@jxsuite/compiler 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +167 -168
- package/dist/compiler.js +105 -107
- package/package.json +8 -7
- package/src/shared.ts +236 -8
- package/src/site/asset-mounts.ts +140 -0
- package/src/site/image-transform.ts +25 -7
- package/src/site/schema-command.ts +37 -77
- package/src/site/site-build.ts +96 -15
- package/src/site/validate-command.ts +133 -37
- package/src/targets/compile-client.ts +63 -67
- package/src/targets/compile-element.ts +246 -31
- package/src/targets/compile-static.ts +8 -2
package/dist/compiler.js
CHANGED
|
@@ -1,88 +1,90 @@
|
|
|
1
|
-
import{createRequire as b6}from"node:module";var N6=Object.create;var{getPrototypeOf:j6,defineProperty:b1,getOwnPropertyNames:C6}=Object;var R6=Object.prototype.hasOwnProperty;function P6(Z){return this[Z]}var x6,E6,O7=(Z,X,W)=>{var G=Z!=null&&typeof Z==="object";if(G){var Q=X?x6??=new WeakMap:E6??=new WeakMap,J=Q.get(Z);if(J)return J}W=Z!=null?N6(j6(Z)):{};let U=X||!Z||!Z.__esModule?b1(W,"default",{value:Z,enumerable:!0}):W;for(let K of C6(Z))if(!R6.call(U,K))b1(U,K,{get:P6.bind(Z,K),enumerable:!0});if(G)Q.set(Z,U);return U};var T7=(Z,X)=>()=>(X||Z((X={exports:{}}).exports,X),X.exports);var S6=(Z)=>Z;function k6(Z,X){this[Z]=S6.bind(null,X)}var X9=(Z,X)=>{for(var W in X)b1(Z,W,{get:X[W],enumerable:!0,configurable:!0,set:k6.bind(X,W)})};var c=(Z,X)=>()=>(Z&&(X=Z(Z=0)),X);var y2=b6(import.meta.url);function g1(Z){let X=Z.$map;return X&&typeof X==="object"?X:void 0}function U9(Z){return Z.startsWith("window#/")&&v6.has(Z.slice(8))}function l2(Z){return G9.has(Z)}function r(Z,X){if(!Z)return;let W=(Z.depth??0)+1;if(W>m6)return;return{depth:W,path:[...Z.path??[],...Array.isArray(X)?X:[X]],report:Z.report}}function l(Z,X,W,G,Q){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return M2(Z,X,W,G,Q);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z){let J=Y9(Z.$ref,X,W,G);return Q?.report(Q.path??[],J),J}if(Array.isArray(Z))return Z.map((J,U)=>l(J,X,W,G,r(Q,U)));return Q?.report(Q.path??[],Z),Z}function Y9(Z,X,W,G){if(Z==="$reduce/acc")return G?.acc;if(Z.startsWith("$reduce/"))return G?.acc;if(Z.startsWith("$args/")){let Q=Z.slice(6).split("/"),J=G?.args?.[Q[0]];return Q.length>1?m2(J,Q.slice(1).join("/")):J}if(Z.startsWith("event#/")){let Q=Z.slice(7);return m2(W,Q)}if(Z.startsWith("$map/")){let Q=Z.split("/"),[,J]=Q,U,K=g1(X);if(J==="item")U=G?.item??K?.item??X["$map/item"];else if(J==="index")U=G?.index??K?.index??X["$map/index"];else U=K?.[J]??X[`$map/${J}`];return Q.length>2?m2(U,Q.slice(2).join("/")):U}if(Z.startsWith("#/state/")){let Q=Z.slice(8),J=Q.indexOf("/");if(J===-1)return X[Q];return m2(X[Q.slice(0,J)],Q.slice(J+1))}if(Z.startsWith("parent#/"))return X[Z.slice(8)];if(Z.startsWith("window#/"))return m2(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return m2(globalThis.document,Z.slice(10));return X[Z]??null}function h6(Z,X,W,G){if(Z.startsWith("$map/")){let Q=Z.split("/"),[,J]=Q,U,K=g1(X);if(J==="item")U=G?.item??K?.item??X["$map/item"];else if(J==="index")U=G?.index??K?.index??X["$map/index"];else U=K?.[J]??X[`$map/${J}`];if(Q.length>2){let H=Q.slice(2),Y=H.pop(),q=H.length>0?m2(U,H.join("/")):U;return{key:Y,obj:q}}return{key:J==="item"?"$map/item":"$map/index",obj:g1(X)??X}}if(Z.startsWith("#/state/")){let Q=Z.slice(8);if(Q.indexOf("/")===-1)return{key:Q,obj:X};let U=Q.split("/"),K=U.pop(),H=X;for(let Y of U)H=H[Y];return{key:K,obj:H}}return{key:Z,obj:X}}function M2(Z,X,W,G,Q){let J=u6(Z,X,W,G,Q);return Q?.report(Q.path??[],J),J}function u6(Z,X,W,G,Q){let{operator:J,target:U,value:K,initial:H}=Z;if(!g6.has(J))throw Error(`$expression: unknown operator "${J}"`);if(v1.has(J)&&!("value"in Z)){let Y=l(U,X,W,G,r(Q,"target"));if(J==="!")return!Y;if(J==="-")return-Y}if(J==="call"){let Y=U?.$ref;if(typeof Y!=="string")throw TypeError("$expression: call target must be a $ref pointer");let q=(G?.callDepth??0)+1;if(q>z9)throw Error(`$expression: call depth exceeded (${z9})`);let B=Array.isArray(K)?K.map((F,D)=>l(F,X,W,G,r(Q,["value",D]))):[];if(Y.startsWith("window#/")){if(!U9(Y))throw Error(`$expression: "${Y}" is not a blessed pure global`);let F=Y.slice(8),D=y6[F];if(D)return D(...B);let w=m2(globalThis.window,F),A=F.lastIndexOf("/"),C=A===-1?globalThis.window:m2(globalThis.window,F.slice(0,A));return w.apply(C,B)}let M=Y9(Y,X,W,G);if(typeof M==="function")return M(...B);if(M&&typeof M==="object"&&"$expression"in M){let F=M,D={};for(let[w,A]of(F.parameters??[]).entries()){let C=typeof A==="string"?A:A?.name??"";if(!C)continue;D[C]=B[w]===void 0&&typeof A==="object"&&A!==null&&"default"in A?A.default:B[w]}return M2(F.$expression,X,W,{args:D,callDepth:q})}throw TypeError(`$expression: call target "${Y}" is not callable`)}if(h1.has(J)){if(J==="?:"){let F=l(U,X,W,G,r(Q,"target"));if(Q){let D=l(K,X,W,G,r(Q,"value")),w=l(H,X,W,G,r(Q,"initial"));return F?D:w}return F?l(K,X,W,G):l(H,X,W,G)}let Y=l(U,X,W,G,r(Q,"target")),q=String(Y),B=Z.cases??{},M=Object.hasOwn(B,q);if(Q){let F;for(let[w,A]of Object.entries(B)){let C=l(A,X,W,G,r(Q,["cases",w]));if(w===q)F=C}let D=l(Z.default,X,W,G,r(Q,"default"));return M?F:D}return M?l(B[q],X,W,G):l(Z.default,X,W,G)}if(y1.has(J)){let Y=l(U,X,W,G,r(Q,"target")),q=l(K,X,W,G,r(Q,"value"));switch(J){case"+":return Y+q;case"-":return Y-q;case"*":return Y*q;case"/":return Y/q;case"%":return Y%q;case"===":return Y===q;case"!==":return Y!==q;case"<":return Y<q;case"<=":return Y<=q;case">":return Y>q;case">=":return Y>=q;case"&&":return Y&&q;case"||":return Y||q;case"??":return Y??q;default:break}}if(Q9.has(J)){let Y=l(K,X,W,G,r(Q,"value")),{obj:q,key:B}=h6(U.$ref,X,W,G);switch(J){case"=":{q[B]=Y;break}case"+=":{let M=q[B];q[B]=M+Y;break}case"-=":{let M=q[B];q[B]=M-Y;break}case"*=":{let M=q[B];q[B]=M*Y;break}case"/=":{let M=q[B];q[B]=M/Y;break}default:break}return}if(J9.has(J)){let Y=l(U,X,W,G,r(Q,"target"));switch(J){case"push":return Y.push(l(K,X,W,G,r(Q,"value")));case"unshift":return Y.unshift(l(K,X,W,G,r(Q,"value")));case"pop":return Y.pop();case"shift":return Y.shift();case"splice":{let q=l(K,X,W,G,r(Q,"value"));return Y.splice(...q)}default:break}}if(u1.has(J)){let Y=l(U,X,W,G,r(Q,"target")),q=K===void 0?[]:Array.isArray(K)?l(K,X,W,G,r(Q,"value")):[l(K,X,W,G,r(Q,"value"))],B=Y?.[J];if(typeof B!=="function")return;return B.apply(Y,q)}if(m1.has(J)){let Y=l(U,X,W,G,r(Q,"target"));if(J==="reduce"){let q=l(H,X,W,G,r(Q,"initial"));for(let[B,M]of Y.entries())q=M2(K,X,W,{acc:q,index:B,item:M},B===0?r(Q,"value"):void 0);return q}if(J==="map")return Y.map((q,B)=>M2(K,X,W,{...G,index:B,item:q},B===0?r(Q,"value"):void 0));if(J==="filter")return Y.filter((q,B)=>M2(K,X,W,{...G,index:B,item:q},B===0?r(Q,"value"):void 0))}return}function s(Z,X){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return J2(Z,X);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return f1(Z.$ref,X);if(Array.isArray(Z))return Z.map((W)=>s(W,X)).join(", ");return JSON.stringify(Z)}function f6(Z){return`_fx_${Z.replaceAll(/[^A-Za-z0-9_$]/g,"_")}`}function f1(Z,X){let W=X.statePrefix??"state",G=X.eventParam??"event";if(Z==="$reduce/acc")return"_acc";if(Z.startsWith("$reduce/"))return"_acc";if(Z.startsWith("$args/"))return`_args${Z.slice(6).split("/").map((J)=>`[${JSON.stringify(J)}]`).join("")}`;if(Z.startsWith("event#/")){let Q=Z.slice(7);return`${G}.${Q.replaceAll("/",".")}`}if(Z.startsWith("$map/")){let Q=Z.split("/"),[,J]=Q;if(J==="item")return Q.length>2?`_item.${Q.slice(2).join(".")}`:"_item";if(J==="index")return"_index";return`_${J}`}if(Z.startsWith("#/state/")){let Q=Z.slice(8);return`${W}.${Q.replaceAll("/",".")}`}if(Z.startsWith("parent#/"))return`${W}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replaceAll("/",".")}`;return`${W}.${Z}`}function W9(Z,X){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return f1(Z.$ref,X);return s(Z,X)}function c6(Z,X){let W=(G)=>X[G]??"undefined";switch(Z){case"Intl/formatNumber":return`new Intl.NumberFormat(${W(1)}, ${W(2)}).format(${W(0)})`;case"Intl/formatDate":return`new Intl.DateTimeFormat(${W(1)}, ${W(2)}).format(new Date(${W(0)}))`;case"Intl/formatRelativeTime":return`new Intl.RelativeTimeFormat(${W(2)}, ${W(3)}).format(${W(0)}, ${W(1)})`;default:return null}}function J2(Z,X={}){let{operator:W,target:G,value:Q,initial:J}=Z;if(v1.has(W)&&!("value"in Z)){let U=s(G,X);if(W==="!")return`!(${U})`;if(W==="-")return`-(${U})`}if(W==="call"){let U=G?.$ref??"",K=Array.isArray(Q)?Q.map((H)=>s(H,X)):[];if(U.startsWith("window#/")){if(!U9(U))throw Error(`$expression: "${U}" is not a blessed pure global`);let H=c6(U.slice(8),K);if(H)return H;return`window.${U.slice(8).replaceAll("/",".")}(${K.join(", ")})`}if(U.startsWith("#/state/")){let H=U.slice(8),Y=X.formulaParams?.[H];if(Y){let q=Y.map((B,M)=>`${JSON.stringify(B)}: ${K[M]??"undefined"}`).join(", ");return`${f6(H)}(${X.statePrefix??"state"}, { ${q} })`}}return`${f1(U,X)}(${K.join(", ")})`}if(h1.has(W)){if(W==="?:"){let Y=s(G,X),q=s(Q,X),B=s(J,X);return`(${Y} ? ${q} : ${B})`}let U=s(G,X),K=Object.entries(Z.cases??{}).map(([Y,q])=>`_d === ${JSON.stringify(Y)} ? ${s(q,X)} : `).join(""),H="default"in Z?s(Z.default,X):"undefined";return`((_d) => ${K}${H})(String(${U}))`}if(y1.has(W)){let U=s(G,X),K=s(Q,X);return`(${U} ${W} ${K})`}if(Q9.has(W)){let U=W9(G,X),K=s(Q,X);return`${U} ${W} ${K}`}if(J9.has(W)){let U=W9(G,X);switch(W){case"push":return`${U}.push(${s(Q,X)})`;case"unshift":return`${U}.unshift(${s(Q,X)})`;case"pop":return`${U}.pop()`;case"shift":return`${U}.shift()`;case"splice":{let K=Array.isArray(Q)?Q.map((H)=>s(H,X)).join(", "):s(Q,X);return`${U}.splice(${K})`}default:break}}if(u1.has(W)){let U=s(G,X),K=Q===void 0?"":Array.isArray(Q)?Q.map((H)=>s(H,X)).join(", "):s(Q,X);return`(${U})?.${W}?.(${K})`}if(m1.has(W)){let U=s(G,X),K=J2(Q,X);if(W==="reduce"){let H=s(J,X);return`${U}.reduce((_acc, _item, _index) => ${K}, ${H})`}if(W==="map")return`${U}.map((_item, _index) => ${K})`;if(W==="filter")return`${U}.filter((_item, _index) => ${K})`}return"undefined"}function m2(Z,X){let W=Z;for(let G of X.split(/[./]/))W=W?.[G];return W}function s0(Z,X,W,G){return l(Z,X,W,G)}function a0(Z,X={}){return s(Z,X)}var G9,v1,y1,Q9,J9,m1,h1,u1,g6,v6,y6,z9=64,m6=64;var N0=c(()=>{G9=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),v1=new Set(["!","-"]),y1=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),Q9=new Set(["=","+=","-=","*=","/="]),J9=new Set(["push","pop","shift","unshift","splice"]),m1=new Set(["reduce","map","filter"]),h1=new Set(["?:","switch"]),u1=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"]),g6=new Set([...G9,...v1,...y1,...m1,...h1,...u1,"call"]),v6=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","Intl/formatNumber","Intl/formatDate","Intl/formatRelativeTime"]),y6={"Intl/formatDate":(Z,X,W)=>new Intl.DateTimeFormat(X,W).format(new Date(Z)),"Intl/formatNumber":(Z,X,W)=>new Intl.NumberFormat(X,W).format(Z),"Intl/formatRelativeTime":(Z,X,W,G)=>new Intl.RelativeTimeFormat(W,G).format(Z,X)}});function F2(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function T2(Z){return F2(Z)&&typeof Z.$ref==="string"}function j2(Z){return F2(Z)&&Z.$prototype==="Function"}function L2(Z){return F2(Z)&&F2(Z.$expression)}function Z0(Z){return L2(Z)&&Array.isArray(Z.parameters)&&Z.parameters.length>0}function C2(Z){return j2(Z)&&Array.isArray(Z.body)}function j0(Z){return F2(Z)&&typeof Z.$prototype==="string"&&Z.$prototype!=="Function"}function c1(Z){return F2(Z)&&Z.timing==="server"&&typeof Z.$src==="string"&&typeof Z.$export==="string"&&!Z.$prototype}function K9(Z){return F2(Z)&&!Z.$prototype&&!Z.$expression&&"default"in Z}function i2(Z){if(!F2(Z))return!1;for(let X of Object.keys(Z))if(!V9.has(X))return!1;return!0}function K2(Z){return F2(Z)&&Z.$prototype==="Array"}function d1(Z){if(K2(Z))return!0;return Array.isArray(Z)&&Z.some((X)=>K2(X))}function q9(Z){return F2(Z)&&Z.$prototype==="Class"}function i(Z){return typeof Z==="string"&&Z.includes("${")}function p1(Z){return/\breturn\b/.test(Z)}function n2(Z){if(!Z)return[];return Z.map((X)=>typeof X==="string"?X:X.name)}var V9;var o2=c(()=>{V9=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function H9(Z){if("operator"in Z)return"expression";if("if"in Z)return"if";if("$switch"in Z)return"switch";return"dispatch"}async function V0(Z,X,W,G={}){let Q=G.args?{args:G.args}:void 0;for(let J of Z)switch(H9(J)){case"expression":{let U=M2(J,X,W,Q);if(U&&typeof U.then==="function")await U;break}case"if":{let U=J,K=s0(U.if,X,W,Q)?U.then:U.else;if(Array.isArray(K))await V0(K,X,W,G);break}case"switch":{let U=J,K=String(s0(U.$switch,X,W,Q)),H=U.cases??{},Y=Object.hasOwn(H,K)?H[K]:U.default;if(Array.isArray(Y))await V0(Y,X,W,G);break}case"dispatch":{let U=J,K=G.target??W?.currentTarget;if(!K)break;let H={};if("detail"in U)H.detail=s0(U.detail,X,W,Q);if(U.bubbles!==void 0)H.bubbles=U.bubbles;if(U.composed!==void 0)H.composed=U.composed;K.dispatchEvent(new CustomEvent(U.dispatchEvent,H));break}default:break}}function A2(Z,X={}){let W=X.indent??"",G=[];for(let Q of Z)switch(H9(Q)){case"expression":{G.push(`${W}${J2(Q,X)};`);break}case"if":{let J=Q,U=a0(J.if,X),K={...X,indent:`${W} `};if(G.push(`${W}if (${U}) {`,A2(J.then??[],K)),J.else)G.push(`${W}} else {`,A2(J.else,K));G.push(`${W}}`);break}case"switch":{let J=Q,U=a0(J.$switch,X),K={...X,indent:`${W} `};G.push(`${W}switch (String(${U})) {`);for(let[H,Y]of Object.entries(J.cases??{}))G.push(`${W} case ${JSON.stringify(H)}: {`,A2(Y,K),`${W} break;`,`${W} }`);if(J.default)G.push(`${W} default: {`,A2(J.default,K),`${W} }`);G.push(`${W}}`);break}case"dispatch":{let J=Q,U=X.eventParam??"event",K=X.dispatchTarget??`(${U} && ${U}.currentTarget)`,H=[];if("detail"in J)H.push(`detail: ${a0(J.detail,X)}`);if(J.bubbles!==void 0)H.push(`bubbles: ${JSON.stringify(J.bubbles)}`);if(J.composed!==void 0)H.push(`composed: ${JSON.stringify(J.composed)}`);let Y=H.length>0?`, { ${H.join(", ")} }`:"";G.push(`${W}${K}?.dispatchEvent(new CustomEvent(${JSON.stringify(J.dispatchEvent)}${Y}));`);break}default:break}return G.join(`
|
|
2
|
-
`)}var
|
|
1
|
+
import{createRequire as f6}from"node:module";var S6=Object.create;var{getPrototypeOf:k6,defineProperty:u1,getOwnPropertyNames:b6}=Object;var g6=Object.prototype.hasOwnProperty;function v6(Z){return this[Z]}var y6,m6,x7=(Z,X,W)=>{var G=Z!=null&&typeof Z==="object";if(G){var Q=X?y6??=new WeakMap:m6??=new WeakMap,U=Q.get(Z);if(U)return U}W=Z!=null?S6(k6(Z)):{};let J=X||!Z||!Z.__esModule?u1(W,"default",{value:Z,enumerable:!0}):W;for(let Y of b6(Z))if(!g6.call(J,Y))u1(J,Y,{get:v6.bind(Z,Y),enumerable:!0});if(G)Q.set(Z,J);return J};var S7=(Z,X)=>()=>(X||Z((X={exports:{}}).exports,X),X.exports);var h6=(Z)=>Z;function u6(Z,X){this[Z]=h6.bind(null,X)}var J9=(Z,X)=>{for(var W in X)u1(Z,W,{get:X[W],enumerable:!0,configurable:!0,set:u6.bind(X,W)})};var c=(Z,X)=>()=>(Z&&(X=Z(Z=0)),X);var h2=f6(import.meta.url);function f1(Z){let X=Z.$map;return X&&typeof X==="object"?X:void 0}function H9(Z){return Z.startsWith("window#/")&&d6.has(Z.slice(8))}function n2(Z){return K9.has(Z)}function r(Z,X){if(!Z)return;let W=(Z.depth??0)+1;if(W>l6)return;return{depth:W,path:[...Z.path??[],...Array.isArray(X)?X:[X]],report:Z.report}}function i(Z,X,W,G,Q){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return M2(Z,X,W,G,Q);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z){let U=B9(Z.$ref,X,W,G);return Q?.report(Q.path??[],U),U}if(Array.isArray(Z))return Z.map((U,J)=>i(U,X,W,G,r(Q,J)));return Q?.report(Q.path??[],Z),Z}function B9(Z,X,W,G){if(Z==="$reduce/acc")return G?.acc;if(Z.startsWith("$reduce/"))return G?.acc;if(Z.startsWith("$args/")){let Q=Z.slice(6).split("/"),U=G?.args?.[Q[0]];return Q.length>1?u2(U,Q.slice(1).join("/")):U}if(Z.startsWith("event#/")){let Q=Z.slice(7);return u2(W,Q)}if(Z.startsWith("$map/")){let Q=Z.split("/"),[,U]=Q,J,Y=f1(X);if(U==="item")J=G?.item??Y?.item??X["$map/item"];else if(U==="index")J=G?.index??Y?.index??X["$map/index"];else J=Y?.[U]??X[`$map/${U}`];return Q.length>2?u2(J,Q.slice(2).join("/")):J}if(Z.startsWith("#/state/")){let Q=Z.slice(8),U=Q.indexOf("/");if(U===-1)return X[Q];return u2(X[Q.slice(0,U)],Q.slice(U+1))}if(Z.startsWith("parent#/"))return X[Z.slice(8)];if(Z.startsWith("window#/"))return u2(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return u2(globalThis.document,Z.slice(10));return X[Z]??null}function i6(Z,X,W,G){if(Z.startsWith("$map/")){let Q=Z.split("/"),[,U]=Q,J,Y=f1(X);if(U==="item")J=G?.item??Y?.item??X["$map/item"];else if(U==="index")J=G?.index??Y?.index??X["$map/index"];else J=Y?.[U]??X[`$map/${U}`];if(Q.length>2){let H=Q.slice(2),K=H.pop(),V=H.length>0?u2(J,H.join("/")):J;return{key:K,obj:V}}return{key:U==="item"?"$map/item":"$map/index",obj:f1(X)??X}}if(Z.startsWith("#/state/")){let Q=Z.slice(8);if(Q.indexOf("/")===-1)return{key:Q,obj:X};let J=Q.split("/"),Y=J.pop(),H=X;for(let K of J)H=H[K];return{key:Y,obj:H}}return{key:Z,obj:X}}function M2(Z,X,W,G,Q){let U=n6(Z,X,W,G,Q);return Q?.report(Q.path??[],U),U}function n6(Z,X,W,G,Q){let{operator:U,target:J,value:Y,initial:H}=Z;if(!c6.has(U))throw Error(`$expression: unknown operator "${U}"`);if(c1.has(U)&&!("value"in Z)){let K=i(J,X,W,G,r(Q,"target"));if(U==="!")return!K;if(U==="-")return-K}if(U==="call"){let K=J?.$ref;if(typeof K!=="string")throw TypeError("$expression: call target must be a $ref pointer");let V=(G?.callDepth??0)+1;if(V>U9)throw Error(`$expression: call depth exceeded (${U9})`);let B=Array.isArray(Y)?Y.map((M,I)=>i(M,X,W,G,r(Q,["value",I]))):[];if(K.startsWith("window#/")){if(!H9(K))throw Error(`$expression: "${K}" is not a blessed pure global`);let M=K.slice(8),I=p6[M];if(I)return I(...B);let w=u2(globalThis.window,M),$=M.lastIndexOf("/"),A=$===-1?globalThis.window:u2(globalThis.window,M.slice(0,$));return w.apply(A,B)}let F=B9(K,X,W,G);if(typeof F==="function")return F(...B);if(F&&typeof F==="object"&&"$expression"in F){let M=F,I={};for(let[w,$]of(M.parameters??[]).entries()){let A=typeof $==="string"?$:$?.name??"";if(!A)continue;I[A]=B[w]===void 0&&typeof $==="object"&&$!==null&&"default"in $?$.default:B[w]}return M2(M.$expression,X,W,{args:I,callDepth:V})}throw TypeError(`$expression: call target "${K}" is not callable`)}if(l1.has(U)){if(U==="?:"){let M=i(J,X,W,G,r(Q,"target"));if(Q){let I=i(Y,X,W,G,r(Q,"value")),w=i(H,X,W,G,r(Q,"initial"));return M?I:w}return M?i(Y,X,W,G):i(H,X,W,G)}let K=i(J,X,W,G,r(Q,"target")),V=String(K),B=Z.cases??{},F=Object.hasOwn(B,V);if(Q){let M;for(let[w,$]of Object.entries(B)){let A=i($,X,W,G,r(Q,["cases",w]));if(w===V)M=A}let I=i(Z.default,X,W,G,r(Q,"default"));return F?M:I}return F?i(B[V],X,W,G):i(Z.default,X,W,G)}if(d1.has(U)){let K=i(J,X,W,G,r(Q,"target")),V=i(Y,X,W,G,r(Q,"value"));switch(U){case"+":return K+V;case"-":return K-V;case"*":return K*V;case"/":return K/V;case"%":return K%V;case"===":return K===V;case"!==":return K!==V;case"<":return K<V;case"<=":return K<=V;case">":return K>V;case">=":return K>=V;case"&&":return K&&V;case"||":return K||V;case"??":return K??V;default:break}}if(V9.has(U)){let K=i(Y,X,W,G,r(Q,"value")),{obj:V,key:B}=i6(J.$ref,X,W,G);switch(U){case"=":{V[B]=K;break}case"+=":{let F=V[B];V[B]=F+K;break}case"-=":{let F=V[B];V[B]=F-K;break}case"*=":{let F=V[B];V[B]=F*K;break}case"/=":{let F=V[B];V[B]=F/K;break}default:break}return}if(q9.has(U)){let K=i(J,X,W,G,r(Q,"target"));switch(U){case"push":return K.push(i(Y,X,W,G,r(Q,"value")));case"unshift":return K.unshift(i(Y,X,W,G,r(Q,"value")));case"pop":return K.pop();case"shift":return K.shift();case"splice":{let V=i(Y,X,W,G,r(Q,"value"));return K.splice(...V)}default:break}}if(i1.has(U)){let K=i(J,X,W,G,r(Q,"target")),V=Y===void 0?[]:Array.isArray(Y)?i(Y,X,W,G,r(Q,"value")):[i(Y,X,W,G,r(Q,"value"))],B=K?.[U];if(typeof B!=="function")return;return B.apply(K,V)}if(p1.has(U)){let K=i(J,X,W,G,r(Q,"target"));if(U==="reduce"){let V=i(H,X,W,G,r(Q,"initial"));for(let[B,F]of K.entries())V=M2(Y,X,W,{acc:V,index:B,item:F},B===0?r(Q,"value"):void 0);return V}if(U==="map")return K.map((V,B)=>M2(Y,X,W,{...G,index:B,item:V},B===0?r(Q,"value"):void 0));if(U==="filter")return K.filter((V,B)=>M2(Y,X,W,{...G,index:B,item:V},B===0?r(Q,"value"):void 0))}return}function s(Z,X){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return J2(Z,X);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return n1(Z.$ref,X);if(Array.isArray(Z))return Z.map((W)=>s(W,X)).join(", ");return JSON.stringify(Z)}function o6(Z){return`_fx_${Z.replaceAll(/[^A-Za-z0-9_$]/g,"_")}`}function n1(Z,X){let W=X.statePrefix??"state",G=X.eventParam??"event";if(Z==="$reduce/acc")return"_acc";if(Z.startsWith("$reduce/"))return"_acc";if(Z.startsWith("$args/"))return`_args${Z.slice(6).split("/").map((U)=>`[${JSON.stringify(U)}]`).join("")}`;if(Z.startsWith("event#/")){let Q=Z.slice(7);return`${G}.${Q.replaceAll("/",".")}`}if(Z.startsWith("$map/")){let Q=Z.split("/"),[,U]=Q;if(U==="item")return Q.length>2?`_item.${Q.slice(2).join(".")}`:"_item";if(U==="index")return"_index";return`_${U}`}if(Z.startsWith("#/state/")){let Q=Z.slice(8);return`${W}.${Q.replaceAll("/",".")}`}if(Z.startsWith("parent#/"))return`${W}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replaceAll("/",".")}`;return`${W}.${Z}`}function Y9(Z,X){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return n1(Z.$ref,X);return s(Z,X)}function r6(Z,X){let W=(G)=>X[G]??"undefined";switch(Z){case"Intl/formatNumber":return`new Intl.NumberFormat(${W(1)}, ${W(2)}).format(${W(0)})`;case"Intl/formatDate":return`new Intl.DateTimeFormat(${W(1)}, ${W(2)}).format(new Date(${W(0)}))`;case"Intl/formatRelativeTime":return`new Intl.RelativeTimeFormat(${W(2)}, ${W(3)}).format(${W(0)}, ${W(1)})`;default:return null}}function J2(Z,X={}){let{operator:W,target:G,value:Q,initial:U}=Z;if(c1.has(W)&&!("value"in Z)){let J=s(G,X);if(W==="!")return`!(${J})`;if(W==="-")return`-(${J})`}if(W==="call"){let J=G?.$ref??"",Y=Array.isArray(Q)?Q.map((H)=>s(H,X)):[];if(J.startsWith("window#/")){if(!H9(J))throw Error(`$expression: "${J}" is not a blessed pure global`);let H=r6(J.slice(8),Y);if(H)return H;return`window.${J.slice(8).replaceAll("/",".")}(${Y.join(", ")})`}if(J.startsWith("#/state/")){let H=J.slice(8),K=X.formulaParams?.[H];if(K){let V=K.map((B,F)=>`${JSON.stringify(B)}: ${Y[F]??"undefined"}`).join(", ");return`${o6(H)}(${X.statePrefix??"state"}, { ${V} })`}}return`${n1(J,X)}(${Y.join(", ")})`}if(l1.has(W)){if(W==="?:"){let K=s(G,X),V=s(Q,X),B=s(U,X);return`(${K} ? ${V} : ${B})`}let J=s(G,X),Y=Object.entries(Z.cases??{}).map(([K,V])=>`_d === ${JSON.stringify(K)} ? ${s(V,X)} : `).join(""),H="default"in Z?s(Z.default,X):"undefined";return`((_d) => ${Y}${H})(String(${J}))`}if(d1.has(W)){let J=s(G,X),Y=s(Q,X);return`(${J} ${W} ${Y})`}if(V9.has(W)){let J=Y9(G,X),Y=s(Q,X);return`${J} ${W} ${Y}`}if(q9.has(W)){let J=Y9(G,X);switch(W){case"push":return`${J}.push(${s(Q,X)})`;case"unshift":return`${J}.unshift(${s(Q,X)})`;case"pop":return`${J}.pop()`;case"shift":return`${J}.shift()`;case"splice":{let Y=Array.isArray(Q)?Q.map((H)=>s(H,X)).join(", "):s(Q,X);return`${J}.splice(${Y})`}default:break}}if(i1.has(W)){let J=s(G,X),Y=Q===void 0?"":Array.isArray(Q)?Q.map((H)=>s(H,X)).join(", "):s(Q,X);return`(${J})?.${W}?.(${Y})`}if(p1.has(W)){let J=s(G,X),Y=J2(Q,X);if(W==="reduce"){let H=s(U,X);return`${J}.reduce((_acc, _item, _index) => ${Y}, ${H})`}if(W==="map")return`${J}.map((_item, _index) => ${Y})`;if(W==="filter")return`${J}.filter((_item, _index) => ${Y})`}return"undefined"}function u2(Z,X){let W=Z;for(let G of X.split(/[./]/))W=W?.[G];return W}function Z1(Z,X,W,G){return i(Z,X,W,G)}function X1(Z,X={}){return s(Z,X)}var K9,c1,d1,V9,q9,p1,l1,i1,c6,d6,p6,U9=64,l6=64;var P0=c(()=>{K9=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),c1=new Set(["!","-"]),d1=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),V9=new Set(["=","+=","-=","*=","/="]),q9=new Set(["push","pop","shift","unshift","splice"]),p1=new Set(["reduce","map","filter"]),l1=new Set(["?:","switch"]),i1=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"]),c6=new Set([...K9,...c1,...d1,...p1,...l1,...i1,"call"]),d6=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","Intl/formatNumber","Intl/formatDate","Intl/formatRelativeTime"]),p6={"Intl/formatDate":(Z,X,W)=>new Intl.DateTimeFormat(X,W).format(new Date(Z)),"Intl/formatNumber":(Z,X,W)=>new Intl.NumberFormat(X,W).format(Z),"Intl/formatRelativeTime":(Z,X,W,G)=>new Intl.RelativeTimeFormat(W,G).format(Z,X)}});function $2(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function V2(Z){return $2(Z)&&typeof Z.$ref==="string"}function C2(Z){return $2(Z)&&Z.$prototype==="Function"}function A2(Z){return $2(Z)&&$2(Z.$expression)}function z0(Z){return A2(Z)&&Array.isArray(Z.parameters)&&Z.parameters.length>0}function R2(Z){return C2(Z)&&Array.isArray(Z.body)}function B0(Z){return $2(Z)&&typeof Z.$prototype==="string"&&Z.$prototype!=="Function"}function o1(Z){return $2(Z)&&Z.timing==="server"&&typeof Z.$src==="string"&&typeof Z.$export==="string"&&!Z.$prototype}function F9(Z){return $2(Z)&&!Z.$prototype&&!Z.$expression&&"default"in Z}function o2(Z){if(!$2(Z))return!1;for(let X of Object.keys(Z))if(!M9.has(X))return!1;return!0}function K2(Z){return $2(Z)&&Z.$prototype==="Array"}function r1(Z){if(K2(Z))return!0;return Array.isArray(Z)&&Z.some((X)=>K2(X))}function $9(Z){return $2(Z)&&Z.$prototype==="Class"}function l(Z){return typeof Z==="string"&&Z.includes("${")}function W0(Z){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test(Z)}function f2(Z){if(!Z)return[];return Z.map((X)=>typeof X==="string"?X:X.name)}var M9;var r2=c(()=>{M9=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function D9(Z){if("operator"in Z)return"expression";if("if"in Z)return"if";if("$switch"in Z)return"switch";return"dispatch"}async function F0(Z,X,W,G={}){let Q=G.args?{args:G.args}:void 0;for(let U of Z)switch(D9(U)){case"expression":{let J=M2(U,X,W,Q);if(J&&typeof J.then==="function")await J;break}case"if":{let J=U,Y=Z1(J.if,X,W,Q)?J.then:J.else;if(Array.isArray(Y))await F0(Y,X,W,G);break}case"switch":{let J=U,Y=String(Z1(J.$switch,X,W,Q)),H=J.cases??{},K=Object.hasOwn(H,Y)?H[Y]:J.default;if(Array.isArray(K))await F0(K,X,W,G);break}case"dispatch":{let J=U,Y=G.target??W?.currentTarget;if(!Y)break;let H={};if("detail"in J)H.detail=Z1(J.detail,X,W,Q);if(J.bubbles!==void 0)H.bubbles=J.bubbles;if(J.composed!==void 0)H.composed=J.composed;Y.dispatchEvent(new CustomEvent(J.dispatchEvent,H));break}default:break}}function w2(Z,X={}){let W=X.indent??"",G=[];for(let Q of Z)switch(D9(Q)){case"expression":{G.push(`${W}${J2(Q,X)};`);break}case"if":{let U=Q,J=X1(U.if,X),Y={...X,indent:`${W} `};if(G.push(`${W}if (${J}) {`,w2(U.then??[],Y)),U.else)G.push(`${W}} else {`,w2(U.else,Y));G.push(`${W}}`);break}case"switch":{let U=Q,J=X1(U.$switch,X),Y={...X,indent:`${W} `};G.push(`${W}switch (String(${J})) {`);for(let[H,K]of Object.entries(U.cases??{}))G.push(`${W} case ${JSON.stringify(H)}: {`,w2(K,Y),`${W} break;`,`${W} }`);if(U.default)G.push(`${W} default: {`,w2(U.default,Y),`${W} }`);G.push(`${W}}`);break}case"dispatch":{let U=Q,J=X.eventParam??"event",Y=X.dispatchTarget??`(${J} && ${J}.currentTarget)`,H=[];if("detail"in U)H.push(`detail: ${X1(U.detail,X)}`);if(U.bubbles!==void 0)H.push(`bubbles: ${JSON.stringify(U.bubbles)}`);if(U.composed!==void 0)H.push(`composed: ${JSON.stringify(U.composed)}`);let K=H.length>0?`, { ${H.join(", ")} }`:"";G.push(`${W}${Y}?.dispatchEvent(new CustomEvent(${JSON.stringify(U.dispatchEvent)}${K}));`);break}default:break}return G.join(`
|
|
2
|
+
`)}var z1=c(()=>{P0()});function e6(Z){if(!s6||!Z.includes("v"))return Z;return Z.replace(a6,(X,W,G)=>`${W}${t6[G.toLowerCase()]??`cq${G}`}`)}function ZZ(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function q2(Z){return Z.replaceAll(/[A-Z]/g,(X)=>`-${X.toLowerCase()}`)}function I2(Z){return Object.entries(Z).filter(([X,W])=>!ZZ(X)&&(W===null||typeof W!=="object")).map(([X,W])=>`${q2(X)}: ${e6(String(W))}`).join("; ")}function a2(Z){return/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(Z.trim())?.[1]??null}function a1(Z,X){if(Z===":root"||Z==="html")return{auto:`${Z}:where(:not([${c2}]))`,forced:`${Z}:where([${c2}="${X}"])`};return{auto:`:where(:root:not([${c2}])) ${Z}`,forced:`:where(:root[${c2}="${X}"]) ${Z}`}}var s6=!1,a6,t6,s2,c2="data-color-scheme",s1="jx-color-scheme";var E0=c(()=>{P0();r2();z1();a6=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,t6={b:"cqb",h:"cqh",i:"cqi",max:"cqmax",min:"cqmin",w:"cqw"};s2=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"])});function x0(Z,X){let W=[];for(let[G,Q]of(Z.parameters??[]).entries()){let U=typeof Q==="string"?Q:Q?.name??"";if(!U)continue;let Y=typeof Q==="object"&&Q!==null&&"default"in Q?`_a[${G}] === undefined ? ${JSON.stringify(Q.default)} : _a[${G}]`:`_a[${G}]`;W.push(`${JSON.stringify(U)}: ${Y}`)}return`(..._a) => { const _args = { ${W.join(", ")} }; return ${X}; }`}function G1(Z,X){let W=X?.$export,G=typeof W==="string"&&W!==""?W:Z;return G===Z?Z:`${G} as ${Z}`}function J1(Z,X,W={}){let{statePrefix:G="state",indent:Q="",collect:U}=W,{url:J}=X,Y=l(J),H=X.method??"GET";if(X.manual)return`${Q}// ${Z}: manual Request — fetch triggered by user action`;let K=[`// ${Z}: auto-fetch from ${Y?"(dynamic URL)":J}`,U?`${U}.push(effect(() => {`:"effect(() => {"];if(Y)K.push(` const url = \`${XZ(J,G)}\`;`,' if (!url || url === "undefined" || url.includes("undefined")) return;');else K.push(` const url = ${JSON.stringify(J)};`);let V=[];if(H!=="GET")V.push(`method: ${JSON.stringify(H)}`);if(X.headers)V.push(`headers: ${JSON.stringify(X.headers)}`);if(X.body){let F=typeof X.body==="object"?JSON.stringify(JSON.stringify(X.body)):JSON.stringify(X.body);V.push(`body: ${F}`)}let B=V.length>0?`, { ${V.join(", ")} }`:"";return K.push(` fetch(url${B})`," .then(r => r.ok ? r.json() : Promise.reject(r.statusText))",` .then(d => { ${G}.${Z} = d; })`,` .catch(e => { ${G}.${Z} = { error: String(e) }; });`,U?"}));":"});"),K.map((F)=>`${Q}${F}`).join(`
|
|
3
|
+
`)}function XZ(Z,X){if(X==="state")return Z;return Z.replaceAll(/\$\{([^}]*)\}/g,(W,G)=>`\${${G.replaceAll(/(?<!this\.)\bstate\./g,`${X}.`)}}`)}function K1(Z){if(!Z||typeof Z!=="object")return!1;if(Z.state)for(let[X,W]of Object.entries(Z.state)){if(X==="$site"||X==="$page")continue;if(W&&typeof W==="object"&&!Array.isArray(W)&&W.timing==="compiler")continue;if(typeof W!=="object"||W===null||Array.isArray(W))return!0;if(W.$prototype)return!0;if("default"in W)return!0;if(o2(W))continue;return!0}if(Z.$switch)return!0;if(K2(Z)||r1(Z.children))return!0;if(Array.isArray(Z.children)&&Z.children.some((X)=>K1(X)))return!0;for(let[X,W]of Object.entries(Z)){if(s2.has(X))continue;if(W!==null&&typeof W==="object"&&typeof W.$ref==="string")return!0;if(l(W))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(l(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(l(X))return!0}return!1}function A9(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(K2(Z)||r1(Z.children))return!0;for(let[X,W]of Object.entries(Z)){if(s2.has(X))continue;if(W!==null&&typeof W==="object"&&typeof W.$ref==="string")return!0;if(l(W))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(l(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(l(X))return!0}return!1}function D0(Z,X=null,W={},G={}){let Q=Z?.state?w9(Z.state,X):X??Object.create(null);return{media:G,scope:Q,scopeDefs:W}}function w9(Z={},X=null){let W=Object.create(X??null),G=X?.[e1],Q=new Set(G instanceof Set?G:[]);Object.defineProperty(W,e1,{configurable:!0,enumerable:!1,value:Q,writable:!0});for(let[J,Y]of Object.entries(Z)){if(typeof Y!=="object"||Y===null||Array.isArray(Y)){d2(W,J,W1(Y));continue}let H=Y;if("default"in H){d2(W,J,W1(H.default));continue}if(!H.$prototype&&!("$expression"in H)&&!o2(H))d2(W,J,W1(H))}let U=[];for(let[J,Y]of Object.entries(Z)){if(typeof Y==="string"&&l(Y)){U.push([J,Y]);continue}if(!Y||typeof Y!=="object")continue;if(A2(Y)){let H=Y.$expression;if(z0(Y)){let K=Y.parameters;d2(W,J,(...V)=>{let B={};for(let[F,M]of K.entries()){let I=typeof M==="string"?M:M?.name??"";if(!I)continue;B[I]=V[F]===void 0&&typeof M==="object"&&M!==null&&"default"in M?M.default:V[F]}return M2(H,W,null,{args:B})})}else if(n2(H.operator))d2(W,J,(K,V)=>M2(H,K,V));else t1(W,J,()=>M2(H,W,null));continue}if(C2(Y)){if(R2(Y)){let{body:H}=Y;d2(W,J,(K,V)=>{F0(H,K??W,V??null)})}else if(typeof Y.body==="string"){let H=Y.parameters?f2(Y.parameters):Y.arguments??[],{body:K}=Y,V=H.includes("state")?H:["state",...H],B=Function(...V,K),F=(M,I)=>B(...V.map((w)=>w==="state"?M:I));if(W0(K))t1(W,J,()=>F(W));else d2(W,J,F)}else d2(W,J,()=>{}),Q.add(J);continue}if(B0(Y)&&(Y.$prototype==="LocalStorage"||Y.$prototype==="SessionStorage")){d2(W,J,W1(Y.default??null));continue}if(B0(Y)&&Y.$prototype==="Request")Q.add(J)}for(let[J,Y]of U){if(I9(Y,W))Q.add(J);t1(W,J,()=>X8(Y,W))}return W}function d2(Z,X,W){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,value:W,writable:!0})}function t1(Z,X,W){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,get:W})}function z2(Z,X){if(O2(Z))return zZ(Z.$ref,X);if(l(Z))return X8(Z,X);return Z}function O2(Z){return V2(Z)}function zZ(Z,X){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let W=Z.split("/"),G=W[1],Q=X.$map?.[G]??X[`$map/${G}`];return W.length>2?L9(Q,W.slice(2).join("/")):Q}if(Z.startsWith("#/state/")){let W=Z.slice(8),G=W.indexOf("/");if(G===-1)return X[W];return L9(X[W.slice(0,G)],W.slice(G+1))}return X[Z]??null}function I9(Z,X){if(!X)return!1;let W=X[e1];for(let G of Z.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*(\()?/g)){if(G[2])continue;let Q=G[1];if(W instanceof Set&&W.has(Q))return!0;if(typeof X[Q]==="function")return!0}return!1}function X8(Z,X){if(I9(Z,X))return null;try{let W=Z.match(/^\$\{(.+)\}$/s);if(W)return Function("state","$map",`return (${W[1]})`)(X,X?.$map);return Function("state","$map",`return \`${Z}\``)(X,X?.$map)}catch{return null}}function L9(Z,X){if(!X)return Z;let W=Z;for(let G of X.split("/"))W=W==null?void 0:W[G];return W}function W1(Z){if(Z===null||typeof Z!=="object")return Z;return structuredClone(Z)}function M0(Z,X){let W="",G=z2(Z.id,X),Q=z2(Z.className,X),U=z2(Z.hidden,X),J=z2(Z.tabIndex,X),Y=z2(Z.title,X),H=z2(Z.lang,X),K=z2(Z.dir,X);if(G)W+=` id="${p(String(G))}"`;if(Q)W+=` class="${p(String(Q))}"`;if(U)W+=" hidden";if(J!==void 0&&J!==null)W+=` tabindex="${p(String(J))}"`;if(Y)W+=` title="${p(String(Y))}"`;if(H)W+=` lang="${p(String(H))}"`;if(K)W+=` dir="${p(String(K))}"`;if(Z.style&&X){let V=Object.entries(Z.style).filter(([B,F])=>!B.startsWith(":")&&!B.startsWith(".")&&!B.startsWith("&")&&!B.startsWith("[")&&!B.startsWith("@")&&F!==null&&typeof F!=="object"&&typeof F==="string"&&l(F)).map(([B,F])=>{let M=z2(F,X);return M==null?null:`${q2(B)}: ${M}`}).filter(Boolean).join("; ");if(V)W+=` style="${V}"`}if(Z.attributes)for(let[V,B]of Object.entries(Z.attributes)){let F=z2(B,X);if(F!==null&&F!==void 0&&(typeof F==="string"||typeof F==="number"||typeof F==="boolean"))W+=` ${V}="${p(String(F))}"`}if(Z.tagName==="img"){if(!Z.attributes?.loading)W+=' loading="lazy"';if(!Z.attributes?.decoding)W+=' decoding="async"'}if(Z.$static)W+=" data-jx-static";else if(Z.$prerendered)W+=" data-jx-prerendered";return W}function S0(Z,X=" "){return Z?"":`
|
|
4
|
+
${X}`}function V1(){let Z=JSON.stringify(s1),X=JSON.stringify(c2);return`(function(){try{var s=localStorage.getItem(${Z});if(s==="light"||s==="dark"){document.documentElement.setAttribute(${X},s)}}catch(e){}})()`}function O9(Z,X,W){let G=Z.startsWith("@--")?X[Z.slice(1)]??Z.slice(1):Z.startsWith("@(")?Z.slice(1):null,Q=G===null?Z:`@media ${G}`,U=G===null?null:a2(G);return(J,Y)=>{if(!Y)return;if(U){let{auto:H,forced:K}=a1(J,U);W.push(`${Q} { ${H} { ${Y} } }`,`${K} { ${Y} }`)}else W.push(`${Q} { ${J} { ${Y} } }`)}}function q1(Z,X,W,G,Q){if(Q===null||typeof Q!=="object"||Array.isArray(Q))return;let U=O9(X,W,Z);U(G,I2(Q));for(let[J,Y]of Object.entries(Q)){if(Y===null||typeof Y!=="object"||Array.isArray(Y))continue;if(J.startsWith("@"))continue;let H=J.startsWith("&")?J.replace("&",G):J.startsWith(":")||J.startsWith(".")||J.startsWith("[")?`${G}${J}`:`${G} ${J}`;U(H,I2(Y))}}function L0(Z,X={},W=null){let G=[];if(W&&typeof W==="object"){let U=(V,B)=>{let F=I2(B);if(F)G.push(`${V} { ${F} }`);for(let[M,I]of Object.entries(B)){if(I===null||typeof I!=="object"||Array.isArray(I))continue;if(M.startsWith("@")){q1(G,M,X,V,I);continue}let w=M.startsWith("&")?M.replace("&",V):M.startsWith(":")||M.startsWith(".")||M.startsWith("[")?`${V}${M}`:`${V} ${M}`;U(w,I)}},J={},Y={};for(let[V,B]of Object.entries(W)){if(V.startsWith(":")||V.startsWith(".")||V.startsWith("[")||V.startsWith("@"))continue;if(B!==null&&typeof B==="object"&&!Array.isArray(B))continue;if(V.startsWith("--"))J[V]=B;else Y[V]=B}let H=I2(J);if(H)G.push(`:root { ${H} }`);let K=I2(Y);if(K)G.push(`body { ${K} }`);for(let[V,B]of Object.entries(W))if(V.startsWith(":")||V.startsWith(".")||V.startsWith("["))U(V,B);else if(B!==null&&typeof B==="object"&&!Array.isArray(B)&&!V.startsWith("@")&&!V.startsWith("--"))U(V,B);else if(V.startsWith("@")&&B!==null&&typeof B==="object"&&!Array.isArray(B)){let F=O9(V,X,G),M={},I={},w=[];for(let[$,A]of Object.entries(B)){if(A!==null&&typeof A==="object"&&!Array.isArray(A)){if(!$.startsWith("@"))w.push([$,A]);continue}if($.startsWith("--"))M[$]=A;else I[$]=A}F(":root",I2(M)),F("body",I2(I));for(let[$,A]of w)F($,I2(A))}}if(Object.values(X).some((U)=>a2(U)!==null)&&!(W&&typeof W==="object"&&("colorScheme"in W)))G.push(":root { color-scheme: light dark }",`:root:where([${c2}="light"]) { color-scheme: light }`,`:root:where([${c2}="dark"]) { color-scheme: dark }`);if($0(Z,G,X,"",{n:0}),G.length===0)return"";return`<style>
|
|
3
5
|
${G.join(`
|
|
4
6
|
`)}
|
|
5
|
-
</style>`}function
|
|
7
|
+
</style>`}function _9(Z,X,W,G){let Q=I2(X);if(Q)W.push(`${Z} { ${Q} }`);for(let[U,J]of Object.entries(X)){if(J===null||typeof J!=="object"||Array.isArray(J))continue;if(U.startsWith("@")){q1(W,U,G,Z,J);continue}let Y=U.startsWith("&")?U.replace("&",Z):U.startsWith(":")||U.startsWith(".")||U.startsWith("[")?`${Z}${U}`:`${Z} ${U}`;_9(Y,J,W,G)}}function $0(Z,X,W,G="",Q,U="jx"){let J=Q??{n:0};if(!Z||typeof Z!=="object")return;if(Z.style&&!Z.id&&!Z.className)Z.className=`${U}-${J.n}`,J.n+=1;let Y=Z.id?`#${Z.id}`:Z.className?`.${Z.className.split(" ")[0]}`:Z.tagName??"*";if(Z.style){let H=[];for(let[K,V]of Object.entries(Z.style)){if(K.startsWith(":")||K.startsWith(".")||K.startsWith("&")||K.startsWith("[")||K.startsWith("@"))continue;if(V===null||typeof V==="object")continue;if(typeof V==="string"&&l(V))continue;H.push(` ${q2(K)}: ${V};`)}if(H.length>0)X.push(`${Y} {
|
|
6
8
|
${H.join(`
|
|
7
9
|
`)}
|
|
8
|
-
}`);for(let[
|
|
9
|
-
`);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";if(Z.$switch){let
|
|
10
|
-
`);return`<${G}${Q}>${
|
|
11
|
-
`)}function
|
|
12
|
-
${
|
|
10
|
+
}`);for(let[K,V]of Object.entries(Z.style)){if(V===null||typeof V!=="object"||Array.isArray(V))continue;if(K.startsWith("@"))q1(X,K,W,Y,V);else{let B=K.startsWith("&")?K.replace("&",Y):K.startsWith(":")||K.startsWith(".")||K.startsWith("[")?`${Y}${K}`:`${Y} ${K}`;_9(B,V,X,W)}}}if(Array.isArray(Z.children))for(let H of Z.children)$0(H,X,W,Y,J,U);if(Z.cases&&typeof Z.cases==="object")for(let H of Object.values(Z.cases))$0(H,X,W,Y,J,U)}function p(Z){return String(Z).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function H1(Z){return Z.split("-").map((X)=>X.charAt(0).toUpperCase()+X.slice(1)).join("")}function N9(Z){let X=new Map;return T9(Z,X),[...X.values()]}function T9(Z,X){if(!Z||typeof Z!=="object")return;if(Z.state){for(let[W,G]of Object.entries(Z.state))if(o1(G))X.set(G.$export,{exportName:G.$export,key:W,src:G.$src})}if(Array.isArray(Z.children))for(let W of Z.children)T9(W,X)}function Q1(Z,X,W=null){if(typeof Z==="string"){if(l(Z)&&X){let J=X8(Z,X);return J!=null?p(String(J)):p(Z)}return p(Z)}if(typeof Z==="number"||typeof Z==="boolean")return p(String(Z));if(Array.isArray(Z))return Z.map((J)=>Q1(J,X,W)).join(`
|
|
11
|
+
`);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";if(Z.$switch){let J=Z.tagName??"div",Y=M0(Z,X),H=z2(Z.$switch,X),K=H==null?void 0:Z.cases?.[String(H)],V=K!==void 0&&!O2(K)?Q1(K,X,W):"";return`<${J}${Y}>${V}</${J}>`}let G=Z.tagName??"div";if(G==="slot"&&W!=null)return W;let Q=M0(Z,X);if(z8.has(G))return`<${G}${Q}>`;let U="";if(Z.textContent!==void 0){let J=z2(Z.textContent,X);U=J!=null?p(String(J)):""}else if(Z.innerHTML){let J=z2(Z.innerHTML,X);U=J!=null?String(J):Z.innerHTML}else if(Array.isArray(Z.children))U=Z.children.map((J)=>Q1(J,X,W)).join(`
|
|
12
|
+
`);return`<${G}${Q}>${U}</${G}>`}function n7(Z,X=null,W=null){let G=Z.state??{};if(X){G={...G};for(let[U,J]of Object.entries(X))if(U in G){let Y=G[U];G[U]=Y&&typeof Y==="object"&&!Array.isArray(Y)&&"default"in Y?{...Y,default:J}:J}else G[U]=J}let Q=w9(G,null);if(!Array.isArray(Z.children))return"";return Z.children.map((U)=>Q1(U,Q,W)).join(`
|
|
13
|
+
`)}function o7(Z){return Z8(Z)}function Z8(Z){if(!Z||typeof Z!=="object")return!0;if(Array.isArray(Z))return Z.every((X)=>Z8(X));if(Z.$prototype)return!1;if(Z.$ref)return!1;if(Z.state)for(let X of Object.values(Z.state)){if(!X||typeof X!=="object")continue;let W=X;if(W.$prototype)return!1;if(W.$ref)return!1}for(let X of Object.keys(Z))if(X.startsWith("on")&&X!=="observedAttributes")return!1;if(Array.isArray(Z.children))return Z.children.every((X)=>Z8(X));if(Z.children&&typeof Z.children==="object"&&Z.children.$prototype)return!1;return!0}function r7(Z,X,W=null,G={}){let Q=[];if(X&&typeof X==="object"){let U=[];for(let[J,Y]of Object.entries(X)){if(J.startsWith(":")||J.startsWith(".")||J.startsWith("&")||J.startsWith("[")||J.startsWith("@"))continue;if(Y===null||typeof Y==="object")continue;if(typeof Y==="string"&&l(Y))continue;U.push(` ${q2(J)}: ${Y};`)}if(U.length>0)Q.push(`${Z} {
|
|
14
|
+
${U.join(`
|
|
13
15
|
`)}
|
|
14
|
-
}`);for(let[
|
|
16
|
+
}`);for(let[J,Y]of Object.entries(X))if(J.startsWith("@"))q1(Q,J,G,Z,Y);else if(J.startsWith(":")||J.startsWith(".")||J.startsWith("&")||J.startsWith("[")){let H=J.startsWith("&")?J.replace("&",Z):`${Z}${J}`;Q.push(`${H} { ${I2(Y)} }`)}}if(W&&Array.isArray(W.children)){let U={n:0};for(let J of W.children)$0(J,Q,G,"",U,Z)}return Q.length>0?`${Q.join(`
|
|
15
17
|
`)}
|
|
16
|
-
`:""}var X1="https://esm.sh/@vue/reactivity@3.5.40",z1="https://esm.sh/lit-html@3.3.0",s1;var X0=c(()=>{C0();N0();t0();o2();C0();N0();t0();o2();s1=new Set(["input","br","hr","img","meta","link","area","col","source"])});function f2(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var r6,x0=()=>r6;var I9=c(()=>{r6=/^win/.test(globalThis.process?globalThis.process.platform:"")});function e(Z,X){let W=new URL(f2(Z),"https://aaa.nonexistanturl.com"),G=new URL(f2(X),W),Q=X.match(/(\s*)$/)?.[1]||"";if(G.hostname==="aaa.nonexistanturl.com"){let{pathname:U,search:K,hash:H}=G;return U+K+decodeURIComponent(H)+Q}let J=G.toString()+Q;if(J.includes("#")){let[U,K]=J.split("#",2);return U+"#"+decodeURIComponent(K||"")}return J}function z0(){if(typeof window<"u"&&window.location&&window.location.href){let Z=window.location.href;if(!Z||!Z.startsWith("http"))try{return new URL(Z),Z}catch{return"/"}return Z}if(typeof process<"u"&&process.cwd){let Z=process.cwd(),X=Z.slice(-1);if(X==="/"||X==="\\")return Z;else return Z+"/"}return"/"}function O9(Z){let X=a6.exec(Z||"");if(X)return X[1].toLowerCase();return}function T9(Z){let X=Z.lastIndexOf(".");if(X>=0)return WZ(Z.substring(X).toLowerCase());return""}function WZ(Z){let X=Z.indexOf("?");if(X>=0)Z=Z.substring(0,X);return Z}function R2(Z){if(!Z)return"#";let X=Z.indexOf("#");if(X>=0)return Z.substring(X);return"#"}function Z2(Z){if(!Z)return"";let X=Z.indexOf("#");if(X>=0)Z=Z.substring(0,X);return Z}function _9(Z){let X=O9(Z);if(X==="http"||X==="https")return!0;else if(X===void 0)return typeof window<"u";else return!1}function U1(Z){if(!Z||typeof Z!=="string")return!0;let X=Z.trim().toLowerCase();if(!X)return!0;if(X.startsWith("javascript:")||X.startsWith("vbscript:")||X.startsWith("data:"))return!0;if(X.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;try{let W=new URL(X.startsWith("//")?"http:"+X:X);if(N9(W.hostname))return!0;let G=W.port;if(G&&KZ(parseInt(G)))return!0}catch{if(X.startsWith("/")&&!X.startsWith("//"))return!1;if(YZ(X))return!0}return!1}function N9(Z){let X=GZ(Z);if(!X)return!0;if(X==="localhost"||zZ.some((Q)=>X.endsWith(Q)))return!0;let W=j9(X);if(W)return C9(W);let G=QZ(X);if(G)return JZ(G);return!1}function GZ(Z){let X=Z.trim().toLowerCase();if(X.startsWith("[")&&X.endsWith("]"))X=X.slice(1,-1);while(X.endsWith("."))X=X.slice(0,-1);return X}function j9(Z){let X=Z.split(".");if(X.length!==4)return;let W=X.map((G)=>{if(!/^\d+$/.test(G))return Number.NaN;return Number(G)});if(W.some((G)=>!Number.isInteger(G)||G<0||G>255))return;return W}function C9([Z,X,W,G]){return Z===0||Z===10||Z===127||Z===100&&X>=64&&X<=127||Z===169&&X===254||Z===172&&X>=16&&X<=31||Z===192&&X===0&&W===0||Z===192&&X===168||Z===198&&(X===18||X===19)||Z>=224||Z===255&&X===255&&W===255&&G===255}function QZ(Z){if(!Z.includes(":"))return;let X=Z,W=X.lastIndexOf(":"),G=X.slice(W+1);if(G.includes(".")){let H=j9(G);if(!H)return;let Y=H[0]*256+H[1],q=H[2]*256+H[3];X=`${X.slice(0,W+1)}${Y.toString(16)}:${q.toString(16)}`}let Q=X.split("::");if(Q.length>2)return;let J=w9(Q[0]),U=Q.length===2?w9(Q[1]):[];if(!J||!U)return;if(Q.length===1)return J.length===8?J:void 0;let K=8-J.length-U.length;if(K<1)return;return[...J,...Array(K).fill(0),...U]}function w9(Z){if(!Z)return[];let X=Z.split(":").map((W)=>{if(!/^[\da-f]{1,4}$/i.test(W))return Number.NaN;return Number.parseInt(W,16)});if(X.some((W)=>!Number.isInteger(W)||W<0||W>65535))return;return X}function JZ(Z){if(Z.length!==8)return!1;let X=Z.every((K)=>K===0),W=Z.slice(0,7).every((K)=>K===0)&&Z[7]===1,G=(Z[0]&65024)===64512,Q=(Z[0]&65472)===65152,J=(Z[0]&65280)===65280;if(X||W||G||Q||J)return!0;let U=UZ(Z);return U?C9(U):!1}function UZ(Z){let X=Z.slice(0,5).every((Q)=>Q===0),W=X&&Z[5]===0,G=X&&Z[5]===65535;if(!W&&!G)return;return[Math.floor(Z[6]/256),Z[6]%256,Math.floor(Z[7]/256),Z[7]%256]}function YZ(Z){return Z.split(/[\s/?#]+/).map((W)=>W.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((W)=>N9(W))}function KZ(Z){return[22,23,25,53,135,139,445,993,995,1433,1521,3306,3389,5432,5900,6379,8080,8443,9200,27017].includes(Z)}function Y1(Z){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let X=O9(Z);return X===void 0||X==="file"}function R9(Z){if(x0()){let X=z0(),W=Z.toUpperCase(),Q=f2(X).toUpperCase(),J=W.includes(Q),U=W.includes(Q),K=ZZ.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(J||U||K)&&!X.startsWith("http"))Z=((Y,q)=>{if(Y.endsWith("/")||Y.endsWith("\\"))return Y+q;else return Y+"/"+q})(X,Z);Z=f2(Z)}Z=encodeURI(Z);for(let X of XZ)Z=Z.replace(X[0],X[1]);return Z}function $0(Z,X){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let G=0;G<a1.length;G+=2)Z=Z.replace(a1[G],a1[G+1]);let W=Z.toLowerCase().startsWith("file://");if(W){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),x0()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(X)Z="file:///"+Z;else W=!1,Z=x0()?Z:"/"+Z}if(x0()&&!W){if(Z=Z.replace(s6,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function K1(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((X)=>{return X.replace(t6,"/").replace(e6,"~")})}var s6,a6,t6,e6,ZZ,XZ,a1,zZ,F0=(Z)=>new URL(Z);var q2=c(()=>{I9();s6=/\//g,a6=/^(\w{2,}):\/\//i,t6=/~1/g,e6=/~0/g,ZZ=/^[a-zA-Z]:[\\/]/,XZ=[[/\?/g,"%3F"],[/#/g,"%23"]],a1=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],zZ=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function P9(){let Z={},X=this;for(let W of BZ(X))if(typeof W==="string"){let G=X[W],Q=typeof G;if(!VZ.includes(Q))Z[W]=G}return Z}function BZ(Z,X=[]){let W=[];while(Z&&Z!==HZ)W=W.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let G=new Set(W);for(let Q of X.concat(qZ))G.delete(Q);return G}function x2(Z){return Z instanceof $2||Z instanceof D0}function e1(Z){if(Z.path===null)Z.path=[];return Z}var VZ,qZ,HZ,$2,D0,w2,V1,N2,q1,H1,t1,L0;var O2=c(()=>{q2();VZ=["function","symbol","undefined"],qZ=["constructor","prototype","__proto__"],HZ=Object.getPrototypeOf({});$2=class $2 extends Error{name;message;source;path;code;constructor(Z,X){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=Z,this.source=X,this.path=null}toJSON=P9.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};D0=class D0 extends Error{files;constructor(Z){super();this.files=Z,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${$0(Z.$refs._root$Ref.path)}'`}toJSON=P9.bind(this);static getParserErrors(Z){let X=[];for(let W of Object.values(Z.$refs._$refs))if(W.errors)X.push(...W.errors);return X}get errors(){return D0.getParserErrors(this.files)}};w2=class w2 extends $2{code="EPARSER";name="ParserError";constructor(Z,X){super(`Error parsing ${X}: ${Z}`,X)}};V1=class V1 extends $2{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};N2=class N2 extends $2{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(Z,X){super(Z.message||`Error reading file "${X}"`,X);if("code"in Z)this.ioErrorCode=String(Z.code)}};q1=class q1 extends $2{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};H1=class H1 extends $2{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,X,W,G,Q){super(`Missing $ref pointer "${R2(X)}". Token "${Z}" does not exist.`,Z2(X));this.targetToken=Z,this.targetRef=W,this.targetFound=G,this.parentPath=Q}};t1=class t1 extends $2{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};L0=class L0 extends $2{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,X){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,Z2(X))}}});function U2(Z,X){let W=MZ(X);return W?e(Z,W):Z}function B1(Z){if(!Z||typeof Z!=="object"||ArrayBuffer.isView(Z))return!1;let X=Z.$schema;if(typeof X==="string"&&(X.includes("draft/2019-09/")||X.includes("draft/2020-12/")||X.includes("oas/3.1/")))return!0;let W=Z.openapi;return typeof W==="string"&&/^3\.1(?:\.|$)/.test(W)}function M1(Z,X,W,G,Q=!1){if(!Q)return;let J=new Set,U=(K,H)=>{if(!K||typeof K!=="object"||ArrayBuffer.isView(K)||J.has(K))return;J.add(K);let Y=U2(H,K);if(Y!==H)Z._addAlias(Y,K,G,Q);for(let q of Object.keys(K))U(K[q],Y)};U(W,X)}function MZ(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var W0=c(()=>{q2()});class G0{$ref;path;originalPath;scopeBase;value;circular;chainCircular;indirections;constructor(Z,X,W){this.$ref=Z,this.path=X,this.originalPath=W||X,this.scopeBase=Z.path||Z2(X),this.value=void 0,this.circular=!1,this.chainCircular=!1,this.indirections=0}resolve(Z,X,W,G=new Set,Q=!0){let J=G0.parse(this.path,this.originalPath),U=[];if(this.value=E9(Z),this.$ref.dynamicIdScope&&!S9(this.$ref))this.scopeBase=U2(this.scopeBase,this.value);for(let H=0;H<J.length;H++){let Y=this.circular,q=this.chainCircular,B=a.isExtended$Ref(this.value);if(F1(this,X,W,G))this.path=G0.join(this.path,J.slice(H));else if(B)this.circular=Y,this.chainCircular=q;let M=J[H];if(this.value[M]===void 0||this.value[M]===null&&H===J.length-1){let F=!1;for(let E=J.length-1;E>H;E--){let y=J.slice(H,E+1).join("/");if(this.value[y]!==void 0){this.value=this.value[y],H=E,F=!0;break}}if(F){this.chainCircular=q;continue}if(M in this.value&&this.value[M]===null){this.value=$1,this.chainCircular=q;continue}this.value=null;let D=this.$ref.path||"",w=this.path.replace(D,""),A=G0.join("",U),C=W?.replace(D,"");throw new H1(M,decodeURI(this.originalPath),w,A,C)}else this.value=this.value[M];if(this.chainCircular=q,U.push(M),this.$ref.dynamicIdScope)this.scopeBase=U2(this.scopeBase,this.value)}let K=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(Q){let H=this.value?.$ref?e(K,this.value.$ref):void 0,Y=typeof W==="string"?e(this.$ref.$refs._root$Ref.path,W):W;if(a.isAllowed$Ref(this.value,X)&&H===Y&&H!==this.path)this.chainCircular=!0;else if(!this.value||H)F1(this,X,W,G)}return this}set(Z,X,W){let G=G0.parse(this.path),Q;if(G.length===0)return this.value=X,X;if(IZ(this.path,G),this.value=E9(Z),this.$ref.dynamicIdScope&&!S9(this.$ref))this.scopeBase=U2(this.scopeBase,this.value);for(let J=0;J<G.length-1;J++){if(F1(this,W),Q=G[J],this.value&&this.value[Q]!==void 0)this.value=this.value[Q];else this.value=x9(this,Q,{});if(this.$ref.dynamicIdScope)this.scopeBase=U2(this.scopeBase,this.value)}return F1(this,W),Q=G[G.length-1],x9(this,Q,X),Z}static parse(Z,X){let W=R2(Z).substring(1);if(!W)return[];let G=W.split("/");for(let Q=0;Q<G.length;Q++)G[Q]=G[Q].replace(DZ,"/").replace(LZ,"~");if(G[0]!=="")throw new L0(W,X===void 0?Z:X);return G.slice(1)}static join(Z,X){if(Z.indexOf("#")===-1)Z+="#";X=Array.isArray(X)?X:[X];for(let W=0;W<X.length;W++){let G=X[W];Z+="/"+G.replace($Z,"~0").replace(FZ,"~1")}return Z}}function F1(Z,X,W,G=new Set){let Q=!1,J=W,U=[];try{while(a.isAllowed$Ref(Z.value,X)){let K=a.isExtended$Ref(Z.value),H=Z.value,Y=Z.path,q=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,B=e(q,Z.value.$ref);if(B===Z.path&&!wZ(J))return Z.circular=!0,Z.chainCircular=!0,Q;let M=typeof J==="string"?e(Z.$ref.$refs._root$Ref.path,J):J;if(B===M&&B!==Z.path)return Z.chainCircular=!0,Q;if(G.has(B))return Z.chainCircular=!0,Q;let F=X?.dereference?.maxDepth??500;if(G.size>=F)throw RangeError(`Maximum dereference depth (${F}) exceeded at ${Z.path}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);G.add(B),U.push(B);let D=Z.$ref.$refs._resolve(B,Y,X,G,K);if(D===null)return Q;if(Z.indirections+=D.indirections+1,Z.chainCircular||=D.circular||D.chainCircular,K){if(Z.chainCircular)return Q;return Z.value=a.dereference(H,D.value,X),Q}else Z.$ref=D.$ref,Z.path=D.path,Z.value=D.value,Z.scopeBase=D.scopeBase,J=Y,Q=!0}return Q}finally{for(let K of U)G.delete(K)}}function x9(Z,X,W){if(Z.value&&typeof Z.value==="object")if(X==="-"&&Array.isArray(Z.value))Z.value.push(W);else Z.value[X]=W;else throw new $2(`Error assigning $ref pointer "${Z.path}".
|
|
17
|
-
Cannot set "${X}" of a non-object.`);return W}function
|
|
18
|
-
Unsafe JSON Pointer token "${W}" cannot be used for assignment.`)}function
|
|
19
|
-
"${Z2(W)}" not found.`);G.set(W,X)}_get$Ref(Z){return Z=e(this._root$Ref.path,Z),this._getRef(Z)}_add(Z){let X=Z2(Z),W=new a(this);return W.path=X,this._$refs[X]=W,this._root$Ref=this._root$Ref||W,W}_addAlias(Z,X,W,G=!1){let Q=Z2(Z);if(!Q||this._$refs[Q]||this._aliases[Q])return this._$refs[Q]||this._aliases[Q];let
|
|
20
|
-
"${Z2(
|
|
21
|
-
Parsed value is empty`);else return
|
|
18
|
+
`:""}var e1,U1="https://esm.sh/@vue/reactivity@3.5.40",Y1="https://esm.sh/lit-html@3.3.0",Q0,z8;var G0=c(()=>{E0();P0();z1();r2();E0();P0();z1();r2();e1=Symbol("jx.runtimeOnlyStateKeys");Q0=new Set(["pre","textarea","listing","plaintext","xmp"]);z8=new Set(["input","br","hr","img","meta","link","area","col","source"])});function p2(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var WZ,b0=()=>WZ;var j9=c(()=>{WZ=/^win/.test(globalThis.process?globalThis.process.platform:"")});function e(Z,X){let W=new URL(p2(Z),"https://aaa.nonexistanturl.com"),G=new URL(p2(X),W),Q=X.match(/(\s*)$/)?.[1]||"";if(G.hostname==="aaa.nonexistanturl.com"){let{pathname:J,search:Y,hash:H}=G;return J+Y+decodeURIComponent(H)+Q}let U=G.toString()+Q;if(U.includes("#")){let[J,Y]=U.split("#",2);return J+"#"+decodeURIComponent(Y||"")}return U}function J0(){if(typeof window<"u"&&window.location&&window.location.href){let Z=window.location.href;if(!Z||!Z.startsWith("http"))try{return new URL(Z),Z}catch{return"/"}return Z}if(typeof process<"u"&&process.cwd){let Z=process.cwd(),X=Z.slice(-1);if(X==="/"||X==="\\")return Z;else return Z+"/"}return"/"}function R9(Z){let X=GZ.exec(Z||"");if(X)return X[1].toLowerCase();return}function P9(Z){let X=Z.lastIndexOf(".");if(X>=0)return qZ(Z.substring(X).toLowerCase());return""}function qZ(Z){let X=Z.indexOf("?");if(X>=0)Z=Z.substring(0,X);return Z}function P2(Z){if(!Z)return"#";let X=Z.indexOf("#");if(X>=0)return Z.substring(X);return"#"}function Z2(Z){if(!Z)return"";let X=Z.indexOf("#");if(X>=0)Z=Z.substring(0,X);return Z}function E9(Z){let X=R9(Z);if(X==="http"||X==="https")return!0;else if(X===void 0)return typeof window<"u";else return!1}function B1(Z){if(!Z||typeof Z!=="string")return!0;let X=Z.trim().toLowerCase();if(!X)return!0;if(X.startsWith("javascript:")||X.startsWith("vbscript:")||X.startsWith("data:"))return!0;if(X.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;try{let W=new URL(X.startsWith("//")?"http:"+X:X);if(x9(W.hostname))return!0;let G=W.port;if(G&&DZ(parseInt(G)))return!0}catch{if(X.startsWith("/")&&!X.startsWith("//"))return!1;if($Z(X))return!0}return!1}function x9(Z){let X=HZ(Z);if(!X)return!0;if(X==="localhost"||VZ.some((Q)=>X.endsWith(Q)))return!0;let W=S9(X);if(W)return k9(W);let G=BZ(X);if(G)return FZ(G);return!1}function HZ(Z){let X=Z.trim().toLowerCase();if(X.startsWith("[")&&X.endsWith("]"))X=X.slice(1,-1);while(X.endsWith("."))X=X.slice(0,-1);return X}function S9(Z){let X=Z.split(".");if(X.length!==4)return;let W=X.map((G)=>{if(!/^\d+$/.test(G))return Number.NaN;return Number(G)});if(W.some((G)=>!Number.isInteger(G)||G<0||G>255))return;return W}function k9([Z,X,W,G]){return Z===0||Z===10||Z===127||Z===100&&X>=64&&X<=127||Z===169&&X===254||Z===172&&X>=16&&X<=31||Z===192&&X===0&&W===0||Z===192&&X===168||Z===198&&(X===18||X===19)||Z>=224||Z===255&&X===255&&W===255&&G===255}function BZ(Z){if(!Z.includes(":"))return;let X=Z,W=X.lastIndexOf(":"),G=X.slice(W+1);if(G.includes(".")){let H=S9(G);if(!H)return;let K=H[0]*256+H[1],V=H[2]*256+H[3];X=`${X.slice(0,W+1)}${K.toString(16)}:${V.toString(16)}`}let Q=X.split("::");if(Q.length>2)return;let U=C9(Q[0]),J=Q.length===2?C9(Q[1]):[];if(!U||!J)return;if(Q.length===1)return U.length===8?U:void 0;let Y=8-U.length-J.length;if(Y<1)return;return[...U,...Array(Y).fill(0),...J]}function C9(Z){if(!Z)return[];let X=Z.split(":").map((W)=>{if(!/^[\da-f]{1,4}$/i.test(W))return Number.NaN;return Number.parseInt(W,16)});if(X.some((W)=>!Number.isInteger(W)||W<0||W>65535))return;return X}function FZ(Z){if(Z.length!==8)return!1;let X=Z.every((Y)=>Y===0),W=Z.slice(0,7).every((Y)=>Y===0)&&Z[7]===1,G=(Z[0]&65024)===64512,Q=(Z[0]&65472)===65152,U=(Z[0]&65280)===65280;if(X||W||G||Q||U)return!0;let J=MZ(Z);return J?k9(J):!1}function MZ(Z){let X=Z.slice(0,5).every((Q)=>Q===0),W=X&&Z[5]===0,G=X&&Z[5]===65535;if(!W&&!G)return;return[Math.floor(Z[6]/256),Z[6]%256,Math.floor(Z[7]/256),Z[7]%256]}function $Z(Z){return Z.split(/[\s/?#]+/).map((W)=>W.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((W)=>x9(W))}function DZ(Z){return[22,23,25,53,135,139,445,993,995,1433,1521,3306,3389,5432,5900,6379,8080,8443,9200,27017].includes(Z)}function F1(Z){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let X=R9(Z);return X===void 0||X==="file"}function b9(Z){if(b0()){let X=J0(),W=Z.toUpperCase(),Q=p2(X).toUpperCase(),U=W.includes(Q),J=W.includes(Q),Y=YZ.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(U||J||Y)&&!X.startsWith("http"))Z=((K,V)=>{if(K.endsWith("/")||K.endsWith("\\"))return K+V;else return K+"/"+V})(X,Z);Z=p2(Z)}Z=encodeURI(Z);for(let X of KZ)Z=Z.replace(X[0],X[1]);return Z}function w0(Z,X){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let G=0;G<W8.length;G+=2)Z=Z.replace(W8[G],W8[G+1]);let W=Z.toLowerCase().startsWith("file://");if(W){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),b0()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(X)Z="file:///"+Z;else W=!1,Z=b0()?Z:"/"+Z}if(b0()&&!W){if(Z=Z.replace(QZ,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function M1(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((X)=>{return X.replace(JZ,"/").replace(UZ,"~")})}var QZ,GZ,JZ,UZ,YZ,KZ,W8,VZ,A0=(Z)=>new URL(Z);var H2=c(()=>{j9();QZ=/\//g,GZ=/^(\w{2,}):\/\//i,JZ=/~1/g,UZ=/~0/g,YZ=/^[a-zA-Z]:[\\/]/,KZ=[[/\?/g,"%3F"],[/#/g,"%23"]],W8=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],VZ=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function g9(){let Z={},X=this;for(let W of IZ(X))if(typeof W==="string"){let G=X[W],Q=typeof G;if(!LZ.includes(Q))Z[W]=G}return Z}function IZ(Z,X=[]){let W=[];while(Z&&Z!==wZ)W=W.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let G=new Set(W);for(let Q of X.concat(AZ))G.delete(Q);return G}function x2(Z){return Z instanceof D2||Z instanceof I0}function G8(Z){if(Z.path===null)Z.path=[];return Z}var LZ,AZ,wZ,D2,I0,_2,$1,T2,D1,L1,Q8,O0;var N2=c(()=>{H2();LZ=["function","symbol","undefined"],AZ=["constructor","prototype","__proto__"],wZ=Object.getPrototypeOf({});D2=class D2 extends Error{name;message;source;path;code;constructor(Z,X){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=Z,this.source=X,this.path=null}toJSON=g9.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};I0=class I0 extends Error{files;constructor(Z){super();this.files=Z,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${w0(Z.$refs._root$Ref.path)}'`}toJSON=g9.bind(this);static getParserErrors(Z){let X=[];for(let W of Object.values(Z.$refs._$refs))if(W.errors)X.push(...W.errors);return X}get errors(){return I0.getParserErrors(this.files)}};_2=class _2 extends D2{code="EPARSER";name="ParserError";constructor(Z,X){super(`Error parsing ${X}: ${Z}`,X)}};$1=class $1 extends D2{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};T2=class T2 extends D2{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(Z,X){super(Z.message||`Error reading file "${X}"`,X);if("code"in Z)this.ioErrorCode=String(Z.code)}};D1=class D1 extends D2{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};L1=class L1 extends D2{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,X,W,G,Q){super(`Missing $ref pointer "${P2(X)}". Token "${Z}" does not exist.`,Z2(X));this.targetToken=Z,this.targetRef=W,this.targetFound=G,this.parentPath=Q}};Q8=class Q8 extends D2{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};O0=class O0 extends D2{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,X){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,Z2(X))}}});function U2(Z,X){let W=OZ(X);return W?e(Z,W):Z}function A1(Z){if(!Z||typeof Z!=="object"||ArrayBuffer.isView(Z))return!1;let X=Z.$schema;if(typeof X==="string"&&(X.includes("draft/2019-09/")||X.includes("draft/2020-12/")||X.includes("oas/3.1/")))return!0;let W=Z.openapi;return typeof W==="string"&&/^3\.1(?:\.|$)/.test(W)}function w1(Z,X,W,G,Q=!1){if(!Q)return;let U=new Set,J=(Y,H)=>{if(!Y||typeof Y!=="object"||ArrayBuffer.isView(Y)||U.has(Y))return;U.add(Y);let K=U2(H,Y);if(K!==H)Z._addAlias(K,Y,G,Q);for(let V of Object.keys(Y))J(Y[V],K)};J(W,X)}function OZ(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var U0=c(()=>{H2()});class Y0{$ref;path;originalPath;scopeBase;value;circular;chainCircular;indirections;constructor(Z,X,W){this.$ref=Z,this.path=X,this.originalPath=W||X,this.scopeBase=Z.path||Z2(X),this.value=void 0,this.circular=!1,this.chainCircular=!1,this.indirections=0}resolve(Z,X,W,G=new Set,Q=!0){let U=Y0.parse(this.path,this.originalPath),J=[];if(this.value=y9(Z),this.$ref.dynamicIdScope&&!m9(this.$ref))this.scopeBase=U2(this.scopeBase,this.value);for(let H=0;H<U.length;H++){let K=this.circular,V=this.chainCircular,B=a.isExtended$Ref(this.value);if(I1(this,X,W,G))this.path=Y0.join(this.path,U.slice(H));else if(B)this.circular=K,this.chainCircular=V;let F=U[H];if(this.value[F]===void 0||this.value[F]===null&&H===U.length-1){let M=!1;for(let C=U.length-1;C>H;C--){let v=U.slice(H,C+1).join("/");if(this.value[v]!==void 0){this.value=this.value[v],H=C,M=!0;break}}if(M){this.chainCircular=V;continue}if(F in this.value&&this.value[F]===null){this.value=O1,this.chainCircular=V;continue}this.value=null;let I=this.$ref.path||"",w=this.path.replace(I,""),$=Y0.join("",J),A=W?.replace(I,"");throw new L1(F,decodeURI(this.originalPath),w,$,A)}else this.value=this.value[F];if(this.chainCircular=V,J.push(F),this.$ref.dynamicIdScope)this.scopeBase=U2(this.scopeBase,this.value)}let Y=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(Q){let H=this.value?.$ref?e(Y,this.value.$ref):void 0,K=typeof W==="string"?e(this.$ref.$refs._root$Ref.path,W):W;if(a.isAllowed$Ref(this.value,X)&&H===K&&H!==this.path)this.chainCircular=!0;else if(!this.value||H)I1(this,X,W,G)}return this}set(Z,X,W){let G=Y0.parse(this.path),Q;if(G.length===0)return this.value=X,X;if(RZ(this.path,G),this.value=y9(Z),this.$ref.dynamicIdScope&&!m9(this.$ref))this.scopeBase=U2(this.scopeBase,this.value);for(let U=0;U<G.length-1;U++){if(I1(this,W),Q=G[U],this.value&&this.value[Q]!==void 0)this.value=this.value[Q];else this.value=v9(this,Q,{});if(this.$ref.dynamicIdScope)this.scopeBase=U2(this.scopeBase,this.value)}return I1(this,W),Q=G[G.length-1],v9(this,Q,X),Z}static parse(Z,X){let W=P2(Z).substring(1);if(!W)return[];let G=W.split("/");for(let Q=0;Q<G.length;Q++)G[Q]=G[Q].replace(TZ,"/").replace(jZ,"~");if(G[0]!=="")throw new O0(W,X===void 0?Z:X);return G.slice(1)}static join(Z,X){if(Z.indexOf("#")===-1)Z+="#";X=Array.isArray(X)?X:[X];for(let W=0;W<X.length;W++){let G=X[W];Z+="/"+G.replace(NZ,"~0").replace(_Z,"~1")}return Z}}function I1(Z,X,W,G=new Set){let Q=!1,U=W,J=[];try{while(a.isAllowed$Ref(Z.value,X)){let Y=a.isExtended$Ref(Z.value),H=Z.value,K=Z.path,V=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,B=e(V,Z.value.$ref);if(B===Z.path&&!PZ(U))return Z.circular=!0,Z.chainCircular=!0,Q;let F=typeof U==="string"?e(Z.$ref.$refs._root$Ref.path,U):U;if(B===F&&B!==Z.path)return Z.chainCircular=!0,Q;if(G.has(B))return Z.chainCircular=!0,Q;let M=X?.dereference?.maxDepth??500;if(G.size>=M)throw RangeError(`Maximum dereference depth (${M}) exceeded at ${Z.path}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);G.add(B),J.push(B);let I=Z.$ref.$refs._resolve(B,K,X,G,Y);if(I===null)return Q;if(Z.indirections+=I.indirections+1,Z.chainCircular||=I.circular||I.chainCircular,Y){if(Z.chainCircular)return Q;return Z.value=a.dereference(H,I.value,X),Q}else Z.$ref=I.$ref,Z.path=I.path,Z.value=I.value,Z.scopeBase=I.scopeBase,U=K,Q=!0}return Q}finally{for(let Y of J)G.delete(Y)}}function v9(Z,X,W){if(Z.value&&typeof Z.value==="object")if(X==="-"&&Array.isArray(Z.value))Z.value.push(W);else Z.value[X]=W;else throw new D2(`Error assigning $ref pointer "${Z.path}".
|
|
19
|
+
Cannot set "${X}" of a non-object.`);return W}function RZ(Z,X){for(let W of X)if(CZ.has(W))throw new D2(`Error assigning $ref pointer "${Z}".
|
|
20
|
+
Unsafe JSON Pointer token "${W}" cannot be used for assignment.`)}function y9(Z){if(x2(Z))throw Z;return Z}function PZ(Z){return typeof Z=="string"&&Y0.parse(Z).length==0}function m9(Z){return Boolean(Z.path&&Z.path in Z.$refs._aliases)}var O1,_Z,NZ,TZ,jZ,CZ,B2;var g0=c(()=>{_0();H2();N2();U0();O1=Symbol("null"),_Z=/\//g,NZ=/~/g,TZ=/~1/g,jZ=/~0/g,CZ=new Set(["__proto__","constructor","prototype"]);B2=Y0});class v0{path;value;$refs;pathType;dynamicIdScope=!1;errors=[];constructor(Z){this.$refs=Z}addError(Z){if(this.errors===void 0)this.errors=[];let X=this.errors.map(({footprint:W})=>W);if("errors"in Z&&Array.isArray(Z.errors))this.errors.push(...Z.errors.map(G8).filter(({footprint:W})=>!X.includes(W)));else if(!("footprint"in Z)||!X.includes(Z.footprint))this.errors.push(G8(Z))}exists(Z,X){try{return this.resolve(Z,X),!0}catch{return!1}}get(Z,X){return this.resolve(Z,X)?.value}resolve(Z,X,W,G,Q,U=!0){let J=new B2(this,Z,W);try{let Y=J.resolve(this.value,X,G,Q,U);if(Y.value===O1)Y.value=null;return Y}catch(Y){if(!X||!X.continueOnError||!x2(Y))throw Y;if(Y.path===null)Y.path=M1(P2(G));if(Y instanceof O0)Y.source=decodeURI(Z2(G));return this.addError(Y),null}}set(Z,X){let W=new B2(this,Z);if(this.value=W.set(this.value,X),this.value===O1)this.value=null}static is$Ref(Z){return Boolean(Z)&&typeof Z==="object"&&Z!==null&&"$ref"in Z&&typeof Z.$ref==="string"&&Z.$ref.length>0}static isExternal$Ref(Z){return v0.is$Ref(Z)&&Z.$ref[0]!=="#"}static isAllowed$Ref(Z,X){if(this.is$Ref(Z)){if(Z.$ref.substring(0,2)==="#/"||Z.$ref==="#")return!0;else if(Z.$ref[0]!=="#"&&(!X||X.resolve?.external))return!0}return}static isExtended$Ref(Z){return v0.is$Ref(Z)&&Object.keys(Z).length>1}static dereference(Z,X,W){if(X&&typeof X==="object"&&v0.isExtended$Ref(Z)){let G={};for(let U of Object.keys(Z))if(U!=="$ref")G[U]=Z[U];let Q=W?.dereference?.mergeKeys??!0;for(let U of Object.keys(X)){let J=U;if(!(J in G))G[J]=X[J];else if(Q&&typeof G[J]==="object"&&G[J]!==null&&typeof X[J]==="object"&&X[J]!==null)G[J]=h9(X[J],G[J])}return G}else return X}}function h9(Z,X){if(typeof Z!=="object"||Z===null)return X;if(typeof X!=="object"||X===null)return X;let W=Array.isArray(Z)?[...Z]:{...Z};for(let G of Object.keys(X))if(Array.isArray(X[G]))W[G]=[...X[G]];else if(typeof X[G]==="object"&&X[G]!==null)W[G]=h9(Z[G],X[G]);else W[G]=X[G];return W}var a;var _0=c(()=>{g0();N2();H2();a=v0});class y0{circular;paths(...Z){return u9(this._$refs,Z.flat()).map((W)=>{return p2(W.decoded)})}values(...Z){let X=this._$refs;return u9(X,Z.flat()).reduce((G,Q)=>{return G[p2(Q.decoded)]=X[Q.encoded].value,G},{})}exists(Z,X){try{return this._resolve(Z,"",X),!0}catch{return!1}}get(Z,X){return this._resolve(Z,"",X).value}set(Z,X){let W=e(this._root$Ref.path,Z),G=this._getRef(W);if(!G)throw Error(`Error resolving $ref pointer "${Z}".
|
|
21
|
+
"${Z2(W)}" not found.`);G.set(W,X)}_get$Ref(Z){return Z=e(this._root$Ref.path,Z),this._getRef(Z)}_add(Z){let X=Z2(Z),W=new a(this);return W.path=X,this._$refs[X]=W,this._root$Ref=this._root$Ref||W,W}_addAlias(Z,X,W,G=!1){let Q=Z2(Z);if(!Q||this._$refs[Q]||this._aliases[Q])return this._$refs[Q]||this._aliases[Q];let U=new a(this);return U.path=Q,U.pathType=W,U.value=X,U.dynamicIdScope=G,this._aliases[Q]=U,U}_resolve(Z,X,W,G,Q=!0){let U=e(this._root$Ref.path,Z),J=this._getRef(U);if(!J)throw Error(`Error resolving $ref pointer "${Z}".
|
|
22
|
+
"${Z2(U)}" not found.`);return J.resolve(U,W,Z,X,G,Q)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=this.values;_getRef(Z){let X=Z2(Z);return this._$refs[X]||this._aliases[X]}}function u9(Z,X){let W=Object.keys(Z);if(X=Array.isArray(X[0])?X[0]:Array.prototype.slice.call(X),X.length>0&&X[0])W=W.filter((G)=>{return X.includes(Z[G].pathType)});return W.map((G)=>{return{encoded:G,decoded:Z[G].pathType==="file"?w0(G,!0):G}})}var f9=c(()=>{_0();H2()});function J8(Z){return Object.keys(Z||{}).filter((X)=>{return typeof Z[X]==="object"}).map((X)=>{return Z[X].name=X,Z[X]})}function U8(Z,X,W,G,Q){return Z.filter((U)=>{return!!c9(U,X,W,G,Q)})}function Y8(Z){for(let X of Z)X.order=X.order||Number.MAX_SAFE_INTEGER;return Z.sort((X,W)=>{return X.order-W.order})}async function K8(Z,X,W,G){let Q,U,J=0;return new Promise((Y,H)=>{K();function K(){if(Q=Z[J++],!Q)return H(U);try{let M=c9(Q,X,W,V,G);if(M&&typeof M.then==="function")M.then(B,F);else if(M!==void 0)B(M);else if(J===Z.length)throw Error("No promise has been returned or callback has been called.")}catch(M){F(M)}}function V(M,I){if(M)F(M);else B(I)}function B(M){Y({plugin:Q,result:M})}function F(M){U={plugin:Q,error:M},K()}})}function c9(Z,X,W,G,Q){let U=Z[X];if(typeof U==="function")return U.apply(Z,[W,G,Q]);if(!G){if(U instanceof RegExp)return U.test(W.url);else if(typeof U==="string")return U===W.extension;else if(Array.isArray(U))return U.indexOf(W.extension)!==-1}return U}async function EZ(Z,X,W){let G=typeof Z==="string"?Z:Z.url,Q=typeof Z==="string"?void 0:Z.baseUrl,U=typeof Z==="string"?void 0:Z.reference,J=G.indexOf("#"),Y="";if(J>=0)Y=G.substring(J),G=G.substring(0,J);if(U){let V=U.indexOf("#");if(V>=0)U=U.substring(0,V)}let H=X._add(G),K={url:G,hash:Y,extension:P9(G),...U!==void 0?{reference:U}:{},...Q!==void 0?{baseUrl:Q}:{}};try{let V=await xZ(K,W,X);H.pathType=V.plugin.name,K.data=V.result;let B=await SZ(K,W,X);return H.value=B.result,H.dynamicIdScope=A1(H.value),w1(X,H.path,H.value,H.pathType,H.dynamicIdScope),B.result}catch(V){if(x2(V))H.value=V;throw V}}async function xZ(Z,X,W){let G=J8(X.resolve);G=U8(G,"canRead",Z,void 0,W),Y8(G);try{return await K8(G,"read",Z,W)}catch(Q){if(!Q&&X.continueOnError)throw new D1(Z.url);else if(!Q||!("error"in Q))throw SyntaxError(`Unable to resolve $ref pointer "${Z.url}"`,{cause:Q});else if(Q.error instanceof T2)throw Q.error;else throw new T2(Q,Z.url)}}async function SZ(Z,X,W){let G=J8(X.parse),Q=U8(G,"canParse",Z),U=Q.length>0?Q:G;Y8(U);try{let J=await K8(U,"parse",Z,W);if(!J.plugin.allowEmpty&&kZ(J.result))throw SyntaxError(`Error parsing "${Z.url}" as ${J.plugin.name}.
|
|
23
|
+
Parsed value is empty`);else return J}catch(J){if(!J&&X.continueOnError)throw new $1(Z.url);else if(J&&J.message&&J.message.startsWith("Error parsing"))throw J;else if(!J||!("error"in J))throw SyntaxError(`Unable to parse ${Z.url}`,{cause:J});else if(J.error instanceof _2)throw J.error;else throw new _2(J.error.message,Z.url)}}function kZ(Z){return Z===void 0||typeof Z==="object"&&Object.keys(Z).length===0||typeof Z==="string"&&Z.trim().length===0||Buffer.isBuffer(Z)&&Z.length===0}var _1;var V8=c(()=>{H2();U0();N2();_1=EZ});var d9;var p9=c(()=>{N2();d9={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(Z){let X=Z.data;if(Buffer.isBuffer(X))X=X.toString();if(typeof X==="string")if(X.trim().length===0)return;else try{return JSON.parse(X)}catch(W){if(this.allowBOM)try{let G=X.indexOf("{");return X=X.slice(G),JSON.parse(X)}catch(G){throw new _2(G.message,Z.url)}throw new _2(W.message,Z.url)}else return X}}});function bZ(Z){return Z&&Z.__esModule&&Object.prototype.hasOwnProperty.call(Z,"default")?Z.default:Z}function m0(){if(l9)return t2;l9=1;function Z(J){return typeof J>"u"||J===null}function X(J){return typeof J==="object"&&J!==null}function W(J){if(Array.isArray(J))return J;else if(Z(J))return[];return[J]}function G(J,Y){if(Y){let H=Object.keys(Y);for(let K=0,V=H.length;K<V;K+=1){let B=H[K];J[B]=Y[B]}}return J}function Q(J,Y){let H="";for(let K=0;K<Y;K+=1)H+=J;return H}function U(J){return J===0&&Number.NEGATIVE_INFINITY===1/J}return t2.isNothing=Z,t2.isObject=X,t2.toArray=W,t2.repeat=Q,t2.isNegativeZero=U,t2.extend=G,t2}function h0(){if(i9)return q8;i9=1;function Z(W,G){let Q="",U=W.reason||"(unknown reason)";if(!W.mark)return U;if(W.mark.name)Q+='in "'+W.mark.name+'" ';if(Q+="("+(W.mark.line+1)+":"+(W.mark.column+1)+")",!G&&W.mark.snippet)Q+=`
|
|
22
24
|
|
|
23
|
-
`+W.mark.snippet;return
|
|
24
|
-
`+B}let
|
|
25
|
-
`,B+=Z.repeat("-",
|
|
26
|
-
`;for(let w=1;w<=
|
|
27
|
-
`}return B.replace(/\n$/,"")}return
|
|
28
|
-
\r`;function W(
|
|
29
|
-
`;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 W2(z){if(z<=65535)return String.fromCharCode(z);return String.fromCharCode((z-65536>>10)+55296,(z-65536&1023)+56320)}function
|
|
30
|
-
|
|
31
|
-
`,
|
|
32
|
-
`}break}if(
|
|
33
|
-
`,
|
|
34
|
-
`,L+1);else if(L===0){if(
|
|
25
|
+
`+W.mark.snippet;return U+" "+Q}function X(W,G){if(Error.call(this),this.name="YAMLException",this.reason=W,this.mark=G,this.message=Z(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}return X.prototype=Object.create(Error.prototype),X.prototype.constructor=X,X.prototype.toString=function(G){return this.name+": "+Z(this,G)},q8=X,q8}function gZ(){if(n9)return H8;n9=1;let Z=m0();function X(Q,U,J,Y,H){let K="",V="",B=Math.floor(H/2)-1;if(Y-U>B)K=" ... ",U=Y-B+K.length;if(J-Y>B)V=" ...",J=Y+B-V.length;return{str:K+Q.slice(U,J).replace(/\t/g,"→")+V,pos:Y-U+K.length}}function W(Q,U){return Z.repeat(" ",U-Q.length)+Q}function G(Q,U){if(U=Object.create(U||null),!Q.buffer)return null;if(!U.maxLength)U.maxLength=79;if(typeof U.indent!=="number")U.indent=1;if(typeof U.linesBefore!=="number")U.linesBefore=3;if(typeof U.linesAfter!=="number")U.linesAfter=2;let J=/\r?\n|\r|\0/g,Y=[0],H=[],K,V=-1;while(K=J.exec(Q.buffer))if(H.push(K.index),Y.push(K.index+K[0].length),Q.position<=K.index&&V<0)V=Y.length-2;if(V<0)V=Y.length-1;let B="",F=Math.min(Q.line+U.linesAfter,H.length).toString().length,M=U.maxLength-(U.indent+F+3);for(let w=1;w<=U.linesBefore;w++){if(V-w<0)break;let $=X(Q.buffer,Y[V-w],H[V-w],Q.position-(Y[V]-Y[V-w]),M);B=Z.repeat(" ",U.indent)+W((Q.line-w+1).toString(),F)+" | "+$.str+`
|
|
26
|
+
`+B}let I=X(Q.buffer,Y[V],H[V],Q.position,M);B+=Z.repeat(" ",U.indent)+W((Q.line+1).toString(),F)+" | "+I.str+`
|
|
27
|
+
`,B+=Z.repeat("-",U.indent+F+3+I.pos)+`^
|
|
28
|
+
`;for(let w=1;w<=U.linesAfter;w++){if(V+w>=H.length)break;let $=X(Q.buffer,Y[V+w],H[V+w],Q.position-(Y[V]-Y[V+w]),M);B+=Z.repeat(" ",U.indent)+W((Q.line+w+1).toString(),F)+" | "+$.str+`
|
|
29
|
+
`}return B.replace(/\n$/,"")}return H8=G,H8}function Y2(){if(o9)return B8;o9=1;let Z=h0(),X=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],W=["scalar","sequence","mapping"];function G(U){let J={};if(U!==null)Object.keys(U).forEach(function(Y){U[Y].forEach(function(H){J[String(H)]=Y})});return J}function Q(U,J){if(J=J||{},Object.keys(J).forEach(function(Y){if(X.indexOf(Y)===-1)throw new Z('Unknown option "'+Y+'" is met in definition of "'+U+'" YAML type.')}),this.options=J,this.tag=U,this.kind=J.kind||null,this.resolve=J.resolve||function(){return!0},this.construct=J.construct||function(Y){return Y},this.instanceOf=J.instanceOf||null,this.predicate=J.predicate||null,this.represent=J.represent||null,this.representName=J.representName||null,this.defaultStyle=J.defaultStyle||null,this.multi=J.multi||!1,this.styleAliases=G(J.styleAliases||null),W.indexOf(this.kind)===-1)throw new Z('Unknown kind "'+this.kind+'" is specified for "'+U+'" YAML type.')}return B8=Q,B8}function $4(){if(r9)return F8;r9=1;let Z=h0(),X=Y2();function W(U,J){let Y=[];return U[J].forEach(function(H){let K=Y.length;Y.forEach(function(V,B){if(V.tag===H.tag&&V.kind===H.kind&&V.multi===H.multi)K=B}),Y[K]=H}),Y}function G(){let U={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function J(Y){if(Y.multi)U.multi[Y.kind].push(Y),U.multi.fallback.push(Y);else U[Y.kind][Y.tag]=U.fallback[Y.tag]=Y}for(let Y=0,H=arguments.length;Y<H;Y+=1)arguments[Y].forEach(J);return U}function Q(U){return this.extend(U)}return Q.prototype.extend=function(J){let Y=[],H=[];if(J instanceof X)H.push(J);else if(Array.isArray(J))H=H.concat(J);else if(J&&(Array.isArray(J.implicit)||Array.isArray(J.explicit))){if(J.implicit)Y=Y.concat(J.implicit);if(J.explicit)H=H.concat(J.explicit)}else throw new Z("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");Y.forEach(function(V){if(!(V instanceof X))throw new Z("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(V.loadKind&&V.loadKind!=="scalar")throw new Z("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(V.multi)throw new Z("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),H.forEach(function(V){if(!(V instanceof X))throw new Z("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let K=Object.create(Q.prototype);return K.implicit=(this.implicit||[]).concat(Y),K.explicit=(this.explicit||[]).concat(H),K.compiledImplicit=W(K,"implicit"),K.compiledExplicit=W(K,"explicit"),K.compiledTypeMap=G(K.compiledImplicit,K.compiledExplicit),K},F8=Q,F8}function D4(){if(s9)return M8;return s9=1,M8=new(Y2())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(X){return X!==null?X:""}}),M8}function L4(){if(a9)return $8;return a9=1,$8=new(Y2())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(X){return X!==null?X:[]}}),$8}function A4(){if(t9)return D8;return t9=1,D8=new(Y2())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(X){return X!==null?X:{}}}),D8}function w4(){if(e9)return L8;return e9=1,L8=new($4())({explicit:[D4(),L4(),A4()]}),L8}function I4(){if(Z4)return A8;Z4=1;let Z=Y2();function X(Q){if(Q===null)return!0;let U=Q.length;return U===1&&Q==="~"||U===4&&(Q==="null"||Q==="Null"||Q==="NULL")}function W(){return null}function G(Q){return Q===null}return A8=new Z("tag:yaml.org,2002:null",{kind:"scalar",resolve:X,construct:W,predicate:G,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),A8}function O4(){if(X4)return w8;X4=1;let Z=Y2();function X(Q){if(Q===null)return!1;let U=Q.length;return U===4&&(Q==="true"||Q==="True"||Q==="TRUE")||U===5&&(Q==="false"||Q==="False"||Q==="FALSE")}function W(Q){return Q==="true"||Q==="True"||Q==="TRUE"}function G(Q){return Object.prototype.toString.call(Q)==="[object Boolean]"}return w8=new Z("tag:yaml.org,2002:bool",{kind:"scalar",resolve:X,construct:W,predicate:G,represent:{lowercase:function(Q){return Q?"true":"false"},uppercase:function(Q){return Q?"TRUE":"FALSE"},camelcase:function(Q){return Q?"True":"False"}},defaultStyle:"lowercase"}),w8}function _4(){if(z4)return I8;z4=1;let Z=m0(),X=Y2();function W(K){return K>=48&&K<=57||K>=65&&K<=70||K>=97&&K<=102}function G(K){return K>=48&&K<=55}function Q(K){return K>=48&&K<=57}function U(K){if(K===null)return!1;let V=K.length,B=0,F=!1;if(!V)return!1;let M=K[B];if(M==="-"||M==="+")M=K[++B];if(M==="0"){if(B+1===V)return!0;if(M=K[++B],M==="b"){B++;for(;B<V;B++){if(M=K[B],M!=="0"&&M!=="1")return!1;F=!0}return F&&isFinite(J(K))}if(M==="x"){B++;for(;B<V;B++){if(!W(K.charCodeAt(B)))return!1;F=!0}return F&&isFinite(J(K))}if(M==="o"){B++;for(;B<V;B++){if(!G(K.charCodeAt(B)))return!1;F=!0}return F&&isFinite(J(K))}}for(;B<V;B++){if(!Q(K.charCodeAt(B)))return!1;F=!0}if(!F)return!1;return isFinite(J(K))}function J(K){let V=K,B=1,F=V[0];if(F==="-"||F==="+"){if(F==="-")B=-1;V=V.slice(1),F=V[0]}if(V==="0")return 0;if(F==="0"){if(V[1]==="b")return B*parseInt(V.slice(2),2);if(V[1]==="x")return B*parseInt(V.slice(2),16);if(V[1]==="o")return B*parseInt(V.slice(2),8)}return B*parseInt(V,10)}function Y(K){return J(K)}function H(K){return Object.prototype.toString.call(K)==="[object Number]"&&(K%1===0&&!Z.isNegativeZero(K))}return I8=new X("tag:yaml.org,2002:int",{kind:"scalar",resolve:U,construct:Y,predicate:H,represent:{binary:function(K){return K>=0?"0b"+K.toString(2):"-0b"+K.toString(2).slice(1)},octal:function(K){return K>=0?"0o"+K.toString(8):"-0o"+K.toString(8).slice(1)},decimal:function(K){return K.toString(10)},hexadecimal:function(K){return K>=0?"0x"+K.toString(16).toUpperCase():"-0x"+K.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),I8}function N4(){if(W4)return O8;W4=1;let Z=m0(),X=Y2(),W=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),G=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Q(K){if(K===null)return!1;if(!W.test(K))return!1;if(isFinite(parseFloat(K,10)))return!0;return G.test(K)}function U(K){let V=K.toLowerCase(),B=V[0]==="-"?-1:1;if("+-".indexOf(V[0])>=0)V=V.slice(1);if(V===".inf")return B===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(V===".nan")return NaN;return B*parseFloat(V,10)}let J=/^[-+]?[0-9]+e/;function Y(K,V){if(isNaN(K))switch(V){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===K)switch(V){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===K)switch(V){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Z.isNegativeZero(K))return"-0.0";let B=K.toString(10);return J.test(B)?B.replace("e",".e"):B}function H(K){return Object.prototype.toString.call(K)==="[object Number]"&&(K%1!==0||Z.isNegativeZero(K))}return O8=new X("tag:yaml.org,2002:float",{kind:"scalar",resolve:Q,construct:U,predicate:H,represent:Y,defaultStyle:"lowercase"}),O8}function T4(){if(Q4)return _8;return Q4=1,_8=w4().extend({implicit:[I4(),O4(),_4(),N4()]}),_8}function j4(){if(G4)return N8;return G4=1,N8=T4(),N8}function C4(){if(J4)return T8;J4=1;let Z=Y2(),X=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),W=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]))?))?$");function G(J){if(J===null)return!1;if(X.exec(J)!==null)return!0;if(W.exec(J)!==null)return!0;return!1}function Q(J){let Y=0,H=null,K=X.exec(J);if(K===null)K=W.exec(J);if(K===null)throw Error("Date resolve error");let V=+K[1],B=+K[2]-1,F=+K[3];if(!K[4])return new Date(Date.UTC(V,B,F));let M=+K[4],I=+K[5],w=+K[6];if(K[7]){Y=K[7].slice(0,3);while(Y.length<3)Y+="0";Y=+Y}if(K[9]){let A=+K[10],C=+(K[11]||0);if(H=(A*60+C)*60000,K[9]==="-")H=-H}let $=new Date(Date.UTC(V,B,F,M,I,w,Y));if(H)$.setTime($.getTime()-H);return $}function U(J){return J.toISOString()}return T8=new Z("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:G,construct:Q,instanceOf:Date,represent:U}),T8}function R4(){if(U4)return j8;U4=1;let Z=Y2();function X(W){return W==="<<"||W===null}return j8=new Z("tag:yaml.org,2002:merge",{kind:"scalar",resolve:X}),j8}function P4(){if(Y4)return C8;Y4=1;let Z=Y2(),X=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
30
|
+
\r`;function W(J){if(J===null)return!1;let Y=0,H=J.length,K=X;for(let V=0;V<H;V++){let B=K.indexOf(J.charAt(V));if(B>64)continue;if(B<0)return!1;Y+=6}return Y%8===0}function G(J){let Y=J.replace(/[\r\n=]/g,""),H=Y.length,K=X,V=0,B=[];for(let M=0;M<H;M++){if(M%4===0&&M)B.push(V>>16&255),B.push(V>>8&255),B.push(V&255);V=V<<6|K.indexOf(Y.charAt(M))}let F=H%4*6;if(F===0)B.push(V>>16&255),B.push(V>>8&255),B.push(V&255);else if(F===18)B.push(V>>10&255),B.push(V>>2&255);else if(F===12)B.push(V>>4&255);return new Uint8Array(B)}function Q(J){let Y="",H=0,K=J.length,V=X;for(let F=0;F<K;F++){if(F%3===0&&F)Y+=V[H>>18&63],Y+=V[H>>12&63],Y+=V[H>>6&63],Y+=V[H&63];H=(H<<8)+J[F]}let B=K%3;if(B===0)Y+=V[H>>18&63],Y+=V[H>>12&63],Y+=V[H>>6&63],Y+=V[H&63];else if(B===2)Y+=V[H>>10&63],Y+=V[H>>4&63],Y+=V[H<<2&63],Y+=V[64];else if(B===1)Y+=V[H>>2&63],Y+=V[H<<4&63],Y+=V[64],Y+=V[64];return Y}function U(J){return Object.prototype.toString.call(J)==="[object Uint8Array]"}return C8=new Z("tag:yaml.org,2002:binary",{kind:"scalar",resolve:W,construct:G,predicate:U,represent:Q}),C8}function E4(){if(K4)return R8;K4=1;let Z=Y2(),X=Object.prototype.hasOwnProperty,W=Object.prototype.toString;function G(U){if(U===null)return!0;let J=[],Y=U;for(let H=0,K=Y.length;H<K;H+=1){let V=Y[H],B=!1;if(W.call(V)!=="[object Object]")return!1;let F;for(F in V)if(X.call(V,F))if(!B)B=!0;else return!1;if(!B)return!1;if(J.indexOf(F)===-1)J.push(F);else return!1}return!0}function Q(U){return U!==null?U:[]}return R8=new Z("tag:yaml.org,2002:omap",{kind:"sequence",resolve:G,construct:Q}),R8}function x4(){if(V4)return P8;V4=1;let Z=Y2(),X=Object.prototype.toString;function W(Q){if(Q===null)return!0;let U=Q,J=Array(U.length);for(let Y=0,H=U.length;Y<H;Y+=1){let K=U[Y];if(X.call(K)!=="[object Object]")return!1;let V=Object.keys(K);if(V.length!==1)return!1;J[Y]=[V[0],K[V[0]]]}return!0}function G(Q){if(Q===null)return[];let U=Q,J=Array(U.length);for(let Y=0,H=U.length;Y<H;Y+=1){let K=U[Y],V=Object.keys(K);J[Y]=[V[0],K[V[0]]]}return J}return P8=new Z("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:W,construct:G}),P8}function S4(){if(q4)return E8;q4=1;let Z=Y2(),X=Object.prototype.hasOwnProperty;function W(Q){if(Q===null)return!0;let U=Q;for(let J in U)if(X.call(U,J)){if(U[J]!==null)return!1}return!0}function G(Q){return Q!==null?Q:{}}return E8=new Z("tag:yaml.org,2002:set",{kind:"mapping",resolve:W,construct:G}),E8}function k8(){if(H4)return x8;return H4=1,x8=j4().extend({implicit:[C4(),R4()],explicit:[P4(),E4(),x4(),S4()]}),x8}function vZ(){if(B4)return N1;B4=1;let Z=m0(),X=h0(),W=gZ(),G=k8(),Q=Object.prototype.hasOwnProperty,U=1,J=2,Y=3,H=4,K=1,V=2,B=3,F=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,M=/[\x85\u2028\u2029]/,I=/[,\[\]{}]/,w=/^(?:!|!!|![0-9A-Za-z-]+!)$/,$=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function A(z){return Object.prototype.toString.call(z)}function C(z){return z===10||z===13}function v(z){return z===9||z===32}function m(z){return z===9||z===32||z===10||z===13}function f(z){return z===44||z===91||z===93||z===123||z===125}function X2(z){if(z>=48&&z<=57)return z-48;let D=z|32;if(D>=97&&D<=102)return D-97+10;return-1}function u(z){if(z===120)return 2;if(z===117)return 4;if(z===85)return 8;return 0}function b(z){if(z>=48&&z<=57)return z-48;return-1}function o(z){switch(z){case 48:return"\x00";case 97:return"\x07";case 98:return"\b";case 116:return"\t";case 9:return"\t";case 110:return`
|
|
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 W2(z){if(z<=65535)return String.fromCharCode(z);return String.fromCharCode((z-65536>>10)+55296,(z-65536&1023)+56320)}function k2(z,D,_){if(D==="__proto__")Object.defineProperty(z,D,{configurable:!0,enumerable:!0,writable:!0,value:_});else z[D]=_}let c0=Array(256),N0=Array(256);for(let z=0;z<256;z++)c0[z]=o(z)?1:0,N0[z]=o(z);function Q2(z,D){this.input=z,this.filename=D.filename||null,this.schema=D.schema||G,this.onWarning=D.onWarning||null,this.legacy=D.legacy||!1,this.json=D.json||!1,this.listener=D.listener||null,this.maxDepth=typeof D.maxDepth==="number"?D.maxDepth:100,this.maxTotalMergeKeys=typeof D.maxTotalMergeKeys==="number"?D.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=z.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function d0(z,D){let _={name:z.filename,buffer:z.input.slice(0,-1),position:z.position,line:z.line,column:z.position-z.lineStart};return _.snippet=W(_),new X(D,_)}function g(z,D){throw d0(z,D)}function K0(z,D){if(z.onWarning)z.onWarning.call(null,d0(z,D))}function b2(z,D,_){let j=z.anchorMapTransactions;if(j.length!==0){let O=j[j.length-1];if(!Q.call(O,D))O[D]={existed:Q.call(z.anchorMap,D),value:z.anchorMap[D]}}z.anchorMap[D]=_}function b1(z){z.anchorMapTransactions.push(Object.create(null))}function X0(z){let D=z.anchorMapTransactions.pop(),_=z.anchorMapTransactions;if(_.length===0)return;let j=_[_.length-1],O=Object.keys(D);for(let x=0,q=O.length;x<q;x+=1){let L=O[x];if(!Q.call(j,L))j[L]=D[L]}}function g1(z){let D=z.anchorMapTransactions.pop(),_=Object.keys(D);for(let j=_.length-1;j>=0;j-=1){let O=D[_[j]];if(O.existed)z.anchorMap[_[j]]=O.value;else delete z.anchorMap[_[j]]}}function T0(z){return{position:z.position,line:z.line,lineStart:z.lineStart,lineIndent:z.lineIndent,firstTabInLine:z.firstTabInLine,tag:z.tag,anchor:z.anchor,kind:z.kind,result:z.result}}function V0(z,D){z.position=D.position,z.line=D.line,z.lineStart=D.lineStart,z.lineIndent=D.lineIndent,z.firstTabInLine=D.firstTabInLine,z.tag=D.tag,z.anchor=D.anchor,z.kind=D.kind,z.result=D.result}let p0={YAML:function(D,_,j){if(D.version!==null)g(D,"duplication of %YAML directive");if(j.length!==1)g(D,"YAML directive accepts exactly one argument");let O=/^([0-9]+)\.([0-9]+)$/.exec(j[0]);if(O===null)g(D,"ill-formed argument of the YAML directive");let x=parseInt(O[1],10),q=parseInt(O[2],10);if(x!==1)g(D,"unacceptable YAML version of the document");if(D.version=j[0],D.checkLineBreaks=q<2,q!==1&&q!==2)K0(D,"unsupported YAML version of the document")},TAG:function(D,_,j){let O;if(j.length!==2)g(D,"TAG directive accepts exactly two arguments");let x=j[0];if(O=j[1],!w.test(x))g(D,"ill-formed tag handle (first argument) of the TAG directive");if(Q.call(D.tagMap,x))g(D,'there is a previously declared suffix for "'+x+'" tag handle');if(!$.test(O))g(D,"ill-formed tag prefix (second argument) of the TAG directive");try{O=decodeURIComponent(O)}catch(q){g(D,"tag prefix is malformed: "+O)}D.tagMap[x]=O}};function F2(z,D,_,j){if(D<_){let O=z.input.slice(D,_);if(j)for(let x=0,q=O.length;x<q;x+=1){let L=O.charCodeAt(x);if(!(L===9||L>=32&&L<=1114111))g(z,"expected valid JSON character")}else if(F.test(O))g(z,"the stream contains non-printable characters");z.result+=O}}function i2(z,D,_,j){if(!Z.isObject(_))g(z,"cannot merge mappings; the provided source object is unacceptable");let O=Object.keys(_);for(let x=0,q=O.length;x<q;x+=1){let L=O[x];if(z.maxTotalMergeKeys!==-1&&++z.totalMergeKeys>z.maxTotalMergeKeys)g(z,"merge keys exceeded maxTotalMergeKeys ("+z.maxTotalMergeKeys+")");if(!Q.call(D,L))k2(D,L,_[L]),j[L]=!0}}function g2(z,D,_,j,O,x,q,L,P){if(Array.isArray(O)){O=Array.prototype.slice.call(O);for(let N=0,T=O.length;N<T;N+=1){if(Array.isArray(O[N]))g(z,"nested arrays are not supported inside keys");if(typeof O==="object"&&A(O[N])==="[object Object]")O[N]="[object Object]"}}if(typeof O==="object"&&A(O)==="[object Object]")O="[object Object]";if(O=String(O),D===null)D={};if(j==="tag:yaml.org,2002:merge")if(Array.isArray(x))for(let N=0,T=x.length;N<T;N+=1)i2(z,D,x[N],_);else i2(z,D,x,_);else{if(!z.json&&!Q.call(_,O)&&Q.call(D,O))z.line=q||z.line,z.lineStart=L||z.lineStart,z.position=P||z.position,g(z,"duplicated mapping key");k2(D,O,x),delete _[O]}return D}function q0(z){let D=z.input.charCodeAt(z.position);if(D===10)z.position++;else if(D===13){if(z.position++,z.input.charCodeAt(z.position)===10)z.position++}else g(z,"a line break is expected");z.line+=1,z.lineStart=z.position,z.firstTabInLine=-1}function t(z,D,_){let j=0,O=z.input.charCodeAt(z.position);while(O!==0){while(v(O)){if(O===9&&z.firstTabInLine===-1)z.firstTabInLine=z.position;O=z.input.charCodeAt(++z.position)}if(D&&O===35)do O=z.input.charCodeAt(++z.position);while(O!==10&&O!==13&&O!==0);if(C(O)){q0(z),O=z.input.charCodeAt(z.position),j++,z.lineIndent=0;while(O===32)z.lineIndent++,O=z.input.charCodeAt(++z.position)}else break}if(_!==-1&&j!==0&&z.lineIndent<_)K0(z,"deficient indentation");return j}function H0(z){let D=z.position,_=z.input.charCodeAt(D);if((_===45||_===46)&&_===z.input.charCodeAt(D+1)&&_===z.input.charCodeAt(D+2)){if(D+=3,_=z.input.charCodeAt(D),_===0||m(_))return!0}return!1}function v2(z,D){if(D===1)z.result+=" ";else if(D>1)z.result+=Z.repeat(`
|
|
32
|
+
`,D-1)}function l0(z,D,_){let j,O,x,q,L,P,N=z.kind,T=z.result,E=z.input.charCodeAt(z.position);if(m(E)||f(E)||E===35||E===38||E===42||E===33||E===124||E===62||E===39||E===34||E===37||E===64||E===96)return!1;if(E===63||E===45){let R=z.input.charCodeAt(z.position+1);if(m(R)||_&&f(R))return!1}z.kind="scalar",z.result="",j=O=z.position,x=!1;while(E!==0){if(E===58){let R=z.input.charCodeAt(z.position+1);if(m(R)||_&&f(R))break}else if(E===35){let R=z.input.charCodeAt(z.position-1);if(m(R))break}else if(z.position===z.lineStart&&H0(z)||_&&f(E))break;else if(C(E))if(q=z.line,L=z.lineStart,P=z.lineIndent,t(z,!1,-1),z.lineIndent>=D){x=!0,E=z.input.charCodeAt(z.position);continue}else{z.position=O,z.line=q,z.lineStart=L,z.lineIndent=P;break}if(x)F2(z,j,O,!1),v2(z,z.line-q),j=O=z.position,x=!1;if(!v(E))O=z.position+1;E=z.input.charCodeAt(++z.position)}if(F2(z,j,O,!1),z.result)return!0;return z.kind=N,z.result=T,!1}function i0(z,D){let _,j,O=z.input.charCodeAt(z.position);if(O!==39)return!1;z.kind="scalar",z.result="",z.position++,_=j=z.position;while((O=z.input.charCodeAt(z.position))!==0)if(O===39)if(F2(z,_,z.position,!0),O=z.input.charCodeAt(++z.position),O===39)_=z.position,z.position++,j=z.position;else return!0;else if(C(O))F2(z,_,j,!0),v2(z,t(z,!1,D)),_=j=z.position;else if(z.position===z.lineStart&&H0(z))g(z,"unexpected end of the document within a single quoted scalar");else if(z.position++,!v(O))j=z.position;g(z,"unexpected end of the stream within a single quoted scalar")}function j0(z,D){let _,j,O,x=z.input.charCodeAt(z.position);if(x!==34)return!1;z.kind="scalar",z.result="",z.position++,_=j=z.position;while((x=z.input.charCodeAt(z.position))!==0)if(x===34)return F2(z,_,z.position,!0),z.position++,!0;else if(x===92){if(F2(z,_,z.position,!0),x=z.input.charCodeAt(++z.position),C(x))t(z,!1,D);else if(x<256&&c0[x])z.result+=N0[x],z.position++;else if((O=u(x))>0){let q=O,L=0;for(;q>0;q--)if(x=z.input.charCodeAt(++z.position),(O=X2(x))>=0)L=(L<<4)+O;else g(z,"expected hexadecimal character");z.result+=W2(L),z.position++}else g(z,"unknown escape sequence");_=j=z.position}else if(C(x))F2(z,_,j,!0),v2(z,t(z,!1,D)),_=j=z.position;else if(z.position===z.lineStart&&H0(z))g(z,"unexpected end of the document within a double quoted scalar");else if(z.position++,!v(x))j=z.position;g(z,"unexpected end of the stream within a double quoted scalar")}function n0(z,D){let _=!0,j,O,x,q=z.tag,L,P=z.anchor,N,T,E,R,k=Object.create(null),S,y,h,d=z.input.charCodeAt(z.position);if(d===91)N=93,R=!1,L=[];else if(d===123)N=125,R=!0,L={};else return!1;if(z.anchor!==null)b2(z,z.anchor,L);d=z.input.charCodeAt(++z.position);while(d!==0){if(t(z,!0,D),d=z.input.charCodeAt(z.position),d===N)return z.position++,z.tag=q,z.anchor=P,z.kind=R?"mapping":"sequence",z.result=L,!0;else if(!_)g(z,"missed comma between flow collection entries");else if(d===44)g(z,"expected the node content, but found ','");if(y=S=h=null,T=E=!1,d===63){let n=z.input.charCodeAt(z.position+1);if(m(n))T=E=!0,z.position++,t(z,!0,D)}if(j=z.line,O=z.lineStart,x=z.position,m2(z,D,U,!1,!0),y=z.tag,S=z.result,t(z,!0,D),d=z.input.charCodeAt(z.position),(E||z.line===j)&&d===58)T=!0,d=z.input.charCodeAt(++z.position),t(z,!0,D),m2(z,D,U,!1,!0),h=z.result;if(R)g2(z,L,k,y,S,h,j,O,x);else if(T)L.push(g2(z,null,k,y,S,h,j,O,x));else L.push(S);if(t(z,!0,D),d=z.input.charCodeAt(z.position),d===44)_=!0,d=z.input.charCodeAt(++z.position);else _=!1}g(z,"unexpected end of the stream within a flow collection")}function o0(z,D){let _,j=K,O=!1,x=!1,q=D,L=0,P=!1,N,T=z.input.charCodeAt(z.position);if(T===124)_=!1;else if(T===62)_=!0;else return!1;z.kind="scalar",z.result="";while(T!==0)if(T=z.input.charCodeAt(++z.position),T===43||T===45)if(K===j)j=T===43?B:V;else g(z,"repeat of a chomping mode identifier");else if((N=b(T))>=0)if(N===0)g(z,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!x)q=D+N-1,x=!0;else g(z,"repeat of an indentation width identifier");else break;if(v(T)){do T=z.input.charCodeAt(++z.position);while(v(T));if(T===35)do T=z.input.charCodeAt(++z.position);while(!C(T)&&T!==0)}while(T!==0){q0(z),z.lineIndent=0,T=z.input.charCodeAt(z.position);while((!x||z.lineIndent<q)&&T===32)z.lineIndent++,T=z.input.charCodeAt(++z.position);if(!x&&z.lineIndent>q)q=z.lineIndent;if(C(T)){L++;continue}if(!x&&q===0)g(z,"missing indentation for block scalar");if(z.lineIndent<q){if(j===B)z.result+=Z.repeat(`
|
|
33
|
+
`,O?1+L:L);else if(j===K){if(O)z.result+=`
|
|
34
|
+
`}break}if(_)if(v(T))P=!0,z.result+=Z.repeat(`
|
|
35
|
+
`,O?1+L:L);else if(P)P=!1,z.result+=Z.repeat(`
|
|
36
|
+
`,L+1);else if(L===0){if(O)z.result+=" "}else z.result+=Z.repeat(`
|
|
35
37
|
`,L);else z.result+=Z.repeat(`
|
|
36
|
-
`,
|
|
37
|
-
`;if(z.charCodeAt(0)===65279)z=z.slice(1)}let
|
|
38
|
-
`,
|
|
39
|
-
`)
|
|
40
|
-
`+Z.repeat(" ",
|
|
41
|
-
`,
|
|
42
|
-
`||
|
|
43
|
-
`)?"+":
|
|
44
|
-
`}function
|
|
45
|
-
`?
|
|
46
|
-
`);return k=k!==-1?k:
|
|
47
|
-
`||
|
|
48
|
-
`:"")+
|
|
49
|
-
`+
|
|
50
|
-
`,
|
|
51
|
-
`+
|
|
52
|
-
`;return""}return
|
|
38
|
+
`,O?1+L:L);O=!0,x=!0,L=0;let E=z.position;while(!C(T)&&T!==0)T=z.input.charCodeAt(++z.position);F2(z,E,z.position,!1)}return!0}function y2(z,D){let{tag:_,anchor:j}=z,O=[],x=!1;if(z.firstTabInLine!==-1)return!1;if(z.anchor!==null)b2(z,z.anchor,O);let q=z.input.charCodeAt(z.position);while(q!==0){if(z.firstTabInLine!==-1)z.position=z.firstTabInLine,g(z,"tab characters must not be used in indentation");if(q!==45)break;let L=z.input.charCodeAt(z.position+1);if(!m(L))break;if(x=!0,z.position++,t(z,!0,-1)){if(z.lineIndent<=D){O.push(null),q=z.input.charCodeAt(z.position);continue}}let P=z.line;if(m2(z,D,Y,!1,!0),O.push(z.result),t(z,!0,-1),q=z.input.charCodeAt(z.position),(z.line===P||z.lineIndent>D)&&q!==0)g(z,"bad indentation of a sequence entry");else if(z.lineIndent<D)break}if(x)return z.tag=_,z.anchor=j,z.kind="sequence",z.result=O,!0;return!1}function r0(z,D,_){let j,O,x,q,L=z.tag,P=z.anchor,N={},T=Object.create(null),E=null,R=null,k=null,S=!1,y=!1;if(z.firstTabInLine!==-1)return!1;if(z.anchor!==null)b2(z,z.anchor,N);let h=z.input.charCodeAt(z.position);while(h!==0){if(!S&&z.firstTabInLine!==-1)z.position=z.firstTabInLine,g(z,"tab characters must not be used in indentation");let d=z.input.charCodeAt(z.position+1),n=z.line;if((h===63||h===58)&&m(d)){if(h===63){if(S)g2(z,N,T,E,R,null,O,x,q),E=R=k=null;y=!0,S=!0,j=!0}else if(S)S=!1,j=!0;else g(z,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");z.position+=1,h=d}else{if(O=z.line,x=z.lineStart,q=z.position,!m2(z,_,J,!1,!0))break;if(z.line===n){h=z.input.charCodeAt(z.position);while(v(h))h=z.input.charCodeAt(++z.position);if(h===58){if(h=z.input.charCodeAt(++z.position),!m(h))g(z,"a whitespace character is expected after the key-value separator within a block mapping");if(S)g2(z,N,T,E,R,null,O,x,q),E=R=k=null;y=!0,S=!1,j=!1,E=z.tag,R=z.result}else if(y)g(z,"can not read an implicit mapping pair; a colon is missed");else return z.tag=L,z.anchor=P,!0}else if(y)g(z,"can not read a block mapping entry; a multiline key may not be an implicit key");else return z.tag=L,z.anchor=P,!0}if(z.line===n||z.lineIndent>D){if(S)O=z.line,x=z.lineStart,q=z.position;if(m2(z,D,H,!0,j))if(S)R=z.result;else k=z.result;if(!S)g2(z,N,T,E,R,k,O,x,q),E=R=k=null;t(z,!0,-1),h=z.input.charCodeAt(z.position)}if((z.line===n||z.lineIndent>D)&&h!==0)g(z,"bad indentation of a mapping entry");else if(z.lineIndent<D)break}if(S)g2(z,N,T,E,R,null,O,x,q);if(y)z.tag=L,z.anchor=P,z.kind="mapping",z.result=N;return y}function v1(z){let D=!1,_=!1,j,O,x=z.input.charCodeAt(z.position);if(x!==33)return!1;if(z.tag!==null)g(z,"duplication of a tag property");if(x=z.input.charCodeAt(++z.position),x===60)D=!0,x=z.input.charCodeAt(++z.position);else if(x===33)_=!0,j="!!",x=z.input.charCodeAt(++z.position);else j="!";let q=z.position;if(D){do x=z.input.charCodeAt(++z.position);while(x!==0&&x!==62);if(z.position<z.length)O=z.input.slice(q,z.position),x=z.input.charCodeAt(++z.position);else g(z,"unexpected end of the stream within a verbatim tag")}else{while(x!==0&&!m(x)){if(x===33)if(!_){if(j=z.input.slice(q-1,z.position+1),!w.test(j))g(z,"named tag handle cannot contain such characters");_=!0,q=z.position+1}else g(z,"tag suffix cannot contain exclamation marks");x=z.input.charCodeAt(++z.position)}if(O=z.input.slice(q,z.position),I.test(O))g(z,"tag suffix cannot contain flow indicator characters")}if(O&&!$.test(O))g(z,"tag name cannot contain such characters: "+O);try{O=decodeURIComponent(O)}catch(L){g(z,"tag name is malformed: "+O)}if(D)z.tag=O;else if(Q.call(z.tagMap,j))z.tag=z.tagMap[j]+O;else if(j==="!")z.tag="!"+O;else if(j==="!!")z.tag="tag:yaml.org,2002:"+O;else g(z,'undeclared tag handle "'+j+'"');return!0}function s0(z){let D=z.input.charCodeAt(z.position);if(D!==38)return!1;if(z.anchor!==null)g(z,"duplication of an anchor property");D=z.input.charCodeAt(++z.position);let _=z.position;while(D!==0&&!m(D)&&!f(D))D=z.input.charCodeAt(++z.position);if(z.position===_)g(z,"name of an anchor node must contain at least one character");return z.anchor=z.input.slice(_,z.position),!0}function a0(z){let D=z.input.charCodeAt(z.position);if(D!==42)return!1;D=z.input.charCodeAt(++z.position);let _=z.position;while(D!==0&&!m(D)&&!f(D))D=z.input.charCodeAt(++z.position);if(z.position===_)g(z,"name of an alias node must contain at least one character");let j=z.input.slice(_,z.position);if(!Q.call(z.anchorMap,j))g(z,'unidentified alias "'+j+'"');return z.result=z.anchorMap[j],t(z,!0,-1),!0}function y1(z,D,_,j){let O=T0(z);if(b1(z),V0(z,D),z.tag=null,z.anchor=null,z.kind=null,z.result=null,r0(z,_,j)&&z.kind==="mapping")return X0(z),!0;return g1(z),V0(z,O),!1}function m2(z,D,_,j,O){let x,q,L=1,P=!1,N=!1,T=null,E,R,k;if(z.depth>=z.maxDepth)g(z,"nesting exceeded maxDepth ("+z.maxDepth+")");if(z.depth+=1,z.listener!==null)z.listener("open",z);z.tag=null,z.anchor=null,z.kind=null,z.result=null;let S=x=q=H===_||Y===_;if(j){if(t(z,!0,-1)){if(P=!0,z.lineIndent>D)L=1;else if(z.lineIndent===D)L=0;else if(z.lineIndent<D)L=-1}}if(L===1)while(!0){let y=z.input.charCodeAt(z.position),h=T0(z);if(P&&(y===33&&z.tag!==null||y===38&&z.anchor!==null))break;if(!v1(z)&&!s0(z))break;if(T===null)T=h;if(t(z,!0,-1)){if(P=!0,q=S,z.lineIndent>D)L=1;else if(z.lineIndent===D)L=0;else if(z.lineIndent<D)L=-1}else q=!1}if(q)q=P||O;if(L===1||H===_){if(U===_||J===_)R=D;else R=D+1;if(k=z.position-z.lineStart,L===1)if(q&&(y2(z,k)||r0(z,k,R))||n0(z,R))N=!0;else{let y=z.input.charCodeAt(z.position);if(T!==null&&S&&!q&&y!==124&&y!==62&&y1(z,T,T.position-T.lineStart,R))N=!0;else if(x&&o0(z,R)||i0(z,R)||j0(z,R))N=!0;else if(a0(z)){if(N=!0,z.tag!==null||z.anchor!==null)g(z,"alias node should not have any properties")}else if(l0(z,R,U===_)){if(N=!0,z.tag===null)z.tag="?"}if(z.anchor!==null)b2(z,z.anchor,z.result)}else if(L===0)N=q&&y2(z,k)}if(z.tag===null){if(z.anchor!==null)b2(z,z.anchor,z.result)}else if(z.tag==="?"){if(z.result!==null&&z.kind!=="scalar")g(z,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+z.kind+'"');for(let y=0,h=z.implicitTypes.length;y<h;y+=1)if(E=z.implicitTypes[y],E.resolve(z.result)){if(z.result=E.construct(z.result),z.tag=E.tag,z.anchor!==null)b2(z,z.anchor,z.result);break}}else if(z.tag!=="!"){if(Q.call(z.typeMap[z.kind||"fallback"],z.tag))E=z.typeMap[z.kind||"fallback"][z.tag];else{E=null;let y=z.typeMap.multi[z.kind||"fallback"];for(let h=0,d=y.length;h<d;h+=1)if(z.tag.slice(0,y[h].tag.length)===y[h].tag){E=y[h];break}}if(!E)g(z,"unknown tag !<"+z.tag+">");if(z.result!==null&&E.kind!==z.kind)g(z,"unacceptable node kind for !<"+z.tag+'> tag; it should be "'+E.kind+'", not "'+z.kind+'"');if(!E.resolve(z.result,z.tag))g(z,"cannot resolve a node with !<"+z.tag+"> explicit tag");else if(z.result=E.construct(z.result,z.tag),z.anchor!==null)b2(z,z.anchor,z.result)}if(z.listener!==null)z.listener("close",z);return z.depth-=1,z.tag!==null||z.anchor!==null||N}function m1(z){let D=z.position,_=!1,j;z.version=null,z.checkLineBreaks=z.legacy,z.tagMap=Object.create(null),z.anchorMap=Object.create(null);while((j=z.input.charCodeAt(z.position))!==0){if(t(z,!0,-1),j=z.input.charCodeAt(z.position),z.lineIndent>0||j!==37)break;_=!0,j=z.input.charCodeAt(++z.position);let O=z.position;while(j!==0&&!m(j))j=z.input.charCodeAt(++z.position);let x=z.input.slice(O,z.position),q=[];if(x.length<1)g(z,"directive name must not be less than one character in length");while(j!==0){while(v(j))j=z.input.charCodeAt(++z.position);if(j===35){do j=z.input.charCodeAt(++z.position);while(j!==0&&!C(j));break}if(C(j))break;O=z.position;while(j!==0&&!m(j))j=z.input.charCodeAt(++z.position);q.push(z.input.slice(O,z.position))}if(j!==0)q0(z);if(Q.call(p0,x))p0[x](z,x,q);else K0(z,'unknown document directive "'+x+'"')}if(t(z,!0,-1),z.lineIndent===0&&z.input.charCodeAt(z.position)===45&&z.input.charCodeAt(z.position+1)===45&&z.input.charCodeAt(z.position+2)===45)z.position+=3,t(z,!0,-1);else if(_)g(z,"directives end mark is expected");if(m2(z,z.lineIndent-1,H,!1,!0),t(z,!0,-1),z.checkLineBreaks&&M.test(z.input.slice(D,z.position)))K0(z,"non-ASCII line breaks are interpreted as content");if(z.documents.push(z.result),z.position===z.lineStart&&H0(z)){if(z.input.charCodeAt(z.position)===46)z.position+=3,t(z,!0,-1);return}if(z.position<z.length-1)g(z,"end of the stream or a document separator is expected")}function t0(z,D){if(z=String(z),D=D||{},z.length!==0){if(z.charCodeAt(z.length-1)!==10&&z.charCodeAt(z.length-1)!==13)z+=`
|
|
39
|
+
`;if(z.charCodeAt(0)===65279)z=z.slice(1)}let _=new Q2(z,D),j=z.indexOf("\x00");if(j!==-1)_.position=j,g(_,"null byte is not allowed in input");_.input+="\x00";while(_.input.charCodeAt(_.position)===32)_.lineIndent+=1,_.position+=1;while(_.position<_.length-1)m1(_);return _.documents}function e0(z,D,_){if(D!==null&&typeof D==="object"&&typeof _>"u")_=D,D=null;let j=t0(z,_);if(typeof D!=="function")return j;for(let O=0,x=j.length;O<x;O+=1)D(j[O])}function h1(z,D){let _=t0(z,D);if(_.length===0)return;else if(_.length===1)return _[0];throw new X("expected a single document in the stream, but found more")}return N1.loadAll=e0,N1.load=h1,N1}function yZ(){if(F4)return S8;F4=1;let Z=m0(),X=h0(),W=k8(),G=Object.prototype.toString,Q=Object.prototype.hasOwnProperty,U=65279,J=9,Y=10,H=13,K=32,V=33,B=34,F=35,M=37,I=38,w=39,$=42,A=44,C=45,v=58,m=61,f=62,X2=63,u=64,b=91,o=93,W2=96,k2=123,c0=124,N0=125,Q2={};Q2[0]="\\0",Q2[7]="\\a",Q2[8]="\\b",Q2[9]="\\t",Q2[10]="\\n",Q2[11]="\\v",Q2[12]="\\f",Q2[13]="\\r",Q2[27]="\\e",Q2[34]="\\\"",Q2[92]="\\\\",Q2[133]="\\N",Q2[160]="\\_",Q2[8232]="\\L",Q2[8233]="\\P";let d0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],g=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function K0(q,L){if(L===null)return{};let P={},N=Object.keys(L);for(let T=0,E=N.length;T<E;T+=1){let R=N[T],k=String(L[R]);if(R.slice(0,2)==="!!")R="tag:yaml.org,2002:"+R.slice(2);let S=q.compiledTypeMap.fallback[R];if(S&&Q.call(S.styleAliases,k))k=S.styleAliases[k];P[R]=k}return P}function b2(q){let L,P,N=q.toString(16).toUpperCase();if(q<=255)L="x",P=2;else if(q<=65535)L="u",P=4;else if(q<=4294967295)L="U",P=8;else throw new X("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+L+Z.repeat("0",P-N.length)+N}let b1=1,X0=2;function g1(q){this.schema=q.schema||W,this.indent=Math.max(1,q.indent||2),this.noArrayIndent=q.noArrayIndent||!1,this.skipInvalid=q.skipInvalid||!1,this.flowLevel=Z.isNothing(q.flowLevel)?-1:q.flowLevel,this.styleMap=K0(this.schema,q.styles||null),this.sortKeys=q.sortKeys||!1,this.lineWidth=q.lineWidth||80,this.noRefs=q.noRefs||!1,this.noCompatMode=q.noCompatMode||!1,this.condenseFlow=q.condenseFlow||!1,this.quotingType=q.quotingType==='"'?X0:b1,this.forceQuotes=q.forceQuotes||!1,this.replacer=typeof q.replacer==="function"?q.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function T0(q,L){let P=Z.repeat(" ",L),N=0,T="",E=q.length;while(N<E){let R,k=q.indexOf(`
|
|
40
|
+
`,N);if(k===-1)R=q.slice(N),N=E;else R=q.slice(N,k+1),N=k+1;if(R.length&&R!==`
|
|
41
|
+
`)T+=P;T+=R}return T}function V0(q,L){return`
|
|
42
|
+
`+Z.repeat(" ",q.indent*L)}function p0(q,L){for(let P=0,N=q.implicitTypes.length;P<N;P+=1)if(q.implicitTypes[P].resolve(L))return!0;return!1}function F2(q){return q===K||q===J}function i2(q){return q>=32&&q<=126||q>=161&&q<=55295&&q!==8232&&q!==8233||q>=57344&&q<=65533&&q!==U||q>=65536&&q<=1114111}function g2(q){return i2(q)&&q!==U&&q!==H&&q!==Y}function q0(q,L,P){let N=g2(q),T=N&&!F2(q);return(P?N:N&&q!==A&&q!==b&&q!==o&&q!==k2&&q!==N0)&&q!==F&&!(L===v&&!T)||g2(L)&&!F2(L)&&q===F||L===v&&T}function t(q){return i2(q)&&q!==U&&!F2(q)&&q!==C&&q!==X2&&q!==v&&q!==A&&q!==b&&q!==o&&q!==k2&&q!==N0&&q!==F&&q!==I&&q!==$&&q!==V&&q!==c0&&q!==m&&q!==f&&q!==w&&q!==B&&q!==M&&q!==u&&q!==W2}function H0(q){return!F2(q)&&q!==v}function v2(q,L){let P=q.charCodeAt(L),N;if(P>=55296&&P<=56319&&L+1<q.length){if(N=q.charCodeAt(L+1),N>=56320&&N<=57343)return(P-55296)*1024+N-56320+65536}return P}function l0(q){return/^\n* /.test(q)}let i0=1,j0=2,n0=3,o0=4,y2=5;function r0(q,L,P,N,T,E,R,k){let S,y=0,h=null,d=!1,n=!1,G9=N!==-1,C0=-1,R0=t(v2(q,0))&&H0(v2(q,q.length-1));if(L||R)for(S=0;S<q.length;y>=65536?S+=2:S++){if(y=v2(q,S),!i2(y))return y2;R0=R0&&q0(y,h,k),h=y}else{for(S=0;S<q.length;y>=65536?S+=2:S++){if(y=v2(q,S),y===Y){if(d=!0,G9)n=n||S-C0-1>N&&q[C0+1]!==" ",C0=S}else if(!i2(y))return y2;R0=R0&&q0(y,h,k),h=y}n=n||G9&&(S-C0-1>N&&q[C0+1]!==" ")}if(!d&&!n){if(R0&&!R&&!T(q))return i0;return E===X0?y2:j0}if(P>9&&l0(q))return y2;if(!R)return n?o0:n0;return E===X0?y2:j0}function v1(q,L,P,N,T){q.dump=function(){if(L.length===0)return q.quotingType===X0?'""':"''";if(!q.noCompatMode){if(d0.indexOf(L)!==-1||g.test(L))return q.quotingType===X0?'"'+L+'"':"'"+L+"'"}let E=q.indent*Math.max(1,P),R=q.lineWidth===-1?-1:Math.max(Math.min(q.lineWidth,40),q.lineWidth-E),k=N||q.flowLevel>-1&&P>=q.flowLevel;function S(y){return p0(q,y)}switch(r0(L,k,q.indent,R,S,q.quotingType,q.forceQuotes&&!N,T)){case i0:return L;case j0:return"'"+L.replace(/'/g,"''")+"'";case n0:return"|"+s0(L,q.indent)+a0(T0(L,E));case o0:return">"+s0(L,q.indent)+a0(T0(y1(L,R),E));case y2:return'"'+m1(L)+'"';default:throw new X("impossible error: invalid scalar style")}}()}function s0(q,L){let P=l0(q)?String(L):"",N=q[q.length-1]===`
|
|
43
|
+
`,E=N&&(q[q.length-2]===`
|
|
44
|
+
`||q===`
|
|
45
|
+
`)?"+":N?"":"-";return P+E+`
|
|
46
|
+
`}function a0(q){return q[q.length-1]===`
|
|
47
|
+
`?q.slice(0,-1):q}function y1(q,L){let P=/(\n+)([^\n]*)/g,N=function(){let k=q.indexOf(`
|
|
48
|
+
`);return k=k!==-1?k:q.length,P.lastIndex=k,m2(q.slice(0,k),L)}(),T=q[0]===`
|
|
49
|
+
`||q[0]===" ",E,R;while(R=P.exec(q)){let k=R[1],S=R[2];E=S[0]===" ",N+=k+(!T&&!E&&S!==""?`
|
|
50
|
+
`:"")+m2(S,L),T=E}return N}function m2(q,L){if(q===""||q[0]===" ")return q;let P=/ [^ ]/g,N,T=0,E,R=0,k=0,S="";while(N=P.exec(q)){if(k=N.index,k-T>L)E=R>T?R:k,S+=`
|
|
51
|
+
`+q.slice(T,E),T=E+1;R=k}if(S+=`
|
|
52
|
+
`,q.length-T>L&&R>T)S+=q.slice(T,R)+`
|
|
53
|
+
`+q.slice(R+1);else S+=q.slice(T);return S.slice(1)}function m1(q){let L="",P=0;for(let N=0;N<q.length;P>=65536?N+=2:N++){P=v2(q,N);let T=Q2[P];if(!T&&i2(P)){if(L+=q[N],P>=65536)L+=q[N+1]}else L+=T||b2(P)}return L}function t0(q,L,P){let N="",T=q.tag;for(let E=0,R=P.length;E<R;E+=1){let k=P[E];if(q.replacer)k=q.replacer.call(P,String(E),k);if(_(q,L,k,!1,!1)||typeof k>"u"&&_(q,L,null,!1,!1)){if(N!=="")N+=","+(!q.condenseFlow?" ":"");N+=q.dump}}q.tag=T,q.dump="["+N+"]"}function e0(q,L,P,N){let T="",E=q.tag;for(let R=0,k=P.length;R<k;R+=1){let S=P[R];if(q.replacer)S=q.replacer.call(P,String(R),S);if(_(q,L+1,S,!0,!0,!1,!0)||typeof S>"u"&&_(q,L+1,null,!0,!0,!1,!0)){if(!N||T!=="")T+=V0(q,L);if(q.dump&&Y===q.dump.charCodeAt(0))T+="-";else T+="- ";T+=q.dump}}q.tag=E,q.dump=T||"[]"}function h1(q,L,P){let N="",T=q.tag,E=Object.keys(P);for(let R=0,k=E.length;R<k;R+=1){let S="";if(N!=="")S+=", ";if(q.condenseFlow)S+='"';let y=E[R],h=P[y];if(q.replacer)h=q.replacer.call(P,y,h);if(!_(q,L,y,!1,!1))continue;if(q.dump.length>1024)S+="? ";if(S+=q.dump+(q.condenseFlow?'"':"")+":"+(q.condenseFlow?"":" "),!_(q,L,h,!1,!1))continue;S+=q.dump,N+=S}q.tag=T,q.dump="{"+N+"}"}function z(q,L,P,N){let T="",E=q.tag,R=Object.keys(P);if(q.sortKeys===!0)R.sort();else if(typeof q.sortKeys==="function")R.sort(q.sortKeys);else if(q.sortKeys)throw new X("sortKeys must be a boolean or a function");for(let k=0,S=R.length;k<S;k+=1){let y="";if(!N||T!=="")y+=V0(q,L);let h=R[k],d=P[h];if(q.replacer)d=q.replacer.call(P,h,d);if(!_(q,L+1,h,!0,!0,!0))continue;let n=q.tag!==null&&q.tag!=="?"||q.dump&&q.dump.length>1024;if(n)if(q.dump&&Y===q.dump.charCodeAt(0))y+="?";else y+="? ";if(y+=q.dump,n)y+=V0(q,L);if(!_(q,L+1,d,!0,n))continue;if(q.dump&&Y===q.dump.charCodeAt(0))y+=":";else y+=": ";y+=q.dump,T+=y}q.tag=E,q.dump=T||"{}"}function D(q,L,P){let N=P?q.explicitTypes:q.implicitTypes;for(let T=0,E=N.length;T<E;T+=1){let R=N[T];if((R.instanceOf||R.predicate)&&(!R.instanceOf||typeof L==="object"&&L instanceof R.instanceOf)&&(!R.predicate||R.predicate(L))){if(P)if(R.multi&&R.representName)q.tag=R.representName(L);else q.tag=R.tag;else q.tag="?";if(R.represent){let k=q.styleMap[R.tag]||R.defaultStyle,S;if(G.call(R.represent)==="[object Function]")S=R.represent(L,k);else if(Q.call(R.represent,k))S=R.represent[k](L,k);else throw new X("!<"+R.tag+'> tag resolver accepts not "'+k+'" style');q.dump=S}return!0}}return!1}function _(q,L,P,N,T,E,R){if(q.tag=null,q.dump=P,!D(q,P,!1))D(q,P,!0);let k=G.call(q.dump),S=N;if(N)N=q.flowLevel<0||q.flowLevel>L;let y=k==="[object Object]"||k==="[object Array]",h,d;if(y)h=q.duplicates.indexOf(P),d=h!==-1;if(q.tag!==null&&q.tag!=="?"||d||q.indent!==2&&L>0)T=!1;if(d&&q.usedDuplicates[h])q.dump="*ref_"+h;else{if(y&&d&&!q.usedDuplicates[h])q.usedDuplicates[h]=!0;if(k==="[object Object]"){if(N&&Object.keys(q.dump).length!==0){if(z(q,L,q.dump,T),d)q.dump="&ref_"+h+q.dump}else if(h1(q,L,q.dump),d)q.dump="&ref_"+h+" "+q.dump}else if(k==="[object Array]"){if(N&&q.dump.length!==0){if(q.noArrayIndent&&!R&&L>0)e0(q,L-1,q.dump,T);else e0(q,L,q.dump,T);if(d)q.dump="&ref_"+h+q.dump}else if(t0(q,L,q.dump),d)q.dump="&ref_"+h+" "+q.dump}else if(k==="[object String]"){if(q.tag!=="?")v1(q,q.dump,L,E,S)}else if(k==="[object Undefined]")return!1;else{if(q.skipInvalid)return!1;throw new X("unacceptable kind of an object to dump "+k)}if(q.tag!==null&&q.tag!=="?"){let n=encodeURI(q.tag[0]==="!"?q.tag.slice(1):q.tag).replace(/!/g,"%21");if(q.tag[0]==="!")n="!"+n;else if(n.slice(0,18)==="tag:yaml.org,2002:")n="!!"+n.slice(18);else n="!<"+n+">";q.dump=n+" "+q.dump}}return!0}function j(q,L){let P=[],N=[];O(q,P,N);let T=N.length;for(let E=0;E<T;E+=1)L.duplicates.push(P[N[E]]);L.usedDuplicates=Array(T)}function O(q,L,P){if(q!==null&&typeof q==="object"){let N=L.indexOf(q);if(N!==-1){if(P.indexOf(N)===-1)P.push(N)}else if(L.push(q),Array.isArray(q))for(let T=0,E=q.length;T<E;T+=1)O(q[T],L,P);else{let T=Object.keys(q);for(let E=0,R=T.length;E<R;E+=1)O(q[T[E]],L,P)}}}function x(q,L){L=L||{};let P=new g1(L);if(!P.noRefs)j(q,P);let N=q;if(P.replacer)N=P.replacer.call({"":N},"",N);if(_(P,0,N,!0,!0))return P.dump+`
|
|
54
|
+
`;return""}return S8.dump=x,S8}function mZ(){if(M4)return G2;M4=1;let Z=vZ(),X=yZ();function W(G,Q){return function(){throw Error("Function yaml."+G+" is removed in js-yaml 4. Use yaml."+Q+" instead, which is now safe by default.")}}return G2.Type=Y2(),G2.Schema=$4(),G2.FAILSAFE_SCHEMA=w4(),G2.JSON_SCHEMA=T4(),G2.CORE_SCHEMA=j4(),G2.DEFAULT_SCHEMA=k8(),G2.load=Z.load,G2.loadAll=Z.loadAll,G2.dump=X.dump,G2.YAMLException=h0(),G2.types={binary:P4(),float:N4(),map:A4(),null:I4(),pairs:x4(),set:S4(),timestamp:C4(),bool:O4(),int:_4(),merge:R4(),omap:E4(),seq:L4(),str:D4()},G2.safeLoad=W("safeLoad","load"),G2.safeLoadAll=W("safeLoadAll","loadAll"),G2.safeDump=W("safeDump","dump"),G2}var G2,N1,t2,l9,q8,i9,H8,n9,B8,o9,F8,r9,M8,s9,$8,a9,D8,t9,L8,e9,A8,Z4,w8,X4,I8,z4,O8,W4,_8,Q4,N8,G4,T8,J4,j8,U4,C8,Y4,R8,K4,P8,V4,E8,q4,x8,H4,B4,S8,F4,M4,hZ,T1,j5,C5,R5,k4,P5,E5,x5,S5,k5,b5,g5,v5,y5,m5;var b8=c(()=>{G2={},N1={},t2={};S8={};hZ=mZ(),T1=bZ(hZ),{Type:j5,Schema:C5,FAILSAFE_SCHEMA:R5,JSON_SCHEMA:k4,CORE_SCHEMA:P5,DEFAULT_SCHEMA:E5,load:x5,loadAll:S5,dump:k5,YAMLException:b5,types:g5,safeLoad:v5,safeLoadAll:y5,safeDump:m5}=T1});var b4;var g4=c(()=>{N2();b8();b8();b4={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(Z){let X=Z.data;if(Buffer.isBuffer(X))X=X.toString();if(typeof X==="string")try{return T1.load(X,{schema:k4})}catch{try{return T1.load(X)}catch(W){throw new _2(W?.message||"Parser Error",Z.url)}}else return X}}});var uZ,v4;var y4=c(()=>{N2();uZ=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,v4={order:300,allowEmpty:!0,encoding:"utf8",canParse(Z){return(typeof Z.data==="string"||Buffer.isBuffer(Z.data))&&uZ.test(Z.url)},parse(Z){if(typeof Z.data==="string")return Z.data;else if(Buffer.isBuffer(Z.data))return Z.data.toString(this.encoding);else throw new _2("data is not text",Z.url)}}});var fZ,m4;var h4=c(()=>{fZ=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,m4={order:400,allowEmpty:!0,canParse(Z){return Buffer.isBuffer(Z.data)&&fZ.test(Z.url)},parse(Z){if(Buffer.isBuffer(Z.data))return Z.data;else return Buffer.from(Z.data)}}});var g8;var v8=c(()=>{H2();N2();g8={order:100,canRead(Z){return F1(Z.url)},async read(Z){let X,W=await import("fs");try{X=w0(Z.url)}catch(G){let Q=G;throw Q.message=`Malformed URI: ${Z.url}: ${Q.message}`,new T2(Q,Z.url)}if(X.endsWith("/")||X.endsWith("\\"))X=X.slice(0,-1);try{return await W.promises.readFile(X)}catch(G){let Q=G;throw Q.message=`Error opening file ${X}: ${Q.message}`,new T2(Q,X)}}}});async function u4(Z,X,W){Z=A0(Z);let G=W||[];G.push(Z.href);try{if(X.safeUrlResolver&&B1(Z.href))throw Error(`Unsafe URL blocked by safeUrlResolver: ${Z.href}`);let Q=await cZ(Z,X);if(Q.status>=400){let U=Error(`HTTP ERROR ${Q.status}`);throw U.status=Q.status,U}else if(Q.status>=300)if(!Number.isNaN(X.redirects)&&G.length>X.redirects){let U=Error(`Error downloading ${G[0]}.
|
|
53
55
|
Too many redirects:
|
|
54
56
|
${G.join(`
|
|
55
|
-
`)}`);throw J.status=Q.status,new N2(J)}else{let J=gZ(Q,"location");if(!J){let K=Error(`HTTP ${Q.status} redirect with no location header`);throw K.status=Q.status,K}let U=e(Z.href,J);return b4(U,X,G)}else{if(Q.body){let J=await Q.arrayBuffer();return Buffer.from(J)}return Buffer.alloc(0)}}catch(Q){let J=Q;throw J.message=`Error downloading ${Z.href}: ${J.message}`,new N2(J,Z.href)}}async function bZ(Z,X){let W,G;if(X.timeout&&typeof AbortController<"u")W=new AbortController,G=setTimeout(()=>W.abort(),X.timeout);let Q=await fetch(Z,{method:"GET",headers:X.headers||{},credentials:X.withCredentials?"include":"same-origin",redirect:"manual",signal:W?W.signal:null});if(G)clearTimeout(G);return Q}function gZ(Z,X){return Z.headers.get(X)}var E8;var S8=c(()=>{q2();O2();E8={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return _9(Z.url)&&(!this.safeUrlResolver||!U1(Z.url))},read(Z){let X=F0(Z.url);if(typeof window<"u"&&!X.protocol)X.protocol=F0(location.href).protocol;return b4(X,this)}}});function m4(Z,X){if(g4(X)){let W=Object.keys(X).filter((G)=>!["__proto__","constructor","prototype"].includes(G));for(let G=0;G<W.length;G++){let Q=W[G],J=X[Q],U=Z[Q];if(g4(J))Z[Q]=m4(U||{},J);else if(J!==void 0)Z[Q]=J}}return Z}function g4(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var v4=()=>{return{parse:{json:{...y9},yaml:{...R4},text:{...x4},binary:{...S4}},resolve:{file:{...P8},http:{...E8},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},y4=(Z)=>{let X=v4();if(Z)m4(X,Z);return X};var k8=c(()=>{m9();P4();E4();k4();x8();S8()});function vZ(Z){let X,W,G,Q,J=Array.prototype.slice.call(Z);if(typeof J[J.length-1]==="function")Q=J.pop();if(typeof J[0]==="string")if(X=J[0],typeof J[2]==="object")W=J[1],G=J[2];else W=void 0,G=J[1];else X="",W=J[0],G=J[1];try{G=y4(G)}catch(U){console.error(`JSON Schema Ref Parser: Error normalizing options: ${U}`)}if(!G.mutateInputSchema&&typeof W==="object")W=JSON.parse(JSON.stringify(W));return{path:X,schema:W,options:G,callback:Q}}var v0;var h4=c(()=>{k8();v0=vZ});function yZ(Z,X){if(!X.resolve?.external)return Promise.resolve();try{let W=Z.$refs._root$Ref.dynamicIdScope?U2(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,G=b8(Z.schema,Z.$refs._root$Ref.path+"#",W,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,X);return Promise.all(G)}catch(W){return Promise.reject(W)}}function b8(Z,X,W,G,Q,J,U,K){U||=new Set;let H=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!U.has(Z)){U.add(Z);let Y=W;if(a.isExternal$Ref(Z))H.push(mZ(Z,X,Y,G,Q,J));let q=Object.keys(Z);for(let B of q){let M=H2.join(X,B),F=Z[B],D=G&&F&&typeof F==="object"&&!ArrayBuffer.isView(F)?U2(Y,F):Y;H=H.concat(b8(F,M,D,G,Q,J,U,K))}}return H}async function mZ(Z,X,W,G,Q,J){let K=J.dereference?.externalReferenceResolution==="root"?z0():G?W:X,H=e(K,Z.$ref),Y=Z2(H),q=Q._get$Ref(Y);if(q)return Promise.resolve(q.value);try{let B=Z.$ref,M={url:H,baseUrl:K};if(typeof B==="string")M.reference=B;let F=await D1(M,Q,J),D=Q._get$Ref(Y),w=b8(F,Y+"#",Y,D?.dynamicIdScope??!1,Q,J,new Set,!0);return Promise.all(w)}catch(B){if(!J?.continueOnError||!x2(B))throw B;if(Q._$refs[Y])B.source=decodeURI(Z2(X)),B.path=K1(R2(X));return[]}}var u4;var f4=c(()=>{A0();E0();G8();q2();O2();W0();u4=yZ});function hZ(Z,X){let W=Z.$refs._root$Ref.dynamicIdScope?U2(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,G=[];g8(Z,"schema",Z.$refs._root$Ref.path+"#",W,Z.$refs._root$Ref.dynamicIdScope,"#",0,G,Z.$refs,X);let Q=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(uZ(G,X,Q),(X.bundle||{}).optimizeInternalRefs!==!1)dZ(G,Z.schema)}function g8(Z,X,W,G,Q,J,U,K,H,Y){let q=X===null?Z:Z[X],B=Y.bundle||{},M=B.excludedPathMatcher||(()=>!1);if(q&&typeof q==="object"&&!ArrayBuffer.isView(q)&&!M(J)){let F=G;if(a.isAllowed$Ref(q))c4(Z,X,W,F,Q,J,U,K,H,Y);else{let D=Object.keys(q).sort((w,A)=>{if(w==="definitions"||w==="$defs")return-1;else if(A==="definitions"||A==="$defs")return 1;else return w.length-A.length});for(let w of D){let A=H2.join(W,w),C=H2.join(J,w),E=q[w],y=Q&&E&&typeof E==="object"&&!ArrayBuffer.isView(E)?U2(F,E):F;if(a.isAllowed$Ref(E))c4(q,w,A,y,Q,C,U,K,H,Y);else g8(q,w,A,y,Q,C,U,K,H,Y);if(E&&typeof E==="object"&&!Array.isArray(E)){if("$ref"in E)B?.onBundle?.(E.$ref,q[w],q,w)}}}}}function c4(Z,X,W,G,Q,J,U,K,H,Y){let q=X===null?Z:Z[X],B=e(Q?G:W,q.$ref),M=H._resolve(B,J,Y);if(M===null)return;let D=H2.parse(J).length,w=Z2(M.path),A=R2(M.path),C=w!==H._root$Ref.path&&!H._aliases[w],E=Boolean(H._aliases[w])&&M.$ref.value!==H._root$Ref.value,y=a.isExtended$Ref(q);U+=M.indirections;let h=fZ(K,Z,X);if(h)if(D<h.depth||U<h.indirections)cZ(K,h);else return;if(K.push({$ref:q,parent:Z,key:X,pathFromRoot:J,depth:D,file:w,hash:A,value:M.value,circular:M.circular,extended:y,external:C,nestedResource:E,indirections:U}),!h||C)g8(M.value,null,M.path,M.$ref.path,M.$ref.dynamicIdScope,J,U+1,K,H,Y)}function uZ(Z,X,W){Z.sort((U,K)=>{if(U.file!==K.file)return U.file<K.file?-1:1;else if(U.hash!==K.hash)return U.hash<K.hash?-1:1;else if(U.circular!==K.circular)return U.circular?-1:1;else if(U.extended!==K.extended)return U.extended?1:-1;else if(U.indirections!==K.indirections)return U.indirections-K.indirections;else if(U.depth!==K.depth)return U.depth-K.depth;else{let H=Math.max(U.pathFromRoot.lastIndexOf("/definitions"),U.pathFromRoot.lastIndexOf("/$defs")),Y=Math.max(K.pathFromRoot.lastIndexOf("/definitions"),K.pathFromRoot.lastIndexOf("/$defs"));if(H!==Y)return Y-H;else return U.pathFromRoot.length-K.pathFromRoot.length}});let G,Q,J;for(let U of Z){let K=X.bundle||{};if(!U.external){if(K.optimizeInternalRefs!==!1&&!U.nestedResource)U.$ref.$ref=U.hash}else if(U.file===G&&U.hash===Q)if(W&&d4(Z,U))U.$ref.$ref=W+J;else U.$ref.$ref=J;else if(U.file===G&&U.hash.indexOf(Q+"/")===0){let H=H2.join(J,H2.parse(U.hash.replace(Q,"#")));if(W&&d4(Z,U))U.$ref.$ref=W+H;else U.$ref.$ref=H}else if(G=U.file,Q=U.hash,J=U.pathFromRoot,U.$ref=U.parent[U.key]=a.dereference(U.$ref,U.value,X),U.circular)U.$ref.$ref=U.pathFromRoot}}function fZ(Z,X,W){for(let G of Z)if(G&&G.parent===X&&G.key===W)return G;return}function cZ(Z,X){let W=Z.indexOf(X);Z.splice(W,1)}function dZ(Z,X){for(let W of Z){if(!W.$ref||typeof W.$ref!=="object"||!("$ref"in W.$ref))continue;let G=W.$ref.$ref;if(typeof G!=="string"||!G.startsWith("#/"))continue;let Q=pZ(X,G);if(Q!==G)W.$ref.$ref=Q}}function pZ(Z,X){if(!X.startsWith("#/"))return X;let W=X.slice(2).split("/"),G=Z,Q=[];for(let U of W){if(G===null||G===void 0||typeof G!=="object")return X;if("$ref"in G&&typeof G.$ref==="string"&&G.$ref.startsWith("#/")){let Y=G.$ref.slice(2).split("/");if(Q.length=0,Q.push(...Y),G=lZ(Z,G.$ref),G===null||G===void 0||typeof G!=="object")return X}let K=U.replace(/~1/g,"/").replace(/~0/g,"~"),H=Array.isArray(G)?parseInt(K):K;G=G[H],Q.push(U)}return"#/"+Q.join("/")}function lZ(Z,X){if(!X.startsWith("#/"))return;let W=X.slice(2).split("/"),G=Z;for(let Q of W){if(G===null||G===void 0||typeof G!=="object")return;let J=Q.replace(/~1/g,"/").replace(/~0/g,"~"),U=Array.isArray(G)?parseInt(J):J;G=G[U]}return G}function d4(Z,X){for(let W of Z){if(W.pathFromRoot==="#"||W.pathFromRoot==="#/")continue;if(X.pathFromRoot.startsWith(W.pathFromRoot+"/")){if(W.value&&typeof W.value==="object"&&"$id"in W.value)return!0}}return!1}var p4;var l4=c(()=>{A0();E0();q2();W0();p4=hZ});function iZ(Z,X){let W=Date.now(),G=Z.$refs._root$Ref.dynamicIdScope?U2(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=v8(Z.schema,Z.$refs._root$Ref.path,G,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,X,W,0);Z.$refs.circular=Q.circular,Z.schema=Q.value}function v8(Z,X,W,G,Q,J,U,K,H,Y,q,B){let M,F={value:Z,circular:!1};n4(q,Y);let D=Y.dereference||{},w=D.maxDepth??500;if(B>w)throw RangeError(`Maximum dereference depth (${w}) exceeded at ${Q}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let A=D.excludedPathMatcher||(()=>!1);if(D?.circular==="ignore"||!U.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!A(Q)){J.add(Z),U.add(Z);let C=W;if(a.isAllowed$Ref(Z,Y))M=i4(Z,X,C,G,Q,J,U,K,H,Y,q,B),F.circular=M.circular,F.value=M.value;else for(let E of Object.keys(Z)){n4(q,Y);let y=H2.join(X,E),h=H2.join(Q,E);if(A(h))continue;let f=Z[E],X2=G&&f&&typeof f==="object"&&!ArrayBuffer.isView(f)?U2(C,f):C,u;if(a.isAllowed$Ref(f,Y)){if(M=i4(f,y,X2,G,h,J,U,K,H,Y,q,B),u=M.circular,Z[E]!==M.value){let b=new Map;if(D?.preservedProperties){if(typeof Z[E]==="object"&&!Array.isArray(Z[E]))D?.preservedProperties.forEach((W2)=>{if(W2 in Z[E])b.set(W2,Z[E][W2])})}let o=M.value;if(D?.cloneReferences&&!u&&o&&typeof o==="object")o=structuredClone(o);if(Z[E]=o,D?.preservedProperties){if(b.size&&typeof Z[E]==="object"&&!Array.isArray(Z[E]))b.forEach((W2,E2)=>{Z[E][E2]=W2})}D?.onDereference?.(f.$ref,Z[E],Z,E)}}else if(!J.has(f)){if(M=v8(f,y,X2,G,h,J,U,K,H,Y,q,B+1),u=M.circular,Z[E]!==M.value)Z[E]=M.value}else u=I1(y,H,Y);F.circular=F.circular||u}J.delete(Z)}}return F}function i4(Z,X,W,G,Q,J,U,K,H,Y,q,B){let D=a.isExternal$Ref(Z)&&Y?.dereference?.externalReferenceResolution==="root"?z0():G?W:X,w=e(D,Z.$ref),A=K.get(w);if(A){if(!A.circular){let X2=Object.keys(Z);if(X2.length>1){let u={};for(let b of X2)if(b!=="$ref"&&!(b in A.value))u[b]=Z[b];return{circular:A.circular,value:Object.assign({},A.value,u)}}return A}if(typeof A.value==="object"&&"$ref"in A.value&&"$ref"in Z){if(A.value.$ref===Z.$ref)return I1(X,H,Y),A}else return I1(X,H,Y),A}let C=H._resolve(w,X,Y);if(C===null)return{circular:!1,value:null};let E=C.circular,y=E||C.chainCircular||J.has(C.value);if(y)I1(X,H,Y);let h=a.dereference(Z,C.value,Y);if(!y){let X2=v8(h,C.path,C.$ref.path,C.$ref.dynamicIdScope,Q,J,U,K,H,Y,q,B+1);y=X2.circular,h=X2.value}if(y&&!E&&Y.dereference?.circular==="ignore")h=Z;if(E&&h!==Z)h.$ref=Q;let f={circular:y,value:h};if(Object.keys(Z).length===1)K.set(w,f);return f}function n4(Z,X){if(X&&X.timeoutMs){if(Date.now()-Z>X.timeoutMs)throw new t1(X.timeoutMs)}}function I1(Z,X,W){if(X.circular=!0,W?.dereference?.onCircular?.(Z),!W.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var o4;var r4=c(()=>{A0();E0();q2();W0();O2();o4=iZ});function nZ(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(X){setTimeout(X,0)}}var y8;var s4=c(()=>{y8=nZ()});function D2(Z,X){if(Z){X.then(function(W){y8(function(){Z(null,W)})},function(W){y8(function(){Z(W)})});return}else return X}var a4=c(()=>{s4()});class c2{schema=null;$refs=new k0;async parse(){let Z=v0(arguments),X;if(!Z.path&&!Z.schema){let G=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return D2(Z.callback,Promise.reject(G))}this.schema=null,this.$refs=new k0;let W="http";if(Y1(Z.path))Z.path=R9(Z.path),W="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let G=F0(Z.schema.$id),Q=G.port??(G.protocol==="https:"?443:80);Z.path=`${G.protocol}//${G.hostname}:${Q}`}if(Z.path=e(z0(),Z.path),Z.schema&&typeof Z.schema==="object"){let G=this.$refs._add(Z.path);G.value=Z.schema,G.pathType=W,G.dynamicIdScope=B1(G.value),M1(this.$refs,G.path,G.value,G.pathType,G.dynamicIdScope),X=Promise.resolve(Z.schema)}else X=D1(Z.path,this.$refs,Z.options);try{let G=await X;if(G!==null&&typeof G==="object"&&!Buffer.isBuffer(G))return this.schema=G,D2(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,D2(Z.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||G}" is not a valid JSON Schema`)}catch(G){if(!Z.options.continueOnError||!x2(G))return D2(Z.callback,Promise.reject(G));if(this.$refs._$refs[Z2(Z.path)])this.$refs._$refs[Z2(Z.path)].addError(G);return D2(Z.callback,Promise.resolve(null))}}static parse(){let Z=new c2;return Z.parse.apply(Z,arguments)}async resolve(){let Z=v0(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await u4(this,Z.options),m8(this),D2(Z.callback,Promise.resolve(this.$refs))}catch(X){return D2(Z.callback,Promise.reject(X))}}static resolve(){let Z=new c2;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new c2;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=v0(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),p4(this,Z.options),m8(this),D2(Z.callback,Promise.resolve(this.schema))}catch(X){return D2(Z.callback,Promise.reject(X))}}static dereference(){let Z=new c2;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=v0(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),o4(this,Z.options),m8(this),D2(Z.callback,Promise.resolve(this.schema))}catch(X){return D2(Z.callback,Promise.reject(X))}}}function m8(Z){if(D0.getParserErrors(Z).length>0)throw new D0(Z)}var RX,PX,xX,t4;var e4=c(()=>{g9();G8();h4();f4();l4();r4();q2();x8();S8();O2();a4();W0();k8();q2();RX=c2.parse,PX=c2.resolve,xX=c2.bundle,t4=c2.dereference});async function h8(Z,X={}){let{baseUrl:W="/_jx/server"}=X,G=await t4(Z),Q=L9(G);if(Q.length===0)return null;let J=Q.map(({exportName:K,src:H})=>`import { ${K} } from '${H}'`).join(`
|
|
56
|
-
`),
|
|
57
|
+
`)}`);throw U.status=Q.status,new T2(U)}else{let U=dZ(Q,"location");if(!U){let Y=Error(`HTTP ${Q.status} redirect with no location header`);throw Y.status=Q.status,Y}let J=e(Z.href,U);return u4(J,X,G)}else{if(Q.body){let U=await Q.arrayBuffer();return Buffer.from(U)}return Buffer.alloc(0)}}catch(Q){let U=Q;throw U.message=`Error downloading ${Z.href}: ${U.message}`,new T2(U,Z.href)}}async function cZ(Z,X){let W,G;if(X.timeout&&typeof AbortController<"u")W=new AbortController,G=setTimeout(()=>W.abort(),X.timeout);let Q=await fetch(Z,{method:"GET",headers:X.headers||{},credentials:X.withCredentials?"include":"same-origin",redirect:"manual",signal:W?W.signal:null});if(G)clearTimeout(G);return Q}function dZ(Z,X){return Z.headers.get(X)}var y8;var m8=c(()=>{H2();N2();y8={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return E9(Z.url)&&(!this.safeUrlResolver||!B1(Z.url))},read(Z){let X=A0(Z.url);if(typeof window<"u"&&!X.protocol)X.protocol=A0(location.href).protocol;return u4(X,this)}}});function p4(Z,X){if(f4(X)){let W=Object.keys(X).filter((G)=>!["__proto__","constructor","prototype"].includes(G));for(let G=0;G<W.length;G++){let Q=W[G],U=X[Q],J=Z[Q];if(f4(U))Z[Q]=p4(J||{},U);else if(U!==void 0)Z[Q]=U}}return Z}function f4(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var c4=()=>{return{parse:{json:{...d9},yaml:{...b4},text:{...v4},binary:{...m4}},resolve:{file:{...g8},http:{...y8},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},d4=(Z)=>{let X=c4();if(Z)p4(X,Z);return X};var h8=c(()=>{p9();g4();y4();h4();v8();m8()});function pZ(Z){let X,W,G,Q,U=Array.prototype.slice.call(Z);if(typeof U[U.length-1]==="function")Q=U.pop();if(typeof U[0]==="string")if(X=U[0],typeof U[2]==="object")W=U[1],G=U[2];else W=void 0,G=U[1];else X="",W=U[0],G=U[1];try{G=d4(G)}catch(J){console.error(`JSON Schema Ref Parser: Error normalizing options: ${J}`)}if(!G.mutateInputSchema&&typeof W==="object")W=JSON.parse(JSON.stringify(W));return{path:X,schema:W,options:G,callback:Q}}var u0;var l4=c(()=>{h8();u0=pZ});function lZ(Z,X){if(!X.resolve?.external)return Promise.resolve();try{let W=Z.$refs._root$Ref.dynamicIdScope?U2(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,G=u8(Z.schema,Z.$refs._root$Ref.path+"#",W,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,X);return Promise.all(G)}catch(W){return Promise.reject(W)}}function u8(Z,X,W,G,Q,U,J,Y){J||=new Set;let H=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!J.has(Z)){J.add(Z);let K=W;if(a.isExternal$Ref(Z))H.push(iZ(Z,X,K,G,Q,U));let V=Object.keys(Z);for(let B of V){let F=B2.join(X,B),M=Z[B],I=G&&M&&typeof M==="object"&&!ArrayBuffer.isView(M)?U2(K,M):K;H=H.concat(u8(M,F,I,G,Q,U,J,Y))}}return H}async function iZ(Z,X,W,G,Q,U){let Y=U.dereference?.externalReferenceResolution==="root"?J0():G?W:X,H=e(Y,Z.$ref),K=Z2(H),V=Q._get$Ref(K);if(V)return Promise.resolve(V.value);try{let B=Z.$ref,F={url:H,baseUrl:Y};if(typeof B==="string")F.reference=B;let M=await _1(F,Q,U),I=Q._get$Ref(K),w=u8(M,K+"#",K,I?.dynamicIdScope??!1,Q,U,new Set,!0);return Promise.all(w)}catch(B){if(!U?.continueOnError||!x2(B))throw B;if(Q._$refs[K])B.source=decodeURI(Z2(X)),B.path=M1(P2(X));return[]}}var i4;var n4=c(()=>{_0();g0();V8();H2();N2();U0();i4=lZ});function nZ(Z,X){let W=Z.$refs._root$Ref.dynamicIdScope?U2(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,G=[];f8(Z,"schema",Z.$refs._root$Ref.path+"#",W,Z.$refs._root$Ref.dynamicIdScope,"#",0,G,Z.$refs,X);let Q=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(oZ(G,X,Q),(X.bundle||{}).optimizeInternalRefs!==!1)aZ(G,Z.schema)}function f8(Z,X,W,G,Q,U,J,Y,H,K){let V=X===null?Z:Z[X],B=K.bundle||{},F=B.excludedPathMatcher||(()=>!1);if(V&&typeof V==="object"&&!ArrayBuffer.isView(V)&&!F(U)){let M=G;if(a.isAllowed$Ref(V))o4(Z,X,W,M,Q,U,J,Y,H,K);else{let I=Object.keys(V).sort((w,$)=>{if(w==="definitions"||w==="$defs")return-1;else if($==="definitions"||$==="$defs")return 1;else return w.length-$.length});for(let w of I){let $=B2.join(W,w),A=B2.join(U,w),C=V[w],v=Q&&C&&typeof C==="object"&&!ArrayBuffer.isView(C)?U2(M,C):M;if(a.isAllowed$Ref(C))o4(V,w,$,v,Q,A,J,Y,H,K);else f8(V,w,$,v,Q,A,J,Y,H,K);if(C&&typeof C==="object"&&!Array.isArray(C)){if("$ref"in C)B?.onBundle?.(C.$ref,V[w],V,w)}}}}}function o4(Z,X,W,G,Q,U,J,Y,H,K){let V=X===null?Z:Z[X],B=e(Q?G:W,V.$ref),F=H._resolve(B,U,K);if(F===null)return;let I=B2.parse(U).length,w=Z2(F.path),$=P2(F.path),A=w!==H._root$Ref.path&&!H._aliases[w],C=Boolean(H._aliases[w])&&F.$ref.value!==H._root$Ref.value,v=a.isExtended$Ref(V);J+=F.indirections;let m=rZ(Y,Z,X);if(m)if(I<m.depth||J<m.indirections)sZ(Y,m);else return;if(Y.push({$ref:V,parent:Z,key:X,pathFromRoot:U,depth:I,file:w,hash:$,value:F.value,circular:F.circular,extended:v,external:A,nestedResource:C,indirections:J}),!m||A)f8(F.value,null,F.path,F.$ref.path,F.$ref.dynamicIdScope,U,J+1,Y,H,K)}function oZ(Z,X,W){Z.sort((J,Y)=>{if(J.file!==Y.file)return J.file<Y.file?-1:1;else if(J.hash!==Y.hash)return J.hash<Y.hash?-1:1;else if(J.circular!==Y.circular)return J.circular?-1:1;else if(J.extended!==Y.extended)return J.extended?1:-1;else if(J.indirections!==Y.indirections)return J.indirections-Y.indirections;else if(J.depth!==Y.depth)return J.depth-Y.depth;else{let H=Math.max(J.pathFromRoot.lastIndexOf("/definitions"),J.pathFromRoot.lastIndexOf("/$defs")),K=Math.max(Y.pathFromRoot.lastIndexOf("/definitions"),Y.pathFromRoot.lastIndexOf("/$defs"));if(H!==K)return K-H;else return J.pathFromRoot.length-Y.pathFromRoot.length}});let G,Q,U;for(let J of Z){let Y=X.bundle||{};if(!J.external){if(Y.optimizeInternalRefs!==!1&&!J.nestedResource)J.$ref.$ref=J.hash}else if(J.file===G&&J.hash===Q)if(W&&r4(Z,J))J.$ref.$ref=W+U;else J.$ref.$ref=U;else if(J.file===G&&J.hash.indexOf(Q+"/")===0){let H=B2.join(U,B2.parse(J.hash.replace(Q,"#")));if(W&&r4(Z,J))J.$ref.$ref=W+H;else J.$ref.$ref=H}else if(G=J.file,Q=J.hash,U=J.pathFromRoot,J.$ref=J.parent[J.key]=a.dereference(J.$ref,J.value,X),J.circular)J.$ref.$ref=J.pathFromRoot}}function rZ(Z,X,W){for(let G of Z)if(G&&G.parent===X&&G.key===W)return G;return}function sZ(Z,X){let W=Z.indexOf(X);Z.splice(W,1)}function aZ(Z,X){for(let W of Z){if(!W.$ref||typeof W.$ref!=="object"||!("$ref"in W.$ref))continue;let G=W.$ref.$ref;if(typeof G!=="string"||!G.startsWith("#/"))continue;let Q=tZ(X,G);if(Q!==G)W.$ref.$ref=Q}}function tZ(Z,X){if(!X.startsWith("#/"))return X;let W=X.slice(2).split("/"),G=Z,Q=[];for(let J of W){if(G===null||G===void 0||typeof G!=="object")return X;if("$ref"in G&&typeof G.$ref==="string"&&G.$ref.startsWith("#/")){let K=G.$ref.slice(2).split("/");if(Q.length=0,Q.push(...K),G=eZ(Z,G.$ref),G===null||G===void 0||typeof G!=="object")return X}let Y=J.replace(/~1/g,"/").replace(/~0/g,"~"),H=Array.isArray(G)?parseInt(Y):Y;G=G[H],Q.push(J)}return"#/"+Q.join("/")}function eZ(Z,X){if(!X.startsWith("#/"))return;let W=X.slice(2).split("/"),G=Z;for(let Q of W){if(G===null||G===void 0||typeof G!=="object")return;let U=Q.replace(/~1/g,"/").replace(/~0/g,"~"),J=Array.isArray(G)?parseInt(U):U;G=G[J]}return G}function r4(Z,X){for(let W of Z){if(W.pathFromRoot==="#"||W.pathFromRoot==="#/")continue;if(X.pathFromRoot.startsWith(W.pathFromRoot+"/")){if(W.value&&typeof W.value==="object"&&"$id"in W.value)return!0}}return!1}var s4;var a4=c(()=>{_0();g0();H2();U0();s4=nZ});function Z7(Z,X){let W=Date.now(),G=Z.$refs._root$Ref.dynamicIdScope?U2(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=c8(Z.schema,Z.$refs._root$Ref.path,G,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,X,W,0);Z.$refs.circular=Q.circular,Z.schema=Q.value}function c8(Z,X,W,G,Q,U,J,Y,H,K,V,B){let F,M={value:Z,circular:!1};e4(V,K);let I=K.dereference||{},w=I.maxDepth??500;if(B>w)throw RangeError(`Maximum dereference depth (${w}) exceeded at ${Q}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let $=I.excludedPathMatcher||(()=>!1);if(I?.circular==="ignore"||!J.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!$(Q)){U.add(Z),J.add(Z);let A=W;if(a.isAllowed$Ref(Z,K))F=t4(Z,X,A,G,Q,U,J,Y,H,K,V,B),M.circular=F.circular,M.value=F.value;else for(let C of Object.keys(Z)){e4(V,K);let v=B2.join(X,C),m=B2.join(Q,C);if($(m))continue;let f=Z[C],X2=G&&f&&typeof f==="object"&&!ArrayBuffer.isView(f)?U2(A,f):A,u;if(a.isAllowed$Ref(f,K)){if(F=t4(f,v,X2,G,m,U,J,Y,H,K,V,B),u=F.circular,Z[C]!==F.value){let b=new Map;if(I?.preservedProperties){if(typeof Z[C]==="object"&&!Array.isArray(Z[C]))I?.preservedProperties.forEach((W2)=>{if(W2 in Z[C])b.set(W2,Z[C][W2])})}let o=F.value;if(I?.cloneReferences&&!u&&o&&typeof o==="object")o=structuredClone(o);if(Z[C]=o,I?.preservedProperties){if(b.size&&typeof Z[C]==="object"&&!Array.isArray(Z[C]))b.forEach((W2,k2)=>{Z[C][k2]=W2})}I?.onDereference?.(f.$ref,Z[C],Z,C)}}else if(!U.has(f)){if(F=c8(f,v,X2,G,m,U,J,Y,H,K,V,B+1),u=F.circular,Z[C]!==F.value)Z[C]=F.value}else u=j1(v,H,K);M.circular=M.circular||u}U.delete(Z)}}return M}function t4(Z,X,W,G,Q,U,J,Y,H,K,V,B){let I=a.isExternal$Ref(Z)&&K?.dereference?.externalReferenceResolution==="root"?J0():G?W:X,w=e(I,Z.$ref),$=Y.get(w);if($){if(!$.circular){let X2=Object.keys(Z);if(X2.length>1){let u={};for(let b of X2)if(b!=="$ref"&&!(b in $.value))u[b]=Z[b];return{circular:$.circular,value:Object.assign({},$.value,u)}}return $}if(typeof $.value==="object"&&"$ref"in $.value&&"$ref"in Z){if($.value.$ref===Z.$ref)return j1(X,H,K),$}else return j1(X,H,K),$}let A=H._resolve(w,X,K);if(A===null)return{circular:!1,value:null};let C=A.circular,v=C||A.chainCircular||U.has(A.value);if(v)j1(X,H,K);let m=a.dereference(Z,A.value,K);if(!v){let X2=c8(m,A.path,A.$ref.path,A.$ref.dynamicIdScope,Q,U,J,Y,H,K,V,B+1);v=X2.circular,m=X2.value}if(v&&!C&&K.dereference?.circular==="ignore")m=Z;if(C&&m!==Z)m.$ref=Q;let f={circular:v,value:m};if(Object.keys(Z).length===1)Y.set(w,f);return f}function e4(Z,X){if(X&&X.timeoutMs){if(Date.now()-Z>X.timeoutMs)throw new Q8(X.timeoutMs)}}function j1(Z,X,W){if(X.circular=!0,W?.dereference?.onCircular?.(Z),!W.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var Z6;var X6=c(()=>{_0();g0();H2();U0();N2();Z6=Z7});function X7(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(X){setTimeout(X,0)}}var d8;var z6=c(()=>{d8=X7()});function L2(Z,X){if(Z){X.then(function(W){d8(function(){Z(null,W)})},function(W){d8(function(){Z(W)})});return}else return X}var W6=c(()=>{z6()});class l2{schema=null;$refs=new y0;async parse(){let Z=u0(arguments),X;if(!Z.path&&!Z.schema){let G=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return L2(Z.callback,Promise.reject(G))}this.schema=null,this.$refs=new y0;let W="http";if(F1(Z.path))Z.path=b9(Z.path),W="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let G=A0(Z.schema.$id),Q=G.port??(G.protocol==="https:"?443:80);Z.path=`${G.protocol}//${G.hostname}:${Q}`}if(Z.path=e(J0(),Z.path),Z.schema&&typeof Z.schema==="object"){let G=this.$refs._add(Z.path);G.value=Z.schema,G.pathType=W,G.dynamicIdScope=A1(G.value),w1(this.$refs,G.path,G.value,G.pathType,G.dynamicIdScope),X=Promise.resolve(Z.schema)}else X=_1(Z.path,this.$refs,Z.options);try{let G=await X;if(G!==null&&typeof G==="object"&&!Buffer.isBuffer(G))return this.schema=G,L2(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,L2(Z.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||G}" is not a valid JSON Schema`)}catch(G){if(!Z.options.continueOnError||!x2(G))return L2(Z.callback,Promise.reject(G));if(this.$refs._$refs[Z2(Z.path)])this.$refs._$refs[Z2(Z.path)].addError(G);return L2(Z.callback,Promise.resolve(null))}}static parse(){let Z=new l2;return Z.parse.apply(Z,arguments)}async resolve(){let Z=u0(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await i4(this,Z.options),p8(this),L2(Z.callback,Promise.resolve(this.$refs))}catch(X){return L2(Z.callback,Promise.reject(X))}}static resolve(){let Z=new l2;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new l2;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=u0(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),s4(this,Z.options),p8(this),L2(Z.callback,Promise.resolve(this.schema))}catch(X){return L2(Z.callback,Promise.reject(X))}}static dereference(){let Z=new l2;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=u0(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),Z6(this,Z.options),p8(this),L2(Z.callback,Promise.resolve(this.schema))}catch(X){return L2(Z.callback,Promise.reject(X))}}}function p8(Z){if(I0.getParserErrors(Z).length>0)throw new I0(Z)}var yX,mX,hX,Q6;var G6=c(()=>{f9();V8();l4();n4();a4();X6();H2();v8();m8();N2();W6();U0();h8();H2();yX=l2.parse,mX=l2.resolve,hX=l2.bundle,Q6=l2.dereference});async function l8(Z,X={}){let{baseUrl:W="/_jx/server"}=X,G=await Q6(Z),Q=N9(G);if(Q.length===0)return null;let U=Q.map(({exportName:Y,src:H})=>`import { ${Y} } from '${H}'`).join(`
|
|
58
|
+
`),J=Q.map(({exportName:Y})=>J6(Y,W)).join(`
|
|
57
59
|
`);return`// Generated by @jxsuite/compiler — do not edit manually
|
|
58
60
|
// Deploy as a Cloudflare Worker, Node server, or Bun process.
|
|
59
61
|
// Requires: npm install hono
|
|
60
62
|
|
|
61
63
|
import { Hono } from 'hono'
|
|
62
|
-
${
|
|
64
|
+
${U}
|
|
63
65
|
|
|
64
66
|
const app = new Hono()
|
|
65
|
-
${
|
|
67
|
+
${J}
|
|
66
68
|
|
|
67
69
|
export default app
|
|
68
|
-
`}function
|
|
69
|
-
`),
|
|
70
|
-
`),
|
|
70
|
+
`}function z7(Z,X={}){let{baseUrl:W="/_jx/server",adapter:G=null,mounts:Q=[],connectors:U=[]}=X;if(Z.length===0&&Q.length===0&&!G)return null;let J=Z.map(({exportName:V,src:B})=>`import { ${V} } from '${B}'`).join(`
|
|
71
|
+
`),Y=W7(Q,U),H=Z.map(({exportName:V})=>J6(V,W)).join(`
|
|
72
|
+
`),K=G==="cloudflare-workers"||G==="cloudflare-pages"?`
|
|
71
73
|
app.all('*', (c) => c.env.ASSETS.fetch(c.req.raw))
|
|
72
74
|
`:`
|
|
73
75
|
`;return`// Generated by @jxsuite/compiler — do not edit manually
|
|
74
76
|
import { Hono } from 'hono'
|
|
75
|
-
${
|
|
77
|
+
${J}${Y.imports}
|
|
76
78
|
|
|
77
79
|
const app = new Hono()
|
|
78
|
-
${
|
|
79
|
-
${
|
|
80
|
+
${Y.routes}${H}
|
|
81
|
+
${K}
|
|
80
82
|
export default app
|
|
81
|
-
`}function
|
|
83
|
+
`}function W7(Z,X){if(Z.length===0)return{imports:"",routes:""};let W=Z.toSorted((U,J)=>U.order-J.order),G=[];for(let U of W)G.push(`import { ${U.className} } from '${U.module}'`);for(let U of X)G.push(`import { ${U.className} } from '${U.module}'`);let Q=["// Extension server mounts (specs/extensions.md §11): one shared ctx, mounted in order.","const jxCtx = {}",`const jxConnectors = { ${X.map((U)=>`${JSON.stringify(U.provider)}: ${U.className}`).join(", ")} }`];for(let[U,J]of W.entries()){let Y=JSON.stringify(J.options);Q.push(`const jxMount${U} = await ${J.className}.mount({ ...${Y}, connectors: jxConnectors }, jxCtx)`,`app.all('${J.basePath}/*', (c) => jxMount${U}(c.req.raw, c.env))`,`app.all('${J.basePath}', (c) => jxMount${U}(c.req.raw, c.env))`)}return{imports:`
|
|
82
84
|
${G.join(`
|
|
83
85
|
`)}`,routes:`${Q.join(`
|
|
84
86
|
`)}
|
|
85
|
-
`}}function
|
|
87
|
+
`}}function J6(Z,X){return`
|
|
86
88
|
app.post('${X}/${Z}', async (c) => {
|
|
87
89
|
const args = await c.req.json().catch(() => ({}))
|
|
88
90
|
try {
|
|
@@ -90,7 +92,7 @@ app.post('${X}/${Z}', async (c) => {
|
|
|
90
92
|
} catch (e) {
|
|
91
93
|
return c.json({ ok: false, error: e?.message ?? 'Server error' }, 500)
|
|
92
94
|
}
|
|
93
|
-
})`}var
|
|
95
|
+
})`}var i8=c(()=>{G6();G0()});function Q7(Z){return Z instanceof Error?Z.message:String(Z)}function n8(Z,X,W){let G;try{G=JSON.parse(Z)}catch(Q){throw Error(`Failed to parse ${W} at ${X}: ${Q7(Q)}`,{cause:Q})}if(!$2(G))throw Error(`Invalid ${W} at ${X}: expected a JSON object`);return G}function C1(Z,X){return n8(Z,X,"Jx document")}function lX(Z,X){return n8(Z,X,"project config")}function iX(Z,X){return n8(Z,X,"class definition")}var o8=c(()=>{r2()});class R1{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;project;server;connector;capabilities;#X;#Z=null;constructor(Z,X,W,G){this.name=Z,this.classPath=X,this.classDef=W,this.#X=G;let{format:Q}=W;this.extensions=(Q?.extensions??[]).map((U)=>U.toLowerCase()),this.mediaType=Q?.mediaType??null,this.documentKinds=Q?.documentKinds??[],this.exportTarget=Q?.exportTarget===!0,this.remote=Q?.remote===!0,this.studio=W.$studio??null,this.project=W.project??null,this.server=W.server??null,this.connector=W.connector??null,this.capabilities=J7(W)}implementation(){if(!this.#Z){let Z=this.classDef.$implementation;if(!Z)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#Z=this.#X.importModule(this.#X.resolvePath(this.classPath,Z))}return this.#Z}async call(Z,...X){let W=this.capabilities[Z];if(!W)throw Error(`Format class "${this.name}" does not declare a "${Z}" capability`);let G=await this.implementation(),Q=this.classDef.title??this.name,U=G[Q]??G.default?.[Q]??G.default,J=U?.[W.identifier];if(typeof J!=="function")throw TypeError(`Format class "${this.name}": implementation export "${Q}" has no static "${W.identifier}" method`);return await J.call(U,...X)}}class P1{#X;constructor(Z){this.#X=Z;for(let X of Y6){let W=new Map;for(let G of Z){if(!G.capabilities[X])continue;for(let Q of G.extensions){let U=W.get(Q);if(U)throw Error(`Format conflict: "${U.name}" and "${G.name}" both claim "${Q}" with the "${X}" capability`);W.set(Q,G)}}}}get entries(){return this.#X}byExtension(Z,X){let W=U6(Z);return this.#X.find((G)=>G.extensions.includes(W)&&(!X||G.capabilities[X]))}byName(Z){return this.#X.find((X)=>X.name===Z)}withCapability(Z){return this.#X.filter((X)=>X.capabilities[Z])}documentExtensions(Z){let X=new Set;for(let W of this.#X){if(Z&&!W.documentKinds.includes(Z))continue;for(let G of W.extensions)X.add(G)}return X.delete(".json"),[...X]}has(Z){let X=U6(Z);return this.#X.some((W)=>W.extensions.includes(X))}}function J7(Z){let X={},W=Z.$defs?.methods??{};for(let[G,Q]of Object.entries(W)){let U=Q.role;if(!U||!K6.includes(U))continue;let J={identifier:Q.identifier??G,timing:Q.timing??G7};if(typeof Q.discriminator==="string")J.discriminator=Q.discriminator;X[U]=J}return X}function U6(Z){let X=Z.toLowerCase();return X.startsWith(".")?X:`.${X}`}var Y6,K6,G7;var r8=c(()=>{Y6=["parse","serialize","discover","load"],K6=[...Y6,"projectData","resolvePaths","lower","emit","assets","mount","dialect","deploySchema","bindings","testConnection"],G7=["compiler","server"]});class V6{#X;#Z;#z;constructor(Z){this.#X=Z,this.#Z=Z.flatMap((Q)=>Q.classes);let X=new Map;for(let Q of Z)for(let U of Q.classes){let J=X.get(U.name);if(J&&J!==Q.specifier)throw Error(`Extension conflict: "${J}" and "${Q.specifier}" both provide a class named "${U.name}"`);X.set(U.name,Q.specifier)}let W=new Map;for(let Q of this.#Z){if(!Q.project)continue;let U=W.get(Q.project.key);if(U)throw Error(`Extension conflict: "${U.name}" and "${Q.name}" both claim the project section "${Q.project.key}"`);W.set(Q.project.key,Q)}let G=new Map;for(let Q of this.#Z){if(!Q.server)continue;let{basePath:U}=Q.server;if(!U.startsWith("/_jx/"))throw Error(`Extension "${Q.name}": server basePath "${U}" must be under /_jx/`);let J=G.get(U);if(J)throw Error(`Extension conflict: "${J.name}" and "${Q.name}" both mount "${U}"`);G.set(U,Q)}this.#z=new P1(this.#Z.filter((Q)=>Q.extensions.length>0))}get extensions(){return this.#X}get classes(){return this.#Z}get formats(){return this.#z}byName(Z){return this.#Z.find((X)=>X.name===Z)}projectContributions(){return this.#Z.filter((Z)=>Z.project!==null)}byProjectKey(Z){return this.#Z.find((X)=>X.project?.key===Z)}byPathsDiscriminator(Z){return this.#Z.find((X)=>X.capabilities.resolvePaths?.discriminator===Z)}emitters(){return this.#Z.filter((Z)=>Z.capabilities.emit!==void 0)}assetProviders(){return this.#Z.filter((Z)=>Z.capabilities.assets!==void 0)}serverMounts(){return this.#Z.filter((Z)=>Z.server!==null).toSorted((Z,X)=>(Z.server?.order??100)-(X.server?.order??100)||Z.name.localeCompare(X.name))}connectors(){return this.#Z.filter((Z)=>Z.connector!==null)}schemaFragments(Z){return this.#X.map((X)=>X.schemas[Z]).filter((X)=>typeof X==="string")}}async function q6(Z,X,W){let G=[];for(let Q of Z??[])G.push(await U7(Q,X,W));return new V6(G)}async function U7(Z,X,W){let G;if(Z.startsWith("./")||Z.startsWith("../")){let Y=X.resolvePath(W,Z);G=X.resolvePath(`${Y}/package.json`,`./${E1}`)}else try{G=X.resolvePath(W,`${Z}/${E1}`)}catch(Y){throw Error(`Extension "${Z}" is not resolvable: it must export ${E1} (is the package installed, and does its exports map include it?): ${s8(Y)}`,{cause:Y})}let Q;try{Q=await X.loadJson(G)}catch(Y){throw Error(`Extension "${Z}": cannot read manifest ${G}: ${s8(Y)}`,{cause:Y})}if(!Q||typeof Q!=="object"||typeof Q.name!=="string")throw Error(`Extension "${Z}": ${E1} must declare a "name"`);if(!Z.startsWith(".")&&Q.name!==Z)throw Error(`Extension "${Z}": manifest name "${Q.name}" does not match the specifier`);let U=[];for(let[Y,H]of Object.entries(Q.classes??{})){let K=X.resolvePath(G,H),V;try{V=await X.loadJson(K)}catch(B){throw Error(`Extension "${Z}": cannot read class "${Y}" at ${K}: ${s8(B)}`,{cause:B})}U.push(new R1(Y,K,V,X))}let J={};if(Q.schemas?.project)J.project=X.resolvePath(G,Q.schemas.project);if(Q.schemas?.document)J.document=X.resolvePath(G,Q.schemas.document);if(Q.schemas?.fields)J.fields=X.resolvePath(G,Q.schemas.fields);return{specifier:Z,manifestPath:G,manifest:Q,classes:U,schemas:J}}function s8(Z){return Z instanceof Error?Z.message:String(Z)}var E1="jx-extension.json";var H6=c(()=>{r8();r8()});var t8={};J9(t8,{unknownFormatError:()=>B7,importImplementation:()=>M6,createNodeFormatIO:()=>$6,buildProjectFormatRegistry:()=>q7,buildProjectExtensionRegistry:()=>D6,buildExtensionsPayload:()=>H7});import{readFileSync as F6}from"node:fs";import{dirname as Y7,isAbsolute as K7,resolve as a8,sep as x1}from"node:path";import{pathToFileURL as V7}from"node:url";import{createRequire as B6}from"node:module";async function M6(Z){let X=[Z],W=`${x1}src${x1}`,G=`${x1}dist${x1}`;if(Z.includes(W))X.push(Z.replace(W,G));if(Z.endsWith(".js"))X.push(`${Z.slice(0,-3)}.ts`);let Q;for(let U of X)try{return await import(V7(U).href)}catch(J){Q=J}throw Q instanceof Error?Q:Error(String(Q))}function $6(Z){return{importModule:(X)=>M6(X),loadJson:async(X)=>JSON.parse(F6(X,"utf8")),resolvePath:(X,W)=>{if(W.startsWith("./")||W.startsWith("../"))return a8(Y7(X),W);if(K7(W))return W;let G=B6(a8(Z,"package.json"));try{return G.resolve(W)}catch{return B6(import.meta.url).resolve(W)}}}}async function D6(Z,X){return q6(X?.extensions,$6(Z),a8(Z,"project.json"))}async function q7(Z,X){return(await D6(Z,X)).formats}function H7(Z){let X=[];for(let W of Z.extensions){let G={};if(W.schemas.project)try{G=JSON.parse(F6(W.schemas.project,"utf8")).properties??{}}catch{G={}}let Q=[];for(let U of W.classes){if(!U.project)continue;Q.push({className:U.name,entrySchema:G[U.project.key]??null,project:U.project,studio:U.studio})}X.push({classes:W.classes.map((U)=>{let J=U.studio?.stateDefaults,Y=U.project===null&&U.server===null&&U.connector===null&&U.extensions.length===0;return{name:U.name,path:U.classPath,...Y?{state:!0}:{},...J&&typeof J==="object"?{stateDefaults:J}:{}}}),contributions:Q,name:W.manifest.name,specifier:W.specifier,...W.manifest.title===void 0?{}:{title:W.manifest.title},...W.manifest.description===void 0?{}:{description:W.manifest.description}})}return X}function B7(Z,X){return Error(`No format class registered for "${X}" (${Z}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`)}var e8=c(()=>{H6()});async function w6(Z,X={}){let{resolveElementPath:W,$media:G,formats:Q}=X,U=[],J=new Set;async function Y(H,K){let V,B;if(typeof H==="string"){let{readFileSync:m}=await import("node:fs"),{resolve:f}=await import("node:path");if(B=K?f(K,H):f(H),J.has(B))return;if(J.add(B),B.endsWith(".json"))V=C1(m(B,"utf8"),B);else{let{extname:X2}=await import("node:path"),u=X2(B).toLowerCase(),b=Q?.byExtension?.(u,"parse");if(!b){let{unknownFormatError:o}=await Promise.resolve().then(() => (e8(),t8));throw o(B,u)}V=await b.call("parse",m(B,"utf8"))}}else{if(V=H,B=null,V.tagName&&J.has(V.tagName))return;if(V.tagName)J.add(V.tagName)}let{tagName:F}=V;if(!F||!F.includes("-"))throw Error(`compileElement: tagName "${F}" must contain a hyphen`);let{dirname:M}=await import("node:path"),I=B?M(B):null,w=[];if(Array.isArray(V.$elements))for(let m of V.$elements){let f=V2(m)?m.$ref:m;if(typeof f!=="string")continue;if(I)await Y(f,I);let X2=W?W(f,I):f.replace(/\.json$/,".js");w.push(X2)}let $=H1(F);if(G)V.$media={...G,...V.$media};let{rewriteSrc:A}=X,C=f0(V,$,w,A?(m)=>A(m,I):void 0),v=B?B.replace(/\.json$/,".js"):`${F}.js`;U.push({content:C,path:v,tagName:F})}return await Y(Z,X.basePath??null),{files:U}}async function F7(Z,X={}){let{title:W="Jx App",reactivitySrc:G="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:Q="https://esm.sh/lit-html@3.3.0"}=X,U=await w6(Z,X),J=U.files.at(-1);if(!J)throw Error("compileElementPage: no element modules were produced");let{basename:Y}=await import("node:path"),H=Y(J.path),K=`<!DOCTYPE html>
|
|
94
96
|
<html lang="en">
|
|
95
97
|
<head>
|
|
96
98
|
<meta charset="utf-8">
|
|
@@ -106,55 +108,54 @@ app.post('${X}/${Z}', async (c) => {
|
|
|
106
108
|
</script>
|
|
107
109
|
</head>
|
|
108
110
|
<body>
|
|
109
|
-
<${
|
|
111
|
+
<${J.tagName}></${J.tagName}>
|
|
110
112
|
<script type="module" src="./${H}"></script>
|
|
111
113
|
</body>
|
|
112
|
-
</html>`;return{files:
|
|
113
|
-
`)}function
|
|
114
|
-
`)}function
|
|
115
|
-
${X} ${
|
|
116
|
-
${X} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(
|
|
117
|
-
${X}>`;let
|
|
118
|
-
${
|
|
119
|
-
\``)}
|
|
120
|
-
${
|
|
114
|
+
</html>`;return{files:U.files,html:K}}function M7(Z){if(Z===null||typeof Z!=="object"||Array.isArray(Z))return JSON.stringify(Z);if("default"in Z)return JSON.stringify(Z.default);if(o2(Z))return;if(Z.$prototype==="LocalStorage"||Z.$prototype==="SessionStorage")return JSON.stringify(Z.default??null);if(Z.$prototype==="Request")return"null";return JSON.stringify(Z)}function D7(Z){let X=new Set,W=new Set,G=(U)=>{if(typeof U==="string"&&U.startsWith("#/state/"))X.add(U.slice(8).split("/")[0])},Q=(U)=>{if(typeof U==="string"){for(let Y of U.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*\(/g))X.add(Y[1]);return}if(!U||typeof U!=="object"||W.has(U))return;if(W.add(U),Array.isArray(U)){for(let Y of U)Q(Y);return}let J=U;if(J.operator==="call"&&V2(J.target))G(J.target.$ref);for(let[Y,H]of Object.entries(J)){if(Y.startsWith("on")&&Y!=="observedAttributes"&&V2(H))G(H.$ref);Q(H)}};return Q(Z.children),Q(Z.state),X}function f0(Z,X,W,G){let Q=["// Generated by @jxsuite/compiler — do not edit manually"];if(Z.$id)Q.push(`// Source: ${Z.$id}`);for(let w of W)Q.push(`import '${w}';`);let U=new Map,J=Z.state??{};for(let[w,$]of Object.entries(J)){let A=$;if(A&&typeof A==="object"&&!Array.isArray(A)&&A.$prototype==="Function"&&A.$src){let C=A.$src;if(!U.has(C))U.set(C,[]);U.get(C).push(G1(w,A))}}for(let[w,$]of U){let A=G?G(w):w;Q.push(`import { ${$.join(", ")} } from '${A}';`)}let Y=Object.entries(J).filter(([,w])=>{let $=w;return Boolean($)&&typeof $==="object"&&!Array.isArray($)&&$.$prototype==="Request"});Q.push("import { reactive, computed, effect, stop } from '@vue/reactivity';","import { render, html } from 'lit-html';","",`class ${X} extends HTMLElement {`," #effects = [];",""," constructor() {"," super();");let H=[],K=[],V=[],B=[],F=D7(Z);for(let[w,$]of Object.entries(J)){let A=$;if(A2(A)){let C=A.$expression;if(z0(A))B.push([w,A]);else if(n2(C.operator))V.push([w,A]);else K.push([w,A])}else if(C2(A))if(A.$src&&typeof A.body!=="string")if(F.has(w)||$7.has(w))V.push([w,A]);else K.push([w,A]);else if(typeof A.body==="string"&&W0(A.body))K.push([w,A]);else V.push([w,A]);else{let C=M7(A);if(C!==void 0)H.push([w,C])}}Q.push(" this.state = reactive({");for(let[w,$]of H)Q.push(` ${w}: ${$},`);Q.push(" });");for(let[w,$]of V)if(Q.push(""),A2($)){let A=J2($.$expression,{eventParam:"e",statePrefix:"s"});Q.push(` this.state.${w} = (s, e) => { ${A}; };`)}else if(R2($)){let A=w2($.body,{dispatchTarget:"this",eventParam:"e",indent:" ",statePrefix:"this.state"});Q.push(` this.state.${w} = (s, e) => {`,A," };")}else{let A=$.parameters?f2($.parameters):$.arguments??["state"],C=A.join(", "),v=typeof $.body==="string"?$.body:"";if(A[0]==="state")if($.$src)Q.push(` this.state.${w} = (${C}) => ${w}(${C});`);else Q.push(` this.state.${w} = (${C}) => {`,` ${v}`," };");else{let m=A.map((f)=>f==="state"?"state":"e").join(", ");if($.$src)Q.push(` this.state.${w} = (state, e) => ${w}(${m});`);else Q.push(` this.state.${w} = (state, e) => {`,` const _fn = (${C}) => {`,` ${v}`," };",` return _fn(${m});`," };")}}for(let[w,$]of B){Q.push("");let A=J2($.$expression,{eventParam:"e",statePrefix:"this.state"});Q.push(` this.state.${w} = ${x0($,A)};`)}for(let[w,$]of K)if(Q.push(""),A2($)){let A=J2($.$expression,{eventParam:"e",statePrefix:"this.state"});Q.push(` this.state.${w} = computed(() => ${A});`)}else if($.$src)Q.push(` this.state.${w} = computed(() => ${w}(this.state));`);else{Q.push(` this.state.${w} = computed(() => {`);let A=(typeof $.body==="string"?$.body:"").replaceAll("state.","this.state.");Q.push(` ${A}`," });")}Q.push(" }","");let M=[];if(Array.isArray(Z.children)){let w={n:0};for(let $ of Z.children)$0($,M,Z.$media??{},"",w,Z.tagName)}Q.push(" template() {"," const s = this.state;"," return html`",S1(Z.children,Z.style," ")," `;"," }",""," 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 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 in this.state) {"," this.state[_k] = this.getAttribute(_n);"," this.removeAttribute(_n);"," }"," }"," for (const key of Object.keys(this.state)) {"," if (this.hasOwnProperty(key) && this[key] !== undefined) {"," this.state[key] = this[key];"," }"," }");for(let[w,$]of Y)Q.push(J1(w,$,{collect:"this.#effects",indent:" ",statePrefix:"this.state"}));if(Z.style&&typeof Z.style==="object"){let w=[];for(let[$,A]of Object.entries(Z.style)){if($.startsWith(":")||$.startsWith(".")||$.startsWith("&")||$.startsWith("[")||$.startsWith("@"))continue;if(A===null||typeof A==="object")continue;let C=q2($);if(typeof A==="string"&&A.includes("${"))w.push([C,A])}if(w.length>0){Q.push(" this.#effects.push(effect(() => {");for(let[$,A]of w){let C=A.replaceAll(/\$\{([^}]+)\}/g,(v,m)=>`\${${m.replaceAll("state.","this.state.")}}`);Q.push(` this.style['${$}'] = \`${C}\`;`)}Q.push(" }));")}}let I=_6(Z.children);if(I)Q.push(" const _slotted = Array.from(this.childNodes).filter(n => n.nodeType === 1 || (n.nodeType === 3 && n.textContent.trim()));");if(Q.push(" if (this.hasAttribute('data-jx-prerendered')) {"," this.removeAttribute('data-jx-prerendered');"," }"," this.innerHTML = '';"," this.#effects.push(effect(() => render(this.template(), this)));"),I)Q.push(" const _slot = this.querySelector('slot');"," if (_slot && _slotted.length > 0) {"," for (const n of _slotted) _slot.before(n);"," _slot.remove();"," }");return Q.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('${Z.tagName}', ${X});`,""),Q.join(`
|
|
115
|
+
`)}function S1(Z,X,W,G=!1,Q=!1){if(!Z)return"";if(K2(Z))return L6(Z,W);if(!Array.isArray(Z))return"";return Z.map((U)=>K2(U)?L6(U,W):I6(U,G?"":W,G,Q)).join(G?"":`
|
|
116
|
+
`)}function I6(Z,X,W=!1,G=!1){if(typeof Z==="string"){if(Z.includes("${"))return`${X}${Z9(Z)}`;return`${X}${p(Z)}`}if(typeof Z==="number"||typeof Z==="boolean")return`${X}${p(String(Z))}`;if(!Z||typeof Z!=="object")return"";let Q=Z.tagName??"div",U=W||Q0.has(Q),J=[];if(Z.attributes)for(let[F,M]of Object.entries(Z.attributes))if(M&&typeof M==="object"&&V2(M))J.push(`${F}="\${${S2(M.$ref)}}"`);else if(typeof M==="string"&&M.includes("${"))J.push(`${F}="${j2(M)}"`);else J.push(`${F}="${M}"`);if(Z.id)J.push(`id="${j2(String(Z.id))}"`);if(Z.className)J.push(`class="${j2(String(Z.className))}"`);for(let[F,M]of Object.entries(Z)){if(s2.has(F)||F.startsWith("$")||F.startsWith("on")||F==="tagName"||F==="id"||F==="className"||F==="style"||F==="children"||F==="textContent"||F==="innerHTML"||F==="attributes")continue;if(M&&typeof M==="object"&&M.$ref)J.push(`.${F}="\${${S2(M.$ref)}}"`);else if(typeof M==="string"&&M.includes("${"))J.push(`.${F}="${j2(M)}"`)}if(Z.$props)for(let[F,M]of Object.entries(Z.$props))if(M&&typeof M==="object"&&M.$ref)J.push(`.${F}="\${${S2(M.$ref)}}"`);else if(typeof M==="string"&&M.includes("${"))J.push(`.${F}="${j2(M)}"`);else J.push(`.${F}="\${${JSON.stringify(M)}}"`);let Y=G?"s.$map = $map; ":"";for(let[F,M]of Object.entries(Z)){if(!F.startsWith("on")||F==="observedAttributes")continue;let I=F.slice(2).toLowerCase();if(M&&typeof M==="object"&&M.$ref)J.push(Y?`@${I}="\${(e) => { ${Y}${S2(M.$ref)}(s, e); }}"`:`@${I}="\${(e) => ${S2(M.$ref)}(s, e)}"`);else if(M&&typeof M==="object"&&"$expression"in M){let w=J2(M.$expression,{eventParam:"e",statePrefix:"s"});J.push(`@${I}="\${(e) => { ${Y}${w}; }}"`)}else if(C2(M))J.push(`@${I}="\${(e) => { ${Y}${L7(M)} }}"`)}let H=O6(Z.style);if(H)J.push(`style="${H}"`);let K=J.length>0?`
|
|
117
|
+
${X} ${J.join(`
|
|
118
|
+
${X} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(Q))return`${X}<${Q}${K}
|
|
119
|
+
${X}>`;let B="";if(Z.$switch){let F=V2(Z.$switch)?Z.$switch.$ref:Z.$switch,M=S2(F),I=Z.cases??{},w=[];for(let[$,A]of Object.entries(I)){if(!A||V2(A))continue;let C=I6(A,`${X} `,!1,G);w.push(` ${JSON.stringify($)}: html\`
|
|
120
|
+
${C}
|
|
121
|
+
\``)}B=`\${{
|
|
122
|
+
${w.join(`,
|
|
121
123
|
`)}
|
|
122
|
-
}[${
|
|
123
|
-
${
|
|
124
|
-
${X}`;return
|
|
125
|
-
${X}>${
|
|
126
|
-
${X} ${
|
|
127
|
-
${X} `)}`:"",H="";if(G.textContent!==void 0)H=
|
|
128
|
-
${
|
|
129
|
-
${X} `;
|
|
130
|
-
${X} <${Q}${
|
|
124
|
+
}[${M}]}`}else if(Z.textContent!==void 0)B=Z9(Z.textContent);else if(Z.innerHTML!==void 0)B=Z.innerHTML;else if(Z.children)B=U?S1(Z.children,Z.style,"",!0,G):`
|
|
125
|
+
${S1(Z.children,Z.style,`${X} `,!1,G)}
|
|
126
|
+
${X}`;return U?`<${Q}${K}>${B}</${Q}>`:`${X}<${Q}${K}
|
|
127
|
+
${X}>${B}</${Q}>`}function L6(Z,X){let W=V2(Z.items)?S2(Z.items.$ref):"ITEMS",G=Z.map;if(!G)return"";let Q=G.tagName??"div",U=[];if(G.attributes)for(let[B,F]of Object.entries(G.attributes))if(F&&typeof F==="object"&&V2(F))U.push(`${B}="\${${A6(F.$ref)}}"`);else if(typeof F==="string"&&F.includes("${"))U.push(`${B}="${j2(F)}"`);else U.push(`${B}="${F}"`);if(G.id)U.push(`id="${j2(String(G.id))}"`);if(G.className)U.push(`class="${j2(String(G.className))}"`);if(G.$props)for(let[B,F]of Object.entries(G.$props))if(V2(F))U.push(`.${B}="\${${A6(F.$ref)}}"`);else if(typeof F==="string"&&F.includes("${"))U.push(`.${B}="${j2(F)}"`);else U.push(`.${B}="\${${JSON.stringify(F)}}"`);let J=O6(G.style);if(J)U.push(`style="${J}"`);for(let[B,F]of Object.entries(G)){if(!B.startsWith("on"))continue;let M=B.slice(2).toLowerCase();if(V2(F))U.push(`@${M}="\${(e) => { s.$map = $map; ${S2(F.$ref)}(s, e); }}"`);else if(A2(F)){let I=J2(F.$expression,{eventParam:"e",statePrefix:"s"});U.push(`@${M}="\${(e) => { s.$map = $map; ${I}; }}"`)}}let Y=U.length>0?`
|
|
128
|
+
${X} ${U.join(`
|
|
129
|
+
${X} `)}`:"",H="";if(G.textContent!==void 0)H=Z9(G.textContent);else if(G.children)H=`
|
|
130
|
+
${S1(G.children,null,`${X} `,!1,!0)}
|
|
131
|
+
${X} `;let K=`html\`
|
|
132
|
+
${X} <${Q}${Y}
|
|
131
133
|
${X} >${H}</${Q}>
|
|
132
|
-
${X}
|
|
134
|
+
${X}\``,V=K.includes("$map")?`(item, index) => { const $map = { item, index }; return ${K}; }`:`(item, index) => ${K}`;return`${X}\${${W}.map(${V})}`}function S2(Z){if(Z.startsWith("#/state/"))return`s.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return`s.${Z}`}function A6(Z){if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return S2(Z)}function j2(Z){return Z.replaceAll("state.","s.")}function Z9(Z){if(Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string")return`\${${S2(Z.$ref)}}`;if(typeof Z==="string"&&Z.includes("${"))return j2(Z);return String(Z)}function L7(Z){if(R2(Z))return w2(Z.body,{dispatchTarget:"e.currentTarget",eventParam:"e",statePrefix:"s"});let X=typeof Z.body==="string"?Z.body:"",W=Z.parameters?f2(Z.parameters):Z.arguments??[];if(W.length>0){let G=W.map((Q)=>Q==="state"?"s":"e").join(", ");return`((${W.join(", ")}) => { ${X} })(${G});`}return X.replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function O6(Z){if(!Z||typeof Z!=="object")return"";let X=[];for(let[W,G]of Object.entries(Z)){if(W.startsWith(":")||W.startsWith(".")||W.startsWith("&")||W.startsWith("[")||W.startsWith("@"))continue;if(G===null||typeof G==="object")continue;if(typeof G==="string"&&G.includes("${")){let Q=q2(W);X.push(`${Q}: ${j2(G)}`)}}return X.join("; ")}function _6(Z){if(!Array.isArray(Z))return!1;for(let X of Z){if(!X||typeof X!=="object")continue;if(X.tagName==="slot")return!0;if(_6(X.children))return!0}return!1}var $7;var k1=c(()=>{E0();G0();r2();o8();$7=new Set(["onMount","onUnmount","onAdopted"])});function N6(Z,X){let{title:W="Jx App",reactivitySrc:G,litHtmlSrc:Q}=X,U=D0(Z,null,Z.state??{},Z.$media??{}),J=L0(Z,Z.$media??{},X.projectStyle??null),Y=[],H=T6(Z,!1,Z,U,Y),K=[],V="",B="";if(Y.length>0){for(let I of Y){let w=f0(I.def,I.className,[],X.rewriteSrc);K.push({content:w,path:`_islands/${I.tagName}.js`,tagName:I.tagName})}V=`<script type="importmap">
|
|
133
135
|
{
|
|
134
136
|
"imports": {
|
|
135
137
|
"@vue/reactivity": "${G}",
|
|
136
138
|
"lit-html": "${Q}"
|
|
137
139
|
}
|
|
138
140
|
}
|
|
139
|
-
</script>`,B=
|
|
140
|
-
`)}let
|
|
141
|
-
`:"",
|
|
141
|
+
</script>`,B=K.map((I)=>`<script type="module" src="./${I.path}"></script>`).join(`
|
|
142
|
+
`)}let F=X.prePaintScheme!==!1&&Object.values(Z.$media??{}).some((I)=>a2(String(I))!==null)?`<script>${V1()}</script>
|
|
143
|
+
`:"",M=`<!DOCTYPE html>
|
|
142
144
|
<html lang="en">
|
|
143
145
|
<head>
|
|
144
146
|
<meta charset="utf-8">
|
|
145
147
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
146
148
|
<title>${p(W)}</title>
|
|
147
|
-
${
|
|
148
|
-
${
|
|
149
|
+
${F}${V}
|
|
150
|
+
${J}
|
|
149
151
|
</head>
|
|
150
152
|
<body>
|
|
151
153
|
${H}
|
|
152
154
|
${B}
|
|
153
155
|
</body>
|
|
154
|
-
</html>`;return{files:
|
|
155
|
-
`)}return""}var A6=c(()=>{X0();C1()});function a8(Z,X){let{title:W="Jx App",reactivitySrc:G=X1,litHtmlSrc:Q=z1,modulePath:J="app.js"}=X,U=B0(Z,null,Z.state??{},Z.$media??{}),K=M0(Z,Z.$media??{},X.projectStyle??null),H={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},Y=new Map,q=new Map,B=[],M=[],F=[],D=[],w=[],A=new Map,C=Z.state??{};for(let[u,b]of Object.entries(C)){if(b===null||typeof b!=="object"||Array.isArray(b)){if(typeof b==="string"&&i(b))M.push([u,`() => \`${b}\``]);else B.push([u,b]);continue}if(L2(b)){let o=b.$expression,W2=J2(o,{eventParam:"e",statePrefix:"state"});if(Z0(b))w.push(`state[${JSON.stringify(u)}] = ${R0(b,W2)};`);else if(l2(o.operator))D.push([u,{args:["state","e"],body:W2}]);else M.push([u,`() => ${W2}`]);continue}if(j2(b)){let o=b.parameters?n2(b.parameters):b.arguments;if(C2(b)){let W2=A2(b.body,{eventParam:"e",statePrefix:"state"});if(b.parameters&&b.parameters.length>0)w.push(`state[${JSON.stringify(u)}] = ${R0(b,`(() => {
|
|
156
|
+
</html>`;return{files:K,html:M}}function T6(Z,X,W,G,Q){if(typeof Z==="string")return p(Z);if(typeof Z==="number"||typeof Z==="boolean")return p(String(Z));if(!Z||typeof Z!=="object")return"";let U=D0(W,G.scope,W?.state??G.scopeDefs,W?.$media??G.media);if(X){let V=Q.length,B=`jx-island-${V}`,F=`JxIsland${V}`,M={...W??Z,tagName:B};return Q.push({className:F,def:M,tagName:B}),`<${B}></${B}>`}let J=Z.tagName??"div",Y=M0(Z,U.scope);if(z8.has(J))return`<${J}${Y}>`;let H=G.preformatted===!0||Q0.has(J),K=A7(Z,W,{...U,preformatted:H},Q);return`<${J}${Y}>${K}</${J}>`}function A7(Z,X,W,G){let Q=X??Z;if(Q.textContent!==void 0){let U=z2(Q.textContent,W.scope);return U==null?"":p(String(U))}if(Q.innerHTML)return z2(Q.innerHTML,W.scope)??Q.innerHTML;if(Array.isArray(Q.children)){let U=Array.isArray(X?.children)?X.children:void 0;return Q.children.map((J,Y)=>{let H=J,K=A9(H),V=U?.[Y]??J;return T6(H,K,V,W,G)}).join(S0(W.preformatted))}return""}var j6=c(()=>{G0();k1()});function z9(Z,X){let{title:W="Jx App",reactivitySrc:G=U1,litHtmlSrc:Q=Y1,modulePath:U="app.js"}=X,J=D0(Z,null,Z.state??{},Z.$media??{}),Y=L0(Z,Z.$media??{},X.projectStyle??null),H={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},K=new Map,V=new Map,B=[],F=[],M=[],I=[],w=[],$=new Map,A=Z.state??{};for(let[u,b]of Object.entries(A)){if(b===null||typeof b!=="object"||Array.isArray(b)){if(typeof b==="string"&&l(b))F.push([u,`() => \`${b}\``]);else B.push([u,b]);continue}if(A2(b)){let o=b.$expression,W2=J2(o,{eventParam:"e",statePrefix:"state"});if(z0(b))w.push(`state[${JSON.stringify(u)}] = ${x0(b,W2)};`);else if(n2(o.operator))I.push([u,{args:["state","e"],body:W2}]);else F.push([u,`() => ${W2}`]);continue}if(C2(b)){let o=b.parameters?f2(b.parameters):b.arguments;if(R2(b)){let W2=w2(b.body,{eventParam:"e",statePrefix:"state"});if(b.parameters&&b.parameters.length>0)w.push(`state[${JSON.stringify(u)}] = ${x0(b,`(() => {
|
|
156
157
|
${W2}
|
|
157
|
-
})()`)};`);else
|
|
158
|
+
})()`)};`);else I.push([u,{args:["state","e"],body:W2}])}else if(b.$src){if(!$.has(b.$src))$.set(b.$src,new Set);$.get(b.$src).add(G1(u,b)),F.push([u,`() => { return ${u}(state); }`])}else if(typeof b.body==="string"&&W0(b.body))F.push([u,`() => { ${b.body} }`]);else I.push([u,{args:o??["state"],body:b.body}]);continue}if(o2(b))continue;if(F9(b)){B.push([u,b.default]);continue}if(B0(b)){if(b.$prototype==="LocalStorage"||b.$prototype==="SessionStorage"){let o=b.$prototype==="LocalStorage"?"localStorage":"sessionStorage",W2=b.key??u,k2=b.default??null;B.push([u,null]),w.push(I7(u,o,W2,k2));continue}if(b.$prototype==="Request"){B.push([u,null]),w.push(J1(u,b));continue}if(b.$prototype==="Cookie"){B.push([u,null]),w.push(O7(u,b.name??u,b.default??null));continue}}B.push([u,b])}let C=C6(Z,Z,J,K,V,H);for(let[u,b]of K)if(!M.some(([o])=>o===u))M.push([u,b]);for(let[u,b]of V)if(!I.some(([o])=>o===u))I.push([u,b]);let v=w7(B,F,M,I,w,$,H,G,X.rewriteSrc),m=[` "@vue/reactivity": "${G}"`,` "lit-html": "${Q}"`],f=X.prePaintScheme!==!1&&Object.values(Z.$media??{}).some((u)=>a2(String(u))!==null)?`<script>${V1()}</script>
|
|
158
159
|
`:"",X2=`<!DOCTYPE html>
|
|
159
160
|
<html lang="en">
|
|
160
161
|
<head>
|
|
@@ -164,33 +165,30 @@ ${W2}
|
|
|
164
165
|
${f}<script type="importmap">
|
|
165
166
|
{
|
|
166
167
|
"imports": {
|
|
167
|
-
${
|
|
168
|
+
${m.join(`,
|
|
168
169
|
`)}
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
172
|
</script>
|
|
172
|
-
${
|
|
173
|
-
<script type="module" src="./${
|
|
173
|
+
${Y}
|
|
174
|
+
<script type="module" src="./${U}"></script>
|
|
174
175
|
</head>
|
|
175
176
|
<body>
|
|
176
|
-
${
|
|
177
|
+
${C}
|
|
177
178
|
</body>
|
|
178
|
-
</html>`;return{files:[{content:
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
${
|
|
184
|
-
`;else if(Array.isArray(Z.children))G=`
|
|
185
|
-
${Z.children.map((J)=>w6(J)).join(`
|
|
179
|
+
</html>`;return{files:[{content:v,path:U}],html:X2}}function C6(Z,X,W,G,Q,U){if(typeof Z==="string")return p(Z);if(typeof Z==="number"||typeof Z==="boolean")return p(String(Z));if(!Z||typeof Z!=="object")return"";let J=D0(X,W.scope,X?.state??W.scopeDefs,X?.$media??W.media),Y=Z.tagName??"div";J.preformatted=W.preformatted===!0||Q0.has(Y);let H=[],K=!1;if(Z.textContent!==void 0){let $=X?.textContent??Z.textContent;if(O2($)){let A=Z0($.$ref);H.push(`:text-content="${A}"`),X9(G,A,$.$ref),K=!0}else if(l($)){let A=`_t${U.t}`;U.t+=1,H.push(`:text-content="${A}"`),G.set(A,`() => \`${$}\``),K=!0}}for(let[$,A]of Object.entries(Z)){if(!$.startsWith("on")||$==="observedAttributes")continue;let C=$.slice(2).toLowerCase();if(O2(A)){let v=Z0(A.$ref);H.push(`@${C}="${v}"`),K=!0}else if(R2(A)){let v=`_h${U.h}`;U.h+=1,H.push(`@${C}="${v}"`),Q.set(v,{args:["state","e"],body:w2(A.body,{eventParam:"e",statePrefix:"state"})}),K=!0}else if(C2(A)){let v=`_h${U.h}`;U.h+=1,H.push(`@${C}="${v}"`),Q.set(v,{args:A.parameters?f2(A.parameters):A.arguments??["state","event"],body:A.body}),K=!0}else if(A2(A)){let v=`_h${U.h}`;U.h+=1,H.push(`@${C}="${v}"`);let m=J2(A.$expression,{eventParam:"e",statePrefix:"state"});Q.set(v,{args:["state","e"],body:m}),K=!0}}if(Z.style&&typeof Z.style==="object")for(let[$,A]of Object.entries(Z.style)){if($.startsWith(":")||$.startsWith(".")||$.startsWith("&")||$.startsWith("[")||$.startsWith("@"))continue;if(A===null||typeof A==="object")continue;if(l(A)){let C=`_s${U.s}`;U.s+=1,H.push(`:style.${q2($)}="${C}"`),G.set(C,`() => \`${A}\``),K=!0}}if(Z.attributes&&typeof Z.attributes==="object"){for(let[$,A]of Object.entries(Z.attributes))if(O2(A)){let C=Z0(A.$ref);H.push(`:attr.${$}="${C}"`),X9(G,C,A.$ref),K=!0}else if(l(A)){let C=`_t${U.t}`;U.t+=1,H.push(`:attr.${$}="${C}"`),G.set(C,`() => \`${A}\``),K=!0}}for(let[$,A]of Object.entries(Z)){if(s2.has($)||$.startsWith("on")||$.startsWith("$")||$==="tagName"||$==="id"||$==="className"||$==="style"||$==="children"||$==="textContent"||$==="innerHTML"||$==="attributes")continue;if(O2(A)){let C=Z0(A.$ref);H.push(`:${q2($)}="${C}"`),X9(G,C,A.$ref),K=!0}else if(l(A)){let C=`_t${U.t}`;U.t+=1,H.push(`:${q2($)}="${C}"`),G.set(C,`() => \`${A}\``),K=!0}}let V=M0(Z,J.scope),B=K?" data-bind":"",F=H.length>0?` ${H.join(" ")}`:"",M="",I=X??Z;if(I.textContent!==void 0&&!K){let $=z2(I.textContent,J.scope);M=$==null?"":p(String($))}else if(I.textContent!==void 0&&K){let $=z2(I.textContent,J.scope);M=$==null?"":p(String($))}else if(I.innerHTML)M=z2(I.innerHTML,J.scope)??I.innerHTML;else if(K2(I.children)){U.needsLit=!0;let $=`_list${U.l}`;U.l+=1;let A=I.children,C;if(O2(A.items))C=`state.${Z0(A.items.$ref)}`;else C=JSON.stringify(A.items);let v=W9(A.map);G.set($,`() => (${C} ?? []).map((item, index) => html\`${v}\`)`),H.push(`:render="${$}"`),K=!0;let m=" data-bind",f=` ${H.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${V}${m}${f}>`;return`<${Y}${V}${m}${f}></${Y}>`}else if(Array.isArray(I.children)&&I.children.some(($)=>K2($))){U.needsLit=!0;let $=`_children${U.l}`;U.l+=1;let A=I.children.map((v)=>R6(v,J.preformatted)).join(S0(J.preformatted," "));G.set($,J.preformatted?`() => html\`${A}\``:`() => html\`
|
|
180
|
+
${A}
|
|
181
|
+
\``),H.push(`:render="${$}"`),K=!0;let C=` ${H.join(" ")}`;return`<${Y}${V} data-bind${C}></${Y}>`}else if(Array.isArray(I.children)){let $=Array.isArray(X?.children)?X.children:void 0;M=I.children.map((A,C)=>{let v=$?.[C]??A;return C6(A,v,J,G,Q,U)}).join(S0(J.preformatted))}if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${V}${B}${F}>`;return`<${Y}${V}${B}${F}>${M}</${Y}>`}function W9(Z,X=!1){if(!Z)return"";let W=Z.tagName??"div",G=X||Q0.has(W),Q="";if(Z.id)Q+=` id="${Z.id}"`;if(Z.className)Q+=` class="${e2(Z.className)}"`;if(Z.$props&&typeof Z.$props==="object")for(let[Y,H]of Object.entries(Z.$props))if(O2(H))Q+=` .${Y}="\${${_7(H.$ref)}}"`;else if(typeof H==="string"&&l(H))Q+=` .${Y}="${e2(H)}"`;else Q+=` .${Y}="\${${JSON.stringify(H)}}"`;if(Z.attributes&&typeof Z.attributes==="object")for(let[Y,H]of Object.entries(Z.attributes))Q+=typeof H==="string"&&l(H)?` ${Y}="${e2(H)}"`:` ${Y}="${p(String(H))}"`;if(Z.style&&typeof Z.style==="object"){let Y=[];for(let[H,K]of Object.entries(Z.style)){if(H.startsWith(":")||H.startsWith(".")||H.startsWith("&")||H.startsWith("[")||H.startsWith("@"))continue;if(K===null||typeof K==="object")continue;let V=q2(H);if(l(String(K)))Y.push(`${V}: ${e2(String(K))}`);else Y.push(`${V}: ${K}`)}if(Y.length>0)Q+=` style="${Y.join("; ")}"`}for(let[Y,H]of Object.entries(Z)){if(!Y.startsWith("on")||Y==="observedAttributes")continue;let K=Y.slice(2).toLowerCase();if(O2(H)){let V=Z0(H.$ref);Q+=` @${K}=\${(e) => { state.$map = { item, index }; on.${V}(e); }}`}else if(R2(H)){let V=w2(H.body,{eventParam:"e",statePrefix:"state"});Q+=` @${K}=\${(e) => { state.$map = { item, index }; ${V} }}`}else if(H&&typeof H==="object"&&H.$prototype==="Function"){let V=e2(H.body);Q+=` @${K}=\${(e) => { ${V} }}`}else if(H&&typeof H==="object"&&"$expression"in H){let V=J2(H.$expression,{eventParam:"e",statePrefix:"state"});Q+=` @${K}=\${(e) => { state.$map = { item, index }; ${V}; }}`}}if(Z.contentEditable)Q+=` contenteditable="${Z.contentEditable}"`;let U="";if(Z.textContent!==void 0){let Y=String(Z.textContent);if(l(Y))U=e2(Y);else if(O2(Z.textContent))U=`\${state.${Z0(Z.textContent.$ref)}}`;else U=p(Y)}else if(Z.innerHTML)U=e2(String(Z.innerHTML));else if(K2(Z.children))U=`
|
|
182
|
+
${P6(Z.children)}
|
|
183
|
+
`;else if(Array.isArray(Z.children)){let Y=Z.children.map((H)=>R6(H,G));U=G?Y.join(""):`
|
|
184
|
+
${Y.join(`
|
|
186
185
|
`)}
|
|
187
|
-
|
|
188
|
-
`)}function
|
|
189
|
-
`)}function
|
|
190
|
-
`)}function
|
|
191
|
-
`)}function
|
|
192
|
-
`)}function
|
|
193
|
-
`):Z.body??"").includes("await ")}import{readFileSync as A7}from"node:fs";async function I7(Z,X={}){let{title:W="Jx App",reactivitySrc:G=X1,litHtmlSrc:Q=z1,projectStyle:J=null}=X,U;if(typeof Z==="string"){let K=A7(Z,"utf8");if(Z.endsWith(".json"))U=w1(K,Z);else{let{extname:H}=await import("node:path"),Y=H(Z).toLowerCase(),q=X.formats?.byExtension?.(Y,"parse");if(!q){let{unknownFormatError:B}=await Promise.resolve().then(() => (n8(),i8));throw B(Z,Y)}U=await q.call("parse",K)}}else U=Z;if(q9(U)){let{compileClassJson:K}=await Promise.resolve().then(() => _6),H=K(U,X),Y=typeof Z==="string"?Z.replace(/\.class\.json$/,".js"):`${U.title}.js`;return{files:[{content:H,path:Y}],html:""}}if(!W1(U))return D6(U,{litHtmlSrc:Q,projectStyle:J,reactivitySrc:G,...X.prePaintScheme===!1?{prePaintScheme:!1}:{},...X.rewriteSrc?{rewriteSrc:X.rewriteSrc}:{},title:W});if(U.tagName&&U.tagName.includes("-")){let{tagName:K}=U,H=J1(K),q={content:y0(U,H,[],X.rewriteSrc),path:`${K}.js`,tagName:K},B=M0(U,U.$media??{}),M=`<!DOCTYPE html>
|
|
186
|
+
`}if(new Set(["input","br","hr","img","meta","link"]).has(W))return`<${W}${Q}>`;return`<${W}${Q}>${U}</${W}>`}function R6(Z,X=!1){if(typeof Z==="string")return l(Z)?e2(Z):p(Z);if(typeof Z==="number"||typeof Z==="boolean")return p(String(Z));if(K2(Z))return P6(Z);return W9(Z,X)}function P6(Z){let{items:X}=Z,W=O2(X)?`state.${Z0(X.$ref)}`:JSON.stringify(X??[]),G=W9(Z.map);return`\${(${W} ?? []).map((item, index) => html\`${G}\`)}`}function e2(Z){return Z.replaceAll("$map.","")}function w7(Z,X,W,G,Q,U,J,Y,H){let K=[],{needsLit:V}=J,B=X.length>0;K.push("// Generated by @jxsuite/compiler — do not edit manually");let F=["reactive","effect"];if(B)F.push("computed");if(K.push(`import { ${F.join(", ")} } from '@vue/reactivity';`),V)K.push("import { html, render } from 'lit-html';");for(let[M,I]of U){let w=H?H(M):M;K.push(`import { ${[...I].join(", ")} } from '${w}';`)}K.push("","const state = reactive({");for(let[M,I]of Z)K.push(` ${M}: ${JSON.stringify(I)},`);if(K.push("});",""),Q.length>0){for(let M of Q)K.push(M);K.push("")}if(X.length>0){for(let[M,I]of X)K.push(`state.${M} = computed(${I});`);K.push("")}if(W.length>0){K.push("const bind = {");for(let[M,I]of W)K.push(` ${M}: ${I},`);K.push("};")}else K.push("const bind = {};");if(K.push(""),G.length>0){K.push("const on = {");for(let[M,I]of G){let w=I.args??["state"],$=w.map((A)=>A==="state"?"state":"e").join(", ");K.push(` ${M}: (e) => { const fn = (${w.join(", ")}) => { ${I.body} }; fn(${$}); },`)}K.push("};")}else K.push("const on = {};");if(K.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;"),V)K.push(" if (parts[0] === 'render') {"," effect(() => { render(bind[key](), el); });"," } else if (parts[0] === 'style' && parts.length > 1) {");else K.push(" if (parts[0] === 'style' && parts.length > 1) {");return K.push(" effect(() => { el.style[parts[1]] = bind[key](); });"," } else if (parts[0] === 'attr' && parts.length > 1) {"," effect(() => { el.setAttribute(parts[1], bind[key]()); });"," } 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);",""),K.join(`
|
|
187
|
+
`)}function I7(Z,X,W,G){return[`// ${Z}: ${X} (key: "${W}")`,"try {",` const _s = ${X}.getItem(${JSON.stringify(W)});`,` state.${Z} = _s !== null ? JSON.parse(_s) : ${JSON.stringify(G)};`,`} catch { state.${Z} = ${JSON.stringify(G)}; }`,"effect(() => {",` const v = state.${Z};`," try {",` if (v === null) ${X}.removeItem(${JSON.stringify(W)});`,` else ${X}.setItem(${JSON.stringify(W)}, JSON.stringify(v));`," } catch {}","});"].join(`
|
|
188
|
+
`)}function O7(Z,X,W){return[`// ${Z}: Cookie (name: "${X}")`,"{",` const _m = document.cookie.match(new RegExp("(?:^|; )${X}=([^;]*)"));`,` try { state.${Z} = _m ? JSON.parse(decodeURIComponent(_m[1])) : ${JSON.stringify(W)}; }`,` catch { state.${Z} = _m ? _m[1] : ${JSON.stringify(W)}; }`,"}"].join(`
|
|
189
|
+
`)}function _7(Z){if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");if(Z.startsWith("#/state/"))return`state.${Z.slice(8).replaceAll("/",".")}`;return`state.${Z.replaceAll("/",".")}`}function Z0(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replaceAll("/","_");return Z.replaceAll("/","_")}function X9(Z,X,W){if(Z.has(X))return;if(W.startsWith("#/state/")){let Q=W.slice(8).split("/");Z.set(X,`() => state.${Q.join(".")}`)}else Z.set(X,`() => state.${W}`)}var Q9=c(()=>{E0();G0();r2()});var x6={};J9(x6,{compileClassJson:()=>N7});function N7(Z,X={}){let W=Z.title;if(!W)throw Error("compileClassJson: missing title (class name)");let G=T7(Z.extends),Q=Z.$defs,U=Q?.fields??{},J=Q?.constructor,Y=typeof J==="object"?J:void 0,H=Q?.methods??{},K=["// Generated by @jxsuite/compiler from .class.json — do not edit manually"];if(Z.$id)K.push(`// Source: ${Z.$id}`);K.push("");let V=G!=="Object"?` extends ${G}`:"";K.push(`class ${W}${V} {`);for(let[B,F]of Object.entries(U)){if(F.scope!=="static")continue;let M=F.identifier??B,I=F.access==="private"?"#":"",w=F.initializer!==void 0?JSON.stringify(F.initializer):F.default!==void 0?JSON.stringify(F.default):"null";K.push(` static ${I}${M} = ${w};`)}for(let[B,F]of Object.entries(U)){if(F.scope==="static")continue;if(F.access!=="private")continue;let M=F.identifier??B;K.push(` #${M};`)}if(Object.keys(U).length>0)K.push("");if(K.push(" constructor(config = {}) {"),Y?.superCall||G!=="Object"){let B=Y?.superCall?.arguments?Y.superCall.arguments.join(", "):"";K.push(` super(${B});`)}for(let[B,F]of Object.entries(U)){if(F.scope==="static")continue;let M=F.identifier??B,I=F.access==="private"?"#":"",w=F.initializer!==void 0?JSON.stringify(F.initializer):F.default!==void 0?JSON.stringify(F.default):"null";K.push(` this.${I}${M} = config.${M} !== undefined ? config.${M} : ${w};`)}if(Y?.body){let B=Array.isArray(Y.body)?Y.body:[Y.body];for(let F of B)K.push(` ${F}`)}K.push(" }");for(let[B,F]of Object.entries(H)){let M=F.identifier??B,I=F.scope==="static",$=F.access==="private"?"#":"",A=I?"static ":"",C=F.returnType?.$ref?.includes("Promise")||C7(F)?"async ":"",v=E6(F.parameters??[]),m=j7(F.body);if(K.push(""),F.role==="accessor"){if(F.getter)K.push(` ${A}get ${$}${M}() {`,` ${F.getter.body}`," }");if(F.setter){let f=E6(F.setter.parameters??[]);K.push(` ${A}set ${$}${M}(${f}) {`,` ${F.setter.body}`," }")}}else{K.push(` ${A}${C}${$}${M}(${v}) {`);for(let f of m)K.push(` ${f}`);K.push(" }")}}return K.push("}","",`export { ${W} };`,`export default ${W};`,""),K.join(`
|
|
190
|
+
`)}function T7(Z){if(!Z)return"Object";if(typeof Z==="string")return Z;if(Z.$ref){let X=Z.$ref.match(/([A-Za-z0-9_]+)\.class\.json/);return X?X[1]:"Object"}return"Object"}function E6(Z){return Z.map((X)=>{if(X.$ref)return X.$ref.split("/").pop();let W=X.identifier??X.name;return typeof W==="string"?W:"arg"}).join(", ")}function j7(Z){if(!Z)return[""];return Array.isArray(Z)?Z:[Z]}function C7(Z){return(Array.isArray(Z.body)?Z.body.join(`
|
|
191
|
+
`):Z.body??"").includes("await ")}import{readFileSync as R7}from"node:fs";async function P7(Z,X={}){let{title:W="Jx App",reactivitySrc:G=U1,litHtmlSrc:Q=Y1,projectStyle:U=null}=X,J;if(typeof Z==="string"){let Y=R7(Z,"utf8");if(Z.endsWith(".json"))J=C1(Y,Z);else{let{extname:H}=await import("node:path"),K=H(Z).toLowerCase(),V=X.formats?.byExtension?.(K,"parse");if(!V){let{unknownFormatError:B}=await Promise.resolve().then(() => (e8(),t8));throw B(Z,K)}J=await V.call("parse",Y)}}else J=Z;if($9(J)){let{compileClassJson:Y}=await Promise.resolve().then(() => x6),H=Y(J,X),K=typeof Z==="string"?Z.replace(/\.class\.json$/,".js"):`${J.title}.js`;return{files:[{content:H,path:K}],html:""}}if(!K1(J))return N6(J,{litHtmlSrc:Q,projectStyle:U,reactivitySrc:G,...X.prePaintScheme===!1?{prePaintScheme:!1}:{},...X.rewriteSrc?{rewriteSrc:X.rewriteSrc}:{},title:W});if(J.tagName&&J.tagName.includes("-")){let{tagName:Y}=J,H=H1(Y),V={content:f0(J,H,[],X.rewriteSrc),path:`${Y}.js`,tagName:Y},B=L0(J,J.$media??{}),F=`<!DOCTYPE html>
|
|
194
192
|
<html lang="en">
|
|
195
193
|
<head>
|
|
196
194
|
<meta charset="utf-8">
|
|
@@ -207,7 +205,7 @@ ${h.join(`,
|
|
|
207
205
|
${B}
|
|
208
206
|
</head>
|
|
209
207
|
<body>
|
|
210
|
-
<${
|
|
211
|
-
<script type="module" src="./${
|
|
208
|
+
<${Y}></${Y}>
|
|
209
|
+
<script type="module" src="./${Y}.js"></script>
|
|
212
210
|
</body>
|
|
213
|
-
</html>`;return{files:[
|
|
211
|
+
</html>`;return{files:[V],html:F}}return z9(J,{litHtmlSrc:Q,projectStyle:U,reactivitySrc:G,...X.prePaintScheme===!1?{prePaintScheme:!1}:{},...X.rewriteSrc?{rewriteSrc:X.rewriteSrc}:{},title:W})}async function _z(Z,X){let[W,G]=await Promise.all([P7(Z),l8(Z)]),{writeFileSync:Q,mkdirSync:U}=await import("node:fs"),{dirname:J,join:Y}=await import("node:path");if(X){Q(X,W.html,"utf8"),console.error(`Written to ${X}`);let H=J(X);for(let K of W.files){let V=Y(H,K.path);U(J(V),{recursive:!0}),Q(V,K.content,"utf8"),console.error(`Written to ${V}`)}}else process.stdout.write(W.html);if(G&&X){let H=X.replace(/(\.[^.]+)?$/,"-server.js");Q(H,G,"utf8"),console.error(`Server handler written to ${H}`)}}var E7=c(()=>{G0();i8();k1();j6();Q9();r2();o8();G0();i8();k1();Q9()});E7();export{_z as runCli,K1 as isDynamic,z7 as compileSiteServer,l8 as compileServer,F7 as compileElementPage,w6 as compileElement,z9 as compileClient,P7 as compile};
|