@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/README.md +0 -2
- package/dist/cli.js +255 -296
- package/dist/compiler.js +147 -186
- package/package.json +15 -9
- package/src/compiler.ts +21 -12
- package/src/shared.ts +133 -10
- package/src/site/bundler-backend.bun.ts +84 -0
- package/src/site/bundler-backend.node.ts +58 -0
- package/src/site/bundler-backend.ts +53 -0
- package/src/site/bundler.ts +49 -110
- package/src/site/client-runtime.ts +6 -11
- package/src/site/format-host.ts +98 -48
- package/src/site/image-cache.ts +38 -12
- package/src/site/layout-resolver.ts +43 -3
- package/src/site/schema-command.ts +26 -28
- package/src/site/server-entries.ts +118 -0
- package/src/site/site-build.ts +114 -52
- package/src/targets/compile-client.ts +54 -12
- package/src/targets/compile-element.ts +37 -0
- package/src/targets/compile-server.ts +17 -52
package/dist/compiler.js
CHANGED
|
@@ -1,53 +1,138 @@
|
|
|
1
|
-
import{createRequire as Hc}from"node:module";var jc=Object.create;var{getPrototypeOf:Mc,defineProperty:rs,getOwnPropertyNames:Dc}=Object;var is=Object.prototype.hasOwnProperty;function Fc(e){return this[e]}var Bc,Wc,jd=(e,t,n)=>{var r=e!=null&&typeof e==="object";if(r){var i=t?Bc??=new WeakMap:Wc??=new WeakMap,s=i.get(e);if(s)return s}n=e!=null?jc(Mc(e)):{};let o=t||!e||!e.__esModule||!is.call(e,"default")?rs(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let a of Dc(e))if(!is.call(o,a))rs(o,a,{get:Fc.bind(e,a),enumerable:!0})}if(r)i.set(e,o);return o};var Md=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var N=(e,t,n)=>()=>{if(e)try{t=e(e=0)}catch(r){n=[r]}if(n)throw n[0];return t};var Fd=Hc(import.meta.url);function C(e){return typeof e==="string"}function ve(e){return typeof e==="number"}function fe(e){return typeof e==="boolean"}function Ae(e){return typeof e==="function"}function O(e){return typeof e==="object"&&e!==null}function Y(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function H(e){return Y(e)&&typeof e.$ref==="string"}function he(e){return Y(e)&&e.$prototype==="Function"}function ge(e){return Y(e)&&Y(e.$expression)}function it(e){return ge(e)&&Array.isArray(e.parameters)&&e.parameters.length>0}function Ye(e){return he(e)&&Array.isArray(e.body)}function Ge(e){return Y(e)&&typeof e.$prototype==="string"&&e.$prototype!=="Function"}function mr(e){return Y(e)&&e.timing==="server"&&typeof e.$src==="string"&&typeof e.$export==="string"&&!e.$prototype}function ss(e){return Y(e)&&!e.$prototype&&!e.$expression&&"default"in e}function ze(e){if(!Y(e))return!1;for(let t of Object.keys(e))if(!os.has(t))return!1;return!0}function X(e){return Y(e)&&e.$prototype==="Array"}function hr(e){return(Array.isArray(e)?e:[e]).some((n)=>X(n))}function as(e){return Y(e)&&e.$prototype==="Class"}function Ut(e){return Y(e)}function D(e){return typeof e==="string"&&e.includes("${")}function st(e){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test(e)}function Uc(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function je(e){if(!e)return[];return e.map((t)=>C(t)?t:t.name)}function Vc(e){return typeof e==="string"}function Je(e){if(typeof e!=="object"||e===null||Array.isArray(e)||!Y(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 Y(t.cases)&&Object.values(t.cases).every((n)=>C(n))&&typeof t.default==="string";return!1}function ht(e){if(Vc(e))return[e];if(!Je(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 os;var Q=N(()=>{os=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function pe(e){return e.replaceAll(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}function cs(e,t){if(e.startsWith("@--"))return t[e.slice(1)]??e.slice(1);if(e.startsWith("@(")){let n=e.slice(2,-1).trim();return Kc.has(n.toLowerCase())?n:e.slice(1)}return null}function Vt(e){return e.startsWith("@position-try")||e.startsWith("@property")||e.startsWith("@font-face")||e.startsWith("@counter-style")}function qt(e){return e.startsWith("@keyframes")}function ls(e,t){let n=[];for(let r of Kt(e))for(let i of Kt(t))n.push(qc(r,i));return n.join(", ")}function qc(e,t){if(t.startsWith("&"))return t.replaceAll("&",e);if(t.startsWith("[")||t.startsWith(":")||t.startsWith("."))return`${e}${t}`;return`${e} ${t}`}function Kt(e){let t=[],n=0,r=null,i=0;for(let o=0;o<e.length;o+=1){let a=e[o];if(r){if(a==="\\")o+=1;else if(a===r)r=null;continue}if(a==='"'||a==="'")r=a;else if(a==="("||a==="[")n+=1;else if(a===")"||a==="]")n=Math.max(0,n-1);else if(a===","&&n===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 Me(e){let t=/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(e.trim())?.[1];return t==="light"||t==="dark"?t:null}function gr(e,t){if(e===":root"||e==="html")return{auto:`${e}:where(:not([${Oe}]))`,forced:`${e}:where([${Oe}="${t}"])`};return{auto:`:where(:root:not([${Oe}])) ${e}`,forced:`:where(:root[${Oe}="${t}"]) ${e}`}}function Xe(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}function yr(e){return e.startsWith("--")?e:pe(e)}function gn(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function us(e,t,n){let r=n.map(([s,o])=>`${s}: ${o}`).join("; "),i=t===null?r:`${t} { ${r} }`;for(let s=e.length-1;s>=0;s-=1)i=`${e[s]} { ${i} }`;return i}function Yc(e,t,n){let r=n.map(({selector:s,declarations:o})=>`${s} { ${o.map(([a,c])=>`${a}: ${c}`).join("; ")} }`).join(" "),i=`@keyframes ${t} { ${r} }`;for(let s=e.length-1;s>=0;s-=1)i=`${e[s]} { ${i} }`;return i}function Gc(e){let t=Object.keys(e).filter((r)=>qt(r));if(t.length===0)return e;let n={...e};for(let r of t)delete n[r];return n}function zc(e){let t=e.startsWith("&")?e.slice(1):e;return t===""||t.startsWith(":")||t.startsWith(".")||t.startsWith("[")}function gt(e,t={}){let{scope:n=null,mediaQueries:r={},transposeValue:i=(g)=>g,transposeSelector:s=(g)=>g,resolveValue:o}=t,a=[],c=(g)=>g!==null&&typeof g==="object"&&!Array.isArray(g)&&!H(g),l=(g,y)=>{if(c(y))return[y];if(!Vt(g)||!Array.isArray(y)||y.length===0)return[];return y.every((E)=>c(E))?y:[]},u=(g,y,E,A)=>{if(y===void 0||y===null)return null;if(H(y))return E?o?.(g,y,A)??null:null;if(O(y))return null;let w=String(y);if(D(w))return E?o?.(g,w,A)??null:null;return i(w)},f=(g,y,E=!0,A="self")=>{let w=[];for(let[S,b]of Object.entries(g)){if(l(S,b).length>0)continue;if(y&&(S.startsWith("@")||Xe(S)))continue;if(S.startsWith("$"))continue;let v=u(S,b,E,A);if(v!==null)w.push([yr(S),v])}return w},d=(g,y,E,A,w)=>{if(E.length===0)return;let S=y;if(S!==null){let x=s(S);if(x===null)return;S=x}let b=us(g,S,E),v={text:b,conditions:[...g],selector:S,declarations:E,target:A,key:gn(b)};if(C(w)&&w!=="")v.description=w;a.push(v)},m=(g,y,E)=>{let A=g.slice(10).trim();if(A==="")return;let w=[];for(let[b,v]of Object.entries(y)){if(!c(v))continue;let x=f(v,!0,!1,"unscoped");if(x.length>0)w.push({declarations:x,selector:b.trim()})}if(w.length===0)return;let S=Yc(E,A,w);a.push({blocks:w,conditions:[...E],declarations:[],key:gn(S),selector:null,target:"unscoped",text:S})},h=(g,y,E,A,w)=>{if(g==="@--")return;if(Vt(g)){d([...A,g],null,f(y,!1,!0,"unscoped"),"unscoped",y.$description);return}if(qt(g)){m(g,y,A);return}let S=cs(g,r),b=S===null?g:`@media ${S}`,v=S===null?null:Me(S);if(v!==null&&E!==null){let{auto:x,forced:T}=gr(E,v);p(y,x,[...A,b],w),p(Gc(y),T,A,w);return}p(y,E,[...A,b],w)};function p(g,y,E,A){d(E,y,f(g,!0,!0,A),A,g.$description);for(let[w,S]of Object.entries(g))for(let b of l(w,S))if(w.startsWith("@"))h(w,b,y,E,A);else if(y!==null)p(b,ls(y,w),E,zc(w)?A:"descendant")}return p(e,n,[],"self"),a}var Kc,Oe="data-color-scheme",yn="jx-color-scheme";var xn=N(()=>{Q();Kc=new Set(["all","print","screen","speech"])});function Vd(){return`the Intl helpers ${Sr.join(", ")}`}var ke="en-US",xr="UTC",fs,Sr,ps;var ds=N(()=>{fs=[{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."}],Sr=fs.map((e)=>e.path),ps=Object.fromEntries(fs.map((e)=>[e.path,e.params.indexOf("locale")]))});function Xc(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function ie(e){return e.replaceAll("~","~0").replaceAll("/","~1")}function Qe(e){if(e==="")return[];return e.split("/").map((t)=>Xc(t))}function te(e,t){let n=e;for(let r of Qe(t))n=n?.[r];return n}function L(e,t){let n=e;for(let r of Qe(t))n+=ms.test(r)?`.${r}`:`[${JSON.stringify(r)}]`;return n}function yt(e){return ms.test(e)?e:JSON.stringify(e)}function hs(e){let t=e.replaceAll(/[^A-Za-z0-9_$]/g,"_");if(t==="")return"ref";return/^\d/.test(t)?`_${t}`:t}var ms;var xt=N(()=>{ms=/^[A-Za-z_$][A-Za-z0-9_$]*$/});function $r(e){let t=e.$map;return O(t)?t:void 0}function Ss(e){return O(e)&&!Array.isArray(e)&&"operator"in e}function Yt(e){return O(e)&&!Array.isArray(e)&&"$ref"in e}function tl(e,t,n){let r=ps[e];if(r===void 0||r<0||t[r]!=null)return t;let i=te(n.$page,"locale");if(!C(i)||i==="")return t;let s=[...t];return s[r]=i,s}function ws(e){return e.startsWith("window#/")&&Zc.has(e.slice(8))}function De(e){return $s.has(e)}function V(e,t){if(!e)return;let n=(e.depth??0)+1;if(n>nl)return;return{depth:n,path:[...e.path??[],...Array.isArray(t)?t:[t]],report:e.report}}function U(e,t,n,r,i){if(e===null||e===void 0)return e;if(Ss(e))return ye(e,t,n,r,i);if(Yt(e)){let s=Sn(e.$ref,t,n,r);return i?.report(i.path??[],s),s}if(Array.isArray(e))return vs(e,t,n,r,i);return i?.report(i.path??[],e),e}function vs(e,t,n,r,i){return e.map((s,o)=>U(s,t,n,r,V(i,o)))}function rl(e,t,n,r){let i=(s)=>{if(!e.slice(s.length).includes("/"))return t;return Sn(e.slice(0,e.lastIndexOf("/")),t,n,r)};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?Sn(e.slice(0,e.lastIndexOf("/")),t,n,r):void 0;return}function Sn(e,t,n,r){if(e==="$reduce/acc")return r?.acc;if(e.startsWith("$reduce/"))return r?.acc;if(e.startsWith("$args/")){let i=e.slice(6).split("/"),s=r?.args?.[i[0]];return i.length>1?te(s,i.slice(1).join("/")):s}if(e.startsWith("event#/")){let i=e.slice(7);return te(n,i)}if(e.startsWith("$map/")){let i=e.split("/"),[,s]=i,o,a=$r(t);if(s==="item")o=r?.item??a?.item??t["$map/item"];else if(s==="index")o=r?.index??a?.index??t["$map/index"];else o=a?.[s]??t[`$map/${s}`];return i.length>2?te(o,i.slice(2).join("/")):o}if(e.startsWith("#/state/"))return te(t,e.slice(8));if(e.startsWith("parent#/"))return te(t,e.slice(8));if(e.startsWith("window#/"))return te(globalThis.window,e.slice(8));if(e.startsWith("document#/"))return te(globalThis.document,e.slice(10));return te(t,e)??null}function il(e,t,n,r){if(e.startsWith("$map/")){let i=e.split("/"),[,s]=i,o,a=$r(t);if(s==="item")o=r?.item??a?.item??t["$map/item"];else if(s==="index")o=r?.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?te(o,c.join("/")):o;return{key:l,obj:u}}return{key:s==="item"?"$map/item":"$map/index",obj:$r(t)??t}}if(e.startsWith("#/state/")){let i=e.slice(8);if(i.indexOf("/")===-1)return{key:i,obj:t};let o=Qe(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 ye(e,t,n,r,i){let s=sl(e,t,n,r,i);return i?.report(i.path??[],s),s}function ys(e,t,n){switch(e){case"+":return t+n;case"-":return t-n;case"*":return t*n;case"/":return t/n;case"%":return t%n;case"<":return t<n;case"<=":return t<=n;case">":return t>n;default:return t>=n}}function sl(e,t,n,r,i){let{operator:s,target:o,value:a,initial:c}=e;if(!Qc.has(s))throw Error(`$expression: unknown operator "${s}"`);if(Er.has(s)&&!("value"in e)){let l=U(o,t,n,r,V(i,"target"));if(s==="!")return!l;if(s==="-")return-l}if(s==="call"){let l=Yt(o)?o.$ref:void 0;if(!C(l))throw TypeError("$expression: call target must be a $ref pointer");let u=(r?.callDepth??0)+1;if(u>gs)throw Error(`$expression: call depth exceeded (${gs})`);let f=Array.isArray(a)?a.map((m,h)=>U(m,t,n,r,V(i,["value",h]))):[];if(l.startsWith("window#/")){if(!ws(l))throw Error(`$expression: "${l}" is not a blessed pure global`);let m=l.slice(8),h=el.get(m);if(h)return h(...tl(m,f,t));let p=te(globalThis.window,m),g=m.lastIndexOf("/"),y=g===-1?globalThis.window:te(globalThis.window,m.slice(0,g));return p.apply(y,f)}let d=Sn(l,t,n,r);if(Ae(d))return d.apply(rl(l,t,n,r),f);if(O(d)&&"$expression"in d){let m=d,h={};for(let[p,g]of(m.parameters??[]).entries()){let y=C(g)?g:g?.name??"";if(!y)continue;h[y]=f[p]===void 0&&O(g)&&"default"in g?g.default:f[p]}return ye(m.$expression,t,n,{args:h,callDepth:u})}throw TypeError(`$expression: call target "${l}" is not callable`)}if(vr.has(s)){if(s==="?:"){let m=U(o,t,n,r,V(i,"target"));if(i){let h=U(a,t,n,r,V(i,"value")),p=U(c,t,n,r,V(i,"initial"));return m?h:p}return m?U(a,t,n,r):U(c,t,n,r)}let l=U(o,t,n,r,V(i,"target")),u=String(l),f=e.cases??{},d=Object.hasOwn(f,u);if(i){let m;for(let[p,g]of Object.entries(f)){let y=U(g,t,n,r,V(i,["cases",p]));if(p===u)m=y}let h=U(e.default,t,n,r,V(i,"default"));return d?m:h}return d?U(f[u],t,n,r):U(e.default,t,n,r)}if(br.has(s)){let l=U(o,t,n,r,V(i,"target")),u=U(a,t,n,r,V(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 ys(s,l,u)}}if(Es.has(s)){let l=U(a,t,n,r,V(i,"value")),{obj:u,key:f}=il(o.$ref,t,n,r);u[f]=s==="="?l:ys(s.slice(0,-1),u[f],l);return}if(bs.has(s)){let l=U(o,t,n,r,V(i,"target"));switch(s){case"push":return l.push(U(a,t,n,r,V(i,"value")));case"unshift":return l.unshift(U(a,t,n,r,V(i,"value")));case"pop":return l.pop();case"shift":return l.shift();case"splice":{let u=U(a,t,n,r,V(i,"value"));return l.splice(...u)}default:break}}if(Ar.has(s)){let l=U(o,t,n,r,V(i,"target")),u=a===void 0?[]:Array.isArray(a)?vs(a,t,n,r,V(i,"value")):[U(a,t,n,r,V(i,"value"))],f=te(l,s);if(!Ae(f))return;return f.apply(l,u)}if(wr.has(s)){let l=U(o,t,n,r,V(i,"target")),u=a;if(s==="reduce"){let f=U(c,t,n,r,V(i,"initial"));for(let[d,m]of l.entries())f=ye(u,t,n,{acc:f,index:d,item:m},d===0?V(i,"value"):void 0);return f}if(s==="map")return l.map((f,d)=>ye(u,t,n,{...r,index:d,item:f},d===0?V(i,"value"):void 0));if(s==="filter")return l.filter((f,d)=>ye(u,t,n,{...r,index:d,item:f},d===0?V(i,"value"):void 0))}return}function K(e,t){if(e===null)return"null";if(e===void 0)return"undefined";if(Ss(e))return ae(e,t);if(Yt(e))return Cr(e.$ref,t);if(Array.isArray(e))return e.map((n)=>K(n,t)).join(", ");return JSON.stringify(e)}function ol(e){return`_fx_${e.replaceAll(/[^A-Za-z0-9_$]/g,"_")}`}function Cr(e,t){let n=t.statePrefix??"state",r=t.eventParam??"event";if(e==="$reduce/acc")return"_acc";if(e.startsWith("$reduce/"))return"_acc";if(e.startsWith("$args/"))return L("_args",e.slice(6));if(e.startsWith("event#/"))return L(r,e.slice(7));if(e.startsWith("$map/")){let i=e.split("/"),[,s]=i;if(s==="item")return i.length>2?L("_item",i.slice(2).join("/")):"_item";if(s==="index")return"_index";return`_${s}`}if(e.startsWith("#/state/"))return L(n,e.slice(8));if(e.startsWith("parent#/"))return L(n,e.slice(8));if(e.startsWith("window#/"))return L("window",e.slice(8));if(e.startsWith("document#/"))return L("document",e.slice(10));return L(n,e)}function xs(e,t){if(Yt(e))return Cr(e.$ref,t);return K(e,t)}function al(e,t,n){let r=(o)=>t[o]??"undefined",i=`(${n.statePrefix??"state"}?.$page?.locale ?? ${JSON.stringify(ke)})`,s=JSON.stringify(xr);switch(e){case"Intl/formatNumber":return`new Intl.NumberFormat(${r(1)} ?? ${i}, ${r(2)}).format(${r(0)})`;case"Intl/formatDate":return`new Intl.DateTimeFormat(${r(1)} ?? ${i}, {timeZone: ${s}, ...${r(2)}}).format(new Date(${r(0)}))`;case"Intl/formatRelativeTime":return`new Intl.RelativeTimeFormat(${r(2)} ?? ${i}, ${r(3)}).format(${r(0)}, ${r(1)})`;case"Intl/formatList":return`new Intl.ListFormat(${r(1)} ?? ${i}, ${r(2)}).format(${r(0)})`;case"Intl/plural":return`new Intl.PluralRules(${r(1)} ?? ${i}, ${r(2)}).select(${r(0)})`;case"Intl/compare":return`new Intl.Collator(${r(2)} ?? ${i}, ${r(3)}).compare(${r(0)}, ${r(1)})`;case"Intl/displayName":return`new Intl.DisplayNames(${r(2)} ?? ${i}, {...${r(3)}, type: ${r(1)} ?? 'language'}).of(${r(0)})`;case"Intl/segment":return`[...new Intl.Segmenter(${r(2)} ?? ${i}, {granularity: ${r(1)} ?? 'grapheme'}).segment(${r(0)})].map((p) => p.segment)`;default:return null}}function ae(e,t={}){let{operator:n,target:r,value:i,initial:s}=e;if(Er.has(n)&&!("value"in e)){let o=K(r,t);if(n==="!")return`!(${o})`;if(n==="-")return`-(${o})`}if(n==="call"){let o=(Yt(r)?r.$ref:void 0)??"",a=Array.isArray(i)?i.map((c)=>K(c,t)):[];if(o.startsWith("window#/")){if(!ws(o))throw Error(`$expression: "${o}" is not a blessed pure global`);let c=al(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((f,d)=>`${JSON.stringify(f)}: ${a[d]??"undefined"}`).join(", ");return`${ol(c)}(${t.statePrefix??"state"}, { ${u} })`}}return`${Cr(o,t)}(${a.join(", ")})`}if(vr.has(n)){if(n==="?:"){let l=K(r,t),u=K(i,t),f=K(s,t);return`(${l} ? ${u} : ${f})`}let o=K(r,t),a=Object.entries(e.cases??{}).map(([l,u])=>`_d === ${JSON.stringify(l)} ? ${K(u,t)} : `).join(""),c="default"in e?K(e.default,t):"undefined";return`((_d) => ${a}${c})(String(${o}))`}if(br.has(n)){let o=K(r,t),a=K(i,t);return`(${o} ${n} ${a})`}if(Es.has(n)){let o=xs(r,t),a=K(i,t);return`${o} ${n} ${a}`}if(bs.has(n)){let o=xs(r,t);switch(n){case"push":return`${o}.push(${K(i,t)})`;case"unshift":return`${o}.unshift(${K(i,t)})`;case"pop":return`${o}.pop()`;case"shift":return`${o}.shift()`;case"splice":{let a=Array.isArray(i)?i.map((c)=>K(c,t)).join(", "):K(i,t);return`${o}.splice(${a})`}default:break}}if(Ar.has(n)){let o=K(r,t),a=i===void 0?"":Array.isArray(i)?i.map((c)=>K(c,t)).join(", "):K(i,t);return`(${o})?.${n}?.(${a})`}if(wr.has(n)){let o=K(r,t),a=ae(i,t);if(n==="reduce"){let c=K(s,t);return`${o}.reduce((_acc, _item, _index) => ${a}, ${c})`}if(n==="map")return`${o}.map((_item, _index) => ${a})`;if(n==="filter")return`${o}.filter((_item, _index) => ${a})`}return"undefined"}function St(e,t,n,r){return U(e,t,n,r)}function ot(e,t={}){return K(e,t)}var $s,Er,br,Es,bs,wr,vr,Ar,Qc,Zc,el,gs=64,nl=64;var Gt=N(()=>{ds();Q();xt();$s=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),Er=new Set(["!","-"]),br=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),Es=new Set(["=","+=","-=","*=","/="]),bs=new Set(["push","pop","shift","unshift","splice"]),wr=new Set(["reduce","map","filter"]),vr=new Set(["?:","switch"]),Ar=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"]),Qc=new Set([...$s,...Er,...br,...wr,...vr,...Ar,"call"]),Zc=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",...Sr]),el=new Map([["Intl/compare",(e,t,n,r)=>new Intl.Collator(n??ke,r).compare(e,t)],["Intl/displayName",(e,t,n,r)=>new Intl.DisplayNames(n??ke,{...r,type:t??"language"}).of(e)],["Intl/formatDate",(e,t,n)=>new Intl.DateTimeFormat(t??ke,{timeZone:xr,...n}).format(new Date(e))],["Intl/formatList",(e,t,n)=>new Intl.ListFormat(t??ke,n).format(e)],["Intl/formatNumber",(e,t,n)=>new Intl.NumberFormat(t??ke,n).format(e)],["Intl/formatRelativeTime",(e,t,n,r)=>new Intl.RelativeTimeFormat(n??ke,r).format(e,t)],["Intl/plural",(e,t,n)=>new Intl.PluralRules(t??ke,n).select(e)],["Intl/segment",(e,t,n)=>[...new Intl.Segmenter(n??ke,{granularity:t??"grapheme"}).segment(e)].map((r)=>r.segment)]])});function cl(e){return e.startsWith(As)}function Zd(e){let t=e;if(cl(t))t=t.slice(As.length);return t=t.replace(/^\.\//,"").replace(/\.(js|ts|mjs|mts)$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,""),`${Or}${t}.js`}function em(e){let t=/\.(\w+)$/.exec(e)?.[1]??"",n=e.replace(/\.\w+$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"");return t===""?`${Or}${n}`:`${Or}${n}.${t}`}function Cs(e){let t=e.replaceAll("\\","/");return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function Os(e){let t=Cs(e);return t.startsWith("/")?t:`/${t}`}function ll(e,t){return[...e].toSorted((n,r)=>r[t].length-n[t].length)}function tm(e,t){let n=t.split("#")[0].split("?")[0];if(!n.startsWith("/"))return null;let r;try{r=decodeURIComponent(n)}catch{return null}if(/%2e|%2f/i.test(r))return null;for(let i of ll(e,"urlPrefix")){let s=Os(i.urlPrefix);if(!r.startsWith(`${s}/`))continue;let a=r.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`${Cs(i.dir)}/${a.join("/")}`}return null}function nm(e,t){let n=new Set;for(let r of t){let i=Os(r.urlPrefix),s=new RegExp(`${i.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}/[^${ul}]+`,"g");for(let o of e.matchAll(s)){let a=o[0].split("#")[0].split("?")[0];if(!a.endsWith("/"))n.add(a)}}return[...n].filter(Boolean)}function fl(e){let t=[],n=0;while(n<e.length){while(n<e.length&&(/\s/.test(e[n])||e[n]===","))n+=1;if(n>=e.length)break;let r=n;while(n<e.length&&!/\s/.test(e[n]))n+=1;let i=e.slice(r,n);if(i.endsWith(",")){t.push({descriptor:"",url:i.replace(/,+$/,"")});continue}while(n<e.length&&/\s/.test(e[n]))n+=1;let s=n;while(n<e.length&&e[n]!==",")n+=1;let o=e.slice(s,n).trim();if(n+=1,i=i.replace(/,+$/,""),i!=="")t.push({descriptor:o,url:i})}return t}function pl(e){return e.map(({url:t,descriptor:n})=>n?`${t} ${n}`:t).join(", ")}function rm(e){if(!C(e)||e==="")return"";let t;try{({pathname:t}=new URL(e))}catch{return""}let n=t.replace(/\/+$/,"");if(n===""||n==="/")return"";return n.startsWith("/")?n:`/${n}`}function Ts(e,t){if(e===""||!t.startsWith("/")||t.startsWith("//"))return t;if(t===e||t.startsWith(`${e}/`))return t;return e+t}function im(e,t){let n=new URL(t);if(!n.pathname.endsWith("/"))n.pathname+="/";return new URL(e.replace(/^\/+/,""),n).href}var As="npm:",Or="/assets/",ul;var Tr=N(()=>{Q();ul=String.raw`"'\s<>()\\`});function Ps(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 dl(e){return(O(e)||Ae(e))&&"then"in e&&Ae(e.then)}async function $t(e,t,n,r={}){let i=r.args?{args:r.args}:void 0;for(let s of e){let o=Ps(s);switch(o.kind){case"expression":{let a=ye(o.node,t,n,i);if(dl(a))await a;break}case"if":{let a=o.node,c=St(a.if,t,n,i)?a.then:a.else;if(Array.isArray(c))await $t(c,t,n,r);break}case"switch":{let a=o.node,c=String(St(a.$switch,t,n,i)),l=a.cases??{},u=Object.hasOwn(l,c)?l[c]:a.default;if(Array.isArray(u))await $t(u,t,n,r);break}case"dispatch":{let a=o.node,c=Ae(r.target)?r.target():r.target,l=n?.currentTarget??c;if(!l)break;let u={};if("detail"in a)u.detail=St(a.detail,t,n,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":{n?.stopPropagation();break}case"preventDefault":{n?.preventDefault();break}default:break}}}function Ce(e,t={}){let n=t.indent??"",r=[];for(let i of e){let s=Ps(i);switch(s.kind){case"expression":{r.push(`${n}${ae(s.node,t)};`);break}case"if":{let o=s.node,a=ot(o.if,t),c={...t,indent:`${n} `};if(r.push(`${n}if (${a}) {`,Ce(o.then??[],c)),o.else)r.push(`${n}} else {`,Ce(o.else,c));r.push(`${n}}`);break}case"switch":{let o=s.node,a=ot(o.$switch,t),c={...t,indent:`${n} `};r.push(`${n}switch (String(${a})) {`);for(let[l,u]of Object.entries(o.cases??{}))r.push(`${n} case ${JSON.stringify(l)}: {`,Ce(u,c),`${n} break;`,`${n} }`);if(o.default)r.push(`${n} default: {`,Ce(o.default,c),`${n} }`);r.push(`${n}}`);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: ${ot(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(", ")} }`:"";r.push(`${n}${c}?.dispatchEvent(new CustomEvent(${JSON.stringify(o.dispatchEvent)}${u}));`);break}case"stopPropagation":{r.push(`${n}${t.eventParam??"event"}?.stopPropagation();`);break}case"preventDefault":{r.push(`${n}${t.eventParam??"event"}?.preventDefault();`);break}default:break}}return r.join(`
|
|
2
|
-
`)}var
|
|
3
|
-
`)}var
|
|
4
|
-
`)}function
|
|
5
|
-
${t}`}function
|
|
6
|
-
function ${
|
|
1
|
+
import{createRequire as cs}from"node:module";var rs=Object.create;var{getPrototypeOf:ss,defineProperty:wn,getOwnPropertyNames:os}=Object;var Cn=Object.prototype.hasOwnProperty;function is(e){return this[e]}var as,ls,Vo=(e,t,n)=>{var r=e!=null&&typeof e==="object";if(r){var s=t?as??=new WeakMap:ls??=new WeakMap,o=s.get(e);if(o)return o}n=e!=null?rs(ss(e)):{};let i=t||!e||!e.__esModule||!Cn.call(e,"default")?wn(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let u of os(e))if(!Cn.call(i,u))wn(i,u,{get:is.bind(e,u),enumerable:!0})}if(r)s.set(e,i);return i};var Ho=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var I=(e,t,n)=>()=>{if(e)try{t=e(e=0)}catch(r){n=[r]}if(n)throw n[0];return t};var Uo=cs(import.meta.url);function J(e){return typeof e==="string"}function ee(e){return typeof e==="number"}function K(e){return typeof e==="boolean"}function te(e){return typeof e==="function"}function C(e){return typeof e==="object"&&e!==null}function L(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function P(e){return L(e)&&typeof e.$ref==="string"}function G(e){return L(e)&&e.$prototype==="Function"}function X(e){return L(e)&&L(e.$expression)}function Ee(e){return X(e)&&Array.isArray(e.parameters)&&e.parameters.length>0}function xe(e){return G(e)&&Array.isArray(e.body)}function ye(e){return L(e)&&typeof e.$prototype==="string"&&e.$prototype!=="Function"}function le(e){return L(e)&&e.timing==="server"&&typeof e.$src==="string"&&typeof e.$export==="string"&&!e.$prototype}function vn(e){return L(e)&&!e.$prototype&&!e.$expression&&"default"in e}function $e(e){if(!L(e))return!1;for(let t of Object.keys(e))if(!On.has(t))return!1;return!0}function V(e){return L(e)&&e.$prototype==="Array"}function Pt(e){return(Array.isArray(e)?e:[e]).some((n)=>V(n))}function An(e){return L(e)&&e.$prototype==="Class"}function Fe(e){return L(e)}function N(e){return typeof e==="string"&&e.includes("${")}function we(e){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test(e)}function us(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function ce(e){if(!e)return[];return e.map((t)=>J(t)?t:t.name)}function ps(e){return typeof e==="string"}function oe(e){if(typeof e!=="object"||e===null||Array.isArray(e)||!L(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 L(t.cases)&&Object.values(t.cases).every((n)=>J(n))&&typeof t.default==="string";return!1}function Oe(e){if(ps(e))return[e];if(!oe(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 On;var H=I(()=>{On=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function z(e){return e.replaceAll(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}function jn(e,t){if(e.startsWith("@--"))return t[e.slice(1)]??e.slice(1);if(e.startsWith("@(")){let n=e.slice(2,-1).trim();return fs.has(n.toLowerCase())?n:e.slice(1)}return null}function We(e){return e.startsWith("@position-try")||e.startsWith("@property")||e.startsWith("@font-face")||e.startsWith("@counter-style")}function He(e){return e.startsWith("@keyframes")}function Rn(e,t){let n=[];for(let r of Ve(e))for(let s of Ve(t))n.push(ms(r,s));return n.join(", ")}function ms(e,t){let n=tt(t,e);if(n!==null)return n;if(t.startsWith("[")||t.startsWith(":")||t.startsWith("."))return`${e}${t}`;return`${e} ${t}`}function Tt(e){let t=[],n=null,r=0;for(let s=0;s<e.length;s+=1){let o=e[s];if(n){if(o==="\\")s+=1;else if(o===n)n=null;continue}if(o==="\\")s+=1;else if(o==='"'||o==="'")n=o;else if(o==="[")r+=1;else if(o==="]")r=Math.max(0,r-1);else if(o==="&"&&r===0)t.push(s)}return t}function tt(e,t){return Tt(e).length>0?ds(e,t):null}function ds(e,t){let n="",r=0;for(let s of Tt(e))n+=e.slice(r,s)+t,r=s+1;return n+e.slice(r)}function Ve(e){let t=[],n=0,r=null,s=0;for(let i=0;i<e.length;i+=1){let u=e[i];if(r){if(u==="\\")i+=1;else if(u===r)r=null;continue}if(u==='"'||u==="'")r=u;else if(u==="("||u==="[")n+=1;else if(u===")"||u==="]")n=Math.max(0,n-1);else if(u===","&&n===0)t.push(e.slice(s,i)),s=i+1}t.push(e.slice(s));let o=t.flatMap((i)=>{let u=i.trim();return u===""?[]:[u]});return o.length>0?o:[e]}function ue(e){let t=/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(e.trim())?.[1];return t==="light"||t==="dark"?t:null}function kt(e,t){if(e===":root"||e==="html")return{auto:`${e}:where(:not([${se}]))`,forced:`${e}:where([${se}="${t}"])`};return{auto:`:where(:root:not([${se}])) ${e}`,forced:`:where(:root[${se}="${t}"]) ${e}`}}function Se(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}function _t(e){return e.startsWith("--")?e:z(e)}function et(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Nn(e,t,n){let r=n.map(([o,i])=>`${o}: ${i}`).join("; "),s=t===null?r:`${t} { ${r} }`;for(let o=e.length-1;o>=0;o-=1)s=`${e[o]} { ${s} }`;return s}function gs(e,t,n){let r=n.map(({selector:o,declarations:i})=>`${o} { ${i.map(([u,a])=>`${u}: ${a}`).join("; ")} }`).join(" "),s=`@keyframes ${t} { ${r} }`;for(let o=e.length-1;o>=0;o-=1)s=`${e[o]} { ${s} }`;return s}function hs(e){let t=Object.keys(e).filter((r)=>He(r));if(t.length===0)return e;let n={...e};for(let r of t)delete n[r];return n}function xs(e){let n=Tt(e).at(-1),r=n===void 0?e:e.slice(n+1);return r===""||r.startsWith(":")||r.startsWith(".")||r.startsWith("[")}function Ae(e,t={}){let{scope:n=null,mediaQueries:r={},transposeValue:s=(m)=>m,transposeSelector:o=(m)=>m,resolveValue:i}=t,u=[],a=(m)=>m!==null&&typeof m==="object"&&!Array.isArray(m)&&!P(m),c=(m,y)=>{if(a(y))return[y];if(!We(m)||!Array.isArray(y)||y.length===0)return[];return y.every((w)=>a(w))?y:[]},l=(m,y,w,O)=>{if(y===void 0||y===null)return null;if(P(y))return w?i?.(m,y,O)??null:null;if(C(y))return null;let v=String(y);if(N(v))return w?i?.(m,v,O)??null:null;return s(v)},p=(m,y,w=!0,O="self")=>{let v=[];for(let[A,k]of Object.entries(m)){if(c(A,k).length>0)continue;if(y&&(A.startsWith("@")||Se(A)))continue;if(A.startsWith("$"))continue;let S=l(A,k,w,O);if(S!==null)v.push([_t(A),S])}return v},g=(m,y,w,O,v)=>{if(w.length===0)return;let A=y;if(A!==null){let h=o(A);if(h===null)return;A=h}let k=Nn(m,A,w),S={text:k,conditions:[...m],selector:A,declarations:w,target:O,key:et(k)};if(J(v)&&v!=="")S.description=v;u.push(S)},d=(m,y,w)=>{let O=m.slice(10).trim();if(O==="")return;let v=[];for(let[k,S]of Object.entries(y)){if(!a(S))continue;let h=p(S,!0,!1,"unscoped");if(h.length>0)v.push({declarations:h,selector:k.trim()})}if(v.length===0)return;let A=gs(w,O,v);u.push({blocks:v,conditions:[...w],declarations:[],key:et(A),selector:null,target:"unscoped",text:A})},x=(m,y,w,O,v)=>{if(m==="@--")return;if(We(m)){g([...O,m],null,p(y,!1,!0,"unscoped"),"unscoped",y.$description);return}if(He(m)){d(m,y,O);return}let A=jn(m,r),k=A===null?m:`@media ${A}`,S=A===null?null:ue(A);if(S!==null&&w!==null){let{auto:h,forced:b}=kt(w,S);f(y,h,[...O,k],v),f(hs(y),b,O,v);return}f(y,w,[...O,k],v)};function f(m,y,w,O){g(w,y,p(m,!0,!0,O),O,m.$description);for(let[v,A]of Object.entries(m))for(let k of c(v,A))if(v.startsWith("@"))x(v,k,y,w,O);else if(y!==null)f(k,Rn(y,v),w,xs(v)?O:"descendant")}return f(e,n,[],"self"),u}var fs,se="data-color-scheme",nt="jx-color-scheme";var Be=I(()=>{H();fs=new Set(["all","print","screen","speech"])});function Go(){return`the Intl helpers ${Mt.join(", ")}`}var ie="en-US",Dt="UTC",Pn,Mt,Tn;var kn=I(()=>{Pn=[{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."}],Mt=Pn.map((e)=>e.path),Tn=Object.fromEntries(Pn.map((e)=>[e.path,e.params.indexOf("locale")]))});function ys(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function B(e){return e.replaceAll("~","~0").replaceAll("/","~1")}function pe(e){if(e==="")return[];return e.split("/").map((t)=>ys(t))}function U(e,t){let n=e;for(let r of pe(t))n=n?.[r];return n}function R(e,t){let n=e;for(let r of pe(t))n+=It.test(r)?`.${r}`:`[${JSON.stringify(r)}]`;return n}function _n(e,t){let n=e;for(let[r,s]of pe(t).entries()){let o=r===0?"":"?.";n+=It.test(s)?`${r===0?".":o}${s}`:`${o}[${JSON.stringify(s)}]`}return n}function fe(e){return It.test(e)?e:JSON.stringify(e)}function Dn(e){let t=e.replaceAll(/[^A-Za-z0-9_$]/g,"_");if(t==="")return"ref";return/^\d/.test(t)?`_${t}`:t}var It;var je=I(()=>{It=/^[A-Za-z_$][A-Za-z0-9_$]*$/});function Lt(e){let t=e.$map;return C(t)?t:void 0}function Fn(e){return C(e)&&!Array.isArray(e)&&"operator"in e}function Ue(e){return C(e)&&!Array.isArray(e)&&"$ref"in e}function Js(e,t,n){let r=Tn[e];if(r===void 0||r<0||t[r]!=null)return t;let s=U(n.$page,"locale");if(!J(s)||s==="")return t;let o=[...t];return o[r]=s,o}function Bn(e){return e.startsWith("window#/")&&Ss.has(e.slice(8))}function me(e){return Wn.has(e)}function D(e,t){if(!e)return;let n=(e.depth??0)+1;if(n>Es)return;return{depth:n,path:[...e.path??[],...Array.isArray(t)?t:[t]],report:e.report}}function _(e,t,n,r,s){if(e===null||e===void 0)return e;if(Fn(e))return Z(e,t,n,r,s);if(Ue(e)){let o=rt(e.$ref,t,n,r);return s?.report(s.path??[],o),o}if(Array.isArray(e))return Un(e,t,n,r,s);return s?.report(s.path??[],e),e}function Un(e,t,n,r,s){return e.map((o,i)=>_(o,t,n,r,D(s,i)))}function ws(e,t,n,r){let s=(o)=>{if(!e.slice(o.length).includes("/"))return t;return rt(e.slice(0,e.lastIndexOf("/")),t,n,r)};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?rt(e.slice(0,e.lastIndexOf("/")),t,n,r):void 0;return}function rt(e,t,n,r){if(e==="$reduce/acc")return r?.acc;if(e.startsWith("$reduce/"))return r?.acc;if(e.startsWith("$args/")){let s=e.slice(6).split("/"),o=r?.args?.[s[0]];return s.length>1?U(o,s.slice(1).join("/")):o}if(e.startsWith("event#/")){let s=e.slice(7);return U(n,s)}if(e.startsWith("$map/")){let s=e.split("/"),[,o]=s,i,u=Lt(t);if(o==="item")i=r?.item??u?.item??t["$map/item"];else if(o==="index")i=r?.index??u?.index??t["$map/index"];else i=u?.[o]??t[`$map/${o}`];return s.length>2?U(i,s.slice(2).join("/")):i}if(e.startsWith("#/state/"))return U(t,e.slice(8));if(e.startsWith("parent#/"))return U(t,e.slice(8));if(e.startsWith("window#/"))return U(globalThis.window,e.slice(8));if(e.startsWith("document#/"))return U(globalThis.document,e.slice(10));return U(t,e)??null}function Cs(e,t,n,r){if(e.startsWith("$map/")){let s=e.split("/"),[,o]=s,i,u=Lt(t);if(o==="item")i=r?.item??u?.item??t["$map/item"];else if(o==="index")i=r?.index??u?.index??t["$map/index"];else i=u?.[o]??t[`$map/${o}`];if(s.length>2){let a=s.slice(2),c=a.pop(),l=a.length>0?U(i,a.join("/")):i;return{key:c,obj:l}}return{key:o==="item"?"$map/item":"$map/index",obj:Lt(t)??t}}if(e.startsWith("#/state/")){let s=e.slice(8);if(s.indexOf("/")===-1)return{key:s,obj:t};let i=pe(s),u=i.pop(),a=t;for(let c of i)a=a[c];return{key:u,obj:a}}return{key:e,obj:t}}function Z(e,t,n,r,s){let o=vs(e,t,n,r,s);return s?.report(s.path??[],o),o}function In(e,t,n){switch(e){case"+":return t+n;case"-":return t-n;case"*":return t*n;case"/":return t/n;case"%":return t%n;case"<":return t<n;case"<=":return t<=n;case">":return t>n;default:return t>=n}}function vs(e,t,n,r,s){let{operator:o,target:i,value:u,initial:a}=e;if(!$s.has(o))throw Error(`$expression: unknown operator "${o}"`);if(Ft.has(o)&&!("value"in e)){let c=_(i,t,n,r,D(s,"target"));if(o==="!")return!c;if(o==="-")return-c}if(o==="call"){let c=Ue(i)?i.$ref:void 0;if(!J(c))throw TypeError("$expression: call target must be a $ref pointer");let l=(r?.callDepth??0)+1;if(l>Mn)throw Error(`$expression: call depth exceeded (${Mn})`);let p=Array.isArray(u)?u.map((d,x)=>_(d,t,n,r,D(s,["value",x]))):[];if(c.startsWith("window#/")){if(!Bn(c))throw Error(`$expression: "${c}" is not a blessed pure global`);let d=c.slice(8),x=bs.get(d);if(x)return x(...Js(d,p,t));let f=U(globalThis.window,d),m=d.lastIndexOf("/"),y=m===-1?globalThis.window:U(globalThis.window,d.slice(0,m));return f.apply(y,p)}let g=rt(c,t,n,r);if(te(g))return g.apply(ws(c,t,n,r),p);if(C(g)&&"$expression"in g){let d=g,x={};for(let[f,m]of(d.parameters??[]).entries()){let y=J(m)?m:m?.name??"";if(!y)continue;x[y]=p[f]===void 0&&C(m)&&"default"in m?m.default:p[f]}return Z(d.$expression,t,n,{args:x,callDepth:l})}throw TypeError(`$expression: call target "${c}" is not callable`)}if(Ht.has(o)){if(o==="?:"){let d=_(i,t,n,r,D(s,"target"));if(s){let x=_(u,t,n,r,D(s,"value")),f=_(a,t,n,r,D(s,"initial"));return d?x:f}return d?_(u,t,n,r):_(a,t,n,r)}let c=_(i,t,n,r,D(s,"target")),l=String(c),p=e.cases??{},g=Object.hasOwn(p,l);if(s){let d;for(let[f,m]of Object.entries(p)){let y=_(m,t,n,r,D(s,["cases",f]));if(f===l)d=y}let x=_(e.default,t,n,r,D(s,"default"));return g?d:x}return g?_(p[l],t,n,r):_(e.default,t,n,r)}if(Wt.has(o)){let c=_(i,t,n,r,D(s,"target")),l=_(u,t,n,r,D(s,"value"));switch(o){case"===":return c===l;case"!==":return c!==l;case"&&":return c&&l;case"||":return c||l;case"??":return c??l;default:return In(o,c,l)}}if(Vn.has(o)){let c=_(u,t,n,r,D(s,"value")),{obj:l,key:p}=Cs(i.$ref,t,n,r);l[p]=o==="="?c:In(o.slice(0,-1),l[p],c);return}if(Hn.has(o)){let c=_(i,t,n,r,D(s,"target"));switch(o){case"push":return c.push(_(u,t,n,r,D(s,"value")));case"unshift":return c.unshift(_(u,t,n,r,D(s,"value")));case"pop":return c.pop();case"shift":return c.shift();case"splice":{let l=_(u,t,n,r,D(s,"value"));return c.splice(...l)}default:break}}if(Bt.has(o)){let c=_(i,t,n,r,D(s,"target")),l=u===void 0?[]:Array.isArray(u)?Un(u,t,n,r,D(s,"value")):[_(u,t,n,r,D(s,"value"))],p=U(c,o);if(!te(p))return;return p.apply(c,l)}if(Vt.has(o)){let c=_(i,t,n,r,D(s,"target")),l=u;if(o==="reduce"){let p=_(a,t,n,r,D(s,"initial"));for(let[g,d]of c.entries())p=Z(l,t,n,{acc:p,index:g,item:d},g===0?D(s,"value"):void 0);return p}if(o==="map")return c.map((p,g)=>Z(l,t,n,{...r,index:g,item:p},g===0?D(s,"value"):void 0));if(o==="filter")return c.filter((p,g)=>Z(l,t,n,{...r,index:g,item:p},g===0?D(s,"value"):void 0))}return}function M(e,t){if(e===null)return"null";if(e===void 0)return"undefined";if(Fn(e))return q(e,t);if(Ue(e))return Ut(e.$ref,t);if(Array.isArray(e))return e.map((n)=>M(n,t)).join(", ");return JSON.stringify(e)}function Os(e){return`_fx_${e.replaceAll(/[^A-Za-z0-9_$]/g,"_")}`}function Ut(e,t){let n=t.statePrefix??"state",r=t.eventParam??"event";if(e==="$reduce/acc")return"_acc";if(e.startsWith("$reduce/"))return"_acc";if(e.startsWith("$args/"))return R("_args",e.slice(6));if(e.startsWith("event#/"))return R(r,e.slice(7));if(e.startsWith("$map/")){let s=e.split("/"),[,o]=s;if(o==="item")return s.length>2?R("_item",s.slice(2).join("/")):"_item";if(o==="index")return"_index";return`_${o}`}if(e.startsWith("#/state/"))return R(n,e.slice(8));if(e.startsWith("parent#/"))return R(n,e.slice(8));if(e.startsWith("window#/"))return R("window",e.slice(8));if(e.startsWith("document#/"))return R("document",e.slice(10));return R(n,e)}function Ln(e,t){if(Ue(e))return Ut(e.$ref,t);return M(e,t)}function As(e,t,n){let r=(i)=>t[i]??"undefined",s=`(${n.statePrefix??"state"}?.$page?.locale ?? ${JSON.stringify(ie)})`,o=JSON.stringify(Dt);switch(e){case"Intl/formatNumber":return`new Intl.NumberFormat(${r(1)} ?? ${s}, ${r(2)}).format(${r(0)})`;case"Intl/formatDate":return`new Intl.DateTimeFormat(${r(1)} ?? ${s}, {timeZone: ${o}, ...${r(2)}}).format(new Date(${r(0)}))`;case"Intl/formatRelativeTime":return`new Intl.RelativeTimeFormat(${r(2)} ?? ${s}, ${r(3)}).format(${r(0)}, ${r(1)})`;case"Intl/formatList":return`new Intl.ListFormat(${r(1)} ?? ${s}, ${r(2)}).format(${r(0)})`;case"Intl/plural":return`new Intl.PluralRules(${r(1)} ?? ${s}, ${r(2)}).select(${r(0)})`;case"Intl/compare":return`new Intl.Collator(${r(2)} ?? ${s}, ${r(3)}).compare(${r(0)}, ${r(1)})`;case"Intl/displayName":return`new Intl.DisplayNames(${r(2)} ?? ${s}, {...${r(3)}, type: ${r(1)} ?? 'language'}).of(${r(0)})`;case"Intl/segment":return`[...new Intl.Segmenter(${r(2)} ?? ${s}, {granularity: ${r(1)} ?? 'grapheme'}).segment(${r(0)})].map((p) => p.segment)`;default:return null}}function q(e,t={}){let{operator:n,target:r,value:s,initial:o}=e;if(Ft.has(n)&&!("value"in e)){let i=M(r,t);if(n==="!")return`!(${i})`;if(n==="-")return`-(${i})`}if(n==="call"){let i=(Ue(r)?r.$ref:void 0)??"",u=Array.isArray(s)?s.map((a)=>M(a,t)):[];if(i.startsWith("window#/")){if(!Bn(i))throw Error(`$expression: "${i}" is not a blessed pure global`);let a=As(i.slice(8),u,t);if(a)return a;return`window.${i.slice(8).replaceAll("/",".")}(${u.join(", ")})`}if(i.startsWith("#/state/")){let a=i.slice(8),c=t.formulaParams?.[a];if(c){let l=c.map((p,g)=>`${JSON.stringify(p)}: ${u[g]??"undefined"}`).join(", ");return`${Os(a)}(${t.statePrefix??"state"}, { ${l} })`}}return`${Ut(i,t)}(${u.join(", ")})`}if(Ht.has(n)){if(n==="?:"){let c=M(r,t),l=M(s,t),p=M(o,t);return`(${c} ? ${l} : ${p})`}let i=M(r,t),u=Object.entries(e.cases??{}).map(([c,l])=>`_d === ${JSON.stringify(c)} ? ${M(l,t)} : `).join(""),a="default"in e?M(e.default,t):"undefined";return`((_d) => ${u}${a})(String(${i}))`}if(Wt.has(n)){let i=M(r,t),u=M(s,t);return`(${i} ${n} ${u})`}if(Vn.has(n)){let i=Ln(r,t),u=M(s,t);return`${i} ${n} ${u}`}if(Hn.has(n)){let i=Ln(r,t);switch(n){case"push":return`${i}.push(${M(s,t)})`;case"unshift":return`${i}.unshift(${M(s,t)})`;case"pop":return`${i}.pop()`;case"shift":return`${i}.shift()`;case"splice":{let u=Array.isArray(s)?s.map((a)=>M(a,t)).join(", "):M(s,t);return`${i}.splice(${u})`}default:break}}if(Bt.has(n)){let i=M(r,t),u=s===void 0?"":Array.isArray(s)?s.map((a)=>M(a,t)).join(", "):M(s,t);return`(${i})?.${n}?.(${u})`}if(Vt.has(n)){let i=M(r,t),u=q(s,t);if(n==="reduce"){let a=M(o,t);return`${i}.reduce((_acc, _item, _index) => ${u}, ${a})`}if(n==="map")return`${i}.map((_item, _index) => ${u})`;if(n==="filter")return`${i}.filter((_item, _index) => ${u})`}return"undefined"}function Re(e,t,n,r){return _(e,t,n,r)}function de(e,t={}){return M(e,t)}var Wn,Ft,Wt,Vn,Hn,Vt,Ht,Bt,$s,Ss,bs,Mn=64,Es=64;var qe=I(()=>{kn();H();je();Wn=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),Ft=new Set(["!","-"]),Wt=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),Vn=new Set(["=","+=","-=","*=","/="]),Hn=new Set(["push","pop","shift","unshift","splice"]),Vt=new Set(["reduce","map","filter"]),Ht=new Set(["?:","switch"]),Bt=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"]),$s=new Set([...Wn,...Ft,...Wt,...Vt,...Ht,...Bt,"call"]),Ss=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",...Mt]),bs=new Map([["Intl/compare",(e,t,n,r)=>new Intl.Collator(n??ie,r).compare(e,t)],["Intl/displayName",(e,t,n,r)=>new Intl.DisplayNames(n??ie,{...r,type:t??"language"}).of(e)],["Intl/formatDate",(e,t,n)=>new Intl.DateTimeFormat(t??ie,{timeZone:Dt,...n}).format(new Date(e))],["Intl/formatList",(e,t,n)=>new Intl.ListFormat(t??ie,n).format(e)],["Intl/formatNumber",(e,t,n)=>new Intl.NumberFormat(t??ie,n).format(e)],["Intl/formatRelativeTime",(e,t,n,r)=>new Intl.RelativeTimeFormat(n??ie,r).format(e,t)],["Intl/plural",(e,t,n)=>new Intl.PluralRules(t??ie,n).select(e)],["Intl/segment",(e,t,n)=>[...new Intl.Segmenter(n??ie,{granularity:t??"grapheme"}).segment(e)].map((r)=>r.segment)]])});function js(e){return e.startsWith(qn)}function si(e){let t=e;if(js(t))t=t.slice(qn.length);return t=t.replace(/^\.\//,"").replace(/\.(js|ts|mjs|mts)$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,""),`${qt}${t}.js`}function oi(e){let t=/\.(\w+)$/.exec(e)?.[1]??"",n=e.replace(/\.\w+$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"");return t===""?`${qt}${n}`:`${qt}${n}.${t}`}function Kn(e){let t=e.replaceAll("\\","/");return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function zn(e){let t=Kn(e);return t.startsWith("/")?t:`/${t}`}function Rs(e,t){return[...e].toSorted((n,r)=>r[t].length-n[t].length)}function ii(e,t){let n=t.split("#")[0].split("?")[0];if(!n.startsWith("/"))return null;let r;try{r=decodeURIComponent(n)}catch{return null}if(/%2e|%2f/i.test(r))return null;for(let s of Rs(e,"urlPrefix")){let o=zn(s.urlPrefix);if(!r.startsWith(`${o}/`))continue;let u=r.slice(o.length+1).split("/");if(u.some((c)=>c===""||c==="."||c===".."))return null;let{filter:a}=s;if(a&&!a(u.join("/")))return null;return`${Kn(s.dir)}/${u.join("/")}`}return null}function ai(e,t){let n=new Set;for(let r of t){let s=zn(r.urlPrefix),o=new RegExp(`${s.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}/[^${Ns}]+`,"g");for(let i of e.matchAll(o)){let u=i[0].split("#")[0].split("?")[0];if(!u.endsWith("/"))n.add(u)}}return[...n].filter(Boolean)}function Ps(e){let t=[],n=0;while(n<e.length){while(n<e.length&&(/\s/.test(e[n])||e[n]===","))n+=1;if(n>=e.length)break;let r=n;while(n<e.length&&!/\s/.test(e[n]))n+=1;let s=e.slice(r,n);if(s.endsWith(",")){t.push({descriptor:"",url:s.replace(/,+$/,"")});continue}while(n<e.length&&/\s/.test(e[n]))n+=1;let o=n;while(n<e.length&&e[n]!==",")n+=1;let i=e.slice(o,n).trim();if(n+=1,s=s.replace(/,+$/,""),s!=="")t.push({descriptor:i,url:s})}return t}function Ts(e){return e.map(({url:t,descriptor:n})=>n?`${t} ${n}`:t).join(", ")}function li(e){if(!J(e)||e==="")return"";let t;try{({pathname:t}=new URL(e))}catch{return""}let n=t.replace(/\/+$/,"");if(n===""||n==="/")return"";return n.startsWith("/")?n:`/${n}`}function Yn(e,t){if(e===""||!t.startsWith("/")||t.startsWith("//"))return t;if(t===e||t.startsWith(`${e}/`))return t;return e+t}function ci(e,t){let n=new URL(t);if(!n.pathname.endsWith("/"))n.pathname+="/";return new URL(e.replace(/^\/+/,""),n).href}var qn="npm:",qt="/assets/",Ns;var Kt=I(()=>{H();Ns=String.raw`"'\s<>()\\`});function Gn(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 ks(e){return(C(e)||te(e))&&"then"in e&&te(e.then)}async function Ne(e,t,n,r={}){let s=r.args?{args:r.args}:void 0;for(let o of e){let i=Gn(o);switch(i.kind){case"expression":{let u=Z(i.node,t,n,s);if(ks(u))await u;break}case"if":{let u=i.node,a=Re(u.if,t,n,s)?u.then:u.else;if(Array.isArray(a))await Ne(a,t,n,r);break}case"switch":{let u=i.node,a=String(Re(u.$switch,t,n,s)),c=u.cases??{},l=Object.hasOwn(c,a)?c[a]:u.default;if(Array.isArray(l))await Ne(l,t,n,r);break}case"dispatch":{let u=i.node,a=te(r.target)?r.target():r.target,c=n?.currentTarget??a;if(!c)break;let l={};if("detail"in u)l.detail=Re(u.detail,t,n,s);if(u.bubbles!==void 0)l.bubbles=u.bubbles;if(u.composed!==void 0)l.composed=u.composed;c.dispatchEvent(new CustomEvent(u.dispatchEvent,l));break}case"stopPropagation":{n?.stopPropagation();break}case"preventDefault":{n?.preventDefault();break}default:break}}}function ne(e,t={}){let n=t.indent??"",r=[];for(let s of e){let o=Gn(s);switch(o.kind){case"expression":{r.push(`${n}${q(o.node,t)};`);break}case"if":{let i=o.node,u=de(i.if,t),a={...t,indent:`${n} `};if(r.push(`${n}if (${u}) {`,ne(i.then??[],a)),i.else)r.push(`${n}} else {`,ne(i.else,a));r.push(`${n}}`);break}case"switch":{let i=o.node,u=de(i.$switch,t),a={...t,indent:`${n} `};r.push(`${n}switch (String(${u})) {`);for(let[c,l]of Object.entries(i.cases??{}))r.push(`${n} case ${JSON.stringify(c)}: {`,ne(l,a),`${n} break;`,`${n} }`);if(i.default)r.push(`${n} default: {`,ne(i.default,a),`${n} }`);r.push(`${n}}`);break}case"dispatch":{let i=o.node,u=t.eventParam??"event",a=t.dispatchTarget??`(${u} && ${u}.currentTarget)`,c=[];if("detail"in i)c.push(`detail: ${de(i.detail,t)}`);if(i.bubbles!==void 0)c.push(`bubbles: ${JSON.stringify(i.bubbles)}`);if(i.composed!==void 0)c.push(`composed: ${JSON.stringify(i.composed)}`);let l=c.length>0?`, { ${c.join(", ")} }`:"";r.push(`${n}${a}?.dispatchEvent(new CustomEvent(${JSON.stringify(i.dispatchEvent)}${l}));`);break}case"stopPropagation":{r.push(`${n}${t.eventParam??"event"}?.stopPropagation();`);break}case"preventDefault":{r.push(`${n}${t.eventParam??"event"}?.preventDefault();`);break}default:break}}return r.join(`
|
|
2
|
+
`)}var st=I(()=>{H();qe()});function ot(e){if(!e.startsWith("${")||!e.endsWith("}"))return!1;let t=0;for(let n=1;n<e.length;n+=1){let r=e[n];if(r==="{")t+=1;else if(r==="}"){if(t-=1,t===0)return n===e.length-1}}return!1}function Zn(){return[...Xn].toSorted()}function Ce(e,t){let n=e.toLowerCase();if(n.startsWith("aria-")||Xn.has(n))return String(t);return t?"":null}var ge,Xn,zt=32,it,at="jx-slot",Yt="data-jx-slots",Gt="jx.slot.group",vi;var ze=I(()=>{Be();qe();je();H();Kt();st();Be();ge=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"]),Xn=new Set(["contenteditable","draggable","spellcheck"]);it=/^[\t\n\f\r ]+$/u,vi=(()=>{let e=Symbol.for(Gt),t=globalThis;return t[e]??=new WeakMap,t[e]})()});function Qn(e,t,n,r,s=Ds){let o=[],i=(p,g)=>{let d={mediaQueries:t,scope:g,transposeValue:n};if(r)d.resolveValue=(x,f)=>r(x,f,g);for(let x of Ae(p,d))o.push(x.text)},u={},a={},c=[],l=[];for(let[p,g]of Object.entries(e)){if(C(g)&&!Array.isArray(g)){if(p.startsWith("@"))c.push([p,g]);else if(!p.startsWith("--"))l.push([p,g]);continue}if(Se(p)||p.startsWith("@"))continue;if(p.startsWith("--")||p==="colorScheme"||p==="color-scheme")u[p]=g;else a[p]=g}i(u,s.root),i(a,s.body);for(let[p,g]of l)if(p.startsWith("&"))i({[p]:g},s.root);else i(g,p);for(let[p,g]of c){if(We(p)||He(p)){i({[p]:g},null);continue}let d={},x={},f=[];for(let[m,y]of Object.entries(g)){if(C(y)&&!Array.isArray(y)){if(!m.startsWith("@"))f.push([m,y]);continue}if(m.startsWith("--"))d[m]=y;else x[m]=y}i({[p]:d},s.root),i({[p]:x},s.body);for(let[m,y]of f)i({[p]:y},m)}if(Object.values(t).some((p)=>ue(p)!==null)&&!("colorScheme"in e))o.push(`${s.root} { color-scheme: light dark }`,`${s.root}:where([${se}="light"]) { color-scheme: light }`,`${s.root}:where([${se}="dark"]) { color-scheme: dark }`);return o.join(`
|
|
3
|
+
`)}var Ds;var er=I(()=>{Be();H();Ds={body:"body",root:":root"}});function tr(e){return e===!1||e==="open"||e==="closed"}function lt(e,t){let n=e?.$shadow;if(tr(n))return n===!1?null:n;let r=t?.shadow;return tr(r)&&r!==!1?r:null}function nr(e,t){return t===null?e:":host"}function Ge(e,t){let n=[];for(let[r,s]of(e.parameters??[]).entries()){let o=rr(s);if(!o)continue;let i=sr(s)?`_a[${r}] === undefined ? ${JSON.stringify(s.default)} : _a[${r}]`:`_a[${r}]`;n.push(`${JSON.stringify(o)}: ${i}`)}return`(..._a) => { const _args = { ${n.join(", ")} }; return ${t}; }`}function rr(e){return J(e)?e:e?.name??""}function sr(e){return C(e)&&"default"in e}function ft(e,t){let n=nn(e,t);return n===e?e:`${n} as ${e}`}function nn(e,t){let n=t?.$export;return J(n)&&n!==""?n:e}function mt(e,t,n={}){let{statePrefix:r="state",indent:s="",collect:o}=n,{url:i}=t,u=N(i),a=t.method??"GET";if(t.manual)return`${s}// ${e}: manual Request — fetch triggered by user action`;let c=[`// ${e}: auto-fetch from ${u?"(dynamic URL)":i}`,o?`${o}.push(effect(() => {`:"effect(() => {"];if(u)c.push(` const url = \`${Is(i,r)}\`;`,' if (!url || url === "undefined" || url.includes("undefined")) return;');else c.push(` const url = ${JSON.stringify(i)};`);let l=[];if(a!=="GET")l.push(`method: ${JSON.stringify(a)}`);if(t.headers)l.push(`headers: ${JSON.stringify(t.headers)}`);if(t.body){let g=C(t.body)?JSON.stringify(JSON.stringify(t.body)):JSON.stringify(t.body);l.push(`body: ${g}`)}let p=l.length>0?`, { ${l.join(", ")} }`:"";return c.push(` fetch(url${p})`," .then(r => r.ok ? r.json() : Promise.reject(r.statusText))",` .then(d => { ${r}.${e} = d; })`,` .catch(e => { ${r}.${e} = { error: String(e) }; });`,o?"}));":"});"),c.map((g)=>`${s}${g}`).join(`
|
|
4
|
+
`)}function dt(e,t,n={}){let{statePrefix:r="state",indent:s="",collect:o,serverBaseUrl:i="/_jx/server"}=n,u=JSON.stringify(`${i}/${t.$export}`),a=Object.entries(t.arguments??{}),c=a.map(([f,m])=>{if(!P(m))return`${fe(f)}: ${JSON.stringify(m)}`;if(Ms.some((y)=>m.$ref.startsWith(y)))throw Error(`Server function "${e}": argument "${f}" references "${m.$ref}", which a state entry cannot read. Use a #/state/, parent#/, window#/ or document#/ reference.`);return`${fe(f)}: ${de({$ref:m.$ref},{statePrefix:r})}`}),l=a.some(([,f])=>P(f)),p=`${pr}(${u}, ${c.length>0?`{ ${c.join(", ")} }`:"{}"})`,g=R(r,B(e)),d=`console.error(${JSON.stringify(`Jx server function ${t.$export}:`)}, e)`;return(l?[`// ${e}: server function ${t.$export}, called again when an argument changes`,"{"," let _jxSeq = 0;",o?` ${o}.push(effect(() => {`:" effect(() => {"," const _seq = ++_jxSeq;",` ${p}`,` .then((d) => { if (_seq === _jxSeq) ${g} = d; })`,` .catch((e) => { if (_seq === _jxSeq) ${d}; });`,o?" }));":" });","}"]:[`// ${e}: server function ${t.$export}, called once`,p,` .then((d) => { ${g} = d; })`,` .catch((e) => { ${d}; });`]).map((f)=>`${s}${f}`).join(`
|
|
5
|
+
`)}function Is(e,t){if(t==="state")return e;return e.replaceAll(/\$\{([^}]*)\}/g,(n,r)=>`\${${r.replaceAll(/(?<!this\.)\bstate\./g,`${t}.`)}}`)}function xt(e){if(!C(e))return!1;if(e.state)for(let[t,n]of Object.entries(e.state)){if(t==="$site"||t==="$page")continue;if(!C(n)||Array.isArray(n))return!0;if(n.timing==="compiler")continue;if(n.$prototype)return!0;if("default"in n)return!0;if($e(n))continue;return!0}if(e.$switch)return!0;if(V(e)||Pt(e.children))return!0;if(Array.isArray(e.children)&&e.children.some((t)=>xt(t)))return!0;for(let[t,n]of Object.entries(e)){if(ge.has(t))continue;if(P(n))return!0;if(N(n))return!0}if(C(e.style)){for(let t of Object.values(e.style))if(N(t))return!0}if(C(e.attributes)){for(let t of Object.values(e.attributes))if(N(t))return!0}return!1}function ir(e){if(!C(e))return!1;if(e.$switch)return!0;if(V(e)||Pt(e.children))return!0;for(let[t,n]of Object.entries(e)){if(ge.has(t))continue;if(P(n))return!0;if(N(n))return!0}if(C(e.style)){for(let t of Object.values(e.style))if(N(t))return!0}if(C(e.attributes)){for(let t of Object.values(e.attributes))if(N(t))return!0}return!1}function ke(e,t=null,n={},r={}){let s=e?.state?en(e.state,t):t??ar();return{media:r,scope:s,scopeDefs:n}}function ar(e=null){return Object.create(e)}function lr(e){return e[or]}function Qt(e,t){if(J(e)){for(let o of e.matchAll(Ls))t.add(o[1]);for(let o of e.matchAll(Fs))t.add(o[1]);return}if(Array.isArray(e)){for(let o of e)Qt(o,t);return}if(!C(e))return;let n=e,{operator:r,target:s}=n;if(J(r)&&me(r)&&P(s)&&s.$ref.startsWith("#/state/"))t.add(s.$ref.slice(8).split("/")[0]);for(let o of Object.values(n))Qt(o,t)}function en(e={},t=null){let n=ar(t),r=t?lr(t):void 0,s=new Set(r);Object.defineProperty(n,or,{configurable:!0,enumerable:!1,value:s,writable:!0});let o=new Set;for(let c of Object.values(e))if(G(c)||X(c))Qt(c.body??c.$expression,o);for(let c of o)if(c in e)s.add(c);for(let[c,l]of Object.entries(e)){if(!C(l)||Array.isArray(l)){he(n,c,ct(l));continue}if("default"in l){he(n,c,ct(l.default));continue}if(le(l)){s.add(c);continue}if(!l.$prototype&&!("$expression"in l)&&!$e(l))he(n,c,ct(l))}let i=[],u=[];for(let[c,l]of Object.entries(e)){if(N(l)){i.push([c,l]);continue}if(!C(l))continue;if(X(l)){let p=l.$expression;if(Ee(l)){let g=l.parameters;he(n,c,(...d)=>{let x={};for(let[f,m]of g.entries()){let y=rr(m);if(!y)continue;x[y]=d[f]===void 0&&sr(m)?m.default:d[f]}return Z(p,n,null,{args:x})})}else if(me(p.operator))he(n,c,(g,d)=>Z(p,g,d));else Xt(n,c,()=>Z(p,n,null));continue}if(G(l)){if(xe(l)){let{body:p}=l;he(n,c,(g,d)=>{Ne(p,g??n,d??null)})}else if(J(l.body)){let p=l.parameters?ce(l.parameters):l.arguments??[],{body:g}=l,d=p.includes("state")?p:["state",...p],x=Function(...d,g),f=(m,y)=>x(...d.map((w)=>w==="state"?m:y));if(we(g))Xt(n,c,()=>f(n)),u.push([c,g]);else he(n,c,f)}else he(n,c,()=>{}),s.add(c);continue}if(ye(l)&&(l.$prototype==="LocalStorage"||l.$prototype==="SessionStorage")){he(n,c,ct(l.default??null));continue}if(ye(l)&&l.$prototype==="Request")s.add(c)}let a=!0;while(a){a=!1;for(let[c,l]of[...u,...i])if(!s.has(c)&&cr(l,n))s.add(c),a=!0}for(let[c,l]of i)Xt(n,c,()=>rn(l,n));return n}function he(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})}function Xt(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:n})}function T(e,t){if(P(e))return Ws(e.$ref,t);if(N(e))return rn(e,t);return e}function Y(e){return P(e)}function Ws(e,t){if(!J(e))return e;if(e.startsWith("$map/")){let n=e.split("/"),r=n[1],o=t.$map?.[r]??t[`$map/${r}`];return n.length>2?Zt(o,n.slice(2).join("/")):o}if(e.startsWith("#/state/"))return Zt(t,e.slice(8));return Zt(t,e)??null}function cr(e,t){if(!t)return!1;let n=lr(t);for(let r of e.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*(\()?/g)){if(r[2])continue;let s=r[1];if(n?.has(s))return!0;let o;try{o=t[s]}catch{continue}if(te(o))return!0}return!1}function yt(e){return ot(e)?`(${e.slice(2,-1)})`:`\`${e}\``}function rn(e,t){if(cr(e,t))return null;let n=["state","$map","$site","$page"],r=[t,t?.$map,t?.$site,t?.$page];try{let s=ot(e)?`return (${e.slice(2,-1)})`:`return \`${e}\``;return Function(...n,s)(...r)}catch{return null}}function Zt(e,t){return U(e,t)}function ct(e){if(!C(e))return e;return structuredClone(e)}function Vs(e,t){if(!e||!t)return"";return Object.entries(e).filter(([n,r])=>!n.startsWith(":")&&!n.startsWith(".")&&!n.startsWith("&")&&!n.startsWith("[")&&!n.startsWith("@")&&N(r)).map(([n,r])=>{let s=T(r,t);return s==null?null:`${z(n)}: ${s}`}).filter(Boolean).join("; ")}function ve(e,t,n=""){let r="",s=T(e.id,t),o=T(e.className,t),i=T(e.hidden,t),u=T(e.tabIndex,t),a=T(e.title,t),c=T(e.lang,t),l=T(e.dir,t);if(s)r+=` id="${j(String(s))}"`;if(o)r+=` class="${j(String(o))}"`;if(i)r+=" hidden";if(u!==void 0&&u!==null)r+=` tabindex="${j(String(u))}"`;if(a)r+=` title="${j(String(a))}"`;if(c)r+=` lang="${j(String(c))}"`;if(l)r+=` dir="${j(String(l))}"`;let p=[Vs(e.style,t),n].filter(Boolean).join("; ");if(p)r+=` style="${j(p)}"`;if(e.attributes)for(let[g,d]of Object.entries(e.attributes)){let x=T(d,t);if(K(x)){let f=Ce(g,x);if(f!==null)r+=f===""?` ${g}`:` ${g}="${j(f)}"`;continue}if(J(x)||ee(x))r+=` ${g}="${j(String(x))}"`}if(e.$static)r+=" data-jx-static";else if(e.$prerendered)r+=" data-jx-prerendered";return r}function Xe(e,t=" "){return e?"":`
|
|
6
|
+
${t}`}function $t(){let e=JSON.stringify(nt),t=JSON.stringify(se);return`(function(){try{var s=localStorage.getItem(${e});if(s==="light"||s==="dark"){document.documentElement.setAttribute(${t},s)}}catch(e){}})()`}function ut(e,t,n,r){for(let s of Ae(t,{mediaQueries:r,resolveValue:(o,i)=>ur(o,i,n),scope:n}))e.push(s.text)}function ur(e,t,n){let r=J(t)?t:t.$ref;return Hs.push({property:e,selector:n,source:r}),null}function St(){return`const __jxEnumAttrs = new Set(${JSON.stringify(Zn())});
|
|
7
|
+
function ${_e}(n, v) {
|
|
7
8
|
if (typeof v !== 'boolean') return v;
|
|
8
9
|
const l = n.toLowerCase();
|
|
9
10
|
if (l.startsWith('aria-') || __jxEnumAttrs.has(l)) return String(v);
|
|
10
11
|
return v ? '' : null;
|
|
11
|
-
}`}function
|
|
12
|
-
`)}function
|
|
13
|
-
|
|
12
|
+
}`}function bt(){return[`async function ${pr}(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(`
|
|
13
|
+
`)}function fr(){let e=`new RegExp(${JSON.stringify(it.source)}, ${JSON.stringify(it.flags)})`,t=`Symbol.for(${JSON.stringify(Gt)})`,n=JSON.stringify(Yt),r=JSON.stringify(at);return[`const __jxSlotWs = ${e};`,`const __jxSlotRec = globalThis[${t}] || (globalThis[${t}] = new WeakMap());`,`function ${sn}(host) {`,` const id = host.getAttribute(${n});`," if (id === null) return Array.from(host.childNodes);",` host.removeAttribute(${n});`,` const open = ${r} + ' ' + id + ' ';`,` const close = '/' + ${r} + ' ' + 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 ${on}(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(`
|
|
14
|
+
`)}function Pe(e){for(let t of an(e)){if(V(t)){if(t.map&&Pe([t.map]))return!0;continue}if(!Fe(t))continue;if(t.tagName==="slot")return!0;let n=Object.values(t.cases??{}).filter((r)=>Fe(r)&&!Y(r));if(Pe(n)||Pe(t.children))return!0}return!1}function an(e){if(V(e))return[e];if(!Array.isArray(e))return[];return e}function Me(e,t={},n=null){let r=[],s=Qn(C(n)?n:{},t,(i)=>i,ur);if(s!=="")r.push(s);if(Te(e,r,t,"",{n:0}),r.length===0)return"";return`<style>
|
|
15
|
+
${Bs(r.join(`
|
|
14
16
|
`))}
|
|
15
|
-
</style>`}function
|
|
16
|
-
${
|
|
17
|
-
`);return""}function
|
|
18
|
-
`);if(!
|
|
19
|
-
${
|
|
20
|
-
`):"";
|
|
17
|
+
</style>`}function Bs(e){return e.replaceAll(/<\/(?=style)/gi,String.raw`<\/`)}function Te(e,t,n,r="",s,o="jx"){let i=s??{n:0};if(!C(e))return;if(e.style&&!e.id&&!e.className)e.className=`${o}-${i.n}`,i.n+=1;let u=Oe(e.tagName).join(", ")||"*",a=e.id?`#${e.id}`:e.className?`.${e.className.split(" ")[0]}`:u;if(e.style)ut(t,e.style,a,n);if(Array.isArray(e.children))for(let c of e.children)Te(c,t,n,a,i,o);if(C(e.cases))for(let c of Object.values(e.cases))Te(c,t,n,a,i,o)}function j(e){return String(e).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Jt(e){return e.split("-").map((t)=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}function Vi(e){let t=[];return mr(e,t),t}function mr(e,t){if(!C(e))return;if(e.state){for(let[n,r]of Object.entries(e.state))if(le(r))t.push({exportName:r.$export,key:n,src:r.$src})}if(Array.isArray(e.children))for(let n of e.children)mr(n,t)}function cn(e,t){if(J(e))return e;let n=Oe(e);if(n.length===0)return"div";if(!oe(e))return n[0];let r=e.$expression,s=r.target;if(r.operator==="?:")return T(s,t)?r.value:r.initial;let o=T(s,t);return r.cases[String(o)]??r.default}function Us(e){if(!e?.slotIds)return null;return e.slotIds.n+=1,e.slotIds.n}function qs(e,t,n,r=null){let s=new Map;for(let o of an(e)){let i="",u=!0,a;if(J(o)||ee(o)||K(o)){if(a=n(o),it.test(a))continue;u=a!==""}else if(V(o))a="";else if(!Fe(o))a=n(o),u=a!=="";else{let l=T(o.attributes?.slot,t),p=J(o.slot)?T(o.slot,t):null;if(J(l)&&l!=="")i=l,a=n(o);else if(J(p)&&p!==""){i=p;let{slot:g,...d}=o;a=n({...d,attributes:{...d.attributes,slot:p}})}else a=n(o)}let c=s.get(i);if(c)c.html=c.html===""?a:`${c.html}
|
|
18
|
+
${a}`,c.content||=u;else s.set(i,{content:u,html:a})}return{groups:s,id:r,taken:new Set}}function dr(e,t,n){for(let r of an(e)){if(V(r)||!Fe(r))continue;if(r.tagName==="slot"){let s=T(r.attributes?.name,t);n.taken.add(J(s)?s:"")}dr(r.children,t,n)}}function Ks(e){let t=null,n={};for(let[r,s]of Object.entries(e??{}))if(r.startsWith("props.")&&r.length>6)t??={},t[r.slice(6)]=s;else n[r]=s;return{lifted:t,rest:n}}function gr(e,t){if(!t)return en(e.state??{},null);let n={...e.state};for(let[r,s]of Object.entries(t)){let o=n[r];n[r]=C(o)&&!Array.isArray(o)&&"default"in o?{...o,default:s}:s}return en(n,null)}function zs(e,t){return Object.fromEntries(Object.entries(e??{}).flatMap(([n,r])=>{if(!N(r))return[];let s=T(r,t);return s==null?[]:[[n,s]]}))}function Ye(e,t,n,r){if(e.textContent!==void 0){let s=T(e.textContent,t);return s!=null?j(String(s)):""}if(e.innerHTML){let s=T(e.innerHTML,t);return s!=null?String(s):e.innerHTML}if(Array.isArray(e.children))return e.children.map((s)=>pt(s,t,n,r)).join(`
|
|
19
|
+
`);return""}function pt(e,t,n=null,r=null){if(J(e)){if(N(e)&&t){let u=rn(e,t);return u!=null?j(String(u)):j(e)}return j(e)}if(ee(e)||K(e))return j(String(e));if(Array.isArray(e))return e.map((u)=>pt(u,t,n,r)).join(`
|
|
20
|
+
`);if(!C(e))return"";if(e.$prototype==="Array")return"";if(e.$switch){let u=e.tagName??"div",a=ve(e,t),c=T(e.$switch,t),l=c==null?void 0:e.cases?.[String(c)],p=l!==void 0&&!Y(l)?pt(l,t,n,r):"";return`<${u}${a}>${p}</${u}>`}let s=cn(e.tagName,t);if(s==="slot"&&n){let u=T(e.attributes?.name,t),a=J(u)?u:"",c;if(!n.taken.has(a))n.taken.add(a),c=n.groups.get(a);let l=c?.html??"";if(l!==""&&n.id!==null)l=`<!--${at} ${n.id} ${encodeURIComponent(a)}-->${l}<!--/${at} ${n.id}-->`;if(c?.content)return dr(e.children,t,n),l;let p=Ye(e,t,n,r);return l===""?p:p===""?l:`${l}
|
|
21
|
+
${p}`}let o=r?.componentDefs.get(s);if(o&&r)return Ys(e,o,t,n,r);let i=ve(e,t);if(ln.has(s))return`<${s}${i}>`;return`<${s}${i}>${Ye(e,t,n,r)}</${s}>`}function Ys(e,t,n,r,s){let o=t.tagName,{lifted:i,rest:u}=Ks(e.attributes),a={...i,...e.$props},c={};for(let[h,b]of Object.entries(a))c[h]=T(b,n)??b;let l=Object.keys(c).length>0,p=s.path??[],g={key:JSON.stringify(c),tag:o},d=[...p.map((h)=>h.tag),o].join(" → ");if(p.some((h)=>h.tag===g.tag&&h.key===g.key))throw Error(`Component <${o}> renders itself: ${d}. A component cannot appear inside its own `+"definition with the same props — the expansion would never end.");if(p.length>=zt)throw Error(`Component nesting exceeds ${zt} levels: ${d}. A component that renders itself with changing props needs a case that stops.`);let x={...s,path:[...p,g]},{children:f}=e,m=(h)=>pt(h,n,r,s),y=lt(t,s.defaults),w=Gs(t),O=gr(t,l?c:null),v,A=null;if(y){let h=Array.isArray(f)?f.map((b)=>m(b)).join(`
|
|
22
|
+
`):"";v=`<template shadowrootmode="${y}"><link rel="stylesheet" href="/components/${o}.css">${Ye(t,O,null,x)}</template>${h}`}else{A=!w&&Pe(t.children)?Us(s):null;let h=qs(f,n,m,A);v=Ye(t,O,h,x)}let k=Object.entries(zs(t.style,O)).map(([h,b])=>`${z(h)}: ${b}`).join("; "),S={...e};if(delete S.$props,delete S.children,S.attributes=!w&&l?{...u,"data-jx-props":JSON.stringify(c)}:u,A!==null)S.attributes={...S.attributes,[Yt]:String(A)};if(w)S.$static=!0;else S.$prerendered=!0;return`<${o}${ve(S,n,k)}>${v}</${o}>`}function Hi(e,t=null,n=null,r=null){return Ye(e,gr(e,t),n,r)}function Gs(e){return tn(e)}function tn(e){if(!C(e))return!0;if(Array.isArray(e))return e.every((t)=>tn(t));if(e.$prototype)return!1;if(e.$ref)return!1;if(e.state)for(let t of Object.values(e.state)){if(!C(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)=>tn(t));if(V(e.children))return!1;return!0}function Zs(e,t){return Ve(e).map((n)=>Qs(n,t)).join(", ")}function Qs(e,t){let n=tt(e,t);if(n!==null)return n;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"&&Xs.test(e))return e;return`${t}${e}`}function Bi(e,t,n=null,r={},s=null){let o=[],i=nr(e,s);if(C(t)){let u={},a=[];for(let[c,l]of Object.entries(t))if(P(l))u[c]=l;else if(C(l)&&!Array.isArray(l))a.push([c,l]);else if(!c.startsWith("@")&&!Se(c))u[c]=l;ut(o,u,i,r);for(let[c,l]of a)if(c.startsWith("@"))ut(o,{[c]:l},i,r);else if(Se(c))ut(o,l,Zs(c,i),r)}if(n&&Array.isArray(n.children)){let u={n:0};for(let a of n.children)Te(a,o,r,"",u,e)}return o.length>0?`${o.join(`
|
|
21
23
|
`)}
|
|
22
|
-
`:""}var Ms,Nn="https://esm.sh/@vue/reactivity@3.5.40",Rn="https://esm.sh/lit-html@3.3.0",yl,xl,Ze,El,vt="__jxAttrText",Dr="__jxCaptureSlotted",Fr="__jxDistributeSlots",At="<!---->",Wr,Pl;var lt=N(()=>{zt();Gt();$n();_s();Q();xt();zt();Gt();$n();Q();Ms=Symbol("jx.runtimeOnlyStateKeys");yl=/\bstate\.([A-Za-z_$][\w$]*)\s*(?:\+\+|--|(?:\*\*|\|\||&&|\?\?|<<|>>>|>>|[-+*/%&|^])?=(?!=))/g,xl=/\bstate\.([A-Za-z_$][\w$]*)\s*\.\s*(?:push|pop|shift|unshift|splice|sort|reverse|fill|copyWithin)\s*\(/g;Ze=new Set(["pre","textarea","listing","plaintext","xmp"]);El=[];Wr=new Set(["input","br","hr","img","meta","link","area","col","source"]);Pl=/^(?:::slotted\(|::part\()/});function He(e){if(e.startsWith("\\\\?\\"))return e;return e.split("\\").join("/")}var Il,en=()=>Il;var Gs=N(()=>{Il=/^win/.test(globalThis.process?globalThis.process.platform:"")});function F(e,t){let n=new URL(zs(e),"https://aaa.nonexistanturl.com"),r=new URL(zs(t),n),i=t.match(/(\s*)$/)?.[1]||"";if(r.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:o,hash:a}=r;return s+o+a+i}return r.toString()+i}function zs(e){let t=e.search(/[?#]/);return t<0?He(e):He(e.slice(0,t))+e.slice(t)}function nn(e){try{return decodeURIComponent(e)}catch{try{return decodeURIComponent(e.replace(/%(?![\dA-F]{2})/gi,"%25"))}catch{return e}}}function xe(){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 Qs(e){let t=Jl.exec(e||"");if(t)return t[1].toLowerCase();return}function Zs(e){let t=e.search(/[?#]/),n=t>=0?e.substring(0,t):e,r=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\")),i=n.lastIndexOf(".");if(i>r)return n.substring(i).toLowerCase();return""}function Se(e){if(!e)return"#";let t=e.indexOf("#");if(t>=0)return e.substring(t);return"#"}function R(e){if(!e)return"";let t=e.indexOf("#");if(t>=0)e=e.substring(0,t);return e}function eo(e){let t=Qs(e);if(t==="http"||t==="https")return!0;else if(t===void 0)return typeof window<"u";else return!1}function jn(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 n=new URL(t.startsWith("//")?"http:"+t:t);if(Vr(n.hostname))return!0;let r=n.port;if(r&&Ul(parseInt(r)))return!0}catch{if(t.startsWith("/")&&!t.startsWith("//"))return!1;if(Hl(t))return!0}return!1}async function to(e){if(jn(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(no(t.hostname),{all:!0,verbatim:!0});if(i.length===0||i.some(({address:s})=>Vr(s)))return{unsafe:!0};return{unsafe:!1,addresses:i}}function Vr(e){let t=no(e);if(!t)return!0;if(t==="localhost"||Dl.some((i)=>t.endsWith(i)))return!0;let n=ro(t);if(n)return io(n);let r=Fl(t);if(r)return Bl(r);return!1}function no(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 ro(e){let t=e.split(".");if(t.length!==4)return;let n=t.map((r)=>{if(!/^\d+$/.test(r))return Number.NaN;return Number(r)});if(n.some((r)=>!Number.isInteger(r)||r<0||r>255))return;return n}function io([e,t,n,r]){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&&n===0||e===192&&t===168||e===198&&(t===18||t===19)||e>=224||e===255&&t===255&&n===255&&r===255}function Fl(e){if(!e.includes(":"))return;let t=e,n=t.lastIndexOf(":"),r=t.slice(n+1);if(r.includes(".")){let c=ro(r);if(!c)return;let l=c[0]*256+c[1],u=c[2]*256+c[3];t=`${t.slice(0,n+1)}${l.toString(16)}:${u.toString(16)}`}let i=t.split("::");if(i.length>2)return;let s=Xs(i[0]),o=i.length===2?Xs(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 Xs(e){if(!e)return[];let t=e.split(":").map((n)=>{if(!/^[\da-f]{1,4}$/i.test(n))return Number.NaN;return Number.parseInt(n,16)});if(t.some((n)=>!Number.isInteger(n)||n<0||n>65535))return;return t}function Bl(e){if(e.length!==8)return!1;let t=e.every((a)=>a===0),n=e.slice(0,7).every((a)=>a===0)&&e[7]===1,r=(e[0]&65024)===64512,i=(e[0]&65472)===65152,s=(e[0]&65280)===65280;if(t||n||r||i||s)return!0;let o=Wl(e);return o?io(o):!1}function Wl(e){let t=e.slice(0,5).every((i)=>i===0),n=t&&e[5]===0,r=t&&e[5]===65535;if(!n&&!r)return;return[Math.floor(e[6]/256),e[6]%256,Math.floor(e[7]/256),e[7]%256]}function Hl(e){return e.split(/[\s/?#]+/).map((n)=>n.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((n)=>Vr(n))}function Ul(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 Mn(e){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let t=Qs(e);return t===void 0||t==="file"}function so(e){if(en()){let t=xe(),n=e.toUpperCase(),i=He(t).toUpperCase(),s=n.includes(i),o=n.includes(i),a=jl.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=He(e)}e=encodeURI(e);for(let t of Ml)e=e.replace(t[0],t[1]);return e}function Ot(e,t){e=e.replace(/%(?![0-9A-Fa-f]{2})/g,"%25");for(let r=0;r<Ur.length;r+=2)e=e.replace(new RegExp(Ur[r].source,"gi"),Ur[r+1]);e=decodeURI(e);let n=e.toLowerCase().startsWith("file://");if(n){if(e=e.replace(/^file:\/\//i,"").replace(/^\//,""),en()&&e[1]==="/")e=`${e[0]}:${e.substring(1)}`;if(t)e="file:///"+e;else n=!1,e=en()?e:"/"+e}if(en()&&!n){if(e=e.replace(_l,"\\"),e.match(/^[a-z]:\\/i))e=e[0].toUpperCase()+e.substring(1)}return e}function Tt(e){if(e=nn(e),e.length<=1||e[0]!=="#"||e[1]!=="/")return[];return e.slice(2).split("/").map((t)=>t.replace(kl,"/").replace(Ll,"~"))}var _l,Jl,kl,Ll,jl,Ml,Ur,Dl,tn=(e)=>new URL(e);var ce=N(()=>{Gs();_l=/\//g,Jl=/^(\w{2,}):\/\//i,kl=/~1/g,Ll=/~0/g,jl=/^[a-zA-Z]:[\\/]/,Ml=[[/\?/g,"%3F"],[/#/g,"%23"]],Ur=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%3F/g,"?",/%40/g,"@"],Dl=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function oo(){let e={},t=this;for(let n of Yl(t))if(typeof n==="string"){let r=t[n],i=typeof r;if(!Vl.includes(i))e[n]=r}return e}function Yl(e,t=[]){let n=[];while(e&&e!==ql)n=n.concat(Object.getOwnPropertyNames(e),Object.getOwnPropertySymbols(e)),e=Object.getPrototypeOf(e);let r=new Set(n);for(let i of t.concat(Kl))r.delete(i);return r}function le(e){return e instanceof $e||e instanceof Pt}function qr(e){if(e.path===null)e.path=[];return e}var Vl,Kl,ql,$e,Pt,Pe,Dn,Ne,Fn,rn,Kr,Nt;var Ee=N(()=>{ce();Vl=["function","symbol","undefined"],Kl=["constructor","prototype","__proto__"],ql=Object.getPrototypeOf({});$e=class $e extends Error{name;message;source;path;code;constructor(e,t,n){super(void 0,n);this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=t,this.path=null}toJSON=oo.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};Pt=class Pt 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 '${Ot(e.$refs._root$Ref.path)}'`}toJSON=oo.bind(this);static getParserErrors(e){let t=[],n=new Set,r=[...Object.values(e.$refs._$refs),...Object.values(e.$refs._aliases)];for(let i of r)if(i.errors){for(let s of i.errors)if(!n.has(s.footprint))n.add(s.footprint),t.push(s)}return t}get errors(){return Pt.getParserErrors(this.files)}};Pe=class Pe extends $e{code="EPARSER";name="ParserError";constructor(e,t,n){super(`Error parsing ${t}: ${e}`,t,n)}};Dn=class Dn extends $e{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(e){super(`Could not find parser for "${e}"`,e)}};Ne=class Ne extends $e{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(e,t,n){super(e.message||`Error reading file "${t}"`,t,n);if("code"in e)this.ioErrorCode=String(e.code)}};Fn=class Fn extends $e{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(e){super(`Could not find resolver for "${e}"`,e)}};rn=class rn extends $e{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(e,t,n,r,i){super(`Missing $ref pointer "${Se(t)}". Token "${e}" does not exist.`,R(t));this.targetToken=e,this.targetRef=n,this.targetFound=r,this.parentPath=i}};Kr=class Kr extends $e{code="ETIMEOUT";name="TimeoutError";constructor(e){super(`Dereferencing timeout reached: ${e}ms`)}};Nt=class Nt extends $e{code="EINVALIDPOINTER";name="InvalidPointerError";constructor(e,t){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,R(t))}}});function G(e,t,n=!1){let r=Rt(t,n);return r?F(e,r):e}function Bn(e){if(!e||typeof e!=="object"||ArrayBuffer.isView(e))return!1;if(Rt(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 n=e.openapi;return typeof n==="string"&&/^3\.1(?:\.|$)/.test(n)}function Wn(e,t,n,r,i=!1){if(!i)return;let s=new Map,o=new Set,a=(c,l,u,f)=>{if(!c||typeof c!=="object"||ArrayBuffer.isView(c)||o.has(c))return;let d=Z(c,u),m=G(l,c,d),h=`${d}:${m}`,p=s.get(c);if(p?.has(h))return;if(p)p.add(h);else s.set(c,new Set([h]));if(o.add(c),m!==l)e._addAlias(m,c,r,i,d,f);for(let g of Object.keys(c))a(c[g],m,d,Gl(f,g));o.delete(c)};a(n,t,!1,t+"#")}function Gl(e,t){return e+"/"+t.replace(/%/g,"%25").replace(/~/g,"~0").replace(/\//g,"~1")}function Rt(e,t=!1){if(!e||typeof e!=="object")return;let r=Z(e,t)?e.id:e.$id;if(typeof r==="string"&&r.length>0)return r;return}function Z(e,t=!1){if(!e||typeof e!=="object")return t;let n=e.$schema;if(typeof n==="string"){if(n.includes("draft-04/"))return!0;if(n.includes("draft-06/")||n.includes("draft-07/")||n.includes("draft/2019-09/")||n.includes("draft/2020-12/")||n.includes("oas/3.1/"))return!1}let r=e.openapi;if(typeof r==="string"&&/^3\.1(?:\.|$)/.test(r))return!1;return t}var Ue=N(()=>{ce()});function ut(e,t){return et(t)?Yr.get(e)?.get(t):void 0}function Re(e,t,n,r){if(t.child)return t.child(n,r);let i=ut(e,r);if(i)return i;let s=Z(r,t.legacyIdScope),o=t.dynamicIdScope&&et(r)&&!ArrayBuffer.isView(r)?G(t.scopeBase,r,s):t.scopeBase,a=(t.path.includes("#")?t.path:t.path+"#")+"/"+n.replace(/%/g,"%25").replace(/~/g,"~0").replace(/\//g,"~1");return{value:r,path:a,scopeBase:o,dynamicIdScope:t.dynamicIdScope,legacyIdScope:s}}function sn(e,t,n,r,i,s=!0){if(!et(t)||!et(n.value)||!et(r.value))return{...n,value:t};let o=n.value,a=r.value,l={...!s&&Object.hasOwn(a,"$ref")?r:n,value:t,child(f,d){if(!((!s||f!=="$ref")&&Object.hasOwn(a,f)))return Re(e,n,f,d);if(!i||!et(d))return Re(e,r,f,d);let h=a[f],p=Re(e,r,f,h);if(!et(h)||Array.isArray(h))return{...p,value:d};let g=Object.hasOwn(o,f)?o[f]:void 0;if(et(g)&&!Array.isArray(g))return ut(e,d)||sn(e,d,Re(e,n,f,g),p,!0,!1);return{...p,value:d}}},u=Yr.get(e);if(!u)u=new WeakMap,Yr.set(e,u);return u.set(t,l),l}function et(e){return e!==null&&typeof e==="object"}var Yr;var Gr=N(()=>{Ue();Yr=new WeakMap});class tt{$ref;path;originalPath;scopeBase;legacyIdScope;location;value;circular;chainCircular;indirections;constructor(e,t,n){this.$ref=e,this.path=t,this.originalPath=n||t,this.scopeBase=e.path||R(t),this.legacyIdScope=e.legacyIdScope,this.value=void 0,this.circular=!1,this.chainCircular=!1,this.indirections=0}resolve(e,t,n,r=new Set,i=!0){let s=tt.parse(this.path,this.originalPath),o=[];if(this.value=lo(e),this.$ref.dynamicIdScope&&!uo(this.$ref))this.legacyIdScope=Z(this.value,this.legacyIdScope),this.scopeBase=G(this.scopeBase,this.value,this.legacyIdScope);this.setLocation(ut(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,f=J.isExtended$Ref(this.value);if(Hn(this,t,n,r))this.path=tt.join(this.path,s.slice(c));else if(f)this.circular=l,this.chainCircular=u;let d=s[c];if(this.value===null||typeof this.value!=="object"&&typeof this.value!=="function"){this.value=null;let m=this.$ref.path||"",h=this.path.replace(m,""),p=tt.join("",o),g=n?.replace(m,"");throw new rn(d,ao(this.originalPath),h,p,g)}if(!Object.hasOwn(this.value,d)||this.value[d]===void 0||this.value[d]===null&&c===s.length-1){let m=!1;for(let E=s.length-1;E>c;E--){let A=s.slice(c,E+1).join("/");if(Object.hasOwn(this.value,A)&&this.value[A]!==void 0){this.value=this.value[A],this.setLocation(Re(this.$ref.$refs,this.location,A,this.value)),c=E,m=!0;break}}if(m){this.chainCircular=u;continue}if(Object.hasOwn(this.value,d)&&this.value[d]===null){this.value=Un,this.setLocation(Re(this.$ref.$refs,this.location,d,null)),this.chainCircular=u;continue}this.value=null;let h=this.$ref.path||"",p=this.path.replace(h,""),g=tt.join("",o),y=n?.replace(h,"");throw new rn(d,ao(this.originalPath),p,g,y)}else this.value=this.value[d];this.chainCircular=u,o.push(d),this.setLocation(Re(this.$ref.$refs,this.location,d,this.value))}let a=this.location?.dynamicIdScope?this.scopeBase:this.location?.path||this.path;if(i){let c=this.value?.$ref?F(a,this.value.$ref):void 0,l=typeof n==="string"?F(this.$ref.$refs._root$Ref.path,n):n;if(J.isAllowed$Ref(this.value,t)&&c===l&&c!==this.path)this.chainCircular=!0;else if(!this.value||c)Hn(this,t,n,r)}return this}set(e,t,n){let r=tt.parse(this.path),i;if(r.length===0)return this.value=t,t;if(tu(this.path,r),this.value=lo(e),this.$ref.dynamicIdScope&&!uo(this.$ref))this.legacyIdScope=Z(this.value,this.legacyIdScope),this.scopeBase=G(this.scopeBase,this.value,this.legacyIdScope);this.setLocation(ut(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<r.length-1;s++){if(Hn(this,n),i=r[s],this.value&&Object.hasOwn(this.value,i)&&this.value[i]!==void 0)this.value=this.value[i];else this.value=co(this,i,{});this.setLocation(Re(this.$ref.$refs,this.location,i,this.value))}return Hn(this,n),i=r[r.length-1],co(this,i,t),e}setLocation(e){this.location=e,this.scopeBase=e.scopeBase,this.legacyIdScope=e.legacyIdScope}static parse(e,t){let n=nn(Se(e).substring(1));if(!n)return[];let r=n.split("/");for(let i=0;i<r.length;i++)r[i]=r[i].replace(Ql,"/").replace(Zl,"~");if(r[0]!=="")throw new Nt(n,t===void 0?e:t);return r.slice(1)}static join(e,t){if(e.indexOf("#")===-1)e+="#";t=Array.isArray(t)?t:[t];for(let n=0;n<t.length;n++){let r=t[n];e+="/"+r.replace(/%/g,"%25").replace(Xl,"~0").replace(zl,"~1")}return e}}function ao(e){try{return decodeURI(e)}catch{return e}}function Hn(e,t,n,r=new Set){let i=!1,s=n,o=[];try{while(J.isAllowed$Ref(e.value,t)){let a=J.isExtended$Ref(e.value),{value:c,path:l}=e,u=e.location?.dynamicIdScope?e.scopeBase:e.location?.path||e.path,f=F(u,e.value.$ref);if(f===e.path&&!nu(s))return e.circular=!0,e.chainCircular=!0,i;let d=typeof s==="string"?F(e.$ref.$refs._root$Ref.path,s):s;if(f===d&&f!==e.path)return e.chainCircular=!0,i;if(r.has(f))return e.chainCircular=!0,i;let m=t?.dereference?.maxDepth??500;if(r.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.`);r.add(f),o.push(f);let h=e.$ref.$refs._resolve(f,l,t,r,a);if(h===null)return i;if(e.indirections+=h.indirections+1,e.chainCircular||=h.circular||h.chainCircular,a){if(e.chainCircular)return i;return e.value=J.dereference(c,h.value,t),e.setLocation(sn(e.$ref.$refs,e.value,h.location,e.location,t?.dereference?.mergeKeys??!0)),i}else e.$ref=h.$ref,e.path=h.path,e.value=h.value,e.scopeBase=h.scopeBase,e.legacyIdScope=h.legacyIdScope,e.location=h.location,s=l,i=!0}return i}finally{for(let a of o)r.delete(a)}}function co(e,t,n){if(e.value&&typeof e.value==="object")if(t==="-"&&Array.isArray(e.value))e.value.push(n);else e.value[t]=n;else throw new $e(`Error assigning $ref pointer "${e.path}".
|
|
23
|
-
|
|
24
|
-
Unsafe JSON Pointer token "${n}" cannot be used for assignment.`)}function lo(e){if(le(e))throw e;return e}function nu(e){return typeof e=="string"&&tt.parse(e).length==0}function uo(e){return Boolean(e.path&&e.path in e.$refs._aliases)}var Un,zl,Xl,Ql,Zl,eu,B;var It=N(()=>{ft();ce();Ee();Ue();Gr();Un=Symbol("null"),zl=/\//g,Xl=/~/g,Ql=/~1/g,Zl=/~0/g,eu=new Set(["__proto__","constructor","prototype"]);B=tt});class on{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:n})=>n);if("errors"in e&&Array.isArray(e.errors))this.errors.push(...e.errors.map(qr).filter(({footprint:n})=>!t.includes(n)));else if(!("footprint"in e)||!t.includes(e.footprint))this.errors.push(qr(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,n,r,i,s=!0){let o=new B(this,e,n);try{let a=o.resolve(this.value,t,r,i,s);if(a.value===Un)a.value=null;return a}catch(a){if(!t||!t.continueOnError||!le(a))throw a;if(a.path===null)a.path=Tt(Se(r));if(a instanceof Nt)a.source=ru(R(r||n||e));return this.addError(a),null}}set(e,t){let n=new B(this,e);if(this.value=n.set(this.value,t),this.value===Un)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 on.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 on.is$Ref(e)&&Object.keys(e).length>1}static dereference(e,t,n){if(t&&typeof t==="object"&&on.isExtended$Ref(e)){let r={};for(let o of Object.keys(e))if(o!=="$ref")an(r,o,e[o]);let i=n?.dereference?.mergeKeys??!0,s=t;for(let o of Object.keys(s))if(!Object.hasOwn(r,o))an(r,o,s[o]);else if(i&&typeof r[o]==="object"&&r[o]!==null&&typeof s[o]==="object"&&s[o]!==null)an(r,o,fo(s[o],r[o]));return r}else return t}}function ru(e){try{return decodeURI(e)}catch{return e}}function fo(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 zr(t);let n=zr(e),r=e,i=t;for(let s of Object.keys(i)){let o=i[s],a;if(Array.isArray(o))a=zr(o);else if(typeof o==="object"&&o!==null){let c=Object.hasOwn(r,s)?r[s]:void 0;a=fo(c,o)}else a=o;an(n,s,a)}return n}function zr(e){let t=Array.isArray(e)?Array(e.length):{},n=e;for(let r of Object.keys(n))an(t,r,n[r]);return t}function an(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})}var J;var ft=N(()=>{It();Ee();ce();J=on});class cn{circular;paths(...e){return po(this._$refs,e.flat()).map((n)=>He(n.decoded))}values(...e){let t=this._$refs;return po(t,e.flat()).reduce((r,i)=>(r[He(i.decoded)]=t[i.encoded].value,r),{})}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 n=F(this._root$Ref.path,e),r=this._getRef(n);if(!r)throw Error(`Error resolving $ref pointer "${e}".
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
`}return l}function xf(e,t){if(t.valueStart===ff)return"";let{valueStart:n,valueEnd:r}=t;if(t.fast)return e.slice(n,r);switch(t.style){case I.SINGLE_QUOTED:return gf(e,n,r);case I.DOUBLE_QUOTED:return yf(e,n,r);case I.LITERAL_BLOCK:return wo(e,n,r,t.indent,t.chomping,!1);case I.FOLDED_BLOCK:return wo(e,n,r,t.indent,t.chomping,!0);default:return hf(e,n,r)}}function ri(e){let t="",n=0;while(n<e.length){if(e.charCodeAt(n)!==37){t+=e[n++];continue}let r=parseInt(e.slice(n+1,n+3),16);if(n+=3,r>=192){let i=r<224?1:r<240?2:3;r&=(1<<6-i)-1;while(i-- >0)r=r<<6|parseInt(e.slice(n+1,n+3),16)&63,n+=3}if(r<65536)t+=String.fromCharCode(r);else r-=65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023)}return t}function Lo(e,t){if(e.startsWith("!<")&&e.endsWith(">"))return ri(e.slice(2,-1));let n=e.indexOf("!",1),r=n===-1?"!":e.slice(0,n+1);return ri(t?.[r]??Sf[r]??r)+ri(e.slice(r.length))}function bf(e){if("tagStart"in e&&e.tagStart!==Jt)return e.tagStart;if("anchorStart"in e&&e.anchorStart!==Jt)return e.anchorStart;if("valueStart"in e&&e.valueStart!==Jt)return e.valueStart;if("start"in e)return e.start;return 0}function ne(e,t){pt.throwAt(e.source,e.position,t,e.filename)}function jo(e,t,n,r){try{return n.finalize(r)}catch(i){if(i instanceof pt)throw i;pt.throwAt(e.source,t,i instanceof Error?i.message:String(i),e.filename)}}function wf(e,t){let n=xf(e.source,t),r=t.tagStart===Jt?"":e.source.slice(t.tagStart,t.tagEnd),i=e.schema.defaultScalarTag;if(r!==""){if(r==="!")return{value:n,tag:i};let s=Lo(r,e.tagHandlers),o=e.schema.lookupScalarTag(s);if(o){let c=o.resolve(n,!0,s);if(c===j)ne(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(n!=="")ne(e,`cannot resolve a node with !<${s}> explicit tag`);let c=a.create(s);return{value:a.carrierIsResult?c:jo(e,e.position,a,c),tag:a}}ne(e,`unknown scalar tag !<${s}>`)}if(t.style===I.PLAIN)return e.schema.resolveImplicitScalarTag(n);return{value:i.resolve(n,!1,i.tagName),tag:i}}function vo(e,t,n){let r=t.tagStart===Jt?"":e.source.slice(t.tagStart,t.tagEnd);return r===""||r==="!"?n:Lo(r,e.tagHandlers)}function Mo(e){return e.nodeKind==="mapping"}function Ao(e){if(e.totalMergeKeys++,e.maxTotalMergeKeys!==-1&&e.totalMergeKeys>e.maxTotalMergeKeys)ne(e,`merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`)}function Co(e,t,n,r){Ao(e);for(let i of r.keys(n)){if(Ao(e),t.tag.has(t.value,i))continue;let s=t.tag.addPair(t.value,i,r.get(n,i));if(s)ne(e,s);t.overridable??=new Set,t.overridable.add(i)}}function vf(e,t,n,r){if(e.position=t.keyPosition,Mo(r))Co(e,t,n,r);else if(r.nodeKind==="sequence"&&Array.isArray(n)){if(n.length>100)ne(e,"abnormal merge sequence size");for(let i of n){let s=e.nodeTags.get(i);if(!s)ne(e,"cannot merge mappings; the provided source object is unacceptable");Co(e,t,i,s)}}else ne(e,"cannot merge mappings; the provided source object is unacceptable")}function Af(e,t,n,r,i){if(e.position=t.keyPosition,t.keyIsMerge){vf(e,t,r,i);return}if(!e.json&&t.tag.has(t.value,n)&&!t.overridable?.has(n))ne(e,"duplicated mapping key");let s=t.tag.addPair(t.value,n,r);if(s)ne(e,s);t.overridable?.delete(n)}function ii(e,t,n){let r=e.frames[e.frames.length-1];if(r.kind==="document")r.value=t,r.hasValue=!0;else if(r.kind==="sequence"){if(Mo(n))e.nodeTags.set(t,n);let i=r.tag.addItem(r.value,t,r.index++);if(i)ne(e,i)}else if(r.hasKey){let i=r.key;r.key=void 0,r.hasKey=!1,Af(e,r,i,t,n)}else r.key=t,r.keyPosition=e.position,r.hasKey=!0,r.keyIsMerge=n.tagName===Ef}function si(e,t,n,r,i){if(t.anchorStart!==Jt){let s={value:n,tag:r,isValueFinal:i};return e.anchors.set(e.source.slice(t.anchorStart,t.anchorEnd),s),s}return null}function Cf(e,t){let n={...bi,...t,events:e,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,nodeTags:new Map,tagHandlers:Object.create(null),totalMergeKeys:0,aliasCount:0};while(n.eventIndex<n.events.length){let r=n.events[n.eventIndex++];switch(n.position=bf(r),r.type){case q.DOCUMENT:n.anchors=new Map,n.nodeTags=new Map,n.aliasCount=0,n.tagHandlers=Object.create(null);for(let i of r.directives)if(i.kind==="tag")n.tagHandlers[i.handle]=i.prefix;n.frames.push({kind:"document",position:n.position,value:void 0,hasValue:!1});break;case q.SCALAR:{let{value:i,tag:s}=wf(n,r);si(n,r,i,s,!0),ii(n,i,s);break}case q.SEQUENCE:{let i=vo(n,r,"tag:yaml.org,2002:seq"),s=n.schema.lookupSequenceTag(i);if(!s)ne(n,`unknown sequence tag !<${i}>`);let o=s.create(i),a=si(n,r,o,s,s.carrierIsResult);n.frames.push({kind:"sequence",position:n.position,value:o,tag:s,anchor:a,index:0});break}case q.MAPPING:{let i=vo(n,r,"tag:yaml.org,2002:map"),s=n.schema.lookupMappingTag(i);if(!s)ne(n,`unknown mapping tag !<${i}>`);let o=s.create(i),a=si(n,r,o,s,s.carrierIsResult);n.frames.push({kind:"mapping",position:n.position,value:o,tag:s,anchor:a,key:void 0,keyPosition:n.position,hasKey:!1,keyIsMerge:!1,overridable:null});break}case q.ALIAS:{if(n.maxAliases!==-1&&++n.aliasCount>n.maxAliases)ne(n,`aliases exceeded maxAliases (${n.maxAliases})`);let i=n.source.slice(r.anchorStart,r.anchorEnd),s=n.anchors.get(i);if(!s)ne(n,`unidentified alias "${i}"`);if(!s.isValueFinal)ne(n,`recursive alias "${i}" is not supported for tag ${s.tag.tagName} because it uses finalize()`);ii(n,s.value,s.tag);break}case q.POP:{let i=n.frames.pop();if(i.kind==="mapping"&&i.hasKey)n.position=i.keyPosition,ne(n,"incomplete mapping pair in event stream");if(i.kind==="document")n.documents.push(i.value);else{let s=i.tag.carrierIsResult?i.value:jo(n,i.position,i.tag,i.value);if(i.anchor)i.anchor.value=s,i.anchor.isValueFinal=!0;ii(n,s,i.tag)}break}}}return n.documents}function If(e,t,n){e.events.push({type:q.DOCUMENT,explicitStart:t,explicitEnd:n,directives:e.directives})}function Uo(e,t,n,r,i,s,o){e.events.push({type:q.SEQUENCE,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:s,style:o})}function Vo(e,t,n,r,i,s,o){e.events.push({type:q.MAPPING,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:s,style:o})}function Oo(e,t){e.events.splice(t.eventsLength,0,{type:q.MAPPING,start:t.position,anchorStart:M,anchorEnd:M,tagStart:M,tagEnd:M,style:nt.FLOW})}function Bt(e,t,n,r,i,s,o,a,c=be.CLIP,l=-1,u=!1){e.events.push({type:q.SCALAR,valueStart:t,valueEnd:n,anchorStart:r,anchorEnd:i,tagStart:s,tagEnd:o,style:a,chomping:c,indent:l,fast:u})}function _f(e,t,n){e.events.push({type:q.ALIAS,anchorStart:t,anchorEnd:n})}function kt(e){e.events.push({type:q.POP})}function ue(e){Bt(e,M,M,M,M,M,M,I.PLAIN)}function To(){return{anchorStart:M,anchorEnd:M,tagStart:M,tagEnd:M}}function Lt(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,eventsLength:e.events.length}}function jt(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 P(e,t){pt.throwAt(e.input.slice(0,e.length),e.position,t,e.filename)}function ee(e){return e===10||e===13}function Wt(e){return e===9||e===32}function Ie(e){return Wt(e)||ee(e)}function Ve(e){return e===0||Ie(e)}function dt(e){return e===44||e===91||e===93||e===123||e===125}function Jf(e){return e>=48&&e<=57?e-48:-1}function kf(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 Lf(e){if(e===120)return 2;if(e===117)return 4;if(e===85)return 8;return 0}function jf(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 Yn(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 se(e,t){let n=0,r=e.input.charCodeAt(e.position),i=e.position===e.lineStart||Ie(e.input.charCodeAt(e.position-1));while(r!==0){while(Wt(r)){if(i=!0,r===9&&e.firstTabInLine===-1)e.firstTabInLine=e.position;r=e.input.charCodeAt(++e.position)}if(t&&i&&r===35)do r=e.input.charCodeAt(++e.position);while(!ee(r)&&r!==0);if(!ee(r))break;Yn(e),n++,i=!0,r=e.input.charCodeAt(e.position);while(r===32)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return n}function Dt(e,t=e.position){let n=e.input.charCodeAt(t);if((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)){let r=e.input.charCodeAt(t+3);return r===0||Ie(r)}return!1}function Ko(e){if(e.position===e.lineStart&&e.input.charCodeAt(e.position)===65279)e.position++,e.lineStart=e.position}function vi(e){if(e.position!==e.lineStart)return!1;if(Dt(e))return!0;if(e.input.charCodeAt(e.position)!==65279)return!1;let t=Lt(e);Ko(e),se(e,!0);let n=e.input.charCodeAt(e.position),r=e.position===e.lineStart&&(n===37||n===45&&Dt(e));return jt(e,t),r}function Po(e){let t=e.input.charCodeAt(e.position);while(t!==0&&!ee(t))t=e.input.charCodeAt(++e.position)}function qo(e,t,n){let r=Of.exec(e.input.slice(t,n));if(r!==null)e.position=t+r.index+r[0].length-1,P(e,"the stream contains non-printable characters")}function Mf(e,t,n){if(e.input.charCodeAt(e.position)!==33)return!1;if(t.tagStart!==M)P(e,"duplication of a tag property");let r=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)P(e,"unexpected end of the stream within a verbatim tag");l=e.input.slice(c,e.position),e.position++}else{while(a!==0&&!Ie(a)&&!(n&&dt(a))){if(a===33)if(!s){if(o=e.input.slice(c-1,e.position+1),!Wo.test(o))P(e,"named tag handle cannot contain such characters");s=!0,c=e.position+1}else P(e,"tag suffix cannot contain exclamation marks");a=e.input.charCodeAt(++e.position)}if(l=e.input.slice(c,e.position),Tf.test(l))P(e,"tag suffix cannot contain flow indicator characters")}if(l&&!(i?Pf.test(l):Nf.test(l)))P(e,`tag name cannot contain such characters: ${l}`);if(!i&&o!=="!"&&o!=="!!"&&!Do.call(e.tagHandlers,o))P(e,`undeclared tag handle "${o}"`);return t.tagStart=r,t.tagEnd=e.position,!0}function Df(e,t){if(e.input.charCodeAt(e.position)!==38)return!1;if(t.anchorStart!==M)P(e,"duplication of an anchor property");e.position++;let n=e.position;while(e.input.charCodeAt(e.position)!==0&&!Ie(e.input.charCodeAt(e.position))&&!dt(e.input.charCodeAt(e.position)))e.position++;if(e.position===n)P(e,"name of an anchor node must contain at least one character");return t.anchorStart=n,t.anchorEnd=e.position,!0}function Ff(e,t){if(e.input.charCodeAt(e.position)!==42)return!1;if(t.anchorStart!==M||t.tagStart!==M)P(e,"alias node should not have any properties");e.position++;let n=e.position;while(e.input.charCodeAt(e.position)!==0&&!Ie(e.input.charCodeAt(e.position))&&!dt(e.input.charCodeAt(e.position)))e.position++;if(e.position===n)P(e,"name of an alias node must contain at least one character");return _f(e,n,e.position),!0}function ui(e,t){if(se(e,!1),e.lineIndent<t)P(e,"deficient indentation")}function Bf(e,t,n){if(e.input.charCodeAt(e.position)!==39)return!1;e.position++;let r=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++,Bt(e,r,o,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,I.SINGLE_QUOTED,be.CLIP,-1,i),!0}if(ee(s))i=!1,ui(e,t);else if(e.position===e.lineStart&&Dt(e))P(e,"unexpected end of the document within a single quoted scalar");else if(s!==9&&s<32)P(e,"expected valid JSON character");else e.position++}P(e,"unexpected end of the stream within a single quoted scalar")}function Wf(e,t,n){if(e.input.charCodeAt(e.position)!==34)return!1;e.position++;let r=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++,Bt(e,r,o,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,I.DOUBLE_QUOTED,be.CLIP,-1,i),!0}if(s===92){i=!1;let o=e.input.charCodeAt(++e.position);if(ee(o))ui(e,t);else if(jf(o))e.position++;else{let a=Lf(o);if(a===0)P(e,"unknown escape sequence");while(a-- >0)if(e.position++,kf(e.input.charCodeAt(e.position))<0)P(e,"expected hexadecimal character");e.position++}}else if(ee(s))i=!1,ui(e,t);else if(e.position===e.lineStart&&Dt(e))P(e,"unexpected end of the document within a double quoted scalar");else if(s!==9&&s<32)P(e,"expected valid JSON character");else e.position++}P(e,"unexpected end of the stream within a double quoted scalar")}function Hf(e,t,n){let r=e.input.charCodeAt(e.position),i=be.CLIP,s=-1,o=!1;if(r!==124&&r!==62)return!1;let a=r===124?I.LITERAL_BLOCK:I.FOLDED_BLOCK;e.position++;while(e.input.charCodeAt(e.position)!==0){let m=e.input.charCodeAt(e.position),h=Jf(m);if(m===43||m===45){if(i!==be.CLIP)P(e,"repeat of a chomping mode identifier");i=m===43?be.KEEP:be.STRIP,e.position++}else if(h>=0){if(h===0)P(e,"bad explicit indentation width of a block scalar; it cannot be less than one");if(o)P(e,"repeat of an indentation width identifier");s=t+h-1,o=!0,e.position++}else break}let c=!1;while(Wt(e.input.charCodeAt(e.position)))c=!0,e.position++;if(c&&e.input.charCodeAt(e.position)===35)Po(e);if(ee(e.input.charCodeAt(e.position)))Yn(e);else if(e.input.charCodeAt(e.position)!==0)P(e,"a line break is expected");let l=o?s:-1,u=0,{position:f,position:d}=e;while(e.input.charCodeAt(e.position)!==0){let m=e.position,h=0;while(e.input.charCodeAt(m+h)===32)h++;let p=e.input.charCodeAt(m+h);if(p===0){if(l>=0){if(h>l)d=m+h}else if(h>0)d=m+h;break}if(vi(e))break;if(!o&&l===-1&&ee(p))u=Math.max(u,h);if(!o&&l===-1&&!ee(p)){if(p===9&&h<t)e.position=m+h,P(e,"tab characters must not be used in indentation");if(h>=t&&h<u)e.position=m+h,P(e,"bad indentation of a mapping entry")}if(l===-1&&p!==0&&!ee(p)&&h<t){e.lineIndent=h,e.position=m+h;break}if(!o&&p!==0&&!ee(p)&&l===-1)l=h;let g=l===-1?t+1:l;if(p!==0&&!ee(p)&&h<g){e.lineIndent=h,e.position=m+h;break}if(Po(e),d=e.position,ee(e.input.charCodeAt(e.position)))Yn(e),d=e.position}return qo(e,f,d),Bt(e,f,d,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,a,i,l),!0}function Uf(e,t){let n=e.input.charCodeAt(e.position),r=t===Mt;if(n===0||Ie(n)||n===35||n===38||n===42||n===33||n===124||n===62||n===39||n===34||n===37||n===64||n===96||dt(n))return!1;if(n===63||n===45){let i=e.input.charCodeAt(e.position+1);if(Ve(i)||r&&dt(i))return!1}return!0}function Vf(e,t,n,r){if(!Uf(e,n))return!1;let{position:i,position:s}=e,o=e.input.charCodeAt(e.position),a=n===Mt,c=!1;while(o!==0){if(vi(e))break;if(o===58){let l=e.input.charCodeAt(e.position+1);if(Ve(l)||a&&dt(l))break}else if(o===35){if(Ie(e.input.charCodeAt(e.position-1)))break}else if(a&&dt(o))break;else if(ee(o)){let{position:l,line:u,lineStart:f,lineIndent:d}=e;if(se(e,!1),e.lineIndent>=t){c=!0,o=e.input.charCodeAt(e.position);continue}e.position=l,e.line=u,e.lineStart=f,e.lineIndent=d;break}if(!Wt(o))s=e.position+1;o=e.input.charCodeAt(++e.position)}if(s===i)return!1;return qo(e,i,s),Bt(e,i,s,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,I.PLAIN,be.CLIP,-1,!c),!0}function ln(e,t){let n=e.line;if(se(e,!0),e.line>n&&e.lineIndent<t||e.firstTabInLine!==-1&&e.lineIndent<t)P(e,"deficient indentation")}function Kf(e,t,n){let r=e.input.charCodeAt(e.position),i=r===123,s=e.position,o=!0;if(r!==91&&r!==123)return!1;let a=i?125:93;if(i)Vo(e,s,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,nt.FLOW);else Uo(e,s,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,nt.FLOW);e.position++;while(e.input.charCodeAt(e.position)!==0){ln(e,t);let c=e.input.charCodeAt(e.position);if(c===a)return e.position++,kt(e),!0;else if(!o)P(e,"missed comma between flow collection entries");else if(c===44)P(e,"expected the node content, but found ','");let l=!1,u=!1;if(c===63&&Ie(e.input.charCodeAt(e.position+1)))l=u=!0,e.position+=1,ln(e,t);let f=e.line,d=Lt(e),m=Ft(e,t,Mt,!1,!0);if(ln(e,t),c=e.input.charCodeAt(e.position),(i||u||e.line===f)&&c===58){if(l=!0,e.position++,ln(e,t),!i){if(Oo(e,d),!m)ue(e)}else if(!m)ue(e);if(!Ft(e,t,Mt,!1,!0))ue(e);if(ln(e,t),!i)kt(e)}else if(i&&l){if(!m)ue(e);ue(e)}else if(i)ue(e);else if(l){if(Oo(e,d),!m)ue(e);ue(e),kt(e)}if(c=e.input.charCodeAt(e.position),c===44)o=!0,e.position++;else o=!1}P(e,"unexpected end of the stream within a flow collection")}function No(e,t,n){if(e.firstTabInLine!==-1||e.input.charCodeAt(e.position)!==45||!Ve(e.input.charCodeAt(e.position+1)))return!1;Uo(e,e.position,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,nt.BLOCK);while(e.input.charCodeAt(e.position)===45&&Ve(e.input.charCodeAt(e.position+1))){if(e.firstTabInLine!==-1)e.position=e.firstTabInLine,P(e,"tab characters must not be used in indentation");let r=e.line;e.position++;let i=se(e,!0)>0;if(e.firstTabInLine!==-1&&e.input.charCodeAt(e.position)===45&&Ve(e.input.charCodeAt(e.position+1)))P(e,"bad indentation of a sequence entry");if(i&&e.lineIndent<=t)ue(e);else Ft(e,t,Bo,!1,!0);if(se(e,!0),e.lineIndent<t||e.position>=e.length)break;if(e.lineIndent>t)P(e,"bad indentation of a sequence entry");if(e.line===r&&e.input.charCodeAt(e.position)===45&&Ve(e.input.charCodeAt(e.position+1)))P(e,"bad indentation of a sequence entry")}return kt(e),!0}function oi(e,t,n,r){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,P(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)&&Ve(l)){if(!o)Vo(e,e.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,nt.BLOCK),o=!0;if(c===63){if(i)ue(e);s=!0,i=!0}else if(i)i=!1;else ue(e),s=!0,i=!1;e.position+=1,a=!0}else{if(i)ue(e),i=!1;let f=Lt(e);if(!Ft(e,n,Fo,!1,!0))break;if(e.line===u){c=e.input.charCodeAt(e.position);while(Wt(c))c=e.input.charCodeAt(++e.position);if(c===58){if(c=e.input.charCodeAt(++e.position),!Ve(c))P(e,"a whitespace character is expected after the key-value separator within a block mapping");if(!o)e.events.splice(f.eventsLength,0,{type:q.MAPPING,start:f.position,anchorStart:r.anchorStart,anchorEnd:r.anchorEnd,tagStart:r.tagStart,tagEnd:r.tagEnd,style:nt.BLOCK}),o=!0;s=!0,i=!1,a=!1}else if(s)P(e,"expected ':' after a mapping key");else{if(r.anchorStart!==M||r.tagStart!==M)return jt(e,f),!1;return!0}}else if(s)P(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else{if(r.anchorStart!==M||r.tagStart!==M)return jt(e,f),!1;return!0}}if(Ft(e,t,qn,!0,a))a=!1;if(!i){if(a)ue(e),a=!1}if(se(e,!0),c=e.input.charCodeAt(e.position),(e.line===u||e.lineIndent>t)&&c!==0)P(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}if(!s)return!1;if(i)ue(e);if(o)kt(e);return!0}function Ft(e,t,n,r,i,s=!0){if(e.depth>=e.maxDepth)P(e,`nesting exceeded maxDepth (${e.maxDepth})`);e.depth++;let o=1,a=!1,c=!1,l=null,u=To(),f=n===qn||n===Bo,d=f,m=f;if(r&&se(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 h=e.input.charCodeAt(e.position),p=Lt(e);if(a&&o!==1&&(h===33||h===38))break;if(a&&m&&(u.tagStart!==M||u.anchorStart!==M)&&(h===33||h===38)){let g=Lt(e),y=t+1;if(oi(e,e.position-e.lineStart,y,u)&&e.events[g.eventsLength]?.type===q.MAPPING)return e.depth--,!0;jt(e,g)}if(a&&(h===33&&u.tagStart!==M||h===38&&u.anchorStart!==M))break;if(!Mf(e,u,n===Mt)&&!Df(e,u))break;if(l===null)l=p;if(se(e,!0))if(a=!0,d=m,e.lineIndent>t)o=1;else if(e.lineIndent===t)o=0;else o=-1;else d=!1}if(d)d=a||i;if(o===1||n===qn){let h=n===Mt||n===Fo?t:t+1,p=e.position-e.lineStart;if(o===1)if(d&&(No(e,p,u)||oi(e,p,h,u))||Kf(e,h,u))c=!0;else{let g=e.input.charCodeAt(e.position);if(l!==null&&s&&m&&!d&&g!==124&&g!==62){let y=Lt(e),E=l.position-l.lineStart;if(jt(e,l),oi(e,E,h,To())&&e.events[y.eventsLength]?.type===q.MAPPING)c=!0;else jt(e,y)}if(!c&&(f&&Hf(e,h,u)||Bf(e,h,u)||Wf(e,h,u)||Ff(e,u)||Vf(e,h,n,u)))c=!0}else if(o===0)c=d&&No(e,p,u)}if(f=f&&!c,!c&&(u.anchorStart!==M||u.tagStart!==M||f))Bt(e,M,M,u.anchorStart,u.anchorEnd,u.tagStart,u.tagEnd,I.PLAIN),c=!0;return e.depth--,c||u.anchorStart!==M||u.tagStart!==M}function qf(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&&!Ie(e.input.charCodeAt(e.position)))e.position++;let n=e.input.slice(t,e.position),r=[];if(n.length===0)P(e,"directive name must not be less than one character in length");while(e.input.charCodeAt(e.position)!==0&&!ee(e.input.charCodeAt(e.position))){while(Wt(e.input.charCodeAt(e.position)))e.position++;if(e.input.charCodeAt(e.position)===35||ee(e.input.charCodeAt(e.position))||e.input.charCodeAt(e.position)===0)break;let i=e.position;while(e.input.charCodeAt(e.position)!==0&&!Ie(e.input.charCodeAt(e.position)))e.position++;r.push(e.input.slice(i,e.position))}if(ee(e.input.charCodeAt(e.position)))Yn(e);if(n==="YAML"){if(e.directives.some((s)=>s.kind==="yaml"))P(e,"duplication of %YAML directive");if(r.length!==1)P(e,"YAML directive accepts exactly one argument");let i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]);if(i===null)P(e,"ill-formed argument of the YAML directive");if(parseInt(i[1],10)!==1)P(e,"unacceptable YAML version of the document");e.directives.push({kind:"yaml",version:r[0]})}else if(n==="TAG"){if(r.length!==2)P(e,"TAG directive accepts exactly two arguments");let[i,s]=r;if(!Wo.test(i))P(e,"ill-formed tag handle (first argument) of the TAG directive");if(Do.call(e.tagHandlers,i))P(e,`there is a previously declared suffix for "${i}" tag handle`);if(!Rf.test(s))P(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 Yf(e){e.directives=[],e.tagHandlers=Object.create(null);let t=!1;se(e,!0);while(qf(e))t=!0,se(e,!0);let n=!1,r=!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&&Ve(e.input.charCodeAt(e.position+3))){n=!0;let a=e.line;e.position+=3,se(e,!0),i=e.line>a}else if(t)P(e,"directives end mark is expected");let s=e.events.length;if(!n&&e.position===e.lineStart&&e.input.charCodeAt(e.position)===46&&Dt(e)){e.position+=3,se(e,!0);return}if(If(e,n,!1),!Ft(e,e.lineIndent-1,qn,!1,i,i))ue(e);if(se(e,!0),e.position===e.lineStart&&Dt(e)){if(r=e.input.charCodeAt(e.position)===46,r){let a=e.line;if(e.position+=3,se(e,!0),e.line===a&&e.position<e.length)P(e,"end of the stream or a document separator is expected")}}let o=e.events[s];if(o?.type===q.DOCUMENT)o.explicitEnd=r;if(kt(e),!r&&e.position<e.length&&!vi(e))P(e,"end of the stream or a document separator is expected")}function Gf(e,t){let n=e.length,r={...wi,...t,input:`${e}\x00`,length:n,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)pt.throwAt(e,i,"null byte is not allowed in input",r.filename);while(r.position<r.length){if(Ko(r),se(r,!0),r.position>=r.length)break;let s=r.position;if(Yf(r),r.position===s)P(r,"can not read a document")}return r.events}function Yo(e,t={}){let n={...zf,...t},r=String(e),i=Object.keys(wi),s=Object.keys(bi);return Cf(Gf(r,So(n,i)),{...So(n,s),source:r})}function Go(e,t,n){let r=null;if(typeof t==="function")r=t;else if(t!==null&&typeof t==="object")n=t;let i=Yo(e,n);if(r===null)return i;for(let s of i)r(s)}function Ai(e,t){let n=Yo(e,t);if(n.length===0)throw new pt("expected a document, but the input is empty");if(n.length===1)return n[0];throw new pt("expected a single document in the stream, but found more")}function Qn(e,t){return(e&1<<t)!==0}function zo(e){if(e.presenterOptions.quoteStyle==="single"&&Qn(e.allowedStylesMask,I.SINGLE_QUOTED))return I.SINGLE_QUOTED;return I.DOUBLE_QUOTED}function Xf(e){if(!e.presenterOptions.quoteFlowKeys)return;if(!e.isKey||!e.flowOnly||e.style!==I.PLAIN)return;e.style=I.DOUBLE_QUOTED}function Qf(e){if(e.style===I.PLAIN&&/[\t\x7F-\xA0\u2028\u2029\uFEFF\uFFFE\uFFFF]/.test(e.node.value))e.style=I.DOUBLE_QUOTED}function Zf(e){if(e.style===I.PLAIN&&/^\s+$/.test(e.node.value))e.style=I.DOUBLE_QUOTED}function ep(e){if(!e.presenterOptions.forceQuotes)return;if(e.isKey||e.style!==I.PLAIN)return;if(e.node.tag!==e.presenterOptions.schema.defaultScalarTag.tagName)return;e.style=e.node.value.includes(`
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
`,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=I.FOLDED_BLOCK;else if(n)e.style=I.LITERAL_BLOCK}function np(e){if(e.style===I.PLAIN&&!Qn(e.allowedStylesMask,I.PLAIN))e.style=zo(e)}function rp(e){if(!Qn(e.allowedStylesMask,e.style))e.style=I.DOUBLE_QUOTED}var j,lu,uu,fu,pu,du,mu,hu,gu,yu,xu,Su,$u,Eu,bu,wu,vu,Au,Io,Tu,Pu,Iu,_u,ai,Lu,ju,_o,Fu,Bu,Uu,Vu,Ku,ci,mi,Gu,hi,Qu,Zu,gi,tf,yi,xi,nf,Si,Xn=class e{tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(t){let n=of(t),r=[],i=rf(),s=sf();for(let u of n){if(u.nodeKind==="scalar"&&u.implicit){if(u.matchByTagPrefix)throw Error("Implicit scalar tags cannot match by tag prefix");r.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=r.filter((u)=>u.implicitFirstChars===null),a=new Set;for(let u of r)if(u.implicitFirstChars!==null)for(let f of u.implicitFirstChars)a.add(f);let c=new Map;for(let u of a)c.set(u,r.filter((f)=>f.implicitFirstChars===null||f.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=n,this.implicitScalarTags=r,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 n=this.exact.scalar[t];if(n)return n;for(let r of this.prefix.scalar)if(t.startsWith(r.tagName))return r}lookupSequenceTag(t){let n=this.exact.sequence[t];if(n)return n;for(let r of this.prefix.sequence)if(t.startsWith(r.tagName))return r}lookupMappingTag(t){let n=this.exact.mapping[t];if(n)return n;for(let r of this.prefix.mapping)if(t.startsWith(r.tagName))return r}resolveImplicitScalarTag(t){let n=this.implicitScalarByFirstChar.get(t.charAt(0))??this.implicitScalarAnyFirstChar;for(let i of n){let s=i.resolve(t,!1,i.tagName);if(s!==j)return{value:s,tag:i}}let r=this.defaultScalarTag;return{value:r.resolve(t,!1,r.tagName),tag:r}}withTags(...t){let n=[];for(let r of t)n=n.concat(r);return new e([...this.tags,...n])}},$i,yh,un,af,cf,xh,Sh,lf,pt,q,I,nt,be,ff=-1,Jo,ko,Sf,$f="-#;/?:@&=+$_.~*'()",$h,Jt=-1,Ef="tag:yaml.org,2002:merge",bi,M=-1,Do,Mt=1,Fo=2,Bo=3,qn=4,Of,Tf,Wo,li,Ho,Pf,Nf,Rf,wi,zf,Eh,bh,wh,Ro,ip="[\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]",sp="[\\n\\r]",op="\\uFEFF",Ci="[ \\t]",Xo,Zn,Qo="[\\x09\\x20-\\uD7FF\\uE000-\\uFFFF\\u{10000}-\\u{10FFFF}]",Zo="[-?:,\\[\\]{}#&*!|>'\"%@`]",ap="[,\\[\\]{}]",fi,pi,cp,lp,ea,ta,na,ra,ia,sa,up,fp,pp,dp,mp,hp,vh,Ah,Ch,Oh,Th,Ph,Nh,gp,Rh,Ih,_h,Jh,kh,Lh,jh,Mh,Dh,Fh,Bh,Wh,Hh,Uh,Vh,Kh,qh;var oa=N(()=>{/*! js-yaml 5.5.0 https://github.com/nodeca/js-yaml @license MIT */j=Symbol("NOT_RESOLVED");lu=oe("tag:yaml.org,2002:str",{resolve:(e)=>e,identify:(e)=>typeof e==="string"}),uu=["","~","null","Null","NULL"],fu=oe("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:(e)=>{if(uu.indexOf(e)!==-1)return null;return j},identify:(e)=>e===null,represent:()=>"null"}),pu=oe("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:(e,t)=>{if(e==="null"||t&&e==="")return null;return j},identify:(e)=>e===null,represent:()=>"null"}),du=["","~","null","Null","NULL"],mu=oe("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:(e)=>{if(du.indexOf(e)!==-1)return null;return j},identify:(e)=>e===null,represent:()=>"null"}),hu=["true","True","TRUE"],gu=["false","False","FALSE"],yu=oe("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:(e)=>{if(hu.indexOf(e)!==-1)return!0;if(gu.indexOf(e)!==-1)return!1;return j},identify:(e)=>Object.prototype.toString.call(e)==="[object Boolean]",represent:(e)=>e?"true":"false"}),xu=["true"],Su=["false"],$u=oe("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:(e)=>{if(xu.indexOf(e)!==-1)return!0;if(Su.indexOf(e)!==-1)return!1;return j},identify:(e)=>Object.prototype.toString.call(e)==="[object Boolean]",represent:(e)=>e?"true":"false"}),Eu=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],bu=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],wu=oe("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:(e)=>{if(Eu.indexOf(e)!==-1)return!0;if(bu.indexOf(e)!==-1)return!1;return j},identify:(e)=>Object.prototype.toString.call(e)==="[object Boolean]",represent:(e)=>e?"true":"false"}),vu=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),Au=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");Io=oe("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:Ou,identify:(e)=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:(e)=>e.toString(10)}),Tu=new RegExp("^-?(?:0|[1-9][0-9]*)$"),Pu=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");Iu=oe("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Ru,identify:(e)=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:(e)=>e.toString(10)}),_u=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_]*))$");ai=oe("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:ku,identify:(e)=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:(e)=>e.toString(10)}),Lu=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),ju=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");_o=oe("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:Mu,identify:(e)=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:Du}),Fu=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),Bu=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");Uu=oe("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Wu,identify:(e)=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:Hu}),Vu=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))$"),Ku=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");ci=oe("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:qu,identify:(e)=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:Yu}),mi=oe("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:(e,t)=>{if(e==="<<"||t&&e==="")return"<<";return j},identify:()=>!1}),Gu=/^[A-Za-z0-9+/]*={0,2}$/;hi=oe("tag:yaml.org,2002:binary",{resolve:zu,identify:(e)=>Object.prototype.toString.call(e)==="[object Uint8Array]",represent:Xu}),Qu=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Zu=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]))?))?$");gi=oe("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:ef,identify:(e)=>e instanceof Date,represent:(e)=>e.toISOString()}),tf=di("tag:yaml.org,2002:seq",{create:()=>[],addItem:(e,t)=>{e.push(t)},identify:Array.isArray});yi=di("tag:yaml.org,2002:omap",{create:()=>({list:[],seen:new Set}),addItem:(e,t)=>{let n;if(t instanceof Map){if(t.size!==1)return"cannot resolve an ordered map item";n=t.keys().next().value}else if(zn(t)){let r=Object.keys(t);if(r.length!==1)return"cannot resolve an ordered map item";n=r[0]}else return"cannot resolve an ordered map item";if(e.seen.has(n))return"duplicate key in ordered map";return e.seen.add(n),e.list.push(t),""},finalize:(e)=>e.list,identify:()=>!1}),xi=di("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 n=t,r=Object.keys(n);if(r.length!==1)return"cannot resolve a pairs item";return e.push([r[0],n[r[0]]]),""},identify:()=>!1}),nf=Gn("tag:yaml.org,2002:map",{create:()=>({}),identify:zn,represent:(e)=>{let t=new Map;for(let n of Object.keys(e))t.set(n,e[n]);return t},addPair:(e,t,n)=>{if(t!==null&&typeof t==="object")return"object-based map does not support complex keys";let r=String(t);if(r==="__proto__")Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0});else e[r]=n;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 n=String(t);if(!Object.prototype.hasOwnProperty.call(e,n))return null;return e[n]}}),Si=Gn("tag:yaml.org,2002:set",{create:()=>new Set,identify:(e)=>e instanceof Set,represent:(e)=>{let t=new Map;for(let n of e)t.set(n,null);return t},addPair:(e,t,n)=>{if(n!==null)return"cannot resolve a set item";return e.add(t),""},has:(e,t)=>e.has(t),keys:(e)=>e.keys(),get:()=>null});$i=new Xn([lu,tf,nf]),yh=new Xn([...$i.tags,pu,$u,Iu,Uu]),un=new Xn([...$i.tags,fu,yu,Io,_o]),af=new Xn([...$i.tags,mu,wu,ai,ci,gi,mi,hi,yi,xi,Si]),cf=af.withTags({...ai,resolve:(e,t,n)=>{let r=ai.resolve(e,t,n);return r===j?Io.resolve(e,t,n):r}},{...ci,resolve:(e,t,n)=>{let r=ci.resolve(e,t,n);return r===j?_o.resolve(e,t,n):r}}),xh=Gn("tag:yaml.org,2002:map",{create:()=>new Map,addPair:(e,t,n)=>(e.set(t,n),""),has:(e,t)=>e.has(t),keys:(e)=>e.keys(),get:(e,t)=>e.get(t),identify:(e)=>e instanceof Map||zn(e),represent:(e)=>{if(e instanceof Map)return e;let t=new Map,n=e;for(let r of Object.keys(n))t.set(r,n[r]);return t}});Sh=Gn("tag:yaml.org,2002:map",{create:()=>({}),identify:zn,represent:(e)=>{let t=new Map;for(let n of Object.keys(e))t.set(n,e[n]);return t},addPair:(e,t,n)=>{let r=$o(t);if(r===null)return"nested arrays are not supported inside keys";if(r==="__proto__")Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0});else e[r]=n;return""},has:(e,t)=>{let n=$o(t);return n!==null&&Object.prototype.hasOwnProperty.call(e,n)},keys:(e)=>Object.keys(e),get:(e,t)=>{let n=String(t);if(!Object.prototype.hasOwnProperty.call(e,n))return null;return e[n]}}),lf={maxLength:79,indent:1,linesBefore:3,linesAfter:2};pt=class e extends Error{reason;mark;constructor(t,n){super();if(this.name="YAMLException",this.reason=t,this.mark=n,this.message=Eo(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}toString(t){return`${this.name}: ${Eo(this,t)}`}static throwAt(t,n,r,i=""){let s=0,o=0;for(let c=0;c<n;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:n,line:s,column:n-o};throw a.snippet=uf(a),new e(r,a)}},q={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},I={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},nt={BLOCK:1,FLOW:2},be={CLIP:1,STRIP:2,KEEP:3};Jo=Array(256),ko=Array(256);for(let e=0;e<256;e++)Jo[e]=bo(e)?1:0,ko[e]=bo(e);Sf=Object.assign(Object.create(null),{"!":"!","!!":"tag:yaml.org,2002:"}),$h=$f+"!,[]";bi={filename:"",schema:un,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};Do=Object.prototype.hasOwnProperty,Of=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Tf=/[,\[\]{}]/,Wo=/^(?:!|!!|![0-9A-Za-z-]+!)$/,li=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,Ho=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,Pf=new RegExp(`^(?:${li})*$`),Nf=new RegExp(`^(?:${Ho})+$`),Rf=new RegExp(`^(?:!(?:${li})*|${Ho}(?:${li})*)$`),wi={filename:"",maxDepth:100};zf={...wi,...bi};Eh=Symbol("INVALID"),bh=Symbol("visit:break"),wh=Symbol("visit:skip");Ro={applyQuoteFlowKeysOption:Xf,doubleQuoteForInvisibles:Qf,doubleQuoteWhitespaceOnly:Zf,applyForceQuotesOption:ep,tryLongOrMultilineAsBlock:tp,quoteInvalidPlain:np,fallbackToDoubleQuoted:rp};Xo=`(?:(?!(?:${sp}|${op}))${ip})`,Zn=`(?:(?!${Ci})${Xo})`,fi=Zn,pi=`(?:(?!${ap})${Zn})`,cp=`(?:(?:(?!${Zo})${Zn})|[?:-](?=${fi}))`,lp=`(?:(?:(?!${Zo})${Zn})|[?:-](?=${pi}))`,ea=`(?:(?:(?![:#])${fi})|:(?=${fi}))#*`,ta=`(?:(?:(?![:#])${pi})|:(?=${pi}))#*`,na=`(?:${Ci}*${ea})*`,ra=`(?:${Ci}*${ta})*`,ia=`${cp}#*${na}`,sa=`${lp}#*${ra}`,up=ia,fp=sa,pp=`\\n+${ea}${na}`,dp=`\\n+${ta}${ra}`,mp=`${ia}(?:${pp})*`,hp=`${sa}(?:${dp})*`,vh=new RegExp(`^(?:${mp})$`,"u"),Ah=new RegExp(`^(?:${hp})$`,"u"),Ch=new RegExp(`^(?:${up})$`,"u"),Oh=new RegExp(`^(?:${fp})$`,"u"),Th=new RegExp(`^(?:${Qo})*$`,"u"),Ph=new RegExp(`^(?:${Qo}|\\n)*$`,"u"),Nh=new RegExp(`^(?:${Xo}|\\n)*$`,"u"),gp={indent:2,seqNoIndent:!1,seqInlineFirst:!0,lineWidth:80,flowBracketPadding:!1,flowSkipCommaSpace:!1,flowSkipColonSpace:!1,quoteFlowKeys:!1,quoteStyle:"single",forceQuotes:!1,scalarStyleRules:Object.keys(Ro).map((e)=>Reflect.get(Ro,e)),tagBeforeAnchor:!1},Rh={...gp,schema:cf,skipInvalid:!1,noRefs:!1,flowLevel:-1,sortKeys:!1,transform:()=>{}},Ih=q.DOCUMENT,_h=q.SEQUENCE,Jh=q.MAPPING,kh=q.SCALAR,Lh=q.ALIAS,jh=q.POP,Mh=I.PLAIN,Dh=I.SINGLE_QUOTED,Fh=I.DOUBLE_QUOTED,Bh=I.LITERAL_BLOCK,Wh=I.FOLDED_BLOCK,Hh=nt.BLOCK,Uh=nt.FLOW,Vh=be.CLIP,Kh=be.STRIP,qh=be.KEEP});var yp,aa;var ca=N(()=>{Ee();oa();yp=un.withTags(gi,mi,hi,yi,xi,Si),aa={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 Ai(t,{schema:un})}catch{try{return Ai(t,{schema:yp})}catch(n){try{if(Go(t,{schema:un}).length===0)return}catch{}throw new Pe(n?.message||"Parser Error",e.url)}}else return t}}});var xp,la;var ua=N(()=>{Ee();xp=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)(?:[?#].*)?$/i,la={order:300,allowEmpty:!0,encoding:"utf8",canParse(e){return(typeof e.data==="string"||Buffer.isBuffer(e.data))&&xp.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 Pe("data is not text",e.url)}}});var Sp,fa;var pa=N(()=>{Sp=/\.(jpeg|jpg|gif|png|bmp|ico)(?:[?#].*)?$/i,fa={order:400,allowEmpty:!0,canParse(e){return Buffer.isBuffer(e.data)&&Sp.test(e.url)},parse(e){if(Buffer.isBuffer(e.data))return e.data;else return Buffer.from(e.data)}}});var Oi;var Ti=N(()=>{ce();Ee();Oi={order:100,canRead(e){return Mn(e.url)},async read(e){let t,n=await import("fs");try{t=Ot(e.url)}catch(r){let i=r;throw i.message=`Malformed URI: ${e.url}: ${i.message}`,new Ne(i,e.url)}if(t.endsWith("/")||t.endsWith("\\"))t=t.slice(0,-1);try{return await n.promises.readFile(t)}catch(r){let i=r;throw i.message=`Error opening file ${t}: ${i.message}`,new Ne(i,t)}}}});async function ga(e,t,n){e=tn(e);let r=n||[];r.push(e.href);let i;try{let s;if(t.safeUrlResolver){let a=await to(e.href);if(a.unsafe)throw Error(`Unsafe URL blocked by safeUrlResolver: ${e.href}`);s=a.addresses}i=await Ep(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)&&r.length>t.redirects){let a=Error(`Error downloading ${r[0]}.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
`)}`);throw a.status=o.status,new Ne(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=F(e.href,a),l=tn(c).origin===e.origin?t:Pp(t);return ga(c,l,r)}else return await o.readBody(t.maxContentLength??ha)}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 Ne(a,e.href)}finally{i?.cancelTimeout(),await i?.response.discard()}}async function Ep(e,t,n){let r,i;if(t.timeout&&typeof AbortController<"u"){let o=new AbortController;r=o,i=setTimeout(()=>o.abort(),t.timeout)}let s=()=>{if(i!==void 0)clearTimeout(i),i=void 0};try{return{response:n&&n.length>0?await vp(e,t,n,r?.signal):bp(await fetch(e,{method:"GET",headers:t.headers||{},credentials:t.withCredentials?"include":"same-origin",redirect:"manual",signal:r?r.signal:null})),cancelTimeout:s}}catch(o){throw s(),o}}function bp(e){return{status:e.status,getHeader:(t)=>e.headers.get(t),readBody:(t)=>wp(e,t),async discard(){if(e.body&&!e.bodyUsed)await e.body.cancel().catch(()=>{return})}}}async function wp(e,t){if(ya(e.headers.get("content-length"),t),!e.body)return Buffer.alloc(0);let n=e.body.getReader(),r=[],i=0;for(;;){let{done:s,value:o}=await n.read();if(s)return Buffer.concat(r,i);if(i+=o.byteLength,i>t)throw await n.cancel().catch(()=>{return}),Ni(t);r.push(o)}}async function vp(e,t,n,r){let i=e.protocol==="https:"?"node:https":"node:http",{request:s}=await import(i),o={method:"GET",headers:Ap(t.headers),lookup:Tp(e.hostname,n),agent:!1,autoSelectFamily:!0};if(r)o.signal=r;let a=await new Promise((l,u)=>{let f=!1,d=s(e,o,(m)=>{f=!0,l(m)});d.on("error",u),d.on("upgrade",(m,h)=>{h.destroy(),u(Error("Unexpected HTTP protocol upgrade"))}),d.on("close",()=>{if(!f)u(Error("The connection was closed before an HTTP response was received"))}),d.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)=>Cp(a,l,r),async discard(){if(!a.destroyed)a.destroy()}}}function Ap(e){let t=new Headers({accept:"*/*","accept-encoding":"gzip, deflate, br","user-agent":"node"});new Headers(e??void 0).forEach((r,i)=>t.set(i,r));for(let r of $p)t.delete(r);let n={};return t.forEach((r,i)=>{n[i]=r}),n}async function Cp(e,t,n){ya(e.headers["content-length"],t);let r=(e.statusCode===204||e.statusCode===205?"":e.headers["content-encoding"]??"").split(",").map((E)=>E.trim().toLowerCase()).filter((E)=>E&&E!=="identity");if(r.length>da)throw Error(`Too many content-encodings: maximum allowed is ${da}`);for(let E of r)if(!["gzip","x-gzip","deflate","x-deflate","br","zstd"].includes(E))throw Error(`Unsupported content-encoding: ${E}`);let i="node:stream",s="node:stream/promises",o="node:zlib",[{Duplex:a,Transform:c,Writable:l},{pipeline:u},f]=await Promise.all([import(i),import(s),import(o)]),d=Error("The connection was closed before the response body was complete");if(e.destroyed)throw e.errored??d;let m=()=>{let E=0;return new c({transform(A,w,S){E+=A.length,S(E>t?Ni(t):null,A)}})},h=[m()];for(let E of r.reverse()){let A=E==="gzip"||E==="x-gzip"?f.createGunzip():E==="deflate"||E==="x-deflate"?Op(f,a):E==="br"?f.createBrotliDecompress():f.createZstdDecompress();h.push(A,m())}let p=[],g=0,y=new l({write(E,A,w){p.push(E),g+=E.length,w()}});try{await u([e,...h,y],n?{signal:n}:{})}catch(E){if(E instanceof Error&&"code"in E&&E.code==="ERR_STREAM_PREMATURE_CLOSE")throw d;throw E}return Buffer.concat(p,g)}function Op(e,t){let n;return new t({read(){n?.resume()},write(r,i,s){if(!n){if(r.length===0){s();return}n=(r[0]&15)===8?e.createInflate():e.createInflateRaw(),n.on("data",(o)=>{if(!this.push(o))n?.pause()}),n.on("end",()=>this.push(null)),n.on("error",(o)=>this.destroy(o))}n.write(r,i,s)},final(r){if(n)n.end(r);else this.push(null),r()},destroy(r,i){n?.destroy(),i(r)}})}function ya(e,t){if(e&&Number(e)>t)throw Ni(t)}function Ni(e){return Error(`Response body exceeds the maxContentLength of ${e} bytes`)}function Tp(e,t){let n=ma(e),r=t.map(({address:i,family:s})=>({address:i,family:s}));return(i,s,o)=>{let a=ma(i),c=s.family==="IPv4"?4:s.family==="IPv6"?6:s.family||0,l=r.filter(({family:u})=>c===0||u===c);if(a!==n||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 ma(e){return e.replace(/^\[|\]$/g,"").replace(/\.+$/,"").toLowerCase()}function Pp(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 ha=52428800,da=5,$p,Pi;var Ri=N(()=>{ce();Ee();$p=["connection","content-length","expect","host","keep-alive","proxy-connection","te","trailer","transfer-encoding","upgrade"],Pi={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,maxContentLength:ha,canRead(e){return eo(e.url)&&(!this.safeUrlResolver||!jn(e.url))},read(e){let t=tn(e.url);if(typeof window<"u"&&!t.protocol)t.protocol=tn(location.href).protocol;return ga(t,this)}}});function Ea(e,t){if(xa(t)){let n=Object.keys(t).filter((r)=>!["__proto__","constructor","prototype"].includes(r));for(let r=0;r<n.length;r++){let i=n[r],s=t[i],o=e[i];if(xa(s))e[i]=Ea(o||{},s);else if(s!==void 0)e[i]=s}}return e}function xa(e){return e&&typeof e==="object"&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)&&!(typeof Headers<"u"&&e instanceof Headers)}var Sa=()=>({parse:{json:{...go},yaml:{...aa},text:{...la},binary:{...fa}},resolve:{file:{...Oi},http:{...Pi},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}),$a=(e)=>{let t=Sa();if(e)Ea(t,e);return t};var Ii=N(()=>{yo();ca();ua();pa();Ti();Ri()});function Np(e,t=!0){let n,r,i,s,o=Array.prototype.slice.call(e);if(typeof o[o.length-1]==="function")s=o.pop();if(typeof o[0]==="string")if(n=o[0],typeof o[2]==="object")r=o[1],i=o[2];else r=void 0,i=o[1];else n="",r=o[0],i=o[1];if(i=$a(i),t&&!i.mutateInputSchema&&typeof r==="object")r=structuredClone(r);return{path:n,schema:r,options:i,callback:s}}var fn;var ba=N(()=>{Ii();fn=Np});async function Ji(e,t,n){let r=e.$refs._root$Ref.path,i=e.$refs._root$Ref.dynamicIdScope?G(r,e.schema,e.$refs._root$Ref.legacyIdScope):r,s={$refs:e.$refs,options:t,excludedPathMatcher:n,documentLoads:new Map,externalDocuments:new Set,excludedPaths:new Set,excludedAncestorPaths:new Set};await tr({value:e.schema,path:r+"#",originPaths:[r+"#"],scopeBase:i,dynamicIdScope:e.$refs._root$Ref.dynamicIdScope,legacyIdScope:e.$refs._root$Ref.legacyIdScope},"#",void 0,void 0,s),await Ip(s)}async function tr(e,t,n,r,i,s=!1){if(!s&&i.excludedPathMatcher(t,e.value)){Aa(e,i);return}let o=e.value;if(!o||typeof o!=="object"||ArrayBuffer.isView(o)||Na(n,o))return;Ht(e);let a={value:o,...n?{parent:n}:{}};if(J.is$Ref(o)&&J.isAllowed$Ref(o,i.options)){if(!await Rp(e,t,r,i)&&J.isExtended$Ref(o))await wa(e,t,a,r,i);return}await wa(e,t,a,r,i)}async function wa(e,t,n,r,i){let s=e.value;await Promise.all(Object.keys(s).filter((o)=>o!=="$ref").map(async(o)=>{let a=B.join(t,o);if(e.children){if(jp(e,o)&&i.excludedPathMatcher(a,void 0)){er(e,o,i);return}}else{if(Object.getOwnPropertyDescriptor(s,o)?.get&&i.excludedPathMatcher(a,void 0)){er(e,o,i);return}let u=s[o],f=Pa(e,o,u);if(i.excludedPathMatcher(a,u)){er(e,o,i);return}await tr(f,a,n,r,i,!0);return}let c=mt(e,o);if(!c)return;if(i.excludedPathMatcher(a,c.value)){er(e,o,i);return}await tr(c,a,n,r,i,!0)}))}async function Rp(e,t,n,r){let i=e.value,s=e.referenceLocation||e;Ht(s);let o=J.isExternal$Ref(i),a=o&&r.options.dereference?.externalReferenceResolution==="root"?xe():s.dynamicIdScope?s.scopeBase:s.path,c=F(a,i.$ref);if(Ra(n,c))return!1;if(Ia(n,s.path,r.options),o&&!await ki(i,c,a,s.path,r))return!1;let l={path:c,depth:(n?.depth??0)+1,...n?{parent:n}:{}},u=await Ca(c,t,r,l);if(!u)return!1;let f=Oa(e,u,r.options.dereference?.mergeKeys??!0);return await tr(f,t,void 0,l,r),!0}async function ki(e,t,n,r,i){let s=R(t),o=i.documentLoads.get(s);if(o)return o;let a=i.$refs._get$Ref(s);if(a)return _i(s,i),!le(a.value);let c=_t({url:t,baseUrl:n,reference:e.$ref},i.$refs,i.options).then(()=>(_i(s,i),!0)).catch((l)=>{if(!i.options.continueOnError||!le(l))throw l;if(i.$refs._$refs[s])_i(s,i),l.source=decodeURI(R(r)),l.path=Tt(Se(r));return!1});return i.documentLoads.set(s,c),c}function _i(e,t){if(t.$refs._$refs[e])t.externalDocuments.add(e)}async function Ip(e){let t=R(e.$refs._root$Ref.path);for(let n of e.externalDocuments){if(n===t)continue;let r=e.$refs._get$Ref(n);if(!r||le(r.value))continue;let i=r.dynamicIdScope?G(r.path,r.value,r.legacyIdScope):r.path;await va(r.value,r.path+"#",i,r.dynamicIdScope,r.legacyIdScope,void 0,new WeakMap,e)}}async function va(e,t,n,r,i,s,o,a){if(a.excludedPaths.has(t)||!e||typeof e!=="object"||ArrayBuffer.isView(e)||Na(s,e))return;let c=a.excludedAncestorPaths.has(t),l=`${i}:${n}`,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 f={value:e,...s?{parent:s}:{}},d=[];if(J.isExternal$Ref(e)){let m=e,h=a.options.dereference?.externalReferenceResolution==="root"?xe():r?n:t,p=F(h,m.$ref);d.push(ki(m,p,h,t,a))}d.push(...Object.keys(e).map(async(m)=>{let h=B.join(t,m);if(a.excludedPaths.has(h))return;let p=e[m],g=Z(p,i),y=r&&p&&typeof p==="object"&&!ArrayBuffer.isView(p)?G(n,p,g):n;await va(p,h,y,r,g,f,o,a)})),await Promise.all(d)}function Aa(e,t){for(let n of e.originPaths||[e.path]){let r=_p(n);if(t.excludedPaths.has(r))continue;t.excludedPaths.add(r);let s=R(r)+"#";for(let o of B.parse(r))t.excludedAncestorPaths.add(s),s=B.join(s,o)}}function er(e,t,n){Aa({...e,path:B.join(e.path,t),originPaths:(e.originPaths||[e.path]).map((r)=>B.join(r,t))},n)}function _p(e){let t=R(e),n=Se(e)||"#";return t+n}async function Ca(e,t,n,r){let i=R(e),s=n.$refs._get$Ref(i);if(!s||le(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=n.$refs._aliases[i]===s;if(o.dynamicIdScope&&!a)o.legacyIdScope=Z(o.value,o.legacyIdScope),o.scopeBase=G(o.scopeBase,o.value,o.legacyIdScope);let c;try{c=B.parse(e)}catch{return}for(let l=0;l<c.length;l++){let u=await Jp(o,t,n,r);if(!u)return;o=u;let f=c[l],d=mt(o,f);if(!d||d.value===void 0||d.value===null&&l===c.length-1){d=void 0;for(let m=c.length-1;m>l;m--){let h=c.slice(l,m+1).join("/"),p=mt(o,h);if(p?.value!==void 0){d=p,l=m;break}}if(!d){let m=mt(o,f);if(!m||m.value!==null)return;d=m}}o=d,Ht(o)}return o}async function Jp(e,t,n,r){let i=e,s=r;while(J.is$Ref(i.value)&&J.isAllowed$Ref(i.value,n.options)){let o=i.value,a=i.referenceLocation||i;Ht(a);let c=J.isExternal$Ref(o),l=c&&n.options.dereference?.externalReferenceResolution==="root"?xe():a.dynamicIdScope?a.scopeBase:a.path,u=F(l,o.$ref);if(Ra(s,u))return J.isExtended$Ref(o)?i:void 0;if(Ia(s,a.path,n.options),c&&!await ki(o,u,l,a.path,n))return;let f={path:u,depth:(s?.depth??0)+1,...s?{parent:s}:{}},d=await Ca(u,t,n,f);if(!d)return;i=Oa(i,d,n.options.dereference?.mergeKeys??!0),s=f}return i}function Oa(e,t,n){if(!J.isExtended$Ref(e.value)||t.value===null||typeof t.value!=="object")return t;return Ta(t,e,n,!0,void 0)}function Ta(e,t,n,r,i){let s=e.value,o=t.value,a=kp(i,s,o);if(a)return a;let c=!r&&Array.isArray(e.value)?Array(e.value.length):{},l=new Map,u={value:c,path:e.path,originPaths:Lp(e,t),scopeBase:e.scopeBase,dynamicIdScope:e.dynamicIdScope,legacyIdScope:e.legacyIdScope,children:l,resolveMetadata(){Ht(e),u.scopeBase=e.scopeBase,u.dynamicIdScope=e.dynamicIdScope,u.legacyIdScope=e.legacyIdScope}},f={target:s,source:o,value:u,...i?{parent:i}:{}},d=new Set(Object.keys(o).filter((p)=>!(r&&p==="$ref"))),m=new Set(Object.keys(s)),h=new Set([...d,...m]);for(let p of h){let g=()=>{let y=d.has(p)?mt(t,p):void 0,E;if(y&&(!m.has(p)||!n||y.value===null||typeof y.value!=="object"||Array.isArray(y.value)))E=y;else{let A=mt(e,p);E=y&&A.value!==null&&typeof A.value==="object"?Ta(A,y,!0,!1,f):y||A}if(l.set(p,E),Dp(c,p,E.value),p==="$ref"&&typeof E.value==="string")u.referenceLocation=E.owner||e;return E};l.set(p,{resolve:g,requiresPrecheck:Mp(o,s,p,d.has(p),m.has(p),n)}),Fp(c,p,()=>mt(u,p).value)}return u}function kp(e,t,n){for(let r=e;r;r=r.parent)if(r.target===t&&r.source===n)return r.value;return}function mt(e,t){if(e.children){let r=e.children.get(t);if(!r||!("resolve"in r))return r;let i=r.resolve();return e.children.set(t,i),i}let n=e.value;if(n===null||typeof n!=="object"&&typeof n!=="function"||!(t in n))return;return Pa(e,t,n[t])}function Pa(e,t,n){let r={value:n,path:B.join(e.path,t),originPaths:(e.originPaths||[e.path]).map((i)=>B.join(i,t)),scopeBase:e.scopeBase,dynamicIdScope:e.dynamicIdScope,legacyIdScope:e.legacyIdScope,owner:e,resolveMetadata(){Ht(e);let i=Z(n,e.legacyIdScope);r.legacyIdScope=i,r.scopeBase=e.dynamicIdScope&&n&&typeof n==="object"&&!ArrayBuffer.isView(n)?G(e.scopeBase,n,i):e.scopeBase}};return r}function Lp(e,t){return[...new Set([...e.originPaths||[e.path],...t.originPaths||[t.path]])]}function Ht(e){let t=e.resolveMetadata;if(t)delete e.resolveMetadata,t()}function jp(e,t){let n=e.children?.get(t);return Boolean(n&&"resolve"in n&&n.requiresPrecheck)}function Mp(e,t,n,r,i,s){let o=r?Object.getOwnPropertyDescriptor(e,n):void 0;if(o?.get)return!0;if(!r)return Boolean(i&&Object.getOwnPropertyDescriptor(t,n)?.get);let a=o?.value;return!(!i||!s||a===null||typeof a!=="object"||Array.isArray(a))&&Boolean(Object.getOwnPropertyDescriptor(t,n)?.get)}function Na(e,t){for(let n=e;n;n=n.parent)if(n.value===t)return!0;return!1}function Ra(e,t){for(let n=e;n;n=n.parent)if(n.path===t)return!0;return!1}function Ia(e,t,n){let r=n.dereference?.maxDepth??500;if((e?.depth??0)>=r)throw RangeError(`Maximum dereference depth (${r}) exceeded at ${t}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`)}function Dp(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0})}function Fp(e,t,n){Object.defineProperty(e,t,{get:n,enumerable:!0,configurable:!0})}var _a=N(()=>{ft();It();Vn();ce();Ee();Ue()});function Bp(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 Ji(e,t,t.resolveExcludedPathMatcher);try{let r=e.$refs._root$Ref.dynamicIdScope?G(e.$refs._root$Ref.path,e.schema,e.$refs._root$Ref.legacyIdScope):e.$refs._root$Ref.path,i=Li(e.schema,e.$refs._root$Ref.path+"#",r,e.$refs._root$Ref.dynamicIdScope,e.$refs._root$Ref.legacyIdScope,e.$refs,t);return Promise.all(i)}catch(r){return Promise.reject(r)}}function Li(e,t,n,r,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 f=`${i}:${n}`,d=a.get(e);if(d?.has(f))return u;if(d)d.add(f);else a.set(e,new Set([f]));l.add(e);let m=n;if(J.isExternal$Ref(e))u.push(Wp(e,t,m,r,s,o));let h=Object.keys(e);for(let p of h){let g=B.join(t,p),y=e[p],E=Z(y,i),A=r&&y&&typeof y==="object"&&!ArrayBuffer.isView(y)?G(m,y,E):m;u=u.concat(Li(y,g,A,r,E,s,o,a,c,l))}l.delete(e)}return u}async function Wp(e,t,n,r,i,s){let a=s.dereference?.externalReferenceResolution==="root"?xe():r?n:t,c=F(a,e.$ref),l=R(c),u=i._get$Ref(l);if(u)return Promise.resolve(u.value);try{let f=e.$ref,d={url:c,baseUrl:a};if(typeof f==="string")d.reference=f;let m=await _t(d,i,s),h=i._get$Ref(l),p=h?.dynamicIdScope??!1,g=h?.legacyIdScope??!1,y=p?G(l,m,g):l,E=Li(m,l+"#",y,p,g,i,s,new Map,!0);return Promise.all(E)}catch(f){if(!s?.continueOnError||!le(f))throw f;if(i._$refs[l])f.source=decodeURI(R(t)),f.path=Tt(Se(t));return[]}}var Ja;var ka=N(()=>{ft();It();Vn();_a();ce();Ee();Ue();Ja=Bp});function Hp(e,t){let n=e.$refs._root$Ref.dynamicIdScope?G(e.$refs._root$Ref.path,e.schema,e.$refs._root$Ref.legacyIdScope):e.$refs._root$Ref.path,r=[],i=new Set([R(e.$refs._root$Ref.path),R(n)]);Mi(e,"schema",e.$refs._root$Ref.path+"#",n,e.$refs._root$Ref.dynamicIdScope,e.$refs._root$Ref.legacyIdScope,!1,"#",0,r,e.$refs,t,i,new Set);let s=Rt(e.schema,e.$refs._root$Ref.legacyIdScope);if(Up(r,t,s,n),(t.bundle||{}).optimizeInternalRefs!==!1)qp(r,e.schema)}function Mi(e,t,n,r,i,s,o,a,c,l,u,f,d,m,h=!1){let p=t===null?e:e[t],g=f.bundle||{},y=g.excludedPathMatcher||(()=>!1);if(p&&typeof p==="object"&&!ArrayBuffer.isView(p)&&(h||!y(a,p))&&!m.has(p)){m.add(p);let E=r;if(J.isAllowed$Ref(p,f))La(e,t,n,E,i,o,a,c,l,u,f,d,m);else{let A=Object.keys(p).sort((w,S)=>{if(w==="definitions"||w==="$defs")return-1;else if(S==="definitions"||S==="$defs")return 1;else return w.length-S.length});for(let w of A){let S=B.join(n,w),b=B.join(a,w);if(Object.getOwnPropertyDescriptor(p,w)?.get&&y(b,void 0))continue;let x=p[w];if(y(b,x))continue;let T=Z(x,s),k=i&&x&&typeof x==="object"&&!ArrayBuffer.isView(x)?G(E,x,T):E,z=i&&ji(x,T),_e=o||z,re=d;if(z)re=new Set(d),re.add(R(k));if(J.isAllowed$Ref(x,f))La(p,w,S,k,i,_e,b,c,l,u,f,re,m);else Mi(p,w,S,k,i,T,_e,b,c,l,u,f,re,m,!0);if(x&&typeof x==="object"&&!Array.isArray(x)){if("$ref"in x)g?.onBundle?.(x.$ref,p[w],p,w)}}}}}function La(e,t,n,r,i,s,o,a,c,l,u,f,d){let m=t===null?e:e[t],p=J.isExternal$Ref(m)&&u.dereference?.externalReferenceResolution==="root"?xe():i?r:n,g=F(p,m.$ref),y=l._resolve(g,o,u);if(y===null)return;let A=B.parse(o).length,w=R(y.path),S=Se(y.path),b=l._aliases[w],v=Boolean(b&&Xp(l._root$Ref.value,y.$ref.value)),x=w!==l._root$Ref.path&&!f.has(w)&&!v,T=Boolean(b)&&y.$ref.value!==l._root$Ref.value,k=Rt(y.$ref.value,y.$ref.legacyIdScope),z=b?y.$ref.path:y.$ref.dynamicIdScope?G(y.$ref.path,y.$ref.value,y.$ref.legacyIdScope):y.$ref.path,_e=J.isExtended$Ref(m);a+=y.indirections;let re=Vp(c,e,t);if(re)if(A<re.depth||a<re.indirections)Kp(c,re);else return;if(c.push({$ref:m,parent:e,key:t,pathFromRoot:o,depth:A,file:w,hash:S,value:y.value,circular:y.circular,extended:_e,external:x,nestedResource:T,indirections:a,scopeBase:r,dynamicIdScope:i,nestedIdScope:s,targetResourceBase:z,...k===void 0?{}:{targetResourceId:k}}),!re||x){let hn=y.$ref.dynamicIdScope?y.scopeBase:y.$ref.path,Lc=s||y.$ref.dynamicIdScope&&ji(y.value,y.legacyIdScope),dr=new Set(f);if(y.value===y.$ref.value&&ji(y.$ref.value,y.$ref.legacyIdScope))dr.add(R(y.$ref.path)),dr.add(R(hn));Mi(y.value,null,y.path,hn,y.$ref.dynamicIdScope,y.legacyIdScope,Lc,o,a+1,c,l,u,dr,d)}}function Up(e,t,n,r){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=R(a.targetResourceBase),u=R(a.scopeBase);if(l!==u)a.$ref.$ref=zp(a);else if(!a.nestedResource)a.$ref.$ref=a.hash}}else if(a.file===i&&a.hash===s)a.$ref.$ref=ja(a,o,n,r);else if(a.file===i&&a.hash.indexOf(s+"/")===0){let l=B.join(o,B.parse(a.hash.replace(s,"#")));a.$ref.$ref=ja(a,l,n,r)}else if(i=a.file,s=a.hash,o=a.pathFromRoot,a.$ref=a.parent[a.key]=J.dereference(a.$ref,a.value,t),a.circular)a.$ref.$ref=a.pathFromRoot}}function Vp(e,t,n){for(let r of e)if(r&&r.parent===t&&r.key===n)return r;return}function Kp(e,t){let n=e.indexOf(t);e.splice(n,1)}function qp(e,t){for(let n of e){if(!n.$ref||typeof n.$ref!=="object"||!("$ref"in n.$ref))continue;let r=n.$ref.$ref;if(typeof r!=="string"||!nr(r))continue;let i=Yp(t,r);if(i!==r)n.$ref.$ref=i}}function Yp(e,t){if(!nr(t))return t;let n=B.parse(t),r=e,i=[];for(let s of n){if(r===null||r===void 0||typeof r!=="object")return t;if(!Object.prototype.hasOwnProperty.call(r,s)&&"$ref"in r&&typeof r.$ref==="string"&&nr(r.$ref)){let o=B.parse(r.$ref);if(i.length=0,i.push(...o),r=Gp(e,r.$ref),r===null||r===void 0||typeof r!=="object")return t}r=r[s],i.push(s)}return B.join("#",i)}function Gp(e,t){if(!nr(t))return;let n=B.parse(t),r=e;for(let i of n){if(r===null||r===void 0||typeof r!=="object")return;r=r[i]}return r}function nr(e){return e[0]==="#"&&nn(e.substring(1)).startsWith("/")}function ja(e,t,n,r){if(!e.dynamicIdScope||!e.nestedIdScope||!r)return t;let i=r;if(n&&R(F(e.scopeBase,n))===R(r))i=n;return R(i)+t}function zp(e){let t=R(e.targetResourceBase);if(typeof e.$ref.$ref==="string"&&R(F(e.scopeBase,e.$ref.$ref))===t)return e.$ref.$ref;if(e.targetResourceId&&R(F(e.scopeBase,e.targetResourceId))===t)t=e.targetResourceId;return e.hash==="#"?t:t+e.hash}function ji(e,t=!1){return Rt(e,t)!==void 0}function Xp(e,t){if(!t||typeof t!=="object")return!1;let n=new Set,r=(i)=>{if(i===t)return!0;if(!i||typeof i!=="object"||ArrayBuffer.isView(i)||n.has(i))return!1;return n.add(i),Object.keys(i).some((s)=>r(i[s]))};return r(e)}var Ma;var Da=N(()=>{ft();It();ce();Ue();Ma=Hp});function Qp(e,t){let n=Date.now(),r=e.$refs._root$Ref.dynamicIdScope?G(e.$refs._root$Ref.path,e.schema,e.$refs._root$Ref.legacyIdScope):e.$refs._root$Ref.path,i=Di(e.schema,e.$refs._root$Ref.path,r,e.$refs._root$Ref.dynamicIdScope,e.$refs._root$Ref.legacyIdScope,"#",new Set,new Map,new Map,e.$refs,t,n,0);e.$refs.circular=i.circular,e.schema=i.value}function Di(e,t,n,r,i,s,o,a,c,l,u,f,d,m){let h,p={value:e,circular:!1};Ba(f,u);let g=u.dereference||{},y=g.maxDepth??500;if(d>y)throw RangeError(`Maximum dereference depth (${y}) exceeded at ${s}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let E=g.excludedPathMatcher||(()=>!1);if(g?.circular==="ignore"||!a.has(e)){if(e&&typeof e==="object"&&!ArrayBuffer.isView(e)&&!E(s,e)){o.add(e),a.set(e,!1);let A=m||ut(l,e)||{value:e,path:t,scopeBase:n,dynamicIdScope:r,legacyIdScope:i};if(J.isAllowed$Ref(e,u))h=Fa(e,A.path,A.scopeBase,A.dynamicIdScope,s,o,a,c,l,u,f,d,A),p.circular=h.circular,p.value=h.value;else for(let w of Object.keys(e)){Ba(f,u);let S=B.join(t,w),b=B.join(s,w);if(Object.getOwnPropertyDescriptor(e,w)?.get&&E(b,void 0))continue;let x=e[w];if(E(b,x))continue;let T=Re(l,A,w,x),k;if(J.isAllowed$Ref(x,u)){if(h=Fa(x,T.path,T.scopeBase,T.dynamicIdScope,b,o,a,c,l,u,f,d,T),k=h.circular,e[w]!==h.value){let z=new Map;if(g?.preservedProperties){if(typeof e[w]==="object"&&!Array.isArray(e[w]))g?.preservedProperties.forEach((re)=>{if(re in e[w])z.set(re,e[w][re])})}let _e=h.value;if(g?.cloneReferences&&!k&&_e&&typeof _e==="object")_e=structuredClone(_e);if(e[w]=_e,g?.preservedProperties){if(z.size&&e[w]!==null&&typeof e[w]==="object"&&!Array.isArray(e[w]))z.forEach((re,hn)=>{e[w][hn]=re})}g?.onDereference?.(x.$ref,e[w],e,w)}}else if(!o.has(x)){if(h=Di(x,T.path,T.scopeBase,T.dynamicIdScope,T.legacyIdScope,b,o,a,c,l,u,f,d+1,T),k=h.circular,e[w]!==h.value)e[w]=h.value}else k=pn(S,l,u);p.circular=p.circular||k}o.delete(e),a.set(e,p.circular)}}else p.circular=a.get(e)||!1;return p}function Fa(e,t,n,r,i,s,o,a,c,l,u,f,d){let p=J.isExternal$Ref(e)&&l?.dereference?.externalReferenceResolution==="root"?xe():r?n:t,g=F(p,e.$ref),y=a.get(g);if(y&&!J.isExtended$Ref(e))if(!y.circular)return y;else if(typeof y.value==="object"&&"$ref"in y.value&&"$ref"in e){if(y.value.$ref===e.$ref)return pn(t,c,l),y}else return pn(t,c,l),y;let E=c._resolve(g,t,l);if(E===null)return{circular:!1,value:null};let A=E.circular,w=A||E.chainCircular||s.has(E.value);if(w)pn(t,c,l);let S=J.dereference(e,E.value,l),b=E.location,v=J.isExtended$Ref(e)?sn(c,S,b,d,l.dereference?.mergeKeys??!0):b;if(!w){let T=Di(S,v.path,v.scopeBase,v.dynamicIdScope,v.legacyIdScope,i,s,o,a,c,l,u,f+1,v);if(w=T.circular,S=T.value,w&&y?.circular)pn(t,c,l)}if(w&&!A&&l.dereference?.circular==="ignore")S=e;if(A&&S!==e)S.$ref=i;let x={circular:w,value:S};if(Object.keys(e).length===1)a.set(g,x);return x}function Ba(e,t){if(t&&t.timeoutMs){if(Date.now()-e>t.timeoutMs)throw new Kr(t.timeoutMs)}}function pn(e,t,n){if(t.circular=!0,n?.dereference?.onCircular?.(e),!n.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${e}`);return!0}var Wa;var Ha=N(()=>{ft();It();ce();Ue();Ee();Gr();Wa=Qp});function Zp(){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 Fi;var Ua=N(()=>{Fi=Zp()});function me(e,t){if(e){t.then(function(n){Fi(function(){e(null,n)})},function(n){Fi(function(){e(n)})});return}else return t}var Va=N(()=>{Ua()});class Ke{schema=null;$refs=new cn;async parse(){let e;try{e=fn(arguments)}catch(r){return rr(arguments,r)}let t,n=e.schema!==void 0&&e.schema!==null;if(!e.path&&!n){let r=Error(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return me(e.callback,Promise.reject(r))}this.schema=null,this.$refs=new cn;try{let r="http";if(Mn(e.path))e.path=so(e.path),r="file";if(e.path=F(xe(),e.path),n&&(typeof e.schema==="object"||typeof e.schema==="boolean")){let s=this.$refs._add(e.path);s.value=e.schema,s.pathType=r,s.dynamicIdScope=Bn(s.value),s.legacyIdScope=Z(s.value),Wn(this.$refs,s.path,s.value,s.pathType,s.dynamicIdScope),t=Promise.resolve(e.schema)}else t=_t(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,me(e.callback,Promise.resolve(this.schema));else if(e.options.continueOnError)return this.schema=null,me(e.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(r){if(!e.options.continueOnError||!le(r))return me(e.callback,Promise.reject(r));if(this.$refs._$refs[R(e.path)])this.$refs._$refs[R(e.path)].addError(r);return me(e.callback,Promise.resolve(null))}}static parse(){let e=new Ke;return e.parse.apply(e,arguments)}async resolve(){let e;try{e=fn(arguments,!1)}catch(t){return rr(arguments,t)}try{return await this.parse(e.path,e.schema,e.options),await Ja(this,e.options),Bi(this),me(e.callback,Promise.resolve(this.$refs))}catch(t){return me(e.callback,Promise.reject(t))}}static resolve(){let e=new Ke;return e.resolve.apply(e,arguments)}static bundle(){let e=new Ke;return e.bundle.apply(e,arguments)}async bundle(){let e;try{e=fn(arguments,!1)}catch(t){return rr(arguments,t)}try{return await this.resolve(e.path,e.schema,e.options),Ma(this,e.options),Bi(this),me(e.callback,Promise.resolve(this.schema))}catch(t){return me(e.callback,Promise.reject(t))}}static dereference(){let e=new Ke;return e.dereference.apply(e,arguments)}async dereference(){let e;try{e=fn(arguments,!1)}catch(t){return rr(arguments,t)}try{return await this.resolve(e.path,e.schema,e.options),Wa(this,e.options),Bi(this),me(e.callback,Promise.resolve(this.schema))}catch(t){return me(e.callback,Promise.reject(t))}}}function rr(e,t){let n=e[e.length-1];return me(typeof n==="function"?n:void 0,Promise.reject(t))}function Bi(e){if(Pt.getParserErrors(e).length>0)throw new Pt(e)}var Zg,ey,ty,Ka;var qa=N(()=>{mo();Vn();ba();ka();Da();Ha();ce();Ti();Ri();Ee();Va();Ue();Ii();ce();Zg=Ke.parse,ey=Ke.resolve,ty=Ke.bundle,Ka=Ke.dereference});function ed(e,t){if(t.routing==="prefix-except-default"&&e===t.defaultLocale)return"/";return`/${e.toLowerCase()}/`}function Ya(e){if(e===null||e.locales.length<2)return"";let t=JSON.stringify(e.locales),n=JSON.stringify(e.defaultLocale),r=JSON.stringify(Object.fromEntries(e.locales.map((i)=>[i,ed(i,e)])));return`
|
|
24
|
+
`:""}var Ms,or,gt="https://esm.sh/@vue/reactivity@3.5.40",ht="https://esm.sh/lit-html@3.3.0",Ls,Fs,be,Hs,_e="__jxAttrText",pr="__jxServerCall",sn="__jxCaptureSlotted",on="__jxDistributeSlots",De="<!---->",ln,Xs;var Ie=I(()=>{ze();Be();qe();st();er();H();je();ze();qe();st();H();Ms=["$map/","event#/","$args/","$reduce/"];or=Symbol("jx.runtimeOnlyStateKeys");Ls=/\bstate\.([A-Za-z_$][\w$]*)\s*(?:\+\+|--|(?:\*\*|\|\||&&|\?\?|<<|>>>|>>|[-+*/%&|^])?=(?!=))/g,Fs=/\bstate\.([A-Za-z_$][\w$]*)\s*\.\s*(?:push|pop|shift|unshift|splice|sort|reverse|fill|copyWithin)\s*\(/g;be=new Set(["pre","textarea","listing","plaintext","xmp"]);Hs=[];ln=new Set(["input","br","hr","img","meta","link","area","col","source"]);Xs=/^(?:::slotted\(|::part\()/});function xr(e){let t=[],n=[],r=null,s=0,o=()=>n.at(-1)?.path??"",i=()=>r===null?o():no(o(),r),u=()=>{s+=1;let a="";while(s<e.length){let c=e[s];if(c==="\\"){let l=e[s+1]??"";if(l==="u")a+=String.fromCodePoint(Number.parseInt(e.slice(s+2,s+6),16)),s+=6;else a+=eo.get(l)??l,s+=2;continue}if(c==='"')return s+=1,a;a+=c,s+=1}return a};while(s<e.length){let a=e[s];if(hr.has(a)||a===","||a===":"){s+=1;continue}if(a==="{"||a==="["){n.push(a==="{"?{keys:new Set,kind:"object",path:i()}:{kind:"array",path:i()}),r=null,s+=1;continue}if(a==="}"||a==="]"){n.pop(),r=null,s+=1;continue}if(a==='"'){let l=u(),p=n.at(-1);if(p?.kind==="object"&&to(e,s)===":"){if(p.keys.has(l))t.push({detail:l,kind:"duplicate-key",path:p.path});p.keys.add(l),r=l}else r=null;continue}if(a==="-"||a>="0"&&a<="9"){let l=s;while(s<e.length&&/[\d+.eE-]/.test(e[s]))s+=1;let p=e.slice(l,s);if(!ro(p))t.push({detail:p,kind:"unsafe-number",path:i()});r=null;continue}let c=s;while(s<e.length&&/[A-Za-z]/.test(e[s]))s+=1;if(s===c)s+=1;r=null}return t}function to(e,t){let n=t;while(n<e.length&&hr.has(e[n]))n+=1;return e[n]??""}function no(e,t){return e===""?t:`${e}.${t}`}function ro(e){if(/[.eE]/.test(e))return!0;let t=Number(e);if(!Number.isFinite(t))return!1;return String(t)===e.replace(/^\+/,"")}function yr(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 hr,eo;var $r=I(()=>{hr=new Set([" ","\t",`
|
|
25
|
+
`,"\r"]);eo=new Map([["b","\b"],["f","\f"],["n",`
|
|
26
|
+
`],["r","\r"],["t","\t"]])});function so(e){return e instanceof Error?e.message:String(e)}function br(e){if(J(e))return Sr.test(e)?e.normalize("NFC"):e;if(Array.isArray(e))return e.map((t)=>br(t));if(L(e))return Jr(e);return e}function Jr(e){let t={};for(let[n,r]of Object.entries(e))t[Sr.test(n)?n.normalize("NFC"):n]=br(r);return t}function un(e,t,n){let r;try{r=JSON.parse(e)}catch(o){throw Error(`Failed to parse ${n} at ${t}: ${so(o)}`,{cause:o})}if(!L(r))throw Error(`Invalid ${n} at ${t}: expected a JSON object`);let s=xr(e);if(s.length>0){let o=s.map((i)=>yr(i)).join("; ");throw Error(`Invalid ${n} at ${t}: ${o}`)}return Jr(r)}function Et(e,t){return un(e,t,"Jx document")}function Qi(e,t){return un(e,t,"project config")}function ea(e,t){return un(e,t,"class definition")}var Sr;var pn=I(()=>{H();$r();Sr=/[^\p{ASCII}]/u});function vr(e){if(!J(e))return null;let[t,...n]=e.split(";"),r=(t??"").indexOf("/");if(r===-1)return null;let s=(t??"").slice(0,r).trim().toLowerCase(),o=(t??"").slice(r+1).trim().toLowerCase();if(!Er.test(s)||!Er.test(o))return null;let i=o.lastIndexOf("+"),u=i===-1?null:o.slice(i+1),a=i===-1?o:o.slice(0,i);if(u==="")return null;let c=a.indexOf("."),l=c===-1?null:a.slice(0,c),p=l!==null&&oo.has(l)?l:null,g=p===null?a:a.slice(p.length+1);if(g==="")return null;let d={};for(let x of n){let f=x.indexOf("=");if(f===-1)return null;let m=x.slice(0,f).trim().toLowerCase(),y=x.slice(f+1).trim();if(m==="")return null;if(y.startsWith('"')&&y.endsWith('"')&&y.length>=2)y=y.slice(1,-1);d[m]=y}return{parameters:d,subtype:g,suffix:u,tree:p,type:s}}function Or(e){if(!J(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(vr(e)===null)return`"${e}" is not a well-formed media type (RFC 6838 §4.2)`;return null}function Ar(e){let t=vr(e);if(t===null)return null;let n=t.tree===null?"":`${t.tree}.`,r=t.suffix===null?"":`+${t.suffix}`;return`${t.type}/${n}${t.subtype}${r}`}var Er,oo,wr="text/markdown; variant=GFM",Cr="application/yaml",ra;var jr=I(()=>{H();Er=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}$/,oo=new Set(["vnd","prs","x"]);ra={".markdown":`${wr}; charset=utf-8`,".md":`${wr}; charset=utf-8`,".yaml":`${Cr}; charset=utf-8`,".yml":`${Cr}; charset=utf-8`}});function Tr(e){if(e===null)throw TypeError("A class descriptor cannot be null");return L(e)?e:{}}class wt{name;classPath;classDef;extensions;mediaType;mediaTypeEssence;documentKinds;exportTarget;remote;studio;project;server;connector;capabilities;#t;#e=null;constructor(e,t,n,r){this.name=e,this.classPath=t,this.classDef=n,this.#t=r;let{format:s}=n;this.extensions=(s?.extensions??[]).map((o)=>o.toLowerCase()),this.mediaType=s?.mediaType??null,this.mediaTypeEssence=Ar(this.mediaType),this.documentKinds=s?.documentKinds??[],this.exportTarget=s?.exportTarget===!0,this.remote=s?.remote===!0,this.studio=n.$studio??null,this.project=n.project??null,this.server=n.server??null,this.connector=n.connector??null,this.capabilities=ao(n)}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.#n(await this.implementation())}#n(e){let t=this.classDef.title??this.name;return e[t]??e.default?.[t]??e.default}async call(e,...t){let n=this.capabilities[e];if(!n)throw Error(`Format class "${this.name}" does not declare a "${e}" capability`);let r=this.#n(await this.implementation()),s=r?.[n.identifier];if(!te(s)){let i=this.classDef.title??this.name;throw TypeError(`Format class "${this.name}": implementation export "${i}" has no static "${n.identifier}" method`)}return await s.call(r,...t)}async parseDocument(e,t){return await this.call("parse",e,t)}}class Ct{#t;constructor(e){this.#t=e;for(let t of e){if(t.mediaType===null)continue;let n=Or(t.mediaType);if(n!==null)throw Error(`Format "${t.name}" declares an invalid mediaType: ${n}`)}for(let t of Nr){let n=new Map;for(let r of e){if(!r.capabilities[t])continue;for(let s of r.extensions){let o=n.get(s);if(o)throw Error(`Format conflict: "${o.name}" and "${r.name}" both claim "${s}" with the "${t}" capability`);n.set(s,r)}}}}get entries(){return this.#t}byExtension(e,t){let n=Rr(e);return this.#t.find((r)=>r.extensions.includes(n)&&(!t||r.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 n of this.#t){if(e&&!n.documentKinds.includes(e))continue;for(let r of n.extensions)t.add(r)}return t.delete(".json"),[...t]}has(e){let t=Rr(e);return this.#t.some((n)=>n.extensions.includes(t))}}function ao(e){let t={},n=e.$defs?.methods??{};for(let[r,s]of Object.entries(n)){let{role:o}=s;if(!co(o))continue;let i={identifier:s.identifier??r,timing:s.timing??io};if(J(s.discriminator))i.discriminator=s.discriminator;t[o]=i}return t}function co(e){return e!==void 0&&lo.has(e)}function Rr(e){let t=e.toLowerCase();return t.startsWith(".")?t:`.${t}`}var Nr,Pr,io,lo;var fn=I(()=>{H();jr();Nr=["parse","serialize","rewrite","discover","load"],Pr=[...Nr,"projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"];io=["compiler","server"];lo=new Set(Pr)});class kr{#t;#e;#n;constructor(e){this.#t=e,this.#e=e.flatMap((s)=>s.classes);let t=new Map;for(let s of e)for(let o of s.classes){let i=t.get(o.name);if(i&&i!==s.specifier)throw Error(`Extension conflict: "${i}" and "${s.specifier}" both provide a class named "${o.name}"`);t.set(o.name,s.specifier)}let n=new Map;for(let s of this.#e){if(!s.project)continue;let o=n.get(s.project.key);if(o)throw Error(`Extension conflict: "${o.name}" and "${s.name}" both claim the project section "${s.project.key}"`);n.set(s.project.key,s)}let r=new Map;for(let s of this.#e){if(!s.server)continue;let{basePath:o}=s.server;if(!o.startsWith("/_jx/"))throw Error(`Extension "${s.name}": server basePath "${o}" must be under /_jx/`);let i=r.get(o);if(i)throw Error(`Extension conflict: "${i.name}" and "${s.name}" both mount "${o}"`);r.set(o,s)}this.#n=new Ct(this.#e.filter((s)=>s.extensions.length>0))}get extensions(){return this.#t}get classes(){return this.#e}get formats(){return this.#n}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 _r(e,t,n){let r=[];for(let s of e??[])r.push(await uo(s,t,n));return new kr(r)}async function uo(e,t,n){let r;if(e.startsWith("./")||e.startsWith("../")){let a=t.resolvePath(n,e);r=t.resolvePath(`${a}/package.json`,`./${Ze}`)}else try{r=t.resolvePath(n,`${e}/${Ze}`)}catch(a){throw Error(`Extension "${e}" is not resolvable: it must export ${Ze} (is the package installed, and does its exports map include it?): ${mn(a)}`,{cause:a})}let s;try{s=await t.loadJson(r)}catch(a){throw Error(`Extension "${e}": cannot read manifest ${r}: ${mn(a)}`,{cause:a})}if(!L(s)||!J(s.name))throw Error(`Extension "${e}": ${Ze} must declare a "name"`);let o=s;if(!e.startsWith(".")&&o.name!==e)throw Error(`Extension "${e}": manifest name "${o.name}" does not match the specifier`);let i=[];for(let[a,c]of Object.entries(o.classes??{})){let l=t.resolvePath(r,c),p;try{p=await t.loadJson(l)}catch(g){throw Error(`Extension "${e}": cannot read class "${a}" at ${l}: ${mn(g)}`,{cause:g})}i.push(new wt(a,l,Tr(p),t))}let u={};if(o.schemas?.project)u.project=t.resolvePath(r,o.schemas.project);if(o.schemas?.document)u.document=t.resolvePath(r,o.schemas.document);if(o.schemas?.fields)u.fields=t.resolvePath(r,o.schemas.fields);return{specifier:e,manifestPath:r,manifest:o,classes:i,schemas:u}}function mn(e){return e instanceof Error?e.message:String(e)}var Ze="jx-extension.json";var Dr=I(()=>{fn();H();fn()});import{readFileSync as po}from"node:fs";import{dirname as fo,isAbsolute as mo,resolve as dn,sep as vt}from"node:path";import{pathToFileURL as go}from"node:url";import{createRequire as ho}from"node:module";async function xo(e){let t=[e],n=`${vt}src${vt}`,r=`${vt}dist${vt}`;if(e.includes(n)){let o=e.replace(n,r);if(t.push(o),o.endsWith(".ts"))t.push(`${o.slice(0,-3)}.js`)}if(e.endsWith(".js"))t.push(`${e.slice(0,-3)}.ts`);let s;for(let o of t)try{return await import(go(o).href)}catch(i){s=i}throw s instanceof Error?s:Error(String(s))}function yo(e,t){return ho(dn(e,"package.json")).resolve(t)}function $o(e){return{importModule:(t)=>xo(t),loadJson:async(t)=>JSON.parse(po(t,"utf8")),resolvePath:(t,n)=>{if(n.startsWith("./")||n.startsWith("../"))return dn(fo(t),n);if(mo(n))return n;return yo(e,n)}}}async function ya(e,t){return _r(t?.extensions,$o(e),dn(e,"project.json"))}function Ot(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 gn=I(()=>{Dr();H()});async function Fr(e,t={}){let{resolveElementPath:n,$media:r,formats:s}=t,o=[],i=new Set;async function u(a,c){let l,p;if(J(a)){let{readFileSync:v}=await import("node:fs"),{resolve:A}=await import("node:path");if(p=c?A(c,a):A(a),i.has(p))return;if(i.add(p),p.endsWith(".json"))l=Et(v(p,"utf8"),p);else{let{extname:k}=await import("node:path"),S=k(p).toLowerCase(),h=s?.byExtension(S,"parse");if(!h){await Promise.resolve().then(() => gn());throw Ot(p,S)}l=await h.parseDocument(v(p,"utf8"))}}else{if(l=a,p=null,l.tagName&&i.has(l.tagName))return;if(l.tagName)i.add(l.tagName)}let{tagName:g}=l;if(!g||!g.includes("-"))throw Error(`compileElement: tagName "${g}" must contain a hyphen`);let{dirname:d}=await import("node:path"),x=p?d(p):null,f=[];if(Array.isArray(l.$elements))for(let v of l.$elements){let A=P(v)?v.$ref:v;if(!J(A))continue;if(x)await u(A,x);let k=n?n(A,x):A.replace(/\.json$/,".js");f.push(k)}let m=Jt(g);if(r)l.$media={...r,...l.$media};let{rewriteSrc:y}=t,w=Qe(l,m,f,y?(v)=>y(v,x):void 0,lt(l,t.defaults),t.serverBaseUrl),O=p?p.replace(/\.json$/,".js"):`${g}.js`;o.push({content:w,path:O,tagName:g})}return await u(e,t.basePath??null),{files:o}}async function So(e,t={}){let{title:n="Jx App",reactivitySrc:r="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:s="https://esm.sh/lit-html@3.3.0"}=t,o=await Fr(e,t),i=o.files.at(-1);if(!i)throw Error("compileElementPage: no element modules were produced");let{basename:u}=await import("node:path"),a=u(i.path),c=`<!DOCTYPE html>
|
|
27
|
+
<html lang="en">
|
|
28
|
+
<head>
|
|
29
|
+
<meta charset="utf-8">
|
|
30
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
31
|
+
<title>${j(n)}</title>
|
|
32
|
+
<script type="importmap">
|
|
33
|
+
{
|
|
34
|
+
"imports": {
|
|
35
|
+
"@vue/reactivity": "${r}",
|
|
36
|
+
"lit-html": "${s}"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
</head>
|
|
41
|
+
<body>
|
|
42
|
+
<${i.tagName}></${i.tagName}>
|
|
43
|
+
<script type="module" src="./${a}"></script>
|
|
44
|
+
</body>
|
|
45
|
+
</html>`;return{files:o.files,html:c}}function bo(e){if(!C(e)||Array.isArray(e))return JSON.stringify(e);if("default"in e)return JSON.stringify(e.default);if($e(e))return;if(e.$prototype==="LocalStorage"||e.$prototype==="SessionStorage")return JSON.stringify(e.default??null);if(e.$prototype==="Request")return"null";if(le(e))return"null";return JSON.stringify(e)}function Jo(e){let t=new Set,n=new Set,r=(o)=>{if(o.startsWith("#/state/"))t.add(o.slice(8).split("/")[0])},s=(o)=>{if(J(o)){for(let u of o.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*\(/g))t.add(u[1]);return}if(!C(o)||n.has(o))return;if(n.add(o),Array.isArray(o)){for(let u of o)s(u);return}let i=o;if(i.operator==="call"&&P(i.target))r(i.target.$ref);for(let[u,a]of Object.entries(i)){if(u.startsWith("on")&&u!=="observedAttributes"&&P(a))r(a.$ref);s(a)}};return s(e.children),s(e.state),t}function Qe(e,t,n,r,s=null,o="/_jx/server"){let i=["// Generated by @jxsuite/compiler — do not edit manually"];if(e.$id)i.push(`// Source: ${e.$id}`);for(let S of n)i.push(`import '${S}';`);let u=new Map,a=new Map,c=e.state??{},l=Jo(e);for(let[S,h]of Object.entries(c))if(G(h)&&h.$src){let b=h.$src;if(h.$lazy===!0){if(!l.has(S)&&!Mr.has(S))throw Error(`"${S}" 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 ${S}() from a handler instead of binding its value.`);let F=a.get(b);if(!F)F=[],a.set(b,F);F.push({binding:S,exportName:nn(S,h)});continue}let E=u.get(b);if(!E)E=[],u.set(b,E);E.push(ft(S,h))}for(let[S,h]of u){let b=r?r(S):S;i.push(`import { ${h.join(", ")} } from '${b}';`)}let p=Object.entries(c).flatMap(([S,h])=>ye(h)&&h.$prototype==="Request"?[[S,h]]:[]),g=Object.entries(c).flatMap(([S,h])=>le(h)?[[S,h]]:[]);if(i.push("import { reactive, computed, effect, stop } from '@vue/reactivity';","import { render, html, nothing } from 'lit-html';",St()),g.length>0)i.push(bt());let d=s===null&&Pe(e.children);if(d)i.push(fr());let x=0;for(let[S,h]of a){let b=r?r(S):S,E=`_jxLazy${x}`;x+=1,i.push(`let ${E};`,`const ${E}Load = () => (${E} ??= import('${b}'));`,...h.map(({binding:F,exportName:W})=>`const ${F} = (...args) => ${E}Load().then((m) => m.${W}(...args));`))}i.push("",`class ${t} extends HTMLElement {`," #effects = [];",...s===null?[]:[" #root = null;"],""," constructor() {"," super();");let f=[],m=[],y=[],w=[],O=[];for(let[S,h]of Object.entries(c))if(X(h))if(Ee(h))w.push([S,h]);else if(me(h.$expression.operator))y.push([S,h]);else m.push([S,h]);else if(G(h))if(h.$src&&!J(h.body))if(l.has(S)||Mr.has(S))y.push([S,h]);else m.push([S,h]);else if(J(h.body)&&we(h.body))m.push([S,h]);else y.push([S,h]);else if(J(h)&&h.includes("${"))O.push([S,h]);else{let b=bo(h);if(b!==void 0)f.push([S,b])}i.push(" this.state = reactive({");for(let[S,h]of f)i.push(` ${fe(S)}: ${h},`);i.push(" });");for(let[S,h]of y)if(i.push(""),X(h)){let b=q(h.$expression,{eventParam:"e",statePrefix:"s"});i.push(` ${R("this.state",B(S))} = (s, e) => { ${b}; };`)}else if(xe(h)){let b=ne(h.body,{dispatchTarget:"this",eventParam:"e",indent:" ",statePrefix:"this.state"});i.push(` ${R("this.state",B(S))} = (s, e) => {`,b," };")}else{let b=h.parameters?ce(h.parameters):h.arguments??["state"],E=b.join(", "),F=J(h.body)?h.body:"";if(b[0]==="state")if(h.$src)i.push(` ${R("this.state",B(S))} = (${E}) => ${S}(${E});`);else i.push(` ${R("this.state",B(S))} = (${E}) => {`,` ${F}`," };");else{let W=b.map((re)=>re==="state"?"state":"e").join(", ");if(h.$src)i.push(` ${R("this.state",B(S))} = (state, e) => ${S}(${W});`);else i.push(` ${R("this.state",B(S))} = (state, e) => {`,` const _fn = (${E}) => {`,` ${F}`," };",` return _fn(${W});`," };")}}for(let[S,h]of w){i.push("");let b=q(h.$expression,{eventParam:"e",statePrefix:"this.state"});i.push(` ${R("this.state",B(S))} = ${Ge(h,b)};`)}for(let[S,h]of O)i.push("",` ${R("this.state",B(S))} = computed(() => ${yt(h.replaceAll("state.","this.state."))});`);for(let[S,h]of m)if(i.push(""),X(h)){let b=q(h.$expression,{eventParam:"e",statePrefix:"this.state"});i.push(` ${R("this.state",B(S))} = computed(() => ${b});`)}else if(h.$src)i.push(` ${R("this.state",B(S))} = computed(() => ${S}(this.state));`);else{i.push(` ${R("this.state",B(S))} = computed(() => {`);let b=(J(h.body)?h.body:"").replaceAll("state.","this.state.");i.push(` ${b}`," });")}i.push(" }","");let v=[];if(Array.isArray(e.children)){let S={n:0};for(let h of e.children)Te(h,v,e.$media??{},"",S,e.tagName)}let A=Wr(),k=!Array.isArray(e.children)&&e.textContent!==void 0?` ${Rt(e.textContent)}`:jt(e.children,e.style," ",!1,!1,A);i.push(" template() {"," const s = this.state;",...A.decls," return html`",k," `;"," }","",...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[S,h]of p)i.push(mt(S,h,{collect:"this.#effects",indent:" ",statePrefix:"this.state"}));for(let[S,h]of g)i.push(dt(S,h,{collect:"this.#effects",indent:" ",serverBaseUrl:o,statePrefix:"this.state"}));if(C(e.style)){let S=[];for(let[h,b]of Object.entries(e.style)){if(h.startsWith(":")||h.startsWith(".")||h.startsWith("&")||h.startsWith("[")||h.startsWith("@"))continue;if(J(b)&&b.includes("${"))S.push([z(h),b])}if(S.length>0){i.push(" this.#effects.push(effect(() => {");for(let[h,b]of S){let E=b.replaceAll(/\$\{([^}]+)\}/g,(F,W)=>`\${${W.replaceAll("state.","this.state.")}}`);i.push(` this.style['${h}'] = \`${E}\`;`)}i.push(" }));")}}if(d)i.push(` const _slotted = ${sn}(this);`);if(i.push(" if (this.hasAttribute('data-jx-prerendered')) {"," this.removeAttribute('data-jx-prerendered');"," }"),s===null)i.push(" this.replaceChildren();"," this.#effects.push(effect(() => render(this.template(), this)));");else i.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)i.push(` ${on}(this, _slotted);`);return i.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});`,""),i.join(`
|
|
46
|
+
`)}function Wr(){return{byText:new Map,decls:[]}}function Vr(e,t){let n=e.byText.get(t);if(n)return n;let r=`_c${e.decls.length}`;e.decls.push(` const ${r} = html\`
|
|
47
|
+
${t}
|
|
48
|
+
\`;`);let s=`\${${r}}`;return e.byText.set(t,s),s}function jt(e,t,n,r=!1,s=!1,o=null,i=!1){if(!e)return"";let u=i?De:"";if(V(e))return`${Lr(e,n)}${u}`;if(!Array.isArray(e))return"";return e.map((a)=>{if(V(a))return`${Lr(a,n)}${u}`;let c=xn(a,r?"":n,r,s,o);return J(a)&&a.includes("${")||C(a)&&oe(a.tagName)?`${c}${u}`:c}).join(r?"":`
|
|
49
|
+
`)}function xn(e,t,n=!1,r=!1,s=null,o=null){if(J(e)){if(e.includes("${"))return`${t}${Rt(e)}`;return`${t}${j(e)}`}if(ee(e)||K(e))return`${t}${j(String(e))}`;if(!C(e))return"";if(oe(e.tagName)){let f=e.tagName.$expression,m=de(f.target,{eventParam:"e",statePrefix:"s"}),y=f.operator==="?:"?[[!0,f.value],[!1,f.initial]]:[...Object.entries(f.cases),["__default__",f.default]],w=y.map(([,h])=>h),O=w.map((h)=>n||be.has(h)),v=null;if(s&&O.every((h)=>h===O[0])){let h=Ir(e,`${t} `,O[0]===!0,r,s,w.some((b)=>b.includes("-")));if(h.trim()!=="")v=Vr(s,h)}let A=y.map(([h,b])=>{let E={...e,tagName:b};return[h,xn(E,`${t} `,n,r,s,v)]});if(f.operator==="?:"){let[,h]=A[0],[,b]=A[1];return`${t}\${${m}
|
|
50
|
+
? html\`
|
|
51
|
+
${h}
|
|
52
|
+
\`
|
|
53
|
+
: html\`
|
|
54
|
+
${b}
|
|
55
|
+
\`}`}let k=A.flatMap(([h,b])=>h==="__default__"?[]:[` ${JSON.stringify(h)}: html\`
|
|
56
|
+
${b}
|
|
57
|
+
\``]),[,S]=A.at(-1);return`${t}\${{
|
|
58
|
+
${k.join(`,
|
|
59
|
+
`)}
|
|
60
|
+
}[String(${m})] ?? html\`
|
|
61
|
+
${S}
|
|
62
|
+
\`}`}let i=e.tagName??"div",u=n||be.has(i),a=[];if(e.attributes)for(let[f,m]of Object.entries(e.attributes))if(P(m))a.push(`${f}="\${${_e}('${f}', ${ae(m.$ref)}) ?? nothing}"`);else if(J(m)&&Eo(m))a.push(`${f}="\${${_e}('${f}', ${Q(m).slice(2,-1)}) ?? nothing}"`);else if(J(m)&&m.includes("${"))a.push(`${f}="${Q(m)}"`);else if(K(m)){let y=Ce(f,m);if(y!==null)a.push(y===""?f:`${f}="${y}"`)}else a.push(`${f}="${m}"`);if(e.id)a.push(`id="${Q(String(e.id))}"`);if(e.className)a.push(`class="${Q(String(e.className))}"`);for(let[f,m]of Object.entries(e)){if(ge.has(f)||f.startsWith("$")||f.startsWith("on")||f==="tagName"||f==="id"||f==="className"||f==="style"||f==="children"||f==="textContent"||f==="innerHTML"||f==="attributes")continue;if(At(m))a.push(`.${f}="\${${ae(m.$ref)}}"`);else if(J(m)&&m.includes("${"))a.push(`.${f}="${Q(m)}"`);else a.push(`.${f}="\${${JSON.stringify(m)}}"`)}if(e.$props)for(let[f,m]of Object.entries(e.$props))if(At(m))a.push(`.${f}="\${${ae(m.$ref)}}"`);else if(J(m)&&m.includes("${"))a.push(`.${f}="${Q(m)}"`);else a.push(`.${f}="\${${JSON.stringify(m)}}"`);let c=r?"s.$map = $map; ":"";for(let[f,m]of Object.entries(e)){if(!f.startsWith("on")||f==="observedAttributes")continue;let y=f.slice(2).toLowerCase();if(At(m))a.push(c?`@${y}="\${(e) => { ${c}${ae(m.$ref)}(s, e); }}"`:`@${y}="\${(e) => ${ae(m.$ref)}(s, e)}"`);else if(C(m)&&"$expression"in m){let w=q(m.$expression,{eventParam:"e",statePrefix:"s"});a.push(`@${y}="\${(e) => { ${c}${w}; }}"`)}else if(G(m))a.push(`@${y}="\${(e) => { ${c}${wo(m)} }}"`)}let l=Br(e.style);if(l)a.push(`style="${l}"`);let p=a.length>0?`
|
|
63
|
+
${t} ${a.join(`
|
|
64
|
+
${t} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(i))return`${t}<${i}${p}
|
|
65
|
+
${t}>`;let d=o??Ir(e,t,u,r,s,i.includes("-")),x=i==="slot"?De:"";return u?`${x}<${i}${p}>${d}${x}</${i}>`:`${t}${x}<${i}${p}
|
|
66
|
+
${t}>${d}${x}</${i}>`}function Ir(e,t,n,r,s,o=!1){if(e.$switch){let i=P(e.$switch)?e.$switch.$ref:e.$switch,u=ae(i),a=[];for(let[g,d]of Object.entries(e.cases??{})){if(!d||P(d))continue;a.push([g,xn(d,`${t} `,!1,r,s)])}let c=a.map(([,g])=>g),l=new Set(c.filter((g,d)=>c.indexOf(g)!==d&&g.trim()!==""));return`\${{
|
|
67
|
+
${a.map(([g,d])=>{let x=s&&l.has(d)?Vr(s,d):d;return` ${JSON.stringify(g)}: html\`
|
|
68
|
+
${x}
|
|
69
|
+
\``}).join(`,
|
|
70
|
+
`)}
|
|
71
|
+
}[${u}]}`}if(e.textContent!==void 0){let i=Rt(e.textContent),u=P(e.textContent)||J(e.textContent)&&e.textContent.includes("${");return o&&u?`${i}${De}`:i}if(e.innerHTML!==void 0)return e.innerHTML;if(e.children)return n?jt(e.children,e.style,"",!0,r,s,o):`
|
|
72
|
+
${jt(e.children,e.style,`${t} `,!1,r,s,o)}
|
|
73
|
+
${t}`;return""}function Lr(e,t){let n=P(e.items)?ae(e.items.$ref):"ITEMS",r=e.map;if(!r)return"";let s=r.tagName??"div",o=[];if(r.attributes)for(let[d,x]of Object.entries(r.attributes))if(P(x))o.push(`${d}="\${${hn(x.$ref)}}"`);else if(J(x)&&x.includes("${"))o.push(`${d}="${Q(x)}"`);else o.push(`${d}="${x}"`);if(r.id)o.push(`id="${Q(String(r.id))}"`);if(r.className)o.push(`class="${Q(String(r.className))}"`);for(let[d,x]of Object.entries(r)){if(ge.has(d)||d.startsWith("$")||d.startsWith("on")||d==="tagName"||d==="id"||d==="className"||d==="style"||d==="children"||d==="textContent"||d==="innerHTML"||d==="attributes")continue;if(At(x))o.push(`.${d}="\${${hn(x.$ref)}}"`);else if(J(x)&&x.includes("${"))o.push(`.${d}="${Q(x)}"`);else o.push(`.${d}="\${${JSON.stringify(x)}}"`)}if(r.$props)for(let[d,x]of Object.entries(r.$props))if(P(x))o.push(`.${d}="\${${hn(x.$ref)}}"`);else if(J(x)&&x.includes("${"))o.push(`.${d}="${Q(x)}"`);else o.push(`.${d}="\${${JSON.stringify(x)}}"`);let i=Br(r.style);if(i)o.push(`style="${i}"`);for(let[d,x]of Object.entries(r)){if(!d.startsWith("on"))continue;let f=d.slice(2).toLowerCase();if(P(x))o.push(`@${f}="\${(e) => { s.$map = $map; ${ae(x.$ref)}(s, e); }}"`);else if(X(x)){let m=q(x.$expression,{eventParam:"e",statePrefix:"s"});o.push(`@${f}="\${(e) => { s.$map = $map; ${m}; }}"`)}}let u=o.length>0?`
|
|
74
|
+
${t} ${o.join(`
|
|
75
|
+
${t} `)}`:"",a=Wr(),c="";if(r.textContent!==void 0)c=Rt(r.textContent);else if(r.children)c=`
|
|
76
|
+
${jt(r.children,null,`${t} `,!1,!0,a)}
|
|
77
|
+
${t} `;let l=`html\`
|
|
78
|
+
${t} <${s}${u}
|
|
79
|
+
${t} >${c}</${s}>
|
|
80
|
+
${t}\``,p=(l.includes("$map")?"const $map = { item, index }; ":"")+a.decls.map((d)=>`${d.trim()} `).join(""),g=p?`(item, index) => { ${p}return ${l}; }`:`(item, index) => ${l}`;return`${t}\${${n}.map(${g})}`}function At(e){return P(e)&&e.$ref!==""}function ae(e){if(e.startsWith("#/state/"))return R("s",e.slice(8));if(e.startsWith("$map/"))return Hr(e.slice(5));if(e.startsWith("parent#/"))return R("s",e.slice(8));if(e.startsWith("window#/"))return R("window",e.slice(8));if(e.startsWith("document#/"))return R("document",e.slice(10));return R("s",e)}function Hr(e){let[t,...n]=pe(e);return R(t??"",n.map((r)=>B(r)).join("/"))}function hn(e){if(e.startsWith("$map/"))return Hr(e.slice(5));return ae(e)}function Q(e){return e.replaceAll("state.","s.")}function Eo(e){return e.startsWith("${")&&e.endsWith("}")&&!e.slice(2).includes("${")}function Rt(e){if(P(e))return`\${${ae(e.$ref)}}`;if(J(e)&&e.includes("${"))return Q(e);return String(e)}function wo(e){if(xe(e))return ne(e.body,{dispatchTarget:"e.currentTarget",eventParam:"e",statePrefix:"s"});let t=J(e.body)?e.body:"",n=e.parameters?ce(e.parameters):e.arguments??[];if(n.length>0){let r=n.map((s)=>s==="state"?"s":"e").join(", ");return`((${n.join(", ")}) => { ${t} })(${r});`}return t.replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function Br(e){if(!C(e))return"";let t=[];for(let[n,r]of Object.entries(e)){if(n.startsWith(":")||n.startsWith(".")||n.startsWith("&")||n.startsWith("[")||n.startsWith("@"))continue;if(J(r)&&r.includes("${")){let s=z(n);t.push(`${s}: ${Q(r)}`)}}return t.join("; ")}var Mr;var Nt=I(()=>{ze();Ie();H();pn();je();Mr=new Set(["onMount","onUnmount","onAdopted"])});function Ur(e,t){let{title:n="Jx App",reactivitySrc:r,litHtmlSrc:s}=t,o=ke(e,null,e.state??{},e.$media??{}),i=Me(e,e.$media??{},t.projectStyle??null),u=[],a=qr(e,!1,o,u),c=[],l="",p="";if(u.length>0){for(let x of u){let f=Qe(x.def,x.className,[],t.rewriteSrc);c.push({content:f,path:`_islands/${x.tagName}.js`,tagName:x.tagName})}l=`<script type="importmap">
|
|
81
|
+
{
|
|
82
|
+
"imports": {
|
|
83
|
+
"@vue/reactivity": "${r}",
|
|
84
|
+
"lit-html": "${s}"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
</script>`,p=c.map((x)=>`<script type="module" src="./${x.path}"></script>`).join(`
|
|
88
|
+
`)}let g=t.prePaintScheme!==!1&&Object.values(e.$media??{}).some((x)=>ue(String(x))!==null)?`<script>${$t()}</script>
|
|
89
|
+
`:"",d=`<!DOCTYPE html>
|
|
90
|
+
<html lang="en">
|
|
91
|
+
<head>
|
|
92
|
+
<meta charset="utf-8">
|
|
93
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
94
|
+
<title>${j(n)}</title>
|
|
95
|
+
${g}${l}
|
|
96
|
+
${i}
|
|
97
|
+
</head>
|
|
98
|
+
<body>
|
|
99
|
+
${a}
|
|
100
|
+
${p}
|
|
101
|
+
</body>
|
|
102
|
+
</html>`;return{files:c,html:d}}function qr(e,t,n,r){if(J(e))return j(e);if(ee(e)||K(e))return j(String(e));if(!C(e))return"";let s=ke(e,n.scope,e.state??n.scopeDefs,e.$media??n.media);if(t){let c=r.length,l=`jx-island-${c}`,p=`JxIsland${c}`,g={...e,tagName:l};return r.push({className:p,def:g,tagName:l}),`<${l}></${l}>`}let o=cn(e.tagName,s.scope),i=ve(e,s.scope);if(ln.has(o))return`<${o}${i}>`;let u=n.preformatted===!0||be.has(o),a=Co(e,{...s,preformatted:u},r);return`<${o}${i}>${a}</${o}>`}function Co(e,t,n){if(e.textContent!==void 0){let r=T(e.textContent,t.scope);return r==null?"":j(String(r))}if(e.innerHTML){let r=T(e.innerHTML,t.scope);return r==null?e.innerHTML:String(r)}if(Array.isArray(e.children))return e.children.map((r)=>qr(r,ir(r),t,n)).join(Xe(t.preformatted));return""}var Kr=I(()=>{Ie();Nt();H()});function bn(e,t){let{title:n="Jx App",reactivitySrc:r=gt,litHtmlSrc:s=ht,modulePath:o="app.js",serverBaseUrl:i="/_jx/server"}=t,u=ke(e,null,e.state??{},e.$media??{}),a=Me(e,e.$media??{},t.projectStyle??null),c={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},l=new Map,p=new Map,g=[],d=[],x=[],f=[],m=[],y=[],w=new Map,O=e.state??{};for(let[b,E]of Object.entries(O)){if(!C(E)||Array.isArray(E)){if(N(E))d.push([b,`() => ${yt(E)}`]);else g.push([b,E]);continue}if(X(E)){let F=E.$expression,W=q(F,{eventParam:"e",statePrefix:"state"});if(Ee(E))m.push(`state[${JSON.stringify(b)}] = ${Ge(E,W)};`);else if(me(F.operator))f.push([b,{args:["state","e"],body:W}]);else d.push([b,`() => ${W}`]);continue}if(G(E)){let F=E.parameters?ce(E.parameters):E.arguments,{body:W}=E;if(Array.isArray(W)){let re=ne(W,{eventParam:"e",statePrefix:"state"});if(E.parameters&&E.parameters.length>0)m.push(`state[${JSON.stringify(b)}] = ${Ge(E,`(() => {
|
|
103
|
+
${re}
|
|
104
|
+
})()`)};`);else f.push([b,{args:["state","e"],body:re}])}else if(E.$src){let re=w.get(E.$src);if(!re)re=new Set,w.set(E.$src,re);re.add(ft(b,E)),d.push([b,`() => { return ${b}(state); }`])}else if(J(W)&&we(W))d.push([b,`() => { ${W} }`]);else f.push([b,{args:F??["state"],body:W}]);continue}if($e(E))continue;if(vn(E)){g.push([b,E.default]);continue}if(ye(E)){if(E.$prototype==="LocalStorage"||E.$prototype==="SessionStorage"){let F=E.$prototype==="LocalStorage"?"localStorage":"sessionStorage",W=E.key??b,re=E.default??null;g.push([b,null]),m.push(Oo(b,F,W,re));continue}if(E.$prototype==="Request"){g.push([b,null]),m.push(mt(b,E));continue}if(E.$prototype==="Cookie"){g.push([b,null]),m.push(Ao(b,E.name??b,E.default??null));continue}}if(le(E)){g.push([b,null]),y.push(dt(b,E,{serverBaseUrl:i}));continue}g.push([b,E])}let v=zr(e,u,l,p,c);for(let[b,E]of l)if(!x.some(([F])=>F===b))x.push([b,E]);for(let[b,E]of p)if(!f.some(([F])=>F===b))f.push([b,E]);let A=vo(g,d,x,f,m,y,w,c,r,t.rewriteSrc),k=[` "@vue/reactivity": "${r}"`,` "lit-html": "${s}"`],S=t.prePaintScheme!==!1&&Object.values(e.$media??{}).some((b)=>ue(String(b))!==null)?`<script>${$t()}</script>
|
|
105
|
+
`:"",h=`<!DOCTYPE html>
|
|
106
|
+
<html lang="en">
|
|
107
|
+
<head>
|
|
108
|
+
<meta charset="utf-8">
|
|
109
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
110
|
+
<title>${j(n)}</title>
|
|
111
|
+
${S}<script type="importmap">
|
|
112
|
+
{
|
|
113
|
+
"imports": {
|
|
114
|
+
${k.join(`,
|
|
115
|
+
`)}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
</script>
|
|
119
|
+
${a}
|
|
120
|
+
<script type="module" src="./${o}"></script>
|
|
121
|
+
</head>
|
|
122
|
+
<body>
|
|
123
|
+
${v}
|
|
124
|
+
</body>
|
|
125
|
+
</html>`;return{files:[{content:A,path:o}],html:h}}function zr(e,t,n,r,s){if(J(e))return j(e);if(ee(e)||K(e))return j(String(e));if(!C(e))return"";let o=ke(e,t.scope,e.state??t.scopeDefs,e.$media??t.media);if(oe(e.tagName))throw Error(`A tag chosen at creation is not supported on a dynamic page yet (candidates: ${Oe(e.tagName).join(", ")}). Move the element into a component, or give it a literal tagName.`);let i=e.tagName??"div";o.preformatted=t.preformatted===!0||be.has(i);let u=[],a=!1;if(e.textContent!==void 0){let f=e.textContent;if(Y(f)){let m=Le(f.$ref);u.push(`:text-content="${m}"`),yn(n,m,f.$ref),a=!0}else if(N(f)){let m=`_t${s.t}`;s.t+=1,u.push(`:text-content="${m}"`),n.set(m,`() => \`${f}\``),a=!0}}for(let[f,m]of Object.entries(e)){if(!f.startsWith("on")||f==="observedAttributes")continue;let y=f.slice(2).toLowerCase();if(Y(m)){let w=Le(m.$ref);u.push(`@${y}="${w}"`),a=!0}else if(G(m)){let w=`_h${s.h}`;s.h+=1,u.push(`@${y}="${w}"`);let{body:O}=m;r.set(w,Array.isArray(O)?{args:["state","e"],body:ne(O,{eventParam:"e",statePrefix:"state"})}:{args:m.parameters?ce(m.parameters):m.arguments??["state","event"],body:O}),a=!0}else if(X(m)){let w=`_h${s.h}`;s.h+=1,u.push(`@${y}="${w}"`);let O=q(m.$expression,{eventParam:"e",statePrefix:"state"});r.set(w,{args:["state","e"],body:O}),a=!0}}if(C(e.style))for(let[f,m]of Object.entries(e.style)){if(f.startsWith(":")||f.startsWith(".")||f.startsWith("&")||f.startsWith("[")||f.startsWith("@"))continue;if(Gr(m))continue;if(N(m)){let y=`_s${s.s}`;s.s+=1,u.push(`:style.${z(f)}="${y}"`),n.set(y,`() => \`${m}\``),a=!0}}if(C(e.attributes)){for(let[f,m]of Object.entries(e.attributes))if(Y(m)){let y=Le(m.$ref);u.push(`:attr.${f}="${y}"`),yn(n,y,m.$ref),a=!0}else if(N(m)){let y=`_t${s.t}`;s.t+=1,u.push(`:attr.${f}="${y}"`),n.set(y,`() => \`${m}\``),a=!0}}for(let[f,m]of Object.entries(e)){if(ge.has(f)||f.startsWith("on")||f.startsWith("$")||f==="tagName"||f==="id"||f==="className"||f==="style"||f==="children"||f==="textContent"||f==="innerHTML"||f==="attributes")continue;if(Y(m)){let y=Le(m.$ref);u.push(`:${z(f)}="${y}"`),yn(n,y,m.$ref),a=!0}else if(N(m)){let y=`_t${s.t}`;s.t+=1,u.push(`:${z(f)}="${y}"`),n.set(y,`() => \`${m}\``),a=!0}}let c=ve(e,o.scope),l=a?" data-bind":"",p=u.length>0?` ${u.join(" ")}`:"",g="",d=e;if(d.$switch){s.needsLit=!0;let f=`_sw${s.sw}`;s.sw+=1;let m=Y(d.$switch)?Sn(d.$switch.$ref):`\`${String(d.$switch)}\``,y=d.cases??{},w=Object.entries(y).filter(([,v])=>v&&!Y(v)).map(([v,A])=>`${JSON.stringify(v)}: html\`${$n(A,o.preformatted)}\``);n.set(f,`() => ({${w.join(", ")}})[String(${m})] ?? html\`\``),u.push(`:render="${f}"`);let O=` ${u.join(" ")}`;return`<${i}${c} data-bind${O}></${i}>`}if(d.textContent!==void 0&&!a){let f=T(d.textContent,o.scope);g=f==null?"":j(String(f))}else if(d.textContent!==void 0&&a){let f=T(d.textContent,o.scope);g=f==null?"":j(String(f))}else if(d.innerHTML){let f=T(d.innerHTML,o.scope);g=f==null?d.innerHTML:String(f)}else if(V(d.children)){s.needsLit=!0;let f=`_list${s.l}`;s.l+=1;let m=d.children,y=Y(m.items)?Sn(m.items.$ref):JSON.stringify(m.items),w=Jn(m.map);n.set(f,`() => (${y} ?? []).map((item, index) => html\`${w}\`)`),u.push(`:render="${f}"`),a=!0;let O=" data-bind",v=` ${u.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(i))return`<${i}${c}${O}${v}>`;return`<${i}${c}${O}${v}></${i}>`}else if(Array.isArray(d.children)&&d.children.some((f)=>V(f))){s.needsLit=!0;let f=`_children${s.l}`;s.l+=1;let m=d.children.map((w)=>$n(w,o.preformatted)).join(Xe(o.preformatted," "));n.set(f,o.preformatted?`() => html\`${m}\``:`() => html\`
|
|
126
|
+
${m}
|
|
127
|
+
\``),u.push(`:render="${f}"`),a=!0;let y=` ${u.join(" ")}`;return`<${i}${c} data-bind${y}></${i}>`}else if(Array.isArray(d.children))g=d.children.map((f)=>zr(f,o,n,r,s)).join(Xe(o.preformatted));if(new Set(["input","br","hr","img","meta","link"]).has(i))return`<${i}${c}${l}${p}>`;return`<${i}${c}${l}${p}>${g}</${i}>`}function Jn(e,t=!1){if(!e)return"";if(oe(e.tagName))throw Error(`A tag chosen at creation is not supported inside a dynamic page's repeater yet (candidates: ${Oe(e.tagName).join(", ")}). Move the item into a component, or give it a literal tagName.`);let n=e.tagName??"div",r=t||be.has(n),s="";if(e.id)s+=` id="${e.id}"`;if(e.className)s+=` class="${Je(e.className)}"`;if(C(e.$props))for(let[a,c]of Object.entries(e.$props))if(Y(c))s+=` .${a}="\${${jo(c.$ref)}}"`;else if(N(c))s+=` .${a}="${Je(c)}"`;else s+=` .${a}="\${${JSON.stringify(c)}}"`;if(C(e.attributes))for(let[a,c]of Object.entries(e.attributes)){if(N(c)){s+=` ${a}="${Je(c)}"`;continue}if(K(c)){let l=Ce(a,c);if(l!==null)s+=l===""?` ${a}`:` ${a}="${j(l)}"`;continue}s+=` ${a}="${j(String(c))}"`}if(C(e.style)){let a=[];for(let[c,l]of Object.entries(e.style)){if(c.startsWith(":")||c.startsWith(".")||c.startsWith("&")||c.startsWith("[")||c.startsWith("@"))continue;if(Gr(l))continue;let p=z(c);if(N(String(l)))a.push(`${p}: ${Je(String(l))}`);else a.push(`${p}: ${l}`)}if(a.length>0)s+=` style="${a.join("; ")}"`}for(let[a,c]of Object.entries(e)){if(!a.startsWith("on")||a==="observedAttributes")continue;let l=a.slice(2).toLowerCase();if(Y(c)){let p=Le(c.$ref);s+=` @${l}=\${(e) => { state.$map = { item, index }; on.${p}(e); }}`}else if(xe(c)){let p=ne(c.body,{eventParam:"e",statePrefix:"state"});s+=` @${l}=\${(e) => { state.$map = { item, index }; ${p} }}`}else if(G(c)){let p=Je(c.body);s+=` @${l}=\${(e) => { ${p} }}`}else if(C(c)&&"$expression"in c){let p=q(c.$expression,{eventParam:"e",statePrefix:"state"});s+=` @${l}=\${(e) => { state.$map = { item, index }; ${p}; }}`}}if(e.contentEditable)s+=` contenteditable="${e.contentEditable}"`;let o=n.includes("-")?De:"",i="";if(e.textContent!==void 0){let a=String(e.textContent);if(N(a))i=`${Je(a)}${o}`;else if(Y(e.textContent))i=`\${state.${Le(e.textContent.$ref)}}${o}`;else i=j(a)}else if(e.innerHTML)i=Je(String(e.innerHTML));else if(V(e.children))i=`
|
|
128
|
+
${Yr(e.children)}${o}
|
|
129
|
+
`;else if(Array.isArray(e.children)){let a=e.children.map((c)=>{let l=$n(c,r);return V(c)||J(c)&&N(c)?`${l}${o}`:l});i=r?a.join(""):`
|
|
130
|
+
${a.join(`
|
|
131
|
+
`)}
|
|
132
|
+
`}if(new Set(["input","br","hr","img","meta","link"]).has(n))return`<${n}${s}>`;return`<${n}${s}>${i}</${n}>`}function $n(e,t=!1){if(J(e))return N(e)?Je(e):j(e);if(ee(e)||K(e))return j(String(e));if(V(e))return Yr(e);return Jn(e,t)}function Yr(e){let{items:t}=e,n=Y(t)?Sn(t.$ref):JSON.stringify(t??[]),r=Jn(e.map);return`\${(${n} ?? []).map((item, index) => html\`${r}\`)}`}function Je(e){return e.replaceAll("$map.","")}function vo(e,t,n,r,s,o,i,u,a,c){let l=[],{needsLit:p}=u,g=t.length>0;l.push("// Generated by @jxsuite/compiler — do not edit manually");let d=["reactive","effect"];if(g)d.push("computed");if(l.push(`import { ${d.join(", ")} } from '@vue/reactivity';`),p)l.push("import { html, render } from 'lit-html';");for(let[x,f]of i){let m=c?c(x):x;l.push(`import { ${[...f].join(", ")} } from '${m}';`)}if(l.push("",St()),o.length>0)l.push("",bt());l.push("","const state = reactive({");for(let[x,f]of e)l.push(` ${fe(x)}: ${JSON.stringify(f)},`);if(l.push("});",""),s.length>0){for(let x of s)l.push(x);l.push("")}if(t.length>0){for(let[x,f]of t)l.push(`${R("state",B(x))} = computed(${f});`);l.push("")}if(o.length>0){for(let x of o)l.push(x);l.push("")}if(n.length>0){l.push("const bind = {");for(let[x,f]of n)l.push(` ${fe(x)}: ${f},`);l.push("};")}else l.push("const bind = {};");if(l.push(""),r.length>0){l.push("const on = {");for(let[x,f]of r){let m=f.args??["state"],y=m.map((w)=>w==="state"?"state":"e").join(", ");l.push(` ${fe(x)}: (e) => { const fn = (${m.join(", ")}) => { ${f.body} }; fn(${y}); },`)}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;"),p)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 = ${_e}(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(`
|
|
133
|
+
`)}function Oo(e,t,n,r){return[`// ${e}: ${t} (key: "${n}")`,"try {",` const _s = ${t}.getItem(${JSON.stringify(n)});`,` state.${e} = _s !== null ? JSON.parse(_s) : ${JSON.stringify(r)};`,`} catch { state.${e} = ${JSON.stringify(r)}; }`,"effect(() => {",` const v = state.${e};`," try {",` if (v === null) ${t}.removeItem(${JSON.stringify(n)});`,` else ${t}.setItem(${JSON.stringify(n)}, JSON.stringify(v));`," } catch {}","});"].join(`
|
|
134
|
+
`)}function Ao(e,t,n){return[`// ${e}: Cookie (name: "${t}")`,"{",` const _m = document.cookie.match(new RegExp("(?:^|; )${t}=([^;]*)"));`,` try { state.${e} = _m ? JSON.parse(decodeURIComponent(_m[1])) : ${JSON.stringify(n)}; }`,` catch { state.${e} = _m ? _m[1] : ${JSON.stringify(n)}; }`,"}"].join(`
|
|
135
|
+
`)}function Gr(e){return e===null||C(e)}function jo(e){if(e.startsWith("$map/")){let[t,...n]=pe(e.slice(5));return R(t??"",n.map((r)=>B(r)).join("/"))}if(e.startsWith("#/state/"))return R("state",e.slice(8));return R("state",e)}function Sn(e){return _n("state",e.startsWith("#/state/")?e.slice(8):e)}function Le(e){return Dn(e.startsWith("#/state/")?e.slice(8):e)}function yn(e,t,n){if(e.has(t))return;e.set(t,`() => ${R("state",n.startsWith("#/state/")?n.slice(8):n)}`)}var En=I(()=>{ze();Ie();H();je()});function Ro(e,t){if(t.routing==="prefix-except-default"&&e===t.defaultLocale)return"/";return`/${e.toLowerCase()}/`}function Xr(e){if(e===null||e.locales.length<2)return"";let t=JSON.stringify(e.locales),n=JSON.stringify(e.defaultLocale),r=JSON.stringify(Object.fromEntries(e.locales.map((s)=>[s,Ro(s,e)])));return`
|
|
51
136
|
// ─── Locale negotiation (RFC 4647 Lookup over Accept-Language) ───────────────
|
|
52
137
|
const JX_LOCALES = ${t}
|
|
53
138
|
const JX_DEFAULT_LOCALE = ${n}
|
|
@@ -116,175 +201,51 @@ app.use('/', async (c, next) => {
|
|
|
116
201
|
res.headers.set('Content-Language', locale)
|
|
117
202
|
c.res = res
|
|
118
203
|
})
|
|
119
|
-
`}
|
|
120
|
-
`),
|
|
121
|
-
`)
|
|
122
|
-
// Deploy as a Cloudflare Worker, Node server, or Bun process.
|
|
123
|
-
// Requires: npm install hono
|
|
124
|
-
|
|
125
|
-
import { Hono } from 'hono'
|
|
126
|
-
${s}
|
|
127
|
-
|
|
128
|
-
const app = new Hono()
|
|
129
|
-
${o}
|
|
130
|
-
|
|
131
|
-
export default app
|
|
132
|
-
`}function td(e,t={}){let{adapter:n=null,mounts:r=[],connectors:i=[],i18n:s=null,base:o=""}=t,a=Ts(o,t.baseUrl??"/_jx/server");if(e.length===0&&r.length===0&&!n)return null;let c=e.map(({exportName:m,src:h})=>`import { ${m} } from '${h}'`).join(`
|
|
133
|
-
`),l=nd(r,i),u=e.map(({exportName:m})=>Ga(m,a)).join(`
|
|
134
|
-
`),f=n==="cloudflare-workers"||n==="cloudflare-pages"?`
|
|
204
|
+
`}function No(e,t="/_jx/server"){return Yn(e,t)}function Po(e,t={}){let{adapter:n=null,mounts:r=[],connectors:s=[],i18n:o=null,base:i=""}=t,u=No(i,t.baseUrl);if(e.length===0&&r.length===0&&!n)return null;let a=e.map(({exportName:d,src:x})=>`import { ${d} } from '${x}'`).join(`
|
|
205
|
+
`),c=To(r,s),l=e.map(({exportName:d})=>ko(d,u)).join(`
|
|
206
|
+
`),p=n==="cloudflare-workers"||n==="cloudflare-pages"?`
|
|
135
207
|
app.all('*', (c) => c.env.ASSETS.fetch(c.req.raw))
|
|
136
208
|
`:`
|
|
137
|
-
`,
|
|
209
|
+
`,g=Xr(o);return`// Generated by @jxsuite/compiler — do not edit manually
|
|
138
210
|
import { Hono } from 'hono'
|
|
139
|
-
${
|
|
211
|
+
${a}${c.imports}
|
|
140
212
|
|
|
141
213
|
const app = new Hono()
|
|
142
|
-
${
|
|
143
|
-
${
|
|
214
|
+
${g}${c.routes}${l}
|
|
215
|
+
${p}
|
|
144
216
|
export default app
|
|
145
|
-
`}function
|
|
217
|
+
`}function To(e,t){if(e.length===0)return{imports:"",routes:""};let n=e.toSorted((o,i)=>o.order-i.order),r=[];for(let o of n)r.push(`import { ${o.className} } from '${o.module}'`);for(let o of t)r.push(`import { ${o.className} } from '${o.module}'`);let s=["// Extension server mounts (specs/extensions.md §11): one shared ctx, mounted in order.","const jxCtx = {}",`const jxConnectors = { ${t.map((o)=>`${JSON.stringify(o.provider)}: ${o.className}`).join(", ")} }`];for(let[o,i]of n.entries()){let u=JSON.stringify(i.options);s.push(`const jxMount${o} = await ${i.className}.mount({ ...${u}, connectors: jxConnectors }, jxCtx)`,`app.all('${i.basePath}/*', (c) => jxMount${o}(c.req.raw, c.env))`,`app.all('${i.basePath}', (c) => jxMount${o}(c.req.raw, c.env))`)}return{imports:`
|
|
146
218
|
${r.join(`
|
|
147
|
-
`)}`,routes:`${
|
|
219
|
+
`)}`,routes:`${s.join(`
|
|
148
220
|
`)}
|
|
149
|
-
`}}function
|
|
221
|
+
`}}function ko(e,t){return`
|
|
150
222
|
app.post('${t}/${e}', async (c) => {
|
|
151
223
|
const args = await c.req.json().catch(() => ({}))
|
|
152
224
|
try {
|
|
153
|
-
return c.json(await ${e}(args, c.env))
|
|
225
|
+
return c.json((await ${e}(args, c.env)) ?? null)
|
|
154
226
|
} catch (e) {
|
|
155
227
|
return c.json({ ok: false, error: e?.message ?? 'Server error' }, 500)
|
|
156
228
|
}
|
|
157
|
-
})`}var
|
|
158
|
-
|
|
159
|
-
`],["r","\r"],["t","\t"]])});function ad(e){return e instanceof Error?e.message:String(e)}function tc(e){if(C(e))return ec.test(e)?e.normalize("NFC"):e;if(Array.isArray(e))return e.map((t)=>tc(t));if(Y(e))return nc(e);return e}function nc(e){let t={};for(let[n,r]of Object.entries(e))t[ec.test(n)?n.normalize("NFC"):n]=tc(r);return t}function Ui(e,t,n){let r;try{r=JSON.parse(e)}catch(s){throw Error(`Failed to parse ${n} at ${t}: ${ad(s)}`,{cause:s})}if(!Y(r))throw Error(`Invalid ${n} at ${t}: expected a JSON object`);let i=Xa(e);if(i.length>0){let s=i.map((o)=>Qa(o)).join("; ");throw Error(`Invalid ${n} at ${t}: ${s}`)}return nc(r)}function ir(e,t){return Ui(e,t,"Jx document")}function py(e,t){return Ui(e,t,"project config")}function dy(e,t){return Ui(e,t,"class definition")}var ec;var Vi=N(()=>{Q();Za();ec=/[^\p{ASCII}]/u});function oc(e){if(!C(e))return null;let[t,...n]=e.split(";"),r=(t??"").indexOf("/");if(r===-1)return null;let i=(t??"").slice(0,r).trim().toLowerCase(),s=(t??"").slice(r+1).trim().toLowerCase();if(!rc.test(i)||!rc.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),f=u!==null&&cd.has(u)?u:null,d=f===null?c:c.slice(f.length+1);if(d==="")return null;let m={};for(let h of n){let p=h.indexOf("=");if(p===-1)return null;let g=h.slice(0,p).trim().toLowerCase(),y=h.slice(p+1).trim();if(g==="")return null;if(y.startsWith('"')&&y.endsWith('"')&&y.length>=2)y=y.slice(1,-1);m[g]=y}return{parameters:m,subtype:d,suffix:a,tree:f,type:i}}function ac(e){if(!C(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(oc(e)===null)return`"${e}" is not a well-formed media type (RFC 6838 §4.2)`;return null}function cc(e){let t=oc(e);if(t===null)return null;let n=t.tree===null?"":`${t.tree}.`,r=t.suffix===null?"":`+${t.suffix}`;return`${t.type}/${n}${t.subtype}${r}`}var rc,cd,ic="text/markdown; variant=GFM",sc="application/yaml",gy;var lc=N(()=>{Q();rc=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}$/,cd=new Set(["vnd","prs","x"]);gy={".markdown":`${ic}; charset=utf-8`,".md":`${ic}; charset=utf-8`,".yaml":`${sc}; charset=utf-8`,".yml":`${sc}; charset=utf-8`}});function dc(e){if(e===null)throw TypeError("A class descriptor cannot be null");return Y(e)?e:{}}class sr{name;classPath;classDef;extensions;mediaType;mediaTypeEssence;documentKinds;exportTarget;remote;studio;project;server;connector;capabilities;#t;#e=null;constructor(e,t,n,r){this.name=e,this.classPath=t,this.classDef=n,this.#t=r;let{format:i}=n;this.extensions=(i?.extensions??[]).map((s)=>s.toLowerCase()),this.mediaType=i?.mediaType??null,this.mediaTypeEssence=cc(this.mediaType),this.documentKinds=i?.documentKinds??[],this.exportTarget=i?.exportTarget===!0,this.remote=i?.remote===!0,this.studio=n.$studio??null,this.project=n.project??null,this.server=n.server??null,this.connector=n.connector??null,this.capabilities=ud(n)}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.#n(await this.implementation())}#n(e){let t=this.classDef.title??this.name;return e[t]??e.default?.[t]??e.default}async call(e,...t){let n=this.capabilities[e];if(!n)throw Error(`Format class "${this.name}" does not declare a "${e}" capability`);let r=this.#n(await this.implementation()),i=r?.[n.identifier];if(!Ae(i)){let o=this.classDef.title??this.name;throw TypeError(`Format class "${this.name}": implementation export "${o}" has no static "${n.identifier}" method`)}return await i.call(r,...t)}async parseDocument(e,t){return await this.call("parse",e,t)}}class or{#t;constructor(e){this.#t=e;for(let t of e){if(t.mediaType===null)continue;let n=ac(t.mediaType);if(n!==null)throw Error(`Format "${t.name}" declares an invalid mediaType: ${n}`)}for(let t of fc){let n=new Map;for(let r of e){if(!r.capabilities[t])continue;for(let i of r.extensions){let s=n.get(i);if(s)throw Error(`Format conflict: "${s.name}" and "${r.name}" both claim "${i}" with the "${t}" capability`);n.set(i,r)}}}}get entries(){return this.#t}byExtension(e,t){let n=uc(e);return this.#t.find((r)=>r.extensions.includes(n)&&(!t||r.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 n of this.#t){if(e&&!n.documentKinds.includes(e))continue;for(let r of n.extensions)t.add(r)}return t.delete(".json"),[...t]}has(e){let t=uc(e);return this.#t.some((n)=>n.extensions.includes(t))}}function ud(e){let t={},n=e.$defs?.methods??{};for(let[r,i]of Object.entries(n)){let{role:s}=i;if(!pd(s))continue;let o={identifier:i.identifier??r,timing:i.timing??ld};if(C(i.discriminator))o.discriminator=i.discriminator;t[s]=o}return t}function pd(e){return e!==void 0&&fd.has(e)}function uc(e){let t=e.toLowerCase();return t.startsWith(".")?t:`.${t}`}var fc,pc,ld,fd;var Ki=N(()=>{Q();lc();fc=["parse","serialize","rewrite","discover","load"],pc=[...fc,"projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"];ld=["compiler","server"];fd=new Set(pc)});class mc{#t;#e;#n;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 n=new Map;for(let i of this.#e){if(!i.project)continue;let s=n.get(i.project.key);if(s)throw Error(`Extension conflict: "${s.name}" and "${i.name}" both claim the project section "${i.project.key}"`);n.set(i.project.key,i)}let r=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=r.get(s);if(o)throw Error(`Extension conflict: "${o.name}" and "${i.name}" both mount "${s}"`);r.set(s,i)}this.#n=new or(this.#e.filter((i)=>i.extensions.length>0))}get extensions(){return this.#t}get classes(){return this.#e}get formats(){return this.#n}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 hc(e,t,n){let r=[];for(let i of e??[])r.push(await dd(i,t,n));return new mc(r)}async function dd(e,t,n){let r;if(e.startsWith("./")||e.startsWith("../")){let c=t.resolvePath(n,e);r=t.resolvePath(`${c}/package.json`,`./${dn}`)}else try{r=t.resolvePath(n,`${e}/${dn}`)}catch(c){throw Error(`Extension "${e}" is not resolvable: it must export ${dn} (is the package installed, and does its exports map include it?): ${qi(c)}`,{cause:c})}let i;try{i=await t.loadJson(r)}catch(c){throw Error(`Extension "${e}": cannot read manifest ${r}: ${qi(c)}`,{cause:c})}if(!Y(i)||!C(i.name))throw Error(`Extension "${e}": ${dn} 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(r,l),f;try{f=await t.loadJson(u)}catch(d){throw Error(`Extension "${e}": cannot read class "${c}" at ${u}: ${qi(d)}`,{cause:d})}o.push(new sr(c,u,dc(f),t))}let a={};if(s.schemas?.project)a.project=t.resolvePath(r,s.schemas.project);if(s.schemas?.document)a.document=t.resolvePath(r,s.schemas.document);if(s.schemas?.fields)a.fields=t.resolvePath(r,s.schemas.fields);return{specifier:e,manifestPath:r,manifest:s,classes:o,schemas:a}}function qi(e){return e instanceof Error?e.message:String(e)}var dn="jx-extension.json";var gc=N(()=>{Ki();Q();Ki()});import{readFileSync as md}from"node:fs";import{dirname as hd,isAbsolute as gd,resolve as Yi,sep as ar}from"node:path";import{pathToFileURL as yd}from"node:url";import{createRequire as yc}from"node:module";async function xd(e){let t=[e],n=`${ar}src${ar}`,r=`${ar}dist${ar}`;if(e.includes(n)){let s=e.replace(n,r);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(yd(s).href)}catch(o){i=o}throw i instanceof Error?i:Error(String(i))}function Sd(e){return{importModule:(t)=>xd(t),loadJson:async(t)=>JSON.parse(md(t,"utf8")),resolvePath:(t,n)=>{if(n.startsWith("./")||n.startsWith("../"))return Yi(hd(t),n);if(gd(n))return n;let r=yc(Yi(e,"package.json"));try{return r.resolve(n)}catch{return yc(import.meta.url).resolve(n)}}}}async function Ry(e,t){return hc(t?.extensions,Sd(e),Yi(e,"project.json"))}function cr(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 Gi=N(()=>{gc();Q()});async function Ec(e,t={}){let{resolveElementPath:n,$media:r,formats:i}=t,s=[],o=new Set;async function a(c,l){let u,f;if(C(c)){let{readFileSync:w}=await import("node:fs"),{resolve:S}=await import("node:path");if(f=l?S(l,c):S(c),o.has(f))return;if(o.add(f),f.endsWith(".json"))u=ir(w(f,"utf8"),f);else{let{extname:b}=await import("node:path"),v=b(f).toLowerCase(),x=i?.byExtension(v,"parse");if(!x){await Promise.resolve().then(() => Gi());throw cr(f,v)}u=await x.parseDocument(w(f,"utf8"))}}else{if(u=c,f=null,u.tagName&&o.has(u.tagName))return;if(u.tagName)o.add(u.tagName)}let{tagName:d}=u;if(!d||!d.includes("-"))throw Error(`compileElement: tagName "${d}" must contain a hyphen`);let{dirname:m}=await import("node:path"),h=f?m(f):null,p=[];if(Array.isArray(u.$elements))for(let w of u.$elements){let S=H(w)?w.$ref:w;if(!C(S))continue;if(h)await a(S,h);let b=n?n(S,h):S.replace(/\.json$/,".js");p.push(b)}let g=Ln(d);if(r)u.$media={...r,...u.$media};let{rewriteSrc:y}=t,E=mn(u,g,p,y?(w)=>y(w,h):void 0,vn(u,t.defaults)),A=f?f.replace(/\.json$/,".js"):`${d}.js`;s.push({content:E,path:A,tagName:d})}return await a(e,t.basePath??null),{files:s}}async function $d(e,t={}){let{title:n="Jx App",reactivitySrc:r="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:i="https://esm.sh/lit-html@3.3.0"}=t,s=await Ec(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>
|
|
160
|
-
<html lang="en">
|
|
161
|
-
<head>
|
|
162
|
-
<meta charset="utf-8">
|
|
163
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
164
|
-
<title>${_(n)}</title>
|
|
165
|
-
<script type="importmap">
|
|
166
|
-
{
|
|
167
|
-
"imports": {
|
|
168
|
-
"@vue/reactivity": "${r}",
|
|
169
|
-
"lit-html": "${i}"
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
</script>
|
|
173
|
-
</head>
|
|
174
|
-
<body>
|
|
175
|
-
<${o.tagName}></${o.tagName}>
|
|
176
|
-
<script type="module" src="./${c}"></script>
|
|
177
|
-
</body>
|
|
178
|
-
</html>`;return{files:s.files,html:l}}function Ed(e){if(!O(e)||Array.isArray(e))return JSON.stringify(e);if("default"in e)return JSON.stringify(e.default);if(ze(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 bd(e){let t=new Set,n=new Set,r=(s)=>{if(s.startsWith("#/state/"))t.add(s.slice(8).split("/")[0])},i=(s)=>{if(C(s)){for(let a of s.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*\(/g))t.add(a[1]);return}if(!O(s)||n.has(s))return;if(n.add(s),Array.isArray(s)){for(let a of s)i(a);return}let o=s;if(o.operator==="call"&&H(o.target))r(o.target.$ref);for(let[a,c]of Object.entries(o)){if(a.startsWith("on")&&a!=="observedAttributes"&&H(c))r(c.$ref);i(c)}};return i(e.children),i(e.state),t}function mn(e,t,n,r,i=null){let s=["// Generated by @jxsuite/compiler — do not edit manually"];if(e.$id)s.push(`// Source: ${e.$id}`);for(let S of n)s.push(`import '${S}';`);let o=new Map,a=new Map,c=e.state??{},l=bd(e);for(let[S,b]of Object.entries(c))if(he(b)&&b.$src){let v=b.$src;if(b.$lazy===!0){if(!l.has(S)&&!xc.has(S))throw Error(`"${S}" 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 ${S}() from a handler instead of binding its value.`);let T=a.get(v);if(!T)T=[],a.set(v,T);T.push({binding:S,exportName:jr(S,b)});continue}let x=o.get(v);if(!x)x=[],o.set(v,x);x.push(Tn(S,b))}for(let[S,b]of o){let v=r?r(S):S;s.push(`import { ${b.join(", ")} } from '${v}';`)}let u=Object.entries(c).flatMap(([S,b])=>Ge(b)&&b.$prototype==="Request"?[[S,b]]:[]);s.push("import { reactive, computed, effect, stop } from '@vue/reactivity';","import { render, html, nothing } from 'lit-html';",kn());let f=i===null&&Et(e.children);if(f)s.push(Us());let d=0;for(let[S,b]of a){let v=r?r(S):S,x=`_jxLazy${d}`;d+=1,s.push(`let ${x};`,`const ${x}Load = () => (${x} ??= import('${v}'));`,...b.map(({binding:T,exportName:k})=>`const ${T} = (...args) => ${x}Load().then((m) => m.${k}(...args));`))}s.push("",`class ${t} extends HTMLElement {`," #effects = [];",...i===null?[]:[" #root = null;"],""," constructor() {"," super();");let m=[],h=[],p=[],g=[],y=[];for(let[S,b]of Object.entries(c))if(ge(b))if(it(b))g.push([S,b]);else if(De(b.$expression.operator))p.push([S,b]);else h.push([S,b]);else if(he(b))if(b.$src&&!C(b.body))if(l.has(S)||xc.has(S))p.push([S,b]);else h.push([S,b]);else if(C(b.body)&&st(b.body))h.push([S,b]);else p.push([S,b]);else if(C(b)&&b.includes("${"))y.push([S,b]);else{let v=Ed(b);if(v!==void 0)m.push([S,v])}s.push(" this.state = reactive({");for(let[S,b]of m)s.push(` ${yt(S)}: ${b},`);s.push(" });");for(let[S,b]of p)if(s.push(""),ge(b)){let v=ae(b.$expression,{eventParam:"e",statePrefix:"s"});s.push(` ${L("this.state",ie(S))} = (s, e) => { ${v}; };`)}else if(Ye(b)){let v=Ce(b.body,{dispatchTarget:"this",eventParam:"e",indent:" ",statePrefix:"this.state"});s.push(` ${L("this.state",ie(S))} = (s, e) => {`,v," };")}else{let v=b.parameters?je(b.parameters):b.arguments??["state"],x=v.join(", "),T=C(b.body)?b.body:"";if(v[0]==="state")if(b.$src)s.push(` ${L("this.state",ie(S))} = (${x}) => ${S}(${x});`);else s.push(` ${L("this.state",ie(S))} = (${x}) => {`,` ${T}`," };");else{let k=v.map((z)=>z==="state"?"state":"e").join(", ");if(b.$src)s.push(` ${L("this.state",ie(S))} = (state, e) => ${S}(${k});`);else s.push(` ${L("this.state",ie(S))} = (state, e) => {`,` const _fn = (${x}) => {`,` ${T}`," };",` return _fn(${k});`," };")}}for(let[S,b]of g){s.push("");let v=ae(b.$expression,{eventParam:"e",statePrefix:"this.state"});s.push(` ${L("this.state",ie(S))} = ${Qt(b,v)};`)}for(let[S,b]of y)s.push("",` ${L("this.state",ie(S))} = computed(() => ${_n(b.replaceAll("state.","this.state."))});`);for(let[S,b]of h)if(s.push(""),ge(b)){let v=ae(b.$expression,{eventParam:"e",statePrefix:"this.state"});s.push(` ${L("this.state",ie(S))} = computed(() => ${v});`)}else if(b.$src)s.push(` ${L("this.state",ie(S))} = computed(() => ${S}(this.state));`);else{s.push(` ${L("this.state",ie(S))} = computed(() => {`);let v=(C(b.body)?b.body:"").replaceAll("state.","this.state.");s.push(` ${v}`," });")}s.push(" }","");let E=[];if(Array.isArray(e.children)){let S={n:0};for(let b of e.children)bt(b,E,e.$media??{},"",S,e.tagName)}let A=bc(),w=!Array.isArray(e.children)&&e.textContent!==void 0?` ${fr(e.textContent)}`:ur(e.children,e.style," ",!1,!1,A);s.push(" template() {"," const s = this.state;",...A.decls," return html`",w," `;"," }","",...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[S,b]of u)s.push(Pn(S,b,{collect:"this.#effects",indent:" ",statePrefix:"this.state"}));if(O(e.style)){let S=[];for(let[b,v]of Object.entries(e.style)){if(b.startsWith(":")||b.startsWith(".")||b.startsWith("&")||b.startsWith("[")||b.startsWith("@"))continue;if(C(v)&&v.includes("${"))S.push([pe(b),v])}if(S.length>0){s.push(" this.#effects.push(effect(() => {");for(let[b,v]of S){let x=v.replaceAll(/\$\{([^}]+)\}/g,(T,k)=>`\${${k.replaceAll("state.","this.state.")}}`);s.push(` this.style['${b}'] = \`${x}\`;`)}s.push(" }));")}}if(f)s.push(` const _slotted = ${Dr}(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(f)s.push(` ${Fr}(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(`
|
|
179
|
-
`)}function bc(){return{byText:new Map,decls:[]}}function wc(e,t){let n=e.byText.get(t);if(n)return n;let r=`_c${e.decls.length}`;e.decls.push(` const ${r} = html\`
|
|
180
|
-
${t}
|
|
181
|
-
\`;`);let i=`\${${r}}`;return e.byText.set(t,i),i}function ur(e,t,n,r=!1,i=!1,s=null,o=!1){if(!e)return"";let a=o?At:"";if(X(e))return`${$c(e,n)}${a}`;if(!Array.isArray(e))return"";return e.map((c)=>{if(X(c))return`${$c(c,n)}${a}`;let l=Xi(c,r?"":n,r,i,s);return C(c)&&c.includes("${")||O(c)&&Je(c.tagName)?`${l}${a}`:l}).join(r?"":`
|
|
182
|
-
`)}function Xi(e,t,n=!1,r=!1,i=null,s=null){if(C(e)){if(e.includes("${"))return`${t}${fr(e)}`;return`${t}${_(e)}`}if(ve(e)||fe(e))return`${t}${_(String(e))}`;if(!O(e))return"";if(Je(e.tagName)){let p=e.tagName.$expression,g=ot(p.target,{eventParam:"e",statePrefix:"s"}),y=p.operator==="?:"?[[!0,p.value],[!1,p.initial]]:[...Object.entries(p.cases),["__default__",p.default]],E=y.map(([,x])=>x),A=E.map((x)=>n||Ze.has(x)),w=null;if(i&&A.every((x)=>x===A[0])){let x=Sc(e,`${t} `,A[0]===!0,r,i,E.some((T)=>T.includes("-")));if(x.trim()!=="")w=wc(i,x)}let S=y.map(([x,T])=>{let k={...e,tagName:T};return[x,Xi(k,`${t} `,n,r,i,w)]});if(p.operator==="?:"){let[,x]=S[0],[,T]=S[1];return`${t}\${${g}
|
|
183
|
-
? html\`
|
|
184
|
-
${x}
|
|
185
|
-
\`
|
|
186
|
-
: html\`
|
|
187
|
-
${T}
|
|
188
|
-
\`}`}let b=S.flatMap(([x,T])=>x==="__default__"?[]:[` ${JSON.stringify(x)}: html\`
|
|
189
|
-
${T}
|
|
190
|
-
\``]),[,v]=S.at(-1);return`${t}\${{
|
|
191
|
-
${b.join(`,
|
|
192
|
-
`)}
|
|
193
|
-
}[String(${g})] ?? html\`
|
|
194
|
-
${v}
|
|
195
|
-
\`}`}let o=e.tagName??"div",a=n||Ze.has(o),c=[];if(e.attributes)for(let[p,g]of Object.entries(e.attributes))if(H(g))c.push(`${p}="\${${vt}('${p}', ${Le(g.$ref)}) ?? nothing}"`);else if(C(g)&&wd(g))c.push(`${p}="\${${vt}('${p}', ${we(g).slice(2,-1)}) ?? nothing}"`);else if(C(g)&&g.includes("${"))c.push(`${p}="${we(g)}"`);else if(fe(g)){let y=at(p,g);if(y!==null)c.push(y===""?p:`${p}="${y}"`)}else c.push(`${p}="${g}"`);if(e.id)c.push(`id="${we(String(e.id))}"`);if(e.className)c.push(`class="${we(String(e.className))}"`);for(let[p,g]of Object.entries(e)){if(Be.has(p)||p.startsWith("$")||p.startsWith("on")||p==="tagName"||p==="id"||p==="className"||p==="style"||p==="children"||p==="textContent"||p==="innerHTML"||p==="attributes")continue;if(lr(g))c.push(`.${p}="\${${Le(g.$ref)}}"`);else if(C(g)&&g.includes("${"))c.push(`.${p}="${we(g)}"`);else c.push(`.${p}="\${${JSON.stringify(g)}}"`)}if(e.$props)for(let[p,g]of Object.entries(e.$props))if(lr(g))c.push(`.${p}="\${${Le(g.$ref)}}"`);else if(C(g)&&g.includes("${"))c.push(`.${p}="${we(g)}"`);else c.push(`.${p}="\${${JSON.stringify(g)}}"`);let l=r?"s.$map = $map; ":"";for(let[p,g]of Object.entries(e)){if(!p.startsWith("on")||p==="observedAttributes")continue;let y=p.slice(2).toLowerCase();if(lr(g))c.push(l?`@${y}="\${(e) => { ${l}${Le(g.$ref)}(s, e); }}"`:`@${y}="\${(e) => ${Le(g.$ref)}(s, e)}"`);else if(O(g)&&"$expression"in g){let E=ae(g.$expression,{eventParam:"e",statePrefix:"s"});c.push(`@${y}="\${(e) => { ${l}${E}; }}"`)}else if(he(g))c.push(`@${y}="\${(e) => { ${l}${vd(g)} }}"`)}let u=Ac(e.style);if(u)c.push(`style="${u}"`);let f=c.length>0?`
|
|
196
|
-
${t} ${c.join(`
|
|
197
|
-
${t} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(o))return`${t}<${o}${f}
|
|
198
|
-
${t}>`;let m=s??Sc(e,t,a,r,i,o.includes("-")),h=o==="slot"?At:"";return a?`${h}<${o}${f}>${m}${h}</${o}>`:`${t}${h}<${o}${f}
|
|
199
|
-
${t}>${m}${h}</${o}>`}function Sc(e,t,n,r,i,s=!1){if(e.$switch){let o=H(e.$switch)?e.$switch.$ref:e.$switch,a=Le(o),c=[];for(let[d,m]of Object.entries(e.cases??{})){if(!m||H(m))continue;c.push([d,Xi(m,`${t} `,!1,r,i)])}let l=c.map(([,d])=>d),u=new Set(l.filter((d,m)=>l.indexOf(d)!==m&&d.trim()!==""));return`\${{
|
|
200
|
-
${c.map(([d,m])=>{let h=i&&u.has(m)?wc(i,m):m;return` ${JSON.stringify(d)}: html\`
|
|
201
|
-
${h}
|
|
202
|
-
\``}).join(`,
|
|
203
|
-
`)}
|
|
204
|
-
}[${a}]}`}if(e.textContent!==void 0){let o=fr(e.textContent),a=H(e.textContent)||C(e.textContent)&&e.textContent.includes("${");return s&&a?`${o}${At}`:o}if(e.innerHTML!==void 0)return e.innerHTML;if(e.children)return n?ur(e.children,e.style,"",!0,r,i,s):`
|
|
205
|
-
${ur(e.children,e.style,`${t} `,!1,r,i,s)}
|
|
206
|
-
${t}`;return""}function $c(e,t){let n=H(e.items)?Le(e.items.$ref):"ITEMS",r=e.map;if(!r)return"";let i=r.tagName??"div",s=[];if(r.attributes)for(let[m,h]of Object.entries(r.attributes))if(H(h))s.push(`${m}="\${${zi(h.$ref)}}"`);else if(C(h)&&h.includes("${"))s.push(`${m}="${we(h)}"`);else s.push(`${m}="${h}"`);if(r.id)s.push(`id="${we(String(r.id))}"`);if(r.className)s.push(`class="${we(String(r.className))}"`);for(let[m,h]of Object.entries(r)){if(Be.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(lr(h))s.push(`.${m}="\${${zi(h.$ref)}}"`);else if(C(h)&&h.includes("${"))s.push(`.${m}="${we(h)}"`);else s.push(`.${m}="\${${JSON.stringify(h)}}"`)}if(r.$props)for(let[m,h]of Object.entries(r.$props))if(H(h))s.push(`.${m}="\${${zi(h.$ref)}}"`);else if(C(h)&&h.includes("${"))s.push(`.${m}="${we(h)}"`);else s.push(`.${m}="\${${JSON.stringify(h)}}"`);let o=Ac(r.style);if(o)s.push(`style="${o}"`);for(let[m,h]of Object.entries(r)){if(!m.startsWith("on"))continue;let p=m.slice(2).toLowerCase();if(H(h))s.push(`@${p}="\${(e) => { s.$map = $map; ${Le(h.$ref)}(s, e); }}"`);else if(ge(h)){let g=ae(h.$expression,{eventParam:"e",statePrefix:"s"});s.push(`@${p}="\${(e) => { s.$map = $map; ${g}; }}"`)}}let a=s.length>0?`
|
|
207
|
-
${t} ${s.join(`
|
|
208
|
-
${t} `)}`:"",c=bc(),l="";if(r.textContent!==void 0)l=fr(r.textContent);else if(r.children)l=`
|
|
209
|
-
${ur(r.children,null,`${t} `,!1,!0,c)}
|
|
210
|
-
${t} `;let u=`html\`
|
|
211
|
-
${t} <${i}${a}
|
|
212
|
-
${t} >${l}</${i}>
|
|
213
|
-
${t}\``,f=(u.includes("$map")?"const $map = { item, index }; ":"")+c.decls.map((m)=>`${m.trim()} `).join(""),d=f?`(item, index) => { ${f}return ${u}; }`:`(item, index) => ${u}`;return`${t}\${${n}.map(${d})}`}function lr(e){return H(e)&&e.$ref!==""}function Le(e){if(e.startsWith("#/state/"))return L("s",e.slice(8));if(e.startsWith("$map/"))return vc(e.slice(5));if(e.startsWith("parent#/"))return L("s",e.slice(8));if(e.startsWith("window#/"))return L("window",e.slice(8));if(e.startsWith("document#/"))return L("document",e.slice(10));return L("s",e)}function vc(e){let[t,...n]=Qe(e);return L(t??"",n.map((r)=>ie(r)).join("/"))}function zi(e){if(e.startsWith("$map/"))return vc(e.slice(5));return Le(e)}function we(e){return e.replaceAll("state.","s.")}function wd(e){return e.startsWith("${")&&e.endsWith("}")&&!e.slice(2).includes("${")}function fr(e){if(H(e))return`\${${Le(e.$ref)}}`;if(C(e)&&e.includes("${"))return we(e);return String(e)}function vd(e){if(Ye(e))return Ce(e.body,{dispatchTarget:"e.currentTarget",eventParam:"e",statePrefix:"s"});let t=C(e.body)?e.body:"",n=e.parameters?je(e.parameters):e.arguments??[];if(n.length>0){let r=n.map((i)=>i==="state"?"s":"e").join(", ");return`((${n.join(", ")}) => { ${t} })(${r});`}return t.replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function Ac(e){if(!O(e))return"";let t=[];for(let[n,r]of Object.entries(e)){if(n.startsWith(":")||n.startsWith(".")||n.startsWith("&")||n.startsWith("[")||n.startsWith("@"))continue;if(C(r)&&r.includes("${")){let i=pe(n);t.push(`${i}: ${we(r)}`)}}return t.join("; ")}var xc;var pr=N(()=>{zt();lt();Q();Vi();xt();xc=new Set(["onMount","onUnmount","onAdopted"])});function Cc(e,t){let{title:n="Jx App",reactivitySrc:r,litHtmlSrc:i}=t,s=wt(e,null,e.state??{},e.$media??{}),o=Ct(e,e.$media??{},t.projectStyle??null),a=[],c=Oc(e,!1,s,a),l=[],u="",f="";if(a.length>0){for(let h of a){let p=mn(h.def,h.className,[],t.rewriteSrc);l.push({content:p,path:`_islands/${h.tagName}.js`,tagName:h.tagName})}u=`<script type="importmap">
|
|
214
|
-
{
|
|
215
|
-
"imports": {
|
|
216
|
-
"@vue/reactivity": "${r}",
|
|
217
|
-
"lit-html": "${i}"
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
</script>`,f=l.map((h)=>`<script type="module" src="./${h.path}"></script>`).join(`
|
|
221
|
-
`)}let d=t.prePaintScheme!==!1&&Object.values(e.$media??{}).some((h)=>Me(String(h))!==null)?`<script>${Jn()}</script>
|
|
222
|
-
`:"",m=`<!DOCTYPE html>
|
|
223
|
-
<html lang="en">
|
|
224
|
-
<head>
|
|
225
|
-
<meta charset="utf-8">
|
|
226
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
227
|
-
<title>${_(n)}</title>
|
|
228
|
-
${d}${u}
|
|
229
|
-
${o}
|
|
230
|
-
</head>
|
|
231
|
-
<body>
|
|
232
|
-
${c}
|
|
233
|
-
${f}
|
|
234
|
-
</body>
|
|
235
|
-
</html>`;return{files:l,html:m}}function Oc(e,t,n,r){if(C(e))return _(e);if(ve(e)||fe(e))return _(String(e));if(!O(e))return"";let i=wt(e,n.scope,e.state??n.scopeDefs,e.$media??n.media);if(t){let l=r.length,u=`jx-island-${l}`,f=`JxIsland${l}`,d={...e,tagName:u};return r.push({className:f,def:d,tagName:u}),`<${u}></${u}>`}let s=Hr(e.tagName,i.scope),o=ct(e,i.scope);if(Wr.has(s))return`<${s}${o}>`;let a=n.preformatted===!0||Ze.has(s),c=Ad(e,{...i,preformatted:a},r);return`<${s}${o}>${c}</${s}>`}function Ad(e,t,n){if(e.textContent!==void 0){let r=W(e.textContent,t.scope);return r==null?"":_(String(r))}if(e.innerHTML){let r=W(e.innerHTML,t.scope);return r==null?e.innerHTML:String(r)}if(Array.isArray(e.children))return e.children.map((r)=>Oc(r,Ds(r),t,n)).join(Zt(t.preformatted));return""}var Tc=N(()=>{lt();pr();Q()});function es(e,t){let{title:n="Jx App",reactivitySrc:r=Nn,litHtmlSrc:i=Rn,modulePath:s="app.js"}=t,o=wt(e,null,e.state??{},e.$media??{}),a=Ct(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,f=[],d=[],m=[],h=[],p=[],g=new Map,y=e.state??{};for(let[v,x]of Object.entries(y)){if(!O(x)||Array.isArray(x)){if(D(x))d.push([v,`() => ${_n(x)}`]);else f.push([v,x]);continue}if(ge(x)){let T=x.$expression,k=ae(T,{eventParam:"e",statePrefix:"state"});if(it(x))p.push(`state[${JSON.stringify(v)}] = ${Qt(x,k)};`);else if(De(T.operator))h.push([v,{args:["state","e"],body:k}]);else d.push([v,`() => ${k}`]);continue}if(he(x)){let T=x.parameters?je(x.parameters):x.arguments,{body:k}=x;if(Array.isArray(k)){let z=Ce(k,{eventParam:"e",statePrefix:"state"});if(x.parameters&&x.parameters.length>0)p.push(`state[${JSON.stringify(v)}] = ${Qt(x,`(() => {
|
|
236
|
-
${z}
|
|
237
|
-
})()`)};`);else h.push([v,{args:["state","e"],body:z}])}else if(x.$src){let z=g.get(x.$src);if(!z)z=new Set,g.set(x.$src,z);z.add(Tn(v,x)),d.push([v,`() => { return ${v}(state); }`])}else if(C(k)&&st(k))d.push([v,`() => { ${k} }`]);else h.push([v,{args:T??["state"],body:k}]);continue}if(ze(x))continue;if(ss(x)){f.push([v,x.default]);continue}if(Ge(x)){if(x.$prototype==="LocalStorage"||x.$prototype==="SessionStorage"){let T=x.$prototype==="LocalStorage"?"localStorage":"sessionStorage",k=x.key??v,z=x.default??null;f.push([v,null]),p.push(Od(v,T,k,z));continue}if(x.$prototype==="Request"){f.push([v,null]),p.push(Pn(v,x));continue}if(x.$prototype==="Cookie"){f.push([v,null]),p.push(Td(v,x.name??v,x.default??null));continue}}f.push([v,x])}let E=Pc(e,o,l,u,c);for(let[v,x]of l)if(!m.some(([T])=>T===v))m.push([v,x]);for(let[v,x]of u)if(!h.some(([T])=>T===v))h.push([v,x]);let A=Cd(f,d,m,h,p,g,c,r,t.rewriteSrc),w=[` "@vue/reactivity": "${r}"`,` "lit-html": "${i}"`],S=t.prePaintScheme!==!1&&Object.values(e.$media??{}).some((v)=>Me(String(v))!==null)?`<script>${Jn()}</script>
|
|
238
|
-
`:"",b=`<!DOCTYPE html>
|
|
239
|
-
<html lang="en">
|
|
240
|
-
<head>
|
|
241
|
-
<meta charset="utf-8">
|
|
242
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
243
|
-
<title>${_(n)}</title>
|
|
244
|
-
${S}<script type="importmap">
|
|
245
|
-
{
|
|
246
|
-
"imports": {
|
|
247
|
-
${w.join(`,
|
|
248
|
-
`)}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
</script>
|
|
252
|
-
${a}
|
|
253
|
-
<script type="module" src="./${s}"></script>
|
|
254
|
-
</head>
|
|
255
|
-
<body>
|
|
256
|
-
${E}
|
|
257
|
-
</body>
|
|
258
|
-
</html>`;return{files:[{content:A,path:s}],html:b}}function Pc(e,t,n,r,i){if(C(e))return _(e);if(ve(e)||fe(e))return _(String(e));if(!O(e))return"";let s=wt(e,t.scope,e.state??t.scopeDefs,e.$media??t.media);if(Je(e.tagName))throw Error(`A tag chosen at creation is not supported on a dynamic page yet (candidates: ${ht(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||Ze.has(o);let a=[],c=!1;if(e.textContent!==void 0){let p=e.textContent;if(de(p)){let g=qe(p.$ref);a.push(`:text-content="${g}"`),Qi(n,g,p.$ref),c=!0}else if(D(p)){let g=`_t${i.t}`;i.t+=1,a.push(`:text-content="${g}"`),n.set(g,`() => \`${p}\``),c=!0}}for(let[p,g]of Object.entries(e)){if(!p.startsWith("on")||p==="observedAttributes")continue;let y=p.slice(2).toLowerCase();if(de(g)){let E=qe(g.$ref);a.push(`@${y}="${E}"`),c=!0}else if(he(g)){let E=`_h${i.h}`;i.h+=1,a.push(`@${y}="${E}"`);let{body:A}=g;r.set(E,Array.isArray(A)?{args:["state","e"],body:Ce(A,{eventParam:"e",statePrefix:"state"})}:{args:g.parameters?je(g.parameters):g.arguments??["state","event"],body:A}),c=!0}else if(ge(g)){let E=`_h${i.h}`;i.h+=1,a.push(`@${y}="${E}"`);let A=ae(g.$expression,{eventParam:"e",statePrefix:"state"});r.set(E,{args:["state","e"],body:A}),c=!0}}if(O(e.style))for(let[p,g]of Object.entries(e.style)){if(p.startsWith(":")||p.startsWith(".")||p.startsWith("&")||p.startsWith("[")||p.startsWith("@"))continue;if(Rc(g))continue;if(D(g)){let y=`_s${i.s}`;i.s+=1,a.push(`:style.${pe(p)}="${y}"`),n.set(y,`() => \`${g}\``),c=!0}}if(O(e.attributes)){for(let[p,g]of Object.entries(e.attributes))if(de(g)){let y=qe(g.$ref);a.push(`:attr.${p}="${y}"`),Qi(n,y,g.$ref),c=!0}else if(D(g)){let y=`_t${i.t}`;i.t+=1,a.push(`:attr.${p}="${y}"`),n.set(y,`() => \`${g}\``),c=!0}}for(let[p,g]of Object.entries(e)){if(Be.has(p)||p.startsWith("on")||p.startsWith("$")||p==="tagName"||p==="id"||p==="className"||p==="style"||p==="children"||p==="textContent"||p==="innerHTML"||p==="attributes")continue;if(de(g)){let y=qe(g.$ref);a.push(`:${pe(p)}="${y}"`),Qi(n,y,g.$ref),c=!0}else if(D(g)){let y=`_t${i.t}`;i.t+=1,a.push(`:${pe(p)}="${y}"`),n.set(y,`() => \`${g}\``),c=!0}}let l=ct(e,s.scope),u=c?" data-bind":"",f=a.length>0?` ${a.join(" ")}`:"",d="",m=e;if(m.$switch){i.needsLit=!0;let p=`_sw${i.sw}`;i.sw+=1;let g=de(m.$switch)?`state.${qe(m.$switch.$ref)}`:`\`${String(m.$switch)}\``,y=m.cases??{},E=Object.entries(y).filter(([,w])=>w&&!de(w)).map(([w,S])=>`${JSON.stringify(w)}: html\`${Zi(S,s.preformatted)}\``);n.set(p,`() => ({${E.join(", ")}})[String(${g})] ?? html\`\``),a.push(`:render="${p}"`);let A=` ${a.join(" ")}`;return`<${o}${l} data-bind${A}></${o}>`}if(m.textContent!==void 0&&!c){let p=W(m.textContent,s.scope);d=p==null?"":_(String(p))}else if(m.textContent!==void 0&&c){let p=W(m.textContent,s.scope);d=p==null?"":_(String(p))}else if(m.innerHTML){let p=W(m.innerHTML,s.scope);d=p==null?m.innerHTML:String(p)}else if(X(m.children)){i.needsLit=!0;let p=`_list${i.l}`;i.l+=1;let g=m.children,y;if(de(g.items))y=`state.${qe(g.items.$ref)}`;else y=JSON.stringify(g.items);let E=ts(g.map);n.set(p,`() => (${y} ?? []).map((item, index) => html\`${E}\`)`),a.push(`:render="${p}"`),c=!0;let A=" data-bind",w=` ${a.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(o))return`<${o}${l}${A}${w}>`;return`<${o}${l}${A}${w}></${o}>`}else if(Array.isArray(m.children)&&m.children.some((p)=>X(p))){i.needsLit=!0;let p=`_children${i.l}`;i.l+=1;let g=m.children.map((E)=>Zi(E,s.preformatted)).join(Zt(s.preformatted," "));n.set(p,s.preformatted?`() => html\`${g}\``:`() => html\`
|
|
259
|
-
${g}
|
|
260
|
-
\``),a.push(`:render="${p}"`),c=!0;let y=` ${a.join(" ")}`;return`<${o}${l} data-bind${y}></${o}>`}else if(Array.isArray(m.children))d=m.children.map((p)=>Pc(p,s,n,r,i)).join(Zt(s.preformatted));if(new Set(["input","br","hr","img","meta","link"]).has(o))return`<${o}${l}${u}${f}>`;return`<${o}${l}${u}${f}>${d}</${o}>`}function ts(e,t=!1){if(!e)return"";if(Je(e.tagName))throw Error(`A tag chosen at creation is not supported inside a dynamic page's repeater yet (candidates: ${ht(e.tagName).join(", ")}). Move the item into a component, or give it a literal tagName.`);let n=e.tagName??"div",r=t||Ze.has(n),i="";if(e.id)i+=` id="${e.id}"`;if(e.className)i+=` class="${rt(e.className)}"`;if(O(e.$props))for(let[c,l]of Object.entries(e.$props))if(de(l))i+=` .${c}="\${${Pd(l.$ref)}}"`;else if(D(l))i+=` .${c}="${rt(l)}"`;else i+=` .${c}="\${${JSON.stringify(l)}}"`;if(O(e.attributes))for(let[c,l]of Object.entries(e.attributes)){if(D(l)){i+=` ${c}="${rt(l)}"`;continue}if(fe(l)){let u=at(c,l);if(u!==null)i+=u===""?` ${c}`:` ${c}="${_(u)}"`;continue}i+=` ${c}="${_(String(l))}"`}if(O(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(Rc(u))continue;let f=pe(l);if(D(String(u)))c.push(`${f}: ${rt(String(u))}`);else c.push(`${f}: ${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(de(l)){let f=qe(l.$ref);i+=` @${u}=\${(e) => { state.$map = { item, index }; on.${f}(e); }}`}else if(Ye(l)){let f=Ce(l.body,{eventParam:"e",statePrefix:"state"});i+=` @${u}=\${(e) => { state.$map = { item, index }; ${f} }}`}else if(he(l)){let f=rt(l.body);i+=` @${u}=\${(e) => { ${f} }}`}else if(O(l)&&"$expression"in l){let f=ae(l.$expression,{eventParam:"e",statePrefix:"state"});i+=` @${u}=\${(e) => { state.$map = { item, index }; ${f}; }}`}}if(e.contentEditable)i+=` contenteditable="${e.contentEditable}"`;let s=n.includes("-")?At:"",o="";if(e.textContent!==void 0){let c=String(e.textContent);if(D(c))o=`${rt(c)}${s}`;else if(de(e.textContent))o=`\${state.${qe(e.textContent.$ref)}}${s}`;else o=_(c)}else if(e.innerHTML)o=rt(String(e.innerHTML));else if(X(e.children))o=`
|
|
261
|
-
${Nc(e.children)}${s}
|
|
262
|
-
`;else if(Array.isArray(e.children)){let c=e.children.map((l)=>{let u=Zi(l,r);return X(l)||C(l)&&D(l)?`${u}${s}`:u});o=r?c.join(""):`
|
|
263
|
-
${c.join(`
|
|
264
|
-
`)}
|
|
265
|
-
`}if(new Set(["input","br","hr","img","meta","link"]).has(n))return`<${n}${i}>`;return`<${n}${i}>${o}</${n}>`}function Zi(e,t=!1){if(C(e))return D(e)?rt(e):_(e);if(ve(e)||fe(e))return _(String(e));if(X(e))return Nc(e);return ts(e,t)}function Nc(e){let{items:t}=e,n=de(t)?`state.${qe(t.$ref)}`:JSON.stringify(t??[]),r=ts(e.map);return`\${(${n} ?? []).map((item, index) => html\`${r}\`)}`}function rt(e){return e.replaceAll("$map.","")}function Cd(e,t,n,r,i,s,o,a,c){let l=[],{needsLit:u}=o,f=t.length>0;l.push("// Generated by @jxsuite/compiler — do not edit manually");let d=["reactive","effect"];if(f)d.push("computed");if(l.push(`import { ${d.join(", ")} } from '@vue/reactivity';`),u)l.push("import { html, render } from 'lit-html';");for(let[m,h]of s){let p=c?c(m):m;l.push(`import { ${[...h].join(", ")} } from '${p}';`)}l.push("",kn(),"","const state = reactive({");for(let[m,h]of e)l.push(` ${yt(m)}: ${JSON.stringify(h)},`);if(l.push("});",""),i.length>0){for(let m of i)l.push(m);l.push("")}if(t.length>0){for(let[m,h]of t)l.push(`${L("state",ie(m))} = computed(${h});`);l.push("")}if(n.length>0){l.push("const bind = {");for(let[m,h]of n)l.push(` ${yt(m)}: ${h},`);l.push("};")}else l.push("const bind = {};");if(l.push(""),r.length>0){l.push("const on = {");for(let[m,h]of r){let p=h.args??["state"],g=p.map((y)=>y==="state"?"state":"e").join(", ");l.push(` ${yt(m)}: (e) => { const fn = (${p.join(", ")}) => { ${h.body} }; fn(${g}); },`)}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 = ${vt}(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(`
|
|
266
|
-
`)}function Od(e,t,n,r){return[`// ${e}: ${t} (key: "${n}")`,"try {",` const _s = ${t}.getItem(${JSON.stringify(n)});`,` state.${e} = _s !== null ? JSON.parse(_s) : ${JSON.stringify(r)};`,`} catch { state.${e} = ${JSON.stringify(r)}; }`,"effect(() => {",` const v = state.${e};`," try {",` if (v === null) ${t}.removeItem(${JSON.stringify(n)});`,` else ${t}.setItem(${JSON.stringify(n)}, JSON.stringify(v));`," } catch {}","});"].join(`
|
|
267
|
-
`)}function Td(e,t,n){return[`// ${e}: Cookie (name: "${t}")`,"{",` const _m = document.cookie.match(new RegExp("(?:^|; )${t}=([^;]*)"));`,` try { state.${e} = _m ? JSON.parse(decodeURIComponent(_m[1])) : ${JSON.stringify(n)}; }`,` catch { state.${e} = _m ? _m[1] : ${JSON.stringify(n)}; }`,"}"].join(`
|
|
268
|
-
`)}function Rc(e){return e===null||O(e)}function Pd(e){if(e.startsWith("$map/")){let[t,...n]=Qe(e.slice(5));return L(t??"",n.map((r)=>ie(r)).join("/"))}if(e.startsWith("#/state/"))return L("state",e.slice(8));return L("state",e)}function qe(e){return hs(e.startsWith("#/state/")?e.slice(8):e)}function Qi(e,t,n){if(e.has(t))return;e.set(t,`() => ${L("state",n.startsWith("#/state/")?n.slice(8):n)}`)}var ns=N(()=>{zt();lt();Q();xt()});function _c(e){let t=e.title;if(!t)throw Error("compileClassJson: missing title (class name)");let n=Rd(e.extends),r=e.$defs,i=r?.fields??{},s=r?.constructor,o=Nd(s)?s:void 0,a=r?.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=n!=="Object"?` extends ${n}`:"";c.push(`class ${t}${l} {`);for(let[u,f]of Object.entries(i)){if(f.scope!=="static")continue;let d=f.identifier??u,m=f.access==="private"?"#":"",h=f.initializer!==void 0?JSON.stringify(f.initializer):f.default!==void 0?JSON.stringify(f.default):"null";c.push(` static ${m}${d} = ${h};`)}for(let[u,f]of Object.entries(i)){if(f.scope==="static")continue;if(f.access!=="private")continue;let d=f.identifier??u;c.push(` #${d};`)}if(Object.keys(i).length>0)c.push("");if(c.push(" constructor(config = {}) {"),o?.superCall||n!=="Object"){let u=o?.superCall?.arguments?o.superCall.arguments.join(", "):"";c.push(` super(${u});`)}for(let[u,f]of Object.entries(i)){if(f.scope==="static")continue;let d=f.identifier??u,m=f.access==="private"?"#":"",h=f.initializer!==void 0?JSON.stringify(f.initializer):f.default!==void 0?JSON.stringify(f.default):"null";c.push(` this.${m}${d} = config.${d} !== undefined ? config.${d} : ${h};`)}if(o?.body){let u=Array.isArray(o.body)?o.body:[o.body];for(let f of u)c.push(` ${f}`)}c.push(" }");for(let[u,f]of Object.entries(a)){let d=f.identifier??u,m=f.scope==="static",p=f.access==="private"?"#":"",g=m?"static ":"",y=f.returnType?.$ref?.includes("Promise")||_d(f)?"async ":"",E=Ic(f.parameters??[]),A=Id(f.body);if(c.push(""),f.role==="accessor"){if(f.getter)c.push(` ${g}get ${p}${d}() {`,` ${f.getter.body}`," }");if(f.setter){let w=Ic(f.setter.parameters??[]);c.push(` ${g}set ${p}${d}(${w}) {`,` ${f.setter.body}`," }")}}else{c.push(` ${g}${y}${p}${d}(${E}) {`);for(let w of A)c.push(` ${w}`);c.push(" }")}}return c.push("}","",`export { ${t} };`,`export default ${t};`,""),c.join(`
|
|
269
|
-
`)}function Nd(e){return typeof e==="object"}function Rd(e){if(!e)return"Object";if(C(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 Ic(e){return e.map((t)=>{if(t.$ref)return t.$ref.split("/").pop();let n=t.identifier??t.name;return C(n)?n:"arg"}).join(", ")}function Id(e){if(!e)return[""];return Array.isArray(e)?e:[e]}function _d(e){return(Array.isArray(e.body)?e.body.join(`
|
|
270
|
-
`):e.body??"").includes("await ")}var Jc=N(()=>{Q()});import{readFileSync as Jd}from"node:fs";async function kd(e,t={}){let{title:n="Jx App",reactivitySrc:r=Nn,litHtmlSrc:i=Rn,projectStyle:s=null}=t,o;if(C(e)){let a=Jd(e,"utf8");if(e.endsWith(".json"))o=ir(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(() => Gi());throw cr(e,l)}o=await u.parseDocument(a)}}else o=e;if(as(o)){await Promise.resolve().then(() => Jc());let c=_c(o),l=C(e)?e.replace(/\.class\.json$/,".js"):`${o.title}.js`;return{files:[{content:c,path:l}],html:""}}if(!In(o))return Cc(o,{litHtmlSrc:i,projectStyle:s,reactivitySrc:r,...kc(t),title:n});if(o.tagName&&o.tagName.includes("-")){let{tagName:a}=o,c=Ln(a),u={content:mn(o,c,[],t.rewriteSrc),path:`${a}.js`,tagName:a},f=Ct(o,o.$media??{},s),d=`<!DOCTYPE html>
|
|
229
|
+
})`}var Zr=I(()=>{Kt()});function es(e){let t=e.title;if(!t)throw Error("compileClassJson: missing title (class name)");let n=Do(e.extends),r=e.$defs,s=r?.fields??{},o=r?.constructor,i=_o(o)?o:void 0,u=r?.methods??{},a=["// Generated by @jxsuite/compiler from .class.json — do not edit manually"];if(e.$id)a.push(`// Source: ${e.$id}`);a.push("");let c=n!=="Object"?` extends ${n}`:"";a.push(`class ${t}${c} {`);for(let[l,p]of Object.entries(s)){if(p.scope!=="static")continue;let g=p.identifier??l,d=p.access==="private"?"#":"",x=p.initializer!==void 0?JSON.stringify(p.initializer):p.default!==void 0?JSON.stringify(p.default):"null";a.push(` static ${d}${g} = ${x};`)}for(let[l,p]of Object.entries(s)){if(p.scope==="static")continue;if(p.access!=="private")continue;let g=p.identifier??l;a.push(` #${g};`)}if(Object.keys(s).length>0)a.push("");if(a.push(" constructor(config = {}) {"),i?.superCall||n!=="Object"){let l=i?.superCall?.arguments?i.superCall.arguments.join(", "):"";a.push(` super(${l});`)}for(let[l,p]of Object.entries(s)){if(p.scope==="static")continue;let g=p.identifier??l,d=p.access==="private"?"#":"",x=p.initializer!==void 0?JSON.stringify(p.initializer):p.default!==void 0?JSON.stringify(p.default):"null";a.push(` this.${d}${g} = config.${g} !== undefined ? config.${g} : ${x};`)}if(i?.body){let l=Array.isArray(i.body)?i.body:[i.body];for(let p of l)a.push(` ${p}`)}a.push(" }");for(let[l,p]of Object.entries(u)){let g=p.identifier??l,d=p.scope==="static",f=p.access==="private"?"#":"",m=d?"static ":"",y=p.returnType?.$ref?.includes("Promise")||Io(p)?"async ":"",w=Qr(p.parameters??[]),O=Mo(p.body);if(a.push(""),p.role==="accessor"){if(p.getter)a.push(` ${m}get ${f}${g}() {`,` ${p.getter.body}`," }");if(p.setter){let v=Qr(p.setter.parameters??[]);a.push(` ${m}set ${f}${g}(${v}) {`,` ${p.setter.body}`," }")}}else{a.push(` ${m}${y}${f}${g}(${w}) {`);for(let v of O)a.push(` ${v}`);a.push(" }")}}return a.push("}","",`export { ${t} };`,`export default ${t};`,""),a.join(`
|
|
230
|
+
`)}function _o(e){return typeof e==="object"}function Do(e){if(!e)return"Object";if(J(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 Qr(e){return e.map((t)=>{if(t.$ref)return t.$ref.split("/").pop();let n=t.identifier??t.name;return J(n)?n:"arg"}).join(", ")}function Mo(e){if(!e)return[""];return Array.isArray(e)?e:[e]}function Io(e){return(Array.isArray(e.body)?e.body.join(`
|
|
231
|
+
`):e.body??"").includes("await ")}var ts=I(()=>{H()});import{readFileSync as Lo}from"node:fs";async function Fo(e,t={}){let{title:n="Jx App",reactivitySrc:r=gt,litHtmlSrc:s=ht,projectStyle:o=null}=t,i;if(J(e)){let a=Lo(e,"utf8");if(e.endsWith(".json"))i=Et(a,e);else{let{extname:c}=await import("node:path"),l=c(e).toLowerCase(),p=t.formats?.byExtension(l,"parse");if(!p){await Promise.resolve().then(() => gn());throw Ot(e,l)}i=await p.parseDocument(a)}}else i=e;if(An(i)){await Promise.resolve().then(() => ts());let c=es(i),l=J(e)?e.replace(/\.class\.json$/,".js"):`${i.title}.js`;return{files:[{content:c,path:l}],html:""}}if(!xt(i))return Ur(i,{litHtmlSrc:s,projectStyle:o,reactivitySrc:r,...ns(t),title:n});if(i.tagName&&i.tagName.includes("-")){let{tagName:a}=i,c=Jt(a),p={content:Qe(i,c,[],t.rewriteSrc,null,t.serverBaseUrl),path:`${a}.js`,tagName:a},g=Me(i,i.$media??{},o),d=`<!DOCTYPE html>
|
|
271
232
|
<html lang="en">
|
|
272
233
|
<head>
|
|
273
234
|
<meta charset="utf-8">
|
|
274
235
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
275
|
-
<title>${
|
|
236
|
+
<title>${j(n)}</title>
|
|
276
237
|
<script type="importmap">
|
|
277
238
|
{
|
|
278
239
|
"imports": {
|
|
279
240
|
"@vue/reactivity": "${r}",
|
|
280
|
-
"lit-html": "${
|
|
241
|
+
"lit-html": "${s}"
|
|
281
242
|
}
|
|
282
243
|
}
|
|
283
244
|
</script>
|
|
284
|
-
${
|
|
245
|
+
${g}
|
|
285
246
|
</head>
|
|
286
247
|
<body>
|
|
287
248
|
<${a}></${a}>
|
|
288
249
|
<script type="module" src="./${a}.js"></script>
|
|
289
250
|
</body>
|
|
290
|
-
</html>`;return{files:[
|
|
251
|
+
</html>`;return{files:[p],html:d}}let u={litHtmlSrc:s,projectStyle:o,reactivitySrc:r,...ns(t),title:n};if(t.serverBaseUrl!==void 0)u.serverBaseUrl=t.serverBaseUrl;return bn(i,u)}function ns(e){let t={};if(e.prePaintScheme===!1)t.prePaintScheme=!1;if(e.rewriteSrc)t.rewriteSrc=e.rewriteSrc;return t}async function Ya(e,t){let n=await Fo(e),{writeFileSync:r,mkdirSync:s}=await import("node:fs"),{dirname:o,join:i}=await import("node:path");if(t){r(t,n.html,"utf8"),console.error(`Written to ${t}`);let u=o(t);for(let a of n.files){let c=i(u,a.path);s(o(c),{recursive:!0}),r(c,a.content,"utf8"),console.error(`Written to ${c}`)}}else process.stdout.write(n.html)}var Wo=I(()=>{Ie();Nt();Kr();En();H();pn();Ie();Zr();Nt();En()});Wo();export{Fo as compile,bn as compileClient,Fr as compileElement,So as compileElementPage,Po as compileSiteServer,xt as isDynamic,Ya as runCli};
|