@jxsuite/compiler 6.1.0 → 8.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 bC}from"node:module";var dC=Object.create;var{getPrototypeOf:pC,defineProperty:$g,getOwnPropertyNames:mC}=Object;var vg=Object.prototype.hasOwnProperty;function hC(e){return this[e]}var gC,yC,Bt=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?gC??=new WeakMap:yC??=new WeakMap,s=i.get(e);if(s)return s}r=e!=null?dC(pC(e)):{};let o=t||!e||!e.__esModule||!vg.call(e,"default")?$g(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of mC(e))if(!vg.call(o,a))$g(o,a,{get:hC.bind(e,a),enumerable:!0})}if(n)i.set(e,o);return o};var C=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var L=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var De=bC(import.meta.url);function T(e){return typeof e==="string"}function Ir(e){return typeof e==="number"}function Rt(e){return typeof e==="boolean"}function Ot(e){return typeof e==="function"}function J(e){return typeof e==="object"&&e!==null}function ee(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Je(e){return ee(e)&&typeof e.$ref==="string"}function xr(e){return ee(e)&&e.$prototype==="Function"}function $r(e){return ee(e)&&ee(e.$expression)}function Ni(e){return $r(e)&&Array.isArray(e.parameters)&&e.parameters.length>0}function Zn(e){return xr(e)&&Array.isArray(e.body)}function un(e){return ee(e)&&typeof e.$prototype==="string"&&e.$prototype!=="Function"}function of(e){return ee(e)&&e.timing==="server"&&typeof e.$src==="string"&&typeof e.$export==="string"&&!e.$prototype}function wg(e){return ee(e)&&!e.$prototype&&!e.$expression&&"default"in e}function ei(e){if(!ee(e))return!1;for(let t of Object.keys(e))if(!Sg.has(t))return!1;return!0}function lt(e){return ee(e)&&e.$prototype==="Array"}function af(e){return(Array.isArray(e)?e:[e]).some((r)=>lt(r))}function Eg(e){return ee(e)&&e.$prototype==="Class"}function ir(e){return ee(e)}function he(e){return typeof e==="string"&&e.includes("${")}function Mi(e){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test(e)}function Li(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Rn(e){if(!e)return[];return e.map((t)=>T(t)?t:t.name)}function xC(e){return typeof e==="string"}function fn(e){if(typeof e!=="object"||e===null||Array.isArray(e)||!ee(e.$expression))return!1;let t=e.$expression;if(t.operator==="?:")return typeof t.value==="string"&&typeof t.initial==="string";if(t.operator==="switch")return ee(t.cases)&&Object.values(t.cases).every((r)=>T(r))&&typeof t.default==="string";return!1}function $s(e){if(xC(e))return[e];if(!fn(e))return[];let t=e.$expression;if(t.operator==="?:")return[...new Set([t.value,t.initial])];return[...new Set([...Object.values(t.cases),t.default])]}var Sg;var Ee=L(()=>{Sg=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function Pg(e){let t=[],r=[],n=null,i=0,s=()=>r.at(-1)?.path??"",o=()=>n===null?s():wC(s(),n),a=()=>{i+=1;let c="";while(i<e.length){let l=e[i];if(l==="\\"){let u=e[i+1]??"";if(u==="u")c+=String.fromCodePoint(Number.parseInt(e.slice(i+2,i+6),16)),i+=6;else c+=$C.get(u)??u,i+=2;continue}if(l==='"')return i+=1,c;c+=l,i+=1}return c};while(i<e.length){let c=e[i];if(_g.has(c)||c===","||c===":"){i+=1;continue}if(c==="{"||c==="["){r.push(c==="{"?{keys:new Set,kind:"object",path:o()}:{kind:"array",path:o()}),n=null,i+=1;continue}if(c==="}"||c==="]"){r.pop(),n=null,i+=1;continue}if(c==='"'){let u=a(),d=r.at(-1);if(d?.kind==="object"&&vC(e,i)===":"){if(d.keys.has(u))t.push({detail:u,kind:"duplicate-key",path:d.path});d.keys.add(u),n=u}else n=null;continue}if(c==="-"||c>="0"&&c<="9"){let u=i;while(i<e.length&&/[\d+.eE-]/.test(e[i]))i+=1;let d=e.slice(u,i);if(!SC(d))t.push({detail:d,kind:"unsafe-number",path:o()});n=null;continue}let l=i;while(i<e.length&&/[A-Za-z]/.test(e[i]))i+=1;if(i===l)i+=1;n=null}return t}function vC(e,t){let r=t;while(r<e.length&&_g.has(e[r]))r+=1;return e[r]??""}function wC(e,t){return e===""?t:`${e}.${t}`}function SC(e){if(/[.eE]/.test(e))return!0;let t=Number(e);if(!Number.isFinite(t))return!1;return String(t)===e.replace(/^\+/,"")}function kg(e){let t=e.path===""?"the document root":`"${e.path}"`;return e.kind==="duplicate-key"?`duplicate key "${e.detail}" in ${t} — JSON.parse keeps the last one and `+"silently discards the first (RFC 7493 §2.3)":`number ${e.detail} in ${t} cannot be represented exactly and will change when `+"the document is written back (RFC 7493 §2.2)"}var _g,$C;var Ag=L(()=>{_g=new Set([" ","\t",`
3
- `,"\r"]);$C=new Map([["b","\b"],["f","\f"],["n",`
4
- `],["r","\r"],["t","\t"]])});function Pe(e){return e instanceof Error?e.message:String(e)}function Rg(e){if(T(e))return jg.test(e)?e.normalize("NFC"):e;if(Array.isArray(e))return e.map((t)=>Rg(t));if(ee(e))return Og(e);return e}function Og(e){let t={};for(let[r,n]of Object.entries(e))t[jg.test(r)?r.normalize("NFC"):r]=Rg(n);return t}function cf(e,t,r){let n;try{n=JSON.parse(e)}catch(s){throw Error(`Failed to parse ${r} at ${t}: ${Pe(s)}`,{cause:s})}if(!ee(n))throw Error(`Invalid ${r} at ${t}: expected a JSON object`);let i=Pg(e);if(i.length>0){let s=i.map((o)=>kg(o)).join("; ");throw Error(`Invalid ${r} at ${t}: ${s}`)}return Og(n)}function ti(e,t){return cf(e,t,"Jx document")}function Cg(e,t){return cf(e,t,"project config")}function Ig(e,t){return cf(e,t,"class definition")}var jg;var vr=L(()=>{Ee();Ag();jg=/[^\p{ASCII}]/u});function EC(e){return JSON.parse(e)}function vs(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function _C(e){return vs(e)&&typeof e.binding==="string"}function PC(e){try{let t=EC(e);return vs(t)?t:void 0}catch{return}}function Tg(e,t){if(t.length===0)return{content:e??"",patched:!1};let r={};if(e){let n=PC(e);if(n===void 0)return{content:e,patched:!1};r=n}for(let n of t)Ng(r,n);return{content:`${JSON.stringify(r,null,"\t")}
5
- `,patched:!0}}function Ng(e,t){for(let[r,n]of Object.entries(t)){let i=r in e?e[r]:void 0;if(Array.isArray(n)){e[r]=kC(Array.isArray(i)?i:[],n);continue}if(vs(n)){if(vs(i))Ng(i,n);else if(i===void 0)e[r]=structuredClone(n);continue}if(i===void 0)e[r]=n}}function kC(e,t){let r=[...e];for(let n of t){if(!_C(n)){if(!r.some((a)=>JSON.stringify(a)===JSON.stringify(n)))r.push(structuredClone(n));continue}let i=r.findIndex((o)=>vs(o)&&o.binding===n.binding),s=r[i];if(vs(s))r[i]={...s,...n};else r.push(structuredClone(n))}return r}var Mg=()=>{};function Fg(e){if(!T(e))return null;let[t,...r]=e.split(";"),n=(t??"").indexOf("/");if(n===-1)return null;let i=(t??"").slice(0,n).trim().toLowerCase(),s=(t??"").slice(n+1).trim().toLowerCase();if(!Lg.test(i)||!Lg.test(s))return null;let o=s.lastIndexOf("+"),a=o===-1?null:s.slice(o+1),c=o===-1?s:s.slice(0,o);if(a==="")return null;let l=c.indexOf("."),u=l===-1?null:c.slice(0,l),d=u!==null&&AC.has(u)?u:null,h=d===null?c:c.slice(d.length+1);if(h==="")return null;let m={};for(let y of r){let g=y.indexOf("=");if(g===-1)return null;let b=y.slice(0,g).trim().toLowerCase(),x=y.slice(g+1).trim();if(b==="")return null;if(x.startsWith('"')&&x.endsWith('"')&&x.length>=2)x=x.slice(1,-1);m[b]=x}return{parameters:m,subtype:h,suffix:a,tree:d,type:i}}function qg(e){if(!T(e)||e.trim()==="")return"expected a media type string";if(!e.includes("/"))return`"${e}" has no "/" — a media type is type/subtype (RFC 6838 §4.2)`;if(Fg(e)===null)return`"${e}" is not a well-formed media type (RFC 6838 §4.2)`;return null}function Bg(e){let t=Fg(e);if(t===null)return null;let r=t.tree===null?"":`${t.tree}.`,n=t.suffix===null?"":`+${t.suffix}`;return`${t.type}/${r}${t.subtype}${n}`}var Lg,AC,Dg="text/markdown; variant=GFM",Jg="application/yaml",Hg;var lf=L(()=>{Ee();Lg=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}$/,AC=new Set(["vnd","prs","x"]);Hg={".markdown":`${Dg}; charset=utf-8`,".md":`${Dg}; charset=utf-8`,".yaml":`${Jg}; charset=utf-8`,".yml":`${Jg}; charset=utf-8`}});function zg(e){if(e===null)throw TypeError("A class descriptor cannot be null");return ee(e)?e:{}}class wc{name;classPath;classDef;extensions;mediaType;mediaTypeEssence;documentKinds;exportTarget;remote;studio;project;server;connector;capabilities;#t;#e=null;constructor(e,t,r,n){this.name=e,this.classPath=t,this.classDef=r,this.#t=n;let{format:i}=r;this.extensions=(i?.extensions??[]).map((s)=>s.toLowerCase()),this.mediaType=i?.mediaType??null,this.mediaTypeEssence=Bg(this.mediaType),this.documentKinds=i?.documentKinds??[],this.exportTarget=i?.exportTarget===!0,this.remote=i?.remote===!0,this.studio=r.$studio??null,this.project=r.project??null,this.server=r.server??null,this.connector=r.connector??null,this.capabilities=RC(r)}implementation(){if(!this.#e){let e=this.classDef.$implementation;if(!e)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#e=this.#t.importModule(this.#t.resolvePath(this.classPath,e))}return this.#e}async implementationExport(){return this.#r(await this.implementation())}#r(e){let t=this.classDef.title??this.name;return e[t]??e.default?.[t]??e.default}async call(e,...t){let r=this.capabilities[e];if(!r)throw Error(`Format class "${this.name}" does not declare a "${e}" capability`);let n=this.#r(await this.implementation()),i=n?.[r.identifier];if(!Ot(i)){let o=this.classDef.title??this.name;throw TypeError(`Format class "${this.name}": implementation export "${o}" has no static "${r.identifier}" method`)}return await i.call(n,...t)}async parseDocument(e,t){return await this.call("parse",e,t)}}class Sc{#t;constructor(e){this.#t=e;for(let t of e){if(t.mediaType===null)continue;let r=qg(t.mediaType);if(r!==null)throw Error(`Format "${t.name}" declares an invalid mediaType: ${r}`)}for(let t of Vg){let r=new Map;for(let n of e){if(!n.capabilities[t])continue;for(let i of n.extensions){let s=r.get(i);if(s)throw Error(`Format conflict: "${s.name}" and "${n.name}" both claim "${i}" with the "${t}" capability`);r.set(i,n)}}}}get entries(){return this.#t}byExtension(e,t){let r=Ug(e);return this.#t.find((n)=>n.extensions.includes(r)&&(!t||n.capabilities[t]))}byName(e){return this.#t.find((t)=>t.name===e)}withCapability(e){return this.#t.filter((t)=>t.capabilities[e])}documentExtensions(e){let t=new Set;for(let r of this.#t){if(e&&!r.documentKinds.includes(e))continue;for(let n of r.extensions)t.add(n)}return t.delete(".json"),[...t]}has(e){let t=Ug(e);return this.#t.some((r)=>r.extensions.includes(t))}}function RC(e){let t={},r=e.$defs?.methods??{};for(let[n,i]of Object.entries(r)){let{role:s}=i;if(!CC(s))continue;let o={identifier:i.identifier??n,timing:i.timing??jC};if(T(i.discriminator))o.discriminator=i.discriminator;t[s]=o}return t}function CC(e){return e!==void 0&&OC.has(e)}function Ug(e){let t=e.toLowerCase();return t.startsWith(".")?t:`.${t}`}var Vg,Wg,jC,OC;var uf=L(()=>{Ee();lf();Vg=["parse","serialize","rewrite","discover","load"],Wg=[...Vg,"projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"];jC=["compiler","server"];OC=new Set(Wg)});class Kg{#t;#e;#r;constructor(e){this.#t=e,this.#e=e.flatMap((i)=>i.classes);let t=new Map;for(let i of e)for(let s of i.classes){let o=t.get(s.name);if(o&&o!==i.specifier)throw Error(`Extension conflict: "${o}" and "${i.specifier}" both provide a class named "${s.name}"`);t.set(s.name,i.specifier)}let r=new Map;for(let i of this.#e){if(!i.project)continue;let s=r.get(i.project.key);if(s)throw Error(`Extension conflict: "${s.name}" and "${i.name}" both claim the project section "${i.project.key}"`);r.set(i.project.key,i)}let n=new Map;for(let i of this.#e){if(!i.server)continue;let{basePath:s}=i.server;if(!s.startsWith("/_jx/"))throw Error(`Extension "${i.name}": server basePath "${s}" must be under /_jx/`);let o=n.get(s);if(o)throw Error(`Extension conflict: "${o.name}" and "${i.name}" both mount "${s}"`);n.set(s,i)}this.#r=new Sc(this.#e.filter((i)=>i.extensions.length>0))}get extensions(){return this.#t}get classes(){return this.#e}get formats(){return this.#r}byName(e){return this.#e.find((t)=>t.name===e)}projectContributions(){return this.#e.filter((e)=>e.project!==null)}byProjectKey(e){return this.#e.find((t)=>t.project?.key===e)}byPathsDiscriminator(e){return this.#e.find((t)=>t.capabilities.resolvePaths?.discriminator===e)}emitters(){return this.#e.filter((e)=>e.capabilities.emit!==void 0)}headProviders(){return this.#e.filter((e)=>e.capabilities.head!==void 0)}assetProviders(){return this.#e.filter((e)=>e.capabilities.assets!==void 0)}serverMounts(){return this.#e.filter((e)=>e.server!==null).toSorted((e,t)=>(e.server?.order??100)-(t.server?.order??100)||e.name.localeCompare(t.name))}connectors(){return this.#e.filter((e)=>e.connector!==null)}schemaFragments(e){return this.#t.map((t)=>t.schemas[e]).filter((t)=>typeof t==="string")}}async function Gg(e,t,r){let n=[];for(let i of e??[])n.push(await IC(i,t,r));return new Kg(n)}async function IC(e,t,r){let n;if(e.startsWith("./")||e.startsWith("../")){let c=t.resolvePath(r,e);n=t.resolvePath(`${c}/package.json`,`./${qo}`)}else try{n=t.resolvePath(r,`${e}/${qo}`)}catch(c){throw Error(`Extension "${e}" is not resolvable: it must export ${qo} (is the package installed, and does its exports map include it?): ${ff(c)}`,{cause:c})}let i;try{i=await t.loadJson(n)}catch(c){throw Error(`Extension "${e}": cannot read manifest ${n}: ${ff(c)}`,{cause:c})}if(!ee(i)||!T(i.name))throw Error(`Extension "${e}": ${qo} must declare a "name"`);let s=i;if(!e.startsWith(".")&&s.name!==e)throw Error(`Extension "${e}": manifest name "${s.name}" does not match the specifier`);let o=[];for(let[c,l]of Object.entries(s.classes??{})){let u=t.resolvePath(n,l),d;try{d=await t.loadJson(u)}catch(h){throw Error(`Extension "${e}": cannot read class "${c}" at ${u}: ${ff(h)}`,{cause:h})}o.push(new wc(c,u,zg(d),t))}let a={};if(s.schemas?.project)a.project=t.resolvePath(n,s.schemas.project);if(s.schemas?.document)a.document=t.resolvePath(n,s.schemas.document);if(s.schemas?.fields)a.fields=t.resolvePath(n,s.schemas.fields);return{specifier:e,manifestPath:n,manifest:s,classes:o,schemas:a}}function ff(e){return e instanceof Error?e.message:String(e)}var qo="jx-extension.json";var Yg=L(()=>{uf();Ee();uf()});import{readFileSync as TC}from"node:fs";import{dirname as NC,isAbsolute as MC,resolve as df,sep as Ec}from"node:path";import{pathToFileURL as LC}from"node:url";import{createRequire as Xg}from"node:module";async function pf(e){let t=[e],r=`${Ec}src${Ec}`,n=`${Ec}dist${Ec}`;if(e.includes(r)){let s=e.replace(r,n);if(t.push(s),s.endsWith(".ts"))t.push(`${s.slice(0,-3)}.js`)}if(e.endsWith(".js"))t.push(`${e.slice(0,-3)}.ts`);let i;for(let s of t)try{return await import(LC(s).href)}catch(o){i=o}throw i instanceof Error?i:Error(String(i))}function mf(e){return{importModule:(t)=>pf(t),loadJson:async(t)=>JSON.parse(TC(t,"utf8")),resolvePath:(t,r)=>{if(r.startsWith("./")||r.startsWith("../"))return df(NC(t),r);if(MC(r))return r;let n=Xg(df(e,"package.json"));try{return n.resolve(r)}catch{return Xg(import.meta.url).resolve(r)}}}}async function ri(e,t){return Gg(t?.extensions,mf(e),df(e,"project.json"))}function _c(e,t){return Error(`No format class registered for "${t}" (${e}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`)}var On=L(()=>{Yg();Ee()});import{existsSync as DC,readFileSync as JC}from"node:fs";import{resolve as Qg}from"node:path";function ni(e){let t=Qg(e,"project.json");if(!DC(t))throw Error(`project.json not found in ${e}`);let r;try{r=Cg(JC(t,"utf8"),t)}catch(o){throw Error(`Invalid project.json: ${Pe(o)}`,{cause:o})}let n={...Bo,...r,build:{...Bo.build,...r.build},defaults:{...Bo.defaults,...r.defaults},images:{...Bo.images,...r.images},url:r.url??Bo.url};if(r.$head)n.$head=r.$head;if(r.$media)n.$media=r.$media;if(r.style)n.style=r.style;if(r.state)n.state=r.state;if(r.redirects)n.redirects=r.redirects;if(r.imports)n.imports=r.imports;let i=["cloudflare-workers","cloudflare-pages","node","bun"];if(n.build.adapter==="static")delete n.build.adapter;if(n.build.adapter&&!i.includes(n.build.adapter))throw Error(`Unknown build adapter "${n.build.adapter}" in project.json. Valid adapters: ${i.join(", ")}`);let s=["build","cloudflare"];if(!s.includes(n.images.service))throw Error(`Unknown images.service "${n.images.service}" in project.json. Valid services: ${s.join(", ")}`);return{config:n,configPath:t,projectRoot:Qg(e)}}var Bo;var Ho=L(()=>{vr();Bo={$head:[],$media:{},build:{format:"directory",outDir:"./dist",provider:null,trailingSlash:"always"},defaults:{charset:"utf8",lang:"en",layout:null},images:{formats:["webp","avif"],lazyLoad:!0,optimize:!0,picture:!0,quality:{avif:65,jpeg:80,png:80,webp:80},service:"build",sizes:"(max-width: 768px) 100vw, 50vw",widths:[320,640,960,1280,1920]},imports:{},name:"Jx Site",redirects:{},state:{},style:{},url:""}});import{existsSync as hf,readFileSync as Zg,writeFileSync as FC}from"node:fs";import{resolve as ey}from"node:path";async function ty(e,t={}){let{dryRun:r=!1,connection:n}=t,{config:i}=ni(e),s=await ri(e,i),o=ee(i.connections)?i.connections:{},a=ee(i.data)?i.data:{},c=Object.keys(o).filter((y)=>!n||y===n);if(n&&c.length===0)throw Error(`Unknown connection "${n}" (no such connections entry in project.json)`);if(c.length===0)throw Error('project.json has no "connections" section — nothing to push. Declare a connection and '+'its tables in the "data" section first.');let l={...process.env,...BC(e),JX_PROJECT_ROOT:e},u=[],d=[];for(let y of c){let g=o[y],b=ee(g)?{...g,$name:y}:{$name:y},x=String(b.provider??""),_=qC(s.connectors(),x);if(!_)throw Error(`Connection "${y}" names provider "${x}", but no enabled extension provides it (enable the extension in project.json "extensions")`);let P={};for(let[w,k]of Object.entries(a))if(ee(k)&&k.connection===y)P[w]=k;let E=await _.call("deploySchema",P,b,{dryRun:r,env:l});if(u.push({applied:E.applied??!r,connection:y,provider:x,statements:E.statements??[],tables:Object.keys(P),warnings:E.warnings??[]}),_.capabilities.bindings){let w=await _.call("bindings",b);if(ee(w)&&Object.keys(w).length>0)d.push(w)}}let h=ey(e,"wrangler.jsonc"),m=!1;if(!r&&d.length>0&&hf(h)){let y=Zg(h,"utf8"),{content:g,patched:b}=Tg(y,d);if(b&&g!==y)FC(h,g,"utf8"),m=!0}return{bindingsPatched:m,results:u,wranglerPath:hf(h)?h:null}}function qC(e,t){return e.find((r)=>r.connector?.provider===t)}function BC(e){let t=ey(e,".dev.vars");if(!hf(t))return{};let r=new Map;for(let n of Zg(t,"utf8").split(`
6
- `)){let i=n.trim();if(i===""||i.startsWith("#"))continue;let s=i.indexOf("=");if(s===-1)continue;let o=i.slice(0,s).trim(),a=i.slice(s+1).trim();if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))a=a.slice(1,-1);if(o!=="")r.set(o,a)}return Object.fromEntries(r)}var ry=L(()=>{Mg();On();Ho();Ee()});function Di(e){return e.startsWith(Pc)}function ny(e){let t=e;if(Di(t))t=t.slice(Pc.length);return t=t.replace(/^\.\//,"").replace(/\.(js|ts|mjs|mts)$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,""),`${gf}${t}.js`}function iy(e){let t=/\.(\w+)$/.exec(e)?.[1]??"",r=e.replace(/\.\w+$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"");return t===""?`${gf}${r}`:`${gf}${r}.${t}`}function sy(e){let t=e.replaceAll("\\","/");return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function kc(e){let t=sy(e);return t.startsWith("/")?t:`/${t}`}function HC(e,t){return[...e].toSorted((r,n)=>n[t].length-r[t].length)}function Ac(e,t){let r=t.split("#")[0].split("?")[0];if(!r.startsWith("/"))return null;let n;try{n=decodeURIComponent(r)}catch{return null}if(/%2e|%2f/i.test(n))return null;for(let i of HC(e,"urlPrefix")){let s=kc(i.urlPrefix);if(!n.startsWith(`${s}/`))continue;let a=n.slice(s.length+1).split("/");if(a.some((l)=>l===""||l==="."||l===".."))return null;let{filter:c}=i;if(c&&!c(a.join("/")))return null;return`${sy(i.dir)}/${a.join("/")}`}return null}function oy(e,t){let r=new Set;for(let n of t){let i=kc(n.urlPrefix),s=new RegExp(`${i.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}/[^${UC}]+`,"g");for(let o of e.matchAll(s)){let a=o[0].split("#")[0].split("?")[0];if(!a.endsWith("/"))r.add(a)}}return[...r].filter(Boolean)}function yf(e){let t=[],r=0;while(r<e.length){while(r<e.length&&(/\s/.test(e[r])||e[r]===","))r+=1;if(r>=e.length)break;let n=r;while(r<e.length&&!/\s/.test(e[r]))r+=1;let i=e.slice(n,r);if(i.endsWith(",")){t.push({descriptor:"",url:i.replace(/,+$/,"")});continue}while(r<e.length&&/\s/.test(e[r]))r+=1;let s=r;while(r<e.length&&e[r]!==",")r+=1;let o=e.slice(s,r).trim();if(r+=1,i=i.replace(/,+$/,""),i!=="")t.push({descriptor:o,url:i})}return t}function bf(e){return e.map(({url:t,descriptor:r})=>r?`${t} ${r}`:t).join(", ")}function Ji(e){if(!T(e)||e==="")return"";let t;try{({pathname:t}=new URL(e))}catch{return""}let r=t.replace(/\/+$/,"");if(r===""||r==="/")return"";return r.startsWith("/")?r:`/${r}`}function ze(e,t){if(e===""||!t.startsWith("/")||t.startsWith("//"))return t;if(t===e||t.startsWith(`${e}/`))return t;return e+t}function ii(e,t){let r=new URL(t);if(!r.pathname.endsWith("/"))r.pathname+="/";return new URL(e.replace(/^\/+/,""),r).href}var Pc="npm:",gf="/assets/",UC;var wr=L(()=>{Ee();UC=String.raw`"'\s<>()\\`});function ay(e,t){return e.replaceAll(GC,(r,n,i)=>{let s=i.trim(),o=eI.exec(s),a=o?o[2]:s,c=ze(t,a);if(c===a)return r;return`url(${n}${o?`${o[1]}${c}${o[1]}`:c}${n})`})}function tI(e,t,r,n,i){let s=r.toLowerCase();if(VC.has(s))return ze(i,n);if(WC.has(s)){let o=yf(n);return o.length===0?n:bf(o.map((a)=>({descriptor:a.descriptor,url:ze(i,a.url)})))}if(s==="style")return ay(n,i);if(s==="content"&&e==="meta"&&ZC.test(t))return ze(i,n);return n}function cy(e,t){if(t==="")return e;let r=e.replaceAll(XC,(n,i,s,o)=>{let a=s.replaceAll(YC,(c,l)=>`"${ze(t,l)}"`);return i+a+o});return r=r.replaceAll(QC,(n,i,s,o)=>i+ay(s,t)+o),r.replaceAll(zC,(n,i,s)=>{if(s==="")return n;let o=i.toLowerCase(),a=s.replaceAll(KC,(c,l,u,d,h)=>{let m=d===void 0?"'":'"',y=d??h??"",g=tI(o,s,l,y,t);return g===y?c:`${l}=${m}${g}${m}`});return a===s?n:`<${i}${a}>`})}var VC,WC,zC,KC,GC,YC,XC,QC,ZC,eI;var ly=L(()=>{wr();VC=new Set(["href","src","poster","action","formaction","data"]),WC=new Set(["srcset","imagesrcset"]),zC=/<([a-zA-Z][a-zA-Z0-9-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,KC=/([a-zA-Z_:][\w:.-]*)\s*=\s*("([^"]*)"|'([^']*)')/g,GC=/url\(\s*(['"]?)([^'")]+)\1\s*\)/g,YC=/"(\/[^"/][^"]*)"/g,XC=/(<script\b[^>]*\btype\s*=\s*["']importmap["'][^>]*>)([\s\S]*?)(<\/script>)/gi,QC=/(<style\b[^>]*>)([\s\S]*?)(<\/style>)/gi,ZC=/\b(?:property|name)\s*=\s*["'](?:og:|twitter:)[\w:.-]*(?:image|url|video|audio|player)[\w:.-]*["']/i,eI=/^(&quot;|&#34;|&apos;|&#39;)([\s\S]*)\1$/});var Go=C(function(BX,Ty){var __dirname="/home/runner/work/jx/jx/node_modules/esbuild/lib",__filename="/home/runner/work/jx/jx/node_modules/esbuild/lib/main.js",{defineProperty:Sf,getOwnPropertyDescriptor:rI,getOwnPropertyNames:nI}=Object,iI=Object.prototype.hasOwnProperty,sI=(e,t)=>{for(var r in t)Sf(e,r,{get:t[r],enumerable:!0})},oI=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of nI(t))if(!iI.call(e,i)&&i!==r)Sf(e,i,{get:()=>t[i],enumerable:!(n=rI(t,i))||n.enumerable})}return e},aI=(e)=>oI(Sf({},"__esModule",{value:!0}),e),zo={};sI(zo,{analyzeMetafile:()=>DI,analyzeMetafileSync:()=>BI,build:()=>TI,buildSync:()=>JI,context:()=>NI,default:()=>WI,formatMessages:()=>LI,formatMessagesSync:()=>qI,initialize:()=>UI,stop:()=>HI,transform:()=>MI,transformSync:()=>FI,version:()=>II});Ty.exports=aI(zo);function uy(e){let t=(n)=>{if(n===null)r.write8(0);else if(typeof n==="boolean")r.write8(1),r.write8(+n);else if(typeof n==="number")r.write8(2),r.write32(n|0);else if(typeof n==="string")r.write8(3),r.write(Ur(n));else if(n instanceof Uint8Array)r.write8(4),r.write(n);else if(n instanceof Array){r.write8(5),r.write32(n.length);for(let i of n)t(i)}else{let i=Object.keys(n);r.write8(6),r.write32(i.length);for(let s of i)r.write(Ur(s)),t(n[s])}},r=new $y;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),$f(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function cI(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return Ui(r.read());case 4:return r.read();case 5:{let o=r.read32(),a=[];for(let c=0;c<o;c++)a.push(t());return a}case 6:{let o=r.read32(),a={};for(let c=0;c<o;c++)a[Ui(r.read())]=t();return a}default:throw Error("Invalid packet")}},r=new $y(e),n=r.read32(),i=(n&1)===0;n>>>=1;let s=t();if(r.ptr!==e.length)throw Error("Invalid packet");return{id:n,isRequest:i,value:s}}var $y=class{constructor(e=new Uint8Array(1024)){this.buf=e,this.len=0,this.ptr=0}_write(e){if(this.len+e>this.buf.length){let t=new Uint8Array((this.len+e)*2);t.set(this.buf),this.buf=t}return this.len+=e,this.len-e}write8(e){let t=this._write(1);this.buf[t]=e}write32(e){let t=this._write(4);$f(this.buf,e,t)}write(e){let t=this._write(4+e.length);$f(this.buf,e.length,t),this.buf.set(e,t+4)}_read(e){if(this.ptr+e>this.buf.length)throw Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return vy(this.buf,this._read(4))}read(){let e=this.read32(),t=new Uint8Array(e),r=this._read(t.length);return t.set(this.buf.subarray(r,r+e)),t}},Ur,Ui,xf;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let e=new TextEncoder,t=new TextDecoder;Ur=(r)=>e.encode(r),Ui=(r)=>t.decode(r),xf='new TextEncoder().encode("")'}else if(typeof Buffer<"u")Ur=(e)=>Buffer.from(e),Ui=(e)=>{let{buffer:t,byteOffset:r,byteLength:n}=e;return Buffer.from(t,r,n).toString()},xf='Buffer.from("")';else throw Error("No UTF-8 codec found");if(!(Ur("")instanceof Uint8Array))throw Error(`Invariant violation: "${xf} instanceof Uint8Array" is incorrectly false
2
+ import{createRequire as Xj}from"node:module";var Wj=Object.create;var{getPrototypeOf:Uj,defineProperty:Bp,getOwnPropertyNames:zj}=Object;var Wp=Object.prototype.hasOwnProperty;function Gj(e){return this[e]}var Kj,Yj,Lt=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var s=t?Kj??=new WeakMap:Yj??=new WeakMap,i=s.get(e);if(i)return i}r=e!=null?Wj(Uj(e)):{};let o=t||!e||!e.__esModule||!Wp.call(e,"default")?Bp(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of zj(e))if(!Wp.call(o,a))Bp(o,a,{get:Gj.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 Ne=Xj(import.meta.url);function T(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 ns(e){return tr(e)&&Array.isArray(e.parameters)&&e.parameters.length>0}function _n(e){return er(e)&&Array.isArray(e.body)}function Cr(e){return ee(e)&&typeof e.$prototype==="string"&&e.$prototype!=="Function"}function tn(e){return ee(e)&&e.timing==="server"&&typeof e.$src==="string"&&typeof e.$export==="string"&&!e.$prototype}function Up(e){return ee(e)&&!e.$prototype&&!e.$expression&&"default"in e}function Pn(e){if(!ee(e))return!1;for(let t of Object.keys(e))if(!zp.has(t))return!1;return!0}function Qe(e){return ee(e)&&e.$prototype==="Array"}function _c(e){return(Array.isArray(e)?e:[e]).some((r)=>Qe(r))}function Gp(e){return ee(e)&&e.$prototype==="Class"}function Ft(e){return ee(e)}function pe(e){return typeof e==="string"&&e.includes("${")}function ss(e){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test(e)}function is(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 Zj(e){return typeof e==="string"}function Nr(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 Ms(e){if(Zj(e))return[e];if(!Nr(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 zp;var ve=q(()=>{zp=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function Yp(e){let t=[],r=[],n=null,s=0,i=()=>r.at(-1)?.path??"",o=()=>n===null?i():tk(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+=Qj.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(Kp.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"&&ek(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(!rk(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 ek(e,t){let r=t;while(r<e.length&&Kp.has(e[r]))r+=1;return e[r]??""}function tk(e,t){return e===""?t:`${e}.${t}`}function rk(e){if(/[.eE]/.test(e))return!0;let t=Number(e);if(!Number.isFinite(t))return!1;return String(t)===e.replace(/^\+/,"")}function Xp(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 Kp,Qj;var Zp=q(()=>{Kp=new Set([" ","\t",`
3
+ `,"\r"]);Qj=new Map([["b","\b"],["f","\f"],["n",`
4
+ `],["r","\r"],["t","\t"]])});function Ee(e){return e instanceof Error?e.message:String(e)}function em(e){if(T(e))return Qp.test(e)?e.normalize("NFC"):e;if(Array.isArray(e))return e.map((t)=>em(t));if(ee(e))return tm(e);return e}function tm(e){let t={};for(let[r,n]of Object.entries(e))t[Qp.test(r)?r.normalize("NFC"):r]=em(n);return t}function Pc(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=Yp(e);if(s.length>0){let i=s.map((o)=>Xp(o)).join("; ");throw Error(`Invalid ${r} at ${t}: ${i}`)}return tm(n)}function jn(e,t){return Pc(e,t,"Jx document")}function rm(e,t){return Pc(e,t,"project config")}function nm(e,t){return Pc(e,t,"class definition")}var Qp;var rr=q(()=>{ve();Zp();Qp=/[^\p{ASCII}]/u});function nk(e){return JSON.parse(e)}function Js(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function sk(e){return Js(e)&&typeof e.binding==="string"}function ik(e){try{let t=nk(e);return Js(t)?t:void 0}catch{return}}function sm(e,t){if(t.length===0)return{content:e??"",patched:!1};let r={};if(e){let n=ik(e);if(n===void 0)return{content:e,patched:!1};r=n}for(let n of t)im(r,n);return{content:`${JSON.stringify(r,null,"\t")}
5
+ `,patched:!0}}function im(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]=ok(Array.isArray(s)?s:[],n);continue}if(Js(n)){if(Js(s))im(s,n);else if(s===void 0)e[r]=structuredClone(n);continue}if(s===void 0)e[r]=n}}function ok(e,t){let r=[...e];for(let n of t){if(!sk(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 om=()=>{};function um(e){if(!T(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(!am.test(s)||!am.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&&ak.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 dm(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(um(e)===null)return`"${e}" is not a well-formed media type (RFC 6838 §4.2)`;return null}function fm(e){let t=um(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 am,ak,lm="text/markdown; variant=GFM",cm="application/yaml",pm;var jc=q(()=>{ve();am=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}$/,ak=new Set(["vnd","prs","x"]);pm={".markdown":`${lm}; charset=utf-8`,".md":`${lm}; charset=utf-8`,".yaml":`${cm}; charset=utf-8`,".yml":`${cm}; charset=utf-8`}});function ym(e){if(e===null)throw TypeError("A class descriptor cannot be null");return ee(e)?e:{}}class oa{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=fm(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=ck(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 aa{#t;constructor(e){this.#t=e;for(let t of e){if(t.mediaType===null)continue;let r=dm(t.mediaType);if(r!==null)throw Error(`Format "${t.name}" declares an invalid mediaType: ${r}`)}for(let t of hm){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=mm(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=mm(e);return this.#t.some((r)=>r.extensions.includes(t))}}function ck(e){let t={},r=e.$defs?.methods??{};for(let[n,s]of Object.entries(r)){let{role:i}=s;if(!dk(i))continue;let o={identifier:s.identifier??n,timing:s.timing??lk};if(T(s.discriminator))o.discriminator=s.discriminator;t[i]=o}return t}function dk(e){return e!==void 0&&uk.has(e)}function mm(e){let t=e.toLowerCase();return t.startsWith(".")?t:`.${t}`}var hm,gm,lk,uk;var kc=q(()=>{ve();jc();hm=["parse","serialize","rewrite","discover","load"],gm=[...hm,"projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"];lk=["compiler","server"];uk=new Set(gm)});class bm{#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 aa(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 xm(e,t,r){let n=[];for(let s of e??[])n.push(await fk(s,t,r));return new bm(n)}async function fk(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?): ${Rc(l)}`,{cause:l})}let s;try{s=await t.loadJson(n)}catch(l){throw Error(`Extension "${e}": cannot read manifest ${n}: ${Rc(l)}`,{cause:l})}if(!ee(s)||!T(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}: ${Rc(h)}`,{cause:h})}o.push(new oa(l,d,ym(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 Rc(e){return e instanceof Error?e.message:String(e)}var Fi="jx-extension.json";var $m=q(()=>{kc();ve();kc()});import{readFileSync as pk}from"node:fs";import{dirname as mk,isAbsolute as hk,resolve as Ac,sep as la}from"node:path";import{pathToFileURL as gk}from"node:url";import{createRequire as yk}from"node:module";async function Oc(e){let t=[e],r=`${la}src${la}`,n=`${la}dist${la}`;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(gk(i).href)}catch(o){s=o}throw s instanceof Error?s:Error(String(s))}function Cc(e,t){return yk(Ac(e,"package.json")).resolve(t)}function Nc(e){return{importModule:(t)=>Oc(t),loadJson:async(t)=>JSON.parse(pk(t,"utf8")),resolvePath:(t,r)=>{if(r.startsWith("./")||r.startsWith("../"))return Ac(mk(t),r);if(hk(r))return r;return Cc(e,r)}}}async function kn(e,t){return xm(t?.extensions,Nc(e),Ac(e,"project.json"))}function ca(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 nn=q(()=>{$m();ve()});import{existsSync as bk,readFileSync as xk}from"node:fs";import{resolve as vm}from"node:path";function Rn(e){let t=vm(e,"project.json");if(!bk(t))throw Error(`project.json not found in ${e}`);let r;try{r=rm(xk(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:vm(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 Tc,readFileSync as wm,writeFileSync as $k}from"node:fs";import{resolve as Sm}from"node:path";async function Em(e,t={}){let{dryRun:r=!1,connection:n}=t,{config:s}=Rn(e),i=await kn(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,...wk(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=vk(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=Sm(e,"wrangler.jsonc"),m=!1;if(!r&&p.length>0&&Tc(h)){let b=wm(h,"utf8"),{content:g,patched:y}=sm(b,p);if(y&&g!==b)$k(h,g,"utf8"),m=!0}return{bindingsPatched:m,results:d,wranglerPath:Tc(h)?h:null}}function vk(e,t){return e.find((r)=>r.connector?.provider===t)}function wk(e){let t=Sm(e,".dev.vars");if(!Tc(t))return{};let r=new Map;for(let n of wm(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 _m=q(()=>{om();nn();Hi();ve()});function os(e){return e.startsWith(ua)}function Pm(e){let t=e;if(os(t))t=t.slice(ua.length);return t=t.replace(/^\.\//,"").replace(/\.(js|ts|mjs|mts)$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,""),`${Ic}${t}.js`}function jm(e){let t=/\.(\w+)$/.exec(e)?.[1]??"",r=e.replace(/\.\w+$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"");return t===""?`${Ic}${r}`:`${Ic}${r}.${t}`}function km(e){let t=e.replaceAll("\\","/");return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function da(e){let t=km(e);return t.startsWith("/")?t:`/${t}`}function Sk(e,t){return[...e].toSorted((r,n)=>n[t].length-r[t].length)}function fa(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 Sk(e,"urlPrefix")){let i=da(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`${km(s.dir)}/${a.join("/")}`}return null}function Rm(e,t){let r=new Set;for(let n of t){let s=da(n.urlPrefix),i=new RegExp(`${s.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}/[^${Ek}]+`,"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 Mc(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 Jc(e){return e.map(({url:t,descriptor:r})=>r?`${t} ${r}`:t).join(", ")}function as(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 Ie(e,t){if(e===""||!t.startsWith("/")||t.startsWith("//"))return t;if(t===e||t.startsWith(`${e}/`))return t;return e+t}function An(e,t){let r=new URL(t);if(!r.pathname.endsWith("/"))r.pathname+="/";return new URL(e.replace(/^\/+/,""),r).href}var ua="npm:",Ic="/assets/",Ek;var nr=q(()=>{ve();Ek=String.raw`"'\s<>()\\`});function Am(e,t){return e.replaceAll(Rk,(r,n,s)=>{let i=s.trim(),o=Tk.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 Ik(e,t,r,n,s){let i=r.toLowerCase();if(_k.has(i))return Ie(s,n);if(Pk.has(i)){let o=Mc(n);return o.length===0?n:Jc(o.map((a)=>({descriptor:a.descriptor,url:Ie(s,a.url)})))}if(i==="style")return Am(n,s);if(i==="content"&&e==="meta"&&Nk.test(t))return Ie(s,n);return n}function Om(e,t){if(t==="")return e;let r=e.replaceAll(Ok,(n,s,i,o)=>{let a=i.replaceAll(Ak,(l,c)=>`"${Ie(t,c)}"`);return s+a+o});return r=r.replaceAll(Ck,(n,s,i,o)=>s+Am(i,t)+o),r.replaceAll(jk,(n,s,i)=>{if(i==="")return n;let o=s.toLowerCase(),a=i.replaceAll(kk,(l,c,d,p,h)=>{let m=p===void 0?"'":'"',b=p??h??"",g=Ik(o,i,c,b,t);return g===b?l:`${c}=${m}${g}${m}`});return a===i?n:`<${s}${a}>`})}var _k,Pk,jk,kk,Rk,Ak,Ok,Ck,Nk,Tk;var Cm=q(()=>{nr();_k=new Set(["href","src","poster","action","formaction","data"]),Pk=new Set(["srcset","imagesrcset"]),jk=/<([a-zA-Z][a-zA-Z0-9-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,kk=/([a-zA-Z_:][\w:.-]*)\s*=\s*("([^"]*)"|'([^']*)')/g,Rk=/url\(\s*(['"]?)([^'")]+)\1\s*\)/g,Ak=/"(\/[^"/][^"]*)"/g,Ok=/(<script\b[^>]*\btype\s*=\s*["']importmap["'][^>]*>)([\s\S]*?)(<\/script>)/gi,Ck=/(<style\b[^>]*>)([\s\S]*?)(<\/style>)/gi,Nk=/\b(?:property|name)\s*=\s*["'](?:og:|twitter:)[\w:.-]*(?:image|url|video|audio|player)[\w:.-]*["']/i,Tk=/^(&quot;|&#34;|&apos;|&#39;)([\s\S]*)\1$/});var Ea=C(function(hz,nh){var __dirname="/home/runner/work/jx/jx/node_modules/esbuild/lib",__filename="/home/runner/work/jx/jx/node_modules/esbuild/lib/main.js",{defineProperty:Hc,getOwnPropertyDescriptor:Mk,getOwnPropertyNames:Jk}=Object,Dk=Object.prototype.hasOwnProperty,Lk=(e,t)=>{for(var r in t)Hc(e,r,{get:t[r],enumerable:!0})},Fk=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let s of Jk(t))if(!Dk.call(e,s)&&s!==r)Hc(e,s,{get:()=>t[s],enumerable:!(n=Mk(t,s))||n.enumerable})}return e},qk=(e)=>Fk(Hc({},"__esModule",{value:!0}),e),Ui={};Lk(Ui,{analyzeMetafile:()=>bR,analyzeMetafileSync:()=>wR,build:()=>mR,buildSync:()=>xR,context:()=>hR,default:()=>PR,formatMessages:()=>yR,formatMessagesSync:()=>vR,initialize:()=>ER,stop:()=>SR,transform:()=>gR,transformSync:()=>$R,version:()=>pR});nh.exports=qk(Ui);function Nm(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 Vm;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),Lc(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function Hk(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return fs(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[fs(r.read())]=t();return a}default:throw Error("Invalid packet")}},r=new Vm(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 Vm=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);Lc(this.buf,e,t)}write(e){let t=this._write(4+e.length);Lc(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 Bm(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,fs,Dc;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let e=new TextEncoder,t=new TextDecoder;$r=(r)=>e.encode(r),fs=(r)=>t.decode(r),Dc='new TextEncoder().encode("")'}else if(typeof Buffer<"u")$r=(e)=>Buffer.from(e),fs=(e)=>{let{buffer:t,byteOffset:r,byteLength:n}=e;return Buffer.from(t,r,n).toString()},Dc='Buffer.from("")';else throw Error("No UTF-8 codec found");if(!($r("")instanceof Uint8Array))throw Error(`Invariant violation: "${Dc} 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 $f(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}var Cn=String.fromCharCode;function Tr(e,t,r){let n=e[t],i=1,s=0;for(let o=0;o<t;o++)if(e[o]===10)i++,s=0;else s++;throw SyntaxError(r?r:t===e.length?"Unexpected end of input while parsing JSON":n>=32&&n<=126?`Unexpected character ${Cn(n)} in JSON at position ${t} (line ${i}, column ${s})`:`Unexpected byte 0x${n.toString(16)} in JSON at position ${t} (line ${i}, column ${s})`)}function lI(e){if(!(e instanceof Uint8Array))throw Error("JSON input must be a Uint8Array");let t=[],r=[],n=[],i=e.length,s=null,o=0,a,c=0;while(c<i){let l=e[c++];if(l<=32)continue;let u;if(o===2&&s===null&&l!==34&&l!==125)Tr(e,--c);switch(l){case 116:{if(e[c++]!==114||e[c++]!==117||e[c++]!==101)Tr(e,--c);u=!0;break}case 102:{if(e[c++]!==97||e[c++]!==108||e[c++]!==115||e[c++]!==101)Tr(e,--c);u=!1;break}case 110:{if(e[c++]!==117||e[c++]!==108||e[c++]!==108)Tr(e,--c);u=null;break}case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:{let d=c;u=Cn(l),l=e[c];while(!0){switch(l){case 43:case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 101:case 69:{u+=Cn(l),l=e[++c];continue}}break}if(u=+u,isNaN(u))Tr(e,--d,"Invalid number");break}case 34:{u="";while(!0){if(c>=i)Tr(e,i);if(l=e[c++],l===34)break;else if(l===92)switch(e[c++]){case 34:u+='"';break;case 47:u+="/";break;case 92:u+="\\";break;case 98:u+="\b";break;case 102:u+="\f";break;case 110:u+=`
12
- `;break;case 114:u+="\r";break;case 116:u+="\t";break;case 117:{let d=0;for(let h=0;h<4;h++)if(l=e[c++],d<<=4,l>=48&&l<=57)d|=l-48;else if(l>=97&&l<=102)d|=l+-87;else if(l>=65&&l<=70)d|=l+-55;else Tr(e,--c);u+=Cn(d);break}default:Tr(e,--c);break}else if(l<=127)u+=Cn(l);else if((l&224)===192)u+=Cn((l&31)<<6|e[c++]&63);else if((l&240)===224)u+=Cn((l&15)<<12|(e[c++]&63)<<6|e[c++]&63);else if((l&248)==240){let d=(l&7)<<18|(e[c++]&63)<<12|(e[c++]&63)<<6|e[c++]&63;if(d>65535)d-=65536,u+=Cn(d>>10&1023|55296),d=56320|d&1023;u+=Cn(d)}}u[0];break}case 91:{u=[],t.push(s),r.push(a),n.push(o),s=null,a=u,o=1;continue}case 123:{u={},t.push(s),r.push(a),n.push(o),s=null,a=u,o=2;continue}case 93:{if(o!==1)Tr(e,--c);u=a,s=t.pop(),a=r.pop(),o=n.pop();break}case 125:{if(o!==2)Tr(e,--c);u=a,s=t.pop(),a=r.pop(),o=n.pop();break}default:Tr(e,--c)}l=e[c];while(l<=32)l=e[++c];switch(o){case 0:{if(c===i)return u;break}case 1:{if(a.push(u),l===44){c++;continue}if(l===93)continue;break}case 2:{if(s===null){if(s=u,l===58){c++;continue}}else{if(a[s]=u,s=null,l===44){c++;continue}if(l===125)continue}break}}break}Tr(e,c)}var yt=JSON.stringify,fy="warning",dy="silent";function Ss(e,t){let r=[];for(let n of e){if(sr(n,t),n.indexOf(",")>=0)throw Error(`Invalid ${t}: ${n}`);r.push(n)}return r.join(",")}var Oc=()=>null,et=(e)=>typeof e==="boolean"?null:"a boolean",re=(e)=>typeof e==="string"?null:"a string",Cc=(e)=>e instanceof RegExp?null:"a RegExp object",qi=(e)=>typeof e==="number"&&e===(e|0)?null:"an integer",uI=(e)=>typeof e==="number"&&e===(e|0)&&e>=0&&e<=65535?null:"a valid port number",wy=(e)=>typeof e==="function"?null:"a function",In=(e)=>Array.isArray(e)?null:"an array",or=(e)=>Array.isArray(e)&&e.every((t)=>typeof t==="string")?null:"an array of strings",Sr=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)?null:"an object",fI=(e)=>typeof e==="object"&&e!==null?null:"an array or an object",dI=(e)=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",py=(e)=>typeof e==="object"&&!Array.isArray(e)?null:"an object or null",Sy=(e)=>typeof e==="string"||typeof e==="boolean"?null:"a string or a boolean",pI=(e)=>typeof e==="string"||typeof e==="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",Ey=(e)=>typeof e==="string"||Array.isArray(e)&&e.every((t)=>typeof t==="string")?null:"a string or an array of strings",_y=(e)=>typeof e==="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",mI=(e)=>typeof e==="string"||e instanceof URL?null:"a string or a URL";function I(e,t,r,n){let i=e[r];if(t[r+""]=!0,i===void 0)return;let s=n(i);if(s!==null)throw Error(`${yt(r)} must be ${s}`);return i}function pt(e,t,r){for(let n in e)if(!(n in t))throw Error(`Invalid option ${r}: ${yt(n)}`)}function hI(e){let t=Object.create(null),r=I(e,t,"wasmURL",mI),n=I(e,t,"wasmModule",dI),i=I(e,t,"worker",et);return pt(e,t,"in initialize() call"),{wasmURL:r,wasmModule:n,worker:i}}function Py(e){let t;if(e!==void 0){t=Object.create(null);for(let r in e){let n=e[r];if(typeof n==="string"||n===!1)t[r]=n;else throw Error(`Expected ${yt(r)} in mangle cache to map to either a string or false`)}}return t}function Lc(e,t,r,n,i){let s=I(t,r,"color",et),o=I(t,r,"logLevel",re),a=I(t,r,"logLimit",qi),c=I(t,r,"logStyle",re);if(s!==void 0)e.push(`--color=${s}`);else if(n)e.push("--color=true");if(e.push(`--log-level=${o||i}`),e.push(`--log-limit=${a||0}`),c)e.push(`--log-style=${c}`)}function sr(e,t,r){if(typeof e!=="string")throw Error(`Expected value for ${t}${r!==void 0?" "+yt(r):""} to be a string, got ${typeof e} instead`);return e}function ky(e,t,r){let n=I(t,r,"legalComments",re),i=I(t,r,"sourceRoot",re),s=I(t,r,"sourcesContent",et),o=I(t,r,"target",Ey),a=I(t,r,"format",re),c=I(t,r,"globalName",re),l=I(t,r,"mangleProps",Cc),u=I(t,r,"reserveProps",Cc),d=I(t,r,"mangleQuoted",et),h=I(t,r,"minify",et),m=I(t,r,"minifySyntax",et),y=I(t,r,"minifyWhitespace",et),g=I(t,r,"minifyIdentifiers",et),b=I(t,r,"lineLimit",qi),x=I(t,r,"drop",or),_=I(t,r,"dropLabels",or),P=I(t,r,"charset",re),E=I(t,r,"treeShaking",et),w=I(t,r,"ignoreAnnotations",et),k=I(t,r,"jsx",re),R=I(t,r,"jsxFactory",re),j=I(t,r,"jsxFragment",re),D=I(t,r,"jsxImportSource",re),F=I(t,r,"jsxDev",et),N=I(t,r,"jsxSideEffects",et),q=I(t,r,"define",Sr),U=I(t,r,"logOverride",Sr),ne=I(t,r,"supported",Sr),ue=I(t,r,"pure",or),ie=I(t,r,"keepNames",et),te=I(t,r,"platform",re),le=I(t,r,"tsconfigRaw",pI),Ce=I(t,r,"absPaths",or);if(n)e.push(`--legal-comments=${n}`);if(i!==void 0)e.push(`--source-root=${i}`);if(s!==void 0)e.push(`--sources-content=${s}`);if(o)e.push(`--target=${Ss(Array.isArray(o)?o:[o],"target")}`);if(a)e.push(`--format=${a}`);if(c)e.push(`--global-name=${c}`);if(te)e.push(`--platform=${te}`);if(le)e.push(`--tsconfig-raw=${typeof le==="string"?le:JSON.stringify(le)}`);if(h)e.push("--minify");if(m)e.push("--minify-syntax");if(y)e.push("--minify-whitespace");if(g)e.push("--minify-identifiers");if(b)e.push(`--line-limit=${b}`);if(P)e.push(`--charset=${P}`);if(E!==void 0)e.push(`--tree-shaking=${E}`);if(w)e.push("--ignore-annotations");if(x)for(let W of x)e.push(`--drop:${sr(W,"drop")}`);if(_)e.push(`--drop-labels=${Ss(_,"drop label")}`);if(Ce)e.push(`--abs-paths=${Ss(Ce,"abs paths")}`);if(l)e.push(`--mangle-props=${Ic(l)}`);if(u)e.push(`--reserve-props=${Ic(u)}`);if(d!==void 0)e.push(`--mangle-quoted=${d}`);if(k)e.push(`--jsx=${k}`);if(R)e.push(`--jsx-factory=${R}`);if(j)e.push(`--jsx-fragment=${j}`);if(D)e.push(`--jsx-import-source=${D}`);if(F)e.push("--jsx-dev");if(N)e.push("--jsx-side-effects");if(q)for(let W in q){if(W.indexOf("=")>=0)throw Error(`Invalid define: ${W}`);e.push(`--define:${W}=${sr(q[W],"define",W)}`)}if(U)for(let W in U){if(W.indexOf("=")>=0)throw Error(`Invalid log override: ${W}`);e.push(`--log-override:${W}=${sr(U[W],"log override",W)}`)}if(ne)for(let W in ne){if(W.indexOf("=")>=0)throw Error(`Invalid supported: ${W}`);let oe=ne[W];if(typeof oe!=="boolean")throw Error(`Expected value for supported ${yt(W)} to be a boolean, got ${typeof oe} instead`);e.push(`--supported:${W}=${oe}`)}if(ue)for(let W of ue)e.push(`--pure:${sr(W,"pure")}`);if(ie)e.push("--keep-names")}function gI(e,t,r,n,i){var s;let o=[],a=[],c=Object.create(null),l=null,u=null;Lc(o,t,c,r,n),ky(o,t,c);let d=I(t,c,"sourcemap",Sy),h=I(t,c,"bundle",et),m=I(t,c,"splitting",et),y=I(t,c,"preserveSymlinks",et),g=I(t,c,"metafile",et),b=I(t,c,"outfile",re),x=I(t,c,"outdir",re),_=I(t,c,"outbase",re),P=I(t,c,"tsconfig",re),E=I(t,c,"resolveExtensions",or),w=I(t,c,"nodePaths",or),k=I(t,c,"mainFields",or),R=I(t,c,"conditions",or),j=I(t,c,"external",or),D=I(t,c,"packages",re),F=I(t,c,"alias",Sr),N=I(t,c,"loader",Sr),q=I(t,c,"outExtension",Sr),U=I(t,c,"publicPath",re),ne=I(t,c,"entryNames",re),ue=I(t,c,"chunkNames",re),ie=I(t,c,"assetNames",re),te=I(t,c,"inject",or),le=I(t,c,"banner",Sr),Ce=I(t,c,"footer",Sr),W=I(t,c,"entryPoints",fI),oe=I(t,c,"absWorkingDir",re),Q=I(t,c,"stdin",Sr),Z=(s=I(t,c,"write",et))!=null?s:i,Ve=I(t,c,"allowOverwrite",et),pe=I(t,c,"mangleCache",Sr);if(c.plugins=!0,pt(t,c,`in ${e}() call`),d)o.push(`--sourcemap${d===!0?"":`=${d}`}`);if(h)o.push("--bundle");if(Ve)o.push("--allow-overwrite");if(m)o.push("--splitting");if(y)o.push("--preserve-symlinks");if(g)o.push("--metafile");if(b)o.push(`--outfile=${b}`);if(x)o.push(`--outdir=${x}`);if(_)o.push(`--outbase=${_}`);if(P)o.push(`--tsconfig=${P}`);if(D)o.push(`--packages=${D}`);if(E)o.push(`--resolve-extensions=${Ss(E,"resolve extension")}`);if(U)o.push(`--public-path=${U}`);if(ne)o.push(`--entry-names=${ne}`);if(ue)o.push(`--chunk-names=${ue}`);if(ie)o.push(`--asset-names=${ie}`);if(k)o.push(`--main-fields=${Ss(k,"main field")}`);if(R)o.push(`--conditions=${Ss(R,"condition")}`);if(j)for(let z of j)o.push(`--external:${sr(z,"external")}`);if(F)for(let z in F){if(z.indexOf("=")>=0)throw Error(`Invalid package name in alias: ${z}`);o.push(`--alias:${z}=${sr(F[z],"alias",z)}`)}if(le)for(let z in le){if(z.indexOf("=")>=0)throw Error(`Invalid banner file type: ${z}`);o.push(`--banner:${z}=${sr(le[z],"banner",z)}`)}if(Ce)for(let z in Ce){if(z.indexOf("=")>=0)throw Error(`Invalid footer file type: ${z}`);o.push(`--footer:${z}=${sr(Ce[z],"footer",z)}`)}if(te)for(let z of te)o.push(`--inject:${sr(z,"inject")}`);if(N)for(let z in N){if(z.indexOf("=")>=0)throw Error(`Invalid loader extension: ${z}`);o.push(`--loader:${z}=${sr(N[z],"loader",z)}`)}if(q)for(let z in q){if(z.indexOf("=")>=0)throw Error(`Invalid out extension: ${z}`);o.push(`--out-extension:${z}=${sr(q[z],"out extension",z)}`)}if(W)if(Array.isArray(W))for(let z=0,dt=W.length;z<dt;z++){let Ze=W[z];if(typeof Ze==="object"&&Ze!==null){let er=Object.create(null),nt=I(Ze,er,"in",re),it=I(Ze,er,"out",re);if(pt(Ze,er,"in entry point at index "+z),nt===void 0)throw Error('Missing property "in" for entry point at index '+z);if(it===void 0)throw Error('Missing property "out" for entry point at index '+z);a.push([it,nt])}else a.push(["",sr(Ze,"entry point at index "+z)])}else for(let z in W)a.push([z,sr(W[z],"entry point",z)]);if(Q){let z=Object.create(null),dt=I(Q,z,"contents",_y),Ze=I(Q,z,"resolveDir",re),er=I(Q,z,"sourcefile",re),nt=I(Q,z,"loader",re);if(pt(Q,z,'in "stdin" object'),er)o.push(`--sourcefile=${er}`);if(nt)o.push(`--loader=${nt}`);if(Ze)u=Ze;if(typeof dt==="string")l=Ur(dt);else if(dt instanceof Uint8Array)l=dt}let Qe=[];if(w)for(let z of w)z+="",Qe.push(z);return{entries:a,flags:o,write:Z,stdinContents:l,stdinResolveDir:u,absWorkingDir:oe,nodePaths:Qe,mangleCache:Py(pe)}}function yI(e,t,r,n){let i=[],s=Object.create(null);Lc(i,t,s,r,n),ky(i,t,s);let o=I(t,s,"sourcemap",Sy),a=I(t,s,"sourcefile",re),c=I(t,s,"loader",re),l=I(t,s,"banner",re),u=I(t,s,"footer",re),d=I(t,s,"mangleCache",Sr);if(pt(t,s,`in ${e}() call`),o)i.push(`--sourcemap=${o===!0?"external":o}`);if(a)i.push(`--sourcefile=${a}`);if(c)i.push(`--loader=${c}`);if(l)i.push(`--banner=${l}`);if(u)i.push(`--footer=${u}`);return{flags:i,mangleCache:Py(d)}}function Ay(e){let t={},r={didClose:!1,reason:""},n={},i=0,s=0,o=new Uint8Array(16384),a=0,c=(P)=>{let E=a+P.length;if(E>o.length){let k=new Uint8Array(E*2);k.set(o),o=k}o.set(P,a),a+=P.length;let w=0;while(w+4<=a){let k=vy(o,w);if(w+4+k>a)break;w+=4,y(o.subarray(w,w+k)),w+=k}if(w>0)o.copyWithin(0,w,a),a-=w},l=(P)=>{if(r.didClose=!0,P)r.reason=": "+(P.message||P);let E="The service was stopped"+r.reason;for(let w in n)n[w](E,null);n={}},u=(P,E,w)=>{if(r.didClose)return w("The service is no longer running"+r.reason,null);let k=i++;if(n[k]=(R,j)=>{try{w(R,j)}finally{if(P)P.unref()}},P)P.ref();e.writeToStdin(uy({id:k,isRequest:!0,value:E}))},d=(P,E)=>{if(r.didClose)throw Error("The service is no longer running"+r.reason);e.writeToStdin(uy({id:P,isRequest:!1,value:E}))},h=async(P,E)=>{try{if(E.command==="ping"){d(P,{});return}if(typeof E.key==="number"){let w=t[E.key];if(!w)return;let k=w[E.command];if(k){await k(P,E);return}}throw Error("Invalid command: "+E.command)}catch(w){let k=[Fi(w,e,null,void 0,"")];try{d(P,{errors:k})}catch{}}},m=!0,y=(P)=>{if(m){m=!1;let w=String.fromCharCode(...P);if(w!=="0.28.2")throw Error(`Cannot start service: Host version "0.28.2" does not match binary version ${yt(w)}`);return}let E=cI(P);if(E.isRequest)h(E.id,E.value);else{let w=n[E.id];if(delete n[E.id],E.value.error)w(E.value.error,{});else w(null,E.value)}};return{readFromStdout:c,afterClose:l,service:{buildOrContext:({callName:P,refs:E,options:w,isTTY:k,defaultWD:R,callback:j})=>{let D=0,F=s++,N={},q={ref(){if(++D===1){if(E)E.ref()}},unref(){if(--D===0){if(delete t[F],E)E.unref()}}};t[F]=N,q.ref(),bI(P,F,u,d,q,e,N,w,k,R,(U,ne)=>{try{j(U,ne)}finally{q.unref()}})},transform:({callName:P,refs:E,input:w,options:k,isTTY:R,fs:j,callback:D})=>{let F=jy(),N=(q)=>{try{if(typeof w!=="string"&&!(w instanceof Uint8Array))throw Error('The input to "transform" must be a string or a Uint8Array');let{flags:U,mangleCache:ne}=yI(P,k,R,dy),ue={command:"transform",flags:U,inputFS:q!==null,input:q!==null?Ur(q):typeof w==="string"?Ur(w):w};if(ne)ue.mangleCache=ne;u(E,ue,(ie,te)=>{if(ie)return D(Error(ie),null);let le=Es(te.errors,F),Ce=Es(te.warnings,F),W=1,oe=()=>{if(--W===0){let Q={warnings:Ce,code:te.code,map:te.map,mangleCache:void 0,legalComments:void 0};if("legalComments"in te)Q.legalComments=te==null?void 0:te.legalComments;if(te.mangleCache)Q.mangleCache=te==null?void 0:te.mangleCache;D(null,Q)}};if(le.length>0)return D(Vo("Transform failed",le,Ce),null);if(te.codeFS)W++,j.readFile(te.code,(Q,Z)=>{if(Q!==null)D(Q,null);else te.code=Z,oe()});if(te.mapFS)W++,j.readFile(te.map,(Q,Z)=>{if(Q!==null)D(Q,null);else te.map=Z,oe()});oe()})}catch(U){let ne=[];try{Lc(ne,k,{},R,dy)}catch{}let ue=Fi(U,e,F,void 0,"");u(E,{command:"error",flags:ne,error:ue},()=>{ue.detail=F.load(ue.detail),D(Vo("Transform failed",[ue],[]),null)})}};if((typeof w==="string"||w instanceof Uint8Array)&&w.length>1048576){let q=N;N=()=>j.writeFile(w,q)}N(null)},formatMessages:({callName:P,refs:E,messages:w,options:k,callback:R})=>{if(!k)throw Error(`Missing second argument in ${P}() call`);let j={},D=I(k,j,"kind",re),F=I(k,j,"color",et),N=I(k,j,"terminalWidth",qi),q=I(k,j,"logStyle",re);if(pt(k,j,`in ${P}() call`),D===void 0)throw Error(`Missing "kind" in ${P}() call`);if(D!=="error"&&D!=="warning")throw Error(`Expected "kind" to be "error" or "warning" in ${P}() call`);let U={command:"format-msgs",messages:Tn(w,"messages",null,"",N),isWarning:D==="warning"};if(F!==void 0)U.color=F;if(N!==void 0)U.terminalWidth=N;if(q!==void 0)U.logStyle=q;u(E,U,(ne,ue)=>{if(ne)return R(Error(ne),null);R(null,ue.messages)})},analyzeMetafile:({callName:P,refs:E,metafile:w,options:k,callback:R})=>{if(k===void 0)k={};let j={},D=I(k,j,"color",et),F=I(k,j,"verbose",et);pt(k,j,`in ${P}() call`);let N={command:"analyze-metafile",metafile:w};if(D!==void 0)N.color=D;if(F!==void 0)N.verbose=F;u(E,N,(q,U)=>{if(q)return R(Error(q),null);R(null,U.result)})}}}}function bI(e,t,r,n,i,s,o,a,c,l,u){let d=jy(),h=e==="context",m=(b,x)=>{let _=[];try{Lc(_,a,{},c,fy)}catch{}let P=Fi(b,s,d,void 0,x);r(i,{command:"error",flags:_,error:P},()=>{P.detail=d.load(P.detail),u(Vo(h?"Context failed":"Build failed",[P],[]),null)})},y;if(typeof a==="object"){let b=a.plugins;if(b!==void 0){if(!Array.isArray(b))return m(Error('"plugins" must be an array'),"");y=b}}if(y&&y.length>0){if(s.isSync)return m(Error("Cannot use plugins in synchronous API calls"),"");xI(t,r,n,i,s,o,a,y,d).then((b)=>{if(!b.ok)return m(b.error,b.pluginName);try{g(b.requestPlugins,b.runOnEndCallbacks,b.scheduleOnDisposeCallbacks)}catch(x){m(x,"")}},(b)=>m(b,""));return}try{g(null,(b,x)=>x([],[]),()=>{})}catch(b){m(b,"")}function g(b,x,_){let P=s.hasFS,{entries:E,flags:w,write:k,stdinContents:R,stdinResolveDir:j,absWorkingDir:D,nodePaths:F,mangleCache:N}=gI(e,a,c,fy,P);if(k&&!s.hasFS)throw Error('The "write" option is unavailable in this environment');let q={command:"build",key:t,entries:E,flags:w,write:k,stdinContents:R,stdinResolveDir:j,absWorkingDir:D||l,nodePaths:F,context:h};if(b)q.plugins=b;if(N)q.mangleCache=N;let U=(ie,te)=>{let le={errors:Es(ie.errors,d),warnings:Es(ie.warnings,d),outputFiles:void 0,metafile:void 0,mangleCache:void 0},Ce=le.errors.slice(),W=le.warnings.slice();if(ie.outputFiles)le.outputFiles=ie.outputFiles.map(vI);if(ie.metafile&&ie.metafile.length)le.metafile=wI(ie.metafile);if(ie.mangleCache)le.mangleCache=ie.mangleCache;if(ie.writeToStdout!==void 0)console.log(Ui(ie.writeToStdout).replace(/\n$/,""));x(le,(oe,Q)=>{if(Ce.length>0||oe.length>0){let Z=Vo("Build failed",Ce.concat(oe),W.concat(Q));return te(Z,null,oe,Q)}te(null,le,oe,Q)})},ne,ue;if(h)o["on-end"]=(ie,te)=>new Promise((le)=>{U(te,(Ce,W,oe,Q)=>{let Z={errors:oe,warnings:Q};if(ue)ue(Ce,W);ne=void 0,ue=void 0,n(ie,Z),le()})});r(i,q,(ie,te)=>{if(ie)return u(Error(ie),null);if(!h)return U(te,(W,oe)=>(_(),u(W,oe)));if(te.errors.length>0)return u(Vo("Context failed",te.errors,te.warnings),null);let le=!1,Ce={rebuild:()=>{if(!ne)ne=new Promise((W,oe)=>{let Q;ue=(Ve,pe)=>{if(!Q)Q=()=>Ve?oe(Ve):W(pe)};let Z=()=>{r(i,{command:"rebuild",key:t},(pe,Qe)=>{if(pe)oe(Error(pe));else if(Q)Q();else Z()})};Z()});return ne},watch:(W={})=>new Promise((oe,Q)=>{if(!s.hasFS)throw Error('Cannot use the "watch" API in this environment');let Z={},Ve=I(W,Z,"delay",qi);pt(W,Z,"in watch() call");let pe={command:"watch",key:t};if(Ve)pe.delay=Ve;r(i,pe,(Qe)=>{if(Qe)Q(Error(Qe));else oe(void 0)})}),serve:(W={})=>new Promise((oe,Q)=>{if(!s.hasFS)throw Error('Cannot use the "serve" API in this environment');let Z={},Ve=I(W,Z,"port",uI),pe=I(W,Z,"host",re),Qe=I(W,Z,"servedir",re),z=I(W,Z,"keyfile",re),dt=I(W,Z,"certfile",re),Ze=I(W,Z,"fallback",re),er=I(W,Z,"cors",Sr),nt=I(W,Z,"onRequest",wy);pt(W,Z,"in serve() call");let it={command:"serve",key:t,onRequest:!!nt};if(Ve!==void 0)it.port=Ve;if(pe!==void 0)it.host=pe;if(Qe!==void 0)it.servedir=Qe;if(z!==void 0)it.keyfile=z;if(dt!==void 0)it.certfile=dt;if(Ze!==void 0)it.fallback=Ze;if(er){let yr={},tr=I(er,yr,"origin",Ey);if(pt(er,yr,'on "cors" object'),Array.isArray(tr))it.corsOrigin=tr;else if(tr!==void 0)it.corsOrigin=[tr]}r(i,it,(yr,tr)=>{if(yr)return Q(Error(yr));if(nt)o["serve-request"]=(Xn,Ii)=>{nt(Ii.args),n(Xn,{})};oe(tr)})}),cancel:()=>new Promise((W)=>{if(le)return W();r(i,{command:"cancel",key:t},()=>{W()})}),dispose:()=>new Promise((W)=>{if(le)return W();le=!0,r(i,{command:"dispose",key:t},()=>{W(),_(),i.unref()})})};i.ref(),u(null,Ce)})}}var xI=async(e,t,r,n,i,s,o,a,c)=>{let l=[],u=[],d={},h={},m=[],y=0,g=0,b=[],x=!1;a=[...a];for(let E of a){let w={};if(typeof E!=="object")throw Error(`Plugin at index ${g} must be an object`);let k=I(E,w,"name",re);if(typeof k!=="string"||k==="")throw Error(`Plugin at index ${g} is missing a name`);try{let R=I(E,w,"setup",wy);if(typeof R!=="function")throw Error("Plugin is missing a setup function");pt(E,w,`on plugin ${yt(k)}`);let j={name:k,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};g++;let F=R({initialOptions:o,resolve:(N,q={})=>{if(!x)throw Error('Cannot call "resolve" before plugin setup has completed');if(typeof N!=="string")throw Error("The path to resolve must be a string");let U=Object.create(null),ne=I(q,U,"pluginName",re),ue=I(q,U,"importer",re),ie=I(q,U,"namespace",re),te=I(q,U,"resolveDir",re),le=I(q,U,"kind",re),Ce=I(q,U,"pluginData",Oc),W=I(q,U,"with",Sr);return pt(q,U,"in resolve() call"),new Promise((oe,Q)=>{let Z={command:"resolve",path:N,key:e,pluginName:k};if(ne!=null)Z.pluginName=ne;if(ue!=null)Z.importer=ue;if(ie!=null)Z.namespace=ie;if(te!=null)Z.resolveDir=te;if(le!=null)Z.kind=le;else throw Error('Must specify "kind" when calling "resolve"');if(Ce!=null)Z.pluginData=c.store(Ce);if(W!=null)Z.with=$I(W,"with");t(n,Z,(Ve,pe)=>{if(Ve!==null)Q(Error(Ve));else oe({errors:Es(pe.errors,c),warnings:Es(pe.warnings,c),path:pe.path,external:pe.external,sideEffects:pe.sideEffects,namespace:pe.namespace,suffix:pe.suffix,pluginData:c.load(pe.pluginData)})})})},onStart(N){let U=jc(Error('This error came from the "onStart" callback registered here:'),i,"onStart");l.push({name:k,callback:N,note:U}),j.onStart=!0},onEnd(N){let U=jc(Error('This error came from the "onEnd" callback registered here:'),i,"onEnd");u.push({name:k,callback:N,note:U}),j.onEnd=!0},onResolve(N,q){let ne=jc(Error('This error came from the "onResolve" callback registered here:'),i,"onResolve"),ue={},ie=I(N,ue,"filter",Cc),te=I(N,ue,"namespace",re);if(pt(N,ue,`in onResolve() call for plugin ${yt(k)}`),ie==null)throw Error("onResolve() call is missing a filter");let le=y++;d[le]={name:k,callback:q,note:ne},j.onResolve.push({id:le,filter:Ic(ie),namespace:te||""})},onLoad(N,q){let ne=jc(Error('This error came from the "onLoad" callback registered here:'),i,"onLoad"),ue={},ie=I(N,ue,"filter",Cc),te=I(N,ue,"namespace",re);if(pt(N,ue,`in onLoad() call for plugin ${yt(k)}`),ie==null)throw Error("onLoad() call is missing a filter");let le=y++;h[le]={name:k,callback:q,note:ne},j.onLoad.push({id:le,filter:Ic(ie),namespace:te||""})},onDispose(N){m.push(N)},esbuild:i.esbuild});if(F)await F;b.push(j)}catch(R){return{ok:!1,error:R,pluginName:k}}}s["on-start"]=async(E,w)=>{c.clear();let k={errors:[],warnings:[]};await Promise.all(l.map(async({name:R,callback:j,note:D})=>{try{let F=await j();if(F!=null){if(typeof F!=="object")throw Error(`Expected onStart() callback in plugin ${yt(R)} to return an object`);let N={},q=I(F,N,"errors",In),U=I(F,N,"warnings",In);if(pt(F,N,`from onStart() callback in plugin ${yt(R)}`),q!=null)k.errors.push(...Tn(q,"errors",c,R,void 0));if(U!=null)k.warnings.push(...Tn(U,"warnings",c,R,void 0))}}catch(F){k.errors.push(Fi(F,i,c,D&&D(),R))}})),r(E,k)},s["on-resolve"]=async(E,w)=>{let k={},R="",j,D;for(let F of w.ids)try{({name:R,callback:j,note:D}=d[F]);let N=await j({path:w.path,importer:w.importer,namespace:w.namespace,resolveDir:w.resolveDir,kind:w.kind,pluginData:c.load(w.pluginData),with:w.with});if(N!=null){if(typeof N!=="object")throw Error(`Expected onResolve() callback in plugin ${yt(R)} to return an object`);let q={},U=I(N,q,"pluginName",re),ne=I(N,q,"path",re),ue=I(N,q,"namespace",re),ie=I(N,q,"suffix",re),te=I(N,q,"external",et),le=I(N,q,"sideEffects",et),Ce=I(N,q,"pluginData",Oc),W=I(N,q,"errors",In),oe=I(N,q,"warnings",In),Q=I(N,q,"watchFiles",or),Z=I(N,q,"watchDirs",or);if(pt(N,q,`from onResolve() callback in plugin ${yt(R)}`),k.id=F,U!=null)k.pluginName=U;if(ne!=null)k.path=ne;if(ue!=null)k.namespace=ue;if(ie!=null)k.suffix=ie;if(te!=null)k.external=te;if(le!=null)k.sideEffects=le;if(Ce!=null)k.pluginData=c.store(Ce);if(W!=null)k.errors=Tn(W,"errors",c,R,void 0);if(oe!=null)k.warnings=Tn(oe,"warnings",c,R,void 0);if(Q!=null)k.watchFiles=Rc(Q,"watchFiles");if(Z!=null)k.watchDirs=Rc(Z,"watchDirs");break}}catch(N){k={id:F,errors:[Fi(N,i,c,D&&D(),R)]};break}r(E,k)},s["on-load"]=async(E,w)=>{let k={},R="",j,D;for(let F of w.ids)try{({name:R,callback:j,note:D}=h[F]);let N=await j({path:w.path,namespace:w.namespace,suffix:w.suffix,pluginData:c.load(w.pluginData),with:w.with});if(N!=null){if(typeof N!=="object")throw Error(`Expected onLoad() callback in plugin ${yt(R)} to return an object`);let q={},U=I(N,q,"pluginName",re),ne=I(N,q,"contents",_y),ue=I(N,q,"resolveDir",re),ie=I(N,q,"pluginData",Oc),te=I(N,q,"loader",re),le=I(N,q,"errors",In),Ce=I(N,q,"warnings",In),W=I(N,q,"watchFiles",or),oe=I(N,q,"watchDirs",or);if(pt(N,q,`from onLoad() callback in plugin ${yt(R)}`),k.id=F,U!=null)k.pluginName=U;if(ne instanceof Uint8Array)k.contents=ne;else if(ne!=null)k.contents=Ur(ne);if(ue!=null)k.resolveDir=ue;if(ie!=null)k.pluginData=c.store(ie);if(te!=null)k.loader=te;if(le!=null)k.errors=Tn(le,"errors",c,R,void 0);if(Ce!=null)k.warnings=Tn(Ce,"warnings",c,R,void 0);if(W!=null)k.watchFiles=Rc(W,"watchFiles");if(oe!=null)k.watchDirs=Rc(oe,"watchDirs");break}}catch(N){k={id:F,errors:[Fi(N,i,c,D&&D(),R)]};break}r(E,k)};let _=(E,w)=>w([],[]);if(u.length>0)_=(E,w)=>{(async()=>{let k=[],R=[];for(let{name:j,callback:D,note:F}of u){let N,q;try{let U=await D(E);if(U!=null){if(typeof U!=="object")throw Error(`Expected onEnd() callback in plugin ${yt(j)} to return an object`);let ne={},ue=I(U,ne,"errors",In),ie=I(U,ne,"warnings",In);if(pt(U,ne,`from onEnd() callback in plugin ${yt(j)}`),ue!=null)N=Tn(ue,"errors",c,j,void 0);if(ie!=null)q=Tn(ie,"warnings",c,j,void 0)}}catch(U){N=[Fi(U,i,c,F&&F(),j)]}if(N){k.push(...N);try{E.errors.push(...N)}catch{}}if(q){R.push(...q);try{E.warnings.push(...q)}catch{}}}w(k,R)})()};let P=()=>{for(let E of m)setTimeout(()=>E(),0)};return x=!0,{ok:!0,requestPlugins:b,runOnEndCallbacks:_,scheduleOnDisposeCallbacks:P}};function jy(){let e=new Map,t=0;return{clear(){e.clear()},load(r){return e.get(r)},store(r){if(r===void 0)return-1;let n=t++;return e.set(n,r),n}}}function jc(e,t,r){let n,i=!1;return()=>{if(i)return n;i=!0;try{let s=(e.stack+"").split(`
13
- `);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 Bm(e,t){return(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0}function Lc(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}var sn=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 ${sn(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 Vk(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=sn(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+=sn(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+=sn(p);break}default:cr(e,--l);break}else if(c<=127)d+=sn(c);else if((c&224)===192)d+=sn((c&31)<<6|e[l++]&63);else if((c&240)===224)d+=sn((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+=sn(p>>10&1023|55296),p=56320|p&1023;d+=sn(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,Tm="warning",Im="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 ha=()=>null,Ge=(e)=>typeof e==="boolean"?null:"a boolean",re=(e)=>typeof e==="string"?null:"a string",ga=(e)=>e instanceof RegExp?null:"a RegExp object",cs=(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",Wm=(e)=>typeof e==="function"?null:"a function",on=(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",Wk=(e)=>typeof e==="object"&&e!==null?null:"an array or an object",Uk=(e)=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",Mm=(e)=>typeof e==="object"&&!Array.isArray(e)?null:"an object or null",Um=(e)=>typeof e==="string"||typeof e==="boolean"?null:"a string or a boolean",zk=(e)=>typeof e==="string"||typeof e==="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",zm=(e)=>typeof e==="string"||Array.isArray(e)&&e.every((t)=>typeof t==="string")?null:"a string or an array of strings",Gm=(e)=>typeof e==="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",Gk=(e)=>typeof e==="string"||e instanceof URL?null:"a string or a URL";function N(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 Kk(e){let t=Object.create(null),r=N(e,t,"wasmURL",Gk),n=N(e,t,"wasmModule",Uk),s=N(e,t,"worker",Ge);return tt(e,t,"in initialize() call"),{wasmURL:r,wasmModule:n,worker:s}}function Km(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 va(e,t,r,n,s){let i=N(t,r,"color",Ge),o=N(t,r,"logLevel",re),a=N(t,r,"logLimit",cs),l=N(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 Ym(e,t,r){let n=N(t,r,"legalComments",re),s=N(t,r,"sourceRoot",re),i=N(t,r,"sourcesContent",Ge),o=N(t,r,"target",zm),a=N(t,r,"format",re),l=N(t,r,"globalName",re),c=N(t,r,"mangleProps",ga),d=N(t,r,"reserveProps",ga),p=N(t,r,"mangleQuoted",Ge),h=N(t,r,"minify",Ge),m=N(t,r,"minifySyntax",Ge),b=N(t,r,"minifyWhitespace",Ge),g=N(t,r,"minifyIdentifiers",Ge),y=N(t,r,"lineLimit",cs),v=N(t,r,"drop",Ht),j=N(t,r,"dropLabels",Ht),S=N(t,r,"charset",re),P=N(t,r,"treeShaking",Ge),E=N(t,r,"ignoreAnnotations",Ge),O=N(t,r,"jsx",re),R=N(t,r,"jsxFactory",re),k=N(t,r,"jsxFragment",re),I=N(t,r,"jsxImportSource",re),D=N(t,r,"jsxDev",Ge),M=N(t,r,"jsxSideEffects",Ge),L=N(t,r,"define",sr),W=N(t,r,"logOverride",sr),se=N(t,r,"supported",sr),ue=N(t,r,"pure",Ht),oe=N(t,r,"keepNames",Ge),Q=N(t,r,"platform",re),ae=N(t,r,"tsconfigRaw",zk),ke=N(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=${ya(c)}`);if(d)e.push(`--reserve-props=${ya(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(W)for(let U in W){if(U.indexOf("=")>=0)throw Error(`Invalid log override: ${U}`);e.push(`--log-override:${U}=${qt(W[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 Yk(e,t,r,n,s){var i;let o=[],a=[],l=Object.create(null),c=null,d=null;va(o,t,l,r,n),Ym(o,t,l);let p=N(t,l,"sourcemap",Um),h=N(t,l,"bundle",Ge),m=N(t,l,"splitting",Ge),b=N(t,l,"preserveSymlinks",Ge),g=N(t,l,"metafile",Ge),y=N(t,l,"outfile",re),v=N(t,l,"outdir",re),j=N(t,l,"outbase",re),S=N(t,l,"tsconfig",re),P=N(t,l,"resolveExtensions",Ht),E=N(t,l,"nodePaths",Ht),O=N(t,l,"mainFields",Ht),R=N(t,l,"conditions",Ht),k=N(t,l,"external",Ht),I=N(t,l,"packages",re),D=N(t,l,"alias",sr),M=N(t,l,"loader",sr),L=N(t,l,"outExtension",sr),W=N(t,l,"publicPath",re),se=N(t,l,"entryNames",re),ue=N(t,l,"chunkNames",re),oe=N(t,l,"assetNames",re),Q=N(t,l,"inject",Ht),ae=N(t,l,"banner",sr),ke=N(t,l,"footer",sr),U=N(t,l,"entryPoints",Wk),le=N(t,l,"absWorkingDir",re),z=N(t,l,"stdin",sr),te=(i=N(t,l,"write",Ge))!=null?i:s,Le=N(t,l,"allowOverwrite",Ge),fe=N(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(W)o.push(`--public-path=${W}`);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,We=U.length;G<We;G++){let Xe=U[G];if(typeof Xe==="object"&&Xe!==null){let pt=Object.create(null),ut=N(Xe,pt,"in",re),Ue=N(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),We=N(z,G,"contents",Gm),Xe=N(z,G,"resolveDir",re),pt=N(z,G,"sourcefile",re),ut=N(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 We==="string")c=$r(We);else if(We instanceof Uint8Array)c=We}let Be=[];if(E)for(let G of E)G+="",Be.push(G);return{entries:a,flags:o,write:te,stdinContents:c,stdinResolveDir:d,absWorkingDir:le,nodePaths:Be,mangleCache:Km(fe)}}function Xk(e,t,r,n){let s=[],i=Object.create(null);va(s,t,i,r,n),Ym(s,t,i);let o=N(t,i,"sourcemap",Um),a=N(t,i,"sourcefile",re),l=N(t,i,"loader",re),c=N(t,i,"banner",re),d=N(t,i,"footer",re),p=N(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:Km(p)}}function Xm(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=Bm(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(Nm({id:O,isRequest:!0,value:P}))},p=(S,P)=>{if(r.didClose)throw Error("The service is no longer running"+r.reason);e.writeToStdin(Nm({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=[ls(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=Hk(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(),Zk(S,D,d,p,L,e,M,E,O,R,(W,se)=>{try{k(W,se)}finally{L.unref()}})},transform:({callName:S,refs:P,input:E,options:O,isTTY:R,fs:k,callback:I})=>{let D=Zm(),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:W,mangleCache:se}=Xk(S,O,R,Im),ue={command:"transform",flags:W,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(Bi("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(W){let se=[];try{va(se,O,{},R,Im)}catch{}let ue=ls(W,e,D,void 0,"");d(P,{command:"error",flags:se,error:ue},()=>{ue.detail=D.load(ue.detail),I(Bi("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=N(O,k,"kind",re),D=N(O,k,"color",Ge),M=N(O,k,"terminalWidth",cs),L=N(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 W={command:"format-msgs",messages:an(E,"messages",null,"",M),isWarning:I==="warning"};if(D!==void 0)W.color=D;if(M!==void 0)W.terminalWidth=M;if(L!==void 0)W.logStyle=L;d(P,W,(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=N(O,k,"color",Ge),D=N(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,W)=>{if(L)return R(Error(L),null);R(null,W.result)})}}}}function Zk(e,t,r,n,s,i,o,a,l,c,d){let p=Zm(),h=e==="context",m=(y,v)=>{let j=[];try{va(j,a,{},l,Tm)}catch{}let S=ls(y,i,p,void 0,v);r(s,{command:"error",flags:j,error:S},()=>{S.detail=p.load(S.detail),d(Bi(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"),"");Qk(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}=Yk(e,a,l,Tm,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 W=(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(tR);if(oe.metafile&&oe.metafile.length)ae.metafile=rR(oe.metafile);if(oe.mangleCache)ae.mangleCache=oe.mangleCache;if(oe.writeToStdout!==void 0)console.log(fs(oe.writeToStdout).replace(/\n$/,""));v(ae,(le,z)=>{if(ke.length>0||le.length>0){let te=Bi("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)=>{W(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 W(Q,(U,le)=>(j(),d(U,le)));if(Q.errors.length>0)return d(Bi("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,Be)=>{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=N(U,te,"delay",cs);tt(U,te,"in watch() call");let fe={command:"watch",key:t};if(Le)fe.delay=Le;r(s,fe,(Be)=>{if(Be)z(Error(Be));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=N(U,te,"port",Bk),fe=N(U,te,"host",re),Be=N(U,te,"servedir",re),G=N(U,te,"keyfile",re),We=N(U,te,"certfile",re),Xe=N(U,te,"fallback",re),pt=N(U,te,"cors",sr),ut=N(U,te,"onRequest",Wm);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(Be!==void 0)Ue.servedir=Be;if(G!==void 0)Ue.keyfile=G;if(We!==void 0)Ue.certfile=We;if(Xe!==void 0)Ue.fallback=Xe;if(pt){let bt={},Mt=N(pt,bt,"origin",zm);if(tt(pt,bt,'on "cors" object'),Array.isArray(Mt))Ue.corsOrigin=Mt;else if(Mt!==void 0)Ue.corsOrigin=[Mt]}r(s,Ue,(bt,Mt)=>{if(bt)return z(Error(bt));if(ut)o["serve-request"]=(Xr,En)=>{ut(En.args),n(Xr,{})};le(Mt)})}),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 Qk=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=N(P,E,"name",re);if(typeof O!=="string"||O==="")throw Error(`Plugin at index ${g} is missing a name`);try{let R=N(P,E,"setup",Wm);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 W=Object.create(null),se=N(L,W,"pluginName",re),ue=N(L,W,"importer",re),oe=N(L,W,"namespace",re),Q=N(L,W,"resolveDir",re),ae=N(L,W,"kind",re),ke=N(L,W,"pluginData",ha),U=N(L,W,"with",sr);return tt(L,W,"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=eR(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 W=pa(Error('This error came from the "onStart" callback registered here:'),s,"onStart");c.push({name:O,callback:M,note:W}),k.onStart=!0},onEnd(M){let W=pa(Error('This error came from the "onEnd" callback registered here:'),s,"onEnd");d.push({name:O,callback:M,note:W}),k.onEnd=!0},onResolve(M,L){let se=pa(Error('This error came from the "onResolve" callback registered here:'),s,"onResolve"),ue={},oe=N(M,ue,"filter",ga),Q=N(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:ya(oe),namespace:Q||""})},onLoad(M,L){let se=pa(Error('This error came from the "onLoad" callback registered here:'),s,"onLoad"),ue={},oe=N(M,ue,"filter",ga),Q=N(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:ya(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=N(D,M,"errors",on),W=N(D,M,"warnings",on);if(tt(D,M,`from onStart() callback in plugin ${it(R)}`),L!=null)O.errors.push(...an(L,"errors",l,R,void 0));if(W!=null)O.warnings.push(...an(W,"warnings",l,R,void 0))}}catch(D){O.errors.push(ls(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={},W=N(M,L,"pluginName",re),se=N(M,L,"path",re),ue=N(M,L,"namespace",re),oe=N(M,L,"suffix",re),Q=N(M,L,"external",Ge),ae=N(M,L,"sideEffects",Ge),ke=N(M,L,"pluginData",ha),U=N(M,L,"errors",on),le=N(M,L,"warnings",on),z=N(M,L,"watchFiles",Ht),te=N(M,L,"watchDirs",Ht);if(tt(M,L,`from onResolve() callback in plugin ${it(R)}`),O.id=D,W!=null)O.pluginName=W;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=an(U,"errors",l,R,void 0);if(le!=null)O.warnings=an(le,"warnings",l,R,void 0);if(z!=null)O.watchFiles=ma(z,"watchFiles");if(te!=null)O.watchDirs=ma(te,"watchDirs");break}}catch(M){O={id:D,errors:[ls(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={},W=N(M,L,"pluginName",re),se=N(M,L,"contents",Gm),ue=N(M,L,"resolveDir",re),oe=N(M,L,"pluginData",ha),Q=N(M,L,"loader",re),ae=N(M,L,"errors",on),ke=N(M,L,"warnings",on),U=N(M,L,"watchFiles",Ht),le=N(M,L,"watchDirs",Ht);if(tt(M,L,`from onLoad() callback in plugin ${it(R)}`),O.id=D,W!=null)O.pluginName=W;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=an(ae,"errors",l,R,void 0);if(ke!=null)O.warnings=an(ke,"warnings",l,R,void 0);if(U!=null)O.watchFiles=ma(U,"watchFiles");if(le!=null)O.watchDirs=ma(le,"watchDirs");break}}catch(M){O={id:D,errors:[ls(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 W=await I(P);if(W!=null){if(typeof W!=="object")throw Error(`Expected onEnd() callback in plugin ${it(k)} to return an object`);let se={},ue=N(W,se,"errors",on),oe=N(W,se,"warnings",on);if(tt(W,se,`from onEnd() callback in plugin ${it(k)}`),ue!=null)M=an(ue,"errors",l,k,void 0);if(oe!=null)L=an(oe,"warnings",l,k,void 0)}}catch(W){M=[ls(W,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 Zm(){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 pa(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=Qm(t,i,r);if(o)return n={text:e.message,location:o},n}catch{}}}function ls(e,t,r,n,s){let i="Internal error",o=null;try{i=(e&&e.message||e)+""}catch{}try{o=Qm(t,(e.stack+"").split(`
14
+ `),"")}catch{}return{id:"",pluginName:s,text:i,location:o,notes:n?[n]:[],detail:r?r.store(e):-1}}function Qm(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 _={},P=I(x,_,"text",re),E=I(x,_,"location",py);pt(x,_,g),b.push({text:P||"",location:my(E,g,i)})}s.push({id:l||"",pluginName:u||n,text:d||"",location:my(h,g,i),notes:b,detail:r?r.store(y):-1}),o++}return s}function Rc(e,t){let r=[];for(let n of e){if(typeof n!=="string")throw Error(`${yt(t)} must be an array of strings`);r.push(n)}return r}function $I(e,t){let r=Object.create(null);for(let n in e){let i=e[n];if(typeof i!=="string")throw Error(`key ${yt(n)} in object ${yt(t)} must be a string`);r[n]=i}return r}function vI({path:e,contents:t,hash:r}){let n=null;return{path:e,contents:t,hash:r,get text(){let i=this.contents;if(n===null||i!==t)t=i,n=Ui(i);return n}}}function Ic(e){let t=e.source;if(e.flags)t=`(?${e.flags})${t}`;return t}function wI(e){let t;try{t=Ui(e)}catch{return lI(e)}return JSON.parse(t)}var si=De("fs"),hy=De("os"),Nr=De("path"),ws=process.env.ESBUILD_BINARY_PATH||ws,SI=(e)=>!!e&&e!=="/usr/bin/esbuild",gy="@esbuild/darwin-arm64",yy="@esbuild/darwin-x64",Tc={"win32 arm64 LE":"@esbuild/win32-arm64","win32 ia32 LE":"@esbuild/win32-ia32","win32 x64 LE":"@esbuild/win32-x64"},Nc={"aix ppc64 BE":"@esbuild/aix-ppc64","android arm64 LE":"@esbuild/android-arm64","darwin arm64 LE":"@esbuild/darwin-arm64","darwin x64 LE":"@esbuild/darwin-x64","freebsd arm64 LE":"@esbuild/freebsd-arm64","freebsd x64 LE":"@esbuild/freebsd-x64","linux arm LE":"@esbuild/linux-arm","linux arm64 LE":"@esbuild/linux-arm64","linux ia32 LE":"@esbuild/linux-ia32","linux mips64el LE":"@esbuild/linux-mips64el","linux ppc64 LE":"@esbuild/linux-ppc64","linux riscv64 LE":"@esbuild/linux-riscv64","linux s390x BE":"@esbuild/linux-s390x","linux x64 LE":"@esbuild/linux-x64","linux loong64 LE":"@esbuild/linux-loong64","netbsd arm64 LE":"@esbuild/netbsd-arm64","netbsd x64 LE":"@esbuild/netbsd-x64","openbsd arm64 LE":"@esbuild/openbsd-arm64","openbsd x64 LE":"@esbuild/openbsd-x64","sunos x64 LE":"@esbuild/sunos-x64"},by={"android arm LE":"@esbuild/android-arm","android x64 LE":"@esbuild/android-x64","openharmony arm64 LE":"@esbuild/openharmony-arm64"};function EI(){let e,t,r=!1,n=`${process.platform} ${hy.arch()} ${hy.endianness()}`;if(n in Tc)e=Tc[n],t="esbuild.exe";else if(n in Nc)e=Nc[n],t="bin/esbuild";else if(n in by)e=by[n],t="bin/esbuild",r=!0;else throw Error(`Unsupported platform: ${n}`);return{pkg:e,subpath:t,isWASM:r}}function _I(){let e=De.resolve("esbuild"),t=Nr.dirname(Nr.dirname(Nr.dirname(e)));if(Nr.basename(t)==="node_modules"){for(let r in Nc)try{let n=Nc[r];if(si.existsSync(Nr.join(t,n)))return n}catch{}for(let r in Tc)try{let n=Tc[r];if(si.existsSync(Nr.join(t,n)))return n}catch{}}return null}function PI(e,t){let r=Nr.dirname(De.resolve("esbuild"));return Nr.join(r,`downloaded-${e.replace("/","-")}-${Nr.basename(t)}`)}function kI(){if(SI(ws))if(!si.existsSync(ws))console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ws}`);else return{binPath:ws,isWASM:!1};let{pkg:e,subpath:t,isWASM:r}=EI(),n;try{n=De.resolve(`${e}/${t}`)}catch(i){if(n=PI(e,t),!si.existsSync(n)){try{De.resolve(e)}catch{let s=_I();if(s){let o=`
20
- Specifically the "${s}" package is present but this platform
16
+ `),suggestion:""}}break}}return null}function Bi(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 Jm(e,t,r){if(e==null)return null;let n={},s=N(e,n,"file",re),i=N(e,n,"namespace",re),o=N(e,n,"line",cs),a=N(e,n,"column",cs),l=N(e,n,"length",cs),c=N(e,n,"lineText",re),d=N(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 an(e,t,r,n,s){let i=[],o=0;for(let a of e){let l={},c=N(a,l,"id",re),d=N(a,l,"pluginName",re),p=N(a,l,"text",re),h=N(a,l,"location",Mm),m=N(a,l,"notes",on),b=N(a,l,"detail",ha),g=`in element ${o} of "${t}"`;tt(a,l,g);let y=[];if(m)for(let v of m){let j={},S=N(v,j,"text",re),P=N(v,j,"location",Mm);tt(v,j,g),y.push({text:S||"",location:Jm(P,g,s)})}i.push({id:c||"",pluginName:d||n,text:p||"",location:Jm(h,g,s),notes:y,detail:r?r.store(b):-1}),o++}return i}function ma(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 eR(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 tR({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=fs(s);return n}}}function ya(e){let t=e.source;if(e.flags)t=`(?${e.flags})${t}`;return t}function rR(e){let t;try{t=fs(e)}catch{return Vk(e)}return JSON.parse(t)}var On=Ne("fs"),Dm=Ne("os"),ur=Ne("path"),Ds=process.env.ESBUILD_BINARY_PATH||Ds,nR=(e)=>!!e&&e!=="/usr/bin/esbuild",Lm="@esbuild/darwin-arm64",Fm="@esbuild/darwin-x64",ba={"win32 arm64 LE":"@esbuild/win32-arm64","win32 ia32 LE":"@esbuild/win32-ia32","win32 x64 LE":"@esbuild/win32-x64"},xa={"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"},qm={"android arm LE":"@esbuild/android-arm","android x64 LE":"@esbuild/android-x64","openharmony arm64 LE":"@esbuild/openharmony-arm64"};function sR(){let e,t,r=!1,n=`${process.platform} ${Dm.arch()} ${Dm.endianness()}`;if(n in ba)e=ba[n],t="esbuild.exe";else if(n in xa)e=xa[n],t="bin/esbuild";else if(n in qm)e=qm[n],t="bin/esbuild",r=!0;else throw Error(`Unsupported platform: ${n}`);return{pkg:e,subpath:t,isWASM:r}}function iR(){let e=Ne.resolve("esbuild"),t=ur.dirname(ur.dirname(ur.dirname(e)));if(ur.basename(t)==="node_modules"){for(let r in xa)try{let n=xa[r];if(On.existsSync(ur.join(t,n)))return n}catch{}for(let r in ba)try{let n=ba[r];if(On.existsSync(ur.join(t,n)))return n}catch{}}return null}function oR(e,t){let r=ur.dirname(Ne.resolve("esbuild"));return ur.join(r,`downloaded-${e.replace("/","-")}-${ur.basename(t)}`)}function aR(){if(nR(Ds))if(!On.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}=sR(),n;try{n=Ne.resolve(`${e}/${t}`)}catch(s){if(n=oR(e,t),!On.existsSync(n)){try{Ne.resolve(e)}catch{let i=iR();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===Fm&&i===Lm||e===Lm&&i===Fm)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,151 @@ 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"),AI=De("crypto"),vf=De("path"),Bi=De("fs"),jI=De("os"),RI=De("tty"),Ht;if(process.env.ESBUILD_WORKER_THREADS!=="0"){try{Ht=De("worker_threads")}catch{}let[e,t]=process.versions.node.split(".");if(+e<12||+e===12&&+t<17||+e===13&&+t<13)Ht=void 0}var xy,Ko=((xy=Ht==null?void 0:Ht.workerData)==null?void 0:xy.esbuildVersion)==="0.28.2",Cy=()=>{if((!ws||!1)&&(vf.basename(__filename)!=="main.js"||vf.basename(__dirname)!=="lib"))throw Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
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(!On.existsSync(o))On.mkdirSync(ur.dirname(o),{recursive:!0}),On.copyFileSync(n,o),On.chmodSync(o,493);return{binPath:o,isWASM:r}}}return{binPath:n,isWASM:r}}var eh=Ne("child_process"),lR=Ne("crypto"),Fc=Ne("path"),us=Ne("fs"),cR=Ne("os"),uR=Ne("tty"),kt;if(process.env.ESBUILD_WORKER_THREADS!=="0"){try{kt=Ne("worker_threads")}catch{}let[e,t]=process.versions.node.split(".");if(+e<12||+e===12&&+t<17||+e===13&&+t<13)kt=void 0}var Hm,zi=((Hm=kt==null?void 0:kt.workerData)==null?void 0:Hm.esbuildVersion)==="0.28.2",th=()=>{if((!Ds||!1)&&(Fc.basename(__filename)!=="main.js"||Fc.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}=kI();if(t)return["node",[e]];else return[e,[]]}},Wo=()=>RI.isatty(2),OI={readFile(e,t){try{let r=Bi.readFileSync(e,"utf8");try{Bi.unlinkSync(e)}catch{}t(null,r)}catch(r){t(r,null)}},writeFile(e,t){try{let r=Iy();Bi.writeFileSync(r,e),t(r)}catch{t(null)}}},CI={readFile(e,t){try{Bi.readFile(e,"utf8",(r,n)=>{try{Bi.unlink(e,()=>t(r,n))}catch{t(r,n)}})}catch(r){t(r,null)}},writeFile(e,t){try{let r=Iy();Bi.writeFile(r,e,(n)=>n!==null?t(null):t(r))}catch{t(null)}}},II="0.28.2",TI=(e)=>Vi().build(e),NI=(e)=>Vi().context(e),MI=(e,t)=>Vi().transform(e,t),LI=(e,t)=>Vi().formatMessages(e,t),DI=(e,t)=>Vi().analyzeMetafile(e,t),JI=(e)=>{if(Ht&&!Ko){if(!Ut)Ut=Jc(Ht);return Ut.buildSync(e)}let t;return Dc((r)=>r.buildOrContext({callName:"buildSync",refs:null,options:e,isTTY:Wo(),defaultWD:Hi,callback:(n,i)=>{if(n)throw n;t=i}})),t},FI=(e,t)=>{if(Ht&&!Ko){if(!Ut)Ut=Jc(Ht);return Ut.transformSync(e,t)}let r;return Dc((n)=>n.transform({callName:"transformSync",refs:null,input:e,options:t||{},isTTY:Wo(),fs:OI,callback:(i,s)=>{if(i)throw i;r=s}})),r},qI=(e,t)=>{if(Ht&&!Ko){if(!Ut)Ut=Jc(Ht);return Ut.formatMessagesSync(e,t)}let r;return Dc((n)=>n.formatMessages({callName:"formatMessagesSync",refs:null,messages:e,options:t,callback:(i,s)=>{if(i)throw i;r=s}})),r},BI=(e,t)=>{if(Ht&&!Ko){if(!Ut)Ut=Jc(Ht);return Ut.analyzeMetafileSync(e,t)}let r;return Dc((n)=>n.analyzeMetafile({callName:"analyzeMetafileSync",refs:null,metafile:typeof e==="string"?e:JSON.stringify(e),options:t,callback:(i,s)=>{if(i)throw i;r=s}})),r},HI=()=>{if(Mc)Mc();if(Ut)Ut.stop();return Promise.resolve()},wf=!1,UI=(e)=>{if(e=hI(e||{}),e.wasmURL)throw Error('The "wasmURL" option only works in the browser');if(e.wasmModule)throw Error('The "wasmModule" option only works in the browser');if(e.worker)throw Error('The "worker" option only works in the browser');if(wf)throw Error('Cannot call "initialize" more than once');return Vi(),wf=!0,Promise.resolve()},Hi=process.cwd(),Uo,Mc,Vi=()=>{if(Uo)return Uo;let[e,t]=Cy(),r=Oy.spawn(e,t.concat("--service=0.28.2","--ping"),{windowsHide:!0,stdio:["pipe","pipe","inherit"],cwd:Hi}),{readFromStdout:n,afterClose:i,service:s}=Ay({writeToStdin(u){r.stdin.write(u,(d)=>{if(d)i(d)})},readFileSync:Bi.readFileSync,isSync:!1,hasFS:!0,esbuild:zo});r.stdin.on("error",i),r.on("error",i);let{stdin:o,stdout:a}=r;a.on("data",n),a.on("end",i),Mc=()=>{o.destroy(),a.destroy(),r.kill(),wf=!1,Uo=void 0,Mc=void 0};let c=0;if(r.unref(),o.unref)o.unref();if(a.unref)a.unref();let l={ref(){if(++c===1)r.ref()},unref(){if(--c===0)r.unref()}};return Uo={build:(u)=>new Promise((d,h)=>{s.buildOrContext({callName:"build",refs:l,options:u,isTTY:Wo(),defaultWD:Hi,callback:(m,y)=>m?h(m):d(y)})}),context:(u)=>new Promise((d,h)=>s.buildOrContext({callName:"context",refs:l,options:u,isTTY:Wo(),defaultWD:Hi,callback:(m,y)=>m?h(m):d(y)})),transform:(u,d)=>new Promise((h,m)=>s.transform({callName:"transform",refs:l,input:u,options:d||{},isTTY:Wo(),fs:CI,callback:(y,g)=>y?m(y):h(g)})),formatMessages:(u,d)=>new Promise((h,m)=>s.formatMessages({callName:"formatMessages",refs:l,messages:u,options:d,callback:(y,g)=>y?m(y):h(g)})),analyzeMetafile:(u,d)=>new Promise((h,m)=>s.analyzeMetafile({callName:"analyzeMetafile",refs:l,metafile:typeof u==="string"?u:JSON.stringify(u),options:d,callback:(y,g)=>y?m(y):h(g)}))},Uo},Dc=(e)=>{let[t,r]=Cy(),n=new Uint8Array,{readFromStdout:i,afterClose:s,service:o}=Ay({writeToStdin(c){if(n.length!==0)throw Error("Must run at most one command");n=c},isSync:!0,hasFS:!0,esbuild:zo});e(o);let a=Oy.execFileSync(t,r.concat("--service=0.28.2"),{cwd:Hi,windowsHide:!0,input:n,maxBuffer:+process.env.ESBUILD_MAX_BUFFER||16777216});i(a),s(null)},Iy=()=>vf.join(jI.tmpdir(),`esbuild-${AI.randomBytes(32).toString("hex")}`),Ut=null,Jc=(e)=>{let{port1:t,port2:r}=new e.MessageChannel,n=new e.Worker(__filename,{workerData:{workerPort:r,defaultWD:Hi,esbuildVersion:"0.28.2"},transferList:[r],execArgv:[]}),i=0,s=(l)=>{let u=Error(`Build failed with 1 error:
71
- error: ${l}`),d=[{id:"",pluginName:"",text:l,location:null,notes:[],detail:void 0}];return u.errors=d,u.warnings=[],u},o=(l)=>{if(!l)return;let u=l.plugins;if(u&&u.length>0)throw s("Cannot use plugins in synchronous API calls")},a=(l,u)=>{for(let d in u)l[d]=u[d]},c=(l,u)=>{let d=i++,h=new SharedArrayBuffer(8),m=new Int32Array(h),y={sharedBuffer:h,id:d,command:l,args:u};n.postMessage(y);let g=Atomics.wait(m,0,0);if(g!=="ok"&&g!=="not-equal")throw Error("Internal error: Atomics.wait() failed: "+g);let{message:{id:b,resolve:x,reject:_,properties:P}}=e.receiveMessageOnPort(t);if(d!==b)throw Error(`Internal error: Expected id ${d} but got id ${b}`);if(_)throw a(_,P),_;return x};return n.unref(),{buildSync(l){return o(l),c("build",[l])},transformSync(l,u){return c("transform",[l,u])},formatMessagesSync(l,u){return c("formatMessages",[l,u])},analyzeMetafileSync(l,u){return c("analyzeMetafile",[l,u])},stop(){n.terminate(),Ut=null}}},VI=()=>{let e=Ht.workerData.workerPort,t=Ht.parentPort,r=(n)=>{let i={};if(n&&typeof n==="object")for(let s in n)i[s]=n[s];return i};try{let n=Vi();Hi=Ht.workerData.defaultWD,t.on("message",(i)=>{(async()=>{let{sharedBuffer:s,id:o,command:a,args:c}=i,l=new Int32Array(s);try{switch(a){case"build":e.postMessage({id:o,resolve:await n.build(c[0])});break;case"transform":e.postMessage({id:o,resolve:await n.transform(c[0],c[1])});break;case"formatMessages":e.postMessage({id:o,resolve:await n.formatMessages(c[0],c[1])});break;case"analyzeMetafile":e.postMessage({id:o,resolve:await n.analyzeMetafile(c[0],c[1])});break;default:throw Error(`Invalid command: ${a}`)}}catch(u){e.postMessage({id:o,reject:u,properties:r(u)})}Atomics.add(l,0,1),Atomics.notify(l,0,1/0)})()})}catch(n){t.on("message",(i)=>{let{sharedBuffer:s,id:o}=i,a=new Int32Array(s);e.postMessage({id:o,reject:n,properties:r(n)}),Atomics.add(a,0,1),Atomics.notify(a,0,1/0)})}};if(Ko)VI();var WI=zo});import{rmSync as Ny,writeFileSync as My}from"node:fs";import{createRequire as zI}from"node:module";import{tmpdir as KI}from"node:os";import{basename as GI,join as Pf,resolve as YI}from"node:path";function Dy(e){return Di(e)||e.startsWith("./")||e.startsWith("../")}function Yo(){return typeof Bun>"u"||process.env.JX_BUNDLER==="esbuild"}function kf(e,t,r){if(Di(e)){let n=e.slice(Pc.length);if(Yo())return zI(Pf(r,"package.json")).resolve(n);return Bun.resolveSync(n,r)}return YI(t,e)}function XI(e){let{onFileLoaded:t,resolver:r}=e;if(r===void 0&&t===void 0)return[];return[{name:"jx-bundle-hooks",setup:(i)=>{if(r!==void 0)i.onResolve({filter:r.filter},(s)=>r.resolve(s));if(t!==void 0)i.onLoad({filter:/.*/},(s)=>{t(s.path)})}}]}function QI(e){if(e==="cloudflare-workers"||e==="cloudflare-pages")return{conditions:["workerd","worker"],external:["cloudflare:*","node:*"],target:"workerd"};return{target:e==="bun"?"bun":"node"}}function Ef(e){return e.minify??e.target==="browser"}function _f(e){let t={};if(e.conditions)t.conditions=e.conditions;if(e.target==="browser")t.define={...ZI};return t}function Jy(e){return e==="node"||e==="bun"?"node":"browser"}function eT(e){if(e==="workerd")return"browser";return e}async function Af(e,t){let r=t.external??[],n=XI(t);if(Yo()){let s=await Promise.resolve().then(() => Bt(Go(),1));await s.build({bundle:!0,..._f(t),entryPoints:[e.entryPath],external:r,format:"esm",logLevel:"silent",minify:Ef(t),outfile:e.outfile,platform:Jy(t.target),plugins:n});return}let i=await Bun.build({..._f(t),entrypoints:[e.entryPath],external:r,format:"esm",minify:Ef(t),plugins:n,target:eT(t.target),throw:!1});if(!i.success||i.outputs.length===0){let s=i.logs.map(String).join(`
72
- `);throw Error(`Bun.build failed for ${e.entryPath}:
73
- ${s}`)}My(e.outfile,await i.outputs[0].text(),"utf8")}function jf(e){return e==="<stdin>"||GI(e).startsWith(Fy)}async function qy(e,t,r){let n=[],i=Pf(KI(),`jx-resolve-${process.pid}.js`);try{await Wi(`export * from ${JSON.stringify(e)};
74
- `,{outfile:i,resolveDir:t},{...r,minify:!1,onFileLoaded:(s)=>n.push(s)})}catch{return}finally{Ny(i,{force:!0})}return n.find((s)=>!jf(s))}async function Wi(e,{resolveDir:t,outfile:r},n){if(Yo()){let s=await Promise.resolve().then(() => Bt(Go(),1));await s.build({bundle:!0,..._f(n),external:n.external??[],format:"esm",logLevel:"silent",minify:Ef(n),outfile:r,platform:Jy(n.target),stdin:{contents:e,loader:"js",resolveDir:t,sourcefile:"jx-entry.js"}});return}let i=Pf(t,`${Fy}${process.pid}.mjs`);My(i,e,"utf8");try{await Af({entryPath:i,outfile:r},n)}finally{Ny(i,{force:!0})}}async function By(e,{projectRoot:t,outfile:r,adapter:n}){await Wi(e,{outfile:r,resolveDir:t},QI(n))}var Ly,ZI,Fy=".jx-entry-";var Rf=L(()=>{wr();Ly=["@vue/reactivity","lit-html"];ZI={"process.env.NODE_ENV":'"production"'}});function rT(e){return e.split("\\").join("/").replace(/^\.\//,"").replace(/^\//,"").replace(/^pages\//,"")}function Hy(e){let t=rT(e),r=t.slice(t.lastIndexOf("/")+1),n=r.lastIndexOf(".");if(n>0)t=t.slice(0,t.length-(r.length-n));if(t.endsWith("/index"))t=t.slice(0,-6)||"/";else if(t==="index")t="/";if(!t.startsWith("/"))t=`/${t}`;let i=[],s=!1,o=!1,a=t.replaceAll(tT,(c,l,u)=>{if(s=!0,l)return o=!0,i.push(l),"*";return i.push(u),`:${u}`});return{isCatchAll:o,isDynamic:s,params:i,urlPattern:a}}function Uy(e,t){if(e.isDynamic!==t.isDynamic)return e.isDynamic?1:-1;if(e.isCatchAll!==t.isCatchAll)return e.isCatchAll?1:-1;return e.urlPattern.localeCompare(t.urlPattern)}var tT;var Vy=L(()=>{tT=/\[\.\.\.(\w+)\]|\[(\w+)\]/g});function Mr(e){if(!T(e)||e.trim()==="")return null;try{return new Intl.Locale(e.trim()).toString()}catch{return null}}function Xo(e){let t=Mr(e);if(t===null)return"ltr";let r=new Intl.Locale(t),n=r.script??r.maximize().script;return n!==void 0&&nT.has(n)?"rtl":"ltr"}function Wy(e){let t=Mr(e);if(t===null)return T(e)?e:"";return new Intl.DisplayNames([t],{type:"language"}).of(t)??t}function Of(e){let t=e.i18n,r=[];if(!J(t))return{errors:r,i18n:null};let n=Array.isArray(t.locales)?t.locales:[],i=[];for(let a of n){let c=Mr(a);if(c===null){r.push(`i18n.locales: "${String(a)}" is not a well-formed BCP 47 language tag.`);continue}if(!i.includes(c))i.push(c)}let s=Mr(t.defaultLocale)??i[0]??null;if(t.defaultLocale!==void 0&&Mr(t.defaultLocale)===null)r.push(`i18n.defaultLocale: "${String(t.defaultLocale)}" is not a well-formed BCP 47 language tag.`);if(s===null)return r.push("i18n is declared with no usable locale — set `defaultLocale` or `locales`."),{errors:r,i18n:null};if(!i.includes(s))i.unshift(s);let o=t.routing==="prefix-always"||t.routing==="prefix-except-default"?t.routing:iT;return{errors:r,i18n:{defaultLocale:s,locales:i,routing:o}}}function dn(e,t){if(t===null)return null;let r=e.split("/").find(Boolean);if(r===void 0)return t.defaultLocale;let n=Mr(r);return n!==null&&t.locales.includes(n)?n:t.defaultLocale}var nT,Fc="^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$",iT="prefix-except-default";var zi=L(()=>{Ee();nT=new Set(["Adlm","Arab","Aran","Armi","Avst","Cprt","Egyd","Egyh","Elym","Gara","Hatr","Hebr","Hluw","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogd","Sogo","Syrc","Thaa","Todr","Yezi"])});function ar(e){return e.replaceAll(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}function zy(e,t){if(e.startsWith("@--"))return t[e.slice(1)]??e.slice(1);if(e.startsWith("@(")){let r=e.slice(2,-1).trim();return sT.has(r.toLowerCase())?r:e.slice(1)}return null}function Qo(e){return e.startsWith("@position-try")||e.startsWith("@property")||e.startsWith("@font-face")||e.startsWith("@counter-style")}function ea(e){return e.startsWith("@keyframes")}function Ky(e,t){let r=[];for(let n of Zo(e))for(let i of Zo(t))r.push(oT(n,i));return r.join(", ")}function oT(e,t){if(t.startsWith("&"))return t.replaceAll("&",e);if(t.startsWith("[")||t.startsWith(":")||t.startsWith("."))return`${e}${t}`;return`${e} ${t}`}function Zo(e){let t=[],r=0,n=null,i=0;for(let o=0;o<e.length;o+=1){let a=e[o];if(n){if(a==="\\")o+=1;else if(a===n)n=null;continue}if(a==='"'||a==="'")n=a;else if(a==="("||a==="[")r+=1;else if(a===")"||a==="]")r=Math.max(0,r-1);else if(a===","&&r===0)t.push(e.slice(i,o)),i=o+1}t.push(e.slice(i));let s=t.flatMap((o)=>{let a=o.trim();return a===""?[]:[a]});return s.length>0?s:[e]}function Wr(e){let t=/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(e.trim())?.[1];return t==="light"||t==="dark"?t:null}function Cf(e,t){if(e===":root"||e==="html")return{auto:`${e}:where(:not([${Vr}]))`,forced:`${e}:where([${Vr}="${t}"])`};return{auto:`:where(:root:not([${Vr}])) ${e}`,forced:`:where(:root[${Vr}="${t}"]) ${e}`}}function oi(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}function If(e){return e.startsWith("--")?e:ar(e)}function qc(e){let t=2166136261;for(let r=0;r<e.length;r+=1)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Gy(e,t,r){let n=r.map(([s,o])=>`${s}: ${o}`).join("; "),i=t===null?n:`${t} { ${n} }`;for(let s=e.length-1;s>=0;s-=1)i=`${e[s]} { ${i} }`;return i}function aT(e,t,r){let n=r.map(({selector:s,declarations:o})=>`${s} { ${o.map(([a,c])=>`${a}: ${c}`).join("; ")} }`).join(" "),i=`@keyframes ${t} { ${n} }`;for(let s=e.length-1;s>=0;s-=1)i=`${e[s]} { ${i} }`;return i}function cT(e){let t=Object.keys(e).filter((n)=>ea(n));if(t.length===0)return e;let r={...e};for(let n of t)delete r[n];return r}function lT(e){let t=e.startsWith("&")?e.slice(1):e;return t===""||t.startsWith(":")||t.startsWith(".")||t.startsWith("[")}function _s(e,t={}){let{scope:r=null,mediaQueries:n={},transposeValue:i=(b)=>b,transposeSelector:s=(b)=>b,resolveValue:o}=t,a=[],c=(b)=>b!==null&&typeof b==="object"&&!Array.isArray(b)&&!Je(b),l=(b,x)=>{if(c(x))return[x];if(!Qo(b)||!Array.isArray(x)||x.length===0)return[];return x.every((_)=>c(_))?x:[]},u=(b,x,_,P)=>{if(x===void 0||x===null)return null;if(Je(x))return _?o?.(b,x,P)??null:null;if(J(x))return null;let E=String(x);if(he(E))return _?o?.(b,E,P)??null:null;return i(E)},d=(b,x,_=!0,P="self")=>{let E=[];for(let[w,k]of Object.entries(b)){if(l(w,k).length>0)continue;if(x&&(w.startsWith("@")||oi(w)))continue;if(w.startsWith("$"))continue;let R=u(w,k,_,P);if(R!==null)E.push([If(w),R])}return E},h=(b,x,_,P,E)=>{if(_.length===0)return;let w=x;if(w!==null){let j=s(w);if(j===null)return;w=j}let k=Gy(b,w,_),R={text:k,conditions:[...b],selector:w,declarations:_,target:P,key:qc(k)};if(T(E)&&E!=="")R.description=E;a.push(R)},m=(b,x,_)=>{let P=b.slice(10).trim();if(P==="")return;let E=[];for(let[k,R]of Object.entries(x)){if(!c(R))continue;let j=d(R,!0,!1,"unscoped");if(j.length>0)E.push({declarations:j,selector:k.trim()})}if(E.length===0)return;let w=aT(_,P,E);a.push({blocks:E,conditions:[..._],declarations:[],key:qc(w),selector:null,target:"unscoped",text:w})},y=(b,x,_,P,E)=>{if(b==="@--")return;if(Qo(b)){h([...P,b],null,d(x,!1,!0,"unscoped"),"unscoped",x.$description);return}if(ea(b)){m(b,x,P);return}let w=zy(b,n),k=w===null?b:`@media ${w}`,R=w===null?null:Wr(w);if(R!==null&&_!==null){let{auto:j,forced:D}=Cf(_,R);g(x,j,[...P,k],E),g(cT(x),D,P,E);return}g(x,_,[...P,k],E)};function g(b,x,_,P){h(_,x,d(b,!0,!0,P),P,b.$description);for(let[E,w]of Object.entries(b))for(let k of l(E,w))if(E.startsWith("@"))y(E,k,x,_,P);else if(x!==null)g(k,Ky(x,E),_,lT(E)?P:"descendant")}return g(e,r,[],"self"),a}var sT,Vr="data-color-scheme",Bc="jx-color-scheme";var Hc=L(()=>{Ee();sT=new Set(["all","print","screen","speech"])});function Qy(){return`the Intl helpers ${Nf.join(", ")}`}var pn="en-US",Tf="UTC",Yy,Nf,Xy;var Mf=L(()=>{Yy=[{api:"Intl.NumberFormat",params:["value","locale","options"],path:"Intl/formatNumber",summary:"Format a number for a locale — grouping, decimals, currency, percent, units."},{api:"Intl.DateTimeFormat",params:["value","locale","options"],path:"Intl/formatDate",summary:"Format a date or timestamp for a locale. Pass `timeZone` in options."},{api:"Intl.RelativeTimeFormat",params:["value","unit","locale","options"],path:"Intl/formatRelativeTime",summary:'Format a relative time — `-3, "day"` becomes "3 days ago".'},{api:"Intl.ListFormat",params:["values","locale","options"],path:"Intl/formatList",summary:'Join a list the way a locale does — "a, b, and c", not a hand-written comma join.'},{api:"Intl.PluralRules",params:["value","locale","options"],path:"Intl/plural",summary:'Which plural category a number falls in ("one", "few", "other") — many languages have '+"more than two, so a ternary on `n === 1` is wrong outside English."},{api:"Intl.Collator",params:["a","b","locale","options"],path:"Intl/compare",summary:'Compare two strings for sorting. `<` and `sort()` order by UTF-16 code unit, which puts "Zebra" before "apple" and sorts every accented word into the wrong place.'},{api:"Intl.DisplayNames",params:["code","type","locale","options"],path:"Intl/displayName",summary:'The name of a language, region, script or currency in a locale — "de" as "German" or '+'"Deutsch", from CLDR rather than a hand-kept table.'},{api:"Intl.Segmenter",params:["value","granularity","locale"],path:"Intl/segment",summary:"Split text into graphemes, words or sentences (UAX #29). `[...str]` splits code points, so it cuts an emoji with a skin-tone modifier in half."}],Nf=Yy.map((e)=>e.path),Xy=Object.fromEntries(Yy.map((e)=>[e.path,e.params.indexOf("locale")]))});function uT(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Ct(e){return e.replaceAll("~","~0").replaceAll("/","~1")}function ai(e){if(e==="")return[];return e.split("/").map((t)=>uT(t))}function Et(e,t){let r=e;for(let n of ai(t))r=r?.[n];return r}function Ie(e,t){let r=e;for(let n of ai(t))r+=Zy.test(n)?`.${n}`:`[${JSON.stringify(n)}]`;return r}function Ps(e){return Zy.test(e)?e:JSON.stringify(e)}function eb(e){let t=e.replaceAll(/[^A-Za-z0-9_$]/g,"_");if(t==="")return"ref";return/^\d/.test(t)?`_${t}`:t}var Zy;var ks=L(()=>{Zy=/^[A-Za-z_$][A-Za-z0-9_$]*$/});function Lf(e){let t=e.$map;return J(t)?t:void 0}function ib(e){return J(e)&&!Array.isArray(e)&&"operator"in e}function ta(e){return J(e)&&!Array.isArray(e)&&"$ref"in e}function mT(e,t,r){let n=Xy[e];if(n===void 0||n<0||t[n]!=null)return t;let i=Et(r.$page,"locale");if(!T(i)||i==="")return t;let s=[...t];return s[n]=i,s}function cb(e){return e.startsWith("window#/")&&dT.has(e.slice(8))}function Nn(e){return sb.has(e)}function tt(e,t){if(!e)return;let r=(e.depth??0)+1;if(r>hT)return;return{depth:r,path:[...e.path??[],...Array.isArray(t)?t:[t]],report:e.report}}function Ke(e,t,r,n,i){if(e===null||e===void 0)return e;if(ib(e))return Er(e,t,r,n,i);if(ta(e)){let s=Uc(e.$ref,t,r,n);return i?.report(i.path??[],s),s}if(Array.isArray(e))return lb(e,t,r,n,i);return i?.report(i.path??[],e),e}function lb(e,t,r,n,i){return e.map((s,o)=>Ke(s,t,r,n,tt(i,o)))}function gT(e,t,r,n){let i=(s)=>{if(!e.slice(s.length).includes("/"))return t;return Uc(e.slice(0,e.lastIndexOf("/")),t,r,n)};if(e.startsWith("#/state/"))return i("#/state/");if(e.startsWith("parent#/"))return i("parent#/");if(e.startsWith("$map/")||e.startsWith("$args/"))return e.split("/").length>2?Uc(e.slice(0,e.lastIndexOf("/")),t,r,n):void 0;return}function Uc(e,t,r,n){if(e==="$reduce/acc")return n?.acc;if(e.startsWith("$reduce/"))return n?.acc;if(e.startsWith("$args/")){let i=e.slice(6).split("/"),s=n?.args?.[i[0]];return i.length>1?Et(s,i.slice(1).join("/")):s}if(e.startsWith("event#/")){let i=e.slice(7);return Et(r,i)}if(e.startsWith("$map/")){let i=e.split("/"),[,s]=i,o,a=Lf(t);if(s==="item")o=n?.item??a?.item??t["$map/item"];else if(s==="index")o=n?.index??a?.index??t["$map/index"];else o=a?.[s]??t[`$map/${s}`];return i.length>2?Et(o,i.slice(2).join("/")):o}if(e.startsWith("#/state/"))return Et(t,e.slice(8));if(e.startsWith("parent#/"))return Et(t,e.slice(8));if(e.startsWith("window#/"))return Et(globalThis.window,e.slice(8));if(e.startsWith("document#/"))return Et(globalThis.document,e.slice(10));return Et(t,e)??null}function yT(e,t,r,n){if(e.startsWith("$map/")){let i=e.split("/"),[,s]=i,o,a=Lf(t);if(s==="item")o=n?.item??a?.item??t["$map/item"];else if(s==="index")o=n?.index??a?.index??t["$map/index"];else o=a?.[s]??t[`$map/${s}`];if(i.length>2){let c=i.slice(2),l=c.pop(),u=c.length>0?Et(o,c.join("/")):o;return{key:l,obj:u}}return{key:s==="item"?"$map/item":"$map/index",obj:Lf(t)??t}}if(e.startsWith("#/state/")){let i=e.slice(8);if(i.indexOf("/")===-1)return{key:i,obj:t};let o=ai(i),a=o.pop(),c=t;for(let l of o)c=c[l];return{key:a,obj:c}}return{key:e,obj:t}}function Er(e,t,r,n,i){let s=bT(e,t,r,n,i);return i?.report(i.path??[],s),s}function rb(e,t,r){switch(e){case"+":return t+r;case"-":return t-r;case"*":return t*r;case"/":return t/r;case"%":return t%r;case"<":return t<r;case"<=":return t<=r;case">":return t>r;default:return t>=r}}function bT(e,t,r,n,i){let{operator:s,target:o,value:a,initial:c}=e;if(!fT.has(s))throw Error(`$expression: unknown operator "${s}"`);if(Df.has(s)&&!("value"in e)){let l=Ke(o,t,r,n,tt(i,"target"));if(s==="!")return!l;if(s==="-")return-l}if(s==="call"){let l=ta(o)?o.$ref:void 0;if(!T(l))throw TypeError("$expression: call target must be a $ref pointer");let u=(n?.callDepth??0)+1;if(u>tb)throw Error(`$expression: call depth exceeded (${tb})`);let d=Array.isArray(a)?a.map((m,y)=>Ke(m,t,r,n,tt(i,["value",y]))):[];if(l.startsWith("window#/")){if(!cb(l))throw Error(`$expression: "${l}" is not a blessed pure global`);let m=l.slice(8),y=pT.get(m);if(y)return y(...mT(m,d,t));let g=Et(globalThis.window,m),b=m.lastIndexOf("/"),x=b===-1?globalThis.window:Et(globalThis.window,m.slice(0,b));return g.apply(x,d)}let h=Uc(l,t,r,n);if(Ot(h))return h.apply(gT(l,t,r,n),d);if(J(h)&&"$expression"in h){let m=h,y={};for(let[g,b]of(m.parameters??[]).entries()){let x=T(b)?b:b?.name??"";if(!x)continue;y[x]=d[g]===void 0&&J(b)&&"default"in b?b.default:d[g]}return Er(m.$expression,t,r,{args:y,callDepth:u})}throw TypeError(`$expression: call target "${l}" is not callable`)}if(qf.has(s)){if(s==="?:"){let m=Ke(o,t,r,n,tt(i,"target"));if(i){let y=Ke(a,t,r,n,tt(i,"value")),g=Ke(c,t,r,n,tt(i,"initial"));return m?y:g}return m?Ke(a,t,r,n):Ke(c,t,r,n)}let l=Ke(o,t,r,n,tt(i,"target")),u=String(l),d=e.cases??{},h=Object.hasOwn(d,u);if(i){let m;for(let[g,b]of Object.entries(d)){let x=Ke(b,t,r,n,tt(i,["cases",g]));if(g===u)m=x}let y=Ke(e.default,t,r,n,tt(i,"default"));return h?m:y}return h?Ke(d[u],t,r,n):Ke(e.default,t,r,n)}if(Jf.has(s)){let l=Ke(o,t,r,n,tt(i,"target")),u=Ke(a,t,r,n,tt(i,"value"));switch(s){case"===":return l===u;case"!==":return l!==u;case"&&":return l&&u;case"||":return l||u;case"??":return l??u;default:return rb(s,l,u)}}if(ob.has(s)){let l=Ke(a,t,r,n,tt(i,"value")),{obj:u,key:d}=yT(o.$ref,t,r,n);u[d]=s==="="?l:rb(s.slice(0,-1),u[d],l);return}if(ab.has(s)){let l=Ke(o,t,r,n,tt(i,"target"));switch(s){case"push":return l.push(Ke(a,t,r,n,tt(i,"value")));case"unshift":return l.unshift(Ke(a,t,r,n,tt(i,"value")));case"pop":return l.pop();case"shift":return l.shift();case"splice":{let u=Ke(a,t,r,n,tt(i,"value"));return l.splice(...u)}default:break}}if(Bf.has(s)){let l=Ke(o,t,r,n,tt(i,"target")),u=a===void 0?[]:Array.isArray(a)?lb(a,t,r,n,tt(i,"value")):[Ke(a,t,r,n,tt(i,"value"))],d=Et(l,s);if(!Ot(d))return;return d.apply(l,u)}if(Ff.has(s)){let l=Ke(o,t,r,n,tt(i,"target")),u=a;if(s==="reduce"){let d=Ke(c,t,r,n,tt(i,"initial"));for(let[h,m]of l.entries())d=Er(u,t,r,{acc:d,index:h,item:m},h===0?tt(i,"value"):void 0);return d}if(s==="map")return l.map((d,h)=>Er(u,t,r,{...n,index:h,item:d},h===0?tt(i,"value"):void 0));if(s==="filter")return l.filter((d,h)=>Er(u,t,r,{...n,index:h,item:d},h===0?tt(i,"value"):void 0))}return}function at(e,t){if(e===null)return"null";if(e===void 0)return"undefined";if(ib(e))return Vt(e,t);if(ta(e))return Hf(e.$ref,t);if(Array.isArray(e))return e.map((r)=>at(r,t)).join(", ");return JSON.stringify(e)}function xT(e){return`_fx_${e.replaceAll(/[^A-Za-z0-9_$]/g,"_")}`}function Hf(e,t){let r=t.statePrefix??"state",n=t.eventParam??"event";if(e==="$reduce/acc")return"_acc";if(e.startsWith("$reduce/"))return"_acc";if(e.startsWith("$args/"))return Ie("_args",e.slice(6));if(e.startsWith("event#/"))return Ie(n,e.slice(7));if(e.startsWith("$map/")){let i=e.split("/"),[,s]=i;if(s==="item")return i.length>2?Ie("_item",i.slice(2).join("/")):"_item";if(s==="index")return"_index";return`_${s}`}if(e.startsWith("#/state/"))return Ie(r,e.slice(8));if(e.startsWith("parent#/"))return Ie(r,e.slice(8));if(e.startsWith("window#/"))return Ie("window",e.slice(8));if(e.startsWith("document#/"))return Ie("document",e.slice(10));return Ie(r,e)}function nb(e,t){if(ta(e))return Hf(e.$ref,t);return at(e,t)}function $T(e,t,r){let n=(o)=>t[o]??"undefined",i=`(${r.statePrefix??"state"}?.$page?.locale ?? ${JSON.stringify(pn)})`,s=JSON.stringify(Tf);switch(e){case"Intl/formatNumber":return`new Intl.NumberFormat(${n(1)} ?? ${i}, ${n(2)}).format(${n(0)})`;case"Intl/formatDate":return`new Intl.DateTimeFormat(${n(1)} ?? ${i}, {timeZone: ${s}, ...${n(2)}}).format(new Date(${n(0)}))`;case"Intl/formatRelativeTime":return`new Intl.RelativeTimeFormat(${n(2)} ?? ${i}, ${n(3)}).format(${n(0)}, ${n(1)})`;case"Intl/formatList":return`new Intl.ListFormat(${n(1)} ?? ${i}, ${n(2)}).format(${n(0)})`;case"Intl/plural":return`new Intl.PluralRules(${n(1)} ?? ${i}, ${n(2)}).select(${n(0)})`;case"Intl/compare":return`new Intl.Collator(${n(2)} ?? ${i}, ${n(3)}).compare(${n(0)}, ${n(1)})`;case"Intl/displayName":return`new Intl.DisplayNames(${n(2)} ?? ${i}, {...${n(3)}, type: ${n(1)} ?? 'language'}).of(${n(0)})`;case"Intl/segment":return`[...new Intl.Segmenter(${n(2)} ?? ${i}, {granularity: ${n(1)} ?? 'grapheme'}).segment(${n(0)})].map((p) => p.segment)`;default:return null}}function Vt(e,t={}){let{operator:r,target:n,value:i,initial:s}=e;if(Df.has(r)&&!("value"in e)){let o=at(n,t);if(r==="!")return`!(${o})`;if(r==="-")return`-(${o})`}if(r==="call"){let o=(ta(n)?n.$ref:void 0)??"",a=Array.isArray(i)?i.map((c)=>at(c,t)):[];if(o.startsWith("window#/")){if(!cb(o))throw Error(`$expression: "${o}" is not a blessed pure global`);let c=$T(o.slice(8),a,t);if(c)return c;return`window.${o.slice(8).replaceAll("/",".")}(${a.join(", ")})`}if(o.startsWith("#/state/")){let c=o.slice(8),l=t.formulaParams?.[c];if(l){let u=l.map((d,h)=>`${JSON.stringify(d)}: ${a[h]??"undefined"}`).join(", ");return`${xT(c)}(${t.statePrefix??"state"}, { ${u} })`}}return`${Hf(o,t)}(${a.join(", ")})`}if(qf.has(r)){if(r==="?:"){let l=at(n,t),u=at(i,t),d=at(s,t);return`(${l} ? ${u} : ${d})`}let o=at(n,t),a=Object.entries(e.cases??{}).map(([l,u])=>`_d === ${JSON.stringify(l)} ? ${at(u,t)} : `).join(""),c="default"in e?at(e.default,t):"undefined";return`((_d) => ${a}${c})(String(${o}))`}if(Jf.has(r)){let o=at(n,t),a=at(i,t);return`(${o} ${r} ${a})`}if(ob.has(r)){let o=nb(n,t),a=at(i,t);return`${o} ${r} ${a}`}if(ab.has(r)){let o=nb(n,t);switch(r){case"push":return`${o}.push(${at(i,t)})`;case"unshift":return`${o}.unshift(${at(i,t)})`;case"pop":return`${o}.pop()`;case"shift":return`${o}.shift()`;case"splice":{let a=Array.isArray(i)?i.map((c)=>at(c,t)).join(", "):at(i,t);return`${o}.splice(${a})`}default:break}}if(Bf.has(r)){let o=at(n,t),a=i===void 0?"":Array.isArray(i)?i.map((c)=>at(c,t)).join(", "):at(i,t);return`(${o})?.${r}?.(${a})`}if(Ff.has(r)){let o=at(n,t),a=Vt(i,t);if(r==="reduce"){let c=at(s,t);return`${o}.reduce((_acc, _item, _index) => ${a}, ${c})`}if(r==="map")return`${o}.map((_item, _index) => ${a})`;if(r==="filter")return`${o}.filter((_item, _index) => ${a})`}return"undefined"}function As(e,t,r,n){return Ke(e,t,r,n)}function Ki(e,t={}){return at(e,t)}var sb,Df,Jf,ob,ab,Ff,qf,Bf,fT,dT,pT,tb=64,hT=64;var ra=L(()=>{Mf();Ee();ks();sb=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),Df=new Set(["!","-"]),Jf=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),ob=new Set(["=","+=","-=","*=","/="]),ab=new Set(["push","pop","shift","unshift","splice"]),Ff=new Set(["reduce","map","filter"]),qf=new Set(["?:","switch"]),Bf=new Set(["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]),fT=new Set([...sb,...Df,...Jf,...Ff,...qf,...Bf,"call"]),dT=new Set(["isNaN","isFinite","parseFloat","parseInt","encodeURIComponent","decodeURIComponent","structuredClone","Math/abs","Math/ceil","Math/floor","Math/round","Math/trunc","Math/sign","Math/sqrt","Math/cbrt","Math/pow","Math/exp","Math/log","Math/log2","Math/log10","Math/min","Math/max","Math/hypot","Number/isInteger","Number/isFinite","Number/isNaN","Number/parseFloat","Number/parseInt","JSON/parse","JSON/stringify","Object/keys","Object/values","Object/entries","Object/fromEntries","Array/from","Array/isArray","Array/of","String/fromCharCode","String/fromCodePoint",...Nf]),pT=new Map([["Intl/compare",(e,t,r,n)=>new Intl.Collator(r??pn,n).compare(e,t)],["Intl/displayName",(e,t,r,n)=>new Intl.DisplayNames(r??pn,{...n,type:t??"language"}).of(e)],["Intl/formatDate",(e,t,r)=>new Intl.DateTimeFormat(t??pn,{timeZone:Tf,...r}).format(new Date(e))],["Intl/formatList",(e,t,r)=>new Intl.ListFormat(t??pn,r).format(e)],["Intl/formatNumber",(e,t,r)=>new Intl.NumberFormat(t??pn,r).format(e)],["Intl/formatRelativeTime",(e,t,r,n)=>new Intl.RelativeTimeFormat(r??pn,n).format(e,t)],["Intl/plural",(e,t,r)=>new Intl.PluralRules(t??pn,r).select(e)],["Intl/segment",(e,t,r)=>[...new Intl.Segmenter(r??pn,{granularity:t??"grapheme"}).segment(e)].map((n)=>n.segment)]])});function ub(e){if("operator"in e)return{kind:"expression",node:e};if("if"in e)return{kind:"if",node:e};if("$switch"in e)return{kind:"switch",node:e};if("stopPropagation"in e)return{kind:"stopPropagation"};if("preventDefault"in e)return{kind:"preventDefault"};return{kind:"dispatch",node:e}}function vT(e){return(J(e)||Ot(e))&&"then"in e&&Ot(e.then)}async function js(e,t,r,n={}){let i=n.args?{args:n.args}:void 0;for(let s of e){let o=ub(s);switch(o.kind){case"expression":{let a=Er(o.node,t,r,i);if(vT(a))await a;break}case"if":{let a=o.node,c=As(a.if,t,r,i)?a.then:a.else;if(Array.isArray(c))await js(c,t,r,n);break}case"switch":{let a=o.node,c=String(As(a.$switch,t,r,i)),l=a.cases??{},u=Object.hasOwn(l,c)?l[c]:a.default;if(Array.isArray(u))await js(u,t,r,n);break}case"dispatch":{let a=o.node,c=Ot(n.target)?n.target():n.target,l=r?.currentTarget??c;if(!l)break;let u={};if("detail"in a)u.detail=As(a.detail,t,r,i);if(a.bubbles!==void 0)u.bubbles=a.bubbles;if(a.composed!==void 0)u.composed=a.composed;l.dispatchEvent(new CustomEvent(a.dispatchEvent,u));break}case"stopPropagation":{r?.stopPropagation();break}case"preventDefault":{r?.preventDefault();break}default:break}}}function Lr(e,t={}){let r=t.indent??"",n=[];for(let i of e){let s=ub(i);switch(s.kind){case"expression":{n.push(`${r}${Vt(s.node,t)};`);break}case"if":{let o=s.node,a=Ki(o.if,t),c={...t,indent:`${r} `};if(n.push(`${r}if (${a}) {`,Lr(o.then??[],c)),o.else)n.push(`${r}} else {`,Lr(o.else,c));n.push(`${r}}`);break}case"switch":{let o=s.node,a=Ki(o.$switch,t),c={...t,indent:`${r} `};n.push(`${r}switch (String(${a})) {`);for(let[l,u]of Object.entries(o.cases??{}))n.push(`${r} case ${JSON.stringify(l)}: {`,Lr(u,c),`${r} break;`,`${r} }`);if(o.default)n.push(`${r} default: {`,Lr(o.default,c),`${r} }`);n.push(`${r}}`);break}case"dispatch":{let o=s.node,a=t.eventParam??"event",c=t.dispatchTarget??`(${a} && ${a}.currentTarget)`,l=[];if("detail"in o)l.push(`detail: ${Ki(o.detail,t)}`);if(o.bubbles!==void 0)l.push(`bubbles: ${JSON.stringify(o.bubbles)}`);if(o.composed!==void 0)l.push(`composed: ${JSON.stringify(o.composed)}`);let u=l.length>0?`, { ${l.join(", ")} }`:"";n.push(`${r}${c}?.dispatchEvent(new CustomEvent(${JSON.stringify(o.dispatchEvent)}${u}));`);break}case"stopPropagation":{n.push(`${r}${t.eventParam??"event"}?.stopPropagation();`);break}case"preventDefault":{n.push(`${r}${t.eventParam??"event"}?.preventDefault();`);break}default:break}}return n.join(`
75
- `)}var Vc=L(()=>{Ee();ra()});function Rs(e){if(!e.startsWith("${")||!e.endsWith("}"))return!1;let t=0;for(let r=1;r<e.length;r+=1){let n=e[r];if(n==="{")t+=1;else if(n==="}"){if(t-=1,t===0)return r===e.length-1}}return!1}function db(){return[...fb].toSorted()}function Gi(e,t){let r=e.toLowerCase();if(r.startsWith("aria-")||fb.has(r))return String(t);return t?"":null}var Mn,fb,Uf=32,Wc,zc="jx-slot",na="data-jx-slots",Vf="jx.slot.group",SQ;var Os=L(()=>{Hc();ra();ks();Ee();wr();Vc();Hc();Mn=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"]),fb=new Set(["contenteditable","draggable","spellcheck"]);Wc=/^[\t\n\f\r ]+$/u,SQ=(()=>{let e=Symbol.for(Vf),t=globalThis;return t[e]??=new WeakMap,t[e]})()});function pb(e,t,r,n,i=ST){let s=[],o=(d,h)=>{let m={mediaQueries:t,scope:h,transposeValue:r};if(n)m.resolveValue=(y,g)=>n(y,g,h);for(let y of _s(d,m))s.push(y.text)},a={},c={},l=[],u=[];for(let[d,h]of Object.entries(e)){if(J(h)&&!Array.isArray(h)){if(d.startsWith("@"))l.push([d,h]);else if(!d.startsWith("--"))u.push([d,h]);continue}if(oi(d)||d.startsWith("@"))continue;if(d.startsWith("--")||d==="colorScheme"||d==="color-scheme")a[d]=h;else c[d]=h}o(a,i.root),o(c,i.body);for(let[d,h]of u)if(d.startsWith("&"))o({[d]:h},i.root);else o(h,d);for(let[d,h]of l){if(Qo(d)||ea(d)){o({[d]:h},null);continue}let m={},y={},g=[];for(let[b,x]of Object.entries(h)){if(J(x)&&!Array.isArray(x)){if(!b.startsWith("@"))g.push([b,x]);continue}if(b.startsWith("--"))m[b]=x;else y[b]=x}o({[d]:m},i.root),o({[d]:y},i.body);for(let[b,x]of g)o({[d]:x},b)}if(Object.values(t).some((d)=>Wr(d)!==null)&&!("colorScheme"in e))s.push(`${i.root} { color-scheme: light dark }`,`${i.root}:where([${Vr}="light"]) { color-scheme: light }`,`${i.root}:where([${Vr}="dark"]) { color-scheme: dark }`);return s.join(`
76
- `)}var ST;var mb=L(()=>{Hc();Ee();ST={body:"body",root:":root"}});function hb(e){return e===!1||e==="open"||e==="closed"}function Yi(e,t){let r=e?.$shadow;if(hb(r))return r===!1?null:r;let n=t?.shadow;return hb(n)&&n!==!1?n:null}function gb(e,t){return t===null?e:":host"}function sa(e,t){let r=[];for(let[n,i]of(e.parameters??[]).entries()){let s=yb(i);if(!s)continue;let o=bb(i)?`_a[${n}] === undefined ? ${JSON.stringify(i.default)} : _a[${n}]`:`_a[${n}]`;r.push(`${JSON.stringify(s)}: ${o}`)}return`(..._a) => { const _args = { ${r.join(", ")} }; return ${t}; }`}function yb(e){return T(e)?e:e?.name??""}function bb(e){return J(e)&&"default"in e}function Yc(e,t){let r=Yf(e,t);return r===e?e:`${r} as ${e}`}function Yf(e,t){let r=t?.$export;return T(r)&&r!==""?r:e}function Xc(e,t,r={}){let{statePrefix:n="state",indent:i="",collect:s}=r,{url:o}=t,a=he(o),c=t.method??"GET";if(t.manual)return`${i}// ${e}: manual Request — fetch triggered by user action`;let l=[`// ${e}: auto-fetch from ${a?"(dynamic URL)":o}`,s?`${s}.push(effect(() => {`:"effect(() => {"];if(a)l.push(` const url = \`${ET(o,n)}\`;`,' if (!url || url === "undefined" || url.includes("undefined")) return;');else l.push(` const url = ${JSON.stringify(o)};`);let u=[];if(c!=="GET")u.push(`method: ${JSON.stringify(c)}`);if(t.headers)u.push(`headers: ${JSON.stringify(t.headers)}`);if(t.body){let h=J(t.body)?JSON.stringify(JSON.stringify(t.body)):JSON.stringify(t.body);u.push(`body: ${h}`)}let d=u.length>0?`, { ${u.join(", ")} }`:"";return l.push(` fetch(url${d})`," .then(r => r.ok ? r.json() : Promise.reject(r.statusText))",` .then(d => { ${n}.${e} = d; })`,` .catch(e => { ${n}.${e} = { error: String(e) }; });`,s?"}));":"});"),l.map((h)=>`${i}${h}`).join(`
77
- `)}function ET(e,t){if(t==="state")return e;return e.replaceAll(/\$\{([^}]*)\}/g,(r,n)=>`\${${n.replaceAll(/(?<!this\.)\bstate\./g,`${t}.`)}}`)}function Qc(e){if(!J(e))return!1;if(e.state)for(let[t,r]of Object.entries(e.state)){if(t==="$site"||t==="$page")continue;if(!J(r)||Array.isArray(r))return!0;if(r.timing==="compiler")continue;if(r.$prototype)return!0;if("default"in r)return!0;if(ei(r))continue;return!0}if(e.$switch)return!0;if(lt(e)||af(e.children))return!0;if(Array.isArray(e.children)&&e.children.some((t)=>Qc(t)))return!0;for(let[t,r]of Object.entries(e)){if(Mn.has(t))continue;if(Je(r))return!0;if(he(r))return!0}if(J(e.style)){for(let t of Object.values(e.style))if(he(t))return!0}if(J(e.attributes)){for(let t of Object.values(e.attributes))if(he(t))return!0}return!1}function $b(e){if(!J(e))return!1;if(e.$switch)return!0;if(lt(e)||af(e.children))return!0;for(let[t,r]of Object.entries(e)){if(Mn.has(t))continue;if(Je(r))return!0;if(he(r))return!0}if(J(e.style)){for(let t of Object.values(e.style))if(he(t))return!0}if(J(e.attributes)){for(let t of Object.values(e.attributes))if(he(t))return!0}return!1}function Ms(e,t=null,r={},n={}){let i=e?.state?Cs(e.state,t):t??vb();return{media:n,scope:i,scopeDefs:r}}function vb(e=null){return Object.create(e)}function wb(e){return e[xb]}function Kf(e,t){if(T(e)){for(let s of e.matchAll(_T))t.add(s[1]);for(let s of e.matchAll(PT))t.add(s[1]);return}if(Array.isArray(e)){for(let s of e)Kf(s,t);return}if(!J(e))return;let r=e,{operator:n,target:i}=r;if(T(n)&&Nn(n)&&Je(i)&&i.$ref.startsWith("#/state/"))t.add(i.$ref.slice(8).split("/")[0]);for(let s of Object.values(r))Kf(s,t)}function Cs(e={},t=null){let r=vb(t),n=t?wb(t):void 0,i=new Set(n);Object.defineProperty(r,xb,{configurable:!0,enumerable:!1,value:i,writable:!0});let s=new Set;for(let l of Object.values(e))if(xr(l)||$r(l))Kf(l.body??l.$expression,s);for(let l of s)if(l in e)i.add(l);for(let[l,u]of Object.entries(e)){if(!J(u)||Array.isArray(u)){Ln(r,l,Kc(u));continue}if("default"in u){Ln(r,l,Kc(u.default));continue}if(!u.$prototype&&!("$expression"in u)&&!ei(u))Ln(r,l,Kc(u))}let o=[],a=[];for(let[l,u]of Object.entries(e)){if(he(u)){o.push([l,u]);continue}if(!J(u))continue;if($r(u)){let d=u.$expression;if(Ni(u)){let h=u.parameters;Ln(r,l,(...m)=>{let y={};for(let[g,b]of h.entries()){let x=yb(b);if(!x)continue;y[x]=m[g]===void 0&&bb(b)?b.default:m[g]}return Er(d,r,null,{args:y})})}else if(Nn(d.operator))Ln(r,l,(h,m)=>Er(d,h,m));else Wf(r,l,()=>Er(d,r,null));continue}if(xr(u)){if(Zn(u)){let{body:d}=u;Ln(r,l,(h,m)=>{js(d,h??r,m??null)})}else if(T(u.body)){let d=u.parameters?Rn(u.parameters):u.arguments??[],{body:h}=u,m=d.includes("state")?d:["state",...d],y=Function(...m,h),g=(b,x)=>y(...m.map((_)=>_==="state"?b:x));if(Mi(h))Wf(r,l,()=>g(r)),a.push([l,h]);else Ln(r,l,g)}else Ln(r,l,()=>{}),i.add(l);continue}if(un(u)&&(u.$prototype==="LocalStorage"||u.$prototype==="SessionStorage")){Ln(r,l,Kc(u.default??null));continue}if(un(u)&&u.$prototype==="Request")i.add(l)}let c=!0;while(c){c=!1;for(let[l,u]of[...a,...o])if(!i.has(l)&&Sb(u,r))i.add(l),c=!0}for(let[l,u]of o)Wf(r,l,()=>It(u,r));return r}function Ln(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0})}function Wf(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:r})}function Be(e,t){if(Je(e))return Xf(e.$ref,t);if(he(e))return It(e,t);return e}function cr(e){return Je(e)}function Xf(e,t){if(!T(e))return e;if(e.startsWith("$map/")){let r=e.split("/"),n=r[1],s=t.$map?.[n]??t[`$map/${n}`];return r.length>2?zf(s,r.slice(2).join("/")):s}if(e.startsWith("#/state/"))return zf(t,e.slice(8));return zf(t,e)??null}function Sb(e,t){if(!t)return!1;let r=wb(t);for(let n of e.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*(\()?/g)){if(n[2])continue;let i=n[1];if(r?.has(i))return!0;let s;try{s=t[i]}catch{continue}if(Ot(s))return!0}return!1}function Zc(e){return Rs(e)?`(${e.slice(2,-1)})`:`\`${e}\``}function It(e,t){if(Sb(e,t))return null;let r=["state","$map","$site","$page"],n=[t,t?.$map,t?.$site,t?.$page];try{let i=Rs(e)?`return (${e.slice(2,-1)})`:`return \`${e}\``;return Function(...r,i)(...n)}catch{return null}}function zf(e,t){return Et(e,t)}function Kc(e){if(!J(e))return e;return structuredClone(e)}function kT(e,t){if(!e||!t)return"";return Object.entries(e).filter(([r,n])=>!r.startsWith(":")&&!r.startsWith(".")&&!r.startsWith("&")&&!r.startsWith("[")&&!r.startsWith("@")&&he(n)).map(([r,n])=>{let i=Be(n,t);return i==null?null:`${ar(r)}: ${i}`}).filter(Boolean).join("; ")}function Xi(e,t,r=""){let n="",i=Be(e.id,t),s=Be(e.className,t),o=Be(e.hidden,t),a=Be(e.tabIndex,t),c=Be(e.title,t),l=Be(e.lang,t),u=Be(e.dir,t);if(i)n+=` id="${Se(String(i))}"`;if(s)n+=` class="${Se(String(s))}"`;if(o)n+=" hidden";if(a!==void 0&&a!==null)n+=` tabindex="${Se(String(a))}"`;if(c)n+=` title="${Se(String(c))}"`;if(l)n+=` lang="${Se(String(l))}"`;if(u)n+=` dir="${Se(String(u))}"`;let d=[kT(e.style,t),r].filter(Boolean).join("; ");if(d)n+=` style="${Se(d)}"`;if(e.attributes)for(let[h,m]of Object.entries(e.attributes)){let y=Be(m,t);if(Rt(y)){let g=Gi(h,y);if(g!==null)n+=g===""?` ${h}`:` ${h}="${Se(g)}"`;continue}if(T(y)||Ir(y))n+=` ${h}="${Se(String(y))}"`}if(e.$static)n+=" data-jx-static";else if(e.$prerendered)n+=" data-jx-prerendered";return n}function oa(e,t=" "){return e?"":`
78
- ${t}`}function Ls(){let e=JSON.stringify(Bc),t=JSON.stringify(Vr);return`(function(){try{var s=localStorage.getItem(${e});if(s==="light"||s==="dark"){document.documentElement.setAttribute(${t},s)}}catch(e){}})()`}function Gc(e,t,r,n){for(let i of _s(t,{mediaQueries:n,resolveValue:(s,o)=>Eb(s,o,r),scope:r}))e.push(i.text)}function Eb(e,t,r){let n=T(t)?t:t.$ref;return AT.push({property:e,selector:r,source:n}),null}function el(){return`const __jxEnumAttrs = new Set(${JSON.stringify(db())});
79
- function ${Ds}(n, v) {
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}=aR();if(t)return["node",[e]];else return[e,[]]}},Wi=()=>uR.isatty(2),dR={readFile(e,t){try{let r=us.readFileSync(e,"utf8");try{us.unlinkSync(e)}catch{}t(null,r)}catch(r){t(r,null)}},writeFile(e,t){try{let r=rh();us.writeFileSync(r,e),t(r)}catch{t(null)}}},fR={readFile(e,t){try{us.readFile(e,"utf8",(r,n)=>{try{us.unlink(e,()=>t(r,n))}catch{t(r,n)}})}catch(r){t(r,null)}},writeFile(e,t){try{let r=rh();us.writeFile(r,e,(n)=>n!==null?t(null):t(r))}catch{t(null)}}},pR="0.28.2",mR=(e)=>ps().build(e),hR=(e)=>ps().context(e),gR=(e,t)=>ps().transform(e,t),yR=(e,t)=>ps().formatMessages(e,t),bR=(e,t)=>ps().analyzeMetafile(e,t),xR=(e)=>{if(kt&&!zi){if(!Rt)Rt=Sa(kt);return Rt.buildSync(e)}let t;return wa((r)=>r.buildOrContext({callName:"buildSync",refs:null,options:e,isTTY:Wi(),defaultWD:ds,callback:(n,s)=>{if(n)throw n;t=s}})),t},$R=(e,t)=>{if(kt&&!zi){if(!Rt)Rt=Sa(kt);return Rt.transformSync(e,t)}let r;return wa((n)=>n.transform({callName:"transformSync",refs:null,input:e,options:t||{},isTTY:Wi(),fs:dR,callback:(s,i)=>{if(s)throw s;r=i}})),r},vR=(e,t)=>{if(kt&&!zi){if(!Rt)Rt=Sa(kt);return Rt.formatMessagesSync(e,t)}let r;return wa((n)=>n.formatMessages({callName:"formatMessagesSync",refs:null,messages:e,options:t,callback:(s,i)=>{if(s)throw s;r=i}})),r},wR=(e,t)=>{if(kt&&!zi){if(!Rt)Rt=Sa(kt);return Rt.analyzeMetafileSync(e,t)}let r;return wa((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},SR=()=>{if($a)$a();if(Rt)Rt.stop();return Promise.resolve()},qc=!1,ER=(e)=>{if(e=Kk(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(qc)throw Error('Cannot call "initialize" more than once');return ps(),qc=!0,Promise.resolve()},ds=process.cwd(),Vi,$a,ps=()=>{if(Vi)return Vi;let[e,t]=th(),r=eh.spawn(e,t.concat("--service=0.28.2","--ping"),{windowsHide:!0,stdio:["pipe","pipe","inherit"],cwd:ds}),{readFromStdout:n,afterClose:s,service:i}=Xm({writeToStdin(d){r.stdin.write(d,(p)=>{if(p)s(p)})},readFileSync:us.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),$a=()=>{o.destroy(),a.destroy(),r.kill(),qc=!1,Vi=void 0,$a=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:Wi(),defaultWD:ds,callback:(m,b)=>m?h(m):p(b)})}),context:(d)=>new Promise((p,h)=>i.buildOrContext({callName:"context",refs:c,options:d,isTTY:Wi(),defaultWD:ds,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:Wi(),fs:fR,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},wa=(e)=>{let[t,r]=th(),n=new Uint8Array,{readFromStdout:s,afterClose:i,service:o}=Xm({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=eh.execFileSync(t,r.concat("--service=0.28.2"),{cwd:ds,windowsHide:!0,input:n,maxBuffer:+process.env.ESBUILD_MAX_BUFFER||16777216});s(a),i(null)},rh=()=>Fc.join(cR.tmpdir(),`esbuild-${lR.randomBytes(32).toString("hex")}`),Rt=null,Sa=(e)=>{let{port1:t,port2:r}=new e.MessageChannel,n=new e.Worker(__filename,{workerData:{workerPort:r,defaultWD:ds,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(),Rt=null}}},_R=()=>{let e=kt.workerData.workerPort,t=kt.parentPort,r=(n)=>{let s={};if(n&&typeof n==="object")for(let i in n)s[i]=n[i];return s};try{let n=ps();ds=kt.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)_R();var PR=Ui});import{createRequire as jR}from"node:module";import{join as kR}from"node:path";function Vc(e,t){return jR(kR(t,"package.json")).resolve(e)}function RR(e){return e==="node"||e==="bun"?"node":"browser"}async function Bc(e){let t=await Promise.resolve().then(() => Lt(Ea(),1)),{entry:r}=e,n={bundle:!0,external:e.external,format:"esm",logLevel:"silent",minify:e.minify,platform:RR(e.target),plugins:e.plugins,write:!1};if(e.conditions)n.conditions=e.conditions;if(e.define)n.define=e.define;if("path"in r)n.entryPoints=[r.path];else n.stdin={contents:r.source,loader:"js",resolveDir:r.resolveDir,sourcefile:"jx-entry.js"};return(await t.build({...n,write:!1})).outputFiles[0].text}var sh=()=>{};var ih=".jx-entry-";import{rmSync as OR,writeFileSync as oh}from"node:fs";import{tmpdir as CR}from"node:os";import{basename as NR,join as TR,resolve as IR}from"node:path";function lh(e){return os(e)||e.startsWith("./")||e.startsWith("../")}function Wc(e,t,r){if(os(e))return Vc(e.slice(ua.length),r);return IR(t,e)}function ch(e,t){return Vc(e,t)}function MR(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 JR(e){if(e==="cloudflare-workers"||e==="cloudflare-pages")return{conditions:["workerd","worker"],external:["cloudflare:*","node:*"],target:"workerd"};return{target:e==="bun"?"bun":"node"}}function LR(e){return e.minify??e.target==="browser"}function FR(e){let t={};if(e.conditions)t.conditions=e.conditions;if(e.target==="browser")t.define={...DR};return t}function uh(e){return{...FR(e),external:e.external??[],minify:LR(e),plugins:MR(e),target:e.target}}async function dh(e,t){let r=await Bc({entry:{path:e.entryPath},...uh(t)});oh(e.outfile,r,"utf8")}function Uc(e){return e==="<stdin>"||NR(e).startsWith(ih)}async function fh(e,t,r){let n=[],s=TR(CR(),`jx-resolve-${process.pid}.js`);try{await ms(`export * from ${JSON.stringify(e)};
72
+ `,{outfile:s,resolveDir:t},{...r,minify:!1,onFileLoaded:(i)=>n.push(i)})}catch{return}finally{OR(s,{force:!0})}return n.find((i)=>!Uc(i))}async function ms(e,{resolveDir:t,outfile:r},n){let s=await Bc({entry:{resolveDir:t,source:e},...uh(n)});oh(r,s,"utf8")}async function ph(e,{projectRoot:t,outfile:r,adapter:n}){await ms(e,{outfile:r,resolveDir:t},JR(n))}var ah,DR;var zc=q(()=>{nr();sh();ah=["@vue/reactivity","lit-html"];DR={"process.env.NODE_ENV":'"production"'}});function HR(e){return e.split("\\").join("/").replace(/^\.\//,"").replace(/^\//,"").replace(/^pages\//,"")}function mh(e){let t=HR(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(qR,(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 hh(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 qR;var gh=q(()=>{qR=/\[\.\.\.(\w+)\]|\[(\w+)\]/g});function dr(e){if(!T(e)||e.trim()==="")return null;try{return new Intl.Locale(e.trim()).toString()}catch{return null}}function Gi(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&&VR.has(n)?"rtl":"ltr"}function yh(e){let t=dr(e);if(t===null)return T(e)?e:"";return new Intl.DisplayNames([t],{type:"language"}).of(t)??t}function Gc(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:BR;return{errors:r,i18n:{defaultLocale:i,locales:s,routing:o}}}function Tr(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 VR,_a="^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$",BR="prefix-except-default";var hs=q(()=>{ve();VR=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 bh(e,t){if(e.startsWith("@--"))return t[e.slice(1)]??e.slice(1);if(e.startsWith("@(")){let r=e.slice(2,-1).trim();return WR.has(r.toLowerCase())?r:e.slice(1)}return null}function Ki(e){return e.startsWith("@position-try")||e.startsWith("@property")||e.startsWith("@font-face")||e.startsWith("@counter-style")}function Xi(e){return e.startsWith("@keyframes")}function xh(e,t){let r=[];for(let n of Yi(e))for(let s of Yi(t))r.push(UR(n,s));return r.join(", ")}function UR(e,t){let r=ja(t,e);if(r!==null)return r;if(t.startsWith("[")||t.startsWith(":")||t.startsWith("."))return`${e}${t}`;return`${e} ${t}`}function Kc(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 ja(e,t){return Kc(e).length>0?zR(e,t):null}function zR(e,t){let r="",n=0;for(let s of Kc(e))r+=e.slice(n,s)+t,n=s+1;return r+e.slice(n)}function Yi(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 Yc(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 Cn(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}function Xc(e){return e.startsWith("--")?e:Vt(e)}function Pa(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 $h(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 GR(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 KR(e){let t=Object.keys(e).filter((n)=>Xi(n));if(t.length===0)return e;let r={...e};for(let n of t)delete r[n];return r}function YR(e){let r=Kc(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(!Ki(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("@")||Cn(E)))continue;if(E.startsWith("$"))continue;let R=d(E,O,j,S);if(R!==null)P.push([Xc(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=$h(y,E,j),R={text:O,conditions:[...y],selector:E,declarations:j,target:S,key:Pa(O)};if(T(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=GR(j,S,P);a.push({blocks:P,conditions:[...j],declarations:[],key:Pa(E),selector:null,target:"unscoped",text:E})},b=(y,v,j,S,P)=>{if(y==="@--")return;if(Ki(y)){h([...S,y],null,p(v,!1,!0,"unscoped"),"unscoped",v.$description);return}if(Xi(y)){m(y,v,S);return}let E=bh(y,n),O=E===null?y:`@media ${E}`,R=E===null?null:wr(E);if(R!==null&&j!==null){let{auto:k,forced:I}=Yc(j,R);g(v,k,[...S,O],P),g(KR(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,xh(v,P),j,YR(P)?S:"descendant")}return g(e,r,[],"self"),a}var WR,vr="data-color-scheme",ka="jx-color-scheme";var Zi=q(()=>{ve();WR=new Set(["all","print","screen","speech"])});function Sh(){return`the Intl helpers ${Qc.join(", ")}`}var Ir="en-US",Zc="UTC",vh,Qc,wh;var eu=q(()=>{vh=[{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."}],Qc=vh.map((e)=>e.path),wh=Object.fromEntries(vh.map((e)=>[e.path,e.params.indexOf("locale")]))});function XR(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)=>XR(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+=tu.test(n)?`.${n}`:`[${JSON.stringify(n)}]`;return r}function Eh(e,t){let r=e;for(let[n,s]of cn(t).entries()){let i=n===0?"":"?.";r+=tu.test(s)?`${n===0?".":i}${s}`:`${i}[${JSON.stringify(s)}]`}return r}function un(e){return tu.test(e)?e:JSON.stringify(e)}function _h(e){let t=e.replaceAll(/[^A-Za-z0-9_$]/g,"_");if(t==="")return"ref";return/^\d/.test(t)?`_${t}`:t}var tu;var Hs=q(()=>{tu=/^[A-Za-z_$][A-Za-z0-9_$]*$/});function ru(e){let t=e.$map;return F(t)?t:void 0}function Rh(e){return F(e)&&!Array.isArray(e)&&"operator"in e}function Qi(e){return F(e)&&!Array.isArray(e)&&"$ref"in e}function tA(e,t,r){let n=wh[e];if(n===void 0||n<0||t[n]!=null)return t;let s=mt(r.$page,"locale");if(!T(s)||s==="")return t;let i=[...t];return i[n]=s,i}function Nh(e){return e.startsWith("window#/")&&QR.has(e.slice(8))}function dn(e){return Ah.has(e)}function Ke(e,t){if(!e)return;let r=(e.depth??0)+1;if(r>rA)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(Rh(e))return ir(e,t,r,n,s);if(Qi(e)){let i=Ra(e.$ref,t,r,n);return s?.report(s.path??[],i),i}if(Array.isArray(e))return Th(e,t,r,n,s);return s?.report(s.path??[],e),e}function Th(e,t,r,n,s){return e.map((i,o)=>Fe(i,t,r,n,Ke(s,o)))}function nA(e,t,r,n){let s=(i)=>{if(!e.slice(i.length).includes("/"))return t;return Ra(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?Ra(e.slice(0,e.lastIndexOf("/")),t,r,n):void 0;return}function Ra(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=ru(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 sA(e,t,r,n){if(e.startsWith("$map/")){let s=e.split("/"),[,i]=s,o,a=ru(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:ru(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=iA(e,t,r,n,s);return s?.report(s.path??[],i),i}function jh(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 iA(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(nu.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=Qi(o)?o.$ref:void 0;if(!T(c))throw TypeError("$expression: call target must be a $ref pointer");let d=(n?.callDepth??0)+1;if(d>Ph)throw Error(`$expression: call depth exceeded (${Ph})`);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=eA.get(m);if(b)return b(...tA(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=Ra(c,t,r,n);if(vt(h))return h.apply(nA(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=T(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(ou.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(su.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 jh(i,c,d)}}if(Oh.has(i)){let c=Fe(a,t,r,n,Ke(s,"value")),{obj:d,key:p}=sA(o.$ref,t,r,n);d[p]=i==="="?c:jh(i.slice(0,-1),d[p],c);return}if(Ch.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(au.has(i)){let c=Fe(o,t,r,n,Ke(s,"target")),d=a===void 0?[]:Array.isArray(a)?Th(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(iu.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(Rh(e))return At(e,t);if(Qi(e))return lu(e.$ref,t);if(Array.isArray(e))return e.map((r)=>Ze(r,t)).join(", ");return JSON.stringify(e)}function oA(e){return`_fx_${e.replaceAll(/[^A-Za-z0-9_$]/g,"_")}`}function lu(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 kh(e,t){if(Qi(e))return lu(e.$ref,t);return Ze(e,t)}function aA(e,t,r){let n=(o)=>t[o]??"undefined",s=`(${r.statePrefix??"state"}?.$page?.locale ?? ${JSON.stringify(Ir)})`,i=JSON.stringify(Zc);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 At(e,t={}){let{operator:r,target:n,value:s,initial:i}=e;if(nu.has(r)&&!("value"in e)){let o=Ze(n,t);if(r==="!")return`!(${o})`;if(r==="-")return`-(${o})`}if(r==="call"){let o=(Qi(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=aA(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`${oA(l)}(${t.statePrefix??"state"}, { ${d} })`}}return`${lu(o,t)}(${a.join(", ")})`}if(ou.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(su.has(r)){let o=Ze(n,t),a=Ze(s,t);return`(${o} ${r} ${a})`}if(Oh.has(r)){let o=kh(n,t),a=Ze(s,t);return`${o} ${r} ${a}`}if(Ch.has(r)){let o=kh(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(au.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(iu.has(r)){let o=Ze(n,t),a=At(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 Ah,nu,su,Oh,Ch,iu,ou,au,ZR,QR,eA,Ph=64,rA=64;var eo=q(()=>{eu();ve();Hs();Ah=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),nu=new Set(["!","-"]),su=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),Oh=new Set(["=","+=","-=","*=","/="]),Ch=new Set(["push","pop","shift","unshift","splice"]),iu=new Set(["reduce","map","filter"]),ou=new Set(["?:","switch"]),au=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([...Ah,...nu,...su,...iu,...ou,...au,"call"]),QR=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",...Qc]),eA=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:Zc,...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 Ih(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 lA(e){return(F(e)||vt(e))&&"then"in e&&vt(e.then)}async function Bs(e,t,r,n={}){let s=n.args?{args:n.args}:void 0;for(let i of e){let o=Ih(i);switch(o.kind){case"expression":{let a=ir(o.node,t,r,s);if(lA(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 Bs(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 Bs(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=Ih(s);switch(i.kind){case"expression":{n.push(`${r}${At(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(`
73
+ `)}var Aa=q(()=>{ve();eo()});function Ws(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 Jh(){return[...Mh].toSorted()}function gs(e,t){let r=e.toLowerCase();if(r.startsWith("aria-")||Mh.has(r))return String(t);return t?"":null}var pn,Mh,cu=32,Oa,Ca="jx-slot",to="data-jx-slots",uu="jx.slot.group",e8;var Us=q(()=>{Zi();eo();Hs();ve();nr();Aa();Zi();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"]),Mh=new Set(["contenteditable","draggable","spellcheck"]);Oa=/^[\t\n\f\r ]+$/u,e8=(()=>{let e=Symbol.for(uu),t=globalThis;return t[e]??=new WeakMap,t[e]})()});function Dh(e,t,r,n,s=uA){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(Cn(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(Ki(p)||Xi(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(`
74
+ `)}var uA;var Lh=q(()=>{Zi();ve();uA={body:"body",root:":root"}});function Fh(e){return e===!1||e==="open"||e==="closed"}function ys(e,t){let r=e?.$shadow;if(Fh(r))return r===!1?null:r;let n=t?.shadow;return Fh(n)&&n!==!1?n:null}function qh(e,t){return t===null?e:":host"}function no(e,t){let r=[];for(let[n,s]of(e.parameters??[]).entries()){let i=Hh(s);if(!i)continue;let o=Vh(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 Hh(e){return T(e)?e:e?.name??""}function Vh(e){return F(e)&&"default"in e}function Ia(e,t){let r=hu(e,t);return r===e?e:`${r} as ${e}`}function hu(e,t){let r=t?.$export;return T(r)&&r!==""?r:e}function Ma(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 = \`${fA(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(`
75
+ `)}function Ja(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(dA.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=`${Yh}(${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(`
76
+ `)}function fA(e,t){if(t==="state")return e;return e.replaceAll(/\$\{([^}]*)\}/g,(r,n)=>`\${${n.replaceAll(/(?<!this\.)\bstate\./g,`${t}.`)}}`)}function Da(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(Pn(r))continue;return!0}if(e.$switch)return!0;if(Qe(e)||_c(e.children))return!0;if(Array.isArray(e.children)&&e.children.some((t)=>Da(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 Wh(e){if(!F(e))return!1;if(e.$switch)return!0;if(Qe(e)||_c(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??Uh();return{media:n,scope:s,scopeDefs:r}}function Uh(e=null){return Object.create(e)}function zh(e){return e[Bh]}function pu(e,t){if(T(e)){for(let i of e.matchAll(pA))t.add(i[1]);for(let i of e.matchAll(mA))t.add(i[1]);return}if(Array.isArray(e)){for(let i of e)pu(i,t);return}if(!F(e))return;let r=e,{operator:n,target:s}=r;if(T(n)&&dn(n)&&Ce(s)&&s.$ref.startsWith("#/state/"))t.add(s.$ref.slice(8).split("/")[0]);for(let i of Object.values(r))pu(i,t)}function zs(e={},t=null){let r=Uh(t),n=t?zh(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))pu(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,Na(d));continue}if("default"in d){mn(r,c,Na(d.default));continue}if(tn(d)){s.add(c);continue}if(!d.$prototype&&!("$expression"in d)&&!Pn(d))mn(r,c,Na(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(ns(d)){let h=d.parameters;mn(r,c,(...m)=>{let b={};for(let[g,y]of h.entries()){let v=Hh(y);if(!v)continue;b[v]=m[g]===void 0&&Vh(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 du(r,c,()=>ir(p,r,null));continue}if(er(d)){if(_n(d)){let{body:p}=d;mn(r,c,(h,m)=>{Bs(p,h??r,m??null)})}else if(T(d.body)){let p=d.parameters?rn(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(ss(h))du(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,Na(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)&&Gh(d,r))s.add(c),l=!0}for(let[c,d]of o)du(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 du(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:r})}function Me(e,t){if(Ce(e))return gu(e.$ref,t);if(pe(e))return wt(e,t);return e}function Bt(e){return Ce(e)}function gu(e,t){if(!T(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?fu(i,r.slice(2).join("/")):i}if(e.startsWith("#/state/"))return fu(t,e.slice(8));return fu(t,e)??null}function Gh(e,t){if(!t)return!1;let r=zh(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 La(e){return Ws(e)?`(${e.slice(2,-1)})`:`\`${e}\``}function wt(e,t){if(Gh(e,t))return null;let r=["state","$map","$site","$page"],n=[t,t?.$map,t?.$site,t?.$page];try{let s=Ws(e)?`return (${e.slice(2,-1)})`:`return \`${e}\``;return Function(...r,s)(...n)}catch{return null}}function fu(e,t){return mt(e,t)}function Na(e){if(!F(e))return e;return structuredClone(e)}function hA(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=[hA(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(T(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 so(e,t=" "){return e?"":`
77
+ ${t}`}function Zs(){let e=JSON.stringify(ka),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 Ta(e,t,r,n){for(let s of qs(t,{mediaQueries:n,resolveValue:(i,o)=>Kh(i,o,r),scope:r}))e.push(s.text)}function Kh(e,t,r){let n=T(t)?t:t.$ref;return gA.push({property:e,selector:r,source:n}),null}function Fa(){return`const __jxEnumAttrs = new Set(${JSON.stringify(Jh())});
78
+ function ${Qs}(n, v) {
80
79
  if (typeof v !== 'boolean') return v;
81
80
  const l = n.toLowerCase();
82
81
  if (l.startsWith('aria-') || __jxEnumAttrs.has(l)) return String(v);
83
82
  return v ? '' : null;
84
- }`}function _b(){let e=`new RegExp(${JSON.stringify(Wc.source)}, ${JSON.stringify(Wc.flags)})`,t=`Symbol.for(${JSON.stringify(Vf)})`,r=JSON.stringify(na),n=JSON.stringify(zc);return[`const __jxSlotWs = ${e};`,`const __jxSlotRec = globalThis[${t}] || (globalThis[${t}] = new WeakMap());`,`function ${Qf}(host) {`,` const id = host.getAttribute(${r});`," if (id === null) return Array.from(host.childNodes);",` host.removeAttribute(${r});`,` const open = ${n} + ' ' + id + ' ';`,` const close = '/' + ${n} + ' ' + id;`," const openers = [];"," const w = host.ownerDocument.createTreeWalker(host, 128);"," for (let n = w.nextNode(); n; n = w.nextNode()) if (n.data.startsWith(open)) openers.push(n);"," const out = [];"," for (const o of openers) {"," const name = decodeURIComponent(o.data.slice(open.length));"," for (let n = o.nextSibling; n; n = n.nextSibling) {"," if (n.nodeType === 8 && n.data === close) break;"," __jxSlotRec.set(n, name);"," out.push(n);"," }"," }"," return out;","}",`function ${Zf}(host, captured) {`," const slots = Array.from(host.querySelectorAll('slot'));"," if (slots.length === 0) return;"," const groups = new Map();"," for (const n of captured) {"," if (n.nodeType === 3 && __jxSlotWs.test(n.data)) continue;"," const r = __jxSlotRec.get(n);"," __jxSlotRec.delete(n);"," const name = r !== undefined ? r : n.nodeType === 1 ? n.getAttribute('slot') || '' : '';"," let g = groups.get(name);"," if (!g) { g = []; groups.set(name, g); }"," g.push(n);"," }"," const taken = new Set();"," for (const slot of slots) {"," const name = slot.getAttribute('name') || '';"," let g = [];"," if (!taken.has(name)) { taken.add(name); g = groups.get(name) || []; }"," const content = g.some((n) => n.nodeType === 1 || (n.nodeType === 3 && n.data !== ''));"," const placed = content ? g : g.concat(Array.from(slot.childNodes));"," const p = slot.parentElement;"," if (p && p !== host && p.localName.includes('-')) {"," const r = __jxSlotRec.get(slot);"," const f = r !== undefined ? r : slot.getAttribute('slot') || '';"," for (const n of placed) __jxSlotRec.set(n, f);"," }"," slot.replaceWith(...placed);"," }","}"].join(`
85
- `)}function ci(e){for(let t of ed(e)){if(lt(t)){if(t.map&&ci([t.map]))return!0;continue}if(!ir(t))continue;if(t.tagName==="slot")return!0;let r=Object.values(t.cases??{}).filter((n)=>ir(n)&&!cr(n));if(ci(r)||ci(t.children))return!0}return!1}function ed(e){if(lt(e))return[e];if(!Array.isArray(e))return[];return e}function Fs(e,t={},r=null){let n=[],i=pb(J(r)?r:{},t,(o)=>o,Eb);if(i!=="")n.push(i);if(li(e,n,t,"",{n:0}),n.length===0)return"";return`<style>
86
- ${tl(n.join(`
83
+ }`}function qa(){return[`async function ${Yh}(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(`
84
+ `)}function Xh(){let e=`new RegExp(${JSON.stringify(Oa.source)}, ${JSON.stringify(Oa.flags)})`,t=`Symbol.for(${JSON.stringify(uu)})`,r=JSON.stringify(to),n=JSON.stringify(Ca);return[`const __jxSlotWs = ${e};`,`const __jxSlotRec = globalThis[${t}] || (globalThis[${t}] = new WeakMap());`,`function ${yu}(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 ${bu}(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 Nn(e){for(let t of xu(e)){if(Qe(t)){if(t.map&&Nn([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)&&!Bt(n));if(Nn(r)||Nn(t.children))return!0}return!1}function xu(e){if(Qe(e))return[e];if(!Array.isArray(e))return[];return e}function ti(e,t={},r=null){let n=[],s=Dh(F(r)?r:{},t,(o)=>o,Kh);if(s!=="")n.push(s);if(Tn(e,n,t,"",{n:0}),n.length===0)return"";return`<style>
86
+ ${Ha(n.join(`
87
87
  `))}
88
- </style>`}function tl(e){return e.replaceAll(/<\/(?=style)/gi,String.raw`<\/`)}function li(e,t,r,n="",i,s="jx"){let o=i??{n:0};if(!J(e))return;if(e.style&&!e.id&&!e.className)e.className=`${s}-${o.n}`,o.n+=1;let a=$s(e.tagName).join(", ")||"*",c=e.id?`#${e.id}`:e.className?`.${e.className.split(" ")[0]}`:a;if(e.style)Gc(t,e.style,c,r);if(Array.isArray(e.children))for(let l of e.children)li(l,t,r,c,o,s);if(J(e.cases))for(let l of Object.values(e.cases))li(l,t,r,c,o,s)}function Se(e){return String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function rl(e){return e.split("-").map((t)=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}function nl(e){let t=new Map;return Pb(e,t),[...t.values()]}function Pb(e,t){if(!J(e))return;if(e.state){for(let[r,n]of Object.entries(e.state))if(of(n))t.set(n.$export,{exportName:n.$export,key:r,src:n.$src})}if(Array.isArray(e.children))for(let r of e.children)Pb(r,t)}function rd(e,t){if(T(e))return e;let r=$s(e);if(r.length===0)return"div";if(!fn(e))return r[0];let n=e.$expression,i=n.target;if(n.operator==="?:")return Be(i,t)?n.value:n.initial;let s=Be(i,t);return n.cases[String(s)]??n.default}function nd(e){if(!e?.slotIds)return null;return e.slotIds.n+=1,e.slotIds.n}function id(e,t,r,n=null){let i=new Map;for(let s of ed(e)){let o="",a=!0,c;if(T(s)||Ir(s)||Rt(s)){if(c=r(s),Wc.test(c))continue;a=c!==""}else if(lt(s))c="";else if(!ir(s))c=r(s),a=c!=="";else{let u=Be(s.attributes?.slot,t),d=T(s.slot)?Be(s.slot,t):null;if(T(u)&&u!=="")o=u,c=r(s);else if(T(d)&&d!==""){o=d;let{slot:h,...m}=s;c=r({...m,attributes:{...m.attributes,slot:d}})}else c=r(s)}let l=i.get(o);if(l)l.html=l.html===""?c:`${l.html}
89
- ${c}`,l.content||=a;else i.set(o,{content:a,html:c})}return{groups:i,id:n,taken:new Set}}function kb(e,t,r){for(let n of ed(e)){if(lt(n)||!ir(n))continue;if(n.tagName==="slot"){let i=Be(n.attributes?.name,t);r.taken.add(T(i)?i:"")}kb(n.children,t,r)}}function sd(e){let t=null,r={};for(let[n,i]of Object.entries(e??{}))if(n.startsWith("props.")&&n.length>6)t??={},t[n.slice(6)]=i;else r[n]=i;return{lifted:t,rest:r}}function il(e,t){if(!t)return Cs(e.state??{},null);let r={...e.state};for(let[n,i]of Object.entries(t)){let s=r[n];r[n]=J(s)&&!Array.isArray(s)&&"default"in s?{...s,default:i}:i}return Cs(r,null)}function od(e,t){return Object.fromEntries(Object.entries(e??{}).flatMap(([r,n])=>{if(!he(n))return[];let i=Be(n,t);return i==null?[]:[[r,i]]}))}function ia(e,t,r,n){if(e.textContent!==void 0){let i=Be(e.textContent,t);return i!=null?Se(String(i)):""}if(e.innerHTML){let i=Be(e.innerHTML,t);return i!=null?String(i):e.innerHTML}if(Array.isArray(e.children))return e.children.map((i)=>Is(i,t,r,n)).join(`
90
- `);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=rd(e.tagName,t);if(i==="slot"&&r){let a=Be(e.attributes?.name,t),c=T(a)?a:"",l;if(!r.taken.has(c))r.taken.add(c),l=r.groups.get(c);let u=l?.html??"";if(u!==""&&r.id!==null)u=`<!--${zc} ${r.id} ${encodeURIComponent(c)}-->${u}<!--/${zc} ${r.id}-->`;if(l?.content)return kb(e.children,t,r),u;let d=ia(e,t,r,n);return u===""?d:d===""?u:`${u}
92
- ${d}`}let s=n?.componentDefs.get(i);if(s&&n)return jT(e,s,t,r,n);let o=Xi(e,t);if(td.has(i))return`<${i}${o}>`;return`<${i}${o}>${ia(e,t,r,n)}</${i}>`}function jT(e,t,r,n,i){let s=t.tagName,{lifted:o,rest:a}=sd(e.attributes),c={...o,...e.$props},l={};for(let[j,D]of Object.entries(c))l[j]=Be(D,r)??D;let u=Object.keys(l).length>0,d=i.path??[],h={key:JSON.stringify(l),tag:s},m=[...d.map((j)=>j.tag),s].join(" → ");if(d.some((j)=>j.tag===h.tag&&j.key===h.key))throw Error(`Component <${s}> renders itself: ${m}. A component cannot appear inside its own `+"definition with the same props — the expansion would never end.");if(d.length>=Uf)throw Error(`Component nesting exceeds ${Uf} levels: ${m}. A component that renders itself with changing props needs a case that stops.`);let y={...i,path:[...d,h]},{children:g}=e,b=(j)=>Is(j,r,n,i),x=Yi(t,i.defaults),_=sl(t),P=il(t,u?l:null),E,w=null;if(x){let j=Array.isArray(g)?g.map((D)=>b(D)).join(`
93
- `):"";E=`<template shadowrootmode="${x}"><link rel="stylesheet" href="/components/${s}.css">${ia(t,P,null,y)}</template>${j}`}else{w=!_&&ci(t.children)?nd(i):null;let j=id(g,r,b,w);E=ia(t,P,j,y)}let k=Object.entries(od(t.style,P)).map(([j,D])=>`${ar(j)}: ${D}`).join("; "),R={...e};if(delete R.$props,delete R.children,R.attributes=!_&&u?{...a,"data-jx-props":JSON.stringify(l)}:a,w!==null)R.attributes={...R.attributes,[na]:String(w)};if(_)R.$static=!0;else R.$prerendered=!0;return`<${s}${Xi(R,r,k)}>${E}</${s}>`}function Ab(e,t=null,r=null,n=null){return ia(e,il(e,t),r,n)}function sl(e){return Gf(e)}function Gf(e){if(!J(e))return!0;if(Array.isArray(e))return e.every((t)=>Gf(t));if(e.$prototype)return!1;if(e.$ref)return!1;if(e.state)for(let t of Object.values(e.state)){if(!J(t)||Array.isArray(t))continue;if(t.$prototype)return!1;if(t.$ref)return!1}for(let t of Object.keys(e))if(t.startsWith("on")&&t!=="observedAttributes")return!1;if(Array.isArray(e.children))return e.children.every((t)=>Gf(t));if(lt(e.children))return!1;return!0}function OT(e,t){return Zo(e).map((r)=>CT(r,t)).join(", ")}function CT(e,t){if(e.startsWith("&"))return e.replaceAll("&",t);if(e.startsWith(":host")){let r=/^:host\((.*)\)$/.exec(e)?.[1];if(t===":host")return e;return r===void 0?t:`${t}${r}`}if(t===":host"&&RT.test(e))return e;return`${t}${e}`}function jb(e,t,r=null,n={},i=null){let s=[],o=gb(e,i);if(J(t)){let a={},c=[];for(let[l,u]of Object.entries(t))if(Je(u))a[l]=u;else if(J(u)&&!Array.isArray(u))c.push([l,u]);else if(!l.startsWith("@")&&!oi(l))a[l]=u;Gc(s,a,o,n);for(let[l,u]of c)if(l.startsWith("@"))Gc(s,{[l]:u},o,n);else if(oi(l))Gc(s,u,OT(l,o),n)}if(r&&Array.isArray(r.children)){let a={n:0};for(let c of r.children)li(c,s,n,"",a,e)}return s.length>0?`${s.join(`
88
+ </style>`}function Ha(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)Ta(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 Va(e){return e.split("-").map((t)=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}function Zh(e){let t=[];return Qh(e,t),t}function Qh(e,t){if(!F(e))return;if(e.state){for(let[r,n]of Object.entries(e.state))if(tn(n))t.push({exportName:n.$export,key:r,src:n.$src})}if(Array.isArray(e.children))for(let r of e.children)Qh(r,t)}function vu(e,t){if(T(e))return e;let r=Ms(e);if(r.length===0)return"div";if(!Nr(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 wu(e){if(!e?.slotIds)return null;return e.slotIds.n+=1,e.slotIds.n}function Su(e,t,r,n=null){let s=new Map;for(let i of xu(e)){let o="",a=!0,l;if(T(i)||lr(i)||$t(i)){if(l=r(i),Oa.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=T(i.slot)?Me(i.slot,t):null;if(T(d)&&d!=="")o=d,l=r(i);else if(T(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}
89
+ ${l}`,c.content||=a;else s.set(o,{content:a,html:l})}return{groups:s,id:n,taken:new Set}}function eg(e,t,r){for(let n of xu(e)){if(Qe(n)||!Ft(n))continue;if(n.tagName==="slot"){let s=Me(n.attributes?.name,t);r.taken.add(T(s)?s:"")}eg(n.children,t,r)}}function Eu(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 Ba(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 _u(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 ro(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(`
90
+ `);return""}function Gs(e,t,r=null,n=null){if(T(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(`
91
+ `);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&&!Bt(d)?Gs(d,t,r,n):"";return`<${a}${l}>${p}</${a}>`}let s=vu(e.tagName,t);if(s==="slot"&&r){let a=Me(e.attributes?.name,t),l=T(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=`<!--${Ca} ${r.id} ${encodeURIComponent(l)}-->${d}<!--/${Ca} ${r.id}-->`;if(c?.content)return eg(e.children,t,r),d;let p=ro(e,t,r,n);return d===""?p:p===""?d:`${d}
92
+ ${p}`}let i=n?.componentDefs.get(s);if(i&&n)return yA(e,i,t,r,n);let o=bs(e,t);if($u.has(s))return`<${s}${o}>`;return`<${s}${o}>${ro(e,t,r,n)}</${s}>`}function yA(e,t,r,n,s){let i=t.tagName,{lifted:o,rest:a}=Eu(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>=cu)throw Error(`Component nesting exceeds ${cu} 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=Wa(t),S=Ba(t,d?c:null),P,E=null;if(v){let k=Array.isArray(g)?g.map((I)=>y(I)).join(`
93
+ `):"";P=`<template shadowrootmode="${v}"><link rel="stylesheet" href="/components/${i}.css">${ro(t,S,null,b)}</template>${k}`}else{E=!j&&Nn(t.children)?wu(s):null;let k=Su(g,r,y,E);P=ro(t,S,k,b)}let O=Object.entries(_u(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,[to]:String(E)};if(j)R.$static=!0;else R.$prerendered=!0;return`<${i}${bs(R,r,O)}>${P}</${i}>`}function tg(e,t=null,r=null,n=null){return ro(e,Ba(e,t),r,n)}function Wa(e){return mu(e)}function mu(e){if(!F(e))return!0;if(Array.isArray(e))return e.every((t)=>mu(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)=>mu(t));if(Qe(e.children))return!1;return!0}function xA(e,t){return Yi(e).map((r)=>$A(r,t)).join(", ")}function $A(e,t){let r=ja(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"&&bA.test(e))return e;return`${t}${e}`}function rg(e,t,r=null,n={},s=null){let i=[],o=qh(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("@")&&!Cn(c))a[c]=d;Ta(i,a,o,n);for(let[c,d]of l)if(c.startsWith("@"))Ta(i,{[c]:d},o,n);else if(Cn(c))Ta(i,d,xA(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
94
  `)}
95
- `:""}var xb,Ts="https://esm.sh/@vue/reactivity@3.5.40",Ns="https://esm.sh/lit-html@3.3.0",_T,PT,ui,AT,Ds="__jxAttrText",Qf="__jxCaptureSlotted",Zf="__jxDistributeSlots",Js="<!---->",td,RT;var mn=L(()=>{Os();ra();Vc();mb();Ee();ks();Os();ra();Vc();Ee();xb=Symbol("jx.runtimeOnlyStateKeys");_T=/\bstate\.([A-Za-z_$][\w$]*)\s*(?:\+\+|--|(?:\*\*|\|\||&&|\?\?|<<|>>>|>>|[-+*/%&|^])?=(?!=))/g,PT=/\bstate\.([A-Za-z_$][\w$]*)\s*\.\s*(?:push|pop|shift|unshift|splice|sort|reverse|fill|copyWithin)\s*\(/g;ui=new Set(["pre","textarea","listing","plaintext","xmp"]);AT=[];td=new Set(["input","br","hr","img","meta","link","area","col","source"]);RT=/^(?:::slotted\(|::part\()/});import{relative as IT,sep as TT}from"node:path";function aa(e){return e===NT}function qs(e,t){if(e==="/")return"/";if(t==="always")return e.endsWith("/")?e:`${e}/`;if(t==="never")return e.replace(/\/+$/,"")||"/";return e}function ol(e,t){let r=new RegExp(`\\s${t}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s"'>]+))`,"i").exec(e);return r===null?null:r[1]??r[2]??r[3]??""}function Rb(e){let t=e.search(/<\/head\s*>/i),r=t===-1?e:e.slice(0,t);for(let[n]of r.matchAll(/<meta\b[^>]*>/gi)){if(ol(n,"name")?.trim().toLowerCase()!=="robots")continue;let i=new Set((ol(n,"content")??"").toLowerCase().split(",").map((s)=>s.trim()));if(i.has("noindex")||i.has("none"))return!0}return!1}function Ob(e){let t=e.search(/<\/head\s*>/i);return{end:t,head:t===-1?e:e.slice(0,t)}}function MT(e,t){let r=t.trim().toLowerCase();for(let[n]of Ob(e).head.matchAll(/<link\b[^>]*>/gi)){let i=(ol(n,"rel")??"").toLowerCase().split(/\s+/),s=(ol(n,"type")??"").split(";")[0]?.trim().toLowerCase();if(i.includes("alternate")&&s===r)return!0}return!1}function Cb(e,t){let{end:r}=Ob(e);if(r===-1||MT(e,t.type))return e;let n=`<link href="${Se(t.href)}" rel="alternate" type="${Se(t.type)}">`;return`${e.slice(0,r)}${n}
96
- ${e.slice(r)}`}function Ib(e,t){return new URL(`/${IT(e,t).split(TT).join("/")}`,"http://localhost").pathname}var NT="/404";var ad=L(()=>{mn()});function Tb(e,t){if(t===null||t.routing!=="prefix-always")return[];let r=[];for(let n of e){if(n.urlPattern==="/")continue;let i=n.urlPattern.split("/").find(Boolean),s=Mr(i);if(s===null||!t.locales.includes(s))r.push(n.urlPattern)}return r}function Nb(e,t){if(t===null)return null;let r=e.split("/").find(Boolean),n=Mr(r);if(r===void 0||n===null||t.locales.includes(n))return null;let i=t.locales.find((s)=>s!==n&&s.split("-")[0]===n.split("-")[0]);return i===void 0?null:{meant:i,segment:r}}function LT(e,t){let r=e.split("/").filter(Boolean),n=Mr(r[0]);if(t!==null&&n!==null&&t.locales.includes(n))return r.slice(1).join("/");return r.join("/")}function cd(e,t){let r=new Map,n=[];if(t===null)return{conflicts:n,sets:r};let i=new Map,s=new Set;for(let o of e){let a=o.translationKey===void 0?LT(o.urlPattern,t):o.translationKey.replaceAll(/^\/+|\/+$/g,"");if(o.translationKey!==void 0)s.add(o.urlPattern);let c=dn(o.urlPattern,t);if(c===null)continue;let l=i.get(a)??[],u=l.find((d)=>d.locale===c);if(u===void 0)l.push({locale:c,urlPattern:o.urlPattern});else n.push({declared:s.has(u.urlPattern)||o.translationKey!==void 0,key:a,locale:c,urlPatterns:[u.urlPattern,o.urlPattern]});i.set(a,l)}for(let o of i.values()){let a=o.toSorted((c,l)=>c.locale===l.locale?0:c.locale<l.locale?-1:1);for(let c of o)r.set(c.urlPattern,a)}return{conflicts:n,sets:r}}function Mb(e,t,r,n){let i=new Map;if(t===null||r==="")return i;let s=new Map;for(let[o,a]of cd(e,t).sets){if(a.length<2)continue;let c=s.get(a);if(c===void 0){c=a.map((u)=>({href:ii(qs(u.urlPattern,n),r),hreflang:u.locale}));let l=a.find((u)=>u.locale===t.defaultLocale);if(l!==void 0)c.push({href:ii(qs(l.urlPattern,n),r),hreflang:"x-default"});s.set(a,c)}i.set(o,c)}return i}function Lb({pageLang:e,pageDir:t,routeLocale:r,defaults:n}){let i=e??r??n?.lang??"en",s=t??n?.dir;if(s!==void 0)return{dir:s,lang:i};return Xo(i)==="rtl"?{dir:"rtl",lang:i}:{lang:i}}var ld=L(()=>{wr();zi();ad();zi();zi()});import{readFileSync as ud,readdirSync as DT}from"node:fs";import{extname as Db,join as JT,relative as FT,resolve as qT}from"node:path";async function Qi(e,t){let r=ud(e,"utf8");if(e.endsWith(".json"))return ti(r,e);let n=Db(e).toLowerCase(),i=t?.byExtension(n,"parse");if(!i)throw Error(`No format class registered for "${n}" (${e}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`);return await i.parseDocument(r)}async function Jb(e,t){let r=new Map,n=new Map;for(let i of e){if(!n.has(i.sourcePath))n.set(i.sourcePath,await HT(i.sourcePath,t));let s=n.get(i.sourcePath);if(s!==null&&s!==void 0)r.set(i.urlPattern,BT(s,i._pathParams))}return r}function BT(e,t){if(!e.includes("${"))return e;return e.replaceAll(/\$\{(\w+)\}/g,(r,n)=>t?.[n]??r)}async function HT(e,t){if(!ud(e,"utf8").includes("$translationKey"))return null;let r;try{r=await Qi(e,t)}catch{return null}return T(r.$translationKey)&&r.$translationKey!==""?r.$translationKey:null}async function Fb(e,t){let r=[],n=new Set([".json",...t?.documentExtensions("page")??[]]);return await qb(e,e,r,n,t),r.sort(Uy),r}async function qb(e,t,r,n,i){let s=DT(e,{withFileTypes:!0});for(let o of s){let a=JT(e,o.name);if(o.isDirectory()){if(o.name.startsWith("_"))continue;await qb(a,t,r,n,i);continue}let c=Db(o.name).toLowerCase();if(!n.has(c))continue;if(o.name.startsWith("_"))continue;let l=FT(t,a);r.push(await UT(l,a,i))}}async function UT(e,t,r){let{isCatchAll:n,isDynamic:i,params:s,urlPattern:o}=Hy(e),a=null;try{let l=(await Qi(t,r)).$layout;if(T(l))a=l}catch{}return{$layout:a,isCatchAll:n,isDynamic:i,params:s,relativePath:e,sourcePath:t,urlPattern:o}}function VT(e){let t=e[Bb];if(!ee(t))return null;let{mtime:r}=t;return T(r)&&r!==""?r:null}function WT(e){if(e.includes("\x00"))return"has a NUL character";for(let t of e.split("/")){if(t==="."||t==="..")return'has a "." or ".." segment';if(t.includes("\\"))return"has a backslash"}return null}async function Hb(e,t,r={},n,i,s){let o=[],a=e.flatMap((c)=>c.isDynamic?[c.urlPattern]:[]);for(let c of e){if(!c.isDynamic){o.push(c);continue}let l;try{l=await Qi(c.sourcePath,n?.formats)}catch{o.push(c);continue}if(!l.$paths){console.warn(`Warning: dynamic route ${c.urlPattern} has no $paths — skipping`);continue}let u=await zT(l.$paths,t,r,n,i,dn(c.urlPattern,s??null),c,a);for(let d of u){let h=c.urlPattern,m={};for(let[x,_]of Object.entries(d)){if(x===Bb)continue;m[x]=String(_),h=h.replace(`:${x}`,m[x]),h=h.replace("*",m[x])}let y=WT(h);if(y!==null){console.warn(`Warning: $paths for ${c.urlPattern} produced "${h}", which ${y}; skipping it`);continue}let g=VT(d),b={...c,_pathParams:m,isCatchAll:!1,isDynamic:!1,params:[],urlPattern:h};if(g!==null)b.sourceMtime=g;o.push(b)}}return o}async function zT(e,t,r,n,i,s,o,a){if(Array.isArray(e))return e;if("values"in e&&Array.isArray(e.values)){let c=T(e.param)?e.param:"value";return e.values.map((l)=>({[c]:l}))}if("$ref"in e&&T(e.$ref)&&e.$ref){let c=e.$ref,l=qT(t,c),u;try{u=JSON.parse(ud(l,"utf8"))}catch(m){return console.warn(`Warning: $paths.$ref could not load "${c}": ${Pe(m)}`),[]}if(!Array.isArray(u))return console.warn(`Warning: $paths.$ref "${c}" must be a JSON array`),[];let d=T(e.param)?e.param:"id",h=T(e.field)?e.field:"id";return u.map((m)=>{if(m===null)throw TypeError(`$paths.$ref "${c}" contains a null entry`);return{[d]:(ee(m)?m[h]??m.id:void 0)??String(m)}})}for(let c of Object.keys(e)){let l=n?.byPathsDiscriminator(c);if(!l?.project)continue;let u={data:r[l.project.key],locale:s,projectConfig:i,root:t};if(o!==void 0)u.params=o.params,u.urlPattern=o.urlPattern;if(a!==void 0)u.patterns=a;return await l.call("resolvePaths",e,u)}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var Bb="_meta";var Ub=L(()=>{Ee();vr();Vy();ld()});import{createHash as KT}from"node:crypto";function Vb(){return{fontOrigins:new Set,frameOrigins:new Set,imgOrigins:new Set,scriptHashes:new Set,scriptOrigins:new Set,styleOrigins:new Set}}function Zi(e,t){let r=new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)')`,"i").exec(e);return r?.[2]??r?.[3]}function fd(e){if(e===void 0||!/^https?:\/\//i.test(e))return null;try{return new URL(e).origin}catch{return null}}function rN(e){return`'sha256-${KT("sha256").update(e,"utf8").digest("base64")}'`}function Wb(e,t){for(let r of e.matchAll(YT)){let n=r[1]??"",i=Zi(n,"src"),s=(Zi(n,"type")??"").trim().toLowerCase();if(i!==void 0){let o=fd(i);if(o)t.scriptOrigins.add(o);continue}if(GT.has(s))t.scriptHashes.add(rN(r[2]??""))}for(let r of e.matchAll(XT)){let n=r[1]??"",i=(Zi(n,"rel")??"").toLowerCase(),s=Zi(n,"href"),o=fd(s);if(!o)continue;if(i.includes("stylesheet"))t.styleOrigins.add(o);if(tN.test(s??"")||(Zi(n,"as")??"")==="font")t.fontOrigins.add(o)}for(let[r,n]of[[QT,t.imgOrigins],[ZT,t.imgOrigins],[eN,t.frameOrigins]])for(let i of e.matchAll(r)){let s=i[1]??"";for(let o of[Zi(s,"src"),...nN(Zi(s,"srcset"))]){let a=fd(o);if(a)n.add(a)}}}function nN(e){return e===void 0?[]:e.split(",").map((t)=>t.trim().split(/\s+/)[0]??"").filter(Boolean)}function zb(e){let t=e?.csp;if(t===void 0||t===!1)return null;if(t===!0)return{};if(t==="report-only")return{mode:"report-only"};return t}function Kb(e,t){let r=(o,a)=>[...o,...a].join(" "),n={"base-uri":"'self'","default-src":"'self'","font-src":r(["'self'"],e.fontOrigins),"form-action":"'self'","frame-ancestors":"'self'","frame-src":r(["'self'"],e.frameOrigins),"img-src":r(["'self'","data:"],e.imgOrigins),"object-src":"'none'","script-src":r(["'self'",...[...e.scriptHashes].toSorted()],e.scriptOrigins),"style-src":r(["'self'","'unsafe-inline'"],e.styleOrigins)};if(t.reportUri!==void 0&&t.reportUri!=="")n["report-to"]="csp-endpoint",n["report-uri"]=t.reportUri;for(let[o,a]of Object.entries(t.directives??{}))n[o]=a;let i=Object.entries(n).filter(([,o])=>o!==!1&&o!=="").toSorted(([o],[a])=>o<a?-1:1).map(([o,a])=>`${o} ${String(a)}`).join("; "),s=t.mode==="report-only"?{"Content-Security-Policy-Report-Only":i}:{"Content-Security-Policy":i};if(t.reportUri!==void 0&&t.reportUri!=="")s["Reporting-Endpoints"]=`csp-endpoint="${t.reportUri}"`;return s}var GT,YT,XT,QT,ZT,eN,tN;var dd=L(()=>{GT=new Set(["","module","importmap","text/javascript","module-shim"]),YT=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,XT=/<link\b([^>]*)>/gi,QT=/<img\b([^>]*)>/gi,ZT=/<source\b([^>]*)>/gi,eN=/<iframe\b([^>]*)>/gi,tN=/\.(woff2?|ttf|otf|eot)(\?|#|$)/i});import{existsSync as al,readFileSync as iN,writeFileSync as Yb}from"node:fs";import{join as cl}from"node:path";function Xb(e,t){let r=e?.headers??{},n=[];if(r.enabled===!1)return{errors:n,rules:[]};let i=r.security??{},s={};if(i.contentTypeOptions!==!1)s["X-Content-Type-Options"]="nosniff";if(i.referrerPolicy!==!1)s["Referrer-Policy"]=i.referrerPolicy??"strict-origin-when-cross-origin";if(i.permissionsPolicy!==!1)s["Permissions-Policy"]=i.permissionsPolicy??"camera=(), microphone=(), geolocation=()";if(i.frameOptions!==!1)s["X-Frame-Options"]=i.frameOptions??"SAMEORIGIN";let{hsts:o}=i;if(o){let u=o===!0?{}:o,d=u.maxAge??Gb,h=u.includeSubDomains??!0,m=u.preload??!1;if(m&&!h)n.push("build.headers.security.hsts: `preload` requires `includeSubDomains` — the preload list "+"will not accept the header without it.");else s["Strict-Transport-Security"]=[`max-age=${d}`,h?"includeSubDomains":null,m?"preload":null].filter(Boolean).join("; ")}let a=zb(i);if(a)if(t===void 0)n.push("build.headers.security.csp is set, but no page was scanned for inline scripts — the "+"policy would block every one of them.");else Object.assign(s,Kb(t,a));let c=r.cache??"auto";if(c==="auto")s["Cache-Control"]="public, max-age=0, must-revalidate";let l=[];if(Object.keys(s).length>0)l.push({headers:s,pattern:"/*"});if(c==="auto")l.push({headers:{"Cache-Control":`public, max-age=${Gb}, immutable`},pattern:sN});for(let[u,d]of Object.entries(r.rules??{}))l.push({headers:d,pattern:u});return{errors:n,rules:l}}function Qb(e){let t=[["feed.xml","application/atom+xml; charset=utf-8"],["feed.json","application/feed+json; charset=utf-8"],["manifest.webmanifest","application/manifest+json; charset=utf-8"],[".well-known/security.txt","text/plain; charset=utf-8"]],r=[];for(let[n,i]of t)if(al(cl(e,n)))r.push({headers:{"Content-Type":i},pattern:`/${n}`});if(al(cl(e,"feed","archive")))r.push({headers:{"Content-Type":"application/atom+xml; charset=utf-8"},pattern:"/feed/archive/*"});return r}function Zb(e,t){if(t==="")return[...e];return e.map((r)=>({headers:r.headers,pattern:ze(t,r.pattern)}))}function cN(e){let t=e.map((r)=>{let n=Object.entries(r.headers).map(([i,s])=>` ${i}: ${s}`);return[r.pattern,...n].join(`
97
- `)});return`${[oN,"",...t].join(`
95
+ `:""}var dA,Bh,Ks="https://esm.sh/@vue/reactivity@3.5.40",Ys="https://esm.sh/lit-html@3.3.0",pA,mA,In,gA,Qs="__jxAttrText",Yh="__jxServerCall",yu="__jxCaptureSlotted",bu="__jxDistributeSlots",ei="<!---->",$u,bA;var Mr=q(()=>{Us();Zi();eo();Aa();Lh();ve();Hs();Us();eo();Aa();ve();dA=["$map/","event#/","$args/","$reduce/"];Bh=Symbol("jx.runtimeOnlyStateKeys");pA=/\bstate\.([A-Za-z_$][\w$]*)\s*(?:\+\+|--|(?:\*\*|\|\||&&|\?\?|<<|>>>|>>|[-+*/%&|^])?=(?!=))/g,mA=/\bstate\.([A-Za-z_$][\w$]*)\s*\.\s*(?:push|pop|shift|unshift|splice|sort|reverse|fill|copyWithin)\s*\(/g;In=new Set(["pre","textarea","listing","plaintext","xmp"]);gA=[];$u=new Set(["input","br","hr","img","meta","link","area","col","source"]);bA=/^(?:::slotted\(|::part\()/});import{relative as vA,sep as wA}from"node:path";function io(e){return e===SA}function ri(e,t){if(e==="/")return"/";if(t==="always")return e.endsWith("/")?e:`${e}/`;if(t==="never")return e.replace(/\/+$/,"")||"/";return e}function Ua(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 ng(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(Ua(n,"name")?.trim().toLowerCase()!=="robots")continue;let s=new Set((Ua(n,"content")??"").toLowerCase().split(",").map((i)=>i.trim()));if(s.has("noindex")||s.has("none"))return!0}return!1}function sg(e){let t=e.search(/<\/head\s*>/i);return{end:t,head:t===-1?e:e.slice(0,t)}}function EA(e,t){let r=t.trim().toLowerCase();for(let[n]of sg(e).head.matchAll(/<link\b[^>]*>/gi)){let s=(Ua(n,"rel")??"").toLowerCase().split(/\s+/),i=(Ua(n,"type")??"").split(";")[0]?.trim().toLowerCase();if(s.includes("alternate")&&i===r)return!0}return!1}function ig(e,t){let{end:r}=sg(e);if(r===-1||EA(e,t.type))return e;let n=`<link href="${$e(t.href)}" rel="alternate" type="${$e(t.type)}">`;return`${e.slice(0,r)}${n}
96
+ ${e.slice(r)}`}function og(e,t){return new URL(`/${vA(e,t).split(wA).join("/")}`,"http://localhost").pathname}var SA="/404";var Pu=q(()=>{Mr()});function ag(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 lg(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 ju(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=Tr(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 cg(e,t,r,n){let s=new Map;if(t===null||r==="")return s;let i=new Map;for(let[o,a]of ju(e,t).sets){if(a.length<2)continue;let l=i.get(a);if(l===void 0){l=a.map((d)=>({href:An(ri(d.urlPattern,n),r),hreflang:d.locale}));let c=a.find((d)=>d.locale===t.defaultLocale);if(c!==void 0)l.push({href:An(ri(c.urlPattern,n),r),hreflang:"x-default"});i.set(a,l)}s.set(o,l)}return s}function ug({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 Gi(s)==="rtl"?{dir:"rtl",lang:s}:{lang:s}}var ku=q(()=>{nr();hs();Pu();hs();hs()});import{readFileSync as Ru,readdirSync as PA}from"node:fs";import{extname as dg,join as jA,relative as kA,resolve as RA}from"node:path";async function xs(e,t){let r=Ru(e,"utf8");if(e.endsWith(".json"))return jn(r,e);let n=dg(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 fg(e,t){let r=new Map,n=new Map;for(let s of e){if(!n.has(s.sourcePath))n.set(s.sourcePath,await OA(s.sourcePath,t));let i=n.get(s.sourcePath);if(i!==null&&i!==void 0)r.set(s.urlPattern,AA(i,s._pathParams))}return r}function AA(e,t){if(!e.includes("${"))return e;return e.replaceAll(/\$\{(\w+)\}/g,(r,n)=>t?.[n]??r)}async function OA(e,t){if(!Ru(e,"utf8").includes("$translationKey"))return null;let r;try{r=await xs(e,t)}catch{return null}return T(r.$translationKey)&&r.$translationKey!==""?r.$translationKey:null}async function pg(e,t){let r=[],n=new Set([".json",...t?.documentExtensions("page")??[]]);return await mg(e,e,r,n,t),r.sort(hh),r}async function mg(e,t,r,n,s){let i=PA(e,{withFileTypes:!0});for(let o of i){let a=jA(e,o.name);if(o.isDirectory()){if(o.name.startsWith("_"))continue;await mg(a,t,r,n,s);continue}let l=dg(o.name).toLowerCase();if(!n.has(l))continue;if(o.name.startsWith("_"))continue;let c=kA(t,a);r.push(await CA(c,a,s))}}async function CA(e,t,r){let{isCatchAll:n,isDynamic:s,params:i,urlPattern:o}=mh(e),a=null;try{let c=(await xs(t,r)).$layout;if(T(c))a=c}catch{}return{$layout:a,isCatchAll:n,isDynamic:s,params:i,relativePath:e,sourcePath:t,urlPattern:o}}function NA(e){let t=e[hg];if(!ee(t))return null;let{mtime:r}=t;return T(r)&&r!==""?r:null}function TA(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 gg(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 IA(c.$paths,t,r,n,s,Tr(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===hg)continue;m[v]=String(j),h=h.replace(`:${v}`,m[v]),h=h.replace("*",m[v])}let b=TA(h);if(b!==null){console.warn(`Warning: $paths for ${l.urlPattern} produced "${h}", which ${b}; skipping it`);continue}let g=NA(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 IA(e,t,r,n,s,i,o,a){if(Array.isArray(e))return e;if("values"in e&&Array.isArray(e.values)){let l=T(e.param)?e.param:"value";return e.values.map((c)=>({[l]:c}))}if("$ref"in e&&T(e.$ref)&&e.$ref){let l=e.$ref,c=RA(t,l),d;try{d=JSON.parse(Ru(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=T(e.param)?e.param:"id",h=T(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 hg="_meta";var yg=q(()=>{ve();rr();gh();ku()});import{createHash as MA}from"node:crypto";function bg(){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 Au(e){if(e===void 0||!/^https?:\/\//i.test(e))return null;try{return new URL(e).origin}catch{return null}}function BA(e){return`'sha256-${MA("sha256").update(e,"utf8").digest("base64")}'`}function xg(e,t){for(let r of e.matchAll(DA)){let n=r[1]??"",s=$s(n,"src"),i=($s(n,"type")??"").trim().toLowerCase();if(s!==void 0){let o=Au(s);if(o)t.scriptOrigins.add(o);continue}if(JA.has(i))t.scriptHashes.add(BA(r[2]??""))}for(let r of e.matchAll(LA)){let n=r[1]??"",s=($s(n,"rel")??"").toLowerCase(),i=$s(n,"href"),o=Au(i);if(!o)continue;if(s.includes("stylesheet"))t.styleOrigins.add(o);if(VA.test(i??"")||($s(n,"as")??"")==="font")t.fontOrigins.add(o)}for(let[r,n]of[[FA,t.imgOrigins],[qA,t.imgOrigins],[HA,t.frameOrigins]])for(let s of e.matchAll(r)){let i=s[1]??"";for(let o of[$s(i,"src"),...WA($s(i,"srcset"))]){let a=Au(o);if(a)n.add(a)}}}function WA(e){return e===void 0?[]:e.split(",").map((t)=>t.trim().split(/\s+/)[0]??"").filter(Boolean)}function $g(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 vg(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 JA,DA,LA,FA,qA,HA,VA;var Ou=q(()=>{JA=new Set(["","module","importmap","text/javascript","module-shim"]),DA=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,LA=/<link\b([^>]*)>/gi,FA=/<img\b([^>]*)>/gi,qA=/<source\b([^>]*)>/gi,HA=/<iframe\b([^>]*)>/gi,VA=/\.(woff2?|ttf|otf|eot)(\?|#|$)/i});import{existsSync as za,readFileSync as UA,writeFileSync as Sg}from"node:fs";import{join as Ga}from"node:path";function Eg(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??wg,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=$g(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,vg(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=${wg}, immutable`},pattern:zA});for(let[d,p]of Object.entries(r.rules??{}))c.push({headers:p,pattern:d});return{errors:n,rules:c}}function _g(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(za(Ga(e,n)))r.push({headers:{"Content-Type":s},pattern:`/${n}`});if(za(Ga(e,"feed","archive")))r.push({headers:{"Content-Type":"application/atom+xml; charset=utf-8"},pattern:"/feed/archive/*"});return r}function Pg(e,t){if(t==="")return[...e];return e.map((r)=>({headers:r.headers,pattern:Ie(t,r.pattern)}))}function YA(e){let t=e.map((r)=>{let n=Object.entries(r.headers).map(([s,i])=>` ${s}: ${i}`);return[r.pattern,...n].join(`
97
+ `)});return`${[GA,"",...t].join(`
98
98
  `)}
99
- `}function ex(e,t){if(t.length===0)return 0;let r=cl(e,"_headers"),n=al(r)?iN(r,"utf8").trim():"",i=cN(t),s=n===""?i:`${i}
100
- ${aN}
99
+ `}function jg(e,t){if(t.length===0)return 0;let r=Ga(e,"_headers"),n=za(r)?UA(r,"utf8").trim():"",s=YA(t),i=n===""?s:`${s}
100
+ ${KA}
101
101
  ${n}
102
- `;return Yb(r,s,"utf8"),1}function tx(e){let t=cl(e,".nojekyll");if(al(t))return 0;return Yb(t,"","utf8"),1}var sN="/images/_optimized/*",Gb=31536000,oN="# Generated by @jxsuite/compiler — configure via build.headers in project.json.",aN="# ─── public/_headers (hand-authored; these rules override the block above) ───";var rx=L(()=>{wr();dd()});async function nx(e,t,r,n={}){let i={},s=mf(e);for(let o of r.projectContributions()){let a=o.project?.key;if(!a||!o.capabilities.projectData)continue;if(!t||!(a in t))continue;i[a]=await o.call("projectData",t[a],{io:s,projectConfig:t,registry:r,root:e,...n.lazy===!0&&{lazy:!0}})}return i}var ix=L(()=>{On()});import{cpSync as lN,existsSync as uN,mkdirSync as fN}from"node:fs";import{dirname as dN,resolve as pN}from"node:path";async function sx(e,t,r){let n=[],i=[],s=new Map;for(let o of e.assetProviders()){let a=o.project?.key,c=a?t[a]:void 0;if(a&&(c==null||J(c)&&Object.keys(c).length===0))continue;try{let l=await o.call("assets",c??null,{projectConfig:t,root:r});for(let u of l??[]){if(!J(u)||!u.urlPrefix||!u.dir)continue;let d={dir:u.dir,urlPrefix:kc(u.urlPrefix)};if(Ot(u.filter))d.filter=u.filter;let h=s.get(d.urlPrefix);if(h){if(h.dir!==d.dir)i.push(`Asset mount conflict: "${d.urlPrefix}" is claimed by both "${h.dir}" and "${d.dir}"`);continue}s.set(d.urlPrefix,d),n.push(d)}}catch(l){i.push(`Error in ${o.name}.assets: ${Pe(l)}`)}}return{errors:i,mounts:n}}function pd(e,t,r){if(t.length===0||!e)return;for(let n of oy(e,t))r.add(n)}function ox(e,t,r){let n=0,i=[];for(let s of e){let o=Ac(t,s);if(!o||!uN(o)){i.push(s);continue}let a=pN(r,decodeURIComponent(s).replace(/^\//,""));fN(dN(a),{recursive:!0}),lN(o,a),n+=1}return{copied:n,missing:i}}var ax=L(()=>{wr();Ee();vr()});async function md(e,t,r){let n=e.$layout??t.defaults?.layout??null;if(!n)return e;let i=await r(n);if(i.$layout)i=await md(i,t,r);let s=e.children??[],o=T(s)?[s]:Array.isArray(s)?s:[],a=hN(i);if(mN(a,o),e.state)a.state={...a.state,...e.state};if(e.$media)a.$media={...a.$media,...e.$media};if(e.style)a.style={...a.style,...e.style};if(e.attributes)a.attributes={...a.attributes,...e.attributes};if(e.$head)a._pageHead=e.$head;if(e.title)a._pageTitle=e.title;return delete a.$layout,a}function mN(e,t){let r=new Map,n=[];for(let i of t){let s=J(i)?i.attributes?.slot:void 0;if(s){let o=r.get(s);if(!o)o=[],r.set(s,o);o.push(i)}else n.push(i)}cx(e,r,n)}function cx(e,t,r){if(!J(e))return;if(!Array.isArray(e.children))return;let n=[];for(let i of e.children)if(J(i)&&i.tagName==="slot"){let s=i.attributes?.name,o=s?t.get(s):void 0;if(s&&o)n.push(...o),t.delete(s);else if(!s&&r.length>0)n.push(...r);else if(Array.isArray(i.children))n.push(...i.children)}else cx(i,t,r),n.push(i);e.children=n}function hN(e){return structuredClone(e)}var lx=L(()=>{Ee()});import{existsSync as gN,readFileSync as yN}from"node:fs";import{resolve as bN}from"node:path";function xN(e){return(t)=>{let r=bN(e,t);if(!gN(r))throw Error(`Layout not found: ${t} (resolved to ${r})`);try{return ti(yN(r,"utf8"),r)}catch(n){throw Error(`Invalid layout JSON at ${r}: ${Pe(n)}`,{cause:n})}}}function ux(e,t,r){return md(e,t,xN(r))}var fx=L(()=>{vr();lx()});function dx(e,t){if(!T(t)||t.trim()==="")return[...e];return[{attributes:{content:t,name:"description"},tagName:"meta"},...e]}function px(e=[],t=[],r=[],n={}){let i=[{attributes:{charset:n.charset??"utf8"},tagName:"meta"},{attributes:{content:"width=device-width, initial-scale=1",name:"viewport"},tagName:"meta"}],s=new Map;for(let a of[...i,...e,...t,...r]){let c=hd(a);s.set(c,a)}let o=n.title??n.siteName??"Jx Site";if(s.set("title",{children:[o],tagName:"title"}),n.pageUrl&&n.siteUrl){let a=ii(n.pageUrl,n.siteUrl);if(![...s.values()].some((l)=>J(l)&&l.tagName==="link"&&l.attributes?.rel==="canonical")){let l={attributes:{href:a,rel:"canonical"},tagName:"link"};s.set(hd(l),l)}if(!s.has("meta:og:url"))s.set("meta:og:url",{attributes:{content:a,property:"og:url"},tagName:"meta"})}if(n.siteName&&!s.has("meta:og:site_name"))s.set("meta:og:site_name",{attributes:{content:n.siteName,property:"og:site_name"},tagName:"meta"});for(let a of n.alternates??[]){let c={attributes:{href:a.href,hreflang:a.hreflang,rel:"alternate"},tagName:"link"},l=hd(c);if(!s.has(l))s.set(l,c)}return[...s.values()]}function hd(e){if(!J(e))return String(e);let t=e.tagName??"unknown",r=e.attributes??{};if(t==="title")return"title";if(r.charset)return"meta:charset";if(t==="meta"&&r.name)return`meta:${r.name}`;if(t==="meta"&&r.property)return`meta:${r.property}`;if(t==="link"&&r.rel){let n=r.hreflang??r.type??r.media??r.sizes??"";return`link:${r.rel}:${r.href??""}:${String(n)}`}if(t==="script"&&r.src)return`script:${r.src}`;if(t==="style"){let n=Array.isArray(e.children)?e.children.join(""):e.textContent,i=J(n)?JSON.stringify(n):n??"";return`style:${$N(i)}`}return`${t}:${JSON.stringify(e)}`}function $N(e){let t=0;for(let r=0;r<e.length;r++)t=Math.trunc((t<<5)-t+(e.codePointAt(r)??0));return t.toString(36)}function mx(e){return e.map((t)=>vN(t)).join(`
103
- `)}function vN(e){if(T(e))return e;if(!J(e))return"";let t=e.tagName,r=e.attributes??{},n=Object.entries(r).map(([c,l])=>l===!0?c:`${c}="${wN(l)}"`).join(" "),i=n?`<${t} ${n}>`:`<${t}>`;if(t!==void 0&&new Set(["meta","link","base","br","hr","img","input"]).has(t))return i;let o=Array.isArray(e.children)?e.children.join(""):e.textContent,a=J(o)?JSON.stringify(o,null,2):o??"";return`${i}${a}</${t}>`}function wN(e){return String(e).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}var hx=L(()=>{wr();Ee()});function _N(e){let t=e.indexOf(":");if(t===-1)return!1;if(t===e.length-1)return!1;try{return new URL(e).protocol!==""}catch{return!1}}function PN(e){if(!T(e))return[];return e.split(/\s+/).filter((t)=>{if(t==="")return!1;let r=t.toLowerCase();return!SN.has(r)&&!EN.has(r)&&!_N(t)})}function gx(e){let t=new Set;for(let r of e){if(!J(r)||r.tagName!=="link")continue;for(let n of PN(r.attributes?.rel))t.add(n)}return[...t]}var SN,EN;var yx=L(()=>{Ee();SN=new Set(["about","acl","alternate","amphtml","api-catalog","appendix","apple-touch-icon","apple-touch-startup-image","archives","author","blocked-by","bookmark","c2pa-manifest","canonical","chapter","cite-as","collection","compression-dictionary","contents","convertedfrom","copyright","create-form","current","deprecation","describedby","describes","disclosure","dns-prefetch","dpp","duplicate","edit","edit-form","edit-media","enclosure","external","first","geofeed","glossary","help","hosts","hub","ice-server","icon","index","intervalafter","intervalbefore","intervalcontains","intervaldisjoint","intervalduring","intervalequals","intervalfinishedby","intervalfinishes","intervalin","intervalmeets","intervalmetby","intervaloverlappedby","intervaloverlaps","intervalstartedby","intervalstarts","item","last","latest-version","license","linkset","lrdd","manifest","mask-icon","me","media-feed","memento","micropub","modulepreload","monitor","monitor-group","next","next-archive","nofollow","noopener","noreferrer","opener","openid2.local_id","openid2.provider","original","p3pv1","payment","pingback","preconnect","predecessor-version","prefetch","preload","prerender","prev","prev-archive","preview","previous","privacy-policy","profile","publication","rdap-active","rdap-bottom","rdap-down","rdap-top","rdap-up","related","replies","restconf","ruleinput","search","section","self","service","service-desc","service-doc","service-meta","sip-trunking-capability","sponsored","start","status","stylesheet","subsection","successor-version","sunset","tag","terms-of-service","timegate","timemap","type","ugc","up","version-history","via","webmention","working-copy","working-copy-of"]),EN=new Set(["shortcut"])});function bx(e,t,r,n=null,i=null,s=[]){if(!e.state)e.state={};let o={};if(i!==null)o.defaultLocale=i.defaultLocale,o.locales=i.locales;e.state.$site={name:t.name??"Jx Site",url:t.url??"",...o,...t.state};let a=(T(e.$lang)?e.$lang:void 0)??dn(r.urlPattern,i)??t.defaults?.lang,c=s.map((u)=>({code:u.locale,current:u.urlPattern===r.urlPattern,dir:Xo(u.locale),label:Wy(u.locale),url:u.urlPattern})),l={params:r._pathParams??{},title:e.title??e._pageTitle??t.name??"",url:r.urlPattern};if(c.length>0)l.alternates=c;if(a!==void 0)l.dir=Xo(a),l.locale=a;if(e.state.$page=l,t.state){for(let[u,d]of Object.entries(t.state))if(u!=="$site"&&u!=="$page"&&!(u in e.state))e.state[u]=d}if(t.$media)e.$media={...t.$media,...e.$media};if(t.imports&&Object.keys(t.imports).length>0){if(!e.imports)e.imports={};for(let[u,d]of Object.entries(t.imports))if(!(u in e.imports))e.imports[u]=n&&(d.startsWith("./")||d.startsWith("../"))?n(d,r):d}if(t.$elements?.length)if(!e.$elements?.length)e.$elements=[...t.$elements];else{let u=new Set,d=[];for(let h of[...t.$elements,...e.$elements]){let m=T(h)?h:J(h)?h.$ref:void 0;if(m&&!u.has(m))u.add(m),d.push(h)}e.$elements=d}return e}var xx=L(()=>{Ee();zi()});import{dirname as kN,relative as AN,resolve as jN}from"node:path";function RN(e){return(t,r)=>{if(!r.sourcePath)return t;return`./${AN(kN(r.sourcePath),jN(e,t))}`}}function $x(e,t,r,n=null,i=null,s=[]){return bx(e,t,r,n===null?null:RN(n),i,s)}var vx=L(()=>{xx()});function Dn(e){if(e.startsWith("\\\\?\\"))return e;return e.split("\\").join("/")}var ON,ca=()=>ON;var wx=L(()=>{ON=/^win/.test(globalThis.process?globalThis.process.platform:"")});function Fe(e,t){let r=new URL(Sx(e),"https://aaa.nonexistanturl.com"),n=new URL(Sx(t),r),i=t.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:o,hash:a}=n;return s+o+a+i}return n.toString()+i}function Sx(e){let t=e.search(/[?#]/);return t<0?Dn(e):Dn(e.slice(0,t))+e.slice(t)}function ua(e){try{return decodeURIComponent(e)}catch{try{return decodeURIComponent(e.replace(/%(?![\dA-F]{2})/gi,"%25"))}catch{return e}}}function _r(){if(typeof window<"u"&&window.location&&window.location.href){let e=window.location.href;if(!e||!e.startsWith("http"))try{return new URL(e),e}catch{return"/"}return e}if(typeof process<"u"&&process.cwd){let e=process.cwd(),t=e.slice(-1);if(t==="/"||t==="\\")return e;else return e+"/"}return"/"}function _x(e){let t=IN.exec(e||"");if(t)return t[1].toLowerCase();return}function Px(e){let t=e.search(/[?#]/),r=t>=0?e.substring(0,t):e,n=Math.max(r.lastIndexOf("/"),r.lastIndexOf("\\")),i=r.lastIndexOf(".");if(i>n)return r.substring(i).toLowerCase();return""}function Pr(e){if(!e)return"#";let t=e.indexOf("#");if(t>=0)return e.substring(t);return"#"}function $e(e){if(!e)return"";let t=e.indexOf("#");if(t>=0)e=e.substring(0,t);return e}function kx(e){let t=_x(e);if(t==="http"||t==="https")return!0;else if(t===void 0)return typeof window<"u";else return!1}function ll(e){if(!e||typeof e!=="string")return!0;let t=e.trim().toLowerCase();if(!t)return!0;if(t.startsWith("javascript:")||t.startsWith("vbscript:")||t.startsWith("data:"))return!0;if(t.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;try{let r=new URL(t.startsWith("//")?"http:"+t:t);if(yd(r.hostname))return!0;let n=r.port;if(n&&HN(parseInt(n)))return!0}catch{if(t.startsWith("/")&&!t.startsWith("//"))return!1;if(BN(t))return!0}return!1}async function Ax(e){if(ll(e))return{unsafe:!0};if(typeof e!=="string"||typeof process>"u"||!process.versions?.node||typeof window<"u")return{unsafe:!1};let t=new URL(e.startsWith("//")?`http:${e}`:e);if(t.protocol!=="http:"&&t.protocol!=="https:")return{unsafe:!1};let i=await(await import("node:dns/promises")).lookup(jx(t.hostname),{all:!0,verbatim:!0});if(i.length===0||i.some(({address:s})=>yd(s)))return{unsafe:!0};return{unsafe:!1,addresses:i}}function yd(e){let t=jx(e);if(!t)return!0;if(t==="localhost"||DN.some((i)=>t.endsWith(i)))return!0;let r=Rx(t);if(r)return Ox(r);let n=JN(t);if(n)return FN(n);return!1}function jx(e){let t=e.trim().toLowerCase();if(t.startsWith("[")&&t.endsWith("]"))t=t.slice(1,-1);while(t.endsWith("."))t=t.slice(0,-1);return t}function Rx(e){let t=e.split(".");if(t.length!==4)return;let r=t.map((n)=>{if(!/^\d+$/.test(n))return Number.NaN;return Number(n)});if(r.some((n)=>!Number.isInteger(n)||n<0||n>255))return;return r}function Ox([e,t,r,n]){return e===0||e===10||e===127||e===100&&t>=64&&t<=127||e===169&&t===254||e===172&&t>=16&&t<=31||e===192&&t===0&&r===0||e===192&&t===168||e===198&&(t===18||t===19)||e>=224||e===255&&t===255&&r===255&&n===255}function JN(e){if(!e.includes(":"))return;let t=e,r=t.lastIndexOf(":"),n=t.slice(r+1);if(n.includes(".")){let c=Rx(n);if(!c)return;let l=c[0]*256+c[1],u=c[2]*256+c[3];t=`${t.slice(0,r+1)}${l.toString(16)}:${u.toString(16)}`}let i=t.split("::");if(i.length>2)return;let s=Ex(i[0]),o=i.length===2?Ex(i[1]):[];if(!s||!o)return;if(i.length===1)return s.length===8?s:void 0;let a=8-s.length-o.length;if(a<1)return;return[...s,...Array(a).fill(0),...o]}function Ex(e){if(!e)return[];let t=e.split(":").map((r)=>{if(!/^[\da-f]{1,4}$/i.test(r))return Number.NaN;return Number.parseInt(r,16)});if(t.some((r)=>!Number.isInteger(r)||r<0||r>65535))return;return t}function FN(e){if(e.length!==8)return!1;let t=e.every((a)=>a===0),r=e.slice(0,7).every((a)=>a===0)&&e[7]===1,n=(e[0]&65024)===64512,i=(e[0]&65472)===65152,s=(e[0]&65280)===65280;if(t||r||n||i||s)return!0;let o=qN(e);return o?Ox(o):!1}function qN(e){let t=e.slice(0,5).every((i)=>i===0),r=t&&e[5]===0,n=t&&e[5]===65535;if(!r&&!n)return;return[Math.floor(e[6]/256),e[6]%256,Math.floor(e[7]/256),e[7]%256]}function BN(e){return e.split(/[\s/?#]+/).map((r)=>r.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((r)=>yd(r))}function HN(e){return[22,23,25,53,135,139,445,993,995,1433,1521,3306,3389,5432,5900,6379,8080,8443,9200,27017].includes(e)}function ul(e){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let t=_x(e);return t===void 0||t==="file"}function Cx(e){if(ca()){let t=_r(),r=e.toUpperCase(),i=Dn(t).toUpperCase(),s=r.includes(i),o=r.includes(i),a=MN.test(e)||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("file://");if(!(s||o||a)&&!t.startsWith("http"))e=((l,u)=>{if(l.endsWith("/")||l.endsWith("\\"))return l+u;else return l+"/"+u})(t,e);e=Dn(e)}e=encodeURI(e);for(let t of LN)e=e.replace(t[0],t[1]);return e}function Bs(e,t){e=e.replace(/%(?![0-9A-Fa-f]{2})/g,"%25");for(let n=0;n<gd.length;n+=2)e=e.replace(new RegExp(gd[n].source,"gi"),gd[n+1]);e=decodeURI(e);let r=e.toLowerCase().startsWith("file://");if(r){if(e=e.replace(/^file:\/\//i,"").replace(/^\//,""),ca()&&e[1]==="/")e=`${e[0]}:${e.substring(1)}`;if(t)e="file:///"+e;else r=!1,e=ca()?e:"/"+e}if(ca()&&!r){if(e=e.replace(CN,"\\"),e.match(/^[a-z]:\\/i))e=e[0].toUpperCase()+e.substring(1)}return e}function Hs(e){if(e=ua(e),e.length<=1||e[0]!=="#"||e[1]!=="/")return[];return e.slice(2).split("/").map((t)=>t.replace(TN,"/").replace(NN,"~"))}var CN,IN,TN,NN,MN,LN,gd,DN,la=(e)=>new URL(e);var Wt=L(()=>{wx();CN=/\//g,IN=/^(\w{2,}):\/\//i,TN=/~1/g,NN=/~0/g,MN=/^[a-zA-Z]:[\\/]/,LN=[[/\?/g,"%3F"],[/#/g,"%23"]],gd=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%3F/g,"?",/%40/g,"@"],DN=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function Ix(){let e={},t=this;for(let r of zN(t))if(typeof r==="string"){let n=t[r],i=typeof n;if(!UN.includes(i))e[r]=n}return e}function zN(e,t=[]){let r=[];while(e&&e!==WN)r=r.concat(Object.getOwnPropertyNames(e),Object.getOwnPropertySymbols(e)),e=Object.getPrototypeOf(e);let n=new Set(r);for(let i of t.concat(VN))n.delete(i);return n}function zt(e){return e instanceof kr||e instanceof Us}function xd(e){if(e.path===null)e.path=[];return e}var UN,VN,WN,kr,Us,Gr,fl,Yr,dl,fa,bd,Vs;var Ar=L(()=>{Wt();UN=["function","symbol","undefined"],VN=["constructor","prototype","__proto__"],WN=Object.getPrototypeOf({});kr=class kr extends Error{name;message;source;path;code;constructor(e,t,r){super(void 0,r);this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=t,this.path=null}toJSON=Ix.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};Us=class Us extends Error{files;constructor(e){super();this.files=e,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${Bs(e.$refs._root$Ref.path)}'`}toJSON=Ix.bind(this);static getParserErrors(e){let t=[],r=new Set,n=[...Object.values(e.$refs._$refs),...Object.values(e.$refs._aliases)];for(let i of n)if(i.errors){for(let s of i.errors)if(!r.has(s.footprint))r.add(s.footprint),t.push(s)}return t}get errors(){return Us.getParserErrors(this.files)}};Gr=class Gr extends kr{code="EPARSER";name="ParserError";constructor(e,t,r){super(`Error parsing ${t}: ${e}`,t,r)}};fl=class fl extends kr{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(e){super(`Could not find parser for "${e}"`,e)}};Yr=class Yr extends kr{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(e,t,r){super(e.message||`Error reading file "${t}"`,t,r);if("code"in e)this.ioErrorCode=String(e.code)}};dl=class dl extends kr{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(e){super(`Could not find resolver for "${e}"`,e)}};fa=class fa extends kr{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(e,t,r,n,i){super(`Missing $ref pointer "${Pr(t)}". Token "${e}" does not exist.`,$e(t));this.targetToken=e,this.targetRef=r,this.targetFound=n,this.parentPath=i}};bd=class bd extends kr{code="ETIMEOUT";name="TimeoutError";constructor(e){super(`Dereferencing timeout reached: ${e}ms`)}};Vs=class Vs extends kr{code="EINVALIDPOINTER";name="InvalidPointerError";constructor(e,t){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,$e(t))}}});function ut(e,t,r=!1){let n=Ws(t,r);return n?Fe(e,n):e}function pl(e){if(!e||typeof e!=="object"||ArrayBuffer.isView(e))return!1;if(Ws(e))return!0;let t=e.$schema;if(typeof t==="string"&&(t.includes("draft-04/")||t.includes("draft-06/")||t.includes("draft-07/")||t.includes("draft/2019-09/")||t.includes("draft/2020-12/")||t.includes("oas/3.1/")))return!0;let r=e.openapi;return typeof r==="string"&&/^3\.1(?:\.|$)/.test(r)}function ml(e,t,r,n,i=!1){if(!i)return;let s=new Map,o=new Set,a=(c,l,u,d)=>{if(!c||typeof c!=="object"||ArrayBuffer.isView(c)||o.has(c))return;let h=bt(c,u),m=ut(l,c,h),y=`${h}:${m}`,g=s.get(c);if(g?.has(y))return;if(g)g.add(y);else s.set(c,new Set([y]));if(o.add(c),m!==l)e._addAlias(m,c,n,i,h,d);for(let b of Object.keys(c))a(c[b],m,h,KN(d,b));o.delete(c)};a(r,t,!1,t+"#")}function KN(e,t){return e+"/"+t.replace(/%/g,"%25").replace(/~/g,"~0").replace(/\//g,"~1")}function Ws(e,t=!1){if(!e||typeof e!=="object")return;let n=bt(e,t)?e.id:e.$id;if(typeof n==="string"&&n.length>0)return n;return}function bt(e,t=!1){if(!e||typeof e!=="object")return t;let r=e.$schema;if(typeof r==="string"){if(r.includes("draft-04/"))return!0;if(r.includes("draft-06/")||r.includes("draft-07/")||r.includes("draft/2019-09/")||r.includes("draft/2020-12/")||r.includes("oas/3.1/"))return!1}let n=e.openapi;if(typeof n==="string"&&/^3\.1(?:\.|$)/.test(n))return!1;return t}var Jn=L(()=>{Wt()});function es(e,t){return fi(t)?$d.get(e)?.get(t):void 0}function Xr(e,t,r,n){if(t.child)return t.child(r,n);let i=es(e,n);if(i)return i;let s=bt(n,t.legacyIdScope),o=t.dynamicIdScope&&fi(n)&&!ArrayBuffer.isView(n)?ut(t.scopeBase,n,s):t.scopeBase,a=(t.path.includes("#")?t.path:t.path+"#")+"/"+r.replace(/%/g,"%25").replace(/~/g,"~0").replace(/\//g,"~1");return{value:n,path:a,scopeBase:o,dynamicIdScope:t.dynamicIdScope,legacyIdScope:s}}function da(e,t,r,n,i,s=!0){if(!fi(t)||!fi(r.value)||!fi(n.value))return{...r,value:t};let o=r.value,a=n.value,l={...!s&&Object.hasOwn(a,"$ref")?n:r,value:t,child(d,h){if(!((!s||d!=="$ref")&&Object.hasOwn(a,d)))return Xr(e,r,d,h);if(!i||!fi(h))return Xr(e,n,d,h);let y=a[d],g=Xr(e,n,d,y);if(!fi(y)||Array.isArray(y))return{...g,value:h};let b=Object.hasOwn(o,d)?o[d]:void 0;if(fi(b)&&!Array.isArray(b))return es(e,h)||da(e,h,Xr(e,r,d,b),g,!0,!1);return{...g,value:h}}},u=$d.get(e);if(!u)u=new WeakMap,$d.set(e,u);return u.set(t,l),l}function fi(e){return e!==null&&typeof e==="object"}var $d;var vd=L(()=>{Jn();$d=new WeakMap});class di{$ref;path;originalPath;scopeBase;legacyIdScope;location;value;circular;chainCircular;indirections;constructor(e,t,r){this.$ref=e,this.path=t,this.originalPath=r||t,this.scopeBase=e.path||$e(t),this.legacyIdScope=e.legacyIdScope,this.value=void 0,this.circular=!1,this.chainCircular=!1,this.indirections=0}resolve(e,t,r,n=new Set,i=!0){let s=di.parse(this.path,this.originalPath),o=[];if(this.value=Mx(e),this.$ref.dynamicIdScope&&!Lx(this.$ref))this.legacyIdScope=bt(this.value,this.legacyIdScope),this.scopeBase=ut(this.scopeBase,this.value,this.legacyIdScope);this.setLocation(es(this.$ref.$refs,this.value)||{value:this.value,path:this.$ref.path,scopeBase:this.scopeBase,dynamicIdScope:this.$ref.dynamicIdScope,legacyIdScope:this.legacyIdScope});for(let c=0;c<s.length;c++){let l=this.circular,u=this.chainCircular,d=je.isExtended$Ref(this.value);if(hl(this,t,r,n))this.path=di.join(this.path,s.slice(c));else if(d)this.circular=l,this.chainCircular=u;let h=s[c];if(this.value===null||typeof this.value!=="object"&&typeof this.value!=="function"){this.value=null;let m=this.$ref.path||"",y=this.path.replace(m,""),g=di.join("",o),b=r?.replace(m,"");throw new fa(h,Tx(this.originalPath),y,g,b)}if(!Object.hasOwn(this.value,h)||this.value[h]===void 0||this.value[h]===null&&c===s.length-1){let m=!1;for(let _=s.length-1;_>c;_--){let P=s.slice(c,_+1).join("/");if(Object.hasOwn(this.value,P)&&this.value[P]!==void 0){this.value=this.value[P],this.setLocation(Xr(this.$ref.$refs,this.location,P,this.value)),c=_,m=!0;break}}if(m){this.chainCircular=u;continue}if(Object.hasOwn(this.value,h)&&this.value[h]===null){this.value=gl,this.setLocation(Xr(this.$ref.$refs,this.location,h,null)),this.chainCircular=u;continue}this.value=null;let y=this.$ref.path||"",g=this.path.replace(y,""),b=di.join("",o),x=r?.replace(y,"");throw new fa(h,Tx(this.originalPath),g,b,x)}else this.value=this.value[h];this.chainCircular=u,o.push(h),this.setLocation(Xr(this.$ref.$refs,this.location,h,this.value))}let a=this.location?.dynamicIdScope?this.scopeBase:this.location?.path||this.path;if(i){let c=this.value?.$ref?Fe(a,this.value.$ref):void 0,l=typeof r==="string"?Fe(this.$ref.$refs._root$Ref.path,r):r;if(je.isAllowed$Ref(this.value,t)&&c===l&&c!==this.path)this.chainCircular=!0;else if(!this.value||c)hl(this,t,r,n)}return this}set(e,t,r){let n=di.parse(this.path),i;if(n.length===0)return this.value=t,t;if(e2(this.path,n),this.value=Mx(e),this.$ref.dynamicIdScope&&!Lx(this.$ref))this.legacyIdScope=bt(this.value,this.legacyIdScope),this.scopeBase=ut(this.scopeBase,this.value,this.legacyIdScope);this.setLocation(es(this.$ref.$refs,this.value)||{value:this.value,path:this.$ref.path,scopeBase:this.scopeBase,dynamicIdScope:this.$ref.dynamicIdScope,legacyIdScope:this.legacyIdScope});for(let s=0;s<n.length-1;s++){if(hl(this,r),i=n[s],this.value&&Object.hasOwn(this.value,i)&&this.value[i]!==void 0)this.value=this.value[i];else this.value=Nx(this,i,{});this.setLocation(Xr(this.$ref.$refs,this.location,i,this.value))}return hl(this,r),i=n[n.length-1],Nx(this,i,t),e}setLocation(e){this.location=e,this.scopeBase=e.scopeBase,this.legacyIdScope=e.legacyIdScope}static parse(e,t){let r=ua(Pr(e).substring(1));if(!r)return[];let n=r.split("/");for(let i=0;i<n.length;i++)n[i]=n[i].replace(XN,"/").replace(QN,"~");if(n[0]!=="")throw new Vs(r,t===void 0?e:t);return n.slice(1)}static join(e,t){if(e.indexOf("#")===-1)e+="#";t=Array.isArray(t)?t:[t];for(let r=0;r<t.length;r++){let n=t[r];e+="/"+n.replace(/%/g,"%25").replace(YN,"~0").replace(GN,"~1")}return e}}function Tx(e){try{return decodeURI(e)}catch{return e}}function hl(e,t,r,n=new Set){let i=!1,s=r,o=[];try{while(je.isAllowed$Ref(e.value,t)){let a=je.isExtended$Ref(e.value),{value:c,path:l}=e,u=e.location?.dynamicIdScope?e.scopeBase:e.location?.path||e.path,d=Fe(u,e.value.$ref);if(d===e.path&&!t2(s))return e.circular=!0,e.chainCircular=!0,i;let h=typeof s==="string"?Fe(e.$ref.$refs._root$Ref.path,s):s;if(d===h&&d!==e.path)return e.chainCircular=!0,i;if(n.has(d))return e.chainCircular=!0,i;let m=t?.dereference?.maxDepth??500;if(n.size>=m)throw RangeError(`Maximum dereference depth (${m}) exceeded at ${e.path}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);n.add(d),o.push(d);let y=e.$ref.$refs._resolve(d,l,t,n,a);if(y===null)return i;if(e.indirections+=y.indirections+1,e.chainCircular||=y.circular||y.chainCircular,a){if(e.chainCircular)return i;return e.value=je.dereference(c,y.value,t),e.setLocation(da(e.$ref.$refs,e.value,y.location,e.location,t?.dereference?.mergeKeys??!0)),i}else e.$ref=y.$ref,e.path=y.path,e.value=y.value,e.scopeBase=y.scopeBase,e.legacyIdScope=y.legacyIdScope,e.location=y.location,s=l,i=!0}return i}finally{for(let a of o)n.delete(a)}}function Nx(e,t,r){if(e.value&&typeof e.value==="object")if(t==="-"&&Array.isArray(e.value))e.value.push(r);else e.value[t]=r;else throw new kr(`Error assigning $ref pointer "${e.path}".
104
- Cannot set "${t}" of a non-object.`);return r}function e2(e,t){for(let r of t)if(ZN.has(r))throw new kr(`Error assigning $ref pointer "${e}".
105
- Unsafe JSON Pointer token "${r}" cannot be used for assignment.`)}function Mx(e){if(zt(e))throw e;return e}function t2(e){return typeof e=="string"&&di.parse(e).length==0}function Lx(e){return Boolean(e.path&&e.path in e.$refs._aliases)}var gl,GN,YN,XN,QN,ZN,qe;var zs=L(()=>{ts();Wt();Ar();Jn();vd();gl=Symbol("null"),GN=/\//g,YN=/~/g,XN=/~1/g,QN=/~0/g,ZN=new Set(["__proto__","constructor","prototype"]);qe=di});class pa{path;sourcePath;value;$refs;pathType;dynamicIdScope=!1;legacyIdScope=!1;errors=[];constructor(e){this.$refs=e}addError(e){if(this.errors===void 0)this.errors=[];let t=this.errors.map(({footprint:r})=>r);if("errors"in e&&Array.isArray(e.errors))this.errors.push(...e.errors.map(xd).filter(({footprint:r})=>!t.includes(r)));else if(!("footprint"in e)||!t.includes(e.footprint))this.errors.push(xd(e))}exists(e,t){try{return this.resolve(e,t),!0}catch{return!1}}get(e,t){return this.resolve(e,t)?.value}resolve(e,t,r,n,i,s=!0){let o=new qe(this,e,r);try{let a=o.resolve(this.value,t,n,i,s);if(a.value===gl)a.value=null;return a}catch(a){if(!t||!t.continueOnError||!zt(a))throw a;if(a.path===null)a.path=Hs(Pr(n));if(a instanceof Vs)a.source=r2($e(n||r||e));return this.addError(a),null}}set(e,t){let r=new qe(this,e);if(this.value=r.set(this.value,t),this.value===gl)this.value=null}static is$Ref(e){return Boolean(e)&&typeof e==="object"&&e!==null&&"$ref"in e&&typeof e.$ref==="string"&&e.$ref.length>0}static isExternal$Ref(e){return pa.is$Ref(e)&&e.$ref[0]!=="#"}static isAllowed$Ref(e,t){if(this.is$Ref(e)){if(e.$ref.substring(0,2)==="#/"||/^#%2f/i.test(e.$ref)||e.$ref==="#")return!0;else if(e.$ref[0]!=="#"&&(!t||t.resolve?.external))return!0}return}static isExtended$Ref(e){return pa.is$Ref(e)&&Object.keys(e).length>1}static dereference(e,t,r){if(t&&typeof t==="object"&&pa.isExtended$Ref(e)){let n={};for(let o of Object.keys(e))if(o!=="$ref")ma(n,o,e[o]);let i=r?.dereference?.mergeKeys??!0,s=t;for(let o of Object.keys(s))if(!Object.hasOwn(n,o))ma(n,o,s[o]);else if(i&&typeof n[o]==="object"&&n[o]!==null&&typeof s[o]==="object"&&s[o]!==null)ma(n,o,Dx(s[o],n[o]));return n}else return t}}function r2(e){try{return decodeURI(e)}catch{return e}}function Dx(e,t){if(typeof e!=="object"||e===null)return t;if(typeof t!=="object"||t===null)return t;if(Array.isArray(t)||Array.isArray(e))return wd(t);let r=wd(e),n=e,i=t;for(let s of Object.keys(i)){let o=i[s],a;if(Array.isArray(o))a=wd(o);else if(typeof o==="object"&&o!==null){let c=Object.hasOwn(n,s)?n[s]:void 0;a=Dx(c,o)}else a=o;ma(r,s,a)}return r}function wd(e){let t=Array.isArray(e)?Array(e.length):{},r=e;for(let n of Object.keys(r))ma(t,n,r[n]);return t}function ma(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0})}var je;var ts=L(()=>{zs();Ar();Wt();je=pa});class ha{circular;paths(...e){return Jx(this._$refs,e.flat()).map((r)=>Dn(r.decoded))}values(...e){let t=this._$refs;return Jx(t,e.flat()).reduce((n,i)=>(n[Dn(i.decoded)]=t[i.encoded].value,n),{})}exists(e,t){try{return this._resolve(e,"",t)!==null}catch{return!1}}get(e,t){return this._resolve(e,"",t)?.value}set(e,t){let r=Fe(this._root$Ref.path,e),n=this._getRef(r);if(!n)throw Error(`Error resolving $ref pointer "${e}".
106
- "${$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 Sd(e){return Object.keys(e||{}).filter((t)=>typeof e[t]==="object").map((t)=>(e[t].name=t,e[t]))}function Ed(e,t,r,n,i){return e.filter((s)=>!!qx(s,t,r,n,i))}function _d(e){return e.sort((t,r)=>(t.order??Number.MAX_SAFE_INTEGER)-(r.order??Number.MAX_SAFE_INTEGER))}async function Pd(e,t,r,n){let i,s=0;return new Promise((o,a)=>{c();function c(){let d=e[s++];if(!d)return a(i);let h=!1,m=!1,y=(g,b)=>{if(m=!0,h)return;if(h=!0,g)u(d,g);else l(d,b)};try{let g=qx(d,t,r,y,n);if(g&&typeof g.then==="function")g.then((b)=>y(void 0,b),(b)=>y(b,void 0));else if(g!==void 0)y(void 0,g);else if(!m&&!n2(d,t))y(Error("No promise has been returned or callback has been called."),void 0)}catch(g){y(g,void 0)}}function l(d,h){o({plugin:d,result:h})}function u(d,h){i={plugin:d,error:h},c()}})}function n2(e,t){let r=e[t];return typeof r==="function"&&r.length>=2}function qx(e,t,r,n,i){let s=e[t];if(typeof s==="function")return s.apply(e,[r,n,i]);if(!n){if(s instanceof RegExp){s.lastIndex=0;let o=s.test(r.url);return s.lastIndex=0,o}else if(typeof s==="string")return s===r.extension;else if(Array.isArray(s))return s.indexOf(r.extension)!==-1}return s}async function i2(e,t,r){let n=typeof e==="string"?e:e.url,i=typeof e==="string"?void 0:e.baseUrl,s=typeof e==="string"?void 0:e.reference,o=n.indexOf("#"),a="";if(o>=0)a=n.substring(o),n=n.substring(0,o);if(s){let u=s.indexOf("#");if(u>=0)s=s.substring(0,u)}let c=t._add(n),l={url:n,hash:a,extension:Px(n),...s!==void 0?{reference:s}:{},...i!==void 0?{baseUrl:i}:{}};try{let u=await s2(l,r,t);c.pathType=u.plugin.name,l.data=u.result;let d=await o2(l,r,t);return c.value=d.result,c.dynamicIdScope=pl(c.value),c.legacyIdScope=bt(c.value),ml(t,c.path,c.value,c.pathType,c.dynamicIdScope),d.result}catch(u){if(zt(u))c.value=u;throw u}}async function s2(e,t,r){let n=Sd(t.resolve);n=Ed(n,"canRead",e,void 0,r),_d(n);try{return await Pd(n,"read",e,r)}catch(i){if(!i&&t.continueOnError)throw new dl(e.url);else if(!i||!("error"in i))throw SyntaxError(`Unable to resolve $ref pointer "${e.url}"`,{cause:i});else if(i.error instanceof Yr)throw i.error;else{let s=i.error instanceof Error?i.error:Error(String(i.error));throw new Yr(s,e.url,{cause:i.error})}}}async function o2(e,t,r){let n=Sd(t.parse),i=Ed(n,"canParse",e),s=i.length>0?i:n;_d(s);try{let o=await Pd(s,"parse",e,r);if(!o.plugin.allowEmpty&&a2(o.result))throw SyntaxError(`Error parsing "${e.url}" as ${o.plugin.name}.
108
- Parsed value is empty`);else return o}catch(o){if(!o&&t.continueOnError)throw new fl(e.url);else if(o&&o.message&&o.message.startsWith("Error parsing"))throw o;else if(!o||!("error"in o))throw SyntaxError(`Unable to parse ${e.url}`,{cause:o});else if(o.error instanceof Gr)throw o.error;else throw new Gr(o.error?.message??String(o.error),e.url,{cause:o.error})}}function a2(e){return e===void 0||e===null||typeof e==="object"&&Object.keys(e).length===0||typeof e==="string"&&e.trim().length===0||Buffer.isBuffer(e)&&e.length===0}var Ks;var yl=L(()=>{Wt();Jn();Ar();Ks=i2});var Bx;var Hx=L(()=>{Ar();Bx={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(e){let t=e.data;if(Buffer.isBuffer(t))t=t.toString();if(typeof t==="string"){if(t.trim().length===0)return;if(this.allowBOM&&t.charCodeAt(0)===65279)t=t.slice(1);try{return JSON.parse(t)}catch(r){throw new Gr(r.message,e.url)}}else return t}}});function Nt(e,t){return{tagName:e,nodeKind:"scalar",implicit:t.implicit??!1,matchByTagPrefix:t.matchByTagPrefix??!1,implicitFirstChars:t.implicitFirstChars??null,resolve:t.resolve,identify:t.identify,represent:t.represent??((r)=>String(r)),representTagName:t.representTagName??(()=>e)}}function Jd(e,t){let r=t.finalize===void 0;return{tagName:e,nodeKind:"sequence",implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addItem:t.addItem,finalize:t.finalize??((n)=>n),carrierIsResult:r,identify:t.identify,represent:t.represent??((n)=>n),representTagName:t.representTagName??(()=>e)}}function vl(e,t){let r=t.finalize===void 0;return{tagName:e,nodeKind:"mapping",implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addPair:t.addPair,has:t.has,keys:t.keys,get:t.get,finalize:t.finalize??((n)=>n),carrierIsResult:r,identify:t.identify,represent:t.represent??((n)=>n),representTagName:t.representTagName??(()=>e)}}function _2(e){let t=e,r=1;if(t[0]==="-"||t[0]==="+"){if(t[0]==="-")r=-1;t=t.slice(1)}if(t.startsWith("0b"))return r*parseInt(t.slice(2),2);if(t.startsWith("0o"))return r*parseInt(t.slice(2),8);if(t.startsWith("0x"))return r*parseInt(t.slice(2),16);return r*parseInt(t,10)}function P2(e,t){if(t){if(!E2.test(e))return Te}else if(!S2.test(e))return Te;let r=_2(e);return Number.isFinite(r)?r:Te}function j2(e){let t=e,r=1;if(t[0]==="-"||t[0]==="+"){if(t[0]==="-")r=-1;t=t.slice(1)}if(t.startsWith("0b"))return r*parseInt(t.slice(2),2);if(t.startsWith("0o"))return r*parseInt(t.slice(2),8);if(t.startsWith("0x"))return r*parseInt(t.slice(2),16);return r*parseInt(t,10)}function R2(e,t){if(t){if(!A2.test(e))return Te}else if(!k2.test(e))return Te;let r=j2(e);return Number.isFinite(r)?r:Te}function I2(e){let t=e.replace(/_/g,""),r=1;if(t[0]==="-"||t[0]==="+"){if(t[0]==="-")r=-1;t=t.slice(1)}if(t.startsWith("0b"))return r*parseInt(t.slice(2),2);if(t.startsWith("0x"))return r*parseInt(t.slice(2),16);if(t.includes(":")){let n=0;for(let i of t.split(":"))n=n*60+Number(i);return r*n}if(t!=="0"&&t[0]==="0")return r*parseInt(t,8);return r*parseInt(t,10)}function T2(e){if(!C2.test(e))return Te;let t=I2(e);return Number.isFinite(t)?t:Te}function L2(e){if(!N2.test(e))return Te;let t=e.toLowerCase(),r=t[0]==="-"?-1:1;if("+-".includes(t[0]))t=t.slice(1);if(t===".inf")return r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(t===".nan")return NaN;let n=r*parseFloat(t);if(Number.isFinite(n)||M2.test(e))return n;return Te}function D2(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}function q2(e,t){if(t){if(!F2.test(e))return Te;let n=e.toLowerCase(),i=n[0]==="-"?-1:1;if("+-".includes(n[0]))n=n.slice(1);if(n===".inf")return i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(n===".nan")return NaN;let s=i*parseFloat(n);return Number.isFinite(s)?s:Te}if(!J2.test(e))return Te;let r=Number(e);if(Number.isFinite(r))return r;return Te}function B2(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}function W2(e){if(!U2.test(e))return Te;let t=e.toLowerCase().replace(/_/g,""),r=t[0]==="-"?-1:1;if("+-".includes(t[0]))t=t.slice(1);if(t===".inf")return r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(t===".nan")return NaN;let n=0;if(t.includes(":")){for(let i of t.split(":"))n=n*60+Number(i);n*=r}else n=r*parseFloat(t);if(Number.isFinite(n)||V2.test(e))return n;return Te}function z2(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}function G2(e){let t=e.replace(/\s/g,"");if(t.length%4!==0||!K2.test(t))return Te;let r=atob(t),n=new Uint8Array(r.length);for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return n}function Y2(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Ux(e,t,r,n=0,i=0,s=0,o=0){let a=new Date(Date.UTC(e,t,r,n,i,s,o));return a.setUTCFullYear(e,t,r),a}function Z2(e){let t=X2.exec(e);if(t===null)t=Q2.exec(e);if(t===null)return Te;let r=+t[1],n=+t[2]-1,i=+t[3];if(!t[4]){let u=Ux(r,n,i);if(u.getUTCFullYear()!==r||u.getUTCMonth()!==n||u.getUTCDate()!==i)return Te;return u}let s=+t[4],o=+t[5],a=+t[6],c=0;if(s>23||o>59||a>59)return Te;if(t[7]){let u=t[7].slice(0,3);while(u.length<3)u+="0";c=+u}let l=Ux(r,n,i,s,o,a,c);if(l.getUTCFullYear()!==r||l.getUTCMonth()!==n||l.getUTCDate()!==i)return Te;if(t[9]){let u=+t[10],d=+(t[11]||0);if(u>23||d>59)return Te;let h=(u*60+d)*60000;l.setTime(l.getTime()-(t[9]==="-"?-h:h))}return l}function wl(e){if(e===null||typeof e!=="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Vx(e,t){let r={};for(let n of t)if(e[n]!==void 0)r[n]=e[n];return r}function rM(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}function nM(){return{scalar:[],sequence:[],mapping:[]}}function iM(e){let t=[];for(let r of e){let n=t.length;for(let i=0;i<t.length;i++){let s=t[i];if(s.nodeKind===r.nodeKind&&s.tagName===r.tagName&&s.matchByTagPrefix===r.matchByTagPrefix){n=i;break}}t[n]=r}return t}function Wx(e){if(Array.isArray(e)){let t=Array.prototype.slice.call(e);for(let r=0;r<t.length;r++){if(Array.isArray(t[r]))return null;if(typeof t[r]==="object"&&Object.prototype.toString.call(t[r])==="[object Object]")t[r]="[object Object]"}return String(t)}if(typeof e==="object"&&Object.prototype.toString.call(e)==="[object Object]")return"[object Object]";return String(e)}function kd(e,t,r,n,i){let s="",o="",a=Math.floor(i/2)-1;if(n-t>a)s=" ... ",t=n-a+s.length;if(r-n>a)o=" ...",r=n+a-o.length;return{str:s+e.slice(t,r).replace(/\t/g,"→")+o,pos:n-t+s.length}}function Ad(e,t){return" ".repeat(Math.max(t-e.length,0))+e}function cM(e,t){if(!e.buffer)return null;let r={...aM,...t},n=/\r?\n|\r|\0/g,i=[0],s=[],o,a=-1;while(o=n.exec(e.buffer))if(s.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&a<0)a=i.length-2;if(a<0)a=i.length-1;let c="",l=Math.min(e.line+r.linesAfter,s.length).toString().length,u=r.maxLength-(r.indent+l+3);for(let h=1;h<=r.linesBefore;h++){if(a-h<0)break;let m=kd(e.buffer,i[a-h],s[a-h],e.position-(i[a]-i[a-h]),u);c=`${" ".repeat(r.indent)}${Ad((e.line-h+1).toString(),l)} | ${m.str}
109
- ${c}`}let d=kd(e.buffer,i[a],s[a],e.position,u);c+=`${" ".repeat(r.indent)}${Ad((e.line+1).toString(),l)} | ${d.str}
110
- `,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=kd(e.buffer,i[a+h],s[a+h],e.position-(i[a]-i[a+h]),u);c+=`${" ".repeat(r.indent)}${Ad((e.line+h+1).toString(),l)} | ${m.str}
112
- `}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 uM(e){if(e<=65535)return String.fromCharCode(e);return String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function fM(e){if(e>=48&&e<=57)return e-48;return(e|32)-97+10}function dM(e){if(e===120)return 2;if(e===117)return 4;return 8}function bl(e,t,r){let n=0;while(t<r){let i=e.charCodeAt(t);if(i===10)n++,t++;else if(i===13){if(n++,t++,e.charCodeAt(t)===10)t++}else if(i===32||i===9)t++;else break}return{position:t,breaks:n}}function zd(e){if(e===1)return" ";return`
116
- `.repeat(e-1)}function pM(e,t,r){let n="",i=t,s=t,o=t;while(i<r){let a=e.charCodeAt(i);if(a===10||a===13){n+=e.slice(s,o);let c=bl(e,i,r);n+=zd(c.breaks),i=s=o=c.position}else if(i++,a!==32&&a!==9)o=i}return n+e.slice(s,o)}function mM(e,t,r){let n="",i=t,s=t,o=t;while(i<r){let a=e.charCodeAt(i);if(a===39)n+=e.slice(s,i)+"'",i+=2,s=o=i;else if(a===10||a===13){n+=e.slice(s,o);let c=bl(e,i,r);n+=zd(c.breaks),i=s=o=c.position}else if(i++,a!==32&&a!==9)o=i}return n+e.slice(s,r)}function hM(e,t,r){let n="",i=t,s=t,o=t;while(i<r){let a=e.charCodeAt(i);if(a===92){n+=e.slice(s,i),i++;let c=e.charCodeAt(i);if(c===10||c===13)i=bl(e,i,r).position;else if(c<256&&o$[c])n+=a$[c],i++;else{let l=dM(c),u=0;for(;l>0;l--){i++;let d=fM(e.charCodeAt(i));u=(u<<4)+d}n+=uM(u),i++}s=o=i}else if(a===10||a===13){n+=e.slice(s,o);let c=bl(e,i,r);n+=zd(c.breaks),i=s=o=c.position}else if(i++,a!==32&&a!==9)o=i}return n+e.slice(s,r)}function Gx(e,t,r,n,i,s){let o=n<0?0:n,a=e.slice(t,r).replace(/\r\n?/g,`
117
- `),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 gM(e,t){if(t.valueStart===lM)return"";let{valueStart:r,valueEnd:n}=t;if(t.fast)return e.slice(r,n);switch(t.style){case ke.SINGLE_QUOTED:return mM(e,r,n);case ke.DOUBLE_QUOTED:return hM(e,r,n);case ke.LITERAL_BLOCK:return Gx(e,r,n,t.indent,t.chomping,!1);case ke.FOLDED_BLOCK:return Gx(e,r,n,t.indent,t.chomping,!0);default:return pM(e,r,n)}}function jd(e){let t="",r=0;while(r<e.length){if(e.charCodeAt(r)!==37){t+=e[r++];continue}let n=parseInt(e.slice(r+1,r+3),16);if(r+=3,n>=192){let i=n<224?1:n<240?2:3;n&=(1<<6-i)-1;while(i-- >0)n=n<<6|parseInt(e.slice(r+1,r+3),16)&63,r+=3}if(n<65536)t+=String.fromCharCode(n);else n-=65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)}return t}function c$(e,t){if(e.startsWith("!<")&&e.endsWith(">"))return jd(e.slice(2,-1));let r=e.indexOf("!",1),n=r===-1?"!":e.slice(0,r+1);return jd(t?.[n]??yM[n]??n)+jd(e.slice(n.length))}function $M(e){if("tagStart"in e&&e.tagStart!==Gs)return e.tagStart;if("anchorStart"in e&&e.anchorStart!==Gs)return e.anchorStart;if("valueStart"in e&&e.valueStart!==Gs)return e.valueStart;if("start"in e)return e.start;return 0}function _t(e,t){rs.throwAt(e.source,e.position,t,e.filename)}function l$(e,t,r,n){try{return r.finalize(n)}catch(i){if(i instanceof rs)throw i;rs.throwAt(e.source,t,i instanceof Error?i.message:String(i),e.filename)}}function vM(e,t){let r=gM(e.source,t),n=t.tagStart===Gs?"":e.source.slice(t.tagStart,t.tagEnd),i=e.schema.defaultScalarTag;if(n!==""){if(n==="!")return{value:r,tag:i};let s=c$(n,e.tagHandlers),o=e.schema.lookupScalarTag(s);if(o){let c=o.resolve(r,!0,s);if(c===Te)_t(e,`cannot resolve a node with !<${s}> explicit tag`);return{value:c,tag:o}}let a=e.schema.lookupMappingTag(s)??e.schema.lookupSequenceTag(s);if(a){if(r!=="")_t(e,`cannot resolve a node with !<${s}> explicit tag`);let c=a.create(s);return{value:a.carrierIsResult?c:l$(e,e.position,a,c),tag:a}}_t(e,`unknown scalar tag !<${s}>`)}if(t.style===ke.PLAIN)return e.schema.resolveImplicitScalarTag(r);return{value:i.resolve(r,!1,i.tagName),tag:i}}function Yx(e,t,r){let n=t.tagStart===Gs?"":e.source.slice(t.tagStart,t.tagEnd);return n===""||n==="!"?r:c$(n,e.tagHandlers)}function u$(e){return e.nodeKind==="mapping"}function Xx(e){if(e.totalMergeKeys++,e.maxTotalMergeKeys!==-1&&e.totalMergeKeys>e.maxTotalMergeKeys)_t(e,`merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`)}function Qx(e,t,r,n){Xx(e);for(let i of n.keys(r)){if(Xx(e),t.tag.has(t.value,i))continue;let s=t.tag.addPair(t.value,i,n.get(r,i));if(s)_t(e,s);t.overridable??=new Set,t.overridable.add(i)}}function wM(e,t,r,n){if(e.position=t.keyPosition,u$(n))Qx(e,t,r,n);else if(n.nodeKind==="sequence"&&Array.isArray(r)){if(r.length>100)_t(e,"abnormal merge sequence size");for(let i of r){let s=e.nodeTags.get(i);if(!s)_t(e,"cannot merge mappings; the provided source object is unacceptable");Qx(e,t,i,s)}}else _t(e,"cannot merge mappings; the provided source object is unacceptable")}function SM(e,t,r,n,i){if(e.position=t.keyPosition,t.keyIsMerge){wM(e,t,n,i);return}if(!e.json&&t.tag.has(t.value,r)&&!t.overridable?.has(r))_t(e,"duplicated mapping key");let s=t.tag.addPair(t.value,r,n);if(s)_t(e,s);t.overridable?.delete(r)}function Rd(e,t,r){let n=e.frames[e.frames.length-1];if(n.kind==="document")n.value=t,n.hasValue=!0;else if(n.kind==="sequence"){if(u$(r))e.nodeTags.set(t,r);let i=n.tag.addItem(n.value,t,n.index++);if(i)_t(e,i)}else if(n.hasKey){let i=n.key;n.key=void 0,n.hasKey=!1,SM(e,n,i,t,r)}else n.key=t,n.keyPosition=e.position,n.hasKey=!0,n.keyIsMerge=r.tagName===xM}function Od(e,t,r,n,i){if(t.anchorStart!==Gs){let s={value:r,tag:n,isValueFinal:i};return e.anchors.set(e.source.slice(t.anchorStart,t.anchorEnd),s),s}return null}function EM(e,t){let r={...Kd,...t,events:e,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,nodeTags:new Map,tagHandlers:Object.create(null),totalMergeKeys:0,aliasCount:0};while(r.eventIndex<r.events.length){let n=r.events[r.eventIndex++];switch(r.position=$M(n),n.type){case ct.DOCUMENT:r.anchors=new Map,r.nodeTags=new Map,r.aliasCount=0,r.tagHandlers=Object.create(null);for(let i of n.directives)if(i.kind==="tag")r.tagHandlers[i.handle]=i.prefix;r.frames.push({kind:"document",position:r.position,value:void 0,hasValue:!1});break;case ct.SCALAR:{let{value:i,tag:s}=vM(r,n);Od(r,n,i,s,!0),Rd(r,i,s);break}case ct.SEQUENCE:{let i=Yx(r,n,"tag:yaml.org,2002:seq"),s=r.schema.lookupSequenceTag(i);if(!s)_t(r,`unknown sequence tag !<${i}>`);let o=s.create(i),a=Od(r,n,o,s,s.carrierIsResult);r.frames.push({kind:"sequence",position:r.position,value:o,tag:s,anchor:a,index:0});break}case ct.MAPPING:{let i=Yx(r,n,"tag:yaml.org,2002:map"),s=r.schema.lookupMappingTag(i);if(!s)_t(r,`unknown mapping tag !<${i}>`);let o=s.create(i),a=Od(r,n,o,s,s.carrierIsResult);r.frames.push({kind:"mapping",position:r.position,value:o,tag:s,anchor:a,key:void 0,keyPosition:r.position,hasKey:!1,keyIsMerge:!1,overridable:null});break}case ct.ALIAS:{if(r.maxAliases!==-1&&++r.aliasCount>r.maxAliases)_t(r,`aliases exceeded maxAliases (${r.maxAliases})`);let i=r.source.slice(n.anchorStart,n.anchorEnd),s=r.anchors.get(i);if(!s)_t(r,`unidentified alias "${i}"`);if(!s.isValueFinal)_t(r,`recursive alias "${i}" is not supported for tag ${s.tag.tagName} because it uses finalize()`);Rd(r,s.value,s.tag);break}case ct.POP:{let i=r.frames.pop();if(i.kind==="mapping"&&i.hasKey)r.position=i.keyPosition,_t(r,"incomplete mapping pair in event stream");if(i.kind==="document")r.documents.push(i.value);else{let s=i.tag.carrierIsResult?i.value:l$(r,i.position,i.tag,i.value);if(i.anchor)i.anchor.value=s,i.anchor.isValueFinal=!0;Rd(r,s,i.tag)}break}}}return r.documents}function RM(e,t,r){e.events.push({type:ct.DOCUMENT,explicitStart:t,explicitEnd:r,directives:e.directives})}function g$(e,t,r,n,i,s,o){e.events.push({type:ct.SEQUENCE,start:t,anchorStart:r,anchorEnd:n,tagStart:i,tagEnd:s,style:o})}function y$(e,t,r,n,i,s,o){e.events.push({type:ct.MAPPING,start:t,anchorStart:r,anchorEnd:n,tagStart:i,tagEnd:s,style:o})}function Zx(e,t){e.events.splice(t.eventsLength,0,{type:ct.MAPPING,start:t.position,anchorStart:Me,anchorEnd:Me,tagStart:Me,tagEnd:Me,style:pi.FLOW})}function ro(e,t,r,n,i,s,o,a,c=jr.CLIP,l=-1,u=!1){e.events.push({type:ct.SCALAR,valueStart:t,valueEnd:r,anchorStart:n,anchorEnd:i,tagStart:s,tagEnd:o,style:a,chomping:c,indent:l,fast:u})}function OM(e,t,r){e.events.push({type:ct.ALIAS,anchorStart:t,anchorEnd:r})}function Ys(e){e.events.push({type:ct.POP})}function Kt(e){ro(e,Me,Me,Me,Me,Me,Me,ke.PLAIN)}function e$(){return{anchorStart:Me,anchorEnd:Me,tagStart:Me,tagEnd:Me}}function Xs(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,eventsLength:e.events.length}}function Qs(e,t){e.position=t.position,e.line=t.line,e.lineStart=t.lineStart,e.lineIndent=t.lineIndent,e.firstTabInLine=t.firstTabInLine,e.events.length=t.eventsLength}function ce(e,t){rs.throwAt(e.input.slice(0,e.length),e.position,t,e.filename)}function wt(e){return e===10||e===13}function no(e){return e===9||e===32}function Qr(e){return no(e)||wt(e)}function Fn(e){return e===0||Qr(e)}function ns(e){return e===44||e===91||e===93||e===123||e===125}function CM(e){return e>=48&&e<=57?e-48:-1}function IM(e){if(e>=48&&e<=57)return e-48;let t=e|32;if(t>=97&&t<=102)return t-97+10;return-1}function TM(e){if(e===120)return 2;if(e===117)return 4;if(e===85)return 8;return 0}function NM(e){return e===48||e===97||e===98||e===116||e===9||e===110||e===118||e===102||e===114||e===101||e===32||e===34||e===47||e===92||e===78||e===95||e===76||e===80}function $l(e){if(e.input.charCodeAt(e.position)===10)e.position++;else if(e.position++,e.input.charCodeAt(e.position)===10)e.position++;e.line++,e.lineStart=e.position,e.lineIndent=0,e.firstTabInLine=-1}function Tt(e,t){let r=0,n=e.input.charCodeAt(e.position),i=e.position===e.lineStart||Qr(e.input.charCodeAt(e.position-1));while(n!==0){while(no(n)){if(i=!0,n===9&&e.firstTabInLine===-1)e.firstTabInLine=e.position;n=e.input.charCodeAt(++e.position)}if(t&&i&&n===35)do n=e.input.charCodeAt(++e.position);while(!wt(n)&&n!==0);if(!wt(n))break;$l(e),r++,i=!0,n=e.input.charCodeAt(e.position);while(n===32)e.lineIndent++,n=e.input.charCodeAt(++e.position)}return r}function eo(e,t=e.position){let r=e.input.charCodeAt(t);if((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)){let n=e.input.charCodeAt(t+3);return n===0||Qr(n)}return!1}function b$(e){if(e.position===e.lineStart&&e.input.charCodeAt(e.position)===65279)e.position++,e.lineStart=e.position}function Yd(e){if(e.position!==e.lineStart)return!1;if(eo(e))return!0;if(e.input.charCodeAt(e.position)!==65279)return!1;let t=Xs(e);b$(e),Tt(e,!0);let r=e.input.charCodeAt(e.position),n=e.position===e.lineStart&&(r===37||r===45&&eo(e));return Qs(e,t),n}function t$(e){let t=e.input.charCodeAt(e.position);while(t!==0&&!wt(t))t=e.input.charCodeAt(++e.position)}function x$(e,t,r){let n=_M.exec(e.input.slice(t,r));if(n!==null)e.position=t+n.index+n[0].length-1,ce(e,"the stream contains non-printable characters")}function MM(e,t,r){if(e.input.charCodeAt(e.position)!==33)return!1;if(t.tagStart!==Me)ce(e,"duplication of a tag property");let n=e.position,i=!1,s=!1,o="!",a=e.input.charCodeAt(++e.position);if(a===60)i=!0,a=e.input.charCodeAt(++e.position);else if(a===33)s=!0,o="!!",a=e.input.charCodeAt(++e.position);let c=e.position,l;if(i){while(a!==0&&a!==62)a=e.input.charCodeAt(++e.position);if(a!==62)ce(e,"unexpected end of the stream within a verbatim tag");l=e.input.slice(c,e.position),e.position++}else{while(a!==0&&!Qr(a)&&!(r&&ns(a))){if(a===33)if(!s){if(o=e.input.slice(c-1,e.position+1),!m$.test(o))ce(e,"named tag handle cannot contain such characters");s=!0,c=e.position+1}else ce(e,"tag suffix cannot contain exclamation marks");a=e.input.charCodeAt(++e.position)}if(l=e.input.slice(c,e.position),PM.test(l))ce(e,"tag suffix cannot contain flow indicator characters")}if(l&&!(i?kM.test(l):AM.test(l)))ce(e,`tag name cannot contain such characters: ${l}`);if(!i&&o!=="!"&&o!=="!!"&&!f$.call(e.tagHandlers,o))ce(e,`undeclared tag handle "${o}"`);return t.tagStart=n,t.tagEnd=e.position,!0}function LM(e,t){if(e.input.charCodeAt(e.position)!==38)return!1;if(t.anchorStart!==Me)ce(e,"duplication of an anchor property");e.position++;let r=e.position;while(e.input.charCodeAt(e.position)!==0&&!Qr(e.input.charCodeAt(e.position))&&!ns(e.input.charCodeAt(e.position)))e.position++;if(e.position===r)ce(e,"name of an anchor node must contain at least one character");return t.anchorStart=r,t.anchorEnd=e.position,!0}function DM(e,t){if(e.input.charCodeAt(e.position)!==42)return!1;if(t.anchorStart!==Me||t.tagStart!==Me)ce(e,"alias node should not have any properties");e.position++;let r=e.position;while(e.input.charCodeAt(e.position)!==0&&!Qr(e.input.charCodeAt(e.position))&&!ns(e.input.charCodeAt(e.position)))e.position++;if(e.position===r)ce(e,"name of an alias node must contain at least one character");return OM(e,r,e.position),!0}function Md(e,t){if(Tt(e,!1),e.lineIndent<t)ce(e,"deficient indentation")}function JM(e,t,r){if(e.input.charCodeAt(e.position)!==39)return!1;e.position++;let n=e.position,i=!0;while(e.input.charCodeAt(e.position)!==0){let s=e.input.charCodeAt(e.position);if(s===39){if(e.input.charCodeAt(e.position+1)===39){i=!1,e.position+=2;continue}let o=e.position;return e.position++,ro(e,n,o,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,ke.SINGLE_QUOTED,jr.CLIP,-1,i),!0}if(wt(s))i=!1,Md(e,t);else if(e.position===e.lineStart&&eo(e))ce(e,"unexpected end of the document within a single quoted scalar");else if(s!==9&&s<32)ce(e,"expected valid JSON character");else e.position++}ce(e,"unexpected end of the stream within a single quoted scalar")}function FM(e,t,r){if(e.input.charCodeAt(e.position)!==34)return!1;e.position++;let n=e.position,i=!0;while(e.input.charCodeAt(e.position)!==0){let s=e.input.charCodeAt(e.position);if(s===34){let o=e.position;return e.position++,ro(e,n,o,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,ke.DOUBLE_QUOTED,jr.CLIP,-1,i),!0}if(s===92){i=!1;let o=e.input.charCodeAt(++e.position);if(wt(o))Md(e,t);else if(NM(o))e.position++;else{let a=TM(o);if(a===0)ce(e,"unknown escape sequence");while(a-- >0)if(e.position++,IM(e.input.charCodeAt(e.position))<0)ce(e,"expected hexadecimal character");e.position++}}else if(wt(s))i=!1,Md(e,t);else if(e.position===e.lineStart&&eo(e))ce(e,"unexpected end of the document within a double quoted scalar");else if(s!==9&&s<32)ce(e,"expected valid JSON character");else e.position++}ce(e,"unexpected end of the stream within a double quoted scalar")}function qM(e,t,r){let n=e.input.charCodeAt(e.position),i=jr.CLIP,s=-1,o=!1;if(n!==124&&n!==62)return!1;let a=n===124?ke.LITERAL_BLOCK:ke.FOLDED_BLOCK;e.position++;while(e.input.charCodeAt(e.position)!==0){let m=e.input.charCodeAt(e.position),y=CM(m);if(m===43||m===45){if(i!==jr.CLIP)ce(e,"repeat of a chomping mode identifier");i=m===43?jr.KEEP:jr.STRIP,e.position++}else if(y>=0){if(y===0)ce(e,"bad explicit indentation width of a block scalar; it cannot be less than one");if(o)ce(e,"repeat of an indentation width identifier");s=t+y-1,o=!0,e.position++}else break}let c=!1;while(no(e.input.charCodeAt(e.position)))c=!0,e.position++;if(c&&e.input.charCodeAt(e.position)===35)t$(e);if(wt(e.input.charCodeAt(e.position)))$l(e);else if(e.input.charCodeAt(e.position)!==0)ce(e,"a line break is expected");let l=o?s:-1,u=0,{position:d,position:h}=e;while(e.input.charCodeAt(e.position)!==0){let m=e.position,y=0;while(e.input.charCodeAt(m+y)===32)y++;let g=e.input.charCodeAt(m+y);if(g===0){if(l>=0){if(y>l)h=m+y}else if(y>0)h=m+y;break}if(Yd(e))break;if(!o&&l===-1&&wt(g))u=Math.max(u,y);if(!o&&l===-1&&!wt(g)){if(g===9&&y<t)e.position=m+y,ce(e,"tab characters must not be used in indentation");if(y>=t&&y<u)e.position=m+y,ce(e,"bad indentation of a mapping entry")}if(l===-1&&g!==0&&!wt(g)&&y<t){e.lineIndent=y,e.position=m+y;break}if(!o&&g!==0&&!wt(g)&&l===-1)l=y;let b=l===-1?t+1:l;if(g!==0&&!wt(g)&&y<b){e.lineIndent=y,e.position=m+y;break}if(t$(e),h=e.position,wt(e.input.charCodeAt(e.position)))$l(e),h=e.position}return x$(e,d,h),ro(e,d,h,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,a,i,l),!0}function BM(e,t){let r=e.input.charCodeAt(e.position),n=t===Zs;if(r===0||Qr(r)||r===35||r===38||r===42||r===33||r===124||r===62||r===39||r===34||r===37||r===64||r===96||ns(r))return!1;if(r===63||r===45){let i=e.input.charCodeAt(e.position+1);if(Fn(i)||n&&ns(i))return!1}return!0}function HM(e,t,r,n){if(!BM(e,r))return!1;let{position:i,position:s}=e,o=e.input.charCodeAt(e.position),a=r===Zs,c=!1;while(o!==0){if(Yd(e))break;if(o===58){let l=e.input.charCodeAt(e.position+1);if(Fn(l)||a&&ns(l))break}else if(o===35){if(Qr(e.input.charCodeAt(e.position-1)))break}else if(a&&ns(o))break;else if(wt(o)){let{position:l,line:u,lineStart:d,lineIndent:h}=e;if(Tt(e,!1),e.lineIndent>=t){c=!0,o=e.input.charCodeAt(e.position);continue}e.position=l,e.line=u,e.lineStart=d,e.lineIndent=h;break}if(!no(o))s=e.position+1;o=e.input.charCodeAt(++e.position)}if(s===i)return!1;return x$(e,i,s),ro(e,i,s,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,ke.PLAIN,jr.CLIP,-1,!c),!0}function ga(e,t){let r=e.line;if(Tt(e,!0),e.line>r&&e.lineIndent<t||e.firstTabInLine!==-1&&e.lineIndent<t)ce(e,"deficient indentation")}function UM(e,t,r){let n=e.input.charCodeAt(e.position),i=n===123,s=e.position,o=!0;if(n!==91&&n!==123)return!1;let a=i?125:93;if(i)y$(e,s,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,pi.FLOW);else g$(e,s,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,pi.FLOW);e.position++;while(e.input.charCodeAt(e.position)!==0){ga(e,t);let c=e.input.charCodeAt(e.position);if(c===a)return e.position++,Ys(e),!0;else if(!o)ce(e,"missed comma between flow collection entries");else if(c===44)ce(e,"expected the node content, but found ','");let l=!1,u=!1;if(c===63&&Qr(e.input.charCodeAt(e.position+1)))l=u=!0,e.position+=1,ga(e,t);let d=e.line,h=Xs(e),m=to(e,t,Zs,!1,!0);if(ga(e,t),c=e.input.charCodeAt(e.position),(i||u||e.line===d)&&c===58){if(l=!0,e.position++,ga(e,t),!i){if(Zx(e,h),!m)Kt(e)}else if(!m)Kt(e);if(!to(e,t,Zs,!1,!0))Kt(e);if(ga(e,t),!i)Ys(e)}else if(i&&l){if(!m)Kt(e);Kt(e)}else if(i)Kt(e);else if(l){if(Zx(e,h),!m)Kt(e);Kt(e),Ys(e)}if(c=e.input.charCodeAt(e.position),c===44)o=!0,e.position++;else o=!1}ce(e,"unexpected end of the stream within a flow collection")}function r$(e,t,r){if(e.firstTabInLine!==-1||e.input.charCodeAt(e.position)!==45||!Fn(e.input.charCodeAt(e.position+1)))return!1;g$(e,e.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,pi.BLOCK);while(e.input.charCodeAt(e.position)===45&&Fn(e.input.charCodeAt(e.position+1))){if(e.firstTabInLine!==-1)e.position=e.firstTabInLine,ce(e,"tab characters must not be used in indentation");let n=e.line;e.position++;let i=Tt(e,!0)>0;if(e.firstTabInLine!==-1&&e.input.charCodeAt(e.position)===45&&Fn(e.input.charCodeAt(e.position+1)))ce(e,"bad indentation of a sequence entry");if(i&&e.lineIndent<=t)Kt(e);else to(e,t,p$,!1,!0);if(Tt(e,!0),e.lineIndent<t||e.position>=e.length)break;if(e.lineIndent>t)ce(e,"bad indentation of a sequence entry");if(e.line===n&&e.input.charCodeAt(e.position)===45&&Fn(e.input.charCodeAt(e.position+1)))ce(e,"bad indentation of a sequence entry")}return Ys(e),!0}function Cd(e,t,r,n){let i=!1,s=!1,o=!1,a=!1;if(e.firstTabInLine!==-1)return!1;let c=e.input.charCodeAt(e.position);while(c!==0){if(!i&&e.firstTabInLine!==-1)e.position=e.firstTabInLine,ce(e,"tab characters must not be used in indentation");let l=e.input.charCodeAt(e.position+1),u=e.line;if((c===63||c===58)&&Fn(l)){if(!o)y$(e,e.position,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,pi.BLOCK),o=!0;if(c===63){if(i)Kt(e);s=!0,i=!0}else if(i)i=!1;else Kt(e),s=!0,i=!1;e.position+=1,a=!0}else{if(i)Kt(e),i=!1;let d=Xs(e);if(!to(e,r,d$,!1,!0))break;if(e.line===u){c=e.input.charCodeAt(e.position);while(no(c))c=e.input.charCodeAt(++e.position);if(c===58){if(c=e.input.charCodeAt(++e.position),!Fn(c))ce(e,"a whitespace character is expected after the key-value separator within a block mapping");if(!o)e.events.splice(d.eventsLength,0,{type:ct.MAPPING,start:d.position,anchorStart:n.anchorStart,anchorEnd:n.anchorEnd,tagStart:n.tagStart,tagEnd:n.tagEnd,style:pi.BLOCK}),o=!0;s=!0,i=!1,a=!1}else if(s)ce(e,"expected ':' after a mapping key");else{if(n.anchorStart!==Me||n.tagStart!==Me)return Qs(e,d),!1;return!0}}else if(s)ce(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else{if(n.anchorStart!==Me||n.tagStart!==Me)return Qs(e,d),!1;return!0}}if(to(e,t,xl,!0,a))a=!1;if(!i){if(a)Kt(e),a=!1}if(Tt(e,!0),c=e.input.charCodeAt(e.position),(e.line===u||e.lineIndent>t)&&c!==0)ce(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}if(!s)return!1;if(i)Kt(e);if(o)Ys(e);return!0}function to(e,t,r,n,i,s=!0){if(e.depth>=e.maxDepth)ce(e,`nesting exceeded maxDepth (${e.maxDepth})`);e.depth++;let o=1,a=!1,c=!1,l=null,u=e$(),d=r===xl||r===p$,h=d,m=d;if(n&&Tt(e,!0))if(a=!0,e.lineIndent>t)o=1;else if(e.lineIndent===t)o=0;else o=-1;if(o===1)while(!0){let y=e.input.charCodeAt(e.position),g=Xs(e);if(a&&o!==1&&(y===33||y===38))break;if(a&&m&&(u.tagStart!==Me||u.anchorStart!==Me)&&(y===33||y===38)){let b=Xs(e),x=t+1;if(Cd(e,e.position-e.lineStart,x,u)&&e.events[b.eventsLength]?.type===ct.MAPPING)return e.depth--,!0;Qs(e,b)}if(a&&(y===33&&u.tagStart!==Me||y===38&&u.anchorStart!==Me))break;if(!MM(e,u,r===Zs)&&!LM(e,u))break;if(l===null)l=g;if(Tt(e,!0))if(a=!0,h=m,e.lineIndent>t)o=1;else if(e.lineIndent===t)o=0;else o=-1;else h=!1}if(h)h=a||i;if(o===1||r===xl){let y=r===Zs||r===d$?t:t+1,g=e.position-e.lineStart;if(o===1)if(h&&(r$(e,g,u)||Cd(e,g,y,u))||UM(e,y,u))c=!0;else{let b=e.input.charCodeAt(e.position);if(l!==null&&s&&m&&!h&&b!==124&&b!==62){let x=Xs(e),_=l.position-l.lineStart;if(Qs(e,l),Cd(e,_,y,e$())&&e.events[x.eventsLength]?.type===ct.MAPPING)c=!0;else Qs(e,x)}if(!c&&(d&&qM(e,y,u)||JM(e,y,u)||FM(e,y,u)||DM(e,u)||HM(e,y,r,u)))c=!0}else if(o===0)c=h&&r$(e,g,u)}if(d=d&&!c,!c&&(u.anchorStart!==Me||u.tagStart!==Me||d))ro(e,Me,Me,u.anchorStart,u.anchorEnd,u.tagStart,u.tagEnd,ke.PLAIN),c=!0;return e.depth--,c||u.anchorStart!==Me||u.tagStart!==Me}function VM(e){if(e.lineIndent>0||e.input.charCodeAt(e.position)!==37)return!1;e.position++;let t=e.position;while(e.input.charCodeAt(e.position)!==0&&!Qr(e.input.charCodeAt(e.position)))e.position++;let r=e.input.slice(t,e.position),n=[];if(r.length===0)ce(e,"directive name must not be less than one character in length");while(e.input.charCodeAt(e.position)!==0&&!wt(e.input.charCodeAt(e.position))){while(no(e.input.charCodeAt(e.position)))e.position++;if(e.input.charCodeAt(e.position)===35||wt(e.input.charCodeAt(e.position))||e.input.charCodeAt(e.position)===0)break;let i=e.position;while(e.input.charCodeAt(e.position)!==0&&!Qr(e.input.charCodeAt(e.position)))e.position++;n.push(e.input.slice(i,e.position))}if(wt(e.input.charCodeAt(e.position)))$l(e);if(r==="YAML"){if(e.directives.some((s)=>s.kind==="yaml"))ce(e,"duplication of %YAML directive");if(n.length!==1)ce(e,"YAML directive accepts exactly one argument");let i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);if(i===null)ce(e,"ill-formed argument of the YAML directive");if(parseInt(i[1],10)!==1)ce(e,"unacceptable YAML version of the document");e.directives.push({kind:"yaml",version:n[0]})}else if(r==="TAG"){if(n.length!==2)ce(e,"TAG directive accepts exactly two arguments");let[i,s]=n;if(!m$.test(i))ce(e,"ill-formed tag handle (first argument) of the TAG directive");if(f$.call(e.tagHandlers,i))ce(e,`there is a previously declared suffix for "${i}" tag handle`);if(!jM.test(s))ce(e,"ill-formed tag prefix (second argument) of the TAG directive");e.tagHandlers[i]=s,e.directives.push({kind:"tag",handle:i,prefix:s})}return!0}function WM(e){e.directives=[],e.tagHandlers=Object.create(null);let t=!1;Tt(e,!0);while(VM(e))t=!0,Tt(e,!0);let r=!1,n=!1,i=!0;if(e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45&&Fn(e.input.charCodeAt(e.position+3))){r=!0;let a=e.line;e.position+=3,Tt(e,!0),i=e.line>a}else if(t)ce(e,"directives end mark is expected");let s=e.events.length;if(!r&&e.position===e.lineStart&&e.input.charCodeAt(e.position)===46&&eo(e)){e.position+=3,Tt(e,!0);return}if(RM(e,r,!1),!to(e,e.lineIndent-1,xl,!1,i,i))Kt(e);if(Tt(e,!0),e.position===e.lineStart&&eo(e)){if(n=e.input.charCodeAt(e.position)===46,n){let a=e.line;if(e.position+=3,Tt(e,!0),e.line===a&&e.position<e.length)ce(e,"end of the stream or a document separator is expected")}}let o=e.events[s];if(o?.type===ct.DOCUMENT)o.explicitEnd=n;if(Ys(e),!n&&e.position<e.length&&!Yd(e))ce(e,"end of the stream or a document separator is expected")}function zM(e,t){let r=e.length,n={...Gd,...t,input:`${e}\x00`,length:r,position:0,line:0,lineStart:0,lineIndent:0,firstTabInLine:-1,depth:0,directives:[],tagHandlers:Object.create(null),events:[]},i=e.indexOf("\x00");if(i!==-1)rs.throwAt(e,i,"null byte is not allowed in input",n.filename);while(n.position<n.length){if(b$(n),Tt(n,!0),n.position>=n.length)break;let s=n.position;if(WM(n),n.position===s)ce(n,"can not read a document")}return n.events}function $$(e,t={}){let r={...KM,...t},n=String(e),i=Object.keys(Gd),s=Object.keys(Kd);return EM(zM(n,Vx(r,i)),{...Vx(r,s),source:n})}function v$(e,t,r){let n=null;if(typeof t==="function")n=t;else if(t!==null&&typeof t==="object")r=t;let i=$$(e,r);if(n===null)return i;for(let s of i)n(s)}function Xd(e,t){let r=$$(e,t);if(r.length===0)throw new rs("expected a document, but the input is empty");if(r.length===1)return r[0];throw new rs("expected a single document in the stream, but found more")}function El(e,t){return(e&1<<t)!==0}function w$(e){if(e.presenterOptions.quoteStyle==="single"&&El(e.allowedStylesMask,ke.SINGLE_QUOTED))return ke.SINGLE_QUOTED;return ke.DOUBLE_QUOTED}function GM(e){if(!e.presenterOptions.quoteFlowKeys)return;if(!e.isKey||!e.flowOnly||e.style!==ke.PLAIN)return;e.style=ke.DOUBLE_QUOTED}function YM(e){if(e.style===ke.PLAIN&&/[\t\x7F-\xA0\u2028\u2029\uFEFF\uFFFE\uFFFF]/.test(e.node.value))e.style=ke.DOUBLE_QUOTED}function XM(e){if(e.style===ke.PLAIN&&/^\s+$/.test(e.node.value))e.style=ke.DOUBLE_QUOTED}function QM(e){if(!e.presenterOptions.forceQuotes)return;if(e.isKey||e.style!==ke.PLAIN)return;if(e.node.tag!==e.presenterOptions.schema.defaultScalarTag.tagName)return;e.style=e.node.value.includes(`
126
- `)?ke.DOUBLE_QUOTED:w$(e)}function ZM(e){if(e.style!==ke.PLAIN||e.isKey)return;let t=e.node.value,r=t.indexOf(`
127
- `)!==-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 eL(e){if(e.style===ke.PLAIN&&!El(e.allowedStylesMask,ke.PLAIN))e.style=w$(e)}function tL(e){if(!El(e.allowedStylesMask,e.style))e.style=ke.DOUBLE_QUOTED}var Te,c2,l2,u2,f2,d2,p2,m2,h2,g2,y2,b2,x2,$2,v2,w2,S2,E2,i$,k2,A2,O2,C2,Id,N2,M2,s$,J2,F2,H2,U2,V2,Td,Fd,K2,qd,X2,Q2,Bd,eM,Hd,Ud,tM,Vd,Sl=class e{tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(t){let r=iM(t),n=[],i=rM(),s=nM();for(let u of r){if(u.nodeKind==="scalar"&&u.implicit){if(u.matchByTagPrefix)throw Error("Implicit scalar tags cannot match by tag prefix");n.push(u)}switch(u.nodeKind){case"scalar":if(u.matchByTagPrefix)s.scalar.push(u);else i.scalar[u.tagName]=u;break;case"sequence":if(u.matchByTagPrefix)s.sequence.push(u);else i.sequence[u.tagName]=u;break;case"mapping":if(u.matchByTagPrefix)s.mapping.push(u);else i.mapping[u.tagName]=u}}let o=n.filter((u)=>u.implicitFirstChars===null),a=new Set;for(let u of n)if(u.implicitFirstChars!==null)for(let d of u.implicitFirstChars)a.add(d);let c=new Map;for(let u of a)c.set(u,n.filter((d)=>d.implicitFirstChars===null||d.implicitFirstChars.indexOf(u)!==-1));let l=i.scalar["tag:yaml.org,2002:str"];if(!l)throw Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=r,this.implicitScalarTags=n,this.implicitScalarByFirstChar=c,this.implicitScalarAnyFirstChar=o,this.defaultScalarTag=l,this.defaultSequenceTag=i.sequence["tag:yaml.org,2002:seq"],this.defaultMappingTag=i.mapping["tag:yaml.org,2002:map"],this.exact=i,this.prefix=s}lookupScalarTag(t){let r=this.exact.scalar[t];if(r)return r;for(let n of this.prefix.scalar)if(t.startsWith(n.tagName))return n}lookupSequenceTag(t){let r=this.exact.sequence[t];if(r)return r;for(let n of this.prefix.sequence)if(t.startsWith(n.tagName))return n}lookupMappingTag(t){let r=this.exact.mapping[t];if(r)return r;for(let n of this.prefix.mapping)if(t.startsWith(n.tagName))return n}resolveImplicitScalarTag(t){let r=this.implicitScalarByFirstChar.get(t.charAt(0))??this.implicitScalarAnyFirstChar;for(let i of r){let s=i.resolve(t,!1,i.tagName);if(s!==Te)return{value:s,tag:i}}let n=this.defaultScalarTag;return{value:n.resolve(t,!1,n.tagName),tag:n}}withTags(...t){let r=[];for(let n of t)r=r.concat(n);return new e([...this.tags,...r])}},Wd,dee,ya,sM,oM,pee,mee,aM,rs,ct,ke,pi,jr,lM=-1,o$,a$,yM,bM="-#;/?:@&=+$_.~*'()",hee,Gs=-1,xM="tag:yaml.org,2002:merge",Kd,Me=-1,f$,Zs=1,d$=2,p$=3,xl=4,_M,PM,m$,Nd,h$,kM,AM,jM,Gd,KM,gee,yee,bee,n$,rL="[\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]",nL="[\\n\\r]",iL="\\uFEFF",Qd="[ \\t]",S$,_l,E$="[\\x09\\x20-\\uD7FF\\uE000-\\uFFFF\\u{10000}-\\u{10FFFF}]",_$="[-?:,\\[\\]{}#&*!|>'\"%@`]",sL="[,\\[\\]{}]",Ld,Dd,oL,aL,P$,k$,A$,j$,R$,O$,cL,lL,uL,fL,dL,pL,xee,$ee,vee,wee,See,Eee,_ee,mL,Pee,kee,Aee,jee,Ree,Oee,Cee,Iee,Tee,Nee,Mee,Lee,Dee,Jee,Fee,qee,Bee;var C$=L(()=>{/*! js-yaml 5.5.0 https://github.com/nodeca/js-yaml @license MIT */Te=Symbol("NOT_RESOLVED");c2=Nt("tag:yaml.org,2002:str",{resolve:(e)=>e,identify:(e)=>typeof e==="string"}),l2=["","~","null","Null","NULL"],u2=Nt("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:(e)=>{if(l2.indexOf(e)!==-1)return null;return Te},identify:(e)=>e===null,represent:()=>"null"}),f2=Nt("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:(e,t)=>{if(e==="null"||t&&e==="")return null;return Te},identify:(e)=>e===null,represent:()=>"null"}),d2=["","~","null","Null","NULL"],p2=Nt("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:(e)=>{if(d2.indexOf(e)!==-1)return null;return Te},identify:(e)=>e===null,represent:()=>"null"}),m2=["true","True","TRUE"],h2=["false","False","FALSE"],g2=Nt("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:(e)=>{if(m2.indexOf(e)!==-1)return!0;if(h2.indexOf(e)!==-1)return!1;return Te},identify:(e)=>Object.prototype.toString.call(e)==="[object Boolean]",represent:(e)=>e?"true":"false"}),y2=["true"],b2=["false"],x2=Nt("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:(e)=>{if(y2.indexOf(e)!==-1)return!0;if(b2.indexOf(e)!==-1)return!1;return Te},identify:(e)=>Object.prototype.toString.call(e)==="[object Boolean]",represent:(e)=>e?"true":"false"}),$2=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],v2=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],w2=Nt("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:(e)=>{if($2.indexOf(e)!==-1)return!0;if(v2.indexOf(e)!==-1)return!1;return Te},identify:(e)=>Object.prototype.toString.call(e)==="[object Boolean]",represent:(e)=>e?"true":"false"}),S2=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),E2=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");i$=Nt("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:P2,identify:(e)=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:(e)=>e.toString(10)}),k2=new RegExp("^-?(?:0|[1-9][0-9]*)$"),A2=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");O2=Nt("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:R2,identify:(e)=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:(e)=>e.toString(10)}),C2=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");Id=Nt("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:T2,identify:(e)=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:(e)=>e.toString(10)}),N2=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),M2=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");s$=Nt("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:L2,identify:(e)=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:D2}),J2=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),F2=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");H2=Nt("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:q2,identify:(e)=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:B2}),U2=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),V2=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");Td=Nt("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:W2,identify:(e)=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:z2}),Fd=Nt("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:(e,t)=>{if(e==="<<"||t&&e==="")return"<<";return Te},identify:()=>!1}),K2=/^[A-Za-z0-9+/]*={0,2}$/;qd=Nt("tag:yaml.org,2002:binary",{resolve:G2,identify:(e)=>Object.prototype.toString.call(e)==="[object Uint8Array]",represent:Y2}),X2=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Q2=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");Bd=Nt("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:Z2,identify:(e)=>e instanceof Date,represent:(e)=>e.toISOString()}),eM=Jd("tag:yaml.org,2002:seq",{create:()=>[],addItem:(e,t)=>{e.push(t)},identify:Array.isArray});Hd=Jd("tag:yaml.org,2002:omap",{create:()=>({list:[],seen:new Set}),addItem:(e,t)=>{let r;if(t instanceof Map){if(t.size!==1)return"cannot resolve an ordered map item";r=t.keys().next().value}else if(wl(t)){let n=Object.keys(t);if(n.length!==1)return"cannot resolve an ordered map item";r=n[0]}else return"cannot resolve an ordered map item";if(e.seen.has(r))return"duplicate key in ordered map";return e.seen.add(r),e.list.push(t),""},finalize:(e)=>e.list,identify:()=>!1}),Ud=Jd("tag:yaml.org,2002:pairs",{create:()=>[],addItem:(e,t)=>{if(t instanceof Map){if(t.size!==1)return"cannot resolve a pairs item";return e.push(t.entries().next().value),""}if(Object.prototype.toString.call(t)!=="[object Object]")return"cannot resolve a pairs item";let r=t,n=Object.keys(r);if(n.length!==1)return"cannot resolve a pairs item";return e.push([n[0],r[n[0]]]),""},identify:()=>!1}),tM=vl("tag:yaml.org,2002:map",{create:()=>({}),identify:wl,represent:(e)=>{let t=new Map;for(let r of Object.keys(e))t.set(r,e[r]);return t},addPair:(e,t,r)=>{if(t!==null&&typeof t==="object")return"object-based map does not support complex keys";let n=String(t);if(n==="__proto__")Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0});else e[n]=r;return""},has:(e,t)=>{if(t!==null&&typeof t==="object")return!1;return Object.prototype.hasOwnProperty.call(e,String(t))},keys:(e)=>Object.keys(e),get:(e,t)=>{let r=String(t);if(!Object.prototype.hasOwnProperty.call(e,r))return null;return e[r]}}),Vd=vl("tag:yaml.org,2002:set",{create:()=>new Set,identify:(e)=>e instanceof Set,represent:(e)=>{let t=new Map;for(let r of e)t.set(r,null);return t},addPair:(e,t,r)=>{if(r!==null)return"cannot resolve a set item";return e.add(t),""},has:(e,t)=>e.has(t),keys:(e)=>e.keys(),get:()=>null});Wd=new Sl([c2,eM,tM]),dee=new Sl([...Wd.tags,f2,x2,O2,H2]),ya=new Sl([...Wd.tags,u2,g2,i$,s$]),sM=new Sl([...Wd.tags,p2,w2,Id,Td,Bd,Fd,qd,Hd,Ud,Vd]),oM=sM.withTags({...Id,resolve:(e,t,r)=>{let n=Id.resolve(e,t,r);return n===Te?i$.resolve(e,t,r):n}},{...Td,resolve:(e,t,r)=>{let n=Td.resolve(e,t,r);return n===Te?s$.resolve(e,t,r):n}}),pee=vl("tag:yaml.org,2002:map",{create:()=>new Map,addPair:(e,t,r)=>(e.set(t,r),""),has:(e,t)=>e.has(t),keys:(e)=>e.keys(),get:(e,t)=>e.get(t),identify:(e)=>e instanceof Map||wl(e),represent:(e)=>{if(e instanceof Map)return e;let t=new Map,r=e;for(let n of Object.keys(r))t.set(n,r[n]);return t}});mee=vl("tag:yaml.org,2002:map",{create:()=>({}),identify:wl,represent:(e)=>{let t=new Map;for(let r of Object.keys(e))t.set(r,e[r]);return t},addPair:(e,t,r)=>{let n=Wx(t);if(n===null)return"nested arrays are not supported inside keys";if(n==="__proto__")Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0});else e[n]=r;return""},has:(e,t)=>{let r=Wx(t);return r!==null&&Object.prototype.hasOwnProperty.call(e,r)},keys:(e)=>Object.keys(e),get:(e,t)=>{let r=String(t);if(!Object.prototype.hasOwnProperty.call(e,r))return null;return e[r]}}),aM={maxLength:79,indent:1,linesBefore:3,linesAfter:2};rs=class e extends Error{reason;mark;constructor(t,r){super();if(this.name="YAMLException",this.reason=t,this.mark=r,this.message=zx(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}toString(t){return`${this.name}: ${zx(this,t)}`}static throwAt(t,r,n,i=""){let s=0,o=0;for(let c=0;c<r;c++){let l=t.charCodeAt(c);if(l===10)s++,o=c+1;else if(l===13){if(s++,t.charCodeAt(c+1)===10)c++;o=c+1}}let a={name:i,buffer:t,position:r,line:s,column:r-o};throw a.snippet=cM(a),new e(n,a)}},ct={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},ke={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},pi={BLOCK:1,FLOW:2},jr={CLIP:1,STRIP:2,KEEP:3};o$=Array(256),a$=Array(256);for(let e=0;e<256;e++)o$[e]=Kx(e)?1:0,a$[e]=Kx(e);yM=Object.assign(Object.create(null),{"!":"!","!!":"tag:yaml.org,2002:"}),hee=bM+"!,[]";Kd={filename:"",schema:ya,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};f$=Object.prototype.hasOwnProperty,_M=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,PM=/[,\[\]{}]/,m$=/^(?:!|!!|![0-9A-Za-z-]+!)$/,Nd=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,h$=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,kM=new RegExp(`^(?:${Nd})*$`),AM=new RegExp(`^(?:${h$})+$`),jM=new RegExp(`^(?:!(?:${Nd})*|${h$}(?:${Nd})*)$`),Gd={filename:"",maxDepth:100};KM={...Gd,...Kd};gee=Symbol("INVALID"),yee=Symbol("visit:break"),bee=Symbol("visit:skip");n$={applyQuoteFlowKeysOption:GM,doubleQuoteForInvisibles:YM,doubleQuoteWhitespaceOnly:XM,applyForceQuotesOption:QM,tryLongOrMultilineAsBlock:ZM,quoteInvalidPlain:eL,fallbackToDoubleQuoted:tL};S$=`(?:(?!(?:${nL}|${iL}))${rL})`,_l=`(?:(?!${Qd})${S$})`,Ld=_l,Dd=`(?:(?!${sL})${_l})`,oL=`(?:(?:(?!${_$})${_l})|[?:-](?=${Ld}))`,aL=`(?:(?:(?!${_$})${_l})|[?:-](?=${Dd}))`,P$=`(?:(?:(?![:#])${Ld})|:(?=${Ld}))#*`,k$=`(?:(?:(?![:#])${Dd})|:(?=${Dd}))#*`,A$=`(?:${Qd}*${P$})*`,j$=`(?:${Qd}*${k$})*`,R$=`${oL}#*${A$}`,O$=`${aL}#*${j$}`,cL=R$,lL=O$,uL=`\\n+${P$}${A$}`,fL=`\\n+${k$}${j$}`,dL=`${R$}(?:${uL})*`,pL=`${O$}(?:${fL})*`,xee=new RegExp(`^(?:${dL})$`,"u"),$ee=new RegExp(`^(?:${pL})$`,"u"),vee=new RegExp(`^(?:${cL})$`,"u"),wee=new RegExp(`^(?:${lL})$`,"u"),See=new RegExp(`^(?:${E$})*$`,"u"),Eee=new RegExp(`^(?:${E$}|\\n)*$`,"u"),_ee=new RegExp(`^(?:${S$}|\\n)*$`,"u"),mL={indent:2,seqNoIndent:!1,seqInlineFirst:!0,lineWidth:80,flowBracketPadding:!1,flowSkipCommaSpace:!1,flowSkipColonSpace:!1,quoteFlowKeys:!1,quoteStyle:"single",forceQuotes:!1,scalarStyleRules:Object.keys(n$).map((e)=>Reflect.get(n$,e)),tagBeforeAnchor:!1},Pee={...mL,schema:oM,skipInvalid:!1,noRefs:!1,flowLevel:-1,sortKeys:!1,transform:()=>{}},kee=ct.DOCUMENT,Aee=ct.SEQUENCE,jee=ct.MAPPING,Ree=ct.SCALAR,Oee=ct.ALIAS,Cee=ct.POP,Iee=ke.PLAIN,Tee=ke.SINGLE_QUOTED,Nee=ke.DOUBLE_QUOTED,Mee=ke.LITERAL_BLOCK,Lee=ke.FOLDED_BLOCK,Dee=pi.BLOCK,Jee=pi.FLOW,Fee=jr.CLIP,qee=jr.STRIP,Bee=jr.KEEP});var hL,I$;var T$=L(()=>{Ar();C$();hL=ya.withTags(Bd,Fd,qd,Hd,Ud,Vd),I$={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(e){let t=e.data;if(Buffer.isBuffer(t))t=t.toString();if(typeof t==="string")try{return Xd(t,{schema:ya})}catch{try{return Xd(t,{schema:hL})}catch(r){try{if(v$(t,{schema:ya}).length===0)return}catch{}throw new Gr(r?.message||"Parser Error",e.url)}}else return t}}});var gL,N$;var M$=L(()=>{Ar();gL=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)(?:[?#].*)?$/i,N$={order:300,allowEmpty:!0,encoding:"utf8",canParse(e){return(typeof e.data==="string"||Buffer.isBuffer(e.data))&&gL.test(e.url)},parse(e){if(typeof e.data==="string")return e.data;else if(Buffer.isBuffer(e.data))return e.data.toString(this.encoding);else throw new Gr("data is not text",e.url)}}});var yL,L$;var D$=L(()=>{yL=/\.(jpeg|jpg|gif|png|bmp|ico)(?:[?#].*)?$/i,L$={order:400,allowEmpty:!0,canParse(e){return Buffer.isBuffer(e.data)&&yL.test(e.url)},parse(e){if(Buffer.isBuffer(e.data))return e.data;else return Buffer.from(e.data)}}});var Zd;var ep=L(()=>{Wt();Ar();Zd={order:100,canRead(e){return ul(e.url)},async read(e){let t,r=await import("fs");try{t=Bs(e.url)}catch(n){let i=n;throw i.message=`Malformed URI: ${e.url}: ${i.message}`,new Yr(i,e.url)}if(t.endsWith("/")||t.endsWith("\\"))t=t.slice(0,-1);try{return await r.promises.readFile(t)}catch(n){let i=n;throw i.message=`Error opening file ${t}: ${i.message}`,new Yr(i,t)}}}});async function B$(e,t,r){e=la(e);let n=r||[];n.push(e.href);let i;try{let s;if(t.safeUrlResolver){let a=await Ax(e.href);if(a.unsafe)throw Error(`Unsafe URL blocked by safeUrlResolver: ${e.href}`);s=a.addresses}i=await xL(e,t,s);let o=i.response;if(o.status>=400){let a=Error(`HTTP ERROR ${o.status}`);throw a.status=o.status,a}else if(o.status>=300)if(!Number.isNaN(t.redirects)&&n.length>t.redirects){let a=Error(`Error downloading ${n[0]}.
129
- 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:kL(t);return B$(c,l,n)}else return await o.readBody(t.maxContentLength??q$)}catch(s){let o=s instanceof Error?s:Error(String(s)),a=Error(`Error downloading ${e.href}: ${o.message}`,{cause:o});if("code"in o)a.code=o.code;throw new Yr(a,e.href)}finally{i?.cancelTimeout(),await i?.response.discard()}}async function xL(e,t,r){let n,i;if(t.timeout&&typeof AbortController<"u"){let o=new AbortController;n=o,i=setTimeout(()=>o.abort(),t.timeout)}let s=()=>{if(i!==void 0)clearTimeout(i),i=void 0};try{return{response:r&&r.length>0?await wL(e,t,r,n?.signal):$L(await fetch(e,{method:"GET",headers:t.headers||{},credentials:t.withCredentials?"include":"same-origin",redirect:"manual",signal:n?n.signal:null})),cancelTimeout:s}}catch(o){throw s(),o}}function $L(e){return{status:e.status,getHeader:(t)=>e.headers.get(t),readBody:(t)=>vL(e,t),async discard(){if(e.body&&!e.bodyUsed)await e.body.cancel().catch(()=>{return})}}}async function vL(e,t){if(H$(e.headers.get("content-length"),t),!e.body)return Buffer.alloc(0);let r=e.body.getReader(),n=[],i=0;for(;;){let{done:s,value:o}=await r.read();if(s)return Buffer.concat(n,i);if(i+=o.byteLength,i>t)throw await r.cancel().catch(()=>{return}),rp(t);n.push(o)}}async function wL(e,t,r,n){let i=e.protocol==="https:"?"node:https":"node:http",{request:s}=await import(i),o={method:"GET",headers:SL(t.headers),lookup:PL(e.hostname,r),agent:!1,autoSelectFamily:!0};if(n)o.signal=n;let a=await new Promise((l,u)=>{let d=!1,h=s(e,o,(m)=>{d=!0,l(m)});h.on("error",u),h.on("upgrade",(m,y)=>{y.destroy(),u(Error("Unexpected HTTP protocol upgrade"))}),h.on("close",()=>{if(!d)u(Error("The connection was closed before an HTTP response was received"))}),h.end()});a.on("error",()=>{return});let c=a.statusCode;if(c===void 0||c<200||c>599)throw a.destroy(),Error(`Invalid HTTP status code: ${c}`);return{status:c,getHeader(l){let u=a.headers[l.toLowerCase()];return Array.isArray(u)?u.join(", "):u??null},readBody:(l)=>EL(a,l,n),async discard(){if(!a.destroyed)a.destroy()}}}function SL(e){let t=new Headers({accept:"*/*","accept-encoding":"gzip, deflate, br","user-agent":"node"});new Headers(e??void 0).forEach((n,i)=>t.set(i,n));for(let n of bL)t.delete(n);let r={};return t.forEach((n,i)=>{r[i]=n}),r}async function EL(e,t,r){H$(e.headers["content-length"],t);let n=(e.statusCode===204||e.statusCode===205?"":e.headers["content-encoding"]??"").split(",").map((_)=>_.trim().toLowerCase()).filter((_)=>_&&_!=="identity");if(n.length>J$)throw Error(`Too many content-encodings: maximum allowed is ${J$}`);for(let _ of n)if(!["gzip","x-gzip","deflate","x-deflate","br","zstd"].includes(_))throw Error(`Unsupported content-encoding: ${_}`);let i="node:stream",s="node:stream/promises",o="node:zlib",[{Duplex:a,Transform:c,Writable:l},{pipeline:u},d]=await Promise.all([import(i),import(s),import(o)]),h=Error("The connection was closed before the response body was complete");if(e.destroyed)throw e.errored??h;let m=()=>{let _=0;return new c({transform(P,E,w){_+=P.length,w(_>t?rp(t):null,P)}})},y=[m()];for(let _ of n.reverse()){let P=_==="gzip"||_==="x-gzip"?d.createGunzip():_==="deflate"||_==="x-deflate"?_L(d,a):_==="br"?d.createBrotliDecompress():d.createZstdDecompress();y.push(P,m())}let g=[],b=0,x=new l({write(_,P,E){g.push(_),b+=_.length,E()}});try{await u([e,...y,x],r?{signal:r}:{})}catch(_){if(_ instanceof Error&&"code"in _&&_.code==="ERR_STREAM_PREMATURE_CLOSE")throw h;throw _}return Buffer.concat(g,b)}function _L(e,t){let r;return new t({read(){r?.resume()},write(n,i,s){if(!r){if(n.length===0){s();return}r=(n[0]&15)===8?e.createInflate():e.createInflateRaw(),r.on("data",(o)=>{if(!this.push(o))r?.pause()}),r.on("end",()=>this.push(null)),r.on("error",(o)=>this.destroy(o))}r.write(n,i,s)},final(n){if(r)r.end(n);else this.push(null),n()},destroy(n,i){r?.destroy(),i(n)}})}function H$(e,t){if(e&&Number(e)>t)throw rp(t)}function rp(e){return Error(`Response body exceeds the maxContentLength of ${e} bytes`)}function PL(e,t){let r=F$(e),n=t.map(({address:i,family:s})=>({address:i,family:s}));return(i,s,o)=>{let a=F$(i),c=s.family==="IPv4"?4:s.family==="IPv6"?6:s.family||0,l=n.filter(({family:u})=>c===0||u===c);if(a!==r||l.length===0){let u=Error(`No validated address is available for ${i}`);u.code="ENOTFOUND",o(u,"",0)}else if(s.all)o(null,l);else{let u=l[0];o(null,u.address,u.family)}}}function F$(e){return e.replace(/^\[|\]$/g,"").replace(/\.+$/,"").toLowerCase()}function kL(e){if(!e.headers)return e;let t=new Headers(e.headers);return t.delete("authorization"),t.delete("proxy-authorization"),t.delete("cookie"),{...e,headers:t}}var q$=52428800,J$=5,bL,tp;var np=L(()=>{Wt();Ar();bL=["connection","content-length","expect","host","keep-alive","proxy-connection","te","trailer","transfer-encoding","upgrade"],tp={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,maxContentLength:q$,canRead(e){return kx(e.url)&&(!this.safeUrlResolver||!ll(e.url))},read(e){let t=la(e.url);if(typeof window<"u"&&!t.protocol)t.protocol=la(location.href).protocol;return B$(t,this)}}});function z$(e,t){if(U$(t)){let r=Object.keys(t).filter((n)=>!["__proto__","constructor","prototype"].includes(n));for(let n=0;n<r.length;n++){let i=r[n],s=t[i],o=e[i];if(U$(s))e[i]=z$(o||{},s);else if(s!==void 0)e[i]=s}}return e}function U$(e){return e&&typeof e==="object"&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)&&!(typeof Headers<"u"&&e instanceof Headers)}var V$=()=>({parse:{json:{...Bx},yaml:{...I$},text:{...N$},binary:{...L$}},resolve:{file:{...Zd},http:{...tp},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}),W$=(e)=>{let t=V$();if(e)z$(t,e);return t};var ip=L(()=>{Hx();T$();M$();D$();ep();np()});function AL(e,t=!0){let r,n,i,s,o=Array.prototype.slice.call(e);if(typeof o[o.length-1]==="function")s=o.pop();if(typeof o[0]==="string")if(r=o[0],typeof o[2]==="object")n=o[1],i=o[2];else n=void 0,i=o[1];else r="",n=o[0],i=o[1];if(i=W$(i),t&&!i.mutateInputSchema&&typeof n==="object")n=structuredClone(n);return{path:r,schema:n,options:i,callback:s}}var ba;var K$=L(()=>{ip();ba=AL});async function op(e,t,r){let n=e.$refs._root$Ref.path,i=e.$refs._root$Ref.dynamicIdScope?ut(n,e.schema,e.$refs._root$Ref.legacyIdScope):n,s={$refs:e.$refs,options:t,excludedPathMatcher:r,documentLoads:new Map,externalDocuments:new Set,excludedPaths:new Set,excludedAncestorPaths:new Set};await kl({value:e.schema,path:n+"#",originPaths:[n+"#"],scopeBase:i,dynamicIdScope:e.$refs._root$Ref.dynamicIdScope,legacyIdScope:e.$refs._root$Ref.legacyIdScope},"#",void 0,void 0,s),await RL(s)}async function kl(e,t,r,n,i,s=!1){if(!s&&i.excludedPathMatcher(t,e.value)){X$(e,i);return}let o=e.value;if(!o||typeof o!=="object"||ArrayBuffer.isView(o)||r0(r,o))return;io(e);let a={value:o,...r?{parent:r}:{}};if(je.is$Ref(o)&&je.isAllowed$Ref(o,i.options)){if(!await jL(e,t,n,i)&&je.isExtended$Ref(o))await G$(e,t,a,n,i);return}await G$(e,t,a,n,i)}async function G$(e,t,r,n,i){let s=e.value;await Promise.all(Object.keys(s).filter((o)=>o!=="$ref").map(async(o)=>{let a=qe.join(t,o);if(e.children){if(NL(e,o)&&i.excludedPathMatcher(a,void 0)){Pl(e,o,i);return}}else{if(Object.getOwnPropertyDescriptor(s,o)?.get&&i.excludedPathMatcher(a,void 0)){Pl(e,o,i);return}let u=s[o],d=t0(e,o,u);if(i.excludedPathMatcher(a,u)){Pl(e,o,i);return}await kl(d,a,r,n,i,!0);return}let c=is(e,o);if(!c)return;if(i.excludedPathMatcher(a,c.value)){Pl(e,o,i);return}await kl(c,a,r,n,i,!0)}))}async function jL(e,t,r,n){let i=e.value,s=e.referenceLocation||e;io(s);let o=je.isExternal$Ref(i),a=o&&n.options.dereference?.externalReferenceResolution==="root"?_r():s.dynamicIdScope?s.scopeBase:s.path,c=Fe(a,i.$ref);if(n0(r,c))return!1;if(i0(r,s.path,n.options),o&&!await ap(i,c,a,s.path,n))return!1;let l={path:c,depth:(r?.depth??0)+1,...r?{parent:r}:{}},u=await Q$(c,t,n,l);if(!u)return!1;let d=Z$(e,u,n.options.dereference?.mergeKeys??!0);return await kl(d,t,void 0,l,n),!0}async function ap(e,t,r,n,i){let s=$e(t),o=i.documentLoads.get(s);if(o)return o;let a=i.$refs._get$Ref(s);if(a)return sp(s,i),!zt(a.value);let c=Ks({url:t,baseUrl:r,reference:e.$ref},i.$refs,i.options).then(()=>(sp(s,i),!0)).catch((l)=>{if(!i.options.continueOnError||!zt(l))throw l;if(i.$refs._$refs[s])sp(s,i),l.source=decodeURI($e(n)),l.path=Hs(Pr(n));return!1});return i.documentLoads.set(s,c),c}function sp(e,t){if(t.$refs._$refs[e])t.externalDocuments.add(e)}async function RL(e){let t=$e(e.$refs._root$Ref.path);for(let r of e.externalDocuments){if(r===t)continue;let n=e.$refs._get$Ref(r);if(!n||zt(n.value))continue;let i=n.dynamicIdScope?ut(n.path,n.value,n.legacyIdScope):n.path;await Y$(n.value,n.path+"#",i,n.dynamicIdScope,n.legacyIdScope,void 0,new WeakMap,e)}}async function Y$(e,t,r,n,i,s,o,a){if(a.excludedPaths.has(t)||!e||typeof e!=="object"||ArrayBuffer.isView(e)||r0(s,e))return;let c=a.excludedAncestorPaths.has(t),l=`${i}:${r}`,u=o.get(e);if(!c&&u?.has(l))return;if(!c)if(u)u.add(l);else o.set(e,new Set([l]));let d={value:e,...s?{parent:s}:{}},h=[];if(je.isExternal$Ref(e)){let m=e,y=a.options.dereference?.externalReferenceResolution==="root"?_r():n?r:t,g=Fe(y,m.$ref);h.push(ap(m,g,y,t,a))}h.push(...Object.keys(e).map(async(m)=>{let y=qe.join(t,m);if(a.excludedPaths.has(y))return;let g=e[m],b=bt(g,i),x=n&&g&&typeof g==="object"&&!ArrayBuffer.isView(g)?ut(r,g,b):r;await Y$(g,y,x,n,b,d,o,a)})),await Promise.all(h)}function X$(e,t){for(let r of e.originPaths||[e.path]){let n=OL(r);if(t.excludedPaths.has(n))continue;t.excludedPaths.add(n);let s=$e(n)+"#";for(let o of qe.parse(n))t.excludedAncestorPaths.add(s),s=qe.join(s,o)}}function Pl(e,t,r){X$({...e,path:qe.join(e.path,t),originPaths:(e.originPaths||[e.path]).map((n)=>qe.join(n,t))},r)}function OL(e){let t=$e(e),r=Pr(e)||"#";return t+r}async function Q$(e,t,r,n){let i=$e(e),s=r.$refs._get$Ref(i);if(!s||zt(s.value))return;let o={value:s.value,path:s.path+"#",originPaths:[s.sourcePath||s.path+"#"],scopeBase:s.path,dynamicIdScope:s.dynamicIdScope,legacyIdScope:s.legacyIdScope},a=r.$refs._aliases[i]===s;if(o.dynamicIdScope&&!a)o.legacyIdScope=bt(o.value,o.legacyIdScope),o.scopeBase=ut(o.scopeBase,o.value,o.legacyIdScope);let c;try{c=qe.parse(e)}catch{return}for(let l=0;l<c.length;l++){let u=await CL(o,t,r,n);if(!u)return;o=u;let d=c[l],h=is(o,d);if(!h||h.value===void 0||h.value===null&&l===c.length-1){h=void 0;for(let m=c.length-1;m>l;m--){let y=c.slice(l,m+1).join("/"),g=is(o,y);if(g?.value!==void 0){h=g,l=m;break}}if(!h){let m=is(o,d);if(!m||m.value!==null)return;h=m}}o=h,io(o)}return o}async function CL(e,t,r,n){let i=e,s=n;while(je.is$Ref(i.value)&&je.isAllowed$Ref(i.value,r.options)){let o=i.value,a=i.referenceLocation||i;io(a);let c=je.isExternal$Ref(o),l=c&&r.options.dereference?.externalReferenceResolution==="root"?_r():a.dynamicIdScope?a.scopeBase:a.path,u=Fe(l,o.$ref);if(n0(s,u))return je.isExtended$Ref(o)?i:void 0;if(i0(s,a.path,r.options),c&&!await ap(o,u,l,a.path,r))return;let d={path:u,depth:(s?.depth??0)+1,...s?{parent:s}:{}},h=await Q$(u,t,r,d);if(!h)return;i=Z$(i,h,r.options.dereference?.mergeKeys??!0),s=d}return i}function Z$(e,t,r){if(!je.isExtended$Ref(e.value)||t.value===null||typeof t.value!=="object")return t;return e0(t,e,r,!0,void 0)}function e0(e,t,r,n,i){let s=e.value,o=t.value,a=IL(i,s,o);if(a)return a;let c=!n&&Array.isArray(e.value)?Array(e.value.length):{},l=new Map,u={value:c,path:e.path,originPaths:TL(e,t),scopeBase:e.scopeBase,dynamicIdScope:e.dynamicIdScope,legacyIdScope:e.legacyIdScope,children:l,resolveMetadata(){io(e),u.scopeBase=e.scopeBase,u.dynamicIdScope=e.dynamicIdScope,u.legacyIdScope=e.legacyIdScope}},d={target:s,source:o,value:u,...i?{parent:i}:{}},h=new Set(Object.keys(o).filter((g)=>!(n&&g==="$ref"))),m=new Set(Object.keys(s)),y=new Set([...h,...m]);for(let g of y){let b=()=>{let x=h.has(g)?is(t,g):void 0,_;if(x&&(!m.has(g)||!r||x.value===null||typeof x.value!=="object"||Array.isArray(x.value)))_=x;else{let P=is(e,g);_=x&&P.value!==null&&typeof P.value==="object"?e0(P,x,!0,!1,d):x||P}if(l.set(g,_),LL(c,g,_.value),g==="$ref"&&typeof _.value==="string")u.referenceLocation=_.owner||e;return _};l.set(g,{resolve:b,requiresPrecheck:ML(o,s,g,h.has(g),m.has(g),r)}),DL(c,g,()=>is(u,g).value)}return u}function IL(e,t,r){for(let n=e;n;n=n.parent)if(n.target===t&&n.source===r)return n.value;return}function is(e,t){if(e.children){let n=e.children.get(t);if(!n||!("resolve"in n))return n;let i=n.resolve();return e.children.set(t,i),i}let r=e.value;if(r===null||typeof r!=="object"&&typeof r!=="function"||!(t in r))return;return t0(e,t,r[t])}function t0(e,t,r){let n={value:r,path:qe.join(e.path,t),originPaths:(e.originPaths||[e.path]).map((i)=>qe.join(i,t)),scopeBase:e.scopeBase,dynamicIdScope:e.dynamicIdScope,legacyIdScope:e.legacyIdScope,owner:e,resolveMetadata(){io(e);let i=bt(r,e.legacyIdScope);n.legacyIdScope=i,n.scopeBase=e.dynamicIdScope&&r&&typeof r==="object"&&!ArrayBuffer.isView(r)?ut(e.scopeBase,r,i):e.scopeBase}};return n}function TL(e,t){return[...new Set([...e.originPaths||[e.path],...t.originPaths||[t.path]])]}function io(e){let t=e.resolveMetadata;if(t)delete e.resolveMetadata,t()}function NL(e,t){let r=e.children?.get(t);return Boolean(r&&"resolve"in r&&r.requiresPrecheck)}function ML(e,t,r,n,i,s){let o=n?Object.getOwnPropertyDescriptor(e,r):void 0;if(o?.get)return!0;if(!n)return Boolean(i&&Object.getOwnPropertyDescriptor(t,r)?.get);let a=o?.value;return!(!i||!s||a===null||typeof a!=="object"||Array.isArray(a))&&Boolean(Object.getOwnPropertyDescriptor(t,r)?.get)}function r0(e,t){for(let r=e;r;r=r.parent)if(r.value===t)return!0;return!1}function n0(e,t){for(let r=e;r;r=r.parent)if(r.path===t)return!0;return!1}function i0(e,t,r){let n=r.dereference?.maxDepth??500;if((e?.depth??0)>=n)throw RangeError(`Maximum dereference depth (${n}) exceeded at ${t}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`)}function LL(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0})}function DL(e,t,r){Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0})}var s0=L(()=>{ts();zs();yl();Wt();Ar();Jn()});function JL(e,t){if(typeof t.resolve?.excludedPathMatcher==="function")return Promise.reject(TypeError("Use the top-level resolveExcludedPathMatcher option; resolve keys are resolver plugins."));if(!t.resolve?.external)return Promise.resolve();if(t.resolveExcludedPathMatcher)return op(e,t,t.resolveExcludedPathMatcher);try{let n=e.$refs._root$Ref.dynamicIdScope?ut(e.$refs._root$Ref.path,e.schema,e.$refs._root$Ref.legacyIdScope):e.$refs._root$Ref.path,i=cp(e.schema,e.$refs._root$Ref.path+"#",n,e.$refs._root$Ref.dynamicIdScope,e.$refs._root$Ref.legacyIdScope,e.$refs,t);return Promise.all(i)}catch(n){return Promise.reject(n)}}function cp(e,t,r,n,i,s,o,a,c,l=new Set){a||=new Map;let u=[];if(e&&typeof e==="object"&&!ArrayBuffer.isView(e)&&!l.has(e)){let d=`${i}:${r}`,h=a.get(e);if(h?.has(d))return u;if(h)h.add(d);else a.set(e,new Set([d]));l.add(e);let m=r;if(je.isExternal$Ref(e))u.push(FL(e,t,m,n,s,o));let y=Object.keys(e);for(let g of y){let b=qe.join(t,g),x=e[g],_=bt(x,i),P=n&&x&&typeof x==="object"&&!ArrayBuffer.isView(x)?ut(m,x,_):m;u=u.concat(cp(x,b,P,n,_,s,o,a,c,l))}l.delete(e)}return u}async function FL(e,t,r,n,i,s){let a=s.dereference?.externalReferenceResolution==="root"?_r():n?r:t,c=Fe(a,e.$ref),l=$e(c),u=i._get$Ref(l);if(u)return Promise.resolve(u.value);try{let d=e.$ref,h={url:c,baseUrl:a};if(typeof d==="string")h.reference=d;let m=await Ks(h,i,s),y=i._get$Ref(l),g=y?.dynamicIdScope??!1,b=y?.legacyIdScope??!1,x=g?ut(l,m,b):l,_=cp(m,l+"#",x,g,b,i,s,new Map,!0);return Promise.all(_)}catch(d){if(!s?.continueOnError||!zt(d))throw d;if(i._$refs[l])d.source=decodeURI($e(t)),d.path=Hs(Pr(t));return[]}}var o0;var a0=L(()=>{ts();zs();yl();s0();Wt();Ar();Jn();o0=JL});function qL(e,t){let r=e.$refs._root$Ref.dynamicIdScope?ut(e.$refs._root$Ref.path,e.schema,e.$refs._root$Ref.legacyIdScope):e.$refs._root$Ref.path,n=[],i=new Set([$e(e.$refs._root$Ref.path),$e(r)]);up(e,"schema",e.$refs._root$Ref.path+"#",r,e.$refs._root$Ref.dynamicIdScope,e.$refs._root$Ref.legacyIdScope,!1,"#",0,n,e.$refs,t,i,new Set);let s=Ws(e.schema,e.$refs._root$Ref.legacyIdScope);if(BL(n,t,s,r),(t.bundle||{}).optimizeInternalRefs!==!1)VL(n,e.schema)}function up(e,t,r,n,i,s,o,a,c,l,u,d,h,m,y=!1){let g=t===null?e:e[t],b=d.bundle||{},x=b.excludedPathMatcher||(()=>!1);if(g&&typeof g==="object"&&!ArrayBuffer.isView(g)&&(y||!x(a,g))&&!m.has(g)){m.add(g);let _=n;if(je.isAllowed$Ref(g,d))c0(e,t,r,_,i,o,a,c,l,u,d,h,m);else{let P=Object.keys(g).sort((E,w)=>{if(E==="definitions"||E==="$defs")return-1;else if(w==="definitions"||w==="$defs")return 1;else return E.length-w.length});for(let E of P){let w=qe.join(r,E),k=qe.join(a,E);if(Object.getOwnPropertyDescriptor(g,E)?.get&&x(k,void 0))continue;let j=g[E];if(x(k,j))continue;let D=bt(j,s),F=i&&j&&typeof j==="object"&&!ArrayBuffer.isView(j)?ut(_,j,D):_,N=i&&lp(j,D),q=o||N,U=h;if(N)U=new Set(h),U.add($e(F));if(je.isAllowed$Ref(j,d))c0(g,E,w,F,i,q,k,c,l,u,d,U,m);else up(g,E,w,F,i,D,q,k,c,l,u,d,U,m,!0);if(j&&typeof j==="object"&&!Array.isArray(j)){if("$ref"in j)b?.onBundle?.(j.$ref,g[E],g,E)}}}}}function c0(e,t,r,n,i,s,o,a,c,l,u,d,h){let m=t===null?e:e[t],g=je.isExternal$Ref(m)&&u.dereference?.externalReferenceResolution==="root"?_r():i?n:r,b=Fe(g,m.$ref),x=l._resolve(b,o,u);if(x===null)return;let P=qe.parse(o).length,E=$e(x.path),w=Pr(x.path),k=l._aliases[E],R=Boolean(k&&GL(l._root$Ref.value,x.$ref.value)),j=E!==l._root$Ref.path&&!d.has(E)&&!R,D=Boolean(k)&&x.$ref.value!==l._root$Ref.value,F=Ws(x.$ref.value,x.$ref.legacyIdScope),N=k?x.$ref.path:x.$ref.dynamicIdScope?ut(x.$ref.path,x.$ref.value,x.$ref.legacyIdScope):x.$ref.path,q=je.isExtended$Ref(m);a+=x.indirections;let U=HL(c,e,t);if(U)if(P<U.depth||a<U.indirections)UL(c,U);else return;if(c.push({$ref:m,parent:e,key:t,pathFromRoot:o,depth:P,file:E,hash:w,value:x.value,circular:x.circular,extended:q,external:j,nestedResource:D,indirections:a,scopeBase:n,dynamicIdScope:i,nestedIdScope:s,targetResourceBase:N,...F===void 0?{}:{targetResourceId:F}}),!U||j){let ne=x.$ref.dynamicIdScope?x.scopeBase:x.$ref.path,ue=s||x.$ref.dynamicIdScope&&lp(x.value,x.legacyIdScope),ie=new Set(d);if(x.value===x.$ref.value&&lp(x.$ref.value,x.$ref.legacyIdScope))ie.add($e(x.$ref.path)),ie.add($e(ne));up(x.value,null,x.path,ne,x.$ref.dynamicIdScope,x.legacyIdScope,ue,o,a+1,c,l,u,ie,h)}}function BL(e,t,r,n){e.sort((a,c)=>{if(a.file!==c.file)return a.file<c.file?-1:1;else if(a.hash!==c.hash)return a.hash<c.hash?-1:1;else if(a.circular!==c.circular)return a.circular?-1:1;else if(a.extended!==c.extended)return a.extended?1:-1;else if(a.indirections!==c.indirections)return a.indirections-c.indirections;else if(a.depth!==c.depth)return a.depth-c.depth;else{let l=Math.max(a.pathFromRoot.lastIndexOf("/definitions"),a.pathFromRoot.lastIndexOf("/$defs")),u=Math.max(c.pathFromRoot.lastIndexOf("/definitions"),c.pathFromRoot.lastIndexOf("/$defs"));if(l!==u)return u-l;else return a.pathFromRoot.length-c.pathFromRoot.length}});let i,s,o;for(let a of e){let c=t.bundle||{};if(!a.external){if(c.optimizeInternalRefs!==!1){let l=$e(a.targetResourceBase),u=$e(a.scopeBase);if(l!==u)a.$ref.$ref=KL(a);else if(!a.nestedResource)a.$ref.$ref=a.hash}}else if(a.file===i&&a.hash===s)a.$ref.$ref=l0(a,o,r,n);else if(a.file===i&&a.hash.indexOf(s+"/")===0){let l=qe.join(o,qe.parse(a.hash.replace(s,"#")));a.$ref.$ref=l0(a,l,r,n)}else if(i=a.file,s=a.hash,o=a.pathFromRoot,a.$ref=a.parent[a.key]=je.dereference(a.$ref,a.value,t),a.circular)a.$ref.$ref=a.pathFromRoot}}function HL(e,t,r){for(let n of e)if(n&&n.parent===t&&n.key===r)return n;return}function UL(e,t){let r=e.indexOf(t);e.splice(r,1)}function VL(e,t){for(let r of e){if(!r.$ref||typeof r.$ref!=="object"||!("$ref"in r.$ref))continue;let n=r.$ref.$ref;if(typeof n!=="string"||!Al(n))continue;let i=WL(t,n);if(i!==n)r.$ref.$ref=i}}function WL(e,t){if(!Al(t))return t;let r=qe.parse(t),n=e,i=[];for(let s of r){if(n===null||n===void 0||typeof n!=="object")return t;if(!Object.prototype.hasOwnProperty.call(n,s)&&"$ref"in n&&typeof n.$ref==="string"&&Al(n.$ref)){let o=qe.parse(n.$ref);if(i.length=0,i.push(...o),n=zL(e,n.$ref),n===null||n===void 0||typeof n!=="object")return t}n=n[s],i.push(s)}return qe.join("#",i)}function zL(e,t){if(!Al(t))return;let r=qe.parse(t),n=e;for(let i of r){if(n===null||n===void 0||typeof n!=="object")return;n=n[i]}return n}function Al(e){return e[0]==="#"&&ua(e.substring(1)).startsWith("/")}function l0(e,t,r,n){if(!e.dynamicIdScope||!e.nestedIdScope||!n)return t;let i=n;if(r&&$e(Fe(e.scopeBase,r))===$e(n))i=r;return $e(i)+t}function KL(e){let t=$e(e.targetResourceBase);if(typeof e.$ref.$ref==="string"&&$e(Fe(e.scopeBase,e.$ref.$ref))===t)return e.$ref.$ref;if(e.targetResourceId&&$e(Fe(e.scopeBase,e.targetResourceId))===t)t=e.targetResourceId;return e.hash==="#"?t:t+e.hash}function lp(e,t=!1){return Ws(e,t)!==void 0}function GL(e,t){if(!t||typeof t!=="object")return!1;let r=new Set,n=(i)=>{if(i===t)return!0;if(!i||typeof i!=="object"||ArrayBuffer.isView(i)||r.has(i))return!1;return r.add(i),Object.keys(i).some((s)=>n(i[s]))};return n(e)}var u0;var f0=L(()=>{ts();zs();Wt();Jn();u0=qL});function YL(e,t){let r=Date.now(),n=e.$refs._root$Ref.dynamicIdScope?ut(e.$refs._root$Ref.path,e.schema,e.$refs._root$Ref.legacyIdScope):e.$refs._root$Ref.path,i=fp(e.schema,e.$refs._root$Ref.path,n,e.$refs._root$Ref.dynamicIdScope,e.$refs._root$Ref.legacyIdScope,"#",new Set,new Map,new Map,e.$refs,t,r,0);e.$refs.circular=i.circular,e.schema=i.value}function fp(e,t,r,n,i,s,o,a,c,l,u,d,h,m){let y,g={value:e,circular:!1};p0(d,u);let b=u.dereference||{},x=b.maxDepth??500;if(h>x)throw RangeError(`Maximum dereference depth (${x}) exceeded at ${s}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let _=b.excludedPathMatcher||(()=>!1);if(b?.circular==="ignore"||!a.has(e)){if(e&&typeof e==="object"&&!ArrayBuffer.isView(e)&&!_(s,e)){o.add(e),a.set(e,!1);let P=m||es(l,e)||{value:e,path:t,scopeBase:r,dynamicIdScope:n,legacyIdScope:i};if(je.isAllowed$Ref(e,u))y=d0(e,P.path,P.scopeBase,P.dynamicIdScope,s,o,a,c,l,u,d,h,P),g.circular=y.circular,g.value=y.value;else for(let E of Object.keys(e)){p0(d,u);let w=qe.join(t,E),k=qe.join(s,E);if(Object.getOwnPropertyDescriptor(e,E)?.get&&_(k,void 0))continue;let j=e[E];if(_(k,j))continue;let D=Xr(l,P,E,j),F;if(je.isAllowed$Ref(j,u)){if(y=d0(j,D.path,D.scopeBase,D.dynamicIdScope,k,o,a,c,l,u,d,h,D),F=y.circular,e[E]!==y.value){let N=new Map;if(b?.preservedProperties){if(typeof e[E]==="object"&&!Array.isArray(e[E]))b?.preservedProperties.forEach((U)=>{if(U in e[E])N.set(U,e[E][U])})}let q=y.value;if(b?.cloneReferences&&!F&&q&&typeof q==="object")q=structuredClone(q);if(e[E]=q,b?.preservedProperties){if(N.size&&e[E]!==null&&typeof e[E]==="object"&&!Array.isArray(e[E]))N.forEach((U,ne)=>{e[E][ne]=U})}b?.onDereference?.(j.$ref,e[E],e,E)}}else if(!o.has(j)){if(y=fp(j,D.path,D.scopeBase,D.dynamicIdScope,D.legacyIdScope,k,o,a,c,l,u,d,h+1,D),F=y.circular,e[E]!==y.value)e[E]=y.value}else F=xa(w,l,u);g.circular=g.circular||F}o.delete(e),a.set(e,g.circular)}}else g.circular=a.get(e)||!1;return g}function d0(e,t,r,n,i,s,o,a,c,l,u,d,h){let g=je.isExternal$Ref(e)&&l?.dereference?.externalReferenceResolution==="root"?_r():n?r:t,b=Fe(g,e.$ref),x=a.get(b);if(x&&!je.isExtended$Ref(e))if(!x.circular)return x;else if(typeof x.value==="object"&&"$ref"in x.value&&"$ref"in e){if(x.value.$ref===e.$ref)return xa(t,c,l),x}else return xa(t,c,l),x;let _=c._resolve(b,t,l);if(_===null)return{circular:!1,value:null};let P=_.circular,E=P||_.chainCircular||s.has(_.value);if(E)xa(t,c,l);let w=je.dereference(e,_.value,l),k=_.location,R=je.isExtended$Ref(e)?da(c,w,k,h,l.dereference?.mergeKeys??!0):k;if(!E){let D=fp(w,R.path,R.scopeBase,R.dynamicIdScope,R.legacyIdScope,i,s,o,a,c,l,u,d+1,R);if(E=D.circular,w=D.value,E&&x?.circular)xa(t,c,l)}if(E&&!P&&l.dereference?.circular==="ignore")w=e;if(P&&w!==e)w.$ref=i;let j={circular:E,value:w};if(Object.keys(e).length===1)a.set(b,j);return j}function p0(e,t){if(t&&t.timeoutMs){if(Date.now()-e>t.timeoutMs)throw new bd(t.timeoutMs)}}function xa(e,t,r){if(t.circular=!0,r?.dereference?.onCircular?.(e),!r.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${e}`);return!0}var m0;var h0=L(()=>{ts();zs();Wt();Jn();Ar();vd();m0=YL});function XL(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(t){setTimeout(t,0)}}var dp;var g0=L(()=>{dp=XL()});function lr(e,t){if(e){t.then(function(r){dp(function(){e(null,r)})},function(r){dp(function(){e(r)})});return}else return t}var y0=L(()=>{g0()});class qn{schema=null;$refs=new ha;async parse(){let e;try{e=ba(arguments)}catch(n){return jl(arguments,n)}let t,r=e.schema!==void 0&&e.schema!==null;if(!e.path&&!r){let n=Error(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return lr(e.callback,Promise.reject(n))}this.schema=null,this.$refs=new ha;try{let n="http";if(ul(e.path))e.path=Cx(e.path),n="file";if(e.path=Fe(_r(),e.path),r&&(typeof e.schema==="object"||typeof e.schema==="boolean")){let s=this.$refs._add(e.path);s.value=e.schema,s.pathType=n,s.dynamicIdScope=pl(s.value),s.legacyIdScope=bt(s.value),ml(this.$refs,s.path,s.value,s.pathType,s.dynamicIdScope),t=Promise.resolve(e.schema)}else t=Ks(e.path,this.$refs,e.options);let i=await t;if(typeof i==="boolean"||i!==null&&typeof i==="object"&&!Buffer.isBuffer(i))return this.schema=i,lr(e.callback,Promise.resolve(this.schema));else if(e.options.continueOnError)return this.schema=null,lr(e.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(n){if(!e.options.continueOnError||!zt(n))return lr(e.callback,Promise.reject(n));if(this.$refs._$refs[$e(e.path)])this.$refs._$refs[$e(e.path)].addError(n);return lr(e.callback,Promise.resolve(null))}}static parse(){let e=new qn;return e.parse.apply(e,arguments)}async resolve(){let e;try{e=ba(arguments,!1)}catch(t){return jl(arguments,t)}try{return await this.parse(e.path,e.schema,e.options),await o0(this,e.options),pp(this),lr(e.callback,Promise.resolve(this.$refs))}catch(t){return lr(e.callback,Promise.reject(t))}}static resolve(){let e=new qn;return e.resolve.apply(e,arguments)}static bundle(){let e=new qn;return e.bundle.apply(e,arguments)}async bundle(){let e;try{e=ba(arguments,!1)}catch(t){return jl(arguments,t)}try{return await this.resolve(e.path,e.schema,e.options),u0(this,e.options),pp(this),lr(e.callback,Promise.resolve(this.schema))}catch(t){return lr(e.callback,Promise.reject(t))}}static dereference(){let e=new qn;return e.dereference.apply(e,arguments)}async dereference(){let e;try{e=ba(arguments,!1)}catch(t){return jl(arguments,t)}try{return await this.resolve(e.path,e.schema,e.options),m0(this,e.options),pp(this),lr(e.callback,Promise.resolve(this.schema))}catch(t){return lr(e.callback,Promise.reject(t))}}}function jl(e,t){let r=e[e.length-1];return lr(typeof r==="function"?r:void 0,Promise.reject(t))}function pp(e){if(Us.getParserErrors(e).length>0)throw new Us(e)}var Kte,Gte,Yte,b0;var x0=L(()=>{Fx();yl();K$();a0();f0();h0();Wt();ep();np();Ar();y0();Jn();ip();Wt();Kte=qn.parse,Gte=qn.resolve,Yte=qn.bundle,b0=qn.dereference});function QL(e,t){if(t.routing==="prefix-except-default"&&e===t.defaultLocale)return"/";return`/${e.toLowerCase()}/`}function $0(e){if(e===null||e.locales.length<2)return"";let t=JSON.stringify(e.locales),r=JSON.stringify(e.defaultLocale),n=JSON.stringify(Object.fromEntries(e.locales.map((i)=>[i,QL(i,e)])));return`
102
+ `;return Sg(r,i,"utf8"),1}function kg(e){let t=Ga(e,".nojekyll");if(za(t))return 0;return Sg(t,"","utf8"),1}var zA="/images/_optimized/*",wg=31536000,GA="# Generated by @jxsuite/compiler — configure via build.headers in project.json.",KA="# ─── public/_headers (hand-authored; these rules override the block above) ───";var Rg=q(()=>{nr();Ou()});async function Ag(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 Og=q(()=>{nn()});import{cpSync as XA,existsSync as ZA,mkdirSync as QA}from"node:fs";import{dirname as eO,resolve as tO}from"node:path";async function Cg(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:da(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 Cu(e,t,r){if(t.length===0||!e)return;for(let n of Rm(e,t))r.add(n)}function Ng(e,t,r){let n=0,s=[];for(let i of e){let o=fa(t,i);if(!o||!ZA(o)){s.push(i);continue}let a=tO(r,decodeURIComponent(i).replace(/^\//,""));QA(eO(a),{recursive:!0}),XA(o,a),n+=1}return{copied:n,missing:s}}var Tg=q(()=>{nr();ve();rr()});async function Nu(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 Nu(s,t,r);let i=e.children??[],o=T(i)?[i]:Array.isArray(i)?i:[],a=nO(s);if(rO(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 rO(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)}Ig(e,r,n)}function Ig(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 Ig(s,t,r),n.push(s);e.children=n}function nO(e){return structuredClone(e)}var Mg=q(()=>{ve()});import{existsSync as sO,readFileSync as iO}from"node:fs";import{resolve as Jg}from"node:path";function Dg(e){return(t)=>{let r=Jg(e,t);if(!sO(r))throw Error(`Layout not found: ${t} (resolved to ${r})`);try{return jn(iO(r,"utf8"),r)}catch(n){throw Error(`Invalid layout JSON at ${r}: ${Ee(n)}`,{cause:n})}}}function Lg(e,t,r){return Nu(e,t,Dg(r))}function Fg(e,t,r){let n=Dg(r),s=[],i=e.$layout??t.defaults?.layout;while(i){let o=Jg(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 qg=q(()=>{rr();Mg()});import{dirname as oO,relative as aO,resolve as lO,sep as cO}from"node:path";function Hg(e,t){return aO(t,e).split(cO).join("/")}function uO(e,t,r){if(!e.startsWith("./")&&!e.startsWith("../"))return e;return`./${Hg(lO(t,e),r)}`}function oo(e,t,r){let n=oO(t),s=Hg(t,r);return Zh(e).map((i)=>({exportName:i.exportName,src:uO(i.src,n,r),declaredIn:s}))}function Vg(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 Wg(e,t){if(!T(t)||t.trim()==="")return[...e];return[{attributes:{content:t,name:"description"},tagName:"meta"},...e]}function Ug(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=Tu(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=An(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(Tu(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=Tu(l);if(!i.has(c))i.set(c,l)}return[...i.values()]}function Tu(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:${dO(s)}`}return`${t}:${JSON.stringify(e)}`}function dO(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 zg(e){return e.map((t)=>fO(t)).join(`
103
+ `)}function fO(e){if(T(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}="${pO(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 pO(e){return String(e).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}var Gg=q(()=>{nr();ve()});function gO(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 yO(e){if(!T(e))return[];return e.split(/\s+/).filter((t)=>{if(t==="")return!1;let r=t.toLowerCase();return!mO.has(r)&&!hO.has(r)&&!gO(t)})}function Kg(e){let t=new Set;for(let r of e){if(!F(r)||r.tagName!=="link")continue;for(let n of yO(r.attributes?.rel))t.add(n)}return[...t]}var mO,hO;var Yg=q(()=>{ve();mO=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"]),hO=new Set(["shortcut"])});function Xg(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=(T(e.$lang)?e.$lang:void 0)??Tr(r.urlPattern,s)??t.defaults?.lang,l=i.map((d)=>({code:d.locale,current:d.urlPattern===r.urlPattern,dir:Gi(d.locale),label:yh(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=Gi(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=T(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 Zg=q(()=>{ve();hs()});import{dirname as bO,relative as xO,resolve as $O}from"node:path";function vO(e){return(t,r)=>{if(!r.sourcePath)return t;return`./${xO(bO(r.sourcePath),$O(e,t))}`}}function Qg(e,t,r,n=null,s=null,i=[]){return Xg(e,t,r,n===null?null:vO(n),s,i)}var ey=q(()=>{Zg()});async function Xa(e,t={}){let{resolveElementPath:r,$media:n,formats:s}=t,i=[],o=new Set;async function a(l,c){let d,p;if(T(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=jn(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(() => nn());throw ca(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(!T(E))continue;if(b)await a(E,b);let O=r?r(E,b):E.replace(/\.json$/,".js");g.push(O)}let y=Va(h);if(n)d.$media={...n,...d.$media};let{rewriteSrc:v}=t,j=ao(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 wO(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 Xa(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>
104
+ <html lang="en">
105
+ <head>
106
+ <meta charset="utf-8">
107
+ <meta name="viewport" content="width=device-width, initial-scale=1">
108
+ <title>${$e(r)}</title>
109
+ <script type="importmap">
110
+ {
111
+ "imports": {
112
+ "@vue/reactivity": "${n}",
113
+ "lit-html": "${s}"
114
+ }
115
+ }
116
+ </script>
117
+ </head>
118
+ <body>
119
+ <${o.tagName}></${o.tagName}>
120
+ <script type="module" src="./${l}"></script>
121
+ </body>
122
+ </html>`;return{files:i.files,html:c}}function SO(e){if(!F(e)||Array.isArray(e))return JSON.stringify(e);if("default"in e)return JSON.stringify(e.default);if(Pn(e))return;if(e.$prototype==="LocalStorage"||e.$prototype==="SessionStorage")return JSON.stringify(e.default??null);if(e.$prototype==="Request")return"null";if(tn(e))return"null";return JSON.stringify(e)}function EO(e){let t=new Set,r=new Set,n=(i)=>{if(i.startsWith("#/state/"))t.add(i.slice(8).split("/")[0])},s=(i)=>{if(T(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 ao(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=EO(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)&&!ty.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:hu(R,k)});continue}let D=a.get(I);if(!D)D=[],a.set(I,D);D.push(Ia(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])=>tn(k)?[[R,k]]:[]);if(o.push("import { reactive, computed, effect, stop } from '@vue/reactivity';","import { render, html, nothing } from 'lit-html';",Fa()),h.length>0)o.push(qa());let m=s===null&&Nn(e.children);if(m)o.push(Xh());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(ns(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&&!T(k.body))if(d.has(R)||ty.has(R))v.push([R,k]);else y.push([R,k]);else if(T(k.body)&&ss(k.body))y.push([R,k]);else v.push([R,k]);else if(T(k)&&k.includes("${"))S.push([R,k]);else{let I=SO(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=At(k.$expression,{eventParam:"e",statePrefix:"s"});o.push(` ${Pe("this.state",dt(R))} = (s, e) => { ${I}; };`)}else if(_n(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?rn(k.parameters):k.arguments??["state"],D=I.join(", "),M=T(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((W)=>W==="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=At(k.$expression,{eventParam:"e",statePrefix:"this.state"});o.push(` ${Pe("this.state",dt(R))} = ${no(k,I)};`)}for(let[R,k]of S)o.push("",` ${Pe("this.state",dt(R))} = computed(() => ${La(k.replaceAll("state.","this.state."))});`);for(let[R,k]of y)if(o.push(""),tr(k)){let I=At(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=(T(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=sy(),O=!Array.isArray(e.children)&&e.textContent!==void 0?` ${Za(e.textContent)}`:Ya(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(Ma(R,k,{collect:"this.#effects",indent:" ",statePrefix:"this.state"}));for(let[R,k]of h)o.push(Ja(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(T(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 = ${yu}(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(` ${bu}(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(`
123
+ `)}function sy(){return{byText:new Map,decls:[]}}function iy(e,t){let r=e.byText.get(t);if(r)return r;let n=`_c${e.decls.length}`;e.decls.push(` const ${n} = html\`
124
+ ${t}
125
+ \`;`);let s=`\${${n}}`;return e.byText.set(t,s),s}function Ya(e,t,r,n=!1,s=!1,i=null,o=!1){if(!e)return"";let a=o?ei:"";if(Qe(e))return`${ny(e,r)}${a}`;if(!Array.isArray(e))return"";return e.map((l)=>{if(Qe(l))return`${ny(l,r)}${a}`;let c=Mu(l,n?"":r,n,s,i);return T(l)&&l.includes("${")||F(l)&&Nr(l.tagName)?`${c}${a}`:c}).join(n?"":`
126
+ `)}function Mu(e,t,r=!1,n=!1,s=null,i=null){if(T(e)){if(e.includes("${"))return`${t}${Za(e)}`;return`${t}${$e(e)}`}if(lr(e)||$t(e))return`${t}${$e(String(e))}`;if(!F(e))return"";if(Nr(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||In.has(k)),P=null;if(s&&S.every((k)=>k===S[0])){let k=ry(e,`${t} `,S[0]===!0,n,s,j.some((I)=>I.includes("-")));if(k.trim()!=="")P=iy(s,k)}let E=v.map(([k,I])=>{let D={...e,tagName:I};return[k,Mu(D,`${t} `,r,n,s,P)]});if(g.operator==="?:"){let[,k]=E[0],[,I]=E[1];return`${t}\${${y}
127
+ ? html\`
128
+ ${k}
129
+ \`
130
+ : html\`
131
+ ${I}
132
+ \`}`}let O=E.flatMap(([k,I])=>k==="__default__"?[]:[` ${JSON.stringify(k)}: html\`
133
+ ${I}
134
+ \``]),[,R]=E.at(-1);return`${t}\${{
135
+ ${O.join(`,
136
+ `)}
137
+ }[String(${y})] ?? html\`
138
+ ${R}
139
+ \`}`}let o=e.tagName??"div",a=r||In.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(T(y)&&_O(y))l.push(`${g}="\${${Qs}('${g}', ${or(y).slice(2,-1)}) ?? nothing}"`);else if(T(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(Ka(y))l.push(`.${g}="\${${Jr(y.$ref)}}"`);else if(T(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(Ka(y))l.push(`.${g}="\${${Jr(y.$ref)}}"`);else if(T(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(Ka(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=At(y.$expression,{eventParam:"e",statePrefix:"s"});l.push(`@${v}="\${(e) => { ${c}${j}; }}"`)}else if(er(y))l.push(`@${v}="\${(e) => { ${c}${PO(y)} }}"`)}let d=ay(e.style);if(d)l.push(`style="${d}"`);let p=l.length>0?`
140
+ ${t} ${l.join(`
141
+ ${t} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(o))return`${t}<${o}${p}
142
+ ${t}>`;let m=i??ry(e,t,a,n,s,o.includes("-")),b=o==="slot"?ei:"";return a?`${b}<${o}${p}>${m}${b}</${o}>`:`${t}${b}<${o}${p}
143
+ ${t}>${m}${b}</${o}>`}function ry(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,Mu(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`\${{
144
+ ${l.map(([h,m])=>{let b=s&&d.has(m)?iy(s,m):m;return` ${JSON.stringify(h)}: html\`
145
+ ${b}
146
+ \``}).join(`,
147
+ `)}
148
+ }[${a}]}`}if(e.textContent!==void 0){let o=Za(e.textContent),a=Ce(e.textContent)||T(e.textContent)&&e.textContent.includes("${");return i&&a?`${o}${ei}`:o}if(e.innerHTML!==void 0)return e.innerHTML;if(e.children)return r?Ya(e.children,e.style,"",!0,n,s,i):`
149
+ ${Ya(e.children,e.style,`${t} `,!1,n,s,i)}
150
+ ${t}`;return""}function ny(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}="\${${Iu(b.$ref)}}"`);else if(T(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(Ka(b))i.push(`.${m}="\${${Iu(b.$ref)}}"`);else if(T(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}="\${${Iu(b.$ref)}}"`);else if(T(b)&&b.includes("${"))i.push(`.${m}="${or(b)}"`);else i.push(`.${m}="\${${JSON.stringify(b)}}"`);let o=ay(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=At(b.$expression,{eventParam:"e",statePrefix:"s"});i.push(`@${g}="\${(e) => { s.$map = $map; ${y}; }}"`)}}let a=i.length>0?`
151
+ ${t} ${i.join(`
152
+ ${t} `)}`:"",l=sy(),c="";if(n.textContent!==void 0)c=Za(n.textContent);else if(n.children)c=`
153
+ ${Ya(n.children,null,`${t} `,!1,!0,l)}
154
+ ${t} `;let d=`html\`
155
+ ${t} <${s}${a}
156
+ ${t} >${c}</${s}>
157
+ ${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 Ka(e){return Ce(e)&&e.$ref!==""}function Jr(e){if(e.startsWith("#/state/"))return Pe("s",e.slice(8));if(e.startsWith("$map/"))return oy(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 oy(e){let[t,...r]=cn(e);return Pe(t??"",r.map((n)=>dt(n)).join("/"))}function Iu(e){if(e.startsWith("$map/"))return oy(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 Za(e){if(Ce(e))return`\${${Jr(e.$ref)}}`;if(T(e)&&e.includes("${"))return or(e);return String(e)}function PO(e){if(_n(e))return fr(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((s)=>s==="state"?"s":"e").join(", ");return`((${r.join(", ")}) => { ${t} })(${n});`}return t.replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function ay(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(T(n)&&n.includes("${")){let s=Vt(r);t.push(`${s}: ${or(n)}`)}}return t.join("; ")}var ty;var lo=q(()=>{Us();Mr();ve();rr();Hs();ty=new Set(["onMount","onUnmount","onAdopted"])});function ly(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=cy(e,!1,i,a),c=[],d="",p="";if(a.length>0){for(let b of a){let g=ao(b.def,b.className,[],t.rewriteSrc);c.push({content:g,path:`_islands/${b.tagName}.js`,tagName:b.tagName})}d=`<script type="importmap">
158
+ {
159
+ "imports": {
160
+ "@vue/reactivity": "${n}",
161
+ "lit-html": "${s}"
162
+ }
163
+ }
164
+ </script>`,p=c.map((b)=>`<script type="module" src="./${b.path}"></script>`).join(`
165
+ `)}let h=t.prePaintScheme!==!1&&Object.values(e.$media??{}).some((b)=>wr(String(b))!==null)?`<script>${Zs()}</script>
166
+ `:"",m=`<!DOCTYPE html>
167
+ <html lang="en">
168
+ <head>
169
+ <meta charset="utf-8">
170
+ <meta name="viewport" content="width=device-width, initial-scale=1">
171
+ <title>${$e(r)}</title>
172
+ ${h}${d}
173
+ ${o}
174
+ </head>
175
+ <body>
176
+ ${l}
177
+ ${p}
178
+ </body>
179
+ </html>`;return{files:c,html:m}}function cy(e,t,r,n){if(T(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=vu(e.tagName,s.scope),o=bs(e,s.scope);if($u.has(i))return`<${i}${o}>`;let a=r.preformatted===!0||In.has(i),l=jO(e,{...s,preformatted:a},n);return`<${i}${o}>${l}</${i}>`}function jO(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)=>cy(n,Wh(n),t,r)).join(so(t.preformatted));return""}var uy=q(()=>{Mr();lo();ve()});function Fu(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,`() => ${La(D)}`]);else h.push([I,D]);continue}if(tr(D)){let M=D.$expression,L=At(M,{eventParam:"e",statePrefix:"state"});if(ns(D))y.push(`state[${JSON.stringify(I)}] = ${no(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?rn(D.parameters):D.arguments,{body:L}=D;if(Array.isArray(L)){let W=fr(L,{eventParam:"e",statePrefix:"state"});if(D.parameters&&D.parameters.length>0)y.push(`state[${JSON.stringify(I)}] = ${no(D,`(() => {
180
+ ${W}
181
+ })()`)};`);else g.push([I,{args:["state","e"],body:W}])}else if(D.$src){let W=j.get(D.$src);if(!W)W=new Set,j.set(D.$src,W);W.add(Ia(I,D)),m.push([I,`() => { return ${I}(state); }`])}else if(T(L)&&ss(L))m.push([I,`() => { ${L} }`]);else g.push([I,{args:M??["state"],body:L}]);continue}if(Pn(D))continue;if(Up(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,W=D.default??null;h.push([I,null]),y.push(RO(I,M,L,W));continue}if(D.$prototype==="Request"){h.push([I,null]),y.push(Ma(I,D));continue}if(D.$prototype==="Cookie"){h.push([I,null]),y.push(AO(I,D.name??I,D.default??null));continue}}if(tn(D)){h.push([I,null]),v.push(Ja(I,D,{serverBaseUrl:o}));continue}h.push([I,D])}let P=dy(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=kO(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>
182
+ `:"",k=`<!DOCTYPE html>
183
+ <html lang="en">
184
+ <head>
185
+ <meta charset="utf-8">
186
+ <meta name="viewport" content="width=device-width, initial-scale=1">
187
+ <title>${$e(r)}</title>
188
+ ${R}<script type="importmap">
189
+ {
190
+ "imports": {
191
+ ${O.join(`,
192
+ `)}
193
+ }
194
+ }
195
+ </script>
196
+ ${l}
197
+ <script type="module" src="./${i}"></script>
198
+ </head>
199
+ <body>
200
+ ${P}
201
+ </body>
202
+ </html>`;return{files:[{content:E,path:i}],html:k}}function dy(e,t,r,n,s){if(T(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(Nr(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||In.has(o);let a=[],l=!1;if(e.textContent!==void 0){let g=e.textContent;if(Bt(g)){let y=ni(g.$ref);a.push(`:text-content="${y}"`),Ju(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(Bt(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?rn(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=At(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(py(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(Bt(y)){let v=ni(y.$ref);a.push(`:attr.${g}="${v}"`),Ju(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(Bt(y)){let v=ni(y.$ref);a.push(`:${Vt(g)}="${v}"`),Ju(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=Bt(m.$switch)?Lu(m.$switch.$ref):`\`${String(m.$switch)}\``,v=m.cases??{},j=Object.entries(v).filter(([,P])=>P&&!Bt(P)).map(([P,E])=>`${JSON.stringify(P)}: html\`${Du(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=Bt(y.items)?Lu(y.items.$ref):JSON.stringify(y.items),j=qu(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)=>Du(j,i.preformatted)).join(so(i.preformatted," "));r.set(g,i.preformatted?`() => html\`${y}\``:`() => html\`
203
+ ${y}
204
+ \``),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)=>dy(g,i,r,n,s)).join(so(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 qu(e,t=!1){if(!e)return"";if(Nr(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||In.has(r),s="";if(e.id)s+=` id="${e.id}"`;if(e.className)s+=` class="${Mn(e.className)}"`;if(F(e.$props))for(let[l,c]of Object.entries(e.$props))if(Bt(c))s+=` .${l}="\${${OO(c.$ref)}}"`;else if(pe(c))s+=` .${l}="${Mn(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}="${Mn(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(py(d))continue;let p=Vt(c);if(pe(String(d)))l.push(`${p}: ${Mn(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(Bt(c)){let p=ni(c.$ref);s+=` @${d}=\${(e) => { state.$map = { item, index }; on.${p}(e); }}`}else if(_n(c)){let p=fr(c.body,{eventParam:"e",statePrefix:"state"});s+=` @${d}=\${(e) => { state.$map = { item, index }; ${p} }}`}else if(er(c)){let p=Mn(c.body);s+=` @${d}=\${(e) => { ${p} }}`}else if(F(c)&&"$expression"in c){let p=At(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=`${Mn(l)}${i}`;else if(Bt(e.textContent))o=`\${state.${ni(e.textContent.$ref)}}${i}`;else o=$e(l)}else if(e.innerHTML)o=Mn(String(e.innerHTML));else if(Qe(e.children))o=`
205
+ ${fy(e.children)}${i}
206
+ `;else if(Array.isArray(e.children)){let l=e.children.map((c)=>{let d=Du(c,n);return Qe(c)||T(c)&&pe(c)?`${d}${i}`:d});o=n?l.join(""):`
207
+ ${l.join(`
208
+ `)}
209
+ `}if(new Set(["input","br","hr","img","meta","link"]).has(r))return`<${r}${s}>`;return`<${r}${s}>${o}</${r}>`}function Du(e,t=!1){if(T(e))return pe(e)?Mn(e):$e(e);if(lr(e)||$t(e))return $e(String(e));if(Qe(e))return fy(e);return qu(e,t)}function fy(e){let{items:t}=e,r=Bt(t)?Lu(t.$ref):JSON.stringify(t??[]),n=qu(e.map);return`\${(${r} ?? []).map((item, index) => html\`${n}\`)}`}function Mn(e){return e.replaceAll("$map.","")}function kO(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("",Fa()),i.length>0)d.push("",qa());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(`
210
+ `)}function RO(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(`
211
+ `)}function AO(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(`
212
+ `)}function py(e){return e===null||F(e)}function OO(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 Lu(e){return Eh("state",e.startsWith("#/state/")?e.slice(8):e)}function ni(e){return _h(e.startsWith("#/state/")?e.slice(8):e)}function Ju(e,t,r){if(e.has(t))return;e.set(t,`() => ${Pe("state",r.startsWith("#/state/")?r.slice(8):r)}`)}var Hu=q(()=>{Us();Mr();ve();Hs()});function CO(e,t){if(t.routing==="prefix-except-default"&&e===t.defaultLocale)return"/";return`/${e.toLowerCase()}/`}function my(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,CO(s,e)])));return`
132
213
  // ─── Locale negotiation (RFC 4647 Lookup over Accept-Language) ───────────────
133
214
  const JX_LOCALES = ${t}
134
215
  const JX_DEFAULT_LOCALE = ${r}
@@ -197,223 +278,101 @@ app.use('/', async (c, next) => {
197
278
  res.headers.set('Content-Language', locale)
198
279
  c.res = res
199
280
  })
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 mp(e,t={}){let{adapter:r=null,mounts:n=[],connectors:i=[],i18n:s=null,base:o=""}=t,a=ze(o,t.baseUrl??"/_jx/server");if(e.length===0&&n.length===0&&!r)return null;let c=e.map(({exportName:m,src:y})=>`import { ${m} } from '${y}'`).join(`
214
- `),l=ZL(n,i),u=e.map(({exportName:m})=>v0(m,a)).join(`
215
- `),d=r==="cloudflare-workers"||r==="cloudflare-pages"?`
281
+ `}function Qa(e,t="/_jx/server"){return Ie(e,t)}function Vu(e,t={}){let{adapter:r=null,mounts:n=[],connectors:s=[],i18n:i=null,base:o=""}=t,a=Qa(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(`
282
+ `),c=NO(n,s),d=e.map(({exportName:m})=>TO(m,a)).join(`
283
+ `),p=r==="cloudflare-workers"||r==="cloudflare-pages"?`
216
284
  app.all('*', (c) => c.env.ASSETS.fetch(c.req.raw))
217
285
  `:`
218
- `,h=$0(s);return`// Generated by @jxsuite/compiler — do not edit manually
286
+ `,h=my(i);return`// Generated by @jxsuite/compiler — do not edit manually
219
287
  import { Hono } from 'hono'
220
- ${c}${l.imports}
288
+ ${l}${c.imports}
221
289
 
222
290
  const app = new Hono()
223
- ${h}${l.routes}${u}
224
- ${d}
291
+ ${h}${c.routes}${d}
292
+ ${p}
225
293
  export default app
226
- `}function ZL(e,t){if(e.length===0)return{imports:"",routes:""};let r=e.toSorted((s,o)=>s.order-o.order),n=[];for(let s of r)n.push(`import { ${s.className} } from '${s.module}'`);for(let s of t)n.push(`import { ${s.className} } from '${s.module}'`);let i=["// Extension server mounts (specs/extensions.md §11): one shared ctx, mounted in order.","const jxCtx = {}",`const jxConnectors = { ${t.map((s)=>`${JSON.stringify(s.provider)}: ${s.className}`).join(", ")} }`];for(let[s,o]of r.entries()){let a=JSON.stringify(o.options);i.push(`const jxMount${s} = await ${o.className}.mount({ ...${a}, connectors: jxConnectors }, jxCtx)`,`app.all('${o.basePath}/*', (c) => jxMount${s}(c.req.raw, c.env))`,`app.all('${o.basePath}', (c) => jxMount${s}(c.req.raw, c.env))`)}return{imports:`
294
+ `}function NO(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
295
  ${n.join(`
228
- `)}`,routes:`${i.join(`
296
+ `)}`,routes:`${s.join(`
229
297
  `)}
230
- `}}function v0(e,t){return`
298
+ `}}function TO(e,t){return`
231
299
  app.post('${t}/${e}', async (c) => {
232
300
  const args = await c.req.json().catch(() => ({}))
233
301
  try {
234
- return c.json(await ${e}(args, c.env))
302
+ return c.json((await ${e}(args, c.env)) ?? null)
235
303
  } catch (e) {
236
304
  return c.json({ ok: false, error: e?.message ?? 'Server error' }, 500)
237
305
  }
238
- })`}var hp=L(()=>{wr();x0();mn()});async function Cl(e,t={}){let{resolveElementPath:r,$media:n,formats:i}=t,s=[],o=new Set;async function a(c,l){let u,d;if(T(c)){let{readFileSync:E}=await import("node:fs"),{resolve:w}=await import("node:path");if(d=l?w(l,c):w(c),o.has(d))return;if(o.add(d),d.endsWith(".json"))u=ti(E(d,"utf8"),d);else{let{extname:k}=await import("node:path"),R=k(d).toLowerCase(),j=i?.byExtension(R,"parse");if(!j){await Promise.resolve().then(() => On());throw _c(d,R)}u=await j.parseDocument(E(d,"utf8"))}}else{if(u=c,d=null,u.tagName&&o.has(u.tagName))return;if(u.tagName)o.add(u.tagName)}let{tagName:h}=u;if(!h||!h.includes("-"))throw Error(`compileElement: tagName "${h}" must contain a hyphen`);let{dirname:m}=await import("node:path"),y=d?m(d):null,g=[];if(Array.isArray(u.$elements))for(let E of u.$elements){let w=Je(E)?E.$ref:E;if(!T(w))continue;if(y)await a(w,y);let k=r?r(w,y):w.replace(/\.json$/,".js");g.push(k)}let b=rl(h);if(n)u.$media={...n,...u.$media};let{rewriteSrc:x}=t,_=va(u,b,g,x?(E)=>x(E,y):void 0,Yi(u,t.defaults)),P=d?d.replace(/\.json$/,".js"):`${h}.js`;s.push({content:_,path:P,tagName:h})}return await a(e,t.basePath??null),{files:s}}async function eD(e,t={}){let{title:r="Jx App",reactivitySrc:n="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:i="https://esm.sh/lit-html@3.3.0"}=t,s=await Cl(e,t),o=s.files.at(-1);if(!o)throw Error("compileElementPage: no element modules were produced");let{basename:a}=await import("node:path"),c=a(o.path),l=`<!DOCTYPE html>
306
+ })`}var Bu=q(()=>{nr()});function gy(e){let t=e.title;if(!t)throw Error("compileClassJson: missing title (class name)");let r=MO(e.extends),n=e.$defs,s=n?.fields??{},i=n?.constructor,o=IO(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")||DO(p)?"async ":"",j=hy(p.parameters??[]),S=JO(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=hy(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(`
307
+ `)}function IO(e){return typeof e==="object"}function MO(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 hy(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 JO(e){if(!e)return[""];return Array.isArray(e)?e:[e]}function DO(e){return(Array.isArray(e.body)?e.body.join(`
308
+ `):e.body??"").includes("await ")}var yy=q(()=>{ve()});import{readFileSync as LO}from"node:fs";async function Wu(e,t={}){let{title:r="Jx App",reactivitySrc:n=Ks,litHtmlSrc:s=Ys,projectStyle:i=null}=t,o;if(T(e)){let l=LO(e,"utf8");if(e.endsWith(".json"))o=jn(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(() => nn());throw ca(e,d)}o=await p.parseDocument(l)}}else o=e;if(Gp(o)){await Promise.resolve().then(() => yy());let c=gy(o),d=T(e)?e.replace(/\.class\.json$/,".js"):`${o.title}.js`;return{files:[{content:c,path:d}],html:""}}if(!Da(o))return ly(o,{litHtmlSrc:s,projectStyle:i,reactivitySrc:n,...by(t),title:r});if(o.tagName&&o.tagName.includes("-")){let{tagName:l}=o,c=Va(l),p={content:ao(o,c,[],t.rewriteSrc,null,t.serverBaseUrl),path:`${l}.js`,tagName:l},h=ti(o,o.$media??{},i),m=`<!DOCTYPE html>
239
309
  <html lang="en">
240
310
  <head>
241
311
  <meta charset="utf-8">
242
312
  <meta name="viewport" content="width=device-width, initial-scale=1">
243
- <title>${Se(r)}</title>
313
+ <title>${$e(r)}</title>
244
314
  <script type="importmap">
245
315
  {
246
316
  "imports": {
247
317
  "@vue/reactivity": "${n}",
248
- "lit-html": "${i}"
318
+ "lit-html": "${s}"
249
319
  }
250
320
  }
251
321
  </script>
322
+ ${h}
252
323
  </head>
253
324
  <body>
254
- <${o.tagName}></${o.tagName}>
255
- <script type="module" src="./${c}"></script>
325
+ <${l}></${l}>
326
+ <script type="module" src="./${l}.js"></script>
256
327
  </body>
257
- </html>`;return{files:s.files,html:l}}function tD(e){if(!J(e)||Array.isArray(e))return JSON.stringify(e);if("default"in e)return JSON.stringify(e.default);if(ei(e))return;if(e.$prototype==="LocalStorage"||e.$prototype==="SessionStorage")return JSON.stringify(e.default??null);if(e.$prototype==="Request")return"null";return JSON.stringify(e)}function rD(e){let t=new Set,r=new Set,n=(s)=>{if(s.startsWith("#/state/"))t.add(s.slice(8).split("/")[0])},i=(s)=>{if(T(s)){for(let a of s.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*\(/g))t.add(a[1]);return}if(!J(s)||r.has(s))return;if(r.add(s),Array.isArray(s)){for(let a of s)i(a);return}let o=s;if(o.operator==="call"&&Je(o.target))n(o.target.$ref);for(let[a,c]of Object.entries(o)){if(a.startsWith("on")&&a!=="observedAttributes"&&Je(c))n(c.$ref);i(c)}};return i(e.children),i(e.state),t}function va(e,t,r,n,i=null){let s=["// Generated by @jxsuite/compiler — do not edit manually"];if(e.$id)s.push(`// Source: ${e.$id}`);for(let w of r)s.push(`import '${w}';`);let o=new Map,a=new Map,c=e.state??{},l=rD(e);for(let[w,k]of Object.entries(c))if(xr(k)&&k.$src){let R=k.$src;if(k.$lazy===!0){if(!l.has(w)&&!w0.has(w))throw Error(`"${w}" declares "$lazy": true but is used as a computed value, not called. A lazily loaded function resolves to a promise; a computed must resolve now. Remove "$lazy", or call ${w}() from a handler instead of binding its value.`);let D=a.get(R);if(!D)D=[],a.set(R,D);D.push({binding:w,exportName:Yf(w,k)});continue}let j=o.get(R);if(!j)j=[],o.set(R,j);j.push(Yc(w,k))}for(let[w,k]of o){let R=n?n(w):w;s.push(`import { ${k.join(", ")} } from '${R}';`)}let u=Object.entries(c).flatMap(([w,k])=>un(k)&&k.$prototype==="Request"?[[w,k]]:[]);s.push("import { reactive, computed, effect, stop } from '@vue/reactivity';","import { render, html, nothing } from 'lit-html';",el());let d=i===null&&ci(e.children);if(d)s.push(_b());let h=0;for(let[w,k]of a){let R=n?n(w):w,j=`_jxLazy${h}`;h+=1,s.push(`let ${j};`,`const ${j}Load = () => (${j} ??= import('${R}'));`,...k.map(({binding:D,exportName:F})=>`const ${D} = (...args) => ${j}Load().then((m) => m.${F}(...args));`))}s.push("",`class ${t} extends HTMLElement {`," #effects = [];",...i===null?[]:[" #root = null;"],""," constructor() {"," super();");let m=[],y=[],g=[],b=[],x=[];for(let[w,k]of Object.entries(c))if($r(k))if(Ni(k))b.push([w,k]);else if(Nn(k.$expression.operator))g.push([w,k]);else y.push([w,k]);else if(xr(k))if(k.$src&&!T(k.body))if(l.has(w)||w0.has(w))g.push([w,k]);else y.push([w,k]);else if(T(k.body)&&Mi(k.body))y.push([w,k]);else g.push([w,k]);else if(T(k)&&k.includes("${"))x.push([w,k]);else{let R=tD(k);if(R!==void 0)m.push([w,R])}s.push(" this.state = reactive({");for(let[w,k]of m)s.push(` ${Ps(w)}: ${k},`);s.push(" });");for(let[w,k]of g)if(s.push(""),$r(k)){let R=Vt(k.$expression,{eventParam:"e",statePrefix:"s"});s.push(` ${Ie("this.state",Ct(w))} = (s, e) => { ${R}; };`)}else if(Zn(k)){let R=Lr(k.body,{dispatchTarget:"this",eventParam:"e",indent:" ",statePrefix:"this.state"});s.push(` ${Ie("this.state",Ct(w))} = (s, e) => {`,R," };")}else{let R=k.parameters?Rn(k.parameters):k.arguments??["state"],j=R.join(", "),D=T(k.body)?k.body:"";if(R[0]==="state")if(k.$src)s.push(` ${Ie("this.state",Ct(w))} = (${j}) => ${w}(${j});`);else s.push(` ${Ie("this.state",Ct(w))} = (${j}) => {`,` ${D}`," };");else{let F=R.map((N)=>N==="state"?"state":"e").join(", ");if(k.$src)s.push(` ${Ie("this.state",Ct(w))} = (state, e) => ${w}(${F});`);else s.push(` ${Ie("this.state",Ct(w))} = (state, e) => {`,` const _fn = (${j}) => {`,` ${D}`," };",` return _fn(${F});`," };")}}for(let[w,k]of b){s.push("");let R=Vt(k.$expression,{eventParam:"e",statePrefix:"this.state"});s.push(` ${Ie("this.state",Ct(w))} = ${sa(k,R)};`)}for(let[w,k]of x)s.push("",` ${Ie("this.state",Ct(w))} = computed(() => ${Zc(k.replaceAll("state.","this.state."))});`);for(let[w,k]of y)if(s.push(""),$r(k)){let R=Vt(k.$expression,{eventParam:"e",statePrefix:"this.state"});s.push(` ${Ie("this.state",Ct(w))} = computed(() => ${R});`)}else if(k.$src)s.push(` ${Ie("this.state",Ct(w))} = computed(() => ${w}(this.state));`);else{s.push(` ${Ie("this.state",Ct(w))} = computed(() => {`);let R=(T(k.body)?k.body:"").replaceAll("state.","this.state.");s.push(` ${R}`," });")}s.push(" }","");let _=[];if(Array.isArray(e.children)){let w={n:0};for(let k of e.children)li(k,_,e.$media??{},"",w,e.tagName)}let P=_0(),E=!Array.isArray(e.children)&&e.textContent!==void 0?` ${Il(e.textContent)}`:Ol(e.children,e.style," ",!1,!1,P);s.push(" template() {"," const s = this.state;",...P.decls," return html`",E," `;"," }","",...i===null?[]:[" #renderRoot() {"," if (this.#root) return this.#root;",i==="closed"?" this.#root = this.attachInternals().shadowRoot ?? this.attachShadow({ mode: 'closed' });":" this.#root = this.shadowRoot ?? this.attachShadow({ mode: 'open' });"," return this.#root;"," }",""]," connectedCallback() {"," const _pa = this.getAttribute('data-jx-props');"," if (_pa) {"," try {"," const _p = JSON.parse(_pa);"," for (const [k, v] of Object.entries(_p)) {"," if (k.startsWith('#')) continue;"," if (k in this.state) this.state[k] = v;"," }"," } catch {}"," this.removeAttribute('data-jx-props');"," }"," const _pn = this.getAttributeNames().filter(n => n.startsWith('props.') && n.length > 6);"," for (const _n of _pn) {"," const _k = _n.slice(6);"," if (_k.startsWith('#')) { this.removeAttribute(_n); continue; }"," if (_k in this.state) {"," this.state[_k] = this.getAttribute(_n);"," this.removeAttribute(_n);"," }"," }"," for (const key of Object.keys(this.state)) {"," if (key.startsWith('#')) continue;"," if (this.hasOwnProperty(key) && this[key] !== undefined) {"," this.state[key] = this[key];"," }"," }");for(let[w,k]of u)s.push(Xc(w,k,{collect:"this.#effects",indent:" ",statePrefix:"this.state"}));if(J(e.style)){let w=[];for(let[k,R]of Object.entries(e.style)){if(k.startsWith(":")||k.startsWith(".")||k.startsWith("&")||k.startsWith("[")||k.startsWith("@"))continue;if(T(R)&&R.includes("${"))w.push([ar(k),R])}if(w.length>0){s.push(" this.#effects.push(effect(() => {");for(let[k,R]of w){let j=R.replaceAll(/\$\{([^}]+)\}/g,(D,F)=>`\${${F.replaceAll("state.","this.state.")}}`);s.push(` this.style['${k}'] = \`${j}\`;`)}s.push(" }));")}}if(d)s.push(` const _slotted = ${Qf}(this);`);if(s.push(" if (this.hasAttribute('data-jx-prerendered')) {"," this.removeAttribute('data-jx-prerendered');"," }"),i===null)s.push(" this.replaceChildren();"," this.#effects.push(effect(() => render(this.template(), this)));");else s.push(" const _root = this.#renderRoot();"," for (const _n of [..._root.childNodes]) {"," if (!(_n.nodeType === 1 && _n.tagName === 'LINK')) _n.remove();"," }"," this.#effects.push(effect(() => render(this.template(), _root)));");if(d)s.push(` ${Zf}(this, _slotted);`);return s.push(" if (typeof this.state.onMount === 'function') {"," queueMicrotask(() => this.state.onMount(this.state));"," }"," }",""," disconnectedCallback() {"," for (const _e of this.#effects) { stop(_e); }"," this.#effects.length = 0;"," if (typeof this.state.onUnmount === 'function') { this.state.onUnmount(this.state); }"," }","}","",`customElements.define('${e.tagName}', ${t});`,""),s.join(`
258
- `)}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=yp(c,n?"":r,n,i,s);return T(c)&&c.includes("${")||J(c)&&fn(c.tagName)?`${l}${a}`:l}).join(n?"":`
261
- `)}function yp(e,t,r=!1,n=!1,i=null,s=null){if(T(e)){if(e.includes("${"))return`${t}${Il(e)}`;return`${t}${Se(e)}`}if(Ir(e)||Rt(e))return`${t}${Se(String(e))}`;if(!J(e))return"";if(fn(e.tagName)){let g=e.tagName.$expression,b=Ki(g.target,{eventParam:"e",statePrefix:"s"}),x=g.operator==="?:"?[[!0,g.value],[!1,g.initial]]:[...Object.entries(g.cases),["__default__",g.default]],_=x.map(([,j])=>j),P=_.map((j)=>r||ui.has(j)),E=null;if(i&&P.every((j)=>j===P[0])){let j=S0(e,`${t} `,P[0]===!0,n,i,_.some((D)=>D.includes("-")));if(j.trim()!=="")E=P0(i,j)}let w=x.map(([j,D])=>{let F={...e,tagName:D};return[j,yp(F,`${t} `,r,n,i,E)]});if(g.operator==="?:"){let[,j]=w[0],[,D]=w[1];return`${t}\${${b}
262
- ? html\`
263
- ${j}
264
- \`
265
- : html\`
266
- ${D}
267
- \`}`}let k=w.flatMap(([j,D])=>j==="__default__"?[]:[` ${JSON.stringify(j)}: html\`
268
- ${D}
269
- \``]),[,R]=w.at(-1);return`${t}\${{
270
- ${k.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)&&nD(b))c.push(`${g}="\${${Ds}('${g}', ${Rr(b).slice(2,-1)}) ?? nothing}"`);else if(T(b)&&b.includes("${"))c.push(`${g}="${Rr(b)}"`);else if(Rt(b)){let x=Gi(g,b);if(x!==null)c.push(x===""?g:`${g}="${x}"`)}else c.push(`${g}="${b}"`);if(e.id)c.push(`id="${Rr(String(e.id))}"`);if(e.className)c.push(`class="${Rr(String(e.className))}"`);for(let[g,b]of Object.entries(e)){if(Mn.has(g)||g.startsWith("$")||g.startsWith("on")||g==="tagName"||g==="id"||g==="className"||g==="style"||g==="children"||g==="textContent"||g==="innerHTML"||g==="attributes")continue;if(Rl(b))c.push(`.${g}="\${${hn(b.$ref)}}"`);else if(T(b)&&b.includes("${"))c.push(`.${g}="${Rr(b)}"`);else c.push(`.${g}="\${${JSON.stringify(b)}}"`)}if(e.$props)for(let[g,b]of Object.entries(e.$props))if(Rl(b))c.push(`.${g}="\${${hn(b.$ref)}}"`);else if(T(b)&&b.includes("${"))c.push(`.${g}="${Rr(b)}"`);else c.push(`.${g}="\${${JSON.stringify(b)}}"`);let l=n?"s.$map = $map; ":"";for(let[g,b]of Object.entries(e)){if(!g.startsWith("on")||g==="observedAttributes")continue;let x=g.slice(2).toLowerCase();if(Rl(b))c.push(l?`@${x}="\${(e) => { ${l}${hn(b.$ref)}(s, e); }}"`:`@${x}="\${(e) => ${hn(b.$ref)}(s, e)}"`);else if(J(b)&&"$expression"in b){let _=Vt(b.$expression,{eventParam:"e",statePrefix:"s"});c.push(`@${x}="\${(e) => { ${l}${_}; }}"`)}else if(xr(b))c.push(`@${x}="\${(e) => { ${l}${iD(b)} }}"`)}let u=A0(e.style);if(u)c.push(`style="${u}"`);let d=c.length>0?`
275
- ${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,yp(m,`${t} `,!1,n,i)])}let l=c.map(([,h])=>h),u=new Set(l.filter((h,m)=>l.indexOf(h)!==m&&h.trim()!==""));return`\${{
279
- ${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}="\${${gp(y.$ref)}}"`);else if(T(y)&&y.includes("${"))s.push(`${m}="${Rr(y)}"`);else s.push(`${m}="${y}"`);if(n.id)s.push(`id="${Rr(String(n.id))}"`);if(n.className)s.push(`class="${Rr(String(n.className))}"`);for(let[m,y]of Object.entries(n)){if(Mn.has(m)||m.startsWith("$")||m.startsWith("on")||m==="tagName"||m==="id"||m==="className"||m==="style"||m==="children"||m==="textContent"||m==="innerHTML"||m==="attributes")continue;if(Rl(y))s.push(`.${m}="\${${gp(y.$ref)}}"`);else if(T(y)&&y.includes("${"))s.push(`.${m}="${Rr(y)}"`);else s.push(`.${m}="\${${JSON.stringify(y)}}"`)}if(n.$props)for(let[m,y]of Object.entries(n.$props))if(Je(y))s.push(`.${m}="\${${gp(y.$ref)}}"`);else if(T(y)&&y.includes("${"))s.push(`.${m}="${Rr(y)}"`);else s.push(`.${m}="\${${JSON.stringify(y)}}"`);let o=A0(n.style);if(o)s.push(`style="${o}"`);for(let[m,y]of Object.entries(n)){if(!m.startsWith("on"))continue;let g=m.slice(2).toLowerCase();if(Je(y))s.push(`@${g}="\${(e) => { s.$map = $map; ${hn(y.$ref)}(s, e); }}"`);else if($r(y)){let b=Vt(y.$expression,{eventParam:"e",statePrefix:"s"});s.push(`@${g}="\${(e) => { s.$map = $map; ${b}; }}"`)}}let a=s.length>0?`
286
- ${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 gp(e){if(e.startsWith("$map/"))return k0(e.slice(5));return hn(e)}function Rr(e){return e.replaceAll("state.","s.")}function nD(e){return e.startsWith("${")&&e.endsWith("}")&&!e.slice(2).includes("${")}function Il(e){if(Je(e))return`\${${hn(e.$ref)}}`;if(T(e)&&e.includes("${"))return Rr(e);return String(e)}function iD(e){if(Zn(e))return Lr(e.body,{dispatchTarget:"e.currentTarget",eventParam:"e",statePrefix:"s"});let t=T(e.body)?e.body:"",r=e.parameters?Rn(e.parameters):e.arguments??[];if(r.length>0){let n=r.map((i)=>i==="state"?"s":"e").join(", ");return`((${r.join(", ")}) => { ${t} })(${n});`}return t.replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function A0(e){if(!J(e))return"";let t=[];for(let[r,n]of Object.entries(e)){if(r.startsWith(":")||r.startsWith(".")||r.startsWith("&")||r.startsWith("[")||r.startsWith("@"))continue;if(T(n)&&n.includes("${")){let i=ar(r);t.push(`${i}: ${Rr(n)}`)}}return t.join("; ")}var w0;var wa=L(()=>{Os();mn();Ee();vr();ks();w0=new Set(["onMount","onUnmount","onAdopted"])});function j0(e,t){let{title:r="Jx App",reactivitySrc:n,litHtmlSrc:i}=t,s=Ms(e,null,e.state??{},e.$media??{}),o=Fs(e,e.$media??{},t.projectStyle??null),a=[],c=R0(e,!1,s,a),l=[],u="",d="";if(a.length>0){for(let y of a){let g=va(y.def,y.className,[],t.rewriteSrc);l.push({content:g,path:`_islands/${y.tagName}.js`,tagName:y.tagName})}u=`<script type="importmap">
293
- {
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=rd(e.tagName,i.scope),o=Xi(e,i.scope);if(td.has(s))return`<${s}${o}>`;let a=r.preformatted===!0||ui.has(s),c=sD(e,{...i,preformatted:a},n);return`<${s}${o}>${c}</${s}>`}function sD(e,t,r){if(e.textContent!==void 0){let n=Be(e.textContent,t.scope);return n==null?"":Se(String(n))}if(e.innerHTML){let n=Be(e.innerHTML,t.scope);return n==null?e.innerHTML:String(n)}if(Array.isArray(e.children))return e.children.map((n)=>R0(n,$b(n),t,r)).join(oa(t.preformatted));return""}var O0=L(()=>{mn();wa();Ee()});function $p(e,t){let{title:r="Jx App",reactivitySrc:n=Ts,litHtmlSrc:i=Ns,modulePath:s="app.js"}=t,o=Ms(e,null,e.state??{},e.$media??{}),a=Fs(e,e.$media??{},t.projectStyle??null),c={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},l=new Map,u=new Map,d=[],h=[],m=[],y=[],g=[],b=new Map,x=e.state??{};for(let[R,j]of Object.entries(x)){if(!J(j)||Array.isArray(j)){if(he(j))h.push([R,`() => ${Zc(j)}`]);else d.push([R,j]);continue}if($r(j)){let D=j.$expression,F=Vt(D,{eventParam:"e",statePrefix:"state"});if(Ni(j))g.push(`state[${JSON.stringify(R)}] = ${sa(j,F)};`);else if(Nn(D.operator))y.push([R,{args:["state","e"],body:F}]);else h.push([R,`() => ${F}`]);continue}if(xr(j)){let D=j.parameters?Rn(j.parameters):j.arguments,{body:F}=j;if(Array.isArray(F)){let N=Lr(F,{eventParam:"e",statePrefix:"state"});if(j.parameters&&j.parameters.length>0)g.push(`state[${JSON.stringify(R)}] = ${sa(j,`(() => {
315
- ${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(aD(R,D,F,N));continue}if(j.$prototype==="Request"){d.push([R,null]),g.push(Xc(R,j));continue}if(j.$prototype==="Cookie"){d.push([R,null]),g.push(cD(R,j.name??R,j.default??null));continue}}d.push([R,j])}let _=C0(e,o,l,u,c);for(let[R,j]of l)if(!m.some(([D])=>D===R))m.push([R,j]);for(let[R,j]of u)if(!y.some(([D])=>D===R))y.push([R,j]);let P=oD(d,h,m,y,g,b,c,n,t.rewriteSrc),E=[` "@vue/reactivity": "${n}"`,` "lit-html": "${i}"`],w=t.prePaintScheme!==!1&&Object.values(e.$media??{}).some((R)=>Wr(String(R))!==null)?`<script>${Ls()}</script>
317
- `:"",k=`<!DOCTYPE html>
318
- <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:P,path:s}],html:k}}function C0(e,t,r,n,i){if(T(e))return Se(e);if(Ir(e)||Rt(e))return Se(String(e));if(!J(e))return"";let s=Ms(e,t.scope,e.state??t.scopeDefs,e.$media??t.media);if(fn(e.tagName))throw Error(`A tag chosen at creation is not supported on a dynamic page yet (candidates: ${$s(e.tagName).join(", ")}). Move the element into a component, or give it a literal tagName.`);let o=e.tagName??"div";s.preformatted=t.preformatted===!0||ui.has(o);let a=[],c=!1;if(e.textContent!==void 0){let g=e.textContent;if(cr(g)){let b=Bn(g.$ref);a.push(`:text-content="${b}"`),bp(r,b,g.$ref),c=!0}else if(he(g)){let b=`_t${i.t}`;i.t+=1,a.push(`:text-content="${b}"`),r.set(b,`() => \`${g}\``),c=!0}}for(let[g,b]of Object.entries(e)){if(!g.startsWith("on")||g==="observedAttributes")continue;let x=g.slice(2).toLowerCase();if(cr(b)){let _=Bn(b.$ref);a.push(`@${x}="${_}"`),c=!0}else if(xr(b)){let _=`_h${i.h}`;i.h+=1,a.push(`@${x}="${_}"`);let{body:P}=b;n.set(_,Array.isArray(P)?{args:["state","e"],body:Lr(P,{eventParam:"e",statePrefix:"state"})}:{args:b.parameters?Rn(b.parameters):b.arguments??["state","event"],body:P}),c=!0}else if($r(b)){let _=`_h${i.h}`;i.h+=1,a.push(`@${x}="${_}"`);let P=Vt(b.$expression,{eventParam:"e",statePrefix:"state"});n.set(_,{args:["state","e"],body:P}),c=!0}}if(J(e.style))for(let[g,b]of Object.entries(e.style)){if(g.startsWith(":")||g.startsWith(".")||g.startsWith("&")||g.startsWith("[")||g.startsWith("@"))continue;if(T0(b))continue;if(he(b)){let x=`_s${i.s}`;i.s+=1,a.push(`:style.${ar(g)}="${x}"`),r.set(x,`() => \`${b}\``),c=!0}}if(J(e.attributes)){for(let[g,b]of Object.entries(e.attributes))if(cr(b)){let x=Bn(b.$ref);a.push(`:attr.${g}="${x}"`),bp(r,x,b.$ref),c=!0}else if(he(b)){let x=`_t${i.t}`;i.t+=1,a.push(`:attr.${g}="${x}"`),r.set(x,`() => \`${b}\``),c=!0}}for(let[g,b]of Object.entries(e)){if(Mn.has(g)||g.startsWith("on")||g.startsWith("$")||g==="tagName"||g==="id"||g==="className"||g==="style"||g==="children"||g==="textContent"||g==="innerHTML"||g==="attributes")continue;if(cr(b)){let x=Bn(b.$ref);a.push(`:${ar(g)}="${x}"`),bp(r,x,b.$ref),c=!0}else if(he(b)){let x=`_t${i.t}`;i.t+=1,a.push(`:${ar(g)}="${x}"`),r.set(x,`() => \`${b}\``),c=!0}}let l=Xi(e,s.scope),u=c?" data-bind":"",d=a.length>0?` ${a.join(" ")}`:"",h="",m=e;if(m.$switch){i.needsLit=!0;let g=`_sw${i.sw}`;i.sw+=1;let b=cr(m.$switch)?`state.${Bn(m.$switch.$ref)}`:`\`${String(m.$switch)}\``,x=m.cases??{},_=Object.entries(x).filter(([,E])=>E&&!cr(E)).map(([E,w])=>`${JSON.stringify(E)}: html\`${xp(w,s.preformatted)}\``);r.set(g,`() => ({${_.join(", ")}})[String(${b})] ?? html\`\``),a.push(`:render="${g}"`);let P=` ${a.join(" ")}`;return`<${o}${l} data-bind${P}></${o}>`}if(m.textContent!==void 0&&!c){let g=Be(m.textContent,s.scope);h=g==null?"":Se(String(g))}else if(m.textContent!==void 0&&c){let g=Be(m.textContent,s.scope);h=g==null?"":Se(String(g))}else if(m.innerHTML){let g=Be(m.innerHTML,s.scope);h=g==null?m.innerHTML:String(g)}else if(lt(m.children)){i.needsLit=!0;let g=`_list${i.l}`;i.l+=1;let b=m.children,x;if(cr(b.items))x=`state.${Bn(b.items.$ref)}`;else x=JSON.stringify(b.items);let _=vp(b.map);r.set(g,`() => (${x} ?? []).map((item, index) => html\`${_}\`)`),a.push(`:render="${g}"`),c=!0;let P=" data-bind",E=` ${a.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(o))return`<${o}${l}${P}${E}>`;return`<${o}${l}${P}${E}></${o}>`}else if(Array.isArray(m.children)&&m.children.some((g)=>lt(g))){i.needsLit=!0;let g=`_children${i.l}`;i.l+=1;let b=m.children.map((_)=>xp(_,s.preformatted)).join(oa(s.preformatted," "));r.set(g,s.preformatted?`() => html\`${b}\``:`() => html\`
338
- ${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 vp(e,t=!1){if(!e)return"";if(fn(e.tagName))throw Error(`A tag chosen at creation is not supported inside a dynamic page's repeater yet (candidates: ${$s(e.tagName).join(", ")}). Move the item into a component, or give it a literal tagName.`);let r=e.tagName??"div",n=t||ui.has(r),i="";if(e.id)i+=` id="${e.id}"`;if(e.className)i+=` class="${mi(e.className)}"`;if(J(e.$props))for(let[c,l]of Object.entries(e.$props))if(cr(l))i+=` .${c}="\${${lD(l.$ref)}}"`;else if(he(l))i+=` .${c}="${mi(l)}"`;else i+=` .${c}="\${${JSON.stringify(l)}}"`;if(J(e.attributes))for(let[c,l]of Object.entries(e.attributes)){if(he(l)){i+=` ${c}="${mi(l)}"`;continue}if(Rt(l)){let u=Gi(c,l);if(u!==null)i+=u===""?` ${c}`:` ${c}="${Se(u)}"`;continue}i+=` ${c}="${Se(String(l))}"`}if(J(e.style)){let c=[];for(let[l,u]of Object.entries(e.style)){if(l.startsWith(":")||l.startsWith(".")||l.startsWith("&")||l.startsWith("[")||l.startsWith("@"))continue;if(T0(u))continue;let d=ar(l);if(he(String(u)))c.push(`${d}: ${mi(String(u))}`);else c.push(`${d}: ${u}`)}if(c.length>0)i+=` style="${c.join("; ")}"`}for(let[c,l]of Object.entries(e)){if(!c.startsWith("on")||c==="observedAttributes")continue;let u=c.slice(2).toLowerCase();if(cr(l)){let d=Bn(l.$ref);i+=` @${u}=\${(e) => { state.$map = { item, index }; on.${d}(e); }}`}else if(Zn(l)){let d=Lr(l.body,{eventParam:"e",statePrefix:"state"});i+=` @${u}=\${(e) => { state.$map = { item, index }; ${d} }}`}else if(xr(l)){let d=mi(l.body);i+=` @${u}=\${(e) => { ${d} }}`}else if(J(l)&&"$expression"in l){let d=Vt(l.$expression,{eventParam:"e",statePrefix:"state"});i+=` @${u}=\${(e) => { state.$map = { item, index }; ${d}; }}`}}if(e.contentEditable)i+=` contenteditable="${e.contentEditable}"`;let s=r.includes("-")?Js:"",o="";if(e.textContent!==void 0){let c=String(e.textContent);if(he(c))o=`${mi(c)}${s}`;else if(cr(e.textContent))o=`\${state.${Bn(e.textContent.$ref)}}${s}`;else o=Se(c)}else if(e.innerHTML)o=mi(String(e.innerHTML));else if(lt(e.children))o=`
340
- ${I0(e.children)}${s}
341
- `;else if(Array.isArray(e.children)){let c=e.children.map((l)=>{let u=xp(l,n);return lt(l)||T(l)&&he(l)?`${u}${s}`:u});o=n?c.join(""):`
342
- ${c.join(`
343
- `)}
344
- `}if(new Set(["input","br","hr","img","meta","link"]).has(r))return`<${r}${i}>`;return`<${r}${i}>${o}</${r}>`}function xp(e,t=!1){if(T(e))return he(e)?mi(e):Se(e);if(Ir(e)||Rt(e))return Se(String(e));if(lt(e))return I0(e);return vp(e,t)}function I0(e){let{items:t}=e,r=cr(t)?`state.${Bn(t.$ref)}`:JSON.stringify(t??[]),n=vp(e.map);return`\${(${r} ?? []).map((item, index) => html\`${n}\`)}`}function mi(e){return e.replaceAll("$map.","")}function oD(e,t,r,n,i,s,o,a,c){let l=[],{needsLit:u}=o,d=t.length>0;l.push("// Generated by @jxsuite/compiler — do not edit manually");let h=["reactive","effect"];if(d)h.push("computed");if(l.push(`import { ${h.join(", ")} } from '@vue/reactivity';`),u)l.push("import { html, render } from 'lit-html';");for(let[m,y]of s){let g=c?c(m):m;l.push(`import { ${[...y].join(", ")} } from '${g}';`)}l.push("",el(),"","const state = reactive({");for(let[m,y]of e)l.push(` ${Ps(m)}: ${JSON.stringify(y)},`);if(l.push("});",""),i.length>0){for(let m of i)l.push(m);l.push("")}if(t.length>0){for(let[m,y]of t)l.push(`${Ie("state",Ct(m))} = computed(${y});`);l.push("")}if(r.length>0){l.push("const bind = {");for(let[m,y]of r)l.push(` ${Ps(m)}: ${y},`);l.push("};")}else l.push("const bind = {};");if(l.push(""),n.length>0){l.push("const on = {");for(let[m,y]of n){let g=y.args??["state"],b=g.map((x)=>x==="state"?"state":"e").join(", ");l.push(` ${Ps(m)}: (e) => { const fn = (${g.join(", ")}) => { ${y.body} }; fn(${b}); },`)}l.push("};")}else l.push("const on = {};");if(l.push("","function hydrate(root) {"," root.querySelectorAll('[data-bind]').forEach(el => {"," [...el.attributes].forEach(a => {"," if (a.name.startsWith(':')) {"," const parts = a.name.slice(1).split('.');"," const key = a.value;"),u)l.push(" if (parts[0] === 'render') {"," effect(() => { render(bind[key](), el); });"," } else if (parts[0] === 'style' && parts.length > 1) {");else l.push(" if (parts[0] === 'style' && parts.length > 1) {");return l.push(" effect(() => { el.style[parts[1]] = bind[key](); });"," } else if (parts[0] === 'attr' && parts.length > 1) {"," effect(() => {",` const _t = ${Ds}(parts[1], bind[key]());`," if (_t === null) { el.removeAttribute(parts[1]); }"," else { el.setAttribute(parts[1], _t); }"," });"," } else {"," const prop = parts[0].replace(/-([a-z])/g, (_, c) => c.toUpperCase());"," effect(() => { el[prop] = bind[key](); });"," }"," } else if (a.name.startsWith('@')) {"," el.addEventListener(a.name.slice(1), on[a.value]);"," }"," });"," });","}","","hydrate(document);",""),l.join(`
345
- `)}function aD(e,t,r,n){return[`// ${e}: ${t} (key: "${r}")`,"try {",` const _s = ${t}.getItem(${JSON.stringify(r)});`,` state.${e} = _s !== null ? JSON.parse(_s) : ${JSON.stringify(n)};`,`} catch { state.${e} = ${JSON.stringify(n)}; }`,"effect(() => {",` const v = state.${e};`," try {",` if (v === null) ${t}.removeItem(${JSON.stringify(r)});`,` else ${t}.setItem(${JSON.stringify(r)}, JSON.stringify(v));`," } catch {}","});"].join(`
346
- `)}function cD(e,t,r){return[`// ${e}: Cookie (name: "${t}")`,"{",` const _m = document.cookie.match(new RegExp("(?:^|; )${t}=([^;]*)"));`,` try { state.${e} = _m ? JSON.parse(decodeURIComponent(_m[1])) : ${JSON.stringify(r)}; }`,` catch { state.${e} = _m ? _m[1] : ${JSON.stringify(r)}; }`,"}"].join(`
347
- `)}function T0(e){return e===null||J(e)}function lD(e){if(e.startsWith("$map/")){let[t,...r]=ai(e.slice(5));return Ie(t??"",r.map((n)=>Ct(n)).join("/"))}if(e.startsWith("#/state/"))return Ie("state",e.slice(8));return Ie("state",e)}function Bn(e){return eb(e.startsWith("#/state/")?e.slice(8):e)}function bp(e,t,r){if(e.has(t))return;e.set(t,`() => ${Ie("state",r.startsWith("#/state/")?r.slice(8):r)}`)}var wp=L(()=>{Os();mn();Ee();ks()});function M0(e){let t=e.title;if(!t)throw Error("compileClassJson: missing title (class name)");let r=fD(e.extends),n=e.$defs,i=n?.fields??{},s=n?.constructor,o=uD(s)?s:void 0,a=n?.methods??{},c=["// Generated by @jxsuite/compiler from .class.json — do not edit manually"];if(e.$id)c.push(`// Source: ${e.$id}`);c.push("");let l=r!=="Object"?` extends ${r}`:"";c.push(`class ${t}${l} {`);for(let[u,d]of Object.entries(i)){if(d.scope!=="static")continue;let h=d.identifier??u,m=d.access==="private"?"#":"",y=d.initializer!==void 0?JSON.stringify(d.initializer):d.default!==void 0?JSON.stringify(d.default):"null";c.push(` static ${m}${h} = ${y};`)}for(let[u,d]of Object.entries(i)){if(d.scope==="static")continue;if(d.access!=="private")continue;let h=d.identifier??u;c.push(` #${h};`)}if(Object.keys(i).length>0)c.push("");if(c.push(" constructor(config = {}) {"),o?.superCall||r!=="Object"){let u=o?.superCall?.arguments?o.superCall.arguments.join(", "):"";c.push(` super(${u});`)}for(let[u,d]of Object.entries(i)){if(d.scope==="static")continue;let h=d.identifier??u,m=d.access==="private"?"#":"",y=d.initializer!==void 0?JSON.stringify(d.initializer):d.default!==void 0?JSON.stringify(d.default):"null";c.push(` this.${m}${h} = config.${h} !== undefined ? config.${h} : ${y};`)}if(o?.body){let u=Array.isArray(o.body)?o.body:[o.body];for(let d of u)c.push(` ${d}`)}c.push(" }");for(let[u,d]of Object.entries(a)){let h=d.identifier??u,m=d.scope==="static",g=d.access==="private"?"#":"",b=m?"static ":"",x=d.returnType?.$ref?.includes("Promise")||pD(d)?"async ":"",_=N0(d.parameters??[]),P=dD(d.body);if(c.push(""),d.role==="accessor"){if(d.getter)c.push(` ${b}get ${g}${h}() {`,` ${d.getter.body}`," }");if(d.setter){let E=N0(d.setter.parameters??[]);c.push(` ${b}set ${g}${h}(${E}) {`,` ${d.setter.body}`," }")}}else{c.push(` ${b}${x}${g}${h}(${_}) {`);for(let E of P)c.push(` ${E}`);c.push(" }")}}return c.push("}","",`export { ${t} };`,`export default ${t};`,""),c.join(`
348
- `)}function uD(e){return typeof e==="object"}function fD(e){if(!e)return"Object";if(T(e))return e;if(e.$ref){let t=e.$ref.match(/([A-Za-z0-9_]+)\.class\.json/);return t?t[1]:"Object"}return"Object"}function N0(e){return e.map((t)=>{if(t.$ref)return t.$ref.split("/").pop();let r=t.identifier??t.name;return T(r)?r:"arg"}).join(", ")}function dD(e){if(!e)return[""];return Array.isArray(e)?e:[e]}function pD(e){return(Array.isArray(e.body)?e.body.join(`
349
- `):e.body??"").includes("await ")}var L0=L(()=>{Ee()});import{readFileSync as mD}from"node:fs";async function Sp(e,t={}){let{title:r="Jx App",reactivitySrc:n=Ts,litHtmlSrc:i=Ns,projectStyle:s=null}=t,o;if(T(e)){let a=mD(e,"utf8");if(e.endsWith(".json"))o=ti(a,e);else{let{extname:c}=await import("node:path"),l=c(e).toLowerCase(),u=t.formats?.byExtension(l,"parse");if(!u){await Promise.resolve().then(() => On());throw _c(e,l)}o=await u.parseDocument(a)}}else o=e;if(Eg(o)){await Promise.resolve().then(() => L0());let c=M0(o),l=T(e)?e.replace(/\.class\.json$/,".js"):`${o.title}.js`;return{files:[{content:c,path:l}],html:""}}if(!Qc(o))return j0(o,{litHtmlSrc:i,projectStyle:s,reactivitySrc:n,...D0(t),title:r});if(o.tagName&&o.tagName.includes("-")){let{tagName:a}=o,c=rl(a),u={content:va(o,c,[],t.rewriteSrc),path:`${a}.js`,tagName:a},d=Fs(o,o.$media??{},s),h=`<!DOCTYPE html>
350
- <html lang="en">
351
- <head>
352
- <meta charset="utf-8">
353
- <meta name="viewport" content="width=device-width, initial-scale=1">
354
- <title>${Se(r)}</title>
355
- <script type="importmap">
356
- {
357
- "imports": {
358
- "@vue/reactivity": "${n}",
359
- "lit-html": "${i}"
360
- }
361
- }
362
- </script>
363
- ${d}
364
- </head>
365
- <body>
366
- <${a}></${a}>
367
- <script type="module" src="./${a}.js"></script>
368
- </body>
369
- </html>`;return{files:[u],html:h}}return $p(o,{litHtmlSrc:i,projectStyle:s,reactivitySrc:n,...D0(t),title:r})}function D0(e){let t={};if(e.prePaintScheme===!1)t.prePaintScheme=!1;if(e.rewriteSrc)t.rewriteSrc=e.rewriteSrc;return t}async function Rre(e,t){let[r,n]=await Promise.all([Sp(e),$a(e)]),{writeFileSync:i,mkdirSync:s}=await import("node:fs"),{dirname:o,join:a}=await import("node:path");if(t){i(t,r.html,"utf8"),console.error(`Written to ${t}`);let c=o(t);for(let l of r.files){let u=a(c,l.path);s(o(u),{recursive:!0}),i(u,l.content,"utf8"),console.error(`Written to ${u}`)}}else process.stdout.write(r.html);if(n&&t){let c=t.replace(/(\.[^.]+)?$/,"-server.js");i(c,n,"utf8"),console.error(`Server handler written to ${c}`)}}var J0=L(()=>{mn();hp();wa();O0();wp();Ee();vr();mn();hp();wa();wp()});import{readFileSync as hD}from"node:fs";import{dirname as Ep,resolve as Tl}from"node:path";import{createRequire as gD}from"node:module";function xD(e){return Ot(e.resolve)}async function F0(e,t,r,n={}){let i=e.imports??{},{state:s}=e;if(!s)return;for(let[o,a]of Object.entries(s)){if(!un(a))continue;if(yD.has(a.$prototype))continue;if(a.timing&&a.timing!=="compiler"){let c=n.registry?.byName(a.$prototype);if(c?.capabilities.lower)try{let l=await c.call("lower",a,{projectConfig:n.config,root:r,route:t});if(ee(l)){let u=l.$bundle;if(Array.isArray(u)){for(let d of u)if(T(d))n.registerBundle?.(d)}delete l.$bundle}s[o]=l}catch(l){console.warn(`prototype-resolver: failed to lower "${o}" ($prototype: "${a.$prototype}"):`,Pe(l))}continue}if(!a.$src){let c=i[a.$prototype]??$D(n,a.$prototype);if(!c)continue;a.$src=c}try{let c=await vD(a,t,r,s,n);if(a.timing&&ee(c))c.timing=a.timing;s[o]=c}catch(c){console.warn(`prototype-resolver: failed to resolve "${o}" ($prototype: "${a.$prototype}"):`,Pe(c))}}}function $D(e,t){return e.registry?.byName(t)?.classPath}async function vD(e,t,r,n,i){let s=e.$src;if(!s)throw Error(`$prototype "${e.$prototype}" has no $src to resolve`);let o;if(s.startsWith("./")||s.startsWith("../"))o=t.sourcePath?Tl(Ep(t.sourcePath),s):Tl(r,s);else o=gD(Tl(r,"package.json")).resolve(s);let a=hD(o,"utf8"),c=Ig(a,o);if(!c.$implementation)throw Error(`${s} has no $implementation field`);let l=Tl(Ep(o),c.$implementation),u=await pf(l),d=e.$export??c.title??e.$prototype,h=u[d]??u.default?.[d];if(!h)throw Error(`Module ${c.$implementation} does not export "${d}"`);let m={};for(let[g,b]of Object.entries(e))if(!bD.has(g))m[g]=b;if(m.src&&!m.basePath&&t.sourcePath)m.basePath=Ep(t.sourcePath);m._project={config:i.config??null,root:r,...i.sections},m._document={route:t,state:n};let y=new h(m);if(xD(y))return await y.resolve();return y}var yD,bD;var q0=L(()=>{On();Ee();vr();yD=new Set(["Function","LocalStorage","SessionStorage","Array"]),bD=new Set(["$prototype","$src","$export","timing","default","description"])});var B0=(e)=>typeof e<"u"&&e!==null,wD=(e)=>typeof e==="object",SD=(e)=>Object.prototype.toString.call(e)==="[object Object]",ED=(e)=>typeof e==="function",_D=(e)=>typeof e==="boolean",PD=(e)=>e instanceof Buffer,kD=(e)=>{if(B0(e))switch(e.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},AD=(e)=>e instanceof ArrayBuffer,jD=(e)=>typeof e==="string"&&e.length>0,RD=(e)=>typeof e==="number"&&Number.isFinite(e),OD=(e)=>Number.isInteger(e),CD=(e,t,r)=>e>=t&&e<=r,ID=(e,t)=>t.includes(e),TD=(e,t,r)=>{let n;try{n=String(r).slice(0,100)}catch{}return Error(`Expected ${t} for ${e} but received ${n} of type ${typeof r}`)},ND=(e,t)=>(t.message=e.message,t),f;var gn=L(()=>{/*!
328
+ </html>`;return{files:[p],html:m}}let a={litHtmlSrc:s,projectStyle:i,reactivitySrc:n,...by(t),title:r};if(t.serverBaseUrl!==void 0)a.serverBaseUrl=t.serverBaseUrl;return Fu(o,a)}function by(e){let t={};if(e.prePaintScheme===!1)t.prePaintScheme=!1;if(e.rewriteSrc)t.rewriteSrc=e.rewriteSrc;return t}async function G9(e,t){let r=await Wu(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 xy=q(()=>{Mr();lo();uy();Hu();ve();rr();Mr();Bu();lo();Hu()});import{readFileSync as FO}from"node:fs";import{dirname as Uu,resolve as el}from"node:path";import{createRequire as qO}from"node:module";function BO(e){return vt(e.resolve)}async function $y(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(HO.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(T(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]??WO(n,a.$prototype);if(!l)continue;a.$src=l}try{let l=await UO(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 WO(e,t){return e.registry?.byName(t)?.classPath}async function UO(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?el(Uu(t.sourcePath),i):el(r,i);else o=qO(el(r,"package.json")).resolve(i);let a=FO(o,"utf8"),l=nm(a,o);if(!l.$implementation)throw Error(`${i} has no $implementation field`);let c=el(Uu(o),l.$implementation),d=await Oc(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(!VO.has(g))m[g]=y;if(m.src&&!m.basePath&&t.sourcePath)m.basePath=Uu(t.sourcePath);m._project={config:s.config??null,root:r,...s.sections},m._document={route:t,state:n};let b=new h(m);if(BO(b))return await b.resolve();return b}var HO,VO;var vy=q(()=>{nn();ve();rr();HO=new Set(["Function","LocalStorage","SessionStorage","Array"]),VO=new Set(["$prototype","$src","$export","timing","default","description"])});var wy=(e)=>typeof e<"u"&&e!==null,zO=(e)=>typeof e==="object",GO=(e)=>Object.prototype.toString.call(e)==="[object Object]",KO=(e)=>typeof e==="function",YO=(e)=>typeof e==="boolean",XO=(e)=>e instanceof Buffer,ZO=(e)=>{if(wy(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},QO=(e)=>e instanceof ArrayBuffer,eC=(e)=>typeof e==="string"&&e.length>0,tC=(e)=>typeof e==="number"&&Number.isFinite(e),rC=(e)=>Number.isInteger(e),nC=(e,t,r)=>e>=t&&e<=r,sC=(e,t)=>t.includes(e),iC=(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}`)},oC=(e,t)=>(t.message=e.message,t),u;var Dr=q(()=>{/*!
370
329
  Copyright 2013 Lovell Fuller and others.
371
330
  SPDX-License-Identifier: Apache-2.0
372
- */f={defined:B0,object:wD,plainObject:SD,fn:ED,bool:_D,buffer:PD,typedArray:kD,arrayBuffer:AD,string:jD,number:RD,integer:OD,inRange:CD,inArray:ID,invalidParameterError:TD,nativeError:ND}});var V0=C(function(Ure,U0){var H0=()=>process.platform==="linux",Nl=null,MD=()=>{if(!Nl)if(H0()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,Nl=process.report.getReport(),process.report.excludeNetwork=e}else Nl={};return Nl};U0.exports={isLinux:H0,getReport:MD}});var z0=C(function(Vre,W0){var so=De("fs"),LD=(e)=>{let t=so.openSync(e,"r"),r=Buffer.alloc(2048),n=so.readSync(t,r,0,2048,0);return so.close(t,()=>{}),r.subarray(0,n)},DD=(e)=>new Promise((t,r)=>{so.open(e,"r",(n,i)=>{if(n)r(n);else{let s=Buffer.alloc(2048);so.read(i,s,0,2048,0,(o,a)=>{t(s.subarray(0,a)),so.close(i,()=>{})})}})});W0.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:LD,readFile:DD}});var G0=C(function(Wre,K0){var JD=(e)=>{if(e.length<64)return null;if(e.readUInt32BE(0)!==2135247942)return null;if(e.readUInt8(4)!==2)return null;if(e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),r=e.readUInt16LE(54),n=e.readUInt16LE(56);for(let i=0;i<n;i++){let s=t+i*r;if(e.readUInt32LE(s)===3){let a=e.readUInt32LE(s+8),c=e.readUInt32LE(s+32);return e.subarray(a,a+c).toString().replace(/\0.*$/g,"")}}return null};K0.exports={interpreterPath:JD}});var Ll=C(function(zre,dv){var X0=De("child_process"),{isLinux:oo,getReport:Q0}=V0(),{LDD_PATH:Ml,SELF_PATH:Z0,readFile:_p,readFileSync:Pp}=z0(),{interpreterPath:ev}=G0(),yn,bn,xn,hi="",tv=()=>{if(!hi)return new Promise((e)=>{X0.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(t,r)=>{hi=t?" ":r,e(hi)})});return hi},rv=()=>{if(!hi)try{hi=X0.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(e){hi=" "}return hi},Hn="glibc",nv=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,ss="musl",FD=(e)=>e.includes("libc.musl-")||e.includes("ld-musl-"),iv=()=>{let e=Q0();if(e.header&&e.header.glibcVersionRuntime)return Hn;if(Array.isArray(e.sharedObjects)){if(e.sharedObjects.some(FD))return ss}return null},sv=(e)=>{let[t,r]=e.split(/[\r\n]+/);if(t&&t.includes(Hn))return Hn;if(r&&r.includes(ss))return ss;return null},ov=(e)=>{if(e){if(e.includes("/ld-musl-"))return ss;else if(e.includes("/ld-linux-"))return Hn}return null},av=(e)=>{if(e=e.toString(),e.includes("musl"))return ss;if(e.includes("GNU C Library"))return Hn;return null},qD=async()=>{if(bn!==void 0)return bn;bn=null;try{let e=await _p(Ml);bn=av(e)}catch(e){}return bn},BD=()=>{if(bn!==void 0)return bn;bn=null;try{let e=Pp(Ml);bn=av(e)}catch(e){}return bn},HD=async()=>{if(yn!==void 0)return yn;yn=null;try{let e=await _p(Z0),t=ev(e);yn=ov(t)}catch(e){}return yn},UD=()=>{if(yn!==void 0)return yn;yn=null;try{let e=Pp(Z0),t=ev(e);yn=ov(t)}catch(e){}return yn},cv=async()=>{let e=null;if(oo()){if(e=await HD(),!e){if(e=await qD(),!e)e=iv();if(!e){let t=await tv();e=sv(t)}}}return e},lv=()=>{let e=null;if(oo()){if(e=UD(),!e){if(e=BD(),!e)e=iv();if(!e){let t=rv();e=sv(t)}}}return e},VD=async()=>oo()&&await cv()!==Hn,WD=()=>oo()&&lv()!==Hn,zD=async()=>{if(xn!==void 0)return xn;xn=null;try{let t=(await _p(Ml)).match(nv);if(t)xn=t[1]}catch(e){}return xn},KD=()=>{if(xn!==void 0)return xn;xn=null;try{let t=Pp(Ml).match(nv);if(t)xn=t[1]}catch(e){}return xn},uv=()=>{let e=Q0();if(e.header&&e.header.glibcVersionRuntime)return e.header.glibcVersionRuntime;return null},Y0=(e)=>e.trim().split(/\s+/)[1],fv=(e)=>{let[t,r,n]=e.split(/[\r\n]+/);if(t&&t.includes(Hn))return Y0(t);if(r&&n&&r.includes(ss))return Y0(n);return null},GD=async()=>{let e=null;if(oo()){if(e=await zD(),!e)e=uv();if(!e){let t=await tv();e=fv(t)}}return e},YD=()=>{let e=null;if(oo()){if(e=KD(),!e)e=uv();if(!e){let t=rv();e=fv(t)}}return e};dv.exports={GLIBC:Hn,MUSL:ss,family:cv,familySync:lv,isNonGlibcLinux:VD,isNonGlibcLinuxSync:WD,version:GD,versionSync:YD}});var ao=C(function(Kre,pv){var XD=Number.MAX_SAFE_INTEGER||9007199254740991,QD=["major","premajor","minor","preminor","patch","prepatch","prerelease"];pv.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:XD,RELEASE_TYPES:QD,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Sa=C(function(Gre,mv){var ZD=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};mv.exports=ZD});var co=C(function($n,hv){var{MAX_SAFE_COMPONENT_LENGTH:kp,MAX_SAFE_BUILD_LENGTH:eJ,MAX_LENGTH:tJ}=ao(),rJ=Sa();$n=hv.exports={};var nJ=$n.re=[],iJ=$n.safeRe=[],Y=$n.src=[],sJ=$n.safeSrc=[],X=$n.t={},oJ=0,Ap="[a-zA-Z0-9-]",aJ=[["\\s",1],["\\d",tJ],[Ap,eJ]],cJ=(e)=>{for(let[t,r]of aJ)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},xe=(e,t,r)=>{let n=cJ(t),i=oJ++;rJ(e,i,t),X[e]=i,Y[i]=t,sJ[i]=n,nJ[i]=new RegExp(t,r?"g":void 0),iJ[i]=new RegExp(n,r?"g":void 0)};xe("NUMERICIDENTIFIER","0|[1-9]\\d*");xe("NUMERICIDENTIFIERLOOSE","\\d+");xe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ap}*`);xe("MAINVERSION",`(${Y[X.NUMERICIDENTIFIER]})\\.(${Y[X.NUMERICIDENTIFIER]})\\.(${Y[X.NUMERICIDENTIFIER]})`);xe("MAINVERSIONLOOSE",`(${Y[X.NUMERICIDENTIFIERLOOSE]})\\.(${Y[X.NUMERICIDENTIFIERLOOSE]})\\.(${Y[X.NUMERICIDENTIFIERLOOSE]})`);xe("PRERELEASEIDENTIFIER",`(?:${Y[X.NONNUMERICIDENTIFIER]}|${Y[X.NUMERICIDENTIFIER]})`);xe("PRERELEASEIDENTIFIERLOOSE",`(?:${Y[X.NONNUMERICIDENTIFIER]}|${Y[X.NUMERICIDENTIFIERLOOSE]})`);xe("PRERELEASE",`(?:-(${Y[X.PRERELEASEIDENTIFIER]}(?:\\.${Y[X.PRERELEASEIDENTIFIER]})*))`);xe("PRERELEASELOOSE",`(?:-?(${Y[X.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Y[X.PRERELEASEIDENTIFIERLOOSE]})*))`);xe("BUILDIDENTIFIER",`${Ap}+`);xe("BUILD",`(?:\\+(${Y[X.BUILDIDENTIFIER]}(?:\\.${Y[X.BUILDIDENTIFIER]})*))`);xe("FULLPLAIN",`v?${Y[X.MAINVERSION]}${Y[X.PRERELEASE]}?${Y[X.BUILD]}?`);xe("FULL",`^${Y[X.FULLPLAIN]}$`);xe("LOOSEPLAIN",`[v=\\s]*${Y[X.MAINVERSIONLOOSE]}${Y[X.PRERELEASELOOSE]}?${Y[X.BUILD]}?`);xe("LOOSE",`^${Y[X.LOOSEPLAIN]}$`);xe("GTLT","((?:<|>)?=?)");xe("XRANGEIDENTIFIERLOOSE",`${Y[X.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);xe("XRANGEIDENTIFIER",`${Y[X.NUMERICIDENTIFIER]}|x|X|\\*`);xe("XRANGEPLAIN",`[v=\\s]*(${Y[X.XRANGEIDENTIFIER]})(?:\\.(${Y[X.XRANGEIDENTIFIER]})(?:\\.(${Y[X.XRANGEIDENTIFIER]})(?:${Y[X.PRERELEASE]})?${Y[X.BUILD]}?)?)?`);xe("XRANGEPLAINLOOSE",`[v=\\s]*(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:${Y[X.PRERELEASELOOSE]})?${Y[X.BUILD]}?)?)?`);xe("XRANGE",`^${Y[X.GTLT]}\\s*${Y[X.XRANGEPLAIN]}$`);xe("XRANGELOOSE",`^${Y[X.GTLT]}\\s*${Y[X.XRANGEPLAINLOOSE]}$`);xe("COERCEPLAIN",`(^|[^\\d])(\\d{1,${kp}})(?:\\.(\\d{1,${kp}}))?(?:\\.(\\d{1,${kp}}))?`);xe("COERCE",`${Y[X.COERCEPLAIN]}(?:$|[^\\d])`);xe("COERCEFULL",Y[X.COERCEPLAIN]+`(?:${Y[X.PRERELEASE]})?(?:${Y[X.BUILD]})?(?:$|[^\\d])`);xe("COERCERTL",Y[X.COERCE],!0);xe("COERCERTLFULL",Y[X.COERCEFULL],!0);xe("LONETILDE","(?:~>?)");xe("TILDETRIM",`(\\s*)${Y[X.LONETILDE]}\\s+`,!0);$n.tildeTrimReplace="$1~";xe("TILDE",`^${Y[X.LONETILDE]}${Y[X.XRANGEPLAIN]}$`);xe("TILDELOOSE",`^${Y[X.LONETILDE]}${Y[X.XRANGEPLAINLOOSE]}$`);xe("LONECARET","(?:\\^)");xe("CARETTRIM",`(\\s*)${Y[X.LONECARET]}\\s+`,!0);$n.caretTrimReplace="$1^";xe("CARET",`^${Y[X.LONECARET]}${Y[X.XRANGEPLAIN]}$`);xe("CARETLOOSE",`^${Y[X.LONECARET]}${Y[X.XRANGEPLAINLOOSE]}$`);xe("COMPARATORLOOSE",`^${Y[X.GTLT]}\\s*(${Y[X.LOOSEPLAIN]})$|^$`);xe("COMPARATOR",`^${Y[X.GTLT]}\\s*(${Y[X.FULLPLAIN]})$|^$`);xe("COMPARATORTRIM",`(\\s*)${Y[X.GTLT]}\\s*(${Y[X.LOOSEPLAIN]}|${Y[X.XRANGEPLAIN]})`,!0);$n.comparatorTrimReplace="$1$2$3";xe("HYPHENRANGE",`^\\s*(${Y[X.XRANGEPLAIN]})\\s+-\\s+(${Y[X.XRANGEPLAIN]})\\s*$`);xe("HYPHENRANGELOOSE",`^\\s*(${Y[X.XRANGEPLAINLOOSE]})\\s+-\\s+(${Y[X.XRANGEPLAINLOOSE]})\\s*$`);xe("STAR","(<|>)?=?\\s*\\*");xe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");xe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Dl=C(function(Yre,gv){var lJ=Object.freeze({loose:!0}),uJ=Object.freeze({}),fJ=(e)=>{if(!e)return uJ;if(typeof e!=="object")return lJ;return e};gv.exports=fJ});var jp=C(function(Xre,xv){var yv=/^[0-9]+$/,bv=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=yv.test(e),n=yv.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},dJ=(e,t)=>bv(t,e);xv.exports={compareIdentifiers:bv,rcompareIdentifiers:dJ}});var Pt=C(function(Qre,vv){var Jl=Sa(),{MAX_LENGTH:$v,MAX_SAFE_INTEGER:Fl}=ao(),{safeRe:ql,t:Bl}=co(),pJ=Dl(),{compareIdentifiers:Rp}=jp(),mJ=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(Rp(e[n],r[n])!==0)return!1;return!0};class Zr{constructor(e,t){if(t=pJ(t),e instanceof Zr)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>$v)throw TypeError(`version is longer than ${$v} characters`);Jl("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?ql[Bl.LOOSE]:ql[Bl.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Fl||this.major<0)throw TypeError("Invalid major version");if(this.minor>Fl||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Fl||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let i=+n;if(i>=0&&i<Fl)return i}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(Jl("SemVer.compare",this.version,this.options,e),!(e instanceof Zr)){if(typeof e==="string"&&e===this.version)return 0;e=new Zr(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof Zr))e=new Zr(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof Zr))e=new Zr(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(Jl("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return Rp(r,n)}while(++t)}compareBuild(e){if(!(e instanceof Zr))e=new Zr(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(Jl("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return Rp(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?ql[Bl.PRERELEASELOOSE]:ql[Bl.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let i=this.prerelease.length;while(--i>=0)if(typeof this.prerelease[i]==="number")this.prerelease[i]++,i=-2;if(i===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let i=[t,n];if(r===!1)i=[t];if(mJ(this.prerelease,t)){let s=this.prerelease[t.split(".").length];if(isNaN(s))this.prerelease=i}else this.prerelease=i}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}vv.exports=Zr});var gi=C(function(Zre,Sv){var wv=Pt(),hJ=(e,t,r=!1)=>{if(e instanceof wv)return e;try{return new wv(e,t)}catch(n){if(!r)return null;throw n}};Sv.exports=hJ});var _v=C(function(ene,Ev){var gJ=gi(),yJ=(e,t)=>{let r=gJ(e,t);return r?r.version:null};Ev.exports=yJ});var kv=C(function(tne,Pv){var bJ=gi(),xJ=(e,t)=>{let r=bJ(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Pv.exports=xJ});var Rv=C(function(rne,jv){var Av=Pt(),$J=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new Av(e instanceof Av?e.version:e,r).inc(t,n,i).version}catch(s){return null}};jv.exports=$J});var Iv=C(function(nne,Cv){var Ov=gi(),vJ=(e,t)=>{let r=Ov(e,null,!0),n=Ov(t,null,!0),i=r.compare(n);if(i===0)return null;let s=i>0,o=s?r:n,a=s?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let u=c?"pre":"";if(r.major!==n.major)return u+"major";if(r.minor!==n.minor)return u+"minor";if(r.patch!==n.patch)return u+"patch";return"prerelease"};Cv.exports=vJ});var Nv=C(function(ine,Tv){var wJ=Pt(),SJ=(e,t)=>new wJ(e,t).major;Tv.exports=SJ});var Lv=C(function(sne,Mv){var EJ=Pt(),_J=(e,t)=>new EJ(e,t).minor;Mv.exports=_J});var Jv=C(function(one,Dv){var PJ=Pt(),kJ=(e,t)=>new PJ(e,t).patch;Dv.exports=kJ});var qv=C(function(ane,Fv){var AJ=gi(),jJ=(e,t)=>{let r=AJ(e,t);return r&&r.prerelease.length?r.prerelease:null};Fv.exports=jJ});var Dr=C(function(cne,Hv){var Bv=Pt(),RJ=(e,t,r)=>new Bv(e,r).compare(new Bv(t,r));Hv.exports=RJ});var Vv=C(function(lne,Uv){var OJ=Dr(),CJ=(e,t,r)=>OJ(t,e,r);Uv.exports=CJ});var zv=C(function(une,Wv){var IJ=Dr(),TJ=(e,t)=>IJ(e,t,!0);Wv.exports=TJ});var Hl=C(function(fne,Gv){var Kv=Pt(),NJ=(e,t,r)=>{let n=new Kv(e,r),i=new Kv(t,r);return n.compare(i)||n.compareBuild(i)};Gv.exports=NJ});var Xv=C(function(dne,Yv){var MJ=Hl(),LJ=(e,t)=>e.sort((r,n)=>MJ(r,n,t));Yv.exports=LJ});var Zv=C(function(pne,Qv){var DJ=Hl(),JJ=(e,t)=>e.sort((r,n)=>DJ(n,r,t));Qv.exports=JJ});var Ea=C(function(mne,ew){var FJ=Dr(),qJ=(e,t,r)=>FJ(e,t,r)>0;ew.exports=qJ});var Ul=C(function(hne,tw){var BJ=Dr(),HJ=(e,t,r)=>BJ(e,t,r)<0;tw.exports=HJ});var Op=C(function(gne,rw){var UJ=Dr(),VJ=(e,t,r)=>UJ(e,t,r)===0;rw.exports=VJ});var Cp=C(function(yne,nw){var WJ=Dr(),zJ=(e,t,r)=>WJ(e,t,r)!==0;nw.exports=zJ});var Vl=C(function(bne,iw){var KJ=Dr(),GJ=(e,t,r)=>KJ(e,t,r)>=0;iw.exports=GJ});var Wl=C(function(xne,sw){var YJ=Dr(),XJ=(e,t,r)=>YJ(e,t,r)<=0;sw.exports=XJ});var Ip=C(function($ne,ow){var QJ=Op(),ZJ=Cp(),eF=Ea(),tF=Vl(),rF=Ul(),nF=Wl(),iF=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return QJ(e,r,n);case"!=":return ZJ(e,r,n);case">":return eF(e,r,n);case">=":return tF(e,r,n);case"<":return rF(e,r,n);case"<=":return nF(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};ow.exports=iF});var cw=C(function(vne,aw){var sF=Pt(),oF=gi(),{safeRe:zl,t:Kl}=co(),aF=(e,t)=>{if(e instanceof sF)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?zl[Kl.COERCEFULL]:zl[Kl.COERCE]);else{let c=t.includePrerelease?zl[Kl.COERCERTLFULL]:zl[Kl.COERCERTL],l;while((l=c.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||l.index+l[0].length!==r.index+r[0].length)r=l;c.lastIndex=l.index+l[1].length+l[2].length}c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",s=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return oF(`${n}.${i}.${s}${o}${a}`,t)};aw.exports=aF});var uw=C(function(wne,lw){var cF=gi(),lF=ao(),uF=Pt(),fF=(e,t,r)=>{if(!lF.RELEASE_TYPES.includes(t))return null;let n=dF(e,r);return n&&pF(n,t)},dF=(e,t)=>{let r=e instanceof uF?e.version:e;return cF(r,t)},pF=(e,t)=>{if(mF(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},mF=(e)=>e.startsWith("pre");lw.exports=fF});var pw=C(function(Sne,dw){class fw{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}dw.exports=fw});var Jr=C(function(Ene,yw){var hF=/\s+/g;class _a{constructor(e,t){if(t=yF(t),e instanceof _a)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new _a(e.raw,t);if(e instanceof Tp)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(hF," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!hw(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&PF(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(_F,"");let r=((this.options.includePrerelease&&SF)|(this.options.loose&&EF))+":"+e,n=mw.get(r);if(n)return n;let i=this.options.loose,s=i?Gt[kt.HYPHENRANGELOOSE]:Gt[kt.HYPHENRANGE];e=e.replace(s,LF(this.options.includePrerelease)),Ge("hyphen replace",e),e=e.replace(Gt[kt.COMPARATORTRIM],$F),Ge("comparator trim",e),e=e.replace(Gt[kt.TILDETRIM],vF),Ge("tilde trim",e),e=e.replace(Gt[kt.CARETTRIM],wF),Ge("caret trim",e);let o=e.split(" ").map((u)=>kF(u,this.options)).join(" ").split(/\s+/).map((u)=>MF(u,this.options));if(i)o=o.filter((u)=>(Ge("loose invalid filter",u,this.options),!!u.match(Gt[kt.COMPARATORLOOSE])));Ge("range list",o);let a=new Map,c=o.map((u)=>new Tp(u,this.options));for(let u of c){if(hw(u))return[u];a.set(u.value,u)}if(a.size>1&&a.has(""))a.delete("");let l=[...a.values()];return mw.set(r,l),l}intersects(e,t){if(!(e instanceof _a))throw TypeError("a Range is required");return this.set.some((r)=>gw(r,t)&&e.set.some((n)=>gw(n,t)&&r.every((i)=>n.every((s)=>i.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new bF(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(DF(this.set[t],e,this.options))return!0;return!1}}yw.exports=_a;var gF=pw(),mw=new gF,yF=Dl(),Tp=Pa(),Ge=Sa(),bF=Pt(),{safeRe:Gt,src:xF,t:kt,comparatorTrimReplace:$F,tildeTrimReplace:vF,caretTrimReplace:wF}=co(),{FLAG_INCLUDE_PRERELEASE:SF,FLAG_LOOSE:EF}=ao(),_F=new RegExp(xF[kt.BUILD],"g"),hw=(e)=>e.value==="<0.0.0-0",PF=(e)=>e.value==="",gw=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();while(r&&n.length)r=n.every((s)=>i.intersects(s,t)),i=n.pop();return r},kF=(e,t)=>(e=e.replace(Gt[kt.BUILD],""),Ge("comp",e,t),e=OF(e,t),Ge("caret",e),e=jF(e,t),Ge("tildes",e),e=IF(e,t),Ge("xrange",e),e=NF(e,t),Ge("stars",e),e),xt=(e)=>!e||e.toLowerCase()==="x"||e==="*",AF=(e,t,r)=>xt(e)&&!xt(t)||xt(t)&&r&&!xt(r),jF=(e,t)=>e.trim().split(/\s+/).map((r)=>RF(r,t)).join(" "),RF=(e,t)=>{let r=t.loose?Gt[kt.TILDELOOSE]:Gt[kt.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,a,c)=>{Ge("tilde",e,i,s,o,a,c);let l;if(xt(s))l="";else if(xt(o))l=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(xt(a))l=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else if(c)Ge("replaceTilde pr",c),l=`>=${s}.${o}.${a}-${c} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.${a} <${s}.${+o+1}.0-0`;return Ge("tilde return",l),l})},OF=(e,t)=>e.trim().split(/\s+/).map((r)=>CF(r,t)).join(" "),CF=(e,t)=>{Ge("caret",e,t);let r=t.loose?Gt[kt.CARETLOOSE]:Gt[kt.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,a,c)=>{Ge("caret",e,i,s,o,a,c);let l;if(xt(s))l="";else if(xt(o))l=`>=${s}.0.0${n} <${+s+1}.0.0-0`;else if(xt(a))if(s==="0")l=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`;else if(c)if(Ge("replaceCaret pr",c),s==="0")if(o==="0")l=`>=${s}.${o}.${a}-${c} <${s}.${o}.${+a+1}-0`;else l=`>=${s}.${o}.${a}-${c} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.${a}-${c} <${+s+1}.0.0-0`;else if(Ge("no pr"),s==="0")if(o==="0")l=`>=${s}.${o}.${a} <${s}.${o}.${+a+1}-0`;else l=`>=${s}.${o}.${a} <${s}.${+o+1}.0-0`;else l=`>=${s}.${o}.${a} <${+s+1}.0.0-0`;return Ge("caret return",l),l})},IF=(e,t)=>(Ge("replaceXRanges",e,t),e.split(/\s+/).map((r)=>TF(r,t)).join(" ")),TF=(e,t)=>{e=e.trim();let r=t.loose?Gt[kt.XRANGELOOSE]:Gt[kt.XRANGE];return e.replace(r,(n,i,s,o,a,c)=>{if(Ge("xRange",e,n,i,s,o,a,c),AF(s,o,a))return e;let l=xt(s),u=l||xt(o),d=u||xt(a),h=d;if(i==="="&&h)i="";if(c=t.includePrerelease?"-0":"",l)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&h){if(u)o=0;if(a=0,i===">")if(i=">=",u)s=+s+1,o=0,a=0;else o=+o+1,a=0;else if(i==="<=")if(i="<",u)s=+s+1;else o=+o+1;if(i==="<")c="-0";n=`${i+s}.${o}.${a}${c}`}else if(u)n=`>=${s}.0.0${c} <${+s+1}.0.0-0`;else if(d)n=`>=${s}.${o}.0${c} <${s}.${+o+1}.0-0`;return Ge("xRange return",n),n})},NF=(e,t)=>(Ge("replaceStars",e,t),e.trim().replace(Gt[kt.STAR],"")),MF=(e,t)=>(Ge("replaceGTE0",e,t),e.trim().replace(Gt[t.includePrerelease?kt.GTE0PRE:kt.GTE0],"")),LF=(e)=>(t,r,n,i,s,o,a,c,l,u,d,h)=>{if(xt(n))r="";else if(xt(i))r=`>=${n}.0.0${e?"-0":""}`;else if(xt(s))r=`>=${n}.${i}.0${e?"-0":""}`;else if(o)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(xt(l))c="";else if(xt(u))c=`<${+l+1}.0.0-0`;else if(xt(d))c=`<${l}.${+u+1}.0-0`;else if(h)c=`<=${l}.${u}.${d}-${h}`;else if(e)c=`<${l}.${u}.${+d+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},DF=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(Ge(e[n].semver),e[n].semver===Tp.ANY)continue;if(e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}}return!1}return!0}});var Pa=C(function(_ne,Sw){var ka=Symbol("SemVer ANY");class Gl{static get ANY(){return ka}constructor(e,t){if(t=bw(t),e instanceof Gl)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),Mp("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===ka)this.value="";else this.value=this.operator+this.semver.version;Mp("comp",this)}parse(e){let t=this.options.loose?xw[$w.COMPARATORLOOSE]:xw[$w.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=ka;else this.semver=new vw(r[2],this.options.loose)}toString(){return this.value}test(e){if(Mp("Comparator.test",e,this.options.loose),this.semver===ka||e===ka)return!0;if(typeof e==="string")try{e=new vw(e,this.options)}catch(t){return!1}return Np(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Gl))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new ww(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new ww(this.value,t).test(e.semver)}if(t=bw(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(Np(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(Np(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Sw.exports=Gl;var bw=Dl(),{safeRe:xw,t:$w}=co(),Np=Ip(),Mp=Sa(),vw=Pt(),ww=Jr()});var Aa=C(function(Pne,Ew){var JF=Jr(),FF=(e,t,r)=>{try{t=new JF(t,r)}catch(n){return!1}return t.test(e)};Ew.exports=FF});var Pw=C(function(kne,_w){var qF=Jr(),BF=(e,t)=>new qF(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));_w.exports=BF});var Aw=C(function(Ane,kw){var HF=Pt(),UF=Jr(),VF=(e,t,r)=>{let n=null,i=null,s=null;try{s=new UF(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===-1)n=o,i=new HF(n,r)}}),n};kw.exports=VF});var Rw=C(function(jne,jw){var WF=Pt(),zF=Jr(),KF=(e,t,r)=>{let n=null,i=null,s=null;try{s=new zF(t,r)}catch(o){return null}return e.forEach((o)=>{if(s.test(o)){if(!n||i.compare(o)===1)n=o,i=new WF(n,r)}}),n};jw.exports=KF});var Iw=C(function(Rne,Cw){var Lp=Pt(),GF=Jr(),Ow=Ea(),YF=(e,t)=>{e=new GF(e,t);let r=new Lp("0.0.0");if(e.test(r))return r;if(r=new Lp("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],s=null;if(i.forEach((o)=>{let a=new Lp(o.semver.version);switch(o.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!s||Ow(a,s))s=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||Ow(r,s)))r=s}if(r&&e.test(r))return r;return null};Cw.exports=YF});var Nw=C(function(One,Tw){var XF=Jr(),QF=(e,t)=>{try{return new XF(e,t).range||"*"}catch(r){return null}};Tw.exports=QF});var Yl=C(function(Cne,Jw){var ZF=Pt(),Dw=Pa(),{ANY:e5}=Dw,t5=Jr(),r5=Aa(),Mw=Ea(),Lw=Ul(),n5=Wl(),i5=Vl(),s5=(e,t,r,n)=>{e=new ZF(e,n),t=new t5(t,n);let i,s,o,a,c;switch(r){case">":i=Mw,s=n5,o=Lw,a=">",c=">=";break;case"<":i=Lw,s=i5,o=Mw,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(r5(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let u=t.set[l],d=null,h=null;if(u.forEach((m)=>{if(m.semver===e5)m=new Dw(">=0.0.0");if(d=d||m,h=h||m,i(m.semver,d.semver,n))d=m;else if(o(m.semver,h.semver,n))h=m}),d.operator===a||d.operator===c)return!1;if((!h.operator||h.operator===a)&&s(e,h.semver))return!1;else if(h.operator===c&&o(e,h.semver))return!1}return!0};Jw.exports=s5});var qw=C(function(Ine,Fw){var o5=Yl(),a5=(e,t,r)=>o5(e,t,">",r);Fw.exports=a5});var Hw=C(function(Tne,Bw){var c5=Yl(),l5=(e,t,r)=>c5(e,t,"<",r);Bw.exports=l5});var Ww=C(function(Nne,Vw){var Uw=Jr(),u5=(e,t,r)=>(e=new Uw(e,r),t=new Uw(t,r),e.intersects(t,r));Vw.exports=u5});var Kw=C(function(Mne,zw){var f5=Aa(),d5=Dr();zw.exports=(e,t,r)=>{let n=[],i=null,s=null,o=e.sort((u,d)=>d5(u,d,r));for(let u of o)if(f5(u,t,r)){if(s=u,!i)i=u}else{if(s)n.push([i,s]);s=null,i=null}if(i)n.push([i,null]);let a=[];for(let[u,d]of n)if(u===d)a.push(u);else if(!d&&u===o[0])a.push("*");else if(!d)a.push(`>=${u}`);else if(u===o[0])a.push(`<=${d}`);else a.push(`${u} - ${d}`);let c=a.join(" || "),l=typeof t.raw==="string"?t.raw:String(t);return c.length<l.length?c:t}});var eS=C(function(Lne,Zw){var Gw=Jr(),Fp=Pa(),{ANY:Dp}=Fp,Jp=Aa(),qp=Dr(),p5=(e,t,r={})=>{if(e===t)return!0;e=new Gw(e,r),t=new Gw(t,r);let n=!1;e:for(let i of e.set){for(let s of t.set){let o=h5(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},m5=[new Fp(">=0.0.0-0")],Yw=[new Fp(">=0.0.0")],h5=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Dp)if(t.length===1&&t[0].semver===Dp)return!0;else if(r.includePrerelease)e=m5;else e=Yw;if(t.length===1&&t[0].semver===Dp)if(r.includePrerelease)return!0;else t=Yw;let n=new Set,i,s;for(let m of e)if(m.operator===">"||m.operator===">=")i=Xw(i,m,r);else if(m.operator==="<"||m.operator==="<=")s=Qw(s,m,r);else n.add(m.semver);if(n.size>1)return null;let o;if(i&&s){if(o=qp(i.semver,s.semver,r),o>0)return null;else if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let m of n){if(i&&!Jp(m,String(i),r))return null;if(s&&!Jp(m,String(s),r))return null;for(let y of t)if(!Jp(m,String(y),r))return!1;return!0}let a,c,l,u,d=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(d&&d.prerelease.length===1&&s.operator==="<"&&d.prerelease[0]===0)d=!1;for(let m of t){if(u=u||m.operator===">"||m.operator===">=",l=l||m.operator==="<"||m.operator==="<=",i){if(h){if(m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===h.major&&m.semver.minor===h.minor&&m.semver.patch===h.patch)h=!1}if(m.operator===">"||m.operator===">="){if(a=Xw(i,m,r),a===m&&a!==i)return!1}else if(i.operator===">="&&!m.test(i.semver))return!1}if(s){if(d){if(m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===d.major&&m.semver.minor===d.minor&&m.semver.patch===d.patch)d=!1}if(m.operator==="<"||m.operator==="<="){if(c=Qw(s,m,r),c===m&&c!==s)return!1}else if(s.operator==="<="&&!m.test(s.semver))return!1}if(!m.operator&&(s||i)&&o!==0)return!1}if(i&&l&&!s&&o!==0)return!1;if(s&&u&&!i&&o!==0)return!1;if(h||d)return!1;return!0},Xw=(e,t,r)=>{if(!e)return t;let n=qp(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},Qw=(e,t,r)=>{if(!e)return t;let n=qp(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};Zw.exports=p5});var iS=C(function(Dne,nS){var Bp=co(),tS=ao(),g5=Pt(),rS=jp(),y5=gi(),b5=_v(),x5=kv(),$5=Rv(),v5=Iv(),w5=Nv(),S5=Lv(),E5=Jv(),_5=qv(),P5=Dr(),k5=Vv(),A5=zv(),j5=Hl(),R5=Xv(),O5=Zv(),C5=Ea(),I5=Ul(),T5=Op(),N5=Cp(),M5=Vl(),L5=Wl(),D5=Ip(),J5=cw(),F5=uw(),q5=Pa(),B5=Jr(),H5=Aa(),U5=Pw(),V5=Aw(),W5=Rw(),z5=Iw(),K5=Nw(),G5=Yl(),Y5=qw(),X5=Hw(),Q5=Ww(),Z5=Kw(),eq=eS();nS.exports={parse:y5,valid:b5,clean:x5,inc:$5,diff:v5,major:w5,minor:S5,patch:E5,prerelease:_5,compare:P5,rcompare:k5,compareLoose:A5,compareBuild:j5,sort:R5,rsort:O5,gt:C5,lt:I5,eq:T5,neq:N5,gte:M5,lte:L5,cmp:D5,coerce:J5,truncate:F5,Comparator:q5,Range:B5,satisfies:H5,toComparators:U5,maxSatisfying:V5,minSatisfying:W5,minVersion:z5,validRange:K5,outside:G5,gtr:Y5,ltr:X5,intersects:Q5,simplifyRange:Z5,subset:eq,SemVer:g5,re:Bp.re,src:Bp.src,tokens:Bp.t,SEMVER_SPEC_VERSION:tS.SEMVER_SPEC_VERSION,RELEASE_TYPES:tS.RELEASE_TYPES,compareIdentifiers:rS.compareIdentifiers,rcompareIdentifiers:rS.rcompareIdentifiers}});var Un;var Xl=L(()=>{Un={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.35.5",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unnebäck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix Bünemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","Jérémy Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kotěšovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouciño <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugué <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>","Dmytro Tiapukhin <cool.gegeg@gmail.com>","Florian Lefebvre <contact@florian-lefebvre.dev>"],scripts:{build:"node install/build.js","build:dist":"node scripts/build.mjs",clean:"rm -rf src/build/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types && npm run lint-publish","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-publish":"publint --strict","lint-types":"tsd --files ./test/types/sharp.test-d.{cts,mts}","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./dist/index.d.mts",exports:{".":{import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}}},sideEffects:!0,repository:{type:"git",url:"git+https://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.1.0","detect-libc":"^2.1.2",semver:"^7.8.5"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.5","@img/sharp-darwin-x64":"0.35.5","@img/sharp-freebsd-wasm32":"0.35.5","@img/sharp-libvips-darwin-arm64":"1.3.4","@img/sharp-libvips-darwin-x64":"1.3.4","@img/sharp-libvips-linux-arm":"1.3.4","@img/sharp-libvips-linux-arm64":"1.3.4","@img/sharp-libvips-linux-ppc64":"1.3.4","@img/sharp-libvips-linux-riscv64":"1.3.4","@img/sharp-libvips-linux-s390x":"1.3.4","@img/sharp-libvips-linux-x64":"1.3.4","@img/sharp-libvips-linuxmusl-arm64":"1.3.4","@img/sharp-libvips-linuxmusl-x64":"1.3.4","@img/sharp-linux-arm":"0.35.5","@img/sharp-linux-arm64":"0.35.5","@img/sharp-linux-ppc64":"0.35.5","@img/sharp-linux-riscv64":"0.35.5","@img/sharp-linux-s390x":"0.35.5","@img/sharp-linux-x64":"0.35.5","@img/sharp-linuxmusl-arm64":"0.35.5","@img/sharp-linuxmusl-x64":"0.35.5","@img/sharp-webcontainers-wasm32":"0.35.5","@img/sharp-win32-arm64":"0.35.5","@img/sharp-win32-ia32":"0.35.5","@img/sharp-win32-x64":"0.35.5"},peerDependenciesMeta:{"@types/node":{optional:!0}},devDependencies:{"@biomejs/biome":"^2.5.14","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.3","@img/sharp-libvips-dev":"1.3.4","@img/sharp-libvips-dev-wasm32":"1.3.4","@img/sharp-libvips-win32-arm64":"1.3.4","@img/sharp-libvips-win32-ia32":"1.3.4","@img/sharp-libvips-win32-x64":"1.3.4","@types/node":"*",emnapi:"^1.11.3","exif-reader":"^2.0.3",icc:"^4.0.0","node-addon-api":"^8.9.2","node-gyp":"^12.4.0",publint:"^0.3.24","tar-fs":"^3.1.3",tsd:"^0.33.0",yauzl:"^3.4.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.7"},funding:{url:"https://opencollective.com/libvips"}}});import{spawnSync as ja}from"node:child_process";import{createHash as rq}from"node:crypto";var Ra,Up,nq,oS,iq,Vp,sq=(e)=>{if(e instanceof Error)console.error(`sharp: Installation error: ${e.message}`);else console.log(`sharp: ${e}`)},aS=()=>Up.default.isNonGlibcLinuxSync()?Up.default.familySync():"",oq=()=>`${process.platform}${aS()}-${process.arch}`,lo=()=>{if(cS())return"wasm32";let{npm_config_arch:e,npm_config_platform:t,npm_config_libc:r}=process.env,n=typeof r==="string"?r:aS();return`${t||process.platform}${n}-${e||process.arch}`},aq=()=>{try{return De(`@img/sharp-libvips-dev-${lo()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},cq=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},lq=()=>{try{return De(`@img/sharp-libvips-dev-${lo()}/lib`)}catch{try{return De(`@img/sharp-libvips-${lo()}/lib`)}catch{}}return""},uq=()=>{if(process.release?.name==="node"&&process.versions){if(!Ra.default.satisfies(process.versions.node,Un.engines.node))return{found:process.versions.node,expected:Un.engines.node}}},cS=()=>{let{CC:e}=process.env;return Boolean(e?.endsWith("/emcc"))},fq=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(ja("sysctl sysctl.proc_translated",Vp).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},sS=(e)=>rq("sha512").update(e).digest("hex"),dq=()=>{try{let e=sS(`imgsharp-libvips-${lo()}`),t=Ra.default.coerce(Un.optionalDependencies[`@img/sharp-libvips-${lo()}`],{includePrerelease:!0}).version;return sS(`${e}npm:${t}`).slice(0,10)}catch{}return""},pq=()=>ja(`node-gyp rebuild --directory=src ${cS()?"--nodedir=emscripten":""}`,{...Vp,stdio:"inherit"}).status,lS=()=>{if(process.platform!=="win32")return(ja("pkg-config --modversion vips-cpp",{...Vp,env:{...process.env,PKG_CONFIG_PATH:uS()}}).stdout||"").trim();else return""},mq=()=>{try{let e=(ja("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(e)return`${e}/lib/pkgconfig`}catch(e){}return},hq=()=>{try{let e=(ja("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(e)return e}catch(e){}return},uS=()=>{if(process.platform!=="win32")return[mq(),hq(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},Hp=(e,t,r)=>{if(r)r(`Detected ${t}, skipping search for globally-installed libvips`);return e},gq=(e)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return Hp(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return Hp(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if(fq())return Hp(!1,"Rosetta",e);let t=lS();return!!t&&Ra.default.gte(t,oS)},Ql;var Wp=L(()=>{Xl();Ra=Bt(iS(),1),Up=Bt(Ll(),1);/*!
331
+ */u={defined:wy,object:zO,plainObject:GO,fn:KO,bool:YO,buffer:XO,typedArray:ZO,arrayBuffer:QO,string:eC,number:tC,integer:rC,inRange:nC,inArray:sC,invalidParameterError:iC,nativeError:oC}});var _y=C(function(lG,Ey){var Sy=()=>process.platform==="linux",tl=null,aC=()=>{if(!tl)if(Sy()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,tl=process.report.getReport(),process.report.excludeNetwork=e}else tl={};return tl};Ey.exports={isLinux:Sy,getReport:aC}});var jy=C(function(cG,Py){var si=Ne("fs"),lC=(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)},cC=(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,()=>{})})}})});Py.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:lC,readFile:cC}});var Ry=C(function(uG,ky){var uC=(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};ky.exports={interpreterPath:uC}});var nl=C(function(dG,Uy){var Oy=Ne("child_process"),{isLinux:ii,getReport:Cy}=_y(),{LDD_PATH:rl,SELF_PATH:Ny,readFile:zu,readFileSync:Gu}=jy(),{interpreterPath:Ty}=Ry(),Lr,Fr,qr,Jn="",Iy=()=>{if(!Jn)return new Promise((e)=>{Oy.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(t,r)=>{Jn=t?" ":r,e(Jn)})});return Jn},My=()=>{if(!Jn)try{Jn=Oy.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(e){Jn=" "}return Jn},hn="glibc",Jy=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,vs="musl",dC=(e)=>e.includes("libc.musl-")||e.includes("ld-musl-"),Dy=()=>{let e=Cy();if(e.header&&e.header.glibcVersionRuntime)return hn;if(Array.isArray(e.sharedObjects)){if(e.sharedObjects.some(dC))return vs}return null},Ly=(e)=>{let[t,r]=e.split(/[\r\n]+/);if(t&&t.includes(hn))return hn;if(r&&r.includes(vs))return vs;return null},Fy=(e)=>{if(e){if(e.includes("/ld-musl-"))return vs;else if(e.includes("/ld-linux-"))return hn}return null},qy=(e)=>{if(e=e.toString(),e.includes("musl"))return vs;if(e.includes("GNU C Library"))return hn;return null},fC=async()=>{if(Fr!==void 0)return Fr;Fr=null;try{let e=await zu(rl);Fr=qy(e)}catch(e){}return Fr},pC=()=>{if(Fr!==void 0)return Fr;Fr=null;try{let e=Gu(rl);Fr=qy(e)}catch(e){}return Fr},mC=async()=>{if(Lr!==void 0)return Lr;Lr=null;try{let e=await zu(Ny),t=Ty(e);Lr=Fy(t)}catch(e){}return Lr},hC=()=>{if(Lr!==void 0)return Lr;Lr=null;try{let e=Gu(Ny),t=Ty(e);Lr=Fy(t)}catch(e){}return Lr},Hy=async()=>{let e=null;if(ii()){if(e=await mC(),!e){if(e=await fC(),!e)e=Dy();if(!e){let t=await Iy();e=Ly(t)}}}return e},Vy=()=>{let e=null;if(ii()){if(e=hC(),!e){if(e=pC(),!e)e=Dy();if(!e){let t=My();e=Ly(t)}}}return e},gC=async()=>ii()&&await Hy()!==hn,yC=()=>ii()&&Vy()!==hn,bC=async()=>{if(qr!==void 0)return qr;qr=null;try{let t=(await zu(rl)).match(Jy);if(t)qr=t[1]}catch(e){}return qr},xC=()=>{if(qr!==void 0)return qr;qr=null;try{let t=Gu(rl).match(Jy);if(t)qr=t[1]}catch(e){}return qr},By=()=>{let e=Cy();if(e.header&&e.header.glibcVersionRuntime)return e.header.glibcVersionRuntime;return null},Ay=(e)=>e.trim().split(/\s+/)[1],Wy=(e)=>{let[t,r,n]=e.split(/[\r\n]+/);if(t&&t.includes(hn))return Ay(t);if(r&&n&&r.includes(vs))return Ay(n);return null},$C=async()=>{let e=null;if(ii()){if(e=await bC(),!e)e=By();if(!e){let t=await Iy();e=Wy(t)}}return e},vC=()=>{let e=null;if(ii()){if(e=xC(),!e)e=By();if(!e){let t=My();e=Wy(t)}}return e};Uy.exports={GLIBC:hn,MUSL:vs,family:Hy,familySync:Vy,isNonGlibcLinux:gC,isNonGlibcLinuxSync:yC,version:$C,versionSync:vC}});var oi=C(function(fG,zy){var wC=Number.MAX_SAFE_INTEGER||9007199254740991,SC=["major","premajor","minor","preminor","patch","prepatch","prerelease"];zy.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:wC,RELEASE_TYPES:SC,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var co=C(function(pG,Gy){var EC=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Gy.exports=EC});var ai=C(function(Hr,Ky){var{MAX_SAFE_COMPONENT_LENGTH:Ku,MAX_SAFE_BUILD_LENGTH:_C,MAX_LENGTH:PC}=oi(),jC=co();Hr=Ky.exports={};var kC=Hr.re=[],RC=Hr.safeRe=[],X=Hr.src=[],AC=Hr.safeSrc=[],Z=Hr.t={},OC=0,Yu="[a-zA-Z0-9-]",CC=[["\\s",1],["\\d",PC],[Yu,_C]],NC=(e)=>{for(let[t,r]of CC)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},be=(e,t,r)=>{let n=NC(t),s=OC++;jC(e,s,t),Z[e]=s,X[s]=t,AC[s]=n,kC[s]=new RegExp(t,r?"g":void 0),RC[s]=new RegExp(n,r?"g":void 0)};be("NUMERICIDENTIFIER","0|[1-9]\\d*");be("NUMERICIDENTIFIERLOOSE","\\d+");be("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Yu}*`);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",`${Yu}+`);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,${Ku}})(?:\\.(\\d{1,${Ku}}))?(?:\\.(\\d{1,${Ku}}))?`);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 sl=C(function(mG,Yy){var TC=Object.freeze({loose:!0}),IC=Object.freeze({}),MC=(e)=>{if(!e)return IC;if(typeof e!=="object")return TC;return e};Yy.exports=MC});var Xu=C(function(hG,Qy){var Xy=/^[0-9]+$/,Zy=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=Xy.test(e),n=Xy.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},JC=(e,t)=>Zy(t,e);Qy.exports={compareIdentifiers:Zy,rcompareIdentifiers:JC}});var ht=C(function(gG,tb){var il=co(),{MAX_LENGTH:eb,MAX_SAFE_INTEGER:ol}=oi(),{safeRe:al,t:ll}=ai(),DC=sl(),{compareIdentifiers:Zu}=Xu(),LC=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(Zu(e[n],r[n])!==0)return!1;return!0};class Sr{constructor(e,t){if(t=DC(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>eb)throw TypeError(`version is longer than ${eb} characters`);il("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?al[ll.LOOSE]:al[ll.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>ol||this.major<0)throw TypeError("Invalid major version");if(this.minor>ol||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>ol||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<ol)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(il("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(il("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 Zu(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(il("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 Zu(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?al[ll.PRERELEASELOOSE]:al[ll.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(LC(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}}tb.exports=Sr});var Dn=C(function(yG,nb){var rb=ht(),FC=(e,t,r=!1)=>{if(e instanceof rb)return e;try{return new rb(e,t)}catch(n){if(!r)return null;throw n}};nb.exports=FC});var ib=C(function(bG,sb){var qC=Dn(),HC=(e,t)=>{let r=qC(e,t);return r?r.version:null};sb.exports=HC});var ab=C(function(xG,ob){var VC=Dn(),BC=(e,t)=>{let r=VC(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};ob.exports=BC});var ub=C(function($G,cb){var lb=ht(),WC=(e,t,r,n,s)=>{if(typeof r==="string")s=n,n=r,r=void 0;try{return new lb(e instanceof lb?e.version:e,r).inc(t,n,s).version}catch(i){return null}};cb.exports=WC});var pb=C(function(vG,fb){var db=Dn(),UC=(e,t)=>{let r=db(e,null,!0),n=db(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"};fb.exports=UC});var hb=C(function(wG,mb){var zC=ht(),GC=(e,t)=>new zC(e,t).major;mb.exports=GC});var yb=C(function(SG,gb){var KC=ht(),YC=(e,t)=>new KC(e,t).minor;gb.exports=YC});var xb=C(function(EG,bb){var XC=ht(),ZC=(e,t)=>new XC(e,t).patch;bb.exports=ZC});var vb=C(function(_G,$b){var QC=Dn(),eN=(e,t)=>{let r=QC(e,t);return r&&r.prerelease.length?r.prerelease:null};$b.exports=eN});var pr=C(function(PG,Sb){var wb=ht(),tN=(e,t,r)=>new wb(e,r).compare(new wb(t,r));Sb.exports=tN});var _b=C(function(jG,Eb){var rN=pr(),nN=(e,t,r)=>rN(t,e,r);Eb.exports=nN});var jb=C(function(kG,Pb){var sN=pr(),iN=(e,t)=>sN(e,t,!0);Pb.exports=iN});var cl=C(function(RG,Rb){var kb=ht(),oN=(e,t,r)=>{let n=new kb(e,r),s=new kb(t,r);return n.compare(s)||n.compareBuild(s)};Rb.exports=oN});var Ob=C(function(AG,Ab){var aN=cl(),lN=(e,t)=>e.sort((r,n)=>aN(r,n,t));Ab.exports=lN});var Nb=C(function(OG,Cb){var cN=cl(),uN=(e,t)=>e.sort((r,n)=>cN(n,r,t));Cb.exports=uN});var uo=C(function(CG,Tb){var dN=pr(),fN=(e,t,r)=>dN(e,t,r)>0;Tb.exports=fN});var ul=C(function(NG,Ib){var pN=pr(),mN=(e,t,r)=>pN(e,t,r)<0;Ib.exports=mN});var Qu=C(function(TG,Mb){var hN=pr(),gN=(e,t,r)=>hN(e,t,r)===0;Mb.exports=gN});var ed=C(function(IG,Jb){var yN=pr(),bN=(e,t,r)=>yN(e,t,r)!==0;Jb.exports=bN});var dl=C(function(MG,Db){var xN=pr(),$N=(e,t,r)=>xN(e,t,r)>=0;Db.exports=$N});var fl=C(function(JG,Lb){var vN=pr(),wN=(e,t,r)=>vN(e,t,r)<=0;Lb.exports=wN});var td=C(function(DG,Fb){var SN=Qu(),EN=ed(),_N=uo(),PN=dl(),jN=ul(),kN=fl(),RN=(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 SN(e,r,n);case"!=":return EN(e,r,n);case">":return _N(e,r,n);case">=":return PN(e,r,n);case"<":return jN(e,r,n);case"<=":return kN(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};Fb.exports=RN});var Hb=C(function(LG,qb){var AN=ht(),ON=Dn(),{safeRe:pl,t:ml}=ai(),CN=(e,t)=>{if(e instanceof AN)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?pl[ml.COERCEFULL]:pl[ml.COERCE]);else{let l=t.includePrerelease?pl[ml.COERCERTLFULL]:pl[ml.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 ON(`${n}.${s}.${i}${o}${a}`,t)};qb.exports=CN});var Bb=C(function(FG,Vb){var NN=Dn(),TN=oi(),IN=ht(),MN=(e,t,r)=>{if(!TN.RELEASE_TYPES.includes(t))return null;let n=JN(e,r);return n&&DN(n,t)},JN=(e,t)=>{let r=e instanceof IN?e.version:e;return NN(r,t)},DN=(e,t)=>{if(LN(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()},LN=(e)=>e.startsWith("pre");Vb.exports=MN});var zb=C(function(qG,Ub){class Wb{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}}Ub.exports=Wb});var mr=C(function(HG,Xb){var FN=/\s+/g;class fo{constructor(e,t){if(t=HN(t),e instanceof fo)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new fo(e.raw,t);if(e instanceof rd)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(FN," "),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)=>!Kb(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&&XN(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(YN,"");let r=((this.options.includePrerelease&&GN)|(this.options.loose&&KN))+":"+e,n=Gb.get(r);if(n)return n;let s=this.options.loose,i=s?Ot[gt.HYPHENRANGELOOSE]:Ot[gt.HYPHENRANGE];e=e.replace(i,lT(this.options.includePrerelease)),qe("hyphen replace",e),e=e.replace(Ot[gt.COMPARATORTRIM],WN),qe("comparator trim",e),e=e.replace(Ot[gt.TILDETRIM],UN),qe("tilde trim",e),e=e.replace(Ot[gt.CARETTRIM],zN),qe("caret trim",e);let o=e.split(" ").map((d)=>ZN(d,this.options)).join(" ").split(/\s+/).map((d)=>aT(d,this.options));if(s)o=o.filter((d)=>(qe("loose invalid filter",d,this.options),!!d.match(Ot[gt.COMPARATORLOOSE])));qe("range list",o);let a=new Map,l=o.map((d)=>new rd(d,this.options));for(let d of l){if(Kb(d))return[d];a.set(d.value,d)}if(a.size>1&&a.has(""))a.delete("");let c=[...a.values()];return Gb.set(r,c),c}intersects(e,t){if(!(e instanceof fo))throw TypeError("a Range is required");return this.set.some((r)=>Yb(r,t)&&e.set.some((n)=>Yb(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 VN(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(cT(this.set[t],e,this.options))return!0;return!1}}Xb.exports=fo;var qN=zb(),Gb=new qN,HN=sl(),rd=po(),qe=co(),VN=ht(),{safeRe:Ot,src:BN,t:gt,comparatorTrimReplace:WN,tildeTrimReplace:UN,caretTrimReplace:zN}=ai(),{FLAG_INCLUDE_PRERELEASE:GN,FLAG_LOOSE:KN}=oi(),YN=new RegExp(BN[gt.BUILD],"g"),Kb=(e)=>e.value==="<0.0.0-0",XN=(e)=>e.value==="",Yb=(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},ZN=(e,t)=>(e=e.replace(Ot[gt.BUILD],""),qe("comp",e,t),e=rT(e,t),qe("caret",e),e=eT(e,t),qe("tildes",e),e=sT(e,t),qe("xrange",e),e=oT(e,t),qe("stars",e),e),at=(e)=>!e||e.toLowerCase()==="x"||e==="*",QN=(e,t,r)=>at(e)&&!at(t)||at(t)&&r&&!at(r),eT=(e,t)=>e.trim().split(/\s+/).map((r)=>tT(r,t)).join(" "),tT=(e,t)=>{let r=t.loose?Ot[gt.TILDELOOSE]:Ot[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})},rT=(e,t)=>e.trim().split(/\s+/).map((r)=>nT(r,t)).join(" "),nT=(e,t)=>{qe("caret",e,t);let r=t.loose?Ot[gt.CARETLOOSE]:Ot[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})},sT=(e,t)=>(qe("replaceXRanges",e,t),e.split(/\s+/).map((r)=>iT(r,t)).join(" ")),iT=(e,t)=>{e=e.trim();let r=t.loose?Ot[gt.XRANGELOOSE]:Ot[gt.XRANGE];return e.replace(r,(n,s,i,o,a,l)=>{if(qe("xRange",e,n,s,i,o,a,l),QN(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})},oT=(e,t)=>(qe("replaceStars",e,t),e.trim().replace(Ot[gt.STAR],"")),aT=(e,t)=>(qe("replaceGTE0",e,t),e.trim().replace(Ot[t.includePrerelease?gt.GTE0PRE:gt.GTE0],"")),lT=(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()},cT=(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===rd.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 po=C(function(VG,nx){var mo=Symbol("SemVer ANY");class hl{static get ANY(){return mo}constructor(e,t){if(t=Zb(t),e instanceof hl)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),sd("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===mo)this.value="";else this.value=this.operator+this.semver.version;sd("comp",this)}parse(e){let t=this.options.loose?Qb[ex.COMPARATORLOOSE]:Qb[ex.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=mo;else this.semver=new tx(r[2],this.options.loose)}toString(){return this.value}test(e){if(sd("Comparator.test",e,this.options.loose),this.semver===mo||e===mo)return!0;if(typeof e==="string")try{e=new tx(e,this.options)}catch(t){return!1}return nd(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof hl))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new rx(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new rx(this.value,t).test(e.semver)}if(t=Zb(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(nd(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(nd(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}nx.exports=hl;var Zb=sl(),{safeRe:Qb,t:ex}=ai(),nd=td(),sd=co(),tx=ht(),rx=mr()});var ho=C(function(BG,sx){var uT=mr(),dT=(e,t,r)=>{try{t=new uT(t,r)}catch(n){return!1}return t.test(e)};sx.exports=dT});var ox=C(function(WG,ix){var fT=mr(),pT=(e,t)=>new fT(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));ix.exports=pT});var lx=C(function(UG,ax){var mT=ht(),hT=mr(),gT=(e,t,r)=>{let n=null,s=null,i=null;try{i=new hT(t,r)}catch(o){return null}return e.forEach((o)=>{if(i.test(o)){if(!n||s.compare(o)===-1)n=o,s=new mT(n,r)}}),n};ax.exports=gT});var ux=C(function(zG,cx){var yT=ht(),bT=mr(),xT=(e,t,r)=>{let n=null,s=null,i=null;try{i=new bT(t,r)}catch(o){return null}return e.forEach((o)=>{if(i.test(o)){if(!n||s.compare(o)===1)n=o,s=new yT(n,r)}}),n};cx.exports=xT});var px=C(function(GG,fx){var id=ht(),$T=mr(),dx=uo(),vT=(e,t)=>{e=new $T(e,t);let r=new id("0.0.0");if(e.test(r))return r;if(r=new id("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 id(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||dx(a,i))i=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||dx(r,i)))r=i}if(r&&e.test(r))return r;return null};fx.exports=vT});var hx=C(function(KG,mx){var wT=mr(),ST=(e,t)=>{try{return new wT(e,t).range||"*"}catch(r){return null}};mx.exports=ST});var gl=C(function(YG,xx){var ET=ht(),bx=po(),{ANY:_T}=bx,PT=mr(),jT=ho(),gx=uo(),yx=ul(),kT=fl(),RT=dl(),AT=(e,t,r,n)=>{e=new ET(e,n),t=new PT(t,n);let s,i,o,a,l;switch(r){case">":s=gx,i=kT,o=yx,a=">",l=">=";break;case"<":s=yx,i=RT,o=gx,a="<",l="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(jT(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===_T)m=new bx(">=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};xx.exports=AT});var vx=C(function(XG,$x){var OT=gl(),CT=(e,t,r)=>OT(e,t,">",r);$x.exports=CT});var Sx=C(function(ZG,wx){var NT=gl(),TT=(e,t,r)=>NT(e,t,"<",r);wx.exports=TT});var Px=C(function(QG,_x){var Ex=mr(),IT=(e,t,r)=>(e=new Ex(e,r),t=new Ex(t,r),e.intersects(t,r));_x.exports=IT});var kx=C(function(eK,jx){var MT=ho(),JT=pr();jx.exports=(e,t,r)=>{let n=[],s=null,i=null,o=e.sort((d,p)=>JT(d,p,r));for(let d of o)if(MT(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 Tx=C(function(tK,Nx){var Rx=mr(),ld=po(),{ANY:od}=ld,ad=ho(),cd=pr(),DT=(e,t,r={})=>{if(e===t)return!0;e=new Rx(e,r),t=new Rx(t,r);let n=!1;e:for(let s of e.set){for(let i of t.set){let o=FT(s,i,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},LT=[new ld(">=0.0.0-0")],Ax=[new ld(">=0.0.0")],FT=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===od)if(t.length===1&&t[0].semver===od)return!0;else if(r.includePrerelease)e=LT;else e=Ax;if(t.length===1&&t[0].semver===od)if(r.includePrerelease)return!0;else t=Ax;let n=new Set,s,i;for(let m of e)if(m.operator===">"||m.operator===">=")s=Ox(s,m,r);else if(m.operator==="<"||m.operator==="<=")i=Cx(i,m,r);else n.add(m.semver);if(n.size>1)return null;let o;if(s&&i){if(o=cd(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&&!ad(m,String(s),r))return null;if(i&&!ad(m,String(i),r))return null;for(let b of t)if(!ad(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=Ox(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=Cx(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},Ox=(e,t,r)=>{if(!e)return t;let n=cd(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},Cx=(e,t,r)=>{if(!e)return t;let n=cd(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};Nx.exports=DT});var Dx=C(function(rK,Jx){var ud=ai(),Ix=oi(),qT=ht(),Mx=Xu(),HT=Dn(),VT=ib(),BT=ab(),WT=ub(),UT=pb(),zT=hb(),GT=yb(),KT=xb(),YT=vb(),XT=pr(),ZT=_b(),QT=jb(),eI=cl(),tI=Ob(),rI=Nb(),nI=uo(),sI=ul(),iI=Qu(),oI=ed(),aI=dl(),lI=fl(),cI=td(),uI=Hb(),dI=Bb(),fI=po(),pI=mr(),mI=ho(),hI=ox(),gI=lx(),yI=ux(),bI=px(),xI=hx(),$I=gl(),vI=vx(),wI=Sx(),SI=Px(),EI=kx(),_I=Tx();Jx.exports={parse:HT,valid:VT,clean:BT,inc:WT,diff:UT,major:zT,minor:GT,patch:KT,prerelease:YT,compare:XT,rcompare:ZT,compareLoose:QT,compareBuild:eI,sort:tI,rsort:rI,gt:nI,lt:sI,eq:iI,neq:oI,gte:aI,lte:lI,cmp:cI,coerce:uI,truncate:dI,Comparator:fI,Range:pI,satisfies:mI,toComparators:hI,maxSatisfying:gI,minSatisfying:yI,minVersion:bI,validRange:xI,outside:$I,gtr:vI,ltr:wI,intersects:SI,simplifyRange:EI,subset:_I,SemVer:qT,re:ud.re,src:ud.src,tokens:ud.t,SEMVER_SPEC_VERSION:Ix.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ix.RELEASE_TYPES,compareIdentifiers:Mx.compareIdentifiers,rcompareIdentifiers:Mx.rcompareIdentifiers}});var gn;var yl=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 go}from"node:child_process";import{createHash as jI}from"node:crypto";var yo,fd,kI,Fx,RI,pd,AI=(e)=>{if(e instanceof Error)console.error(`sharp: Installation error: ${e.message}`);else console.log(`sharp: ${e}`)},qx=()=>fd.default.isNonGlibcLinuxSync()?fd.default.familySync():"",OI=()=>`${process.platform}${qx()}-${process.arch}`,li=()=>{if(Hx())return"wasm32";let{npm_config_arch:e,npm_config_platform:t,npm_config_libc:r}=process.env,n=typeof r==="string"?r:qx();return`${t||process.platform}${n}-${e||process.arch}`},CI=()=>{try{return Ne(`@img/sharp-libvips-dev-${li()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},NI=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},TI=()=>{try{return Ne(`@img/sharp-libvips-dev-${li()}/lib`)}catch{try{return Ne(`@img/sharp-libvips-${li()}/lib`)}catch{}}return""},II=()=>{if(process.release?.name==="node"&&process.versions){if(!yo.default.satisfies(process.versions.node,gn.engines.node))return{found:process.versions.node,expected:gn.engines.node}}},Hx=()=>{let{CC:e}=process.env;return Boolean(e?.endsWith("/emcc"))},MI=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(go("sysctl sysctl.proc_translated",pd).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},Lx=(e)=>jI("sha512").update(e).digest("hex"),JI=()=>{try{let e=Lx(`imgsharp-libvips-${li()}`),t=yo.default.coerce(gn.optionalDependencies[`@img/sharp-libvips-${li()}`],{includePrerelease:!0}).version;return Lx(`${e}npm:${t}`).slice(0,10)}catch{}return""},DI=()=>go(`node-gyp rebuild --directory=src ${Hx()?"--nodedir=emscripten":""}`,{...pd,stdio:"inherit"}).status,Vx=()=>{if(process.platform!=="win32")return(go("pkg-config --modversion vips-cpp",{...pd,env:{...process.env,PKG_CONFIG_PATH:Bx()}}).stdout||"").trim();else return""},LI=()=>{try{let e=(go("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(e)return`${e}/lib/pkgconfig`}catch(e){}return},FI=()=>{try{let e=(go("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(e)return e}catch(e){}return},Bx=()=>{if(process.platform!=="win32")return[LI(),FI(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},dd=(e,t,r)=>{if(r)r(`Detected ${t}, skipping search for globally-installed libvips`);return e},qI=(e)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return dd(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return dd(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if(MI())return dd(!1,"Rosetta",e);let t=Vx();return!!t&&yo.default.gte(t,Fx)},bl;var md=q(()=>{yl();yo=Lt(Dx(),1),fd=Lt(nl(),1);/*!
373
332
  Copyright 2013 Lovell Fuller and others.
374
333
  SPDX-License-Identifier: Apache-2.0
375
- */nq=process.env.npm_package_config_libvips||Un.config.libvips,oS=Ra.default.coerce(nq).version,iq=["darwin-arm64","darwin-x64","freebsd-arm64","freebsd-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-wasm32","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],Vp={encoding:"utf8",shell:!0},Ql={minimumLibvipsVersion:oS,prebuiltPlatforms:iq,buildPlatformArch:lo,buildSharpLibvipsIncludeDir:aq,buildSharpLibvipsCPlusPlusDir:cq,buildSharpLibvipsLibDir:lq,isUnsupportedNodeRuntime:uq,runtimePlatformArch:oq,log:sq,yarnLocator:dq,spawnRebuild:pq,globalLibvipsVersion:lS,pkgConfigPath:uS,useGlobalLibvips:gq}});import{createRequire as yq}from"node:module";var Zl,$t,dS,bq,fS,xq,$q,Vn,He,yi,Le;var Oa=L(()=>{Wp();Xl();Zl=Bt(Ll(),1);/*!
334
+ */kI=process.env.npm_package_config_libvips||gn.config.libvips,Fx=yo.default.coerce(kI).version,RI=["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"],pd={encoding:"utf8",shell:!0},bl={minimumLibvipsVersion:Fx,prebuiltPlatforms:RI,buildPlatformArch:li,buildSharpLibvipsIncludeDir:CI,buildSharpLibvipsCPlusPlusDir:NI,buildSharpLibvipsLibDir:TI,isUnsupportedNodeRuntime:II,runtimePlatformArch:OI,log:AI,yarnLocator:JI,spawnRebuild:DI,globalLibvipsVersion:Vx,pkgConfigPath:Bx,useGlobalLibvips:qI}});import{createRequire as HI}from"node:module";var xl,lt,Ux,VI,Wx,BI,WI,yn,Je,Ln,Oe;var bo=q(()=>{md();yl();xl=Lt(nl(),1);/*!
376
335
  Copyright 2013 Lovell Fuller and others.
377
336
  SPDX-License-Identifier: Apache-2.0
378
- */$t=yq(import.meta.url),{version:dS}=Un,{runtimePlatformArch:bq,isUnsupportedNodeRuntime:fS,prebuiltPlatforms:xq,minimumLibvipsVersion:$q}=Ql,Vn=bq(),yi=[];try{He=$t(`../src/build/Release/sharp-${Vn}-${dS}.node`)}catch(e){yi.push(e)}if(!He)try{He=$t(`../src/build/Release/sharp-wasm32-${dS}.node`)}catch(e){yi.push(e)}if(!He)try{switch(Vn){case"darwin-arm64":He=$t("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":He=$t("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":He=$t("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":He=$t("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":He=$t("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":He=$t("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":He=$t("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":He=$t("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":He=$t("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":He=$t("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":He=$t("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":He=$t("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":He=$t("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":He=$t("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":He=$t("@img/sharp-webcontainers-wasm32/sharp.node");break}if(He&&["linux-x64","linuxmusl-x64"].includes(Vn)&&!He._isUsingX64V2()){let e=Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");e.code="Unsupported CPU",yi.push(e),He=null}if(He&&process.versions.electron&&Vn.startsWith("linux"))process.emitWarning("Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux",{code:"SharpElectronLinux"})}catch(e){yi.push(e)}if(!He)try{He=$t("@img/sharp-wasm32/sharp.node")}catch(e){yi.push(e)}if(!He){let[e,t,r]=["linux","darwin","win32"].map((s)=>Vn.startsWith(s)),n=[`Could not load the "sharp" module using the ${Vn} runtime`];yi.forEach((s)=>{if(!s.code?.endsWith("MODULE_NOT_FOUND"))n.push(s.code?`${s.code}: ${s.message}`:s.message)});let i=yi.map((s)=>s.message).join(" ");if(n.push("Possible solutions:"),fS()){let{found:s,expected:o}=fS();n.push("- Please upgrade Node.js:",` Found ${s}`,` Requires ${o}`)}else if(xq.includes(Vn)&&!/libstdc\+\+\.so/.test(i)){let[s,o]=Vn.split("-"),a=s.endsWith("musl")?" --libc=musl":"";n.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${s.replace("musl","")}${a} --cpu=${o} sharp`)}else n.push(`- Manually install libvips >= ${$q}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if(e&&/(symbol not found|CXXABI_)/i.test(i))try{let{config:s}=$t(`@img/sharp-libvips-${Vn}/package`),o=`${Zl.familySync()} ${Zl.versionSync()}`,a=`${s.musl?"musl":"glibc"} ${s.musl||s.glibc}`;n.push("- Update your OS:",` Found ${o}`,` Requires ${a}`)}catch(s){}if(e&&/\/snap\/core[0-9]{2}/.test(i))n.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(t&&/Incompatible library version/.test(i))n.push("- Update Homebrew:"," brew update && brew upgrade vips");if(yi.some((s)=>s.code==="ERR_DLOPEN_DISABLED"))n.push("- Run Node.js without using the --no-addons flag");if(r&&/The specified procedure could not be found/.test(i))n.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp");throw n.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),Error(n.join(`
379
- `))}Le=He});import vq from"node:util";import zp from"node:stream";function Eq(){let e=this.constructor.call(),{debuglog:t,queueListener:r,...n}=this.options;if(e.options=structuredClone(n),e.options.debuglog=t,e.options.queueListener=r,this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),e.options.input.buffer=this.options.input.buffer,e.emit("finish")});return e}var wq,Sq=(e)=>{os.queue.emit("change",e)},os=function(e,t){if(arguments.length===1&&!f.defined(e))throw Error("Invalid input");if(!(this instanceof os))return new os(e,t);return zp.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:0.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:(r)=>{this.emit("warning",r),wq(r)},queueListener:Sq},this.options.input=this._createInputDescriptor(e,t,{allowStream:!0}),this},vn;var pS=L(()=>{gn();Oa();/*!
337
+ */lt=HI(import.meta.url),{version:Ux}=gn,{runtimePlatformArch:VI,isUnsupportedNodeRuntime:Wx,prebuiltPlatforms:BI,minimumLibvipsVersion:WI}=bl,yn=VI(),Ln=[];try{Je=lt(`../src/build/Release/sharp-${yn}-${Ux}.node`)}catch(e){Ln.push(e)}if(!Je)try{Je=lt(`../src/build/Release/sharp-wasm32-${Ux}.node`)}catch(e){Ln.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",Ln.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){Ln.push(e)}if(!Je)try{Je=lt("@img/sharp-wasm32/sharp.node")}catch(e){Ln.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`];Ln.forEach((i)=>{if(!i.code?.endsWith("MODULE_NOT_FOUND"))n.push(i.code?`${i.code}: ${i.message}`:i.message)});let s=Ln.map((i)=>i.message).join(" ");if(n.push("Possible solutions:"),Wx()){let{found:i,expected:o}=Wx();n.push("- Please upgrade Node.js:",` Found ${i}`,` Requires ${o}`)}else if(BI.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 >= ${WI}`," 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=`${xl.familySync()} ${xl.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(Ln.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(`
338
+ `))}Oe=Je});import UI from"node:util";import hd from"node:stream";function KI(){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 zI,GI=(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 hd.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),zI(r)},queueListener:GI},this.options.input=this._createInputDescriptor(e,t,{allowStream:!0}),this},Vr;var zx=q(()=>{Dr();bo();/*!
380
339
  Copyright 2013 Lovell Fuller and others.
381
340
  SPDX-License-Identifier: Apache-2.0
382
- */wq=vq.debuglog("sharp");Object.setPrototypeOf(os.prototype,zp.Duplex.prototype);Object.setPrototypeOf(os,zp.Duplex);Object.assign(os.prototype,{clone:Eq});vn=os});function mS(e){let t=Pq.filter((r)=>f.defined(e[r])).map((r)=>[r,e[r]]);return t.length?Object.fromEntries(t):void 0}function kq(e,t,r){let n={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(f.string(e))n.file=e;else if(f.buffer(e)){if(e.length===0)throw Error("Input Buffer is empty");n.buffer=e}else if(f.arrayBuffer(e)){if(e.byteLength===0)throw Error("Input bit Array is empty");n.buffer=Buffer.from(e,0,e.byteLength)}else if(f.typedArray(e)){if(e.length===0)throw Error("Input Bit Array is empty");n.buffer=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(f.plainObject(e)&&!f.defined(t)){if(t=e,mS(t))n.buffer=[]}else if(!f.defined(e)&&!f.defined(t)&&f.object(r)&&r.allowStream)n.buffer=[];else if(Array.isArray(e))if(e.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=e.map((i)=>this._createInputDescriptor(i));else throw Error("Recursive join is unsupported");else throw Error("Expected at least two images to join");else throw Error(`Unsupported input '${e}' of type ${typeof e}${f.defined(t)?` when also providing options of type ${typeof t}`:""}`);if(f.object(t)){if(f.defined(t.failOn))if(f.string(t.failOn)&&f.inArray(t.failOn,["none","truncated","error","warning"]))n.failOn=t.failOn;else throw f.invalidParameterError("failOn","one of: none, truncated, error, warning",t.failOn);if(f.defined(t.autoOrient))if(f.bool(t.autoOrient))n.autoOrient=t.autoOrient;else throw f.invalidParameterError("autoOrient","boolean",t.autoOrient);if(f.defined(t.density))if(f.number(t.density)&&f.inRange(t.density,1,1e5))n.density=t.density;else throw f.invalidParameterError("density","number between 1 and 100000",t.density);if(f.defined(t.ignoreIcc))if(f.bool(t.ignoreIcc))n.ignoreIcc=t.ignoreIcc;else throw f.invalidParameterError("ignoreIcc","boolean",t.ignoreIcc);if(f.defined(t.limitInputPixels))if(f.bool(t.limitInputPixels))n.limitInputPixels=t.limitInputPixels?268402689:0;else if(f.integer(t.limitInputPixels)&&f.inRange(t.limitInputPixels,0,Number.MAX_SAFE_INTEGER))n.limitInputPixels=t.limitInputPixels;else throw f.invalidParameterError("limitInputPixels","positive integer",t.limitInputPixels);if(f.defined(t.limitInputChannels))if(f.bool(t.limitInputChannels))n.limitInputChannels=t.limitInputChannels?5:0;else if(f.integer(t.limitInputChannels)&&f.inRange(t.limitInputChannels,0,Number.MAX_SAFE_INTEGER))n.limitInputChannels=t.limitInputChannels;else throw f.invalidParameterError("limitInputChannels","positive integer",t.limitInputChannels);if(f.defined(t.unlimited))if(f.bool(t.unlimited))n.unlimited=t.unlimited;else throw f.invalidParameterError("unlimited","boolean",t.unlimited);if(f.defined(t.sequentialRead))if(f.bool(t.sequentialRead))n.sequentialRead=t.sequentialRead;else throw f.invalidParameterError("sequentialRead","boolean",t.sequentialRead);if(f.defined(t.raw)){if(f.object(t.raw)&&f.integer(t.raw.width)&&f.inRange(t.raw.width,1,1e8)&&f.integer(t.raw.height)&&f.inRange(t.raw.height,1,1e8)&&f.integer(t.raw.channels)&&f.inRange(t.raw.channels,1,4))switch(n.rawWidth=t.raw.width,n.rawHeight=t.raw.height,n.rawChannels=t.raw.channels,e.constructor){case Uint8Array:case Uint8ClampedArray:n.rawDepth="uchar";break;case Int8Array:n.rawDepth="char";break;case Uint16Array:n.rawDepth="ushort";break;case Int16Array:n.rawDepth="short";break;case Uint32Array:n.rawDepth="uint";break;case Int32Array:n.rawDepth="int";break;case Float32Array:n.rawDepth="float";break;case Float64Array:n.rawDepth="double";break;default:n.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(n.rawPremultiplied=!1,f.defined(t.raw.premultiplied))if(f.bool(t.raw.premultiplied))n.rawPremultiplied=t.raw.premultiplied;else throw f.invalidParameterError("raw.premultiplied","boolean",t.raw.premultiplied);if(n.rawPageHeight=0,f.defined(t.raw.pageHeight))if(f.integer(t.raw.pageHeight)&&t.raw.pageHeight>0&&t.raw.pageHeight<=t.raw.height){if(t.raw.height%t.raw.pageHeight!==0)throw Error(`Expected raw.height ${t.raw.height} to be a multiple of raw.pageHeight ${t.raw.pageHeight}`);n.rawPageHeight=t.raw.pageHeight}else throw f.invalidParameterError("raw.pageHeight","positive integer",t.raw.pageHeight)}if(f.defined(t.animated))if(f.bool(t.animated))n.pages=t.animated?-1:1;else throw f.invalidParameterError("animated","boolean",t.animated);if(f.defined(t.pages))if(f.integer(t.pages)&&f.inRange(t.pages,-1,1e5))n.pages=t.pages;else throw f.invalidParameterError("pages","integer between -1 and 100000",t.pages);if(f.defined(t.page))if(f.integer(t.page)&&f.inRange(t.page,0,1e5))n.page=t.page;else throw f.invalidParameterError("page","integer between 0 and 100000",t.page);if(f.object(t.openSlide)&&f.defined(t.openSlide.level))if(f.integer(t.openSlide.level)&&f.inRange(t.openSlide.level,0,256))n.openSlideLevel=t.openSlide.level;else throw f.invalidParameterError("openSlide.level","integer between 0 and 256",t.openSlide.level);else if(f.defined(t.level))if(f.integer(t.level)&&f.inRange(t.level,0,256))n.openSlideLevel=t.level;else throw f.invalidParameterError("level","integer between 0 and 256",t.level);if(f.object(t.tiff)&&f.defined(t.tiff.subifd))if(f.integer(t.tiff.subifd)&&f.inRange(t.tiff.subifd,-1,1e5))n.tiffSubifd=t.tiff.subifd;else throw f.invalidParameterError("tiff.subifd","integer between -1 and 100000",t.tiff.subifd);else if(f.defined(t.subifd))if(f.integer(t.subifd)&&f.inRange(t.subifd,-1,1e5))n.tiffSubifd=t.subifd;else throw f.invalidParameterError("subifd","integer between -1 and 100000",t.subifd);if(f.object(t.svg)){if(f.defined(t.svg.stylesheet))if(f.string(t.svg.stylesheet))n.svgStylesheet=t.svg.stylesheet;else throw f.invalidParameterError("svg.stylesheet","string",t.svg.stylesheet);if(f.defined(t.svg.highBitdepth))if(f.bool(t.svg.highBitdepth))n.svgHighBitdepth=t.svg.highBitdepth;else throw f.invalidParameterError("svg.highBitdepth","boolean",t.svg.highBitdepth)}if(f.object(t.pdf)&&f.defined(t.pdf.background))n.pdfBackground=this._getBackgroundColourOption(t.pdf.background);else if(f.defined(t.pdfBackground))n.pdfBackground=this._getBackgroundColourOption(t.pdfBackground);if(f.object(t.jp2)&&f.defined(t.jp2.oneshot))if(f.bool(t.jp2.oneshot))n.jp2Oneshot=t.jp2.oneshot;else throw f.invalidParameterError("jp2.oneshot","boolean",t.jp2.oneshot);if(f.defined(t.create))if(f.object(t.create)&&f.integer(t.create.width)&&f.inRange(t.create.width,1,1e8)&&f.integer(t.create.height)&&f.inRange(t.create.height,1,1e8)&&f.integer(t.create.channels)){if(n.createWidth=t.create.width,n.createHeight=t.create.height,n.createChannels=t.create.channels,n.createPageHeight=0,f.defined(t.create.pageHeight))if(f.integer(t.create.pageHeight)&&t.create.pageHeight>0&&t.create.pageHeight<=t.create.height){if(t.create.height%t.create.pageHeight!==0)throw Error(`Expected create.height ${t.create.height} to be a multiple of create.pageHeight ${t.create.pageHeight}`);n.createPageHeight=t.create.pageHeight}else throw f.invalidParameterError("create.pageHeight","positive integer",t.create.pageHeight);if(f.defined(t.create.noise)){if(!f.object(t.create.noise))throw Error("Expected noise to be an object");if(t.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(n.createNoiseType=t.create.noise.type,!f.inRange(t.create.channels,1,4))throw f.invalidParameterError("create.channels","number between 1 and 4",t.create.channels);if(n.createNoiseMean=128,f.defined(t.create.noise.mean))if(f.number(t.create.noise.mean)&&f.inRange(t.create.noise.mean,0,1e4))n.createNoiseMean=t.create.noise.mean;else throw f.invalidParameterError("create.noise.mean","number between 0 and 10000",t.create.noise.mean);if(n.createNoiseSigma=30,f.defined(t.create.noise.sigma))if(f.number(t.create.noise.sigma)&&f.inRange(t.create.noise.sigma,0,1e4))n.createNoiseSigma=t.create.noise.sigma;else throw f.invalidParameterError("create.noise.sigma","number between 0 and 10000",t.create.noise.sigma)}else if(f.defined(t.create.background)){if(!f.inRange(t.create.channels,3,4))throw f.invalidParameterError("create.channels","number between 3 and 4",t.create.channels);n.createBackground=this._getBackgroundColourOption(t.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete n.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(f.defined(t.text))if(f.object(t.text)&&f.string(t.text.text)){if(n.textValue=t.text.text,f.defined(t.text.height)&&f.defined(t.text.dpi))throw Error("Expected only one of dpi or height");if(f.defined(t.text.font))if(f.string(t.text.font))n.textFont=t.text.font;else throw f.invalidParameterError("text.font","string",t.text.font);if(f.defined(t.text.fontfile))if(f.string(t.text.fontfile))n.textFontfile=t.text.fontfile;else throw f.invalidParameterError("text.fontfile","string",t.text.fontfile);if(f.defined(t.text.width))if(f.integer(t.text.width)&&f.inRange(t.text.width,1,1e6))n.textWidth=t.text.width;else throw f.invalidParameterError("text.width","integer between 1 and 1000000",t.text.width);if(f.defined(t.text.height))if(f.integer(t.text.height)&&f.inRange(t.text.height,1,1e6))n.textHeight=t.text.height;else throw f.invalidParameterError("text.height","integer between 1 and 1000000",t.text.height);if(f.defined(t.text.align))if(f.string(t.text.align)&&f.string(this.constructor.align[t.text.align]))n.textAlign=this.constructor.align[t.text.align];else throw f.invalidParameterError("text.align","valid alignment",t.text.align);if(f.defined(t.text.justify))if(f.bool(t.text.justify))n.textJustify=t.text.justify;else throw f.invalidParameterError("text.justify","boolean",t.text.justify);if(f.defined(t.text.dpi))if(f.integer(t.text.dpi)&&f.inRange(t.text.dpi,1,1e6))n.textDpi=t.text.dpi;else throw f.invalidParameterError("text.dpi","integer between 1 and 1000000",t.text.dpi);if(f.defined(t.text.rgba))if(f.bool(t.text.rgba))n.textRgba=t.text.rgba;else throw f.invalidParameterError("text.rgba","bool",t.text.rgba);if(f.defined(t.text.spacing))if(f.integer(t.text.spacing)&&f.inRange(t.text.spacing,-1e6,1e6))n.textSpacing=t.text.spacing;else throw f.invalidParameterError("text.spacing","integer between -1000000 and 1000000",t.text.spacing);if(f.defined(t.text.wrap))if(f.string(t.text.wrap)&&f.inArray(t.text.wrap,["word","char","word-char","none"]))n.textWrap=t.text.wrap;else throw f.invalidParameterError("text.wrap","one of: word, char, word-char, none",t.text.wrap);delete n.buffer}else throw Error("Expected a valid string to create an image with text.");if(f.defined(t.join))if(f.defined(this.options.join)){if(f.defined(t.join.animated))if(f.bool(t.join.animated))n.joinAnimated=t.join.animated;else throw f.invalidParameterError("join.animated","boolean",t.join.animated);if(f.defined(t.join.across))if(f.integer(t.join.across)&&f.inRange(t.join.across,1,1e6))n.joinAcross=t.join.across;else throw f.invalidParameterError("join.across","integer between 1 and 100000",t.join.across);if(f.defined(t.join.shim))if(f.integer(t.join.shim)&&f.inRange(t.join.shim,0,1e6))n.joinShim=t.join.shim;else throw f.invalidParameterError("join.shim","integer between 0 and 100000",t.join.shim);if(f.defined(t.join.background))n.joinBackground=this._getBackgroundColourOption(t.join.background);if(f.defined(t.join.halign))if(f.string(t.join.halign)&&f.string(this.constructor.align[t.join.halign]))n.joinHalign=this.constructor.align[t.join.halign];else throw f.invalidParameterError("join.halign","valid alignment",t.join.halign);if(f.defined(t.join.valign))if(f.string(t.join.valign)&&f.string(this.constructor.align[t.join.valign]))n.joinValign=this.constructor.align[t.join.valign];else throw f.invalidParameterError("join.valign","valid alignment",t.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(f.defined(t))throw Error(`Invalid input options ${t}`);return n}function Aq(e,t,r){if(Array.isArray(this.options.input.buffer))if(f.buffer(e))this.options.input.buffer.push(e),r();else r(Error("Non-Buffer data on Writable Stream"));else r(Error("Unexpected data on Writable Stream"))}function jq(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function Rq(){return Array.isArray(this.options.input.buffer)}function Oq(e){if(this.writableFinished)e();else this.once("finish",e)}function Cq(e){let t=Error();if(f.fn(e)){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.metadata(this.options,(r,n)=>{if(r)e(f.nativeError(r,t));else e(null,n)})});else Le.metadata(this.options,(r,n)=>{if(r)e(f.nativeError(r,t));else e(null,n)});return this}else if(this._isStreamInput())return new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.metadata(this.options,(i,s)=>{if(i)n(f.nativeError(i,t));else r(s)})})});else return new Promise((r,n)=>{Le.metadata(this.options,(i,s)=>{if(i)n(f.nativeError(i,t));else r(s)})})}function Iq(e){let t=Error();if(f.fn(e)){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.stats(this.options,(r,n)=>{if(r)e(f.nativeError(r,t));else e(null,n)})});else Le.stats(this.options,(r,n)=>{if(r)e(f.nativeError(r,t));else e(null,n)});return this}else if(this._isStreamInput())return new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.stats(this.options,(i,s)=>{if(i)n(f.nativeError(i,t));else r(s)})})});else return new Promise((r,n)=>{Le.stats(this.options,(i,s)=>{if(i)n(f.nativeError(i,t));else r(s)})})}var _q,Pq,hS=(e)=>{Object.assign(e.prototype,{_inputOptionsFromObject:mS,_createInputDescriptor:kq,_write:Aq,_flattenBufferIn:jq,_isStreamInput:Rq,_whenStreamInFinished:Oq,metadata:Cq,stats:Iq}),e.align=_q};var gS=L(()=>{gn();Oa();/*!
341
+ */zI=UI.debuglog("sharp");Object.setPrototypeOf(ws.prototype,hd.Duplex.prototype);Object.setPrototypeOf(ws,hd.Duplex);Object.assign(ws.prototype,{clone:KI});Vr=ws});function Gx(e){let t=XI.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,Gx(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 QI(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 e2(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function t2(){return Array.isArray(this.options.input.buffer)}function r2(e){if(this.writableFinished)e();else this.once("finish",e)}function n2(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 s2(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 YI,XI,Kx=(e)=>{Object.assign(e.prototype,{_inputOptionsFromObject:Gx,_createInputDescriptor:ZI,_write:QI,_flattenBufferIn:e2,_isStreamInput:t2,_whenStreamInFinished:r2,metadata:n2,stats:s2}),e.align=YI};var Yx=q(()=>{Dr();bo();/*!
383
342
  Copyright 2013 Lovell Fuller and others.
384
343
  SPDX-License-Identifier: Apache-2.0
385
- */_q={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},Pq=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"]});function Gp(e){return e.angle%360!==0||e.rotationAngle!==0}function eu(e){return e.width!==-1||e.height!==-1}function Mq(e,t,r){if(eu(this.options))this.options.debuglog("ignoring previous resize options");if(this.options.widthPost!==-1)this.options.debuglog("operation order will be: extract, resize, extract");if(f.defined(e))if(f.object(e)&&!f.defined(r))r=e;else if(f.integer(e)&&f.inRange(e,1,1e8))this.options.width=e;else throw f.invalidParameterError("width","positive integer between 1 and 100000000",e);else this.options.width=-1;if(f.defined(t))if(f.integer(t)&&f.inRange(t,1,1e8))this.options.height=t;else throw f.invalidParameterError("height","positive integer between 1 and 100000000",t);else this.options.height=-1;if(f.object(r)){if(f.defined(r.width))if(f.integer(r.width)&&f.inRange(r.width,1,1e8))this.options.width=r.width;else throw f.invalidParameterError("width","positive integer between 1 and 100000000",r.width);if(f.defined(r.height))if(f.integer(r.height)&&f.inRange(r.height,1,1e8))this.options.height=r.height;else throw f.invalidParameterError("height","positive integer between 1 and 100000000",r.height);if(f.defined(r.fit)){let n=Nq[r.fit];if(f.string(n))this.options.canvas=n;else throw f.invalidParameterError("fit","valid fit",r.fit)}if(f.defined(r.position)){let n=f.integer(r.position)?r.position:$S[r.position]||xS[r.position]||bS[r.position];if(f.integer(n)&&(f.inRange(n,0,8)||f.inRange(n,16,17)))this.options.position=n;else throw f.invalidParameterError("position","valid position/gravity/strategy",r.position)}if(this._setBackgroundColourOption("resizeBackground",r.background),f.defined(r.kernel))if(f.string(Kp[r.kernel]))this.options.kernel=Kp[r.kernel];else throw f.invalidParameterError("kernel","valid kernel name",r.kernel);if(f.defined(r.withoutEnlargement))this._setBooleanOption("withoutEnlargement",r.withoutEnlargement);if(f.defined(r.withoutReduction))this._setBooleanOption("withoutReduction",r.withoutReduction);if(f.defined(r.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",r.fastShrinkOnLoad)}if(Gp(this.options)&&eu(this.options))this.options.rotateBefore=!0;return this}function Lq(e){if(f.integer(e))if(f.inRange(e,1,1e8))this.options.extendTop=e,this.options.extendBottom=e,this.options.extendLeft=e,this.options.extendRight=e;else throw f.invalidParameterError("extend","integer between 1 and 100000000",e);else if(f.object(e)){if(f.defined(e.top))if(f.integer(e.top)&&f.inRange(e.top,0,1e8))this.options.extendTop=e.top;else throw f.invalidParameterError("top","integer between 0 and 100000000",e.top);if(f.defined(e.bottom))if(f.integer(e.bottom)&&f.inRange(e.bottom,0,1e8))this.options.extendBottom=e.bottom;else throw f.invalidParameterError("bottom","integer between 0 and 100000000",e.bottom);if(f.defined(e.left))if(f.integer(e.left)&&f.inRange(e.left,0,1e8))this.options.extendLeft=e.left;else throw f.invalidParameterError("left","integer between 0 and 100000000",e.left);if(f.defined(e.right))if(f.integer(e.right)&&f.inRange(e.right,0,1e8))this.options.extendRight=e.right;else throw f.invalidParameterError("right","integer between 0 and 100000000",e.right);if(this._setBackgroundColourOption("extendBackground",e.background),f.defined(e.extendWith))if(f.string(yS[e.extendWith]))this.options.extendWith=yS[e.extendWith];else throw f.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",e.extendWith)}else throw f.invalidParameterError("extend","integer or object",e);return this}function Dq(e){let t=eu(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${t}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function(r){let n=e[r];if(f.integer(n)&&f.inRange(n,0,1e8))this.options[r+(r==="left"||r==="top"?"Offset":"")+t]=n;else throw f.invalidParameterError(r,"integer between 0 and 100000000",n)},this),Gp(this.options)&&!eu(this.options)){if(this.options.widthPre===-1||this.options.widthPost===-1)this.options.rotateBefore=!0}if(this.options.input.autoOrient)this.options.orientBefore=!0;return this}function Jq(e){if(this.options.trimThreshold=10,f.defined(e))if(f.object(e)){if(f.defined(e.background))this._setBackgroundColourOption("trimBackground",e.background);if(f.defined(e.threshold))if(f.number(e.threshold)&&e.threshold>=0)this.options.trimThreshold=e.threshold;else throw f.invalidParameterError("threshold","positive number",e.threshold);if(f.defined(e.lineArt))this._setBooleanOption("trimLineArt",e.lineArt);if(f.defined(e.margin))if(f.integer(e.margin)&&f.inRange(e.margin,0,1e7))this.options.trimMargin=e.margin;else throw f.invalidParameterError("margin","integer between 0 and 10000000",e.margin)}else throw f.invalidParameterError("trim","object",e);if(Gp(this.options))this.options.rotateBefore=!0;return this}var bS,xS,yS,$S,Kp,Tq,Nq,vS=(e)=>{Object.assign(e.prototype,{resize:Mq,extend:Lq,extract:Dq,trim:Jq}),e.gravity=bS,e.strategy=$S,e.kernel=Kp,e.fit=Tq,e.position=xS};var wS=L(()=>{gn();/*!
344
+ */YI={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},XI=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"]});function yd(e){return e.angle%360!==0||e.rotationAngle!==0}function $l(e){return e.width!==-1||e.height!==-1}function a2(e,t,r){if($l(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=o2[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:e$[r.position]||Qx[r.position]||Zx[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(gd[r.kernel]))this.options.kernel=gd[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(yd(this.options)&&$l(this.options))this.options.rotateBefore=!0;return this}function l2(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(Xx[e.extendWith]))this.options.extendWith=Xx[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 c2(e){let t=$l(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),yd(this.options)&&!$l(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 u2(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(yd(this.options))this.options.rotateBefore=!0;return this}var Zx,Qx,Xx,e$,gd,i2,o2,t$=(e)=>{Object.assign(e.prototype,{resize:a2,extend:l2,extract:c2,trim:u2}),e.gravity=Zx,e.strategy=e$,e.kernel=gd,e.fit=i2,e.position=Qx};var r$=q(()=>{Dr();/*!
386
345
  Copyright 2013 Lovell Fuller and others.
387
346
  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},Kp={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},Tq={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},Nq={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"}});function Fq(e){if(!Array.isArray(e))throw f.invalidParameterError("images to composite","array",e);return this.options.composite=e.map((t)=>{if(!f.object(t))throw f.invalidParameterError("image to composite","object",t);let r=this._inputOptionsFromObject(t),n={input:this._createInputDescriptor(t.input,r,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(f.defined(t.blend))if(f.string(Yp[t.blend]))n.blend=Yp[t.blend];else throw f.invalidParameterError("blend","valid blend name",t.blend);if(f.defined(t.tile))if(f.bool(t.tile))n.tile=t.tile;else throw f.invalidParameterError("tile","boolean",t.tile);if(f.defined(t.left))if(f.integer(t.left)&&f.inRange(t.left,-1e8,1e8))n.left=t.left;else throw f.invalidParameterError("left","integer between -100000000 and 100000000",t.left);if(f.defined(t.top))if(f.integer(t.top)&&f.inRange(t.top,-1e8,1e8))n.top=t.top;else throw f.invalidParameterError("top","integer between -100000000 and 100000000",t.top);if(f.defined(t.top)!==f.defined(t.left))throw Error("Expected both left and top to be set");else n.hasOffset=f.integer(t.top)&&f.integer(t.left);if(f.defined(t.gravity))if(f.integer(t.gravity)&&f.inRange(t.gravity,0,8))n.gravity=t.gravity;else if(f.string(t.gravity)&&f.integer(this.constructor.gravity[t.gravity]))n.gravity=this.constructor.gravity[t.gravity];else throw f.invalidParameterError("gravity","valid gravity",t.gravity);if(f.defined(t.premultiplied))if(f.bool(t.premultiplied))n.premultiplied=t.premultiplied;else throw f.invalidParameterError("premultiplied","boolean",t.premultiplied);return n}),this}var Yp,SS=(e)=>{e.prototype.composite=Fq,e.blend=Yp};var ES=L(()=>{gn();/*!
347
+ */Zx={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},Qx={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},Xx={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},e$={entropy:16,attention:17},gd={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},i2={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},o2={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"}});function d2(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(bd[t.blend]))n.blend=bd[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 bd,n$=(e)=>{e.prototype.composite=d2,e.blend=bd};var s$=q(()=>{Dr();/*!
389
348
  Copyright 2013 Lovell Fuller and others.
390
349
  SPDX-License-Identifier: Apache-2.0
391
- */Yp={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"}});function qq(e,t){if(!f.defined(e))return this.autoOrient();if(this.options.angle||this.options.rotationAngle)this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0;if(f.integer(e)&&!(e%90))this.options.angle=e;else if(f.number(e)){if(this.options.rotationAngle=e,f.object(t)&&t.background)this._setBackgroundColourOption("rotationBackground",t.background)}else throw f.invalidParameterError("angle","numeric",e);return this}function Bq(){return this.options.input.autoOrient=!0,this}function Hq(e){return this.options.flip=f.bool(e)?e:!0,this}function Uq(e){return this.options.flop=f.bool(e)?e:!0,this}function Vq(e,t){let n=Array.isArray(e)&&(e.length===4&&e.every(f.number)||e.length===2&&e.every((i)=>Array.isArray(i)&&i.length===2))?e.flat():[];if(n.length===4&&n.every(f.number))this.options.affineMatrix=n;else throw f.invalidParameterError("matrix","1x4 or 2x2 array",e);if(f.defined(t))if(f.object(t)){if(this._setBackgroundColourOption("affineBackground",t.background),f.defined(t.idx))if(f.number(t.idx))this.options.affineIdx=t.idx;else throw f.invalidParameterError("options.idx","number",t.idx);if(f.defined(t.idy))if(f.number(t.idy))this.options.affineIdy=t.idy;else throw f.invalidParameterError("options.idy","number",t.idy);if(f.defined(t.odx))if(f.number(t.odx))this.options.affineOdx=t.odx;else throw f.invalidParameterError("options.odx","number",t.odx);if(f.defined(t.ody))if(f.number(t.ody))this.options.affineOdy=t.ody;else throw f.invalidParameterError("options.ody","number",t.ody);if(f.defined(t.interpolator))if(f.inArray(t.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=t.interpolator;else throw f.invalidParameterError("options.interpolator","valid interpolator name",t.interpolator)}else throw f.invalidParameterError("options","object",t);return this}function Wq(e){if(f.plainObject(e)){if(f.number(e.sigma)&&f.inRange(e.sigma,0.000001,10))this.options.sharpenSigma=e.sigma;else throw f.invalidParameterError("options.sigma","number between 0.000001 and 10",e.sigma);if(f.defined(e.m1))if(f.number(e.m1)&&f.inRange(e.m1,0,1e6))this.options.sharpenM1=e.m1;else throw f.invalidParameterError("options.m1","number between 0 and 1000000",e.m1);if(f.defined(e.m2))if(f.number(e.m2)&&f.inRange(e.m2,0,1e6))this.options.sharpenM2=e.m2;else throw f.invalidParameterError("options.m2","number between 0 and 1000000",e.m2);if(f.defined(e.x1))if(f.number(e.x1)&&f.inRange(e.x1,0,1e6))this.options.sharpenX1=e.x1;else throw f.invalidParameterError("options.x1","number between 0 and 1000000",e.x1);if(f.defined(e.y2))if(f.number(e.y2)&&f.inRange(e.y2,0,1e6))this.options.sharpenY2=e.y2;else throw f.invalidParameterError("options.y2","number between 0 and 1000000",e.y2);if(f.defined(e.y3))if(f.number(e.y3)&&f.inRange(e.y3,0,1e6))this.options.sharpenY3=e.y3;else throw f.invalidParameterError("options.y3","number between 0 and 1000000",e.y3)}else this.options.sharpenSigma=-1;return this}function zq(e){if(!f.defined(e))this.options.medianSize=3;else if(f.integer(e)&&f.inRange(e,1,1000))this.options.medianSize=e;else throw f.invalidParameterError("size","integer between 1 and 1000",e);return this}function Kq(e){let t;if(f.number(e))t=e;else if(f.plainObject(e)){if(!f.number(e.sigma))throw f.invalidParameterError("options.sigma","number between 0.3 and 1000",t);if(t=e.sigma,"precision"in e)if(f.string(_S[e.precision]))this.options.precision=_S[e.precision];else throw f.invalidParameterError("precision","one of: integer, float, approximate",e.precision);if("minAmplitude"in e)if(f.number(e.minAmplitude)&&f.inRange(e.minAmplitude,0.001,1))this.options.minAmpl=e.minAmplitude;else throw f.invalidParameterError("minAmplitude","number between 0.001 and 1",e.minAmplitude)}if(!f.defined(e))this.options.blurSigma=-1;else if(f.bool(e))this.options.blurSigma=e?-1:0;else if(f.number(t)&&f.inRange(t,0.3,1000))this.options.blurSigma=t;else throw f.invalidParameterError("sigma","number between 0.3 and 1000",t);return this}function Gq(e){if(!f.defined(e))this.options.dilateWidth=1;else if(f.integer(e)&&f.inRange(e,1,65536))this.options.dilateWidth=e;else throw f.invalidParameterError("width","integer between 1 and 65536",e);return this}function Yq(e){if(!f.defined(e))this.options.erodeWidth=1;else if(f.integer(e)&&f.inRange(e,1,65536))this.options.erodeWidth=e;else throw f.invalidParameterError("width","integer between 1 and 65536",e);return this}function Xq(e){if(this.options.flatten=f.bool(e)?e:!0,f.object(e))this._setBackgroundColourOption("flattenBackground",e.background);return this}function Qq(){return this.options.unflatten=!0,this}function Zq(e,t){if(!f.defined(e))this.options.gamma=2.2;else if(f.number(e)&&f.inRange(e,1,3))this.options.gamma=e;else throw f.invalidParameterError("gamma","number between 1.0 and 3.0",e);if(!f.defined(t))this.options.gammaOut=this.options.gamma;else if(f.number(t)&&f.inRange(t,1,3))this.options.gammaOut=t;else throw f.invalidParameterError("gammaOut","number between 1.0 and 3.0",t);return this}function e3(e){if(this.options.negate=f.bool(e)?e:!0,f.plainObject(e)&&"alpha"in e)if(!f.bool(e.alpha))throw f.invalidParameterError("alpha","should be boolean value",e.alpha);else this.options.negateAlpha=e.alpha;return this}function t3(e){if(f.plainObject(e)){if(f.defined(e.lower))if(f.number(e.lower)&&f.inRange(e.lower,0,99))this.options.normaliseLower=e.lower;else throw f.invalidParameterError("lower","number between 0 and 99",e.lower);if(f.defined(e.upper))if(f.number(e.upper)&&f.inRange(e.upper,1,100))this.options.normaliseUpper=e.upper;else throw f.invalidParameterError("upper","number between 1 and 100",e.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw f.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function r3(e){return this.normalise(e)}function n3(e){if(f.plainObject(e)){if(f.integer(e.width)&&f.inRange(e.width,1,65536))this.options.claheWidth=e.width;else throw f.invalidParameterError("width","integer between 1 and 65536",e.width);if(f.integer(e.height)&&f.inRange(e.height,1,65536))this.options.claheHeight=e.height;else throw f.invalidParameterError("height","integer between 1 and 65536",e.height);if(f.defined(e.maxSlope))if(f.integer(e.maxSlope)&&f.inRange(e.maxSlope,0,100))this.options.claheMaxSlope=e.maxSlope;else throw f.invalidParameterError("maxSlope","integer between 0 and 100",e.maxSlope)}else throw f.invalidParameterError("options","plain object",e);return this}function i3(e){if(!f.object(e)||!Array.isArray(e.kernel)||!f.integer(e.width)||!f.integer(e.height)||!f.inRange(e.width,3,1001)||!f.inRange(e.height,3,1001)||e.height*e.width!==e.kernel.length||!e.kernel.every(f.number))throw Error("Invalid convolution kernel");if(!f.integer(e.scale))e.scale=e.kernel.reduce((t,r)=>t+r,0);if(e.scale<1)e.scale=1;if(!f.integer(e.offset))e.offset=0;return this.options.convKernel=e,this}function s3(e,t){if(!f.defined(e))this.options.threshold=128;else if(f.bool(e))this.options.threshold=e?128:0;else if(f.integer(e)&&f.inRange(e,0,255))this.options.threshold=e;else throw f.invalidParameterError("threshold","integer between 0 and 255",e);if(!f.object(t)||t.greyscale===!0||t.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function o3(e,t,r){if(this.options.boolean=this._createInputDescriptor(e,r),f.string(t)&&f.inArray(t,["and","or","eor"]))this.options.booleanOp=t;else throw f.invalidParameterError("operator","one of: and, or, eor",t);return this}function a3(e,t){if(!f.defined(e)&&f.number(t))e=1;else if(f.number(e)&&!f.defined(t))t=0;if(!f.defined(e))this.options.linearA=[];else if(f.number(e))this.options.linearA=[e];else if(Array.isArray(e)&&f.inRange(e.length,1,1e6)&&e.every(f.number))this.options.linearA=e;else throw f.invalidParameterError("a","number or array of numbers",e);if(!f.defined(t))this.options.linearB=[];else if(f.number(t))this.options.linearB=[t];else if(Array.isArray(t)&&f.inRange(t.length,1,1e6)&&t.every(f.number))this.options.linearB=t;else throw f.invalidParameterError("b","number or array of numbers",t);if(this.options.linearA.length!==this.options.linearB.length)throw Error("Expected a and b to be arrays of the same length");return this}function c3(e){if(!Array.isArray(e))throw f.invalidParameterError("inputMatrix","array",e);let t=e.length;if(t!==3&&t!==4)throw f.invalidParameterError("inputMatrix","3x3 or 4x4 array",t);if(!e.every((n)=>Array.isArray(n)&&n.length===t))throw f.invalidParameterError("inputMatrix",`array of ${t} arrays of length ${t}`,e);let r=e.flat();if(!r.every(f.number))throw f.invalidParameterError("inputMatrix","array of numbers",r);return this.options.recombMatrix=r,this}function l3(e){if(!f.plainObject(e))throw f.invalidParameterError("options","plain object",e);if("brightness"in e)if(f.number(e.brightness)&&e.brightness>=0)this.options.brightness=e.brightness;else throw f.invalidParameterError("brightness","number above zero",e.brightness);if("saturation"in e)if(f.number(e.saturation)&&e.saturation>=0)this.options.saturation=e.saturation;else throw f.invalidParameterError("saturation","number above zero",e.saturation);if("hue"in e)if(f.integer(e.hue))this.options.hue=e.hue%360;else throw f.invalidParameterError("hue","number",e.hue);if("lightness"in e)if(f.number(e.lightness))this.options.lightness=e.lightness;else throw f.invalidParameterError("lightness","number",e.lightness);return this}var _S,PS=(e)=>{Object.assign(e.prototype,{autoOrient:Bq,rotate:qq,flip:Hq,flop:Uq,affine:Vq,sharpen:Wq,erode:Yq,dilate:Gq,median:zq,blur:Kq,flatten:Xq,unflatten:Qq,gamma:Zq,negate:e3,normalise:t3,normalize:r3,clahe:n3,convolve:i3,threshold:s3,boolean:o3,linear:a3,recomb:c3,modulate:l3})};var kS=L(()=>{gn();/*!
350
+ */bd={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 f2(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 p2(){return this.options.input.autoOrient=!0,this}function m2(e){return this.options.flip=u.bool(e)?e:!0,this}function h2(e){return this.options.flop=u.bool(e)?e:!0,this}function g2(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 y2(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 b2(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 x2(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(i$[e.precision]))this.options.precision=i$[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 $2(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 v2(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 w2(e){if(this.options.flatten=u.bool(e)?e:!0,u.object(e))this._setBackgroundColourOption("flattenBackground",e.background);return this}function S2(){return this.options.unflatten=!0,this}function E2(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 P2(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 j2(e){return this.normalise(e)}function k2(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 R2(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 A2(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 O2(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 C2(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 N2(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 T2(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 i$,o$=(e)=>{Object.assign(e.prototype,{autoOrient:p2,rotate:f2,flip:m2,flop:h2,affine:g2,sharpen:y2,erode:v2,dilate:$2,median:b2,blur:x2,flatten:w2,unflatten:S2,gamma:E2,negate:_2,normalise:P2,normalize:j2,clahe:k2,convolve:R2,threshold:A2,boolean:O2,linear:C2,recomb:N2,modulate:T2})};var a$=q(()=>{Dr();/*!
392
351
  Copyright 2013 Lovell Fuller and others.
393
352
  SPDX-License-Identifier: Apache-2.0
394
- */_S={integer:"integer",float:"float",approximate:"approximate"}});var IS=C(function(lie,CS){var{defineProperty:tm,getOwnPropertyDescriptor:u3,getOwnPropertyNames:f3}=Object,d3=Object.prototype.hasOwnProperty,p3=(e,t)=>{for(var r in t)tm(e,r,{get:t[r],enumerable:!0})},m3=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let i of f3(t))if(!d3.call(e,i)&&i!==r)tm(e,i,{get:()=>t[i],enumerable:!(n=u3(t,i))||n.enumerable})}return e},h3=(e)=>m3(tm({},"__esModule",{value:!0}),e),AS={};p3(AS,{default:()=>j3});CS.exports=h3(AS);var Xp={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let e in Xp)Object.freeze(Xp[e]);var wn=Object.freeze(Xp),jS=Object.create(null);for(let e in wn)if(Object.hasOwn(wn,e))jS[wn[e]]=e;var ur={to:{},get:{}};ur.get=function(e){let t=e.slice(0,3).toLowerCase(),r,n;switch(t){case"hsl":{r=ur.get.hsl(e),n="hsl";break}case"hwb":{r=ur.get.hwb(e),n="hwb";break}default:{r=ur.get.rgb(e),n="rgb";break}}if(!r)return null;return{model:n,value:r}};ur.get.rgb=function(e){if(!e)return null;let t=/^#([a-f\d]{3,4})$/i,r=/^#([a-f\d]{6})([a-f\d]{2})?$/i,n=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,i=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,s=/^(\w+)$/,o=[0,0,0,1],a,c,l;if(a=e.match(r)){l=a[2],a=a[1];for(c=0;c<3;c++){let u=c*2;o[c]=Number.parseInt(a.slice(u,u+2),16)}if(l)o[3]=Number.parseInt(l,16)/255}else if(a=e.match(t)){a=a[1],l=a[3];for(c=0;c<3;c++)o[c]=Number.parseInt(a[c]+a[c],16);if(l)o[3]=Number.parseInt(l+l,16)/255}else if(a=e.match(n)){for(c=0;c<3;c++)o[c]=Number.parseFloat(a[c+1]);if(a[4])o[3]=a[5]?Number.parseFloat(a[4])*0.01:Number.parseFloat(a[4])}else if(a=e.match(i)){for(c=0;c<3;c++)o[c]=Math.round(Number.parseFloat(a[c+1])*2.55);if(a[4])o[3]=a[5]?Number.parseFloat(a[4])*0.01:Number.parseFloat(a[4])}else if(a=e.toLowerCase().match(s)){if(a[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(wn,a[1]))return null;return o=wn[a[1]].slice(),o[3]=1,o}else return null;for(c=0;c<3;c++)o[c]=bi(o[c],0,255);return o[3]=bi(o[3],0,1),o};ur.get.hsl=function(e){if(!e)return null;let t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,r=e.match(t);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,s=bi(Number.parseFloat(r[2]),0,100),o=bi(Number.parseFloat(r[3]),0,100),a=bi(Number.isNaN(n)?1:n,0,1);return[i,s,o,a]}return null};ur.get.hwb=function(e){if(!e)return null;let t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,r=e.match(t);if(r){let n=Number.parseFloat(r[4]),i=(Number.parseFloat(r[1])%360+360)%360,s=bi(Number.parseFloat(r[2]),0,100),o=bi(Number.parseFloat(r[3]),0,100),a=bi(Number.isNaN(n)?1:n,0,1);return[i,s,o,a]}return null};ur.to.hex=function(...e){return"#"+tu(e[0])+tu(e[1])+tu(e[2])+(e[3]<1?tu(Math.round(e[3]*255)):"")};ur.to.rgb=function(...e){return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};ur.to.rgb.percent=function(...e){let t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+r+"%, "+n+"%)":"rgba("+t+"%, "+r+"%, "+n+"%, "+e[3]+")"};ur.to.hsl=function(...e){return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};ur.to.hwb=function(...e){let t="";if(e.length>=4&&e[3]!==1)t=", "+e[3];return"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};ur.to.keyword=function(...e){return jS[e.slice(0,3)]};function bi(e,t,r){return Math.min(Math.max(t,e),r)}function tu(e){let t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var uo=ur,RS={};for(let e of Object.keys(wn))RS[wn[e]]=e;var K={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},as=K,Wn=0.008856451679035631;function po(e){let t=e>0.0031308?1.055*e**0.4166666666666667-0.055:e*12.92;return Math.min(Math.max(0,t),1)}function mo(e){return e>0.04045?((e+0.055)/1.055)**2.4:e/12.92}for(let e of Object.keys(K)){if(!("channels"in K[e]))throw Error("missing channels property: "+e);if(!("labels"in K[e]))throw Error("missing channel labels property: "+e);if(K[e].labels.length!==K[e].channels)throw Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=K[e];delete K[e].channels,delete K[e].labels,Object.defineProperty(K[e],"channels",{value:t}),Object.defineProperty(K[e],"labels",{value:r})}K.rgb.hsl=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(t,r,n),s=Math.max(t,r,n),o=s-i,a,c;switch(s){case i:{a=0;break}case t:{a=(r-n)/o;break}case r:{a=2+(n-t)/o;break}case n:{a=4+(t-r)/o;break}}if(a=Math.min(a*60,360),a<0)a+=360;let l=(i+s)/2;if(s===i)c=0;else if(l<=0.5)c=o/(s+i);else c=o/(2-s-i);return[a,c*100,l*100]};K.rgb.hsv=function(e){let t,r,n,i,s,o=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(o,a,c),u=l-Math.min(o,a,c),d=function(h){return(l-h)/6/u+0.5};if(u===0)i=0,s=0;else{switch(s=u/l,t=d(o),r=d(a),n=d(c),l){case o:{i=n-r;break}case a:{i=0.3333333333333333+t-n;break}case c:{i=0.6666666666666666+r-t;break}}if(i<0)i+=1;else if(i>1)i-=1}return[i*360,s*100,l*100]};K.rgb.hwb=function(e){let t=e[0],r=e[1],n=e[2],i=K.rgb.hsl(e)[0],s=0.00392156862745098*Math.min(t,Math.min(r,n));return n=1-0.00392156862745098*Math.max(t,Math.max(r,n)),[i,s*100,n*100]};K.rgb.oklab=function(e){let t=mo(e[0]/255),r=mo(e[1]/255),n=mo(e[2]/255),i=Math.cbrt(0.4122214708*t+0.5363325363*r+0.0514459929*n),s=Math.cbrt(0.2119034982*t+0.6806995451*r+0.1073969566*n),o=Math.cbrt(0.0883024619*t+0.2817188376*r+0.6299787005*n),a=0.2104542553*i+0.793617785*s-0.0040720468*o,c=1.9779984951*i-2.428592205*s+0.4505937099*o,l=0.0259040371*i+0.7827717662*s-0.808675766*o;return[a*100,c*100,l*100]};K.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(1-t,1-r,1-n),s=(1-t-i)/(1-i)||0,o=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[s*100,o*100,a*100,i*100]};function g3(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}K.rgb.keyword=function(e){let t=RS[e];if(t)return t;let r=Number.POSITIVE_INFINITY,n;for(let i of Object.keys(wn)){let s=wn[i],o=g3(e,s);if(o<r)r=o,n=i}return n};K.keyword.rgb=function(e){return[...wn[e]]};K.rgb.xyz=function(e){let t=mo(e[0]/255),r=mo(e[1]/255),n=mo(e[2]/255),i=t*0.4124564+r*0.3575761+n*0.1804375,s=t*0.2126729+r*0.7151522+n*0.072175,o=t*0.0193339+r*0.119192+n*0.9503041;return[i*100,s*100,o*100]};K.rgb.lab=function(e){let t=K.rgb.xyz(e),r=t[0],n=t[1],i=t[2];r/=95.047,n/=100,i/=108.883,r=r>Wn?r**0.3333333333333333:7.787*r+0.13793103448275862,n=n>Wn?n**0.3333333333333333:7.787*n+0.13793103448275862,i=i>Wn?i**0.3333333333333333:7.787*i+0.13793103448275862;let s=116*n-16,o=500*(r-n),a=200*(n-i);return[s,o,a]};K.hsl.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,i,s;if(r===0)return s=n*255,[s,s,s];let o=n<0.5?n*(1+r):n+r-n*r,a=2*n-o,c=[0,0,0];for(let l=0;l<3;l++){if(i=t+0.3333333333333333*-(l-1),i<0)i++;if(i>1)i--;if(6*i<1)s=a+(o-a)*6*i;else if(2*i<1)s=o;else if(3*i<2)s=a+(o-a)*(0.6666666666666666-i)*6;else s=a;c[l]=s*255}return c};K.hsl.hsv=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,i=r,s=Math.max(n,0.01);n*=2,r*=n<=1?n:2-n,i*=s<=1?s:2-s;let o=(n+r)/2,a=n===0?2*i/(s+i):2*r/(n+r);return[t,a*100,o*100]};K.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,n=e[2]/100,i=Math.floor(t)%6,s=t-Math.floor(t),o=255*n*(1-r),a=255*n*(1-r*s),c=255*n*(1-r*(1-s));switch(n*=255,i){case 0:return[n,c,o];case 1:return[a,n,o];case 2:return[o,n,c];case 3:return[o,a,n];case 4:return[c,o,n];case 5:return[n,o,a]}};K.hsv.hsl=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,i=Math.max(n,0.01),s,o;o=(2-r)*n;let a=(2-r)*i;return s=r*i,s/=a<=1?a:2-a,s=s||0,o/=2,[t,s*100,o*100]};K.hwb.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,i=r+n,s;if(i>1)r/=i,n/=i;let o=Math.floor(6*t),a=1-n;if(s=6*t-o,(o&1)!==0)s=1-s;let c=r+s*(a-r),l,u,d;switch(o){default:case 6:case 0:{l=a,u=c,d=r;break}case 1:{l=c,u=a,d=r;break}case 2:{l=r,u=a,d=c;break}case 3:{l=r,u=c,d=a;break}case 4:{l=c,u=r,d=a;break}case 5:{l=a,u=r,d=c;break}}return[l*255,u*255,d*255]};K.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=e[3]/100,s=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,r*(1-i)+i),a=1-Math.min(1,n*(1-i)+i);return[s*255,o*255,a*255]};K.xyz.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i,s,o;return i=t*3.2404542+r*-1.5371385+n*-0.4985314,s=t*-0.969266+r*1.8760108+n*0.041556,o=t*0.0556434+r*-0.2040259+n*1.0572252,i=po(i),s=po(s),o=po(o),[i*255,s*255,o*255]};K.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];t/=95.047,r/=100,n/=108.883,t=t>Wn?t**0.3333333333333333:7.787*t+0.13793103448275862,r=r>Wn?r**0.3333333333333333:7.787*r+0.13793103448275862,n=n>Wn?n**0.3333333333333333:7.787*n+0.13793103448275862;let i=116*r-16,s=500*(t-r),o=200*(r-n);return[i,s,o]};K.xyz.oklab=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=Math.cbrt(0.8189330101*t+0.3618667424*r-0.1288597137*n),s=Math.cbrt(0.0329845436*t+0.9293118715*r+0.0361456387*n),o=Math.cbrt(0.0482003018*t+0.2643662691*r+0.633851707*n),a=0.2104542553*i+0.793617785*s-0.0040720468*o,c=1.9779984951*i-2.428592205*s+0.4505937099*o,l=0.0259040371*i+0.7827717662*s-0.808675766*o;return[a*100,c*100,l*100]};K.oklab.oklch=function(e){return K.lab.lch(e)};K.oklab.xyz=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=(0.999999998*t+0.396337792*r+0.215803758*n)**3,s=(1.000000008*t-0.105561342*r-0.063854175*n)**3,o=(1.000000055*t-0.089484182*r-1.291485538*n)**3,a=1.227013851*i-0.55779998*s+0.281256149*o,c=-0.040580178*i+1.11225687*s-0.071676679*o,l=-0.076381285*i-0.421481978*s+1.58616322*o;return[a*100,c*100,l*100]};K.oklab.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,i=(t+0.3963377774*r+0.2158037573*n)**3,s=(t-0.1055613458*r-0.0638541728*n)**3,o=(t-0.0894841775*r-1.291485548*n)**3,a=po(4.0767416621*i-3.3077115913*s+0.2309699292*o),c=po(-1.2684380046*i+2.6097574011*s-0.3413193965*o),l=po(-0.0041960863*i-0.7034186147*s+1.707614701*o);return[a*255,c*255,l*255]};K.oklch.oklab=function(e){return K.lch.lab(e)};K.lab.xyz=function(e){let t=e[0],r=e[1],n=e[2],i,s,o;s=(t+16)/116,i=r/500+s,o=s-n/200;let a=s**3,c=i**3,l=o**3;return s=a>Wn?a:(s-0.13793103448275862)/7.787,i=c>Wn?c:(i-0.13793103448275862)/7.787,o=l>Wn?l:(o-0.13793103448275862)/7.787,i*=95.047,s*=100,o*=108.883,[i,s,o]};K.lab.lch=function(e){let t=e[0],r=e[1],n=e[2],i;if(i=Math.atan2(n,r)*360/2/Math.PI,i<0)i+=360;let o=Math.sqrt(r*r+n*n);return[t,o,i]};K.lch.lab=function(e){let t=e[0],r=e[1],i=e[2]/360*2*Math.PI,s=r*Math.cos(i),o=r*Math.sin(i);return[t,s,o]};K.rgb.ansi16=function(e,t=null){let[r,n,i]=e,s=t===null?K.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),s===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));if(s===2)o+=60;return o};K.hsv.ansi16=function(e){return K.rgb.ansi16(K.hsv.rgb(e),e[2])};K.rgb.ansi256=function(e){let t=e[0],r=e[1],n=e[2];if(t>>4===r>>4&&r>>4===n>>4){if(t<8)return 16;if(t>248)return 231;return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};K.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7){if(e>50)t+=3.5;return t=t/10.5*255,[t,t,t]}let r=(Math.trunc(e>50)+1)*0.5,n=(t&1)*r*255,i=(t>>1&1)*r*255,s=(t>>2&1)*r*255;return[n,i,s]};K.ansi256.rgb=function(e){if(e=e[0],e>=232){let s=(e-232)*10+8;return[s,s,s]}e-=16;let t,r=Math.floor(e/36)/5*255,n=Math.floor((t=e%36)/6)/5*255,i=t%6/5*255;return[r,n,i]};K.rgb.hex=function(e){let r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(r.length)+r};K.hex.rgb=function(e){let t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let r=t[0];if(t[0].length===3)r=[...r].map((a)=>a+a).join("");let n=Number.parseInt(r,16),i=n>>16&255,s=n>>8&255,o=n&255;return[i,s,o]};K.rgb.hcg=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.max(Math.max(t,r),n),s=Math.min(Math.min(t,r),n),o=i-s,a,c=o<1?s/(1-o):0;if(o<=0)a=0;else if(i===t)a=(r-n)/o%6;else if(i===r)a=2+(n-t)/o;else a=4+(t-r)/o;return a/=6,a%=1,[a*360,o*100,c*100]};K.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=r<0.5?2*t*r:2*t*(1-r),i=0;if(n<1)i=(r-0.5*n)/(1-n);return[e[0],n*100,i*100]};K.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=t*r,i=0;if(n<1)i=(r-n)/(1-n);return[e[0],n*100,i*100]};K.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],s=t%1*6,o=s%1,a=1-o,c=0;switch(Math.floor(s)){case 0:{i[0]=1,i[1]=o,i[2]=0;break}case 1:{i[0]=a,i[1]=1,i[2]=0;break}case 2:{i[0]=0,i[1]=1,i[2]=o;break}case 3:{i[0]=0,i[1]=a,i[2]=1;break}case 4:{i[0]=o,i[1]=0,i[2]=1;break}default:i[0]=1,i[1]=0,i[2]=a}return c=(1-r)*n,[(r*i[0]+c)*255,(r*i[1]+c)*255,(r*i[2]+c)*255]};K.hcg.hsv=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t),i=0;if(n>0)i=t/n;return[e[0],i*100,n*100]};K.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+0.5*t,i=0;if(n>0&&n<0.5)i=t/(2*n);else if(n>=0.5&&n<1)i=t/(2*(1-n));return[e[0],i*100,n*100]};K.hcg.hwb=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};K.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,i=n-t,s=0;if(i<1)s=(n-i)/(1-i);return[e[0],i*100,s*100]};K.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};K.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};K.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};K.gray.hsl=function(e){return[0,0,e[0]]};K.gray.hsv=K.gray.hsl;K.gray.hwb=function(e){return[0,100,e[0]]};K.gray.cmyk=function(e){return[0,0,0,e[0]]};K.gray.lab=function(e){return[e[0],0,0]};K.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(n.length)+n};K.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function y3(){let e={},t=Object.keys(as);for(let{length:r}=t,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function b3(e){let t=y3(),r=[e];t[e].distance=0;while(r.length>0){let n=r.pop(),i=Object.keys(as[n]);for(let{length:s}=i,o=0;o<s;o++){let a=i[o],c=t[a];if(c.distance===-1)c.distance=t[n].distance+1,c.parent=n,r.unshift(a)}}return t}function x3(e,t){return function(r){return t(e(r))}}function $3(e,t){let r=[t[e].parent,e],n=as[t[e].parent][e],i=t[e].parent;while(t[i].parent)r.unshift(t[i].parent),n=x3(as[t[i].parent][i],n),i=t[i].parent;return n.conversion=r,n}function v3(e){let t=b3(e),r={},n=Object.keys(t);for(let{length:i}=n,s=0;s<i;s++){let o=n[s];if(t[o].parent===null)continue;r[o]=$3(o,t)}return r}var w3=v3,fo={},S3=Object.keys(as);function E3(e){let t=function(...r){let n=r[0];if(n===void 0||n===null)return n;if(n.length>1)r=n;return e(r)};if("conversion"in e)t.conversion=e.conversion;return t}function _3(e){let t=function(...r){let n=r[0];if(n===void 0||n===null)return n;if(n.length>1)r=n;let i=e(r);if(typeof i==="object")for(let{length:s}=i,o=0;o<s;o++)i[o]=Math.round(i[o]);return i};if("conversion"in e)t.conversion=e.conversion;return t}for(let e of S3){fo[e]={},Object.defineProperty(fo[e],"channels",{value:as[e].channels}),Object.defineProperty(fo[e],"labels",{value:as[e].labels});let t=w3(e),r=Object.keys(t);for(let n of r){let i=t[n];fo[e][n]=_3(i),fo[e][n].raw=E3(i)}}var Or=fo,OS=["keyword","gray","hex"],Qp={};for(let e of Object.keys(Or))Qp[[...Or[e].labels].sort().join("")]=e;var Zp={};function St(e,t){if(!(this instanceof St))return new St(e,t);if(t&&t in OS)t=null;if(t&&!(t in Or))throw Error("Unknown model: "+t);let r,n;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof St)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e==="string"){let i=uo.get(e);if(i===null)throw Error("Unable to parse color from string: "+e);this.model=i.model,n=Or[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]==="number"?i.value[n]:1}else if(e.length>0){this.model=t||"rgb",n=Or[this.model].channels;let i=Array.prototype.slice.call(e,0,n);this.color=em(i,n),this.valpha=typeof e[n]==="number"?e[n]:1}else if(typeof e==="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let i=Object.keys(e);if("alpha"in e)i.splice(i.indexOf("alpha"),1),this.valpha=typeof e.alpha==="number"?e.alpha:0;let s=i.sort().join("");if(!(s in Qp))throw Error("Unable to parse color from object: "+JSON.stringify(e));this.model=Qp[s];let{labels:o}=Or[this.model],a=[];for(r=0;r<o.length;r++)a.push(e[o[r]]);this.color=em(a)}if(Zp[this.model]){n=Or[this.model].channels;for(r=0;r<n;r++){let i=Zp[this.model][r];if(i)this.color[r]=i(this.color[r])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}St.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in uo.to?this:this.rgb();t=t.round(typeof e==="number"?e:1);let r=t.valpha===1?t.color:[...t.color,this.valpha];return uo.to[t.model](...r)},percentString(e){let t=this.rgb().round(typeof e==="number"?e:1),r=t.valpha===1?t.color:[...t.color,this.valpha];return uo.to.rgb.percent(...r)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=Or[this.model],{labels:r}=Or[this.model];for(let n=0;n<t;n++)e[r[n]]=this.color[n];if(this.valpha!==1)e.alpha=this.valpha;return e},unitArray(){let e=this.rgb().color;if(e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1)e.push(this.valpha);return e},unitObject(){let e=this.rgb().object();if(e.r/=255,e.g/=255,e.b/=255,this.valpha!==1)e.alpha=this.valpha;return e},round(e){return e=Math.max(e||0,0),new St([...this.color.map(k3(e)),this.valpha],this.model)},alpha(e){if(e!==void 0)return new St([...this.color,Math.max(0,Math.min(1,e))],this.model);return this.valpha},red:ft("rgb",0,vt(255)),green:ft("rgb",1,vt(255)),blue:ft("rgb",2,vt(255)),hue:ft(["hsl","hsv","hsl","hwb","hcg"],0,(e)=>(e%360+360)%360),saturationl:ft("hsl",1,vt(100)),lightness:ft("hsl",2,vt(100)),saturationv:ft("hsv",1,vt(100)),value:ft("hsv",2,vt(100)),chroma:ft("hcg",1,vt(100)),gray:ft("hcg",2,vt(100)),white:ft("hwb",1,vt(100)),wblack:ft("hwb",2,vt(100)),cyan:ft("cmyk",0,vt(100)),magenta:ft("cmyk",1,vt(100)),yellow:ft("cmyk",2,vt(100)),black:ft("cmyk",3,vt(100)),x:ft("xyz",0,vt(95.047)),y:ft("xyz",1,vt(100)),z:ft("xyz",2,vt(108.833)),l:ft("lab",0,vt(100)),a:ft("lab",1),b:ft("lab",2),keyword(e){if(e!==void 0)return new St(e);return Or[this.model].keyword(this.color)},hex(e){if(e!==void 0)return new St(e);return uo.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new St(e);let t=this.rgb().round().color,r=Math.round(this.valpha*255).toString(16).toUpperCase();if(r.length===1)r="0"+r;return uo.to.hex(...t)+r},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[r,n]of e.entries()){let i=n/255;t[r]=i<=0.04045?i/12.92:((i+0.055)/1.055)**2.4}return 0.2126*t[0]+0.7152*t[1]+0.0722*t[2]},contrast(e){let t=this.luminosity(),r=e.luminosity();if(t>r)return(t+0.05)/(r+0.05);return(r+0.05)/(t+0.05)},level(e){let t=this.contrast(e);if(t>=7)return"AAA";return t>=4.5?"AA":""},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*0.3+e[1]*0.59+e[2]*0.11;return St.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),r=t.color[0];return r=(r+e)%360,r=r<0?360+r:r,t.color[0]=r,t},mix(e,t){if(!e||!e.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);let r=e.rgb(),n=this.rgb(),i=t===void 0?0.5:t,s=2*i-1,o=r.alpha()-n.alpha(),a=((s*o===-1?s:(s+o)/(1+s*o))+1)/2,c=1-a;return St.rgb(a*r.red()+c*n.red(),a*r.green()+c*n.green(),a*r.blue()+c*n.blue(),r.alpha()*i+n.alpha()*(1-i))}};for(let e of Object.keys(Or)){if(OS.includes(e))continue;let{channels:t}=Or[e];St.prototype[e]=function(...r){if(this.model===e)return new St(this);if(r.length>0)return new St(r,e);return new St([...A3(Or[this.model][e].raw(this.color)),this.valpha],e)},St[e]=function(...r){let n=r[0];if(typeof n==="number")n=em(r,t);return new St(n,e)}}function P3(e,t){return Number(e.toFixed(t))}function k3(e){return function(t){return P3(t,e)}}function ft(e,t,r){e=Array.isArray(e)?e:[e];for(let n of e)(Zp[n]||=[])[t]=r;return e=e[0],function(n){let i;if(n!==void 0){if(r)n=r(n);return i=this[e](),i.color[t]=n,i}if(i=this[e]().color[t],r)i=r(i);return i}}function vt(e){return function(t){return Math.max(0,Math.min(e,t))}}function A3(e){return Array.isArray(e)?e:[e]}function em(e,t){for(let r=0;r<t;r++)if(typeof e[r]!=="number")e[r]=0;return e}var j3=St});var NS=C(function(uie,TS){TS.exports=IS().default});function R3(e){return this._setBackgroundColourOption("tint",e),this}function O3(e){return this.options.greyscale=f.bool(e)?e:!0,this}function C3(e){return this.greyscale(e)}function I3(e){if(!f.string(e))throw f.invalidParameterError("colourspace","string",e);return this.options.colourspacePipeline=e,this}function T3(e){return this.pipelineColourspace(e)}function N3(e){if(!f.string(e))throw f.invalidParameterError("colourspace","string",e);return this.options.colourspace=e,this}function M3(e){return this.toColourspace(e)}function DS(e){if(f.object(e)||f.string(e)&&e.length>=3&&e.length<=200){let t=LS.default(e),r=t.red(),n=t.green(),i=t.blue(),s=Math.round(t.alpha()*255);for(let[o,a]of[["red",r],["green",n],["blue",i],["alpha",s]])if(!f.number(a))throw f.invalidParameterError(`background.${o}`,"number",a);return[r,n,i,s]}else throw f.invalidParameterError("background","object or string",e)}function L3(e,t){if(f.defined(t))this.options[e]=DS(t)}var LS,MS,JS=(e)=>{Object.assign(e.prototype,{tint:R3,greyscale:O3,grayscale:C3,pipelineColourspace:I3,pipelineColorspace:T3,toColourspace:N3,toColorspace:M3,_getBackgroundColourOption:DS,_setBackgroundColourOption:L3}),e.colourspace=MS,e.colorspace=MS};var FS=L(()=>{gn();LS=Bt(NS(),1);/*!
353
+ */i$={integer:"integer",float:"float",approximate:"approximate"}});var p$=C(function(jK,f$){var{defineProperty:Sd,getOwnPropertyDescriptor:I2,getOwnPropertyNames:M2}=Object,J2=Object.prototype.hasOwnProperty,D2=(e,t)=>{for(var r in t)Sd(e,r,{get:t[r],enumerable:!0})},L2=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let s of M2(t))if(!J2.call(e,s)&&s!==r)Sd(e,s,{get:()=>t[s],enumerable:!(n=I2(t,s))||n.enumerable})}return e},F2=(e)=>L2(Sd({},"__esModule",{value:!0}),e),l$={};D2(l$,{default:()=>eM});f$.exports=F2(l$);var xd={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 xd)Object.freeze(xd[e]);var Br=Object.freeze(xd),c$=Object.create(null);for(let e in Br)if(Object.hasOwn(Br,e))c$[Br[e]]=e;var Wt={to:{},get:{}};Wt.get=function(e){let t=e.slice(0,3).toLowerCase(),r,n;switch(t){case"hsl":{r=Wt.get.hsl(e),n="hsl";break}case"hwb":{r=Wt.get.hwb(e),n="hwb";break}default:{r=Wt.get.rgb(e),n="rgb";break}}if(!r)return null;return{model:n,value:r}};Wt.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(Br,a[1]))return null;return o=Br[a[1]].slice(),o[3]=1,o}else return null;for(l=0;l<3;l++)o[l]=Fn(o[l],0,255);return o[3]=Fn(o[3],0,1),o};Wt.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=Fn(Number.parseFloat(r[2]),0,100),o=Fn(Number.parseFloat(r[3]),0,100),a=Fn(Number.isNaN(n)?1:n,0,1);return[s,i,o,a]}return null};Wt.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=Fn(Number.parseFloat(r[2]),0,100),o=Fn(Number.parseFloat(r[3]),0,100),a=Fn(Number.isNaN(n)?1:n,0,1);return[s,i,o,a]}return null};Wt.to.hex=function(...e){return"#"+vl(e[0])+vl(e[1])+vl(e[2])+(e[3]<1?vl(Math.round(e[3]*255)):"")};Wt.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]+")"};Wt.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]+")"};Wt.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]+")"};Wt.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+")"};Wt.to.keyword=function(...e){return c$[e.slice(0,3)]};function Fn(e,t,r){return Math.min(Math.max(t,e),r)}function vl(e){let t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var ci=Wt,u$={};for(let e of Object.keys(Br))u$[Br[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 q2(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=u$[e];if(t)return t;let r=Number.POSITIVE_INFINITY,n;for(let s of Object.keys(Br)){let i=Br[s],o=q2(e,i);if(o<r)r=o,n=s}return n};K.keyword.rgb=function(e){return[...Br[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 H2(){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 V2(e){let t=H2(),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 B2(e,t){return function(r){return t(e(r))}}function W2(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=B2(Ss[t[s].parent][s],n),s=t[s].parent;return n.conversion=r,n}function U2(e){let t=V2(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]=W2(o,t)}return r}var z2=U2,ui={},G2=Object.keys(Ss);function K2(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 Y2(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 G2){ui[e]={},Object.defineProperty(ui[e],"channels",{value:Ss[e].channels}),Object.defineProperty(ui[e],"labels",{value:Ss[e].labels});let t=z2(e),r=Object.keys(t);for(let n of r){let s=t[n];ui[e][n]=Y2(s),ui[e][n].raw=K2(s)}}var ar=ui,d$=["keyword","gray","hex"],$d={};for(let e of Object.keys(ar))$d[[...ar[e].labels].sort().join("")]=e;var vd={};function ft(e,t){if(!(this instanceof ft))return new ft(e,t);if(t&&t in d$)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=wd(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 $d))throw Error("Unable to parse color from object: "+JSON.stringify(e));this.model=$d[i];let{labels:o}=ar[this.model],a=[];for(r=0;r<o.length;r++)a.push(e[o[r]]);this.color=wd(a)}if(vd[this.model]){n=ar[this.model].channels;for(r=0;r<n;r++){let s=vd[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(d$.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([...Q2(ar[this.model][e].raw(this.color)),this.valpha],e)},ft[e]=function(...r){let n=r[0];if(typeof n==="number")n=wd(r,t);return new ft(n,e)}}function X2(e,t){return Number(e.toFixed(t))}function Z2(e){return function(t){return X2(t,e)}}function et(e,t,r){e=Array.isArray(e)?e:[e];for(let n of e)(vd[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 Q2(e){return Array.isArray(e)?e:[e]}function wd(e,t){for(let r=0;r<t;r++)if(typeof e[r]!=="number")e[r]=0;return e}var eM=ft});var h$=C(function(kK,m$){m$.exports=p$().default});function tM(e){return this._setBackgroundColourOption("tint",e),this}function rM(e){return this.options.greyscale=u.bool(e)?e:!0,this}function nM(e){return this.greyscale(e)}function sM(e){if(!u.string(e))throw u.invalidParameterError("colourspace","string",e);return this.options.colourspacePipeline=e,this}function iM(e){return this.pipelineColourspace(e)}function oM(e){if(!u.string(e))throw u.invalidParameterError("colourspace","string",e);return this.options.colourspace=e,this}function aM(e){return this.toColourspace(e)}function b$(e){if(u.object(e)||u.string(e)&&e.length>=3&&e.length<=200){let t=y$.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 lM(e,t){if(u.defined(t))this.options[e]=b$(t)}var y$,g$,x$=(e)=>{Object.assign(e.prototype,{tint:tM,greyscale:rM,grayscale:nM,pipelineColourspace:sM,pipelineColorspace:iM,toColourspace:oM,toColorspace:aM,_getBackgroundColourOption:b$,_setBackgroundColourOption:lM}),e.colourspace=g$,e.colorspace=g$};var $$=q(()=>{Dr();y$=Lt(h$(),1);/*!
395
354
  Copyright 2013 Lovell Fuller and others.
396
355
  SPDX-License-Identifier: Apache-2.0
397
- */MS={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"}});function J3(){return this.options.removeAlpha=!0,this}function F3(e){if(f.defined(e))if(f.number(e)&&f.inRange(e,0,1))this.options.ensureAlpha=e;else throw f.invalidParameterError("alpha","number between 0 and 1",e);else this.options.ensureAlpha=1;return this}function q3(e){let t={red:0,green:1,blue:2,alpha:3};if(Object.keys(t).includes(e))e=t[e];if(f.integer(e)&&f.inRange(e,0,4))this.options.extractChannel=e;else throw f.invalidParameterError("channel","integer or one of: red, green, blue, alpha",e);return this}function B3(e,t){if(Array.isArray(e))e.forEach(function(r){this.options.joinChannelIn.push(this._createInputDescriptor(r,t))},this);else this.options.joinChannelIn.push(this._createInputDescriptor(e,t));return this}function H3(e){if(f.string(e)&&f.inArray(e,["and","or","eor"]))this.options.bandBoolOp=e;else throw f.invalidParameterError("boolOp","one of: and, or, eor",e);return this}var D3,qS=(e)=>{Object.assign(e.prototype,{removeAlpha:J3,ensureAlpha:F3,extractChannel:q3,joinChannel:B3,bandbool:H3}),e.bool=D3};var BS=L(()=>{gn();/*!
356
+ */g$={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"}});function uM(){return this.options.removeAlpha=!0,this}function dM(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 fM(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 pM(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 mM(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 cM,v$=(e)=>{Object.assign(e.prototype,{removeAlpha:uM,ensureAlpha:dM,extractChannel:fM,joinChannel:pM,bandbool:mM}),e.bool=cM};var w$=q(()=>{Dr();/*!
398
357
  Copyright 2013 Lovell Fuller and others.
399
358
  SPDX-License-Identifier: Apache-2.0
400
- */D3={and:"and",or:"or",eor:"eor"}});import rm from"node:path";function V3(e,t){let r;if(!f.string(e))r=Error("Missing output file path");else if(f.string(this.options.input.file)&&rm.resolve(this.options.input.file)===rm.resolve(e))r=Error("Cannot use same file for input and output");else if(U3.test(rm.extname(e))&&!this.constructor.format.jp2.output.file)r=US();if(r)if(f.fn(t))t(r);else return Promise.reject(r);else{this.options.fileOut=e;let n=Error();return this._pipeline(t,n)}return this}function W3(e,t){if(f.object(e))this._setBooleanOption("resolveWithObject",e.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let r=Error();return this._pipeline(f.fn(e)?e:t,r)}function z3(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let e=Error();return this._pipeline(null,e)}function K3(e){if(f.number(e)&&e>0)this.options.withMetadataDensity=e;else throw f.invalidParameterError("density","positive number",e);return this.keepExif()}function G3(){return this.options.keepMetadata|=1,this}function Y3(e){if(f.object(e))for(let[t,r]of Object.entries(e))if(f.object(r))for(let[n,i]of Object.entries(r))if(f.string(i))this.options.withExif[`exif-${t.toLowerCase()}-${n}`]=i;else throw f.invalidParameterError(`${t}.${n}`,"string",i);else throw f.invalidParameterError(t,"object",r);else throw f.invalidParameterError("exif","object",e);return this.options.withExifMerge=!1,this.keepExif()}function X3(e){return this.withExif(e),this.options.withExifMerge=!0,this}function Q3(){return this.options.keepMetadata|=8,this}function Z3(e,t){if(f.string(e))this.options.withIccProfile=e;else throw f.invalidParameterError("icc","string",e);if(this.keepIccProfile(),f.object(t)){if(f.defined(t.attach))if(f.bool(t.attach)){if(!t.attach)this.options.keepMetadata&=-9}else throw f.invalidParameterError("attach","boolean",t.attach)}return this}function eB(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function tB(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function rB(){return this.options.keepMetadata|=2,this}function nB(e){if(f.string(e)&&e.length>0)this.options.withXmp=e,this.options.keepMetadata|=2;else throw f.invalidParameterError("xmp","non-empty string",e);return this}function iB(){return this.options.keepMetadata|=31,this}function sB(e){if(this.keepMetadata(),this.withIccProfile("srgb"),f.object(e)){if(f.defined(e.orientation))if(f.integer(e.orientation)&&f.inRange(e.orientation,1,8))this.options.withMetadataOrientation=e.orientation;else throw f.invalidParameterError("orientation","integer between 1 and 8",e.orientation);if(f.defined(e.density))if(f.number(e.density)&&e.density>0)this.options.withMetadataDensity=e.density;else throw f.invalidParameterError("density","positive number",e.density);if(f.defined(e.icc))this.withIccProfile(e.icc);if(f.defined(e.exif))this.withExifMerge(e.exif)}return this}function oB(e,t){let r=HS.get((f.object(e)&&f.string(e.id)?e.id:e).toLowerCase());if(!r)throw f.invalidParameterError("format",`one of: ${[...HS.keys()].join(", ")}`,e);return this[r](t)}function aB(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jpegQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.progressive))this._setBooleanOption("jpegProgressive",e.progressive);if(f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);let t=f.bool(e.optimizeCoding)?e.optimizeCoding:e.optimiseCoding;if(f.defined(t))this._setBooleanOption("jpegOptimiseCoding",t);if(f.defined(e.mozjpeg))if(f.bool(e.mozjpeg)){if(e.mozjpeg)this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3}else throw f.invalidParameterError("mozjpeg","boolean",e.mozjpeg);let r=f.bool(e.trellisQuantization)?e.trellisQuantization:e.trellisQuantisation;if(f.defined(r))this._setBooleanOption("jpegTrellisQuantisation",r);if(f.defined(e.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",e.overshootDeringing);let n=f.bool(e.optimizeScans)?e.optimizeScans:e.optimiseScans;if(f.defined(n)){if(this._setBooleanOption("jpegOptimiseScans",n),n)this.options.jpegProgressive=!0}let i=f.number(e.quantizationTable)?e.quantizationTable:e.quantisationTable;if(f.defined(i))if(f.integer(i)&&f.inRange(i,0,8))this.options.jpegQuantisationTable=i;else throw f.invalidParameterError("quantisationTable","integer between 0 and 8",i)}return this._updateFormatOut("jpeg",e)}function cB(e){if(f.object(e)){if(f.defined(e.progressive))this._setBooleanOption("pngProgressive",e.progressive);if(f.defined(e.compressionLevel))if(f.integer(e.compressionLevel)&&f.inRange(e.compressionLevel,0,9))this.options.pngCompressionLevel=e.compressionLevel;else throw f.invalidParameterError("compressionLevel","integer between 0 and 9",e.compressionLevel);if(f.defined(e.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",e.adaptiveFiltering);let t=e.colours||e.colors;if(f.defined(t))if(f.integer(t)&&f.inRange(t,2,256))this.options.pngBitdepth=VS(t);else throw f.invalidParameterError("colours","integer between 2 and 256",t);if(f.defined(e.palette))this._setBooleanOption("pngPalette",e.palette);else if([e.quality,e.effort,e.colours,e.colors,e.dither].some(f.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,0,100))this.options.pngQuality=e.quality;else throw f.invalidParameterError("quality","integer between 0 and 100",e.quality);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,10))this.options.pngEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 10",e.effort);if(f.defined(e.dither))if(f.number(e.dither)&&f.inRange(e.dither,0,1))this.options.pngDither=e.dither;else throw f.invalidParameterError("dither","number between 0.0 and 1.0",e.dither)}}return this._updateFormatOut("png",e)}function lB(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.webpQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.alphaQuality))if(f.integer(e.alphaQuality)&&f.inRange(e.alphaQuality,0,100))this.options.webpAlphaQuality=e.alphaQuality;else throw f.invalidParameterError("alphaQuality","integer between 0 and 100",e.alphaQuality);if(f.defined(e.lossless))this._setBooleanOption("webpLossless",e.lossless);if(f.defined(e.nearLossless))this._setBooleanOption("webpNearLossless",e.nearLossless);if(f.defined(e.smartSubsample))this._setBooleanOption("webpSmartSubsample",e.smartSubsample);if(f.defined(e.smartDeblock))this._setBooleanOption("webpSmartDeblock",e.smartDeblock);if(f.defined(e.preset))if(f.string(e.preset)&&f.inArray(e.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=e.preset;else throw f.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",e.preset);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,0,6))this.options.webpEffort=e.effort;else throw f.invalidParameterError("effort","integer between 0 and 6",e.effort);if(f.defined(e.minSize))this._setBooleanOption("webpMinSize",e.minSize);if(f.defined(e.mixed))this._setBooleanOption("webpMixed",e.mixed);if(f.defined(e.exact))this._setBooleanOption("webpExact",e.exact)}return nm(e,this.options),this._updateFormatOut("webp",e)}function uB(e){if(f.object(e)){if(f.defined(e.reuse))this._setBooleanOption("gifReuse",e.reuse);if(f.defined(e.progressive))this._setBooleanOption("gifProgressive",e.progressive);let t=e.colours||e.colors;if(f.defined(t))if(f.integer(t)&&f.inRange(t,2,256))this.options.gifBitdepth=VS(t);else throw f.invalidParameterError("colours","integer between 2 and 256",t);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,10))this.options.gifEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 10",e.effort);if(f.defined(e.dither))if(f.number(e.dither)&&f.inRange(e.dither,0,1))this.options.gifDither=e.dither;else throw f.invalidParameterError("dither","number between 0.0 and 1.0",e.dither);if(f.defined(e.interFrameMaxError))if(f.number(e.interFrameMaxError)&&f.inRange(e.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=e.interFrameMaxError;else throw f.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",e.interFrameMaxError);if(f.defined(e.interPaletteMaxError))if(f.number(e.interPaletteMaxError)&&f.inRange(e.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=e.interPaletteMaxError;else throw f.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",e.interPaletteMaxError);if(f.defined(e.keepDuplicateFrames))if(f.bool(e.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",e.keepDuplicateFrames);else throw f.invalidParameterError("keepDuplicateFrames","boolean",e.keepDuplicateFrames)}return nm(e,this.options),this._updateFormatOut("gif",e)}function fB(e){if(!this.constructor.format.jp2.output.buffer)throw US();if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jp2Quality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.jp2Lossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.tileWidth))if(f.integer(e.tileWidth)&&f.inRange(e.tileWidth,1,32768))this.options.jp2TileWidth=e.tileWidth;else throw f.invalidParameterError("tileWidth","integer between 1 and 32768",e.tileWidth);if(f.defined(e.tileHeight))if(f.integer(e.tileHeight)&&f.inRange(e.tileHeight,1,32768))this.options.jp2TileHeight=e.tileHeight;else throw f.invalidParameterError("tileHeight","integer between 1 and 32768",e.tileHeight);if(f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling)}return this._updateFormatOut("jp2",e)}function nm(e,t){if(f.object(e)&&f.defined(e.loop))if(f.integer(e.loop)&&f.inRange(e.loop,0,65535))t.loop=e.loop;else throw f.invalidParameterError("loop","integer between 0 and 65535",e.loop);if(f.object(e)&&f.defined(e.delay))if(f.integer(e.delay)&&f.inRange(e.delay,0,65535))t.delay=[e.delay];else if(Array.isArray(e.delay)&&f.inRange(e.delay.length,1,1e6)&&e.delay.every(f.integer)&&e.delay.every((r)=>f.inRange(r,0,65535)))t.delay=e.delay;else throw f.invalidParameterError("delay","integer or an array of integers between 0 and 65535",e.delay)}function dB(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.tiffQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.bitdepth))if(f.integer(e.bitdepth)&&f.inArray(e.bitdepth,[1,2,4]))this.options.tiffBitdepth=e.bitdepth;else throw f.invalidParameterError("bitdepth","1, 2 or 4",e.bitdepth);if(f.defined(e.tile))this._setBooleanOption("tiffTile",e.tile);if(f.defined(e.tileWidth))if(f.integer(e.tileWidth)&&f.inRange(e.tileWidth,1,32768))this.options.tiffTileWidth=e.tileWidth;else throw f.invalidParameterError("tileWidth","integer between 1 and 32768",e.tileWidth);if(f.defined(e.tileHeight))if(f.integer(e.tileHeight)&&f.inRange(e.tileHeight,1,32768))this.options.tiffTileHeight=e.tileHeight;else throw f.invalidParameterError("tileHeight","integer between 1 and 32768",e.tileHeight);if(f.defined(e.miniswhite))this._setBooleanOption("tiffMiniswhite",e.miniswhite);if(f.defined(e.pyramid))this._setBooleanOption("tiffPyramid",e.pyramid);if(f.defined(e.xres))if(f.number(e.xres)&&f.inRange(e.xres,0.001,1e6))this.options.tiffXres=e.xres;else throw f.invalidParameterError("xres","number between 0.001 and 1000000",e.xres);if(f.defined(e.yres))if(f.number(e.yres)&&f.inRange(e.yres,0.001,1e6))this.options.tiffYres=e.yres;else throw f.invalidParameterError("yres","number between 0.001 and 1000000",e.yres);if(f.defined(e.compression))if(f.string(e.compression)&&f.inArray(e.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=e.compression;else throw f.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",e.compression);if(f.defined(e.bigtiff))this._setBooleanOption("tiffBigtiff",e.bigtiff);if(f.defined(e.predictor))if(f.string(e.predictor)&&f.inArray(e.predictor,["none","horizontal","float"]))this.options.tiffPredictor=e.predictor;else throw f.invalidParameterError("predictor","one of: none, horizontal, float",e.predictor);if(f.defined(e.resolutionUnit))if(f.string(e.resolutionUnit)&&f.inArray(e.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=e.resolutionUnit;else throw f.invalidParameterError("resolutionUnit","one of: inch, cm",e.resolutionUnit)}return this._updateFormatOut("tiff",e)}function pB(e){return this.heif({...e,compression:"av1"})}function mB(e){if(f.object(e)){if(f.string(e.compression)&&f.inArray(e.compression,["av1","hevc"]))this.options.heifCompression=e.compression;else throw f.invalidParameterError("compression","one of: av1, hevc",e.compression);if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.heifQuality=e.quality;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.heifLossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,0,9))this.options.heifEffort=e.effort;else throw f.invalidParameterError("effort","integer between 0 and 9",e.effort);if(f.defined(e.chromaSubsampling))if(f.string(e.chromaSubsampling)&&f.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=e.chromaSubsampling;else throw f.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);if(f.defined(e.bitdepth))if(f.integer(e.bitdepth)&&f.inArray(e.bitdepth,[8,10,12]))this.options.heifBitdepth=e.bitdepth;else throw f.invalidParameterError("bitdepth","8, 10 or 12",e.bitdepth);if(f.defined(e.tune))if(f.string(e.tune)&&f.inArray(e.tune,["auto","iq","psnr","ssim"]))if(this.options.heifLossless&&e.tune==="iq")this.options.heifTune="ssim";else this.options.heifTune=e.tune;else throw f.invalidParameterError("tune","one of: auto, iq, psnr, ssim",e.tune)}else throw f.invalidParameterError("options","Object",e);return this._updateFormatOut("heif",e)}function hB(e){if(f.object(e)){if(f.defined(e.quality))if(f.integer(e.quality)&&f.inRange(e.quality,1,100))this.options.jxlDistance=e.quality>=30?0.1+(100-e.quality)*0.09:0.017666666666666667*e.quality*e.quality-1.15*e.quality+25;else throw f.invalidParameterError("quality","integer between 1 and 100",e.quality);else if(f.defined(e.distance))if(f.number(e.distance)&&f.inRange(e.distance,0,15))this.options.jxlDistance=e.distance;else throw f.invalidParameterError("distance","number between 0.0 and 15.0",e.distance);if(f.defined(e.decodingTier))if(f.integer(e.decodingTier)&&f.inRange(e.decodingTier,0,4))this.options.jxlDecodingTier=e.decodingTier;else throw f.invalidParameterError("decodingTier","integer between 0 and 4",e.decodingTier);if(f.defined(e.lossless))if(f.bool(e.lossless))this.options.jxlLossless=e.lossless;else throw f.invalidParameterError("lossless","boolean",e.lossless);if(f.defined(e.effort))if(f.integer(e.effort)&&f.inRange(e.effort,1,9))this.options.jxlEffort=e.effort;else throw f.invalidParameterError("effort","integer between 1 and 9",e.effort)}return nm(e,this.options),this._updateFormatOut("jxl",e)}function gB(e){if(f.object(e)){if(f.defined(e.depth))if(f.string(e.depth)&&f.inArray(e.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=e.depth;else throw f.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",e.depth)}return this._updateFormatOut("raw")}function yB(e){if(f.object(e)){if(f.defined(e.size))if(f.integer(e.size)&&f.inRange(e.size,1,8192))this.options.tileSize=e.size;else throw f.invalidParameterError("size","integer between 1 and 8192",e.size);if(f.defined(e.overlap))if(f.integer(e.overlap)&&f.inRange(e.overlap,0,8192)){if(e.overlap>this.options.tileSize)throw f.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,e.overlap);this.options.tileOverlap=e.overlap}else throw f.invalidParameterError("overlap","integer between 0 and 8192",e.overlap);if(f.defined(e.container))if(f.string(e.container)&&f.inArray(e.container,["fs","zip"]))this.options.tileContainer=e.container;else throw f.invalidParameterError("container","one of: fs, zip",e.container);if(f.defined(e.layout))if(f.string(e.layout)&&f.inArray(e.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=e.layout;else throw f.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",e.layout);if(f.defined(e.angle))if(f.integer(e.angle)&&!(e.angle%90))this.options.tileAngle=e.angle;else throw f.invalidParameterError("angle","positive/negative multiple of 90",e.angle);if(this._setBackgroundColourOption("tileBackground",e.background),f.defined(e.depth))if(f.string(e.depth)&&f.inArray(e.depth,["onepixel","onetile","one"]))this.options.tileDepth=e.depth;else throw f.invalidParameterError("depth","one of: onepixel, onetile, one",e.depth);if(f.defined(e.skipBlanks))if(f.integer(e.skipBlanks)&&f.inRange(e.skipBlanks,-1,65535))this.options.tileSkipBlanks=e.skipBlanks;else throw f.invalidParameterError("skipBlanks","integer between -1 and 255/65535",e.skipBlanks);else if(f.defined(e.layout)&&e.layout==="google")this.options.tileSkipBlanks=5;let t=f.bool(e.center)?e.center:e.centre;if(f.defined(t))this._setBooleanOption("tileCentre",t);if(f.defined(e.id))if(f.string(e.id))this.options.tileId=e.id;else throw f.invalidParameterError("id","string",e.id);if(f.defined(e.basename))if(f.string(e.basename))this.options.tileBasename=e.basename;else throw f.invalidParameterError("basename","string",e.basename)}if(f.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw f.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function bB(e){if(!f.plainObject(e))throw f.invalidParameterError("options","object",e);if(f.integer(e.seconds)&&f.inRange(e.seconds,0,3600))this.options.timeoutSeconds=e.seconds;else throw f.invalidParameterError("seconds","integer between 0 and 3600",e.seconds);return this}function xB(e,t){if(!(f.object(t)&&t.force===!1))this.options.formatOut=e;return this}function $B(e,t){if(f.bool(t))this.options[e]=t;else throw f.invalidParameterError(e,"boolean",t)}function vB(){if(!this.options.streamOut){this.options.streamOut=!0;let e=Error();this._pipeline(void 0,e)}}function wB(e,t){if(typeof e==="function"){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.pipeline(this.options,(r,n,i)=>{if(r)e(f.nativeError(r,t));else e(null,n,i)})});else Le.pipeline(this.options,(r,n,i)=>{if(r)e(f.nativeError(r,t));else e(null,n,i)});return this}else if(this.options.streamOut){if(this._isStreamInput())this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.pipeline(this.options,(r,n,i)=>{if(r)this.emit("error",f.nativeError(r,t));else this.emit("info",i),this.push(n);this.push(null),this.on("end",()=>this.emit("close"))})});else Le.pipeline(this.options,(r,n,i)=>{if(r)this.emit("error",f.nativeError(r,t));else this.emit("info",i),this.push(n);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((r,n)=>{this._whenStreamInFinished(()=>{this._flattenBufferIn(),Le.pipeline(this.options,(i,s,o)=>{if(i)n(f.nativeError(i,t));else if(this.options.resolveWithObject)r({data:s,info:o});else r(s)})})});else return new Promise((r,n)=>{Le.pipeline(this.options,(i,s,o)=>{if(i)n(f.nativeError(i,t));else if(this.options.resolveWithObject)r({data:s,info:o});else r(s)})})}var HS,U3,US=()=>Error("JP2 output requires libvips with support for OpenJPEG"),VS=(e)=>1<<32-Math.clz32(Math.ceil(Math.log2(e))-1),WS=(e)=>{Object.assign(e.prototype,{toFile:V3,toBuffer:W3,toUint8Array:z3,withDensity:K3,keepExif:G3,withExif:Y3,withExifMerge:X3,keepIccProfile:Q3,withIccProfile:Z3,keepGainMap:eB,withGainMap:tB,keepXmp:rB,withXmp:nB,keepMetadata:iB,withMetadata:sB,toFormat:oB,jpeg:aB,jp2:fB,png:cB,webp:lB,tiff:dB,avif:pB,heif:mB,jxl:hB,gif:uB,raw:gB,tile:yB,timeout:bB,_updateFormatOut:xB,_setBooleanOption:$B,_read:vB,_pipeline:wB})};var zS=L(()=>{gn();Oa();/*!
359
+ */cM={and:"and",or:"or",eor:"eor"}});import Ed from"node:path";function gM(e,t){let r;if(!u.string(e))r=Error("Missing output file path");else if(u.string(this.options.input.file)&&Ed.resolve(this.options.input.file)===Ed.resolve(e))r=Error("Cannot use same file for input and output");else if(hM.test(Ed.extname(e))&&!this.constructor.format.jp2.output.file)r=E$();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 yM(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 bM(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let e=Error();return this._pipeline(null,e)}function xM(e){if(u.number(e)&&e>0)this.options.withMetadataDensity=e;else throw u.invalidParameterError("density","positive number",e);return this.keepExif()}function $M(){return this.options.keepMetadata|=1,this}function vM(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 wM(e){return this.withExif(e),this.options.withExifMerge=!0,this}function SM(){return this.options.keepMetadata|=8,this}function EM(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 PM(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function jM(){return this.options.keepMetadata|=2,this}function kM(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 RM(){return this.options.keepMetadata|=31,this}function AM(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 OM(e,t){let r=S$.get((u.object(e)&&u.string(e.id)?e.id:e).toLowerCase());if(!r)throw u.invalidParameterError("format",`one of: ${[...S$.keys()].join(", ")}`,e);return this[r](t)}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.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 NM(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=_$(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 TM(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 _d(e,this.options),this._updateFormatOut("webp",e)}function IM(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=_$(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 _d(e,this.options),this._updateFormatOut("gif",e)}function MM(e){if(!this.constructor.format.jp2.output.buffer)throw E$();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 _d(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 JM(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 DM(e){return this.heif({...e,compression:"av1"})}function LM(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 FM(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 _d(e,this.options),this._updateFormatOut("jxl",e)}function qM(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 HM(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 VM(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 BM(e,t){if(!(u.object(t)&&t.force===!1))this.options.formatOut=e;return this}function WM(e,t){if(u.bool(t))this.options[e]=t;else throw u.invalidParameterError(e,"boolean",t)}function UM(){if(!this.options.streamOut){this.options.streamOut=!0;let e=Error();this._pipeline(void 0,e)}}function zM(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 S$,hM,E$=()=>Error("JP2 output requires libvips with support for OpenJPEG"),_$=(e)=>1<<32-Math.clz32(Math.ceil(Math.log2(e))-1),P$=(e)=>{Object.assign(e.prototype,{toFile:gM,toBuffer:yM,toUint8Array:bM,withDensity:xM,keepExif:$M,withExif:vM,withExifMerge:wM,keepIccProfile:SM,withIccProfile:EM,keepGainMap:_M,withGainMap:PM,keepXmp:jM,withXmp:kM,keepMetadata:RM,withMetadata:AM,toFormat:OM,jpeg:CM,jp2:MM,png:NM,webp:TM,tiff:JM,avif:DM,heif:LM,jxl:FM,gif:IM,raw:qM,tile:HM,timeout:VM,_updateFormatOut:BM,_setBooleanOption:WM,_read:UM,_pipeline:zM})};var j$=q(()=>{Dr();bo();/*!
401
360
  Copyright 2013 Lovell Fuller and others.
402
361
  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"]]),U3=/\.(jp[2x]|j2[kc])$/i});import SB from"node:events";import{createRequire as EB}from"node:module";import{availableParallelism as _B}from"node:os";function GS(e){if(f.bool(e))if(e)return Le.cache(50,20,100);else return Le.cache(0,0,0);else if(f.object(e)){for(let t of["memory","files","items"]){let r=e[t];if(f.defined(r)&&!(f.integer(r)&&r>=0))throw f.invalidParameterError(t,"a positive integer",r)}return Le.cache(e.memory,e.files,e.items)}else return Le.cache()}function kB(e){return Le.concurrency(f.integer(e)?e:null)}function jB(){return Le.counters()}function RB(e){return Le.simd(f.bool(e)?e:null)}function OB(e){if(f.object(e))if(Array.isArray(e.operation)&&e.operation.every(f.string))Le.block(e.operation,!0);else throw f.invalidParameterError("operation","Array<string>",e.operation);else throw f.invalidParameterError("options","object",e)}function CB(e){if(f.object(e))if(Array.isArray(e.operation)&&e.operation.every(f.string))Le.block(e.operation,!1);else throw f.invalidParameterError("operation","Array<string>",e.operation);else throw f.invalidParameterError("options","object",e)}var Ca,im,KS,sm,xi,PB,ho,AB,YS=(e)=>{e.cache=GS,e.concurrency=kB,e.counters=jB,e.simd=RB,e.format=xi,e.interpolators=PB,e.versions=ho,e.queue=AB,e.block=OB,e.unblock=CB};var XS=L(()=>{gn();Wp();Oa();Xl();Ca=Bt(Ll(),1);/*!
362
+ */S$=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"]]),hM=/\.(jp[2x]|j2[kc])$/i});import GM from"node:events";import{createRequire as KM}from"node:module";import{availableParallelism as YM}from"node:os";function R$(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 eJ(){return Oe.counters()}function tJ(e){return Oe.simd(u.bool(e)?e:null)}function rJ(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 nJ(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 xo,Pd,k$,jd,qn,XM,pi,QM,A$=(e)=>{e.cache=R$,e.concurrency=ZM,e.counters=eJ,e.simd=tJ,e.format=qn,e.interpolators=XM,e.versions=pi,e.queue=QM,e.block=rJ,e.unblock=nJ};var O$=q(()=>{Dr();md();bo();yl();xo=Lt(nl(),1);/*!
404
363
  Copyright 2013 Lovell Fuller and others.
405
364
  SPDX-License-Identifier: Apache-2.0
406
- */im=EB(import.meta.url),KS=Ql.runtimePlatformArch(),sm=Le.libvipsVersion(),xi=Le.format();xi.heif.output.alias=["avif","heic"];xi.jpeg.output.alias=["jpe","jpg"];xi.tiff.output.alias=["tif"];xi.jp2.output.alias=["j2c","j2k","jp2","jpx"];PB={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},ho={vips:sm.semver};if(!sm.isGlobal)if(!sm.isWasm)try{ho=im(`@img/sharp-${KS}/versions`)}catch(e){try{ho=im(`@img/sharp-libvips-${KS}/versions`)}catch(t){}}else try{ho=im("@img/sharp-wasm32/versions")}catch(e){}ho.sharp=Un.version;if(ho.heif&&xi.heif)xi.heif.input.fileSuffix=[".avif"],xi.heif.output.alias=["avif"];GS(!0);if(!process.env.MALLOC_ARENA_MAX&&Ca.default.familySync()===Ca.default.GLIBC&&!Le._isUsingJemalloc())Le.concurrency(1);else if(Ca.default.familySync()===Ca.default.MUSL&&Le.concurrency()===1024)Le.concurrency(_B());AB=new SB.EventEmitter});var IB;var QS=L(()=>{pS();gS();wS();ES();kS();FS();BS();zS();XS();/*!
365
+ */Pd=KM(import.meta.url),k$=bl.runtimePlatformArch(),jd=Oe.libvipsVersion(),qn=Oe.format();qn.heif.output.alias=["avif","heic"];qn.jpeg.output.alias=["jpe","jpg"];qn.tiff.output.alias=["tif"];qn.jp2.output.alias=["j2c","j2k","jp2","jpx"];XM={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},pi={vips:jd.semver};if(!jd.isGlobal)if(!jd.isWasm)try{pi=Pd(`@img/sharp-${k$}/versions`)}catch(e){try{pi=Pd(`@img/sharp-libvips-${k$}/versions`)}catch(t){}}else try{pi=Pd("@img/sharp-wasm32/versions")}catch(e){}pi.sharp=gn.version;if(pi.heif&&qn.heif)qn.heif.input.fileSuffix=[".avif"],qn.heif.output.alias=["avif"];R$(!0);if(!process.env.MALLOC_ARENA_MAX&&xo.default.familySync()===xo.default.GLIBC&&!Oe._isUsingJemalloc())Oe.concurrency(1);else if(xo.default.familySync()===xo.default.MUSL&&Oe.concurrency()===1024)Oe.concurrency(YM());QM=new GM.EventEmitter});var sJ;var C$=q(()=>{zx();Yx();r$();s$();a$();$$();w$();j$();O$();/*!
407
366
  Copyright 2013 Lovell Fuller and others.
408
367
  SPDX-License-Identifier: Apache-2.0
409
- */hS(vn);vS(vn);SS(vn);PS(vn);JS(vn);qS(vn);WS(vn);YS(vn);IB=vn});import{createHash as ZS}from"node:crypto";import{existsSync as TB,mkdirSync as NB,readFileSync as MB}from"node:fs";import{basename as LB,extname as DB,resolve as om}from"node:path";import{createRequire as JB}from"node:module";async function eE(){if(go)return go;try{let e=await Promise.resolve().then(() => (QS(),{}));return go=IB,go}catch{}try{return go=JB(om(process.cwd(),"package.json"))("sharp"),go}catch(e){throw Error(`Sharp is required for image optimization but failed to load: ${Pe(e)}`,{cause:e})}}async function am(e){let r=await(await eE())(e).metadata();return{format:r.format??"unknown",height:r.height??0,width:r.width??0}}function Ia(e){let t=MB(e);return ZS("md5").update(t).digest("hex").slice(0,8)}function cm(e){let t=JSON.stringify({formats:e.formats,quality:e.quality,v:qB,widths:e.widths});return ZS("md5").update(t).digest("hex").slice(0,8)}function BB(e,t,r,n){return`${e}-${t}-${r}.${n}`}async function tE(e,t,r){let n=await eE(),i=await am(e),s=Ia(e),o=LB(e,DB(e)),a=om(t,"_optimized");NB(a,{recursive:!0});let c=[],l=r.widths.length>0?Math.max(...r.widths):i.width,u=r.widths.filter((m)=>m<=i.width);if(i.width<l&&!u.includes(i.width))u.push(i.width);if(u.length===0)u.push(i.width);u.sort((m,y)=>m-y);let d=[];for(let m of u)for(let y of r.formats){let g=BB(o,m,s,y),b=`/${FB}/${g}`,x=om(a,g);if(c.push({absolutePath:x,format:y,outputPath:b,width:m}),TB(x))continue;let _=r.quality[y]??80,P=n(e).resize(m).toFormat(y,{quality:_}).toFile(x).then(()=>{});d.push(P)}let h=4;for(let m=0;m<d.length;m+=h)await Promise.all(d.slice(m,m+h));return{contentHash:s,original:{format:i.format,height:i.height,width:i.width},variants:c}}function rE(e,t){return e.flatMap((r)=>r.format===t?[`${r.outputPath} ${r.width}w`]:[]).join(", ")}var go=null,FB="images/_optimized",qB=2;var lm=L(()=>{vr()});import{existsSync as HB,mkdirSync as UB,readFileSync as VB,rmSync as WB,writeFileSync as zB}from"node:fs";import{basename as KB,resolve as ru}from"node:path";import{execSync as GB}from"node:child_process";import{tmpdir as YB}from"node:os";function yo(e){if(Ta===void 0)try{let t=GB("npm config get cache",{cwd:YB(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();Ta=t&&t!=="undefined"?t:null}catch{Ta=null}if(Ta)return ru(Ta,"jxsuite-images",KB(e));return ru(e,".cache/images")}function nE(e){let t=ru(yo(e),"manifest.json");if(!HB(t))return{entries:{},touched:new Set,version:1};try{let r=JSON.parse(VB(t,"utf8"));return r.touched=new Set,r}catch{return{entries:{},touched:new Set,version:1}}}function iE(e,t,r={}){if(r.prune&&t.touched)XB(t,t.touched);let n=yo(e);UB(n,{recursive:!0}),zB(ru(n,"manifest.json"),JSON.stringify({entries:t.entries,version:t.version},null,2),"utf8")}function XB(e,t){let r=new Set,n=Object.entries(e.entries);for(let[i,s]of n)if(t.has(i))for(let o of s.manifest.variants??[])r.add(o.absolutePath);for(let[i,s]of n){if(t.has(i))continue;for(let o of s.manifest.variants??[])if(!r.has(o.absolutePath))WB(o.absolutePath,{force:!0});delete e.entries[i]}}function sE(e,t){e.touched?.add(t);let r=e.entries[t];if(!r)return null;return r.manifest}function oE(e,t,r,n){e.touched?.add(t),e.entries[t]={manifest:n,source:r,timestamp:Date.now()}}var Ta;var um=L(()=>{lm()});function fm(e,t){if(!t||aE(e.loading))return{};if(String(e.fetchpriority??"").toLowerCase()==="high")return{};return aE(e.decoding)?{loading:"lazy"}:{decoding:"async",loading:"lazy"}}var aE=(e)=>e!==void 0&&e!==null&&e!=="";import{existsSync as pE}from"node:fs";import{basename as QB,extname as mE,resolve as cE}from"node:path";async function eH(e,t){let r=t.get(e);if(!r){let n=Ia(e);try{let i=await am(e);r={width:i.width,height:i.height,hash:n}}catch(i){if(!lE)lE=!0,console.warn(`Could not read image dimensions (${Pe(i)}) — `+"emitting srcsets without width/height attributes.");r={width:null,height:null,hash:n}}t.set(e,r)}return r}function uE(e,t,r,n){let i=t.quality.webp??80,s=e.startsWith("/")?"":"/",o=n?`?v=${n}`:"";return t.widths.filter((a)=>a<=r).toSorted((a,c)=>a-c).map((a)=>`/cdn-cgi/image/width=${a},quality=${i},fit=scale-down,format=auto${s}${e}${o} ${a}w`).join(", ")}async function tH(e,t,r,n,i){let s=`${Ia(e)}:${cm(r)}`,o=sE(i,s);if(o){if(o.variants.every((l)=>pE(l.absolutePath)))return o}if(!o)console.log(` Optimizing ${QB(e)}...`);let a=await tE(e,yo(n),r);return oE(i,s,t,a),a}function rH(e){if(!e)return!0;if(e.includes("${"))return!0;if(ZB.some((t)=>e.startsWith(t)))return!0;if(hE.has(mE(e).toLowerCase()))return!0;return!1}function nH(e,t){if(t.service!=="cloudflare")return!1;if(!t.remoteDomains?.length)return!1;if(!e.startsWith("https://"))return!1;if(e.includes("${"))return!1;try{let r=new URL(e);if(hE.has(mE(r.pathname).toLowerCase()))return!1;return t.remoteDomains.includes(r.hostname)}catch{return!1}}function iH(e,t,r){let n=r?.length?Ac(r,e):null;if(n)return n;if(e.startsWith("/"))return cE(t,"public",e.slice(1));return cE(t,e)}async function gE(e,t,r,n,i,s=[]){let o=new Map;return await yE(e,t,r,n,i??new Map,o,s),{imageRefs:o}}async function yE(e,t,r,n,i,s,o,a=null){if(e.tagName==="img"){if(await uH(e,t,r,n,i,s,o,a))return}if(T(e.innerHTML)&&e.innerHTML.includes("<img"))e.innerHTML=await hH(e.innerHTML,t,r,n,i,s,o);if(Array.isArray(e.children)){let c=xE(e,a);for(let l of e.children){if(!ir(l))continue;await yE(l,t,r,n,i,s,o,c)}}}async function bE(e,t,r,n,i,s,o,a){if(!T(e)||t)return null;let c=nH(e,r);if(!c&&rH(e))return null;if(c)return{dims:null,sources:[],srcset:uE(e,r,1/0,null)};let l=iH(e,n,a);if(!pE(l))return null;if(r.service==="cloudflare"){let g=await eH(l,s),b=uE(e,r,g.width??1/0,g.hash);return{dims:g.width&&g.height?{height:g.height,width:g.width}:null,sources:[],srcset:b}}let u=o.get(l);if(!u)u=await tH(l,e,r,n,i),o.set(l,u);let h=[...fE.filter((g)=>r.formats.includes(g)),...r.formats.filter((g)=>!fE.includes(g))].flatMap((g)=>{let b=rE(u.variants,g);return b===""?[]:[{srcset:b,type:sH.get(g)??`image/${g}`}]}),m=u.original?.width&&u.original.height?{height:u.original.height,width:u.original.width}:null,y=r.picture!==!1&&h.length>1;return{dims:m,fallbackSrc:aH(u.variants,r.formats),sources:y?h:[],srcset:h[0]?.srcset??""}}function aH(e,t){let r=oH.find((i)=>t.includes(i));if(r===void 0)return;let n;for(let i of e)if(i.format===r&&(n===void 0||i.width>n.width))n=i;return n?.outputPath}function dE(e){if(!T(e))return null;let t=cH.exec(e.trim());if(!t)return null;let r=Number(t[1]);return t[2]==="rem"?r*16:r}function xE(e,t){let{style:r}=e;if(!J(r))return t;let n=dE(r.maxWidth)??dE(r.width);if(n===null)return t;return t===null?n:Math.min(t,n)}function lH(e){if(e===null)return;let t=Math.round(e);return`(max-width: ${t}px) 100vw, ${t}px`}async function uH(e,t,r,n,i,s,o,a=null){if(!e.attributes)e.attributes={};let c=e.attributes;if(c.src===void 0&&T(e.src))c.src=e.src,delete e.src;let l=t.optimize?await bE(c.src,c["data-no-optimize"]!==void 0,t,r,n,i,s,o):null,u=xE(e,a),d=c.sizes??lH(u)??t.sizes;if(l){if(l.srcset!==""){if(c.srcset=l.srcset,c.sizes=d,l.fallbackSrc!==void 0)c.src=l.fallbackSrc}if(l.dims&&c.width===void 0&&c.height===void 0)c.width=String(l.dims.width),c.height=String(l.dims.height)}if(Object.assign(c,fm(c,t.lazyLoad)),l&&l.sources.length>0)return fH(e,l.sources,d),!0;return!1}function fH(e,t,r){let n={...e.attributes},i=n.sizes??r;delete n.srcset,delete n.sizes;let s={attributes:n,tagName:"img"};if(e.style!==void 0)s.style=e.style,delete e.style;let o=t.map((a)=>{let c={};if(i!=="")c.sizes=i;return c.srcset=a.srcset,c.type=a.type,{attributes:c,tagName:"source"}});o.push(s),e.tagName="picture",e.attributes={},e.children=o}async function hH(e,t,r,n,i,s,o){let a=[];for(let l of e.matchAll(dH)){let u=l[0],d=l[1],h=(Na(d,"src")??"").replaceAll("&amp;","&"),m=pH.test(d),y=t.optimize&&h!==""&&!m?await bE(h,mH.test(d),t,r,n,i,s,o):null,g="";if(y&&y.srcset!=="")g+=` srcset="${y.srcset}" sizes="${t.sizes}"`;if(y?.dims&&!/\bwidth=/.test(d)&&!/\bheight=/.test(d))g+=` width="${y.dims.width}" height="${y.dims.height}"`;let b=fm({decoding:Na(d,"decoding"),fetchpriority:Na(d,"fetchpriority"),loading:Na(d,"loading")},t.lazyLoad);for(let[_,P]of Object.entries(b))g+=` ${_}="${P}"`;if(g==="")continue;let x=y&&y.sources.length>0?gH(d,y.sources,t.sizes,g):`<img${d}${g}>`;a.push({match:u,replacement:x})}let c=e;for(let{match:l,replacement:u}of a)c=c.replace(l,u);return c}function gH(e,t,r,n){let i=Na(e,"sizes")??r,s=n.replace(/ srcset="[^"]*"/,"").replace(/ sizes="[^"]*"/,"");return`<picture>${t.map((a)=>`<source type="${a.type}" srcset="${a.srcset}" sizes="${i}">`).join("")}<img${e}${s}></picture>`}function Na(e,t){return new RegExp(`\\b${t}="([^"]*)"`,"i").exec(e)?.[1]}var hE,ZB,lE=!1,fE,sH,oH,cH,dH,pH,mH;var $E=L(()=>{lm();um();wr();Ee();vr();hE=new Set([".svg",".gif"]),ZB=["http://","https://","data:","//"];fE=["avif","webp","jpeg","png"],sH=new Map([["avif","image/avif"],["jpeg","image/jpeg"],["png","image/png"],["webp","image/webp"]]);oH=["jpeg","png"];cH=/^(\d+(?:\.\d+)?)(px|rem)$/;dH=/<img\b([^>]*)>/gi,pH=/\bsrcset="/,mH=/\bdata-no-optimize\b/});import{createHash as yH}from"node:crypto";import{existsSync as bH}from"node:fs";import{join as vE}from"node:path";function $H(e,t){let r=e.replace(/^\//,"");return e.endsWith("/")||r===""?vE(t,r,"index.html"):vE(t,r)}function pm(e){if(e===void 0)return null;if(e===!1)return!1;if(e===!0)return{};return e.enabled===!1?!1:e}function vH(e){let t=JSON.stringify({fallback:e.offlineFallback??null,precache:[...e.precache??[]].toSorted(),scope:e.scope??"/"});return yH("sha256").update(t,"utf8").digest("hex").slice(0,8)}function wE(e,t,r=""){let n=[],i=[],s=[...e.precache??[]],o=e.offlineFallback;if(o!==void 0&&!s.includes(o))s.push(o),n.push(`serviceWorker: "${o}" is the offline fallback but was not in \`precache\` — `+"added, since a page that was never cached cannot be served offline.");if(t!==void 0){for(let h of s)if(!h.startsWith("/"))i.push(`serviceWorker.precache: "${h}" must be a site-absolute URL starting with /.`);else if(!bH($H(h,t)))i.push(`serviceWorker.precache: "${h}" is not a file this build produced — `+"`cache.addAll()` is all-or-nothing, so one bad entry stops the worker installing.")}let a=s.map((h)=>ze(r,h)),c=ze(r,xH),l=o===void 0?null:ze(r,o),u=`jx-${vH(e)}`,d=`/*
368
+ */Kx(Vr);t$(Vr);n$(Vr);o$(Vr);x$(Vr);v$(Vr);P$(Vr);A$(Vr);sJ=Vr});import{createHash as N$}from"node:crypto";import{existsSync as iJ,mkdirSync as oJ,readFileSync as aJ}from"node:fs";import{basename as lJ,extname as cJ,resolve as kd}from"node:path";import{createRequire as uJ}from"node:module";async function T$(){if(mi)return mi;try{let e=await Promise.resolve().then(() => (C$(),{}));return mi=sJ,mi}catch{}try{return mi=uJ(kd(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 Rd(e){let r=await(await T$())(e).metadata();return{format:r.format??"unknown",height:r.height??0,width:r.width??0}}function $o(e){let t=aJ(e);return N$("md5").update(t).digest("hex").slice(0,8)}function Ad(e){let t=JSON.stringify({formats:e.formats,quality:e.quality,v:fJ,widths:e.widths});return N$("md5").update(t).digest("hex").slice(0,8)}function pJ(e,t,r,n){return`${e}-${t}-${r}.${n}`}async function I$(e,t,r){let n=await T$(),s=await Rd(e),i=$o(e),o=lJ(e,cJ(e)),a=kd(t,"_optimized");oJ(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=pJ(o,m,i,b),y=`/${dJ}/${g}`,v=kd(a,g);if(l.push({absolutePath:v,format:b,outputPath:y,width:m}),iJ(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 M$(e,t){return e.flatMap((r)=>r.format===t?[`${r.outputPath} ${r.width}w`]:[]).join(", ")}var mi=null,dJ="images/_optimized",fJ=2;var Od=q(()=>{rr()});import{existsSync as mJ,mkdirSync as hJ,readFileSync as gJ,rmSync as yJ,writeFileSync as bJ}from"node:fs";import{basename as xJ,resolve as Sl}from"node:path";import{execSync as $J}from"node:child_process";import{tmpdir as vJ}from"node:os";function SJ(){let e=process.env.npm_config_cache??process.env.NPM_CONFIG_CACHE;if(e)return e;try{let t=$J("npm config get cache",{cwd:vJ(),encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:wJ}).trim();return t&&t!=="undefined"?t:null}catch{return null}}function hi(e){if(wl===void 0)wl=SJ();if(wl)return Sl(wl,"jxsuite-images",xJ(e));return Sl(e,".cache/images")}function J$(e){let t=Sl(hi(e),"manifest.json");if(!mJ(t))return{entries:{},touched:new Set,version:1};try{let r=JSON.parse(gJ(t,"utf8"));return r.touched=new Set,r}catch{return{entries:{},touched:new Set,version:1}}}function D$(e,t,r={}){if(r.prune&&t.touched)EJ(t,t.touched);let n=hi(e);hJ(n,{recursive:!0}),bJ(Sl(n,"manifest.json"),JSON.stringify({entries:t.entries,version:t.version},null,2),"utf8")}function EJ(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))yJ(o.absolutePath,{force:!0});delete e.entries[s]}}function L$(e,t){e.touched?.add(t);let r=e.entries[t];if(!r)return null;return r.manifest}function F$(e,t,r,n){e.touched?.add(t),e.entries[t]={manifest:n,source:r,timestamp:Date.now()}}var wl,wJ=3000;var Cd=q(()=>{Od()});function Nd(e,t){if(!t||q$(e.loading))return{};if(String(e.fetchpriority??"").toLowerCase()==="high")return{};return q$(e.decoding)?{loading:"lazy"}:{decoding:"async",loading:"lazy"}}var q$=(e)=>e!==void 0&&e!==null&&e!=="";import{existsSync as z$}from"node:fs";import{basename as _J,extname as G$,resolve as H$}from"node:path";async function jJ(e,t){let r=t.get(e);if(!r){let n=$o(e);try{let s=await Rd(e);r={width:s.width,height:s.height,hash:n}}catch(s){if(!V$)V$=!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 kJ(e,t,r,n,s){let i=`${$o(e)}:${Ad(r)}`,o=L$(s,i);if(o){if(o.variants.every((c)=>z$(c.absolutePath)))return o}if(!o)console.log(` Optimizing ${_J(e)}...`);let a=await I$(e,hi(n),r);return F$(s,i,t,a),a}function RJ(e){if(!e)return!0;if(e.includes("${"))return!0;if(PJ.some((t)=>e.startsWith(t)))return!0;if(K$.has(G$(e).toLowerCase()))return!0;return!1}function AJ(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(K$.has(G$(r.pathname).toLowerCase()))return!1;return t.remoteDomains.includes(r.hostname)}catch{return!1}}function OJ(e,t,r){let n=r?.length?fa(r,e):null;if(n)return n;if(e.startsWith("/"))return H$(t,"public",e.slice(1));return H$(t,e)}async function Y$(e,t,r,n,s,i=[]){let o=new Map;return await X$(e,t,r,n,s??new Map,o,i),{imageRefs:o}}async function X$(e,t,r,n,s,i,o,a=null){if(e.tagName==="img"){if(await JJ(e,t,r,n,s,i,o,a))return}if(T(e.innerHTML)&&e.innerHTML.includes("<img"))e.innerHTML=await HJ(e.innerHTML,t,r,n,s,i,o);if(Array.isArray(e.children)){let l=Q$(e,a);for(let c of e.children){if(!Ft(c))continue;await X$(c,t,r,n,s,i,o,l)}}}async function Z$(e,t,r,n,s,i,o,a){if(!T(e)||t)return null;let l=AJ(e,r);if(!l&&RJ(e))return null;if(l)return{dims:null,sources:[],srcset:B$(e,r,1/0,null)};let c=OJ(e,n,a);if(!z$(c))return null;if(r.service==="cloudflare"){let g=await jJ(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 kJ(c,e,r,n,s),o.set(c,d);let h=[...W$.filter((g)=>r.formats.includes(g)),...r.formats.filter((g)=>!W$.includes(g))].flatMap((g)=>{let y=M$(d.variants,g);return y===""?[]:[{srcset:y,type:CJ.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:TJ(d.variants,r.formats),sources:b?h:[],srcset:h[0]?.srcset??""}}function TJ(e,t){let r=NJ.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 U$(e){if(!T(e))return null;let t=IJ.exec(e.trim());if(!t)return null;let r=Number(t[1]);return t[2]==="rem"?r*16:r}function Q$(e,t){let{style:r}=e;if(!F(r))return t;let n=U$(r.maxWidth)??U$(r.width);if(n===null)return t;return t===null?n:Math.min(t,n)}function MJ(e){if(e===null)return;let t=Math.round(e);return`(max-width: ${t}px) 100vw, ${t}px`}async function JJ(e,t,r,n,s,i,o,a=null){if(!e.attributes)e.attributes={};let l=e.attributes;if(l.src===void 0&&T(e.src))l.src=e.src,delete e.src;let c=t.optimize?await Z$(l.src,l["data-no-optimize"]!==void 0,t,r,n,s,i,o):null,d=Q$(e,a),p=l.sizes??MJ(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,Nd(l,t.lazyLoad)),c&&c.sources.length>0)return DJ(e,c.sources,p),!0;return!1}function DJ(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 HJ(e,t,r,n,s,i,o){let a=[];for(let c of e.matchAll(LJ)){let d=c[0],p=c[1],h=(vo(p,"src")??"").replaceAll("&amp;","&"),m=FJ.test(p),b=t.optimize&&h!==""&&!m?await Z$(h,qJ.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=Nd({decoding:vo(p,"decoding"),fetchpriority:vo(p,"fetchpriority"),loading:vo(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?VJ(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 VJ(e,t,r,n){let s=vo(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 vo(e,t){return new RegExp(`\\b${t}="([^"]*)"`,"i").exec(e)?.[1]}var K$,PJ,V$=!1,W$,CJ,NJ,IJ,LJ,FJ,qJ;var ev=q(()=>{Od();Cd();nr();ve();rr();K$=new Set([".svg",".gif"]),PJ=["http://","https://","data:","//"];W$=["avif","webp","jpeg","png"],CJ=new Map([["avif","image/avif"],["jpeg","image/jpeg"],["png","image/png"],["webp","image/webp"]]);NJ=["jpeg","png"];IJ=/^(\d+(?:\.\d+)?)(px|rem)$/;LJ=/<img\b([^>]*)>/gi,FJ=/\bsrcset="/,qJ=/\bdata-no-optimize\b/});import{createHash as BJ}from"node:crypto";import{existsSync as WJ}from"node:fs";import{join as tv}from"node:path";function zJ(e,t){let r=e.replace(/^\//,"");return e.endsWith("/")||r===""?tv(t,r,"index.html"):tv(t,r)}function Id(e){if(e===void 0)return null;if(e===!1)return!1;if(e===!0)return{};return e.enabled===!1?!1:e}function GJ(e){let t=JSON.stringify({fallback:e.offlineFallback??null,precache:[...e.precache??[]].toSorted(),scope:e.scope??"/"});return BJ("sha256").update(t,"utf8").digest("hex").slice(0,8)}function rv(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(!WJ(zJ(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,UJ),c=o===void 0?null:Ie(r,o),d=`jx-${GJ(e)}`,p=`/*
410
369
  * Generated by @jxsuite/compiler — configure via \`serviceWorker\` in project.json.
411
370
  * Set \`"serviceWorker": false\` to replace this with a worker that removes itself.
412
371
  */
413
- const CACHE = ${JSON.stringify(u)};
372
+ const CACHE = ${JSON.stringify(d)};
414
373
  const PRECACHE = ${JSON.stringify(a)};
415
- const CACHE_FIRST = ${JSON.stringify(c)};
416
- const OFFLINE_FALLBACK = ${JSON.stringify(l)};
374
+ const CACHE_FIRST = ${JSON.stringify(l)};
375
+ const OFFLINE_FALLBACK = ${JSON.stringify(c)};
417
376
 
418
377
  self.addEventListener("install", (event) => {
419
378
  // Take over as soon as possible: a half-updated pair of workers is harder to reason about than
@@ -496,7 +455,7 @@ self.addEventListener("fetch", (event) => {
496
455
  })(),
497
456
  );
498
457
  });
499
- `;return{errors:i,path:dm,source:d,warnings:n}}function SE(){return{errors:[],path:dm,source:`/*
458
+ `;return{errors:s,path:Td,source:p,warnings:n}}function nv(){return{errors:[],path:Td,source:`/*
500
459
  * Generated by @jxsuite/compiler. This site had a service worker and no longer does.
501
460
  *
502
461
  * A worker is sticky: removing the file would leave every previous visitor running the old one
@@ -519,95 +478,95 @@ self.addEventListener("activate", (event) => {
519
478
  })(),
520
479
  );
521
480
  });
522
- `,warnings:[]}}function EE(e,t=""){return`if('serviceWorker' in navigator){addEventListener('load',function(){navigator.serviceWorker.register('${ze(t,`/${dm}`)}',{scope:${JSON.stringify(ze(t,e))}}).catch(function(){})})}`}var dm="sw.js",xH="/images/_optimized/";var _E=L(()=>{wr()});import{mkdirSync as wH,writeFileSync as SH}from"node:fs";import{dirname as EH,join as _H}from"node:path";function $i(e,t,r){if(r!==void 0)e[t]=r}function PE(e){let t=e.manifest,r=[],n=[];if(t===void 0||t.enabled===!1)return{errors:r,files:[],warnings:n};let i=t.name??e.name??"Jx Site",s=Ji(e.url),o=[];for(let u of t.icons??[])o.push(T(u.src)?{...u,src:ze(s,u.src)}:u);let a={display:t.display??"standalone",icons:o,name:i,short_name:t.shortName??i,start_url:ze(s,t.startUrl??"/")};$i(a,"description",t.description),$i(a,"theme_color",t.themeColor),$i(a,"background_color",t.backgroundColor),$i(a,"scope",t.scope===void 0?void 0:ze(s,t.scope)),$i(a,"orientation",t.orientation),$i(a,"lang",t.lang),$i(a,"dir",t.dir),$i(a,"categories",t.categories);let c=new Set(o.flatMap((u)=>(u.sizes??"").split(/\s+/).map((d)=>Math.trunc(Number(d.split("x")[0]))))),l=PH.filter((u)=>!c.has(u));if(l.length>0)n.push(`manifest: no ${l.join("px and no ")}px icon declared — browsers will not offer to `+"install the site without one at each size.");return{errors:r,files:[{content:`${JSON.stringify(a,null,2)}
523
- `,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(`
481
+ `,warnings:[]}}function sv(e,t=""){return`if('serviceWorker' in navigator){addEventListener('load',function(){navigator.serviceWorker.register('${Ie(t,`/${Td}`)}',{scope:${JSON.stringify(Ie(t,e))}}).catch(function(){})})}`}var Td="sw.js",UJ="/images/_optimized/";var iv=q(()=>{nr()});import{mkdirSync as KJ,writeFileSync as YJ}from"node:fs";import{dirname as XJ,join as ZJ}from"node:path";function Hn(e,t,r){if(r!==void 0)e[t]=r}function ov(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=as(e.url),o=[];for(let d of t.icons??[])o.push(T(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??"/")};Hn(a,"description",t.description),Hn(a,"theme_color",t.themeColor),Hn(a,"background_color",t.backgroundColor),Hn(a,"scope",t.scope===void 0?void 0:Ie(i,t.scope)),Hn(a,"orientation",t.orientation),Hn(a,"lang",t.lang),Hn(a,"dir",t.dir),Hn(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=QJ.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)}
482
+ `,path:"manifest.webmanifest"}],warnings:n}}function av(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 lv(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
483
  `)}
525
- `,path:".well-known/security.txt"}],warnings:i}}function jE(e,t,r){let n=0,i=[];for(let s of e){let o=_H(t,s.path);if(r(o)){i.push(s.path);continue}wH(EH(o),{recursive:!0}),SH(o,s.content,"utf8"),n+=1}return{skipped:i,written:n}}var PH;var RE=L(()=>{wr();zi();Ee();PH=[192,512]});import{existsSync as kH,mkdirSync as hm,readFileSync as AH,readdirSync as jH,writeFileSync as RH}from"node:fs";import{createRequire as OH}from"node:module";import{dirname as Ma,join as CE,relative as CH,resolve as La}from"node:path";function IH(e){return e.endsWith("/")}function IE(e=gm){let t={},r=[],n=[];for(let i of nu)if(TH(i.specifier,e))t[i.specifier]=i.assetPath,t[`${i.specifier}/`]=i.assetDir,n.push(i.assetPath);else t[i.specifier]=i.fallback,r.push(`Could not resolve "${i.specifier}" — the import map falls back to ${i.fallback}. Interactive pages will load it from a third party, and a \`default-src 'self'\` policy will block them.`);return{assetPaths:n,imports:t,warnings:r}}async function TE(e,t,r=gm,n=!0){let i=[],s=0;for(let o of nu){if(!e.assetPaths.includes(o.assetPath))continue;let a=La(t,o.assetPath.replace(/^\//,""));hm(Ma(a),{recursive:!0});try{await Wi(`export * from ${JSON.stringify(o.specifier)};
526
- `,{outfile:a,resolveDir:r},{minify:n,target:"browser"}),s+=1}catch(c){i.push(`Bundling client runtime "${o.specifier}": ${Pe(c)}`)}}return{errors:i,written:s}}function ym(e){return Object.entries(e).filter(([t,r])=>!IH(t)&&r.startsWith("/")).map(([,t])=>t)}function NE(e){let t=[];for(let r of e.matchAll(/<script type="importmap">([\s\S]*?)<\/script>/g)){let n;try{n=JSON.parse(r[1])}catch{continue}let i=ee(n)?n.imports:void 0;if(!J(i))continue;let s=Object.entries(i).flatMap(([o,a])=>T(a)?[[o,a]]:[]);t.push(...ym(Object.fromEntries(s)))}return t}function ME(e){return`<script type="importmap">
484
+ `,path:".well-known/security.txt"}],warnings:s}}function cv(e,t,r){let n=0,s=[];for(let i of e){let o=ZJ(t,i.path);if(r(o)){s.push(i.path);continue}KJ(XJ(o),{recursive:!0}),YJ(o,i.content,"utf8"),n+=1}return{skipped:s,written:n}}var QJ;var uv=q(()=>{nr();hs();ve();QJ=[192,512]});import{existsSync as eD,mkdirSync as Jd,readFileSync as tD,readdirSync as rD,writeFileSync as nD}from"node:fs";import{dirname as wo,join as sD,relative as iD,resolve as So}from"node:path";function oD(e){return e.endsWith("/")}function fv(e=Dd){let t={},r=[],n=[];for(let s of El)if(aD(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 pv(e,t,r=Dd,n=!0){let s=[],i=0;for(let o of El){if(!e.assetPaths.includes(o.assetPath))continue;let a=So(t,o.assetPath.replace(/^\//,""));Jd(wo(a),{recursive:!0});try{await ms(`export * from ${JSON.stringify(o.specifier)};
485
+ `,{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 Ld(e){return Object.entries(e).filter(([t,r])=>!oD(t)&&r.startsWith("/")).map(([,t])=>t)}function mv(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])=>T(a)?[[o,a]]:[]);t.push(...Ld(Object.fromEntries(i)))}return t}function hv(e){return`<script type="importmap">
527
486
  {
528
487
  "imports": {
529
488
  ${Object.entries(e).map(([r,n])=>` ${JSON.stringify(r)}: ${JSON.stringify(n)}`).join(`,
530
489
  `)}
531
490
  }
532
491
  }
533
- </script>`}function TH(e,t){try{if(Yo())OH(CE(t,"x.js")).resolve(e);else Bun.resolveSync(e,t);return!0}catch{return!1}}async function LE(e,t=gm,r=!0){let n=[],i=new Set,s=new Map,o=new Map,a=La(e,"assets"),c=0,l=async(d)=>{if(!o.has(d.specifier))o.set(d.specifier,await qy(d.specifier,t,{target:"browser"}));return o.get(d.specifier)},u=async(d)=>[...AH(d,"utf8").matchAll(/(?:from|import)\s*["']([^"']+)["']/g)].map((m)=>m[1]);for(let d=0;d<OE;d++){let h=0,m=[];try{m=jH(a,{recursive:!0}).map(String).filter((y)=>y.endsWith(".js")).map((y)=>CE(a,y))}catch{return mm(e,s,n,c)}for(let y of m){let g=[];try{g=await u(y)}catch{continue}for(let b of g){let x=nu.find((E)=>b.startsWith(`${E.specifier}/`));if(!x||i.has(b))continue;i.add(b);let _=b.slice(x.specifier.length+1),P=La(e,`${x.assetDir.replace(/^\//,"")}${_}`);hm(Ma(P),{recursive:!0});try{await Wi(`export * from ${JSON.stringify(b)};
534
- `,{outfile:P,resolveDir:t},{minify:r,resolver:NH(x,P,await l(x),s),target:"browser"}),c+=1,h+=1}catch(E){n.push(`Bundling runtime subpath "${b}": ${Pe(E)}`)}}}if(h===0)return mm(e,s,n,c)}return n.push(`Runtime subpath resolution did not settle in ${OE} passes — a package subpath `+"graph this deep is more likely a cycle in the scan than a real dependency chain."),mm(e,s,n,c)}function NH(e,t,r,n){return{filter:/.*/,resolve:({importer:i,path:s})=>{if(jf(i))return;if(nu.find((a)=>s===a.specifier||s.startsWith(`${a.specifier}/`))!==void 0)return{external:!0,path:s};if(r===void 0||!s.startsWith("."))return;if(La(Ma(i),s)!==r)return;return n.set(La(Ma(t),s),e.specifier),{external:!0,path:s}}}}function mm(e,t,r,n){let i=n;for(let[s,o]of t){if(kH(s))continue;try{hm(Ma(s),{recursive:!0}),RH(s,`export * from ${JSON.stringify(o)};
535
- `,"utf8"),i+=1}catch(a){r.push(`Writing shared core stub ${CH(e,s)}: ${Pe(a)}`)}}return{errors:r,written:i}}var nu,gm,OE=10;var DE=L(()=>{Rf();mn();Ee();vr();nu=[{assetDir:"/assets/@vue/reactivity/",assetPath:"/assets/vue-reactivity.js",fallback:Ts,specifier:"@vue/reactivity"},{assetDir:"/assets/lit-html/",assetPath:"/assets/lit-html.js",fallback:Ns,specifier:"lit-html"}];gm=import.meta.dirname});import{cpSync as iu,existsSync as zn,mkdirSync as en,readFileSync as MH,readdirSync as LH,rmSync as DH,statSync as JH,writeFileSync as Cr}from"node:fs";import{createHash as FH}from"node:crypto";import{basename as qH,dirname as tn,join as vi,relative as BH,resolve as rt,sep as HH}from"node:path";async function qE(e,t={}){let{clean:r=!0,verbose:n=!1}=t,i=[],s=n?console.log.bind(console):()=>{};s("Loading project.json...");let{config:o}=ni(e);if("contentTypes"in o)throw Error('project.json declares "contentTypes", which is no longer supported. Run `bun scripts/migrate-project-extensions.ts <project>` to migrate to "extensions" + "content", then `jx schema`.');let a=rt(e,o.build.outDir),c=rt(e,"pages"),l=rt(e,"public"),u=o.build.trailingSlash??"always",d=o.build.minify!==!1,h=new Map,m=new Map,y=new Map,g=(M)=>{let H=M.toSorted(),ae=`/assets/elements-${FH("sha1").update(H.join("\x00")).digest("hex").slice(0,12)}.js`;return y.set(ae,H),ae},b=IE(),x=b.imports,_=new Set,P=Vb(),{errors:E,i18n:w}=Of(o);for(let M of E)i.push(M),console.error(M);for(let M of b.warnings)console.warn(M);let k=new Map,R=(M,H,B)=>{let ae=k.get(M);if(ae!==void 0&&ae.entryPath!==H)throw Error(`"${B}" and "${ae.specifier}" both map to ${M} — rename one`);k.set(M,{entryPath:H,specifier:B})},j=(M,H)=>{if(!Dy(M))return M;try{let B=kf(M,H??e,e);if(!Di(M)&&!zn(B))return console.warn(`Sidecar "${M}" not found at ${B} — emitting unbundled`),M;let ae=Di(M)?M:`./${BH(e,B)}`,we=ny(ae);return R(we,B,M),h.set(we,{entryPath:B,specifier:M}),we}catch(B){return i.push(`Sidecar "${M}": ${Pe(B)}`),M}},D=(M)=>{let H=iy(M);try{let B=kf(`npm:${M}`,e,e);return R(H,B,M),m.set(H,B),H}catch(B){return i.push(`$head specifier "${M}": ${Pe(B)}`),M}},F=await ri(e,o),N=F.formats;if(N.entries.length>0)s(` Registered ${N.entries.length} format(s): ${N.entries.map((M)=>M.name).join(", ")}`);let q=F.serverMounts().filter((M)=>{if(!M.project)return!0;let H=o[M.project.key];return J(H)&&Object.keys(H).length>0});if(q.length>0&&!o.build.adapter){let M=q.map((H)=>H.project?`"${H.project.key}"`:`"${H.server.basePath}"`).join(", ");throw Error(`project.json declares dynamic section(s) ${M} served by extension mounts, but `+'build.adapter is "static". Dynamic tables need a server-capable adapter — set '+'build.adapter to "cloudflare-workers", "cloudflare-pages", "node", or "bun".')}if(r&&zn(a))DH(a,{force:!0,recursive:!0});if(en(a,{recursive:!0}),!zn(c))throw Error(`pages/ directory not found in ${e}`);s("Discovering pages...");let U=await Fb(c,N);s(` Found ${U.length} page(s)`),s("Loading project sections...");let ne=await nx(e,o,F),ue=Object.keys(ne);if(ue.length>0)s(` Loaded ${ue.length} section(s): ${ue.join(", ")}`);let{errors:ie,mounts:te}=await sx(F,o,e);i.push(...ie);for(let M of ie)console.error(M);if(te.length>0)s(` Mounted ${te.length} asset dir(s): ${te.map((M)=>M.urlPrefix).join(", ")}`);let le=new Set,Ce=await WH(F,o,e),oe=(await Hb(U,e,ne,F,o,w)).map((M)=>Object.assign(M,{locale:dn(M.urlPattern,w)}));s(` ${oe.length} route(s) after expansion`);let Q=0,Z=rt(e,"components"),Ve=[],pe=new Map,Qe=new Map;if(zn(Z)){s("Compiling components...");let M=[".json",...N.documentExtensions("component")],H=LH(Z).filter((gt)=>M.some((st)=>gt.endsWith(st))),B=rt(a,"components");en(B,{recursive:!0});let ae=new Map;for(let gt of H){let st=rt(Z,gt);try{let{tagName:jt}=await Qi(st,N);if(jt)ae.set(st,jt)}catch{}}let we=Ji(o.url);for(let gt of H)try{let st=rt(Z,gt),jt={formats:N,resolveElementPath:(We,Ft)=>{let nf=Ft?rt(Ft,We):rt(We),vc=ae.get(nf);return vc?`./${vc}.js`:We.replace(/\.json$/,".js")},rewriteSrc:(We,Ft)=>ze(we,j(We,Ft))};if(o.$media)jt.$media=o.$media;let me=await Cl(st,jt);for(let We of me.files){let Ft=We.tagName?`${We.tagName}.js`:qH(We.path);if(!Ve.includes(We.tagName))Cr(rt(B,Ft),We.content,"utf8"),Ve.push(We.tagName),Q+=1}let ot=await Qi(st,N);if(ot.tagName){Qe.set(ot.tagName,ot);let We=Yi(ot,o.defaults),Ft=jb(ot.tagName,ot.style,ot,o.$media??{},We);if(Ft){if(We===null)pe.set(ot.tagName,Ft);pd(Ft,te,le),Cr(rt(B,`${ot.tagName}.css`),Ft,"utf8"),Q+=1}}}catch(st){let jt=Pe(st);i.push(`Error compiling component ${gt}: ${jt}`),console.error(`Error compiling component ${gt}: ${jt}`)}s(` Compiled ${Ve.length} component(s): ${Ve.join(", ")}`)}let z=[];if(o.build.adapter)for(let[,M]of Qe){let H=nl(M);for(let B of H){let ae=`./components/${B.src.replace(/^\.\//,"")}`;z.push({exportName:B.exportName,src:ae})}}let dt=o.images.optimize&&o.images.service==="cloudflare",Ze=o.images.optimize&&!dt?nE(e):null,er=dt?new Map:null;if(dt)console.log('images.service is "cloudflare" — srcsets use /cdn-cgi/image transform URLs. '+"Ensure Image Transformations are enabled for your zone (Cloudflare dashboard → "+"Images → Transformations); these URLs do not work on *.pages.dev / *.workers.dev previews.");let nt=o.url,it=Ji(nt),yr=Boolean(nt)&&o.build.sitemap!==!1,tr=[],Xn=oe.filter((M)=>!M.urlPattern.includes(":")&&!M.urlPattern.includes("*")),Ii=w===null?new Map:await Jb(Xn,N),bs=Xn.map((M)=>({translationKey:Ii.get(M.urlPattern),urlPattern:M.urlPattern})),rr=Mb(bs,w,nt,u),{conflicts:Qn,sets:Lo}=cd(bs,w);for(let M of Qn){let[H,B]=M.urlPatterns,ae=M.declared?"Give one of them a different $translationKey.":"Move one out of the locale tree, or give it its own $translationKey.",we=`${B} and ${H} are both the "${M.locale}" version of "${M.key}". A translation set names one URL per language, so ${B} is `+`dropped from it — it carries no alternates and no switcher. ${ae}`;if(M.declared)i.push(we),console.error(we);else console.warn(we)}let ln=Tb(oe,w);if(ln.length>0)console.warn(`i18n.routing is "prefix-always", but ${ln.length} route(s) sit outside the locale tree and are served as "${w?.defaultLocale}": ${ln.slice(0,10).join(", ")}${ln.length>10?`, and ${ln.length-10} more`:""}. Move them under a locale directory, or use "prefix-except-default".`);if(w!==null&&w.routing==="prefix-always"&&!o.build.adapter&&!oe.some((M)=>M.urlPattern==="/"))console.warn('i18n.routing is "prefix-always" and no page claims "/", so the site root is a 404. '+'Locale negotiation answers "/" only when build.adapter is set — a static deployment has '+`no runtime to read Accept-Language. Add a redirect from "/" to "/${w.defaultLocale.toLowerCase()}/", set build.adapter, or use "prefix-except-default".`);let $c=new Set,xs=new Set;for(let M of oe){let H=Nb(M.urlPattern,w);if(H&&!$c.has(H.segment))$c.add(H.segment),console.warn(`Routes under /${H.segment}/ are served as "${w?.defaultLocale}" — `+`i18n.locales declares "${H.meant}", not "${H.segment}". Rename the directory to "${H.meant.toLowerCase()}" or declare the shorter tag.`);try{s(` Compiling ${M.urlPattern} ...`);let B=await UH(M,o,e,ne,Ze,Qe,er,N,F,j,te,Ce,D,{alternates:rr.get(M.urlPattern)??[],i18n:w,translations:Lo.get(M.urlPattern)??[]},x,g);for(let me of B.unregisteredRelations)if(!xs.has(me))xs.add(me),console.warn(`<link rel="${me}"> — "${me}" is not an IANA link relation, and a relation nobody recognizes does nothing. Check the spelling, or use an absolute `+"URI if it is an extension relation (RFC 8288 §2.1.2).");let ae=new Set;for(let[me,ot]of Qe)if(sl(ot))ae.add(me);if(Ve.length>0)B.html=GH(B.html,Ve,pe,ae,B.files.map((me)=>me.content).join(`
536
- `),x);for(let me of NE(B.html))_.add(me);pd(B.html,te,le),Wb(B.html,P);let we=VE(M.urlPattern,a,u);en(tn(we),{recursive:!0});let gt=!M.urlPattern.includes(":")&&!M.urlPattern.includes("*"),st=!aa(M.urlPattern)&&!Rb(B.html);if(yr&&!B.excludeFromSitemap&&st&&gt){let me=rr.get(M.urlPattern)??[];tr.push({lastmod:T(M.sourceMtime)&&M.sourceMtime!==""?M.sourceMtime:ZH(JH(M.sourcePath).mtime),loc:ii(qs(M.urlPattern,u),nt),...me.length>0&&{alternates:me}})}let jt=[];for(let me of N.withCapability("serialize")){if(!me.exportTarget||aa(M.urlPattern))continue;try{let ot=await me.call("serialize",B.doc,{buildScope:(We)=>Cs(We,null),componentDefs:Qe,evaluateTemplate:(We,Ft)=>{if(!he(We))return;return It(We,Ft)??We},mode:"export"});if(ot){let We=we.replace(/\.html$/,me.extensions[0]);jt.push({content:ot,path:We,type:me.mediaTypeEssence})}}catch(ot){i.push(`Error exporting ${me.name} for ${M.urlPattern}: ${Pe(ot)}`)}}for(let me of jt)if(me.type!==null)B.html=Cb(B.html,{href:Ib(a,me.path),type:me.type});Cr(we,cy(B.html,it),"utf8"),Q+=1;for(let me of jt)Cr(me.path,me.content,"utf8"),Q+=1;for(let me of B.files){let ot=rt(tn(we),me.path);en(tn(ot),{recursive:!0}),Cr(ot,me.content,"utf8"),Q+=1}if(B.serverHandler){let me=rt(tn(we),"_server.js");Cr(me,B.serverHandler,"utf8"),Q+=1}}catch(B){let ae=`Error compiling ${M.urlPattern}: ${Pe(B)}`;i.push(ae),console.error(ae)}}if(Ze&&o.images.optimize){iE(e,Ze,{prune:i.length===0});let M=rt(yo(e),"_optimized");if(zn(M)){let B=rt(a,"images/_optimized");en(B,{recursive:!0}),iu(M,B,{recursive:!0})}let H=Object.keys(Ze.entries).length;if(H>0)s(` Optimized ${H} image(s)`)}if(o.build.adapter){let{adapter:M}=o.build;s("Generating site-wide server worker...");let H=new Map;for(let st of z)if(!H.has(st.exportName))H.set(st.exportName,st);let{mounts:B,connectors:ae}=VH(q,F,o);if(B.length>0)s(` Mounting ${B.length} extension route(s): ${B.map((st)=>st.basePath).join(", ")}`);let gt=M==="cloudflare-pages"&&H.size===0&&B.length===0?null:mp([...H.values()],{adapter:M,base:it,connectors:ae,i18n:w,mounts:B});if(gt){let st=M==="cloudflare-pages"?"_worker.js":"worker.js";try{await By(gt,{adapter:M,outfile:rt(a,st),projectRoot:e}),Q+=1,s(` Generated dist/${st} (bundled, ${H.size} server function(s))`)}catch(jt){let me=`Error bundling dist/${st}: ${Pe(jt)}`;i.push(me),console.error(me)}if(M==="cloudflare-pages")Cr(rt(a,"_routes.json"),`${JSON.stringify({exclude:[],include:w&&w.locales.length>1?["/","/_jx/*"]:["/_jx/*"],version:1},null,2)}
537
- `,"utf8"),Q+=1}}if(_.size>0){s(`Bundling ${_.size} client runtime module(s)...`);let M=await TE({...b,assetPaths:[..._]},a,void 0,d);Q+=M.written;for(let H of M.errors)i.push(H),console.error(H)}if(m.size>0){s(`Copying ${m.size} package asset(s)...`);for(let[M,H]of m){let B=rt(a,M.replace(/^\//,""));en(tn(B),{recursive:!0}),iu(H,B),Q+=1,s(` ${H} → ${M}`)}}if(h.size>0){s(`Bundling ${h.size} client sidecar module(s)...`);for(let[M,H]of h)try{let B=rt(a,M.replace(/^\//,""));en(tn(B),{recursive:!0}),await Af({entryPath:H.entryPath,outfile:B},{external:Ly,minify:d,target:"browser"}),Q+=1,s(` ${H.specifier} → ${M}`)}catch(B){let ae=`Error bundling sidecar "${H.specifier}": ${Pe(B)}`;i.push(ae),console.error(ae)}}if(y.size>0){s(`Bundling ${y.size} npm element set(s)...`);for(let[M,H]of y){let B=rt(a,M.replace(/^\//,""));en(tn(B),{recursive:!0});try{await Wi(`${H.map((ae)=>`import ${JSON.stringify(ae)};`).join(`
492
+ </script>`}function aD(e,t){try{return ch(e,t),!0}catch{return!1}}async function gv(e,t=Dd,r=!0){let n=[],s=new Set,i=new Map,o=new Map,a=So(e,"assets"),l=0,c=async(p)=>{if(!o.has(p.specifier))o.set(p.specifier,await fh(p.specifier,t,{target:"browser"}));return o.get(p.specifier)},d=async(p)=>[...tD(p,"utf8").matchAll(/(?:from|import)\s*["']([^"']+)["']/g)].map((m)=>m[1]);for(let p=0;p<dv;p++){let h=0,m=[];try{m=rD(a,{recursive:!0}).map(String).filter((b)=>b.endsWith(".js")).map((b)=>sD(a,b))}catch{return Md(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=El.find((P)=>y.startsWith(`${P.specifier}/`));if(!v||s.has(y))continue;s.add(y);let j=y.slice(v.specifier.length+1),S=So(e,`${v.assetDir.replace(/^\//,"")}${j}`);Jd(wo(S),{recursive:!0});try{await ms(`export * from ${JSON.stringify(y)};
493
+ `,{outfile:S,resolveDir:t},{minify:r,resolver:lD(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 Md(e,i,n,l)}return n.push(`Runtime subpath resolution did not settle in ${dv} passes — a package subpath `+"graph this deep is more likely a cycle in the scan than a real dependency chain."),Md(e,i,n,l)}function lD(e,t,r,n){return{filter:/.*/,resolve:({importer:s,path:i})=>{if(Uc(s))return;if(El.find((a)=>i===a.specifier||i.startsWith(`${a.specifier}/`))!==void 0)return{external:!0,path:i};if(r===void 0||!i.startsWith("."))return;if(So(wo(s),i)!==r)return;return n.set(So(wo(t),i),e.specifier),{external:!0,path:i}}}}function Md(e,t,r,n){let s=n;for(let[i,o]of t){if(eD(i))continue;try{Jd(wo(i),{recursive:!0}),nD(i,`export * from ${JSON.stringify(o)};
494
+ `,"utf8"),s+=1}catch(a){r.push(`Writing shared core stub ${iD(e,i)}: ${Ee(a)}`)}}return{errors:r,written:s}}var El,Dd,dv=10;var yv=q(()=>{zc();Mr();ve();rr();El=[{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"}];Dd=import.meta.dirname});import{cpSync as _l,existsSync as xn,mkdirSync as Er,readFileSync as cD,readdirSync as uD,rmSync as dD,statSync as fD,writeFileSync as hr}from"node:fs";import{createHash as pD}from"node:crypto";import{basename as mD,dirname as Wr,join as Vn,relative as hD,resolve as Ye,sep as gD}from"node:path";async function vv(e,t={}){let{clean:r=!0,verbose:n=!1}=t,s=[],i=n?console.log.bind(console):()=>{};i("Loading project.json...");let{config:o}=Rn(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-${pD("sha1").update(H.join("\x00")).digest("hex").slice(0,12)}.js`;return b.set(ie,H),ie},y=fv(),v=y.imports,j=new Set,S=bg(),{errors:P,i18n:E}=Gc(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(!lh(J))return J;try{let V=Wc(J,H??e,e);if(!os(J)&&!xn(V))return console.warn(`Sidecar "${J}" not found at ${V} — emitting unbundled`),J;let ie=os(J)?J:`./${hD(e,V)}`,Se=Pm(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=jm(J);try{let V=Wc(`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 kn(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 — ${bv}`)}if(r&&xn(a))dD(a,{force:!0,recursive:!0});if(Er(a,{recursive:!0}),!xn(l))throw Error(`pages/ directory not found in ${e}`);i("Discovering pages...");let W=await pg(l,M);i(` Found ${W.length} page(s)`),i("Loading project sections...");let se=await Ag(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 Cg(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 xD(D,o,e),le=(await gg(W,e,se,D,o,E)).map((J)=>Object.assign(J,{locale:Tr(J.urlPattern,E)}));i(` ${le.length} route(s) after expansion`);let z=0,te=Ye(e,"components"),Le=[],fe=new Map,Be=new Map,G=new Map;if(xn(te)){i("Compiling components...");let J=[".json",...M.documentExtensions("component")],H=uD(te).filter((ze)=>J.some((Te)=>ze.endsWith(Te))),V=Ye(a,"components");Er(V,{recursive:!0});let ie=new Map;for(let ze of H){let Te=Ye(te,ze);try{let{tagName:he}=await xs(Te,M);if(he)ie.set(Te,he)}catch{}}let Se=as(o.url),Or=Qa(Se);for(let ze of H)try{let Te=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 Xa(Te,he);for(let ot of xt.files){let Zt=ot.tagName?`${ot.tagName}.js`:mD(ot.path);if(!Le.includes(ot.tagName))hr(Ye(V,Zt),ot.content,"utf8"),Le.push(ot.tagName),z+=1}let st=await xs(Te,M);if(st.tagName){Be.set(st.tagName,st),G.set(st.tagName,Te);let ot=ys(st,o.defaults),Zt=rg(st.tagName,st.style,st,o.$media??{},ot);if(Zt){if(ot===null)fe.set(st.tagName,Zt);Cu(Zt,Q,ae),hr(Ye(V,`${st.tagName}.css`),Zt,"utf8"),z+=1}}}catch(Te){let he=Ee(Te);s.push(`Error compiling component ${ze}: ${he}`),console.error(`Error compiling component ${ze}: ${he}`)}i(` Compiled ${Le.length} component(s): ${Le.join(", ")}`)}let We=[];for(let[J,H]of Be)We.push(...oo(H,G.get(J),e));if(o.state)We.push(...oo({state:o.state},Ye(e,"project.json"),e));let Xe=o.images.optimize&&o.images.service==="cloudflare",pt=o.images.optimize&&!Xe?J$(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=as(Ue),Mt=Boolean(Ue)&&o.build.sitemap!==!1,Xr=[],En=le.filter((J)=>!J.urlPattern.includes(":")&&!J.urlPattern.includes("*")),Ii=E===null?new Map:await fg(En,M),Jt=En.map((J)=>({translationKey:Ii.get(J.urlPattern),urlPattern:J.urlPattern})),Zr=cg(Jt,E,Ue,d),{conflicts:Mi,sets:Ts}=ju(Jt,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 ts=ag(le,E);if(ts.length>0)console.warn(`i18n.routing is "prefix-always", but ${ts.length} route(s) sit outside the locale tree and are served as "${E?.defaultLocale}": ${ts.slice(0,10).join(", ")}${ts.length>10?`, and ${ts.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,ia=new Set;for(let J of le){let H=lg(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 yD(J,o,e,se,pt,Be,ut,M,D,k,Q,ke,I,{alternates:Zr.get(J.urlPattern)??[],i18n:E,translations:Ts.get(J.urlPattern)??[]},v,g);We.push(...V.serverEntries);for(let he of V.unregisteredRelations)if(!ia.has(he))ia.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 Be)if(Wa(xt))ie.add(he);if(Le.length>0)V.html=wD(V.html,Le,fe,ie,V.files.map((he)=>he.content).join(`
495
+ `),v);for(let he of mv(V.html))j.add(he);Cu(V.html,Q,ae),xg(V.html,S);let Se=_v(J.urlPattern,a,d);Er(Wr(Se),{recursive:!0});let Or=!J.urlPattern.includes(":")&&!J.urlPattern.includes("*"),ze=!io(J.urlPattern)&&!ng(V.html);if(Mt&&!V.excludeFromSitemap&&ze&&Or){let he=Zr.get(J.urlPattern)??[];Xr.push({lastmod:T(J.sourceMtime)&&J.sourceMtime!==""?J.sourceMtime:PD(fD(J.sourcePath).mtime),loc:An(ri(J.urlPattern,d),Ue),...he.length>0&&{alternates:he}})}let Te=[];for(let he of M.withCapability("serialize")){if(!he.exportTarget||io(J.urlPattern))continue;try{let xt=await he.call("serialize",V.doc,{buildScope:(st)=>zs(st,null),componentDefs:Be,evaluateTemplate:(st,ot)=>{if(!pe(st))return;return wt(st,ot)??st},mode:"export"});if(xt){let st=Se.replace(/\.html$/,he.extensions[0]);Te.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 Te)if(he.type!==null)V.html=ig(V.html,{href:og(a,he.path),type:he.type});hr(Se,Om(V.html,bt),"utf8"),z+=1;for(let he of Te)hr(he.path,he.content,"utf8"),z+=1;for(let he of V.files){let xt=Ye(Wr(Se),he.path);Er(Wr(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){D$(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}),_l(J,V,{recursive:!0})}let H=Object.keys(pt.entries).length;if(H>0)i(` Optimized ${H} image(s)`)}let Qr=[];if(!o.build.adapter&&We.length>0){let H=`timing: "server" entries ${[...new Set(We.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 — ${bv}`;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}=Vg(We);Qr=H;for(let Te of V)s.push(Te),console.error(Te);let{mounts:ie,connectors:Se}=bD(L,D,o);if(ie.length>0)i(` Mounting ${ie.length} extension route(s): ${ie.map((Te)=>Te.basePath).join(", ")}`);let ze=J==="cloudflare-pages"&&Qr.length===0&&ie.length===0?null:Vu(Qr,{adapter:J,base:bt,connectors:Se,i18n:E,mounts:ie});if(ze){let Te=J==="cloudflare-pages"?"_worker.js":"worker.js";try{await ph(ze,{adapter:J,outfile:Ye(a,Te),projectRoot:e}),z+=1,i(` Generated dist/${Te} (bundled, ${Qr.length} server function(s))`)}catch(he){let xt=`Error bundling dist/${Te}: ${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)}
496
+ `,"utf8"),z+=1}}if(j.size>0){i(`Bundling ${j.size} client runtime module(s)...`);let J=await pv({...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(Wr(V),{recursive:!0}),_l(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(Wr(V),{recursive:!0}),await dh({entryPath:H.entryPath,outfile:V},{external:ah,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(Wr(V),{recursive:!0});try{await ms(`${H.map((ie)=>`import ${JSON.stringify(ie)};`).join(`
538
497
  `)}
539
- `,{outfile:B,resolveDir:e},{minify:d,target:"browser"}),Q+=1,s(` ${H.length} element(s) → ${M}`)}catch(ae){let we=`Error bundling npm $elements [${H.join(", ")}]: ${Pe(ae)}`;i.push(we),console.error(we)}}}if(_.size>0){let M=await LE(a,void 0,d);if(M.written>0)s(`Bundling ${M.written} runtime subpath module(s)...`);Q+=M.written;for(let H of M.errors)i.push(H),console.error(H)}for(let M of F.emitters()){let H=M.project?.key,B=H?o[H]:void 0;if(H&&(B==null||J(B)&&Object.keys(B).length===0))continue;try{let ae=await M.call("emit",B??null,{projectConfig:o,root:e,routes:oe,sections:ne});for(let we of ae??[]){let gt=rt(a,we.path.replace(/^\//,""));if(!gt.startsWith(a+HH))throw Error(`emit path escapes outDir: ${we.path}`);en(tn(gt),{recursive:!0}),Cr(gt,we.content),Q+=1,s(` ${M.name} emitted ${we.path}`)}}catch(ae){let we=`Error in ${M.name}.emit: ${Pe(ae)}`;i.push(we),console.error(we)}}if(o.redirects&&Object.keys(o.redirects).length>0){s("Generating redirects...");let M=new Set(oe.map((B)=>B.urlPattern)),H=QH(o.redirects,a,{basePath:it,compiledUrls:M,trailingSlash:o.build.trailingSlash});Q+=H.files,i.push(...H.errors)}if(yr)s(`Generating sitemap (${tr.length} URL(s))...`),Q+=tU(tr,a);else if(!nt&&o.build.sitemap!==!1)console.warn("sitemap.xml skipped — set `url` in project.json to enable sitemap generation.");if(le.size>0){let{copied:M,missing:H}=ox(le,te,a);Q+=M,s(`Copying ${M} mounted asset(s)...`);for(let B of H)console.warn(`Referenced asset not found: ${B}`)}if(zn(l))s("Copying public/ assets..."),iu(l,a,{recursive:!0});if(yr)Q+=rU(a,nt);{let M=[PE(o),AE(o,new Date)];for(let ae of M){for(let we of ae.errors)i.push(we),console.error(we);for(let we of ae.warnings)console.warn(we)}let{skipped:H,written:B}=jE(M.flatMap((ae)=>ae.files),a,zn);Q+=B;for(let ae of H)s(` ${ae} — kept the copy from public/`)}{let M=pm(o.serviceWorker);if(M!==null){let H=M===!1?SE():wE(M,a,it);for(let B of H.warnings)console.warn(B);for(let B of H.errors)i.push(B),console.error(B);if(H.path!==null)Cr(vi(a,H.path),H.source,"utf8"),Q+=1,s(M===!1?" sw.js — tombstone (unregisters and clears)":" sw.js")}}{let{errors:M,rules:H}=Xb(o.build,P);i.push(...M);let B=Zb([...H,...Qb(a)],it);if(B.length>0){s("Writing response headers..."),Q+=ex(a,B);let{adapter:ae,deploy:we}=o.build;if(ae==="node"||ae==="bun")console.warn(`The "${ae}" adapter serves no static assets, so dist/_headers is documentation `+"rather than configuration — apply these headers at the reverse proxy in front of it.");else if(ae===void 0&&we===void 0)if(zn(rt(l,"CNAME")))console.warn("GitHub Pages ignores dist/_headers and serves its own Cache-Control: max-age=600, so the generated caching and security rules will not take effect. Deploy behind a host that reads _headers (Cloudflare Pages, Cloudflare Workers assets, Netlify) to apply them.");else s(" note: _headers is read by Cloudflare Pages, Cloudflare Workers assets and Netlify; other static hosts ignore it and serve their own Cache-Control.")}Q+=tx(a)}if(o.copy){s("Copying mapped files...");for(let[M,H]of Object.entries(o.copy)){if(!T(H))throw TypeError(`project.json copy["${M}"] must be a destination path string`);let B=rt(e,M),ae=rt(a,H);en(tn(ae),{recursive:!0}),iu(B,ae)}}if(s(`
540
- Build complete: ${oe.length} routes, ${Q} files`),i.length>0)s(` ${i.length} error(s)`);return{errors:i,files:Q,routes:oe.length}}async function UH(e,t,r,n,i,s,o,a,c,l,u,d,h,m,y,g){let b=Ji(t.url),x=await Qi(e.sourcePath,a),_=await ux(x,t,r),P=dx(x.$head??_._pageHead??[],x.description),E=_.$head??[],w=x.title??_._pageTitle??null;delete _._pageHead,delete _._pageTitle,$x(_,t,e,r,m.i18n,m.translations);let k=Lb({defaults:t.defaults,pageDir:T(x.$dir)?x.$dir:void 0,pageLang:T(x.$lang)?x.$lang:void 0,routeLocale:dn(e.urlPattern,m.i18n)});await F0(_,e,r,{config:t,registerBundle:(pe)=>{l(pe,null)},registry:c,sections:n});let R=Cs(_.state??{}),j=w??t.name;if(he(j))j=It(j,R)??j;let D=bm(JE(P,R),h),F=bm(JE(E,R),h);Da(_,R);let N={counter:{n:0},media:{...t.$media,..._.$media},rules:[]},q={n:0};if(Sm(_,s,N,t.defaults,q),_.state){let pe=new Set;for(let[z,dt]of Object.entries(_.state)){if(z==="$site"||z==="$page")continue;if(ee(dt)&&dt.timing==="compiler")delete _.state[z];else if(Array.isArray(dt))pe.add(z)}let Qe=!0;while(Qe){Qe=!1;let z={..._.state};for(let Ze of pe)delete z[Ze];let dt=JSON.stringify({children:_.children,state:z});for(let Ze of pe)if(KH(dt,Ze))pe.delete(Ze),Qe=!0}for(let z of pe)delete _.state[z]}let U=pm(t.serviceWorker),ne=U===null||U===!1?[]:[{tagName:"script",textContent:EE(U.scope??"/",b)}],ue=[...kE(t),...ne,...d,...bm(t.$head??[],h)],ie=px(ue,F,D,{title:j,charset:t.defaults.charset??"utf8",siteName:t.name,siteUrl:t.url,...m.alternates.length>0&&{alternates:m.alternates},...!aa(e.urlPattern)&&{pageUrl:qs(e.urlPattern,t.build.trailingSlash)}});if(t.$media)_.$media={...t.$media,..._.$media};if(Object.values(_.$media??{}).some((pe)=>Wr(String(pe))!==null))ie.splice(2,0,{tagName:"script",textContent:Ls()});let te=t.images;await gE(_,te,r,i,o??void 0,u);let le={lang:k.lang,prePaintScheme:!1,projectStyle:t.style??null,rewriteSrc:(pe)=>ze(b,l(pe,tn(e.sourcePath))),title:j},Ce=y["@vue/reactivity"];if(Ce!==void 0)le.reactivitySrc=Ce;let W=y["lit-html"];if(W!==void 0)le.litHtmlSrc=W;let oe=await Sp(_,le);if(N.rules.length>0)oe.html=oe.html.replace("</head>",`<style>
541
- ${tl(N.rules.join(`
498
+ `,{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 gv(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+gD))throw Error(`emit path escapes outDir: ${Se.path}`);Er(Wr(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=_D(o.redirects,a,{basePath:bt,compiledUrls:J,trailingSlash:o.build.trailingSlash});z+=H.files,s.push(...H.errors)}if(Mt)i(`Generating sitemap (${Xr.length} URL(s))...`),z+=kD(Xr,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..."),_l(c,a,{recursive:!0});if(Mt)z+=RD(a,Ue);{let J=[ov(o),lv(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}=cv(J.flatMap((ie)=>ie.files),a,xn);z+=V;for(let ie of H)i(` ${ie} — kept the copy from public/`)}{let J=Id(o.serviceWorker);if(J!==null){let H=J===!1?nv():rv(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(Vn(a,H.path),H.source,"utf8"),z+=1,i(J===!1?" sw.js — tombstone (unregisters and clears)":" sw.js")}}{let{errors:J,rules:H}=Eg(o.build,S);s.push(...J);let V=Pg([...H,..._g(a)],bt);if(V.length>0){i("Writing response headers..."),z+=jg(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+=kg(a)}if(o.copy){i("Copying mapped files...");for(let[J,H]of Object.entries(o.copy)){if(!T(H))throw TypeError(`project.json copy["${J}"] must be a destination path string`);let V=Ye(e,J),ie=Ye(a,H);Er(Wr(ie),{recursive:!0}),_l(V,ie)}}if(i(`
499
+ Build complete: ${le.length} routes, ${z} files`),s.length>0)i(` ${s.length} error(s)`);return{errors:s,files:z,routes:le.length,serverEntries:Qr}}async function yD(e,t,r,n,s,i,o,a,l,c,d,p,h,m,b,g){let y=as(t.url),v=await xs(e.sourcePath,a),j=await Lg(v,t,r),S=[...oo(v,e.sourcePath,r),...Fg(v,t,r).flatMap((fe)=>oo(fe.doc,fe.path,r))],P=Wg(v.$head??j._pageHead??[],v.description),E=j.$head??[],O=v.title??j._pageTitle??null;delete j._pageHead,delete j._pageTitle,Qg(j,t,e,r,m.i18n,m.translations);let R=ug({defaults:t.defaults,pageDir:T(v.$dir)?v.$dir:void 0,pageLang:T(v.$lang)?v.$lang:void 0,routeLocale:Tr(e.urlPattern,m.i18n)});await $y(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=Fd(xv(P,k),h),M=Fd(xv(E,k),h);Eo(j,k);let L={counter:{n:0},media:{...t.$media,...j.$media},rules:[]},W={n:0};if(Wd(j,i,L,t.defaults,W),j.state){let fe=new Set;for(let[G,We]of Object.entries(j.state)){if(G==="$site"||G==="$page")continue;if(ee(We)&&We.timing==="compiler")delete j.state[G];else if(Array.isArray(We))fe.add(G)}let Be=!0;while(Be){Be=!1;let G={...j.state};for(let Xe of fe)delete G[Xe];let We=JSON.stringify({children:j.children,state:G});for(let Xe of fe)if(vD(We,Xe))fe.delete(Xe),Be=!0}for(let G of fe)delete j.state[G]}let se=Id(t.serviceWorker),ue=se===null||se===!1?[]:[{tagName:"script",textContent:sv(se.scope??"/",y)}],oe=[...av(t),...ue,...p,...Fd(t.$head??[],h)],Q=Ug(oe,M,D,{title:I,charset:t.defaults.charset??"utf8",siteName:t.name,siteUrl:t.url,...m.alternates.length>0&&{alternates:m.alternates},...!io(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 Y$(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,Wr(e.sourcePath))),serverBaseUrl:Qa(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 Wu(j,ke);if(L.rules.length>0)z.html=z.html.replace("</head>",`<style>
500
+ ${Ha(L.rules.join(`
542
501
  `))}
543
502
  </style>
544
- </head>`);oe.html=XH(oe.html,ie,k);let Q=(pe)=>typeof pe==="string"&&!pe.startsWith("./")&&!pe.startsWith("../"),Z=[...new Set([..._.$elements??[],...x.$elements??[]].filter((pe)=>Q(pe)))];if(Z.length>0)oe.html=YH(oe.html,g(Z));let Ve=null;if(!t.build.adapter)try{let pe=await $a(e.sourcePath);if(pe)Ve=pe}catch{}return{doc:_,excludeFromSitemap:x.$sitemap===!1,files:oe.files,html:oe.html,unregisteredRelations:gx(ie),serverHandler:Ve}}function VH(e,t,r){if(e.length===0)return{connectors:[],mounts:[]};let n=Ji(r.url),i={};for(let c of t.projectContributions()){let{key:l}=c.project;if(l in r)i[l]=r[l]}let s=e.map((c)=>{let l=c.server,{module:u}=l;if(!T(u)||u==="")throw Error(`Extension class "${c.name}": server.module (a bare import specifier) is required to generate a deployable worker`);let d=ze(n,l.basePath);return{basePath:d,className:c.classDef.title??c.name,module:u,options:{basePath:d,sections:i},order:l.order??100}}),o=new Set;for(let c of Object.values(i)){if(!ee(c))continue;for(let l of Object.values(c)){let u=ee(l)?l.provider:void 0;if(T(u))o.add(u)}}let a=[];for(let c of t.connectors()){let l=String(c.connector.provider);if(!o.has(l))continue;let{module:u}=c.connector;if(!T(u)||u==="")throw Error(`Connector class "${c.name}": connector.module (a bare import specifier) is required to generate a deployable worker`);a.push({className:c.classDef.title??c.name,module:u,provider:l})}return{connectors:a,mounts:s}}async function WH(e,t,r){let n=[];for(let i of e.headProviders()){let s=i.project?.key,o=s===void 0?null:t[s];if(s!==void 0&&(o===void 0||o===null))continue;try{let a=await i.call("head",o??null,{projectConfig:t,root:r});n.push(...a??[])}catch(a){console.warn(`${i.name} head capability failed: ${Pe(a)}`)}}return n}function wm(e,t){if(Array.isArray(e))return e.map((r)=>wm(r,t));if(ee(e))return Object.fromEntries(Object.entries(e).map(([r,n])=>[r,wm(n,t)]));if(he(e))return It(e,t)??e;return e}function JE(e,t){return e.map((r)=>{if(!J(r))return r;let n={...r};if(n.attributes){n.attributes={...n.attributes};for(let[i,s]of Object.entries(n.attributes))if(he(s))n.attributes[i]=It(s,t)??s}if(he(n.textContent))n.textContent=It(n.textContent,t)??n.textContent;else if(J(n.textContent))n.textContent=wm(n.textContent,t);return n})}function bm(e,t){return e.map((r)=>{if(!J(r)||!r.attributes)return r;let n={...r,attributes:{...r.attributes}};for(let i of["href","src"]){let s=n.attributes[i];if(T(s)&&zH(s))n.attributes[i]=t(s)}return n})}function zH(e){return!e.startsWith("/")&&!e.startsWith("./")&&!e.startsWith("../")&&!e.startsWith("http")&&!e.startsWith("data:")}function BE(e){return WE(e).replaceAll("${","&#36;{")}function HE(e){return e.replaceAll("${","$​{")}function UE(e,t){if(!J(e))return e;let r={};for(let[n,i]of Object.entries(e))if(n==="children"&&Array.isArray(e.children))r.children=e.children.map((s)=>{if(T(s))return s;return UE(s,t)});else if(n==="style"&&J(e.style)){let s={...e.style};for(let[o,a]of Object.entries(s))if(he(a))s[o]=su(a,t)??a;r.style=s}else if(n==="attributes"&&J(e.attributes)){let s={...e.attributes};for(let[o,a]of Object.entries(s))if(he(a)){let c=su(a,t);s[o]=T(c)&&c.includes("${")?HE(c):c??a}r.attributes=s}else if(n==="$props"&&J(e.$props)){let s={...e.$props};for(let[o,a]of Object.entries(s))if(he(a)){let c=su(a,t);s[o]=c!==null?c??null:a}r.$props=s}else if(he(i)){let s=su(i,t);if(n==="textContent"&&T(s)&&s.includes("${"))r.innerHTML=BE(s);else r[n]=s??i}else r[n]=i;return r}function su(e,t){try{let r=t.$map,n=J(r)&&"item"in r?r.item:void 0,i=J(r)&&"index"in r?r.index:void 0,s=Rs(e)?`return (${e.slice(2,-1)})`:`return \`${e}\``;return Function("state","$map","item","index",s)(t,r,n,i)}catch{return null}}function Da(e,t){if(!J(e))return;if(he(e.innerHTML)){let i=It(e.innerHTML,t);if(i!=null)e.innerHTML=String(i).replaceAll("${","&#36;{")}let r=e.textContent;if(he(r)){let i=It(r,t);if(T(i)&&i.includes("${"))e.innerHTML=BE(i),delete e.textContent;else e.textContent=i??r}if(J(e.style)){for(let[i,s]of Object.entries(e.style))if(he(s))e.style[i]=It(s,t)??s}if(J(e.attributes)){for(let[i,s]of Object.entries(e.attributes))if(he(s)){let o=It(s,t);e.attributes[i]=T(o)&&o.includes("${")?HE(o):o??s}}if(J(e.$props)){let i=e.$props;for(let[s,o]of Object.entries(i))if(he(o))i[s]=It(o,t)??o}let n=e.children;if(lt(n)){let i=FE(n,t);if(i&&i.length>0){e.children=i;return}}if(he(n)){let i=It(n,t);if(Array.isArray(i)){let s=i;e.children=s;for(let o of s)Da(o,t)}}else if(Array.isArray(e.children)){let i=0;while(i<e.children.length){let s=e.children[i];if(he(s)){let o=It(s,t);if(Array.isArray(o)){let a=o;e.children.splice(i,1,...a);for(let c of a)Da(c,t);i+=a.length;continue}}if(lt(s)){let o=FE(s,t);if(o&&o.length>0){e.children.splice(i,1,...o),i+=o.length;continue}}Da(s,t),i+=1}}}function KH(e,t){let r=t.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`);return new RegExp(String.raw`\bstate\.${r}\b|#/state/${r}(?=["/])`).test(e)}function FE(e,t){let r=e.items,n=Je(r)?Xf(r.$ref,t):r,i=e.map;if(!Array.isArray(n)||!i)return null;return n.map((o,a)=>{let c=Object.create(t);c.$map={index:a,item:o},c["$map/item"]=o,c["$map/index"]=a;let l=UE(i,c);return Da(l,c),l})}function Sm(e,t,r,n,i){if(!J(e))return;if(Array.isArray(e)){for(let a of e)Sm(a,t,r,n,i);return}if(Array.isArray(e.children))for(let a of e.children)Sm(a,t,r,n,i);let{tagName:s}=e;if(!T(s))return;let o=t.get(s);if(o){if(e.attributes){let{lifted:x,rest:_}=sd(e.attributes);if(x)e.attributes=_,e.$props={...x,...e.$props}}let a=(x)=>{if(r&&J(x)&&!Array.isArray(x))li(x,r.rules,r.media,"",r.counter,"jxs");return Is(x,{},null)},c=Yi(o,n),l=e.$props||null,u={componentDefs:t,defaults:n,path:[{key:JSON.stringify(l??{}),tag:s}],slotIds:i},d=sl(o),{children:h}=e,m=!c&&!d&&ci(o.children)?nd(u):null,y=c?(Array.isArray(h)?h:[]).map((x)=>a(x)).join(`
545
- `):null,g=Ab(o,l,c?null:id(h,{},a,m),u);if(m!==null)e.attributes={...e.attributes,[na]:String(m)};e.innerHTML=c?`<template shadowrootmode="${c}"><link rel="stylesheet" href="/components/${s}.css">${g}</template>${y??""}`:g,delete e.children;let b=od(o.style,il(o,l));if(Object.keys(b).length>0)e.style={...e.style,...b};if(!d&&e.$props&&Object.keys(e.$props).length>0)e.attributes={...e.attributes,"data-jx-props":JSON.stringify(e.$props)};if(delete e.$props,d)e.$static=!0;else e.$prerendered=!0}}function GH(e,t,r=new Map,n=new Set,i="",s={}){let o=(P)=>e.includes(`<${P}`),a=(P)=>i.includes(`<${P}`),c=t.filter((P)=>o(P)||a(P));if(c.length===0)return e;let l=c.flatMap((P)=>{let E=r.get(P);return E===void 0||E===""?[]:[E]}).join(`
546
- `),u=l===""?"":`<style>
547
- ${tl(l)}
548
- </style>`,d=(P)=>{let E=P.filter(Boolean).join(`
549
- `);return E===""?e:e.replace("</head>",` ${E}
550
- </head>`)},h=c.filter((P)=>a(P)||!n.has(P));if(h.length===0)return d([u]);let m=ME(s),g=[...ym(s),...h.map((P)=>`/components/${P}.js`)].map((P)=>`<link rel="modulepreload" href="${P}">`).join(`
551
- `),b=e.includes('<script type="importmap">'),x=d([b?"":m,g,u]),_=h.map((P)=>`<script type="module" src="/components/${P}.js"></script>`).join(`
552
- `);return x.replace("</body>",` ${_}
553
- </body>`)}function YH(e,t){return e.replace("</body>",` <script type="module" src="${t}"></script>
554
- </body>`)}function XH(e,t,r){let n=mx(t),i=/<head>([\s\S]*?)<\/head>/i,s=e.match(i),o="";if(s){let c=s[1].match(/<style>[\s\S]*?<\/style>/gi);if(c)o+=`
555
- ${c.join(`
556
- `)}`;let l=s[1].match(/<script[\s\S]*?<\/script>/gi);if(l)o+=`
503
+ </head>`);z.html=ED(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=SD(z.html,g(Le));return{doc:j,excludeFromSitemap:v.$sitemap===!1,files:z.files,html:z.html,unregisteredRelations:Kg(Q),serverEntries:S}}function bD(e,t,r){if(e.length===0)return{connectors:[],mounts:[]};let n=as(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(!T(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(T(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(!T(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 xD(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 Bd(e,t){if(Array.isArray(e))return e.map((r)=>Bd(r,t));if(ee(e))return Object.fromEntries(Object.entries(e).map(([r,n])=>[r,Bd(n,t)]));if(pe(e))return wt(e,t)??e;return e}function xv(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=Bd(n.textContent,t);return n})}function Fd(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(T(i)&&$D(i))n.attributes[s]=t(i)}return n})}function $D(e){return!e.startsWith("/")&&!e.startsWith("./")&&!e.startsWith("../")&&!e.startsWith("http")&&!e.startsWith("data:")}function wv(e){return Pv(e).replaceAll("${","&#36;{")}function Sv(e){return e.replaceAll("${","$​{")}function Ev(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(T(i))return i;return Ev(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]=Pl(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=Pl(a,t);i[o]=T(l)&&l.includes("${")?Sv(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=Pl(a,t);i[o]=l!==null?l??null:a}r.$props=i}else if(pe(s)){let i=Pl(s,t);if(n==="textContent"&&T(i)&&i.includes("${"))r.innerHTML=wv(i);else r[n]=i??s}else r[n]=s;return r}function Pl(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=Ws(e)?`return (${e.slice(2,-1)})`:`return \`${e}\``;return Function("state","$map","item","index",i)(t,r,n,s)}catch{return null}}function Eo(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(T(s)&&s.includes("${"))e.innerHTML=wv(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]=T(o)&&o.includes("${")?Sv(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=$v(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)Eo(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)Eo(l,t);s+=a.length;continue}}if(Qe(i)){let o=$v(i,t);if(o&&o.length>0){e.children.splice(s,1,...o),s+=o.length;continue}}Eo(i,t),s+=1}}}function vD(e,t){let r=t.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`);return new RegExp(String.raw`\bstate\.${r}\b|#/state/${r}(?=["/])`).test(e)}function $v(e,t){let r=e.items,n=Ce(r)?gu(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=Ev(s,l);return Eo(c,l),c})}function Wd(e,t,r,n,s){if(!F(e))return;if(Array.isArray(e)){for(let a of e)Wd(a,t,r,n,s);return}if(Array.isArray(e.children))for(let a of e.children)Wd(a,t,r,n,s);let{tagName:i}=e;if(!T(i))return;let o=t.get(i);if(o){if(e.attributes){let{lifted:v,rest:j}=Eu(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=Wa(o),{children:h}=e,m=!l&&!p&&Nn(o.children)?wu(d):null,b=l?(Array.isArray(h)?h:[]).map((v)=>a(v)).join(`
504
+ `):null,g=tg(o,c,l?null:Su(h,{},a,m),d);if(m!==null)e.attributes={...e.attributes,[to]:String(m)};e.innerHTML=l?`<template shadowrootmode="${l}"><link rel="stylesheet" href="/components/${i}.css">${g}</template>${b??""}`:g,delete e.children;let y=_u(o.style,Ba(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 wD(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(`
505
+ `),d=c===""?"":`<style>
506
+ ${Ha(c)}
507
+ </style>`,p=(S)=>{let P=S.filter(Boolean).join(`
508
+ `);return P===""?e:e.replace("</head>",` ${P}
509
+ </head>`)},h=l.filter((S)=>a(S)||!n.has(S));if(h.length===0)return p([d]);let m=hv(i),g=[...Ld(i),...h.map((S)=>`/components/${S}.js`)].map((S)=>`<link rel="modulepreload" href="${S}">`).join(`
510
+ `),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(`
511
+ `);return v.replace("</body>",` ${j}
512
+ </body>`)}function SD(e,t){return e.replace("</body>",` <script type="module" src="${t}"></script>
513
+ </body>`)}function ED(e,t,r){let n=zg(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
514
  ${l.join(`
558
- `)}`}let a=e;if(i.test(a))a=a.replace(i,`<head>
515
+ `)}`;let c=i[1].match(/<script[\s\S]*?<\/script>/gi);if(c)o+=`
516
+ ${c.join(`
517
+ `)}`}let a=e;if(s.test(a))a=a.replace(s,`<head>
559
518
  ${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 QH(e,t,r={}){let n=0,i=[],s=[],o=(l)=>l.length>1&&l.endsWith("/")?l.slice(0,-1):l,a=new Set([...r.compiledUrls??[]].map((l)=>o(l))),c=r.trailingSlash??"always";for(let[l,u]of Object.entries(e)){let d=T(u)?u:u.destination,h=!T(u)&&"rewrite"in u&&u.rewrite,m=h?200:!T(u)&&("status"in u)?u.status??301:301;if(!h&&!xm.has(String(m))){i.push(`Redirect "${l}" has status ${m}, which is not an RFC 9110 §15.4 redirection `+`status. Use one of ${[...xm.keys()].join(", ")}, or { destination, rewrite: true } for a proxy.`);continue}let y=r.basePath??"";if(s.push(`${ze(y,l)} ${ze(y,d)} ${m}`),l.includes(":")||l.includes("*"))continue;if(a.has(o(l)))console.warn(`The ${h?"rewrite":"redirect"} "${l}" collides with a compiled page at the same route — `+"remove one or the other.");if(h)continue;let g=xm.get(String(m));if(!g.html)continue;let b=VE(l,t,c),x=g.canonical?`
561
- <link rel="canonical" href="${$m(d)}">`:`
562
- <meta name="robots" content="noindex">`,_=`<!DOCTYPE html>
519
+ </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 _v(e,t,r){if(e==="/")return Vn(t,"index.html");if(io(e))return Vn(t,"404.html");let n=e.replace(/^\//,"");if(r==="always")return Vn(t,n,"index.html");return Vn(t,`${n}.html`)}function _D(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=T(d)?d:d.destination,h=!T(d)&&"rewrite"in d&&d.rewrite,m=h?200:!T(d)&&("status"in d)?d.status??301:301;if(!h&&!qd.has(String(m))){s.push(`Redirect "${c}" has status ${m}, which is not an RFC 9110 §15.4 redirection `+`status. Use one of ${[...qd.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=qd.get(String(m));if(!g.html)continue;let y=_v(c,t,l),v=g.canonical?`
520
+ <link rel="canonical" href="${Hd(p)}">`:`
521
+ <meta name="robots" content="noindex">`,j=`<!DOCTYPE html>
563
522
  <html>
564
523
  <head>
565
524
  <meta charset="utf-8">
566
- <meta http-equiv="refresh" content="0;url=${$m(d)}">${x}
525
+ <meta http-equiv="refresh" content="0;url=${Hd(p)}">${v}
567
526
  <title>Redirecting...</title>
568
527
  </head>
569
528
  <body>
570
- <p>Redirecting to <a href="${$m(d)}">${WE(d)}</a>...</p>
529
+ <p>Redirecting to <a href="${Hd(p)}">${Pv(p)}</a>...</p>
571
530
  </body>
572
- </html>`;en(tn(b),{recursive:!0}),Cr(b,_,"utf8"),n+=1}if(s.length>0)Cr(vi(t,"_redirects"),`${s.join(`
531
+ </html>`;Er(Wr(y),{recursive:!0}),hr(y,j,"utf8"),n+=1}if(i.length>0)hr(Vn(t,"_redirects"),`${i.join(`
573
532
  `)}
574
- `,"utf8"),n+=1;return{errors:i,files:n}}function WE(e){return String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function $m(e){return String(e).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}function vm(e){return String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function ZH(e){return e.toISOString().replace(/\.\d{3}Z$/,"Z")}function tU(e,t){if(e.length===0)return 0;let r=e.map((s)=>{let o=(s.alternates??[]).map((a)=>` <xhtml:link rel="alternate" hreflang="${vm(a.hreflang)}" href="${vm(a.href)}"/>`).join(`
533
+ `,"utf8"),n+=1;return{errors:s,files:n}}function Pv(e){return String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function Hd(e){return String(e).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}function Vd(e){return String(e).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function PD(e){return e.toISOString().replace(/\.\d{3}Z$/,"Z")}function kD(e,t){if(e.length===0)return 0;let r=e.map((i)=>{let o=(i.alternates??[]).map((a)=>` <xhtml:link rel="alternate" hreflang="${Vd(a.hreflang)}" href="${Vd(a.href)}"/>`).join(`
575
534
  `);return` <url>
576
- <loc>${vm(s.loc)}</loc>
577
- <lastmod>${s.lastmod}</lastmod>
535
+ <loc>${Vd(i.loc)}</loc>
536
+ <lastmod>${i.lastmod}</lastmod>
578
537
  ${o===""?"":`${o}
579
538
  `} </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="${eU}"`:""}>
539
+ `),s=`<?xml version="1.0" encoding="UTF-8"?>
540
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"${e.some((i)=>(i.alternates?.length??0)>0)?` xmlns:xhtml="${jD}"`:""}>
582
541
  ${r}
583
542
  </urlset>
584
- `;return Cr(vi(t,"sitemap.xml"),i,"utf8"),1}function rU(e,t){let r=vi(e,"robots.txt"),n=zn(r),i=n?MH(r,"utf8"):`User-agent: *
543
+ `;return hr(Vn(t,"sitemap.xml"),s,"utf8"),1}function RD(e,t){let r=Vn(e,"robots.txt"),n=xn(r),s=n?cD(r,"utf8"):`User-agent: *
585
544
  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 xm,eU="http://www.w3.org/1999/xhtml";var zE=L(()=>{Ee();vr();wr();ly();Rf();Ho();Ub();rx();On();ix();ax();fx();hx();yx();vx();J0();wa();mn();Os();q0();$E();dd();_E();ad();RE();ld();DE();um();xm=new Map([["301",{canonical:!0,html:!0,why:""}],["302",{canonical:!1,html:!0,why:""}],["303",{canonical:!1,html:!0,why:""}],["307",{canonical:!1,html:!1,why:"307 preserves the request method and body; a meta-refresh silently converts POST to GET"}],["308",{canonical:!1,html:!1,why:"308 preserves the request method and body; a meta-refresh silently converts POST to GET"}]])});import{createRequire as nU}from"node:module";import{join as iU}from"node:path";import{spawn as sU}from"node:child_process";function oU(e){try{return nU(iU(e,"package.json")).resolve("@jxsuite/server/dev")}catch{throw Error(`@jxsuite/server is not installed in ${e}. Add it to devDependencies (e.g. \`bun add -d @jxsuite/server\`) and retry.`)}}function KE(e,t,r=sU,n=process){let s=[oU(e),"--root",e];if(t!==void 0)s.push("--port",String(t));let o=r("bun",s,{stdio:"inherit"});return o.on("error",(a)=>{if(a.code==="ENOENT")console.error("The Jx dev server runs on Bun, which was not found on your PATH. Install it from https://bun.sh and retry.");else console.error(`Failed to start the dev server: ${a.message}`);n.exitCode=1}),n.on("SIGINT",()=>{o.kill("SIGINT")}),n.on("SIGTERM",()=>{o.kill("SIGTERM")}),o.on("exit",(a)=>{n.exitCode=a??0}),o}var GE=()=>{};import{createServer as aU}from"node:http";import{existsSync as ou,readFileSync as YE,statSync as cU}from"node:fs";import{extname as lU,join as Em,normalize as uU,resolve as XE,sep as fU}from"node:path";function pU(e,t){let r=uU(t).replaceAll("\\","/"),n=XE(e,`.${r.startsWith("/")?r:`/${r}`}`);if(n!==e&&!n.startsWith(e+fU))return null;if(ou(n)){if(cU(n).isDirectory()){let s=Em(n,"index.html");return ou(s)?s:null}return n}let i=Em(n,"index.html");return ou(i)?i:null}function QE(e,t){let r=XE(e),n=aU((i,s)=>{let o=new URL(i.url??"/","http://localhost"),a=pU(r,decodeURIComponent(o.pathname));if(a){s.writeHead(200,{"Content-Type":dU.get(lU(a).toLowerCase())??"application/octet-stream"}),s.end(YE(a));return}let c=Em(r,"404.html");if(ou(c)){s.writeHead(404,{"Content-Type":"text/html; charset=utf-8"}),s.end(YE(c));return}s.writeHead(404,{"Content-Type":"text/plain; charset=utf-8"}),s.end("Not found")});return n.listen(t),n}var dU;var ZE=L(()=>{lf();dU=new Map(Object.entries({".avif":"image/avif",".css":"text/css; charset=utf-8",".gif":"image/gif",".html":"text/html; charset=utf-8",".ico":"image/x-icon",".jpeg":"image/jpeg",".jpg":"image/jpeg",".js":"text/javascript; charset=utf-8",".json":"application/json; charset=utf-8",".png":"image/png",".svg":"image/svg+xml",".txt":"text/plain; charset=utf-8",".webp":"image/webp",".woff2":"font/woff2",".xml":"application/xml; charset=utf-8",...Hg}))});var Ja="https://jxsuite.com/schema/project/fields/v2",cs="https://jxsuite.com/schema/document/paths/v2",e1,t1,Fa,_m;var au=L(()=>{e1={description:"A single field definition inside a section entry schema — a small, recursive subset of "+"JSON Schema. Recursive positions reference the effective field union via the well-known fields resource $id.",properties:{default:{},description:{type:"string"},enum:{type:"array"},format:{type:"string"},items:{$ref:"https://jxsuite.com/schema/project/fields/v2"},properties:{additionalProperties:{$ref:"https://jxsuite.com/schema/project/fields/v2"},type:"object"},required:{items:{type:"string"},type:"array"},type:{enum:["string","number","integer","boolean","array","object"],type:"string"}},required:["type"],type:"object"},t1={description:`Relationship reference field: points at a named entry of a referenceable section via "#/<sectionKey>/<name>" (specs/relationships.md). A bare reference is to-one; wrap in an array field's items for to-many.`,properties:{$ref:{pattern:"^#/[A-Za-z][A-Za-z0-9_-]*/[A-Za-z0-9._-]+$",type:"string"},description:{type:"string"}},required:["$ref"],type:"object"},Fa=[{additionalProperties:!1,description:'Explicit value list: generates one page per value, bound to `param` (default "value").',properties:{param:{description:'Route parameter to fill (default "value").',type:"string"},values:{description:"The values to expand.",type:"array"}},required:["values"],type:"object"},{additionalProperties:!1,description:"JSON data-file source: loads a project-relative file that must contain an array, and generates one page per item.",properties:{$ref:{description:"Project-relative path to a .json file containing an array.",type:"string"},field:{description:'Item field providing the parameter value (default "id").',type:"string"},param:{description:'Route parameter to fill (default "id").',type:"string"}},required:["$ref"],type:"object"},{description:"Legacy explicit form: an array of ready-made parameter objects, used as-is with no expansion. Prefer one of the source shapes above.",items:{additionalProperties:{type:"string"},type:"object"},type:"array"}],_m={description:"A source shape contributed by an extension this schema cannot see. The project's generated document.schema.json validates these exactly; enable the owning extension and regenerate with `jx schema` to get precise checking here.",minProperties:1,type:"object"}});function mU(e){let{corePath:t,fragments:r,fieldSchemaRefs:n=[]}=e;return{$comment:s1,$defs:{Fields:{$id:Ja,anyOf:[{$ref:`${r1}#/$defs/JxFieldSchema`},{$ref:`${r1}#/$defs/RelationshipRef`},...n.map((i)=>({$ref:i}))]}},$schema:"https://json-schema.org/draft/2020-12/schema",allOf:[{$ref:t},...r.map((i)=>({$ref:i}))],type:"object",unevaluatedProperties:!1}}async function Ba(e,t,r,n=[]){let i=structuredClone(e),s=new Map,o=new Set;Pm(i,o);let a=0,c=async(u)=>{let d=qa(u),h=s.get(d);if(h!==void 0)return h;let m;try{m=structuredClone(await t(d))}catch(x){throw Error(`bundleSchema: cannot load $ref target "${d}": ${vU(x)}`,{cause:x})}let y=T(m.$id)&&wi(m.$id)?m.$id:null;a+=y===null?1:0;let g=y??`urn:jx:bundled:${a}`;if(s.set(d,g),o.has(g))return g;o.add(g),m.$id=g,await l(m,$U(d),!0);let b=i.$defs??={};return b[g]=m,g},l=async(u,d,h=!1)=>{if(Array.isArray(u)){for(let b of u)await l(b,d);return}if(!ee(u))return;let m=u,y=d;if(!h&&T(m.$id)&&wi(m.$id))y=null;let g=m.$ref;if(T(g)&&y!==null&&!g.startsWith("#")&&!wi(g)){let b=g.indexOf("#"),x=b===-1?g:g.slice(0,b),_=b===-1?"":g.slice(b);if(x){let P=await c(`${y}/${x}`);m.$ref=`${P}${_}`}}for(let b of Object.values(m))await l(b,y)};await l(i,qa(r),!0);for(let u of n)await c(`${qa(r)}/${u}`);return i}function bU(e){return e.replaceAll("~","~0").replaceAll("/","~1")}function*n1(e,t){for(let r of hU){let n=e[r];if(Array.isArray(n)){for(let[i,s]of n.entries())if(ee(s))yield[s,`${t}/${r}/${i}`]}else if(ee(n))yield[n,`${t}/${r}`]}for(let r of gU){let n=e[r];if(!ee(n))continue;for(let[i,s]of Object.entries(n))if(ee(s))yield[s,`${t}/${r}/${bU(i)}`]}for(let r of yU){let n=e[r];if(!Array.isArray(n))continue;for(let[i,s]of n.entries())if(ee(s))yield[s,`${t}/${r}/${i}`]}}function xU(e,t){let r=e.replace(/^[a-zA-Z][a-zA-Z\d+.-]*:/,"");if(r.startsWith("//")){let s=r.indexOf("/",2);r=s===-1?"":r.slice(s+1)}r=r.replace(/^schema\//,"");let n=r.split(/[^a-zA-Z0-9]+/).filter(Boolean).join("-")||"resource",i=n;for(let s=2;t.has(i);s+=1)i=`${n}-${s}`;return t.add(i),i}function Ha(e){let t=structuredClone(e);if(ee(t.$defs)){let s=new Set(Object.keys(t.$defs).filter((a)=>!wi(a))),o={};for(let[a,c]of Object.entries(t.$defs)){let l=ee(c)&&T(c.$id)?c.$id:a;o[wi(a)?xU(l,s):a]=c}t.$defs=o}let r=new Map,n=(s,o)=>{let{$id:a}=s;if(T(a)&&wi(a)&&!r.has(a))r.set(a,o);for(let[c,l]of n1(s,o))n(c,l)};n(t,"#");let i=(s,o)=>{let a=o,{$id:c}=s;if(T(c)&&wi(c)){if(a=r.get(c)??o,a!=="#")delete s.$id}let l=s.$ref;if(T(l)){let u=l.indexOf("#"),d=u===-1?l:l.slice(0,u),h=u===-1?"":l.slice(u+1);if(d===""){if(h.startsWith("/"))s.$ref=`${a}${h}`}else{let m=r.get(d);if(m!==void 0)s.$ref=h?`${m}${h}`:m}}for(let[u]of n1(s,a))i(u,a)};return i(t,"#"),t}function Pm(e,t){if(Array.isArray(e)){for(let n of e)Pm(n,t);return}if(!ee(e))return;let r=e;if(T(r.$id)&&wi(r.$id))t.add(r.$id);for(let n of Object.values(r))Pm(n,t)}function wi(e){return/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(e)}function qa(e){let t=e.replaceAll("\\","/"),r=t.startsWith("/"),n=[];for(let i of t.split("/")){if(i===""||i===".")continue;if(i===".."){if(n.length>0&&n.at(-1)!=="..")n.pop();else if(!r)n.push("..");continue}n.push(i)}return(r?"/":"")+n.join("/")}function $U(e){let t=e.lastIndexOf("/");if(t===-1)return".";return t===0?"/":e.slice(0,t)}function vU(e){return e instanceof Error?e.message:String(e)}function wU(e){let{corePath:t,pathsValueRefs:r}=e;return{$comment:s1,$defs:{PathsValue:{$id:cs,anyOf:[...Fa,...r.map((n)=>({$ref:n}))]}},$schema:"https://json-schema.org/draft/2020-12/schema",allOf:[{$ref:t}]}}async function o1(e){let{baseDir:t,coreDocumentRef:r,coreProjectRef:n,extensions:i,loadJson:s}=e,o=[],a=[],c=[],l=[];for(let h of i){if(h.project)o.push(h.project);if(h.document){let m=await i1(h.document,s,t);if(a.push(...m),m.length>0)c.push(h.document)}if(h.fields)l.push(...await i1(h.fields,s,t)),o.push(h.fields)}let u=mU({corePath:n,fieldSchemaRefs:l,fragments:o}),d=wU({corePath:r,pathsValueRefs:a});return{document:Ha(await Ba(d,s,t,c)),project:Ha(await Ba(u,s,t))}}async function i1(e,t,r){let n;try{n=await t(qa(`${qa(r)}/${e}`))}catch{return[]}let{$id:i}=n;if(!T(i)||!n.$defs)return[];return Object.keys(n.$defs).map((s)=>`${i}#/$defs/${s}`)}var r1="https://jxsuite.com/schema/project/core/v2",s1="Generated by `jx schema` from project.json#/extensions — do not edit.",hU,gU,yU;var a1=L(()=>{au();Ee();au();hU=["additionalItems","additionalProperties","contains","contentSchema","else","if","items","not","propertyNames","then","unevaluatedItems","unevaluatedProperties"],gU=["$defs","definitions","dependencies","dependentSchemas","patternProperties","properties"],yU=["allOf","anyOf","oneOf","prefixItems"]});import{existsSync as u1,readFileSync as SU,statSync as c1,writeFileSync as cu}from"node:fs";import{createRequire as Va}from"node:module";import{dirname as EU,isAbsolute as _U,relative as Am,resolve as Sn,sep as jm}from"node:path";async function f1(e){let{config:t}=ni(e),r=await ri(e,t),n=Sn(e),{document:i,project:s}=await o1({baseDir:n,coreDocumentRef:l1(e,kU),coreProjectRef:l1(e,PU),extensions:r.extensions.map((o)=>({document:o.schemas.document&&km(e,o,o.schemas.document),fields:o.schemas.fields&&km(e,o,o.schemas.fields),project:o.schemas.project&&km(e,o,o.schemas.project)})),loadJson:m1(n)});return{documentSchema:i,projectSchema:s}}async function d1(e){let{documentSchema:t,projectSchema:r}=await f1(e),n=Sn(e,"project.schema.json"),i=Sn(e,"document.schema.json");return cu(n,`${JSON.stringify(r,null,2)}
591
- `,"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(SU(e,"utf8"));if(!ee(t))throw TypeError(`Schema file "${e}" is not a JSON object`);return t}function jU(e){return e.startsWith(AU)&&e.endsWith(".json")}function RU(e,t){try{return Va(import.meta.url).resolve(e)}catch(r){throw Error(`Schema ref "${t}" names the first-party schema "${e}", which must resolve from the host workspace and does not. The project's own copy is deliberately not consulted, so the host install is missing "${e.split("/").slice(0,2).join("/")}" — check that `+"the package ships with this build",{cause:r})}}function m1(e){return async(t)=>{let r=Sn(t),n=Am(e,r);if(n.startsWith("..")||_U(n))throw Error(`Schema ref "${t}" escapes the project root ${e}`);let i=n.split(jm).join("/"),s="node_modules/",o=i.lastIndexOf(s),a=o===-1?null:i.slice(o+s.length);if(a!==null&&jU(a))return Ua(RU(a,t));if(u1(r))return Ua(r);if(a===null)throw Error(`Schema ref "${t}" does not exist`);let c;try{c=Va(Sn(e,"package.json")).resolve(a)}catch{try{c=Va(import.meta.url).resolve(a)}catch(l){throw Error(`Schema ref "${t}" does not exist and "${a}" is not resolvable from the project or the host`,{cause:l})}}return Ua(c)}}function l1(e,t){let r=null;try{r=Va(Sn(e,"package.json")).resolve(t)}catch{try{r=Va(import.meta.url).resolve(t)}catch{r=null}}let n=`./node_modules/${t}`;return r?h1(e,r,n):n}function km(e,t,r){let n=Am(EU(t.manifestPath),r).split(jm).join("/"),i=`./node_modules/${t.specifier}/${n}`;return h1(e,r,i)}function h1(e,t,r){let n=Am(e,t).split(jm).join("/");if(n.startsWith(".."))return r;return n.startsWith("./")?n:`./${n}`}var PU="@jxsuite/schema/schemas/project.core.schema.json",kU="@jxsuite/schema/schema.json",AU="@jxsuite/";var Rm=L(()=>{a1();Ee();On();Ho()});var x1=C(function(_oe,b1){var __dirname="/home/runner/work/jx/jx/node_modules/@webref/elements",g1=De("fs").promises,y1=De("path");async function OU({folder:e=__dirname}={}){let t={},r=await g1.readdir(e);for(let n of r)if(n.endsWith(".json")&&n!=="package.json"){let i=await g1.readFile(y1.join(e,n),"utf8");t[y1.basename(n,".json")]=JSON.parse(i)}return t}b1.exports={listAll:OU}});var w1=C(function(Poe,v1){var __dirname="/home/runner/work/jx/jx/node_modules/@webref/css",CU=De("fs").promises,IU=De("path");async function $1({folder:e=__dirname}={}){let t=await CU.readFile(IU.join(e,"css.json"),"utf8");return JSON.parse(t)}async function TU({folder:e=__dirname}={}){let t=await $1(e),r={};for(let[n,i]of Object.entries(t)){r[n]={};for(let s of i){let o=s.name,a=null;if(s.for)a=i.find((c)=>c!==s&&c.name===s.name);if(a)o+=" for "+s.for[0];if(r[n][o]=s,s.descriptors){let c=s.descriptors;s.descriptors={};for(let l of c)s.descriptors[l.name]=l}}}return r}v1.exports={listAll:$1,index:TU}});var S1=C(function(lu,Om){(function(e,t){typeof lu=="object"&&typeof Om=="object"?Om.exports=t():typeof define=="function"&&define.amd?define([],t):typeof lu=="object"?lu.WebIDL2=t():e.WebIDL2=t()})(globalThis,()=>(()=>{var e={d:(p,v)=>{for(var S in v)e.o(v,S)&&!e.o(p,S)&&Object.defineProperty(p,S,{enumerable:!0,get:v[S]})},o:(p,v)=>Object.prototype.hasOwnProperty.call(p,v),r:(p)=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(p,"__esModule",{value:!0})}},t={};function r(p,v,S,A,O,{level:V="error",autofix:G,ruleName:de}={}){function fe(br){return br>0?p.slice(v,v+br):p.slice(Math.max(v+br,0),v)}function ye(br,{precedes:Ti}={}){let jn=br.map((Fo)=>Fo.trivia+Fo.value).join(""),Jo=p[v];return Jo.type==="eof"?jn:Ti?jn+Jo.trivia:jn.slice(Jo.trivia.length)}let Ae=p[v].type!=="eof"?p[v].line:p.length>1?p[v-1].line:1,Ne=function(br){let Ti=br.split(`
595
- `);return Ti[Ti.length-1]}(ye(fe(-5),{precedes:!0})),qt=fe(5),nr=ye(qt),Do=Ne+nr.split(`
545
+ `;if(/^Sitemap:/im.test(s))return 0;if(!s.endsWith(`
546
+ `))s+=`
547
+ `;return s+=`
548
+ Sitemap: ${An("/sitemap.xml",t)}
549
+ `,hr(r,s,"utf8"),n?0:1}var bv='set build.adapter to "cloudflare-workers", "cloudflare-pages", "node", or "bun".',qd,jD="http://www.w3.org/1999/xhtml";var jv=q(()=>{ve();rr();nr();Cm();zc();Hi();yg();Rg();nn();Og();Tg();qg();Bg();Gg();Yg();ey();xy();lo();Bu();Mr();Us();vy();ev();Ou();iv();Pu();uv();ku();yv();Cd();qd=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 AD}from"node:module";import{join as OD}from"node:path";import{spawn as CD}from"node:child_process";function ND(e){try{return AD(OD(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 kv(e,t,r=CD,n=process){let i=[ND(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 Rv=()=>{};import{createServer as TD}from"node:http";import{existsSync as jl,readFileSync as Av,statSync as ID}from"node:fs";import{extname as MD,join as Ud,normalize as JD,resolve as Ov,sep as DD}from"node:path";function FD(e,t){let r=JD(t).replaceAll("\\","/"),n=Ov(e,`.${r.startsWith("/")?r:`/${r}`}`);if(n!==e&&!n.startsWith(e+DD))return null;if(jl(n)){if(ID(n).isDirectory()){let i=Ud(n,"index.html");return jl(i)?i:null}return n}let s=Ud(n,"index.html");return jl(s)?s:null}function Cv(e,t){let r=Ov(e),n=TD((s,i)=>{let o=new URL(s.url??"/","http://localhost"),a=FD(r,decodeURIComponent(o.pathname));if(a){i.writeHead(200,{"Content-Type":LD.get(MD(a).toLowerCase())??"application/octet-stream"}),i.end(Av(a));return}let l=Ud(r,"404.html");if(jl(l)){i.writeHead(404,{"Content-Type":"text/html; charset=utf-8"}),i.end(Av(l));return}i.writeHead(404,{"Content-Type":"text/plain; charset=utf-8"}),i.end("Not found")});return n.listen(t),n}var LD;var Nv=q(()=>{jc();LD=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",...pm}))});var _o="https://jxsuite.com/schema/project/fields/v2",Es="https://jxsuite.com/schema/document/paths/v2",Tv,Iv,Po,zd;var kl=q(()=>{Tv={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"},Iv={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"},Po=[{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"}],zd={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 qD(e){let{corePath:t,fragments:r,fieldSchemaRefs:n=[]}=e;return{$comment:Lv,$defs:{Fields:{$id:_o,anyOf:[{$ref:`${Mv}#/$defs/JxFieldSchema`},{$ref:`${Mv}#/$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 ko(e,t,r,n=[]){let s=structuredClone(e),i=new Map,o=new Set;Gd(s,o);let a=0,l=async(d)=>{let p=jo(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}": ${GD(v)}`,{cause:v})}let b=T(m.$id)&&Bn(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,zD(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&&T(m.$id)&&Bn(m.$id))b=null;let g=m.$ref;if(T(g)&&b!==null&&!g.startsWith("#")&&!Bn(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,jo(r),!0);for(let d of n)await l(`${jo(r)}/${d}`);return s}function WD(e){return e.replaceAll("~","~0").replaceAll("/","~1")}function*Jv(e,t){for(let r of HD){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 VD){let n=e[r];if(!ee(n))continue;for(let[s,i]of Object.entries(n))if(ee(i))yield[i,`${t}/${r}/${WD(s)}`]}for(let r of BD){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 UD(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 Ro(e){let t=structuredClone(e);if(ee(t.$defs)){let i=new Set(Object.keys(t.$defs).filter((a)=>!Bn(a))),o={};for(let[a,l]of Object.entries(t.$defs)){let c=ee(l)&&T(l.$id)?l.$id:a;o[Bn(a)?UD(c,i):a]=l}t.$defs=o}let r=new Map,n=(i,o)=>{let{$id:a}=i;if(T(a)&&Bn(a)&&!r.has(a))r.set(a,o);for(let[l,c]of Jv(i,o))n(l,c)};n(t,"#");let s=(i,o)=>{let a=o,{$id:l}=i;if(T(l)&&Bn(l)){if(a=r.get(l)??o,a!=="#")delete i.$id}let c=i.$ref;if(T(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 Jv(i,a))s(d,a)};return s(t,"#"),t}function Gd(e,t){if(Array.isArray(e)){for(let n of e)Gd(n,t);return}if(!ee(e))return;let r=e;if(T(r.$id)&&Bn(r.$id))t.add(r.$id);for(let n of Object.values(r))Gd(n,t)}function Bn(e){return/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(e)}function jo(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 zD(e){let t=e.lastIndexOf("/");if(t===-1)return".";return t===0?"/":e.slice(0,t)}function GD(e){return e instanceof Error?e.message:String(e)}function KD(e){let{corePath:t,pathsValueRefs:r}=e;return{$comment:Lv,$defs:{PathsValue:{$id:Es,anyOf:[...Po,...r.map((n)=>({$ref:n}))]}},$schema:"https://json-schema.org/draft/2020-12/schema",allOf:[{$ref:t}]}}async function Fv(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 Dv(h.document,i,t);if(a.push(...m),m.length>0)l.push(h.document)}if(h.fields)c.push(...await Dv(h.fields,i,t)),o.push(h.fields)}let d=qD({corePath:n,fieldSchemaRefs:c,fragments:o}),p=KD({corePath:r,pathsValueRefs:a});return{document:Ro(await ko(p,i,t,l)),project:Ro(await ko(d,i,t))}}async function Dv(e,t,r){let n;try{n=await t(jo(`${jo(r)}/${e}`))}catch{return[]}let{$id:s}=n;if(!T(s)||!n.$defs)return[];return Object.keys(n.$defs).map((i)=>`${s}#/$defs/${i}`)}var Mv="https://jxsuite.com/schema/project/core/v2",Lv="Generated by `jx schema` from project.json#/extensions — do not edit.",HD,VD,BD;var qv=q(()=>{kl();ve();kl();HD=["additionalItems","additionalProperties","contains","contentSchema","else","if","items","not","propertyNames","then","unevaluatedItems","unevaluatedProperties"],VD=["$defs","definitions","dependencies","dependentSchemas","patternProperties","properties"],BD=["allOf","anyOf","oneOf","prefixItems"]});import{existsSync as Bv,readFileSync as YD,statSync as Hv,writeFileSync as Rl}from"node:fs";import{createRequire as Yd}from"node:module";import{dirname as XD,isAbsolute as ZD,relative as Xd,resolve as $n,sep as Zd}from"node:path";async function Wv(e){let{config:t}=Rn(e),r=await kn(e,t),n=$n(e),{document:s,project:i}=await Fv({baseDir:n,coreDocumentRef:Vv(e,eL),coreProjectRef:Vv(e,QD),extensions:r.extensions.map((o)=>({document:o.schemas.document&&Kd(e,o,o.schemas.document),fields:o.schemas.fields&&Kd(e,o,o.schemas.fields),project:o.schemas.project&&Kd(e,o,o.schemas.project)})),loadJson:Gv(n)});return{documentSchema:s,projectSchema:i}}async function Uv(e){let{documentSchema:t,projectSchema:r}=await Wv(e),n=$n(e,"project.schema.json"),s=$n(e,"document.schema.json");return Rl(n,`${JSON.stringify(r,null,2)}
550
+ `,"utf8"),Rl(s,`${JSON.stringify(t,null,2)}
551
+ `,"utf8"),{documentSchemaPath:s,projectSchemaPath:n}}async function zv(e,t={}){let{write:r=!0}=t,n=$n(e),s=$n(n,"project.json"),i=$n(n,"project.schema.json"),o=$n(n,"document.schema.json"),a=(g)=>{if(!Bv(g))return!0;try{return Hv(s).mtimeMs>Hv(g).mtimeMs}catch{return!1}},c=a(i)||a(o)?await Wv(n):null;if(c&&r)Rl(i,`${JSON.stringify(c.projectSchema,null,2)}
552
+ `,"utf8"),Rl(o,`${JSON.stringify(c.documentSchema,null,2)}
553
+ `,"utf8");let d=Gv(n),p=c?.projectSchema??Ao(i),h=c?.documentSchema??Ao(o),m=Ro(await ko(p,d,n));return{document:Ro(await ko(h,d,n)),project:m}}function Ao(e){let t=JSON.parse(YD(e,"utf8"));if(!ee(t))throw TypeError(`Schema file "${e}" is not a JSON object`);return t}function rL(e){return e.startsWith(tL)&&e.endsWith(".json")}function nL(e,t){try{return Yd(import.meta.url).resolve(e)}catch(r){throw Error(`Schema ref "${t}" names the core 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 Gv(e){return async(t)=>{let r=$n(t),n=Xd(e,r);if(n.startsWith("..")||ZD(n))throw Error(`Schema ref "${t}" escapes the project root ${e}`);let s=n.split(Zd).join("/"),i="node_modules/",o=s.lastIndexOf(i),a=o===-1?null:s.slice(o+i.length);if(a!==null&&rL(a))return Ao(nL(a,t));if(Bv(r))return Ao(r);if(a===null)throw Error(`Schema ref "${t}" does not exist`);let l;try{l=Cc(e,a)}catch(c){throw Error(`Schema ref "${t}" does not exist and "${a}" is not resolvable from the `+"project — is the package installed?",{cause:c})}return Ao(l)}}function Vv(e,t){let r=null;try{r=Yd($n(e,"package.json")).resolve(t)}catch{try{r=Yd(import.meta.url).resolve(t)}catch{r=null}}let n=`./node_modules/${t}`;return r?Kv(e,r,n):n}function Kd(e,t,r){let n=Xd(XD(t.manifestPath),r).split(Zd).join("/"),s=`./node_modules/${t.specifier}/${n}`;return Kv(e,r,s)}function Kv(e,t,r){let n=Xd(e,t).split(Zd).join("/");if(n.startsWith(".."))return r;return n.startsWith("./")?n:`./${n}`}var QD="@jxsuite/schema/schemas/project.core.schema.json",eL="@jxsuite/schema/schema.json",tL="@jxsuite/schema/";var Qd=q(()=>{qv();ve();nn();Hi()});var Qv=C(function(BY,Zv){var __dirname="/home/runner/work/jx/jx/node_modules/@webref/elements",Yv=Ne("fs").promises,Xv=Ne("path");async function sL({folder:e=__dirname}={}){let t={},r=await Yv.readdir(e);for(let n of r)if(n.endsWith(".json")&&n!=="package.json"){let s=await Yv.readFile(Xv.join(e,n),"utf8");t[Xv.basename(n,".json")]=JSON.parse(s)}return t}Zv.exports={listAll:sL}});var rw=C(function(WY,tw){var __dirname="/home/runner/work/jx/jx/node_modules/@webref/css",iL=Ne("fs").promises,oL=Ne("path");async function ew({folder:e=__dirname}={}){let t=await iL.readFile(oL.join(e,"css.json"),"utf8");return JSON.parse(t)}async function aL({folder:e=__dirname}={}){let t=await ew(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}tw.exports={listAll:ew,index:aL}});var nw=C(function(Al,ef){(function(e,t){typeof Al=="object"&&typeof ef=="object"?ef.exports=t():typeof define=="function"&&define.amd?define([],t):typeof Al=="object"?Al.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:B="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:rs}={}){let en=Qt.map((Li)=>Li.trivia+Li.value).join(""),Di=f[x];return Di.type==="eof"?en:rs?en+Di.trivia:en.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 rs=Qt.split(`
554
+ `);return rs[rs.length-1]}(ge(ce(-5),{precedes:!0})),jt=ce(5),Dt=ge(jt),Ji=Ae+Dt.split(`
596
555
  `)[0]+`
597
- `+(" ".repeat(Ne.length)+"^"),sf=O==="Syntax"?"since":"inside",bg=`${O} error at line ${Ae}${p.name?` in ${p.name}`:""}${S&&S.name?`, ${sf} \`${S.partial?"partial ":""}${function(br){let Ti=[br];for(;br&&br.parent;){let{parent:jn}=br;Ti.unshift(jn),br=jn}return Ti.map((jn)=>function(Jo,Fo){let xg=Jo;return Fo&&(xg+=` ${Fo}`),xg}(jn.type,jn.name)).join(" -> ")}(S)}\``:""}:
598
- ${Do}`;return{message:`${bg} ${A}`,bareMessage:A,context:bg,line:Ae,sourceName:p.name,level:V,ruleName:de,autofix:G,input:nr,tokens:qt}}function n(p,v,S,A){return r(p,v,S,A,"Syntax")}function i(p,v,S,A,O={}){return O.ruleName=S,r(v.source,p.index,v,A,"Validation",O)}e.r(t),e.d(t,{WebIDLParseError:()=>it,parse:()=>jt,validate:()=>fC,write:()=>Ft});class s{constructor({source:p,tokens:v}){Object.defineProperties(this,{source:{value:p},tokens:{value:v,writable:!0},parent:{value:null,writable:!0},this:{value:this}})}toJSON(){let p={type:void 0,name:void 0,inheritance:void 0},v=this;for(;v!==Object.prototype;){let S=Object.getOwnPropertyDescriptors(v);for(let[A,O]of Object.entries(S))(O.enumerable||O.get)&&(p[A]=this[A]);v=Object.getPrototypeOf(v)}return p}}function o(p,v,{useNullableInner:S}={}){if(!p.union){let A=v.unique.get(p.idlType);if(!A)return;if(A.type==="typedef"){let{typedefIncludesDictionary:O}=v.cache;if(O.has(A))return O.get(A);v.cache.typedefIncludesDictionary.set(A,void 0);let V=o(A.idlType,v);if(v.cache.typedefIncludesDictionary.set(A,V),V)return{reference:p,dictionary:V.dictionary}}if(A.type==="dictionary"&&(S||!p.nullable))return{reference:p,dictionary:A}}for(let A of p.subtype){let O=o(A,v);if(O)return A.union?O:{reference:A,dictionary:O.dictionary}}}function a(p,v){if(v.cache.dictionaryIncludesRequiredField.has(p))return v.cache.dictionaryIncludesRequiredField.get(p);v.cache.dictionaryIncludesRequiredField.set(p,void 0);let S=p.members.some((A)=>A.required);if(!S&&p.inheritance){let A=v.unique.get(p.inheritance);A?a(A,v)&&(S=!0):S=!0}return v.cache.dictionaryIncludesRequiredField.set(p,S),S}class c extends Array{constructor({source:p,tokens:v}){super(),Object.defineProperties(this,{source:{value:p},tokens:{value:v},parent:{value:null,writable:!0}})}}class l extends s{static parser(p,v){return()=>{let S=p.consumeKind(v);if(S)return new l({source:p.source,tokens:{value:S}})}}get value(){return N(this.tokens.value.value)}write(p){return p.ts.wrap([p.token(this.tokens.value),p.token(this.tokens.separator)])}}class u extends l{static parse(p){let v=p.consumeKind("eof");if(v)return new u({source:p.source,tokens:{value:v}})}get type(){return"eof"}}function d(p,v){return q(p,{parser:l.parser(p,v),listName:v+" list"})}let h=["identifier","decimal","integer","string"],m=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map((p)=>[p,`Legacy${p}`]),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function y(p){for(let v of h){let S=d(p,v);if(S.length)return S}p.error("Expected identifiers, strings, decimals, or integers but none found")}class g extends s{static parse(p){let v={assign:p.consume("=")},S=Z(new g({source:p.source,tokens:v}));if(S.list=[],v.assign){if(v.asterisk=p.consume("*"),v.asterisk)return S.this;v.secondaryName=p.consumeKind(...h)}return v.open=p.consume("("),v.open?(S.list=S.rhsIsList?y(p):ie(p),v.close=p.consume(")")||p.error("Unexpected token in extended attribute argument list")):v.assign&&!v.secondaryName&&p.error("No right hand side to extended attribute assignment"),S.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.asterisk&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.asterisk?"*":this.tokens.secondaryName?this.tokens.secondaryName.type:null}write(p){let{rhsType:v}=this;return p.ts.wrap([p.token(this.tokens.assign),p.token(this.tokens.asterisk),p.reference_token(this.tokens.secondaryName,this.parent),p.token(this.tokens.open),...this.list.map((S)=>v==="identifier-list"?p.identifier(S,this.parent):S.write(p)),p.token(this.tokens.close)])}}class b extends s{static parse(p){let v=p.consumeKind("identifier");if(v)return new b({source:p.source,tokens:{name:v},params:g.parse(p)})}constructor({source:p,tokens:v,params:S}){super({source:p,tokens:v}),S.parent=this,Object.defineProperty(this,"params",{value:S})}get type(){return"extended-attribute"}get name(){return this.tokens.name.value}get rhs(){let{rhsType:p,tokens:v,list:S}=this.params;if(!p)return null;return{type:p,value:this.params.rhsIsList?S:this.params.tokens.secondaryName?N(v.secondaryName.value):null}}get arguments(){let{rhsIsList:p,list:v}=this.params;return!v||p?[]:v}*validate(p){let{name:v}=this;if(v==="LegacyNoInterfaceObject")yield i(this.tokens.name,this,"no-nointerfaceobject","`[LegacyNoInterfaceObject]` extended attribute is an undesirable feature that may be removed from Web IDL in the future. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more information.",{level:"warning"});else if(m.has(v)){let A=`\`[${v}]\` extended attribute is a legacy feature that is now renamed to \`[${m.get(v)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield i(this.tokens.name,this,"renamed-legacy",A,{level:"warning",autofix:(S=this,()=>{let{name:O}=S;S.tokens.name.value=m.get(O),O==="TreatNullAs"&&(S.params.tokens={})})})}var S;for(let A of this.arguments)yield*A.validate(p)}write(p){return p.ts.wrap([p.ts.trivia(this.tokens.name.trivia),p.ts.extendedAttribute(p.ts.wrap([p.ts.extendedAttributeReference(this.name),this.params.write(p)])),p.token(this.tokens.separator)])}}class x extends c{static parse(p){let v={};v.open=p.consume("[");let S=new x({source:p.source,tokens:v});return v.open?(S.push(...q(p,{parser:b.parse,listName:"extended attribute"})),v.close=p.consume("]")||p.error("Expected a closing token for the extended attribute list"),S.length||(p.unconsume(v.close.index),p.error("An extended attribute list must not be empty")),p.probe("[")&&p.error("Illegal double extended attribute lists, consider merging them"),S):S}*validate(p){for(let v of this)yield*v.validate(p)}write(p){return this.length?p.ts.wrap([p.token(this.tokens.open),...this.map((v)=>v.write(p)),p.token(this.tokens.close)]):""}}function _(p,v){let S=p.consume("?");S&&(v.tokens.nullable=S),p.probe("?")&&p.error("Can't nullable more than once")}function P(p,v){let S=function(A,O){let V=A.consume("FrozenArray","ObservableArray","Promise","async_sequence","sequence","record");if(!V)return;let G=Z(new E({source:A.source,tokens:{base:V}}));switch(G.tokens.open=A.consume("<")||A.error(`No opening bracket after ${V.value}`),V.value){case"Promise":{A.probe("[")&&A.error("Promise type cannot have extended attribute");let de=le(A,O)||A.error("Missing Promise subtype");G.subtype.push(de);break}case"async_sequence":case"sequence":case"FrozenArray":case"ObservableArray":{let de=te(A,O)||A.error(`Missing ${V.value} subtype`);G.subtype.push(de);break}case"record":{A.probe("[")&&A.error("Record key cannot have extended attribute");let de=A.consume(...Qe)||A.error(`Record key must be one of: ${Qe.join(", ")}`),fe=new E({source:A.source,tokens:{base:de}});fe.tokens.separator=A.consume(",")||A.error("Missing comma after record key type"),fe.type=O;let ye=te(A,O)||A.error("Error parsing generic type record");G.subtype.push(fe,ye);break}}return G.idlType||A.error(`Error parsing generic type ${V.value}`),G.tokens.close=A.consume(">")||A.error(`Missing closing bracket after ${V.value}`),G.this}(p,v)||ue(p);if(!S){let A=p.consumeKind("identifier")||p.consume(...Qe,...pe);if(!A)return;S=new E({source:p.source,tokens:{base:A}}),p.probe("<")&&p.error(`Unsupported generic type ${A.value}`)}return S.generic==="Promise"&&p.probe("?")&&p.error("Promise type cannot be nullable"),S.type=v||null,_(p,S),S.nullable&&S.idlType==="any"&&p.error("Type `any` cannot be made nullable"),S}class E extends s{static parse(p,v){return P(p,v)||function(S,A){let O={};if(O.open=S.consume("("),!O.open)return;let V=Z(new E({source:S.source,tokens:O}));for(V.type=A||null;;){let G=te(S,A)||S.error("No type after open parenthesis or 'or' in union type");G.idlType==="any"&&S.error("Type `any` cannot be included in a union type"),G.generic==="Promise"&&S.error("Type `Promise` cannot be included in a union type"),V.subtype.push(G);let de=S.consume("or");if(!de)break;G.tokens.separator=de}return V.idlType.length<2&&S.error("At least two types are expected in a union type but found less"),O.close=S.consume(")")||S.error("Unterminated union type"),_(S,V),V.this}(p,v)}constructor({source:p,tokens:v}){super({source:p,tokens:v}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new x({source:p,tokens:{}})}get generic(){return this.subtype.length&&this.tokens.base?this.tokens.base.value:""}get nullable(){return Boolean(this.tokens.nullable)}get union(){return Boolean(this.subtype.length)&&!this.tokens.base}get idlType(){if(this.subtype.length)return this.subtype;return N([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter((p)=>p).map((p)=>p.value).join(" "))}*validate(p){if(yield*this.extAttrs.validate(p),this.idlType==="BufferSource")for(let O of[this.extAttrs,this.parent?.extAttrs])for(let V of O){if(V.name!=="AllowShared")continue;let G="`[AllowShared] BufferSource` is now replaced with AllowSharedBufferSource.";yield i(this.tokens.base,this,"migrate-allowshared",G,{autofix:w(this,V,O)})}if(this.idlType==="void")yield i(this.tokens.base,this,"replace-void","`void` is now replaced by `undefined`. Refer to the [relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) for more information.",{autofix:(v=this,()=>{v.tokens.base.value="undefined"})});var v;let S=!this.union&&p.unique.get(this.idlType),A=this.union?this:S&&S.type==="typedef"?S.idlType:void 0;if(A&&this.nullable){let{reference:O}=o(A,p)||{};if(O){let V=(this.union?O:this).tokens.base;yield i(V,this,"no-nullable-union-dict","Nullable union cannot include a dictionary type.")}}else for(let O of this.subtype)yield*O.validate(p)}write(p){return p.ts.wrap([this.extAttrs.write(p),(()=>{if(this.union||this.generic)return p.ts.wrap([p.token(this.tokens.base,p.ts.generic),p.token(this.tokens.open),...this.subtype.map((O)=>O.write(p)),p.token(this.tokens.close)]);let v=this.tokens.prefix||this.tokens.base,S=this.tokens.prefix?[this.tokens.prefix.value,p.ts.trivia(this.tokens.base.trivia)]:[],A=p.reference(p.ts.wrap([...S,this.tokens.base.value,p.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return p.ts.wrap([p.ts.trivia(v.trivia),A])})(),p.token(this.tokens.nullable),p.token(this.tokens.separator)])}}function w(p,v,S){return()=>{let A=S.indexOf(v);S.splice(A,1),!S.length&&p.tokens.base.trivia.match(/^\s$/)&&(p.tokens.base.trivia=""),p.tokens.base.value="AllowSharedBufferSource"}}class k extends s{static parse(p){let v=p.consume("=");if(!v)return null;let S=U(p)||p.consumeKind("string")||p.consume("null","[","{")||p.error("No value for default"),A=[S];if(S.value==="["){let O=p.consume("]")||p.error("Default sequence value must be empty");A.push(O)}else if(S.value==="{"){let O=p.consume("}")||p.error("Default dictionary value must be empty");A.push(O)}return new k({source:p.source,tokens:{assign:v},expression:A})}constructor({source:p,tokens:v,expression:S}){super({source:p,tokens:v}),S.parent=this,Object.defineProperty(this,"expression",{value:S})}get type(){return ne(this.expression[0]).type}get value(){return ne(this.expression[0]).value}get negative(){return ne(this.expression[0]).negative}write(p){return p.ts.wrap([p.token(this.tokens.assign),...this.expression.map((v)=>p.token(v))])}}class R extends s{static parse(p){let v=p.position,S={},A=Z(new R({source:p.source,tokens:S}));return A.extAttrs=x.parse(p),S.optional=p.consume("optional"),A.idlType=te(p,"argument-type"),A.idlType?(S.optional||(S.variadic=p.consume("...")),S.name=p.consumeKind("identifier")||p.consume(...z),S.name?(A.default=S.optional?k.parse(p):null,A.this):p.unconsume(v)):p.unconsume(v)}get type(){return"argument"}get optional(){return!!this.tokens.optional}get variadic(){return!!this.tokens.variadic}get name(){return N(this.tokens.name.value)}*validate(p){yield*this.extAttrs.validate(p),yield*this.idlType.validate(p);let v=o(this.idlType,p,{useNullableInner:!0});if(v){if(this.idlType.nullable)yield i(this.tokens.name,this,"no-nullable-dict-arg","Dictionary arguments cannot be nullable.");else if(this.optional){if(!this.default)yield i(this.tokens.name,this,"dict-arg-default","Optional dictionary arguments must have a default value of `{}`.",{autofix:j(this)})}else if(this.parent&&!a(v.dictionary,p)&&function(A){let O=A.parent.arguments||A.parent.list,V=O.indexOf(A);return!O.slice(V+1).some((de)=>!de.optional)}(this))yield i(this.tokens.name,this,"dict-arg-optional","Dictionary argument must be optional if it has no required fields",{autofix:(S=this,()=>{let O=Q(S.idlType);S.tokens.optional={...O,type:"optional",value:"optional"},O.trivia=" ",j(S)()})})}var S}write(p){return p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.optional),p.ts.type(this.idlType.write(p)),p.token(this.tokens.variadic),p.name_token(this.tokens.name,{data:this}),this.default?this.default.write(p):"",p.token(this.tokens.separator)])}}function j(p){return()=>{p.default=k.parse(new nt(" = {}"))}}class D extends s{static parse(p,{special:v,regular:S}={}){let A={special:v},O=Z(new D({source:p.source,tokens:A}));return v&&v.value==="stringifier"&&(A.termination=p.consume(";"),A.termination)?(O.arguments=[],O):(v||S||(A.special=p.consume("getter","setter","deleter")),O.idlType=le(p)||p.error("Missing return type"),A.name=p.consumeKind("identifier")||p.consume("includes"),A.open=p.consume("(")||p.error("Invalid operation"),O.arguments=ie(p),A.close=p.consume(")")||p.error("Unterminated operation"),A.termination=p.consume(";")||p.error("Unterminated operation, expected `;`"),O.this)}get type(){return"operation"}get name(){let{name:p}=this.tokens;return p?N(p.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(p){if(yield*this.extAttrs.validate(p),!this.name&&["","static"].includes(this.special))yield i(this.tokens.open,this,"incomplete-op","Regular or static operations must have both a return type and an identifier.");if(this.idlType){if(this.idlType.generic==="async_sequence")yield i(this.idlType.tokens.base,this,"async-sequence-idl-to-js","async_sequence types cannot be returned by an operation.");yield*this.idlType.validate(p)}for(let v of this.arguments)yield*v.validate(p)}write(p){let{parent:v}=this,S=this.idlType?[p.ts.type(this.idlType.write(p)),p.name_token(this.tokens.name,{data:this,parent:v}),p.token(this.tokens.open),p.ts.wrap(this.arguments.map((A)=>A.write(p))),p.token(this.tokens.close)]:[];return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),this.tokens.name?p.token(this.tokens.special):p.token(this.tokens.special,p.ts.nameless,{data:this,parent:v}),...S,p.token(this.tokens.termination)]),{data:this,parent:v})}}class F extends s{static parse(p,{special:v,noInherit:S=!1,readonly:A=!1}={}){let O=p.position,V={special:v},G=Z(new F({source:p.source,tokens:V}));if(v||S||(V.special=p.consume("inherit")),G.special==="inherit"&&p.probe("readonly")&&p.error("Inherited attributes cannot be read-only"),V.readonly=p.consume("readonly"),A&&!V.readonly&&p.probe("attribute")&&p.error("Attributes must be readonly in this context"),V.base=p.consume("attribute"),V.base)return G.idlType=te(p,"attribute-type")||p.error("Attribute lacks a type"),V.name=p.consumeKind("identifier")||p.consume("async","required")||p.error("Attribute lacks a name"),V.termination=p.consume(";")||p.error("Unterminated attribute, expected `;`"),G.this;p.unconsume(O)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return N(this.tokens.name.value)}*validate(p){if(yield*this.extAttrs.validate(p),yield*this.idlType.validate(p),["async_sequence","sequence","record"].includes(this.idlType.generic)){let v=`Attributes cannot accept ${this.idlType.generic} types.`;yield i(this.tokens.name,this,"attr-invalid-type",v)}{let{reference:v}=o(this.idlType,p)||{};if(v){let S=(this.idlType.union?v:this.idlType).tokens.base;yield i(S,this,"attr-invalid-type","Attributes cannot accept dictionary types.")}}if(this.readonly&&function(v,S){if(v.union)return!1;if(v.extAttrs.some((O)=>O.name==="EnforceRange"))return!0;let A=S.unique.get(v.idlType);return A?.type==="typedef"&&A.idlType.extAttrs.some((O)=>O.name==="EnforceRange")}(this.idlType,p)){let v=this.idlType.tokens.base;yield i(v,this,"attr-invalid-type","Readonly attributes cannot accept [EnforceRange] extended attribute.")}}write(p){let{parent:v}=this;return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.special),p.token(this.tokens.readonly),p.token(this.tokens.base),p.ts.type(this.idlType.write(p)),p.name_token(this.tokens.name,{data:this,parent:v}),p.token(this.tokens.termination)]),{data:this,parent:v})}}function N(p){return p.startsWith("_")?p.slice(1):p}function q(p,{parser:v,allowDangler:S,listName:A="list"}){let O=v(p);if(!O)return[];O.tokens.separator=p.consume(",");let V=[O];for(;O.tokens.separator;){let G=v(p);if(!G){S||p.error(`Trailing comma in ${A}`);break}if(G.tokens.separator=p.consume(","),V.push(G),!G.tokens.separator)break}return V}function U(p){return p.consumeKind("decimal","integer")||p.consume("true","false","Infinity","-Infinity","NaN")}function ne({type:p,value:v}){switch(p){case"decimal":case"integer":return{type:"number",value:v};case"string":return{type:"string",value:v.slice(1,-1)}}switch(v){case"true":case"false":return{type:"boolean",value:v==="true"};case"Infinity":case"-Infinity":return{type:"Infinity",negative:v.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:v}}}function ue(p){let{source:v}=p,S=function(){let O=p.consume("unsigned"),V=p.consume("short","long");if(V){let G=p.consume("long");return new E({source:v,tokens:{prefix:O,base:V,postfix:G}})}O&&p.error("Failed to parse integer type")}()||function(){let O=p.consume("unrestricted"),V=p.consume("float","double");if(V)return new E({source:v,tokens:{prefix:O,base:V}});O&&p.error("Failed to parse float type")}();if(S)return S;let A=p.consume("bigint","boolean","byte","octet","undefined");return A?new E({source:v,tokens:{base:A}}):void 0}function ie(p){return q(p,{parser:R.parse,listName:"arguments list"})}function te(p,v){let S=x.parse(p),A=E.parse(p,v);return A&&(Z(A).extAttrs=S),A}function le(p,v){let S=E.parse(p,v||"return-type");if(S)return S;let A=p.consume("void");if(A){let O=new E({source:p.source,tokens:{base:A}});return O.type="return-type",O}}function Ce(p){let v=p.consume("stringifier");if(!v)return;return F.parse(p,{special:v})||D.parse(p,{special:v})||p.error("Unterminated stringifier")}function W(p){let v=p.split(`
599
- `);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 sf=`The ${nr.special==="static"?"static ":""}operation "${Do}" has already been defined for the base interface "${qt.name}" either in itself or in a mixin`;yield i(nr.tokens.name,Ne,"no-cross-overload",sf)}}}function fe(ye){return ye.members.filter(({type:Ae})=>Ae==="operation")}}(p,this))}}function M(p,v){return p=Z(p),()=>{let S=W(p.extAttrs.tokens.open.trivia),A=p.members.length?W(Q(p.members[0]).trivia):function(Ae){let Ne=W(Ae),qt=Ne.includes("\t")?"\t":" ";return Ne+qt}(S),O=ln.parse(new nt(`
601
- ${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=k.parse(p),v.required&&S.default&&p.error("Required member must not have a default"),v.termination=p.consume(";")||p.error("Unterminated dictionary member, expected `;`"),S.this}get type(){return"field"}get name(){return N(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(p){yield*this.idlType.validate(p)}write(p){let{parent:v}=this;return p.ts.definition(p.ts.wrap([this.extAttrs.write(p),p.token(this.tokens.required),p.ts.type(this.idlType.write(p)),p.name_token(this.tokens.name,{data:this,parent:v}),this.default?this.default.write(p):"",p.token(this.tokens.termination)]),{data:this,parent:v})}}class ae extends rr{static parse(p,{extMembers:v=[],partial:S}={}){let A={partial:S};if(A.base=p.consume("dictionary"),A.base)return rr.parse(p,new ae({source:p.source,tokens:A}),{inheritable:!S,allowedMembers:[...v,[B.parse]]})}get type(){return"dictionary"}}class we extends rr{static parse(p,{extMembers:v=[],partial:S}={}){let A={partial:S};if(A.base=p.consume("namespace"),A.base)return rr.parse(p,new we({source:p.source,tokens:A}),{allowedMembers:[...v,[F.parse,{noInherit:!0,readonly:!0}],[Qn.parse],[D.parse,{regular:!0}]]})}get type(){return"namespace"}*validate(p){if(!this.partial&&this.extAttrs.every((v)=>v.name!=="Exposed"))yield i(this.tokens.name,this,"require-exposed","Namespaces must have [Exposed] extended attribute. To fix, add, for example, [Exposed=Window]. Please also consider carefully if your namespace should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.",{autofix:oe(this)});yield*super.validate(p)}}class gt extends rr{static parse(p,v,{extMembers:S=[]}={}){let A={callback:v};if(A.base=p.consume("interface"),A.base)return rr.parse(p,new gt({source:p.source,tokens:A}),{allowedMembers:[...S,[Qn.parse],[D.parse,{regular:!0}]]})}get type(){return"callback interface"}}function st(p,v){let S=p.source;function A(fe){p.error(fe)}function O(...fe){return p.consume(...fe)}function V(fe){let ye=O("interface");if(ye)return H.parse(p,ye,{...fe,...v?.extensions?.mixin})||xs.parse(p,ye,{...fe,...v?.extensions?.interface})||A("Interface has no proper body")}function G(){if(v.productions)for(let fe of v.productions){let ye=fe(p);if(ye)return ye}return function(){let fe=O("callback");if(fe)return p.probe("interface")?gt.parse(p,fe,{...v?.extensions?.callbackInterface}):bs.parse(p,fe)}()||V()||function(){let fe=O("partial");if(fe)return ae.parse(p,{partial:fe,...v?.extensions?.dictionary})||V({partial:fe})||we.parse(p,{partial:fe,...v?.extensions?.namespace})||A("Partial doesn't apply to anything")}()||ae.parse(p,v?.extensions?.dictionary)||tr.parse(p)||Ii.parse(p)||Xn.parse(p)||we.parse(p,v?.extensions?.namespace)}let de=function(){if(!S.length)return[];let fe=[];for(;;){let Ae=x.parse(p),Ne=G();if(!Ne){Ae.length&&A("Stray extended attributes");break}Z(Ne).extAttrs=Ae,fe.push(Ne)}let ye=u.parse(p);return v.concrete&&fe.push(ye),fe}();return p.position<S.length&&A("Unrecognised tokens"),de}function jt(p,v={}){let S=new nt(p);return v.sourceName!==void 0&&(S.source.name=v.sourceName),st(S,v)}function me(p){return p}let ot={wrap:(p)=>p.join(""),trivia:me,name:me,reference:me,type:me,generic:me,nameless:me,inheritance:me,definition:me,extendedAttribute:me,extendedAttributeReference:me};class We{constructor(p){this.ts=Object.assign({},ot,p)}reference(p,{unescaped:v,context:S}){return v||(v=p.startsWith("_")?p.slice(1):p),this.ts.reference(p,v,S)}token(p,v=me,...S){if(!p)return"";let A=v(p.value,...S);return this.ts.wrap([this.ts.trivia(p.trivia),A])}reference_token(p,v){return this.token(p,this.reference.bind(this),{context:v})}name_token(p,v){return this.token(p,this.ts.name,v)}identifier(p,v){return this.ts.wrap([this.reference_token(p.tokens.value,v),this.token(p.tokens.separator)])}}function Ft(p,{templates:v=ot}={}){v=Object.assign({},ot,v);let S=new We(v);return v.wrap(p.map((A)=>A.write(S)))}function nf(p,v){let S=new Map,A=p.filter((O)=>O.type==="includes");for(let O of A){let V=v.get(O.includes);if(!V)continue;let G=S.get(O.target);G?G.push(V):S.set(O.target,[V])}return S}function*vc(p){let v=function(S){let A=new Map,O=new Set,V=new Map;for(let G of S)if(G.partial){let de=V.get(G.name);de?de.push(G):V.set(G.name,[G])}else G.name&&(A.has(G.name)?O.add(G):A.set(G.name,G));return{all:S,unique:A,partials:V,duplicates:O,mixinMap:nf(S,A),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(p);for(let S of v.all)S.validate&&(yield*S.validate(v));yield*function*({unique:S,duplicates:A}){for(let O of A){let{name:V}=O,G=`The name "${V}" of type "${S.get(V).type}" was already seen`;yield i(O.tokens.name,O,"no-duplicate",G)}}(v)}function fC(p){return[...vc((v=p,v.flat?v.flat():[].concat(...v)))];var v}return t})())});var j1=C(function(koe,A1){var __dirname="/home/runner/work/jx/jx/node_modules/@webref/idl",E1=De("fs").promises,_1=De("path"),NU=S1();class P1{constructor(e,t){this.filename=t,this.shortname=_1.basename(t,".idl"),this.path=_1.join(e,t)}async text(){return await E1.readFile(this.path,"utf8")}async parse(){let e=await this.text();return NU.parse(e)}}async function k1({folder:e=__dirname}={}){let t={},r=await E1.readdir(e);for(let n of r)if(n.endsWith(".idl")){let i=new P1(e,n);t[i.shortname]=i}return t}async function MU(e){let t=await k1(e);for(let[r,n]of Object.entries(t))t[r]=await n.parse();return t}A1.exports={listAll:k1,parseAll:MU}});var R1,O1;var C1=L(()=>{R1={anyOf:[{additionalProperties:!1,description:"Two-way: `target` is the test, `value` the tag when it is truthy, `initial` the tag when it is not.",properties:{initial:{$ref:"#/$defs/TagName"},operator:{const:"?:",type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/TagName"}},required:["operator","target","value","initial"],title:"?: — the tag when the test holds, and the tag when it does not"},{additionalProperties:!1,description:"Multiway: `target` is the discriminant, matched against case keys by its string form. "+"`default` is required — an element with no tag cannot exist.",properties:{cases:{additionalProperties:{$ref:"#/$defs/TagName"},type:"object"},default:{$ref:"#/$defs/TagName"},operator:{const:"switch",type:"string"},target:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target","cases","default"],title:"switch — one tag per discriminant value, with a required fallback"}],description:"A tag name chosen at element creation. Every branch resolves to a `TagName`, so the candidate set is enumerable without evaluating anything."},O1={anyOf:[{$ref:"#/$defs/TagName"},{additionalProperties:!1,properties:{$expression:{$ref:"#/$defs/TagExpression"}},required:["$expression"],type:"object"}]}});var I1;var T1=L(()=>{I1={description:"HTML element tag name or custom element name (must contain a hyphen per Web Components spec). "+"A NAME, never an expression: no `${…}` position in the pipeline evaluates a tagName. Use "+"`$switch`/`cases` to vary the element.",minLength:1,pattern:"^[a-zA-Z][a-zA-Z0-9._-]*$",type:"string"}});var N1,M1,L1;var D1=L(()=>{N1={oneOf:[{type:"string"},{$ref:"#/$defs/RefObject"}]},M1={oneOf:[{type:"boolean"},{$ref:"#/$defs/RefObject"}]},L1={oneOf:[{type:"number"},{$ref:"#/$defs/RefObject"}]}});var J1;var F1=L(()=>{J1={additionalProperties:!0,description:"A page-level <head> entry. Defines meta tags, link tags, script tags, etc.",properties:{attributes:{additionalProperties:{oneOf:[{type:"string"},{type:"boolean"}]},type:"object"},children:{items:{$ref:"#/$defs/HeadEntry"},type:"array"},tagName:{type:"string"},textContent:{description:"Element content. An object is serialized to JSON inside the tag — that is how a "+'JSON-LD block (`<script type="application/ld+json">`) is authored.',oneOf:[{type:"string"},{type:"object"}]}},required:["tagName"],type:"object"}});var q1,B1;var H1=L(()=>{q1={description:"A CEM-compatible parameter definition for a function. Follows the Custom Elements Manifest Parameter shape.",properties:{default:{description:"Default value for the parameter."},description:{description:"Parameter documentation.",type:"string"},name:{description:"Parameter name.",type:"string"},optional:{description:"Whether the parameter is optional.",type:"boolean"},type:{description:"Parameter type (JSON Schema or CEM { text } format)."}},required:["name"],type:"object"},B1={description:"A CEM-compatible event definition. Describes a CustomEvent the function dispatches.",properties:{deprecated:{description:"Deprecation notice.",oneOf:[{type:"boolean"},{type:"string"}]},description:{description:"Event documentation.",type:"string"},name:{description:"Event name (e.g. 'task-toggled').",type:"string"},type:{description:"Event type (e.g. { text: 'CustomEvent' })."}},required:["name"],type:"object"}});var U1;var V1=L(()=>{U1={enum:["string","number","integer","boolean","array","object","null"],type:"string"}});var W1,z1,K1,G1,Y1,X1,Q1,Z1,e_;var t_=L(()=>{W1={description:"Reference to a $defs type definition in the current component.",examples:["#/$defs/Count","#/$defs/TodoItem","#/$defs/Status"],pattern:String.raw`^#/\$defs/`,type:"string"},z1={description:"Reference to a state entry (runtime variable) in the current component.",examples:["#/state/count","#/state/addTask","#/state/items"],pattern:"^#/state/",type:"string"},K1={description:"Reference to an external Jx component file.",examples:["./card.json","https://cdn.example.com/button.json"],pattern:String.raw`^(\./|\.\./).*\.json$|^https?://`,type:"string"},G1={description:"Reference to a window or document global.",examples:["window#/currentUser","document#/appConfig"],pattern:"^(window|document)#/",type:"string"},Y1={description:"Reference to a named state entry passed via $props from a parent component.",examples:["parent#/sharedState","parent#/theme"],pattern:"^parent#/",type:"string"},X1={description:"Reference to the current Array map iteration context.",examples:["$map/item","$map/index","$map/item/text","$map/item/done"],pattern:String.raw`^\$map/(item|index)(/.*)?$`,type:"string"},Q1={oneOf:[{$ref:"#/$defs/InternalRef"},{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/ExternalRef"},{$ref:"#/$defs/GlobalRef"},{$ref:"#/$defs/ParentRef"},{$ref:"#/$defs/MapRef"}],type:"string"},Z1={additionalProperties:!1,description:"A $ref binding. Resolves to a state entry (reactive) or plain value (static).",properties:{$ref:{$ref:"#/$defs/AnyRef"}},required:["$ref"],type:"object"},e_={properties:{$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"}},required:["$ref"],type:"object"}});var uu;var r_=L(()=>{uu={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/RefObject"},{$ref:"#/$defs/StyleObject"}]},description:"CSS style definition. camelCase property names follow CSSOM convention. Keys starting with :, ., &, or [ are treated as nested CSS selectors. Keys matching $media breakpoint names (or other @-prefixed at-rules) group nested rules. Nesting is recursive: selector and at-rule groups may nest to arbitrary depth "+"(e.g. breakpoint → selector → pseudo-class), mirroring the compiler's recursive emission. "+"An object carrying $ref is a reactive VALUE, and the runtime reads it as one. It also matches the nested-block branch vacuously, since a block admits a string under any key, which is why these branches are anyOf rather than oneOf. A DECLARATION at-rule (@font-face, @property, @position-try, @counter-style) may hold an ARRAY of blocks, which is that key written more than once, in order: an object's keys are "+"unique, so @font-face — the at-rule whose identity is not in its key — could not otherwise "+"state a family's second weight at all.",patternProperties:{"^@(font-face|property|position-try|counter-style)":{anyOf:[{$ref:"#/$defs/StyleObject"},{items:{$ref:"#/$defs/StyleObject"},minItems:1,type:"array"}]}},properties:{$description:{description:"Why this rule exists. Emitted as a comment by static builds, ignored at runtime.",type:"string"}},type:"object"}});var n_,i_;var s_=L(()=>{n_={additionalProperties:!1,description:"Dynamic mapped list. Re-renders when the items state entry changes.",properties:{$prototype:{const:"Array",type:"string"},filter:{$ref:"#/$defs/RefObject"},items:{oneOf:[{$ref:"#/$defs/RefObject"},{type:"array"}]},key:{additionalProperties:!1,description:"The identity of each rendered row: a $map/item pointer read per item. A row whose key survives a change keeps its DOM node and its effects across reorders, insertions and "+"removals; without a key, rows are keyed by index. $map/index is not a key — an index "+"names a position, not a row.",properties:{$ref:{pattern:String.raw`^\$map/item(/.+)?$`,type:"string"}},required:["$ref"],type:"object"},map:{$ref:"#/$defs/ElementDef"},sort:{$ref:"#/$defs/RefObject"}},required:["$prototype","items","map"],type:"object"},i_={description:"Array of child definitions — elements, text, or Array namespaces (dynamic lists) mixed "+"freely. A bare Array namespace (the whole children slot is one dynamic list) is also "+"accepted for backward compatibility, as is a ${…} template string that resolves at build "+"time to an array of child definitions.",oneOf:[{items:{anyOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/SwitchNode"},{$ref:"#/$defs/ArrayNamespace"},{type:"string"},{type:"number"}]},type:"array"},{$ref:"#/$defs/ArrayNamespace"},{description:"Computed children — a ${…} template that resolves at build time to an array of child "+'definitions (e.g. "${state.entry.$children}" for parsed content). A bare plain-text string is NOT a valid children value; text children must be array items.',pattern:String.raw`\$\{`,type:"string"}]}});var o_,a_,c_,l_,u_,Cm;var f_=L(()=>{o_={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{$ref:"#/$defs/RefObject"}]},description:"HTML attributes and ARIA attributes set via element.setAttribute().",type:"object"},a_={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array"},{type:"object"},{$ref:"#/$defs/RefObject"}]},description:"Explicit prop passing at a component boundary.",type:"object"},c_={oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{$ref:"#/$defs/RefObject"}]},l_={additionalProperties:!1,description:"Reactive $ref that drives which case to render: a state entry, or inside a mapped array's template the row's $map/item or $map/index (spec §14.1).",properties:{$ref:{oneOf:[{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/MapRef"}],type:"string"}},required:["$ref"],type:"object"},u_={properties:{$switch:{$ref:"#/$defs/SwitchDef"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},type:"object"},tagName:{$ref:"#/$defs/TagName"}},required:["$switch","cases"],type:"object"},Cm={additionalProperties:{$ref:"#/$defs/ElementPropertyValue"},description:"A Jx element definition. Maps directly to a DOM element.",properties:{"$map/index":{$ref:"#/$defs/RefObject"},"$map/item":{$ref:"#/$defs/RefObject"},$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"},$switch:{$ref:"#/$defs/SwitchDef"},alt:{$ref:"#/$defs/StringOrRef"},attributes:{$ref:"#/$defs/AttributesObject"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},description:"Switch cases for this element. Maps case values to element definitions or external component refs, rendered according to the reactive $switch discriminant.",type:"object"},checked:{$ref:"#/$defs/BoolOrRef"},children:{$ref:"#/$defs/ChildrenValue"},className:{$ref:"#/$defs/StringOrRef"},dir:{enum:["ltr","rtl","auto"],type:"string"},disabled:{$ref:"#/$defs/BoolOrRef"},hidden:{$ref:"#/$defs/BoolOrRef"},href:{$ref:"#/$defs/StringOrRef"},id:{type:"string"},innerHTML:{$ref:"#/$defs/StringOrRef"},innerText:{$ref:"#/$defs/StringOrRef"},lang:{$ref:"#/$defs/StringOrRef"},name:{$ref:"#/$defs/StringOrRef"},placeholder:{$ref:"#/$defs/StringOrRef"},selected:{$ref:"#/$defs/BoolOrRef"},src:{$ref:"#/$defs/StringOrRef"},style:{$ref:"#/$defs/StyleObject"},tabIndex:{$ref:"#/$defs/NumberOrRef"},tagName:{$ref:"#/$defs/ElementTagName"},textContent:{$ref:"#/$defs/StringOrRef"},title:{$ref:"#/$defs/StringOrRef"},type:{$ref:"#/$defs/StringOrRef"},value:{$ref:"#/$defs/StringOrRef"}},required:["tagName"],type:"object"}});var d_;var p_=L(()=>{d_={description:"A typed reactive state variable with explicit type and default value. The type property is a JSON Schema or $ref to a $defs type definition. The default property is the initial runtime value.",not:{required:["$prototype"]},properties:{$ref:{description:"Reference to a shared type definition.",type:"string"},attribute:{description:"Linked HTML attribute name for CEM extraction.",type:"string"},default:{description:"Initial state value."},deprecated:{description:"Deprecation notice for CEM extraction.",oneOf:[{type:"boolean"},{type:"string"}]},description:{type:"string"},examples:{type:"array"},reflects:{description:"Whether property changes reflect back to the HTML attribute.",type:"boolean"},type:{description:"JSON Schema type definition, $ref to a $defs type, or JSON Schema type string.",oneOf:[{type:"string"},{type:"object"}]}},required:["default"],type:"object"}});var m_;var h_=L(()=>{m_={additionalProperties:!1,description:'A function declaration. $prototype must be "Function". body (inline) and $src (external) are mutually exclusive. First parameter is always state (the reactive scope).',properties:{$export:{description:"Named export in $src module. Defaults to the state key name.",type:"string"},$lazy:{description:"Load $src on first call instead of importing it up front. The function then returns a "+"promise, so it may only be called from a handler or lifecycle hook — never bound as a "+"computed value. Use it for code most visitors never reach.",type:"boolean"},$prototype:{const:"Function",type:"string"},$src:{description:"External module specifier. Mutually exclusive with body.",examples:["./counter.js","npm:@myorg/validators"],type:"string"},arguments:{description:"Legacy alias for parameters: bare string parameter names (state may be listed explicitly as the first name). Superseded by parameters.",examples:[["state","event"]],items:{type:"string"},type:"array"},body:{description:"Inline function body: an opaque JS source string (first implicit parameter is state), or a structured statement array (spec §20) — explicit structured function declaration, analyzable by tooling and editable visually. The escalation ladder within the shape is structured statements → JS string.",examples:["state.count++",'state.items.push({ id: Date.now(), text: "", done: false })','return state.score >= 90 ? "gold" : "silver"',[{operator:"push",target:{$ref:"#/state/cart"},value:1},{dispatchEvent:"cart-changed",detail:{$ref:"#/state/cart"}}]],oneOf:[{type:"string"},{$ref:"#/$defs/StatementList"}]},description:{type:"string"},emits:{description:"Array of CEM-compatible Event objects this function dispatches. Used for CEM extraction and studio event discovery.",items:{$ref:"#/$defs/CemEvent"},type:"array"},name:{description:"Explicit function name. Defaults to the state key name.",type:"string"},parameters:{description:"Function parameters (after the implicit state parameter). Accepts CEM-compatible parameter objects or bare string names for backward compatibility.",examples:[["event"],[{name:"event",type:{text:"Event"}}],[{description:"Item identifier",name:"id",type:{text:"number"}}]],items:{oneOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"},type:{description:"Return type for tooling (JSON Schema or CEM { text } format)."}},required:["$prototype"],type:"object"}});var g_,y_;var b_=L(()=>{g_={description:"One statement of a structured function body. Either a bare expression node in statement position (a mutation like =/push, or a call — its result discarded unless captured by an assignment), an if/then/else branch (JSON Schema conditional keywords; if holds a pure expression, then/else hold statement lists), a $switch multiway branch (discriminant matched by string form against cases keys, like element-level $switch), a dispatchEvent statement (WHATWG DOM: dispatches a CustomEvent from the handler's current target, with CustomEventInit members detail/bubbles/composed), or the two WHATWG event verbs stopPropagation and preventDefault, each spelled as the member set to true.",oneOf:[{$ref:"#/$defs/ExpressionNode"},{additionalProperties:!1,properties:{else:{items:{$ref:"#/$defs/Statement"},type:"array"},if:{$ref:"#/$defs/ExpressionOperand"},then:{items:{$ref:"#/$defs/Statement"},type:"array"}},required:["if","then"],title:"if / then / else — conditional branch (JSON Schema keyword triple)",type:"object"},{additionalProperties:!1,properties:{$switch:{$ref:"#/$defs/ExpressionOperand"},cases:{additionalProperties:{items:{$ref:"#/$defs/Statement"},type:"array"},type:"object"},default:{items:{$ref:"#/$defs/Statement"},type:"array"}},required:["$switch","cases"],title:"$switch / cases — multiway branch (element-level convention, ECMA switch semantics)",type:"object"},{additionalProperties:!1,properties:{bubbles:{type:"boolean"},composed:{type:"boolean"},detail:{$ref:"#/$defs/ExpressionOperand"},dispatchEvent:{description:"The CustomEvent type to dispatch (WHATWG DOM dispatchEvent).",type:"string"}},required:["dispatchEvent"],title:"dispatchEvent — emit a CustomEvent (WHATWG naming, CustomEventInit members)",type:"object"},{additionalProperties:!1,properties:{stopPropagation:{const:!0,description:"Stop the handler's event at the current target (WHATWG DOM stopPropagation), so an ancestor's handler for the same event does not run. A body run without an event has nothing to stop."}},required:["stopPropagation"],title:"stopPropagation — stop the event here (WHATWG DOM)",type:"object"},{additionalProperties:!1,properties:{preventDefault:{const:!0,description:"Cancel the handler's event's default action (WHATWG DOM preventDefault): a link's navigation, a form's submission, a key's scroll."}},required:["preventDefault"],title:"preventDefault — cancel the event's default action (WHATWG DOM)",type:"object"}]},y_={description:"A structured function body: statements executed sequentially (one yielding a promise is awaited before the next, per ECMA async/await semantics).",items:{$ref:"#/$defs/Statement"},type:"array"}});var x_;var $_=L(()=>{x_={description:'An external class / data source. $prototype is a constructor name (not "Function"). When $prototype is not in the built-in registry, $src is required. All state entries are reactive by default.',properties:{$export:{description:"Named export in $src module. Defaults to the $prototype value.",type:"string"},$prototype:{description:"Constructor name — built-in Web API class or external class name.",examples:["Request","URLSearchParams","FormData","LocalStorage","SessionStorage","Cookie","IndexedDB","Array","Set","Map","Blob","ReadableStream","MarkdownCollection","MyParser"],not:{const:"Function"},type:"string"},$src:{description:"External module specifier. Required when $prototype is not a built-in.",examples:["@jxsuite/md","./lib/my-parser.js","npm:@myorg/data"],type:"string"},autoIncrement:{type:"boolean"},body:{},database:{type:"string"},debounce:{minimum:0,type:"integer"},default:{},description:{type:"string"},domain:{type:"string"},filter:{anyOf:[{$ref:"#/$defs/RefObject"},{description:"A single filter object, e.g. an equality shorthand.",type:"object"},{description:'Ordered filter rules, e.g. [{ field: "Slug", op: "not empty" }].',items:{type:"object"},type:"array"}],description:"Filter configuration: a reactive $ref binding, a single filter object, or an ordered array of rules."},headers:{additionalProperties:{type:"string"},type:"object"},indexes:{items:{properties:{keyPath:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},name:{type:"string"},unique:{type:"boolean"}},required:["name","keyPath"],type:"object"},type:"array"},items:{},key:{type:"string"},keyPath:{type:"string"},manual:{type:"boolean"},map:{$ref:"#/$defs/ElementDef"},maxAge:{type:"integer"},method:{enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],type:"string"},name:{type:"string"},path:{type:"string"},responseType:{enum:["json","text","blob","arraybuffer","document",""],type:"string"},sameSite:{enum:["strict","lax","none"],type:"string"},secure:{type:"boolean"},sort:{anyOf:[{$ref:"#/$defs/RefObject"},{description:"A single sort rule, e.g. { field, order }.",type:"object"},{description:'Ordered sort rules, e.g. [{ field: "date", order: "desc" }].',items:{type:"object"},type:"array"}],description:"Sort configuration: a reactive $ref binding, a single { field, order } rule, or an ordered array of rules."},src:{description:"Configuration property passed to external class constructor.",type:"string"},store:{type:"string"},timing:{enum:["compiler","server","client"],type:"string"},url:{$ref:"#/$defs/StringOrRef"},version:{minimum:1,type:"integer"}},required:["$prototype"],type:"object"}});var v_;var w_=L(()=>{v_={description:"A reusable JSON Schema type definition for tooling only. No function, no runtime artifact. Referenced from state entries via $ref. Naming convention: PascalCase.",not:{anyOf:[{required:["default"]},{required:["$prototype"]}]},properties:{description:{type:"string"},enum:{type:"array"},examples:{type:"array"},items:{},maxLength:{minimum:0,type:"integer"},maximum:{type:"number"},minLength:{minimum:0,type:"integer"},minimum:{type:"number"},pattern:{type:"string"},properties:{type:"object"},required:{items:{type:"string"},type:"array"},type:{$ref:"#/$defs/JsonSchemaType"}},required:["type"],type:"object"}});var S_,E_,__,P_,k_,A_,j_,R_,O_,C_,I_,T_,N_,M_,L_,D_,J_;var F_=L(()=>{Mf();S_={additionalProperties:!1,description:"A JSON Pointer $ref operand within an expression node. $args/<name> resolves a named formula's parameter (callable entries only).",properties:{$ref:{pattern:String.raw`^(\$map/|\$reduce/|\$args/|event#/|#/|parent#/|window#/|document#/)`,type:"string"}},required:["$ref"],type:"object"},E_={anyOf:[{not:{pattern:String.raw`\$\{`},type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"},{description:"Plain-object literal (e.g. an Intl options bag). Objects carrying $ref or operator keys are pointers/nodes, never literals.",not:{anyOf:[{required:["$ref"]},{required:["operator"]}]},type:"object"}],description:"A non-reactive operand: scalar, plain-object literal, or array of operands."},__={anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"},{$ref:"#/$defs/ExpressionLiteral"}],description:"Anything that may appear in target or value: a pointer, a literal, or a nested expression node."},P_={enum:["!","-"]},k_={enum:["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]},A_={const:"?:"},j_={const:"switch"},R_={const:"call"},O_={description:"A genuine pure String.prototype / Array.prototype / Number.prototype method (spec §19.4d). The ES2023 change-by-copy family (toSorted, toReversed, toSpliced, with) stands in where mutation would otherwise occur. Receiver in target; value carries the argument (bare scalar) or argument list (array).",enum:["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]},C_={enum:["=","+=","-=","*=","/="]},I_={enum:["pop","shift"]},T_={enum:["push","unshift"]},N_={const:"splice"},M_={const:"reduce"},L_={enum:["map","filter"]},D_={additionalProperties:!1,description:"The core expression node. operator + target, with value gated by arity.",oneOf:[{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/UnaryOperator"}},required:["operator"],title:"Unary — target only, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/BinaryOperator"}},required:["operator","value"],title:"Binary — left in target, right in value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/AssignmentOperator"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"Assignment — writable target, value required"},{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/NoArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator"],title:"pop / shift — array receiver, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/OneArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"push / unshift — array receiver, single value argument"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/SpliceMethod"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},minItems:1,type:"array"}},required:["operator","value"],title:"splice — array receiver, [start, deleteCount, ...items]"},{properties:{operator:{$ref:"#/$defs/ReduceMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value","initial"],title:"reduce — pure fold over a pointer or derived array; seed in initial"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/MapFilterMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value"],title:"map / filter — pure over a pointer or derived array; per-item expression in value"},{description:"The ECMAScript conditional (ternary) operator, pure: target is the test, value the consequent, initial the alternate (the reduce precedent for repurposing initial). Chain else-if by nesting another ?: node in initial.",properties:{operator:{$ref:"#/$defs/ConditionalOperator"}},required:["operator","value","initial"],title:"?: — pure conditional; test in target, consequent in value, alternate in initial"},{description:"Value-keyed multiway selection, pure: target is the discriminant (matched against case keys by its string form, like element-level $switch), cases maps matched values to result operands, default is the operand when no case matches (result is undefined without it). Condition-chain branching composes from nested ?: nodes instead.",not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},type:"object"},default:{$ref:"#/$defs/ExpressionOperand"},operator:{$ref:"#/$defs/SwitchOperator"}},required:["operator","cases"],title:"switch — pure value-keyed selection; discriminant in target, results in cases/default"},{description:"A pure standard-library method call: target is the receiver (any operand — never mutated; change-by-copy names replace the mutating originals), value the optional argument (bare scalar) or argument list (array). A missing receiver or method yields undefined, matching null-safe path reads.",not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/PureMethod"}},required:["operator"],title:"Pure method — genuine prototype methods; receiver in target, args in value"},{description:"Invoke a callable, pure in formula position: target is the callee pointer — a named formula entry (#/state/…) or a blessed pure global via window#/ (Math.*, JSON.*, Object.keys/values/entries, and "+`${Qy()}) — and value is the positional argument list (the splice args-in-value precedent). Argument order follows the callee's declared parameters.`,not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/CallOperator"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"}},required:["operator"],title:"call — invoke a named formula or blessed global; callee in target, args in value"}],properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},description:"switch only: matched discriminant value (string form) → result operand.",type:"object"},default:{$ref:"#/$defs/ExpressionOperand",description:"switch only: result operand when no case key matches."},initial:{$ref:"#/$defs/ExpressionOperand"},operator:{type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target"],type:"object"},J_={additionalProperties:!1,description:"A declarative expression entry (Shape 5). Used as a state entry or inline event handler. With parameters it is a named formula: a pure, reusable computation invoked via the call operator, its parameters resolved through $args/<name> refs in the body.",properties:{$description:{type:"string"},$expression:{$ref:"#/$defs/ExpressionNode"},$title:{type:"string"},parameters:{description:"Named-formula parameters (CEM convention, as on Function entries): bare names or CEM parameter objects. Present ⇒ the entry is callable, not a computed value.",items:{anyOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"}},required:["$expression"],type:"object"}});var q_,B_,H_,U_;var V_=L(()=>{q_={description:"A single state entry. Shape is determined by value type: "+"scalar/array → naked reactive property, string with ${} → computed, "+'object with $prototype: "Function" → function, '+"object with $prototype: <other> → data source, "+"object with type and default → typed reactive property, "+"plain object → naked object reactive property.",oneOf:[{type:"number"},{type:"boolean"},{type:"null"},{type:"string"},{type:"array"},{$ref:"#/$defs/TypedStateDef"},{$ref:"#/$defs/FunctionDef"},{$ref:"#/$defs/ExternalClassDef"},{$ref:"#/$defs/ExpressionEntry"},{not:{anyOf:[{required:["$prototype"]},{required:["default"]},{required:["type"]},{required:["$expression"]}]},type:"object"}]},B_={additionalProperties:{$ref:"#/$defs/StateEntry"},description:"Map of runtime variables. Keys are camelCase (public) or #-prefixed (private). All entries are reactive by default.",type:"object"},H_={additionalProperties:{$ref:"#/$defs/TypeDefEntry"},description:"Map of reusable JSON Schema type definitions. Keys are PascalCase type names. No runtime artifacts are produced.",type:"object"},U_={description:"A $defs type definition entry. Must be a pure JSON Schema type definition or a class definition (.class.json format).",oneOf:[{$ref:"#/$defs/PureTypeDef"},{$ref:"#/$defs/ClassDef"}]}});var LU,Im,Tm,Nm,Mm,Lm,Dm,Jm,Fm,qm,W_;var z_=L(()=>{LU=["method","accessor","parse","serialize","rewrite","discover","load","projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"],Im={description:"A typed parameter definition for a class.",properties:{default:{},description:{type:"string"},examples:{type:"array"},format:{description:`When "json-schema", this parameter's value is itself a JSON Schema.`,type:"string"},identifier:{type:"string"},type:{}},required:["identifier"],type:"object"},Tm={description:"A class field definition with access control and scope.",properties:{$prototype:{description:'Data source prototype for this field (e.g., "Request").',type:"string"},access:{enum:["public","private","protected"],type:"string"},default:{},description:{type:"string"},examples:{type:"array"},identifier:{type:"string"},initializer:{},role:{const:"field",type:"string"},scope:{enum:["instance","static"],type:"string"},type:{}},type:"object"},Nm={description:"Class constructor definition.",properties:{$prototype:{const:"Function",type:"string"},body:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:{type:"string"},parameters:{items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{$ref:"#/$defs/ClassParameterDef"}]},type:"array"},role:{const:"constructor",type:"string"},superCall:{properties:{arguments:{items:{type:"string"},type:"array"}},type:"object"}},type:"object"},Mm={description:"A class method or accessor definition. Capability roles (parse, serialize, rewrite, discover, load) mark static methods that hosts (compiler, server, studio) invoke for format dispatch.",properties:{$prototype:{const:"Function",type:"string"},access:{enum:["public","private","protected"],type:"string"},body:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:{type:"string"},getter:{properties:{body:{type:"string"}},type:"object"},identifier:{type:"string"},parameters:{items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{$ref:"#/$defs/ClassParameterDef"}]},type:"array"},returnType:{},role:{enum:LU,type:"string"},scope:{enum:["instance","static"],type:"string"},setter:{properties:{body:{type:"string"},parameters:{type:"array"}},type:"object"},timing:{description:"Execution environments allowed to call this capability directly. Hosts outside the list round-trip through the dev server.",items:{enum:["compiler","server","client"],type:"string"},type:"array"}},type:"object"},Lm={description:"Format participation marker. A class carrying this block is auto-discovered from the project imports map and used for file-extension dispatch by the compiler, server, and studio.",properties:{documentKinds:{description:'"page"/"component" allow the extension in pages/components discovery; "content" allows it as a content-type source.',items:{enum:["page","component","content"],type:"string"},type:"array"},exportTarget:{description:"When true, site builds emit a serialized sidecar per page in this format.",type:"boolean"},extensions:{description:'File extensions this format claims, with leading dot (e.g. [".md"]).',items:{pattern:String.raw`^\.`,type:"string"},minItems:1,type:"array"},mediaType:{description:"MIME type for the format (icons, labels, HTTP).",type:"string"},remote:{description:"When true, the load capability accepts http(s) URLs as sources.",type:"boolean"}},required:["extensions"],type:"object"},Dm={additionalProperties:!1,description:"Project-section admission block (specs/extensions.md §9). A class carrying this block owns "+"the project.json section named by `key`; hosts dispatch that section's data through the class's projectData/resolvePaths capabilities.",properties:{description:{type:"string"},key:{description:"The project.json top-level section this class owns (exclusive per project).",type:"string"},referenceable:{description:"Whether section entries can be referenced from documents (e.g. content types).",type:"boolean"},title:{type:"string"}},required:["key"],type:"object"},Jm={additionalProperties:!1,description:"Server-mount admission block (specs/extensions.md §11). A class carrying this block mounts "+"routes under its /_jx/ basePath in the site worker and dev server.",properties:{basePath:{description:"Route subtree this class mounts — must be under /_jx/ (exclusive per project).",examples:["/_jx/data","/_jx/auth"],type:"string"},module:{description:"Module specifier exporting the mount handler.",type:"string"},order:{description:"Mount order (ascending; default 100).",type:"number"}},required:["basePath"],type:"object"},Fm={description:"Connection-provider admission block (specs/extensions.md §12). A class carrying this block "+"provides database connections of the given provider/kind.",properties:{kind:{description:"SQL dialect family the provider speaks.",enum:["sqlite","postgres"],type:"string"},local:{description:"Local-development substitute provider (e.g. sqlite for D1).",type:"string"},module:{description:"Module specifier exporting the provider implementation.",type:"string"},provider:{description:"Provider identifier (e.g. d1, supabase, sqlite).",type:"string"},serve:{description:"Module specifier exporting the serve-time worker binding.",type:"string"}},required:["provider","kind"],type:"object"},qm={description:"Studio control-surface hints for a format class: editor modes, document-mode rules, templates, and the element/nesting constraints that gate structural editing.",properties:{documentMode:{properties:{componentWhen:{description:"Treat the document as a component when this top-level/frontmatter key matches the regex.",properties:{frontmatterKey:{type:"string"},matches:{type:"string"}},type:"object"},default:{enum:["content","component"],type:"string"}},type:"object"},elements:{description:"Element allowlist and nesting constraints for structural editing.",properties:{block:{items:{type:"string"},type:"array"},inline:{items:{type:"string"},type:"array"},nesting:{additionalProperties:{properties:{block:{type:"boolean"},directive:{type:"boolean"},inline:{type:"boolean"},only:{items:{type:"string"},type:"array"}},type:"object"},description:'Per-parent child rules keyed by tag (or "_root"): { block, inline, directive } booleans or { only: [tags] }.',type:"object"},textOnly:{items:{type:"string"},type:"array"},void:{items:{type:"string"},type:"array"}},type:"object"},icon:{type:"string"},modes:{description:"Editor modes the studio offers for documents of this format.",items:{type:"string"},type:"array"},newFileTemplate:{description:"Initial source text for newly created files of this format.",type:"string"}},type:"object"},W_={additionalProperties:!1,description:'A .class.json schema-defined class. $prototype must be "Class". Defines fields, constructor, methods, and type parameters via $defs. Optionally points to a JS module via $implementation for hybrid execution.',properties:{$defs:{description:"Class members: parameters, returnTypes, fields, constructor, methods.",properties:{constructor:{$ref:"#/$defs/ClassConstructorDef"},fields:{additionalProperties:{$ref:"#/$defs/ClassFieldDef"},description:"Class fields with role, access, scope, and type information.",type:"object"},methods:{additionalProperties:{$ref:"#/$defs/ClassMethodDef"},description:"Class methods and accessors.",type:"object"},parameters:{additionalProperties:{$ref:"#/$defs/ClassParameterDef"},description:"Reusable typed parameter schemas, keyed by name.",type:"object"},returnTypes:{additionalProperties:{type:"object"},description:"Output type schemas, keyed by name.",type:"object"}},type:"object"},$id:{type:"string"},$implementation:{description:"Relative path to a JS module containing the actual class implementation.",type:"string"},$prototype:{const:"Class",type:"string"},$schema:{type:"string"},$studio:{$ref:"#/$defs/StudioHints"},connector:{$ref:"#/$defs/ConnectorBlockDef"},description:{type:"string"},extends:{description:"Base class — string name or $ref to another .class.json.",oneOf:[{type:"string"},{properties:{$ref:{type:"string"}},required:["$ref"],type:"object"}]},format:{$ref:"#/$defs/FormatDef"},project:{$ref:"#/$defs/ProjectBlockDef"},server:{$ref:"#/$defs/ServerBlockDef"},title:{description:"PascalCase class name, used as the export name.",type:"string"}},required:["$prototype","title"],type:"object"}});var K_;var G_=L(()=>{K_={additionalProperties:!1,description:"Schema for jx-extension.json manifests. Located at the extension package root and exported so hosts can resolve <package>/jx-extension.json through the exports map.",properties:{$schema:{type:"string"},classes:{additionalProperties:{type:"string"},description:"$prototype-visible class name → class descriptor path, relative to the manifest.",type:"object"},description:{description:"One-line description.",type:"string"},name:{description:"Package name; must match package.json.",type:"string"},schemas:{additionalProperties:!1,description:"Schema fragments this package contributes, relative to the manifest.",properties:{document:{description:"Document-schema fragment (positions like $paths values).",type:"string"},fields:{description:"Field-union fragment: its $defs members are unioned into the per-project "+"field-schema resource as extension field extras (specs/extensions.md §5.3).",type:"string"},project:{description:"Project-schema fragment (top-level project.json sections).",type:"string"}},type:"object"},title:{description:"Human-readable name for studio surfaces.",type:"string"}},required:["name"],type:"object"}});var fu;var Y_=L(()=>{fu={description:"Image optimization configuration for the project.",properties:{formats:{items:{type:"string"},type:"array"},lazyLoad:{type:"boolean"},optimize:{type:"boolean"},picture:{description:"Wrap a multi-format image in a <picture> with one <source> per format (default true). With it off the <img> carries a srcset in the preferred format alone, which browsers that cannot decode that format will still select from.",type:"boolean"},quality:{properties:{avif:{type:"number"},jpeg:{type:"number"},png:{type:"number"},webp:{type:"number"}},type:"object"},remoteDomains:{description:'Hostnames whose remote (https) images are optimized through /cdn-cgi/image transform URLs (cloudflare service only), e.g. ["drive.usercontent.google.com"]. Remote sources from other hosts are left untouched.',items:{type:"string"},type:"array"},service:{description:'How images are optimized: "build" runs Sharp at build time; "cloudflare" emits /cdn-cgi/image transform URLs served by Cloudflare Image Transformations (requires the feature to be enabled on the serving zone).',enum:["build","cloudflare"],type:"string"},sizes:{type:"string"},widths:{items:{type:"number"},type:"array"}},type:"object"}});var DU,Bm;var X_=L(()=>{zi();DU=[301,302,303,307,308],Bm={description:"Schema for Jx project.json files. A project.json file is the root anchor file for a Jx project, declaring site metadata, default settings, global styles, extensions, and build configuration. Open by design: extension-contributed sections (e.g. `content`) are opaque top-level keys; the generated per-project entry document (project.schema.json) closes the composition.",properties:{$defs:{description:"Global type definitions available to all pages.",type:"object"},$elements:{description:"Global custom element dependencies available to all pages. Items are $ref objects or npm package specifier strings.",items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{type:"string"}]},type:"array"},$head:{description:"Global <head> entries applied to all pages. Array of element definitions for meta tags, link tags, script tags, etc.",examples:[[{attributes:{href:"/favicon.svg",rel:"icon"},tagName:"link"},{attributes:{content:"Jx",name:"generator"},tagName:"meta"}]],items:{properties:{attributes:{additionalProperties:{type:"string"},type:"object"},tagName:{type:"string"}},type:"object"},type:"array"},$media:{additionalProperties:{type:"string"},description:'Named media breakpoints following CSS @custom-media convention. Available in all component style objects. Declaring a pure color-scheme query (e.g. "--dark": "(prefers-color-scheme: dark)") additionally opts the site into the forced-scheme contract: @--dark style blocks are dual-emitted so a data-color-scheme attribute on <html> overrides the OS preference, color-scheme is declared on :root, and a pre-paint script restores the '+"visitor's persisted choice (spec §9.5).",examples:[{"--dark":"(prefers-color-scheme: dark)","--lg":"(min-width: 1024px)","--md":"(min-width: 768px)","--sm":"(min-width: 640px)"}],type:"object"},$schema:{description:"Relative path to the generated per-project schema (conventionally ./project.schema.json, written by `jx schema`).",type:"string"},build:{description:"Build configuration.",properties:{adapter:{description:"Platform adapter for deployment-specific output.",enum:["static","cloudflare-pages","cloudflare-workers","node","bun"],type:"string"},deploy:{additionalProperties:!1,description:"Deployment tracking: the hosting project this repo publishes to. Identifiers "+"only (no secrets) — safe to commit; Studio uses it to tell whether the publish "+"workflow already exists. `adapter` says how the build is packaged; `deploy` says where it ships.",properties:{accountId:{description:"Hosting account id (e.g. the Cloudflare account id).",type:"string"},productionUrl:{description:"Production URL of the connected hosting project.",type:"string"},projectName:{description:"Hosting project name (e.g. the Cloudflare Pages project).",pattern:"^[a-z0-9][a-z0-9-]*$",type:"string"},provider:{description:"Hosting provider the project is connected to.",enum:["cloudflare-pages"],type:"string"}},required:["provider","accountId","projectName"],type:"object"},format:{default:"directory",description:"Reserved; currently unused. Accepted for forward compatibility with single-file output (desktop single-file mode) — the build emits per-route directories regardless.",enum:["directory","single"],type:"string"},outDir:{default:"./dist",description:"Output directory for compiled site.",type:"string"},headers:{additionalProperties:!1,description:"Emit dist/_headers — the response headers only the build can know. Honored by "+"Cloudflare Pages/Workers assets and Netlify; on the node/bun adapters the file documents what a reverse proxy in front of them must send.",properties:{cache:{default:"auto",description:'"auto" marks the content-addressed image variants immutable (RFC 8246) and revalidates everything else (RFC 9111). "off" emits no Cache-Control at all.',enum:["auto","off"],type:"string"},enabled:{default:!0,type:"boolean"},rules:{additionalProperties:{additionalProperties:{type:"string"},type:"object"},description:"Verbatim rules, merged after the generated block.",propertyNames:{pattern:"^/"},type:"object"},security:{additionalProperties:!1,properties:{contentTypeOptions:{default:!0,type:"boolean"},csp:{default:!1,description:"CSP Level 3. Off by default: unlike the other security headers this one "+"governs code the build cannot see — a third-party script that loads a "+"second script, a widget that opens a frame — so turning it on is a change "+"to verify in the browser console, not a safe default. `script-src` is derived from the inline scripts and external origins the build emitted; `style-src` keeps 'unsafe-inline', because per-page <style> blocks and per-element style attributes have no site-wide hash.",oneOf:[{type:"boolean"},{const:"report-only"},{additionalProperties:!1,properties:{directives:{additionalProperties:{oneOf:[{type:"string"},{const:!1}]},description:"Replace (string) or remove (false) a computed directive. A replacement is wholesale, so an addition restates the defaults.",type:"object"},mode:{default:"enforce",enum:["enforce","report-only"]},reportUri:{format:"uri-reference",type:"string"}},type:"object"}]},frameOptions:{default:"SAMEORIGIN",oneOf:[{enum:["DENY","SAMEORIGIN"],type:"string"},{const:!1}]},hsts:{default:!1,description:"RFC 6797. Off by default: a wrong max-age locks the apex domain to HTTPS for that long, and the mistake is invisible until a certificate lapses. `preload` requires `includeSubDomains` and is a build error without it.",oneOf:[{type:"boolean"},{additionalProperties:!1,properties:{includeSubDomains:{default:!0,type:"boolean"},maxAge:{default:31536000,minimum:0,type:"integer"},preload:{default:!1,type:"boolean"}},type:"object"}]},permissionsPolicy:{default:"camera=(), microphone=(), geolocation=()",oneOf:[{type:"string"},{const:!1}]},referrerPolicy:{default:"strict-origin-when-cross-origin",oneOf:[{enum:["no-referrer","no-referrer-when-downgrade","origin","origin-when-cross-origin","same-origin","strict-origin","strict-origin-when-cross-origin","unsafe-url"],type:"string"},{const:!1}]}},type:"object"}},type:"object"},sitemap:{default:!0,description:"Generate sitemap.xml from the route table (requires `url`). Set false to disable.",type:"boolean"},trailingSlash:{default:"always",description:"Trailing slash behavior for generated URLs.",enum:["always","never","ignore"],type:"string"}},type:"object"},copy:{additionalProperties:{type:"string"},description:"Declarative file copy map. Keys are source paths (relative to project root), values are destination paths (relative to outDir).",type:"object"},defaults:{description:"Default settings applied to all pages unless overridden.",properties:{charset:{default:"utf8",description:"Default charset for the page.",type:"string"},dir:{description:"Base direction for the <html> element. Omitted when unset — a page's `$dir` "+"overrides it. Right-to-left content renders left-to-right without this.",enum:["ltr","rtl","auto"],type:"string"},lang:{default:"en",description:"Default lang attribute for the <html> element. A page's `$lang` overrides it.",type:"string"},layout:{default:null,description:"Default layout file path applied to all pages. Set to null to render pages without a layout.",examples:["./layouts/base.json"],oneOf:[{type:"string"},{type:"null"}]},shadow:{default:!1,description:"Default shadow-DOM mode for every component (spec.md §16.6). Off unless set: a "+"shadow root isolates component styles from the page and replaces the <slot> emulation with real slot distribution. A component's own `$shadow` overrides this in both directions.",oneOf:[{enum:["open","closed"],type:"string"},{const:!1,type:"boolean"}]}},type:"object"},extensions:{description:"Extension packages: bare package names (resolved project-first through the package exports map) or relative paths. Each must export jx-extension.json.",examples:[["@jxsuite/parser"]],items:{type:"string"},type:"array"},manifest:{additionalProperties:!1,description:'W3C Web App Manifest, emitted as manifest.webmanifest with a <link rel="manifest"> on every page. Absent means no manifest: it is a claim that a site is meant to be installed, and most are not.',properties:{backgroundColor:{type:"string"},categories:{items:{type:"string"},type:"array"},description:{type:"string"},dir:{enum:["ltr","rtl","auto"],type:"string"},display:{default:"standalone",enum:["fullscreen","standalone","minimal-ui","browser"],type:"string"},enabled:{default:!0,type:"boolean"},icons:{description:"Icons at 192px and 512px are what browsers require before offering to install the site; the build warns when either is missing.",items:{additionalProperties:!1,properties:{purpose:{type:"string"},sizes:{examples:["192x192"],type:"string"},src:{type:"string"},type:{type:"string"}},required:["src"],type:"object"},type:"array"},lang:{type:"string"},name:{description:"Defaults to the project name.",type:"string"},orientation:{type:"string"},scope:{type:"string"},shortName:{type:"string"},startUrl:{default:"/",type:"string"},themeColor:{type:"string"}},type:"object"},serviceWorker:{default:!1,description:"W3C Service Worker, emitted as sw.js. Off unless declared — a worker is sticky, so it "+"is the one output that can keep breaking visitors after a deploy tries to fix them. **Turning it off means `false`, not deleting the key**: `false` emits a tombstone at the same URL that unregisters the old worker and clears its caches, and a 404 there is not an instruction to stop. HTML is always network-first; only the content-addressed /images/_optimized/* is served cache-first.",oneOf:[{type:"boolean"},{additionalProperties:!1,properties:{enabled:{default:!0,type:"boolean"},offlineFallback:{description:"Page served for a failed navigation. Added to `precache` if not already there.",type:"string"},precache:{description:"Site-absolute URLs fetched at install time. Each must be a file this build produces; one that is not fails the build, because a single unreachable entry stops the worker installing at all.",items:{pattern:"^/",type:"string"},type:"array"},scope:{default:"/",type:"string"}},type:"object"}]},securityTxt:{additionalProperties:!1,description:"RFC 9116 security.txt, emitted at .well-known/security.txt. `expires` is required by "+"§2.5.5 and an absent or past value is a build error — an expired file advertises a "+"reporting channel while telling the reporter not to trust it. A hand-placed public/.well-known/security.txt shadows this, which is how a clearsigned file ships.",properties:{acknowledgments:{items:{type:"string"},type:"array"},canonical:{type:"string"},contact:{description:"At least one mailto:, https: or tel: URI (§2.5.3).",items:{type:"string"},type:"array"},enabled:{default:!0,type:"boolean"},encryption:{items:{type:"string"},type:"array"},expires:{format:"date-time",type:"string"},hiring:{items:{type:"string"},type:"array"},policy:{items:{type:"string"},type:"array"},preferredLanguages:{description:"BCP 47 tags, validated and canonicalized like i18n.locales.",items:{pattern:Fc,type:"string"},type:"array"}},type:"object"},i18n:{description:"Internationalization configuration.",properties:{defaultLocale:{description:"Default locale, as a BCP 47 language tag. The pattern catches shape errors (`en_US`, `en--US`); the build is the authority on well-formedness.",examples:["en"],pattern:Fc,type:"string"},locales:{description:"Available locales, as BCP 47 language tags.",examples:[["en","fr","de"]],items:{pattern:Fc,type:"string"},type:"array"},routing:{description:"Locale routing strategy.",enum:["prefix-except-default","prefix-always"],type:"string"}},type:"object"},images:{$ref:"#/$defs/ImageConfig"},imports:{additionalProperties:{type:"string"},description:"Global import map: $prototype names to .class.json file paths. Makes external classes available by name in all pages.",examples:[{Markdown:"@jxsuite/parser/Markdown.class.json",MarkdownCollection:"@jxsuite/parser/MarkdownCollection.class.json"}],type:"object"},name:{default:"Jx Site",description:"Human-readable project name.",examples:["My Portfolio","Jx Example Site"],type:"string"},redirects:{additionalProperties:{oneOf:[{description:"Destination path or URL; implies a 301.",type:"string"},{additionalProperties:!1,description:"A redirect with an explicit RFC 9110 §15.4 status.",properties:{destination:{type:"string"},status:{default:301,description:"RFC 9110 §15.4 redirection status. 307 and 308 preserve the request method; "+"301 and 302 historically do not.",enum:[...DU],type:"integer"}},required:["destination"],type:"object"},{additionalProperties:!1,description:"A rewrite (proxy): the destination's content is served AT the source URL, with no "+"redirect. Emitted as status 200 in `_redirects`, which is the host convention — "+"not an HTTP redirection status.",properties:{destination:{type:"string"},rewrite:{const:!0,type:"boolean"}},required:["destination","rewrite"],type:"object"}]},description:"Static redirect and rewrite rules. Keys are source paths in URLPattern pathname syntax.",examples:[{"/api/*":{destination:"https://api.example.com/*",rewrite:!0},"/legacy/*":{destination:"/archive/*",status:308},"/old-about":"/about"}],propertyNames:{pattern:"^/"},type:"object"},state:{description:"Site-wide reactive state available to all pages.",type:"object"},style:{additionalProperties:{oneOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/StyleObject"}]},description:"Global CSS styles applied to the <body> element. Uses the same camelCase CSSOM convention and recursive selector/at-rule nesting as component styles.",type:"object"},url:{description:"Production URL of the deployed site.",examples:["https://example.com","https://jxsuite.com"],type:"string"}},type:"object"}});function JU(){return Q_??=FU(),Q_}async function FU(){let[e,t,r]=await Promise.all([eP.listAll(),tP.default.listAll(),rP.default.parseAll()]),n=new Set;for(let{elements:l}of Object.values(e))for(let u of l)if(!u.obsolete)n.add(u.name);let i=[...n].toSorted(),s=new Set;for(let l of t.properties)for(let u of l.styleDeclaration??[])s.add(u);let o=[...s].toSorted(),a=new Set;for(let l of Object.values(r))for(let u of l){if(u.type!=="interface"&&u.type!=="interface mixin")continue;if(!u.members)continue;for(let d of u.members)if(d.type==="attribute"&&d.name?.startsWith("on")&&d.idlType?.idlType==="EventHandler")a.add(d.name)}let c=[...a].toSorted();return{cssProps:o,eventHandlers:c,tagExamples:i}}function qU(e){let t={};for(let r of e)t[r]={description:`Event handler for the "${r.slice(2)}" event.`,oneOf:[{$ref:"#/$defs/RefObject"},{$ref:"#/$defs/ExpressionEntry"},{$ref:"#/$defs/FunctionDef"}]};return t}function BU(e){let t={...uu.properties};for(let r of e)t[r]={oneOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/RefObject"}]};return t}async function HU(){let{tagExamples:e,cssProps:t,eventHandlers:r}=await JU();return{$defs:{DefsMap:H_,TypeDefEntry:U_,StateMap:B_,StateEntry:q_,TypedStateDef:d_,PureTypeDef:v_,FunctionDef:m_,ClassDef:W_,ClassParameterDef:Im,ClassFieldDef:Tm,ClassConstructorDef:Nm,ClassMethodDef:Mm,FormatDef:Lm,ProjectBlockDef:Dm,ServerBlockDef:Jm,ConnectorBlockDef:Fm,StudioHints:qm,ExternalClassDef:x_,ExpressionPointer:S_,ExpressionLiteral:E_,ExpressionOperand:__,UnaryOperator:P_,BinaryOperator:k_,ConditionalOperator:A_,SwitchOperator:j_,CallOperator:R_,PureMethod:O_,AssignmentOperator:C_,NoArgMethod:I_,OneArgMethod:T_,SpliceMethod:N_,ReduceMethod:M_,MapFilterMethod:L_,ExpressionNode:D_,ExpressionEntry:J_,Statement:g_,StatementList:y_,ElementDef:{...Cm,properties:{...Cm.properties,...qU(r)}},ChildrenValue:i_,ArrayNamespace:n_,SwitchDef:l_,SwitchNode:u_,StyleObject:{...uu,properties:BU(t)},AttributesObject:o_,PropsObject:a_,RefObject:Z1,AnyRef:Q1,InternalRef:W1,StateRef:z1,ExternalRef:K1,ExternalComponentRef:e_,GlobalRef:G1,ParentRef:Y1,MapRef:X1,ElementPropertyValue:c_,StringOrRef:N1,BoolOrRef:M1,NumberOrRef:L1,CemParameter:q1,CemEvent:B1,TagName:{...I1,examples:[...e,"my-counter","todo-app","user-card"]},TagExpression:R1,ElementTagName:O1,JsonSchemaType:U1,HeadEntry:J1,ImageConfig:fu,PathsValue:{$id:cs,anyOf:[...Fa,_m],description:"Default $paths source union: the core shapes, plus a catch-all for source shapes contributed by extensions this schema cannot see. The project's generated document.schema.json replaces this with the exact set its extensions provide."}},$id:"https://jxsuite.com/schema/v1",$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:{$ref:"#/$defs/ElementPropertyValue"},description:"Schema for Jx component files. A Jx document is a JSON object that declaratively describes a reactive web component: its structure (DOM tree), styling, type definitions ($defs), runtime state, and inline or external functions. Reactivity is powered by @vue/reactivity.",properties:{$defs:{$ref:"#/$defs/DefsMap",description:"Pure JSON Schema type definitions for this component. "+"All entries are reusable type schemas — no runtime artifacts are produced. "+"Referenced from state entries via $ref. Naming convention: PascalCase."},$elements:{description:"Custom element dependencies. Items are either $ref objects pointing to JX element definitions, or bare npm package name strings for web component libraries.",items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{description:"npm package specifier (must declare customElements in package.json)",type:"string"}]},type:"array"},$head:{description:"Page-level <head> entries. Array of head entries for meta tags, link tags, script tags, etc. Merged with layout and site-level $head entries.",items:{$ref:"#/$defs/HeadEntry"},type:"array"},$id:{description:"Component identifier string. Used by tooling and the builder.",examples:["Counter","TodoApp","UserCard"],type:"string"},$dir:{description:"Base direction for this page's <html> element, overriding `defaults.dir`. Right-to-left content renders left-to-right without it.",enum:["ltr","rtl","auto"],type:"string"},$lang:{description:"Language tag for this page's <html> element, overriding `defaults.lang` "+"(site-architecture.md §8.4).",examples:["en","fr","ar-EG"],type:"string"},$translationKey:{description:"This page's identity across languages, overriding the one its path implies "+"(site-architecture.md §13.5). Two routes are translations when their keys match; "+"the default key is the path with the locale prefix removed, which is right whenever "+"the paths are parallel and wrong for a localized slug — /fr-ca/a-propos/ shares "+"nothing with /about/ until one of them says so.",examples:["about","blog/hello-world"],type:"string"},$layout:{description:"Layout reference for pages. String path to a layout JSON file, or false to opt out of the default layout.",examples:["./layouts/base.json"],oneOf:[{type:"string"},{const:!1,type:"boolean"}]},$shadow:{description:"Render this component into a shadow root instead of the light DOM (spec.md §16.6). "+"Off unless set: a shadow root isolates the component's styles from the page and replaces the <slot> emulation with real slot distribution, so it changes how the "+"component composes. Overrides `defaults.shadow` in both directions — `false` opts "+"one component out of a project that opted in.",oneOf:[{enum:["open","closed"],type:"string"},{const:!1,type:"boolean"}]},$sitemap:{description:"Set false to exclude this page from sitemap.xml (site-architecture.md §8.4.1). "+"Every other page with a URL is included.",type:"boolean"},$media:{additionalProperties:{type:"string"},description:'Named media breakpoints following CSS @custom-media convention. Keys use the CSS custom property -- prefix. Pure color-scheme queries (e.g. "--dark": "(prefers-color-scheme: dark)") are dual-emitted so a data-color-scheme attribute on the root element forces the scheme '+"regardless of the OS preference (spec §9.5).",examples:[{"--dark":"(prefers-color-scheme: dark)","--md":"(min-width: 768px)","--sm":"(min-width: 640px)"}],type:"object"},$paths:{$ref:cs,description:"Dynamic route source for a page: expands one page per entry at build time. One of the core shapes (explicit `values`, a `$ref` data file, or a bare array of parameter objects) or a source shape contributed by an enabled extension, such as the parser's `contentType`."},$schema:{description:"URI identifying the Jx dialect version. Enables schema-aware IDE tooling.",examples:["https://jxsuite.com/schema/v1"],type:"string"},attributes:{$ref:"#/$defs/AttributesObject"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},description:"Switch cases object. Maps case values to element definitions or external component refs. Used alongside $switch for dynamic component rendering.",type:"object"},children:{$ref:"#/$defs/ChildrenValue"},imports:{additionalProperties:{type:"string"},description:"Import map: $prototype names to .class.json file paths. Allows state entries to reference external classes by name without $src.",type:"object"},observedAttributes:{description:"HTML attributes the custom element watches for changes. Follows the Web Components observedAttributes convention.",items:{type:"string"},type:"array"},state:{$ref:"#/$defs/StateMap",description:"Runtime variables for this component. All entries are reactive by default. Entry shape is determined by value type: "+"scalar/array → reactive property, string with ${} → computed, "+"object with $prototype → function or data source, "+"object with type and default → typed reactive property."},style:{$ref:"#/$defs/StyleObject"},tagName:{$ref:"#/$defs/TagName"},title:{$ref:"#/$defs/StringOrRef",description:"Page title. Can be a static string or a template string with ${} expressions."}},title:"Jx Document",type:"object"}}function UU(){return{$defs:{ImageConfig:fu,StyleObject:nP},$id:"https://jxsuite.com/schema/project/v1",$schema:"https://json-schema.org/draft/2020-12/schema",description:"Schema for Jx project.json files. A project.json file is the root anchor file for a Jx project, declaring site metadata, default settings, global styles, extensions, and build configuration. Open by design: extension-contributed sections are opaque top-level keys; the generated per-project entry document (project.schema.json) closes the composition.",properties:Bm.properties,title:"Jx Project",type:"object"}}function VU(){return{$defs:{ImageConfig:fu,JxFieldSchema:e1,RelationshipRef:t1,StyleObject:nP},$id:"https://jxsuite.com/schema/project/core/v2",$schema:"https://json-schema.org/draft/2020-12/schema",description:"Core fragment of the Jx project.json schema. Open by design: extension fragments contribute their own top-level sections and the generated per-project entry document "+"(project.schema.json) closes the composition. See specs/extensions.md §5.",properties:Bm.properties,title:"Jx Project Core",type:"object"}}function WU(){return{$id:Ja,$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"https://jxsuite.com/schema/project/core/v2#/$defs/JxFieldSchema"},{$ref:"https://jxsuite.com/schema/project/core/v2#/$defs/RelationshipRef"}],description:"Default field-schema union for section entry schemas: the core field shape plus relationship references. Per-project entry documents override this resource with the "+"effective union. See specs/extensions.md §5.3.",title:"Jx Project Field Union"}}function zU(){return{$id:cs,$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[...Fa,_m],description:"Default $paths-value union for documents: the core source shapes. Per-project entry documents override this resource with those members PLUS every extension-contributed paths shape.",title:"Jx Document Paths Union"}}function KU(){return{$id:"https://jxsuite.com/schema/extension-manifest/v1",$schema:"https://json-schema.org/draft/2020-12/schema",title:"Jx Extension Manifest",...K_}}function Hm(){return{$defs:{ClassConstructorDef:Nm,ClassFieldDef:Tm,ClassMethodDef:Mm,ClassParameterDef:Im,ConnectorBlockDef:Fm,FormatDef:Lm,ProjectBlockDef:Dm,ServerBlockDef:Jm,StudioHints:qm},$id:"https://jxsuite.com/schema/class/v1",$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Schema for Jx .class.json files. A class definition describes a schema-defined class with fields, constructor, methods, and type parameters. Optionally points to a JS module via $implementation for hybrid execution.",properties:{$defs:{description:"Class members: parameters, returnTypes, fields, constructor, methods.",properties:{constructor:{$ref:"#/$defs/ClassConstructorDef"},fields:{additionalProperties:{$ref:"#/$defs/ClassFieldDef"},description:"Class fields with role, access, scope, and type information.",type:"object"},methods:{additionalProperties:{$ref:"#/$defs/ClassMethodDef"},description:"Class methods and accessors.",type:"object"},parameters:{additionalProperties:{$ref:"#/$defs/ClassParameterDef"},description:"Reusable typed parameter schemas, keyed by name.",type:"object"},returnTypes:{additionalProperties:{type:"object"},description:"Output type schemas, keyed by name.",type:"object"}},type:"object"},$id:{type:"string"},$implementation:{description:"Relative path to a JS module containing the actual class implementation.",examples:["./md.js","./lib/calculator.js"],type:"string"},$prototype:{const:"Class",description:'Must be "Class" for class definition files.',type:"string"},$schema:{type:"string"},$studio:{$ref:"#/$defs/StudioHints"},connector:{$ref:"#/$defs/ConnectorBlockDef"},description:{type:"string"},extends:{description:"Base class — string name or $ref to another .class.json.",oneOf:[{type:"string"},{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"}]},format:{$ref:"#/$defs/FormatDef"},project:{$ref:"#/$defs/ProjectBlockDef"},server:{$ref:"#/$defs/ServerBlockDef"},title:{description:"PascalCase class name, used as the export name.",examples:["MarkdownFile","DataSource","Calculator"],type:"string"}},required:["$prototype","title"],title:"Jx Class Definition",type:"object"}}async function GU(e){let{mkdirSync:t,writeFileSync:r}=await import("node:fs"),{resolve:n,dirname:i}=await import("node:path"),s=i(n(e,"..")),o=await HU(),a=UU(),c=Hm(),l=VU(),u=KU(),d=WU(),h=zU(),m=JSON.stringify(o,null,2),y=JSON.stringify(a,null,2),g=JSON.stringify(c,null,2),b=JSON.stringify(l,null,2),x=JSON.stringify(u,null,2),_=JSON.stringify(d,null,2),P=JSON.stringify(h,null,2),[E]=process.argv.slice(2);if(E)r(E,m,"utf8"),console.error(`Jx component schema written to ${E}`);else{r(n(s,"schema.json"),m,"utf8"),r(n(s,"project-schema.json"),y,"utf8"),r(n(s,"class-schema.json"),g,"utf8"),t(n(s,"schemas"),{recursive:!0}),r(n(s,"schemas","project.core.schema.json"),b,"utf8"),r(n(s,"schemas","project.fields.schema.json"),_,"utf8"),r(n(s,"schemas","document.paths.schema.json"),P,"utf8"),r(n(s,"extension-manifest.schema.json"),x,"utf8");let w=Bun.spawnSync(["bunx","oxfmt",n(s,"schemas","project.core.schema.json"),n(s,"schemas","project.fields.schema.json"),n(s,"schemas","document.paths.schema.json")],{cwd:s});if(w.exitCode!==0){let k=w.stderr.toString()||w.stdout.toString()||`exit ${w.exitCode}${w.signalCode?`, signal ${w.signalCode}`:""}`;console.error(`Warning: skipped oxfmt reformat of generated schemas (${k})`)}console.error("Generated:"),console.error(" schema.json (component)"),console.error(" project-schema.json"),console.error(" class-schema.json"),console.error(" schemas/project.core.schema.json"),console.error(" schemas/project.fields.schema.json"),console.error(" schemas/document.paths.schema.json"),console.error(" extension-manifest.schema.json")}}var eP,tP,rP,Q_=null,nP,Z_,xae;var iP=L(()=>{C1();T1();D1();F1();H1();V1();t_();r_();s_();f_();p_();h_();b_();$_();w_();F_();V_();z_();G_();au();Y_();X_();eP=Bt(x1(),1),tP=Bt(w1(),1),rP=Bt(j1(),1);nP={...uu,additionalProperties:{anyOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/StyleObject"}]}};[,Z_]=process.argv,xae=Z_?.endsWith("schema.ts")?GU(Z_):void 0});var za=C(function(aP){Object.defineProperty(aP,"__esModule",{value:!0});aP.regexpCode=aP.getEsmExportName=aP.getProperty=aP.safeStringify=aP.stringify=aP.strConcat=aP.addCodeArg=aP.str=aP._=aP.nil=aP._Code=aP.Name=aP.IDENTIFIER=aP._CodeOrName=void 0;class du{}aP._CodeOrName=du;aP.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class bo extends du{constructor(e){super();if(!aP.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}aP.Name=bo;class rn extends du{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof bo)t[r.str]=(t[r.str]||0)+1;return t},{})}}aP._Code=rn;aP.nil=new rn("");function sP(e,...t){let r=[e[0]],n=0;while(n<t.length)Vm(r,t[n]),r.push(e[++n]);return new rn(r)}aP._=sP;var Um=new rn("+");function oP(e,...t){let r=[Wa(e[0])],n=0;while(n<t.length)r.push(Um),Vm(r,t[n]),r.push(Um,Wa(e[++n]));return YU(r),new rn(r)}aP.str=oP;function Vm(e,t){if(t instanceof rn)e.push(...t._items);else if(t instanceof bo)e.push(t);else e.push(ZU(t))}aP.addCodeArg=Vm;function YU(e){let t=1;while(t<e.length-1){if(e[t]===Um){let r=XU(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function XU(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof bo||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof bo))return`"${e}${t.slice(1)}`;return}function QU(e,t){return t.emptyStr()?e:e.emptyStr()?t:oP`${e}${t}`}aP.strConcat=QU;function ZU(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Wa(Array.isArray(e)?e.join(","):e)}function e4(e){return new rn(Wa(e))}aP.stringify=e4;function Wa(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}aP.safeStringify=Wa;function t4(e){return typeof e=="string"&&aP.IDENTIFIER.test(e)?new rn(`.${e}`):sP`[${e}]`}aP.getProperty=t4;function r4(e){if(typeof e=="string"&&aP.IDENTIFIER.test(e))return new rn(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}aP.getEsmExportName=r4;function n4(e){return new rn(e.toString())}aP.regexpCode=n4});var Gm=C(function(fP){Object.defineProperty(fP,"__esModule",{value:!0});fP.ValueScope=fP.ValueScopeName=fP.Scope=fP.varKinds=fP.UsedValueState=void 0;var fr=za();class lP extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var mu;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(mu||(fP.UsedValueState=mu={}));fP.varKinds={const:new fr.Name("const"),let:new fr.Name("let"),var:new fr.Name("var")};class zm{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof fr.Name?e:this.name(e)}name(e){return new fr.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}fP.Scope=zm;class Km extends fr.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=fr._`.${new fr.Name(t)}[${r}]`}}fP.ValueScopeName=Km;var g4=fr._`\n`;class uP extends zm{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?g4:fr.nil}}get(){return this._scope}name(e){return new Km(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:i}=n,s=(r=t.key)!==null&&r!==void 0?r:t.ref,o=this._values[i];if(o){let l=o.get(s);if(l)return l}else o=this._values[i]=new Map;o.set(s,n);let a=this._scope[i]||(this._scope[i]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:i,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return fr._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(n)=>{if(n.value===void 0)throw Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,r)}_reduceValues(e,t,r={},n){let i=fr.nil;for(let s in e){let o=e[s];if(!o)continue;let a=r[s]=r[s]||new Map;o.forEach((c)=>{if(a.has(c))return;a.set(c,mu.Started);let l=t(c);if(l){let u=this.opts.es5?fP.varKinds.var:fP.varKinds.const;i=fr._`${i}${u} ${c} = ${l};${this.opts._n}`}else if(l=n===null||n===void 0?void 0:n(c))i=fr._`${i}${l}${this.opts._n}`;else throw new lP(c);a.set(c,mu.Completed)})}return i}}fP.ValueScope=uP});var be=C(function(dr){Object.defineProperty(dr,"__esModule",{value:!0});dr.or=dr.and=dr.not=dr.CodeGen=dr.operators=dr.varKinds=dr.ValueScopeName=dr.ValueScope=dr.Scope=dr.Name=dr.regexpCode=dr.stringify=dr.getProperty=dr.nil=dr.strConcat=dr.str=dr._=void 0;var Re=za(),nn=Gm(),Si=za();Object.defineProperty(dr,"_",{enumerable:!0,get:function(){return Si._}});Object.defineProperty(dr,"str",{enumerable:!0,get:function(){return Si.str}});Object.defineProperty(dr,"strConcat",{enumerable:!0,get:function(){return Si.strConcat}});Object.defineProperty(dr,"nil",{enumerable:!0,get:function(){return Si.nil}});Object.defineProperty(dr,"getProperty",{enumerable:!0,get:function(){return Si.getProperty}});Object.defineProperty(dr,"stringify",{enumerable:!0,get:function(){return Si.stringify}});Object.defineProperty(dr,"regexpCode",{enumerable:!0,get:function(){return Si.regexpCode}});Object.defineProperty(dr,"Name",{enumerable:!0,get:function(){return Si.Name}});var $u=Gm();Object.defineProperty(dr,"Scope",{enumerable:!0,get:function(){return $u.Scope}});Object.defineProperty(dr,"ValueScope",{enumerable:!0,get:function(){return $u.ValueScope}});Object.defineProperty(dr,"ValueScopeName",{enumerable:!0,get:function(){return $u.ValueScopeName}});Object.defineProperty(dr,"varKinds",{enumerable:!0,get:function(){return $u.varKinds}});dr.operators={GT:new Re._Code(">"),GTE:new Re._Code(">="),LT:new Re._Code("<"),LTE:new Re._Code("<="),EQ:new Re._Code("==="),NEQ:new Re._Code("!=="),NOT:new Re._Code("!"),OR:new Re._Code("||"),AND:new Re._Code("&&"),ADD:new Re._Code("+")};class Ei{optimizeNodes(){return this}optimizeNames(e,t){return this}}class pP extends Ei{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?nn.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=$o(this.rhs,e,t);return this}get names(){return this.rhs instanceof Re._CodeOrName?this.rhs.names:{}}}class Qm extends Ei{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof Re.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=$o(this.rhs,e,t),this}get names(){let e=this.lhs instanceof Re.Name?{}:{...this.lhs.names};return xu(e,this.rhs)}}class mP extends Qm{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class hP extends Ei{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class gP extends Ei{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class yP extends Ei{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class bP extends Ei{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=$o(this.code,e,t),this}get names(){return this.code instanceof Re._CodeOrName?this.code.names:{}}}class vu extends Ei{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;while(n--){let i=r[n];if(i.optimizeNames(e,t))continue;$4(e,i.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>ls(e,t.names),{})}}class _i extends vu{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class xP extends vu{}class Ka extends _i{}Ka.kind="else";class Kn extends _i{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new Ka(r):r}if(t){if(e===!1)return t instanceof Kn?t:t.nodes;if(this.nodes.length)return this;return new Kn(EP(e),t instanceof Kn?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=$o(this.condition,e,t),this}get names(){let e=super.names;if(xu(e,this.condition),this.else)ls(e,this.else.names);return e}}Kn.kind="if";class xo extends _i{}xo.kind="for";class $P extends xo{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=$o(this.iteration,e,t),this}get names(){return ls(super.names,this.iteration.names)}}class vP extends xo{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?nn.varKinds.var:this.varKind,{name:r,from:n,to:i}=this;return`for(${t} ${r}=${n}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){let e=xu(super.names,this.from);return xu(e,this.to)}}class Ym extends xo{constructor(e,t,r,n){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=$o(this.iterable,e,t),this}get names(){return ls(super.names,this.iterable.names)}}class hu extends _i{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}hu.kind="func";class gu extends vu{render(e){return"return "+super.render(e)}}gu.kind="return";class wP extends _i{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(n=this.finally)===null||n===void 0||n.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)ls(e,this.catch.names);if(this.finally)ls(e,this.finally.names);return e}}class yu extends _i{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}yu.kind="catch";class bu extends _i{render(e){return"finally"+super.render(e)}}bu.kind="finally";class SP{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
604
- `:""},this._extScope=e,this._scope=new nn.Scope({parent:e}),this._nodes=[new xP]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let i=this._scope.toName(t);if(r!==void 0&&n)this._constants[i.str]=r;return this._leafNode(new pP(e,i,r)),i}const(e,t,r){return this._def(nn.varKinds.const,e,t,r)}let(e,t,r){return this._def(nn.varKinds.let,e,t,r)}var(e,t,r){return this._def(nn.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Qm(e,t,r))}add(e,t){return this._leafNode(new mP(e,dr.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==Re.nil)this._leafNode(new bP(e));return this}object(...e){let t=["{"];for(let[r,n]of e){if(t.length>1)t.push(",");if(t.push(r),r!==n||this.opts.es5)t.push(":"),Re.addCodeArg(t,n)}return t.push("}"),new Re._Code(t)}if(e,t,r){if(this._blockNode(new Kn(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Kn(e))}else(){return this._elseNode(new Ka)}endIf(){return this._endBlockNode(Kn,Ka)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new $P(e),t)}forRange(e,t,r,n,i=this.opts.es5?nn.varKinds.var:nn.varKinds.let){let s=this._scope.toName(e);return this._for(new vP(i,s,t,r),()=>n(s))}forOf(e,t,r,n=nn.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let s=t instanceof Re.Name?t:this.var("_arr",t);return this.forRange("_i",0,Re._`${s}.length`,(o)=>{this.var(i,Re._`${s}[${o}]`),r(i)})}return this._for(new Ym("of",n,i,t),()=>r(i))}forIn(e,t,r,n=this.opts.es5?nn.varKinds.var:nn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,Re._`Object.keys(${t})`,r);let i=this._scope.toName(e);return this._for(new Ym("in",n,i,t),()=>r(i))}endFor(){return this._endBlockNode(xo)}label(e){return this._leafNode(new hP(e))}break(e){return this._leafNode(new gP(e))}return(e){let t=new gu;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(gu)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new wP;if(this._blockNode(n),this.code(e),t){let i=this.name("e");this._currNode=n.catch=new yu(i),t(i)}if(r)this._currNode=n.finally=new bu,this.code(r);return this._endBlockNode(yu,bu)}throw(e){return this._leafNode(new yP(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=Re.nil,r,n){if(this._blockNode(new hu(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(hu)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof Kn))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}dr.CodeGen=SP;function ls(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function xu(e,t){return t instanceof Re._CodeOrName?ls(e,t.names):e}function $o(e,t,r){if(e instanceof Re.Name)return n(e);if(!i(e))return e;return new Re._Code(e._items.reduce((s,o)=>{if(o instanceof Re.Name)o=n(o);if(o instanceof Re._Code)s.push(...o._items);else s.push(o);return s},[]));function n(s){let o=r[s.str];if(o===void 0||t[s.str]!==1)return s;return delete t[s.str],o}function i(s){return s instanceof Re._Code&&s._items.some((o)=>o instanceof Re.Name&&t[o.str]===1&&r[o.str]!==void 0)}}function $4(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function EP(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:Re._`!${Xm(e)}`}dr.not=EP;var v4=_P(dr.operators.AND);function w4(...e){return e.reduce(v4)}dr.and=w4;var S4=_P(dr.operators.OR);function E4(...e){return e.reduce(S4)}dr.or=E4;function _P(e){return(t,r)=>t===Re.nil?r:r===Re.nil?t:Re._`${Xm(t)} ${e} ${Xm(r)}`}function Xm(e){return e instanceof Re.Name?e:Re._`(${e})`}});var _e=C(function(TP){Object.defineProperty(TP,"__esModule",{value:!0});TP.checkStrictMode=TP.getErrorPath=TP.Type=TP.useFunc=TP.setEvaluated=TP.evaluatedPropsToName=TP.mergeEvaluated=TP.eachItem=TP.unescapeJsonPointer=TP.escapeJsonPointer=TP.escapeFragment=TP.unescapeFragment=TP.schemaRefOrVal=TP.schemaHasRulesButRef=TP.schemaHasRules=TP.checkUnknownRules=TP.alwaysValidSchema=TP.toHash=void 0;var Ue=be(),A4=za();function j4(e){let t={};for(let r of e)t[r]=!0;return t}TP.toHash=j4;function R4(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return jP(e,t),!RP(t,e.self.RULES.all)}TP.alwaysValidSchema=R4;function jP(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let i=n.RULES.keywords;for(let s in t)if(!i[s])IP(e,`unknown keyword: "${s}"`)}TP.checkUnknownRules=jP;function RP(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}TP.schemaHasRules=RP;function O4(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}TP.schemaHasRulesButRef=O4;function C4({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return Ue._`${r}`}return Ue._`${e}${t}${Ue.getProperty(n)}`}TP.schemaRefOrVal=C4;function I4(e){return OP(decodeURIComponent(e))}TP.unescapeFragment=I4;function T4(e){return encodeURIComponent(eh(e))}TP.escapeFragment=T4;function eh(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}TP.escapeJsonPointer=eh;function OP(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}TP.unescapeJsonPointer=OP;function N4(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}TP.eachItem=N4;function kP({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,s,o,a)=>{let c=o===void 0?s:o instanceof Ue.Name?(s instanceof Ue.Name?e(i,s,o):t(i,s,o),o):s instanceof Ue.Name?(t(i,o,s),s):r(s,o);return a===Ue.Name&&!(c instanceof Ue.Name)?n(i,c):c}}TP.mergeEvaluated={props:kP({mergeNames:(e,t,r)=>e.if(Ue._`${r} !== true && ${t} !== undefined`,()=>{e.if(Ue._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,Ue._`${r} || {}`).code(Ue._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(Ue._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,Ue._`${r} || {}`),th(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:CP}),items:kP({mergeNames:(e,t,r)=>e.if(Ue._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,Ue._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(Ue._`${r} !== true`,()=>e.assign(r,t===!0?!0:Ue._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function CP(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",Ue._`{}`);if(t!==void 0)th(e,r,t);return r}TP.evaluatedPropsToName=CP;function th(e,t,r){Object.keys(r).forEach((n)=>e.assign(Ue._`${t}${Ue.getProperty(n)}`,!0))}TP.setEvaluated=th;var AP={};function M4(e,t){return e.scopeValue("func",{ref:t,code:AP[t.code]||(AP[t.code]=new A4._Code(t.code))})}TP.useFunc=M4;var Zm;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Zm||(TP.Type=Zm={}));function L4(e,t,r){if(e instanceof Ue.Name){let n=t===Zm.Num;return r?n?Ue._`"[" + ${e} + "]"`:Ue._`"['" + ${e} + "']"`:n?Ue._`"/" + ${e}`:Ue._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?Ue.getProperty(e).toString():"/"+eh(e)}TP.getErrorPath=L4;function IP(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}TP.checkStrictMode=IP});var Fr=C(function(MP){Object.defineProperty(MP,"__esModule",{value:!0});var Mt=be(),tV={data:new Mt.Name("data"),valCxt:new Mt.Name("valCxt"),instancePath:new Mt.Name("instancePath"),parentData:new Mt.Name("parentData"),parentDataProperty:new Mt.Name("parentDataProperty"),rootData:new Mt.Name("rootData"),dynamicAnchors:new Mt.Name("dynamicAnchors"),vErrors:new Mt.Name("vErrors"),errors:new Mt.Name("errors"),this:new Mt.Name("this"),self:new Mt.Name("self"),scope:new Mt.Name("scope"),json:new Mt.Name("json"),jsonPos:new Mt.Name("jsonPos"),jsonLen:new Mt.Name("jsonLen"),jsonPart:new Mt.Name("jsonPart")};MP.default=tV});var Ga=C(function(FP){Object.defineProperty(FP,"__esModule",{value:!0});FP.extendErrors=FP.resetErrorsCount=FP.reportExtraError=FP.reportError=FP.keyword$DataError=FP.keywordError=void 0;var Oe=be(),Su=_e(),Yt=Fr();FP.keywordError={message:({keyword:e})=>Oe.str`must pass "${e}" keyword validation`};FP.keyword$DataError={message:({keyword:e,schemaType:t})=>t?Oe.str`"${e}" keyword must be ${t} ($data)`:Oe.str`"${e}" keyword is invalid ($data)`};function nV(e,t=FP.keywordError,r,n){let{it:i}=e,{gen:s,compositeRule:o,allErrors:a}=i,c=JP(e,t,r);if(n!==null&&n!==void 0?n:o||a)LP(s,c);else DP(i,Oe._`[${c}]`)}FP.reportError=nV;function iV(e,t=FP.keywordError,r){let{it:n}=e,{gen:i,compositeRule:s,allErrors:o}=n,a=JP(e,t,r);if(LP(i,a),!(s||o))DP(n,Yt.default.vErrors)}FP.reportExtraError=iV;function sV(e,t){e.assign(Yt.default.errors,t),e.if(Oe._`${Yt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(Oe._`${Yt.default.vErrors}.length`,t),()=>e.assign(Yt.default.vErrors,null)))}FP.resetErrorsCount=sV;function oV({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw Error("ajv implementation error");let o=e.name("err");e.forRange("i",i,Yt.default.errors,(a)=>{if(e.const(o,Oe._`${Yt.default.vErrors}[${a}]`),e.if(Oe._`${o}.instancePath === undefined`,()=>e.assign(Oe._`${o}.instancePath`,Oe.strConcat(Yt.default.instancePath,s.errorPath))),e.assign(Oe._`${o}.schemaPath`,Oe.str`${s.errSchemaPath}/${t}`),s.opts.verbose)e.assign(Oe._`${o}.schema`,r),e.assign(Oe._`${o}.data`,n)})}FP.extendErrors=oV;function LP(e,t){let r=e.const("err",t);e.if(Oe._`${Yt.default.vErrors} === null`,()=>e.assign(Yt.default.vErrors,Oe._`[${r}]`),Oe._`${Yt.default.vErrors}.push(${r})`),e.code(Oe._`${Yt.default.errors}++`)}function DP(e,t){let{gen:r,validateName:n,schemaEnv:i}=e;if(i.$async)r.throw(Oe._`new ${e.ValidationError}(${t})`);else r.assign(Oe._`${n}.errors`,t),r.return(!1)}var us={keyword:new Oe.Name("keyword"),schemaPath:new Oe.Name("schemaPath"),params:new Oe.Name("params"),propertyName:new Oe.Name("propertyName"),message:new Oe.Name("message"),schema:new Oe.Name("schema"),parentSchema:new Oe.Name("parentSchema")};function JP(e,t,r){let{createErrors:n}=e.it;if(n===!1)return Oe._`{}`;return aV(e,t,r)}function aV(e,t,r={}){let{gen:n,it:i}=e,s=[cV(i,r),lV(e,r)];return uV(e,t,s),n.object(...s)}function cV({errorPath:e},{instancePath:t}){let r=t?Oe.str`${e}${Su.getErrorPath(t,Su.Type.Str)}`:e;return[Yt.default.instancePath,Oe.strConcat(Yt.default.instancePath,r)]}function lV({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:Oe.str`${t}/${e}`;if(r)i=Oe.str`${i}${Su.getErrorPath(r,Su.Type.Str)}`;return[us.schemaPath,i]}function uV(e,{params:t,message:r},n){let{keyword:i,data:s,schemaValue:o,it:a}=e,{opts:c,propertyName:l,topSchemaRef:u,schemaPath:d}=a;if(n.push([us.keyword,i],[us.params,typeof t=="function"?t(e):t||Oe._`{}`]),c.messages)n.push([us.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([us.schema,o],[us.parentSchema,Oe._`${u}${d}`],[Yt.default.data,s]);if(l)n.push([us.propertyName,l])}});var VP=C(function(HP){Object.defineProperty(HP,"__esModule",{value:!0});HP.boolOrEmptySchema=HP.topBoolOrEmptySchema=void 0;var hV=Ga(),gV=be(),yV=Fr(),bV={message:"boolean schema is false"};function xV(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)BP(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(yV.default.data);else t.assign(gV._`${n}.errors`,null),t.return(!0)}HP.topBoolOrEmptySchema=xV;function $V(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),BP(e);else r.var(t,!0)}HP.boolOrEmptySchema=$V;function BP(e,t){let{gen:r,data:n}=e;hV.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},bV,void 0,t)}});var nh=C(function(WP){Object.defineProperty(WP,"__esModule",{value:!0});WP.getRules=WP.isJSONType=void 0;var wV=["string","number","integer","boolean","null","object","array"],SV=new Set(wV);function EV(e){return typeof e=="string"&&SV.has(e)}WP.isJSONType=EV;function _V(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}WP.getRules=_V});var ih=C(function(YP){Object.defineProperty(YP,"__esModule",{value:!0});YP.shouldUseRule=YP.shouldUseGroup=YP.schemaHasRulesForType=void 0;function kV({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&KP(e,n)}YP.schemaHasRulesForType=kV;function KP(e,t){return t.rules.some((r)=>GP(e,r))}YP.shouldUseGroup=KP;function GP(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some((n)=>e[n]!==void 0))}YP.shouldUseRule=GP});var Ya=C(function(tk){Object.defineProperty(tk,"__esModule",{value:!0});tk.reportTypeError=tk.checkDataTypes=tk.checkDataType=tk.coerceAndCheckDataType=tk.getJSONTypes=tk.getSchemaTypes=tk.DataType=void 0;var RV=nh(),OV=ih(),CV=Ga(),ve=be(),QP=_e(),vo;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(vo||(tk.DataType=vo={}));function IV(e){let t=ZP(e.type);if(t.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)t.push("null")}return t}tk.getSchemaTypes=IV;function ZP(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(RV.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}tk.getJSONTypes=ZP;function TV(e,t){let{gen:r,data:n,opts:i}=e,s=NV(t,i.coerceTypes),o=t.length>0&&!(s.length===0&&t.length===1&&OV.schemaHasRulesForType(e,t[0]));if(o){let a=oh(t,n,i.strictNumbers,vo.Wrong);r.if(a,()=>{if(s.length)MV(e,t,s);else ah(e)})}return o}tk.coerceAndCheckDataType=TV;var ek=new Set(["string","number","integer","boolean","null"]);function NV(e,t){return t?e.filter((r)=>ek.has(r)||t==="array"&&r==="array"):[]}function MV(e,t,r){let{gen:n,data:i,opts:s}=e,o=n.let("dataType",ve._`typeof ${i}`),a=n.let("coerced",ve._`undefined`);if(s.coerceTypes==="array")n.if(ve._`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,ve._`${i}[0]`).assign(o,ve._`typeof ${i}`).if(oh(t,i,s.strictNumbers),()=>n.assign(a,i)));n.if(ve._`${a} !== undefined`);for(let l of r)if(ek.has(l)||l==="array"&&s.coerceTypes==="array")c(l);n.else(),ah(e),n.endIf(),n.if(ve._`${a} !== undefined`,()=>{n.assign(i,a),LV(e,a)});function c(l){switch(l){case"string":n.elseIf(ve._`${o} == "number" || ${o} == "boolean"`).assign(a,ve._`"" + ${i}`).elseIf(ve._`${i} === null`).assign(a,ve._`""`);return;case"number":n.elseIf(ve._`${o} == "boolean" || ${i} === null
605
- || (${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 LV({gen:e,parentData:t,parentDataProperty:r},n){e.if(ve._`${t} !== undefined`,()=>e.assign(ve._`${t}[${r}]`,n))}function sh(e,t,r,n=vo.Correct){let i=n===vo.Correct?ve.operators.EQ:ve.operators.NEQ,s;switch(e){case"null":return ve._`${t} ${i} null`;case"array":s=ve._`Array.isArray(${t})`;break;case"object":s=ve._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=o(ve._`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=o();break;default:return ve._`typeof ${t} ${i} ${e}`}return n===vo.Correct?s:ve.not(s);function o(a=ve.nil){return ve.and(ve._`typeof ${t} == "number"`,a,r?ve._`isFinite(${t})`:ve.nil)}}tk.checkDataType=sh;function oh(e,t,r,n){if(e.length===1)return sh(e[0],t,r,n);let i,s=QP.toHash(e);if(s.array&&s.object){let o=ve._`typeof ${t} != "object"`;i=s.null?o:ve._`!${t} || ${o}`,delete s.null,delete s.array,delete s.object}else i=ve.nil;if(s.number)delete s.integer;for(let o in s)i=ve.and(i,sh(o,t,r,n));return i}tk.checkDataTypes=oh;var DV={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?ve._`{type: ${e}}`:ve._`{type: ${t}}`};function ah(e){let t=JV(e);CV.reportError(t,DV)}tk.reportTypeError=ah;function JV(e){let{gen:t,data:r,schema:n}=e,i=QP.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}});var ok=C(function(ik){Object.defineProperty(ik,"__esModule",{value:!0});ik.assignDefaults=void 0;var wo=be(),WV=_e();function zV(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)nk(e,i,r[i].default);else if(t==="array"&&Array.isArray(n))n.forEach((i,s)=>nk(e,s,i.default))}ik.assignDefaults=zV;function nk(e,t,r){let{gen:n,compositeRule:i,data:s,opts:o}=e;if(r===void 0)return;let a=wo._`${s}${wo.getProperty(t)}`;if(i){WV.checkStrictMode(e,`default is ignored for: ${a}`);return}let c=wo._`${a} === undefined`;if(o.useDefaults==="empty")c=wo._`${c} || ${a} === null || ${a} === ""`;n.if(c,wo._`${a} = ${wo.stringify(r)}`)}});var qr=C(function(lk){Object.defineProperty(lk,"__esModule",{value:!0});lk.validateUnion=lk.validateArray=lk.usePattern=lk.callValidateCode=lk.schemaProperties=lk.allSchemaProperties=lk.noPropertyInData=lk.propertyInData=lk.isOwnProperty=lk.hasPropFunc=lk.reportMissingProp=lk.checkMissingProp=lk.checkReportMissingProp=void 0;var Ye=be(),ch=_e(),Pi=Fr(),KV=_e();function GV(e,t){let{gen:r,data:n,it:i}=e;r.if(uh(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:Ye._`${t}`},!0),e.error()})}lk.checkReportMissingProp=GV;function YV({gen:e,data:t,it:{opts:r}},n,i){return Ye.or(...n.map((s)=>Ye.and(uh(e,t,s,r.ownProperties),Ye._`${i} = ${s}`)))}lk.checkMissingProp=YV;function XV(e,t){e.setParams({missingProperty:t},!0),e.error()}lk.reportMissingProp=XV;function ak(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Ye._`Object.prototype.hasOwnProperty`})}lk.hasPropFunc=ak;function lh(e,t,r){return Ye._`${ak(e)}.call(${t}, ${r})`}lk.isOwnProperty=lh;function QV(e,t,r,n){let i=Ye._`${t}${Ye.getProperty(r)} !== undefined`;return n?Ye._`${i} && ${lh(e,t,r)}`:i}lk.propertyInData=QV;function uh(e,t,r,n){let i=Ye._`${t}${Ye.getProperty(r)} === undefined`;return n?Ye.or(i,Ye.not(lh(e,t,r))):i}lk.noPropertyInData=uh;function ck(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}lk.allSchemaProperties=ck;function ZV(e,t){return ck(t).filter((r)=>!ch.alwaysValidSchema(e,t[r]))}lk.schemaProperties=ZV;function eW({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},a,c,l){let u=l?Ye._`${e}, ${t}, ${n}${i}`:t,d=[[Pi.default.instancePath,Ye.strConcat(Pi.default.instancePath,s)],[Pi.default.parentData,o.parentData],[Pi.default.parentDataProperty,o.parentDataProperty],[Pi.default.rootData,Pi.default.rootData]];if(o.opts.dynamicRef)d.push([Pi.default.dynamicAnchors,Pi.default.dynamicAnchors]);let h=Ye._`${u}, ${r.object(...d)}`;return c!==Ye.nil?Ye._`${a}.call(${c}, ${h})`:Ye._`${a}(${h})`}lk.callValidateCode=eW;var tW=Ye._`new RegExp`;function rW({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,s=i(r,n);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:Ye._`${i.code==="new RegExp"?tW:KV.useFunc(e,i)}(${r}, ${n})`})}lk.usePattern=rW;function nW(e){let{gen:t,data:r,keyword:n,it:i}=e,s=t.name("valid");if(i.allErrors){let a=t.let("valid",!0);return o(()=>t.assign(a,!1)),a}return t.var(s,!0),o(()=>t.break()),s;function o(a){let c=t.const("len",Ye._`${r}.length`);t.forRange("i",0,c,(l)=>{e.subschema({keyword:n,dataProp:l,dataPropType:ch.Type.Num},s),t.if(Ye.not(s),a)})}}lk.validateArray=nW;function iW(e){let{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>ch.alwaysValidSchema(i,c))&&!i.opts.unevaluated)return;let o=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,l)=>{let u=e.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);if(t.assign(o,Ye._`${o} || ${a}`),!e.mergeValidEvaluated(u,a))t.if(Ye.not(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}lk.validateUnion=iW});var hk=C(function(pk){Object.defineProperty(pk,"__esModule",{value:!0});pk.validateKeywordUsage=pk.validSchemaType=pk.funcKeywordCode=pk.macroKeywordCode=void 0;var Xt=be(),fs=Fr(),yW=qr(),bW=Ga();function xW(e,t){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=e,a=t.macro.call(o.self,i,s,o),c=dk(r,n,a);if(o.opts.validateSchema!==!1)o.self.validateSchema(a,!0);let l=r.name("valid");e.subschema({schema:a,schemaPath:Xt.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}pk.macroKeywordCode=xW;function $W(e,t){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:a,it:c}=e;wW(c,t);let l=!a&&t.compile?t.compile.call(c.self,s,o,c):t.validate,u=dk(n,i,l),d=n.let("valid");e.block$data(d,h),e.ok((r=t.valid)!==null&&r!==void 0?r:d);function h(){if(t.errors===!1){if(g(),t.modifying)fk(e);b(()=>e.error())}else{let x=t.async?m():y();if(t.modifying)fk(e);b(()=>vW(e,x))}}function m(){let x=n.let("ruleErrs",null);return n.try(()=>g(Xt._`await `),(_)=>n.assign(d,!1).if(Xt._`${_} instanceof ${c.ValidationError}`,()=>n.assign(x,Xt._`${_}.errors`),()=>n.throw(_))),x}function y(){let x=Xt._`${u}.errors`;return n.assign(x,null),g(Xt.nil),x}function g(x=t.async?Xt._`await `:Xt.nil){let _=c.opts.passContext?fs.default.this:fs.default.self,P=!(("compile"in t)&&!a||t.schema===!1);n.assign(d,Xt._`${x}${yW.callValidateCode(e,u,_,P)}`,t.modifying)}function b(x){var _;n.if(Xt.not((_=t.valid)!==null&&_!==void 0?_:d),x)}}pk.funcKeywordCode=$W;function fk(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,Xt._`${n.parentData}[${n.parentDataProperty}]`))}function vW(e,t){let{gen:r}=e;r.if(Xt._`Array.isArray(${t})`,()=>{r.assign(fs.default.vErrors,Xt._`${fs.default.vErrors} === null ? ${t} : ${fs.default.vErrors}.concat(${t})`).assign(fs.default.errors,Xt._`${fs.default.vErrors}.length`),bW.extendErrors(e)},()=>e.error())}function wW({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function dk(e,t,r){if(r===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:Xt.stringify(r)})}function SW(e,t,r=!1){return!t.length||t.some((n)=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}pk.validSchemaType=SW;function EW({schema:e,opts:t,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw Error("ajv implementation error");let o=i.dependencies;if(o===null||o===void 0?void 0:o.some((a)=>!Object.prototype.hasOwnProperty.call(e,a)))throw Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(i.validateSchema){if(!i.validateSchema(e[s])){let c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw Error(c)}}}pk.validateKeywordUsage=EW});var xk=C(function(yk){Object.defineProperty(yk,"__esModule",{value:!0});yk.extendSubschemaMode=yk.extendSubschemaData=yk.getSubschema=void 0;var En=be(),gk=_e();function AW(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:En._`${e.schemaPath}${En.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:En._`${e.schemaPath}${En.getProperty(t)}${En.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${gk.escapeFragment(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||o===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw Error('either "keyword" or "schema" must be passed')}yk.getSubschema=AW;function jW(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=t,h=a.let("data",En._`${t.data}${En.getProperty(r)}`,!0);c(h),e.errorPath=En.str`${l}${gk.getErrorPath(r,n,d.jsPropertySyntax)}`,e.parentDataProperty=En._`${r}`,e.dataPathArr=[...u,e.parentDataProperty]}if(i!==void 0){let l=i instanceof En.Name?i:a.let("data",i,!0);if(c(l),o!==void 0)e.propertyName=o}if(s)e.dataTypes=s;function c(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}yk.extendSubschemaData=jW;function RW(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){if(n!==void 0)e.compositeRule=n;if(i!==void 0)e.createErrors=i;if(s!==void 0)e.allErrors=s;e.jtdDiscriminator=t,e.jtdMetadata=r}yk.extendSubschemaMode=RW});var fh=C(function(zae,$k){$k.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}});var wk=C(function(Kae,vk){var ki=vk.exports=function(e,t,r){if(typeof t=="function")r=t,t={};r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};Eu(t,n,i,e,"",e)};ki.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ki.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ki.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ki.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Eu(e,t,r,n,i,s,o,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,i,s,o,a,c,l);for(var u in n){var d=n[u];if(Array.isArray(d)){if(u in ki.arrayKeywords)for(var h=0;h<d.length;h++)Eu(e,t,r,d[h],i+"/"+u+"/"+h,s,i,u,n,h)}else if(u in ki.propsKeywords){if(d&&typeof d=="object")for(var m in d)Eu(e,t,r,d[m],i+"/"+u+"/"+IW(m),s,i,u,n,m)}else if(u in ki.keywords||e.allKeys&&!(u in ki.skipKeywords))Eu(e,t,r,d,i+"/"+u,s,i,u,n)}r(n,i,s,o,a,c,l)}}function IW(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Xa=C(function(Pk){Object.defineProperty(Pk,"__esModule",{value:!0});Pk.getSchemaRefs=Pk.resolveUrl=Pk.normalizeId=Pk._getFullPath=Pk.getFullPath=Pk.inlineRef=void 0;var TW=_e(),NW=fh(),MW=wk(),LW=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function DW(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!dh(e);if(!t)return!1;return Sk(e)<=t}Pk.inlineRef=DW;var JW=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function dh(e){for(let t in e){if(JW.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(dh))return!0;if(typeof r=="object"&&dh(r))return!0}return!1}function Sk(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,LW.has(r))continue;if(typeof e[r]=="object")TW.eachItem(e[r],(n)=>t+=Sk(n));if(t===1/0)return 1/0}return t}function Ek(e,t="",r){if(r!==!1)t=So(t);let n=e.parse(t);return _k(e,n)}Pk.getFullPath=Ek;function _k(e,t){return e.serialize(t).split("#")[0]+"#"}Pk._getFullPath=_k;var FW=/#\/?$/;function So(e){return e?e.replace(FW,""):""}Pk.normalizeId=So;function qW(e,t,r){return r=So(r),e.resolve(t,r)}Pk.resolveUrl=qW;var BW=/^[a-z_][-a-z0-9._]*$/i;function HW(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=So(e[r]||t),s={"":i},o=Ek(n,i,!1),a={},c=new Set;return MW(e,{allKeys:!0},(d,h,m,y)=>{if(y===void 0)return;let g=o+h,b=s[y];if(typeof d[r]=="string")b=x.call(this,d[r]);_.call(this,d.$anchor),_.call(this,d.$dynamicAnchor),s[h]=b;function x(P){let E=this.opts.uriResolver.resolve;if(P=So(b?E(b,P):P),c.has(P))throw u(P);c.add(P);let w=this.refs[P];if(typeof w=="string")w=this.refs[w];if(typeof w=="object")l(d,w.schema,P);else if(P!==So(g))if(P[0]==="#")l(d,a[P],P),a[P]=d;else this.refs[P]=g;return P}function _(P){if(typeof P=="string"){if(!BW.test(P))throw Error(`invalid anchor "${P}"`);x.call(this,`#${P}`)}}}),a;function l(d,h,m){if(h!==void 0&&!NW(d,h))throw u(m)}function u(d){return Error(`reference "${d}" resolves to more than one schema`)}}Pk.getSchemaRefs=HW});var Eo=C(function(Bk){Object.defineProperty(Bk,"__esModule",{value:!0});Bk.getData=Bk.KeywordCxt=Bk.validateFunctionCode=void 0;var Ok=VP(),Ck=Ya(),ph=ih(),_u=Ya(),GW=ok(),Qa=hk(),mh=xk(),se=be(),ge=Fr(),YW=Xa(),Gn=_e(),Za=Ga();function XW(e){if(Nk(e)){if(Mk(e),Tk(e)){e6(e);return}}Ik(e,()=>Ok.topBoolOrEmptySchema(e))}Bk.validateFunctionCode=XW;function Ik({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},s){if(i.code.es5)e.func(t,se._`${ge.default.data}, ${ge.default.valCxt}`,n.$async,()=>{e.code(se._`"use strict"; ${Ak(r,i)}`),ZW(e,i),e.code(s)});else e.func(t,se._`${ge.default.data}, ${QW(i)}`,n.$async,()=>e.code(Ak(r,i)).code(s))}function QW(e){return se._`{${ge.default.instancePath}="", ${ge.default.parentData}, ${ge.default.parentDataProperty}, ${ge.default.rootData}=${ge.default.data}${e.dynamicRef?se._`, ${ge.default.dynamicAnchors}={}`:se.nil}}={}`}function ZW(e,t){e.if(ge.default.valCxt,()=>{if(e.var(ge.default.instancePath,se._`${ge.default.valCxt}.${ge.default.instancePath}`),e.var(ge.default.parentData,se._`${ge.default.valCxt}.${ge.default.parentData}`),e.var(ge.default.parentDataProperty,se._`${ge.default.valCxt}.${ge.default.parentDataProperty}`),e.var(ge.default.rootData,se._`${ge.default.valCxt}.${ge.default.rootData}`),t.dynamicRef)e.var(ge.default.dynamicAnchors,se._`${ge.default.valCxt}.${ge.default.dynamicAnchors}`)},()=>{if(e.var(ge.default.instancePath,se._`""`),e.var(ge.default.parentData,se._`undefined`),e.var(ge.default.parentDataProperty,se._`undefined`),e.var(ge.default.rootData,ge.default.data),t.dynamicRef)e.var(ge.default.dynamicAnchors,se._`{}`)})}function e6(e){let{schema:t,opts:r,gen:n}=e;Ik(e,()=>{if(r.$comment&&t.$comment)Dk(e);if(s6(e),n.let(ge.default.vErrors,null),n.let(ge.default.errors,0),r.unevaluated)t6(e);Lk(e),c6(e)});return}function t6(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",se._`${r}.evaluated`),t.if(se._`${e.evaluated}.dynamicProps`,()=>t.assign(se._`${e.evaluated}.props`,se._`undefined`)),t.if(se._`${e.evaluated}.dynamicItems`,()=>t.assign(se._`${e.evaluated}.items`,se._`undefined`))}function Ak(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?se._`/*# sourceURL=${r} */`:se.nil}function r6(e,t){if(Nk(e)){if(Mk(e),Tk(e)){n6(e,t);return}}Ok.boolOrEmptySchema(e,t)}function Tk({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function Nk(e){return typeof e.schema!="boolean"}function n6(e,t){let{schema:r,gen:n,opts:i}=e;if(i.$comment&&r.$comment)Dk(e);o6(e),a6(e);let s=n.const("_errs",ge.default.errors);Lk(e,s),n.var(t,se._`${s} === ${ge.default.errors}`)}function Mk(e){Gn.checkUnknownRules(e),i6(e)}function Lk(e,t){if(e.opts.jtd)return jk(e,[],!1,t);let r=Ck.getSchemaTypes(e.schema),n=Ck.coerceAndCheckDataType(e,r);jk(e,r,!n,t)}function i6(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&Gn.schemaHasRulesButRef(t,i.RULES))i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function s6(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)Gn.checkStrictMode(e,"default is ignored in the schema root")}function o6(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=YW.resolveUrl(e.opts.uriResolver,e.baseId,t)}function a6(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function Dk({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)e.code(se._`${ge.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=se.str`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(se._`${ge.default.self}.opts.$comment(${s}, ${o}, ${a}.schema)`)}}function c6(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=e;if(r.$async)t.if(se._`${ge.default.errors} === 0`,()=>t.return(ge.default.data),()=>t.throw(se._`new ${i}(${ge.default.vErrors})`));else{if(t.assign(se._`${n}.errors`,ge.default.vErrors),s.unevaluated)l6(e);t.return(se._`${ge.default.errors} === 0`)}}function l6({gen:e,evaluated:t,props:r,items:n}){if(r instanceof se.Name)e.assign(se._`${t}.props`,r);if(n instanceof se.Name)e.assign(se._`${t}.items`,n)}function jk(e,t,r,n){let{gen:i,schema:s,data:o,allErrors:a,opts:c,self:l}=e,{RULES:u}=l;if(s.$ref&&(c.ignoreKeywordsWithRef||!Gn.schemaHasRulesButRef(s,u))){i.block(()=>Fk(e,"$ref",u.all.$ref.definition));return}if(!c.jtd)u6(e,t);i.block(()=>{for(let h of u.rules)d(h);d(u.post)});function d(h){if(!ph.shouldUseGroup(s,h))return;if(h.type){if(i.if(_u.checkDataType(h.type,o,c.strictNumbers)),Rk(e,h),t.length===1&&t[0]===h.type&&r)i.else(),_u.reportTypeError(e);i.endIf()}else Rk(e,h);if(!a)i.if(se._`${ge.default.errors} === ${n||0}`)}}function Rk(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;if(i)GW.assignDefaults(e,t.type);r.block(()=>{for(let s of t.rules)if(ph.shouldUseRule(n,s))Fk(e,s.keyword,s.definition,t.type)})}function u6(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(f6(e,t),!e.opts.allowUnionTypes)d6(e,t);p6(e,e.dataTypes)}function f6(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!Jk(e.dataTypes,r))hh(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),h6(e,t)}function d6(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))hh(e,"use allowUnionTypes to allow union type keyword")}function p6(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&ph.shouldUseRule(e.schema,i)){let{type:s}=i.definition;if(s.length&&!s.some((o)=>m6(t,o)))hh(e,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function m6(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Jk(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function h6(e,t){let r=[];for(let n of e.dataTypes)if(Jk(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function hh(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,Gn.checkStrictMode(e,t,e.opts.strictTypes)}class gh{constructor(e,t,r){if(Qa.validateKeywordUsage(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=Gn.schemaRefOrVal(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",qk(this.$data,e));else if(this.schemaCode=this.schemaValue,!Qa.validSchemaType(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",ge.default.errors)}result(e,t,r){this.failResult(se.not(e),t,r)}failResult(e,t,r){if(this.gen.if(e),r)r();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult(se.not(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(se._`${t} !== undefined && (${se.or(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?Za.reportExtraError:Za.reportError)(this,this.def.error,t)}$dataError(){Za.reportError(this,this.def.$dataError||Za.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Za.resetErrorsCount(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,r=se.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=se.nil,t=se.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:i,def:s}=this;if(r.if(se.or(se._`${n} === undefined`,t)),e!==se.nil)r.assign(e,!0);if(i.length||s.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==se.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:i}=this;return se.or(s(),o());function s(){if(r.length){if(!(t instanceof se.Name))throw Error("ajv implementation error");let a=Array.isArray(r)?r:[r];return se._`${_u.checkDataTypes(a,t,i.opts.strictNumbers,_u.DataType.Wrong)}`}return se.nil}function o(){if(n.validateSchema){let a=e.scopeValue("validate$data",{ref:n.validateSchema});return se._`!${a}(${t})`}return se.nil}}subschema(e,t){let r=mh.getSubschema(this.it,e);mh.extendSubschemaData(r,this.it,e),mh.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return r6(n,t),n}mergeEvaluated(e,t){let{it:r,gen:n}=this;if(!r.opts.unevaluated)return;if(r.props!==!0&&e.props!==void 0)r.props=Gn.mergeEvaluated.props(n,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=Gn.mergeEvaluated.items(n,e.items,r.items,t)}mergeValidEvaluated(e,t){let{it:r,gen:n}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return n.if(t,()=>this.mergeEvaluated(e,se.Name)),!0}}Bk.KeywordCxt=gh;function Fk(e,t,r,n){let i=new gh(e,r,t);if("code"in r)r.code(i,n);else if(i.$data&&r.validate)Qa.funcKeywordCode(i,r);else if("macro"in r)Qa.macroKeywordCode(i,r);else if(r.compile||r.validate)Qa.funcKeywordCode(i,r)}var g6=/^\/(?:[^~]|~0|~1)*$/,y6=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function qk(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,s;if(e==="")return ge.default.rootData;if(e[0]==="/"){if(!g6.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,s=ge.default.rootData}else{let l=y6.exec(e);if(!l)throw Error(`Invalid JSON-pointer: ${e}`);let u=+l[1];if(i=l[2],i==="#"){if(u>=t)throw Error(c("property/index",u));return n[t-u]}if(u>t)throw Error(c("data",u));if(s=r[t-u],!i)return s}let o=s,a=i.split("/");for(let l of a)if(l)s=se._`${s}${se.getProperty(Gn.unescapeJsonPointer(l))}`,o=se._`${o} && ${s}`;return o;function c(l,u){return`Cannot access ${l} ${u} levels up, current level is ${t}`}}Bk.getData=qk});var ec=C(function(Vk){Object.defineProperty(Vk,"__esModule",{value:!0});class Uk extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}Vk.default=Uk});var _o=C(function(zk){Object.defineProperty(zk,"__esModule",{value:!0});var yh=Xa();class Wk extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=yh.resolveUrl(e,t,r),this.missingSchema=yh.normalizeId(yh.getFullPath(e,this.missingRef))}}zk.default=Wk});var rc=C(function(Yk){Object.defineProperty(Yk,"__esModule",{value:!0});Yk.resolveSchema=Yk.getCompilingSchema=Yk.resolveRef=Yk.compileSchema=Yk.SchemaEnv=void 0;var sn=be(),w6=ec(),ds=Fr(),on=Xa(),Kk=_e(),S6=Eo();class tc{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:on.normalizeId(r===null||r===void 0?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r===null||r===void 0?void 0:r.$async,this.refs={}}}Yk.SchemaEnv=tc;function xh(e){let t=Gk.call(this,e);if(t)return t;let r=on.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new sn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),a;if(e.$async)a=o.scopeValue("Error",{ref:w6.default,code:sn._`require("ajv/dist/runtime/validation_error").default`});let c=o.scopeName("validate");e.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:ds.default.data,parentData:ds.default.parentData,parentDataProperty:ds.default.parentDataProperty,dataNames:[ds.default.data],dataPathArr:[sn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:sn.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:sn.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:sn._`""`,opts:this.opts,self:this},u;try{this._compilations.add(e),S6.validateFunctionCode(l),o.optimize(this.opts.code.optimize);let d=o.toString();if(u=`${o.scopeRefs(ds.default.scope)}return ${d}`,this.opts.code.process)u=this.opts.code.process(u,e);let m=Function(`${ds.default.self}`,`${ds.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:m}),m.errors=null,m.schema=e.schema,m.schemaEnv=e,e.$async)m.$async=!0;if(this.opts.code.source===!0)m.source={validateName:c,validateCode:d,scopeValues:o._values};if(this.opts.unevaluated){let{props:y,items:g}=l;if(m.evaluated={props:y instanceof sn.Name?void 0:y,items:g instanceof sn.Name?void 0:g,dynamicProps:y instanceof sn.Name,dynamicItems:g instanceof sn.Name},m.source)m.source.evaluated=sn.stringify(m.evaluated)}return e.validate=m,e}catch(d){if(delete e.validate,delete e.validateName,u)this.logger.error("Error compiling schema, function code:",u);throw d}finally{this._compilations.delete(e)}}Yk.compileSchema=xh;function E6(e,t,r){var n;r=on.resolveUrl(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let s=k6.call(this,e,r);if(s===void 0){let o=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;if(o)s=new tc({schema:o,schemaId:a,root:e,baseId:t})}if(s===void 0)return;return e.refs[r]=_6.call(this,s)}Yk.resolveRef=E6;function _6(e){if(on.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:xh.call(this,e)}function Gk(e){for(let t of this._compilations)if(P6(t,e))return t}Yk.getCompilingSchema=Gk;function P6(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function k6(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||Pu.call(this,e,t)}function Pu(e,t){let r=this.opts.uriResolver.parse(t),n=on._getFullPath(this.opts.uriResolver,r),i=on.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return bh.call(this,r,e);let s=on.normalizeId(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let a=Pu.call(this,e,o);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return bh.call(this,r,a)}if(typeof(o===null||o===void 0?void 0:o.schema)!=="object")return;if(!o.validate)xh.call(this,o);if(s===on.normalizeId(t)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];if(l)i=on.resolveUrl(this.opts.uriResolver,i,l);return new tc({schema:a,schemaId:c,root:e,baseId:i})}return bh.call(this,r,o)}Yk.resolveSchema=Pu;var A6=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function bh(e,{baseId:t,schema:r,root:n}){var i;if(((i=e.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[Kk.unescapeFragment(a)];if(c===void 0)return;r=c;let l=typeof r==="object"&&r[this.opts.schemaId];if(!A6.has(a)&&l)t=on.resolveUrl(this.opts.uriResolver,t,l)}let s;if(typeof r!="boolean"&&r.$ref&&!Kk.schemaHasRulesButRef(r,this.RULES)){let a=on.resolveUrl(this.opts.uriResolver,t,r.$ref);s=Pu.call(this,n,a)}let{schemaId:o}=this.opts;if(s=s||new tc({schema:r,schemaId:o,root:n,baseId:t}),s.schema!==s.root.schema)return s;return}});var Qk=C(function(ece,I6){I6.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var _h=C(function(tce,oA){var T6=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),vh=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),N6=RegExp.prototype.test.bind(/^\d*$/u),ps=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),wh=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),eA=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),Sh=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),M6=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),pr=Array(256);for(let t=0;t<256;t++)pr[t]="%"+"0123456789ABCDEF"[t>>4]+"0123456789ABCDEF"[t&15];function Lt(e){if(e<2048)return pr[192|e>>6]+pr[128|e&63];if(e<65536)return pr[224|e>>12]+pr[128|e>>6&63]+pr[128|e&63];return pr[240|e>>18]+pr[128|e>>12&63]+pr[128|e>>6&63]+pr[128|e&63]}function L6(e){let t="",r=0,n=0;for(n=0;n<e.length;n++){if(r=e[n].charCodeAt(0),r===48)continue;if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var D6=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),J6=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),F6=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),q6=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function B6(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++){if(F6(e[t]))continue;if(e[t]==="%"&&t+2<e.length&&ps(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}function Zk(e){let t=-1,r=0,n=-1,i=0;for(let a=0;a<e.length;a++)if(e[a]==="0"){if(n===-1)n=a;if(i++,i>r)r=i,t=n}else n=-1,i=0;if(r<2)return e.join(":");let s=e.slice(0,t).join(":"),o=e.slice(t+r).join(":");return s+"::"+o}function H6(e){let t=e.indexOf("::");if(t!==-1&&e.indexOf("::",t+1)!==-1)return;let r=t===-1?e.split(":"):e.slice(0,t).split(":"),n=t===-1?[]:e.slice(t+2).split(":");if(t!==-1){if(r.length===1&&r[0]==="")r.length=0;if(n.length===1&&n[0]==="")n.length=0}let i=r.concat(n),s=0;for(let a=0;a<i.length;a++){let c=i[a];if(c==="")return;if(c.indexOf(".")!==-1){if(a!==i.length-1||t!==-1&&n.length===0||!vh(c))return;s+=2;continue}if(!D6(c))return;i[a]=parseInt(c,16).toString(16),s++}if(t===-1){if(s!==8)return;return Zk(i)}if(s>=8)return;let o=i.slice(0,r.length);for(let a=s;a<8;a++)o.push("0");for(let a=r.length;a<i.length;a++)o.push(i[a]);return Zk(o)}function $h(e){let t=e[0]==="["&&e[e.length-1]==="]";if((e[0]==="["||e[e.length-1]==="]")&&!t)return{host:e,isIPV6:!1,error:!0};let n=t?e.slice(1,-1):e;if(t&&J6(n))return n=n.toLowerCase(),{host:`[${n}]`,escapedHost:n,isIPV6:!1,isIPVFuture:!0};if(U6(n,":")<2)return{host:e,isIPV6:!1,error:t};let i="",s=n.indexOf("%");if(s!==-1){let a=n.slice(s,s+3).toLowerCase()==="%25"?3:1;if(i=n.slice(s+a),!B6(i))return{host:e,isIPV6:!1,error:!0};n=n.slice(0,s)}let o=H6(n);if(o===void 0)return{host:e,isIPV6:!1,error:!0};return{host:o+(i?"%"+i:""),escapedHost:o+(i?"%25"+i:""),isIPV6:!0}}function U6(e,t){let r=0;for(let n=0;n<e.length;n++)if(e[n]===t)r++;return r}function tA(e){let t=e,r=[],n=-1,i=0;while(i=t.length){if(i===1)if(t===".")break;else if(t==="/"){r.push("/");break}else{r.push(t);break}else if(i===2){if(t[0]==="."){if(t[1]===".")break;else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){r.push("/");break}}}else if(i===3){if(t==="/.."){if(r.length!==0)r.pop();r.push("/");break}}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){if(t=t.slice(3),r.length!==0)r.pop();continue}}}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function V6(e){if(e===""||e[0]==="/")return tA(e);let t=e.split("/"),r=t.length-1,n=[],i=!1;for(let s=0;s<=r;s++){let o=t[s];if(o==="."||o===".."){if(o==="..")if(n.length!==0&&n[n.length-1]!=="..")n.pop();else n.push("..");i=s===r}else n.push(o)}if(i&&n[n.length-1]!=="..")n.push("");if(n.length===0||n[0]===""||n[0].includes(":"))n.unshift(".");return n.join("/")}var W6={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},z6=/[@/?#:]/g,K6=/[@/?#]/g;function rA(e,t){let r=t?K6:z6;return r.lastIndex=0,e.replace(r,(n)=>W6[n])}function nA(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let i=e.slice(n+1,n+3);if(ps(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));if(t&&wh(o))r+=o;else r+="%"+s;n+=2;continue}}r+=e[n]}return r}function G6(e){let t="";for(let r=0;r<e.length;r++){let n=e[r];if(n==="%"&&r+2<e.length){let i=e.slice(r+1,r+3);if(ps(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));if(o!=="."&&wh(o))t+=o;else t+="%"+s;r+=2;continue}}if(eA(n))t+=n;else{let i=e.charCodeAt(r);if(i<128)t+=sA(i)?n:pr[i];else if(i<55296||i>57343)t+=Lt(i);else if(i<=56319&&r+1<e.length){let s=e.charCodeAt(r+1);if(s>=56320&&s<=57343)t+=Lt(65536+(i-55296<<10)+(s-56320)),r++;else t+=Lt(65533)}else t+=Lt(65533)}}return t}function Y6(e,t=!1){let r="",n=t&&e[0]!=="/";for(let i=0;i<e.length;i++){let s=e[i];if(s==="%"&&i+2<e.length){let o=e.slice(i+1,i+3);if(ps(o)){r+="%"+o.toUpperCase(),i+=2;continue}}if(s==="/")n=!1;if(eA(s)&&(s!==":"||!n))r+=s;else{let o=e.charCodeAt(i);if(o<128)r+=pr[o];else if(o<55296||o>57343)r+=Lt(o);else if(o<=56319&&i+1<e.length){let a=e.charCodeAt(i+1);if(a>=56320&&a<=57343)r+=Lt(65536+(o-55296<<10)+(a-56320)),i++;else r+=Lt(65533)}else r+=Lt(65533)}}return r}function Eh(e,t){let r="";for(let n=0;n<e.length;n++){let i=e[n];if(i==="%"&&n+2<e.length){let s=e.slice(n+1,n+3);if(ps(s)){r+="%"+s.toUpperCase(),n+=2;continue}}if(t(i))r+=i;else{let s=e.charCodeAt(n);if(s<128)r+=pr[s];else if(s<55296||s>57343)r+=Lt(s);else if(s<=56319&&n+1<e.length){let o=e.charCodeAt(n+1);if(o>=56320&&o<=57343)r+=Lt(65536+(s-55296<<10)+(o-56320)),n++;else r+=Lt(65533)}else r+=Lt(65533)}}return r}function iA(e){return Eh(e,M6)}function X6(e){return Eh(e,Sh)}function Q6(e){return Eh(e,Sh)}function sA(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===42||e===43||e===45||e===46||e===47||e===64||e===95}function Z6(e){let t="";for(let r=0;r<e.length;r++){let n=e[r];if(n==="%"&&r+2<e.length){let i=e.slice(r+1,r+3);if(ps(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));if(wh(o))t+=o;else t+="%"+s;r+=2;continue}}if(Sh(n))t+=n;else{let i=e.charCodeAt(r);if(i<128)t+=sA(i)?n:pr[i];else if(i<55296||i>57343)t+=Lt(i);else if(i<=56319&&r+1<e.length){let s=e.charCodeAt(r+1);if(s>=56320&&s<=57343)t+=Lt(65536+(i-55296<<10)+(s-56320)),r++;else t+=Lt(65533)}else t+=Lt(65533)}}return t}function e9(e){let t="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let n=e.slice(r+1,r+3);if(ps(n)){t+="%"+n.toUpperCase(),r+=2;continue}}t+=escape(e[r])}return t}function t9(e){let t=[];if(e.userinfo!==void 0)t.push(iA(e.userinfo)),t.push("@");if(e.host!==void 0){let r=e.host;if(!vh(r)){let n=$h(r);if(n.isIPV6!==!0&&n.isIPVFuture!==!0)r=nA(r,!0),n=$h(r);if(n.isIPV6===!0||n.isIPVFuture===!0)r=`[${n.escapedHost}]`;else r=rA(r,!1)}t.push(r)}if(typeof e.port==="number"||typeof e.port==="string"){let r=String(e.port);if(!N6(r))throw TypeError("URI port is malformed.");t.push(":"),t.push(r)}return t.length?t.join(""):void 0}oA.exports={nonSimpleDomain:q6,recomposeAuthority:t9,reescapeHostDelimiters:rA,normalizePercentEncoding:nA,normalizePathEncoding:G6,serializePathEncoding:Y6,normalizeQueryFragmentEncoding:Z6,encodeUserinfo:iA,encodeQuery:X6,encodeFragment:Q6,escapePreservingEscapes:e9,removeDotSegments:tA,removeDotSegmentsRelative:V6,isIPv4:vh,isUUID:T6,normalizeIPv6:$h,stringArrayToHexStripped:L6}});var fA=C(function(rce,uA){var{isUUID:r9}=_h(),n9=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,i9=["http","https","ws","wss","urn","urn:uuid"];function s9(e){return i9.indexOf(e)!==-1}function Ph(e){if(e.secure===!0)return!0;else if(e.secure===!1)return!1;else if(e.scheme)return e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S");else return!1}function aA(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function cA(e){let t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port==="")e.port=void 0;if(!e.path)e.path="/";return e}function o9(e){return e.secure=Ph(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function a9(e){if(e.port===(Ph(e)?443:80)||e.port==="")e.port=void 0;if(typeof e.secure==="boolean")e.scheme=e.secure?"wss":"ws",e.secure=void 0;if(e.resourceName){let t=e.resourceName.indexOf("?"),r=t===-1?e.resourceName:e.resourceName.slice(0,t);e.path=r&&r!=="/"?r:void 0,e.query=t===-1?void 0:e.resourceName.slice(t+1),e.resourceName=void 0}return e.fragment=void 0,e}function c9(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(n9);if(r&&r[0]===e.path){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let i=`${n}:${t.nid||e.nid}`,s=kh(i);if(e.path=void 0,s)e=s.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function l9(e,t){if(e.nid===void 0)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i=`${r}:${t.nid||n}`,s=kh(i);if(s)e=s.serialize(e,t);let o=e,a=e.nss;return o.path=`${n||t.nid}:${a}`,t.skipEscape=!0,o}function u9(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!r9(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function f9(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var lA={scheme:"http",domainHost:!0,parse:aA,serialize:cA},d9={scheme:"https",domainHost:lA.domainHost,parse:aA,serialize:cA},ku={scheme:"ws",domainHost:!0,parse:o9,serialize:a9},p9={scheme:"wss",domainHost:ku.domainHost,parse:ku.parse,serialize:ku.serialize},m9={scheme:"urn",parse:c9,serialize:l9,skipNormalize:!0},h9={scheme:"urn:uuid",parse:u9,serialize:f9,skipNormalize:!0},Au={http:lA,https:d9,ws:ku,wss:p9,urn:m9,"urn:uuid":h9};Object.setPrototypeOf(Au,null);function kh(e){return e&&(Au[e]||Au[e.toLowerCase()])||void 0}uA.exports={wsIsSecure:Ph,SCHEMES:Au,isValidSchemeName:s9,getSchemeHandler:kh}});var _A=C(function(nce,Cu){var{normalizeIPv6:gA,removeDotSegments:ic,removeDotSegmentsRelative:yA,recomposeAuthority:g9,normalizePercentEncoding:Ah,normalizePathEncoding:y9,serializePathEncoding:dA,normalizeQueryFragmentEncoding:pA,encodeQuery:b9,encodeFragment:x9,reescapeHostDelimiters:$9,isIPv4:bA,nonSimpleDomain:v9}=_h(),{SCHEMES:xA,getSchemeHandler:jh}=fA(),$A=/^[A-Za-z][A-Za-z0-9+.-]*$/u,w9=/[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;function mA(e){let t=String(e);if(!$A.test(t))throw TypeError("URI scheme is malformed.");return t}function S9(e,t){if(typeof e==="string")e=C9(e,t);else if(typeof e==="object")e=Ru(ms(e,t),t);return e}function E9(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:i,malformedAuthorityOrPort:s,malformedPercentEncoding:o,malformedSchemeSpecific:a,malformedHost:c,malformedScheme:l}=ju(e,n),{parsed:u,malformedAuthorityOrPort:d,malformedPercentEncoding:h,malformedSchemeSpecific:m,malformedHost:y,malformedScheme:g}=ju(t,n);if(s||d||o||h||a||m||c||y||l||g)throw Error(i.error||u.error||"URI is malformed.");let b=vA(i,u,n,!0),x=jh(r&&r.scheme||b.scheme),_=b.host,P=_!==void 0&&_!==""&&(bA(_)||gA(_).isIPV6);if(SA(b,r||{},x,P))throw Error("URI host is malformed.");wA(b,r||{},x,P);let E=_&&_.indexOf("%")!==-1&&!/\P{ASCII}/u.test(_);if(b.error&&!E)throw Error(b.error);return n.skipEscape=!0,ms(b,n)}function vA(e,t,r,n){let i={};if(!n)e=Ru(ms(e,r),r),t=Ru(ms(t,r),r);if(r=r||{},!r.tolerant&&t.scheme)i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=ic(t.path||""),i.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=ic(t.path||""),i.query=t.query;else{if(!t.path)if(i.path=e.path,t.query!==void 0)i.query=t.query;else i.query=e.query;else{if(t.path[0]==="/")i.path=ic(t.path);else{let s=e.userinfo!==void 0||e.host!==void 0||e.port!==void 0;if(s&&!e.path)i.path="/"+t.path;else if(!e.path)i.path=t.path;else i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;i.path=e.scheme===void 0&&!s&&i.path[0]!=="/"?yA(i.path):ic(i.path)}i.query=t.query}i.userinfo=e.userinfo,i.host=e.host,i.port=e.port}i.scheme=e.scheme}return i.fragment=t.fragment,i}function _9(e,t,r){let n=hA(e,r),i=hA(t,r);return n!==void 0&&i!==void 0&&n===i}function ms(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),i=[];if(r.scheme)r.scheme=mA(r.scheme);let s=jh(n.scheme||r.scheme);if(s&&s.serialize)s.serialize(r,n);let o=r.userinfo!==void 0||r.host!==void 0||r.port!==void 0,a=(r.scheme===void 0||n.reference==="suffix")&&!o,c=!n.skipEscape&&a;if(r.path!==void 0)if(!n.skipEscape)r.path=dA(r.path,c);else r.path=Ah(r.path);if(n.reference!=="suffix"&&r.scheme)r.scheme=mA(r.scheme),i.push(r.scheme,":");let l=g9(r);if(l!==void 0){if(n.reference!=="suffix")i.push("//");if(i.push(l),r.path&&r.path[0]!=="/")i.push("/")}if(r.path!==void 0){let u=r.path;if(!n.absolutePath&&(!s||!s.absolutePath))u=a&&u[0]!=="/"?yA(u):ic(u);if(a)u=dA(u,!0);if(l===void 0&&u[0]==="/"&&u[1]==="/")u="/%2F"+u.slice(2);i.push(u)}if(r.query!==void 0)i.push("?",b9(r.query));if(r.fragment!==void 0)i.push("#",x9(r.fragment));return i.join("")}var P9=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,k9=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,A9=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function j9(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port==="number"&&(e.port<0||e.port>65535))return"URI port is malformed.";return}function nc(e){if(e===void 0)return!1;let t=e.indexOf("%");while(t!==-1){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf("%",t+3)}return!1}function Ou(e){return e[0]==="["&&e[e.length-1]==="]"}function R9(e){let t=e[4];return nc(e[3])||t!==void 0&&!Ou(t)&&nc(t)||nc(e[6])||nc(e[7])||nc(e[8])}function wA(e,t,r,n){if(SA(e,t,r,n))return e.error=e.error||"URI host is malformed.",!0;if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&!Ou(e.host)&&(t.domainHost||r&&r.domainHost)&&n===!1&&v9(e.host)){let i;try{i=new URL("http://"+e.host)}catch(s){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+s,!0}if(!O9(i))return e.error=e.error||"URI host is malformed.",!0;e.host=i.hostname}return!1}function SA(e,t,r,n){return Boolean(e.host&&n===!1&&!Ou(e.host)&&(t.domainHost||r&&r.domainHost)&&w9.test(e.host))}function O9(e){return e.username===""&&e.password===""&&e.port===""&&e.pathname==="/"&&e.search===""&&e.hash===""&&e.hostname!==""}function ju(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,s=!1,o=!1,a=!1,c=!1,l=!1,u=!1;if(r.reference==="suffix")if(r.scheme)e=r.scheme+":"+e;else e="//"+e;let d=e.match(k9);if(d!==null&&d[1].indexOf("\\")!==-1)n.error="URI authority must not contain a literal backslash.",i=!0;let h=e.match(A9);if(h!==null){let y=h[1],g=y.replace(/[\t\n\r]/g,"");if(g.length>=2){if(g.slice(0,2)!=="//")n.error=n.error||"URI authority must not contain a literal backslash.",i=!0;else if(y.length!==g.length)n.error=n.error||"URI authority introducer must not contain whitespace.",i=!0}}let m=e.match(P9);if(m){if(n.scheme=m[1],n.userinfo=m[3],n.host=m[4],n.port=parseInt(m[5],10),n.path=m[6]||"",n.query=m[7],n.fragment=m[8],n.scheme!==void 0)if($A.test(n.scheme))n.scheme=n.scheme.toLowerCase();else n.error=n.error||"URI scheme is malformed.",l=!0;if(s=R9(m),s)n.error=n.error||"URI contains malformed percent-encoding.";if(isNaN(n.port))n.port=m[5];let y=j9(n,m);if(y!==void 0)n.error=n.error||y,i=!0;if(n.host)if(bA(n.host)===!1){let x=Ou(n.host),_=n.host.indexOf("[")!==-1||n.host.indexOf("]")!==-1,P=gA(n.host);if(u=P.isIPV6||P.isIPVFuture===!0,c=_&&(!x||P.error===!0),n.host=u?P.host:P.host.toLowerCase(),c)n.error=n.error||"URI host is malformed.",i=!0}else u=!0;if(n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path)n.reference="same-document";else if(n.scheme===void 0)n.reference="relative";else if(n.fragment===void 0)n.reference="absolute";else n.reference="uri";if(r.reference&&r.reference!=="suffix"&&r.reference!==n.reference)n.error=n.error||"URI is not a "+r.reference+" reference.";let g=jh(r.scheme||n.scheme);if(!c)a=wA(n,r,g,u);if(e.indexOf("%")!==-1&&n.host!==void 0&&!c){let b=u?n.host:Ah(n.host,!0);if(!u)b=Ah(b.toLowerCase());n.host=u||r.scheme!=="null"?$9(b,u):b}if(!g||g&&!g.skipNormalize){if(n.path)n.path=y9(n.path);if(n.query)n.query=pA(n.query);if(n.fragment)n.fragment=pA(n.fragment)}if(g&&g.parse){if(g.parse(n,r),g===xA.urn&&n.nid===void 0)o=!0}}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i,malformedPercentEncoding:s,malformedSchemeSpecific:o,malformedHost:a,malformedScheme:l}}function Ru(e,t){return ju(e,t).parsed}function C9(e,t){return EA(e,t).normalized}function EA(e,t){let{parsed:r,malformedAuthorityOrPort:n,malformedPercentEncoding:i,malformedSchemeSpecific:s,malformedHost:o,malformedScheme:a}=ju(e,t);return{normalized:n||i||s||o||a?e:ms(r,t),malformedAuthorityOrPort:n,malformedPercentEncoding:i,malformedSchemeSpecific:s,malformedHost:o,malformedScheme:a}}function hA(e,t){if(typeof e!=="string"&&typeof e!=="object")return;let r;try{r=typeof e==="string"?e:ms(e,t)}catch{return}let{normalized:n,malformedAuthorityOrPort:i,malformedPercentEncoding:s,malformedSchemeSpecific:o,malformedHost:a,malformedScheme:c}=EA(r,t);return i||s||o||a||c?void 0:n}var Rh={SCHEMES:xA,normalize:S9,resolve:E9,resolveComponent:vA,equal:_9,serialize:ms,parse:Ru};Cu.exports=Rh;Cu.exports.default=Rh;Cu.exports.fastUri=Rh});var AA=C(function(kA){Object.defineProperty(kA,"__esModule",{value:!0});var PA=_A();PA.code='require("ajv/dist/runtime/uri").default';kA.default=PA});var Ih=C(function(Yn){Object.defineProperty(Yn,"__esModule",{value:!0});Yn.CodeGen=Yn.Name=Yn.nil=Yn.stringify=Yn.str=Yn._=Yn.KeywordCxt=void 0;var T9=Eo();Object.defineProperty(Yn,"KeywordCxt",{enumerable:!0,get:function(){return T9.KeywordCxt}});var Po=be();Object.defineProperty(Yn,"_",{enumerable:!0,get:function(){return Po._}});Object.defineProperty(Yn,"str",{enumerable:!0,get:function(){return Po.str}});Object.defineProperty(Yn,"stringify",{enumerable:!0,get:function(){return Po.stringify}});Object.defineProperty(Yn,"nil",{enumerable:!0,get:function(){return Po.nil}});Object.defineProperty(Yn,"Name",{enumerable:!0,get:function(){return Po.Name}});Object.defineProperty(Yn,"CodeGen",{enumerable:!0,get:function(){return Po.CodeGen}});var N9=ec(),IA=_o(),M9=nh(),oc=rc(),L9=be(),sc=Xa(),Iu=Ya(),Ch=_e(),jA=Qk(),D9=AA(),TA=(e,t)=>new RegExp(e,t);TA.code="new RegExp";var J9=["removeAdditional","useDefaults","coerceTypes"],F9=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),q9={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},B9={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},RA=200;function H9(e){var t,r,n,i,s,o,a,c,l,u,d,h,m,y,g,b,x,_,P,E,w,k,R,j,D;let F=e.strict,N=(t=e.code)===null||t===void 0?void 0:t.optimize,q=N===!0||N===void 0?1:N||0,U=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:TA,ne=(i=e.uriResolver)!==null&&i!==void 0?i:D9.default;return{strictSchema:(o=(s=e.strictSchema)!==null&&s!==void 0?s:F)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:F)!==null&&c!==void 0?c:!0,strictTypes:(u=(l=e.strictTypes)!==null&&l!==void 0?l:F)!==null&&u!==void 0?u:"log",strictTuples:(h=(d=e.strictTuples)!==null&&d!==void 0?d:F)!==null&&h!==void 0?h:"log",strictRequired:(y=(m=e.strictRequired)!==null&&m!==void 0?m:F)!==null&&y!==void 0?y:!1,code:e.code?{...e.code,optimize:q,regExp:U}:{optimize:q,regExp:U},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:RA,loopEnum:(b=e.loopEnum)!==null&&b!==void 0?b:RA,meta:(x=e.meta)!==null&&x!==void 0?x:!0,messages:(_=e.messages)!==null&&_!==void 0?_:!0,inlineRefs:(P=e.inlineRefs)!==null&&P!==void 0?P:!0,schemaId:(E=e.schemaId)!==null&&E!==void 0?E:"$id",addUsedSchema:(w=e.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(k=e.validateSchema)!==null&&k!==void 0?k:!0,validateFormats:(R=e.validateFormats)!==null&&R!==void 0?R:!0,unicodeRegExp:(j=e.unicodeRegExp)!==null&&j!==void 0?j:!0,int32range:(D=e.int32range)!==null&&D!==void 0?D:!0,uriResolver:ne}}class Tu{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...H9(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new L9.ValueScope({scope:{},prefixes:F9,es5:t,lines:r}),this.logger=G9(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=M9.getRules(),OA.call(this,q9,e,"NOT SUPPORTED"),OA.call(this,B9,e,"DEPRECATED","warn"),this._metaOpts=z9.call(this),e.formats)V9.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)W9.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);U9.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=jA;if(r==="id")n={...jA},n.id=n.$id,delete n.$id;if(t&&e)this.addMetaSchema(n,n[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let n=r(t);if(!("$async"in r))this.errors=r.errors;return n}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(l,u){await i.call(this,l.$schema);let d=this._addSchema(l,u);return d.validate||s.call(this,d)}async function i(l){if(l&&!this.getSchema(l))await n.call(this,{$ref:l},!0)}async function s(l){try{return this._compileSchemaEnv(l)}catch(u){if(!(u instanceof IA.default))throw u;return o.call(this,u),await a.call(this,u.missingSchema),s.call(this,l)}}function o({missingSchema:l,missingRef:u}){if(this.refs[l])throw Error(`AnySchema ${l} is loaded but ${u} cannot be resolved`)}async function a(l){let u=await c.call(this,l);if(!this.refs[l])await i.call(this,u.$schema);if(!this.refs[l])this.addSchema(u,l,t)}async function c(l){let u=this._loading[l];if(u)return u;try{return await(this._loading[l]=r(l))}finally{delete this._loading[l]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(let s of e)this.addSchema(s,void 0,r,n);return this}let i;if(typeof e==="object"){let{schemaId:s}=this.opts;if(i=e[s],i!==void 0&&typeof i!="string")throw Error(`schema ${s} must be string`)}return t=sc.normalizeId(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(r,e);if(!n&&t){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw Error(i)}return n}getSchema(e){let t;while(typeof(t=CA.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new oc.SchemaEnv({schema:{},schemaId:r});if(t=oc.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=CA.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];if(r)r=sc.normalizeId(r),delete this.schemas[r],delete this.refs[r];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string"){if(r=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r}else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(X9.call(this,r,t),!t)return Ch.eachItem(r,(i)=>Oh.call(this,i)),this;Z9.call(this,t);let n={...t,type:Iu.getJSONTypes(t.type),schemaType:Iu.getJSONTypes(t.schemaType)};return Ch.eachItem(r,n.type.length===0?(i)=>Oh.call(this,i,n):(i)=>n.type.forEach((s)=>Oh.call(this,i,n,s))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let n=r.rules.findIndex((i)=>i.keyword===e);if(n>=0)r.rules.splice(n,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){if(!e||e.length===0)return"No errors";return e.map((n)=>`${r}${n.instancePath} ${n.message}`).reduce((n,i)=>n+t+i)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of t){let i=n.split("/").slice(1),s=e;for(let o of i)s=s[o];for(let o in r){let a=r[o];if(typeof a!="object")continue;let{$data:c}=a.definition,l=s[o];if(c&&l)s[o]=NA(l)}}return e}_removeAllSchemas(e,t){for(let r in e){let n=e[r];if(!t||t.test(r)){if(typeof n=="string")delete e[r];else if(n&&!n.meta)this._cache.delete(n.schema),delete e[r]}}}_addSchema(e,t,r,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let s,{schemaId:o}=this.opts;if(typeof e=="object")s=e[o];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let a=this._cache.get(e);if(a!==void 0)return a;r=sc.normalizeId(s||r);let c=sc.getSchemaRefs.call(this,e,r);if(a=new oc.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:r,localRefs:c}),this._cache.set(a.schema,a),i&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=a}if(n)this.validateSchema(e,!0);return a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else oc.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{oc.compileSchema.call(this,e)}finally{this.opts=t}}}Tu.ValidationError=N9.default;Tu.MissingRefError=IA.default;Yn.default=Tu;function OA(e,t,r,n="error"){for(let i in e){let s=i;if(s in t)this.logger[n](`${r}: option ${i}. ${e[s]}`)}}function CA(e){return e=sc.normalizeId(e),this.schemas[e]||this.refs[e]}function U9(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function V9(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function W9(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function z9(){let e={...this.opts};for(let t of J9)delete e[t];return e}var K9={log(){},warn(){},error(){}};function G9(e){if(e===!1)return K9;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var Y9=/^[a-z_$][a-z0-9_$:-]*$/i;function X9(e,t){let{RULES:r}=this;if(Ch.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!Y9.test(n))throw Error(`Keyword ${n} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function Oh(e,t,r){var n;let i=t===null||t===void 0?void 0:t.post;if(r&&i)throw Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,o=i?s.post:s.rules.find(({type:c})=>c===r);if(!o)o={type:r,rules:[]},s.rules.push(o);if(s.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:Iu.getJSONTypes(t.type),schemaType:Iu.getJSONTypes(t.schemaType)}};if(t.before)Q9.call(this,o,a,t.before);else o.rules.push(a);s.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function Q9(e,t,r){let n=e.rules.findIndex((i)=>i.keyword===r);if(n>=0)e.rules.splice(n,0,t);else e.rules.push(t),this.logger.warn(`rule ${r} is not defined`)}function Z9(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=NA(t);e.validateSchema=this.compile(t,!0)}var ez={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function NA(e){return{anyOf:[e,ez]}}});var LA=C(function(MA){Object.defineProperty(MA,"__esModule",{value:!0});var nz={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};MA.default=nz});var Lu=C(function(qA){Object.defineProperty(qA,"__esModule",{value:!0});qA.callRef=qA.getValidate=void 0;var sz=_o(),DA=qr(),mr=be(),ko=Fr(),JA=rc(),Nu=_e(),oz={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:s,validateName:o,opts:a,self:c}=n,{root:l}=s;if((r==="#"||r==="#/")&&i===l.baseId)return d();let u=JA.resolveRef.call(c,l,i,r);if(u===void 0)throw new sz.default(n.opts.uriResolver,i,r);if(u instanceof JA.SchemaEnv)return h(u);return m(u);function d(){if(s===l)return Mu(e,o,s,s.$async);let y=t.scopeValue("root",{ref:l});return Mu(e,mr._`${y}.validate`,l,l.$async)}function h(y){let g=FA(e,y);Mu(e,g,y,y.$async)}function m(y){let g=t.scopeValue("schema",a.code.source===!0?{ref:y,code:mr.stringify(y)}:{ref:y}),b=t.name("valid"),x=e.subschema({schema:y,dataTypes:[],schemaPath:mr.nil,topSchemaRef:g,errSchemaPath:r},b);e.mergeEvaluated(x),e.ok(b)}}};function FA(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):mr._`${r.scopeValue("wrapper",{ref:t})}.validate`}qA.getValidate=FA;function Mu(e,t,r,n){let{gen:i,it:s}=e,{allErrors:o,schemaEnv:a,opts:c}=s,l=c.passContext?ko.default.this:mr.nil;if(n)u();else d();function u(){if(!a.$async)throw Error("async schema referenced by sync schema");let y=i.let("valid");i.try(()=>{if(i.code(mr._`await ${DA.callValidateCode(e,t,l)}`),m(t),!o)i.assign(y,!0)},(g)=>{if(i.if(mr._`!(${g} instanceof ${s.ValidationError})`,()=>i.throw(g)),h(g),!o)i.assign(y,!1)}),e.ok(y)}function d(){e.result(DA.callValidateCode(e,t,l),()=>m(t),()=>h(t))}function h(y){let g=mr._`${y}.errors`;i.assign(ko.default.vErrors,mr._`${ko.default.vErrors} === null ? ${g} : ${ko.default.vErrors}.concat(${g})`),i.assign(ko.default.errors,mr._`${ko.default.vErrors}.length`)}function m(y){var g;if(!s.opts.unevaluated)return;let b=(g=r===null||r===void 0?void 0:r.validate)===null||g===void 0?void 0:g.evaluated;if(s.props!==!0)if(b&&!b.dynamicProps){if(b.props!==void 0)s.props=Nu.mergeEvaluated.props(i,b.props,s.props)}else{let x=i.var("props",mr._`${y}.evaluated.props`);s.props=Nu.mergeEvaluated.props(i,x,s.props,mr.Name)}if(s.items!==!0)if(b&&!b.dynamicItems){if(b.items!==void 0)s.items=Nu.mergeEvaluated.items(i,b.items,s.items)}else{let x=i.var("items",mr._`${y}.evaluated.items`);s.items=Nu.mergeEvaluated.items(i,x,s.items,mr.Name)}}}qA.callRef=Mu;qA.default=oz});var Th=C(function(HA){Object.defineProperty(HA,"__esModule",{value:!0});var lz=LA(),uz=Lu(),fz=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",lz.default,uz.default];HA.default=fz});var VA=C(function(UA){Object.defineProperty(UA,"__esModule",{value:!0});var Ju=be(),Ai=Ju.operators,Du={maximum:{okStr:"<=",ok:Ai.LTE,fail:Ai.GT},minimum:{okStr:">=",ok:Ai.GTE,fail:Ai.LT},exclusiveMaximum:{okStr:"<",ok:Ai.LT,fail:Ai.GTE},exclusiveMinimum:{okStr:">",ok:Ai.GT,fail:Ai.LTE}},pz={message:({keyword:e,schemaCode:t})=>Ju.str`must be ${Du[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Ju._`{comparison: ${Du[e].okStr}, limit: ${t}}`},mz={keyword:Object.keys(Du),type:"number",schemaType:"number",$data:!0,error:pz,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(Ju._`${r} ${Du[t].fail} ${n} || isNaN(${r})`)}};UA.default=mz});var zA=C(function(WA){Object.defineProperty(WA,"__esModule",{value:!0});var ac=be(),gz={message:({schemaCode:e})=>ac.str`must be multiple of ${e}`,params:({schemaCode:e})=>ac._`{multipleOf: ${e}}`},yz={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:gz,code(e){let{gen:t,data:r,schemaCode:n,it:i}=e,s=i.opts.multipleOfPrecision,o=t.let("res"),a=s?ac._`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:ac._`${o} !== parseInt(${o})`;e.fail$data(ac._`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};WA.default=yz});var YA=C(function(GA){Object.defineProperty(GA,"__esModule",{value:!0});function KA(e){let t=e.length,r=0,n=0,i;while(n<t)if(r++,i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<t){if(i=e.charCodeAt(n),(i&64512)===56320)n++}return r}GA.default=KA;KA.code='require("ajv/dist/runtime/ucs2length").default'});var QA=C(function(XA){Object.defineProperty(XA,"__esModule",{value:!0});var hs=be(),$z=_e(),vz=YA(),wz={message({keyword:e,schemaCode:t}){return hs.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>hs._`{limit: ${e}}`},Sz={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:wz,code(e){let{keyword:t,data:r,schemaCode:n,it:i}=e,s=t==="maxLength"?hs.operators.GT:hs.operators.LT,o=i.opts.unicode===!1?hs._`${r}.length`:hs._`${$z.useFunc(e.gen,vz.default)}(${r})`;e.fail$data(hs._`${o} ${s} ${n}`)}};XA.default=Sz});var ej=C(function(ZA){Object.defineProperty(ZA,"__esModule",{value:!0});var _z=qr(),Pz=_e(),Ao=be(),kz={message:({schemaCode:e})=>Ao.str`must match pattern "${e}"`,params:({schemaCode:e})=>Ao._`{pattern: ${e}}`},Az={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:kz,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:s,it:o}=e,a=o.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=o.opts.code,l=c.code==="new RegExp"?Ao._`new RegExp`:Pz.useFunc(t,c),u=t.let("valid");t.try(()=>t.assign(u,Ao._`${l}(${s}, ${a}).test(${r})`),()=>t.assign(u,!1)),e.fail$data(Ao._`!${u}`)}else{let c=_z.usePattern(e,i);e.fail$data(Ao._`!${c}.test(${r})`)}}};ZA.default=Az});var rj=C(function(tj){Object.defineProperty(tj,"__esModule",{value:!0});var cc=be(),Rz={message({keyword:e,schemaCode:t}){return cc.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>cc._`{limit: ${e}}`},Oz={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Rz,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxProperties"?cc.operators.GT:cc.operators.LT;e.fail$data(cc._`Object.keys(${r}).length ${i} ${n}`)}};tj.default=Oz});var ij=C(function(nj){Object.defineProperty(nj,"__esModule",{value:!0});var uc=qr(),lc=be(),Iz=_e(),Tz={message:({params:{missingProperty:e}})=>lc.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>lc._`{missingProperty: ${e}}`},Nz={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Tz,code(e){let{gen:t,schema:r,schemaCode:n,data:i,$data:s,it:o}=e,{opts:a}=o;if(!s&&r.length===0)return;let c=r.length>=a.loopRequired;if(o.allErrors)l();else u();if(a.strictRequired){let m=e.parentSchema.properties,{definedProperties:y}=e.it;for(let g of r)if((m===null||m===void 0?void 0:m[g])===void 0&&!y.has(g)){let b=o.schemaEnv.baseId+o.errSchemaPath,x=`required property "${g}" is not defined at "${b}" (strictRequired)`;Iz.checkStrictMode(o,x,o.opts.strictRequired)}}function l(){if(c||s)e.block$data(lc.nil,d);else for(let m of r)uc.checkReportMissingProp(e,m)}function u(){let m=t.let("missing");if(c||s){let y=t.let("valid",!0);e.block$data(y,()=>h(m,y)),e.ok(y)}else t.if(uc.checkMissingProp(e,r,m)),uc.reportMissingProp(e,m),t.else()}function d(){t.forOf("prop",n,(m)=>{e.setParams({missingProperty:m}),t.if(uc.noPropertyInData(t,i,m,a.ownProperties),()=>e.error())})}function h(m,y){e.setParams({missingProperty:m}),t.forOf(m,n,()=>{t.assign(y,uc.propertyInData(t,i,m,a.ownProperties)),t.if(lc.not(y),()=>{e.error(),t.break()})},lc.nil)}}};nj.default=Nz});var oj=C(function(sj){Object.defineProperty(sj,"__esModule",{value:!0});var fc=be(),Lz={message({keyword:e,schemaCode:t}){return fc.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>fc._`{limit: ${e}}`},Dz={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Lz,code(e){let{keyword:t,data:r,schemaCode:n}=e,i=t==="maxItems"?fc.operators.GT:fc.operators.LT;e.fail$data(fc._`${r}.length ${i} ${n}`)}};sj.default=Dz});var Fu=C(function(cj){Object.defineProperty(cj,"__esModule",{value:!0});var aj=fh();aj.code='require("ajv/dist/runtime/equal").default';cj.default=aj});var uj=C(function(lj){Object.defineProperty(lj,"__esModule",{value:!0});var Nh=Ya(),At=be(),qz=_e(),Bz=Fu(),Hz={message:({params:{i:e,j:t}})=>At.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>At._`{i: ${e}, j: ${t}}`},Uz={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Hz,code(e){let{gen:t,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:a}=e;if(!n&&!i)return;let c=t.let("valid"),l=s.items?Nh.getSchemaTypes(s.items):[];e.block$data(c,u,At._`${o} === false`),e.ok(c);function u(){let y=t.let("i",At._`${r}.length`),g=t.let("j");e.setParams({i:y,j:g}),t.assign(c,!0),t.if(At._`${y} > 1`,()=>(d()?h:m)(y,g))}function d(){return l.length>0&&!l.some((y)=>y==="object"||y==="array")}function h(y,g){let b=t.name("item"),x=Nh.checkDataTypes(l,b,a.opts.strictNumbers,Nh.DataType.Wrong),_=t.const("indices",At._`{}`);t.for(At._`;${y}--;`,()=>{if(t.let(b,At._`${r}[${y}]`),t.if(x,At._`continue`),l.length>1)t.if(At._`typeof ${b} == "string"`,At._`${b} += "_"`);t.if(At._`typeof ${_}[${b}] == "number"`,()=>{t.assign(g,At._`${_}[${b}]`),e.error(),t.assign(c,!1).break()}).code(At._`${_}[${b}] = ${y}`)})}function m(y,g){let b=qz.useFunc(t,Bz.default),x=t.name("outer");t.label(x).for(At._`;${y}--;`,()=>t.for(At._`${g} = ${y}; ${g}--;`,()=>t.if(At._`${b}(${r}[${y}], ${r}[${g}])`,()=>{e.error(),t.assign(c,!1).break(x)})))}}};lj.default=Uz});var dj=C(function(fj){Object.defineProperty(fj,"__esModule",{value:!0});var Mh=be(),Wz=_e(),zz=Fu(),Kz={message:"must be equal to constant",params:({schemaCode:e})=>Mh._`{allowedValue: ${e}}`},Gz={keyword:"const",$data:!0,error:Kz,code(e){let{gen:t,data:r,$data:n,schemaCode:i,schema:s}=e;if(n||s&&typeof s=="object")e.fail$data(Mh._`!${Wz.useFunc(t,zz.default)}(${r}, ${i})`);else e.fail(Mh._`${s} !== ${r}`)}};fj.default=Gz});var mj=C(function(pj){Object.defineProperty(pj,"__esModule",{value:!0});var dc=be(),Xz=_e(),Qz=Fu(),Zz={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>dc._`{allowedValues: ${e}}`},e8={keyword:"enum",schemaType:"array",$data:!0,error:Zz,code(e){let{gen:t,data:r,$data:n,schema:i,schemaCode:s,it:o}=e;if(!n&&i.length===0)throw Error("enum must have non-empty array");let a=i.length>=o.opts.loopEnum,c,l=()=>c!==null&&c!==void 0?c:c=Xz.useFunc(t,Qz.default),u;if(a||n)u=t.let("valid"),e.block$data(u,d);else{if(!Array.isArray(i))throw Error("ajv implementation error");let m=t.const("vSchema",s);u=dc.or(...i.map((y,g)=>h(m,g)))}e.pass(u);function d(){t.assign(u,!1),t.forOf("v",s,(m)=>t.if(dc._`${l()}(${r}, ${m})`,()=>t.assign(u,!0).break()))}function h(m,y){let g=i[y];return typeof g==="object"&&g!==null?dc._`${l()}(${r}, ${m}[${y}])`:dc._`${r} === ${g}`}}};pj.default=e8});var Lh=C(function(hj){Object.defineProperty(hj,"__esModule",{value:!0});var r8=VA(),n8=zA(),i8=QA(),s8=ej(),o8=rj(),a8=ij(),c8=oj(),l8=uj(),u8=dj(),f8=mj(),d8=[r8.default,n8.default,i8.default,s8.default,o8.default,a8.default,c8.default,l8.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u8.default,f8.default];hj.default=d8});var Jh=C(function(yj){Object.defineProperty(yj,"__esModule",{value:!0});yj.validateAdditionalItems=void 0;var gs=be(),Dh=_e(),m8={message:({params:{len:e}})=>gs.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>gs._`{limit: ${e}}`},h8={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:m8,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){Dh.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}gj(e,n)}};function gj(e,t){let{gen:r,schema:n,data:i,keyword:s,it:o}=e;o.items=!0;let a=r.const("len",gs._`${i}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(gs._`${a} <= ${t.length}`);else if(typeof n=="object"&&!Dh.alwaysValidSchema(o,n)){let l=r.var("valid",gs._`${a} <= ${t.length}`);r.if(gs.not(l),()=>c(l)),e.ok(l)}function c(l){r.forRange("i",t.length,a,(u)=>{if(e.subschema({keyword:s,dataProp:u,dataPropType:Dh.Type.Num},l),!o.allErrors)r.if(gs.not(l),()=>r.break())})}}yj.validateAdditionalItems=gj;yj.default=h8});var Fh=C(function(vj){Object.defineProperty(vj,"__esModule",{value:!0});vj.validateTuple=void 0;var xj=be(),qu=_e(),y8=qr(),b8={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return $j(e,"additionalItems",t);if(r.items=!0,qu.alwaysValidSchema(r,t))return;e.ok(y8.validateArray(e))}};function $j(e,t,r=e.schema){let{gen:n,parentSchema:i,data:s,keyword:o,it:a}=e;if(u(i),a.opts.unevaluated&&r.length&&a.items!==!0)a.items=qu.mergeEvaluated.items(n,r.length,a.items);let c=n.name("valid"),l=n.const("len",xj._`${s}.length`);r.forEach((d,h)=>{if(qu.alwaysValidSchema(a,d))return;n.if(xj._`${l} > ${h}`,()=>e.subschema({keyword:o,schemaProp:h,dataProp:h},c)),e.ok(c)});function u(d){let{opts:h,errSchemaPath:m}=a,y=r.length,g=y===d.minItems&&(y===d.maxItems||d[t]===!1);if(h.strictTuples&&!g){let b=`"${o}" is ${y}-tuple, but minItems or maxItems/${t} are not specified or different at path "${m}"`;qu.checkStrictMode(a,b,h.strictTuples)}}}vj.validateTuple=$j;vj.default=b8});var Ej=C(function(Sj){Object.defineProperty(Sj,"__esModule",{value:!0});var $8=Fh(),v8={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>$8.validateTuple(e,"items")};Sj.default=v8});var kj=C(function(Pj){Object.defineProperty(Pj,"__esModule",{value:!0});var _j=be(),S8=_e(),E8=qr(),_8=Jh(),P8={message:({params:{len:e}})=>_j.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>_j._`{limit: ${e}}`},k8={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:P8,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;if(n.items=!0,S8.alwaysValidSchema(n,t))return;if(i)_8.validateAdditionalItems(e,i);else e.ok(E8.validateArray(e))}};Pj.default=k8});var jj=C(function(Aj){Object.defineProperty(Aj,"__esModule",{value:!0});var Br=be(),Bu=_e(),j8={message:({params:{min:e,max:t}})=>t===void 0?Br.str`must contain at least ${e} valid item(s)`:Br.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?Br._`{minContains: ${e}}`:Br._`{minContains: ${e}, maxContains: ${t}}`},R8={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:j8,code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e,o,a,{minContains:c,maxContains:l}=n;if(s.opts.next)o=c===void 0?1:c,a=l;else o=1;let u=t.const("len",Br._`${i}.length`);if(e.setParams({min:o,max:a}),a===void 0&&o===0){Bu.checkStrictMode(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){Bu.checkStrictMode(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(Bu.alwaysValidSchema(s,r)){let g=Br._`${u} >= ${o}`;if(a!==void 0)g=Br._`${g} && ${u} <= ${a}`;e.pass(g);return}s.items=!0;let d=t.name("valid");if(a===void 0&&o===1)m(d,()=>t.if(d,()=>t.break()));else if(o===0){if(t.let(d,!0),a!==void 0)t.if(Br._`${i}.length > 0`,h)}else t.let(d,!1),h();e.result(d,()=>e.reset());function h(){let g=t.name("_valid"),b=t.let("count",0);m(g,()=>t.if(g,()=>y(b)))}function m(g,b){t.forRange("i",0,u,(x)=>{e.subschema({keyword:"contains",dataProp:x,dataPropType:Bu.Type.Num,compositeRule:!0},g),b()})}function y(g){if(t.code(Br._`${g}++`),a===void 0)t.if(Br._`${g} >= ${o}`,()=>t.assign(d,!0).break());else if(t.if(Br._`${g} > ${a}`,()=>t.assign(d,!1).break()),o===1)t.assign(d,!0);else t.if(Br._`${g} >= ${o}`,()=>t.assign(d,!0))}}};Aj.default=R8});var Hu=C(function(Cj){Object.defineProperty(Cj,"__esModule",{value:!0});Cj.validateSchemaDeps=Cj.validatePropertyDeps=Cj.error=void 0;var qh=be(),C8=_e(),pc=qr();Cj.error={message:({params:{property:e,depsCount:t,deps:r}})=>qh.str`must have ${t===1?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>qh._`{property: ${e},
556
+ `+(" ".repeat(Ae.length)+"^"),Ec=A==="Syntax"?"since":"inside",Hp=`${A} error at line ${_e}${f.name?` in ${f.name}`:""}${w&&w.name?`, ${Ec} \`${w.partial?"partial ":""}${function(Qt){let rs=[Qt];for(;Qt&&Qt.parent;){let{parent:en}=Qt;rs.unshift(en),Qt=en}return rs.map((en)=>function(Di,Li){let Vp=Di;return Li&&(Vp+=` ${Li}`),Vp}(en.type,en.name)).join(" -> ")}(w)}\``:""}:
557
+ ${Ji}`;return{message:`${Hp} ${_}`,bareMessage:_,context:Hp,line:_e,sourceName:f.name,level:B,ruleName:de,autofix:Y,input:Dt,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 B=o(_.idlType,x);if(x.cache.typedefIncludesDictionary.set(_,B),B)return{reference:f,dictionary:B.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 B=_.consume("FrozenArray","ObservableArray","Promise","async_sequence","sequence","record");if(!B)return;let Y=te(new P({source:_.source,tokens:{base:B}}));switch(Y.tokens.open=_.consume("<")||_.error(`No opening bracket after ${B.value}`),B.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 ${B.value} subtype`);Y.subtype.push(de);break}case"record":{_.probe("[")&&_.error("Record key cannot have extended attribute");let de=_.consume(...Be)||_.error(`Record key must be one of: ${Be.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 ${B.value}`),Y.tokens.close=_.consume(">")||_.error(`Missing closing bracket after ${B.value}`),Y.this}(f,x)||ue(f);if(!w){let _=f.consumeKind("identifier")||f.consume(...Be,...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 B=te(new P({source:w.source,tokens:A}));for(B.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"),B.subtype.push(Y);let de=w.consume("or");if(!de)break;Y.tokens.separator=de}return B.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,B),B.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 B of A){if(B.name!=="AllowShared")continue;let Y="`[AllowShared] BufferSource` is now replaced with AllowSharedBufferSource.";yield s(this.tokens.base,this,"migrate-allowshared",Y,{autofix:E(this,B,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 B=(this.union?A:this).tokens.base;yield s(B,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=W(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,B=A.indexOf(_);return!A.slice(B+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,B={special:x},Y=te(new D({source:f.source,tokens:B}));if(x||w||(B.special=f.consume("inherit")),Y.special==="inherit"&&f.probe("readonly")&&f.error("Inherited attributes cannot be read-only"),B.readonly=f.consume("readonly"),_&&!B.readonly&&f.probe("attribute")&&f.error("Attributes must be readonly in this context"),B.base=f.consume("attribute"),B.base)return Y.idlType=Q(f,"attribute-type")||f.error("Attribute lacks a type"),B.name=f.consumeKind("identifier")||f.consume("async","required")||f.error("Attribute lacks a name"),B.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 B=[A];for(;A.tokens.separator;){let Y=x(f);if(!Y){w||f.error(`Trailing comma in ${_}`);break}if(Y.tokens.separator=f.consume(","),B.push(Y),!Y.tokens.separator)break}return B}function W(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"),B=f.consume("short","long");if(B){let Y=f.consume("long");return new P({source:x,tokens:{prefix:A,base:B,postfix:Y}})}A&&f.error("Failed to parse integer type")}()||function(){let A=f.consume("unrestricted"),B=f.consume("float","double");if(B)return new P({source:x,tokens:{prefix:A,base:B}});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(`
558
+ `);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=`
559
+ ${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 B of A)B.parent!==void 0&&(B.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"],Be=["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"],We=["-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,Be,fe),Xe=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],pt=["_constructor","toString","_toString"];class ut{constructor(f){this.source=function(x){let w=[],_=0,A="",B=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;B+=(_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))}We.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:B,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:B,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:B,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:B,tokens:Y}){super(f),this.name="WebIDLParseError",this.bareMessage=x,this.context=w,this.line=_,this.sourceName=A,this.input=B,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 Mt 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 Mt({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 Xr 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 Xr({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 En extends i{static parse(f){let x={},w=te(new En({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 Jt extends i{static parse(f,x,{inheritable:w,allowedMembers:_}){let{tokens:A,type:B}=x;for(A.name=f.consumeKind("identifier")||f.error(`Missing name in ${B}`),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 ${B}`),x.members=[];;){if(A.close=f.consume("}"),A.close)return A.termination=f.consume(";")||f.error(`Missing semicolon after ${B}`),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 Zr 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=W(f)||f.error("Const lacks a value"),x.termination=f.consume(";")||f.error("Unterminated const, expected `;`");let _=new Zr({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,B=A==="maplike",Y=B||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)):B&&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 Ts 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 Ts({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 ts(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 Jt{static parse(f,x,{extMembers:w=[],partial:_=null}={}){let A={partial:_,base:x};return Jt.parse(f,new Is({source:f.source,tokens:A}),{inheritable:!_,allowedMembers:[...w,[Zr.parse],[Ts.parse],[ts],[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:ia(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))}}(_),B=w.partials.get(_.name)||[],Y=w.mixinMap.get(_.name)||[];for(let ge of[...B,...Y]){let _e=ce(ge),Ae=_e.filter((Dt)=>Dt.special==="static"),jt=_e.filter((Dt)=>Dt.special!=="static");yield*de(Ae,A.statics,ge,_),yield*de(jt,A.nonstatics,ge,_),Ae.forEach((Dt)=>A.statics.add(Dt.name)),jt.forEach((Dt)=>A.nonstatics.add(Dt.name))}function*de(ge,_e,Ae,jt){for(let Dt of ge){let{name:Ji}=Dt;if(Ji&&_e.has(Ji)){let Ec=`The ${Dt.special==="static"?"static ":""}operation "${Ji}" has already been defined for the base interface "${jt.name}" either in itself or in a mixin`;yield s(Dt.tokens.name,Ae,"no-cross-overload",Ec)}}}function ce(ge){return ge.members.filter(({type:_e})=>_e==="operation")}}(f,this))}}function ia(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=Ts.parse(new ut(`
560
+ ${_}constructor();`));A.extAttrs=new v({source:f.source,tokens:{}}),te(A).arguments=x.arguments;let B=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(B+1,0,A);let{close:Y}=f.tokens;Y.trivia.includes(`
561
+ `)||(Y.trivia+=`
562
+ ${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 Qr extends Jt{static parse(f,x,{extMembers:w=[],partial:_}={}){let A={partial:_,base:x};if(A.mixin=f.consume("mixin"),A.mixin)return Jt.parse(f,new Qr({source:f.source,tokens:A}),{allowedMembers:[...w,[Zr.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 Jt{static parse(f,{extMembers:x=[],partial:w}={}){let _={partial:w};if(_.base=f.consume("dictionary"),_.base)return Jt.parse(f,new H({source:f.source,tokens:_}),{inheritable:!w,allowedMembers:[...x,[J.parse]]})}get type(){return"dictionary"}}class V extends Jt{static parse(f,{extMembers:x=[],partial:w}={}){let _={partial:w};if(_.base=f.consume("namespace"),_.base)return Jt.parse(f,new V({source:f.source,tokens:_}),{allowedMembers:[...x,[D.parse,{noInherit:!0,readonly:!0}],[Zr.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 Jt{static parse(f,x,{extMembers:w=[]}={}){let _={callback:x};if(_.base=f.consume("interface"),_.base)return Jt.parse(f,new ie({source:f.source,tokens:_}),{allowedMembers:[...w,[Zr.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 B(ce){let ge=A("interface");if(ge)return Qr.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)}()||B()||function(){let ce=A("partial");if(ce)return H.parse(f,{partial:ce,...x?.extensions?.dictionary})||B({partial:ce})||V.parse(f,{partial:ce,...x?.extensions?.namespace})||_("Partial doesn't apply to anything")}()||H.parse(f,x?.extensions?.dictionary)||Mt.parse(f)||En.parse(f)||Xr.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 Te={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({},Te,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=Te}={}){x=Object.assign({},Te,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 B=x.get(A.includes);if(!B)continue;let Y=w.get(A.target);Y?Y.push(B):w.set(A.target,[B])}return w}function*ot(f){let x=function(w){let _=new Map,A=new Set,B=new Map;for(let Y of w)if(Y.partial){let de=B.get(Y.name);de?de.push(Y):B.set(Y.name,[Y])}else Y.name&&(_.has(Y.name)?A.add(Y):_.set(Y.name,Y));return{all:w,unique:_,partials:B,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:B}=A,Y=`The name "${B}" of type "${w.get(B).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 cw=C(function(UY,lw){var __dirname="/home/runner/work/jx/jx/node_modules/@webref/idl",sw=Ne("fs").promises,iw=Ne("path"),lL=nw();class ow{constructor(e,t){this.filename=t,this.shortname=iw.basename(t,".idl"),this.path=iw.join(e,t)}async text(){return await sw.readFile(this.path,"utf8")}async parse(){let e=await this.text();return lL.parse(e)}}async function aw({folder:e=__dirname}={}){let t={},r=await sw.readdir(e);for(let n of r)if(n.endsWith(".idl")){let s=new ow(e,n);t[s.shortname]=s}return t}async function cL(e){let t=await aw(e);for(let[r,n]of Object.entries(t))t[r]=await n.parse();return t}lw.exports={listAll:aw,parseAll:cL}});var uw,dw;var fw=q(()=>{uw={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."},dw={anyOf:[{$ref:"#/$defs/TagName"},{additionalProperties:!1,properties:{$expression:{$ref:"#/$defs/TagExpression"}},required:["$expression"],type:"object"}]}});var pw;var mw=q(()=>{pw={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 hw,gw,yw;var bw=q(()=>{hw={oneOf:[{type:"string"},{$ref:"#/$defs/RefObject"}]},gw={oneOf:[{type:"boolean"},{$ref:"#/$defs/RefObject"}]},yw={oneOf:[{type:"number"},{$ref:"#/$defs/RefObject"}]}});var xw;var $w=q(()=>{xw={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 vw,ww;var Sw=q(()=>{vw={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"},ww={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 Ew;var _w=q(()=>{Ew={enum:["string","number","integer","boolean","array","object","null"],type:"string"}});var Pw,jw,kw,Rw,Aw,Ow,Cw,Nw,Tw;var Iw=q(()=>{Pw={description:"Reference to a $defs type definition in the current component.",examples:["#/$defs/Count","#/$defs/TodoItem","#/$defs/Status"],pattern:String.raw`^#/\$defs/`,type:"string"},jw={description:"Reference to a state entry (runtime variable) in the current component.",examples:["#/state/count","#/state/addTask","#/state/items"],pattern:"^#/state/",type:"string"},kw={description:"Reference to an external Jx component file.",examples:["./card.json","https://cdn.example.com/button.json"],pattern:String.raw`^(\./|\.\./).*\.json$|^https?://`,type:"string"},Rw={description:"Reference to a window or document global.",examples:["window#/currentUser","document#/appConfig"],pattern:"^(window|document)#/",type:"string"},Aw={description:"Reference to a named state entry passed via $props from a parent component.",examples:["parent#/sharedState","parent#/theme"],pattern:"^parent#/",type:"string"},Ow={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"},Cw={oneOf:[{$ref:"#/$defs/InternalRef"},{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/ExternalRef"},{$ref:"#/$defs/GlobalRef"},{$ref:"#/$defs/ParentRef"},{$ref:"#/$defs/MapRef"}],type:"string"},Nw={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"},Tw={properties:{$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"}},required:["$ref"],type:"object"}});var Ol;var Mw=q(()=>{Ol={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 Jw,Dw;var Lw=q(()=>{Jw={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"},Dw={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 Fw,qw,Hw,Vw,Bw,tf;var Ww=q(()=>{Fw={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{$ref:"#/$defs/RefObject"}]},description:"HTML attributes and ARIA attributes set via element.setAttribute().",type:"object"},qw={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"},Hw={oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{$ref:"#/$defs/RefObject"}]},Vw={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"},Bw={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"},tf={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 Uw;var zw=q(()=>{Uw={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 Gw;var Kw=q(()=>{Gw={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 Yw,Xw;var Zw=q(()=>{Yw={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"}]},Xw={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 Qw;var e0=q(()=>{Qw={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 t0;var r0=q(()=>{t0={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 n0,s0,i0,o0,a0,l0,c0,u0,d0,f0,p0,m0,h0,g0,y0,b0,x0;var $0=q(()=>{eu();n0={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"},s0={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."},i0={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."},o0={enum:["!","-"]},a0={enum:["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]},l0={const:"?:"},c0={const:"switch"},u0={const:"call"},d0={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"]},f0={enum:["=","+=","-=","*=","/="]},p0={enum:["pop","shift"]},m0={enum:["push","unshift"]},h0={const:"splice"},g0={const:"reduce"},y0={enum:["map","filter"]},b0={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 "+`${Sh()}) — 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"},x0={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 v0,w0,S0,E0;var _0=q(()=>{v0={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"}]},w0={additionalProperties:{$ref:"#/$defs/StateEntry"},description:"Map of runtime variables. Keys are camelCase (public) or #-prefixed (private). All entries are reactive by default.",type:"object"},S0={additionalProperties:{$ref:"#/$defs/TypeDefEntry"},description:"Map of reusable JSON Schema type definitions. Keys are PascalCase type names. No runtime artifacts are produced.",type:"object"},E0={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 uL,rf,nf,sf,of,af,lf,cf,uf,df,P0;var j0=q(()=>{uL=["method","accessor","parse","serialize","rewrite","discover","load","projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"],rf={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"},nf={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"},sf={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"},of={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:uL,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"},af={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"},lf={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"},cf={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"},uf={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"},df={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"},P0={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 k0;var R0=q(()=>{k0={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 Cl;var A0=q(()=>{Cl={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 dL,ff;var O0=q(()=>{hs();dL=[301,302,303,307,308],ff={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:_a,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:_a,type:"string"},locales:{description:"Available locales, as BCP 47 language tags.",examples:[["en","fr","de"]],items:{pattern:_a,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:[...dL],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 fL(){return C0??=pL(),C0}async function pL(){let[e,t,r]=await Promise.all([T0.listAll(),I0.default.listAll(),M0.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 mL(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 hL(e){let t={...Ol.properties};for(let r of e)t[r]={oneOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/RefObject"}]};return t}async function gL(){let{tagExamples:e,cssProps:t,eventHandlers:r}=await fL();return{$defs:{DefsMap:S0,TypeDefEntry:E0,StateMap:w0,StateEntry:v0,TypedStateDef:Uw,PureTypeDef:t0,FunctionDef:Gw,ClassDef:P0,ClassParameterDef:rf,ClassFieldDef:nf,ClassConstructorDef:sf,ClassMethodDef:of,FormatDef:af,ProjectBlockDef:lf,ServerBlockDef:cf,ConnectorBlockDef:uf,StudioHints:df,ExternalClassDef:Qw,ExpressionPointer:n0,ExpressionLiteral:s0,ExpressionOperand:i0,UnaryOperator:o0,BinaryOperator:a0,ConditionalOperator:l0,SwitchOperator:c0,CallOperator:u0,PureMethod:d0,AssignmentOperator:f0,NoArgMethod:p0,OneArgMethod:m0,SpliceMethod:h0,ReduceMethod:g0,MapFilterMethod:y0,ExpressionNode:b0,ExpressionEntry:x0,Statement:Yw,StatementList:Xw,ElementDef:{...tf,properties:{...tf.properties,...mL(r)}},ChildrenValue:Dw,ArrayNamespace:Jw,SwitchDef:Vw,SwitchNode:Bw,StyleObject:{...Ol,properties:hL(t)},AttributesObject:Fw,PropsObject:qw,RefObject:Nw,AnyRef:Cw,InternalRef:Pw,StateRef:jw,ExternalRef:kw,ExternalComponentRef:Tw,GlobalRef:Rw,ParentRef:Aw,MapRef:Ow,ElementPropertyValue:Hw,StringOrRef:hw,BoolOrRef:gw,NumberOrRef:yw,CemParameter:vw,CemEvent:ww,TagName:{...pw,examples:[...e,"my-counter","todo-app","user-card"]},TagExpression:uw,ElementTagName:dw,JsonSchemaType:Ew,HeadEntry:xw,ImageConfig:Cl,PathsValue:{$id:Es,anyOf:[...Po,zd],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 yL(){return{$defs:{ImageConfig:Cl,StyleObject:J0},$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:ff.properties,title:"Jx Project",type:"object"}}function bL(){return{$defs:{ImageConfig:Cl,JxFieldSchema:Tv,RelationshipRef:Iv,StyleObject:J0},$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:ff.properties,title:"Jx Project Core",type:"object"}}function xL(){return{$id:_o,$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 $L(){return{$id:Es,$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[...Po,zd],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 vL(){return{$id:"https://jxsuite.com/schema/extension-manifest/v1",$schema:"https://json-schema.org/draft/2020-12/schema",title:"Jx Extension Manifest",...k0}}function pf(){return{$defs:{ClassConstructorDef:sf,ClassFieldDef:nf,ClassMethodDef:of,ClassParameterDef:rf,ConnectorBlockDef:uf,FormatDef:af,ProjectBlockDef:lf,ServerBlockDef:cf,StudioHints:df},$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 wL(e){let{mkdirSync:t,writeFileSync:r}=await import("node:fs"),{resolve:n,dirname:s}=await import("node:path"),i=s(n(e,"..")),o=await gL(),a=yL(),l=pf(),c=bL(),d=vL(),p=xL(),h=$L(),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 T0,I0,M0,C0=null,J0,N0,DX;var D0=q(()=>{fw();mw();bw();$w();Sw();_w();Iw();Mw();Lw();Ww();zw();Kw();Zw();e0();r0();$0();_0();j0();R0();kl();A0();O0();T0=Lt(Qv(),1),I0=Lt(rw(),1),M0=Lt(cw(),1);J0={...Ol,additionalProperties:{anyOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/StyleObject"}]}};[,N0]=process.argv,DX=N0?.endsWith("schema.ts")?wL(N0):void 0});var Co=C(function(q0){Object.defineProperty(q0,"__esModule",{value:!0});q0.regexpCode=q0.getEsmExportName=q0.getProperty=q0.safeStringify=q0.stringify=q0.strConcat=q0.addCodeArg=q0.str=q0._=q0.nil=q0._Code=q0.Name=q0.IDENTIFIER=q0._CodeOrName=void 0;class Nl{}q0._CodeOrName=Nl;q0.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class gi extends Nl{constructor(e){super();if(!q0.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}}}q0.Name=gi;class _r extends Nl{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},{})}}q0._Code=_r;q0.nil=new _r("");function L0(e,...t){let r=[e[0]],n=0;while(n<t.length)hf(r,t[n]),r.push(e[++n]);return new _r(r)}q0._=L0;var mf=new _r("+");function F0(e,...t){let r=[Oo(e[0])],n=0;while(n<t.length)r.push(mf),hf(r,t[n]),r.push(mf,Oo(e[++n]));return SL(r),new _r(r)}q0.str=F0;function hf(e,t){if(t instanceof _r)e.push(...t._items);else if(t instanceof gi)e.push(t);else e.push(PL(t))}q0.addCodeArg=hf;function SL(e){let t=1;while(t<e.length-1){if(e[t]===mf){let r=EL(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function EL(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 _L(e,t){return t.emptyStr()?e:e.emptyStr()?t:F0`${e}${t}`}q0.strConcat=_L;function PL(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Oo(Array.isArray(e)?e.join(","):e)}function jL(e){return new _r(Oo(e))}q0.stringify=jL;function Oo(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}q0.safeStringify=Oo;function kL(e){return typeof e=="string"&&q0.IDENTIFIER.test(e)?new _r(`.${e}`):L0`[${e}]`}q0.getProperty=kL;function RL(e){if(typeof e=="string"&&q0.IDENTIFIER.test(e))return new _r(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}q0.getEsmExportName=RL;function AL(e){return new _r(e.toString())}q0.regexpCode=AL});var xf=C(function(W0){Object.defineProperty(W0,"__esModule",{value:!0});W0.ValueScope=W0.ValueScopeName=W0.Scope=W0.varKinds=W0.UsedValueState=void 0;var Ut=Co();class V0 extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Il;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Il||(W0.UsedValueState=Il={}));W0.varKinds={const:new Ut.Name("const"),let:new Ut.Name("let"),var:new Ut.Name("var")};class yf{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}}}W0.Scope=yf;class bf 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}]`}}W0.ValueScopeName=bf;var VL=Ut._`\n`;class B0 extends yf{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?VL:Ut.nil}}get(){return this._scope}name(e){return new bf(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,Il.Started);let c=t(l);if(c){let d=this.opts.es5?W0.varKinds.var:W0.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 V0(l);a.set(l,Il.Completed)})}return s}}W0.ValueScope=B0});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=Co(),Pr=xf(),Wn=Co();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 ql=xf();Object.defineProperty(zt,"Scope",{enumerable:!0,get:function(){return ql.Scope}});Object.defineProperty(zt,"ValueScope",{enumerable:!0,get:function(){return ql.ValueScope}});Object.defineProperty(zt,"ValueScopeName",{enumerable:!0,get:function(){return ql.ValueScopeName}});Object.defineProperty(zt,"varKinds",{enumerable:!0,get:function(){return ql.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 Un{optimizeNodes(){return this}optimizeNames(e,t){return this}}class z0 extends Un{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 wf extends Un{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 Fl(e,this.rhs)}}class G0 extends wf{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class K0 extends Un{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Y0 extends Un{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class X0 extends Un{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class Z0 extends Un{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 Hl extends Un{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;zL(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 zn extends Hl{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Q0 extends Hl{}class No extends zn{}No.kind="else";class vn extends zn{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 No(r):r}if(t){if(e===!1)return t instanceof vn?t:t.nodes;if(this.nodes.length)return this;return new vn(sS(e),t instanceof vn?[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(Fl(e,this.condition),this.else)_s(e,this.else.names);return e}}vn.kind="if";class yi extends zn{}yi.kind="for";class eS 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 tS 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=Fl(super.names,this.from);return Fl(e,this.to)}}class $f 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 Ml extends zn{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)}}Ml.kind="func";class Jl extends Hl{render(e){return"return "+super.render(e)}}Jl.kind="return";class rS extends zn{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 Dl extends zn{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Dl.kind="catch";class Ll extends zn{render(e){return"finally"+super.render(e)}}Ll.kind="finally";class nS{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
563
+ `:""},this._extScope=e,this._scope=new Pr.Scope({parent:e}),this._nodes=[new Q0]}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 z0(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 wf(e,t,r))}add(e,t){return this._leafNode(new G0(e,zt.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==je.nil)this._leafNode(new Z0(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 vn(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 vn(e))}else(){return this._elseNode(new No)}endIf(){return this._endBlockNode(vn,No)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new eS(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 tS(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 $f("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 $f("in",n,s,t),()=>r(s))}endFor(){return this._endBlockNode(yi)}label(e){return this._leafNode(new K0(e))}break(e){return this._leafNode(new Y0(e))}return(e){let t=new Jl;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Jl)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new rS;if(this._blockNode(n),this.code(e),t){let s=this.name("e");this._currNode=n.catch=new Dl(s),t(s)}if(r)this._currNode=n.finally=new Ll,this.code(r);return this._endBlockNode(Dl,Ll)}throw(e){return this._leafNode(new X0(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 Ml(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(Ml)}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 vn))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=nS;function _s(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Fl(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 zL(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function sS(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:je._`!${vf(e)}`}zt.not=sS;var GL=iS(zt.operators.AND);function KL(...e){return e.reduce(GL)}zt.and=KL;var YL=iS(zt.operators.OR);function XL(...e){return e.reduce(YL)}zt.or=XL;function iS(e){return(t,r)=>t===je.nil?r:r===je.nil?t:je._`${vf(t)} ${e} ${vf(r)}`}function vf(e){return e instanceof je.Name?e:je._`(${e})`}});var we=C(function(mS){Object.defineProperty(mS,"__esModule",{value:!0});mS.checkStrictMode=mS.getErrorPath=mS.Type=mS.useFunc=mS.setEvaluated=mS.evaluatedPropsToName=mS.mergeEvaluated=mS.eachItem=mS.unescapeJsonPointer=mS.escapeJsonPointer=mS.escapeFragment=mS.unescapeFragment=mS.schemaRefOrVal=mS.schemaHasRulesButRef=mS.schemaHasRules=mS.checkUnknownRules=mS.alwaysValidSchema=mS.toHash=void 0;var De=ye(),tF=Co();function rF(e){let t={};for(let r of e)t[r]=!0;return t}mS.toHash=rF;function nF(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return cS(e,t),!uS(t,e.self.RULES.all)}mS.alwaysValidSchema=nF;function cS(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])pS(e,`unknown keyword: "${i}"`)}mS.checkUnknownRules=cS;function uS(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}mS.schemaHasRules=uS;function sF(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}mS.schemaHasRulesButRef=sF;function iF({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)}`}mS.schemaRefOrVal=iF;function oF(e){return dS(decodeURIComponent(e))}mS.unescapeFragment=oF;function aF(e){return encodeURIComponent(Ef(e))}mS.escapeFragment=aF;function Ef(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}mS.escapeJsonPointer=Ef;function dS(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}mS.unescapeJsonPointer=dS;function lF(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}mS.eachItem=lF;function aS({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}}mS.mergeEvaluated={props:aS({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} || {}`),_f(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:fS}),items:aS({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 fS(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",De._`{}`);if(t!==void 0)_f(e,r,t);return r}mS.evaluatedPropsToName=fS;function _f(e,t,r){Object.keys(r).forEach((n)=>e.assign(De._`${t}${De.getProperty(n)}`,!0))}mS.setEvaluated=_f;var lS={};function cF(e,t){return e.scopeValue("func",{ref:t,code:lS[t.code]||(lS[t.code]=new tF._Code(t.code))})}mS.useFunc=cF;var Sf;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Sf||(mS.Type=Sf={}));function uF(e,t,r){if(e instanceof De.Name){let n=t===Sf.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():"/"+Ef(e)}mS.getErrorPath=uF;function pS(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}mS.checkStrictMode=pS});var gr=C(function(gS){Object.defineProperty(gS,"__esModule",{value:!0});var St=ye(),kF={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")};gS.default=kF});var To=C(function($S){Object.defineProperty($S,"__esModule",{value:!0});$S.extendErrors=$S.resetErrorsCount=$S.reportExtraError=$S.reportError=$S.keyword$DataError=$S.keywordError=void 0;var Re=ye(),Bl=we(),Ct=gr();$S.keywordError={message:({keyword:e})=>Re.str`must pass "${e}" keyword validation`};$S.keyword$DataError={message:({keyword:e,schemaType:t})=>t?Re.str`"${e}" keyword must be ${t} ($data)`:Re.str`"${e}" keyword is invalid ($data)`};function AF(e,t=$S.keywordError,r,n){let{it:s}=e,{gen:i,compositeRule:o,allErrors:a}=s,l=xS(e,t,r);if(n!==null&&n!==void 0?n:o||a)yS(i,l);else bS(s,Re._`[${l}]`)}$S.reportError=AF;function OF(e,t=$S.keywordError,r){let{it:n}=e,{gen:s,compositeRule:i,allErrors:o}=n,a=xS(e,t,r);if(yS(s,a),!(i||o))bS(n,Ct.default.vErrors)}$S.reportExtraError=OF;function CF(e,t){e.assign(Ct.default.errors,t),e.if(Re._`${Ct.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(Re._`${Ct.default.vErrors}.length`,t),()=>e.assign(Ct.default.vErrors,null)))}$S.resetErrorsCount=CF;function NF({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,Ct.default.errors,(a)=>{if(e.const(o,Re._`${Ct.default.vErrors}[${a}]`),e.if(Re._`${o}.instancePath === undefined`,()=>e.assign(Re._`${o}.instancePath`,Re.strConcat(Ct.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)})}$S.extendErrors=NF;function yS(e,t){let r=e.const("err",t);e.if(Re._`${Ct.default.vErrors} === null`,()=>e.assign(Ct.default.vErrors,Re._`[${r}]`),Re._`${Ct.default.vErrors}.push(${r})`),e.code(Re._`${Ct.default.errors}++`)}function bS(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 xS(e,t,r){let{createErrors:n}=e.it;if(n===!1)return Re._`{}`;return TF(e,t,r)}function TF(e,t,r={}){let{gen:n,it:s}=e,i=[IF(s,r),MF(e,r)];return JF(e,t,i),n.object(...i)}function IF({errorPath:e},{instancePath:t}){let r=t?Re.str`${e}${Bl.getErrorPath(t,Bl.Type.Str)}`:e;return[Ct.default.instancePath,Re.strConcat(Ct.default.instancePath,r)]}function MF({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:Re.str`${t}/${e}`;if(r)s=Re.str`${s}${Bl.getErrorPath(r,Bl.Type.Str)}`;return[Ps.schemaPath,s]}function JF(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}`],[Ct.default.data,i]);if(c)n.push([Ps.propertyName,c])}});var _S=C(function(SS){Object.defineProperty(SS,"__esModule",{value:!0});SS.boolOrEmptySchema=SS.topBoolOrEmptySchema=void 0;var HF=To(),VF=ye(),BF=gr(),WF={message:"boolean schema is false"};function UF(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)wS(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(BF.default.data);else t.assign(VF._`${n}.errors`,null),t.return(!0)}SS.topBoolOrEmptySchema=UF;function zF(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),wS(e);else r.var(t,!0)}SS.boolOrEmptySchema=zF;function wS(e,t){let{gen:r,data:n}=e;HF.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},WF,void 0,t)}});var jf=C(function(PS){Object.defineProperty(PS,"__esModule",{value:!0});PS.getRules=PS.isJSONType=void 0;var KF=["string","number","integer","boolean","null","object","array"],YF=new Set(KF);function XF(e){return typeof e=="string"&&YF.has(e)}PS.isJSONType=XF;function ZF(){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:{}}}PS.getRules=ZF});var kf=C(function(AS){Object.defineProperty(AS,"__esModule",{value:!0});AS.shouldUseRule=AS.shouldUseGroup=AS.schemaHasRulesForType=void 0;function eq({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&kS(e,n)}AS.schemaHasRulesForType=eq;function kS(e,t){return t.rules.some((r)=>RS(e,r))}AS.shouldUseGroup=kS;function RS(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))}AS.shouldUseRule=RS});var Io=C(function(IS){Object.defineProperty(IS,"__esModule",{value:!0});IS.reportTypeError=IS.checkDataTypes=IS.checkDataType=IS.coerceAndCheckDataType=IS.getJSONTypes=IS.getSchemaTypes=IS.DataType=void 0;var nq=jf(),sq=kf(),iq=To(),xe=ye(),CS=we(),xi;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(xi||(IS.DataType=xi={}));function oq(e){let t=NS(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}IS.getSchemaTypes=oq;function NS(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(nq.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}IS.getJSONTypes=NS;function aq(e,t){let{gen:r,data:n,opts:s}=e,i=lq(t,s.coerceTypes),o=t.length>0&&!(i.length===0&&t.length===1&&sq.schemaHasRulesForType(e,t[0]));if(o){let a=Af(t,n,s.strictNumbers,xi.Wrong);r.if(a,()=>{if(i.length)cq(e,t,i);else Of(e)})}return o}IS.coerceAndCheckDataType=aq;var TS=new Set(["string","number","integer","boolean","null"]);function lq(e,t){return t?e.filter((r)=>TS.has(r)||t==="array"&&r==="array"):[]}function cq(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(Af(t,s,i.strictNumbers),()=>n.assign(a,s)));n.if(xe._`${a} !== undefined`);for(let c of r)if(TS.has(c)||c==="array"&&i.coerceTypes==="array")l(c);n.else(),Of(e),n.endIf(),n.if(xe._`${a} !== undefined`,()=>{n.assign(s,a),uq(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
564
+ || (${o} == "string" && ${s} && ${s} == +${s})`).assign(a,xe._`+${s}`);return;case"integer":n.elseIf(xe._`${o} === "boolean" || ${s} === null
565
+ || (${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"
566
+ || ${o} === "boolean" || ${s} === null`).assign(a,xe._`[${s}]`)}}}function uq({gen:e,parentData:t,parentDataProperty:r},n){e.if(xe._`${t} !== undefined`,()=>e.assign(xe._`${t}[${r}]`,n))}function Rf(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)}}IS.checkDataType=Rf;function Af(e,t,r,n){if(e.length===1)return Rf(e[0],t,r,n);let s,i=CS.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,Rf(o,t,r,n));return s}IS.checkDataTypes=Af;var dq={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?xe._`{type: ${e}}`:xe._`{type: ${t}}`};function Of(e){let t=fq(e);iq.reportError(t,dq)}IS.reportTypeError=Of;function fq(e){let{gen:t,data:r,schema:n}=e,s=CS.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var FS=C(function(DS){Object.defineProperty(DS,"__esModule",{value:!0});DS.assignDefaults=void 0;var $i=ye(),xq=we();function $q(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)JS(e,s,r[s].default);else if(t==="array"&&Array.isArray(n))n.forEach((s,i)=>JS(e,i,s.default))}DS.assignDefaults=$q;function JS(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){xq.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(VS){Object.defineProperty(VS,"__esModule",{value:!0});VS.validateUnion=VS.validateArray=VS.usePattern=VS.callValidateCode=VS.schemaProperties=VS.allSchemaProperties=VS.noPropertyInData=VS.propertyInData=VS.isOwnProperty=VS.hasPropFunc=VS.reportMissingProp=VS.checkMissingProp=VS.checkReportMissingProp=void 0;var He=ye(),Cf=we(),Gn=gr(),vq=we();function wq(e,t){let{gen:r,data:n,it:s}=e;r.if(Tf(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:He._`${t}`},!0),e.error()})}VS.checkReportMissingProp=wq;function Sq({gen:e,data:t,it:{opts:r}},n,s){return He.or(...n.map((i)=>He.and(Tf(e,t,i,r.ownProperties),He._`${s} = ${i}`)))}VS.checkMissingProp=Sq;function Eq(e,t){e.setParams({missingProperty:t},!0),e.error()}VS.reportMissingProp=Eq;function qS(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:He._`Object.prototype.hasOwnProperty`})}VS.hasPropFunc=qS;function Nf(e,t,r){return He._`${qS(e)}.call(${t}, ${r})`}VS.isOwnProperty=Nf;function _q(e,t,r,n){let s=He._`${t}${He.getProperty(r)} !== undefined`;return n?He._`${s} && ${Nf(e,t,r)}`:s}VS.propertyInData=_q;function Tf(e,t,r,n){let s=He._`${t}${He.getProperty(r)} === undefined`;return n?He.or(s,He.not(Nf(e,t,r))):s}VS.noPropertyInData=Tf;function HS(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}VS.allSchemaProperties=HS;function Pq(e,t){return HS(t).filter((r)=>!Cf.alwaysValidSchema(e,t[r]))}VS.schemaProperties=Pq;function jq({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=[[Gn.default.instancePath,He.strConcat(Gn.default.instancePath,i)],[Gn.default.parentData,o.parentData],[Gn.default.parentDataProperty,o.parentDataProperty],[Gn.default.rootData,Gn.default.rootData]];if(o.opts.dynamicRef)p.push([Gn.default.dynamicAnchors,Gn.default.dynamicAnchors]);let h=He._`${d}, ${r.object(...p)}`;return l!==He.nil?He._`${a}.call(${l}, ${h})`:He._`${a}(${h})`}VS.callValidateCode=jq;var kq=He._`new RegExp`;function Rq({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"?kq:vq.useFunc(e,s)}(${r}, ${n})`})}VS.usePattern=Rq;function Aq(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:Cf.Type.Num},i),t.if(He.not(i),a)})}}VS.validateArray=Aq;function Oq(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((l)=>Cf.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))}VS.validateUnion=Oq});var KS=C(function(zS){Object.defineProperty(zS,"__esModule",{value:!0});zS.validateKeywordUsage=zS.validSchemaType=zS.funcKeywordCode=zS.macroKeywordCode=void 0;var Nt=ye(),js=gr(),Bq=yr(),Wq=To();function Uq(e,t){let{gen:r,keyword:n,schema:s,parentSchema:i,it:o}=e,a=t.macro.call(o.self,s,i,o),l=US(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))}zS.macroKeywordCode=Uq;function zq(e,t){var r;let{gen:n,keyword:s,schema:i,parentSchema:o,$data:a,it:l}=e;Kq(l,t);let c=!a&&t.compile?t.compile.call(l.self,i,o,l):t.validate,d=US(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)WS(e);y(()=>e.error())}else{let v=t.async?m():b();if(t.modifying)WS(e);y(()=>Gq(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}${Bq.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)}}zS.funcKeywordCode=zq;function WS(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,Nt._`${n.parentData}[${n.parentDataProperty}]`))}function Gq(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`),Wq.extendErrors(e)},()=>e.error())}function Kq({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function US(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 Yq(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")}zS.validSchemaType=Yq;function Xq({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)}}}zS.validateKeywordUsage=Xq});var QS=C(function(XS){Object.defineProperty(XS,"__esModule",{value:!0});XS.extendSubschemaMode=XS.extendSubschemaData=XS.getSubschema=void 0;var Ur=ye(),YS=we();function t5(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:Ur._`${e.schemaPath}${Ur.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:Ur._`${e.schemaPath}${Ur.getProperty(t)}${Ur.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${YS.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')}XS.getSubschema=t5;function r5(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",Ur._`${t.data}${Ur.getProperty(r)}`,!0);l(h),e.errorPath=Ur.str`${c}${YS.getErrorPath(r,n,p.jsPropertySyntax)}`,e.parentDataProperty=Ur._`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){let c=s instanceof Ur.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]}}XS.extendSubschemaData=r5;function n5(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}XS.extendSubschemaMode=n5});var If=C(function(fZ,e1){e1.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 r1=C(function(pZ,t1){var Kn=t1.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(){};Wl(t,n,s,e,"",e)};Kn.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Kn.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Kn.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Kn.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 Wl(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 Kn.arrayKeywords)for(var h=0;h<p.length;h++)Wl(e,t,r,p[h],s+"/"+d+"/"+h,i,s,d,n,h)}else if(d in Kn.propsKeywords){if(p&&typeof p=="object")for(var m in p)Wl(e,t,r,p[m],s+"/"+d+"/"+o5(m),i,s,d,n,m)}else if(d in Kn.keywords||e.allKeys&&!(d in Kn.skipKeywords))Wl(e,t,r,p,s+"/"+d,i,s,d,n)}r(n,s,i,o,a,l,c)}}function o5(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Mo=C(function(o1){Object.defineProperty(o1,"__esModule",{value:!0});o1.getSchemaRefs=o1.resolveUrl=o1.normalizeId=o1._getFullPath=o1.getFullPath=o1.inlineRef=void 0;var a5=we(),l5=If(),c5=r1(),u5=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function d5(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!Mf(e);if(!t)return!1;return n1(e)<=t}o1.inlineRef=d5;var f5=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Mf(e){for(let t in e){if(f5.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Mf))return!0;if(typeof r=="object"&&Mf(r))return!0}return!1}function n1(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,u5.has(r))continue;if(typeof e[r]=="object")a5.eachItem(e[r],(n)=>t+=n1(n));if(t===1/0)return 1/0}return t}function s1(e,t="",r){if(r!==!1)t=vi(t);let n=e.parse(t);return i1(e,n)}o1.getFullPath=s1;function i1(e,t){return e.serialize(t).split("#")[0]+"#"}o1._getFullPath=i1;var p5=/#\/?$/;function vi(e){return e?e.replace(p5,""):""}o1.normalizeId=vi;function m5(e,t,r){return r=vi(r),e.resolve(t,r)}o1.resolveUrl=m5;var h5=/^[a-z_][-a-z0-9._]*$/i;function g5(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=vi(e[r]||t),i={"":s},o=s1(n,s,!1),a={},l=new Set;return c5(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(!h5.test(S))throw Error(`invalid anchor "${S}"`);v.call(this,`#${S}`)}}}),a;function c(p,h,m){if(h!==void 0&&!l5(p,h))throw d(m)}function d(p){return Error(`reference "${p}" resolves to more than one schema`)}}o1.getSchemaRefs=g5});var wi=C(function(w1){Object.defineProperty(w1,"__esModule",{value:!0});w1.getData=w1.KeywordCxt=w1.validateFunctionCode=void 0;var d1=_S(),f1=Io(),Jf=kf(),Ul=Io(),w5=FS(),Jo=KS(),Df=QS(),ne=ye(),me=gr(),S5=Mo(),wn=we(),Do=To();function E5(e){if(h1(e)){if(g1(e),m1(e)){j5(e);return}}p1(e,()=>d1.topBoolOrEmptySchema(e))}w1.validateFunctionCode=E5;function p1({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"; ${l1(r,s)}`),P5(e,s),e.code(i)});else e.func(t,ne._`${me.default.data}, ${_5(s)}`,n.$async,()=>e.code(l1(r,s)).code(i))}function _5(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 P5(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 j5(e){let{schema:t,opts:r,gen:n}=e;p1(e,()=>{if(r.$comment&&t.$comment)b1(e);if(C5(e),n.let(me.default.vErrors,null),n.let(me.default.errors,0),r.unevaluated)k5(e);y1(e),I5(e)});return}function k5(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 l1(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?ne._`/*# sourceURL=${r} */`:ne.nil}function R5(e,t){if(h1(e)){if(g1(e),m1(e)){A5(e,t);return}}d1.boolOrEmptySchema(e,t)}function m1({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 h1(e){return typeof e.schema!="boolean"}function A5(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)b1(e);N5(e),T5(e);let i=n.const("_errs",me.default.errors);y1(e,i),n.var(t,ne._`${i} === ${me.default.errors}`)}function g1(e){wn.checkUnknownRules(e),O5(e)}function y1(e,t){if(e.opts.jtd)return c1(e,[],!1,t);let r=f1.getSchemaTypes(e.schema),n=f1.coerceAndCheckDataType(e,r);c1(e,r,!n,t)}function O5(e){let{schema:t,errSchemaPath:r,opts:n,self:s}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&wn.schemaHasRulesButRef(t,s.RULES))s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function C5(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)wn.checkStrictMode(e,"default is ignored in the schema root")}function N5(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=S5.resolveUrl(e.opts.uriResolver,e.baseId,t)}function T5(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function b1({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 I5(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)M5(e);t.return(ne._`${me.default.errors} === 0`)}}function M5({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 c1(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||!wn.schemaHasRulesButRef(i,d))){s.block(()=>$1(e,"$ref",d.all.$ref.definition));return}if(!l.jtd)J5(e,t);s.block(()=>{for(let h of d.rules)p(h);p(d.post)});function p(h){if(!Jf.shouldUseGroup(i,h))return;if(h.type){if(s.if(Ul.checkDataType(h.type,o,l.strictNumbers)),u1(e,h),t.length===1&&t[0]===h.type&&r)s.else(),Ul.reportTypeError(e);s.endIf()}else u1(e,h);if(!a)s.if(ne._`${me.default.errors} === ${n||0}`)}}function u1(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;if(s)w5.assignDefaults(e,t.type);r.block(()=>{for(let i of t.rules)if(Jf.shouldUseRule(n,i))$1(e,i.keyword,i.definition,t.type)})}function J5(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(D5(e,t),!e.opts.allowUnionTypes)L5(e,t);F5(e,e.dataTypes)}function D5(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!x1(e.dataTypes,r))Lf(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),H5(e,t)}function L5(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))Lf(e,"use allowUnionTypes to allow union type keyword")}function F5(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&Jf.shouldUseRule(e.schema,s)){let{type:i}=s.definition;if(i.length&&!i.some((o)=>q5(t,o)))Lf(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function q5(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function x1(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function H5(e,t){let r=[];for(let n of e.dataTypes)if(x1(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function Lf(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,wn.checkStrictMode(e,t,e.opts.strictTypes)}class Ff{constructor(e,t,r){if(Jo.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=wn.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",v1(this.$data,e));else if(this.schemaCode=this.schemaValue,!Jo.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?Do.reportExtraError:Do.reportError)(this,this.def.error,t)}$dataError(){Do.reportError(this,this.def.$dataError||Do.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Do.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._`${Ul.checkDataTypes(a,t,s.opts.strictNumbers,Ul.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=Df.getSubschema(this.it,e);Df.extendSubschemaData(r,this.it,e),Df.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return R5(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=wn.mergeEvaluated.props(n,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=wn.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}}w1.KeywordCxt=Ff;function $1(e,t,r,n){let s=new Ff(e,r,t);if("code"in r)r.code(s,n);else if(s.$data&&r.validate)Jo.funcKeywordCode(s,r);else if("macro"in r)Jo.macroKeywordCode(s,r);else if(r.compile||r.validate)Jo.funcKeywordCode(s,r)}var V5=/^\/(?:[^~]|~0|~1)*$/,B5=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function v1(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,i;if(e==="")return me.default.rootData;if(e[0]==="/"){if(!V5.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,i=me.default.rootData}else{let c=B5.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(wn.unescapeJsonPointer(c))}`,o=ne._`${o} && ${i}`;return o;function l(c,d){return`Cannot access ${c} ${d} levels up, current level is ${t}`}}w1.getData=v1});var Lo=C(function(_1){Object.defineProperty(_1,"__esModule",{value:!0});class E1 extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}_1.default=E1});var Si=C(function(j1){Object.defineProperty(j1,"__esModule",{value:!0});var qf=Mo();class P1 extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=qf.resolveUrl(e,t,r),this.missingSchema=qf.normalizeId(qf.getFullPath(e,this.missingRef))}}j1.default=P1});var qo=C(function(A1){Object.defineProperty(A1,"__esModule",{value:!0});A1.resolveSchema=A1.getCompilingSchema=A1.resolveRef=A1.compileSchema=A1.SchemaEnv=void 0;var jr=ye(),K5=Lo(),ks=gr(),kr=Mo(),k1=we(),Y5=wi();class Fo{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={}}}A1.SchemaEnv=Fo;function Vf(e){let t=R1.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:K5.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),Y5.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)}}A1.compileSchema=Vf;function X5(e,t,r){var n;r=kr.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let i=e3.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 Fo({schema:o,schemaId:a,root:e,baseId:t})}if(i===void 0)return;return e.refs[r]=Z5.call(this,i)}A1.resolveRef=X5;function Z5(e){if(kr.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:Vf.call(this,e)}function R1(e){for(let t of this._compilations)if(Q5(t,e))return t}A1.getCompilingSchema=R1;function Q5(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function e3(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||zl.call(this,e,t)}function zl(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 Hf.call(this,r,e);let i=kr.normalizeId(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=zl.call(this,e,o);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return Hf.call(this,r,a)}if(typeof(o===null||o===void 0?void 0:o.schema)!=="object")return;if(!o.validate)Vf.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 Fo({schema:a,schemaId:l,root:e,baseId:s})}return Hf.call(this,r,o)}A1.resolveSchema=zl;var t3=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Hf(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[k1.unescapeFragment(a)];if(l===void 0)return;r=l;let c=typeof r==="object"&&r[this.opts.schemaId];if(!t3.has(a)&&c)t=kr.resolveUrl(this.opts.uriResolver,t,c)}let i;if(typeof r!="boolean"&&r.$ref&&!k1.schemaHasRulesButRef(r,this.RULES)){let a=kr.resolveUrl(this.opts.uriResolver,t,r.$ref);i=zl.call(this,n,a)}let{schemaId:o}=this.opts;if(i=i||new Fo({schema:r,schemaId:o,root:n,baseId:t}),i.schema!==i.root.schema)return i;return}});var C1=C(function(xZ,o3){o3.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 Kf=C(function($Z,F1){var a3=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Wf=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),l3=RegExp.prototype.test.bind(/^\d*$/u),Rs=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Uf=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),T1=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),zf=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),c3=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 u3(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 d3=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),f3=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),p3=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),m3=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function h3(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++){if(p3(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 N1(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 g3(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||!Wf(l))return;i+=2;continue}if(!d3(l))return;s[a]=parseInt(l,16).toString(16),i++}if(t===-1){if(i!==8)return;return N1(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 N1(o)}function Bf(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&&f3(n))return n=n.toLowerCase(),{host:`[${n}]`,escapedHost:n,isIPV6:!1,isIPVFuture:!0};if(y3(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),!h3(s))return{host:e,isIPV6:!1,error:!0};n=n.slice(0,i)}let o=g3(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 y3(e,t){let r=0;for(let n=0;n<e.length;n++)if(e[n]===t)r++;return r}function I1(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 b3(e){if(e===""||e[0]==="/")return I1(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 x3={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},$3=/[@/?#:]/g,v3=/[@/?#]/g;function M1(e,t){let r=t?v3:$3;return r.lastIndex=0,e.replace(r,(n)=>x3[n])}function J1(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&&Uf(o))r+=o;else r+="%"+i;n+=2;continue}}r+=e[n]}return r}function w3(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!=="."&&Uf(o))t+=o;else t+="%"+i;r+=2;continue}}if(T1(n))t+=n;else{let s=e.charCodeAt(r);if(s<128)t+=L1(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 S3(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(T1(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 Gf(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 D1(e){return Gf(e,c3)}function E3(e){return Gf(e,zf)}function _3(e){return Gf(e,zf)}function L1(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 P3(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(Uf(o))t+=o;else t+="%"+i;r+=2;continue}}if(zf(n))t+=n;else{let s=e.charCodeAt(r);if(s<128)t+=L1(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 j3(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 k3(e){let t=[];if(e.userinfo!==void 0)t.push(D1(e.userinfo)),t.push("@");if(e.host!==void 0){let r=e.host;if(!Wf(r)){let n=Bf(r);if(n.isIPV6!==!0&&n.isIPVFuture!==!0)r=J1(r,!0),n=Bf(r);if(n.isIPV6===!0||n.isIPVFuture===!0)r=`[${n.escapedHost}]`;else r=M1(r,!1)}t.push(r)}if(typeof e.port==="number"||typeof e.port==="string"){let r=String(e.port);if(!l3(r))throw TypeError("URI port is malformed.");t.push(":"),t.push(r)}return t.length?t.join(""):void 0}F1.exports={nonSimpleDomain:m3,recomposeAuthority:k3,reescapeHostDelimiters:M1,normalizePercentEncoding:J1,normalizePathEncoding:w3,serializePathEncoding:S3,normalizeQueryFragmentEncoding:P3,encodeUserinfo:D1,encodeQuery:E3,encodeFragment:_3,escapePreservingEscapes:j3,removeDotSegments:I1,removeDotSegmentsRelative:b3,isIPv4:Wf,isUUID:a3,normalizeIPv6:Bf,stringArrayToHexStripped:u3}});var W1=C(function(vZ,B1){var{isUUID:R3}=Kf(),A3=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,O3=["http","https","ws","wss","urn","urn:uuid"];function C3(e){return O3.indexOf(e)!==-1}function Yf(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 q1(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function H1(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 N3(e){return e.secure=Yf(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function T3(e){if(e.port===(Yf(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 I3(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(A3);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=Xf(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 M3(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=Xf(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 J3(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!R3(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function D3(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var V1={scheme:"http",domainHost:!0,parse:q1,serialize:H1},L3={scheme:"https",domainHost:V1.domainHost,parse:q1,serialize:H1},Gl={scheme:"ws",domainHost:!0,parse:N3,serialize:T3},F3={scheme:"wss",domainHost:Gl.domainHost,parse:Gl.parse,serialize:Gl.serialize},q3={scheme:"urn",parse:I3,serialize:M3,skipNormalize:!0},H3={scheme:"urn:uuid",parse:J3,serialize:D3,skipNormalize:!0},Kl={http:V1,https:L3,ws:Gl,wss:F3,urn:q3,"urn:uuid":H3};Object.setPrototypeOf(Kl,null);function Xf(e){return e&&(Kl[e]||Kl[e.toLowerCase()])||void 0}B1.exports={wsIsSecure:Yf,SCHEMES:Kl,isValidSchemeName:C3,getSchemeHandler:Xf}});var iE=C(function(wZ,Ql){var{normalizeIPv6:Y1,removeDotSegments:Vo,removeDotSegmentsRelative:X1,recomposeAuthority:V3,normalizePercentEncoding:Zf,normalizePathEncoding:B3,serializePathEncoding:U1,normalizeQueryFragmentEncoding:z1,encodeQuery:W3,encodeFragment:U3,reescapeHostDelimiters:z3,isIPv4:Z1,nonSimpleDomain:G3}=Kf(),{SCHEMES:Q1,getSchemeHandler:Qf}=W1(),eE=/^[A-Za-z][A-Za-z0-9+.-]*$/u,K3=/[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;function G1(e){let t=String(e);if(!eE.test(t))throw TypeError("URI scheme is malformed.");return t}function Y3(e,t){if(typeof e==="string")e=iH(e,t);else if(typeof e==="object")e=Xl(As(e,t),t);return e}function X3(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}=Yl(e,n),{parsed:d,malformedAuthorityOrPort:p,malformedPercentEncoding:h,malformedSchemeSpecific:m,malformedHost:b,malformedScheme:g}=Yl(t,n);if(i||p||o||h||a||m||l||b||c||g)throw Error(s.error||d.error||"URI is malformed.");let y=tE(s,d,n,!0),v=Qf(r&&r.scheme||y.scheme),j=y.host,S=j!==void 0&&j!==""&&(Z1(j)||Y1(j).isIPV6);if(nE(y,r||{},v,S))throw Error("URI host is malformed.");rE(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 tE(e,t,r,n){let s={};if(!n)e=Xl(As(e,r),r),t=Xl(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=Vo(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=Vo(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=Vo(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]!=="/"?X1(s.path):Vo(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 Z3(e,t,r){let n=K1(e,r),s=K1(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=G1(r.scheme);let i=Qf(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=U1(r.path,l);else r.path=Zf(r.path);if(n.reference!=="suffix"&&r.scheme)r.scheme=G1(r.scheme),s.push(r.scheme,":");let c=V3(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]!=="/"?X1(d):Vo(d);if(a)d=U1(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("?",W3(r.query));if(r.fragment!==void 0)s.push("#",U3(r.fragment));return s.join("")}var Q3=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,eH=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,tH=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function rH(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 Ho(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 Zl(e){return e[0]==="["&&e[e.length-1]==="]"}function nH(e){let t=e[4];return Ho(e[3])||t!==void 0&&!Zl(t)&&Ho(t)||Ho(e[6])||Ho(e[7])||Ho(e[8])}function rE(e,t,r,n){if(nE(e,t,r,n))return e.error=e.error||"URI host is malformed.",!0;if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&!Zl(e.host)&&(t.domainHost||r&&r.domainHost)&&n===!1&&G3(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(!sH(s))return e.error=e.error||"URI host is malformed.",!0;e.host=s.hostname}return!1}function nE(e,t,r,n){return Boolean(e.host&&n===!1&&!Zl(e.host)&&(t.domainHost||r&&r.domainHost)&&K3.test(e.host))}function sH(e){return e.username===""&&e.password===""&&e.port===""&&e.pathname==="/"&&e.search===""&&e.hash===""&&e.hostname!==""}function Yl(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(eH);if(p!==null&&p[1].indexOf("\\")!==-1)n.error="URI authority must not contain a literal backslash.",s=!0;let h=e.match(tH);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(Q3);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(eE.test(n.scheme))n.scheme=n.scheme.toLowerCase();else n.error=n.error||"URI scheme is malformed.",c=!0;if(i=nH(m),i)n.error=n.error||"URI contains malformed percent-encoding.";if(isNaN(n.port))n.port=m[5];let b=rH(n,m);if(b!==void 0)n.error=n.error||b,s=!0;if(n.host)if(Z1(n.host)===!1){let v=Zl(n.host),j=n.host.indexOf("[")!==-1||n.host.indexOf("]")!==-1,S=Y1(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=Qf(r.scheme||n.scheme);if(!l)a=rE(n,r,g,d);if(e.indexOf("%")!==-1&&n.host!==void 0&&!l){let y=d?n.host:Zf(n.host,!0);if(!d)y=Zf(y.toLowerCase());n.host=d||r.scheme!=="null"?z3(y,d):y}if(!g||g&&!g.skipNormalize){if(n.path)n.path=B3(n.path);if(n.query)n.query=z1(n.query);if(n.fragment)n.fragment=z1(n.fragment)}if(g&&g.parse){if(g.parse(n,r),g===Q1.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 Xl(e,t){return Yl(e,t).parsed}function iH(e,t){return sE(e,t).normalized}function sE(e,t){let{parsed:r,malformedAuthorityOrPort:n,malformedPercentEncoding:s,malformedSchemeSpecific:i,malformedHost:o,malformedScheme:a}=Yl(e,t);return{normalized:n||s||i||o||a?e:As(r,t),malformedAuthorityOrPort:n,malformedPercentEncoding:s,malformedSchemeSpecific:i,malformedHost:o,malformedScheme:a}}function K1(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}=sE(r,t);return s||i||o||a||l?void 0:n}var ep={SCHEMES:Q1,normalize:Y3,resolve:X3,resolveComponent:tE,equal:Z3,serialize:As,parse:Xl};Ql.exports=ep;Ql.exports.default=ep;Ql.exports.fastUri=ep});var lE=C(function(aE){Object.defineProperty(aE,"__esModule",{value:!0});var oE=iE();oE.code='require("ajv/dist/runtime/uri").default';aE.default=oE});var np=C(function(Sn){Object.defineProperty(Sn,"__esModule",{value:!0});Sn.CodeGen=Sn.Name=Sn.nil=Sn.stringify=Sn.str=Sn._=Sn.KeywordCxt=void 0;var aH=wi();Object.defineProperty(Sn,"KeywordCxt",{enumerable:!0,get:function(){return aH.KeywordCxt}});var Ei=ye();Object.defineProperty(Sn,"_",{enumerable:!0,get:function(){return Ei._}});Object.defineProperty(Sn,"str",{enumerable:!0,get:function(){return Ei.str}});Object.defineProperty(Sn,"stringify",{enumerable:!0,get:function(){return Ei.stringify}});Object.defineProperty(Sn,"nil",{enumerable:!0,get:function(){return Ei.nil}});Object.defineProperty(Sn,"Name",{enumerable:!0,get:function(){return Ei.Name}});Object.defineProperty(Sn,"CodeGen",{enumerable:!0,get:function(){return Ei.CodeGen}});var lH=Lo(),pE=Si(),cH=jf(),Wo=qo(),uH=ye(),Bo=Mo(),ec=Io(),rp=we(),cE=C1(),dH=lE(),mE=(e,t)=>new RegExp(e,t);mE.code="new RegExp";var fH=["removeAdditional","useDefaults","coerceTypes"],pH=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),mH={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."},hH={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},uE=200;function gH(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,W=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:mE,se=(s=e.uriResolver)!==null&&s!==void 0?s:dH.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:W}:{optimize:L,regExp:W},loopRequired:(g=e.loopRequired)!==null&&g!==void 0?g:uE,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:uE,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 tc{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,...gH(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new uH.ValueScope({scope:{},prefixes:pH,es5:t,lines:r}),this.logger=wH(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=cH.getRules(),dE.call(this,mH,e,"NOT SUPPORTED"),dE.call(this,hH,e,"DEPRECATED","warn"),this._metaOpts=$H.call(this),e.formats)bH.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)xH.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);yH.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=cE;if(r==="id")n={...cE},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 pE.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=Bo.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=fE.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new Wo.SchemaEnv({schema:{},schemaId:r});if(t=Wo.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=fE.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=Bo.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(EH.call(this,r,t),!t)return rp.eachItem(r,(s)=>tp.call(this,s)),this;PH.call(this,t);let n={...t,type:ec.getJSONTypes(t.type),schemaType:ec.getJSONTypes(t.schemaType)};return rp.eachItem(r,n.type.length===0?(s)=>tp.call(this,s,n):(s)=>n.type.forEach((i)=>tp.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]=hE(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=Bo.normalizeId(i||r);let l=Bo.getSchemaRefs.call(this,e,r);if(a=new Wo.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 Wo.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{Wo.compileSchema.call(this,e)}finally{this.opts=t}}}tc.ValidationError=lH.default;tc.MissingRefError=pE.default;Sn.default=tc;function dE(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 fE(e){return e=Bo.normalizeId(e),this.schemas[e]||this.refs[e]}function yH(){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 bH(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function xH(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 $H(){let e={...this.opts};for(let t of fH)delete e[t];return e}var vH={log(){},warn(){},error(){}};function wH(e){if(e===!1)return vH;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 SH=/^[a-z_$][a-z0-9_$:-]*$/i;function EH(e,t){let{RULES:r}=this;if(rp.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!SH.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 tp(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:ec.getJSONTypes(t.type),schemaType:ec.getJSONTypes(t.schemaType)}};if(t.before)_H.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 _H(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 PH(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=hE(t);e.validateSchema=this.compile(t,!0)}var jH={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function hE(e){return{anyOf:[e,jH]}}});var yE=C(function(gE){Object.defineProperty(gE,"__esModule",{value:!0});var AH={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};gE.default=AH});var sc=C(function(vE){Object.defineProperty(vE,"__esModule",{value:!0});vE.callRef=vE.getValidate=void 0;var CH=Si(),bE=yr(),Kt=ye(),_i=gr(),xE=qo(),rc=we(),NH={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=xE.resolveRef.call(l,c,s,r);if(d===void 0)throw new CH.default(n.opts.uriResolver,s,r);if(d instanceof xE.SchemaEnv)return h(d);return m(d);function p(){if(i===c)return nc(e,o,i,i.$async);let b=t.scopeValue("root",{ref:c});return nc(e,Kt._`${b}.validate`,c,c.$async)}function h(b){let g=$E(e,b);nc(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 $E(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):Kt._`${r.scopeValue("wrapper",{ref:t})}.validate`}vE.getValidate=$E;function nc(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 ${bE.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(bE.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=rc.mergeEvaluated.props(s,y.props,i.props)}else{let v=s.var("props",Kt._`${b}.evaluated.props`);i.props=rc.mergeEvaluated.props(s,v,i.props,Kt.Name)}if(i.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)i.items=rc.mergeEvaluated.items(s,y.items,i.items)}else{let v=s.var("items",Kt._`${b}.evaluated.items`);i.items=rc.mergeEvaluated.items(s,v,i.items,Kt.Name)}}}vE.callRef=nc;vE.default=NH});var sp=C(function(SE){Object.defineProperty(SE,"__esModule",{value:!0});var MH=yE(),JH=sc(),DH=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",MH.default,JH.default];SE.default=DH});var _E=C(function(EE){Object.defineProperty(EE,"__esModule",{value:!0});var oc=ye(),Yn=oc.operators,ic={maximum:{okStr:"<=",ok:Yn.LTE,fail:Yn.GT},minimum:{okStr:">=",ok:Yn.GTE,fail:Yn.LT},exclusiveMaximum:{okStr:"<",ok:Yn.LT,fail:Yn.GTE},exclusiveMinimum:{okStr:">",ok:Yn.GT,fail:Yn.LTE}},FH={message:({keyword:e,schemaCode:t})=>oc.str`must be ${ic[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>oc._`{comparison: ${ic[e].okStr}, limit: ${t}}`},qH={keyword:Object.keys(ic),type:"number",schemaType:"number",$data:!0,error:FH,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(oc._`${r} ${ic[t].fail} ${n} || isNaN(${r})`)}};EE.default=qH});var jE=C(function(PE){Object.defineProperty(PE,"__esModule",{value:!0});var Uo=ye(),VH={message:({schemaCode:e})=>Uo.str`must be multiple of ${e}`,params:({schemaCode:e})=>Uo._`{multipleOf: ${e}}`},BH={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:VH,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,i=s.opts.multipleOfPrecision,o=t.let("res"),a=i?Uo._`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:Uo._`${o} !== parseInt(${o})`;e.fail$data(Uo._`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};PE.default=BH});var AE=C(function(RE){Object.defineProperty(RE,"__esModule",{value:!0});function kE(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}RE.default=kE;kE.code='require("ajv/dist/runtime/ucs2length").default'});var CE=C(function(OE){Object.defineProperty(OE,"__esModule",{value:!0});var Os=ye(),zH=we(),GH=AE(),KH={message({keyword:e,schemaCode:t}){return Os.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>Os._`{limit: ${e}}`},YH={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:KH,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._`${zH.useFunc(e.gen,GH.default)}(${r})`;e.fail$data(Os._`${o} ${i} ${n}`)}};OE.default=YH});var TE=C(function(NE){Object.defineProperty(NE,"__esModule",{value:!0});var ZH=yr(),QH=we(),Pi=ye(),eV={message:({schemaCode:e})=>Pi.str`must match pattern "${e}"`,params:({schemaCode:e})=>Pi._`{pattern: ${e}}`},tV={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:eV,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`:QH.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=ZH.usePattern(e,s);e.fail$data(Pi._`!${l}.test(${r})`)}}};NE.default=tV});var ME=C(function(IE){Object.defineProperty(IE,"__esModule",{value:!0});var zo=ye(),nV={message({keyword:e,schemaCode:t}){return zo.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>zo._`{limit: ${e}}`},sV={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:nV,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?zo.operators.GT:zo.operators.LT;e.fail$data(zo._`Object.keys(${r}).length ${s} ${n}`)}};IE.default=sV});var DE=C(function(JE){Object.defineProperty(JE,"__esModule",{value:!0});var Ko=yr(),Go=ye(),oV=we(),aV={message:({params:{missingProperty:e}})=>Go.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Go._`{missingProperty: ${e}}`},lV={keyword:"required",type:"object",schemaType:"array",$data:!0,error:aV,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)`;oV.checkStrictMode(o,v,o.opts.strictRequired)}}function c(){if(l||i)e.block$data(Go.nil,p);else for(let m of r)Ko.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(Ko.checkMissingProp(e,r,m)),Ko.reportMissingProp(e,m),t.else()}function p(){t.forOf("prop",n,(m)=>{e.setParams({missingProperty:m}),t.if(Ko.noPropertyInData(t,s,m,a.ownProperties),()=>e.error())})}function h(m,b){e.setParams({missingProperty:m}),t.forOf(m,n,()=>{t.assign(b,Ko.propertyInData(t,s,m,a.ownProperties)),t.if(Go.not(b),()=>{e.error(),t.break()})},Go.nil)}}};JE.default=lV});var FE=C(function(LE){Object.defineProperty(LE,"__esModule",{value:!0});var Yo=ye(),uV={message({keyword:e,schemaCode:t}){return Yo.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>Yo._`{limit: ${e}}`},dV={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:uV,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?Yo.operators.GT:Yo.operators.LT;e.fail$data(Yo._`${r}.length ${s} ${n}`)}};LE.default=dV});var ac=C(function(HE){Object.defineProperty(HE,"__esModule",{value:!0});var qE=If();qE.code='require("ajv/dist/runtime/equal").default';HE.default=qE});var BE=C(function(VE){Object.defineProperty(VE,"__esModule",{value:!0});var ip=Io(),yt=ye(),mV=we(),hV=ac(),gV={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}}`},yV={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:gV,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?ip.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=ip.checkDataTypes(c,y,a.opts.strictNumbers,ip.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=mV.useFunc(t,hV.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)})))}}};VE.default=yV});var UE=C(function(WE){Object.defineProperty(WE,"__esModule",{value:!0});var op=ye(),xV=we(),$V=ac(),vV={message:"must be equal to constant",params:({schemaCode:e})=>op._`{allowedValue: ${e}}`},wV={keyword:"const",$data:!0,error:vV,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:i}=e;if(n||i&&typeof i=="object")e.fail$data(op._`!${xV.useFunc(t,$V.default)}(${r}, ${s})`);else e.fail(op._`${i} !== ${r}`)}};WE.default=wV});var GE=C(function(zE){Object.defineProperty(zE,"__esModule",{value:!0});var Xo=ye(),EV=we(),_V=ac(),PV={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>Xo._`{allowedValues: ${e}}`},jV={keyword:"enum",schemaType:"array",$data:!0,error:PV,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=EV.useFunc(t,_V.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=Xo.or(...s.map((b,g)=>h(m,g)))}e.pass(d);function p(){t.assign(d,!1),t.forOf("v",i,(m)=>t.if(Xo._`${c()}(${r}, ${m})`,()=>t.assign(d,!0).break()))}function h(m,b){let g=s[b];return typeof g==="object"&&g!==null?Xo._`${c()}(${r}, ${m}[${b}])`:Xo._`${r} === ${g}`}}};zE.default=jV});var ap=C(function(KE){Object.defineProperty(KE,"__esModule",{value:!0});var RV=_E(),AV=jE(),OV=CE(),CV=TE(),NV=ME(),TV=DE(),IV=FE(),MV=BE(),JV=UE(),DV=GE(),LV=[RV.default,AV.default,OV.default,CV.default,NV.default,TV.default,IV.default,MV.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},JV.default,DV.default];KE.default=LV});var cp=C(function(XE){Object.defineProperty(XE,"__esModule",{value:!0});XE.validateAdditionalItems=void 0;var Cs=ye(),lp=we(),qV={message:({params:{len:e}})=>Cs.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Cs._`{limit: ${e}}`},HV={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:qV,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){lp.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}YE(e,n)}};function YE(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"&&!lp.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:lp.Type.Num},c),!o.allErrors)r.if(Cs.not(c),()=>r.break())})}}XE.validateAdditionalItems=YE;XE.default=HV});var up=C(function(t_){Object.defineProperty(t_,"__esModule",{value:!0});t_.validateTuple=void 0;var QE=ye(),lc=we(),BV=yr(),WV={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return e_(e,"additionalItems",t);if(r.items=!0,lc.alwaysValidSchema(r,t))return;e.ok(BV.validateArray(e))}};function e_(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=lc.mergeEvaluated.items(n,r.length,a.items);let l=n.name("valid"),c=n.const("len",QE._`${i}.length`);r.forEach((p,h)=>{if(lc.alwaysValidSchema(a,p))return;n.if(QE._`${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}"`;lc.checkStrictMode(a,y,h.strictTuples)}}}t_.validateTuple=e_;t_.default=WV});var s_=C(function(n_){Object.defineProperty(n_,"__esModule",{value:!0});var zV=up(),GV={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>zV.validateTuple(e,"items")};n_.default=GV});var a_=C(function(o_){Object.defineProperty(o_,"__esModule",{value:!0});var i_=ye(),YV=we(),XV=yr(),ZV=cp(),QV={message:({params:{len:e}})=>i_.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>i_._`{limit: ${e}}`},e4={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:QV,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,YV.alwaysValidSchema(n,t))return;if(s)ZV.validateAdditionalItems(e,s);else e.ok(XV.validateArray(e))}};o_.default=e4});var c_=C(function(l_){Object.defineProperty(l_,"__esModule",{value:!0});var br=ye(),cc=we(),r4={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}}`},n4={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:r4,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){cc.checkStrictMode(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){cc.checkStrictMode(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(cc.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:cc.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))}}};l_.default=n4});var uc=C(function(f_){Object.defineProperty(f_,"__esModule",{value:!0});f_.validateSchemaDeps=f_.validatePropertyDeps=f_.error=void 0;var dp=ye(),i4=we(),Zo=yr();f_.error={message:({params:{property:e,depsCount:t,deps:r}})=>dp.str`must have ${t===1?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>dp._`{property: ${e},
608
567
  missingProperty: ${n},
609
568
  depsCount: ${t},
610
- deps: ${r}}`};var I8={keyword:"dependencies",type:"object",schemaType:"object",error:Cj.error,code(e){let[t,r]=T8(e);Rj(e,t),Oj(e,r)}};function T8({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let i=Array.isArray(e[n])?t:r;i[n]=e[n]}return[t,r]}function Rj(e,t=e.schema){let{gen:r,data:n,it:i}=e;if(Object.keys(t).length===0)return;let s=r.let("missing");for(let o in t){let a=t[o];if(a.length===0)continue;let c=pc.propertyInData(r,n,o,i.opts.ownProperties);if(e.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),i.allErrors)r.if(c,()=>{for(let l of a)pc.checkReportMissingProp(e,l)});else r.if(qh._`${c} && (${pc.checkMissingProp(e,a,s)})`),pc.reportMissingProp(e,s),r.else()}}Cj.validatePropertyDeps=Rj;function Oj(e,t=e.schema){let{gen:r,data:n,keyword:i,it:s}=e,o=r.name("valid");for(let a in t){if(C8.alwaysValidSchema(s,t[a]))continue;r.if(pc.propertyInData(r,n,a,s.opts.ownProperties),()=>{let c=e.subschema({keyword:i,schemaProp:a},o);e.mergeValidEvaluated(c,o)},()=>r.var(o,!0)),e.ok(o)}}Cj.validateSchemaDeps=Oj;Cj.default=I8});var Lj=C(function(Mj){Object.defineProperty(Mj,"__esModule",{value:!0});var Nj=be(),L8=_e(),D8={message:"property name must be valid",params:({params:e})=>Nj._`{propertyName: ${e.propertyName}}`},J8={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:D8,code(e){let{gen:t,schema:r,data:n,it:i}=e;if(L8.alwaysValidSchema(i,r))return;let s=t.name("valid");t.forIn("key",n,(o)=>{e.setParams({propertyName:o}),e.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),t.if(Nj.not(s),()=>{if(e.error(!0),!i.allErrors)t.break()})}),e.ok(s)}};Mj.default=J8});var Bh=C(function(Dj){Object.defineProperty(Dj,"__esModule",{value:!0});var Uu=qr(),an=be(),q8=Fr(),Vu=_e(),B8={message:"must NOT have additional properties",params:({params:e})=>an._`{additionalProperty: ${e.additionalProperty}}`},H8={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:B8,code(e){let{gen:t,schema:r,parentSchema:n,data:i,errsCount:s,it:o}=e;if(!s)throw Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&Vu.alwaysValidSchema(o,r))return;let l=Uu.allSchemaProperties(n.properties),u=Uu.allSchemaProperties(n.patternProperties);d(),e.ok(an._`${s} === ${q8.default.errors}`);function d(){t.forIn("key",i,(b)=>{if(!l.length&&!u.length)y(b);else t.if(h(b),()=>y(b))})}function h(b){let x;if(l.length>8){let _=Vu.schemaRefOrVal(o,n.properties,"properties");x=Uu.isOwnProperty(t,_,b)}else if(l.length)x=an.or(...l.map((_)=>an._`${b} === ${_}`));else x=an.nil;if(u.length)x=an.or(x,...u.map((_)=>an._`${Uu.usePattern(e,_)}.test(${b})`));return an.not(x)}function m(b){t.code(an._`delete ${i}[${b}]`)}function y(b){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){m(b);return}if(r===!1){if(e.setParams({additionalProperty:b}),e.error(),!a)t.break();return}if(typeof r=="object"&&!Vu.alwaysValidSchema(o,r)){let x=t.name("valid");if(c.removeAdditional==="failing")g(b,x,!1),t.if(an.not(x),()=>{e.reset(),m(b)});else if(g(b,x),!a)t.if(an.not(x),()=>t.break())}}function g(b,x,_){let P={keyword:"additionalProperties",dataProp:b,dataPropType:Vu.Type.Str};if(_===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(P,x)}}};Dj.default=H8});var Bj=C(function(qj){Object.defineProperty(qj,"__esModule",{value:!0});var V8=Eo(),Fj=qr(),Hh=_e(),Jj=Bh(),W8={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:i,it:s}=e;if(s.opts.removeAdditional==="all"&&n.additionalProperties===void 0)Jj.default.code(new V8.KeywordCxt(s,Jj.default,"additionalProperties"));let o=Fj.allSchemaProperties(r);for(let d of o)s.definedProperties.add(d);if(s.opts.unevaluated&&o.length&&s.props!==!0)s.props=Hh.mergeEvaluated.props(t,Hh.toHash(o),s.props);let a=o.filter((d)=>!Hh.alwaysValidSchema(s,r[d]));if(a.length===0)return;let c=t.name("valid");for(let d of a){if(l(d))u(d);else{if(t.if(Fj.propertyInData(t,i,d,s.opts.ownProperties)),u(d),!s.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(d),e.ok(c)}function l(d){return s.opts.useDefaults&&!s.compositeRule&&r[d].default!==void 0}function u(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};qj.default=W8});var zj=C(function(Wj){Object.defineProperty(Wj,"__esModule",{value:!0});var Hj=qr(),Wu=be(),Uj=_e(),Vj=_e(),K8={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:i,it:s}=e,{opts:o}=s,a=Hj.allSchemaProperties(r),c=a.filter((g)=>Uj.alwaysValidSchema(s,r[g]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&i.properties,u=t.name("valid");if(s.props!==!0&&!(s.props instanceof Wu.Name))s.props=Vj.evaluatedPropsToName(t,s.props);let{props:d}=s;h();function h(){for(let g of a){if(l)m(g);if(s.allErrors)y(g);else t.var(u,!0),y(g),t.if(u)}}function m(g){for(let b in l)if(new RegExp(g).test(b))Uj.checkStrictMode(s,`property ${b} matches pattern ${g} (use allowMatchingProperties)`)}function y(g){t.forIn("key",n,(b)=>{t.if(Wu._`${Hj.usePattern(e,g)}.test(${b})`,()=>{let x=c.includes(g);if(!x)e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:b,dataPropType:Vj.Type.Str},u);if(s.opts.unevaluated&&d!==!0)t.assign(Wu._`${d}[${b}]`,!0);else if(!x&&!s.allErrors)t.if(Wu.not(u),()=>t.break())})})}}};Wj.default=K8});var Gj=C(function(Kj){Object.defineProperty(Kj,"__esModule",{value:!0});var Y8=_e(),X8={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(Y8.alwaysValidSchema(n,r)){e.fail();return}let i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Kj.default=X8});var Xj=C(function(Yj){Object.defineProperty(Yj,"__esModule",{value:!0});var Z8=qr(),eK={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Z8.validateUnion,error:{message:"must match a schema in anyOf"}};Yj.default=eK});var Zj=C(function(Qj){Object.defineProperty(Qj,"__esModule",{value:!0});var zu=be(),rK=_e(),nK={message:"must match exactly one schema in oneOf",params:({params:e})=>zu._`{passingSchemas: ${e.passing}}`},iK={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:nK,code(e){let{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,o=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(l),e.result(o,()=>e.reset(),()=>e.error(!0));function l(){s.forEach((u,d)=>{let h;if(rK.alwaysValidSchema(i,u))t.var(c,!0);else h=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c);if(d>0)t.if(zu._`${c} && ${o}`).assign(o,!1).assign(a,zu._`[${a}, ${d}]`).else();t.if(c,()=>{if(t.assign(o,!0),t.assign(a,d),h)e.mergeEvaluated(h,zu.Name)})})}}};Qj.default=iK});var tR=C(function(eR){Object.defineProperty(eR,"__esModule",{value:!0});var oK=_e(),aK={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let i=t.name("valid");r.forEach((s,o)=>{if(oK.alwaysValidSchema(n,s))return;let a=e.subschema({keyword:"allOf",schemaProp:o},i);e.ok(i),e.mergeEvaluated(a)})}};eR.default=aK});var sR=C(function(iR){Object.defineProperty(iR,"__esModule",{value:!0});var Ku=be(),nR=_e(),lK={message:({params:e})=>Ku.str`must match "${e.ifClause}" schema`,params:({params:e})=>Ku._`{failingKeyword: ${e.ifClause}}`},uK={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:lK,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)nR.checkStrictMode(n,'"if" without "then" and "else" is ignored');let i=rR(n,"then"),s=rR(n,"else");if(!i&&!s)return;let o=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),i&&s){let u=t.let("ifClause");e.setParams({ifClause:u}),t.if(a,l("then",u),l("else",u))}else if(i)t.if(a,l("then"));else t.if(Ku.not(a),l("else"));e.pass(o,()=>e.error(!0));function c(){let u=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(u)}function l(u,d){return()=>{let h=e.subschema({keyword:u},a);if(t.assign(o,a),e.mergeValidEvaluated(h,o),d)t.assign(d,Ku._`${u}`);else e.setParams({ifClause:u})}}}};function rR(e,t){let r=e.schema[t];return r!==void 0&&!nR.alwaysValidSchema(e,r)}iR.default=uK});var aR=C(function(oR){Object.defineProperty(oR,"__esModule",{value:!0});var dK=_e(),pK={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)dK.checkStrictMode(r,`"${e}" without "if" is ignored`)}};oR.default=pK});var Uh=C(function(cR){Object.defineProperty(cR,"__esModule",{value:!0});var hK=Jh(),gK=Ej(),yK=Fh(),bK=kj(),xK=jj(),$K=Hu(),vK=Lj(),wK=Bh(),SK=Bj(),EK=zj(),_K=Gj(),PK=Xj(),kK=Zj(),AK=tR(),jK=sR(),RK=aR();function OK(e=!1){let t=[_K.default,PK.default,kK.default,AK.default,jK.default,RK.default,vK.default,wK.default,$K.default,SK.default,EK.default];if(e)t.push(gK.default,bK.default);else t.push(hK.default,yK.default);return t.push(xK.default),t}cR.default=OK});var Wh=C(function(fR){Object.defineProperty(fR,"__esModule",{value:!0});fR.dynamicAnchor=void 0;var Vh=be(),IK=Fr(),lR=rc(),TK=Lu(),NK={keyword:"$dynamicAnchor",schemaType:"string",code:(e)=>uR(e,e.schema)};function uR(e,t){let{gen:r,it:n}=e;n.schemaEnv.root.dynamicAnchors[t]=!0;let i=Vh._`${IK.default.dynamicAnchors}${Vh.getProperty(t)}`,s=n.errSchemaPath==="#"?n.validateName:MK(e);r.if(Vh._`!${i}`,()=>r.assign(i,s))}fR.dynamicAnchor=uR;function MK(e){let{schemaEnv:t,schema:r,self:n}=e.it,{root:i,baseId:s,localRefs:o,meta:a}=t.root,{schemaId:c}=n.opts,l=new lR.SchemaEnv({schema:r,schemaId:c,root:i,baseId:s,localRefs:o,meta:a});return lR.compileSchema.call(n,l),TK.getValidate(e,l)}fR.default=NK});var zh=C(function(gR){Object.defineProperty(gR,"__esModule",{value:!0});gR.dynamicRef=void 0;var mR=be(),DK=Fr(),pR=Lu(),JK={keyword:"$dynamicRef",schemaType:"string",code:(e)=>hR(e,e.schema)};function hR(e,t){let{gen:r,keyword:n,it:i}=e;if(t[0]!=="#")throw Error(`"${n}" only supports hash fragment reference`);let s=t.slice(1);if(i.allErrors)o();else{let c=r.let("valid",!1);o(c),e.ok(c)}function o(c){if(i.schemaEnv.root.dynamicAnchors[s]){let l=r.let("_v",mR._`${DK.default.dynamicAnchors}${mR.getProperty(s)}`);r.if(l,a(l,c),a(i.validateName,c))}else a(i.validateName,c)()}function a(c,l){return l?()=>r.block(()=>{pR.callRef(e,c),r.let(l,!0)}):()=>pR.callRef(e,c)}}gR.dynamicRef=hR;gR.default=JK});var xR=C(function(bR){Object.defineProperty(bR,"__esModule",{value:!0});var qK=Wh(),BK=_e(),HK={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){if(e.schema)qK.dynamicAnchor(e,"");else BK.checkStrictMode(e.it,"$recursiveAnchor: false is ignored")}};bR.default=HK});var vR=C(function($R){Object.defineProperty($R,"__esModule",{value:!0});var VK=zh(),WK={keyword:"$recursiveRef",schemaType:"string",code:(e)=>VK.dynamicRef(e,e.schema)};$R.default=WK});var SR=C(function(wR){Object.defineProperty(wR,"__esModule",{value:!0});var KK=Wh(),GK=zh(),YK=xR(),XK=vR(),QK=[KK.default,GK.default,YK.default,XK.default];wR.default=QK});var PR=C(function(_R){Object.defineProperty(_R,"__esModule",{value:!0});var ER=Hu(),eG={keyword:"dependentRequired",type:"object",schemaType:"object",error:ER.error,code:(e)=>ER.validatePropertyDeps(e)};_R.default=eG});var AR=C(function(kR){Object.defineProperty(kR,"__esModule",{value:!0});var rG=Hu(),nG={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(e)=>rG.validateSchemaDeps(e)};kR.default=nG});var RR=C(function(jR){Object.defineProperty(jR,"__esModule",{value:!0});var sG=_e(),oG={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:r}){if(t.contains===void 0)sG.checkStrictMode(r,`"${e}" without "contains" is ignored`)}};jR.default=oG});var CR=C(function(OR){Object.defineProperty(OR,"__esModule",{value:!0});var cG=PR(),lG=AR(),uG=RR(),fG=[cG.default,lG.default,uG.default];OR.default=fG});var NR=C(function(TR){Object.defineProperty(TR,"__esModule",{value:!0});var ji=be(),IR=_e(),pG=Fr(),mG={message:"must NOT have unevaluated properties",params:({params:e})=>ji._`{unevaluatedProperty: ${e.unevaluatedProperty}}`},hG={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:mG,code(e){let{gen:t,schema:r,data:n,errsCount:i,it:s}=e;if(!i)throw Error("ajv implementation error");let{allErrors:o,props:a}=s;if(a instanceof ji.Name)t.if(ji._`${a} !== true`,()=>t.forIn("key",n,(d)=>t.if(l(a,d),()=>c(d))));else if(a!==!0)t.forIn("key",n,(d)=>a===void 0?c(d):t.if(u(a,d),()=>c(d)));s.props=!0,e.ok(ji._`${i} === ${pG.default.errors}`);function c(d){if(r===!1){if(e.setParams({unevaluatedProperty:d}),e.error(),!o)t.break();return}if(!IR.alwaysValidSchema(s,r)){let h=t.name("valid");if(e.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:IR.Type.Str},h),!o)t.if(ji.not(h),()=>t.break())}}function l(d,h){return ji._`!${d} || !${d}[${h}]`}function u(d,h){let m=[];for(let y in d)if(d[y]===!0)m.push(ji._`${h} !== ${y}`);return ji.and(...m)}}};TR.default=hG});var DR=C(function(LR){Object.defineProperty(LR,"__esModule",{value:!0});var ys=be(),MR=_e(),yG={message:({params:{len:e}})=>ys.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ys._`{limit: ${e}}`},bG={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:yG,code(e){let{gen:t,schema:r,data:n,it:i}=e,s=i.items||0;if(s===!0)return;let o=t.const("len",ys._`${n}.length`);if(r===!1)e.setParams({len:s}),e.fail(ys._`${o} > ${s}`);else if(typeof r=="object"&&!MR.alwaysValidSchema(i,r)){let c=t.var("valid",ys._`${o} <= ${s}`);t.if(ys.not(c),()=>a(c,s)),e.ok(c)}i.items=!0;function a(c,l){t.forRange("i",l,o,(u)=>{if(e.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:MR.Type.Num},c),!i.allErrors)t.if(ys.not(c),()=>t.break())})}}};LR.default=bG});var FR=C(function(JR){Object.defineProperty(JR,"__esModule",{value:!0});var $G=NR(),vG=DR(),wG=[$G.default,vG.default];JR.default=wG});var BR=C(function(qR){Object.defineProperty(qR,"__esModule",{value:!0});var mt=be(),EG={message:({schemaCode:e})=>mt.str`must match format "${e}"`,params:({schemaCode:e})=>mt._`{format: ${e}}`},_G={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:EG,code(e,t){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:a}=e,{opts:c,errSchemaPath:l,schemaEnv:u,self:d}=a;if(!c.validateFormats)return;if(i)h();else m();function h(){let y=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),g=r.const("fDef",mt._`${y}[${o}]`),b=r.let("fType"),x=r.let("format");r.if(mt._`typeof ${g} == "object" && !(${g} instanceof RegExp)`,()=>r.assign(b,mt._`${g}.type || "string"`).assign(x,mt._`${g}.validate`),()=>r.assign(b,mt._`"string"`).assign(x,g)),e.fail$data(mt.or(_(),P()));function _(){if(c.strictSchema===!1)return mt.nil;return mt._`${o} && !${x}`}function P(){let E=u.$async?mt._`(${g}.async ? await ${x}(${n}) : ${x}(${n}))`:mt._`${x}(${n})`,w=mt._`(typeof ${x} == "function" ? ${E} : ${x}.test(${n}))`;return mt._`${x} && ${x} !== true && ${b} === ${t} && !${w}`}}function m(){let y=d.formats[s];if(!y){_();return}if(y===!0)return;let[g,b,x]=P(y);if(g===t)e.pass(E());function _(){if(c.strictSchema===!1){d.logger.warn(w());return}throw Error(w());function w(){return`unknown format "${s}" ignored in schema at path "${l}"`}}function P(w){let k=w instanceof RegExp?mt.regexpCode(w):c.code.formats?mt._`${c.code.formats}${mt.getProperty(s)}`:void 0,R=r.scopeValue("formats",{key:s,ref:w,code:k});if(typeof w=="object"&&!(w instanceof RegExp))return[w.type||"string",w.validate,mt._`${R}.validate`];return["string",w,R]}function E(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!u.$async)throw Error("async format in sync schema");return mt._`await ${x}(${n})`}return typeof b=="function"?mt._`${x}(${n})`:mt._`${x}.test(${n})`}}}};qR.default=_G});var Kh=C(function(HR){Object.defineProperty(HR,"__esModule",{value:!0});var kG=BR(),AG=[kG.default];HR.default=AG});var Gh=C(function(UR){Object.defineProperty(UR,"__esModule",{value:!0});UR.contentVocabulary=UR.metadataVocabulary=void 0;UR.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];UR.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var KR=C(function(zR){Object.defineProperty(zR,"__esModule",{value:!0});var OG=Th(),CG=Lh(),IG=Uh(),TG=SR(),NG=CR(),MG=FR(),LG=Kh(),WR=Gh(),DG=[TG.default,OG.default,CG.default,(0,IG.default)(!0),LG.default,WR.metadataVocabulary,WR.contentVocabulary,NG.default,MG.default];zR.default=DG});var QR=C(function(YR){Object.defineProperty(YR,"__esModule",{value:!0});YR.DiscrError=void 0;var GR;(function(e){e.Tag="tag",e.Mapping="mapping"})(GR||(YR.DiscrError=GR={}))});var Xh=C(function(eO){Object.defineProperty(eO,"__esModule",{value:!0});var jo=be(),Yh=QR(),ZR=rc(),FG=_o(),qG=_e(),BG={message:({params:{discrError:e,tagName:t}})=>e===Yh.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>jo._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},HG={keyword:"discriminator",type:"object",schemaType:"object",error:BG,code(e){let{gen:t,data:r,schema:n,parentSchema:i,it:s}=e,{oneOf:o}=i;if(!s.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!o)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),l=t.const("tag",jo._`${r}${jo.getProperty(a)}`);t.if(jo._`typeof ${l} == "string"`,()=>u(),()=>e.error(!1,{discrError:Yh.DiscrError.Tag,tag:l,tagName:a})),e.ok(c);function u(){let m=h();t.if(!1);for(let y in m)t.elseIf(jo._`${l} === ${y}`),t.assign(c,d(m[y]));t.else(),e.error(!1,{discrError:Yh.DiscrError.Mapping,tag:l,tagName:a}),t.endIf()}function d(m){let y=t.name("valid"),g=e.subschema({keyword:"oneOf",schemaProp:m},y);return e.mergeEvaluated(g,jo.Name),y}function h(){var m;let y={},g=x(i),b=!0;for(let E=0;E<o.length;E++){let w=o[E];if((w===null||w===void 0?void 0:w.$ref)&&!qG.schemaHasRulesButRef(w,s.self.RULES)){let R=w.$ref;if(w=ZR.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,R),w instanceof ZR.SchemaEnv)w=w.schema;if(w===void 0)throw new FG.default(s.opts.uriResolver,s.baseId,R)}let k=(m=w===null||w===void 0?void 0:w.properties)===null||m===void 0?void 0:m[a];if(typeof k!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);b=b&&(g||x(w)),_(k,E)}if(!b)throw Error(`discriminator: "${a}" must be required`);return y;function x({required:E}){return Array.isArray(E)&&E.includes(a)}function _(E,w){if(E.const)P(E.const,w);else if(E.enum)for(let k of E.enum)P(k,w);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function P(E,w){if(typeof E!="string"||E in y)throw Error(`discriminator: "${a}" values must be unique strings`);y[E]=w}}}};eO.default=HG});var tO=C(function(lle,VG){VG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var rO=C(function(ule,WG){WG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var nO=C(function(fle,zG){zG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var iO=C(function(dle,KG){KG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var sO=C(function(ple,GG){GG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var oO=C(function(mle,YG){YG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var aO=C(function(hle,XG){XG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var cO=C(function(gle,QG){QG.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var uO=C(function(lO){Object.defineProperty(lO,"__esModule",{value:!0});var ZG=tO(),e7=rO(),t7=nO(),r7=iO(),n7=sO(),i7=oO(),s7=aO(),o7=cO(),a7=["/properties"];function c7(e){return[ZG,e7,t7,r7,n7,t(this,i7),s7,t(this,o7)].forEach((r)=>this.addMetaSchema(r,void 0,!1)),this;function t(r,n){return e?r.$dataMetaSchema(n,a7):n}}lO.default=c7});var eg=C(function(hr,Zh){Object.defineProperty(hr,"__esModule",{value:!0});hr.MissingRefError=hr.ValidationError=hr.CodeGen=hr.Name=hr.nil=hr.stringify=hr.str=hr._=hr.KeywordCxt=hr.Ajv2020=void 0;var u7=Ih(),f7=KR(),d7=Xh(),p7=uO(),Qh="https://json-schema.org/draft/2020-12/schema";class mc extends u7.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),f7.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(d7.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;if(!t)return;p7.default.call(this,e),this.refs["http://json-schema.org/schema"]=Qh}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Qh)?Qh:void 0)}}hr.Ajv2020=mc;Zh.exports=hr=mc;Zh.exports.Ajv2020=mc;Object.defineProperty(hr,"__esModule",{value:!0});hr.default=mc;var m7=Eo();Object.defineProperty(hr,"KeywordCxt",{enumerable:!0,get:function(){return m7.KeywordCxt}});var Ro=be();Object.defineProperty(hr,"_",{enumerable:!0,get:function(){return Ro._}});Object.defineProperty(hr,"str",{enumerable:!0,get:function(){return Ro.str}});Object.defineProperty(hr,"stringify",{enumerable:!0,get:function(){return Ro.stringify}});Object.defineProperty(hr,"nil",{enumerable:!0,get:function(){return Ro.nil}});Object.defineProperty(hr,"Name",{enumerable:!0,get:function(){return Ro.Name}});Object.defineProperty(hr,"CodeGen",{enumerable:!0,get:function(){return Ro.CodeGen}});var h7=ec();Object.defineProperty(hr,"ValidationError",{enumerable:!0,get:function(){return h7.default}});var g7=_o();Object.defineProperty(hr,"MissingRefError",{enumerable:!0,get:function(){return g7.default}})});import{existsSync as Yu,readFileSync as x7}from"node:fs";import{createRequire as fO}from"node:module";import{isAbsolute as $7,relative as v7,resolve as Gu}from"node:path";import{fileURLToPath as dO,pathToFileURL as w7}from"node:url";function hc(e){return JSON.parse(x7(e,"utf8"))}async function pO(e){let t=Gu(e),r=Gu(t,"project.json"),n=Gu(t,"project.schema.json");if(!Yu(r))throw Error(`project.json not found in ${t}`);if(!Yu(n))throw Error(`project.schema.json not found in ${t} — run \`jx schema\` to generate it from `+"project.json#/extensions");let i=hc(r),s=hc(n);s.$id=w7(n).href;let o;try{({default:o}=await Promise.resolve().then(() => Bt(eg(),1)))}catch(u){throw Error("Project validation requires ajv: bun add ajv",{cause:u})}let c=await new o({allErrors:!0,loadSchema:(u)=>S7(u,t),strict:!1}).compileAsync(s),l=c(i);return{errors:c.errors??null,valid:l}}async function S7(e,t){if(!e.startsWith("file:"))throw Error(`Cannot resolve schema ref "${e}": only project-relative file refs are loadable (canonical URIs must resolve from already-loaded fragments)`);let r=dO(e),n=v7(t,r);if(n.startsWith("..")||$7(n))throw Error(`Schema ref "${e}" escapes the project root ${t}`);if(Yu(r))return hc(r);let i=n.split("\\").join("/"),s="node_modules/",o=i.lastIndexOf(s);if(o===-1)throw Error(`Schema ref "${e}" does not exist`);let a=i.slice(o+s.length),c;try{c=fO(Gu(t,"package.json")).resolve(a)}catch{try{c=fO(import.meta.url).resolve(a)}catch(l){if(a.startsWith("@jxsuite/schema/")){let d=dO(new URL(`../${a.slice(16)}`,import.meta.url));if(Yu(d))return hc(d)}throw Error(`Schema ref "${e}" does not exist and "${a}" is not resolvable from the project or the host`,{cause:l})}}return hc(c)}var mO=()=>{};function Pn(e){return ee(e.attributes)?e.attributes:{}}function Dt(e,t){let r=Pn(e)[t];return T(r)?r:null}function ht(e){return T(e.tagName)?e.tagName.toLowerCase():""}function Zt(e,t="the popover"){let r=T(e.id)?e.id:Dt(e,"id");if(r)return`#${r}`;let n=ht(e);return n===""?t:`the <${n}>`}function P7(e){let t=Pn(e).popover;return T(t)?t:null}function gO(e){let t=new Set,r=new Set;for(let n of e){let i=n!==null&&T(n.tagName)?n.tagName:"";if(n===null||!i.includes("-"))continue;if(tg(n))t.add(i);let s=n.observedAttributes;if(Array.isArray(s)&&k7.every((o)=>s.includes(o)))r.add(i)}return{invokerTags:r,popoverTags:t}}function tg(e){return"popover"in Pn(e)||"popover"in e}function gc(e,t){return tg(e)||(t?.popoverTags?.has(ht(e))??!1)}function Ri(e){if(T(e.id)&&e.id!=="")return e.id;let t=Dt(e,"id");return t===""?null:t}function*_n(e,t=[],r=null,n){yield{enclosing:r,node:e,path:t};let i=gc(e,n)?e:r,{children:s}=e;if(Array.isArray(s)){for(let[c,l]of s.entries())if(J(l))yield*_n(l,[...t,"children",c],i,n)}else if(ee(s)&&ir(s.map))yield*_n(s.map,[...t,"children","map"],i,n);let o=ir(e.map)?e.map:null;if(o)yield*_n(o,[...t,"map"],i,n);let a=ee(e.cases)?e.cases:{};for(let[c,l]of Object.entries(a))if(J(l))yield*_n(l,[...t,"cases",c],i,n)}function rg(e,t){let r=[];for(let{node:n}of _n(e,[],null,t)){if(!gc(n,t))continue;let i=Ri(n);if(i!==null&&!r.includes(i))r.push(i)}return r}function Xu(e){return e.startsWith("@")}function yO(e){return e.startsWith(":")||e.startsWith("&")||e.startsWith(".")||e.startsWith("[")}function Qt(e,t){let r=e?.[t];if(r===void 0||Li(r)||Array.isArray(r))return null;return String(r)}function bO(e){for(let[t,r]of Object.entries(e??{})){if(!Li(r))continue;if(yO(t)&&t.includes(":popover-open")&&Qt(r,"display")!==null)return!0;if(Xu(t)&&bO(r))return!0}return!1}function xO(e){for(let[t,r]of Object.entries(e??{})){if(!Li(r))continue;if(yO(t)&&t.includes(":popover-open"))return!0;if(Xu(t)&&xO(r))return!0}return!1}function j7(e){return A7.some((t)=>Qt(e,t)!==null)}function R7(e){if(!e)return[];let t=[];for(let[r,n]of Object.entries(e))if(Xu(r)&&Li(n)&&Qt(n,"display")!==null)t.push(r);return t}function $O(e){if(!e)return[];let t=[],r=Qt(e,"transition");if(r!==null)t.push(r);for(let[n,i]of Object.entries(e))if(Xu(n)&&Li(i))t.push(...$O(i));return t}function O7(e){if(!e)return!1;if(Qt(e,"positionAnchor")!==null||Qt(e,"position-anchor")!==null)return!0;return["top","left","right","bottom","inset","insetBlockStart","insetInlineStart"].some((t)=>(Qt(e,t)??"").includes("anchor("))}function C7(e){if(!e)return!1;if(Qt(e,"positionArea")!==null||Qt(e,"position-area")!==null||Qt(e,"positionTryFallbacks")!==null||Qt(e,"position-try-fallbacks")!==null)return!0;return Object.keys(e).some((t)=>t.startsWith("@supports"))}function vO(e,t){let r=[..._n(e,[],null,t)],n=rg(e,t),i=r.some(({node:a})=>gc(a,t)),s=new Set;for(let{node:a}of r)if(hO.has(ht(a))){let c=Dt(a,"popovertarget");if(c!==null)s.add(c)}let o=[];for(let{enclosing:a,node:c,path:l}of r)if(o.push(...I7(c,l,a,n,i,t)),tg(c))o.push(...T7(c,l,s));return o}function I7(e,t,r,n,i,s){let o=[],a=ht(e),c=Dt(e,"popovertarget"),l=hO.has(a)||(s?.invokerTags?.has(a)??!1);if(c!==null&&!l)return o.push({detail:"`popovertarget` and `popovertargetaction` come from the `PopoverTargetAttributes` IDL mixin, which HTML includes into `HTMLButtonElement` and `HTMLInputElement` and into nothing else. Elsewhere they parse and do nothing. A link inside an open popover "+"dismisses it by navigating away, which is why this looks like it works — but it does "+`not for a new tab or a same-page fragment. Remove both attributes. ${Xe}`,fix:"invoker",message:`<${a||"element"}> carries popovertarget, which only <button> and <input> support.`,path:t,rule:"invoker-not-button",severity:"error"}),o;if(c!==null){if(i&&!n.includes(c)){let u=n.length>0?`The popovers here are: ${n.map((d)=>`"${d}"`).join(", ")}. `:"";o.push({detail:`No element in this document declares \`popover\` with the id "${c}". ${u}A target that names nothing does nothing, silently. ${Xe}`,message:`popovertarget="${c}" names no popover in this document.`,path:t,rule:"target-missing",severity:"error"})}else if(r!==null&&Ri(r)!==null&&Ri(r)!==c)o.push({detail:`This control is inside ${Zt(r)} but targets "${c}". Dismissing a different popover leaves the one the reader is looking at open. This is usually a copy-paste between two panels in the same file. ${Xe}`,message:`A control inside ${Zt(r)} targets "${c}" instead.`,path:t,rule:"target-mismatch",severity:"warn"})}if(a==="a"&&r!==null&&c===null){let u=Dt(e,"href")??(T(e.href)?e.href:null),d=Dt(e,"target")==="_blank",h=u!==null&&u.includes("#");if(d||h){let m=d?"it opens a new tab, so the panel stays open on the page behind it. ":"it is a same-document fragment, so the page scrolls behind the open panel. ";o.push({detail:`A link inside a panel normally dismisses it by navigating away. This one does not: ${m}`+"There is no declarative fix — a link cannot carry `popovertarget`. Move it out of the "+`panel, make it a <button>, or accept it deliberately. ${Xe}`,message:`A link inside ${Zt(r)} does not dismiss it.`,path:t,rule:"link-does-not-dismiss",severity:"warn"})}}return o}function T7(e,t,r){let n=[],{style:i}=e,s=Zt(e),o=P7(e);if(o!==null&&o!==""&&!_7.some((l)=>l===o))n.push({detail:"`popover` is an enumerated attribute taking `auto`, `manual` or `hint`. Anything else falls back to the invalid-value default `manual`, which gives up light dismiss and gives "+`up Escape — so the panel opens and there is no way to close it. Write "auto". ${Xe}`,fix:"mode",message:`${s} declares popover="${o}", which is not one of auto, manual or hint.`,path:t,rule:"invalid-mode",severity:"error"});else if(Rt(Pn(e).popover))n.push({detail:`\`popover\` carries its value in its text, so a boolean is not the right shape. Written as \`true\` it reaches two of the compiler's emitters as \`popover="true"\`, which is not one of the three keywords, so HTML falls back to \`manual\`: no light dismiss, no Escape, and the trigger stops toggling. Write "auto". ${Xe}`,fix:"mode",message:`${s} writes popover as a boolean.`,path:t,rule:"invalid-mode",severity:"error"});let a=Qt(i,"display");if(a!==null&&a!=="revert"&&a!=="revert-layer")n.push({detail:"A closed popover is hidden by the browser's own `[popover]:not(:popover-open) { display: none }`. That rule is UA-origin, so any author `display` beats it at any specificity, and "+"the panel is laid out on every page whether it is open or not — usually parked off the "+`side of the viewport by the transform meant to animate it, so nothing looks wrong until you scroll sideways. \`display\` belongs in \`:popover-open\` and nowhere else. ${Xe}`,fix:"display",message:`${s} sets display in its base rule.`,path:t,rule:"base-display",severity:"error"});for(let l of R7(i))n.push({detail:`The same defect as a base \`display\`, arriving through \`${l}\` and therefore only at `+"one width — which is what makes it hard to see. Gate the TRIGGER on a breakpoint, never "+`the panel: the popover mechanism is what hides the panel. ${Xe}`,fix:"display",message:`${s} sets display inside ${l}.`,path:t,rule:"breakpoint-display",severity:"error"});if(Qt(i,"visibility")!==null)n.push({detail:`A second hiding mechanism the browser already provides. Once \`display\` leaves the base rule this one only adds a frame of flicker on open, and it hides the element from assistive technology in a way \`display: none\` already did. ${Xe}`,fix:"display",message:`${s} also hides itself with visibility.`,path:t,rule:"base-visibility",severity:"warn"});if(!xO(i))n.push({detail:"Nothing changes when it opens, so no transition on it can run and — if `display` is not "+"in the base rule — the panel has no `display` at all while open. This is usually a panel "+`that was styled before it was made a popover. ${Xe}`,message:`${s} has no :popover-open rule.`,path:t,rule:"no-open-rule",severity:"warn"});else if(!bO(i)&&a===null&&j7(i))n.push({detail:`${s} declares flex or grid properties, but neither its base rule nor its `+"`:popover-open` rule sets a `display` for them to apply to — and the base rule must not "+`(that is what keeps the closed panel hidden). So it opens with the UA's \`display: block\` and the layout silently does nothing. Put \`display: flex\` in \`:popover-open\`. ${Xe}`,fix:"open-display",message:`${s} is laid out with flex or grid but never sets display.`,path:t,rule:"no-open-display",severity:"error"});for(let l of $O(i))if(l.includes("display")&&!l.includes("overlay")){n.push({detail:"`display …allow-discrete` keeps the box alive while it animates out; `overlay "+"…allow-discrete` is what keeps it in the TOP LAYER for those same milliseconds. "+`Without it the panel drops behind the page content and the backdrop disappears a frame early, so the exit reads as a flicker rather than an animation. ${Xe}`,message:`${s} transitions display but not overlay.`,path:t,rule:"cut-exit",severity:"warn"});break}if(O7(i)&&!C7(i))n.push({detail:"When `anchor()` does not resolve, every inset it feeds computes to `auto` — and a "+`\`position: fixed\` box with four \`auto\` insets falls back to its STATIC position, which for a panel declared inside a header is in the middle of the header. Use \`position-area\` with \`position-try-fallbacks\`, or add a \`@supports\` block that positions it without anchors. ${Xe}`,message:`${s} is anchor-positioned with no fallback.`,path:t,rule:"unsafe-anchor",severity:"warn"});let c=Ri(e);if(c!==null&&!r.has(c))n.push({detail:`No \`<button>\` or \`<input>\` in this document names it with \`popovertarget\`. If it is opened from another file or from a function that calls \`showPopover()\`, this is fine; otherwise there is no way for a reader to open it. ${Xe}`,message:`${s} has no invoker in this document.`,path:t,rule:"no-invoker",severity:"warn"});return n}var _7,hO,k7,A7,Xe="See docs/framework/concepts/overlays.";var Qu=L(()=>{Ee();_7=["auto","manual","hint"],hO=new Set(["button","input"]);k7=["popovertarget","popovertargetaction","command","commandfor"];A7=["flexDirection","flex-direction","alignItems","align-items","justifyContent","justify-content","flexWrap","flex-wrap","gridTemplateColumns","grid-template-columns","gridTemplateRows","grid-template-rows","gap"]});function To(e,t){let r=Pn(e),n=t in r?r[t]:e[t];if(n===void 0||n===null)return{kind:"absent"};if(Je(n)||ee(n))return{kind:"bound"};if(T(n))return n.includes("${")?{kind:"bound"}:{kind:"text",text:n};return{isTrue:n===!0,kind:"other"}}function Co(e,t){let r=To(e,t);return r.kind==="text"&&r.text.trim()!==""?r.text:null}function Jt(e,t){return To(e,t).kind!=="absent"}function Oi(e){let t=To(e,"role");if(t.kind==="bound")return Io;return t.kind==="text"?t.text.trim().toLowerCase().split(/\s+/)[0]:null}function Zu(e){let t=To(e,"id");if(t.kind==="bound")return Io;return t.kind==="text"&&t.text!==""?t.text:null}function Hr(e,t){let r=To(e,t);return r.kind==="bound"||r.kind==="text"&&r.text.trim()!==""}function ef(e){let t=e.textContent;if(T(t)){if(t.trim()!=="")return!0}else if(t!==void 0&&t!==null)return!0;if(Hr(e,"aria-label")||Jt(e,"aria-labelledby"))return!0;if(ht(e)==="img"&&(Hr(e,"alt")||Hr(e,"title")))return!0;if(ht(e)==="slot")return!0;let{children:r}=e;if(Array.isArray(r)){for(let i of r)if(T(i)){if(i.trim()!=="")return!0}else if(J(i)&&ef(i))return!0}else if(r!=null)return!0;if(ee(e.map))return!0;return(ee(e.cases)?Object.values(e.cases):[]).some((i)=>ir(i)&&ef(i))}function*Oo(e,t=[],r=[],n=[]){yield{node:e,path:t,roles:r,tags:n};let i=[...r,Oi(e)],s=[...n,ht(e)],{children:o}=e;if(Array.isArray(o)){for(let[a,c]of o.entries())if(J(c))yield*Oo(c,[...t,"children",a],i,s)}else if(ee(o)&&ir(o.map))yield*Oo(o.map,[...t,"children","map"],i,s);if(ir(e.map))yield*Oo(e.map,[...t,"map"],i,s);if(ee(e.cases)){for(let[a,c]of Object.entries(e.cases))if(J(c))yield*Oo(c,[...t,"cases",a],i,s)}}function F7(e){return e.some((t)=>t.includes("-"))}function kn(e,t,r,n,i,s="error"){return{criterion:i,detail:`${n} ${N7}`,message:r,path:t,rule:e,severity:s}}function wO(e,t,r){if(r.includes("label"))return!0;if(e===Io||t.bound)return!0;return e!==null&&t.ids.has(e)}function q7(e,t){let{node:r,path:n,tags:i}=e,s=ht(r),o=Oi(r);if(o==="bound")return null;if(Hr(r,"aria-label")||Jt(r,"aria-labelledby")||Hr(r,"title"))return null;let c=Zt(r,"the control"),l=(d)=>kn("interactive-unnamed",n,`${c} has no accessible name.`,`A control with no name is announced as its role alone, so a reader hears "button" and nothing else. ${d}`,"4.1.2"),u=B7(r,s,t,i);if(u==="named"||u==="exempt")return null;if(o!==null&&M7.has(o))return ef(r)?null:l("Give it text content, or an aria-label.");if(o!==null&&L7.has(o))return l("Give it an aria-label, or aria-labelledby naming its visible label.");if(o!==null)return null;if(s==="button"||s==="summary"||s==="a"&&Jt(r,"href"))return ef(r)?null:l("Give it text content, or an aria-label.");if(u==="unnamed")return l("Give it a <label for> naming its id, or an aria-label.");if(u==="unnamed-value")return l("Give it a value, or an aria-label.");if(u==="unnamed-alt")return l("Give it an alt, or an aria-label.");return null}function B7(e,t,r,n){if(t==="area"){if(!Jt(e,"href"))return"none";return Hr(e,"alt")?"named":"unnamed-alt"}if(t==="select"||t==="textarea")return wO(Zu(e),r,n)||Hr(e,"placeholder")?"named":"unnamed";if(t!=="input")return"none";let i=(Co(e,"type")??"text").toLowerCase();if(i==="hidden"||Jt(e,"type")&&Co(e,"type")===null)return"exempt";if(D7.has(i))return Hr(e,"value")?"named":"unnamed-value";if(i==="image")return Hr(e,"alt")?"named":"unnamed-alt";return wO(Zu(e),r,n)||Hr(e,"placeholder")?"named":"unnamed"}function U7(e){let{node:t,path:r,tags:n}=e,i=ht(t);if(!i.includes("-")||!n.some((s)=>H7.has(s)))return null;return kn("custom-element-in-select",r,`<${i}> is a custom element inside a <select>.`,'A <select> builds its own rows: an element it does not know is not in select.options, so it cannot be picked, cannot be reached with the arrow keys, and fires no change event — while role="option" on it still makes the accessibility tree read as though it could. Every row of a <select> is a native <option>; a listbox whose rows are jx-option elements is a jx-listbox.',"4.1.2")}function V7(e){let{node:t,path:r}=e;if(ht(t)!=="img")return null;let n=Oi(t);if(n==="bound"||n==="presentation"||n==="none")return null;if(Jt(t,"alt")||Hr(t,"aria-label")||Jt(t,"aria-labelledby"))return null;return kn("img-alt-missing",r,`${Zt(t,"the image")} has no alt text.`,'An image with no alt is announced by its file name. Describe it in alt, or write alt="" for a decorative one.',"1.1.1")}function z7(e,t){let{node:r,path:n}=e,i=[];for(let s of W7){let o=Co(r,s);if(o===null)continue;for(let a of o.split(/\s+/))if(a!==""&&!t.has(a))i.push(kn("aria-target-missing",n,`${Zt(r,"the element")} points ${s} at #${a}, which nothing in this document has as its id.`,"A reference to an id that is not in the document is silently dropped, so the relationship it declares does not exist. Name an element that is here, or give that element the id.","1.3.1"))}return i}function K7(e,t,r){for(let n of SO.get(t)??[]){let i=r.get(n);if(i===void 0)continue;if(i.bound)return!0;if(e===Io&&i.ids.size>0)return!0;if(e!==null&&e!==Io&&i.ids.has(e))return!0}return!1}function G7(e,t){let{node:r,path:n,roles:i,tags:s}=e,o=Oi(r);if(o===null||o==="bound"||n.length===0||F7(s))return null;if(i.includes("bound")||K7(Zu(r),o,t))return null;let a=Zt(r,"the element");if(o==="tab"&&!i.includes("tablist"))return kn("tab-outside-tablist",n,`${a} is a tab outside any tablist.`,'A tab is announced with its position in a tablist, so one with no tablist ancestor has no place to be counted in. Put the tabs in a container with role="tablist".',"1.3.1");if((o==="menuitem"||o==="menuitemcheckbox"||o==="menuitemradio")&&!i.includes("menu")&&!i.includes("menubar"))return kn("menuitem-outside-menu",n,`${a} is a ${o} outside any menu.`,'A menu item is owned by a menu, and is announced as one of its items. Put it in a container with role="menu" or role="menubar".',"1.3.1");if(o==="option"&&!i.includes("listbox")&&!s.includes("select")&&!s.includes("datalist"))return kn("option-outside-listbox",n,`${a} is an option outside any listbox.`,'An option is owned by a listbox, and is announced as one of its choices. Put it in a container with role="listbox", or in a <select>.',"1.3.1");return null}function Y7(e){let t=[];for(let{node:r}of Oo(e)){if(Oi(r)!=="tab")continue;let n=To(r,"aria-selected");if(n.kind==="bound")return null;t.push(n.kind==="other"&&n.isTrue||n.kind==="text"&&n.text==="true")}return t}function X7(e){let{node:t,path:r}=e;if(Oi(t)!=="tablist")return null;let n=Y7(t);if(n===null||n.length===0||n.includes(!0))return null;return kn("tablist-none-selected",r,`${Zt(t,"the tablist")} has ${n.length} tab(s) and none is selected.`,'A tablist always has a current tab, and aria-selected="true" is how it is announced. Mark the tab whose panel is showing.',"4.1.2","warn")}function Q7(e){let{node:t,path:r}=e,n=Oi(t);if(!(ht(t)==="dialog"||n==="dialog"||n==="alertdialog")||n==="bound")return null;if(Hr(t,"aria-label")||Jt(t,"aria-labelledby"))return null;return kn("dialog-unnamed",r,`${Zt(t,"the dialog")} has no accessible name.`,"A dialog is announced by its name when it opens, and its content does not name it. Give it aria-labelledby naming its heading, or an aria-label.","4.1.2")}function eY(e){let{node:t,path:r}=e;if(!Jt(t,"aria-activedescendant"))return null;let n=ht(t);if(Z7.has(n)||n==="a"&&Jt(t,"href")||Jt(t,"tabIndex")||Jt(t,"tabindex")||Jt(t,"contenteditable"))return null;return kn("activedescendant-not-focusable",r,`${Zt(t,"the element")} manages focus with aria-activedescendant but cannot itself take focus.`,"aria-activedescendant names the active child of a FOCUSED container; on one that cannot be focused, the keyboard never reaches it. Give the container a tabindex.","2.1.1")}function EO(e){let t=[...Oo(e)],r=new Set,n={bound:!1,ids:new Set},i=new Map,s=!1;for(let{node:a}of t){let c=Oi(a);if(c!==null&&J7.has(c)){let u=i.get(c)??{bound:!1,ids:new Set},d=Co(a,"aria-owns");if(d===null)u.bound||=Jt(a,"aria-owns");else for(let h of d.split(/\s+/))if(h!=="")u.ids.add(h);i.set(c,u)}let l=Zu(a);if(l===Io)s=!0;else if(l!==null)r.add(l);if(ht(a)==="label"){let u=Co(a,"for")??Co(a,"htmlFor");if(u===null)n.bound||=Jt(a,"for")||Jt(a,"htmlFor");else n.ids.add(u)}}let o=[];for(let a of t){let c=[q7(a,n),V7(a),G7(a,i),U7(a),X7(a),Q7(a),eY(a)];for(let l of c)if(l)o.push(l);if(!s)o.push(...z7(a,r))}return o}var N7="See docs/framework/concepts/accessibility.",Io="bound",M7,L7,D7,SO,J7,H7,W7,Z7;var _O=L(()=>{Ee();Qu();M7=new Set(["button","checkbox","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","switch","tab","treeitem"]),L7=new Set(["combobox","listbox","searchbox","slider","spinbutton","textbox"]),D7=new Set(["button","reset","submit"]),SO=new Map([["menuitem",["menu","menubar"]],["menuitemcheckbox",["menu","menubar"]],["menuitemradio",["menu","menubar"]],["option",["listbox"]],["tab",["tablist"]]]),J7=new Set([...SO.values()].flat());H7=new Set(["select","jx-select"]);W7=["aria-activedescendant","aria-controls","aria-describedby","aria-details","aria-errormessage","aria-flowto","aria-labelledby","aria-owns"];Z7=new Set(["button","input","select","textarea"])});function ng(e){return ht(e)==="dialog"}function PO(e){return e.startsWith("--")}function aY(e){let t=[];for(let{node:r}of _n(e)){let n=Ri(r);if(ng(r)&&n!==null&&!t.includes(n))t.push(n)}return t}function cY(e){let t=e.oncommand;return t!==void 0&&t!==null}function lY(e,t){for(let{node:r}of _n(e)){if(r===e)continue;let n=ht(r);if(n==="button"){let i=Dt(r,"command"),s=Dt(r,"commandfor");if(i!==null&&(i==="close"||i==="request-close")&&(s===null||s===t))return!0}if(n==="form"&&Dt(r,"method")?.toLowerCase()==="dialog")return!0}return!1}function AO(e,t){let r=[..._n(e,[],null,t)],n=aY(e),i=rg(e,t),s=n.length>0||i.length>0,o=new Map,a=new Map;for(let{node:l}of r){let u=Ri(l);if(u!==null&&!o.has(u))o.set(u,l);if(ht(l)==="button"){let d=Dt(l,"commandfor"),h=Dt(l,"command");if(d!==null){let m=a.get(d)??new Set;m.add(h??""),a.set(d,m)}}}let c=[];for(let{node:l,path:u}of r)if(c.push(...uY(l,u,o,n,i,s,t)),ng(l))c.push(...fY(l,u,a));return c}function uY(e,t,r,n,i,s,o){let a=[],c=ht(e),l=o?.invokerTags?.has(c)??!1,u=Dt(e,"command"),d=Dt(e,"commandfor");if(!(u!==null||d!==null||("command"in Pn(e))||("commandfor"in Pn(e))))return a;let m=Zt(e,"the element");if(!oY.has(c)&&!l)return a.push({detail:"`command` and `commandfor` are attributes of `HTMLButtonElement` and of no other "+"interface — not even `<input>`, which `popovertarget` does allow. Elsewhere they parse "+`and do nothing. Make it a <button>, or remove both attributes. ${Xe}`,fix:"invoker",message:`<${c||"element"}> carries command/commandfor, which only <button> supports.`,path:t,rule:"invoker-not-button",severity:"error"}),a;if(u!==null&&!iY.has(u)&&!PO(u))return a.push({detail:`\`command\` is an enumerated attribute taking ${kO.map((y)=>`\`${y}\``).join(", ")}, or a custom command starting with \`--\`. Anything else is the invalid-value state, and a button in that state does nothing when clicked. ${Xe}`,message:`${m} declares command="${u}", which is not a built-in or --custom command.`,path:t,rule:"command-invalid",severity:"error"}),a;if(d!==null){let y=r.get(d),g=n.includes(d),b=i.includes(d);if(!y&&s){let x=[...n,...i].map((_)=>`"${_}"`).join(", ");return a.push({detail:`No element in this document has the id "${d}". The dialogs and popovers here are: ${x}. A commandfor that names nothing does nothing, silently. ${Xe}`,message:`commandfor="${d}" names nothing in this document.`,path:t,rule:"command-target-missing",severity:"error"}),a}if(u!==null&&y){if(tY.has(u)&&!ng(y))a.push({detail:`\`${u}\` acts on a <dialog>, and "${d}" is ${b?"a popover":`a <${ht(y)||"element"}>`}. The click is ignored. ${b?"Use `toggle-popover`, `show-popover` or `hide-popover` for a popover.":"Point it at a dialog, or make the target one."} ${Xe}`,message:`${m} sends ${u} to "${d}", which is not a dialog.`,path:t,rule:"command-target-mismatch",severity:"error"});else if(rY.has(u)&&!gc(y,o))a.push({detail:`\`${u}\` acts on a popover, and "${d}" is ${g?"a dialog":`a <${ht(y)||"element"}>`} that declares no \`popover\`. The click is ignored. ${g?"Use `show-modal`, `close` or `request-close` for a dialog.":"Give the target a `popover` attribute, or point the button elsewhere."} ${Xe}`,message:`${m} sends ${u} to "${d}", which is not a popover.`,path:t,rule:"command-target-mismatch",severity:"error"});else if(PO(u)&&!cY(y))a.push({detail:`A custom command is a \`CommandEvent\` dispatched at its target, and "${d}" has no `+"`oncommand` handler to answer it — so the click does nothing. Add one that switches on "+`\`event#/command\`, or use a built-in command. ${Xe}`,message:`${m} sends ${u} to "${d}", which handles no command.`,path:t,rule:"custom-command-unhandled",severity:"warn"})}}return a}function fY(e,t,r){let n=[],i=Zt(e,"the dialog"),s=Ri(e),{style:o}=e,a=Dt(e,"closedby");if(a!==null&&!sY.has(a))n.push({detail:`\`closedby\` is an enumerated attribute taking \`any\` (light dismiss and Escape), \`closerequest\` (Escape only, the default for a modal) or \`none\`. Anything else is the invalid-value default, \`auto\`, which is the same as leaving it out. ${Xe}`,message:`${i} declares closedby="${a}", which is not any, closerequest or none.`,path:t,rule:"dialog-closedby-invalid",severity:"error"});if(Qt(o,"display")!==null)n.push({detail:`A closed dialog is hidden by the browser's own \`dialog:not([open]) { display: none }\`. That rule is UA-origin, so any author \`display\` beats it, and the dialog is laid out on every page whether or not anyone opened it. \`display\` belongs in the \`&[open]\` rule and nowhere else. ${Xe}`,fix:"display",message:`${i} sets display in its base rule.`,path:t,rule:"dialog-display",severity:"error"});let c=s===null?void 0:r.get(s),l=Dt(e,"open")!==null||Pn(e).open===!0||e.open===!0;if(s!==null&&!c?.has("show-modal")&&!l)n.push({detail:`No <button> in this document opens it with \`command="show-modal"\`. If it is opened from another file or from a function that calls \`showModal()\`, this is fine; otherwise there is no way for a reader to open it. ${Xe}`,message:`${i} has no invoker in this document.`,path:t,rule:"dialog-no-invoker",severity:"warn"});if(c?.has("show-modal")&&a==="none"&&!lY(e,s))n.push({detail:`A modal dialog makes everything outside it inert, so the only ways out are the ones it offers: \`closedby="none"\` turns off Escape and light dismiss, and nothing inside it closes it. A reader who opens it cannot leave. Add a <button command="close"> inside, or drop \`closedby="none"\`. ${Xe}`,message:`${i} opens modally, closes on nothing, and has no close button.`,path:t,rule:"modal-without-close",severity:"error"});return n}var kO,tY,rY,nY,iY,sY,oY;var jO=L(()=>{Ee();Qu();kO=["toggle-popover","show-popover","hide-popover","show-modal","close","request-close"],tY=new Set(["show-modal","close","request-close"]),rY=new Set(["toggle-popover","show-popover","hide-popover"]),nY=["any","closerequest","none"],iY=new Set(kO),sY=new Set(nY),oY=new Set(["button"])});var JO=C(function(LO){Object.defineProperty(LO,"__esModule",{value:!0});LO.formatNames=LO.fastFormats=LO.fullFormats=void 0;function An(e,t){return{validate:e,compare:t}}LO.fullFormats={date:An(IO,ag),time:An(sg(!0),cg),"date-time":An(RO(!0),NO),"iso-time":An(sg(),TO),"iso-date-time":An(RO(),MO),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:yY,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:EY,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:bY,int32:{type:"number",validate:vY},int64:{type:"number",validate:wY},float:{type:"number",validate:CO},double:{type:"number",validate:CO},password:!0,binary:!0};LO.fastFormats={...LO.fullFormats,date:An(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,ag),time:An(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,cg),"date-time":An(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,NO),"iso-time":An(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,TO),"iso-date-time":An(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,MO),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};LO.formatNames=Object.keys(LO.fullFormats);function dY(e){return e%4===0&&(e%100!==0||e%400===0)}var pY=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,mY=[0,31,28,31,30,31,30,31,31,30,31,30,31];function IO(e){let t=pY.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],i=+t[3];return n>=1&&n<=12&&i>=1&&i<=(n===2&&dY(r)?29:mY[n])}function ag(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var ig=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function sg(e){return function(r){let n=ig.exec(r);if(!n)return!1;let i=+n[1],s=+n[2],o=+n[3],a=n[4],c=n[5]==="-"?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||e&&!a)return!1;if(i<=23&&s<=59&&o<60)return!0;let d=s-u*c,h=i-l*c-(d<0?1:0);return(h===23||h===-1)&&(d===59||d===-1)&&o<61}}function cg(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(!(r&&n))return;return r-n}function TO(e,t){if(!(e&&t))return;let r=ig.exec(e),n=ig.exec(t);if(!(r&&n))return;if(e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t)return 1;if(e<t)return-1;return 0}var og=/t|\s/i;function RO(e){let t=sg(e);return function(n){let i=n.split(og);return i.length===2&&IO(i[0])&&t(i[1])}}function NO(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(!(r&&n))return;return r-n}function MO(e,t){if(!(e&&t))return;let[r,n]=e.split(og),[i,s]=t.split(og),o=ag(r,i);if(o===void 0)return;return o||cg(n,s)}var hY=/\/|:/,gY=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function yY(e){return hY.test(e)&&gY.test(e)}var OO=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function bY(e){return OO.lastIndex=0,OO.test(e)}var xY=-2147483648,$Y=2147483647;function vY(e){return Number.isInteger(e)&&e<=$Y&&e>=xY}function wY(e){return Number.isInteger(e)}function CO(){return!0}var SY=/[^\\]\\Z/;function EY(e){if(SY.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var BO=C(function(qO){Object.defineProperty(qO,"__esModule",{value:!0});var PY=Th(),kY=Lh(),AY=Uh(),jY=Kh(),FO=Gh(),RY=[PY.default,kY.default,(0,AY.default)(),jY.default,FO.metadataVocabulary,FO.contentVocabulary];qO.default=RY});var HO=C(function(qle,CY){CY.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var VO=C(function(gr,ug){Object.defineProperty(gr,"__esModule",{value:!0});gr.MissingRefError=gr.ValidationError=gr.CodeGen=gr.Name=gr.nil=gr.stringify=gr.str=gr._=gr.KeywordCxt=gr.Ajv=void 0;var IY=Ih(),TY=BO(),NY=Xh(),UO=HO(),MY=["/properties"],tf="http://json-schema.org/draft-07/schema";class yc extends IY.default{_addVocabularies(){if(super._addVocabularies(),TY.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(NY.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(UO,MY):UO;this.addMetaSchema(e,tf,!1),this.refs["http://json-schema.org/schema"]=tf}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(tf)?tf:void 0)}}gr.Ajv=yc;ug.exports=gr=yc;ug.exports.Ajv=yc;Object.defineProperty(gr,"__esModule",{value:!0});gr.default=yc;var LY=Eo();Object.defineProperty(gr,"KeywordCxt",{enumerable:!0,get:function(){return LY.KeywordCxt}});var No=be();Object.defineProperty(gr,"_",{enumerable:!0,get:function(){return No._}});Object.defineProperty(gr,"str",{enumerable:!0,get:function(){return No.str}});Object.defineProperty(gr,"stringify",{enumerable:!0,get:function(){return No.stringify}});Object.defineProperty(gr,"nil",{enumerable:!0,get:function(){return No.nil}});Object.defineProperty(gr,"Name",{enumerable:!0,get:function(){return No.Name}});Object.defineProperty(gr,"CodeGen",{enumerable:!0,get:function(){return No.CodeGen}});var DY=ec();Object.defineProperty(gr,"ValidationError",{enumerable:!0,get:function(){return DY.default}});var JY=_o();Object.defineProperty(gr,"MissingRefError",{enumerable:!0,get:function(){return JY.default}})});var zO=C(function(WO){Object.defineProperty(WO,"__esModule",{value:!0});WO.formatLimitDefinition=void 0;var BY=VO(),cn=be(),Ci=cn.operators,rf={formatMaximum:{okStr:"<=",ok:Ci.LTE,fail:Ci.GT},formatMinimum:{okStr:">=",ok:Ci.GTE,fail:Ci.LT},formatExclusiveMaximum:{okStr:"<",ok:Ci.LT,fail:Ci.GTE},formatExclusiveMinimum:{okStr:">",ok:Ci.GT,fail:Ci.LTE}},HY={message:({keyword:e,schemaCode:t})=>cn.str`should be ${rf[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>cn._`{comparison: ${rf[e].okStr}, limit: ${t}}`};WO.formatLimitDefinition={keyword:Object.keys(rf),type:"string",schemaType:"string",$data:!0,error:HY,code(e){let{gen:t,data:r,schemaCode:n,keyword:i,it:s}=e,{opts:o,self:a}=s;if(!o.validateFormats)return;let c=new BY.KeywordCxt(s,a.RULES.all.format.definition,"format");if(c.$data)l();else u();function l(){let h=t.scopeValue("formats",{ref:a.formats,code:o.code.formats}),m=t.const("fmt",cn._`${h}[${c.schemaCode}]`);e.fail$data(cn.or(cn._`typeof ${m} != "object"`,cn._`${m} instanceof RegExp`,cn._`typeof ${m}.compare != "function"`,d(m)))}function u(){let h=c.schema,m=a.formats[h];if(!m||m===!0)return;if(typeof m!="object"||m instanceof RegExp||typeof m.compare!="function")throw Error(`"${i}": format "${h}" does not define "compare" function`);let y=t.scopeValue("formats",{key:h,ref:m,code:o.code.formats?cn._`${o.code.formats}${cn.getProperty(h)}`:void 0});e.fail$data(d(y))}function d(h){return cn._`${h}.compare(${r}, ${n}) ${rf[i].fail} 0`}},dependencies:["format"]};var UY=(e)=>(e.addKeyword(WO.formatLimitDefinition),e);WO.default=UY});var XO=C(function(bc,YO){Object.defineProperty(bc,"__esModule",{value:!0});var Mo=JO(),WY=zO(),dg=be(),KO=new dg.Name("fullFormats"),zY=new dg.Name("fastFormats"),pg=(e,t={keywords:!0})=>{if(Array.isArray(t))return GO(e,t,Mo.fullFormats,KO),e;let[r,n]=t.mode==="fast"?[Mo.fastFormats,zY]:[Mo.fullFormats,KO],i=t.formats||Mo.formatNames;if(GO(e,i,r,n),t.keywords)(0,WY.default)(e);return e};pg.get=(e,t="full")=>{let n=(t==="fast"?Mo.fastFormats:Mo.fullFormats)[e];if(!n)throw Error(`Unknown format "${e}"`);return n};function GO(e,t,r,n){var i,s;(i=(s=e.opts.code).formats)!==null&&i!==void 0||(s.formats=dg._`require("ajv-formats/dist/formats").${n}`);for(let o of t)e.addFormat(o,r[o])}YO.exports=bc=pg;Object.defineProperty(bc,"__esModule",{value:!0});bc.default=pg});import{existsSync as ZO,readFileSync as eC,readdirSync as tC,statSync as rC}from"node:fs";import{createRequire as KY}from"node:module";import{join as nC,relative as mg,resolve as hg}from"node:path";async function QY(){try{let{default:e}=await Promise.resolve().then(() => Bt(eg(),1)),{default:t}=await Promise.resolve().then(() => Bt(XO(),1));return{addFormats:t,Ajv:e}}catch(e){throw Error("Project validation requires ajv and ajv-formats: bun add ajv ajv-formats",{cause:e})}}async function iC(e,t={}){let r=hg(e),n=[],i=[],s=0;for(let P of["project.schema.json","document.schema.json"]){let E=hg(r,P);if(!ZO(E))continue;s+=1;let w=xc(E),k=eX(w);if(k.length>0)n.push({errors:k.map(({reason:R,ref:j})=>({message:`$ref "${j}" ${R} — committed entry documents must be self-contained `+"single-resource schemas; regenerate with `jx schema`"})),file:P})}if(n.length>0)return{checked:s,issues:n,lint:i,valid:!1};let o=await pO(r);if(s+=1,!o.valid)n.push({errors:o.errors??[],file:"project.json"});let{addFormats:a,Ajv:c}=await QY(),{document:l}=await p1(r,{write:!1}),u=new c({allErrors:!0,ownProperties:!0,strict:!1});a(u);let d=u.compile(l),h=gO(QO(r).flatMap((P)=>{try{return[JSON.parse(eC(P,"utf8"))]}catch{return[]}}));for(let P of GY)for(let E of aC(hg(r,P))){if(E.endsWith(".class.json"))continue;s+=1;let w=xc(E);if(d(w))i.push(...ZY(w,mg(r,E),h));else n.push({errors:d.errors??[],file:mg(r,E)})}let m=new c({allErrors:!0,ownProperties:!0,strict:!1});a(m);let y=m.compile(Hm());for(let P of QO(r)){s+=1;let E=xc(P);if(!y(E))n.push({errors:y.errors??[],file:mg(r,P)})}let{config:g}=ni(r),b=await ri(r,g),x=KY(import.meta.url);for(let P of b.extensions)for(let E of["project","document","fields"]){let w=P.schemas[E];if(!w)continue;s+=1;let k=new c({allErrors:!0,ownProperties:!0,strict:!1});a(k);for(let R of XY){let j=x.resolve(R);k.addSchema(xc(j))}try{k.compile(xc(w))}catch(R){n.push({errors:[{message:R instanceof Error?R.message:String(R)}],file:`${P.specifier} (${E} fragment)`})}}let _=t.strict===!0&&i.some((P)=>P.severity==="error");return{checked:s,issues:n,lint:i,valid:n.length===0&&!_}}function xc(e){return JSON.parse(eC(e,"utf8"))}function ZY(e,t,r){let n=[];for(let i of vO(e,r))n.push({...gg(i),file:t,source:"popover"});for(let i of AO(e,r))n.push({...gg(i),file:t,source:"dialog"});for(let i of EO(e))n.push({...gg(i),criterion:i.criterion,file:t,source:"accessibility"});return n}function gg(e){return{detail:e.detail,message:e.message,path:e.path,rule:e.rule,severity:e.severity}}function sC(e){return e.lint.map((t)=>{let r=t.criterion===void 0?`${t.source}/${t.rule}`:`${t.source}/${t.rule}, WCAG ${t.criterion}`;return`${t.file}: ${t.severity}: ${t.message} [${r}]`})}function eX(e){let t=[],r=new Set,n=(s)=>{let o=e;for(let a of s.slice(1).split("/")){if(a==="")continue;let c=a.replaceAll("~1","/").replaceAll("~0","~");if(!J(o))return!1;if(o=o[c],o===void 0)return!1}return!0},i=(s)=>{if(!ee(s)||r.has(s))return;r.add(s);let o=s.$ref;if(T(o)){if(/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(o))t.push({reason:"is an absolute URI editors resolve over the network",ref:o});else if(!o.startsWith("#"))t.push({reason:"is a relative path only Node module resolution can follow",ref:o});else if(o.length>1&&!o.startsWith("#/"))t.push({reason:"is an $anchor reference, which has no root-pointer form",ref:o});else if(o.length>1&&!n(o.slice(1)))t.push({reason:"points at no node in this document",ref:o})}for(let[a,c]of Object.entries(s)){if(!tX.has(a))continue;if(Array.isArray(c))for(let l of c)i(l);else if(ee(c)){if(i(c),oC.has(a))for(let l of Object.values(c))i(l)}}};return i(e),t}function aC(e){if(!ZO(e))return[];let t=[];for(let r of tC(e)){let n=nC(e,r);if(rC(n).isDirectory())t.push(...aC(n));else if(r.endsWith(".json"))t.push(n)}return t.toSorted()}function QO(e){let t=[],r=(n)=>{for(let i of tC(n)){if(YY.has(i))continue;let s=nC(n,i);if(rC(s).isDirectory())r(s);else if(i.endsWith(".class.json"))t.push(s)}};return r(e),t.toSorted()}function cC(e){let t=[];for(let r of e.issues){t.push(`${r.file}:`);for(let n of r.errors){let i=ee(n)?n:{},{instancePath:s,message:o}=i;t.push(` - ${s||"/"}: ${o??JSON.stringify(n)}`)}}return t}var GY,YY,XY,oC,tX;var lC=L(()=>{iP();mO();_O();jO();Qu();Ee();On();Ho();Rm();GY=["components","pages","layouts"],YY=new Set(["node_modules","dist",".git"]),XY=["@jxsuite/schema/schemas/project.core.schema.json","@jxsuite/schema/schemas/project.fields.schema.json","@jxsuite/schema/schemas/document.paths.schema.json"];oC=new Set(["$defs","definitions","dependencies","dependentSchemas","patternProperties","properties"]),tX=new Set([...oC,"additionalItems","additionalProperties","allOf","anyOf","contains","contentSchema","else","if","items","not","oneOf","prefixItems","propertyNames","then","unevaluatedItems","unevaluatedProperties"])});vr();import{relative as yg,resolve as uC}from"node:path";async function rX(){let e=process.argv.slice(2),[t]=e;if(!t||t==="--help"||t==="-h")console.log(`Usage: jx <command> [options]
569
+ deps: ${r}}`};var o4={keyword:"dependencies",type:"object",schemaType:"object",error:f_.error,code(e){let[t,r]=a4(e);u_(e,t),d_(e,r)}};function a4({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 u_(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=Zo.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)Zo.checkReportMissingProp(e,c)});else r.if(dp._`${l} && (${Zo.checkMissingProp(e,a,i)})`),Zo.reportMissingProp(e,i),r.else()}}f_.validatePropertyDeps=u_;function d_(e,t=e.schema){let{gen:r,data:n,keyword:s,it:i}=e,o=r.name("valid");for(let a in t){if(i4.alwaysValidSchema(i,t[a]))continue;r.if(Zo.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)}}f_.validateSchemaDeps=d_;f_.default=o4});var y_=C(function(g_){Object.defineProperty(g_,"__esModule",{value:!0});var h_=ye(),u4=we(),d4={message:"property name must be valid",params:({params:e})=>h_._`{propertyName: ${e.propertyName}}`},f4={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:d4,code(e){let{gen:t,schema:r,data:n,it:s}=e;if(u4.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(h_.not(i),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(i)}};g_.default=f4});var fp=C(function(b_){Object.defineProperty(b_,"__esModule",{value:!0});var dc=yr(),Rr=ye(),m4=gr(),fc=we(),h4={message:"must NOT have additional properties",params:({params:e})=>Rr._`{additionalProperty: ${e.additionalProperty}}`},g4={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:h4,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"&&fc.alwaysValidSchema(o,r))return;let c=dc.allSchemaProperties(n.properties),d=dc.allSchemaProperties(n.patternProperties);p(),e.ok(Rr._`${i} === ${m4.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=fc.schemaRefOrVal(o,n.properties,"properties");v=dc.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._`${dc.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"&&!fc.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:fc.Type.Str};if(j===!1)Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(S,v)}}};b_.default=g4});var w_=C(function(v_){Object.defineProperty(v_,"__esModule",{value:!0});var b4=wi(),$_=yr(),pp=we(),x_=fp(),x4={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)x_.default.code(new b4.KeywordCxt(i,x_.default,"additionalProperties"));let o=$_.allSchemaProperties(r);for(let p of o)i.definedProperties.add(p);if(i.opts.unevaluated&&o.length&&i.props!==!0)i.props=pp.mergeEvaluated.props(t,pp.toHash(o),i.props);let a=o.filter((p)=>!pp.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($_.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)}}};v_.default=x4});var j_=C(function(P_){Object.defineProperty(P_,"__esModule",{value:!0});var S_=yr(),pc=ye(),E_=we(),__=we(),v4={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:i}=e,{opts:o}=i,a=S_.allSchemaProperties(r),l=a.filter((g)=>E_.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 pc.Name))i.props=__.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))E_.checkStrictMode(i,`property ${y} matches pattern ${g} (use allowMatchingProperties)`)}function b(g){t.forIn("key",n,(y)=>{t.if(pc._`${S_.usePattern(e,g)}.test(${y})`,()=>{let v=l.includes(g);if(!v)e.subschema({keyword:"patternProperties",schemaProp:g,dataProp:y,dataPropType:__.Type.Str},d);if(i.opts.unevaluated&&p!==!0)t.assign(pc._`${p}[${y}]`,!0);else if(!v&&!i.allErrors)t.if(pc.not(d),()=>t.break())})})}}};P_.default=v4});var R_=C(function(k_){Object.defineProperty(k_,"__esModule",{value:!0});var S4=we(),E4={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(S4.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"}};k_.default=E4});var O_=C(function(A_){Object.defineProperty(A_,"__esModule",{value:!0});var P4=yr(),j4={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:P4.validateUnion,error:{message:"must match a schema in anyOf"}};A_.default=j4});var N_=C(function(C_){Object.defineProperty(C_,"__esModule",{value:!0});var mc=ye(),R4=we(),A4={message:"must match exactly one schema in oneOf",params:({params:e})=>mc._`{passingSchemas: ${e.passing}}`},O4={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:A4,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(R4.alwaysValidSchema(s,d))t.var(l,!0);else h=e.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},l);if(p>0)t.if(mc._`${l} && ${o}`).assign(o,!1).assign(a,mc._`[${a}, ${p}]`).else();t.if(l,()=>{if(t.assign(o,!0),t.assign(a,p),h)e.mergeEvaluated(h,mc.Name)})})}}};C_.default=O4});var I_=C(function(T_){Object.defineProperty(T_,"__esModule",{value:!0});var N4=we(),T4={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(N4.alwaysValidSchema(n,i))return;let a=e.subschema({keyword:"allOf",schemaProp:o},s);e.ok(s),e.mergeEvaluated(a)})}};T_.default=T4});var L_=C(function(D_){Object.defineProperty(D_,"__esModule",{value:!0});var hc=ye(),J_=we(),M4={message:({params:e})=>hc.str`must match "${e.ifClause}" schema`,params:({params:e})=>hc._`{failingKeyword: ${e.ifClause}}`},J4={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:M4,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)J_.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=M_(n,"then"),i=M_(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(hc.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,hc._`${d}`);else e.setParams({ifClause:d})}}}};function M_(e,t){let r=e.schema[t];return r!==void 0&&!J_.alwaysValidSchema(e,r)}D_.default=J4});var q_=C(function(F_){Object.defineProperty(F_,"__esModule",{value:!0});var L4=we(),F4={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)L4.checkStrictMode(r,`"${e}" without "if" is ignored`)}};F_.default=F4});var mp=C(function(H_){Object.defineProperty(H_,"__esModule",{value:!0});var H4=cp(),V4=s_(),B4=up(),W4=a_(),U4=c_(),z4=uc(),G4=y_(),K4=fp(),Y4=w_(),X4=j_(),Z4=R_(),Q4=O_(),eB=N_(),tB=I_(),rB=L_(),nB=q_();function sB(e=!1){let t=[Z4.default,Q4.default,eB.default,tB.default,rB.default,nB.default,G4.default,K4.default,z4.default,Y4.default,X4.default];if(e)t.push(V4.default,W4.default);else t.push(H4.default,B4.default);return t.push(U4.default),t}H_.default=sB});var gp=C(function(W_){Object.defineProperty(W_,"__esModule",{value:!0});W_.dynamicAnchor=void 0;var hp=ye(),oB=gr(),V_=qo(),aB=sc(),lB={keyword:"$dynamicAnchor",schemaType:"string",code:(e)=>B_(e,e.schema)};function B_(e,t){let{gen:r,it:n}=e;n.schemaEnv.root.dynamicAnchors[t]=!0;let s=hp._`${oB.default.dynamicAnchors}${hp.getProperty(t)}`,i=n.errSchemaPath==="#"?n.validateName:cB(e);r.if(hp._`!${s}`,()=>r.assign(s,i))}W_.dynamicAnchor=B_;function cB(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 V_.SchemaEnv({schema:r,schemaId:l,root:s,baseId:i,localRefs:o,meta:a});return V_.compileSchema.call(n,c),aB.getValidate(e,c)}W_.default=lB});var yp=C(function(Y_){Object.defineProperty(Y_,"__esModule",{value:!0});Y_.dynamicRef=void 0;var G_=ye(),dB=gr(),z_=sc(),fB={keyword:"$dynamicRef",schemaType:"string",code:(e)=>K_(e,e.schema)};function K_(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",G_._`${dB.default.dynamicAnchors}${G_.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(()=>{z_.callRef(e,l),r.let(c,!0)}):()=>z_.callRef(e,l)}}Y_.dynamicRef=K_;Y_.default=fB});var Q_=C(function(Z_){Object.defineProperty(Z_,"__esModule",{value:!0});var mB=gp(),hB=we(),gB={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){if(e.schema)mB.dynamicAnchor(e,"");else hB.checkStrictMode(e.it,"$recursiveAnchor: false is ignored")}};Z_.default=gB});var tP=C(function(eP){Object.defineProperty(eP,"__esModule",{value:!0});var bB=yp(),xB={keyword:"$recursiveRef",schemaType:"string",code:(e)=>bB.dynamicRef(e,e.schema)};eP.default=xB});var nP=C(function(rP){Object.defineProperty(rP,"__esModule",{value:!0});var vB=gp(),wB=yp(),SB=Q_(),EB=tP(),_B=[vB.default,wB.default,SB.default,EB.default];rP.default=_B});var oP=C(function(iP){Object.defineProperty(iP,"__esModule",{value:!0});var sP=uc(),jB={keyword:"dependentRequired",type:"object",schemaType:"object",error:sP.error,code:(e)=>sP.validatePropertyDeps(e)};iP.default=jB});var lP=C(function(aP){Object.defineProperty(aP,"__esModule",{value:!0});var RB=uc(),AB={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(e)=>RB.validateSchemaDeps(e)};aP.default=AB});var uP=C(function(cP){Object.defineProperty(cP,"__esModule",{value:!0});var CB=we(),NB={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:r}){if(t.contains===void 0)CB.checkStrictMode(r,`"${e}" without "contains" is ignored`)}};cP.default=NB});var fP=C(function(dP){Object.defineProperty(dP,"__esModule",{value:!0});var IB=oP(),MB=lP(),JB=uP(),DB=[IB.default,MB.default,JB.default];dP.default=DB});var hP=C(function(mP){Object.defineProperty(mP,"__esModule",{value:!0});var Xn=ye(),pP=we(),FB=gr(),qB={message:"must NOT have unevaluated properties",params:({params:e})=>Xn._`{unevaluatedProperty: ${e.unevaluatedProperty}}`},HB={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:qB,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 Xn.Name)t.if(Xn._`${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(Xn._`${s} === ${FB.default.errors}`);function l(p){if(r===!1){if(e.setParams({unevaluatedProperty:p}),e.error(),!o)t.break();return}if(!pP.alwaysValidSchema(i,r)){let h=t.name("valid");if(e.subschema({keyword:"unevaluatedProperties",dataProp:p,dataPropType:pP.Type.Str},h),!o)t.if(Xn.not(h),()=>t.break())}}function c(p,h){return Xn._`!${p} || !${p}[${h}]`}function d(p,h){let m=[];for(let b in p)if(p[b]===!0)m.push(Xn._`${h} !== ${b}`);return Xn.and(...m)}}};mP.default=HB});var bP=C(function(yP){Object.defineProperty(yP,"__esModule",{value:!0});var Ns=ye(),gP=we(),BB={message:({params:{len:e}})=>Ns.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Ns._`{limit: ${e}}`},WB={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:BB,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",Ns._`${n}.length`);if(r===!1)e.setParams({len:i}),e.fail(Ns._`${o} > ${i}`);else if(typeof r=="object"&&!gP.alwaysValidSchema(s,r)){let l=t.var("valid",Ns._`${o} <= ${i}`);t.if(Ns.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:gP.Type.Num},l),!s.allErrors)t.if(Ns.not(l),()=>t.break())})}}};yP.default=WB});var $P=C(function(xP){Object.defineProperty(xP,"__esModule",{value:!0});var zB=hP(),GB=bP(),KB=[zB.default,GB.default];xP.default=KB});var wP=C(function(vP){Object.defineProperty(vP,"__esModule",{value:!0});var rt=ye(),XB={message:({schemaCode:e})=>rt.str`must match format "${e}"`,params:({schemaCode:e})=>rt._`{format: ${e}}`},ZB={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:XB,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})`}}}};vP.default=ZB});var bp=C(function(SP){Object.defineProperty(SP,"__esModule",{value:!0});var eW=wP(),tW=[eW.default];SP.default=tW});var xp=C(function(EP){Object.defineProperty(EP,"__esModule",{value:!0});EP.contentVocabulary=EP.metadataVocabulary=void 0;EP.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];EP.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var kP=C(function(jP){Object.defineProperty(jP,"__esModule",{value:!0});var sW=sp(),iW=ap(),oW=mp(),aW=nP(),lW=fP(),cW=$P(),uW=bp(),PP=xp(),dW=[aW.default,sW.default,iW.default,(0,oW.default)(!0),uW.default,PP.metadataVocabulary,PP.contentVocabulary,lW.default,cW.default];jP.default=dW});var CP=C(function(AP){Object.defineProperty(AP,"__esModule",{value:!0});AP.DiscrError=void 0;var RP;(function(e){e.Tag="tag",e.Mapping="mapping"})(RP||(AP.DiscrError=RP={}))});var vp=C(function(TP){Object.defineProperty(TP,"__esModule",{value:!0});var ji=ye(),$p=CP(),NP=qo(),pW=Si(),mW=we(),hW={message:({params:{discrError:e,tagName:t}})=>e===$p.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}}`},gW={keyword:"discriminator",type:"object",schemaType:"object",error:hW,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:$p.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:$p.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)&&!mW.schemaHasRulesButRef(E,i.self.RULES)){let R=E.$ref;if(E=NP.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,R),E instanceof NP.SchemaEnv)E=E.schema;if(E===void 0)throw new pW.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}}}};TP.default=gW});var IP=C(function(kQ,bW){bW.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 MP=C(function(RQ,xW){xW.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 JP=C(function(AQ,$W){$W.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 DP=C(function(OQ,vW){vW.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 LP=C(function(CQ,wW){wW.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 FP=C(function(NQ,SW){SW.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 qP=C(function(TQ,EW){EW.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 HP=C(function(IQ,_W){_W.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 BP=C(function(VP){Object.defineProperty(VP,"__esModule",{value:!0});var PW=IP(),jW=MP(),kW=JP(),RW=DP(),AW=LP(),OW=FP(),CW=qP(),NW=HP(),TW=["/properties"];function IW(e){return[PW,jW,kW,RW,AW,t(this,OW),CW,t(this,NW)].forEach((r)=>this.addMetaSchema(r,void 0,!1)),this;function t(r,n){return e?r.$dataMetaSchema(n,TW):n}}VP.default=IW});var Ep=C(function(Yt,Sp){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 JW=np(),DW=kP(),LW=vp(),FW=BP(),wp="https://json-schema.org/draft/2020-12/schema";class Qo extends JW.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),DW.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(LW.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;if(!t)return;FW.default.call(this,e),this.refs["http://json-schema.org/schema"]=wp}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(wp)?wp:void 0)}}Yt.Ajv2020=Qo;Sp.exports=Yt=Qo;Sp.exports.Ajv2020=Qo;Object.defineProperty(Yt,"__esModule",{value:!0});Yt.default=Qo;var qW=wi();Object.defineProperty(Yt,"KeywordCxt",{enumerable:!0,get:function(){return qW.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 HW=Lo();Object.defineProperty(Yt,"ValidationError",{enumerable:!0,get:function(){return HW.default}});var VW=Si();Object.defineProperty(Yt,"MissingRefError",{enumerable:!0,get:function(){return VW.default}})});import{existsSync as yc,readFileSync as UW}from"node:fs";import{createRequire as WP}from"node:module";import{isAbsolute as zW,relative as GW,resolve as gc}from"node:path";import{fileURLToPath as UP,pathToFileURL as KW}from"node:url";function ea(e){return JSON.parse(UW(e,"utf8"))}async function zP(e){let t=gc(e),r=gc(t,"project.json"),n=gc(t,"project.schema.json");if(!yc(r))throw Error(`project.json not found in ${t}`);if(!yc(n))throw Error(`project.schema.json not found in ${t} — run \`jx schema\` to generate it from `+"project.json#/extensions");let s=ea(r),i=ea(n);i.$id=KW(n).href;let o;try{({default:o}=await Promise.resolve().then(() => Lt(Ep(),1)))}catch(d){throw Error("Project validation requires ajv: bun add ajv",{cause:d})}let l=await new o({allErrors:!0,loadSchema:(d)=>YW(d,t),strict:!1}).compileAsync(i),c=l(s);return{errors:l.errors??null,valid:c}}async function YW(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=UP(e),n=GW(t,r);if(n.startsWith("..")||zW(n))throw Error(`Schema ref "${e}" escapes the project root ${t}`);if(yc(r))return ea(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="@jxsuite/schema/",c;try{c=WP(gc(t,"package.json")).resolve(a)}catch(d){if(!a.startsWith(l))throw Error(`Schema ref "${e}" does not exist and "${a}" is not resolvable from the `+"project — is the package installed?",{cause:d});try{c=WP(import.meta.url).resolve(a)}catch(p){let h=UP(new URL(`../${a.slice(l.length)}`,import.meta.url));if(yc(h))return ea(h);throw Error(`Schema ref "${e}" does not exist and "${a}" is not resolvable from the project or this host's core`,{cause:p})}}return ea(c)}var GP=()=>{};function Gr(e){return ee(e.attributes)?e.attributes:{}}function _t(e,t){let r=Gr(e)[t];return T(r)?r:null}function nt(e){return T(e.tagName)?e.tagName.toLowerCase():""}function It(e,t="the popover"){let r=T(e.id)?e.id:_t(e,"id");if(r)return`#${r}`;let n=nt(e);return n===""?t:`the <${n}>`}function QW(e){let t=Gr(e).popover;return T(t)?t:null}function YP(e){let t=new Set,r=new Set;for(let n of e){let s=n!==null&&T(n.tagName)?n.tagName:"";if(n===null||!s.includes("-"))continue;if(_p(n))t.add(s);let i=n.observedAttributes;if(Array.isArray(i)&&eU.every((o)=>i.includes(o)))r.add(s)}return{invokerTags:r,popoverTags:t}}function _p(e){return"popover"in Gr(e)||"popover"in e}function ta(e,t){return _p(e)||(t?.popoverTags?.has(nt(e))??!1)}function Zn(e){if(T(e.id)&&e.id!=="")return e.id;let t=_t(e,"id");return t===""?null:t}function*zr(e,t=[],r=null,n){yield{enclosing:r,node:e,path:t};let s=ta(e,n)?e:r,{children:i}=e;if(Array.isArray(i)){for(let[l,c]of i.entries())if(F(c))yield*zr(c,[...t,"children",l],s,n)}else if(ee(i)&&Ft(i.map))yield*zr(i.map,[...t,"children","map"],s,n);let o=Ft(e.map)?e.map:null;if(o)yield*zr(o,[...t,"map"],s,n);let a=ee(e.cases)?e.cases:{};for(let[l,c]of Object.entries(a))if(F(c))yield*zr(c,[...t,"cases",l],s,n)}function Pp(e,t){let r=[];for(let{node:n}of zr(e,[],null,t)){if(!ta(n,t))continue;let s=Zn(n);if(s!==null&&!r.includes(s))r.push(s)}return r}function bc(e){return e.startsWith("@")}function XP(e){return e.startsWith(":")||e.startsWith("&")||e.startsWith(".")||e.startsWith("[")}function Tt(e,t){let r=e?.[t];if(r===void 0||is(r)||Array.isArray(r))return null;return String(r)}function ZP(e){for(let[t,r]of Object.entries(e??{})){if(!is(r))continue;if(XP(t)&&t.includes(":popover-open")&&Tt(r,"display")!==null)return!0;if(bc(t)&&ZP(r))return!0}return!1}function QP(e){for(let[t,r]of Object.entries(e??{})){if(!is(r))continue;if(XP(t)&&t.includes(":popover-open"))return!0;if(bc(t)&&QP(r))return!0}return!1}function rU(e){return tU.some((t)=>Tt(e,t)!==null)}function nU(e){if(!e)return[];let t=[];for(let[r,n]of Object.entries(e))if(bc(r)&&is(n)&&Tt(n,"display")!==null)t.push(r);return t}function ej(e){if(!e)return[];let t=[],r=Tt(e,"transition");if(r!==null)t.push(r);for(let[n,s]of Object.entries(e))if(bc(n)&&is(s))t.push(...ej(s));return t}function sU(e){if(!e)return!1;if(Tt(e,"positionAnchor")!==null||Tt(e,"position-anchor")!==null)return!0;return["top","left","right","bottom","inset","insetBlockStart","insetInlineStart"].some((t)=>(Tt(e,t)??"").includes("anchor("))}function iU(e){if(!e)return!1;if(Tt(e,"positionArea")!==null||Tt(e,"position-area")!==null||Tt(e,"positionTryFallbacks")!==null||Tt(e,"position-try-fallbacks")!==null)return!0;return Object.keys(e).some((t)=>t.startsWith("@supports"))}function tj(e,t){let r=[...zr(e,[],null,t)],n=Pp(e,t),s=r.some(({node:a})=>ta(a,t)),i=new Set;for(let{node:a}of r)if(KP.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(...oU(l,c,a,n,s,t)),_p(l))o.push(...aU(l,c,i));return o}function oU(e,t,r,n,s,i){let o=[],a=nt(e),l=_t(e,"popovertarget"),c=KP.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&&Zn(r)!==null&&Zn(r)!==l)o.push({detail:`This control is inside ${It(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 ${It(r)} targets "${l}" instead.`,path:t,rule:"target-mismatch",severity:"warn"})}if(a==="a"&&r!==null&&l===null){let d=_t(e,"href")??(T(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 ${It(r)} does not dismiss it.`,path:t,rule:"link-does-not-dismiss",severity:"warn"})}}return o}function aU(e,t,r){let n=[],{style:s}=e,i=It(e),o=QW(e);if(o!==null&&o!==""&&!ZW.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(Gr(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=Tt(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 nU(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(Tt(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(!QP(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(!ZP(s)&&a===null&&rU(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 ej(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(sU(s)&&!iU(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=Zn(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 ZW,KP,eU,tU,Ve="See docs/framework/concepts/overlays.";var xc=q(()=>{ve();ZW=["auto","manual","hint"],KP=new Set(["button","input"]);eU=["popovertarget","popovertargetaction","command","commandfor"];tU=["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=Gr(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(T(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 Qn(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 $c(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 vc(e){let t=e.textContent;if(T(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(T(s)){if(s.trim()!=="")return!0}else if(F(s)&&vc(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)&&vc(s))}function*Ri(e,t=[],r=[],n=[]){yield{node:e,path:t,roles:r,tags:n};let s=[...r,Qn(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 pU(e){return e.some((t)=>t.includes("-"))}function Kr(e,t,r,n,s,i="error"){return{criterion:s,detail:`${n} ${lU}`,message:r,path:t,rule:e,severity:i}}function rj(e,t,r){if(r.includes("label"))return!0;if(e===Oi||t.bound)return!0;return e!==null&&t.ids.has(e)}function mU(e,t){let{node:r,path:n,tags:s}=e,i=nt(r),o=Qn(r);if(o==="bound")return null;if(xr(r,"aria-label")||Pt(r,"aria-labelledby")||xr(r,"title"))return null;let l=It(r,"the control"),c=(p)=>Kr("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=hU(r,i,t,s);if(d==="named"||d==="exempt")return null;if(o!==null&&cU.has(o))return vc(r)?null:c("Give it text content, or an aria-label.");if(o!==null&&uU.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 vc(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 hU(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 rj($c(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(dU.has(s))return xr(e,"value")?"named":"unnamed-value";if(s==="image")return xr(e,"alt")?"named":"unnamed-alt";return rj($c(e),r,n)||xr(e,"placeholder")?"named":"unnamed"}function yU(e){let{node:t,path:r,tags:n}=e,s=nt(t);if(!s.includes("-")||!n.some((i)=>gU.has(i)))return null;return Kr("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 bU(e){let{node:t,path:r}=e;if(nt(t)!=="img")return null;let n=Qn(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 Kr("img-alt-missing",r,`${It(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 $U(e,t){let{node:r,path:n}=e,s=[];for(let i of xU){let o=Ai(r,i);if(o===null)continue;for(let a of o.split(/\s+/))if(a!==""&&!t.has(a))s.push(Kr("aria-target-missing",n,`${It(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 vU(e,t,r){for(let n of nj.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 wU(e,t){let{node:r,path:n,roles:s,tags:i}=e,o=Qn(r);if(o===null||o==="bound"||n.length===0||pU(i))return null;if(s.includes("bound")||vU($c(r),o,t))return null;let a=It(r,"the element");if(o==="tab"&&!s.includes("tablist"))return Kr("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 Kr("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 Kr("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 SU(e){let t=[];for(let{node:r}of Ri(e)){if(Qn(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 EU(e){let{node:t,path:r}=e;if(Qn(t)!=="tablist")return null;let n=SU(t);if(n===null||n.length===0||n.includes(!0))return null;return Kr("tablist-none-selected",r,`${It(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 _U(e){let{node:t,path:r}=e,n=Qn(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 Kr("dialog-unnamed",r,`${It(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 jU(e){let{node:t,path:r}=e;if(!Pt(t,"aria-activedescendant"))return null;let n=nt(t);if(PU.has(n)||n==="a"&&Pt(t,"href")||Pt(t,"tabIndex")||Pt(t,"tabindex")||Pt(t,"contenteditable"))return null;return Kr("activedescendant-not-focusable",r,`${It(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 sj(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=Qn(a);if(l!==null&&fU.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=$c(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=[mU(a,n),bU(a),wU(a,s),yU(a),EU(a),_U(a),jU(a)];for(let c of l)if(c)o.push(c);if(!i)o.push(...$U(a,r))}return o}var lU="See docs/framework/concepts/accessibility.",Oi="bound",cU,uU,dU,nj,fU,gU,xU,PU;var ij=q(()=>{ve();xc();cU=new Set(["button","checkbox","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","switch","tab","treeitem"]),uU=new Set(["combobox","listbox","searchbox","slider","spinbutton","textbox"]),dU=new Set(["button","reset","submit"]),nj=new Map([["menuitem",["menu","menubar"]],["menuitemcheckbox",["menu","menubar"]],["menuitemradio",["menu","menubar"]],["option",["listbox"]],["tab",["tablist"]]]),fU=new Set([...nj.values()].flat());gU=new Set(["select","jx-select"]);xU=["aria-activedescendant","aria-controls","aria-describedby","aria-details","aria-errormessage","aria-flowto","aria-labelledby","aria-owns"];PU=new Set(["button","input","select","textarea"])});function jp(e){return nt(e)==="dialog"}function oj(e){return e.startsWith("--")}function TU(e){let t=[];for(let{node:r}of zr(e)){let n=Zn(r);if(jp(r)&&n!==null&&!t.includes(n))t.push(n)}return t}function IU(e){let t=e.oncommand;return t!==void 0&&t!==null}function MU(e,t){for(let{node:r}of zr(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 lj(e,t){let r=[...zr(e,[],null,t)],n=TU(e),s=Pp(e,t),i=n.length>0||s.length>0,o=new Map,a=new Map;for(let{node:c}of r){let d=Zn(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(...JU(c,d,o,n,s,i,t)),jp(c))l.push(...DU(c,d,a));return l}function JU(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 Gr(e))||("commandfor"in Gr(e))))return a;let m=It(e,"the element");if(!NU.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&&!OU.has(d)&&!oj(d))return a.push({detail:`\`command\` is an enumerated attribute taking ${aj.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(kU.has(d)&&!jp(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(RU.has(d)&&!ta(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(oj(d)&&!IU(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 DU(e,t,r){let n=[],s=It(e,"the dialog"),i=Zn(e),{style:o}=e,a=_t(e,"closedby");if(a!==null&&!CU.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(Tt(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||Gr(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"&&!MU(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 aj,kU,RU,AU,OU,CU,NU;var cj=q(()=>{ve();xc();aj=["toggle-popover","show-popover","hide-popover","show-modal","close","request-close"],kU=new Set(["show-modal","close","request-close"]),RU=new Set(["toggle-popover","show-popover","hide-popover"]),AU=["any","closerequest","none"],OU=new Set(aj),CU=new Set(AU),NU=new Set(["button"])});var xj=C(function(yj){Object.defineProperty(yj,"__esModule",{value:!0});yj.formatNames=yj.fastFormats=yj.fullFormats=void 0;function Yr(e,t){return{validate:e,compare:t}}yj.fullFormats={date:Yr(pj,Op),time:Yr(Rp(!0),Cp),"date-time":Yr(uj(!0),hj),"iso-time":Yr(Rp(),mj),"iso-date-time":Yr(uj(),gj),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:BU,"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:XU,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:WU,int32:{type:"number",validate:GU},int64:{type:"number",validate:KU},float:{type:"number",validate:fj},double:{type:"number",validate:fj},password:!0,binary:!0};yj.fastFormats={...yj.fullFormats,date:Yr(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Op),time:Yr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Cp),"date-time":Yr(/^\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,hj),"iso-time":Yr(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,mj),"iso-date-time":Yr(/^\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,gj),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};yj.formatNames=Object.keys(yj.fullFormats);function LU(e){return e%4===0&&(e%100!==0||e%400===0)}var FU=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,qU=[0,31,28,31,30,31,30,31,31,30,31,30,31];function pj(e){let t=FU.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&&LU(r)?29:qU[n])}function Op(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var kp=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Rp(e){return function(r){let n=kp.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 Cp(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 mj(e,t){if(!(e&&t))return;let r=kp.exec(e),n=kp.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 Ap=/t|\s/i;function uj(e){let t=Rp(e);return function(n){let s=n.split(Ap);return s.length===2&&pj(s[0])&&t(s[1])}}function hj(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 gj(e,t){if(!(e&&t))return;let[r,n]=e.split(Ap),[s,i]=t.split(Ap),o=Op(r,s);if(o===void 0)return;return o||Cp(n,i)}var HU=/\/|:/,VU=/^(?:[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 BU(e){return HU.test(e)&&VU.test(e)}var dj=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function WU(e){return dj.lastIndex=0,dj.test(e)}var UU=-2147483648,zU=2147483647;function GU(e){return Number.isInteger(e)&&e<=zU&&e>=UU}function KU(e){return Number.isInteger(e)}function fj(){return!0}var YU=/[^\\]\\Z/;function XU(e){if(YU.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var wj=C(function(vj){Object.defineProperty(vj,"__esModule",{value:!0});var QU=sp(),e6=ap(),t6=mp(),r6=bp(),$j=xp(),n6=[QU.default,e6.default,(0,t6.default)(),r6.default,$j.metadataVocabulary,$j.contentVocabulary];vj.default=n6});var Sj=C(function(oee,i6){i6.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 _j=C(function(Xt,Tp){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 o6=np(),a6=wj(),l6=vp(),Ej=Sj(),c6=["/properties"],wc="http://json-schema.org/draft-07/schema";class ra extends o6.default{_addVocabularies(){if(super._addVocabularies(),a6.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(l6.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Ej,c6):Ej;this.addMetaSchema(e,wc,!1),this.refs["http://json-schema.org/schema"]=wc}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(wc)?wc:void 0)}}Xt.Ajv=ra;Tp.exports=Xt=ra;Tp.exports.Ajv=ra;Object.defineProperty(Xt,"__esModule",{value:!0});Xt.default=ra;var u6=wi();Object.defineProperty(Xt,"KeywordCxt",{enumerable:!0,get:function(){return u6.KeywordCxt}});var Ni=ye();Object.defineProperty(Xt,"_",{enumerable:!0,get:function(){return Ni._}});Object.defineProperty(Xt,"str",{enumerable:!0,get:function(){return Ni.str}});Object.defineProperty(Xt,"stringify",{enumerable:!0,get:function(){return Ni.stringify}});Object.defineProperty(Xt,"nil",{enumerable:!0,get:function(){return Ni.nil}});Object.defineProperty(Xt,"Name",{enumerable:!0,get:function(){return Ni.Name}});Object.defineProperty(Xt,"CodeGen",{enumerable:!0,get:function(){return Ni.CodeGen}});var d6=Lo();Object.defineProperty(Xt,"ValidationError",{enumerable:!0,get:function(){return d6.default}});var f6=Si();Object.defineProperty(Xt,"MissingRefError",{enumerable:!0,get:function(){return f6.default}})});var jj=C(function(Pj){Object.defineProperty(Pj,"__esModule",{value:!0});Pj.formatLimitDefinition=void 0;var h6=_j(),Ar=ye(),es=Ar.operators,Sc={formatMaximum:{okStr:"<=",ok:es.LTE,fail:es.GT},formatMinimum:{okStr:">=",ok:es.GTE,fail:es.LT},formatExclusiveMaximum:{okStr:"<",ok:es.LT,fail:es.GTE},formatExclusiveMinimum:{okStr:">",ok:es.GT,fail:es.LTE}},g6={message:({keyword:e,schemaCode:t})=>Ar.str`should be ${Sc[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Ar._`{comparison: ${Sc[e].okStr}, limit: ${t}}`};Pj.formatLimitDefinition={keyword:Object.keys(Sc),type:"string",schemaType:"string",$data:!0,error:g6,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 h6.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}) ${Sc[s].fail} 0`}},dependencies:["format"]};var y6=(e)=>(e.addKeyword(Pj.formatLimitDefinition),e);Pj.default=y6});var Oj=C(function(na,Aj){Object.defineProperty(na,"__esModule",{value:!0});var Ti=xj(),x6=jj(),Mp=ye(),kj=new Mp.Name("fullFormats"),$6=new Mp.Name("fastFormats"),Jp=(e,t={keywords:!0})=>{if(Array.isArray(t))return Rj(e,t,Ti.fullFormats,kj),e;let[r,n]=t.mode==="fast"?[Ti.fastFormats,$6]:[Ti.fullFormats,kj],s=t.formats||Ti.formatNames;if(Rj(e,s,r,n),t.keywords)(0,x6.default)(e);return e};Jp.get=(e,t="full")=>{let n=(t==="fast"?Ti.fastFormats:Ti.fullFormats)[e];if(!n)throw Error(`Unknown format "${e}"`);return n};function Rj(e,t,r,n){var s,i;(s=(i=e.opts.code).formats)!==null&&s!==void 0||(i.formats=Mp._`require("ajv-formats/dist/formats").${n}`);for(let o of t)e.addFormat(o,r[o])}Aj.exports=na=Jp;Object.defineProperty(na,"__esModule",{value:!0});na.default=Jp});import{existsSync as Nj,readFileSync as Tj,readdirSync as Ij,statSync as Mj}from"node:fs";import{createRequire as v6}from"node:module";import{join as Jj,relative as Dp,resolve as Lp}from"node:path";async function _6(){try{let{default:e}=await Promise.resolve().then(() => Lt(Ep(),1)),{default:t}=await Promise.resolve().then(() => Lt(Oj(),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 Dj(e,t={}){let r=Lp(e),n=[],s=[],i=0;for(let S of["project.schema.json","document.schema.json"]){let P=Lp(r,S);if(!Nj(P))continue;i+=1;let E=sa(P),O=j6(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 zP(r);if(i+=1,!o.valid)n.push({errors:o.errors??[],file:"project.json"});let{addFormats:a,Ajv:l}=await _6(),{document:c}=await zv(r,{write:!1}),d=new l({allErrors:!0,ownProperties:!0,strict:!1});a(d);let p=d.compile(c),h=YP(Cj(r).flatMap((S)=>{try{return[JSON.parse(Tj(S,"utf8"))]}catch{return[]}}));for(let S of w6)for(let P of qj(Lp(r,S))){if(P.endsWith(".class.json"))continue;i+=1;let E=sa(P);if(p(E))s.push(...P6(E,Dp(r,P),h));else n.push({errors:p.errors??[],file:Dp(r,P)})}let m=new l({allErrors:!0,ownProperties:!0,strict:!1});a(m);let b=m.compile(pf());for(let S of Cj(r)){i+=1;let P=sa(S);if(!b(P))n.push({errors:b.errors??[],file:Dp(r,S)})}let{config:g}=Rn(r),y=await kn(r,g),v=v6(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 E6){let k=v.resolve(R);O.addSchema(sa(k))}try{O.compile(sa(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 sa(e){return JSON.parse(Tj(e,"utf8"))}function P6(e,t,r){let n=[];for(let s of tj(e,r))n.push({...Fp(s),file:t,source:"popover"});for(let s of lj(e,r))n.push({...Fp(s),file:t,source:"dialog"});for(let s of sj(e))n.push({...Fp(s),criterion:s.criterion,file:t,source:"accessibility"});return n}function Fp(e){return{detail:e.detail,message:e.message,path:e.path,rule:e.rule,severity:e.severity}}function Lj(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 j6(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(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,l]of Object.entries(i)){if(!k6.has(a))continue;if(Array.isArray(l))for(let c of l)s(c);else if(ee(l)){if(s(l),Fj.has(a))for(let c of Object.values(l))s(c)}}};return s(e),t}function qj(e){if(!Nj(e))return[];let t=[];for(let r of Ij(e)){let n=Jj(e,r);if(Mj(n).isDirectory())t.push(...qj(n));else if(r.endsWith(".json"))t.push(n)}return t.toSorted()}function Cj(e){let t=[],r=(n)=>{for(let s of Ij(n)){if(S6.has(s))continue;let i=Jj(n,s);if(Mj(i).isDirectory())r(i);else if(s.endsWith(".class.json"))t.push(i)}};return r(e),t.toSorted()}function Hj(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 w6,S6,E6,Fj,k6;var Vj=q(()=>{D0();GP();ij();cj();xc();ve();nn();Hi();Qd();w6=["components","pages","layouts"],S6=new Set(["node_modules","dist",".git"]),E6=["@jxsuite/schema/schemas/project.core.schema.json","@jxsuite/schema/schemas/project.fields.schema.json","@jxsuite/schema/schemas/document.paths.schema.json"];Fj=new Set(["$defs","definitions","dependencies","dependentSchemas","patternProperties","properties"]),k6=new Set([...Fj,"additionalItems","additionalProperties","allOf","anyOf","contains","contentSchema","else","if","items","not","oneOf","prefixItems","propertyNames","then","unevaluatedItems","unevaluatedProperties"])});rr();import{relative as qp,resolve as Bj}from"node:path";async function R6(){let e=process.argv.slice(2),[t]=e;if(!t||t==="--help"||t==="-h")console.log(`Usage: jx <command> [options]
611
570
 
612
571
  Commands:
613
572
  build [root] Build a Jx site to dist/
@@ -623,8 +582,8 @@ Options:
623
582
  --port <n> dev/preview: port to listen on (default 3000 / 4173)
624
583
  --dry-run db push: print the statements without executing them
625
584
  --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=uC(l??".");if(r){if(n!=="push")console.error(`Unknown db subcommand: ${n??"(none)"}
627
- Usage: jx db push [root] [--dry-run] [--connection <name>]`),process.exit(1);let d=s.has("--dry-run");try{await Promise.resolve().then(() => ry());let m={dryRun:d};if(a!==void 0)m.connection=a;let{results:y,bindingsPatched:g,wranglerPath:b}=await ty(u,m);for(let x of y){let _=x.applied?"applied":"dry-run";console.log(`${x.connection} (${x.provider}) — ${x.tables.length} table(s), ${x.statements.length} statement(s) [${_}]`);for(let P of x.statements)console.log(` ${P}`);for(let P of x.warnings)console.warn(` warning: ${P}`)}if(g&&b)console.log(`Updated bindings in ${yg(u,b)}`)}catch(h){console.error(`db push failed: ${Pe(h)}`),process.exit(1)}return}if(t==="build"){let d=s.has("--verbose"),h=!s.has("--no-clean");console.log(`Building site from ${u}...`);try{await Promise.resolve().then(() => zE());let y=await qE(u,{clean:h,verbose:d});if(y.errors.length>0){console.error(`
628
- 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=uC(u,"dist");if(!d(h))console.error(`No build output at ${h} — run \`jx build\` first.`),process.exit(1);await Promise.resolve().then(() => ZE());let y=c??4173;QE(h,y),console.log(`Previewing ${h} at http://localhost:${y}`)}else if(t==="schema")try{await Promise.resolve().then(() => Rm());let{projectSchemaPath:h,documentSchemaPath:m}=await d1(u);console.log(`Wrote ${yg(u,h)}`),console.log(`Wrote ${yg(u,m)}`)}catch(d){console.error(`Schema generation failed: ${Pe(d)}`),process.exit(1)}else if(t==="validate")try{await Promise.resolve().then(() => lC());let y=await iC(u,{strict:s.has("--strict")}),g=sC(y);if(y.valid){console.log(`Project is valid (${y.checked} files checked in ${u})`);for(let b of g)console.log(b)}else{console.error(`Project is INVALID (${u}):`);for(let b of[...cC(y),...g])console.error(b);process.exit(1)}}catch(d){console.error(`Validation failed: ${Pe(d)}`),process.exit(1)}else console.error(`Unknown command: ${t}
630
- Run "jx --help" for usage.`),process.exit(1)}var due=rX();export{due as ready};
585
+ --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=Bj(c??".");if(r){if(n!=="push")console.error(`Unknown db subcommand: ${n??"(none)"}
586
+ Usage: jx db push [root] [--dry-run] [--connection <name>]`),process.exit(1);let p=i.has("--dry-run");try{await Promise.resolve().then(() => _m());let m={dryRun:p};if(a!==void 0)m.connection=a;let{results:b,bindingsPatched:g,wranglerPath:y}=await Em(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 ${qp(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(() => jv());let b=await vv(d,{clean:h,verbose:p});if(b.errors.length>0){console.error(`
587
+ Build completed with ${b.errors.length} error(s):`);for(let g of b.errors)console.error(` - ${g}`);process.exit(1)}console.log(`
588
+ 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(() => Rv());kv(d,l)}catch(p){console.error(Ee(p)),process.exit(1)}else if(t==="preview"){let{existsSync:p}=await import("node:fs"),h=Bj(d,"dist");if(!p(h))console.error(`No build output at ${h} — run \`jx build\` first.`),process.exit(1);await Promise.resolve().then(() => Nv());let b=l??4173;Cv(h,b),console.log(`Previewing ${h} at http://localhost:${b}`)}else if(t==="schema")try{await Promise.resolve().then(() => Qd());let{projectSchemaPath:h,documentSchemaPath:m}=await Uv(d);console.log(`Wrote ${qp(d,h)}`),console.log(`Wrote ${qp(d,m)}`)}catch(p){console.error(`Schema generation failed: ${Ee(p)}`),process.exit(1)}else if(t==="validate")try{await Promise.resolve().then(() => Vj());let b=await Dj(d,{strict:i.has("--strict")}),g=Lj(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[...Hj(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}
589
+ Run "jx --help" for usage.`),process.exit(1)}var Oee=R6();export{Oee as ready};