@jxsuite/compiler 5.1.3 → 6.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +194 -191
- package/dist/compiler.js +97 -94
- package/package.json +8 -7
- package/src/shared.ts +344 -34
- package/src/site/project-sections.ts +4 -0
- package/src/site/site-build.ts +43 -18
- package/src/targets/compile-client.ts +15 -5
- package/src/targets/compile-element.ts +72 -60
package/dist/compiler.js
CHANGED
|
@@ -1,50 +1,53 @@
|
|
|
1
|
-
import{createRequire as Tc}from"node:module";var Ac=Object.create;var{getPrototypeOf:Cc,defineProperty:Ki,getOwnPropertyNames:Oc}=Object;var qi=Object.prototype.hasOwnProperty;function Pc(e){return this[e]}var Ic,Nc,Ed=(e,t,n)=>{var r=e!=null&&typeof e==="object";if(r){var i=t?Ic??=new WeakMap:Nc??=new WeakMap,s=i.get(e);if(s)return s}n=e!=null?Ac(Cc(e)):{};let o=t||!e||!e.__esModule||!qi.call(e,"default")?Ki(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let a of Oc(e))if(!qi.call(o,a))Ki(o,a,{get:Pc.bind(e,a),enumerable:!0})}if(r)i.set(e,o);return o};var wd=(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 Ad=Tc(import.meta.url);function C(e){return typeof e==="string"}function Ce(e){return typeof e==="number"}function de(e){return typeof e==="boolean"}function ve(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 me(e){return Y(e)&&e.$prototype==="Function"}function he(e){return Y(e)&&Y(e.$expression)}function it(e){return he(e)&&Array.isArray(e.parameters)&&e.parameters.length>0}function Ye(e){return me(e)&&Array.isArray(e.body)}function ze(e){return Y(e)&&typeof e.$prototype==="string"&&e.$prototype!=="Function"}function or(e){return Y(e)&&e.timing==="server"&&typeof e.$src==="string"&&typeof e.$export==="string"&&!e.$prototype}function Yi(e){return Y(e)&&!e.$prototype&&!e.$expression&&"default"in e}function Ge(e){if(!Y(e))return!1;for(let t of Object.keys(e))if(!zi.has(t))return!1;return!0}function ue(e){return Y(e)&&e.$prototype==="Array"}function ar(e){return(Array.isArray(e)?e:[e]).some((n)=>ue(n))}function Gi(e){return Y(e)&&e.$prototype==="Class"}function Od(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 Rc(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Le(e){if(!e)return[];return e.map((t)=>C(t)?t:t.name)}function _c(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(_c(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 zi;var X=I(()=>{zi=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function fe(e){return e.replaceAll(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}function Xi(e,t){if(e.startsWith("@--"))return t[e.slice(1)]??e.slice(1);if(e.startsWith("@(")){let n=e.slice(2,-1).trim();return Jc.has(n.toLowerCase())?n:e.slice(1)}return null}function Wt(e){return e.startsWith("@position-try")||e.startsWith("@property")||e.startsWith("@font-face")||e.startsWith("@counter-style")}function Ut(e){return e.startsWith("@keyframes")}function Qi(e,t){let n=[];for(let r of Ht(e))for(let i of Ht(t))n.push(kc(r,i));return n.join(", ")}function kc(e,t){if(t.startsWith("&"))return t.replaceAll("&",e);if(t.startsWith("[")||t.startsWith(":")||t.startsWith("."))return`${e}${t}`;return`${e} ${t}`}function Ht(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 cr(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 lr(e){return e.startsWith("--")?e:fe(e)}function pn(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 Zi(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 Lc(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 jc(e){let t=Object.keys(e).filter((r)=>Ut(r));if(t.length===0)return e;let n={...e};for(let r of t)delete n[r];return n}function Mc(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),u=(g,y)=>{if(c(y))return[y];if(!Wt(g)||!Array.isArray(y)||y.length===0)return[];return y.every((b)=>c(b))?y:[]},l=(g,y,b,A)=>{if(y===void 0||y===null)return null;if(H(y))return b?o?.(g,y,A)??null:null;if(O(y))return null;let v=String(y);if(D(v))return b?o?.(g,v,A)??null:null;return i(v)},f=(g,y,b=!0,A="self")=>{let v=[];for(let[S,x]of Object.entries(g)){if(u(S,x).length>0)continue;if(y&&(S.startsWith("@")||Xe(S)))continue;if(S.startsWith("$"))continue;let E=l(S,x,b,A);if(E!==null)v.push([lr(S),E])}return v},m=(g,y,b,A,v)=>{if(b.length===0)return;let S=y;if(S!==null){let w=s(S);if(w===null)return;S=w}let x=Zi(g,S,b),E={text:x,conditions:[...g],selector:S,declarations:b,target:A,key:pn(x)};if(C(v)&&v!=="")E.description=v;a.push(E)},h=(g,y,b)=>{let A=g.slice(10).trim();if(A==="")return;let v=[];for(let[x,E]of Object.entries(y)){if(!c(E))continue;let w=f(E,!0,!1,"unscoped");if(w.length>0)v.push({declarations:w,selector:x.trim()})}if(v.length===0)return;let S=Lc(b,A,v);a.push({blocks:v,conditions:[...b],declarations:[],key:pn(S),selector:null,target:"unscoped",text:S})},d=(g,y,b,A,v)=>{if(g==="@--")return;if(Wt(g)){m([...A,g],null,f(y,!1,!0,"unscoped"),"unscoped",y.$description);return}if(Ut(g)){h(g,y,A);return}let S=Xi(g,r),x=S===null?g:`@media ${S}`,E=S===null?null:Me(S);if(E!==null&&b!==null){let{auto:w,forced:N}=cr(b,E);p(y,w,[...A,x],v),p(jc(y),N,A,v);return}p(y,b,[...A,x],v)};function p(g,y,b,A){m(b,y,f(g,!0,!0,A),A,g.$description);for(let[v,S]of Object.entries(g))for(let x of u(v,S))if(v.startsWith("@"))d(v,x,y,b,A);else if(y!==null)p(x,Qi(y,v),b,Mc(v)?A:"descendant")}return p(e,n,[],"self"),a}var Jc,Oe="data-color-scheme",dn="jx-color-scheme";var mn=I(()=>{X();Jc=new Set(["all","print","screen","speech"])});function Td(){return`the Intl helpers ${fr.join(", ")}`}var Je="en-US",ur="UTC",es,fr,ts;var ns=I(()=>{es=[{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."}],fr=es.map((e)=>e.path),ts=Object.fromEntries(es.map((e)=>[e.path,e.params.indexOf("locale")]))});function Dc(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function re(e){return e.replaceAll("~","~0").replaceAll("/","~1")}function Qe(e){if(e==="")return[];return e.split("/").map((t)=>Dc(t))}function ee(e,t){let n=e;for(let r of Qe(t))n=n?.[r];return n}function k(e,t){let n=e;for(let r of Qe(t))n+=rs.test(r)?`.${r}`:`[${JSON.stringify(r)}]`;return n}function yt(e){return rs.test(e)?e:JSON.stringify(e)}function is(e){let t=e.replaceAll(/[^A-Za-z0-9_$]/g,"_");if(t==="")return"ref";return/^\d/.test(t)?`_${t}`:t}var rs;var xt=I(()=>{rs=/^[A-Za-z_$][A-Za-z0-9_$]*$/});function pr(e){let t=e.$map;return O(t)?t:void 0}function cs(e){return O(e)&&!Array.isArray(e)&&"operator"in e}function Vt(e){return O(e)&&!Array.isArray(e)&&"$ref"in e}function Hc(e,t,n){let r=ts[e];if(r===void 0||r<0||t[r]!=null)return t;let i=ee(n.$page,"locale");if(!C(i)||i==="")return t;let s=[...t];return s[r]=i,s}function ps(e){return e.startsWith("window#/")&&Bc.has(e.slice(8))}function De(e){return ls.has(e)}function U(e,t){if(!e)return;let n=(e.depth??0)+1;if(n>Uc)return;return{depth:n,path:[...e.path??[],...Array.isArray(t)?t:[t]],report:e.report}}function W(e,t,n,r,i){if(e===null||e===void 0)return e;if(cs(e))return ge(e,t,n,r,i);if(Vt(e)){let s=hn(e.$ref,t,n,r);return i?.report(i.path??[],s),s}if(Array.isArray(e))return ds(e,t,n,r,i);return i?.report(i.path??[],e),e}function ds(e,t,n,r,i){return e.map((s,o)=>W(s,t,n,r,U(i,o)))}function Vc(e,t,n,r){let i=(s)=>{if(!e.slice(s.length).includes("/"))return t;return hn(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?hn(e.slice(0,e.lastIndexOf("/")),t,n,r):void 0;return}function hn(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?ee(s,i.slice(1).join("/")):s}if(e.startsWith("event#/")){let i=e.slice(7);return ee(n,i)}if(e.startsWith("$map/")){let i=e.split("/"),[,s]=i,o,a=pr(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?ee(o,i.slice(2).join("/")):o}if(e.startsWith("#/state/"))return ee(t,e.slice(8));if(e.startsWith("parent#/"))return ee(t,e.slice(8));if(e.startsWith("window#/"))return ee(globalThis.window,e.slice(8));if(e.startsWith("document#/"))return ee(globalThis.document,e.slice(10));return ee(t,e)??null}function Kc(e,t,n,r){if(e.startsWith("$map/")){let i=e.split("/"),[,s]=i,o,a=pr(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),u=c.pop(),l=c.length>0?ee(o,c.join("/")):o;return{key:u,obj:l}}return{key:s==="item"?"$map/item":"$map/index",obj:pr(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 u of o)c=c[u];return{key:a,obj:c}}return{key:e,obj:t}}function ge(e,t,n,r,i){let s=qc(e,t,n,r,i);return i?.report(i.path??[],s),s}function os(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 qc(e,t,n,r,i){let{operator:s,target:o,value:a,initial:c}=e;if(!Fc.has(s))throw Error(`$expression: unknown operator "${s}"`);if(dr.has(s)&&!("value"in e)){let u=W(o,t,n,r,U(i,"target"));if(s==="!")return!u;if(s==="-")return-u}if(s==="call"){let u=Vt(o)?o.$ref:void 0;if(!C(u))throw TypeError("$expression: call target must be a $ref pointer");let l=(r?.callDepth??0)+1;if(l>ss)throw Error(`$expression: call depth exceeded (${ss})`);let f=Array.isArray(a)?a.map((h,d)=>W(h,t,n,r,U(i,["value",d]))):[];if(u.startsWith("window#/")){if(!ps(u))throw Error(`$expression: "${u}" is not a blessed pure global`);let h=u.slice(8),d=Wc.get(h);if(d)return d(...Hc(h,f,t));let p=ee(globalThis.window,h),g=h.lastIndexOf("/"),y=g===-1?globalThis.window:ee(globalThis.window,h.slice(0,g));return p.apply(y,f)}let m=hn(u,t,n,r);if(ve(m))return m.apply(Vc(u,t,n,r),f);if(O(m)&&"$expression"in m){let h=m,d={};for(let[p,g]of(h.parameters??[]).entries()){let y=C(g)?g:g?.name??"";if(!y)continue;d[y]=f[p]===void 0&&O(g)&&"default"in g?g.default:f[p]}return ge(h.$expression,t,n,{args:d,callDepth:l})}throw TypeError(`$expression: call target "${u}" is not callable`)}if(gr.has(s)){if(s==="?:"){let h=W(o,t,n,r,U(i,"target"));if(i){let d=W(a,t,n,r,U(i,"value")),p=W(c,t,n,r,U(i,"initial"));return h?d:p}return h?W(a,t,n,r):W(c,t,n,r)}let u=W(o,t,n,r,U(i,"target")),l=String(u),f=e.cases??{},m=Object.hasOwn(f,l);if(i){let h;for(let[p,g]of Object.entries(f)){let y=W(g,t,n,r,U(i,["cases",p]));if(p===l)h=y}let d=W(e.default,t,n,r,U(i,"default"));return m?h:d}return m?W(f[l],t,n,r):W(e.default,t,n,r)}if(mr.has(s)){let u=W(o,t,n,r,U(i,"target")),l=W(a,t,n,r,U(i,"value"));switch(s){case"===":return u===l;case"!==":return u!==l;case"&&":return u&&l;case"||":return u||l;case"??":return u??l;default:return os(s,u,l)}}if(us.has(s)){let u=W(a,t,n,r,U(i,"value")),{obj:l,key:f}=Kc(o.$ref,t,n,r);l[f]=s==="="?u:os(s.slice(0,-1),l[f],u);return}if(fs.has(s)){let u=W(o,t,n,r,U(i,"target"));switch(s){case"push":return u.push(W(a,t,n,r,U(i,"value")));case"unshift":return u.unshift(W(a,t,n,r,U(i,"value")));case"pop":return u.pop();case"shift":return u.shift();case"splice":{let l=W(a,t,n,r,U(i,"value"));return u.splice(...l)}default:break}}if(yr.has(s)){let u=W(o,t,n,r,U(i,"target")),l=a===void 0?[]:Array.isArray(a)?ds(a,t,n,r,U(i,"value")):[W(a,t,n,r,U(i,"value"))],f=ee(u,s);if(!ve(f))return;return f.apply(u,l)}if(hr.has(s)){let u=W(o,t,n,r,U(i,"target")),l=a;if(s==="reduce"){let f=W(c,t,n,r,U(i,"initial"));for(let[m,h]of u.entries())f=ge(l,t,n,{acc:f,index:m,item:h},m===0?U(i,"value"):void 0);return f}if(s==="map")return u.map((f,m)=>ge(l,t,n,{...r,index:m,item:f},m===0?U(i,"value"):void 0));if(s==="filter")return u.filter((f,m)=>ge(l,t,n,{...r,index:m,item:f},m===0?U(i,"value"):void 0))}return}function V(e,t){if(e===null)return"null";if(e===void 0)return"undefined";if(cs(e))return oe(e,t);if(Vt(e))return xr(e.$ref,t);if(Array.isArray(e))return e.map((n)=>V(n,t)).join(", ");return JSON.stringify(e)}function Yc(e){return`_fx_${e.replaceAll(/[^A-Za-z0-9_$]/g,"_")}`}function xr(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 k("_args",e.slice(6));if(e.startsWith("event#/"))return k(r,e.slice(7));if(e.startsWith("$map/")){let i=e.split("/"),[,s]=i;if(s==="item")return i.length>2?k("_item",i.slice(2).join("/")):"_item";if(s==="index")return"_index";return`_${s}`}if(e.startsWith("#/state/"))return k(n,e.slice(8));if(e.startsWith("parent#/"))return k(n,e.slice(8));if(e.startsWith("window#/"))return k("window",e.slice(8));if(e.startsWith("document#/"))return k("document",e.slice(10));return k(n,e)}function as(e,t){if(Vt(e))return xr(e.$ref,t);return V(e,t)}function zc(e,t,n){let r=(o)=>t[o]??"undefined",i=`(${n.statePrefix??"state"}?.$page?.locale ?? ${JSON.stringify(Je)})`,s=JSON.stringify(ur);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 oe(e,t={}){let{operator:n,target:r,value:i,initial:s}=e;if(dr.has(n)&&!("value"in e)){let o=V(r,t);if(n==="!")return`!(${o})`;if(n==="-")return`-(${o})`}if(n==="call"){let o=(Vt(r)?r.$ref:void 0)??"",a=Array.isArray(i)?i.map((c)=>V(c,t)):[];if(o.startsWith("window#/")){if(!ps(o))throw Error(`$expression: "${o}" is not a blessed pure global`);let c=zc(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),u=t.formulaParams?.[c];if(u){let l=u.map((f,m)=>`${JSON.stringify(f)}: ${a[m]??"undefined"}`).join(", ");return`${Yc(c)}(${t.statePrefix??"state"}, { ${l} })`}}return`${xr(o,t)}(${a.join(", ")})`}if(gr.has(n)){if(n==="?:"){let u=V(r,t),l=V(i,t),f=V(s,t);return`(${u} ? ${l} : ${f})`}let o=V(r,t),a=Object.entries(e.cases??{}).map(([u,l])=>`_d === ${JSON.stringify(u)} ? ${V(l,t)} : `).join(""),c="default"in e?V(e.default,t):"undefined";return`((_d) => ${a}${c})(String(${o}))`}if(mr.has(n)){let o=V(r,t),a=V(i,t);return`(${o} ${n} ${a})`}if(us.has(n)){let o=as(r,t),a=V(i,t);return`${o} ${n} ${a}`}if(fs.has(n)){let o=as(r,t);switch(n){case"push":return`${o}.push(${V(i,t)})`;case"unshift":return`${o}.unshift(${V(i,t)})`;case"pop":return`${o}.pop()`;case"shift":return`${o}.shift()`;case"splice":{let a=Array.isArray(i)?i.map((c)=>V(c,t)).join(", "):V(i,t);return`${o}.splice(${a})`}default:break}}if(yr.has(n)){let o=V(r,t),a=i===void 0?"":Array.isArray(i)?i.map((c)=>V(c,t)).join(", "):V(i,t);return`(${o})?.${n}?.(${a})`}if(hr.has(n)){let o=V(r,t),a=oe(i,t);if(n==="reduce"){let c=V(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 W(e,t,n,r)}function ot(e,t={}){return V(e,t)}var ls,dr,mr,us,fs,hr,gr,yr,Fc,Bc,Wc,ss=64,Uc=64;var Kt=I(()=>{ns();X();xt();ls=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),dr=new Set(["!","-"]),mr=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),us=new Set(["=","+=","-=","*=","/="]),fs=new Set(["push","pop","shift","unshift","splice"]),hr=new Set(["reduce","map","filter"]),gr=new Set(["?:","switch"]),yr=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"]),Fc=new Set([...ls,...dr,...mr,...hr,...gr,...yr,"call"]),Bc=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",...fr]),Wc=new Map([["Intl/compare",(e,t,n,r)=>new Intl.Collator(n??Je,r).compare(e,t)],["Intl/displayName",(e,t,n,r)=>new Intl.DisplayNames(n??Je,{...r,type:t??"language"}).of(e)],["Intl/formatDate",(e,t,n)=>new Intl.DateTimeFormat(t??Je,{timeZone:ur,...n}).format(new Date(e))],["Intl/formatList",(e,t,n)=>new Intl.ListFormat(t??Je,n).format(e)],["Intl/formatNumber",(e,t,n)=>new Intl.NumberFormat(t??Je,n).format(e)],["Intl/formatRelativeTime",(e,t,n,r)=>new Intl.RelativeTimeFormat(n??Je,r).format(e,t)],["Intl/plural",(e,t,n)=>new Intl.PluralRules(t??Je,n).select(e)],["Intl/segment",(e,t,n)=>[...new Intl.Segmenter(n??Je,{granularity:t??"grapheme"}).segment(e)].map((r)=>r.segment)]])});function Gc(e){return e.startsWith(ms)}function Dd(e){let t=e;if(Gc(t))t=t.slice(ms.length);return t=t.replace(/^\.\//,"").replace(/\.(js|ts|mjs|mts)$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,""),`${Sr}${t}.js`}function Fd(e){let t=/\.(\w+)$/.exec(e)?.[1]??"",n=e.replace(/\.\w+$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"");return t===""?`${Sr}${n}`:`${Sr}${n}.${t}`}function hs(e){let t=e.replaceAll("\\","/");return t.length>1&&t.endsWith("/")?t.slice(0,-1):t}function gs(e){let t=hs(e);return t.startsWith("/")?t:`/${t}`}function Xc(e,t){return[...e].toSorted((n,r)=>r[t].length-n[t].length)}function Bd(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 Xc(e,"urlPrefix")){let s=gs(i.urlPrefix);if(!r.startsWith(`${s}/`))continue;let a=r.slice(s.length+1).split("/");if(a.some((u)=>u===""||u==="."||u===".."))return null;let{filter:c}=i;if(c&&!c(a.join("/")))return null;return`${hs(i.dir)}/${a.join("/")}`}return null}function Wd(e,t){let n=new Set;for(let r of t){let i=gs(r.urlPrefix),s=new RegExp(`${i.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}/[^${Qc}]+`,"g");for(let o of e.matchAll(s)){let a=o[0].split("#")[0].split("?")[0];if(!a.endsWith("/"))n.add(a)}}return[...n].filter(Boolean)}function Zc(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 el(e){return e.map(({url:t,descriptor:n})=>n?`${t} ${n}`:t).join(", ")}function Hd(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 ys(e,t){if(e===""||!t.startsWith("/")||t.startsWith("//"))return t;if(t===e||t.startsWith(`${e}/`))return t;return e+t}function Ud(e,t){let n=new URL(t);if(!n.pathname.endsWith("/"))n.pathname+="/";return new URL(e.replace(/^\/+/,""),n).href}var ms="npm:",Sr="/assets/",Qc;var $r=I(()=>{X();Qc=String.raw`"'\s<>()\\`});function xs(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 tl(e){return(O(e)||ve(e))&&"then"in e&&ve(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=xs(s);switch(o.kind){case"expression":{let a=ge(o.node,t,n,i);if(tl(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)),u=a.cases??{},l=Object.hasOwn(u,c)?u[c]:a.default;if(Array.isArray(l))await $t(l,t,n,r);break}case"dispatch":{let a=o.node,c=ve(r.target)?r.target():r.target,u=n?.currentTarget??c;if(!u)break;let l={};if("detail"in a)l.detail=St(a.detail,t,n,i);if(a.bubbles!==void 0)l.bubbles=a.bubbles;if(a.composed!==void 0)l.composed=a.composed;u.dispatchEvent(new CustomEvent(a.dispatchEvent,l));break}case"stopPropagation":{n?.stopPropagation();break}case"preventDefault":{n?.preventDefault();break}default:break}}}function Ae(e,t={}){let n=t.indent??"",r=[];for(let i of e){let s=xs(i);switch(s.kind){case"expression":{r.push(`${n}${oe(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}) {`,Ae(o.then??[],c)),o.else)r.push(`${n}} else {`,Ae(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[u,l]of Object.entries(o.cases??{}))r.push(`${n} case ${JSON.stringify(u)}: {`,Ae(l,c),`${n} break;`,`${n} }`);if(o.default)r.push(`${n} default: {`,Ae(o.default,c),`${n} }`);r.push(`${n}}`);break}case"dispatch":{let o=s.node,a=t.eventParam??"event",c=t.dispatchTarget??`(${a} && ${a}.currentTarget)`,u=[];if("detail"in o)u.push(`detail: ${ot(o.detail,t)}`);if(o.bubbles!==void 0)u.push(`bubbles: ${JSON.stringify(o.bubbles)}`);if(o.composed!==void 0)u.push(`composed: ${JSON.stringify(o.composed)}`);let l=u.length>0?`, { ${u.join(", ")} }`:"";r.push(`${n}${c}?.dispatchEvent(new CustomEvent(${JSON.stringify(o.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
|
|
3
|
-
`)}var
|
|
4
|
-
`)}function
|
|
5
|
-
${t}`}function
|
|
6
|
-
function ${
|
|
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 $n=N(()=>{Q();Gt()});function En(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 Rs(){return[...Ns].toSorted()}function at(e,t){let n=e.toLowerCase();if(n.startsWith("aria-")||Ns.has(n))return String(t);return t?"":null}var Be,Ns,Pr=32,bn,wn="jx-slot",Nr="data-jx-slots",Rr="jx.slot.group",Em;var zt=N(()=>{xn();Gt();xt();Q();Tr();$n();xn();Be=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"]),Ns=new Set(["contenteditable","draggable","spellcheck"]);bn=/^[\t\n\f\r ]+$/u,Em=(()=>{let e=Symbol.for(Rr),t=globalThis;return t[e]??=new WeakMap,t[e]})()});function Is(e,t,n,r,i=hl){let s=[],o=(f,d)=>{let m={mediaQueries:t,scope:d,transposeValue:n};if(r)m.resolveValue=(h,p)=>r(h,p,d);for(let h of gt(f,m))s.push(h.text)},a={},c={},l=[],u=[];for(let[f,d]of Object.entries(e)){if(O(d)&&!Array.isArray(d)){if(f.startsWith("@"))l.push([f,d]);else if(!f.startsWith("--"))u.push([f,d]);continue}if(Xe(f)||f.startsWith("@"))continue;if(f.startsWith("--")||f==="colorScheme"||f==="color-scheme")a[f]=d;else c[f]=d}o(a,i.root),o(c,i.body);for(let[f,d]of u)if(f.startsWith("&"))o({[f]:d},i.root);else o(d,f);for(let[f,d]of l){if(Vt(f)||qt(f)){o({[f]:d},null);continue}let m={},h={},p=[];for(let[g,y]of Object.entries(d)){if(O(y)&&!Array.isArray(y)){if(!g.startsWith("@"))p.push([g,y]);continue}if(g.startsWith("--"))m[g]=y;else h[g]=y}o({[f]:m},i.root),o({[f]:h},i.body);for(let[g,y]of p)o({[f]:y},g)}if(Object.values(t).some((f)=>Me(f)!==null)&&!("colorScheme"in e))s.push(`${i.root} { color-scheme: light dark }`,`${i.root}:where([${Oe}="light"]) { color-scheme: light }`,`${i.root}:where([${Oe}="dark"]) { color-scheme: dark }`);return s.join(`
|
|
3
|
+
`)}var hl;var _s=N(()=>{xn();Q();hl={body:"body",root:":root"}});function Js(e){return e===!1||e==="open"||e==="closed"}function vn(e,t){let n=e?.$shadow;if(Js(n))return n===!1?null:n;let r=t?.shadow;return Js(r)&&r!==!1?r:null}function ks(e,t){return t===null?e:":host"}function Qt(e,t){let n=[];for(let[r,i]of(e.parameters??[]).entries()){let s=Ls(i);if(!s)continue;let o=js(i)?`_a[${r}] === undefined ? ${JSON.stringify(i.default)} : _a[${r}]`:`_a[${r}]`;n.push(`${JSON.stringify(s)}: ${o}`)}return`(..._a) => { const _args = { ${n.join(", ")} }; return ${t}; }`}function Ls(e){return C(e)?e:e?.name??""}function js(e){return O(e)&&"default"in e}function Tn(e,t){let n=jr(e,t);return n===e?e:`${n} as ${e}`}function jr(e,t){let n=t?.$export;return C(n)&&n!==""?n:e}function Pn(e,t,n={}){let{statePrefix:r="state",indent:i="",collect:s}=n,{url:o}=t,a=D(o),c=t.method??"GET";if(t.manual)return`${i}// ${e}: manual Request — fetch triggered by user action`;let l=[`// ${e}: auto-fetch from ${a?"(dynamic URL)":o}`,s?`${s}.push(effect(() => {`:"effect(() => {"];if(a)l.push(` const url = \`${gl(o,r)}\`;`,' if (!url || url === "undefined" || url.includes("undefined")) return;');else l.push(` const url = ${JSON.stringify(o)};`);let u=[];if(c!=="GET")u.push(`method: ${JSON.stringify(c)}`);if(t.headers)u.push(`headers: ${JSON.stringify(t.headers)}`);if(t.body){let d=O(t.body)?JSON.stringify(JSON.stringify(t.body)):JSON.stringify(t.body);u.push(`body: ${d}`)}let f=u.length>0?`, { ${u.join(", ")} }`:"";return l.push(` fetch(url${f})`," .then(r => r.ok ? r.json() : Promise.reject(r.statusText))",` .then(d => { ${r}.${e} = d; })`,` .catch(e => { ${r}.${e} = { error: String(e) }; });`,s?"}));":"});"),l.map((d)=>`${i}${d}`).join(`
|
|
4
|
+
`)}function gl(e,t){if(t==="state")return e;return e.replaceAll(/\$\{([^}]*)\}/g,(n,r)=>`\${${r.replaceAll(/(?<!this\.)\bstate\./g,`${t}.`)}}`)}function In(e){if(!O(e))return!1;if(e.state)for(let[t,n]of Object.entries(e.state)){if(t==="$site"||t==="$page")continue;if(!O(n)||Array.isArray(n))return!0;if(n.timing==="compiler")continue;if(n.$prototype)return!0;if("default"in n)return!0;if(ze(n))continue;return!0}if(e.$switch)return!0;if(X(e)||hr(e.children))return!0;if(Array.isArray(e.children)&&e.children.some((t)=>In(t)))return!0;for(let[t,n]of Object.entries(e)){if(Be.has(t))continue;if(H(n))return!0;if(D(n))return!0}if(O(e.style)){for(let t of Object.values(e.style))if(D(t))return!0}if(O(e.attributes)){for(let t of Object.values(e.attributes))if(D(t))return!0}return!1}function Ds(e){if(!O(e))return!1;if(e.$switch)return!0;if(X(e)||hr(e.children))return!0;for(let[t,n]of Object.entries(e)){if(Be.has(t))continue;if(H(n))return!0;if(D(n))return!0}if(O(e.style)){for(let t of Object.values(e.style))if(D(t))return!0}if(O(e.attributes)){for(let t of Object.values(e.attributes))if(D(t))return!0}return!1}function wt(e,t=null,n={},r={}){let i=e?.state?kr(e.state,t):t??Fs();return{media:r,scope:i,scopeDefs:n}}function Fs(e=null){return Object.create(e)}function Bs(e){return e[Ms]}function Jr(e,t){if(C(e)){for(let s of e.matchAll(yl))t.add(s[1]);for(let s of e.matchAll(xl))t.add(s[1]);return}if(Array.isArray(e)){for(let s of e)Jr(s,t);return}if(!O(e))return;let n=e,{operator:r,target:i}=n;if(C(r)&&De(r)&&H(i)&&i.$ref.startsWith("#/state/"))t.add(i.$ref.slice(8).split("/")[0]);for(let s of Object.values(n))Jr(s,t)}function kr(e={},t=null){let n=Fs(t),r=t?Bs(t):void 0,i=new Set(r);Object.defineProperty(n,Ms,{configurable:!0,enumerable:!1,value:i,writable:!0});let s=new Set;for(let l of Object.values(e))if(he(l)||ge(l))Jr(l.body??l.$expression,s);for(let l of s)if(l in e)i.add(l);for(let[l,u]of Object.entries(e)){if(!O(u)||Array.isArray(u)){We(n,l,An(u));continue}if("default"in u){We(n,l,An(u.default));continue}if(!u.$prototype&&!("$expression"in u)&&!ze(u))We(n,l,An(u))}let o=[],a=[];for(let[l,u]of Object.entries(e)){if(D(u)){o.push([l,u]);continue}if(!O(u))continue;if(ge(u)){let f=u.$expression;if(it(u)){let d=u.parameters;We(n,l,(...m)=>{let h={};for(let[p,g]of d.entries()){let y=Ls(g);if(!y)continue;h[y]=m[p]===void 0&&js(g)?g.default:m[p]}return ye(f,n,null,{args:h})})}else if(De(f.operator))We(n,l,(d,m)=>ye(f,d,m));else Ir(n,l,()=>ye(f,n,null));continue}if(he(u)){if(Ye(u)){let{body:f}=u;We(n,l,(d,m)=>{$t(f,d??n,m??null)})}else if(C(u.body)){let f=u.parameters?je(u.parameters):u.arguments??[],{body:d}=u,m=f.includes("state")?f:["state",...f],h=Function(...m,d),p=(g,y)=>h(...m.map((E)=>E==="state"?g:y));if(st(d))Ir(n,l,()=>p(n)),a.push([l,d]);else We(n,l,p)}else We(n,l,()=>{}),i.add(l);continue}if(Ge(u)&&(u.$prototype==="LocalStorage"||u.$prototype==="SessionStorage")){We(n,l,An(u.default??null));continue}if(Ge(u)&&u.$prototype==="Request")i.add(l)}let c=!0;while(c){c=!1;for(let[l,u]of[...a,...o])if(!i.has(l)&&Ws(u,n))i.add(l),c=!0}for(let[l,u]of o)Ir(n,l,()=>Mr(u,n));return n}function We(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})}function Ir(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:n})}function W(e,t){if(H(e))return Sl(e.$ref,t);if(D(e))return Mr(e,t);return e}function de(e){return H(e)}function Sl(e,t){if(!C(e))return e;if(e.startsWith("$map/")){let n=e.split("/"),r=n[1],s=t.$map?.[r]??t[`$map/${r}`];return n.length>2?_r(s,n.slice(2).join("/")):s}if(e.startsWith("#/state/"))return _r(t,e.slice(8));return _r(t,e)??null}function Ws(e,t){if(!t)return!1;let n=Bs(t);for(let r of e.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*(\()?/g)){if(r[2])continue;let i=r[1];if(n?.has(i))return!0;let s;try{s=t[i]}catch{continue}if(Ae(s))return!0}return!1}function _n(e){return En(e)?`(${e.slice(2,-1)})`:`\`${e}\``}function Mr(e,t){if(Ws(e,t))return null;let n=["state","$map","$site","$page"],r=[t,t?.$map,t?.$site,t?.$page];try{let i=En(e)?`return (${e.slice(2,-1)})`:`return \`${e}\``;return Function(...n,i)(...r)}catch{return null}}function _r(e,t){return te(e,t)}function An(e){if(!O(e))return e;return structuredClone(e)}function $l(e,t){if(!e||!t)return"";return Object.entries(e).filter(([n,r])=>!n.startsWith(":")&&!n.startsWith(".")&&!n.startsWith("&")&&!n.startsWith("[")&&!n.startsWith("@")&&D(r)).map(([n,r])=>{let i=W(r,t);return i==null?null:`${pe(n)}: ${i}`}).filter(Boolean).join("; ")}function ct(e,t,n=""){let r="",i=W(e.id,t),s=W(e.className,t),o=W(e.hidden,t),a=W(e.tabIndex,t),c=W(e.title,t),l=W(e.lang,t),u=W(e.dir,t);if(i)r+=` id="${_(String(i))}"`;if(s)r+=` class="${_(String(s))}"`;if(o)r+=" hidden";if(a!==void 0&&a!==null)r+=` tabindex="${_(String(a))}"`;if(c)r+=` title="${_(String(c))}"`;if(l)r+=` lang="${_(String(l))}"`;if(u)r+=` dir="${_(String(u))}"`;let f=[$l(e.style,t),n].filter(Boolean).join("; ");if(f)r+=` style="${_(f)}"`;if(e.attributes)for(let[d,m]of Object.entries(e.attributes)){let h=W(m,t);if(fe(h)){let p=at(d,h);if(p!==null)r+=p===""?` ${d}`:` ${d}="${_(p)}"`;continue}if(C(h)||ve(h))r+=` ${d}="${_(String(h))}"`}if(e.$static)r+=" data-jx-static";else if(e.$prerendered)r+=" data-jx-prerendered";return r}function Zt(e,t=" "){return e?"":`
|
|
5
|
+
${t}`}function Jn(){let e=JSON.stringify(yn),t=JSON.stringify(Oe);return`(function(){try{var s=localStorage.getItem(${e});if(s==="light"||s==="dark"){document.documentElement.setAttribute(${t},s)}}catch(e){}})()`}function Cn(e,t,n,r){for(let i of gt(t,{mediaQueries:r,resolveValue:(s,o)=>Hs(s,o,n),scope:n}))e.push(i.text)}function Hs(e,t,n){let r=C(t)?t:t.$ref;return El.push({property:e,selector:n,source:r}),null}function kn(){return`const __jxEnumAttrs = new Set(${JSON.stringify(Rs())});
|
|
6
|
+
function ${vt}(n, v) {
|
|
7
7
|
if (typeof v !== 'boolean') return v;
|
|
8
8
|
const l = n.toLowerCase();
|
|
9
9
|
if (l.startsWith('aria-') || __jxEnumAttrs.has(l)) return String(v);
|
|
10
10
|
return v ? '' : null;
|
|
11
|
-
}`}function
|
|
12
|
-
|
|
11
|
+
}`}function Us(){let e=`new RegExp(${JSON.stringify(bn.source)}, ${JSON.stringify(bn.flags)})`,t=`Symbol.for(${JSON.stringify(Rr)})`,n=JSON.stringify(Nr),r=JSON.stringify(wn);return[`const __jxSlotWs = ${e};`,`const __jxSlotRec = globalThis[${t}] || (globalThis[${t}] = new WeakMap());`,`function ${Dr}(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 ${Fr}(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(`
|
|
12
|
+
`)}function Et(e){for(let t of Br(e)){if(X(t)){if(t.map&&Et([t.map]))return!0;continue}if(!Ut(t))continue;if(t.tagName==="slot")return!0;let n=Object.values(t.cases??{}).filter((r)=>Ut(r)&&!de(r));if(Et(n)||Et(t.children))return!0}return!1}function Br(e){if(X(e))return[e];if(!Array.isArray(e))return[];return e}function Ct(e,t={},n=null){let r=[],i=Is(O(n)?n:{},t,(o)=>o,Hs);if(i!=="")r.push(i);if(bt(e,r,t,"",{n:0}),r.length===0)return"";return`<style>
|
|
13
|
+
${bl(r.join(`
|
|
13
14
|
`))}
|
|
14
|
-
</style>`}function
|
|
15
|
-
|
|
16
|
-
`);
|
|
17
|
-
`)
|
|
15
|
+
</style>`}function bl(e){return e.replaceAll(/<\/(?=style)/gi,String.raw`<\/`)}function bt(e,t,n,r="",i,s="jx"){let o=i??{n:0};if(!O(e))return;if(e.style&&!e.id&&!e.className)e.className=`${s}-${o.n}`,o.n+=1;let a=ht(e.tagName).join(", ")||"*",c=e.id?`#${e.id}`:e.className?`.${e.className.split(" ")[0]}`:a;if(e.style)Cn(t,e.style,c,n);if(Array.isArray(e.children))for(let l of e.children)bt(l,t,n,c,o,s);if(O(e.cases))for(let l of Object.values(e.cases))bt(l,t,n,c,o,s)}function _(e){return String(e).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Ln(e){return e.split("-").map((t)=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}function Vs(e){let t=new Map;return Ks(e,t),[...t.values()]}function Ks(e,t){if(!O(e))return;if(e.state){for(let[n,r]of Object.entries(e.state))if(mr(r))t.set(r.$export,{exportName:r.$export,key:n,src:r.$src})}if(Array.isArray(e.children))for(let n of e.children)Ks(n,t)}function Hr(e,t){if(C(e))return e;let n=ht(e);if(n.length===0)return"div";if(!Je(e))return n[0];let r=e.$expression,i=r.target;if(r.operator==="?:")return W(i,t)?r.value:r.initial;let s=W(i,t);return r.cases[String(s)]??r.default}function wl(e){if(!e?.slotIds)return null;return e.slotIds.n+=1,e.slotIds.n}function vl(e,t,n,r=null){let i=new Map;for(let s of Br(e)){let o="",a=!0,c;if(C(s)||ve(s)||fe(s)){if(c=n(s),bn.test(c))continue;a=c!==""}else if(X(s))c="";else if(!Ut(s))c=n(s),a=c!=="";else{let u=W(s.attributes?.slot,t),f=C(s.slot)?W(s.slot,t):null;if(C(u)&&u!=="")o=u,c=n(s);else if(C(f)&&f!==""){o=f;let{slot:d,...m}=s;c=n({...m,attributes:{...m.attributes,slot:f}})}else c=n(s)}let l=i.get(o);if(l)l.html=l.html===""?c:`${l.html}
|
|
16
|
+
${c}`,l.content||=a;else i.set(o,{content:a,html:c})}return{groups:i,id:r,taken:new Set}}function qs(e,t,n){for(let r of Br(e)){if(X(r)||!Ut(r))continue;if(r.tagName==="slot"){let i=W(r.attributes?.name,t);n.taken.add(C(i)?i:"")}qs(r.children,t,n)}}function Al(e){let t=null,n={};for(let[r,i]of Object.entries(e??{}))if(r.startsWith("props.")&&r.length>6)t??={},t[r.slice(6)]=i;else n[r]=i;return{lifted:t,rest:n}}function Ys(e,t){if(!t)return kr(e.state??{},null);let n={...e.state};for(let[r,i]of Object.entries(t)){let s=n[r];n[r]=O(s)&&!Array.isArray(s)&&"default"in s?{...s,default:i}:i}return kr(n,null)}function Cl(e,t){return Object.fromEntries(Object.entries(e??{}).flatMap(([n,r])=>{if(!D(r))return[];let i=W(r,t);return i==null?[]:[[n,i]]}))}function Xt(e,t,n,r){if(e.textContent!==void 0){let i=W(e.textContent,t);return i!=null?_(String(i)):""}if(e.innerHTML){let i=W(e.innerHTML,t);return i!=null?String(i):e.innerHTML}if(Array.isArray(e.children))return e.children.map((i)=>On(i,t,n,r)).join(`
|
|
17
|
+
`);return""}function On(e,t,n=null,r=null){if(C(e)){if(D(e)&&t){let a=Mr(e,t);return a!=null?_(String(a)):_(e)}return _(e)}if(ve(e)||fe(e))return _(String(e));if(Array.isArray(e))return e.map((a)=>On(a,t,n,r)).join(`
|
|
18
|
+
`);if(!O(e))return"";if(e.$prototype==="Array")return"";if(e.$switch){let a=e.tagName??"div",c=ct(e,t),l=W(e.$switch,t),u=l==null?void 0:e.cases?.[String(l)],f=u!==void 0&&!de(u)?On(u,t,n,r):"";return`<${a}${c}>${f}</${a}>`}let i=Hr(e.tagName,t);if(i==="slot"&&n){let a=W(e.attributes?.name,t),c=C(a)?a:"",l;if(!n.taken.has(c))n.taken.add(c),l=n.groups.get(c);let u=l?.html??"";if(u!==""&&n.id!==null)u=`<!--${wn} ${n.id} ${encodeURIComponent(c)}-->${u}<!--/${wn} ${n.id}-->`;if(l?.content)return qs(e.children,t,n),u;let f=Xt(e,t,n,r);return u===""?f:f===""?u:`${u}
|
|
19
|
+
${f}`}let s=r?.componentDefs.get(i);if(s&&r)return Ol(e,s,t,n,r);let o=ct(e,t);if(Wr.has(i))return`<${i}${o}>`;return`<${i}${o}>${Xt(e,t,n,r)}</${i}>`}function Ol(e,t,n,r,i){let s=t.tagName,{lifted:o,rest:a}=Al(e.attributes),c={...o,...e.$props},l={};for(let[x,T]of Object.entries(c))l[x]=W(T,n)??T;let u=Object.keys(l).length>0,f=i.path??[],d={key:JSON.stringify(l),tag:s},m=[...f.map((x)=>x.tag),s].join(" → ");if(f.some((x)=>x.tag===d.tag&&x.key===d.key))throw Error(`Component <${s}> renders itself: ${m}. A component cannot appear inside its own `+"definition with the same props — the expansion would never end.");if(f.length>=Pr)throw Error(`Component nesting exceeds ${Pr} levels: ${m}. A component that renders itself with changing props needs a case that stops.`);let h={...i,path:[...f,d]},{children:p}=e,g=(x)=>On(x,n,r,i),y=vn(t,i.defaults),E=Tl(t),A=Ys(t,u?l:null),w,S=null;if(y){let x=Array.isArray(p)?p.map((T)=>g(T)).join(`
|
|
20
|
+
`):"";w=`<template shadowrootmode="${y}"><link rel="stylesheet" href="/components/${s}.css">${Xt(t,A,null,h)}</template>${x}`}else{S=!E&&Et(t.children)?wl(i):null;let x=vl(p,n,g,S);w=Xt(t,A,x,h)}let b=Object.entries(Cl(t.style,A)).map(([x,T])=>`${pe(x)}: ${T}`).join("; "),v={...e};if(delete v.$props,delete v.children,v.attributes=!E&&u?{...a,"data-jx-props":JSON.stringify(l)}:a,S!==null)v.attributes={...v.attributes,[Nr]:String(S)};if(E)v.$static=!0;else v.$prerendered=!0;return`<${s}${ct(v,n,b)}>${w}</${s}>`}function Lm(e,t=null,n=null,r=null){return Xt(e,Ys(e,t),n,r)}function Tl(e){return Lr(e)}function Lr(e){if(!O(e))return!0;if(Array.isArray(e))return e.every((t)=>Lr(t));if(e.$prototype)return!1;if(e.$ref)return!1;if(e.state)for(let t of Object.values(e.state)){if(!O(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)=>Lr(t));if(X(e.children))return!1;return!0}function Nl(e,t){return Kt(e).map((n)=>Rl(n,t)).join(", ")}function Rl(e,t){if(e.startsWith("&"))return e.replaceAll("&",t);if(e.startsWith(":host")){let n=/^:host\((.*)\)$/.exec(e)?.[1];if(t===":host")return e;return n===void 0?t:`${t}${n}`}if(t===":host"&&Pl.test(e))return e;return`${t}${e}`}function jm(e,t,n=null,r={},i=null){let s=[],o=ks(e,i);if(O(t)){let a={},c=[];for(let[l,u]of Object.entries(t))if(H(u))a[l]=u;else if(O(u)&&!Array.isArray(u))c.push([l,u]);else if(!l.startsWith("@")&&!Xe(l))a[l]=u;Cn(s,a,o,r);for(let[l,u]of c)if(l.startsWith("@"))Cn(s,{[l]:u},o,r);else if(Xe(l))Cn(s,u,Nl(l,o),r)}if(n&&Array.isArray(n.children)){let a={n:0};for(let c of n.children)bt(c,s,r,"",a,e)}return s.length>0?`${s.join(`
|
|
18
21
|
`)}
|
|
19
|
-
`:""}var Os,wn="https://esm.sh/@vue/reactivity@3.5.40",vn="https://esm.sh/lit-html@3.3.0",il,sl,Ze,cl,wt="__jxAttrText",Nr,ml;var lt=I(()=>{qt();Kt();gn();Es();X();xt();qt();Kt();gn();X();Os=Symbol("jx.runtimeOnlyStateKeys");il=/\bstate\.([A-Za-z_$][\w$]*)\s*(?:\+\+|--|(?:\*\*|\|\||&&|\?\?|<<|>>>|>>|[-+*/%&|^])?=(?!=))/g,sl=/\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"]);cl=[];Nr=new Set(["input","br","hr","img","meta","link","area","col","source"]);ml=/^(?:::slotted\(|::part\()/});function He(e){if(e.startsWith("\\\\?\\"))return e;return e.split("\\").join("/")}var yl,Gt=()=>yl;var Ls=I(()=>{yl=/^win/.test(globalThis.process?globalThis.process.platform:"")});function F(e,t){let n=new URL(js(e),"https://aaa.nonexistanturl.com"),r=new URL(js(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 js(e){let t=e.search(/[?#]/);return t<0?He(e):He(e.slice(0,t))+e.slice(t)}function Qt(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 Ds(e){let t=Sl.exec(e||"");if(t)return t[1].toLowerCase();return}function Fs(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 T(e){if(!e)return"";let t=e.indexOf("#");if(t>=0)e=e.substring(0,t);return e}function Bs(e){let t=Ds(e);if(t==="http"||t==="https")return!0;else if(t===void 0)return typeof window<"u";else return!1}function In(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(Jr(n.hostname))return!0;let r=n.port;if(r&&Il(parseInt(r)))return!0}catch{if(t.startsWith("/")&&!t.startsWith("//"))return!1;if(Pl(t))return!0}return!1}async function Ws(e){if(In(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(Hs(t.hostname),{all:!0,verbatim:!0});if(i.length===0||i.some(({address:s})=>Jr(s)))return{unsafe:!0};return{unsafe:!1,addresses:i}}function Jr(e){let t=Hs(e);if(!t)return!0;if(t==="localhost"||vl.some((i)=>t.endsWith(i)))return!0;let n=Us(t);if(n)return Vs(n);let r=Al(t);if(r)return Cl(r);return!1}function Hs(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 Us(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 Vs([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 Al(e){if(!e.includes(":"))return;let t=e,n=t.lastIndexOf(":"),r=t.slice(n+1);if(r.includes(".")){let c=Us(r);if(!c)return;let u=c[0]*256+c[1],l=c[2]*256+c[3];t=`${t.slice(0,n+1)}${u.toString(16)}:${l.toString(16)}`}let i=t.split("::");if(i.length>2)return;let s=Ms(i[0]),o=i.length===2?Ms(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 Ms(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 Cl(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=Ol(e);return o?Vs(o):!1}function Ol(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 Pl(e){return e.split(/[\s/?#]+/).map((n)=>n.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((n)=>Jr(n))}function Il(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 Nn(e){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let t=Ds(e);return t===void 0||t==="file"}function Ks(e){if(Gt()){let t=xe(),n=e.toUpperCase(),i=He(t).toUpperCase(),s=n.includes(i),o=n.includes(i),a=El.test(e)||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("file://");if(!(s||o||a)&&!t.startsWith("http"))e=((u,l)=>{if(u.endsWith("/")||u.endsWith("\\"))return u+l;else return u+"/"+l})(t,e);e=He(e)}e=encodeURI(e);for(let t of wl)e=e.replace(t[0],t[1]);return e}function At(e,t){e=e.replace(/%(?![0-9A-Fa-f]{2})/g,"%25");for(let r=0;r<_r.length;r+=2)e=e.replace(new RegExp(_r[r].source,"gi"),_r[r+1]);e=decodeURI(e);let n=e.toLowerCase().startsWith("file://");if(n){if(e=e.replace(/^file:\/\//i,"").replace(/^\//,""),Gt()&&e[1]==="/")e=`${e[0]}:${e.substring(1)}`;if(t)e="file:///"+e;else n=!1,e=Gt()?e:"/"+e}if(Gt()&&!n){if(e=e.replace(xl,"\\"),e.match(/^[a-z]:\\/i))e=e[0].toUpperCase()+e.substring(1)}return e}function Ct(e){if(e=Qt(e),e.length<=1||e[0]!=="#"||e[1]!=="/")return[];return e.slice(2).split("/").map((t)=>t.replace($l,"/").replace(bl,"~"))}var xl,Sl,$l,bl,El,wl,_r,vl,Xt=(e)=>new URL(e);var ae=I(()=>{Ls();xl=/\//g,Sl=/^(\w{2,}):\/\//i,$l=/~1/g,bl=/~0/g,El=/^[a-zA-Z]:[\\/]/,wl=[[/\?/g,"%3F"],[/#/g,"%23"]],_r=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%3F/g,"?",/%40/g,"@"],vl=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function qs(){let e={},t=this;for(let n of _l(t))if(typeof n==="string"){let r=t[n],i=typeof r;if(!Nl.includes(i))e[n]=r}return e}function _l(e,t=[]){let n=[];while(e&&e!==Rl)n=n.concat(Object.getOwnPropertyNames(e),Object.getOwnPropertySymbols(e)),e=Object.getPrototypeOf(e);let r=new Set(n);for(let i of t.concat(Tl))r.delete(i);return r}function ce(e){return e instanceof $e||e instanceof Ot}function Lr(e){if(e.path===null)e.path=[];return e}var Nl,Tl,Rl,$e,Ot,Ie,Tn,Ne,Rn,Zt,kr,Pt;var be=I(()=>{ae();Nl=["function","symbol","undefined"],Tl=["constructor","prototype","__proto__"],Rl=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=qs.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};Ot=class Ot 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 '${At(e.$refs._root$Ref.path)}'`}toJSON=qs.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 Ot.getParserErrors(this.files)}};Ie=class Ie extends $e{code="EPARSER";name="ParserError";constructor(e,t,n){super(`Error parsing ${t}: ${e}`,t,n)}};Tn=class Tn 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)}};Rn=class Rn extends $e{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(e){super(`Could not find resolver for "${e}"`,e)}};Zt=class Zt 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.`,T(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`)}};Pt=class Pt extends $e{code="EINVALIDPOINTER";name="InvalidPointerError";constructor(e,t){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,T(t))}}});function z(e,t,n=!1){let r=It(t,n);return r?F(e,r):e}function _n(e){if(!e||typeof e!=="object"||ArrayBuffer.isView(e))return!1;if(It(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 Jn(e,t,n,r,i=!1){if(!i)return;let s=new Map,o=new Set,a=(c,u,l,f)=>{if(!c||typeof c!=="object"||ArrayBuffer.isView(c)||o.has(c))return;let m=Q(c,l),h=z(u,c,m),d=`${m}:${h}`,p=s.get(c);if(p?.has(d))return;if(p)p.add(d);else s.set(c,new Set([d]));if(o.add(c),h!==u)e._addAlias(h,c,r,i,m,f);for(let g of Object.keys(c))a(c[g],h,m,Jl(f,g));o.delete(c)};a(n,t,!1,t+"#")}function Jl(e,t){return e+"/"+t.replace(/%/g,"%25").replace(/~/g,"~0").replace(/\//g,"~1")}function It(e,t=!1){if(!e||typeof e!=="object")return;let r=Q(e,t)?e.id:e.$id;if(typeof r==="string"&&r.length>0)return r;return}function Q(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=I(()=>{ae()});function ut(e,t){return et(t)?jr.get(e)?.get(t):void 0}function Te(e,t,n,r){if(t.child)return t.child(n,r);let i=ut(e,r);if(i)return i;let s=Q(r,t.legacyIdScope),o=t.dynamicIdScope&&et(r)&&!ArrayBuffer.isView(r)?z(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 en(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,u={...!s&&Object.hasOwn(a,"$ref")?r:n,value:t,child(f,m){if(!((!s||f!=="$ref")&&Object.hasOwn(a,f)))return Te(e,n,f,m);if(!i||!et(m))return Te(e,r,f,m);let d=a[f],p=Te(e,r,f,d);if(!et(d)||Array.isArray(d))return{...p,value:m};let g=Object.hasOwn(o,f)?o[f]:void 0;if(et(g)&&!Array.isArray(g))return ut(e,m)||en(e,m,Te(e,n,f,g),p,!0,!1);return{...p,value:m}}},l=jr.get(e);if(!l)l=new WeakMap,jr.set(e,l);return l.set(t,u),u}function et(e){return e!==null&&typeof e==="object"}var jr;var Mr=I(()=>{Ue();jr=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||T(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=Gs(e),this.$ref.dynamicIdScope&&!Xs(this.$ref))this.legacyIdScope=Q(this.value,this.legacyIdScope),this.scopeBase=z(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 u=this.circular,l=this.chainCircular,f=J.isExtended$Ref(this.value);if(kn(this,t,n,r))this.path=tt.join(this.path,s.slice(c));else if(f)this.circular=u,this.chainCircular=l;let m=s[c];if(this.value===null||typeof this.value!=="object"&&typeof this.value!=="function"){this.value=null;let h=this.$ref.path||"",d=this.path.replace(h,""),p=tt.join("",o),g=n?.replace(h,"");throw new Zt(m,Ys(this.originalPath),d,p,g)}if(!Object.hasOwn(this.value,m)||this.value[m]===void 0||this.value[m]===null&&c===s.length-1){let h=!1;for(let b=s.length-1;b>c;b--){let A=s.slice(c,b+1).join("/");if(Object.hasOwn(this.value,A)&&this.value[A]!==void 0){this.value=this.value[A],this.setLocation(Te(this.$ref.$refs,this.location,A,this.value)),c=b,h=!0;break}}if(h){this.chainCircular=l;continue}if(Object.hasOwn(this.value,m)&&this.value[m]===null){this.value=Ln,this.setLocation(Te(this.$ref.$refs,this.location,m,null)),this.chainCircular=l;continue}this.value=null;let d=this.$ref.path||"",p=this.path.replace(d,""),g=tt.join("",o),y=n?.replace(d,"");throw new Zt(m,Ys(this.originalPath),p,g,y)}else this.value=this.value[m];this.chainCircular=l,o.push(m),this.setLocation(Te(this.$ref.$refs,this.location,m,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,u=typeof n==="string"?F(this.$ref.$refs._root$Ref.path,n):n;if(J.isAllowed$Ref(this.value,t)&&c===u&&c!==this.path)this.chainCircular=!0;else if(!this.value||c)kn(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(Fl(this.path,r),this.value=Gs(e),this.$ref.dynamicIdScope&&!Xs(this.$ref))this.legacyIdScope=Q(this.value,this.legacyIdScope),this.scopeBase=z(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(kn(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=zs(this,i,{});this.setLocation(Te(this.$ref.$refs,this.location,i,this.value))}return kn(this,n),i=r[r.length-1],zs(this,i,t),e}setLocation(e){this.location=e,this.scopeBase=e.scopeBase,this.legacyIdScope=e.legacyIdScope}static parse(e,t){let n=Qt(Se(e).substring(1));if(!n)return[];let r=n.split("/");for(let i=0;i<r.length;i++)r[i]=r[i].replace(jl,"/").replace(Ml,"~");if(r[0]!=="")throw new Pt(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(Ll,"~0").replace(kl,"~1")}return e}}function Ys(e){try{return decodeURI(e)}catch{return e}}function kn(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:u}=e,l=e.location?.dynamicIdScope?e.scopeBase:e.location?.path||e.path,f=F(l,e.value.$ref);if(f===e.path&&!Bl(s))return e.circular=!0,e.chainCircular=!0,i;let m=typeof s==="string"?F(e.$ref.$refs._root$Ref.path,s):s;if(f===m&&f!==e.path)return e.chainCircular=!0,i;if(r.has(f))return e.chainCircular=!0,i;let h=t?.dereference?.maxDepth??500;if(r.size>=h)throw RangeError(`Maximum dereference depth (${h}) 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 d=e.$ref.$refs._resolve(f,u,t,r,a);if(d===null)return i;if(e.indirections+=d.indirections+1,e.chainCircular||=d.circular||d.chainCircular,a){if(e.chainCircular)return i;return e.value=J.dereference(c,d.value,t),e.setLocation(en(e.$ref.$refs,e.value,d.location,e.location,t?.dereference?.mergeKeys??!0)),i}else e.$ref=d.$ref,e.path=d.path,e.value=d.value,e.scopeBase=d.scopeBase,e.legacyIdScope=d.legacyIdScope,e.location=d.location,s=u,i=!0}return i}finally{for(let a of o)r.delete(a)}}function zs(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}".
|
|
20
|
-
Cannot set "${t}" of a non-object.`);return n}function
|
|
21
|
-
Unsafe JSON Pointer token "${n}" cannot be used for assignment.`)}function
|
|
22
|
-
"${
|
|
23
|
-
"${
|
|
24
|
-
Parsed value is empty`);else return o}catch(o){if(!o&&t.continueOnError)throw new
|
|
25
|
-
${c}`}let f=
|
|
26
|
-
`,c+=`${"-".repeat(n.indent+
|
|
27
|
-
`;for(let
|
|
28
|
-
`}return c.replace(/\n$/,"")}function
|
|
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
|
+
Cannot set "${t}" of a non-object.`);return n}function tu(e,t){for(let n of t)if(eu.has(n))throw new $e(`Error assigning $ref pointer "${e}".
|
|
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
|
+
"${R(n)}" not found.`);r.set(n,t)}_get$Ref(e){return e=F(this._root$Ref.path,e),this._getRef(e)}_add(e){let t=R(e),n=new J(this);return n.path=t,this._$refs[t]=n,this._root$Ref=this._root$Ref||n,n}_addAlias(e,t,n,r=!1,i=!1,s){let o=R(e);if(!o||this._$refs[o]||this._aliases[o])return this._$refs[o]||this._aliases[o];let a=new J(this);return a.path=o,a.pathType=n,a.value=t,a.dynamicIdScope=r,a.legacyIdScope=i,a.sourcePath=s,this._aliases[o]=a,a}_resolve(e,t,n,r,i=!0){let s=F(this._root$Ref.path,e),o=this._getRef(s);if(!o)throw Error(`Error resolving $ref pointer "${e}".
|
|
26
|
+
"${R(s)}" not found.`);return o.resolve(s,n,e,t,r,i)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=()=>this.values();_getRef(e){let t=R(e);return this._$refs[t]||this._aliases[t]}}function po(e,t){let n=Object.keys(e);if(t=Array.isArray(t[0])?t[0]:Array.prototype.slice.call(t),t.length>0&&t[0])n=n.filter((r)=>t.includes(e[r].pathType));return n.map((r)=>({encoded:r,decoded:e[r].pathType==="file"?Ot(r,!0):r}))}var mo=N(()=>{ft();ce()});function Xr(e){return Object.keys(e||{}).filter((t)=>typeof e[t]==="object").map((t)=>(e[t].name=t,e[t]))}function Qr(e,t,n,r,i){return e.filter((s)=>!!ho(s,t,n,r,i))}function Zr(e){return e.sort((t,n)=>(t.order??Number.MAX_SAFE_INTEGER)-(n.order??Number.MAX_SAFE_INTEGER))}async function ei(e,t,n,r){let i,s=0;return new Promise((o,a)=>{c();function c(){let f=e[s++];if(!f)return a(i);let d=!1,m=!1,h=(p,g)=>{if(m=!0,d)return;if(d=!0,p)u(f,p);else l(f,g)};try{let p=ho(f,t,n,h,r);if(p&&typeof p.then==="function")p.then((g)=>h(void 0,g),(g)=>h(g,void 0));else if(p!==void 0)h(void 0,p);else if(!m&&!iu(f,t))h(Error("No promise has been returned or callback has been called."),void 0)}catch(p){h(p,void 0)}}function l(f,d){o({plugin:f,result:d})}function u(f,d){i={plugin:f,error:d},c()}})}function iu(e,t){let n=e[t];return typeof n==="function"&&n.length>=2}function ho(e,t,n,r,i){let s=e[t];if(typeof s==="function")return s.apply(e,[n,r,i]);if(!r){if(s instanceof RegExp){s.lastIndex=0;let o=s.test(n.url);return s.lastIndex=0,o}else if(typeof s==="string")return s===n.extension;else if(Array.isArray(s))return s.indexOf(n.extension)!==-1}return s}async function su(e,t,n){let r=typeof e==="string"?e:e.url,i=typeof e==="string"?void 0:e.baseUrl,s=typeof e==="string"?void 0:e.reference,o=r.indexOf("#"),a="";if(o>=0)a=r.substring(o),r=r.substring(0,o);if(s){let u=s.indexOf("#");if(u>=0)s=s.substring(0,u)}let c=t._add(r),l={url:r,hash:a,extension:Zs(r),...s!==void 0?{reference:s}:{},...i!==void 0?{baseUrl:i}:{}};try{let u=await ou(l,n,t);c.pathType=u.plugin.name,l.data=u.result;let f=await au(l,n,t);return c.value=f.result,c.dynamicIdScope=Bn(c.value),c.legacyIdScope=Z(c.value),Wn(t,c.path,c.value,c.pathType,c.dynamicIdScope),f.result}catch(u){if(le(u))c.value=u;throw u}}async function ou(e,t,n){let r=Xr(t.resolve);r=Qr(r,"canRead",e,void 0,n),Zr(r);try{return await ei(r,"read",e,n)}catch(i){if(!i&&t.continueOnError)throw new Fn(e.url);else if(!i||!("error"in i))throw SyntaxError(`Unable to resolve $ref pointer "${e.url}"`,{cause:i});else if(i.error instanceof Ne)throw i.error;else{let s=i.error instanceof Error?i.error:Error(String(i.error));throw new Ne(s,e.url,{cause:i.error})}}}async function au(e,t,n){let r=Xr(t.parse),i=Qr(r,"canParse",e),s=i.length>0?i:r;Zr(s);try{let o=await ei(s,"parse",e,n);if(!o.plugin.allowEmpty&&cu(o.result))throw SyntaxError(`Error parsing "${e.url}" as ${o.plugin.name}.
|
|
27
|
+
Parsed value is empty`);else return o}catch(o){if(!o&&t.continueOnError)throw new Dn(e.url);else if(o&&o.message&&o.message.startsWith("Error parsing"))throw o;else if(!o||!("error"in o))throw SyntaxError(`Unable to parse ${e.url}`,{cause:o});else if(o.error instanceof Pe)throw o.error;else throw new Pe(o.error?.message??String(o.error),e.url,{cause:o.error})}}function cu(e){return e===void 0||e===null||typeof e==="object"&&Object.keys(e).length===0||typeof e==="string"&&e.trim().length===0||Buffer.isBuffer(e)&&e.length===0}var _t;var Vn=N(()=>{ce();Ue();Ee();_t=su});var go;var yo=N(()=>{Ee();go={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(e){let t=e.data;if(Buffer.isBuffer(t))t=t.toString();if(typeof t==="string"){if(t.trim().length===0)return;if(this.allowBOM&&t.charCodeAt(0)===65279)t=t.slice(1);try{return JSON.parse(t)}catch(n){throw new Pe(n.message,e.url)}}else return t}}});function oe(e,t){return{tagName:e,nodeKind:"scalar",implicit:t.implicit??!1,matchByTagPrefix:t.matchByTagPrefix??!1,implicitFirstChars:t.implicitFirstChars??null,resolve:t.resolve,identify:t.identify,represent:t.represent??((n)=>String(n)),representTagName:t.representTagName??(()=>e)}}function di(e,t){let n=t.finalize===void 0;return{tagName:e,nodeKind:"sequence",implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addItem:t.addItem,finalize:t.finalize??((r)=>r),carrierIsResult:n,identify:t.identify,represent:t.represent??((r)=>r),representTagName:t.representTagName??(()=>e)}}function Gn(e,t){let n=t.finalize===void 0;return{tagName:e,nodeKind:"mapping",implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addPair:t.addPair,has:t.has,keys:t.keys,get:t.get,finalize:t.finalize??((r)=>r),carrierIsResult:n,identify:t.identify,represent:t.represent??((r)=>r),representTagName:t.representTagName??(()=>e)}}function Cu(e){let t=e,n=1;if(t[0]==="-"||t[0]==="+"){if(t[0]==="-")n=-1;t=t.slice(1)}if(t.startsWith("0b"))return n*parseInt(t.slice(2),2);if(t.startsWith("0o"))return n*parseInt(t.slice(2),8);if(t.startsWith("0x"))return n*parseInt(t.slice(2),16);return n*parseInt(t,10)}function Ou(e,t){if(t){if(!Au.test(e))return j}else if(!vu.test(e))return j;let n=Cu(e);return Number.isFinite(n)?n:j}function Nu(e){let t=e,n=1;if(t[0]==="-"||t[0]==="+"){if(t[0]==="-")n=-1;t=t.slice(1)}if(t.startsWith("0b"))return n*parseInt(t.slice(2),2);if(t.startsWith("0o"))return n*parseInt(t.slice(2),8);if(t.startsWith("0x"))return n*parseInt(t.slice(2),16);return n*parseInt(t,10)}function Ru(e,t){if(t){if(!Pu.test(e))return j}else if(!Tu.test(e))return j;let n=Nu(e);return Number.isFinite(n)?n:j}function Ju(e){let t=e.replace(/_/g,""),n=1;if(t[0]==="-"||t[0]==="+"){if(t[0]==="-")n=-1;t=t.slice(1)}if(t.startsWith("0b"))return n*parseInt(t.slice(2),2);if(t.startsWith("0x"))return n*parseInt(t.slice(2),16);if(t.includes(":")){let r=0;for(let i of t.split(":"))r=r*60+Number(i);return n*r}if(t!=="0"&&t[0]==="0")return n*parseInt(t,8);return n*parseInt(t,10)}function ku(e){if(!_u.test(e))return j;let t=Ju(e);return Number.isFinite(t)?t:j}function Mu(e){if(!Lu.test(e))return j;let t=e.toLowerCase(),n=t[0]==="-"?-1:1;if("+-".includes(t[0]))t=t.slice(1);if(t===".inf")return n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(t===".nan")return NaN;let r=n*parseFloat(t);if(Number.isFinite(r)||ju.test(e))return r;return j}function Du(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}function Wu(e,t){if(t){if(!Bu.test(e))return j;let r=e.toLowerCase(),i=r[0]==="-"?-1:1;if("+-".includes(r[0]))r=r.slice(1);if(r===".inf")return i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(r===".nan")return NaN;let s=i*parseFloat(r);return Number.isFinite(s)?s:j}if(!Fu.test(e))return j;let n=Number(e);if(Number.isFinite(n))return n;return j}function Hu(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}function qu(e){if(!Vu.test(e))return j;let t=e.toLowerCase().replace(/_/g,""),n=t[0]==="-"?-1:1;if("+-".includes(t[0]))t=t.slice(1);if(t===".inf")return n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(t===".nan")return NaN;let r=0;if(t.includes(":")){for(let i of t.split(":"))r=r*60+Number(i);r*=n}else r=n*parseFloat(t);if(Number.isFinite(r)||Ku.test(e))return r;return j}function Yu(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}function zu(e){let t=e.replace(/\s/g,"");if(t.length%4!==0||!Gu.test(t))return j;let n=atob(t),r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return r}function Xu(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function xo(e,t,n,r=0,i=0,s=0,o=0){let a=new Date(Date.UTC(e,t,n,r,i,s,o));return a.setUTCFullYear(e,t,n),a}function ef(e){let t=Qu.exec(e);if(t===null)t=Zu.exec(e);if(t===null)return j;let n=+t[1],r=+t[2]-1,i=+t[3];if(!t[4]){let u=xo(n,r,i);if(u.getUTCFullYear()!==n||u.getUTCMonth()!==r||u.getUTCDate()!==i)return j;return u}let s=+t[4],o=+t[5],a=+t[6],c=0;if(s>23||o>59||a>59)return j;if(t[7]){let u=t[7].slice(0,3);while(u.length<3)u+="0";c=+u}let l=xo(n,r,i,s,o,a,c);if(l.getUTCFullYear()!==n||l.getUTCMonth()!==r||l.getUTCDate()!==i)return j;if(t[9]){let u=+t[10],f=+(t[11]||0);if(u>23||f>59)return j;let d=(u*60+f)*60000;l.setTime(l.getTime()-(t[9]==="-"?-d:d))}return l}function zn(e){if(e===null||typeof e!=="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function So(e,t){let n={};for(let r of t)if(e[r]!==void 0)n[r]=e[r];return n}function rf(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}function sf(){return{scalar:[],sequence:[],mapping:[]}}function of(e){let t=[];for(let n of e){let r=t.length;for(let i=0;i<t.length;i++){let s=t[i];if(s.nodeKind===n.nodeKind&&s.tagName===n.tagName&&s.matchByTagPrefix===n.matchByTagPrefix){r=i;break}}t[r]=n}return t}function $o(e){if(Array.isArray(e)){let t=Array.prototype.slice.call(e);for(let n=0;n<t.length;n++){if(Array.isArray(t[n]))return null;if(typeof t[n]==="object"&&Object.prototype.toString.call(t[n])==="[object Object]")t[n]="[object Object]"}return String(t)}if(typeof e==="object"&&Object.prototype.toString.call(e)==="[object Object]")return"[object Object]";return String(e)}function ti(e,t,n,r,i){let s="",o="",a=Math.floor(i/2)-1;if(r-t>a)s=" ... ",t=r-a+s.length;if(n-r>a)o=" ...",n=r+a-o.length;return{str:s+e.slice(t,n).replace(/\t/g,"→")+o,pos:r-t+s.length}}function ni(e,t){return" ".repeat(Math.max(t-e.length,0))+e}function uf(e,t){if(!e.buffer)return null;let n={...lf,...t},r=/\r?\n|\r|\0/g,i=[0],s=[],o,a=-1;while(o=r.exec(e.buffer))if(s.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&a<0)a=i.length-2;if(a<0)a=i.length-1;let c="",l=Math.min(e.line+n.linesAfter,s.length).toString().length,u=n.maxLength-(n.indent+l+3);for(let d=1;d<=n.linesBefore;d++){if(a-d<0)break;let m=ti(e.buffer,i[a-d],s[a-d],e.position-(i[a]-i[a-d]),u);c=`${" ".repeat(n.indent)}${ni((e.line-d+1).toString(),l)} | ${m.str}
|
|
28
|
+
${c}`}let f=ti(e.buffer,i[a],s[a],e.position,u);c+=`${" ".repeat(n.indent)}${ni((e.line+1).toString(),l)} | ${f.str}
|
|
29
|
+
`,c+=`${"-".repeat(n.indent+l+3+f.pos)}^
|
|
30
|
+
`;for(let d=1;d<=n.linesAfter;d++){if(a+d>=s.length)break;let m=ti(e.buffer,i[a+d],s[a+d],e.position-(i[a]-i[a+d]),u);c+=`${" ".repeat(n.indent)}${ni((e.line+d+1).toString(),l)} | ${m.str}
|
|
31
|
+
`}return c.replace(/\n$/,"")}function Eo(e,t){let n="";if(!e.mark)return e.reason;if(e.mark.name)n+=`in "${e.mark.name}" `;if(n+=`(${e.mark.line+1}:${e.mark.column+1})`,!t&&e.mark.snippet)n+=`
|
|
29
32
|
|
|
30
|
-
${e.mark.snippet}`;return`${e.reason} ${n}`}function
|
|
31
|
-
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"
";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function
|
|
32
|
-
`.repeat(e-1)}function
|
|
33
|
+
${e.mark.snippet}`;return`${e.reason} ${n}`}function bo(e){switch(e){case 48:return"\x00";case 97:return"\x07";case 98:return"\b";case 116:return"\t";case 9:return"\t";case 110:return`
|
|
34
|
+
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"
";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function pf(e){if(e<=65535)return String.fromCharCode(e);return String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function df(e){if(e>=48&&e<=57)return e-48;return(e|32)-97+10}function mf(e){if(e===120)return 2;if(e===117)return 4;return 8}function Kn(e,t,n){let r=0;while(t<n){let i=e.charCodeAt(t);if(i===10)r++,t++;else if(i===13){if(r++,t++,e.charCodeAt(t)===10)t++}else if(i===32||i===9)t++;else break}return{position:t,breaks:r}}function Ei(e){if(e===1)return" ";return`
|
|
35
|
+
`.repeat(e-1)}function hf(e,t,n){let r="",i=t,s=t,o=t;while(i<n){let a=e.charCodeAt(i);if(a===10||a===13){r+=e.slice(s,o);let c=Kn(e,i,n);r+=Ei(c.breaks),i=s=o=c.position}else if(i++,a!==32&&a!==9)o=i}return r+e.slice(s,o)}function gf(e,t,n){let r="",i=t,s=t,o=t;while(i<n){let a=e.charCodeAt(i);if(a===39)r+=e.slice(s,i)+"'",i+=2,s=o=i;else if(a===10||a===13){r+=e.slice(s,o);let c=Kn(e,i,n);r+=Ei(c.breaks),i=s=o=c.position}else if(i++,a!==32&&a!==9)o=i}return r+e.slice(s,n)}function yf(e,t,n){let r="",i=t,s=t,o=t;while(i<n){let a=e.charCodeAt(i);if(a===92){r+=e.slice(s,i),i++;let c=e.charCodeAt(i);if(c===10||c===13)i=Kn(e,i,n).position;else if(c<256&&Jo[c])r+=ko[c],i++;else{let l=mf(c),u=0;for(;l>0;l--){i++;let f=df(e.charCodeAt(i));u=(u<<4)+f}r+=pf(u),i++}s=o=i}else if(a===10||a===13){r+=e.slice(s,o);let c=Kn(e,i,n);r+=Ei(c.breaks),i=s=o=c.position}else if(i++,a!==32&&a!==9)o=i}return r+e.slice(s,n)}function wo(e,t,n,r,i,s){let o=r<0?0:r,a=e.slice(t,n).replace(/\r\n?/g,`
|
|
33
36
|
`),c=a===""?[]:(a.endsWith(`
|
|
34
37
|
`)?a.slice(0,-1):a).split(`
|
|
35
|
-
`),
|
|
36
|
-
`.repeat(
|
|
37
|
-
`.repeat(f+1);else if(f===0){if(l
|
|
38
|
-
`.repeat(f);else
|
|
39
|
-
`.repeat(
|
|
40
|
-
`.repeat(
|
|
41
|
-
`}return u}function nf(e,t){if(t.valueStart===zu)return"";let{valueStart:n,valueEnd:r}=t;if(t.fast)return e.slice(n,r);switch(t.style){case R.SINGLE_QUOTED:return ef(e,n,r);case R.DOUBLE_QUOTED:return tf(e,n,r);case R.LITERAL_BLOCK:return lo(e,n,r,t.indent,t.chomping,!1);case R.FOLDED_BLOCK:return lo(e,n,r,t.indent,t.chomping,!0);default:return Zu(e,n,r)}}function Kr(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 wo(e,t){if(e.startsWith("!<")&&e.endsWith(">"))return Kr(e.slice(2,-1));let n=e.indexOf("!",1),r=n===-1?"!":e.slice(0,n+1);return Kr(t?.[r]??rf[r]??r)+Kr(e.slice(r.length))}function af(e){if("tagStart"in e&&e.tagStart!==Rt)return e.tagStart;if("anchorStart"in e&&e.anchorStart!==Rt)return e.anchorStart;if("valueStart"in e&&e.valueStart!==Rt)return e.valueStart;if("start"in e)return e.start;return 0}function te(e,t){pt.throwAt(e.source,e.position,t,e.filename)}function vo(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 cf(e,t){let n=nf(e.source,t),r=t.tagStart===Rt?"":e.source.slice(t.tagStart,t.tagEnd),i=e.schema.defaultScalarTag;if(r!==""){if(r==="!")return{value:n,tag:i};let s=wo(r,e.tagHandlers),o=e.schema.lookupScalarTag(s);if(o){let c=o.resolve(n,!0,s);if(c===L)te(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!=="")te(e,`cannot resolve a node with !<${s}> explicit tag`);let c=a.create(s);return{value:a.carrierIsResult?c:vo(e,e.position,a,c),tag:a}}te(e,`unknown scalar tag !<${s}>`)}if(t.style===R.PLAIN)return e.schema.resolveImplicitScalarTag(n);return{value:i.resolve(n,!1,i.tagName),tag:i}}function uo(e,t,n){let r=t.tagStart===Rt?"":e.source.slice(t.tagStart,t.tagEnd);return r===""||r==="!"?n:wo(r,e.tagHandlers)}function Ao(e){return e.nodeKind==="mapping"}function fo(e){if(e.totalMergeKeys++,e.maxTotalMergeKeys!==-1&&e.totalMergeKeys>e.maxTotalMergeKeys)te(e,`merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`)}function po(e,t,n,r){fo(e);for(let i of r.keys(n)){if(fo(e),t.tag.has(t.value,i))continue;let s=t.tag.addPair(t.value,i,r.get(n,i));if(s)te(e,s);t.overridable??=new Set,t.overridable.add(i)}}function lf(e,t,n,r){if(e.position=t.keyPosition,Ao(r))po(e,t,n,r);else if(r.nodeKind==="sequence"&&Array.isArray(n)){if(n.length>100)te(e,"abnormal merge sequence size");for(let i of n){let s=e.nodeTags.get(i);if(!s)te(e,"cannot merge mappings; the provided source object is unacceptable");po(e,t,i,s)}}else te(e,"cannot merge mappings; the provided source object is unacceptable")}function uf(e,t,n,r,i){if(e.position=t.keyPosition,t.keyIsMerge){lf(e,t,r,i);return}if(!e.json&&t.tag.has(t.value,n)&&!t.overridable?.has(n))te(e,"duplicated mapping key");let s=t.tag.addPair(t.value,n,r);if(s)te(e,s);t.overridable?.delete(n)}function qr(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(Ao(n))e.nodeTags.set(t,n);let i=r.tag.addItem(r.value,t,r.index++);if(i)te(e,i)}else if(r.hasKey){let i=r.key;r.key=void 0,r.hasKey=!1,uf(e,r,i,t,n)}else r.key=t,r.keyPosition=e.position,r.hasKey=!0,r.keyIsMerge=n.tagName===of}function Yr(e,t,n,r,i){if(t.anchorStart!==Rt){let s={value:n,tag:r,isValueFinal:i};return e.anchors.set(e.source.slice(t.anchorStart,t.anchorEnd),s),s}return null}function ff(e,t){let n={...fi,...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=af(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}=cf(n,r);Yr(n,r,i,s,!0),qr(n,i,s);break}case q.SEQUENCE:{let i=uo(n,r,"tag:yaml.org,2002:seq"),s=n.schema.lookupSequenceTag(i);if(!s)te(n,`unknown sequence tag !<${i}>`);let o=s.create(i),a=Yr(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=uo(n,r,"tag:yaml.org,2002:map"),s=n.schema.lookupMappingTag(i);if(!s)te(n,`unknown mapping tag !<${i}>`);let o=s.create(i),a=Yr(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)te(n,`aliases exceeded maxAliases (${n.maxAliases})`);let i=n.source.slice(r.anchorStart,r.anchorEnd),s=n.anchors.get(i);if(!s)te(n,`unidentified alias "${i}"`);if(!s.isValueFinal)te(n,`recursive alias "${i}" is not supported for tag ${s.tag.tagName} because it uses finalize()`);qr(n,s.value,s.tag);break}case q.POP:{let i=n.frames.pop();if(i.kind==="mapping"&&i.hasKey)n.position=i.keyPosition,te(n,"incomplete mapping pair in event stream");if(i.kind==="document")n.documents.push(i.value);else{let s=i.tag.carrierIsResult?i.value:vo(n,i.position,i.tag,i.value);if(i.anchor)i.anchor.value=s,i.anchor.isValueFinal=!0;qr(n,s,i.tag)}break}}}return n.documents}function yf(e,t,n){e.events.push({type:q.DOCUMENT,explicitStart:t,explicitEnd:n,directives:e.directives})}function To(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 Ro(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 mo(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 Dt(e,t,n,r,i,s,o,a,c=Ee.CLIP,u=-1,l=!1){e.events.push({type:q.SCALAR,valueStart:t,valueEnd:n,anchorStart:r,anchorEnd:i,tagStart:s,tagEnd:o,style:a,chomping:c,indent:u,fast:l})}function xf(e,t,n){e.events.push({type:q.ALIAS,anchorStart:t,anchorEnd:n})}function _t(e){e.events.push({type:q.POP})}function le(e){Dt(e,M,M,M,M,M,M,R.PLAIN)}function ho(){return{anchorStart:M,anchorEnd:M,tagStart:M,tagEnd:M}}function Jt(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,eventsLength:e.events.length}}function kt(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 Z(e){return e===10||e===13}function Ft(e){return e===9||e===32}function Re(e){return Ft(e)||Z(e)}function Ve(e){return e===0||Re(e)}function dt(e){return e===44||e===91||e===93||e===123||e===125}function Sf(e){return e>=48&&e<=57?e-48:-1}function $f(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 bf(e){if(e===120)return 2;if(e===117)return 4;if(e===85)return 8;return 0}function Ef(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 Fn(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 ie(e,t){let n=0,r=e.input.charCodeAt(e.position),i=e.position===e.lineStart||Re(e.input.charCodeAt(e.position-1));while(r!==0){while(Ft(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(!Z(r)&&r!==0);if(!Z(r))break;Fn(e),n++,i=!0,r=e.input.charCodeAt(e.position);while(r===32)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return n}function jt(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||Re(r)}return!1}function _o(e){if(e.position===e.lineStart&&e.input.charCodeAt(e.position)===65279)e.position++,e.lineStart=e.position}function di(e){if(e.position!==e.lineStart)return!1;if(jt(e))return!0;if(e.input.charCodeAt(e.position)!==65279)return!1;let t=Jt(e);_o(e),ie(e,!0);let n=e.input.charCodeAt(e.position),r=e.position===e.lineStart&&(n===37||n===45&&jt(e));return kt(e,t),r}function go(e){let t=e.input.charCodeAt(e.position);while(t!==0&&!Z(t))t=e.input.charCodeAt(++e.position)}function Jo(e,t,n){let r=pf.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 wf(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,u;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");u=e.input.slice(c,e.position),e.position++}else{while(a!==0&&!Re(a)&&!(n&&dt(a))){if(a===33)if(!s){if(o=e.input.slice(c-1,e.position+1),!Io.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(u=e.input.slice(c,e.position),df.test(u))P(e,"tag suffix cannot contain flow indicator characters")}if(u&&!(i?mf.test(u):hf.test(u)))P(e,`tag name cannot contain such characters: ${u}`);if(!i&&o!=="!"&&o!=="!!"&&!Co.call(e.tagHandlers,o))P(e,`undeclared tag handle "${o}"`);return t.tagStart=r,t.tagEnd=e.position,!0}function vf(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&&!Re(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 Af(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&&!Re(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 xf(e,n,e.position),!0}function Zr(e,t){if(ie(e,!1),e.lineIndent<t)P(e,"deficient indentation")}function Cf(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++,Dt(e,r,o,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,R.SINGLE_QUOTED,Ee.CLIP,-1,i),!0}if(Z(s))i=!1,Zr(e,t);else if(e.position===e.lineStart&&jt(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 Of(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++,Dt(e,r,o,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,R.DOUBLE_QUOTED,Ee.CLIP,-1,i),!0}if(s===92){i=!1;let o=e.input.charCodeAt(++e.position);if(Z(o))Zr(e,t);else if(Ef(o))e.position++;else{let a=bf(o);if(a===0)P(e,"unknown escape sequence");while(a-- >0)if(e.position++,$f(e.input.charCodeAt(e.position))<0)P(e,"expected hexadecimal character");e.position++}}else if(Z(s))i=!1,Zr(e,t);else if(e.position===e.lineStart&&jt(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 Pf(e,t,n){let r=e.input.charCodeAt(e.position),i=Ee.CLIP,s=-1,o=!1;if(r!==124&&r!==62)return!1;let a=r===124?R.LITERAL_BLOCK:R.FOLDED_BLOCK;e.position++;while(e.input.charCodeAt(e.position)!==0){let h=e.input.charCodeAt(e.position),d=Sf(h);if(h===43||h===45){if(i!==Ee.CLIP)P(e,"repeat of a chomping mode identifier");i=h===43?Ee.KEEP:Ee.STRIP,e.position++}else if(d>=0){if(d===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+d-1,o=!0,e.position++}else break}let c=!1;while(Ft(e.input.charCodeAt(e.position)))c=!0,e.position++;if(c&&e.input.charCodeAt(e.position)===35)go(e);if(Z(e.input.charCodeAt(e.position)))Fn(e);else if(e.input.charCodeAt(e.position)!==0)P(e,"a line break is expected");let u=o?s:-1,l=0,{position:f,position:m}=e;while(e.input.charCodeAt(e.position)!==0){let h=e.position,d=0;while(e.input.charCodeAt(h+d)===32)d++;let p=e.input.charCodeAt(h+d);if(p===0){if(u>=0){if(d>u)m=h+d}else if(d>0)m=h+d;break}if(di(e))break;if(!o&&u===-1&&Z(p))l=Math.max(l,d);if(!o&&u===-1&&!Z(p)){if(p===9&&d<t)e.position=h+d,P(e,"tab characters must not be used in indentation");if(d>=t&&d<l)e.position=h+d,P(e,"bad indentation of a mapping entry")}if(u===-1&&p!==0&&!Z(p)&&d<t){e.lineIndent=d,e.position=h+d;break}if(!o&&p!==0&&!Z(p)&&u===-1)u=d;let g=u===-1?t+1:u;if(p!==0&&!Z(p)&&d<g){e.lineIndent=d,e.position=h+d;break}if(go(e),m=e.position,Z(e.input.charCodeAt(e.position)))Fn(e),m=e.position}return Jo(e,f,m),Dt(e,f,m,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,a,i,u),!0}function If(e,t){let n=e.input.charCodeAt(e.position),r=t===Lt;if(n===0||Re(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 Nf(e,t,n,r){if(!If(e,n))return!1;let{position:i,position:s}=e,o=e.input.charCodeAt(e.position),a=n===Lt,c=!1;while(o!==0){if(di(e))break;if(o===58){let u=e.input.charCodeAt(e.position+1);if(Ve(u)||a&&dt(u))break}else if(o===35){if(Re(e.input.charCodeAt(e.position-1)))break}else if(a&&dt(o))break;else if(Z(o)){let{position:u,line:l,lineStart:f,lineIndent:m}=e;if(ie(e,!1),e.lineIndent>=t){c=!0,o=e.input.charCodeAt(e.position);continue}e.position=u,e.line=l,e.lineStart=f,e.lineIndent=m;break}if(!Ft(o))s=e.position+1;o=e.input.charCodeAt(++e.position)}if(s===i)return!1;return Jo(e,i,s),Dt(e,i,s,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,R.PLAIN,Ee.CLIP,-1,!c),!0}function sn(e,t){let n=e.line;if(ie(e,!0),e.line>n&&e.lineIndent<t||e.firstTabInLine!==-1&&e.lineIndent<t)P(e,"deficient indentation")}function Tf(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)Ro(e,s,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,nt.FLOW);else To(e,s,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,nt.FLOW);e.position++;while(e.input.charCodeAt(e.position)!==0){sn(e,t);let c=e.input.charCodeAt(e.position);if(c===a)return e.position++,_t(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 u=!1,l=!1;if(c===63&&Re(e.input.charCodeAt(e.position+1)))u=l=!0,e.position+=1,sn(e,t);let f=e.line,m=Jt(e),h=Mt(e,t,Lt,!1,!0);if(sn(e,t),c=e.input.charCodeAt(e.position),(i||l||e.line===f)&&c===58){if(u=!0,e.position++,sn(e,t),!i){if(mo(e,m),!h)le(e)}else if(!h)le(e);if(!Mt(e,t,Lt,!1,!0))le(e);if(sn(e,t),!i)_t(e)}else if(i&&u){if(!h)le(e);le(e)}else if(i)le(e);else if(u){if(mo(e,m),!h)le(e);le(e),_t(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 yo(e,t,n){if(e.firstTabInLine!==-1||e.input.charCodeAt(e.position)!==45||!Ve(e.input.charCodeAt(e.position+1)))return!1;To(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=ie(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)le(e);else Mt(e,t,Po,!1,!0);if(ie(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 _t(e),!0}function zr(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 u=e.input.charCodeAt(e.position+1),l=e.line;if((c===63||c===58)&&Ve(u)){if(!o)Ro(e,e.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,nt.BLOCK),o=!0;if(c===63){if(i)le(e);s=!0,i=!0}else if(i)i=!1;else le(e),s=!0,i=!1;e.position+=1,a=!0}else{if(i)le(e),i=!1;let f=Jt(e);if(!Mt(e,n,Oo,!1,!0))break;if(e.line===l){c=e.input.charCodeAt(e.position);while(Ft(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 kt(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 kt(e,f),!1;return!0}}if(Mt(e,t,Dn,!0,a))a=!1;if(!i){if(a)le(e),a=!1}if(ie(e,!0),c=e.input.charCodeAt(e.position),(e.line===l||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)le(e);if(o)_t(e);return!0}function Mt(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,u=null,l=ho(),f=n===Dn||n===Po,m=f,h=f;if(r&&ie(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 d=e.input.charCodeAt(e.position),p=Jt(e);if(a&&o!==1&&(d===33||d===38))break;if(a&&h&&(l.tagStart!==M||l.anchorStart!==M)&&(d===33||d===38)){let g=Jt(e),y=t+1;if(zr(e,e.position-e.lineStart,y,l)&&e.events[g.eventsLength]?.type===q.MAPPING)return e.depth--,!0;kt(e,g)}if(a&&(d===33&&l.tagStart!==M||d===38&&l.anchorStart!==M))break;if(!wf(e,l,n===Lt)&&!vf(e,l))break;if(u===null)u=p;if(ie(e,!0))if(a=!0,m=h,e.lineIndent>t)o=1;else if(e.lineIndent===t)o=0;else o=-1;else m=!1}if(m)m=a||i;if(o===1||n===Dn){let d=n===Lt||n===Oo?t:t+1,p=e.position-e.lineStart;if(o===1)if(m&&(yo(e,p,l)||zr(e,p,d,l))||Tf(e,d,l))c=!0;else{let g=e.input.charCodeAt(e.position);if(u!==null&&s&&h&&!m&&g!==124&&g!==62){let y=Jt(e),b=u.position-u.lineStart;if(kt(e,u),zr(e,b,d,ho())&&e.events[y.eventsLength]?.type===q.MAPPING)c=!0;else kt(e,y)}if(!c&&(f&&Pf(e,d,l)||Cf(e,d,l)||Of(e,d,l)||Af(e,l)||Nf(e,d,n,l)))c=!0}else if(o===0)c=m&&yo(e,p,l)}if(f=f&&!c,!c&&(l.anchorStart!==M||l.tagStart!==M||f))Dt(e,M,M,l.anchorStart,l.anchorEnd,l.tagStart,l.tagEnd,R.PLAIN),c=!0;return e.depth--,c||l.anchorStart!==M||l.tagStart!==M}function Rf(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&&!Re(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&&!Z(e.input.charCodeAt(e.position))){while(Ft(e.input.charCodeAt(e.position)))e.position++;if(e.input.charCodeAt(e.position)===35||Z(e.input.charCodeAt(e.position))||e.input.charCodeAt(e.position)===0)break;let i=e.position;while(e.input.charCodeAt(e.position)!==0&&!Re(e.input.charCodeAt(e.position)))e.position++;r.push(e.input.slice(i,e.position))}if(Z(e.input.charCodeAt(e.position)))Fn(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(!Io.test(i))P(e,"ill-formed tag handle (first argument) of the TAG directive");if(Co.call(e.tagHandlers,i))P(e,`there is a previously declared suffix for "${i}" tag handle`);if(!gf.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 _f(e){e.directives=[],e.tagHandlers=Object.create(null);let t=!1;ie(e,!0);while(Rf(e))t=!0,ie(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,ie(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&&jt(e)){e.position+=3,ie(e,!0);return}if(yf(e,n,!1),!Mt(e,e.lineIndent-1,Dn,!1,i,i))le(e);if(ie(e,!0),e.position===e.lineStart&&jt(e)){if(r=e.input.charCodeAt(e.position)===46,r){let a=e.line;if(e.position+=3,ie(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(_t(e),!r&&e.position<e.length&&!di(e))P(e,"end of the stream or a document separator is expected")}function Jf(e,t){let n=e.length,r={...pi,...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(_o(r),ie(r,!0),r.position>=r.length)break;let s=r.position;if(_f(r),r.position===s)P(r,"can not read a document")}return r.events}function ko(e,t={}){let n={...kf,...t},r=String(e),i=Object.keys(pi),s=Object.keys(fi);return ff(Jf(r,so(n,i)),{...so(n,s),source:r})}function Lo(e,t,n){let r=null;if(typeof t==="function")r=t;else if(t!==null&&typeof t==="object")n=t;let i=ko(e,n);if(r===null)return i;for(let s of i)r(s)}function mi(e,t){let n=ko(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 Un(e,t){return(e&1<<t)!==0}function jo(e){if(e.presenterOptions.quoteStyle==="single"&&Un(e.allowedStylesMask,R.SINGLE_QUOTED))return R.SINGLE_QUOTED;return R.DOUBLE_QUOTED}function Lf(e){if(!e.presenterOptions.quoteFlowKeys)return;if(!e.isKey||!e.flowOnly||e.style!==R.PLAIN)return;e.style=R.DOUBLE_QUOTED}function jf(e){if(e.style===R.PLAIN&&/[\t\x7F-\xA0\u2028\u2029\uFEFF\uFFFE\uFFFF]/.test(e.node.value))e.style=R.DOUBLE_QUOTED}function Mf(e){if(e.style===R.PLAIN&&/^\s+$/.test(e.node.value))e.style=R.DOUBLE_QUOTED}function Df(e){if(!e.presenterOptions.forceQuotes)return;if(e.isKey||e.style!==R.PLAIN)return;if(e.node.tag!==e.presenterOptions.schema.defaultScalarTag.tagName)return;e.style=e.node.value.includes(`
|
|
42
|
-
`)?
|
|
43
|
-
`)!==-1;if(!
|
|
44
|
-
`,s);if(c!==-1)a=c;let u=t.slice(s,a);if(u.length>i&&u[0]!==" "&&/ [^ \t]/.test(u))o=!0;if(c===-1)break;s=c+1}if(o)e.style=R.FOLDED_BLOCK;else if(n)e.style=R.LITERAL_BLOCK}function Bf(e){if(e.style===R.PLAIN&&!Un(e.allowedStylesMask,R.PLAIN))e.style=jo(e)}function Wf(e){if(!Un(e.allowedStylesMask,e.style))e.style=R.DOUBLE_QUOTED}var L,Yl,zl,Gl,Xl,Ql,Zl,eu,tu,nu,ru,iu,su,ou,au,cu,lu,uu,So,du,mu,yu,xu,Gr,bu,Eu,$o,Au,Cu,Iu,Nu,Tu,Xr,ri,Ju,ii,ju,Mu,si,Fu,oi,ai,Bu,ci,Hn=class e{tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(t){let n=Uu(t),r=[],i=Wu(),s=Hu();for(let l of n){if(l.nodeKind==="scalar"&&l.implicit){if(l.matchByTagPrefix)throw Error("Implicit scalar tags cannot match by tag prefix");r.push(l)}switch(l.nodeKind){case"scalar":if(l.matchByTagPrefix)s.scalar.push(l);else i.scalar[l.tagName]=l;break;case"sequence":if(l.matchByTagPrefix)s.sequence.push(l);else i.sequence[l.tagName]=l;break;case"mapping":if(l.matchByTagPrefix)s.mapping.push(l);else i.mapping[l.tagName]=l}}let o=r.filter((l)=>l.implicitFirstChars===null),a=new Set;for(let l of r)if(l.implicitFirstChars!==null)for(let f of l.implicitFirstChars)a.add(f);let c=new Map;for(let l of a)c.set(l,r.filter((f)=>f.implicitFirstChars===null||f.implicitFirstChars.indexOf(l)!==-1));let u=i.scalar["tag:yaml.org,2002:str"];if(!u)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=u,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!==L)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])}},li,nh,on,Vu,Ku,rh,ih,qu,pt,q,R,nt,Ee,zu=-1,bo,Eo,rf,sf="-#;/?:@&=+$_.~*'()",sh,Rt=-1,of="tag:yaml.org,2002:merge",fi,M=-1,Co,Lt=1,Oo=2,Po=3,Dn=4,pf,df,Io,Qr,No,mf,hf,gf,pi,kf,oh,ah,ch,xo,Hf="[\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]",Uf="[\\n\\r]",Vf="\\uFEFF",hi="[ \\t]",Mo,Vn,Do="[\\x09\\x20-\\uD7FF\\uE000-\\uFFFF\\u{10000}-\\u{10FFFF}]",Fo="[-?:,\\[\\]{}#&*!|>'\"%@`]",Kf="[,\\[\\]{}]",ei,ti,qf,Yf,Bo,Wo,Ho,Uo,Vo,Ko,zf,Gf,Xf,Qf,Zf,ep,lh,uh,fh,ph,dh,mh,hh,tp,gh,yh,xh,Sh,$h,bh,Eh,wh,vh,Ah,Ch,Oh,Ph,Ih,Nh,Th,Rh;var qo=I(()=>{/*! js-yaml 5.5.0 https://github.com/nodeca/js-yaml @license MIT */L=Symbol("NOT_RESOLVED");Yl=se("tag:yaml.org,2002:str",{resolve:(e)=>e,identify:(e)=>typeof e==="string"}),zl=["","~","null","Null","NULL"],Gl=se("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:(e)=>{if(zl.indexOf(e)!==-1)return null;return L},identify:(e)=>e===null,represent:()=>"null"}),Xl=se("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:(e,t)=>{if(e==="null"||t&&e==="")return null;return L},identify:(e)=>e===null,represent:()=>"null"}),Ql=["","~","null","Null","NULL"],Zl=se("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:(e)=>{if(Ql.indexOf(e)!==-1)return null;return L},identify:(e)=>e===null,represent:()=>"null"}),eu=["true","True","TRUE"],tu=["false","False","FALSE"],nu=se("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:(e)=>{if(eu.indexOf(e)!==-1)return!0;if(tu.indexOf(e)!==-1)return!1;return L},identify:(e)=>Object.prototype.toString.call(e)==="[object Boolean]",represent:(e)=>e?"true":"false"}),ru=["true"],iu=["false"],su=se("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:(e)=>{if(ru.indexOf(e)!==-1)return!0;if(iu.indexOf(e)!==-1)return!1;return L},identify:(e)=>Object.prototype.toString.call(e)==="[object Boolean]",represent:(e)=>e?"true":"false"}),ou=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],au=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],cu=se("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:(e)=>{if(ou.indexOf(e)!==-1)return!0;if(au.indexOf(e)!==-1)return!1;return L},identify:(e)=>Object.prototype.toString.call(e)==="[object Boolean]",represent:(e)=>e?"true":"false"}),lu=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),uu=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");So=se("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:pu,identify:(e)=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:(e)=>e.toString(10)}),du=new RegExp("^-?(?:0|[1-9][0-9]*)$"),mu=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");yu=se("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:gu,identify:(e)=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:(e)=>e.toString(10)}),xu=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_]*))$");Gr=se("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:$u,identify:(e)=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:(e)=>e.toString(10)}),bu=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Eu=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");$o=se("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:vu}),Au=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),Cu=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");Iu=se("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Ou,identify:(e)=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:Pu}),Nu=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))$"),Tu=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");Xr=se("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:Ru,identify:(e)=>typeof e==="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:_u}),ri=se("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:(e,t)=>{if(e==="<<"||t&&e==="")return"<<";return L},identify:()=>!1}),Ju=/^[A-Za-z0-9+/]*={0,2}$/;ii=se("tag:yaml.org,2002:binary",{resolve:ku,identify:(e)=>Object.prototype.toString.call(e)==="[object Uint8Array]",represent:Lu}),ju=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Mu=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]))?))?$");si=se("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:Du,identify:(e)=>e instanceof Date,represent:(e)=>e.toISOString()}),Fu=ni("tag:yaml.org,2002:seq",{create:()=>[],addItem:(e,t)=>{e.push(t)},identify:Array.isArray});oi=ni("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(Wn(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}),ai=ni("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}),Bu=Bn("tag:yaml.org,2002:map",{create:()=>({}),identify:Wn,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]}}),ci=Bn("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});li=new Hn([Yl,Fu,Bu]),nh=new Hn([...li.tags,Xl,su,yu,Iu]),on=new Hn([...li.tags,Gl,nu,So,$o]),Vu=new Hn([...li.tags,Zl,cu,Gr,Xr,si,ri,ii,oi,ai,ci]),Ku=Vu.withTags({...Gr,resolve:(e,t,n)=>{let r=Gr.resolve(e,t,n);return r===L?So.resolve(e,t,n):r}},{...Xr,resolve:(e,t,n)=>{let r=Xr.resolve(e,t,n);return r===L?$o.resolve(e,t,n):r}}),rh=Bn("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||Wn(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}});ih=Bn("tag:yaml.org,2002:map",{create:()=>({}),identify:Wn,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=oo(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=oo(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]}}),qu={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=ao(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}toString(t){return`${this.name}: ${ao(this,t)}`}static throwAt(t,n,r,i=""){let s=0,o=0;for(let c=0;c<n;c++){let u=t.charCodeAt(c);if(u===10)s++,o=c+1;else if(u===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=Yu(a),new e(r,a)}},q={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},R={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},nt={BLOCK:1,FLOW:2},Ee={CLIP:1,STRIP:2,KEEP:3};bo=Array(256),Eo=Array(256);for(let e=0;e<256;e++)bo[e]=co(e)?1:0,Eo[e]=co(e);rf=Object.assign(Object.create(null),{"!":"!","!!":"tag:yaml.org,2002:"}),sh=sf+"!,[]";fi={filename:"",schema:on,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};Co=Object.prototype.hasOwnProperty,pf=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,df=/[,\[\]{}]/,Io=/^(?:!|!!|![0-9A-Za-z-]+!)$/,Qr=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,No=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,mf=new RegExp(`^(?:${Qr})*$`),hf=new RegExp(`^(?:${No})+$`),gf=new RegExp(`^(?:!(?:${Qr})*|${No}(?:${Qr})*)$`),pi={filename:"",maxDepth:100};kf={...pi,...fi};oh=Symbol("INVALID"),ah=Symbol("visit:break"),ch=Symbol("visit:skip");xo={applyQuoteFlowKeysOption:Lf,doubleQuoteForInvisibles:jf,doubleQuoteWhitespaceOnly:Mf,applyForceQuotesOption:Df,tryLongOrMultilineAsBlock:Ff,quoteInvalidPlain:Bf,fallbackToDoubleQuoted:Wf};Mo=`(?:(?!(?:${Uf}|${Vf}))${Hf})`,Vn=`(?:(?!${hi})${Mo})`,ei=Vn,ti=`(?:(?!${Kf})${Vn})`,qf=`(?:(?:(?!${Fo})${Vn})|[?:-](?=${ei}))`,Yf=`(?:(?:(?!${Fo})${Vn})|[?:-](?=${ti}))`,Bo=`(?:(?:(?![:#])${ei})|:(?=${ei}))#*`,Wo=`(?:(?:(?![:#])${ti})|:(?=${ti}))#*`,Ho=`(?:${hi}*${Bo})*`,Uo=`(?:${hi}*${Wo})*`,Vo=`${qf}#*${Ho}`,Ko=`${Yf}#*${Uo}`,zf=Vo,Gf=Ko,Xf=`\\n+${Bo}${Ho}`,Qf=`\\n+${Wo}${Uo}`,Zf=`${Vo}(?:${Xf})*`,ep=`${Ko}(?:${Qf})*`,lh=new RegExp(`^(?:${Zf})$`,"u"),uh=new RegExp(`^(?:${ep})$`,"u"),fh=new RegExp(`^(?:${zf})$`,"u"),ph=new RegExp(`^(?:${Gf})$`,"u"),dh=new RegExp(`^(?:${Do})*$`,"u"),mh=new RegExp(`^(?:${Do}|\\n)*$`,"u"),hh=new RegExp(`^(?:${Mo}|\\n)*$`,"u"),tp={indent:2,seqNoIndent:!1,seqInlineFirst:!0,lineWidth:80,flowBracketPadding:!1,flowSkipCommaSpace:!1,flowSkipColonSpace:!1,quoteFlowKeys:!1,quoteStyle:"single",forceQuotes:!1,scalarStyleRules:Object.keys(xo).map((e)=>Reflect.get(xo,e)),tagBeforeAnchor:!1},gh={...tp,schema:Ku,skipInvalid:!1,noRefs:!1,flowLevel:-1,sortKeys:!1,transform:()=>{}},yh=q.DOCUMENT,xh=q.SEQUENCE,Sh=q.MAPPING,$h=q.SCALAR,bh=q.ALIAS,Eh=q.POP,wh=R.PLAIN,vh=R.SINGLE_QUOTED,Ah=R.DOUBLE_QUOTED,Ch=R.LITERAL_BLOCK,Oh=R.FOLDED_BLOCK,Ph=nt.BLOCK,Ih=nt.FLOW,Nh=Ee.CLIP,Th=Ee.STRIP,Rh=Ee.KEEP});var np,Yo;var zo=I(()=>{be();qo();np=on.withTags(si,ri,ii,oi,ai,ci),Yo={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 mi(t,{schema:on})}catch{try{return mi(t,{schema:np})}catch(n){try{if(Lo(t,{schema:on}).length===0)return}catch{}throw new Ie(n?.message||"Parser Error",e.url)}}else return t}}});var rp,Go;var Xo=I(()=>{be();rp=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)(?:[?#].*)?$/i,Go={order:300,allowEmpty:!0,encoding:"utf8",canParse(e){return(typeof e.data==="string"||Buffer.isBuffer(e.data))&&rp.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 Ie("data is not text",e.url)}}});var ip,Qo;var Zo=I(()=>{ip=/\.(jpeg|jpg|gif|png|bmp|ico)(?:[?#].*)?$/i,Qo={order:400,allowEmpty:!0,canParse(e){return Buffer.isBuffer(e.data)&&ip.test(e.url)},parse(e){if(Buffer.isBuffer(e.data))return e.data;else return Buffer.from(e.data)}}});var gi;var yi=I(()=>{ae();be();gi={order:100,canRead(e){return Nn(e.url)},async read(e){let t,n=await import("fs");try{t=At(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 ra(e,t,n){e=Xt(e);let r=n||[];r.push(e.href);let i;try{let s;if(t.safeUrlResolver){let a=await Ws(e.href);if(a.unsafe)throw Error(`Unsafe URL blocked by safeUrlResolver: ${e.href}`);s=a.addresses}i=await op(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]}.
|
|
38
|
+
`),l="",u=!1,f=0,d=!1;for(let m of c){let h=0;while(h<o&&m.charCodeAt(h)===32)h++;if(r<0||h>=m.length){f++;continue}let p=m.slice(o),g=p.charCodeAt(0);if(s)if(g===32||g===9)d=!0,l+=`
|
|
39
|
+
`.repeat(u?1+f:f);else if(d)d=!1,l+=`
|
|
40
|
+
`.repeat(f+1);else if(f===0){if(u)l+=" "}else l+=`
|
|
41
|
+
`.repeat(f);else l+=`
|
|
42
|
+
`.repeat(u?1+f:f);l+=p,u=!0,f=0}if(i===be.KEEP)l+=`
|
|
43
|
+
`.repeat(u?1+f:f);else if(i!==be.STRIP){if(u)l+=`
|
|
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
|
+
`)?I.DOUBLE_QUOTED:zo(e)}function tp(e){if(e.style!==I.PLAIN||e.isKey)return;let t=e.node.value,n=t.indexOf(`
|
|
46
|
+
`)!==-1;if(!Qn(e.allowedStylesMask,I.LITERAL_BLOCK)){if(n)e.style=I.DOUBLE_QUOTED;return}let r=e.presenterOptions.lineWidth;if(r===-1){if(n)e.style=I.LITERAL_BLOCK;return}let i=Math.max(Math.min(r,40),r-e.shiftOfContent),s=0,o=!1;while(s<=t.length){let a=t.length,c=t.indexOf(`
|
|
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]}.
|
|
45
48
|
Too many redirects:
|
|
46
49
|
${r.join(`
|
|
47
|
-
`)}`);throw a.status=o.status,new Ne(a)}else{let a=o.getHeader("location");if(!a){let l=Error(`HTTP ${o.status} redirect with no location header`);throw l.status=o.status,l}let c=F(e.href,a),u=Xt(c).origin===e.origin?t:mp(t);return ra(c,u,r)}else return await o.readBody(t.maxContentLength??na)}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 op(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 lp(e,t,n,r?.signal):ap(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 ap(e){return{status:e.status,getHeader:(t)=>e.headers.get(t),readBody:(t)=>cp(e,t),async discard(){if(e.body&&!e.bodyUsed)await e.body.cancel().catch(()=>{return})}}}async function cp(e,t){if(ia(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}),Si(t);r.push(o)}}async function lp(e,t,n,r){let i=e.protocol==="https:"?"node:https":"node:http",{request:s}=await import(i),o={method:"GET",headers:up(t.headers),lookup:dp(e.hostname,n),agent:!1,autoSelectFamily:!0};if(r)o.signal=r;let a=await new Promise((u,l)=>{let f=!1,m=s(e,o,(h)=>{f=!0,u(h)});m.on("error",l),m.on("upgrade",(h,d)=>{d.destroy(),l(Error("Unexpected HTTP protocol upgrade"))}),m.on("close",()=>{if(!f)l(Error("The connection was closed before an HTTP response was received"))}),m.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(u){let l=a.headers[u.toLowerCase()];return Array.isArray(l)?l.join(", "):l??null},readBody:(u)=>fp(a,u,r),async discard(){if(!a.destroyed)a.destroy()}}}function up(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 sp)t.delete(r);let n={};return t.forEach((r,i)=>{n[i]=r}),n}async function fp(e,t,n){ia(e.headers["content-length"],t);let r=(e.statusCode===204||e.statusCode===205?"":e.headers["content-encoding"]??"").split(",").map((b)=>b.trim().toLowerCase()).filter((b)=>b&&b!=="identity");if(r.length>ea)throw Error(`Too many content-encodings: maximum allowed is ${ea}`);for(let b of r)if(!["gzip","x-gzip","deflate","x-deflate","br","zstd"].includes(b))throw Error(`Unsupported content-encoding: ${b}`);let i="node:stream",s="node:stream/promises",o="node:zlib",[{Duplex:a,Transform:c,Writable:u},{pipeline:l},f]=await Promise.all([import(i),import(s),import(o)]),m=Error("The connection was closed before the response body was complete");if(e.destroyed)throw e.errored??m;let h=()=>{let b=0;return new c({transform(A,v,S){b+=A.length,S(b>t?Si(t):null,A)}})},d=[h()];for(let b of r.reverse()){let A=b==="gzip"||b==="x-gzip"?f.createGunzip():b==="deflate"||b==="x-deflate"?pp(f,a):b==="br"?f.createBrotliDecompress():f.createZstdDecompress();d.push(A,h())}let p=[],g=0,y=new u({write(b,A,v){p.push(b),g+=b.length,v()}});try{await l([e,...d,y],n?{signal:n}:{})}catch(b){if(b instanceof Error&&"code"in b&&b.code==="ERR_STREAM_PREMATURE_CLOSE")throw m;throw b}return Buffer.concat(p,g)}function pp(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 ia(e,t){if(e&&Number(e)>t)throw Si(t)}function Si(e){return Error(`Response body exceeds the maxContentLength of ${e} bytes`)}function dp(e,t){let n=ta(e),r=t.map(({address:i,family:s})=>({address:i,family:s}));return(i,s,o)=>{let a=ta(i),c=s.family==="IPv4"?4:s.family==="IPv6"?6:s.family||0,u=r.filter(({family:l})=>c===0||l===c);if(a!==n||u.length===0){let l=Error(`No validated address is available for ${i}`);l.code="ENOTFOUND",o(l,"",0)}else if(s.all)o(null,u);else{let l=u[0];o(null,l.address,l.family)}}}function ta(e){return e.replace(/^\[|\]$/g,"").replace(/\.+$/,"").toLowerCase()}function mp(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 na=52428800,ea=5,sp,xi;var $i=I(()=>{ae();be();sp=["connection","content-length","expect","host","keep-alive","proxy-connection","te","trailer","transfer-encoding","upgrade"],xi={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,maxContentLength:na,canRead(e){return Bs(e.url)&&(!this.safeUrlResolver||!In(e.url))},read(e){let t=Xt(e.url);if(typeof window<"u"&&!t.protocol)t.protocol=Xt(location.href).protocol;return ra(t,this)}}});function ca(e,t){if(sa(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(sa(s))e[i]=ca(o||{},s);else if(s!==void 0)e[i]=s}}return e}function sa(e){return e&&typeof e==="object"&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)&&!(typeof Headers<"u"&&e instanceof Headers)}var oa=()=>({parse:{json:{...no},yaml:{...Yo},text:{...Go},binary:{...Qo}},resolve:{file:{...gi},http:{...xi},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}),aa=(e)=>{let t=oa();if(e)ca(t,e);return t};var bi=I(()=>{ro();zo();Xo();Zo();yi();$i()});function hp(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=aa(i),t&&!i.mutateInputSchema&&typeof r==="object")r=structuredClone(r);return{path:n,schema:r,options:i,callback:s}}var an;var la=I(()=>{bi();an=hp});async function wi(e,t,n){let r=e.$refs._root$Ref.path,i=e.$refs._root$Ref.dynamicIdScope?z(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 qn({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 yp(s)}async function qn(e,t,n,r,i,s=!1){if(!s&&i.excludedPathMatcher(t,e.value)){pa(e,i);return}let o=e.value;if(!o||typeof o!=="object"||ArrayBuffer.isView(o)||ya(n,o))return;Bt(e);let a={value:o,...n?{parent:n}:{}};if(J.is$Ref(o)&&J.isAllowed$Ref(o,i.options)){if(!await gp(e,t,r,i)&&J.isExtended$Ref(o))await ua(e,t,a,r,i);return}await ua(e,t,a,r,i)}async function ua(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(Ep(e,o)&&i.excludedPathMatcher(a,void 0)){Kn(e,o,i);return}}else{if(Object.getOwnPropertyDescriptor(s,o)?.get&&i.excludedPathMatcher(a,void 0)){Kn(e,o,i);return}let l=s[o],f=ga(e,o,l);if(i.excludedPathMatcher(a,l)){Kn(e,o,i);return}await qn(f,a,n,r,i,!0);return}let c=mt(e,o);if(!c)return;if(i.excludedPathMatcher(a,c.value)){Kn(e,o,i);return}await qn(c,a,n,r,i,!0)}))}async function gp(e,t,n,r){let i=e.value,s=e.referenceLocation||e;Bt(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(xa(n,c))return!1;if(Sa(n,s.path,r.options),o&&!await vi(i,c,a,s.path,r))return!1;let u={path:c,depth:(n?.depth??0)+1,...n?{parent:n}:{}},l=await da(c,t,r,u);if(!l)return!1;let f=ma(e,l,r.options.dereference?.mergeKeys??!0);return await qn(f,t,void 0,u,r),!0}async function vi(e,t,n,r,i){let s=T(t),o=i.documentLoads.get(s);if(o)return o;let a=i.$refs._get$Ref(s);if(a)return Ei(s,i),!ce(a.value);let c=Tt({url:t,baseUrl:n,reference:e.$ref},i.$refs,i.options).then(()=>(Ei(s,i),!0)).catch((u)=>{if(!i.options.continueOnError||!ce(u))throw u;if(i.$refs._$refs[s])Ei(s,i),u.source=decodeURI(T(r)),u.path=Ct(Se(r));return!1});return i.documentLoads.set(s,c),c}function Ei(e,t){if(t.$refs._$refs[e])t.externalDocuments.add(e)}async function yp(e){let t=T(e.$refs._root$Ref.path);for(let n of e.externalDocuments){if(n===t)continue;let r=e.$refs._get$Ref(n);if(!r||ce(r.value))continue;let i=r.dynamicIdScope?z(r.path,r.value,r.legacyIdScope):r.path;await fa(r.value,r.path+"#",i,r.dynamicIdScope,r.legacyIdScope,void 0,new WeakMap,e)}}async function fa(e,t,n,r,i,s,o,a){if(a.excludedPaths.has(t)||!e||typeof e!=="object"||ArrayBuffer.isView(e)||ya(s,e))return;let c=a.excludedAncestorPaths.has(t),u=`${i}:${n}`,l=o.get(e);if(!c&&l?.has(u))return;if(!c)if(l)l.add(u);else o.set(e,new Set([u]));let f={value:e,...s?{parent:s}:{}},m=[];if(J.isExternal$Ref(e)){let h=e,d=a.options.dereference?.externalReferenceResolution==="root"?xe():r?n:t,p=F(d,h.$ref);m.push(vi(h,p,d,t,a))}m.push(...Object.keys(e).map(async(h)=>{let d=B.join(t,h);if(a.excludedPaths.has(d))return;let p=e[h],g=Q(p,i),y=r&&p&&typeof p==="object"&&!ArrayBuffer.isView(p)?z(n,p,g):n;await fa(p,d,y,r,g,f,o,a)})),await Promise.all(m)}function pa(e,t){for(let n of e.originPaths||[e.path]){let r=xp(n);if(t.excludedPaths.has(r))continue;t.excludedPaths.add(r);let s=T(r)+"#";for(let o of B.parse(r))t.excludedAncestorPaths.add(s),s=B.join(s,o)}}function Kn(e,t,n){pa({...e,path:B.join(e.path,t),originPaths:(e.originPaths||[e.path]).map((r)=>B.join(r,t))},n)}function xp(e){let t=T(e),n=Se(e)||"#";return t+n}async function da(e,t,n,r){let i=T(e),s=n.$refs._get$Ref(i);if(!s||ce(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=Q(o.value,o.legacyIdScope),o.scopeBase=z(o.scopeBase,o.value,o.legacyIdScope);let c;try{c=B.parse(e)}catch{return}for(let u=0;u<c.length;u++){let l=await Sp(o,t,n,r);if(!l)return;o=l;let f=c[u],m=mt(o,f);if(!m||m.value===void 0||m.value===null&&u===c.length-1){m=void 0;for(let h=c.length-1;h>u;h--){let d=c.slice(u,h+1).join("/"),p=mt(o,d);if(p?.value!==void 0){m=p,u=h;break}}if(!m){let h=mt(o,f);if(!h||h.value!==null)return;m=h}}o=m,Bt(o)}return o}async function Sp(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;Bt(a);let c=J.isExternal$Ref(o),u=c&&n.options.dereference?.externalReferenceResolution==="root"?xe():a.dynamicIdScope?a.scopeBase:a.path,l=F(u,o.$ref);if(xa(s,l))return J.isExtended$Ref(o)?i:void 0;if(Sa(s,a.path,n.options),c&&!await vi(o,l,u,a.path,n))return;let f={path:l,depth:(s?.depth??0)+1,...s?{parent:s}:{}},m=await da(l,t,n,f);if(!m)return;i=ma(i,m,n.options.dereference?.mergeKeys??!0),s=f}return i}function ma(e,t,n){if(!J.isExtended$Ref(e.value)||t.value===null||typeof t.value!=="object")return t;return ha(t,e,n,!0,void 0)}function ha(e,t,n,r,i){let s=e.value,o=t.value,a=$p(i,s,o);if(a)return a;let c=!r&&Array.isArray(e.value)?Array(e.value.length):{},u=new Map,l={value:c,path:e.path,originPaths:bp(e,t),scopeBase:e.scopeBase,dynamicIdScope:e.dynamicIdScope,legacyIdScope:e.legacyIdScope,children:u,resolveMetadata(){Bt(e),l.scopeBase=e.scopeBase,l.dynamicIdScope=e.dynamicIdScope,l.legacyIdScope=e.legacyIdScope}},f={target:s,source:o,value:l,...i?{parent:i}:{}},m=new Set(Object.keys(o).filter((p)=>!(r&&p==="$ref"))),h=new Set(Object.keys(s)),d=new Set([...m,...h]);for(let p of d){let g=()=>{let y=m.has(p)?mt(t,p):void 0,b;if(y&&(!h.has(p)||!n||y.value===null||typeof y.value!=="object"||Array.isArray(y.value)))b=y;else{let A=mt(e,p);b=y&&A.value!==null&&typeof A.value==="object"?ha(A,y,!0,!1,f):y||A}if(u.set(p,b),vp(c,p,b.value),p==="$ref"&&typeof b.value==="string")l.referenceLocation=b.owner||e;return b};u.set(p,{resolve:g,requiresPrecheck:wp(o,s,p,m.has(p),h.has(p),n)}),Ap(c,p,()=>mt(l,p).value)}return l}function $p(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 ga(e,t,n[t])}function ga(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(){Bt(e);let i=Q(n,e.legacyIdScope);r.legacyIdScope=i,r.scopeBase=e.dynamicIdScope&&n&&typeof n==="object"&&!ArrayBuffer.isView(n)?z(e.scopeBase,n,i):e.scopeBase}};return r}function bp(e,t){return[...new Set([...e.originPaths||[e.path],...t.originPaths||[t.path]])]}function Bt(e){let t=e.resolveMetadata;if(t)delete e.resolveMetadata,t()}function Ep(e,t){let n=e.children?.get(t);return Boolean(n&&"resolve"in n&&n.requiresPrecheck)}function wp(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 ya(e,t){for(let n=e;n;n=n.parent)if(n.value===t)return!0;return!1}function xa(e,t){for(let n=e;n;n=n.parent)if(n.path===t)return!0;return!1}function Sa(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 vp(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0})}function Ap(e,t,n){Object.defineProperty(e,t,{get:n,enumerable:!0,configurable:!0})}var $a=I(()=>{ft();Nt();jn();ae();be();Ue()});function Cp(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 wi(e,t,t.resolveExcludedPathMatcher);try{let r=e.$refs._root$Ref.dynamicIdScope?z(e.$refs._root$Ref.path,e.schema,e.$refs._root$Ref.legacyIdScope):e.$refs._root$Ref.path,i=Ai(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 Ai(e,t,n,r,i,s,o,a,c,u=new Set){a||=new Map;let l=[];if(e&&typeof e==="object"&&!ArrayBuffer.isView(e)&&!u.has(e)){let f=`${i}:${n}`,m=a.get(e);if(m?.has(f))return l;if(m)m.add(f);else a.set(e,new Set([f]));u.add(e);let h=n;if(J.isExternal$Ref(e))l.push(Op(e,t,h,r,s,o));let d=Object.keys(e);for(let p of d){let g=B.join(t,p),y=e[p],b=Q(y,i),A=r&&y&&typeof y==="object"&&!ArrayBuffer.isView(y)?z(h,y,b):h;l=l.concat(Ai(y,g,A,r,b,s,o,a,c,u))}u.delete(e)}return l}async function Op(e,t,n,r,i,s){let a=s.dereference?.externalReferenceResolution==="root"?xe():r?n:t,c=F(a,e.$ref),u=T(c),l=i._get$Ref(u);if(l)return Promise.resolve(l.value);try{let f=e.$ref,m={url:c,baseUrl:a};if(typeof f==="string")m.reference=f;let h=await Tt(m,i,s),d=i._get$Ref(u),p=d?.dynamicIdScope??!1,g=d?.legacyIdScope??!1,y=p?z(u,h,g):u,b=Ai(h,u+"#",y,p,g,i,s,new Map,!0);return Promise.all(b)}catch(f){if(!s?.continueOnError||!ce(f))throw f;if(i._$refs[u])f.source=decodeURI(T(t)),f.path=Ct(Se(t));return[]}}var ba;var Ea=I(()=>{ft();Nt();jn();$a();ae();be();Ue();ba=Cp});function Pp(e,t){let n=e.$refs._root$Ref.dynamicIdScope?z(e.$refs._root$Ref.path,e.schema,e.$refs._root$Ref.legacyIdScope):e.$refs._root$Ref.path,r=[],i=new Set([T(e.$refs._root$Ref.path),T(n)]);Oi(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=It(e.schema,e.$refs._root$Ref.legacyIdScope);if(Ip(r,t,s,n),(t.bundle||{}).optimizeInternalRefs!==!1)Rp(r,e.schema)}function Oi(e,t,n,r,i,s,o,a,c,u,l,f,m,h,d=!1){let p=t===null?e:e[t],g=f.bundle||{},y=g.excludedPathMatcher||(()=>!1);if(p&&typeof p==="object"&&!ArrayBuffer.isView(p)&&(d||!y(a,p))&&!h.has(p)){h.add(p);let b=r;if(J.isAllowed$Ref(p,f))wa(e,t,n,b,i,o,a,c,u,l,f,m,h);else{let A=Object.keys(p).sort((v,S)=>{if(v==="definitions"||v==="$defs")return-1;else if(S==="definitions"||S==="$defs")return 1;else return v.length-S.length});for(let v of A){let S=B.join(n,v),x=B.join(a,v);if(Object.getOwnPropertyDescriptor(p,v)?.get&&y(x,void 0))continue;let w=p[v];if(y(x,w))continue;let N=Q(w,s),j=i&&w&&typeof w==="object"&&!ArrayBuffer.isView(w)?z(b,w,N):b,G=i&&Ci(w,N),_e=o||G,ne=m;if(G)ne=new Set(m),ne.add(T(j));if(J.isAllowed$Ref(w,f))wa(p,v,S,j,i,_e,x,c,u,l,f,ne,h);else Oi(p,v,S,j,i,N,_e,x,c,u,l,f,ne,h,!0);if(w&&typeof w==="object"&&!Array.isArray(w)){if("$ref"in w)g?.onBundle?.(w.$ref,p[v],p,v)}}}}}function wa(e,t,n,r,i,s,o,a,c,u,l,f,m){let h=t===null?e:e[t],p=J.isExternal$Ref(h)&&l.dereference?.externalReferenceResolution==="root"?xe():i?r:n,g=F(p,h.$ref),y=u._resolve(g,o,l);if(y===null)return;let A=B.parse(o).length,v=T(y.path),S=Se(y.path),x=u._aliases[v],E=Boolean(x&&Lp(u._root$Ref.value,y.$ref.value)),w=v!==u._root$Ref.path&&!f.has(v)&&!E,N=Boolean(x)&&y.$ref.value!==u._root$Ref.value,j=It(y.$ref.value,y.$ref.legacyIdScope),G=x?y.$ref.path:y.$ref.dynamicIdScope?z(y.$ref.path,y.$ref.value,y.$ref.legacyIdScope):y.$ref.path,_e=J.isExtended$Ref(h);a+=y.indirections;let ne=Np(c,e,t);if(ne)if(A<ne.depth||a<ne.indirections)Tp(c,ne);else return;if(c.push({$ref:h,parent:e,key:t,pathFromRoot:o,depth:A,file:v,hash:S,value:y.value,circular:y.circular,extended:_e,external:w,nestedResource:N,indirections:a,scopeBase:r,dynamicIdScope:i,nestedIdScope:s,targetResourceBase:G,...j===void 0?{}:{targetResourceId:j}}),!ne||w){let fn=y.$ref.dynamicIdScope?y.scopeBase:y.$ref.path,vc=s||y.$ref.dynamicIdScope&&Ci(y.value,y.legacyIdScope),sr=new Set(f);if(y.value===y.$ref.value&&Ci(y.$ref.value,y.$ref.legacyIdScope))sr.add(T(y.$ref.path)),sr.add(T(fn));Oi(y.value,null,y.path,fn,y.$ref.dynamicIdScope,y.legacyIdScope,vc,o,a+1,c,u,l,sr,m)}}function Ip(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 u=Math.max(a.pathFromRoot.lastIndexOf("/definitions"),a.pathFromRoot.lastIndexOf("/$defs")),l=Math.max(c.pathFromRoot.lastIndexOf("/definitions"),c.pathFromRoot.lastIndexOf("/$defs"));if(u!==l)return l-u;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 u=T(a.targetResourceBase),l=T(a.scopeBase);if(u!==l)a.$ref.$ref=kp(a);else if(!a.nestedResource)a.$ref.$ref=a.hash}}else if(a.file===i&&a.hash===s)a.$ref.$ref=va(a,o,n,r);else if(a.file===i&&a.hash.indexOf(s+"/")===0){let u=B.join(o,B.parse(a.hash.replace(s,"#")));a.$ref.$ref=va(a,u,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 Np(e,t,n){for(let r of e)if(r&&r.parent===t&&r.key===n)return r;return}function Tp(e,t){let n=e.indexOf(t);e.splice(n,1)}function Rp(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"||!Yn(r))continue;let i=_p(t,r);if(i!==r)n.$ref.$ref=i}}function _p(e,t){if(!Yn(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"&&Yn(r.$ref)){let o=B.parse(r.$ref);if(i.length=0,i.push(...o),r=Jp(e,r.$ref),r===null||r===void 0||typeof r!=="object")return t}r=r[s],i.push(s)}return B.join("#",i)}function Jp(e,t){if(!Yn(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 Yn(e){return e[0]==="#"&&Qt(e.substring(1)).startsWith("/")}function va(e,t,n,r){if(!e.dynamicIdScope||!e.nestedIdScope||!r)return t;let i=r;if(n&&T(F(e.scopeBase,n))===T(r))i=n;return T(i)+t}function kp(e){let t=T(e.targetResourceBase);if(typeof e.$ref.$ref==="string"&&T(F(e.scopeBase,e.$ref.$ref))===t)return e.$ref.$ref;if(e.targetResourceId&&T(F(e.scopeBase,e.targetResourceId))===t)t=e.targetResourceId;return e.hash==="#"?t:t+e.hash}function Ci(e,t=!1){return It(e,t)!==void 0}function Lp(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 Aa;var Ca=I(()=>{ft();Nt();ae();Ue();Aa=Pp});function jp(e,t){let n=Date.now(),r=e.$refs._root$Ref.dynamicIdScope?z(e.$refs._root$Ref.path,e.schema,e.$refs._root$Ref.legacyIdScope):e.$refs._root$Ref.path,i=Pi(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 Pi(e,t,n,r,i,s,o,a,c,u,l,f,m,h){let d,p={value:e,circular:!1};Pa(f,l);let g=l.dereference||{},y=g.maxDepth??500;if(m>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 b=g.excludedPathMatcher||(()=>!1);if(g?.circular==="ignore"||!a.has(e)){if(e&&typeof e==="object"&&!ArrayBuffer.isView(e)&&!b(s,e)){o.add(e),a.set(e,!1);let A=h||ut(u,e)||{value:e,path:t,scopeBase:n,dynamicIdScope:r,legacyIdScope:i};if(J.isAllowed$Ref(e,l))d=Oa(e,A.path,A.scopeBase,A.dynamicIdScope,s,o,a,c,u,l,f,m,A),p.circular=d.circular,p.value=d.value;else for(let v of Object.keys(e)){Pa(f,l);let S=B.join(t,v),x=B.join(s,v);if(Object.getOwnPropertyDescriptor(e,v)?.get&&b(x,void 0))continue;let w=e[v];if(b(x,w))continue;let N=Te(u,A,v,w),j;if(J.isAllowed$Ref(w,l)){if(d=Oa(w,N.path,N.scopeBase,N.dynamicIdScope,x,o,a,c,u,l,f,m,N),j=d.circular,e[v]!==d.value){let G=new Map;if(g?.preservedProperties){if(typeof e[v]==="object"&&!Array.isArray(e[v]))g?.preservedProperties.forEach((ne)=>{if(ne in e[v])G.set(ne,e[v][ne])})}let _e=d.value;if(g?.cloneReferences&&!j&&_e&&typeof _e==="object")_e=structuredClone(_e);if(e[v]=_e,g?.preservedProperties){if(G.size&&e[v]!==null&&typeof e[v]==="object"&&!Array.isArray(e[v]))G.forEach((ne,fn)=>{e[v][fn]=ne})}g?.onDereference?.(w.$ref,e[v],e,v)}}else if(!o.has(w)){if(d=Pi(w,N.path,N.scopeBase,N.dynamicIdScope,N.legacyIdScope,x,o,a,c,u,l,f,m+1,N),j=d.circular,e[v]!==d.value)e[v]=d.value}else j=cn(S,u,l);p.circular=p.circular||j}o.delete(e),a.set(e,p.circular)}}else p.circular=a.get(e)||!1;return p}function Oa(e,t,n,r,i,s,o,a,c,u,l,f,m){let p=J.isExternal$Ref(e)&&u?.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 cn(t,c,u),y}else return cn(t,c,u),y;let b=c._resolve(g,t,u);if(b===null)return{circular:!1,value:null};let A=b.circular,v=A||b.chainCircular||s.has(b.value);if(v)cn(t,c,u);let S=J.dereference(e,b.value,u),x=b.location,E=J.isExtended$Ref(e)?en(c,S,x,m,u.dereference?.mergeKeys??!0):x;if(!v){let N=Pi(S,E.path,E.scopeBase,E.dynamicIdScope,E.legacyIdScope,i,s,o,a,c,u,l,f+1,E);if(v=N.circular,S=N.value,v&&y?.circular)cn(t,c,u)}if(v&&!A&&u.dereference?.circular==="ignore")S=e;if(A&&S!==e)S.$ref=i;let w={circular:v,value:S};if(Object.keys(e).length===1)a.set(g,w);return w}function Pa(e,t){if(t&&t.timeoutMs){if(Date.now()-e>t.timeoutMs)throw new kr(t.timeoutMs)}}function cn(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 Ia;var Na=I(()=>{ft();Nt();ae();Ue();be();Mr();Ia=jp});function Mp(){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 Ii;var Ta=I(()=>{Ii=Mp()});function pe(e,t){if(e){t.then(function(n){Ii(function(){e(null,n)})},function(n){Ii(function(){e(n)})});return}else return t}var Ra=I(()=>{Ta()});class Ke{schema=null;$refs=new rn;async parse(){let e;try{e=an(arguments)}catch(r){return zn(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 pe(e.callback,Promise.reject(r))}this.schema=null,this.$refs=new rn;try{let r="http";if(Nn(e.path))e.path=Ks(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=_n(s.value),s.legacyIdScope=Q(s.value),Jn(this.$refs,s.path,s.value,s.pathType,s.dynamicIdScope),t=Promise.resolve(e.schema)}else t=Tt(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,pe(e.callback,Promise.resolve(this.schema));else if(e.options.continueOnError)return this.schema=null,pe(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||!ce(r))return pe(e.callback,Promise.reject(r));if(this.$refs._$refs[T(e.path)])this.$refs._$refs[T(e.path)].addError(r);return pe(e.callback,Promise.resolve(null))}}static parse(){let e=new Ke;return e.parse.apply(e,arguments)}async resolve(){let e;try{e=an(arguments,!1)}catch(t){return zn(arguments,t)}try{return await this.parse(e.path,e.schema,e.options),await ba(this,e.options),Ni(this),pe(e.callback,Promise.resolve(this.$refs))}catch(t){return pe(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=an(arguments,!1)}catch(t){return zn(arguments,t)}try{return await this.resolve(e.path,e.schema,e.options),Aa(this,e.options),Ni(this),pe(e.callback,Promise.resolve(this.schema))}catch(t){return pe(e.callback,Promise.reject(t))}}static dereference(){let e=new Ke;return e.dereference.apply(e,arguments)}async dereference(){let e;try{e=an(arguments,!1)}catch(t){return zn(arguments,t)}try{return await this.resolve(e.path,e.schema,e.options),Ia(this,e.options),Ni(this),pe(e.callback,Promise.resolve(this.schema))}catch(t){return pe(e.callback,Promise.reject(t))}}}function zn(e,t){let n=e[e.length-1];return pe(typeof n==="function"?n:void 0,Promise.reject(t))}function Ni(e){if(Ot.getParserErrors(e).length>0)throw new Ot(e)}var Mg,Dg,Fg,_a;var Ja=I(()=>{eo();jn();la();Ea();Ca();Na();ae();yi();$i();be();Ra();Ue();bi();ae();Mg=Ke.parse,Dg=Ke.resolve,Fg=Ke.bundle,_a=Ke.dereference});function Dp(e,t){if(t.routing==="prefix-except-default"&&e===t.defaultLocale)return"/";return`/${e.toLowerCase()}/`}function ka(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,Dp(i,e)])));return`
|
|
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`
|
|
48
51
|
// ─── Locale negotiation (RFC 4647 Lookup over Accept-Language) ───────────────
|
|
49
52
|
const JX_LOCALES = ${t}
|
|
50
53
|
const JX_DEFAULT_LOCALE = ${n}
|
|
@@ -113,8 +116,8 @@ app.use('/', async (c, next) => {
|
|
|
113
116
|
res.headers.set('Content-Language', locale)
|
|
114
117
|
c.res = res
|
|
115
118
|
})
|
|
116
|
-
`}async function
|
|
117
|
-
`),o=i.map(({exportName:a})=>
|
|
119
|
+
`}async function Wi(e,t={}){let{baseUrl:n="/_jx/server"}=t,r=await Ka(e),i=Vs(r);if(i.length===0)return null;let s=i.map(({exportName:a,src:c})=>`import { ${a} } from '${c}'`).join(`
|
|
120
|
+
`),o=i.map(({exportName:a})=>Ga(a,n)).join(`
|
|
118
121
|
`);return`// Generated by @jxsuite/compiler — do not edit manually
|
|
119
122
|
// Deploy as a Cloudflare Worker, Node server, or Bun process.
|
|
120
123
|
// Requires: npm install hono
|
|
@@ -126,24 +129,24 @@ const app = new Hono()
|
|
|
126
129
|
${o}
|
|
127
130
|
|
|
128
131
|
export default app
|
|
129
|
-
`}function
|
|
130
|
-
`),
|
|
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(`
|
|
131
134
|
`),f=n==="cloudflare-workers"||n==="cloudflare-pages"?`
|
|
132
135
|
app.all('*', (c) => c.env.ASSETS.fetch(c.req.raw))
|
|
133
136
|
`:`
|
|
134
|
-
`,
|
|
137
|
+
`,d=Ya(s);return`// Generated by @jxsuite/compiler — do not edit manually
|
|
135
138
|
import { Hono } from 'hono'
|
|
136
|
-
${c}${
|
|
139
|
+
${c}${l.imports}
|
|
137
140
|
|
|
138
141
|
const app = new Hono()
|
|
139
|
-
${
|
|
142
|
+
${d}${l.routes}${u}
|
|
140
143
|
${f}
|
|
141
144
|
export default app
|
|
142
|
-
`}function
|
|
145
|
+
`}function nd(e,t){if(e.length===0)return{imports:"",routes:""};let n=e.toSorted((s,o)=>s.order-o.order),r=[];for(let s of n)r.push(`import { ${s.className} } from '${s.module}'`);for(let s of t)r.push(`import { ${s.className} } from '${s.module}'`);let i=["// Extension server mounts (specs/extensions.md §11): one shared ctx, mounted in order.","const jxCtx = {}",`const jxConnectors = { ${t.map((s)=>`${JSON.stringify(s.provider)}: ${s.className}`).join(", ")} }`];for(let[s,o]of n.entries()){let a=JSON.stringify(o.options);i.push(`const jxMount${s} = await ${o.className}.mount({ ...${a}, connectors: jxConnectors }, jxCtx)`,`app.all('${o.basePath}/*', (c) => jxMount${s}(c.req.raw, c.env))`,`app.all('${o.basePath}', (c) => jxMount${s}(c.req.raw, c.env))`)}return{imports:`
|
|
143
146
|
${r.join(`
|
|
144
147
|
`)}`,routes:`${i.join(`
|
|
145
148
|
`)}
|
|
146
|
-
`}}function
|
|
149
|
+
`}}function Ga(e,t){return`
|
|
147
150
|
app.post('${t}/${e}', async (c) => {
|
|
148
151
|
const args = await c.req.json().catch(() => ({}))
|
|
149
152
|
try {
|
|
@@ -151,9 +154,9 @@ app.post('${t}/${e}', async (c) => {
|
|
|
151
154
|
} catch (e) {
|
|
152
155
|
return c.json({ ok: false, error: e?.message ?? 'Server error' }, 500)
|
|
153
156
|
}
|
|
154
|
-
})`}var
|
|
155
|
-
`,"\r"]);
|
|
156
|
-
`],["r","\r"],["t","\t"]])});function Kp(e){return e instanceof Error?e.message:String(e)}function Wa(e){if(C(e))return Ba.test(e)?e.normalize("NFC"):e;if(Array.isArray(e))return e.map((t)=>Wa(t));if(Y(e))return Ha(e);return e}function Ha(e){let t={};for(let[n,r]of Object.entries(e))t[Ba.test(n)?n.normalize("NFC"):n]=Wa(r);return t}function _i(e,t,n){let r;try{r=JSON.parse(e)}catch(s){throw Error(`Failed to parse ${n} at ${t}: ${Kp(s)}`,{cause:s})}if(!Y(r))throw Error(`Invalid ${n} at ${t}: expected a JSON object`);let i=Ma(e);if(i.length>0){let s=i.map((o)=>Da(o)).join("; ");throw Error(`Invalid ${n} at ${t}: ${s}`)}return Ha(r)}function Gn(e,t){return _i(e,t,"Jx document")}function Xg(e,t){return _i(e,t,"project config")}function Qg(e,t){return _i(e,t,"class definition")}var Ba;var Ji=I(()=>{X();Fa();Ba=/[^\p{ASCII}]/u});function qa(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(!Ua.test(i)||!Ua.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 u=c.indexOf("."),l=u===-1?null:c.slice(0,u),f=l!==null&&qp.has(l)?l:null,m=f===null?c:c.slice(f.length+1);if(m==="")return null;let h={};for(let d of n){let p=d.indexOf("=");if(p===-1)return null;let g=d.slice(0,p).trim().toLowerCase(),y=d.slice(p+1).trim();if(g==="")return null;if(y.startsWith('"')&&y.endsWith('"')&&y.length>=2)y=y.slice(1,-1);h[g]=y}return{parameters:h,subtype:m,suffix:a,tree:f,type:i}}function Ya(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(qa(e)===null)return`"${e}" is not a well-formed media type (RFC 6838 §4.2)`;return null}function za(e){let t=qa(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 Ua,qp,Va="text/markdown; variant=GFM",Ka="application/yaml",ty;var Ga=I(()=>{X();Ua=/^[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}$/,qp=new Set(["vnd","prs","x"]);ty={".markdown":`${Va}; charset=utf-8`,".md":`${Va}; charset=utf-8`,".yaml":`${Ka}; charset=utf-8`,".yml":`${Ka}; charset=utf-8`}});function ec(e){if(e===null)throw TypeError("A class descriptor cannot be null");return Y(e)?e:{}}class Xn{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=za(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=zp(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(!ve(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 Qn{#t;constructor(e){this.#t=e;for(let t of e){if(t.mediaType===null)continue;let n=Ya(t.mediaType);if(n!==null)throw Error(`Format "${t.name}" declares an invalid mediaType: ${n}`)}for(let t of Qa){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=Xa(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=Xa(e);return this.#t.some((n)=>n.extensions.includes(t))}}function zp(e){let t={},n=e.$defs?.methods??{};for(let[r,i]of Object.entries(n)){let{role:s}=i;if(!Xp(s))continue;let o={identifier:i.identifier??r,timing:i.timing??Yp};if(C(i.discriminator))o.discriminator=i.discriminator;t[s]=o}return t}function Xp(e){return e!==void 0&&Gp.has(e)}function Xa(e){let t=e.toLowerCase();return t.startsWith(".")?t:`.${t}`}var Qa,Za,Yp,Gp;var ki=I(()=>{X();Ga();Qa=["parse","serialize","rewrite","discover","load"],Za=[...Qa,"projectData","resolvePaths","lower","emit","head","assets","mount","dialect","deploySchema","bindings","testConnection"];Yp=["compiler","server"];Gp=new Set(Za)});class tc{#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 Qn(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 nc(e,t,n){let r=[];for(let i of e??[])r.push(await Qp(i,t,n));return new tc(r)}async function Qp(e,t,n){let r;if(e.startsWith("./")||e.startsWith("../")){let c=t.resolvePath(n,e);r=t.resolvePath(`${c}/package.json`,`./${ln}`)}else try{r=t.resolvePath(n,`${e}/${ln}`)}catch(c){throw Error(`Extension "${e}" is not resolvable: it must export ${ln} (is the package installed, and does its exports map include it?): ${Li(c)}`,{cause:c})}let i;try{i=await t.loadJson(r)}catch(c){throw Error(`Extension "${e}": cannot read manifest ${r}: ${Li(c)}`,{cause:c})}if(!Y(i)||!C(i.name))throw Error(`Extension "${e}": ${ln} 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,u]of Object.entries(s.classes??{})){let l=t.resolvePath(r,u),f;try{f=await t.loadJson(l)}catch(m){throw Error(`Extension "${e}": cannot read class "${c}" at ${l}: ${Li(m)}`,{cause:m})}o.push(new Xn(c,l,ec(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 Li(e){return e instanceof Error?e.message:String(e)}var ln="jx-extension.json";var rc=I(()=>{ki();X();ki()});import{readFileSync as Zp}from"node:fs";import{dirname as ed,isAbsolute as td,resolve as ji,sep as Zn}from"node:path";import{pathToFileURL as nd}from"node:url";import{createRequire as ic}from"node:module";async function rd(e){let t=[e],n=`${Zn}src${Zn}`,r=`${Zn}dist${Zn}`;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(nd(s).href)}catch(o){i=o}throw i instanceof Error?i:Error(String(i))}function id(e){return{importModule:(t)=>rd(t),loadJson:async(t)=>JSON.parse(Zp(t,"utf8")),resolvePath:(t,n)=>{if(n.startsWith("./")||n.startsWith("../"))return ji(ed(t),n);if(td(n))return n;let r=ic(ji(e,"package.json"));try{return r.resolve(n)}catch{return ic(import.meta.url).resolve(n)}}}}async function gy(e,t){return nc(t?.extensions,id(e),ji(e,"project.json"))}function er(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 Mi=I(()=>{rc();X()});async function cc(e,t={}){let{resolveElementPath:n,$media:r,formats:i}=t,s=[],o=new Set;async function a(c,u){let l,f;if(C(c)){let{readFileSync:v}=await import("node:fs"),{resolve:S}=await import("node:path");if(f=u?S(u,c):S(c),o.has(f))return;if(o.add(f),f.endsWith(".json"))l=Gn(v(f,"utf8"),f);else{let{extname:x}=await import("node:path"),E=x(f).toLowerCase(),w=i?.byExtension(E,"parse");if(!w){await Promise.resolve().then(() => Mi());throw er(f,E)}l=await w.parseDocument(v(f,"utf8"))}}else{if(l=c,f=null,l.tagName&&o.has(l.tagName))return;if(l.tagName)o.add(l.tagName)}let{tagName:m}=l;if(!m||!m.includes("-"))throw Error(`compileElement: tagName "${m}" must contain a hyphen`);let{dirname:h}=await import("node:path"),d=f?h(f):null,p=[];if(Array.isArray(l.$elements))for(let v of l.$elements){let S=H(v)?v.$ref:v;if(!C(S))continue;if(d)await a(S,d);let x=n?n(S,d):S.replace(/\.json$/,".js");p.push(x)}let g=Pn(m);if(r)l.$media={...r,...l.$media};let{rewriteSrc:y}=t,b=un(l,g,p,y?(v)=>y(v,d):void 0,yn(l,t.defaults)),A=f?f.replace(/\.json$/,".js"):`${m}.js`;s.push({content:b,path:A,tagName:m})}return await a(e,t.basePath??null),{files:s}}async function sd(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 cc(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),u=`<!DOCTYPE html>
|
|
157
|
+
})`}var Hi=N(()=>{Tr();qa();lt()});function Xa(e){let t=[],n=[],r=null,i=0,s=()=>n.at(-1)?.path??"",o=()=>r===null?s():sd(s(),r),a=()=>{i+=1;let c="";while(i<e.length){let l=e[i];if(l==="\\"){let u=e[i+1]??"";if(u==="u")c+=String.fromCodePoint(Number.parseInt(e.slice(i+2,i+6),16)),i+=6;else c+=rd.get(u)??u,i+=2;continue}if(l==='"')return i+=1,c;c+=l,i+=1}return c};while(i<e.length){let c=e[i];if(za.has(c)||c===","||c===":"){i+=1;continue}if(c==="{"||c==="["){n.push(c==="{"?{keys:new Set,kind:"object",path:o()}:{kind:"array",path:o()}),r=null,i+=1;continue}if(c==="}"||c==="]"){n.pop(),r=null,i+=1;continue}if(c==='"'){let u=a(),f=n.at(-1);if(f?.kind==="object"&&id(e,i)===":"){if(f.keys.has(u))t.push({detail:u,kind:"duplicate-key",path:f.path});f.keys.add(u),r=u}else r=null;continue}if(c==="-"||c>="0"&&c<="9"){let u=i;while(i<e.length&&/[\d+.eE-]/.test(e[i]))i+=1;let f=e.slice(u,i);if(!od(f))t.push({detail:f,kind:"unsafe-number",path:o()});r=null;continue}let l=i;while(i<e.length&&/[A-Za-z]/.test(e[i]))i+=1;if(i===l)i+=1;r=null}return t}function id(e,t){let n=t;while(n<e.length&&za.has(e[n]))n+=1;return e[n]??""}function sd(e,t){return e===""?t:`${e}.${t}`}function od(e){if(/[.eE]/.test(e))return!0;let t=Number(e);if(!Number.isFinite(t))return!1;return String(t)===e.replace(/^\+/,"")}function Qa(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 za,rd;var Za=N(()=>{za=new Set([" ","\t",`
|
|
158
|
+
`,"\r"]);rd=new Map([["b","\b"],["f","\f"],["n",`
|
|
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>
|
|
157
160
|
<html lang="en">
|
|
158
161
|
<head>
|
|
159
162
|
<meta charset="utf-8">
|
|
@@ -172,67 +175,67 @@ app.post('${t}/${e}', async (c) => {
|
|
|
172
175
|
<${o.tagName}></${o.tagName}>
|
|
173
176
|
<script type="module" src="./${c}"></script>
|
|
174
177
|
</body>
|
|
175
|
-
</html>`;return{files:s.files,html:
|
|
176
|
-
`)}function
|
|
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\`
|
|
177
180
|
${t}
|
|
178
|
-
\`;`);let i=`\${${r}}`;return e.byText.set(t,i),i}function
|
|
179
|
-
`)}function
|
|
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}
|
|
180
183
|
? html\`
|
|
181
|
-
${
|
|
184
|
+
${x}
|
|
182
185
|
\`
|
|
183
186
|
: html\`
|
|
184
|
-
${
|
|
185
|
-
\`}`}let S
|
|
186
|
-
${
|
|
187
|
-
\``]),[,
|
|
188
|
-
${
|
|
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(`,
|
|
189
192
|
`)}
|
|
190
|
-
}[String(${
|
|
191
|
-
${
|
|
192
|
-
\`}`}let o=e.tagName??"div",a=n||Ze.has(o),c=[];if(e.attributes)for(let[
|
|
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?`
|
|
193
196
|
${t} ${c.join(`
|
|
194
197
|
${t} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(o))return`${t}<${o}${f}
|
|
195
|
-
${t}>`;let
|
|
196
|
-
${t}>${h}</${o}>`}function
|
|
197
|
-
${
|
|
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\`
|
|
198
201
|
${h}
|
|
199
202
|
\``}).join(`,
|
|
200
203
|
`)}
|
|
201
|
-
}[${
|
|
202
|
-
${
|
|
203
|
-
${t}`;return""}function
|
|
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?`
|
|
204
207
|
${t} ${s.join(`
|
|
205
|
-
${t} `)}`:"",c=
|
|
206
|
-
${
|
|
207
|
-
${t} `;let
|
|
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\`
|
|
208
211
|
${t} <${i}${a}
|
|
209
|
-
${t} >${
|
|
210
|
-
${t}\``,f=(
|
|
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">
|
|
211
214
|
{
|
|
212
215
|
"imports": {
|
|
213
216
|
"@vue/reactivity": "${r}",
|
|
214
217
|
"lit-html": "${i}"
|
|
215
218
|
}
|
|
216
219
|
}
|
|
217
|
-
</script>`,f=
|
|
218
|
-
`)}let
|
|
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>
|
|
220
223
|
<html lang="en">
|
|
221
224
|
<head>
|
|
222
225
|
<meta charset="utf-8">
|
|
223
226
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
224
227
|
<title>${_(n)}</title>
|
|
225
|
-
${
|
|
228
|
+
${d}${u}
|
|
226
229
|
${o}
|
|
227
230
|
</head>
|
|
228
231
|
<body>
|
|
229
232
|
${c}
|
|
230
233
|
${f}
|
|
231
234
|
</body>
|
|
232
|
-
</html>`;return{files:
|
|
233
|
-
${
|
|
234
|
-
})()`)};`);else
|
|
235
|
-
`:"",
|
|
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>
|
|
236
239
|
<html lang="en">
|
|
237
240
|
<head>
|
|
238
241
|
<meta charset="utf-8">
|
|
@@ -241,7 +244,7 @@ ${G}
|
|
|
241
244
|
${S}<script type="importmap">
|
|
242
245
|
{
|
|
243
246
|
"imports": {
|
|
244
|
-
${
|
|
247
|
+
${w.join(`,
|
|
245
248
|
`)}
|
|
246
249
|
}
|
|
247
250
|
}
|
|
@@ -250,21 +253,21 @@ ${v.join(`,
|
|
|
250
253
|
<script type="module" src="./${s}"></script>
|
|
251
254
|
</head>
|
|
252
255
|
<body>
|
|
253
|
-
${
|
|
256
|
+
${E}
|
|
254
257
|
</body>
|
|
255
|
-
</html>`;return{files:[{content:A,path:s}],html:
|
|
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\`
|
|
256
259
|
${g}
|
|
257
|
-
\``),a.push(`:render="${p}"`),c=!0;let y=` ${a.join(" ")}`;return`<${o}${
|
|
258
|
-
${
|
|
259
|
-
`;else if(Array.isArray(e.children)){let
|
|
260
|
-
${
|
|
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(`
|
|
261
264
|
`)}
|
|
262
|
-
`}if(new Set(["input","br","hr","img","meta","link"]).has(n))return`<${n}${i}>`;return`<${n}${i}>${
|
|
263
|
-
`)}function
|
|
264
|
-
`)}function
|
|
265
|
-
`)}function
|
|
266
|
-
`)}function
|
|
267
|
-
`):e.body??"").includes("await ")}var
|
|
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>
|
|
268
271
|
<html lang="en">
|
|
269
272
|
<head>
|
|
270
273
|
<meta charset="utf-8">
|
|
@@ -284,4 +287,4 @@ ${v.join(`,
|
|
|
284
287
|
<${a}></${a}>
|
|
285
288
|
<script type="module" src="./${a}.js"></script>
|
|
286
289
|
</body>
|
|
287
|
-
</html>`;return{files:[
|
|
290
|
+
</html>`;return{files:[u],html:d}}return es(o,{litHtmlSrc:i,projectStyle:s,reactivitySrc:r,...kc(t),title:n})}function kc(e){let t={};if(e.prePaintScheme===!1)t.prePaintScheme=!1;if(e.rewriteSrc)t.rewriteSrc=e.rewriteSrc;return t}async function sx(e,t){let[n,r]=await Promise.all([kd(e),Wi(e)]),{writeFileSync:i,mkdirSync:s}=await import("node:fs"),{dirname:o,join:a}=await import("node:path");if(t){i(t,n.html,"utf8"),console.error(`Written to ${t}`);let c=o(t);for(let l of n.files){let u=a(c,l.path);s(o(u),{recursive:!0}),i(u,l.content,"utf8"),console.error(`Written to ${u}`)}}else process.stdout.write(n.html);if(r&&t){let c=t.replace(/(\.[^.]+)?$/,"-server.js");i(c,r,"utf8"),console.error(`Server handler written to ${c}`)}}var Ld=N(()=>{lt();Hi();pr();Tc();ns();Q();Vi();lt();Hi();pr();ns()});Ld();export{kd as compile,es as compileClient,Ec as compileElement,$d as compileElementPage,Wi as compileServer,td as compileSiteServer,In as isDynamic,sx as runCli};
|