@jxsuite/compiler 0.28.3 → 0.28.4
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 +14 -14
- package/package.json +4 -4
- package/src/site/image-transform.ts +0 -23
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as kq}from"node:module";var Tq=Object.create;var{getPrototypeOf:Rq,defineProperty:d1,getOwnPropertyNames:_q}=Object;var Pq=Object.prototype.hasOwnProperty;function jq(Z){return this[Z]}var Eq,Cq,B4=(Z,X,q)=>{var W=Z!=null&&typeof Z==="object";if(W){var Q=X?Eq??=new WeakMap:Cq??=new WeakMap,J=Q.get(Z);if(J)return J}q=Z!=null?Tq(Rq(Z)):{};let z=X||!Z||!Z.__esModule?d1(q,"default",{value:Z,enumerable:!0}):q;for(let Y of _q(Z))if(!Pq.call(z,Y))d1(z,Y,{get:jq.bind(Z,Y),enumerable:!0});if(W)Q.set(Z,z);return z};var E=(Z,X)=>()=>(X||Z((X={exports:{}}).exports,X),X.exports);var Oq=(Z)=>Z;function xq(Z,X){this[Z]=Oq.bind(null,X)}var f4=(Z,X)=>{for(var q in X)d1(Z,q,{get:X[q],enumerable:!0,configurable:!0,set:xq.bind(X,q)})};var R=(Z,X)=>()=>(Z&&(X=Z(Z=0)),X);var q0=kq(import.meta.url);function c1(Z){let X=Z.$map;return X&&typeof X==="object"?X:void 0}function L6(Z){return p3.has(Z)}function C0(Z,X,q,W){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return Q6(Z,X,q,W);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return bq(Z.$ref,X,q,W);if(Array.isArray(Z))return Z.map((Q)=>C0(Q,X,q,W));return Z}function bq(Z,X,q,W){if(Z==="$reduce/acc")return W?.acc;if(Z.startsWith("$reduce/"))return W?.acc;if(Z.startsWith("event#/")){let Q=Z.slice(7);return S6(q,Q)}if(Z.startsWith("$map/")){let Q=Z.split("/"),[,J]=Q,z,Y=c1(X);if(J==="item")z=W?.item??Y?.item??X["$map/item"];else if(J==="index")z=W?.index??Y?.index??X["$map/index"];else z=Y?.[J]??X[`$map/${J}`];return Q.length>2?S6(z,Q.slice(2).join("/")):z}if(Z.startsWith("#/state/")){let Q=Z.slice(8),J=Q.indexOf("/");if(J===-1)return X[Q];return S6(X[Q.slice(0,J)],Q.slice(J+1))}if(Z.startsWith("parent#/"))return X[Z.slice(8)];if(Z.startsWith("window#/"))return S6(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return S6(globalThis.document,Z.slice(10));return X[Z]??null}function vq(Z,X,q,W){if(Z.startsWith("$map/")){let Q=Z.split("/"),[,J]=Q,z,Y=c1(X);if(J==="item")z=W?.item??Y?.item??X["$map/item"];else if(J==="index")z=W?.index??Y?.index??X["$map/index"];else z=Y?.[J]??X[`$map/${J}`];if(Q.length>2){let U=Q.slice(2),K=U.pop(),V=U.length>0?S6(z,U.join("/")):z;return{key:K,obj:V}}return{key:J==="item"?"$map/item":"$map/index",obj:c1(X)??X}}if(Z.startsWith("#/state/")){let Q=Z.slice(8);if(Q.indexOf("/")===-1)return{key:Q,obj:X};let z=Q.split("/"),Y=z.pop(),U=X;for(let K of z)U=U[K];return{key:Y,obj:U}}return{key:Z,obj:X}}function Q6(Z,X,q,W){let{operator:Q,target:J,value:z,initial:Y}=Z;if(!Sq.has(Q))throw Error(`$expression: unknown operator "${Q}"`);if(l1.has(Q)&&!("value"in Z)){let U=C0(J,X,q,W);if(Q==="!")return!U;if(Q==="-")return-U}if(p1.has(Q)){let U=C0(J,X,q,W),K=C0(z,X,q,W);switch(Q){case"+":return U+K;case"-":return U-K;case"*":return U*K;case"/":return U/K;case"%":return U%K;case"===":return U===K;case"!==":return U!==K;case"<":return U<K;case"<=":return U<=K;case">":return U>K;case">=":return U>=K;case"&&":return U&&K;case"||":return U||K;default:break}}if(n3.has(Q)){let U=C0(z,X,q,W),{obj:K,key:V}=vq(J.$ref,X,q,W);switch(Q){case"=":{K[V]=U;break}case"+=":{let B=K[V];K[V]=B+U;break}case"-=":{let B=K[V];K[V]=B-U;break}case"*=":{let B=K[V];K[V]=B*U;break}case"/=":{let B=K[V];K[V]=B/U;break}default:break}return}if(i3.has(Q)){let U=C0(J,X,q,W);switch(Q){case"push":return U.push(C0(z,X,q,W));case"unshift":return U.unshift(C0(z,X,q,W));case"pop":return U.pop();case"shift":return U.shift();case"splice":{let K=C0(z,X,q,W);return U.splice(...K)}default:break}}if(n1.has(Q)){let U=C0(J,X,q,W);if(Q==="reduce"){let K=C0(Y,X,q,W);for(let[V,B]of U.entries())K=Q6(z,X,q,{acc:K,index:V,item:B});return K}if(Q==="map")return U.map((K,V)=>Q6(z,X,q,{...W,index:V,item:K}));if(Q==="filter")return U.filter((K,V)=>Q6(z,X,q,{...W,index:V,item:K}))}return}function N0(Z,X){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return T0(Z,X);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return r3(Z.$ref,X);if(Array.isArray(Z))return Z.map((q)=>N0(q,X)).join(", ");return JSON.stringify(Z)}function r3(Z,X){let q=X.statePrefix??"state",W=X.eventParam??"event";if(Z==="$reduce/acc")return"_acc";if(Z.startsWith("$reduce/"))return"_acc";if(Z.startsWith("event#/")){let Q=Z.slice(7);return`${W}.${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`${q}.${Q.replaceAll("/",".")}`}if(Z.startsWith("parent#/"))return`${q}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replaceAll("/",".")}`;return`${q}.${Z}`}function l3(Z,X){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return r3(Z.$ref,X);return N0(Z,X)}function T0(Z,X={}){let{operator:q,target:W,value:Q,initial:J}=Z;if(l1.has(q)&&!("value"in Z)){let z=N0(W,X);if(q==="!")return`!(${z})`;if(q==="-")return`-(${z})`}if(p1.has(q)){let z=N0(W,X),Y=N0(Q,X);return`(${z} ${q} ${Y})`}if(n3.has(q)){let z=l3(W,X),Y=N0(Q,X);return`${z} ${q} ${Y}`}if(i3.has(q)){let z=l3(W,X);switch(q){case"push":return`${z}.push(${N0(Q,X)})`;case"unshift":return`${z}.unshift(${N0(Q,X)})`;case"pop":return`${z}.pop()`;case"shift":return`${z}.shift()`;case"splice":{let Y=Array.isArray(Q)?Q.map((U)=>N0(U,X)).join(", "):N0(Q,X);return`${z}.splice(${Y})`}default:break}}if(n1.has(q)){let z=N0(W,X),Y=T0(Q,X);if(q==="reduce"){let U=N0(J,X);return`${z}.reduce((_acc, _item, _index) => ${Y}, ${U})`}if(q==="map")return`${z}.map((_item, _index) => ${Y})`;if(q==="filter")return`${z}.filter((_item, _index) => ${Y})`}return"undefined"}function S6(Z,X){let q=Z;for(let W of X.split(/[./]/))q=q?.[W];return q}var p3,l1,p1,n3,i3,n1,Sq;var i1=R(()=>{p3=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),l1=new Set(["!","-"]),p1=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||"]),n3=new Set(["=","+=","-=","*=","/="]),i3=new Set(["push","pop","shift","unshift","splice"]),n1=new Set(["reduce","map","filter"]),Sq=new Set([...p3,...l1,...p1,...n1])});function M0(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function L0(Z){return M0(Z)&&typeof Z.$ref==="string"}function i0(Z){return M0(Z)&&Z.$prototype==="Function"}function O0(Z){return M0(Z)&&M0(Z.$expression)}function I6(Z){return M0(Z)&&typeof Z.$prototype==="string"&&Z.$prototype!=="Function"}function r1(Z){return M0(Z)&&Z.timing==="server"&&typeof Z.$src==="string"&&typeof Z.$export==="string"&&!Z.$prototype}function a3(Z){return M0(Z)&&!Z.$prototype&&!Z.$expression&&"default"in Z}function J6(Z){if(!M0(Z))return!1;for(let X of Object.keys(Z))if(!s3.has(X))return!1;return!0}function w6(Z){return M0(Z)&&Z.$prototype==="Array"}function o3(Z){return M0(Z)&&Z.$prototype==="Class"}function x(Z){return typeof Z==="string"&&Z.includes("${")}function z6(Z){if(!Z)return[];return Z.map((X)=>typeof X==="string"?X:X.name)}var s3;var S0=R(()=>{s3=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function yq(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function I0(Z){return Z.replaceAll(/[A-Z]/g,(X)=>`-${X.toLowerCase()}`)}function B0(Z){return Object.entries(Z).filter(([X,q])=>!yq(X)&&(q===null||typeof q!=="object")).map(([X,q])=>`${I0(X)}: ${q}`).join("; ")}var D6;var u4=R(()=>{i1();S0();D6=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 o1(Z){if(!Z||typeof Z!=="object")return!1;if(Z.state)for(let[X,q]of Object.entries(Z.state)){if(X==="$site"||X==="$page")continue;if(q&&typeof q==="object"&&!Array.isArray(q)&&q.timing==="compiler")continue;if(typeof q!=="object"||q===null||Array.isArray(q))return!0;if(q.$prototype)return!0;if("default"in q)return!0;if(J6(q))continue;return!0}if(Z.$switch)return!0;if(!Array.isArray(Z.children)&&Z.children?.$prototype==="Array")return!0;if(Array.isArray(Z.children)&&Z.children.some((X)=>o1(X)))return!0;for(let[X,q]of Object.entries(Z)){if(D6.has(X))continue;if(q!==null&&typeof q==="object"&&typeof q.$ref==="string")return!0;if(x(q))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(x(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(x(X))return!0}return!1}function e3(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(!Array.isArray(Z.children)&&Z.children?.$prototype==="Array")return!0;for(let[X,q]of Object.entries(Z)){if(D6.has(X))continue;if(q!==null&&typeof q==="object"&&typeof q.$ref==="string")return!0;if(x(q))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(x(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(x(X))return!0}return!1}function h6(Z,X=null,q={},W={}){let Q=Z?.state?m6(Z.state,X):X??Object.create(null);return{media:W,scope:Q,scopeDefs:q}}function m6(Z={},X=null){let q=Object.create(X??null);for(let[W,Q]of Object.entries(Z)){if(typeof Q!=="object"||Q===null||Array.isArray(Q)){N6(q,W,d4(Q));continue}let J=Q;if("default"in J){N6(q,W,d4(J.default));continue}if(!J.$prototype&&!("$expression"in J)&&!J6(J))N6(q,W,d4(J))}for(let[W,Q]of Object.entries(Z)){if(typeof Q==="string"&&x(Q)){a1(q,W,()=>Y0(Q,q));continue}if(!Q||typeof Q!=="object")continue;if(O0(Q)){let J=Q.$expression;if(L6(J.operator))N6(q,W,(z,Y)=>Q6(J,z,Y));else a1(q,W,()=>Q6(J,q,null));continue}if(i0(Q)){if(Q.body){let J=Q.parameters?z6(Q.parameters):Q.arguments??[],z=Function("state",...J,Q.body);if(Q.body.includes("return"))a1(q,W,()=>z(q));else N6(q,W,z)}else N6(q,W,()=>{});continue}if(I6(Q)&&(Q.$prototype==="LocalStorage"||Q.$prototype==="SessionStorage"))N6(q,W,d4(Q.default??null))}return q}function N6(Z,X,q){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,value:q,writable:!0})}function a1(Z,X,q){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,get:q})}function p(Z,X){if(b0(Z))return t1(Z.$ref,X);if(x(Z))return Y0(Z,X);return Z}function b0(Z){return L0(Z)}function t1(Z,X){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let q=Z.split("/"),[,W]=q,Q=X.$map?.[W]??X[`$map/${W}`];return q.length>2?t3(Q,q.slice(2).join("/")):Q}if(Z.startsWith("#/state/")){let q=Z.slice(8),W=q.indexOf("/");if(W===-1)return X[q];return t3(X[q.slice(0,W)],q.slice(W+1))}return X[Z]??null}function Y0(Z,X){try{let q=Z.match(/^\$\{(.+)\}$/s);if(q)return Function("state","$map",`return (${q[1]})`)(X,X?.$map);return Function("state","$map",`return \`${Z}\``)(X,X?.$map)}catch{return null}}function t3(Z,X){if(!X)return Z;let q=Z;for(let W of X.split("/"))q=q==null?void 0:q[W];return q}function d4(Z){if(Z===null||typeof Z!=="object")return Z;return structuredClone(Z)}function v6(Z,X){let q="",W=p(Z.id,X),Q=p(Z.className,X),J=p(Z.hidden,X),z=p(Z.tabIndex,X),Y=p(Z.title,X),U=p(Z.lang,X),K=p(Z.dir,X);if(W)q+=` id="${y(String(W))}"`;if(Q)q+=` class="${y(String(Q))}"`;if(J)q+=" hidden";if(z!==void 0&&z!==null)q+=` tabindex="${y(String(z))}"`;if(Y)q+=` title="${y(String(Y))}"`;if(U)q+=` lang="${y(String(U))}"`;if(K)q+=` dir="${y(String(K))}"`;if(Z.style&&X){let V=Object.entries(Z.style).filter(([B,H])=>!B.startsWith(":")&&!B.startsWith(".")&&!B.startsWith("&")&&!B.startsWith("[")&&!B.startsWith("@")&&H!==null&&typeof H!=="object"&&typeof H==="string"&&x(H)).map(([B,H])=>{let $=p(H,X);return $==null?null:`${I0(B)}: ${$}`}).filter(Boolean).join("; ");if(V)q+=` style="${V}"`}if(Z.attributes)for(let[V,B]of Object.entries(Z.attributes)){let H=p(B,X);if(H!==null&&H!==void 0&&(typeof H==="string"||typeof H==="number"||typeof H==="boolean"))q+=` ${V}="${y(String(H))}"`}if(Z.tagName==="img"){if(!Z.attributes?.loading)q+=' loading="lazy"';if(!Z.attributes?.decoding)q+=' decoding="async"'}if(Z.$static)q+=" data-jx-static";else if(Z.$prerendered)q+=" data-jx-prerendered";return q}function f6(Z,X={},q=null){let W=[];if(q&&typeof q==="object"){let J=(V,B)=>{let H=B0(B);if(H)W.push(`${V} { ${H} }`);for(let[$,F]of Object.entries(B)){if(F===null||typeof F!=="object"||Array.isArray(F))continue;if($.startsWith("@")){let A=$.startsWith("@--")?`@media ${X[$.slice(1)]??$.slice(1)}`:$,I=B0(F);if(I)W.push(`${A} { ${V} { ${I} } }`);for(let[M,_]of Object.entries(F)){if(_===null||typeof _!=="object"||Array.isArray(_))continue;if(M.startsWith("@"))continue;let k=M.startsWith("&")?M.replace("&",V):M.startsWith(":")||M.startsWith(".")||M.startsWith("[")?`${V}${M}`:`${V} ${M}`,b=B0(_);if(b)W.push(`${A} { ${k} { ${b} } }`)}continue}let L=$.startsWith("&")?$.replace("&",V):$.startsWith(":")||$.startsWith(".")||$.startsWith("[")?`${V}${$}`:`${V} ${$}`;J(L,F)}};for(let[V,B]of Object.entries(q))if(V.startsWith(":")||V.startsWith(".")||V.startsWith("["))J(V,B);else if(B!==null&&typeof B==="object"&&!Array.isArray(B)&&!V.startsWith("@")&&!V.startsWith("--"))J(V,B);else if(V.startsWith("@")){let H=V.startsWith("@--")?`@media ${X[V.slice(1)]??V.slice(1)}`:V.startsWith("@(")?`@media ${V.slice(1)}`:V;W.push(`${H} { body { ${B0(B)} } }`)}let z={},Y={};for(let[V,B]of Object.entries(q)){if(V.startsWith(":")||V.startsWith(".")||V.startsWith("[")||V.startsWith("@"))continue;if(B!==null&&typeof B==="object"&&!Array.isArray(B))continue;if(V.startsWith("--"))z[V]=B;else Y[V]=B}let U=B0(z);if(U)W.push(`:root { ${U} }`);let K=B0(Y);if(K)W.push(`body { ${K} }`)}if(G6(Z,W,X,"",{n:0}),W.length===0)return"";return`<style>
|
|
2
|
+
import{createRequire as kq}from"node:module";var Tq=Object.create;var{getPrototypeOf:Rq,defineProperty:d1,getOwnPropertyNames:_q}=Object;var Pq=Object.prototype.hasOwnProperty;function jq(Z){return this[Z]}var Eq,Cq,B4=(Z,X,q)=>{var W=Z!=null&&typeof Z==="object";if(W){var Q=X?Eq??=new WeakMap:Cq??=new WeakMap,J=Q.get(Z);if(J)return J}q=Z!=null?Tq(Rq(Z)):{};let z=X||!Z||!Z.__esModule?d1(q,"default",{value:Z,enumerable:!0}):q;for(let Y of _q(Z))if(!Pq.call(z,Y))d1(z,Y,{get:jq.bind(Z,Y),enumerable:!0});if(W)Q.set(Z,z);return z};var E=(Z,X)=>()=>(X||Z((X={exports:{}}).exports,X),X.exports);var Oq=(Z)=>Z;function xq(Z,X){this[Z]=Oq.bind(null,X)}var f4=(Z,X)=>{for(var q in X)d1(Z,q,{get:X[q],enumerable:!0,configurable:!0,set:xq.bind(X,q)})};var R=(Z,X)=>()=>(Z&&(X=Z(Z=0)),X);var q0=kq(import.meta.url);function c1(Z){let X=Z.$map;return X&&typeof X==="object"?X:void 0}function L6(Z){return p3.has(Z)}function C0(Z,X,q,W){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return Q6(Z,X,q,W);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return bq(Z.$ref,X,q,W);if(Array.isArray(Z))return Z.map((Q)=>C0(Q,X,q,W));return Z}function bq(Z,X,q,W){if(Z==="$reduce/acc")return W?.acc;if(Z.startsWith("$reduce/"))return W?.acc;if(Z.startsWith("event#/")){let Q=Z.slice(7);return S6(q,Q)}if(Z.startsWith("$map/")){let Q=Z.split("/"),[,J]=Q,z,Y=c1(X);if(J==="item")z=W?.item??Y?.item??X["$map/item"];else if(J==="index")z=W?.index??Y?.index??X["$map/index"];else z=Y?.[J]??X[`$map/${J}`];return Q.length>2?S6(z,Q.slice(2).join("/")):z}if(Z.startsWith("#/state/")){let Q=Z.slice(8),J=Q.indexOf("/");if(J===-1)return X[Q];return S6(X[Q.slice(0,J)],Q.slice(J+1))}if(Z.startsWith("parent#/"))return X[Z.slice(8)];if(Z.startsWith("window#/"))return S6(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return S6(globalThis.document,Z.slice(10));return X[Z]??null}function vq(Z,X,q,W){if(Z.startsWith("$map/")){let Q=Z.split("/"),[,J]=Q,z,Y=c1(X);if(J==="item")z=W?.item??Y?.item??X["$map/item"];else if(J==="index")z=W?.index??Y?.index??X["$map/index"];else z=Y?.[J]??X[`$map/${J}`];if(Q.length>2){let U=Q.slice(2),K=U.pop(),V=U.length>0?S6(z,U.join("/")):z;return{key:K,obj:V}}return{key:J==="item"?"$map/item":"$map/index",obj:c1(X)??X}}if(Z.startsWith("#/state/")){let Q=Z.slice(8);if(Q.indexOf("/")===-1)return{key:Q,obj:X};let z=Q.split("/"),Y=z.pop(),U=X;for(let K of z)U=U[K];return{key:Y,obj:U}}return{key:Z,obj:X}}function Q6(Z,X,q,W){let{operator:Q,target:J,value:z,initial:Y}=Z;if(!Sq.has(Q))throw Error(`$expression: unknown operator "${Q}"`);if(l1.has(Q)&&!("value"in Z)){let U=C0(J,X,q,W);if(Q==="!")return!U;if(Q==="-")return-U}if(p1.has(Q)){let U=C0(J,X,q,W),K=C0(z,X,q,W);switch(Q){case"+":return U+K;case"-":return U-K;case"*":return U*K;case"/":return U/K;case"%":return U%K;case"===":return U===K;case"!==":return U!==K;case"<":return U<K;case"<=":return U<=K;case">":return U>K;case">=":return U>=K;case"&&":return U&&K;case"||":return U||K;default:break}}if(n3.has(Q)){let U=C0(z,X,q,W),{obj:K,key:V}=vq(J.$ref,X,q,W);switch(Q){case"=":{K[V]=U;break}case"+=":{let B=K[V];K[V]=B+U;break}case"-=":{let B=K[V];K[V]=B-U;break}case"*=":{let B=K[V];K[V]=B*U;break}case"/=":{let B=K[V];K[V]=B/U;break}default:break}return}if(i3.has(Q)){let U=C0(J,X,q,W);switch(Q){case"push":return U.push(C0(z,X,q,W));case"unshift":return U.unshift(C0(z,X,q,W));case"pop":return U.pop();case"shift":return U.shift();case"splice":{let K=C0(z,X,q,W);return U.splice(...K)}default:break}}if(n1.has(Q)){let U=C0(J,X,q,W);if(Q==="reduce"){let K=C0(Y,X,q,W);for(let[V,B]of U.entries())K=Q6(z,X,q,{acc:K,index:V,item:B});return K}if(Q==="map")return U.map((K,V)=>Q6(z,X,q,{...W,index:V,item:K}));if(Q==="filter")return U.filter((K,V)=>Q6(z,X,q,{...W,index:V,item:K}))}return}function N0(Z,X){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return T0(Z,X);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return r3(Z.$ref,X);if(Array.isArray(Z))return Z.map((q)=>N0(q,X)).join(", ");return JSON.stringify(Z)}function r3(Z,X){let q=X.statePrefix??"state",W=X.eventParam??"event";if(Z==="$reduce/acc")return"_acc";if(Z.startsWith("$reduce/"))return"_acc";if(Z.startsWith("event#/")){let Q=Z.slice(7);return`${W}.${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`${q}.${Q.replaceAll("/",".")}`}if(Z.startsWith("parent#/"))return`${q}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replaceAll("/",".")}`;return`${q}.${Z}`}function l3(Z,X){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return r3(Z.$ref,X);return N0(Z,X)}function T0(Z,X={}){let{operator:q,target:W,value:Q,initial:J}=Z;if(l1.has(q)&&!("value"in Z)){let z=N0(W,X);if(q==="!")return`!(${z})`;if(q==="-")return`-(${z})`}if(p1.has(q)){let z=N0(W,X),Y=N0(Q,X);return`(${z} ${q} ${Y})`}if(n3.has(q)){let z=l3(W,X),Y=N0(Q,X);return`${z} ${q} ${Y}`}if(i3.has(q)){let z=l3(W,X);switch(q){case"push":return`${z}.push(${N0(Q,X)})`;case"unshift":return`${z}.unshift(${N0(Q,X)})`;case"pop":return`${z}.pop()`;case"shift":return`${z}.shift()`;case"splice":{let Y=Array.isArray(Q)?Q.map((U)=>N0(U,X)).join(", "):N0(Q,X);return`${z}.splice(${Y})`}default:break}}if(n1.has(q)){let z=N0(W,X),Y=T0(Q,X);if(q==="reduce"){let U=N0(J,X);return`${z}.reduce((_acc, _item, _index) => ${Y}, ${U})`}if(q==="map")return`${z}.map((_item, _index) => ${Y})`;if(q==="filter")return`${z}.filter((_item, _index) => ${Y})`}return"undefined"}function S6(Z,X){let q=Z;for(let W of X.split(/[./]/))q=q?.[W];return q}var p3,l1,p1,n3,i3,n1,Sq;var i1=R(()=>{p3=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),l1=new Set(["!","-"]),p1=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||"]),n3=new Set(["=","+=","-=","*=","/="]),i3=new Set(["push","pop","shift","unshift","splice"]),n1=new Set(["reduce","map","filter"]),Sq=new Set([...p3,...l1,...p1,...n1])});function M0(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function L0(Z){return M0(Z)&&typeof Z.$ref==="string"}function i0(Z){return M0(Z)&&Z.$prototype==="Function"}function O0(Z){return M0(Z)&&M0(Z.$expression)}function I6(Z){return M0(Z)&&typeof Z.$prototype==="string"&&Z.$prototype!=="Function"}function r1(Z){return M0(Z)&&Z.timing==="server"&&typeof Z.$src==="string"&&typeof Z.$export==="string"&&!Z.$prototype}function a3(Z){return M0(Z)&&!Z.$prototype&&!Z.$expression&&"default"in Z}function J6(Z){if(!M0(Z))return!1;for(let X of Object.keys(Z))if(!s3.has(X))return!1;return!0}function w6(Z){return M0(Z)&&Z.$prototype==="Array"}function o3(Z){return M0(Z)&&Z.$prototype==="Class"}function x(Z){return typeof Z==="string"&&Z.includes("${")}function z6(Z){if(!Z)return[];return Z.map((X)=>typeof X==="string"?X:X.name)}var s3;var S0=R(()=>{s3=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function yq(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function I0(Z){return Z.replaceAll(/[A-Z]/g,(X)=>`-${X.toLowerCase()}`)}function B0(Z){return Object.entries(Z).filter(([X,q])=>!yq(X)&&(q===null||typeof q!=="object")).map(([X,q])=>`${I0(X)}: ${q}`).join("; ")}var D6;var u4=R(()=>{i1();S0();D6=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 o1(Z){if(!Z||typeof Z!=="object")return!1;if(Z.state)for(let[X,q]of Object.entries(Z.state)){if(X==="$site"||X==="$page")continue;if(q&&typeof q==="object"&&!Array.isArray(q)&&q.timing==="compiler")continue;if(typeof q!=="object"||q===null||Array.isArray(q))return!0;if(q.$prototype)return!0;if("default"in q)return!0;if(J6(q))continue;return!0}if(Z.$switch)return!0;if(!Array.isArray(Z.children)&&Z.children?.$prototype==="Array")return!0;if(Array.isArray(Z.children)&&Z.children.some((X)=>o1(X)))return!0;for(let[X,q]of Object.entries(Z)){if(D6.has(X))continue;if(q!==null&&typeof q==="object"&&typeof q.$ref==="string")return!0;if(x(q))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(x(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(x(X))return!0}return!1}function e3(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(!Array.isArray(Z.children)&&Z.children?.$prototype==="Array")return!0;for(let[X,q]of Object.entries(Z)){if(D6.has(X))continue;if(q!==null&&typeof q==="object"&&typeof q.$ref==="string")return!0;if(x(q))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(x(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(x(X))return!0}return!1}function h6(Z,X=null,q={},W={}){let Q=Z?.state?m6(Z.state,X):X??Object.create(null);return{media:W,scope:Q,scopeDefs:q}}function m6(Z={},X=null){let q=Object.create(X??null);for(let[W,Q]of Object.entries(Z)){if(typeof Q!=="object"||Q===null||Array.isArray(Q)){N6(q,W,d4(Q));continue}let J=Q;if("default"in J){N6(q,W,d4(J.default));continue}if(!J.$prototype&&!("$expression"in J)&&!J6(J))N6(q,W,d4(J))}for(let[W,Q]of Object.entries(Z)){if(typeof Q==="string"&&x(Q)){a1(q,W,()=>Y0(Q,q));continue}if(!Q||typeof Q!=="object")continue;if(O0(Q)){let J=Q.$expression;if(L6(J.operator))N6(q,W,(z,Y)=>Q6(J,z,Y));else a1(q,W,()=>Q6(J,q,null));continue}if(i0(Q)){if(Q.body){let J=Q.parameters?z6(Q.parameters):Q.arguments??[],z=Function("state",...J,Q.body);if(Q.body.includes("return"))a1(q,W,()=>z(q));else N6(q,W,z)}else N6(q,W,()=>{});continue}if(I6(Q)&&(Q.$prototype==="LocalStorage"||Q.$prototype==="SessionStorage"))N6(q,W,d4(Q.default??null))}return q}function N6(Z,X,q){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,value:q,writable:!0})}function a1(Z,X,q){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,get:q})}function p(Z,X){if(b0(Z))return t1(Z.$ref,X);if(x(Z))return Y0(Z,X);return Z}function b0(Z){return L0(Z)}function t1(Z,X){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let q=Z.split("/"),[,W]=q,Q=X.$map?.[W]??X[`$map/${W}`];return q.length>2?t3(Q,q.slice(2).join("/")):Q}if(Z.startsWith("#/state/")){let q=Z.slice(8),W=q.indexOf("/");if(W===-1)return X[q];return t3(X[q.slice(0,W)],q.slice(W+1))}return X[Z]??null}function Y0(Z,X){try{let q=Z.match(/^\$\{(.+)\}$/s);if(q)return Function("state","$map",`return (${q[1]})`)(X,X?.$map);return Function("state","$map",`return \`${Z}\``)(X,X?.$map)}catch{return null}}function t3(Z,X){if(!X)return Z;let q=Z;for(let W of X.split("/"))q=q==null?void 0:q[W];return q}function d4(Z){if(Z===null||typeof Z!=="object")return Z;return structuredClone(Z)}function v6(Z,X){let q="",W=p(Z.id,X),Q=p(Z.className,X),J=p(Z.hidden,X),z=p(Z.tabIndex,X),Y=p(Z.title,X),U=p(Z.lang,X),K=p(Z.dir,X);if(W)q+=` id="${y(String(W))}"`;if(Q)q+=` class="${y(String(Q))}"`;if(J)q+=" hidden";if(z!==void 0&&z!==null)q+=` tabindex="${y(String(z))}"`;if(Y)q+=` title="${y(String(Y))}"`;if(U)q+=` lang="${y(String(U))}"`;if(K)q+=` dir="${y(String(K))}"`;if(Z.style&&X){let V=Object.entries(Z.style).filter(([B,H])=>!B.startsWith(":")&&!B.startsWith(".")&&!B.startsWith("&")&&!B.startsWith("[")&&!B.startsWith("@")&&H!==null&&typeof H!=="object"&&typeof H==="string"&&x(H)).map(([B,H])=>{let $=p(H,X);return $==null?null:`${I0(B)}: ${$}`}).filter(Boolean).join("; ");if(V)q+=` style="${V}"`}if(Z.attributes)for(let[V,B]of Object.entries(Z.attributes)){let H=p(B,X);if(H!==null&&H!==void 0&&(typeof H==="string"||typeof H==="number"||typeof H==="boolean"))q+=` ${V}="${y(String(H))}"`}if(Z.tagName==="img"){if(!Z.attributes?.loading)q+=' loading="lazy"';if(!Z.attributes?.decoding)q+=' decoding="async"'}if(Z.$static)q+=" data-jx-static";else if(Z.$prerendered)q+=" data-jx-prerendered";return q}function f6(Z,X={},q=null){let W=[];if(q&&typeof q==="object"){let J=(V,B)=>{let H=B0(B);if(H)W.push(`${V} { ${H} }`);for(let[$,F]of Object.entries(B)){if(F===null||typeof F!=="object"||Array.isArray(F))continue;if($.startsWith("@")){let A=$.startsWith("@--")?`@media ${X[$.slice(1)]??$.slice(1)}`:$,I=B0(F);if(I)W.push(`${A} { ${V} { ${I} } }`);for(let[M,P]of Object.entries(F)){if(P===null||typeof P!=="object"||Array.isArray(P))continue;if(M.startsWith("@"))continue;let k=M.startsWith("&")?M.replace("&",V):M.startsWith(":")||M.startsWith(".")||M.startsWith("[")?`${V}${M}`:`${V} ${M}`,b=B0(P);if(b)W.push(`${A} { ${k} { ${b} } }`)}continue}let L=$.startsWith("&")?$.replace("&",V):$.startsWith(":")||$.startsWith(".")||$.startsWith("[")?`${V}${$}`:`${V} ${$}`;J(L,F)}};for(let[V,B]of Object.entries(q))if(V.startsWith(":")||V.startsWith(".")||V.startsWith("["))J(V,B);else if(B!==null&&typeof B==="object"&&!Array.isArray(B)&&!V.startsWith("@")&&!V.startsWith("--"))J(V,B);else if(V.startsWith("@")){let H=V.startsWith("@--")?`@media ${X[V.slice(1)]??V.slice(1)}`:V.startsWith("@(")?`@media ${V.slice(1)}`:V;W.push(`${H} { body { ${B0(B)} } }`)}let z={},Y={};for(let[V,B]of Object.entries(q)){if(V.startsWith(":")||V.startsWith(".")||V.startsWith("[")||V.startsWith("@"))continue;if(B!==null&&typeof B==="object"&&!Array.isArray(B))continue;if(V.startsWith("--"))z[V]=B;else Y[V]=B}let U=B0(z);if(U)W.push(`:root { ${U} }`);let K=B0(Y);if(K)W.push(`body { ${K} }`)}if(G6(Z,W,X,"",{n:0}),W.length===0)return"";return`<style>
|
|
3
3
|
${W.join(`
|
|
4
4
|
`)}
|
|
5
5
|
</style>`}function Z8(Z,X,q,W){let Q=B0(X);if(Q)q.push(`${Z} { ${Q} }`);for(let[J,z]of Object.entries(X)){if(z===null||typeof z!=="object"||Array.isArray(z))continue;if(J.startsWith("@")){let U=J.startsWith("@--")?`@media ${W[J.slice(1)]??J.slice(1)}`:J.startsWith("@(")?`@media ${J.slice(1)}`:J,K=B0(z);if(K)q.push(`${U} { ${Z} { ${K} } }`);for(let[V,B]of Object.entries(z)){if(B===null||typeof B!=="object"||Array.isArray(B))continue;if(V.startsWith("@"))continue;let H=V.startsWith("&")?V.replace("&",Z):V.startsWith(":")||V.startsWith(".")||V.startsWith("[")?`${Z}${V}`:`${Z} ${V}`,$=B0(B);if($)q.push(`${U} { ${H} { ${$} } }`)}continue}let Y=J.startsWith("&")?J.replace("&",Z):J.startsWith(":")||J.startsWith(".")||J.startsWith("[")?`${Z}${J}`:`${Z} ${J}`;Z8(Y,z,q,W)}}function G6(Z,X,q,W="",Q,J="jx"){let z=Q??{n:0};if(!Z||typeof Z!=="object")return;if(Z.style&&!Z.id&&!Z.className)Z.className=`${J}-${z.n}`,z.n+=1;let Y=Z.id?`#${Z.id}`:Z.className?`.${Z.className.split(" ")[0]}`:Z.tagName??"*";if(Z.style){let U=[];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"&&x(V))continue;U.push(` ${I0(K)}: ${V};`)}if(U.length>0)X.push(`${Y} {
|
|
@@ -24,15 +24,15 @@ Parsed value is empty`);else return z}catch(z){if(!z&&X.continueOnError)throw ne
|
|
|
24
24
|
`,Y+=a.repeat("-",X.indent+V+3+K.pos)+`^
|
|
25
25
|
`;for(U=1;U<=X.linesAfter;U++){if(z+U>=Q.length)break;K=U5(Z.buffer,W[z+U],Q[z+U],Z.position-(W[z]-W[z+U]),B),Y+=a.repeat(" ",X.indent)+K5((Z.line+U+1).toString(),V)+" | "+K.str+`
|
|
26
26
|
`}return Y.replace(/\n$/,"")}function TW(Z){var X={};if(Z!==null)Object.keys(Z).forEach(function(q){Z[q].forEach(function(W){X[String(W)]=q})});return X}function RW(Z,X){if(X=X||{},Object.keys(X).forEach(function(q){if(DW.indexOf(q)===-1)throw new K0('Unknown option "'+q+'" is met in definition of "'+Z+'" YAML type.')}),this.options=X,this.tag=Z,this.kind=X.kind||null,this.resolve=X.resolve||function(){return!0},this.construct=X.construct||function(q){return q},this.instanceOf=X.instanceOf||null,this.predicate=X.predicate||null,this.represent=X.represent||null,this.representName=X.representName||null,this.defaultStyle=X.defaultStyle||null,this.multi=X.multi||!1,this.styleAliases=TW(X.styleAliases||null),NW.indexOf(this.kind)===-1)throw new K0('Unknown kind "'+this.kind+'" is specified for "'+Z+'" YAML type.')}function I8(Z,X){var q=[];return Z[X].forEach(function(W){var Q=q.length;q.forEach(function(J,z){if(J.tag===W.tag&&J.kind===W.kind&&J.multi===W.multi)Q=z}),q[Q]=W}),q}function _W(){var Z={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},X,q;function W(Q){if(Q.multi)Z.multi[Q.kind].push(Q),Z.multi.fallback.push(Q);else Z[Q.kind][Q.tag]=Z.fallback[Q.tag]=Q}for(X=0,q=arguments.length;X<q;X+=1)arguments[X].forEach(W);return Z}function B5(Z){return this.extend(Z)}function PW(Z){if(Z===null)return!0;var X=Z.length;return X===1&&Z==="~"||X===4&&(Z==="null"||Z==="Null"||Z==="NULL")}function jW(){return null}function EW(Z){return Z===null}function CW(Z){if(Z===null)return!1;var X=Z.length;return X===4&&(Z==="true"||Z==="True"||Z==="TRUE")||X===5&&(Z==="false"||Z==="False"||Z==="FALSE")}function OW(Z){return Z==="true"||Z==="True"||Z==="TRUE"}function xW(Z){return Object.prototype.toString.call(Z)==="[object Boolean]"}function kW(Z){return 48<=Z&&Z<=57||65<=Z&&Z<=70||97<=Z&&Z<=102}function SW(Z){return 48<=Z&&Z<=55}function bW(Z){return 48<=Z&&Z<=57}function vW(Z){if(Z===null)return!1;var X=Z.length,q=0,W=!1,Q;if(!X)return!1;if(Q=Z[q],Q==="-"||Q==="+")Q=Z[++q];if(Q==="0"){if(q+1===X)return!0;if(Q=Z[++q],Q==="b"){q++;for(;q<X;q++){if(Q=Z[q],Q==="_")continue;if(Q!=="0"&&Q!=="1")return!1;W=!0}return W&&Q!=="_"}if(Q==="x"){q++;for(;q<X;q++){if(Q=Z[q],Q==="_")continue;if(!kW(Z.charCodeAt(q)))return!1;W=!0}return W&&Q!=="_"}if(Q==="o"){q++;for(;q<X;q++){if(Q=Z[q],Q==="_")continue;if(!SW(Z.charCodeAt(q)))return!1;W=!0}return W&&Q!=="_"}}if(Q==="_")return!1;for(;q<X;q++){if(Q=Z[q],Q==="_")continue;if(!bW(Z.charCodeAt(q)))return!1;W=!0}if(!W||Q==="_")return!1;return!0}function yW(Z){var X=Z,q=1,W;if(X.indexOf("_")!==-1)X=X.replace(/_/g,"");if(W=X[0],W==="-"||W==="+"){if(W==="-")q=-1;X=X.slice(1),W=X[0]}if(X==="0")return 0;if(W==="0"){if(X[1]==="b")return q*parseInt(X.slice(2),2);if(X[1]==="x")return q*parseInt(X.slice(2),16);if(X[1]==="o")return q*parseInt(X.slice(2),8)}return q*parseInt(X,10)}function gW(Z){return Object.prototype.toString.call(Z)==="[object Number]"&&(Z%1===0&&!a.isNegativeZero(Z))}function mW(Z){if(Z===null)return!1;if(!hW.test(Z)||Z[Z.length-1]==="_")return!1;return!0}function fW(Z){var X,q;if(X=Z.replace(/_/g,"").toLowerCase(),q=X[0]==="-"?-1:1,"+-".indexOf(X[0])>=0)X=X.slice(1);if(X===".inf")return q===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(X===".nan")return NaN;return q*parseFloat(X,10)}function dW(Z,X){var q;if(isNaN(Z))switch(X){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===Z)switch(X){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===Z)switch(X){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(a.isNegativeZero(Z))return"-0.0";return q=Z.toString(10),uW.test(q)?q.replace("e",".e"):q}function cW(Z){return Object.prototype.toString.call(Z)==="[object Number]"&&(Z%1!==0||a.isNegativeZero(Z))}function lW(Z){if(Z===null)return!1;if(i8.exec(Z)!==null)return!0;if(r8.exec(Z)!==null)return!0;return!1}function pW(Z){var X,q,W,Q,J,z,Y,U=0,K=null,V,B,H;if(X=i8.exec(Z),X===null)X=r8.exec(Z);if(X===null)throw Error("Date resolve error");if(q=+X[1],W=+X[2]-1,Q=+X[3],!X[4])return new Date(Date.UTC(q,W,Q));if(J=+X[4],z=+X[5],Y=+X[6],X[7]){U=X[7].slice(0,3);while(U.length<3)U+="0";U=+U}if(X[9]){if(V=+X[10],B=+(X[11]||0),K=(V*60+B)*60000,X[9]==="-")K=-K}if(H=new Date(Date.UTC(q,W,Q,J,z,Y,U)),K)H.setTime(H.getTime()-K);return H}function nW(Z){return Z.toISOString()}function iW(Z){return Z==="<<"||Z===null}function rW(Z){if(Z===null)return!1;var X,q,W=0,Q=Z.length,J=M5;for(q=0;q<Q;q++){if(X=J.indexOf(Z.charAt(q)),X>64)continue;if(X<0)return!1;W+=6}return W%8===0}function aW(Z){var X,q,W=Z.replace(/[\r\n=]/g,""),Q=W.length,J=M5,z=0,Y=[];for(X=0;X<Q;X++){if(X%4===0&&X)Y.push(z>>16&255),Y.push(z>>8&255),Y.push(z&255);z=z<<6|J.indexOf(W.charAt(X))}if(q=Q%4*6,q===0)Y.push(z>>16&255),Y.push(z>>8&255),Y.push(z&255);else if(q===18)Y.push(z>>10&255),Y.push(z>>2&255);else if(q===12)Y.push(z>>4&255);return new Uint8Array(Y)}function sW(Z){var X="",q=0,W,Q,J=Z.length,z=M5;for(W=0;W<J;W++){if(W%3===0&&W)X+=z[q>>18&63],X+=z[q>>12&63],X+=z[q>>6&63],X+=z[q&63];q=(q<<8)+Z[W]}if(Q=J%3,Q===0)X+=z[q>>18&63],X+=z[q>>12&63],X+=z[q>>6&63],X+=z[q&63];else if(Q===2)X+=z[q>>10&63],X+=z[q>>4&63],X+=z[q<<2&63],X+=z[64];else if(Q===1)X+=z[q>>2&63],X+=z[q<<4&63],X+=z[64],X+=z[64];return X}function oW(Z){return Object.prototype.toString.call(Z)==="[object Uint8Array]"}function ZQ(Z){if(Z===null)return!0;var X=[],q,W,Q,J,z,Y=Z;for(q=0,W=Y.length;q<W;q+=1){if(Q=Y[q],z=!1,eW.call(Q)!=="[object Object]")return!1;for(J in Q)if(tW.call(Q,J))if(!z)z=!0;else return!1;if(!z)return!1;if(X.indexOf(J)===-1)X.push(J);else return!1}return!0}function XQ(Z){return Z!==null?Z:[]}function WQ(Z){if(Z===null)return!0;var X,q,W,Q,J,z=Z;J=Array(z.length);for(X=0,q=z.length;X<q;X+=1){if(W=z[X],qQ.call(W)!=="[object Object]")return!1;if(Q=Object.keys(W),Q.length!==1)return!1;J[X]=[Q[0],W[Q[0]]]}return!0}function QQ(Z){if(Z===null)return[];var X,q,W,Q,J,z=Z;J=Array(z.length);for(X=0,q=z.length;X<q;X+=1)W=z[X],Q=Object.keys(W),J[X]=[Q[0],W[Q[0]]];return J}function zQ(Z){if(Z===null)return!0;var X,q=Z;for(X in q)if(JQ.call(q,X)){if(q[X]!==null)return!1}return!0}function GQ(Z){return Z!==null?Z:{}}function D8(Z){return Object.prototype.toString.call(Z)}function h0(Z){return Z===10||Z===13}function j6(Z){return Z===9||Z===32}function F0(Z){return Z===9||Z===32||Z===10||Z===13}function i6(Z){return Z===44||Z===91||Z===93||Z===123||Z===125}function BQ(Z){var X;if(48<=Z&&Z<=57)return Z-48;if(X=Z|32,97<=X&&X<=102)return X-97+10;return-1}function HQ(Z){if(Z===120)return 2;if(Z===117)return 4;if(Z===85)return 8;return 0}function $Q(Z){if(48<=Z&&Z<=57)return Z-48;return-1}function N8(Z){return Z===48?"\x00":Z===97?"\x07":Z===98?"\b":Z===116?"\t":Z===9?"\t":Z===110?`
|
|
27
|
-
`:Z===118?"\v":Z===102?"\f":Z===114?"\r":Z===101?"\x1B":Z===32?" ":Z===34?'"':Z===47?"/":Z===92?"\\":Z===78?"
":Z===95?" ":Z===76?"\u2028":Z===80?"\u2029":""}function FQ(Z){if(Z<=65535)return String.fromCharCode(Z);return String.fromCharCode((Z-65536>>10)+55296,(Z-65536&1023)+56320)}function J9(Z,X,q){if(X==="__proto__")Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,writable:!0,value:q});else Z[X]=q}function AQ(Z,X){this.input=Z,this.filename=X.filename||null,this.schema=X.schema||L5,this.onWarning=X.onWarning||null,this.legacy=X.legacy||!1,this.json=X.json||!1,this.listener=X.listener||null,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.firstTabInLine=-1,this.documents=[]}function Y9(Z,X){var q={name:Z.filename,buffer:Z.input.slice(0,-1),position:Z.position,line:Z.line,column:Z.position-Z.lineStart};return q.snippet=wW(q),new K0(X,q)}function
|
|
28
|
-
`,X-1)}function MQ(Z,X,q){var W,Q,J,z,Y,U,K,V,B=Z.kind,H=Z.result,$;if($=Z.input.charCodeAt(Z.position),F0($)||i6($)||$===35||$===38||$===42||$===33||$===124||$===62||$===39||$===34||$===37||$===64||$===96)return!1;if($===63||$===45){if(Q=Z.input.charCodeAt(Z.position+1),F0(Q)||q&&i6(Q))return!1}Z.kind="scalar",Z.result="",J=z=Z.position,Y=!1;while($!==0){if($===58){if(Q=Z.input.charCodeAt(Z.position+1),F0(Q)||q&&i6(Q))break}else if($===35){if(W=Z.input.charCodeAt(Z.position-1),F0(W))break}else if(Z.position===Z.lineStart&&z1(Z)||q&&i6($))break;else if(h0($))if(U=Z.line,K=Z.lineStart,V=Z.lineIndent,i(Z,!1,-1),Z.lineIndent>=X){Y=!0,$=Z.input.charCodeAt(Z.position);continue}else{Z.position=z,Z.line=U,Z.lineStart=K,Z.lineIndent=V;break}if(Y)U6(Z,J,z,!1),w5(Z,Z.line-U),J=z=Z.position,Y=!1;if(!j6($))z=Z.position+1;$=Z.input.charCodeAt(++Z.position)}if(U6(Z,J,z,!1),Z.result)return!0;return Z.kind=B,Z.result=H,!1}function LQ(Z,X){var q,W,Q;if(q=Z.input.charCodeAt(Z.position),q!==39)return!1;Z.kind="scalar",Z.result="",Z.position++,W=Q=Z.position;while((q=Z.input.charCodeAt(Z.position))!==0)if(q===39)if(U6(Z,W,Z.position,!0),q=Z.input.charCodeAt(++Z.position),q===39)W=Z.position,Z.position++,Q=Z.position;else return!0;else if(h0(q))U6(Z,W,Q,!0),w5(Z,i(Z,!1,X)),W=Q=Z.position;else if(Z.position===Z.lineStart&&z1(Z))
|
|
27
|
+
`:Z===118?"\v":Z===102?"\f":Z===114?"\r":Z===101?"\x1B":Z===32?" ":Z===34?'"':Z===47?"/":Z===92?"\\":Z===78?"
":Z===95?" ":Z===76?"\u2028":Z===80?"\u2029":""}function FQ(Z){if(Z<=65535)return String.fromCharCode(Z);return String.fromCharCode((Z-65536>>10)+55296,(Z-65536&1023)+56320)}function J9(Z,X,q){if(X==="__proto__")Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,writable:!0,value:q});else Z[X]=q}function AQ(Z,X){this.input=Z,this.filename=X.filename||null,this.schema=X.schema||L5,this.onWarning=X.onWarning||null,this.legacy=X.legacy||!1,this.json=X.json||!1,this.listener=X.listener||null,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.firstTabInLine=-1,this.documents=[]}function Y9(Z,X){var q={name:Z.filename,buffer:Z.input.slice(0,-1),position:Z.position,line:Z.line,column:Z.position-Z.lineStart};return q.snippet=wW(q),new K0(X,q)}function _(Z,X){throw Y9(Z,X)}function W1(Z,X){if(Z.onWarning)Z.onWarning.call(null,Y9(Z,X))}function U6(Z,X,q,W){var Q,J,z,Y;if(X<q){if(Y=Z.input.slice(X,q),W){for(Q=0,J=Y.length;Q<J;Q+=1)if(z=Y.charCodeAt(Q),!(z===9||32<=z&&z<=1114111))_(Z,"expected valid JSON character")}else if(UQ.test(Y))_(Z,"the stream contains non-printable characters");Z.result+=Y}}function R8(Z,X,q,W){var Q,J,z,Y;if(!a.isObject(q))_(Z,"cannot merge mappings; the provided source object is unacceptable");Q=Object.keys(q);for(z=0,Y=Q.length;z<Y;z+=1)if(J=Q[z],!K6.call(X,J))J9(X,J,q[J]),W[J]=!0}function r6(Z,X,q,W,Q,J,z,Y,U){var K,V;if(Array.isArray(Q)){Q=Array.prototype.slice.call(Q);for(K=0,V=Q.length;K<V;K+=1){if(Array.isArray(Q[K]))_(Z,"nested arrays are not supported inside keys");if(typeof Q==="object"&&D8(Q[K])==="[object Object]")Q[K]="[object Object]"}}if(typeof Q==="object"&&D8(Q)==="[object Object]")Q="[object Object]";if(Q=String(Q),X===null)X={};if(W==="tag:yaml.org,2002:merge")if(Array.isArray(J))for(K=0,V=J.length;K<V;K+=1)R8(Z,X,J[K],q);else R8(Z,X,J,q);else{if(!Z.json&&!K6.call(q,Q)&&K6.call(X,Q))Z.line=z||Z.line,Z.lineStart=Y||Z.lineStart,Z.position=U||Z.position,_(Z,"duplicated mapping key");J9(X,Q,J),delete q[Q]}return X}function I5(Z){var X=Z.input.charCodeAt(Z.position);if(X===10)Z.position++;else if(X===13){if(Z.position++,Z.input.charCodeAt(Z.position)===10)Z.position++}else _(Z,"a line break is expected");Z.line+=1,Z.lineStart=Z.position,Z.firstTabInLine=-1}function i(Z,X,q){var W=0,Q=Z.input.charCodeAt(Z.position);while(Q!==0){while(j6(Q)){if(Q===9&&Z.firstTabInLine===-1)Z.firstTabInLine=Z.position;Q=Z.input.charCodeAt(++Z.position)}if(X&&Q===35)do Q=Z.input.charCodeAt(++Z.position);while(Q!==10&&Q!==13&&Q!==0);if(h0(Q)){I5(Z),Q=Z.input.charCodeAt(Z.position),W++,Z.lineIndent=0;while(Q===32)Z.lineIndent++,Q=Z.input.charCodeAt(++Z.position)}else break}if(q!==-1&&W!==0&&Z.lineIndent<q)W1(Z,"deficient indentation");return W}function z1(Z){var X=Z.position,q;if(q=Z.input.charCodeAt(X),(q===45||q===46)&&q===Z.input.charCodeAt(X+1)&&q===Z.input.charCodeAt(X+2)){if(X+=3,q=Z.input.charCodeAt(X),q===0||F0(q))return!0}return!1}function w5(Z,X){if(X===1)Z.result+=" ";else if(X>1)Z.result+=a.repeat(`
|
|
28
|
+
`,X-1)}function MQ(Z,X,q){var W,Q,J,z,Y,U,K,V,B=Z.kind,H=Z.result,$;if($=Z.input.charCodeAt(Z.position),F0($)||i6($)||$===35||$===38||$===42||$===33||$===124||$===62||$===39||$===34||$===37||$===64||$===96)return!1;if($===63||$===45){if(Q=Z.input.charCodeAt(Z.position+1),F0(Q)||q&&i6(Q))return!1}Z.kind="scalar",Z.result="",J=z=Z.position,Y=!1;while($!==0){if($===58){if(Q=Z.input.charCodeAt(Z.position+1),F0(Q)||q&&i6(Q))break}else if($===35){if(W=Z.input.charCodeAt(Z.position-1),F0(W))break}else if(Z.position===Z.lineStart&&z1(Z)||q&&i6($))break;else if(h0($))if(U=Z.line,K=Z.lineStart,V=Z.lineIndent,i(Z,!1,-1),Z.lineIndent>=X){Y=!0,$=Z.input.charCodeAt(Z.position);continue}else{Z.position=z,Z.line=U,Z.lineStart=K,Z.lineIndent=V;break}if(Y)U6(Z,J,z,!1),w5(Z,Z.line-U),J=z=Z.position,Y=!1;if(!j6($))z=Z.position+1;$=Z.input.charCodeAt(++Z.position)}if(U6(Z,J,z,!1),Z.result)return!0;return Z.kind=B,Z.result=H,!1}function LQ(Z,X){var q,W,Q;if(q=Z.input.charCodeAt(Z.position),q!==39)return!1;Z.kind="scalar",Z.result="",Z.position++,W=Q=Z.position;while((q=Z.input.charCodeAt(Z.position))!==0)if(q===39)if(U6(Z,W,Z.position,!0),q=Z.input.charCodeAt(++Z.position),q===39)W=Z.position,Z.position++,Q=Z.position;else return!0;else if(h0(q))U6(Z,W,Q,!0),w5(Z,i(Z,!1,X)),W=Q=Z.position;else if(Z.position===Z.lineStart&&z1(Z))_(Z,"unexpected end of the document within a single quoted scalar");else Z.position++,Q=Z.position;_(Z,"unexpected end of the stream within a single quoted scalar")}function IQ(Z,X){var q,W,Q,J,z,Y;if(Y=Z.input.charCodeAt(Z.position),Y!==34)return!1;Z.kind="scalar",Z.result="",Z.position++,q=W=Z.position;while((Y=Z.input.charCodeAt(Z.position))!==0)if(Y===34)return U6(Z,q,Z.position,!0),Z.position++,!0;else if(Y===92){if(U6(Z,q,Z.position,!0),Y=Z.input.charCodeAt(++Z.position),h0(Y))i(Z,!1,X);else if(Y<256&&z9[Y])Z.result+=G9[Y],Z.position++;else if((z=HQ(Y))>0){Q=z,J=0;for(;Q>0;Q--)if(Y=Z.input.charCodeAt(++Z.position),(z=BQ(Y))>=0)J=(J<<4)+z;else _(Z,"expected hexadecimal character");Z.result+=FQ(J),Z.position++}else _(Z,"unknown escape sequence");q=W=Z.position}else if(h0(Y))U6(Z,q,W,!0),w5(Z,i(Z,!1,X)),q=W=Z.position;else if(Z.position===Z.lineStart&&z1(Z))_(Z,"unexpected end of the document within a double quoted scalar");else Z.position++,W=Z.position;_(Z,"unexpected end of the stream within a double quoted scalar")}function wQ(Z,X){var q=!0,W,Q,J,z=Z.tag,Y,U=Z.anchor,K,V,B,H,$,F=Object.create(null),L,A,I,M;if(M=Z.input.charCodeAt(Z.position),M===91)V=93,$=!1,Y=[];else if(M===123)V=125,$=!0,Y={};else return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Y;M=Z.input.charCodeAt(++Z.position);while(M!==0){if(i(Z,!0,X),M=Z.input.charCodeAt(Z.position),M===V)return Z.position++,Z.tag=z,Z.anchor=U,Z.kind=$?"mapping":"sequence",Z.result=Y,!0;else if(!q)_(Z,"missed comma between flow collection entries");else if(M===44)_(Z,"expected the node content, but found ','");if(A=L=I=null,B=H=!1,M===63){if(K=Z.input.charCodeAt(Z.position+1),F0(K))B=H=!0,Z.position++,i(Z,!0,X)}if(W=Z.line,Q=Z.lineStart,J=Z.position,a6(Z,X,X1,!1,!0),A=Z.tag,L=Z.result,i(Z,!0,X),M=Z.input.charCodeAt(Z.position),(H||Z.line===W)&&M===58)B=!0,M=Z.input.charCodeAt(++Z.position),i(Z,!0,X),a6(Z,X,X1,!1,!0),I=Z.result;if($)r6(Z,Y,F,A,L,I,W,Q,J);else if(B)Y.push(r6(Z,null,F,A,L,I,W,Q,J));else Y.push(L);if(i(Z,!0,X),M=Z.input.charCodeAt(Z.position),M===44)q=!0,M=Z.input.charCodeAt(++Z.position);else q=!1}_(Z,"unexpected end of the stream within a flow collection")}function DQ(Z,X){var q,W,Q=V5,J=!1,z=!1,Y=X,U=0,K=!1,V,B;if(B=Z.input.charCodeAt(Z.position),B===124)W=!1;else if(B===62)W=!0;else return!1;Z.kind="scalar",Z.result="";while(B!==0)if(B=Z.input.charCodeAt(++Z.position),B===43||B===45)if(V5===Q)Q=B===43?w8:YQ;else _(Z,"repeat of a chomping mode identifier");else if((V=$Q(B))>=0)if(V===0)_(Z,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!z)Y=X+V-1,z=!0;else _(Z,"repeat of an indentation width identifier");else break;if(j6(B)){do B=Z.input.charCodeAt(++Z.position);while(j6(B));if(B===35)do B=Z.input.charCodeAt(++Z.position);while(!h0(B)&&B!==0)}while(B!==0){I5(Z),Z.lineIndent=0,B=Z.input.charCodeAt(Z.position);while((!z||Z.lineIndent<Y)&&B===32)Z.lineIndent++,B=Z.input.charCodeAt(++Z.position);if(!z&&Z.lineIndent>Y)Y=Z.lineIndent;if(h0(B)){U++;continue}if(Z.lineIndent<Y){if(Q===w8)Z.result+=a.repeat(`
|
|
29
29
|
`,J?1+U:U);else if(Q===V5){if(J)Z.result+=`
|
|
30
30
|
`}break}if(W)if(j6(B))K=!0,Z.result+=a.repeat(`
|
|
31
31
|
`,J?1+U:U);else if(K)K=!1,Z.result+=a.repeat(`
|
|
32
32
|
`,U+1);else if(U===0){if(J)Z.result+=" "}else Z.result+=a.repeat(`
|
|
33
33
|
`,U);else Z.result+=a.repeat(`
|
|
34
|
-
`,J?1+U:U);J=!0,z=!0,U=0,q=Z.position;while(!h0(B)&&B!==0)B=Z.input.charCodeAt(++Z.position);U6(Z,q,Z.position,!1)}return!0}function _8(Z,X){var q,W=Z.tag,Q=Z.anchor,J=[],z,Y=!1,U;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=J;U=Z.input.charCodeAt(Z.position);while(U!==0){if(Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,
|
|
35
|
-
`;if(Z.charCodeAt(0)===65279)Z=Z.slice(1)}var q=new AQ(Z,X),W=Z.indexOf("\x00");if(W!==-1)q.position=W,
|
|
34
|
+
`,J?1+U:U);J=!0,z=!0,U=0,q=Z.position;while(!h0(B)&&B!==0)B=Z.input.charCodeAt(++Z.position);U6(Z,q,Z.position,!1)}return!0}function _8(Z,X){var q,W=Z.tag,Q=Z.anchor,J=[],z,Y=!1,U;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=J;U=Z.input.charCodeAt(Z.position);while(U!==0){if(Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,_(Z,"tab characters must not be used in indentation");if(U!==45)break;if(z=Z.input.charCodeAt(Z.position+1),!F0(z))break;if(Y=!0,Z.position++,i(Z,!0,-1)){if(Z.lineIndent<=X){J.push(null),U=Z.input.charCodeAt(Z.position);continue}}if(q=Z.line,a6(Z,X,q9,!1,!0),J.push(Z.result),i(Z,!0,-1),U=Z.input.charCodeAt(Z.position),(Z.line===q||Z.lineIndent>X)&&U!==0)_(Z,"bad indentation of a sequence entry");else if(Z.lineIndent<X)break}if(Y)return Z.tag=W,Z.anchor=Q,Z.kind="sequence",Z.result=J,!0;return!1}function NQ(Z,X,q){var W,Q,J,z,Y,U,K=Z.tag,V=Z.anchor,B={},H=Object.create(null),$=null,F=null,L=null,A=!1,I=!1,M;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=B;M=Z.input.charCodeAt(Z.position);while(M!==0){if(!A&&Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,_(Z,"tab characters must not be used in indentation");if(W=Z.input.charCodeAt(Z.position+1),J=Z.line,(M===63||M===58)&&F0(W)){if(M===63){if(A)r6(Z,B,H,$,F,null,z,Y,U),$=F=L=null;I=!0,A=!0,Q=!0}else if(A)A=!1,Q=!0;else _(Z,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");Z.position+=1,M=W}else{if(z=Z.line,Y=Z.lineStart,U=Z.position,!a6(Z,q,X9,!1,!0))break;if(Z.line===J){M=Z.input.charCodeAt(Z.position);while(j6(M))M=Z.input.charCodeAt(++Z.position);if(M===58){if(M=Z.input.charCodeAt(++Z.position),!F0(M))_(Z,"a whitespace character is expected after the key-value separator within a block mapping");if(A)r6(Z,B,H,$,F,null,z,Y,U),$=F=L=null;I=!0,A=!1,Q=!1,$=Z.tag,F=Z.result}else if(I)_(Z,"can not read an implicit mapping pair; a colon is missed");else return Z.tag=K,Z.anchor=V,!0}else if(I)_(Z,"can not read a block mapping entry; a multiline key may not be an implicit key");else return Z.tag=K,Z.anchor=V,!0}if(Z.line===J||Z.lineIndent>X){if(A)z=Z.line,Y=Z.lineStart,U=Z.position;if(a6(Z,X,q1,!0,Q))if(A)F=Z.result;else L=Z.result;if(!A)r6(Z,B,H,$,F,L,z,Y,U),$=F=L=null;i(Z,!0,-1),M=Z.input.charCodeAt(Z.position)}if((Z.line===J||Z.lineIndent>X)&&M!==0)_(Z,"bad indentation of a mapping entry");else if(Z.lineIndent<X)break}if(A)r6(Z,B,H,$,F,null,z,Y,U);if(I)Z.tag=K,Z.anchor=V,Z.kind="mapping",Z.result=B;return I}function TQ(Z){var X,q=!1,W=!1,Q,J,z;if(z=Z.input.charCodeAt(Z.position),z!==33)return!1;if(Z.tag!==null)_(Z,"duplication of a tag property");if(z=Z.input.charCodeAt(++Z.position),z===60)q=!0,z=Z.input.charCodeAt(++Z.position);else if(z===33)W=!0,Q="!!",z=Z.input.charCodeAt(++Z.position);else Q="!";if(X=Z.position,q){do z=Z.input.charCodeAt(++Z.position);while(z!==0&&z!==62);if(Z.position<Z.length)J=Z.input.slice(X,Z.position),z=Z.input.charCodeAt(++Z.position);else _(Z,"unexpected end of the stream within a verbatim tag")}else{while(z!==0&&!F0(z)){if(z===33)if(!W){if(Q=Z.input.slice(X-1,Z.position+1),!W9.test(Q))_(Z,"named tag handle cannot contain such characters");W=!0,X=Z.position+1}else _(Z,"tag suffix cannot contain exclamation marks");z=Z.input.charCodeAt(++Z.position)}if(J=Z.input.slice(X,Z.position),VQ.test(J))_(Z,"tag suffix cannot contain flow indicator characters")}if(J&&!Q9.test(J))_(Z,"tag name cannot contain such characters: "+J);try{J=decodeURIComponent(J)}catch(Y){_(Z,"tag name is malformed: "+J)}if(q)Z.tag=J;else if(K6.call(Z.tagMap,Q))Z.tag=Z.tagMap[Q]+J;else if(Q==="!")Z.tag="!"+J;else if(Q==="!!")Z.tag="tag:yaml.org,2002:"+J;else _(Z,'undeclared tag handle "'+Q+'"');return!0}function RQ(Z){var X,q;if(q=Z.input.charCodeAt(Z.position),q!==38)return!1;if(Z.anchor!==null)_(Z,"duplication of an anchor property");q=Z.input.charCodeAt(++Z.position),X=Z.position;while(q!==0&&!F0(q)&&!i6(q))q=Z.input.charCodeAt(++Z.position);if(Z.position===X)_(Z,"name of an anchor node must contain at least one character");return Z.anchor=Z.input.slice(X,Z.position),!0}function _Q(Z){var X,q,W;if(W=Z.input.charCodeAt(Z.position),W!==42)return!1;W=Z.input.charCodeAt(++Z.position),X=Z.position;while(W!==0&&!F0(W)&&!i6(W))W=Z.input.charCodeAt(++Z.position);if(Z.position===X)_(Z,"name of an alias node must contain at least one character");if(q=Z.input.slice(X,Z.position),!K6.call(Z.anchorMap,q))_(Z,'unidentified alias "'+q+'"');return Z.result=Z.anchorMap[q],i(Z,!0,-1),!0}function a6(Z,X,q,W,Q){var J,z,Y,U=1,K=!1,V=!1,B,H,$,F,L,A;if(Z.listener!==null)Z.listener("open",Z);if(Z.tag=null,Z.anchor=null,Z.kind=null,Z.result=null,J=z=Y=q1===q||q9===q,W){if(i(Z,!0,-1)){if(K=!0,Z.lineIndent>X)U=1;else if(Z.lineIndent===X)U=0;else if(Z.lineIndent<X)U=-1}}if(U===1)while(TQ(Z)||RQ(Z))if(i(Z,!0,-1)){if(K=!0,Y=J,Z.lineIndent>X)U=1;else if(Z.lineIndent===X)U=0;else if(Z.lineIndent<X)U=-1}else Y=!1;if(Y)Y=K||Q;if(U===1||q1===q){if(X1===q||X9===q)L=X;else L=X+1;if(A=Z.position-Z.lineStart,U===1)if(Y&&(_8(Z,A)||NQ(Z,A,L))||wQ(Z,L))V=!0;else{if(z&&DQ(Z,L)||LQ(Z,L)||IQ(Z,L))V=!0;else if(_Q(Z)){if(V=!0,Z.tag!==null||Z.anchor!==null)_(Z,"alias node should not have any properties")}else if(MQ(Z,L,X1===q)){if(V=!0,Z.tag===null)Z.tag="?"}if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}else if(U===0)V=Y&&_8(Z,A)}if(Z.tag===null){if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}else if(Z.tag==="?"){if(Z.result!==null&&Z.kind!=="scalar")_(Z,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+Z.kind+'"');for(B=0,H=Z.implicitTypes.length;B<H;B+=1)if(F=Z.implicitTypes[B],F.resolve(Z.result)){if(Z.result=F.construct(Z.result),Z.tag=F.tag,Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result;break}}else if(Z.tag!=="!"){if(K6.call(Z.typeMap[Z.kind||"fallback"],Z.tag))F=Z.typeMap[Z.kind||"fallback"][Z.tag];else{F=null,$=Z.typeMap.multi[Z.kind||"fallback"];for(B=0,H=$.length;B<H;B+=1)if(Z.tag.slice(0,$[B].tag.length)===$[B].tag){F=$[B];break}}if(!F)_(Z,"unknown tag !<"+Z.tag+">");if(Z.result!==null&&F.kind!==Z.kind)_(Z,"unacceptable node kind for !<"+Z.tag+'> tag; it should be "'+F.kind+'", not "'+Z.kind+'"');if(!F.resolve(Z.result,Z.tag))_(Z,"cannot resolve a node with !<"+Z.tag+"> explicit tag");else if(Z.result=F.construct(Z.result,Z.tag),Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}if(Z.listener!==null)Z.listener("close",Z);return Z.tag!==null||Z.anchor!==null||V}function PQ(Z){var X=Z.position,q,W,Q,J=!1,z;Z.version=null,Z.checkLineBreaks=Z.legacy,Z.tagMap=Object.create(null),Z.anchorMap=Object.create(null);while((z=Z.input.charCodeAt(Z.position))!==0){if(i(Z,!0,-1),z=Z.input.charCodeAt(Z.position),Z.lineIndent>0||z!==37)break;J=!0,z=Z.input.charCodeAt(++Z.position),q=Z.position;while(z!==0&&!F0(z))z=Z.input.charCodeAt(++Z.position);if(W=Z.input.slice(q,Z.position),Q=[],W.length<1)_(Z,"directive name must not be less than one character in length");while(z!==0){while(j6(z))z=Z.input.charCodeAt(++Z.position);if(z===35){do z=Z.input.charCodeAt(++Z.position);while(z!==0&&!h0(z));break}if(h0(z))break;q=Z.position;while(z!==0&&!F0(z))z=Z.input.charCodeAt(++Z.position);Q.push(Z.input.slice(q,Z.position))}if(z!==0)I5(Z);if(K6.call(T8,W))T8[W](Z,W,Q);else W1(Z,'unknown document directive "'+W+'"')}if(i(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,i(Z,!0,-1);else if(J)_(Z,"directives end mark is expected");if(a6(Z,Z.lineIndent-1,q1,!1,!0),i(Z,!0,-1),Z.checkLineBreaks&&KQ.test(Z.input.slice(X,Z.position)))W1(Z,"non-ASCII line breaks are interpreted as content");if(Z.documents.push(Z.result),Z.position===Z.lineStart&&z1(Z)){if(Z.input.charCodeAt(Z.position)===46)Z.position+=3,i(Z,!0,-1);return}if(Z.position<Z.length-1)_(Z,"end of the stream or a document separator is expected");else return}function U9(Z,X){if(Z=String(Z),X=X||{},Z.length!==0){if(Z.charCodeAt(Z.length-1)!==10&&Z.charCodeAt(Z.length-1)!==13)Z+=`
|
|
35
|
+
`;if(Z.charCodeAt(0)===65279)Z=Z.slice(1)}var q=new AQ(Z,X),W=Z.indexOf("\x00");if(W!==-1)q.position=W,_(q,"null byte is not allowed in input");q.input+="\x00";while(q.input.charCodeAt(q.position)===32)q.lineIndent+=1,q.position+=1;while(q.position<q.length-1)PQ(q);return q.documents}function jQ(Z,X,q){if(X!==null&&typeof X==="object"&&typeof q>"u")q=X,X=null;var W=U9(Z,q);if(typeof X!=="function")return W;for(var Q=0,J=W.length;Q<J;Q+=1)X(W[Q])}function EQ(Z,X){var q=U9(Z,X);if(q.length===0)return;else if(q.length===1)return q[0];throw new K0("expected a single document in the stream, but found more")}function aQ(Z,X){var q,W,Q,J,z,Y,U;if(X===null)return{};q={},W=Object.keys(X);for(Q=0,J=W.length;Q<J;Q+=1){if(z=W[Q],Y=String(X[z]),z.slice(0,2)==="!!")z="tag:yaml.org,2002:"+z.slice(2);if(U=Z.compiledTypeMap.fallback[z],U&&B9.call(U.styleAliases,Y))Y=U.styleAliases[Y];q[z]=Y}return q}function sQ(Z){var X,q,W;if(X=Z.toString(16).toUpperCase(),Z<=255)q="x",W=2;else if(Z<=65535)q="u",W=4;else if(Z<=4294967295)q="U",W=8;else throw new K0("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+q+a.repeat("0",W-X.length)+X}function tQ(Z){this.schema=Z.schema||L5,this.indent=Math.max(1,Z.indent||2),this.noArrayIndent=Z.noArrayIndent||!1,this.skipInvalid=Z.skipInvalid||!1,this.flowLevel=a.isNothing(Z.flowLevel)?-1:Z.flowLevel,this.styleMap=aQ(this.schema,Z.styles||null),this.sortKeys=Z.sortKeys||!1,this.lineWidth=Z.lineWidth||80,this.noRefs=Z.noRefs||!1,this.noCompatMode=Z.noCompatMode||!1,this.condenseFlow=Z.condenseFlow||!1,this.quotingType=Z.quotingType==='"'?w4:oQ,this.forceQuotes=Z.forceQuotes||!1,this.replacer=typeof Z.replacer==="function"?Z.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function P8(Z,X){var q=a.repeat(" ",X),W=0,Q=-1,J="",z,Y=Z.length;while(W<Y){if(Q=Z.indexOf(`
|
|
36
36
|
`,W),Q===-1)z=Z.slice(W),W=Y;else z=Z.slice(W,Q+1),W=Q+1;if(z.length&&z!==`
|
|
37
37
|
`)J+=q;J+=z}return J}function $5(Z,X){return`
|
|
38
38
|
`+a.repeat(" ",Z.indent*X)}function eQ(Z,X){var q,W,Q;for(q=0,W=Z.implicitTypes.length;q<W;q+=1)if(Q=Z.implicitTypes[q],Q.resolve(X))return!0;return!1}function J1(Z){return Z===SQ||Z===xQ}function D4(Z){return 32<=Z&&Z<=126||161<=Z&&Z<=55295&&Z!==8232&&Z!==8233||57344<=Z&&Z<=65533&&Z!==D5||65536<=Z&&Z<=1114111}function j8(Z){return D4(Z)&&Z!==D5&&Z!==kQ&&Z!==I4}function E8(Z,X,q){var W=j8(Z),Q=W&&!J1(Z);return(q?W:W&&Z!==H9&&Z!==$9&&Z!==F9&&Z!==A9&&Z!==M9)&&Z!==H5&&!(X===Q1&&!Q)||j8(X)&&!J1(X)&&Z===H5||X===Q1&&Q}function ZJ(Z){return D4(Z)&&Z!==D5&&!J1(Z)&&Z!==fQ&&Z!==cQ&&Z!==Q1&&Z!==H9&&Z!==$9&&Z!==F9&&Z!==A9&&Z!==M9&&Z!==H5&&Z!==gQ&&Z!==mQ&&Z!==bQ&&Z!==nQ&&Z!==uQ&&Z!==dQ&&Z!==hQ&&Z!==vQ&&Z!==yQ&&Z!==lQ&&Z!==pQ}function XJ(Z){return!J1(Z)&&Z!==Q1}function M4(Z,X){var q=Z.charCodeAt(X),W;if(q>=55296&&q<=56319&&X+1<Z.length){if(W=Z.charCodeAt(X+1),W>=56320&&W<=57343)return(q-55296)*1024+W-56320+65536}return q}function L9(Z){var X=/^\n* /;return X.test(Z)}function qJ(Z,X,q,W,Q,J,z,Y){var U,K=0,V=null,B=!1,H=!1,$=W!==-1,F=-1,L=ZJ(M4(Z,0))&&XJ(M4(Z,Z.length-1));if(X||z)for(U=0;U<Z.length;K>=65536?U+=2:U++){if(K=M4(Z,U),!D4(K))return n6;L=L&&E8(K,V,Y),V=K}else{for(U=0;U<Z.length;K>=65536?U+=2:U++){if(K=M4(Z,U),K===I4){if(B=!0,$)H=H||U-F-1>W&&Z[F+1]!==" ",F=U}else if(!D4(K))return n6;L=L&&E8(K,V,Y),V=K}H=H||$&&(U-F-1>W&&Z[F+1]!==" ")}if(!B&&!H){if(L&&!z&&!Q(Z))return I9;return J===w4?n6:F5}if(q>9&&L9(Z))return n6;if(!z)return H?D9:w9;return J===w4?n6:F5}function WJ(Z,X,q,W,Q){Z.dump=function(){if(X.length===0)return Z.quotingType===w4?'""':"''";if(!Z.noCompatMode){if(iQ.indexOf(X)!==-1||rQ.test(X))return Z.quotingType===w4?'"'+X+'"':"'"+X+"'"}var J=Z.indent*Math.max(1,q),z=Z.lineWidth===-1?-1:Math.max(Math.min(Z.lineWidth,40),Z.lineWidth-J),Y=W||Z.flowLevel>-1&&q>=Z.flowLevel;function U(K){return eQ(Z,K)}switch(qJ(X,Y,Z.indent,z,U,Z.quotingType,Z.forceQuotes&&!W,Q)){case I9:return X;case F5:return"'"+X.replace(/'/g,"''")+"'";case w9:return"|"+C8(X,Z.indent)+O8(P8(X,J));case D9:return">"+C8(X,Z.indent)+O8(P8(QJ(X,z),J));case n6:return'"'+JJ(X)+'"';default:throw new K0("impossible error: invalid scalar style")}}()}function C8(Z,X){var q=L9(Z)?String(X):"",W=Z[Z.length-1]===`
|
|
@@ -48,10 +48,10 @@ Parsed value is empty`);else return z}catch(z){if(!z&&X.continueOnError)throw ne
|
|
|
48
48
|
`,Z.length-Q>X&&z>Q)U+=Z.slice(Q,z)+`
|
|
49
49
|
`+Z.slice(z+1);else U+=Z.slice(Q);return U.slice(1)}function JJ(Z){var X="",q=0,W;for(var Q=0;Q<Z.length;q>=65536?Q+=2:Q++)if(q=M4(Z,Q),W=z0[q],!W&&D4(q)){if(X+=Z[Q],q>=65536)X+=Z[Q+1]}else X+=W||sQ(q);return X}function zJ(Z,X,q){var W="",Q=Z.tag,J,z,Y;for(J=0,z=q.length;J<z;J+=1){if(Y=q[J],Z.replacer)Y=Z.replacer.call(q,String(J),Y);if(s0(Z,X,Y,!1,!1)||typeof Y>"u"&&s0(Z,X,null,!1,!1)){if(W!=="")W+=","+(!Z.condenseFlow?" ":"");W+=Z.dump}}Z.tag=Q,Z.dump="["+W+"]"}function k8(Z,X,q,W){var Q="",J=Z.tag,z,Y,U;for(z=0,Y=q.length;z<Y;z+=1){if(U=q[z],Z.replacer)U=Z.replacer.call(q,String(z),U);if(s0(Z,X+1,U,!0,!0,!1,!0)||typeof U>"u"&&s0(Z,X+1,null,!0,!0,!1,!0)){if(!W||Q!=="")Q+=$5(Z,X);if(Z.dump&&I4===Z.dump.charCodeAt(0))Q+="-";else Q+="- ";Q+=Z.dump}}Z.tag=J,Z.dump=Q||"[]"}function GJ(Z,X,q){var W="",Q=Z.tag,J=Object.keys(q),z,Y,U,K,V;for(z=0,Y=J.length;z<Y;z+=1){if(V="",W!=="")V+=", ";if(Z.condenseFlow)V+='"';if(U=J[z],K=q[U],Z.replacer)K=Z.replacer.call(q,U,K);if(!s0(Z,X,U,!1,!1))continue;if(Z.dump.length>1024)V+="? ";if(V+=Z.dump+(Z.condenseFlow?'"':"")+":"+(Z.condenseFlow?"":" "),!s0(Z,X,K,!1,!1))continue;V+=Z.dump,W+=V}Z.tag=Q,Z.dump="{"+W+"}"}function YJ(Z,X,q,W){var Q="",J=Z.tag,z=Object.keys(q),Y,U,K,V,B,H;if(Z.sortKeys===!0)z.sort();else if(typeof Z.sortKeys==="function")z.sort(Z.sortKeys);else if(Z.sortKeys)throw new K0("sortKeys must be a boolean or a function");for(Y=0,U=z.length;Y<U;Y+=1){if(H="",!W||Q!=="")H+=$5(Z,X);if(K=z[Y],V=q[K],Z.replacer)V=Z.replacer.call(q,K,V);if(!s0(Z,X+1,K,!0,!0,!0))continue;if(B=Z.tag!==null&&Z.tag!=="?"||Z.dump&&Z.dump.length>1024,B)if(Z.dump&&I4===Z.dump.charCodeAt(0))H+="?";else H+="? ";if(H+=Z.dump,B)H+=$5(Z,X);if(!s0(Z,X+1,V,!0,B))continue;if(Z.dump&&I4===Z.dump.charCodeAt(0))H+=":";else H+=": ";H+=Z.dump,Q+=H}Z.tag=J,Z.dump=Q||"{}"}function S8(Z,X,q){var W,Q,J,z,Y,U;Q=q?Z.explicitTypes:Z.implicitTypes;for(J=0,z=Q.length;J<z;J+=1)if(Y=Q[J],(Y.instanceOf||Y.predicate)&&(!Y.instanceOf||typeof X==="object"&&X instanceof Y.instanceOf)&&(!Y.predicate||Y.predicate(X))){if(q)if(Y.multi&&Y.representName)Z.tag=Y.representName(X);else Z.tag=Y.tag;else Z.tag="?";if(Y.represent){if(U=Z.styleMap[Y.tag]||Y.defaultStyle,V9.call(Y.represent)==="[object Function]")W=Y.represent(X,U);else if(B9.call(Y.represent,U))W=Y.represent[U](X,U);else throw new K0("!<"+Y.tag+'> tag resolver accepts not "'+U+'" style');Z.dump=W}return!0}return!1}function s0(Z,X,q,W,Q,J,z){if(Z.tag=null,Z.dump=q,!S8(Z,q,!1))S8(Z,q,!0);var Y=V9.call(Z.dump),U=W,K;if(W)W=Z.flowLevel<0||Z.flowLevel>X;var V=Y==="[object Object]"||Y==="[object Array]",B,H;if(V)B=Z.duplicates.indexOf(q),H=B!==-1;if(Z.tag!==null&&Z.tag!=="?"||H||Z.indent!==2&&X>0)Q=!1;if(H&&Z.usedDuplicates[B])Z.dump="*ref_"+B;else{if(V&&H&&!Z.usedDuplicates[B])Z.usedDuplicates[B]=!0;if(Y==="[object Object]"){if(W&&Object.keys(Z.dump).length!==0){if(YJ(Z,X,Z.dump,Q),H)Z.dump="&ref_"+B+Z.dump}else if(GJ(Z,X,Z.dump),H)Z.dump="&ref_"+B+" "+Z.dump}else if(Y==="[object Array]"){if(W&&Z.dump.length!==0){if(Z.noArrayIndent&&!z&&X>0)k8(Z,X-1,Z.dump,Q);else k8(Z,X,Z.dump,Q);if(H)Z.dump="&ref_"+B+Z.dump}else if(zJ(Z,X,Z.dump),H)Z.dump="&ref_"+B+" "+Z.dump}else if(Y==="[object String]"){if(Z.tag!=="?")WJ(Z,Z.dump,X,J,U)}else if(Y==="[object Undefined]")return!1;else{if(Z.skipInvalid)return!1;throw new K0("unacceptable kind of an object to dump "+Y)}if(Z.tag!==null&&Z.tag!=="?"){if(K=encodeURI(Z.tag[0]==="!"?Z.tag.slice(1):Z.tag).replace(/!/g,"%21"),Z.tag[0]==="!")K="!"+K;else if(K.slice(0,18)==="tag:yaml.org,2002:")K="!!"+K.slice(18);else K="!<"+K+">";Z.dump=K+" "+Z.dump}}return!0}function UJ(Z,X){var q=[],W=[],Q,J;A5(Z,q,W);for(Q=0,J=W.length;Q<J;Q+=1)X.duplicates.push(q[W[Q]]);X.usedDuplicates=Array(J)}function A5(Z,X,q){var W,Q,J;if(Z!==null&&typeof Z==="object")if(Q=X.indexOf(Z),Q!==-1){if(q.indexOf(Q)===-1)q.push(Q)}else if(X.push(Z),Array.isArray(Z))for(Q=0,J=Z.length;Q<J;Q+=1)A5(Z[Q],X,q);else{W=Object.keys(Z);for(Q=0,J=W.length;Q<J;Q+=1)A5(Z[W[Q]],X,q)}}function KJ(Z,X){X=X||{};var q=new tQ(X);if(!q.noRefs)UJ(Z,q);var W=Z;if(q.replacer)W=q.replacer.call({"":W},"",W);if(s0(q,0,W,!0,!0))return q.dump+`
|
|
50
50
|
`;return""}function N5(Z,X){return function(){throw Error("Function yaml."+Z+" is removed in js-yaml 4. Use yaml."+X+" instead, which is now safe by default.")}}var HW,$W,FW,AW,MW,LW,a,K0,wW,DW,NW,W0,y8,g8,h8,m8,f8,u8,d8,c8,hW,uW,l8,p8,n8,i8,r8,a8,s8,M5=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
51
|
-
\r`,o8,tW,eW,t8,qQ,e8,JQ,Z9,L5,K6,X1=1,X9=2,q9=3,q1=4,V5=1,YQ=2,w8=3,UQ,KQ,VQ,W9,Q9,z9,G9,Y6,T8,CQ,OQ,K9,V9,B9,D5=65279,xQ=9,I4=10,kQ=13,SQ=32,bQ=33,vQ=34,H5=35,yQ=37,gQ=38,hQ=39,mQ=42,H9=44,fQ=45,Q1=58,uQ=61,dQ=62,cQ=63,lQ=64,$9=91,F9=93,pQ=96,A9=123,nQ=124,M9=125,z0,iQ,rQ,oQ=1,w4=2,I9=1,F5=2,w9=3,D9=4,n6=5,VJ,BJ,HJ,$J,FJ,T5,AJ,MJ,LJ,IJ,wJ,DJ,NJ,TJ,RJ,_J,R5;var _5=R(()=>{/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */HW=b8,$W=YW,FW=UW,AW=VW,MW=BW,LW=KW,a={isNothing:HW,isObject:$W,toArray:FW,repeat:AW,isNegativeZero:MW,extend:LW};L4.prototype=Object.create(Error.prototype);L4.prototype.constructor=L4;L4.prototype.toString=function(X){return this.name+": "+v8(this,X)};K0=L4;wW=IW,DW=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],NW=["scalar","sequence","mapping"];W0=RW;B5.prototype.extend=function(X){var q=[],W=[];if(X instanceof W0)W.push(X);else if(Array.isArray(X))W=W.concat(X);else if(X&&(Array.isArray(X.implicit)||Array.isArray(X.explicit))){if(X.implicit)q=q.concat(X.implicit);if(X.explicit)W=W.concat(X.explicit)}else throw new K0("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");q.forEach(function(J){if(!(J instanceof W0))throw new K0("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(J.loadKind&&J.loadKind!=="scalar")throw new K0("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(J.multi)throw new K0("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),W.forEach(function(J){if(!(J instanceof W0))throw new K0("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var Q=Object.create(B5.prototype);return Q.implicit=(this.implicit||[]).concat(q),Q.explicit=(this.explicit||[]).concat(W),Q.compiledImplicit=I8(Q,"implicit"),Q.compiledExplicit=I8(Q,"explicit"),Q.compiledTypeMap=_W(Q.compiledImplicit,Q.compiledExplicit),Q};y8=B5,g8=new W0("tag:yaml.org,2002:str",{kind:"scalar",construct:function(Z){return Z!==null?Z:""}}),h8=new W0("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(Z){return Z!==null?Z:[]}}),m8=new W0("tag:yaml.org,2002:map",{kind:"mapping",construct:function(Z){return Z!==null?Z:{}}}),f8=new y8({explicit:[g8,h8,m8]});u8=new W0("tag:yaml.org,2002:null",{kind:"scalar",resolve:PW,construct:jW,predicate:EW,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});d8=new W0("tag:yaml.org,2002:bool",{kind:"scalar",resolve:CW,construct:OW,predicate:xW,represent:{lowercase:function(Z){return Z?"true":"false"},uppercase:function(Z){return Z?"TRUE":"FALSE"},camelcase:function(Z){return Z?"True":"False"}},defaultStyle:"lowercase"});c8=new W0("tag:yaml.org,2002:int",{kind:"scalar",resolve:vW,construct:yW,predicate:gW,represent:{binary:function(Z){return Z>=0?"0b"+Z.toString(2):"-0b"+Z.toString(2).slice(1)},octal:function(Z){return Z>=0?"0o"+Z.toString(8):"-0o"+Z.toString(8).slice(1)},decimal:function(Z){return Z.toString(10)},hexadecimal:function(Z){return Z>=0?"0x"+Z.toString(16).toUpperCase():"-0x"+Z.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),hW=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");uW=/^[-+]?[0-9]+e/;l8=new W0("tag:yaml.org,2002:float",{kind:"scalar",resolve:mW,construct:fW,predicate:cW,represent:dW,defaultStyle:"lowercase"}),p8=f8.extend({implicit:[u8,d8,c8,l8]}),n8=p8,i8=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r8=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]))?))?$");a8=new W0("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:lW,construct:pW,instanceOf:Date,represent:nW});s8=new W0("tag:yaml.org,2002:merge",{kind:"scalar",resolve:iW});o8=new W0("tag:yaml.org,2002:binary",{kind:"scalar",resolve:rW,construct:aW,predicate:oW,represent:sW}),tW=Object.prototype.hasOwnProperty,eW=Object.prototype.toString;t8=new W0("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ZQ,construct:XQ}),qQ=Object.prototype.toString;e8=new W0("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:WQ,construct:QQ}),JQ=Object.prototype.hasOwnProperty;Z9=new W0("tag:yaml.org,2002:set",{kind:"mapping",resolve:zQ,construct:GQ}),L5=n8.extend({implicit:[a8,s8],explicit:[o8,t8,e8,Z9]}),K6=Object.prototype.hasOwnProperty,UQ=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,KQ=/[\x85\u2028\u2029]/,VQ=/[,\[\]\{\}]/,W9=/^(?:!|!!|![a-z\-]+!)$/i,Q9=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;z9=Array(256),G9=Array(256);for(Y6=0;Y6<256;Y6++)z9[Y6]=N8(Y6)?1:0,G9[Y6]=N8(Y6);T8={YAML:function(X,q,W){var Q,J,z;if(X.version!==null)
|
|
51
|
+
\r`,o8,tW,eW,t8,qQ,e8,JQ,Z9,L5,K6,X1=1,X9=2,q9=3,q1=4,V5=1,YQ=2,w8=3,UQ,KQ,VQ,W9,Q9,z9,G9,Y6,T8,CQ,OQ,K9,V9,B9,D5=65279,xQ=9,I4=10,kQ=13,SQ=32,bQ=33,vQ=34,H5=35,yQ=37,gQ=38,hQ=39,mQ=42,H9=44,fQ=45,Q1=58,uQ=61,dQ=62,cQ=63,lQ=64,$9=91,F9=93,pQ=96,A9=123,nQ=124,M9=125,z0,iQ,rQ,oQ=1,w4=2,I9=1,F5=2,w9=3,D9=4,n6=5,VJ,BJ,HJ,$J,FJ,T5,AJ,MJ,LJ,IJ,wJ,DJ,NJ,TJ,RJ,_J,R5;var _5=R(()=>{/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */HW=b8,$W=YW,FW=UW,AW=VW,MW=BW,LW=KW,a={isNothing:HW,isObject:$W,toArray:FW,repeat:AW,isNegativeZero:MW,extend:LW};L4.prototype=Object.create(Error.prototype);L4.prototype.constructor=L4;L4.prototype.toString=function(X){return this.name+": "+v8(this,X)};K0=L4;wW=IW,DW=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],NW=["scalar","sequence","mapping"];W0=RW;B5.prototype.extend=function(X){var q=[],W=[];if(X instanceof W0)W.push(X);else if(Array.isArray(X))W=W.concat(X);else if(X&&(Array.isArray(X.implicit)||Array.isArray(X.explicit))){if(X.implicit)q=q.concat(X.implicit);if(X.explicit)W=W.concat(X.explicit)}else throw new K0("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");q.forEach(function(J){if(!(J instanceof W0))throw new K0("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(J.loadKind&&J.loadKind!=="scalar")throw new K0("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(J.multi)throw new K0("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),W.forEach(function(J){if(!(J instanceof W0))throw new K0("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var Q=Object.create(B5.prototype);return Q.implicit=(this.implicit||[]).concat(q),Q.explicit=(this.explicit||[]).concat(W),Q.compiledImplicit=I8(Q,"implicit"),Q.compiledExplicit=I8(Q,"explicit"),Q.compiledTypeMap=_W(Q.compiledImplicit,Q.compiledExplicit),Q};y8=B5,g8=new W0("tag:yaml.org,2002:str",{kind:"scalar",construct:function(Z){return Z!==null?Z:""}}),h8=new W0("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(Z){return Z!==null?Z:[]}}),m8=new W0("tag:yaml.org,2002:map",{kind:"mapping",construct:function(Z){return Z!==null?Z:{}}}),f8=new y8({explicit:[g8,h8,m8]});u8=new W0("tag:yaml.org,2002:null",{kind:"scalar",resolve:PW,construct:jW,predicate:EW,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});d8=new W0("tag:yaml.org,2002:bool",{kind:"scalar",resolve:CW,construct:OW,predicate:xW,represent:{lowercase:function(Z){return Z?"true":"false"},uppercase:function(Z){return Z?"TRUE":"FALSE"},camelcase:function(Z){return Z?"True":"False"}},defaultStyle:"lowercase"});c8=new W0("tag:yaml.org,2002:int",{kind:"scalar",resolve:vW,construct:yW,predicate:gW,represent:{binary:function(Z){return Z>=0?"0b"+Z.toString(2):"-0b"+Z.toString(2).slice(1)},octal:function(Z){return Z>=0?"0o"+Z.toString(8):"-0o"+Z.toString(8).slice(1)},decimal:function(Z){return Z.toString(10)},hexadecimal:function(Z){return Z>=0?"0x"+Z.toString(16).toUpperCase():"-0x"+Z.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),hW=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");uW=/^[-+]?[0-9]+e/;l8=new W0("tag:yaml.org,2002:float",{kind:"scalar",resolve:mW,construct:fW,predicate:cW,represent:dW,defaultStyle:"lowercase"}),p8=f8.extend({implicit:[u8,d8,c8,l8]}),n8=p8,i8=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r8=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]))?))?$");a8=new W0("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:lW,construct:pW,instanceOf:Date,represent:nW});s8=new W0("tag:yaml.org,2002:merge",{kind:"scalar",resolve:iW});o8=new W0("tag:yaml.org,2002:binary",{kind:"scalar",resolve:rW,construct:aW,predicate:oW,represent:sW}),tW=Object.prototype.hasOwnProperty,eW=Object.prototype.toString;t8=new W0("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ZQ,construct:XQ}),qQ=Object.prototype.toString;e8=new W0("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:WQ,construct:QQ}),JQ=Object.prototype.hasOwnProperty;Z9=new W0("tag:yaml.org,2002:set",{kind:"mapping",resolve:zQ,construct:GQ}),L5=n8.extend({implicit:[a8,s8],explicit:[o8,t8,e8,Z9]}),K6=Object.prototype.hasOwnProperty,UQ=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,KQ=/[\x85\u2028\u2029]/,VQ=/[,\[\]\{\}]/,W9=/^(?:!|!!|![a-z\-]+!)$/i,Q9=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;z9=Array(256),G9=Array(256);for(Y6=0;Y6<256;Y6++)z9[Y6]=N8(Y6)?1:0,G9[Y6]=N8(Y6);T8={YAML:function(X,q,W){var Q,J,z;if(X.version!==null)_(X,"duplication of %YAML directive");if(W.length!==1)_(X,"YAML directive accepts exactly one argument");if(Q=/^([0-9]+)\.([0-9]+)$/.exec(W[0]),Q===null)_(X,"ill-formed argument of the YAML directive");if(J=parseInt(Q[1],10),z=parseInt(Q[2],10),J!==1)_(X,"unacceptable YAML version of the document");if(X.version=W[0],X.checkLineBreaks=z<2,z!==1&&z!==2)W1(X,"unsupported YAML version of the document")},TAG:function(X,q,W){var Q,J;if(W.length!==2)_(X,"TAG directive accepts exactly two arguments");if(Q=W[0],J=W[1],!W9.test(Q))_(X,"ill-formed tag handle (first argument) of the TAG directive");if(K6.call(X.tagMap,Q))_(X,'there is a previously declared suffix for "'+Q+'" tag handle');if(!Q9.test(J))_(X,"ill-formed tag prefix (second argument) of the TAG directive");try{J=decodeURIComponent(J)}catch(z){_(X,"tag prefix is malformed: "+J)}X.tagMap[Q]=J}};CQ=jQ,OQ=EQ,K9={loadAll:CQ,load:OQ},V9=Object.prototype.toString,B9=Object.prototype.hasOwnProperty,z0={};z0[0]="\\0";z0[7]="\\a";z0[8]="\\b";z0[9]="\\t";z0[10]="\\n";z0[11]="\\v";z0[12]="\\f";z0[13]="\\r";z0[27]="\\e";z0[34]="\\\"";z0[92]="\\\\";z0[133]="\\N";z0[160]="\\_";z0[8232]="\\L";z0[8233]="\\P";iQ=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],rQ=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;VJ=KJ,BJ={dump:VJ};HJ=W0,$J=y8,FJ=f8,T5=p8,AJ=n8,MJ=L5,LJ=K9.load,IJ=K9.loadAll,wJ=BJ.dump,DJ=K0,NJ={binary:o8,float:l8,map:m8,null:u8,pairs:e8,set:Z9,timestamp:a8,bool:d8,int:c8,merge:s8,omap:t8,seq:h8,str:g8},TJ=N5("safeLoad","load"),RJ=N5("safeLoadAll","loadAll"),_J=N5("safeDump","dump"),R5={Type:HJ,Schema:$J,FAILSAFE_SCHEMA:FJ,JSON_SCHEMA:T5,CORE_SCHEMA:AJ,DEFAULT_SCHEMA:MJ,load:LJ,loadAll:IJ,dump:wJ,YAMLException:DJ,types:NJ,safeLoad:TJ,safeLoadAll:RJ,safeDump:_J}});var N9;var T9=R(()=>{P0();_5();_5();N9={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 R5.load(X,{schema:T5})}catch{try{return R5.load(X)}catch(q){throw new _0(q?.message||"Parser Error",Z.url)}}else return X}}});var PJ,R9;var _9=R(()=>{P0();PJ=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,R9={order:300,allowEmpty:!0,encoding:"utf8",canParse(Z){return(typeof Z.data==="string"||Buffer.isBuffer(Z.data))&&PJ.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 _0("data is not text",Z.url)}}});var jJ,P9;var j9=R(()=>{jJ=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,P9={order:400,allowEmpty:!0,canParse(Z){return Buffer.isBuffer(Z.data)&&jJ.test(Z.url)},parse(Z){if(Buffer.isBuffer(Z.data))return Z.data;else return Buffer.from(Z.data)}}});var P5;var j5=R(()=>{H0();P0();P5={order:100,canRead(Z){return p4(Z.url)},async read(Z){let X,q=await import("fs");try{X=d6(Z.url)}catch(W){let Q=W;throw Q.message=`Malformed URI: ${Z.url}: ${Q.message}`,new x0(Q,Z.url)}if(X.endsWith("/")||X.endsWith("\\"))X=X.slice(0,-1);try{return await q.promises.readFile(X)}catch(W){let Q=W;throw Q.message=`Error opening file ${X}: ${Q.message}`,new x0(Q,X)}}}});async function E9(Z,X,q){Z=u6(Z);let W=q||[];W.push(Z.href);try{let Q=await EJ(Z,X);if(Q.status>=400){let J=Error(`HTTP ERROR ${Q.status}`);throw J.status=Q.status,J}else if(Q.status>=300)if(!Number.isNaN(X.redirects)&&W.length>X.redirects){let J=Error(`Error downloading ${W[0]}.
|
|
52
52
|
Too many redirects:
|
|
53
53
|
${W.join(`
|
|
54
|
-
`)}`);throw J.status=Q.status,new x0(J)}else if(!("location"in Q.headers)||!Q.headers.location){let J=Error(`HTTP ${Q.status} redirect with no location header`);throw J.status=Q.status,J}else{let J=r(Z.href,Q.headers.location);return E9(J,X,W)}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 x0(J,Z.href)}}async function EJ(Z,X){let q,W;if(X.timeout&&typeof AbortController<"u")q=new AbortController,W=setTimeout(()=>q.abort(),X.timeout);let Q=await fetch(Z,{method:"GET",headers:X.headers||{},credentials:X.withCredentials?"include":"same-origin",signal:q?q.signal:null});if(W)clearTimeout(W);return Q}var E5;var C5=R(()=>{H0();P0();E5={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return G8(Z.url)&&(!this.safeUrlResolver||!X5(Z.url))},read(Z){let X=u6(Z.url);if(typeof window<"u"&&!X.protocol)X.protocol=u6(location.href).protocol;return E9(X,this)}}});function k9(Z,X){if(C9(X)){let q=Object.keys(X).filter((W)=>!["__proto__","constructor","prototype"].includes(W));for(let W=0;W<q.length;W++){let Q=q[W],J=X[Q],z=Z[Q];if(C9(J))Z[Q]=k9(z||{},J);else if(J!==void 0)Z[Q]=J}}return Z}function C9(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var O9=()=>{return{parse:{json:{...M8},yaml:{...N9},text:{...R9},binary:{...P9}},resolve:{file:{...P5},http:{...E5},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},x9=(Z)=>{let X=O9();if(Z)k9(X,Z);return X};var O5=R(()=>{L8();T9();_9();j9();j5();C5()});function CJ(Z){let X,q,W,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")q=J[1],W=J[2];else q=void 0,W=J[1];else X="",q=J[0],W=J[1];try{W=x9(W)}catch(z){console.error(`JSON Schema Ref Parser: Error normalizing options: ${z}`)}if(!W.mutateInputSchema&&typeof q==="object")q=JSON.parse(JSON.stringify(q));return{path:X,schema:q,options:W,callback:Q}}var N4;var S9=R(()=>{O5();N4=CJ});function OJ(Z,X){if(!X.resolve?.external)return Promise.resolve();try{let q=Z.$refs._root$Ref.dynamicIdScope?U0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,W=x5(Z.schema,Z.$refs._root$Ref.path+"#",q,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,X);return Promise.all(W)}catch(q){return Promise.reject(q)}}function x5(Z,X,q,W,Q,J,z,Y){z||=new Set;let U=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!z.has(Z)){z.add(Z);let K=q;if(d.isExternal$Ref(Z))U.push(xJ(Z,X,K,W,Q,J));let V=Object.keys(Z);for(let B of V){let H=$0.join(X,B),$=Z[B],F=W&&$&&typeof $==="object"&&!ArrayBuffer.isView($)?U0(K,$):K;U=U.concat(x5($,H,F,W,Q,J,z,Y))}}return U}async function xJ(Z,X,q,W,Q,J){let Y=J.dereference?.externalReferenceResolution==="root"?R6():W?q:X,U=r(Y,Z.$ref),K=n(U),V=Q._get$Ref(K);if(V)return Promise.resolve(V.value);try{let B=Z.$ref,H={url:U,baseUrl:Y};if(typeof B==="string")H.reference=B;let $=await Z1(H,Q,J),F=Q._get$Ref(K),L=x5($,K+"#",K,F?.dynamicIdScope??!1,Q,J,new Set,!0);return Promise.all(L)}catch(B){if(!J?.continueOnError||!g0(B))throw B;if(Q._$refs[K])B.source=decodeURI(n(X)),B.path=n4(v0(X));return[]}}var b9;var v9=R(()=>{p6();$4();Y5();H0();P0();_6();b9=OJ});function kJ(Z,X){let q=Z.$refs._root$Ref.dynamicIdScope?U0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,W=[];k5(Z,"schema",Z.$refs._root$Ref.path+"#",q,Z.$refs._root$Ref.dynamicIdScope,"#",0,W,Z.$refs,X);let Q=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(SJ(W,X,Q),(X.bundle||{}).optimizeInternalRefs!==!1)yJ(W,Z.schema)}function k5(Z,X,q,W,Q,J,z,Y,U,K){let V=X===null?Z:Z[X],B=K.bundle||{},H=B.excludedPathMatcher||(()=>!1);if(V&&typeof V==="object"&&!ArrayBuffer.isView(V)&&!H(J)){let $=W;if(d.isAllowed$Ref(V))y9(Z,X,q,$,Q,J,z,Y,U,K);else{let F=Object.keys(V).sort((L,A)=>{if(L==="definitions"||L==="$defs")return-1;else if(A==="definitions"||A==="$defs")return 1;else return L.length-A.length});for(let L of F){let A=$0.join(q,L),I=$0.join(J,L),M=V[L],_=Q&&M&&typeof M==="object"&&!ArrayBuffer.isView(M)?U0($,M):$;if(d.isAllowed$Ref(M))y9(V,L,A,_,Q,I,z,Y,U,K);else k5(V,L,A,_,Q,I,z,Y,U,K);if(M&&typeof M==="object"&&!Array.isArray(M)){if("$ref"in M)B?.onBundle?.(M.$ref,V[L],V,L)}}}}}function y9(Z,X,q,W,Q,J,z,Y,U,K){let V=X===null?Z:Z[X],B=r(Q?W:q,V.$ref),H=U._resolve(B,J,K);if(H===null)return;let F=$0.parse(J).length,L=n(H.path),A=v0(H.path),I=L!==U._root$Ref.path&&!U._aliases[L],M=d.isExtended$Ref(V);z+=H.indirections;let _=bJ(Y,Z,X);if(_)if(F<_.depth||z<_.indirections)vJ(Y,_);else return;if(Y.push({$ref:V,parent:Z,key:X,pathFromRoot:J,depth:F,file:L,hash:A,value:H.value,circular:H.circular,extended:M,external:I,indirections:z}),!_||I)k5(H.value,null,H.path,H.$ref.path,H.$ref.dynamicIdScope,J,z+1,Y,U,K)}function SJ(Z,X,q){Z.sort((z,Y)=>{if(z.file!==Y.file)return z.file<Y.file?-1:1;else if(z.hash!==Y.hash)return z.hash<Y.hash?-1:1;else if(z.circular!==Y.circular)return z.circular?-1:1;else if(z.extended!==Y.extended)return z.extended?1:-1;else if(z.indirections!==Y.indirections)return z.indirections-Y.indirections;else if(z.depth!==Y.depth)return z.depth-Y.depth;else{let U=Math.max(z.pathFromRoot.lastIndexOf("/definitions"),z.pathFromRoot.lastIndexOf("/$defs")),K=Math.max(Y.pathFromRoot.lastIndexOf("/definitions"),Y.pathFromRoot.lastIndexOf("/$defs"));if(U!==K)return K-U;else return z.pathFromRoot.length-Y.pathFromRoot.length}});let W,Q,J;for(let z of Z){let Y=X.bundle||{};if(!z.external){if(Y.optimizeInternalRefs!==!1)z.$ref.$ref=z.hash}else if(z.file===W&&z.hash===Q)if(q&&g9(Z,z))z.$ref.$ref=q+J;else z.$ref.$ref=J;else if(z.file===W&&z.hash.indexOf(Q+"/")===0){let U=$0.join(J,$0.parse(z.hash.replace(Q,"#")));if(q&&g9(Z,z))z.$ref.$ref=q+U;else z.$ref.$ref=U}else if(W=z.file,Q=z.hash,J=z.pathFromRoot,z.$ref=z.parent[z.key]=d.dereference(z.$ref,z.value,X),z.circular)z.$ref.$ref=z.pathFromRoot}}function bJ(Z,X,q){for(let W of Z)if(W&&W.parent===X&&W.key===q)return W;return}function vJ(Z,X){let q=Z.indexOf(X);Z.splice(q,1)}function yJ(Z,X){for(let q of Z){if(!q.$ref||typeof q.$ref!=="object"||!("$ref"in q.$ref))continue;let W=q.$ref.$ref;if(typeof W!=="string"||!W.startsWith("#/"))continue;let Q=gJ(X,W);if(Q!==W)q.$ref.$ref=Q}}function gJ(Z,X){if(!X.startsWith("#/"))return X;let q=X.slice(2).split("/"),W=Z,Q=[];for(let z of q){if(W===null||W===void 0||typeof W!=="object")return X;if("$ref"in W&&typeof W.$ref==="string"&&W.$ref.startsWith("#/")){let K=W.$ref.slice(2).split("/");if(Q.length=0,Q.push(...K),W=hJ(Z,W.$ref),W===null||W===void 0||typeof W!=="object")return X}let Y=z.replace(/~1/g,"/").replace(/~0/g,"~"),U=Array.isArray(W)?parseInt(Y):Y;W=W[U],Q.push(z)}return"#/"+Q.join("/")}function hJ(Z,X){if(!X.startsWith("#/"))return;let q=X.slice(2).split("/"),W=Z;for(let Q of q){if(W===null||W===void 0||typeof W!=="object")return;let J=Q.replace(/~1/g,"/").replace(/~0/g,"~"),z=Array.isArray(W)?parseInt(J):J;W=W[z]}return W}function g9(Z,X){for(let q of Z){if(q.pathFromRoot==="#"||q.pathFromRoot==="#/")continue;if(X.pathFromRoot.startsWith(q.pathFromRoot+"/")){if(q.value&&typeof q.value==="object"&&"$id"in q.value)return!0}}return!1}var h9;var m9=R(()=>{p6();$4();H0();_6();h9=kJ});function mJ(Z,X){let q=Date.now(),W=Z.$refs._root$Ref.dynamicIdScope?U0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=S5(Z.schema,Z.$refs._root$Ref.path,W,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,X,q,0);Z.$refs.circular=Q.circular,Z.schema=Q.value}function S5(Z,X,q,W,Q,J,z,Y,U,K,V,B){let H,$={value:Z,circular:!1};u9(V,K);let F=K.dereference||{},L=F.maxDepth??500;if(B>L)throw RangeError(`Maximum dereference depth (${L}) exceeded at ${Q}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let A=F.excludedPathMatcher||(()=>!1);if(F?.circular==="ignore"||!z.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!A(Q)){J.add(Z),z.add(Z);let I=q;if(d.isAllowed$Ref(Z,K))H=f9(Z,X,I,W,Q,J,z,Y,U,K,V,B),$.circular=H.circular,$.value=H.value;else for(let M of Object.keys(Z)){u9(V,K);let _=$0.join(X,M),k=$0.join(Q,M);if(A(k))continue;let b=Z[M],C=W&&b&&typeof b==="object"&&!ArrayBuffer.isView(b)?U0(I,b):I,T;if(d.isAllowed$Ref(b,K)){if(H=f9(b,_,C,W,k,J,z,Y,U,K,V,B),T=H.circular,Z[M]!==H.value){let j=new Map;if(F?.preservedProperties){if(typeof Z[M]==="object"&&!Array.isArray(Z[M]))F?.preservedProperties.forEach((g)=>{if(g in Z[M])j.set(g,Z[M][g])})}let S=H.value;if(F?.cloneReferences&&!T&&S&&typeof S==="object")S=structuredClone(S);if(Z[M]=S,F?.preservedProperties){if(j.size&&typeof Z[M]==="object"&&!Array.isArray(Z[M]))j.forEach((g,f)=>{Z[M][f]=g})}F?.onDereference?.(b.$ref,Z[M],Z,M)}}else if(!J.has(b)){if(H=S5(b,_,C,W,k,J,z,Y,U,K,V,B+1),T=H.circular,Z[M]!==H.value)Z[M]=H.value}else T=G1(_,U,K);$.circular=$.circular||T}J.delete(Z)}}return $}function f9(Z,X,q,W,Q,J,z,Y,U,K,V,B){let F=d.isExternal$Ref(Z)&&K?.dereference?.externalReferenceResolution==="root"?R6():W?q:X,L=r(F,Z.$ref),A=Y.get(L);if(A){if(!A.circular){let C=Object.keys(Z);if(C.length>1){let T={};for(let j of C)if(j!=="$ref"&&!(j in A.value))T[j]=Z[j];return{circular:A.circular,value:Object.assign({},A.value,T)}}return A}if(typeof A.value==="object"&&"$ref"in A.value&&"$ref"in Z){if(A.value.$ref===Z.$ref)return G1(X,U,K),A}else return G1(X,U,K),A}let I=U._resolve(L,X,K);if(I===null)return{circular:!1,value:null};let M=I.circular,_=M||J.has(I.value);if(_)G1(X,U,K);let k=d.dereference(Z,I.value,K);if(!_){let C=S5(k,I.path,I.$ref.path,I.$ref.dynamicIdScope,Q,J,z,Y,U,K,V,B+1);_=C.circular,k=C.value}if(_&&!M&&K.dereference?.circular==="ignore")k=Z;if(M)k.$ref=Q;let b={circular:_,value:k};if(Object.keys(Z).length===1)Y.set(L,b);return b}function u9(Z,X){if(X&&X.timeoutMs){if(Date.now()-Z>X.timeoutMs)throw new q5(X.timeoutMs)}}function G1(Z,X,q){if(X.circular=!0,q?.dereference?.onCircular?.(Z),!q.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var d9;var c9=R(()=>{p6();$4();H0();_6();P0();d9=mJ});function fJ(){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 b5;var l9=R(()=>{b5=fJ()});function w0(Z,X){if(Z){X.then(function(q){b5(function(){Z(null,q)})},function(q){b5(function(){Z(q)})});return}else return X}var p9=R(()=>{l9()});class o0{schema=null;$refs=new A4;async parse(){let Z=N4(arguments),X;if(!Z.path&&!Z.schema){let W=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return w0(Z.callback,Promise.reject(W))}this.schema=null,this.$refs=new A4;let q="http";if(p4(Z.path))Z.path=Y8(Z.path),q="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let W=u6(Z.schema.$id),Q=W.port??(W.protocol==="https:"?443:80);Z.path=`${W.protocol}//${W.hostname}:${Q}`}if(Z.path=r(R6(),Z.path),Z.schema&&typeof Z.schema==="object"){let W=this.$refs._add(Z.path);W.value=Z.schema,W.pathType=q,W.dynamicIdScope=s4(W.value),o4(this.$refs,W.path,W.value,W.pathType,W.dynamicIdScope),X=Promise.resolve(Z.schema)}else X=Z1(Z.path,this.$refs,Z.options);try{let W=await X;if(W!==null&&typeof W==="object"&&!Buffer.isBuffer(W))return this.schema=W,w0(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,w0(Z.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||W}" is not a valid JSON Schema`)}catch(W){if(!Z.options.continueOnError||!g0(W))return w0(Z.callback,Promise.reject(W));if(this.$refs._$refs[n(Z.path)])this.$refs._$refs[n(Z.path)].addError(W);return w0(Z.callback,Promise.resolve(null))}}static parse(){let Z=new o0;return Z.parse.apply(Z,arguments)}async resolve(){let Z=N4(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await b9(this,Z.options),v5(this),w0(Z.callback,Promise.resolve(this.$refs))}catch(X){return w0(Z.callback,Promise.reject(X))}}static resolve(){let Z=new o0;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new o0;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=N4(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),h9(this,Z.options),v5(this),w0(Z.callback,Promise.resolve(this.schema))}catch(X){return w0(Z.callback,Promise.reject(X))}}static dereference(){let Z=new o0;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=N4(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),d9(this,Z.options),v5(this),w0(Z.callback,Promise.resolve(this.schema))}catch(X){return w0(Z.callback,Promise.reject(X))}}}function v5(Z){if(c6.getParserErrors(Z).length>0)throw new c6(Z)}var VF,BF,HF,n9;var i9=R(()=>{F8();Y5();S9();v9();m9();c9();H0();j5();C5();P0();p9();_6();O5();H0();VF=o0.parse,BF=o0.resolve,HF=o0.bundle,n9=o0.dereference});async function Y1(Z,X={}){let{baseUrl:q="/_jx/server"}=X,W=await n9(Z),Q=l4(W);if(Q.length===0)return null;let J=Q.map(({exportName:Y,src:U})=>`import { ${Y} } from '${U}'`).join(`
|
|
54
|
+
`)}`);throw J.status=Q.status,new x0(J)}else if(!("location"in Q.headers)||!Q.headers.location){let J=Error(`HTTP ${Q.status} redirect with no location header`);throw J.status=Q.status,J}else{let J=r(Z.href,Q.headers.location);return E9(J,X,W)}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 x0(J,Z.href)}}async function EJ(Z,X){let q,W;if(X.timeout&&typeof AbortController<"u")q=new AbortController,W=setTimeout(()=>q.abort(),X.timeout);let Q=await fetch(Z,{method:"GET",headers:X.headers||{},credentials:X.withCredentials?"include":"same-origin",signal:q?q.signal:null});if(W)clearTimeout(W);return Q}var E5;var C5=R(()=>{H0();P0();E5={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return G8(Z.url)&&(!this.safeUrlResolver||!X5(Z.url))},read(Z){let X=u6(Z.url);if(typeof window<"u"&&!X.protocol)X.protocol=u6(location.href).protocol;return E9(X,this)}}});function k9(Z,X){if(C9(X)){let q=Object.keys(X).filter((W)=>!["__proto__","constructor","prototype"].includes(W));for(let W=0;W<q.length;W++){let Q=q[W],J=X[Q],z=Z[Q];if(C9(J))Z[Q]=k9(z||{},J);else if(J!==void 0)Z[Q]=J}}return Z}function C9(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var O9=()=>{return{parse:{json:{...M8},yaml:{...N9},text:{...R9},binary:{...P9}},resolve:{file:{...P5},http:{...E5},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},x9=(Z)=>{let X=O9();if(Z)k9(X,Z);return X};var O5=R(()=>{L8();T9();_9();j9();j5();C5()});function CJ(Z){let X,q,W,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")q=J[1],W=J[2];else q=void 0,W=J[1];else X="",q=J[0],W=J[1];try{W=x9(W)}catch(z){console.error(`JSON Schema Ref Parser: Error normalizing options: ${z}`)}if(!W.mutateInputSchema&&typeof q==="object")q=JSON.parse(JSON.stringify(q));return{path:X,schema:q,options:W,callback:Q}}var N4;var S9=R(()=>{O5();N4=CJ});function OJ(Z,X){if(!X.resolve?.external)return Promise.resolve();try{let q=Z.$refs._root$Ref.dynamicIdScope?U0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,W=x5(Z.schema,Z.$refs._root$Ref.path+"#",q,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,X);return Promise.all(W)}catch(q){return Promise.reject(q)}}function x5(Z,X,q,W,Q,J,z,Y){z||=new Set;let U=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!z.has(Z)){z.add(Z);let K=q;if(d.isExternal$Ref(Z))U.push(xJ(Z,X,K,W,Q,J));let V=Object.keys(Z);for(let B of V){let H=$0.join(X,B),$=Z[B],F=W&&$&&typeof $==="object"&&!ArrayBuffer.isView($)?U0(K,$):K;U=U.concat(x5($,H,F,W,Q,J,z,Y))}}return U}async function xJ(Z,X,q,W,Q,J){let Y=J.dereference?.externalReferenceResolution==="root"?R6():W?q:X,U=r(Y,Z.$ref),K=n(U),V=Q._get$Ref(K);if(V)return Promise.resolve(V.value);try{let B=Z.$ref,H={url:U,baseUrl:Y};if(typeof B==="string")H.reference=B;let $=await Z1(H,Q,J),F=Q._get$Ref(K),L=x5($,K+"#",K,F?.dynamicIdScope??!1,Q,J,new Set,!0);return Promise.all(L)}catch(B){if(!J?.continueOnError||!g0(B))throw B;if(Q._$refs[K])B.source=decodeURI(n(X)),B.path=n4(v0(X));return[]}}var b9;var v9=R(()=>{p6();$4();Y5();H0();P0();_6();b9=OJ});function kJ(Z,X){let q=Z.$refs._root$Ref.dynamicIdScope?U0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,W=[];k5(Z,"schema",Z.$refs._root$Ref.path+"#",q,Z.$refs._root$Ref.dynamicIdScope,"#",0,W,Z.$refs,X);let Q=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(SJ(W,X,Q),(X.bundle||{}).optimizeInternalRefs!==!1)yJ(W,Z.schema)}function k5(Z,X,q,W,Q,J,z,Y,U,K){let V=X===null?Z:Z[X],B=K.bundle||{},H=B.excludedPathMatcher||(()=>!1);if(V&&typeof V==="object"&&!ArrayBuffer.isView(V)&&!H(J)){let $=W;if(d.isAllowed$Ref(V))y9(Z,X,q,$,Q,J,z,Y,U,K);else{let F=Object.keys(V).sort((L,A)=>{if(L==="definitions"||L==="$defs")return-1;else if(A==="definitions"||A==="$defs")return 1;else return L.length-A.length});for(let L of F){let A=$0.join(q,L),I=$0.join(J,L),M=V[L],P=Q&&M&&typeof M==="object"&&!ArrayBuffer.isView(M)?U0($,M):$;if(d.isAllowed$Ref(M))y9(V,L,A,P,Q,I,z,Y,U,K);else k5(V,L,A,P,Q,I,z,Y,U,K);if(M&&typeof M==="object"&&!Array.isArray(M)){if("$ref"in M)B?.onBundle?.(M.$ref,V[L],V,L)}}}}}function y9(Z,X,q,W,Q,J,z,Y,U,K){let V=X===null?Z:Z[X],B=r(Q?W:q,V.$ref),H=U._resolve(B,J,K);if(H===null)return;let F=$0.parse(J).length,L=n(H.path),A=v0(H.path),I=L!==U._root$Ref.path&&!U._aliases[L],M=d.isExtended$Ref(V);z+=H.indirections;let P=bJ(Y,Z,X);if(P)if(F<P.depth||z<P.indirections)vJ(Y,P);else return;if(Y.push({$ref:V,parent:Z,key:X,pathFromRoot:J,depth:F,file:L,hash:A,value:H.value,circular:H.circular,extended:M,external:I,indirections:z}),!P||I)k5(H.value,null,H.path,H.$ref.path,H.$ref.dynamicIdScope,J,z+1,Y,U,K)}function SJ(Z,X,q){Z.sort((z,Y)=>{if(z.file!==Y.file)return z.file<Y.file?-1:1;else if(z.hash!==Y.hash)return z.hash<Y.hash?-1:1;else if(z.circular!==Y.circular)return z.circular?-1:1;else if(z.extended!==Y.extended)return z.extended?1:-1;else if(z.indirections!==Y.indirections)return z.indirections-Y.indirections;else if(z.depth!==Y.depth)return z.depth-Y.depth;else{let U=Math.max(z.pathFromRoot.lastIndexOf("/definitions"),z.pathFromRoot.lastIndexOf("/$defs")),K=Math.max(Y.pathFromRoot.lastIndexOf("/definitions"),Y.pathFromRoot.lastIndexOf("/$defs"));if(U!==K)return K-U;else return z.pathFromRoot.length-Y.pathFromRoot.length}});let W,Q,J;for(let z of Z){let Y=X.bundle||{};if(!z.external){if(Y.optimizeInternalRefs!==!1)z.$ref.$ref=z.hash}else if(z.file===W&&z.hash===Q)if(q&&g9(Z,z))z.$ref.$ref=q+J;else z.$ref.$ref=J;else if(z.file===W&&z.hash.indexOf(Q+"/")===0){let U=$0.join(J,$0.parse(z.hash.replace(Q,"#")));if(q&&g9(Z,z))z.$ref.$ref=q+U;else z.$ref.$ref=U}else if(W=z.file,Q=z.hash,J=z.pathFromRoot,z.$ref=z.parent[z.key]=d.dereference(z.$ref,z.value,X),z.circular)z.$ref.$ref=z.pathFromRoot}}function bJ(Z,X,q){for(let W of Z)if(W&&W.parent===X&&W.key===q)return W;return}function vJ(Z,X){let q=Z.indexOf(X);Z.splice(q,1)}function yJ(Z,X){for(let q of Z){if(!q.$ref||typeof q.$ref!=="object"||!("$ref"in q.$ref))continue;let W=q.$ref.$ref;if(typeof W!=="string"||!W.startsWith("#/"))continue;let Q=gJ(X,W);if(Q!==W)q.$ref.$ref=Q}}function gJ(Z,X){if(!X.startsWith("#/"))return X;let q=X.slice(2).split("/"),W=Z,Q=[];for(let z of q){if(W===null||W===void 0||typeof W!=="object")return X;if("$ref"in W&&typeof W.$ref==="string"&&W.$ref.startsWith("#/")){let K=W.$ref.slice(2).split("/");if(Q.length=0,Q.push(...K),W=hJ(Z,W.$ref),W===null||W===void 0||typeof W!=="object")return X}let Y=z.replace(/~1/g,"/").replace(/~0/g,"~"),U=Array.isArray(W)?parseInt(Y):Y;W=W[U],Q.push(z)}return"#/"+Q.join("/")}function hJ(Z,X){if(!X.startsWith("#/"))return;let q=X.slice(2).split("/"),W=Z;for(let Q of q){if(W===null||W===void 0||typeof W!=="object")return;let J=Q.replace(/~1/g,"/").replace(/~0/g,"~"),z=Array.isArray(W)?parseInt(J):J;W=W[z]}return W}function g9(Z,X){for(let q of Z){if(q.pathFromRoot==="#"||q.pathFromRoot==="#/")continue;if(X.pathFromRoot.startsWith(q.pathFromRoot+"/")){if(q.value&&typeof q.value==="object"&&"$id"in q.value)return!0}}return!1}var h9;var m9=R(()=>{p6();$4();H0();_6();h9=kJ});function mJ(Z,X){let q=Date.now(),W=Z.$refs._root$Ref.dynamicIdScope?U0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=S5(Z.schema,Z.$refs._root$Ref.path,W,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,X,q,0);Z.$refs.circular=Q.circular,Z.schema=Q.value}function S5(Z,X,q,W,Q,J,z,Y,U,K,V,B){let H,$={value:Z,circular:!1};u9(V,K);let F=K.dereference||{},L=F.maxDepth??500;if(B>L)throw RangeError(`Maximum dereference depth (${L}) exceeded at ${Q}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let A=F.excludedPathMatcher||(()=>!1);if(F?.circular==="ignore"||!z.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!A(Q)){J.add(Z),z.add(Z);let I=q;if(d.isAllowed$Ref(Z,K))H=f9(Z,X,I,W,Q,J,z,Y,U,K,V,B),$.circular=H.circular,$.value=H.value;else for(let M of Object.keys(Z)){u9(V,K);let P=$0.join(X,M),k=$0.join(Q,M);if(A(k))continue;let b=Z[M],C=W&&b&&typeof b==="object"&&!ArrayBuffer.isView(b)?U0(I,b):I,T;if(d.isAllowed$Ref(b,K)){if(H=f9(b,P,C,W,k,J,z,Y,U,K,V,B),T=H.circular,Z[M]!==H.value){let j=new Map;if(F?.preservedProperties){if(typeof Z[M]==="object"&&!Array.isArray(Z[M]))F?.preservedProperties.forEach((g)=>{if(g in Z[M])j.set(g,Z[M][g])})}let S=H.value;if(F?.cloneReferences&&!T&&S&&typeof S==="object")S=structuredClone(S);if(Z[M]=S,F?.preservedProperties){if(j.size&&typeof Z[M]==="object"&&!Array.isArray(Z[M]))j.forEach((g,f)=>{Z[M][f]=g})}F?.onDereference?.(b.$ref,Z[M],Z,M)}}else if(!J.has(b)){if(H=S5(b,P,C,W,k,J,z,Y,U,K,V,B+1),T=H.circular,Z[M]!==H.value)Z[M]=H.value}else T=G1(P,U,K);$.circular=$.circular||T}J.delete(Z)}}return $}function f9(Z,X,q,W,Q,J,z,Y,U,K,V,B){let F=d.isExternal$Ref(Z)&&K?.dereference?.externalReferenceResolution==="root"?R6():W?q:X,L=r(F,Z.$ref),A=Y.get(L);if(A){if(!A.circular){let C=Object.keys(Z);if(C.length>1){let T={};for(let j of C)if(j!=="$ref"&&!(j in A.value))T[j]=Z[j];return{circular:A.circular,value:Object.assign({},A.value,T)}}return A}if(typeof A.value==="object"&&"$ref"in A.value&&"$ref"in Z){if(A.value.$ref===Z.$ref)return G1(X,U,K),A}else return G1(X,U,K),A}let I=U._resolve(L,X,K);if(I===null)return{circular:!1,value:null};let M=I.circular,P=M||J.has(I.value);if(P)G1(X,U,K);let k=d.dereference(Z,I.value,K);if(!P){let C=S5(k,I.path,I.$ref.path,I.$ref.dynamicIdScope,Q,J,z,Y,U,K,V,B+1);P=C.circular,k=C.value}if(P&&!M&&K.dereference?.circular==="ignore")k=Z;if(M)k.$ref=Q;let b={circular:P,value:k};if(Object.keys(Z).length===1)Y.set(L,b);return b}function u9(Z,X){if(X&&X.timeoutMs){if(Date.now()-Z>X.timeoutMs)throw new q5(X.timeoutMs)}}function G1(Z,X,q){if(X.circular=!0,q?.dereference?.onCircular?.(Z),!q.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var d9;var c9=R(()=>{p6();$4();H0();_6();P0();d9=mJ});function fJ(){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 b5;var l9=R(()=>{b5=fJ()});function w0(Z,X){if(Z){X.then(function(q){b5(function(){Z(null,q)})},function(q){b5(function(){Z(q)})});return}else return X}var p9=R(()=>{l9()});class o0{schema=null;$refs=new A4;async parse(){let Z=N4(arguments),X;if(!Z.path&&!Z.schema){let W=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return w0(Z.callback,Promise.reject(W))}this.schema=null,this.$refs=new A4;let q="http";if(p4(Z.path))Z.path=Y8(Z.path),q="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let W=u6(Z.schema.$id),Q=W.port??(W.protocol==="https:"?443:80);Z.path=`${W.protocol}//${W.hostname}:${Q}`}if(Z.path=r(R6(),Z.path),Z.schema&&typeof Z.schema==="object"){let W=this.$refs._add(Z.path);W.value=Z.schema,W.pathType=q,W.dynamicIdScope=s4(W.value),o4(this.$refs,W.path,W.value,W.pathType,W.dynamicIdScope),X=Promise.resolve(Z.schema)}else X=Z1(Z.path,this.$refs,Z.options);try{let W=await X;if(W!==null&&typeof W==="object"&&!Buffer.isBuffer(W))return this.schema=W,w0(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,w0(Z.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||W}" is not a valid JSON Schema`)}catch(W){if(!Z.options.continueOnError||!g0(W))return w0(Z.callback,Promise.reject(W));if(this.$refs._$refs[n(Z.path)])this.$refs._$refs[n(Z.path)].addError(W);return w0(Z.callback,Promise.resolve(null))}}static parse(){let Z=new o0;return Z.parse.apply(Z,arguments)}async resolve(){let Z=N4(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await b9(this,Z.options),v5(this),w0(Z.callback,Promise.resolve(this.$refs))}catch(X){return w0(Z.callback,Promise.reject(X))}}static resolve(){let Z=new o0;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new o0;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=N4(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),h9(this,Z.options),v5(this),w0(Z.callback,Promise.resolve(this.schema))}catch(X){return w0(Z.callback,Promise.reject(X))}}static dereference(){let Z=new o0;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=N4(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),d9(this,Z.options),v5(this),w0(Z.callback,Promise.resolve(this.schema))}catch(X){return w0(Z.callback,Promise.reject(X))}}}function v5(Z){if(c6.getParserErrors(Z).length>0)throw new c6(Z)}var VF,BF,HF,n9;var i9=R(()=>{F8();Y5();S9();v9();m9();c9();H0();j5();C5();P0();p9();_6();O5();H0();VF=o0.parse,BF=o0.resolve,HF=o0.bundle,n9=o0.dereference});async function Y1(Z,X={}){let{baseUrl:q="/_jx/server"}=X,W=await n9(Z),Q=l4(W);if(Q.length===0)return null;let J=Q.map(({exportName:Y,src:U})=>`import { ${Y} } from '${U}'`).join(`
|
|
55
55
|
`),z=Q.map(({exportName:Y})=>r9(Y,q)).join(`
|
|
56
56
|
`);return`// Generated by @jxsuite/compiler — do not edit manually
|
|
57
57
|
// Deploy as a Cloudflare Worker, Node server, or Bun process.
|
|
@@ -85,7 +85,7 @@ app.post('${X}/${Z}', async (c) => {
|
|
|
85
85
|
} catch (e) {
|
|
86
86
|
return c.json({ ok: false, error: e?.message ?? 'Server error' }, 500)
|
|
87
87
|
}
|
|
88
|
-
})`}var a9=R(()=>{i9();T6()});function t0(Z){return Z instanceof Error?Z.message:String(Z)}function g5(Z,X,q){let W;try{W=JSON.parse(Z)}catch(Q){throw Error(`Failed to parse ${q} at ${X}: ${t0(Q)}`,{cause:Q})}if(!M0(W))throw Error(`Invalid ${q} at ${X}: expected a JSON object`);return W}function V6(Z,X){return g5(Z,X,"Jx document")}function s9(Z,X){return g5(Z,X,"project config")}function o9(Z,X){return g5(Z,X,"class definition")}var e0=R(()=>{S0()});class Z7{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;capabilities;#Z;#X=null;constructor(Z,X,q,W){this.name=Z,this.classPath=X,this.classDef=q,this.#Z=W;let Q=q.format;this.extensions=(Q.extensions??[]).map((J)=>J.toLowerCase()),this.mediaType=Q.mediaType??null,this.documentKinds=Q.documentKinds??[],this.exportTarget=Q.exportTarget===!0,this.remote=Q.remote===!0,this.studio=q.$studio??null,this.capabilities=dJ(q)}implementation(){if(!this.#X){let Z=this.classDef.$implementation;if(!Z)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#X=this.#Z.importModule(this.#Z.resolvePath(this.classPath,Z))}return this.#X}async call(Z,...X){let q=this.capabilities[Z];if(!q)throw Error(`Format class "${this.name}" does not declare a "${Z}" capability`);let W=await this.implementation(),Q=this.classDef.title??this.name,J=W[Q]??W.default?.[Q]??W.default,z=J?.[q.identifier];if(typeof z!=="function")throw TypeError(`Format class "${this.name}": implementation export "${Q}" has no static "${q.identifier}" method`);return await z.call(J,...X)}}class X7{#Z;constructor(Z){this.#Z=Z;for(let X of e9){let q=new Map;for(let W of Z){if(!W.capabilities[X])continue;for(let Q of W.extensions){let J=q.get(Q);if(J)throw Error(`Format conflict: "${J.name}" and "${W.name}" both claim "${Q}" with the "${X}" capability`);q.set(Q,W)}}}}get entries(){return this.#Z}byExtension(Z,X){let q=t9(Z);return this.#Z.find((W)=>W.extensions.includes(q)&&(!X||W.capabilities[X]))}byName(Z){return this.#Z.find((X)=>X.name===Z)}withCapability(Z){return this.#Z.filter((X)=>X.capabilities[Z])}documentExtensions(Z){let X=new Set;for(let q of this.#Z){if(Z&&!q.documentKinds.includes(Z))continue;for(let W of q.extensions)X.add(W)}return X.delete(".json"),[...X]}has(Z){let X=t9(Z);return this.#Z.some((q)=>q.extensions.includes(X))}}async function q7(Z,X,q){let W=[];for(let[Q,J]of Object.entries(Z??{})){if(typeof J!=="string"||!J.endsWith(".class.json"))continue;let z,Y;try{z=q?X.resolvePath(q,J):J,Y=await X.loadJson(z)}catch{continue}if(!Y||typeof Y!=="object")continue;if(!Y.format||!Array.isArray(Y.format.extensions))continue;W.push(new Z7(Q,z,Y,X))}return new X7(W)}function dJ(Z){let X={},q=Z.$defs?.methods??{};for(let[W,Q]of Object.entries(q)){let J=Q.role;if(!J||!e9.includes(J))continue;X[J]={identifier:Q.identifier??W,timing:Q.timing??uJ}}return X}function t9(Z){let X=Z.toLowerCase();return X.startsWith(".")?X:`.${X}`}var e9,uJ;var W7=R(()=>{e9=["parse","serialize","discover","load"],uJ=["compiler","server"]});var f5={};f4(f5,{unknownFormatError:()=>m5,importImplementation:()=>K1,createNodeFormatIO:()=>J7,buildProjectFormatRegistry:()=>T4});import{readFileSync as cJ}from"node:fs";import{dirname as lJ,isAbsolute as pJ,resolve as h5,sep as U1}from"node:path";import{pathToFileURL as nJ}from"node:url";import{createRequire as Q7}from"node:module";async function K1(Z){let X=[Z],q=`${U1}src${U1}`,W=`${U1}dist${U1}`;if(Z.includes(q))X.push(Z.replace(q,W));if(Z.endsWith(".js"))X.push(`${Z.slice(0,-3)}.ts`);let Q;for(let J of X)try{return await import(nJ(J).href)}catch(z){Q=z}throw Q instanceof Error?Q:Error(String(Q))}function J7(Z){return{importModule:(X)=>K1(X),loadJson:async(X)=>JSON.parse(cJ(X,"utf8")),resolvePath:(X,q)=>{if(q.startsWith("./")||q.startsWith("../"))return h5(lJ(X),q);if(pJ(q))return q;let W=Q7(h5(Z,"package.json"));try{return W.resolve(q)}catch{return Q7(import.meta.url).resolve(q)}}}}async function T4(Z,X){return q7(X?.imports,J7(Z),h5(Z,"project.json"))}function m5(Z,X){return Error(`No format class imported for "${X}" (${Z}). Add a format class to project.json imports, e.g. "Markdown": "@jxsuite/parser/Markdown.class.json".`)}var s6=R(()=>{W7()});async function B1(Z,X={}){let{resolveElementPath:q,$media:W,formats:Q}=X,J=[],z=new Set;async function Y(U,K){let V,B;if(typeof U==="string"){let{readFileSync:
|
|
88
|
+
})`}var a9=R(()=>{i9();T6()});function t0(Z){return Z instanceof Error?Z.message:String(Z)}function g5(Z,X,q){let W;try{W=JSON.parse(Z)}catch(Q){throw Error(`Failed to parse ${q} at ${X}: ${t0(Q)}`,{cause:Q})}if(!M0(W))throw Error(`Invalid ${q} at ${X}: expected a JSON object`);return W}function V6(Z,X){return g5(Z,X,"Jx document")}function s9(Z,X){return g5(Z,X,"project config")}function o9(Z,X){return g5(Z,X,"class definition")}var e0=R(()=>{S0()});class Z7{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;capabilities;#Z;#X=null;constructor(Z,X,q,W){this.name=Z,this.classPath=X,this.classDef=q,this.#Z=W;let Q=q.format;this.extensions=(Q.extensions??[]).map((J)=>J.toLowerCase()),this.mediaType=Q.mediaType??null,this.documentKinds=Q.documentKinds??[],this.exportTarget=Q.exportTarget===!0,this.remote=Q.remote===!0,this.studio=q.$studio??null,this.capabilities=dJ(q)}implementation(){if(!this.#X){let Z=this.classDef.$implementation;if(!Z)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#X=this.#Z.importModule(this.#Z.resolvePath(this.classPath,Z))}return this.#X}async call(Z,...X){let q=this.capabilities[Z];if(!q)throw Error(`Format class "${this.name}" does not declare a "${Z}" capability`);let W=await this.implementation(),Q=this.classDef.title??this.name,J=W[Q]??W.default?.[Q]??W.default,z=J?.[q.identifier];if(typeof z!=="function")throw TypeError(`Format class "${this.name}": implementation export "${Q}" has no static "${q.identifier}" method`);return await z.call(J,...X)}}class X7{#Z;constructor(Z){this.#Z=Z;for(let X of e9){let q=new Map;for(let W of Z){if(!W.capabilities[X])continue;for(let Q of W.extensions){let J=q.get(Q);if(J)throw Error(`Format conflict: "${J.name}" and "${W.name}" both claim "${Q}" with the "${X}" capability`);q.set(Q,W)}}}}get entries(){return this.#Z}byExtension(Z,X){let q=t9(Z);return this.#Z.find((W)=>W.extensions.includes(q)&&(!X||W.capabilities[X]))}byName(Z){return this.#Z.find((X)=>X.name===Z)}withCapability(Z){return this.#Z.filter((X)=>X.capabilities[Z])}documentExtensions(Z){let X=new Set;for(let q of this.#Z){if(Z&&!q.documentKinds.includes(Z))continue;for(let W of q.extensions)X.add(W)}return X.delete(".json"),[...X]}has(Z){let X=t9(Z);return this.#Z.some((q)=>q.extensions.includes(X))}}async function q7(Z,X,q){let W=[];for(let[Q,J]of Object.entries(Z??{})){if(typeof J!=="string"||!J.endsWith(".class.json"))continue;let z,Y;try{z=q?X.resolvePath(q,J):J,Y=await X.loadJson(z)}catch{continue}if(!Y||typeof Y!=="object")continue;if(!Y.format||!Array.isArray(Y.format.extensions))continue;W.push(new Z7(Q,z,Y,X))}return new X7(W)}function dJ(Z){let X={},q=Z.$defs?.methods??{};for(let[W,Q]of Object.entries(q)){let J=Q.role;if(!J||!e9.includes(J))continue;X[J]={identifier:Q.identifier??W,timing:Q.timing??uJ}}return X}function t9(Z){let X=Z.toLowerCase();return X.startsWith(".")?X:`.${X}`}var e9,uJ;var W7=R(()=>{e9=["parse","serialize","discover","load"],uJ=["compiler","server"]});var f5={};f4(f5,{unknownFormatError:()=>m5,importImplementation:()=>K1,createNodeFormatIO:()=>J7,buildProjectFormatRegistry:()=>T4});import{readFileSync as cJ}from"node:fs";import{dirname as lJ,isAbsolute as pJ,resolve as h5,sep as U1}from"node:path";import{pathToFileURL as nJ}from"node:url";import{createRequire as Q7}from"node:module";async function K1(Z){let X=[Z],q=`${U1}src${U1}`,W=`${U1}dist${U1}`;if(Z.includes(q))X.push(Z.replace(q,W));if(Z.endsWith(".js"))X.push(`${Z.slice(0,-3)}.ts`);let Q;for(let J of X)try{return await import(nJ(J).href)}catch(z){Q=z}throw Q instanceof Error?Q:Error(String(Q))}function J7(Z){return{importModule:(X)=>K1(X),loadJson:async(X)=>JSON.parse(cJ(X,"utf8")),resolvePath:(X,q)=>{if(q.startsWith("./")||q.startsWith("../"))return h5(lJ(X),q);if(pJ(q))return q;let W=Q7(h5(Z,"package.json"));try{return W.resolve(q)}catch{return Q7(import.meta.url).resolve(q)}}}}async function T4(Z,X){return q7(X?.imports,J7(Z),h5(Z,"project.json"))}function m5(Z,X){return Error(`No format class imported for "${X}" (${Z}). Add a format class to project.json imports, e.g. "Markdown": "@jxsuite/parser/Markdown.class.json".`)}var s6=R(()=>{W7()});async function B1(Z,X={}){let{resolveElementPath:q,$media:W,formats:Q}=X,J=[],z=new Set;async function Y(U,K){let V,B;if(typeof U==="string"){let{readFileSync:P}=await import("node:fs"),{resolve:k}=await import("node:path");if(B=K?k(K,U):k(U),z.has(B))return;if(z.add(B),B.endsWith(".json"))V=V6(P(B,"utf8"),B);else{let{extname:b}=await import("node:path"),C=b(B).toLowerCase(),T=Q?.byExtension?.(C,"parse");if(!T){let{unknownFormatError:j}=await Promise.resolve().then(() => (s6(),f5));throw j(B,C)}V=await T.call("parse",P(B,"utf8"))}}else{if(V=U,B=null,V.tagName&&z.has(V.tagName))return;if(V.tagName)z.add(V.tagName)}let{tagName:H}=V;if(!H||!H.includes("-"))throw Error(`compileElement: tagName "${H}" must contain a hyphen`);let{dirname:$}=await import("node:path"),F=B?$(B):null,L=[];if(Array.isArray(V.$elements))for(let P of V.$elements){let k=L0(P)?P.$ref:P;if(typeof k!=="string")continue;if(F)await Y(k,F);let b=q?q(k,F):k.replace(/\.json$/,".js");L.push(b)}let A=c4(H);if(W)V.$media={...W,...V.$media};let I=R4(V,A,L),M=B?B.replace(/\.json$/,".js"):`${H}.js`;J.push({content:I,path:M,tagName:H})}return await Y(Z,X.basePath??null),{files:J}}async function iJ(Z,X={}){let{title:q="Jx App",reactivitySrc:W="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:Q="https://esm.sh/lit-html@3.3.0"}=X,J=await B1(Z,X),z=J.files.at(-1);if(!z)throw Error("compileElementPage: no element modules were produced");let{basename:Y}=await import("node:path"),U=Y(z.path),K=`<!DOCTYPE html>
|
|
89
89
|
<html lang="en">
|
|
90
90
|
<head>
|
|
91
91
|
<meta charset="utf-8">
|
|
@@ -146,7 +146,7 @@ ${X}\`)}`}function Z6(Z){if(Z.startsWith("#/state/"))return`s.${Z.slice(8).repla
|
|
|
146
146
|
${B}
|
|
147
147
|
</body>
|
|
148
148
|
</html>`;return{files:K,html:H}}function K7(Z,X,q,W,Q){if(typeof Z==="string")return y(Z);if(typeof Z==="number"||typeof Z==="boolean")return y(String(Z));if(!Z||typeof Z!=="object")return"";let J=h6(q,W.scope,q?.state??W.scopeDefs,q?.$media??W.media);if(X){let K=Q.length,V=`jx-island-${K}`,B=`JxIsland${K}`,H={...q??Z,tagName:V};return Q.push({className:B,def:H,tagName:V}),`<${V}></${V}>`}let z=Z.tagName??"div",Y=v6(Z,J.scope),U=tJ(Z,q,J,Q);return`<${z}${Y}>${U}</${z}>`}function tJ(Z,X,q,W){let Q=X??Z;if(Q.textContent!==void 0){let J=p(Q.textContent,q.scope);return J==null?"":y(String(J))}if(Q.innerHTML)return p(Q.innerHTML,q.scope)??Q.innerHTML;if(Array.isArray(Q.children)){let J=Array.isArray(X?.children)?X.children:void 0;return Q.children.map((z,Y)=>{let U=z,K=e3(U),V=J?.[Y]??z;return K7(U,K,V,q,W)}).join(`
|
|
149
|
-
`)}return""}var V7=R(()=>{T6();H1()});function B7(Z,X){let{title:q="Jx App",reactivitySrc:W=y6,litHtmlSrc:Q=g6,modulePath:J="app.js"}=X,z=h6(Z,null,Z.state??{},Z.$media??{}),Y=f6(Z,Z.$media??{},X.projectStyle??null),U={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},K=new Map,V=new Map,B=[],H=[],$=[],F=[],L=[],A=new Map,I=Z.state??{};for(let[C,T]of Object.entries(I)){if(T===null||typeof T!=="object"||Array.isArray(T)){if(typeof T==="string"&&x(T))H.push([C,`() => \`${T}\``]);else B.push([C,T]);continue}if(O0(T)){let j=T.$expression,S=T0(j,{eventParam:"e",statePrefix:"state"});if(L6(j.operator))F.push([C,{args:["state","e"],body:S}]);else H.push([C,`() => ${S}`]);continue}if(i0(T)){let j=T.parameters?z6(T.parameters):T.arguments;if(T.$src){if(!A.has(T.$src))A.set(T.$src,new Set);A.get(T.$src).add(C),H.push([C,`() => { return ${C}(state); }`])}else if(T.body&&T.body.includes("return"))H.push([C,`() => { ${T.body} }`]);else F.push([C,{args:j??["state"],body:T.body}]);continue}if(J6(T))continue;if(a3(T)){B.push([C,T.default]);continue}if(I6(T)){if(T.$prototype==="LocalStorage"||T.$prototype==="SessionStorage"){let j=T.$prototype==="LocalStorage"?"localStorage":"sessionStorage",S=T.key??C,g=T.default??null;B.push([C,null]),L.push(Xz(C,j,S,g));continue}if(T.$prototype==="Request"){B.push([C,null]),L.push(Zz(C,T));continue}if(T.$prototype==="Cookie"){B.push([C,null]),L.push(qz(C,T.name??C,T.default??null));continue}}B.push([C,T])}let M=H7(Z,Z,z,K,V,U);for(let[C,T]of K)if(!$.some(([j])=>j===C))$.push([C,T]);for(let[C,T]of V)if(!F.some(([j])=>j===C))F.push([C,T]);let
|
|
149
|
+
`)}return""}var V7=R(()=>{T6();H1()});function B7(Z,X){let{title:q="Jx App",reactivitySrc:W=y6,litHtmlSrc:Q=g6,modulePath:J="app.js"}=X,z=h6(Z,null,Z.state??{},Z.$media??{}),Y=f6(Z,Z.$media??{},X.projectStyle??null),U={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},K=new Map,V=new Map,B=[],H=[],$=[],F=[],L=[],A=new Map,I=Z.state??{};for(let[C,T]of Object.entries(I)){if(T===null||typeof T!=="object"||Array.isArray(T)){if(typeof T==="string"&&x(T))H.push([C,`() => \`${T}\``]);else B.push([C,T]);continue}if(O0(T)){let j=T.$expression,S=T0(j,{eventParam:"e",statePrefix:"state"});if(L6(j.operator))F.push([C,{args:["state","e"],body:S}]);else H.push([C,`() => ${S}`]);continue}if(i0(T)){let j=T.parameters?z6(T.parameters):T.arguments;if(T.$src){if(!A.has(T.$src))A.set(T.$src,new Set);A.get(T.$src).add(C),H.push([C,`() => { return ${C}(state); }`])}else if(T.body&&T.body.includes("return"))H.push([C,`() => { ${T.body} }`]);else F.push([C,{args:j??["state"],body:T.body}]);continue}if(J6(T))continue;if(a3(T)){B.push([C,T.default]);continue}if(I6(T)){if(T.$prototype==="LocalStorage"||T.$prototype==="SessionStorage"){let j=T.$prototype==="LocalStorage"?"localStorage":"sessionStorage",S=T.key??C,g=T.default??null;B.push([C,null]),L.push(Xz(C,j,S,g));continue}if(T.$prototype==="Request"){B.push([C,null]),L.push(Zz(C,T));continue}if(T.$prototype==="Cookie"){B.push([C,null]),L.push(qz(C,T.name??C,T.default??null));continue}}B.push([C,T])}let M=H7(Z,Z,z,K,V,U);for(let[C,T]of K)if(!$.some(([j])=>j===C))$.push([C,T]);for(let[C,T]of V)if(!F.some(([j])=>j===C))F.push([C,T]);let P=eJ(B,H,$,F,L,A,U,W),k=[` "@vue/reactivity": "${W}"`,` "lit-html": "${Q}"`],b=`<!DOCTYPE html>
|
|
150
150
|
<html lang="en">
|
|
151
151
|
<head>
|
|
152
152
|
<meta charset="utf-8">
|
|
@@ -166,7 +166,7 @@ ${k.join(`,
|
|
|
166
166
|
<body>
|
|
167
167
|
${M}
|
|
168
168
|
</body>
|
|
169
|
-
</html>`;return{files:[{content:
|
|
169
|
+
</html>`;return{files:[{content:P,path:J}],html:b}}function H7(Z,X,q,W,Q,J){if(typeof Z==="string")return y(Z);if(typeof Z==="number"||typeof Z==="boolean")return y(String(Z));if(!Z||typeof Z!=="object")return"";let z=h6(X,q.scope,X?.state??q.scopeDefs,X?.$media??q.media),Y=Z.tagName??"div",U=[],K=!1;if(Z.textContent!==void 0){let A=X?.textContent??Z.textContent;if(b0(A)){let I=E6(A.$ref);U.push(`:text-content="${I}"`),c5(W,I,A.$ref),K=!0}else if(x(A)){let I=`_t${J.t}`;J.t+=1,U.push(`:text-content="${I}"`),W.set(I,`() => \`${A}\``),K=!0}}for(let[A,I]of Object.entries(Z)){if(!A.startsWith("on")||A==="observedAttributes")continue;let M=A.slice(2).toLowerCase();if(b0(I)){let P=E6(I.$ref);U.push(`@${M}="${P}"`),K=!0}else if(i0(I)){let P=`_h${J.h}`;J.h+=1,U.push(`@${M}="${P}"`),Q.set(P,{args:I.parameters?z6(I.parameters):I.arguments??["state","event"],body:I.body}),K=!0}else if(O0(I)){let P=`_h${J.h}`;J.h+=1,U.push(`@${M}="${P}"`);let k=T0(I.$expression,{eventParam:"e",statePrefix:"state"});Q.set(P,{args:["state","e"],body:k}),K=!0}}if(Z.style&&typeof Z.style==="object")for(let[A,I]of Object.entries(Z.style)){if(A.startsWith(":")||A.startsWith(".")||A.startsWith("&")||A.startsWith("[")||A.startsWith("@"))continue;if(I===null||typeof I==="object")continue;if(x(I)){let M=`_s${J.s}`;J.s+=1,U.push(`:style.${I0(A)}="${M}"`),W.set(M,`() => \`${I}\``),K=!0}}if(Z.attributes&&typeof Z.attributes==="object"){for(let[A,I]of Object.entries(Z.attributes))if(b0(I)){let M=E6(I.$ref);U.push(`:attr.${A}="${M}"`),c5(W,M,I.$ref),K=!0}else if(x(I)){let M=`_t${J.t}`;J.t+=1,U.push(`:attr.${A}="${M}"`),W.set(M,`() => \`${I}\``),K=!0}}for(let[A,I]of Object.entries(Z)){if(D6.has(A)||A.startsWith("on")||A.startsWith("$")||A==="tagName"||A==="id"||A==="className"||A==="style"||A==="children"||A==="textContent"||A==="innerHTML"||A==="attributes")continue;if(b0(I)){let M=E6(I.$ref);U.push(`:${I0(A)}="${M}"`),c5(W,M,I.$ref),K=!0}else if(x(I)){let M=`_t${J.t}`;J.t+=1,U.push(`:${I0(A)}="${M}"`),W.set(M,`() => \`${I}\``),K=!0}}let V=v6(Z,z.scope),B=K?" data-bind":"",H=U.length>0?` ${U.join(" ")}`:"",$="",F=X??Z;if(F.textContent!==void 0&&!K){let A=p(F.textContent,z.scope);$=A==null?"":y(String(A))}else if(F.textContent!==void 0&&K){let A=p(F.textContent,z.scope);$=A==null?"":y(String(A))}else if(F.innerHTML)$=p(F.innerHTML,z.scope)??F.innerHTML;else if(w6(F.children)){J.needsLit=!0;let A=`_list${J.l}`;J.l+=1;let I=F.children,M;if(b0(I.items))M=`state.${E6(I.items.$ref)}`;else M=JSON.stringify(I.items);let P=$7(I.map);W.set(A,`() => (${M} ?? []).map((item, index) => html\`${P}\`)`),U.push(`:render="${A}"`),K=!0;let k=" data-bind",b=` ${U.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${V}${k}${b}>`;return`<${Y}${V}${k}${b}></${Y}>`}else if(Array.isArray(F.children)){let A=Array.isArray(X?.children)?X.children:void 0;$=F.children.map((I,M)=>{let P=A?.[M]??I;return H7(I,P,z,W,Q,J)}).join(`
|
|
170
170
|
`)}if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${V}${B}${H}>`;return`<${Y}${V}${B}${H}>${$}</${Y}>`}function $7(Z){if(!Z)return"";let X=Z.tagName??"div",q="";if(Z.id)q+=` id="${Z.id}"`;if(Z.className)q+=` class="${o6(Z.className)}"`;if(Z.attributes&&typeof Z.attributes==="object")for(let[J,z]of Object.entries(Z.attributes))q+=typeof z==="string"&&x(z)?` ${J}="${o6(z)}"`:` ${J}="${y(String(z))}"`;if(Z.style&&typeof Z.style==="object"){let J=[];for(let[z,Y]of Object.entries(Z.style)){if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")||z.startsWith("@"))continue;if(Y===null||typeof Y==="object")continue;let U=I0(z);if(x(String(Y)))J.push(`${U}: ${o6(String(Y))}`);else J.push(`${U}: ${Y}`)}if(J.length>0)q+=` style="${J.join("; ")}"`}for(let[J,z]of Object.entries(Z)){if(!J.startsWith("on")||J==="observedAttributes")continue;let Y=J.slice(2).toLowerCase();if(b0(z)){let U=E6(z.$ref);q+=` @${Y}=\${(e) => { state.$map = { item, index }; on.${U}(e); }}`}else if(z&&typeof z==="object"&&z.$prototype==="Function"){let U=o6(z.body);q+=` @${Y}=\${(e) => { ${U} }}`}else if(z&&typeof z==="object"&&"$expression"in z){let U=T0(z.$expression,{eventParam:"e",statePrefix:"state"});q+=` @${Y}=\${(e) => { state.$map = { item, index }; ${U}; }}`}}if(Z.contentEditable)q+=` contenteditable="${Z.contentEditable}"`;let W="";if(Z.textContent!==void 0){let J=String(Z.textContent);if(x(J))W=o6(J);else if(b0(Z.textContent))W=`\${state.${E6(Z.textContent.$ref)}}`;else W=y(J)}else if(Z.innerHTML)W=o6(String(Z.innerHTML));else if(Array.isArray(Z.children))W=`
|
|
171
171
|
${Z.children.map((J)=>$7(J)).join(`
|
|
172
172
|
`)}
|
|
@@ -174,7 +174,7 @@ ${k.join(`,
|
|
|
174
174
|
`)}function Zz(Z,X){let{url:q}=X,W=X.method??"GET",Q=x(q);if(X.manual)return`// ${Z}: manual Request — fetch triggered by user action`;let J=[`// ${Z}: auto-fetch from ${Q?"(dynamic URL)":q}`,"effect(() => {"];if(Q)J.push(` const url = \`${q}\`;`),J.push(' if (!url || url === "undefined" || url.includes("undefined")) return;');else J.push(` const url = ${JSON.stringify(q)};`);let z=[];if(W!=="GET")z.push(`method: ${JSON.stringify(W)}`);if(X.headers)z.push(`headers: ${JSON.stringify(X.headers)}`);if(X.body){let U=typeof X.body==="object"?JSON.stringify(JSON.stringify(X.body)):JSON.stringify(X.body);z.push(`body: ${U}`)}let Y=z.length>0?`, { ${z.join(", ")} }`:"";return J.push(` fetch(url${Y})`),J.push(" .then(r => r.ok ? r.json() : Promise.reject(r.statusText))"),J.push(` .then(d => { state.${Z} = d; })`),J.push(` .catch(e => { state.${Z} = { error: String(e) }; });`),J.push("});"),J.join(`
|
|
175
175
|
`)}function Xz(Z,X,q,W){return[`// ${Z}: ${X} (key: "${q}")`,"try {",` const _s = ${X}.getItem(${JSON.stringify(q)});`,` state.${Z} = _s !== null ? JSON.parse(_s) : ${JSON.stringify(W)};`,`} catch { state.${Z} = ${JSON.stringify(W)}; }`,"effect(() => {",` const v = state.${Z};`," try {",` if (v === null) ${X}.removeItem(${JSON.stringify(q)});`,` else ${X}.setItem(${JSON.stringify(q)}, JSON.stringify(v));`," } catch {}","});"].join(`
|
|
176
176
|
`)}function qz(Z,X,q){return[`// ${Z}: Cookie (name: "${X}")`,"{",` const _m = document.cookie.match(new RegExp("(?:^|; )${X}=([^;]*)"));`,` try { state.${Z} = _m ? JSON.parse(decodeURIComponent(_m[1])) : ${JSON.stringify(q)}; }`,` catch { state.${Z} = _m ? _m[1] : ${JSON.stringify(q)}; }`,"}"].join(`
|
|
177
|
-
`)}function E6(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replaceAll("/","_");return Z.replaceAll("/","_")}function c5(Z,X,q){if(Z.has(X))return;if(q.startsWith("#/state/")){let Q=q.slice(8).split("/");Z.set(X,`() => state.${Q.join(".")}`)}else Z.set(X,`() => state.${q}`)}var F7=R(()=>{u4();T6();S0()});var M7={};f4(M7,{compileClassJson:()=>Wz});function Wz(Z,X={}){let q=Z.title;if(!q)throw Error("compileClassJson: missing title (class name)");let W=Qz(Z.extends),Q=Z.$defs,J=Q?.fields??{},z=Q?.constructor,Y=typeof z==="object"?z:void 0,U=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=W!=="Object"?` extends ${W}`:"";K.push(`class ${q}${V} {`);for(let[B,H]of Object.entries(J)){if(H.scope!=="static")continue;let $=H.identifier??B,F=H.access==="private"?"#":"",L=H.initializer!==void 0?JSON.stringify(H.initializer):H.default!==void 0?JSON.stringify(H.default):"null";K.push(` static ${F}${$} = ${L};`)}for(let[B,H]of Object.entries(J)){if(H.scope==="static")continue;if(H.access!=="private")continue;let $=H.identifier??B;K.push(` #${$};`)}if(Object.keys(J).length>0)K.push("");if(K.push(" constructor(config = {}) {"),Y?.superCall||W!=="Object"){let B=Y?.superCall?.arguments?Y.superCall.arguments.join(", "):"";K.push(` super(${B});`)}for(let[B,H]of Object.entries(J)){if(H.scope==="static")continue;let $=H.identifier??B,F=H.access==="private"?"#":"",L=H.initializer!==void 0?JSON.stringify(H.initializer):H.default!==void 0?JSON.stringify(H.default):"null";K.push(` this.${F}${$} = config.${$} !== undefined ? config.${$} : ${L};`)}if(Y?.body){let B=Array.isArray(Y.body)?Y.body:[Y.body];for(let H of B)K.push(` ${H}`)}K.push(" }");for(let[B,H]of Object.entries(U)){let $=H.identifier??B,F=H.scope==="static",A=H.access==="private"?"#":"",I=F?"static ":"",M=H.returnType?.$ref?.includes("Promise")||zz(H)?"async ":"",
|
|
177
|
+
`)}function E6(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replaceAll("/","_");return Z.replaceAll("/","_")}function c5(Z,X,q){if(Z.has(X))return;if(q.startsWith("#/state/")){let Q=q.slice(8).split("/");Z.set(X,`() => state.${Q.join(".")}`)}else Z.set(X,`() => state.${q}`)}var F7=R(()=>{u4();T6();S0()});var M7={};f4(M7,{compileClassJson:()=>Wz});function Wz(Z,X={}){let q=Z.title;if(!q)throw Error("compileClassJson: missing title (class name)");let W=Qz(Z.extends),Q=Z.$defs,J=Q?.fields??{},z=Q?.constructor,Y=typeof z==="object"?z:void 0,U=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=W!=="Object"?` extends ${W}`:"";K.push(`class ${q}${V} {`);for(let[B,H]of Object.entries(J)){if(H.scope!=="static")continue;let $=H.identifier??B,F=H.access==="private"?"#":"",L=H.initializer!==void 0?JSON.stringify(H.initializer):H.default!==void 0?JSON.stringify(H.default):"null";K.push(` static ${F}${$} = ${L};`)}for(let[B,H]of Object.entries(J)){if(H.scope==="static")continue;if(H.access!=="private")continue;let $=H.identifier??B;K.push(` #${$};`)}if(Object.keys(J).length>0)K.push("");if(K.push(" constructor(config = {}) {"),Y?.superCall||W!=="Object"){let B=Y?.superCall?.arguments?Y.superCall.arguments.join(", "):"";K.push(` super(${B});`)}for(let[B,H]of Object.entries(J)){if(H.scope==="static")continue;let $=H.identifier??B,F=H.access==="private"?"#":"",L=H.initializer!==void 0?JSON.stringify(H.initializer):H.default!==void 0?JSON.stringify(H.default):"null";K.push(` this.${F}${$} = config.${$} !== undefined ? config.${$} : ${L};`)}if(Y?.body){let B=Array.isArray(Y.body)?Y.body:[Y.body];for(let H of B)K.push(` ${H}`)}K.push(" }");for(let[B,H]of Object.entries(U)){let $=H.identifier??B,F=H.scope==="static",A=H.access==="private"?"#":"",I=F?"static ":"",M=H.returnType?.$ref?.includes("Promise")||zz(H)?"async ":"",P=A7(H.parameters??[]),k=Jz(H.body);if(K.push(""),H.role==="accessor"){if(H.getter)K.push(` ${I}get ${A}${$}() {`),K.push(` ${H.getter.body}`),K.push(" }");if(H.setter){let b=A7(H.setter.parameters??[]);K.push(` ${I}set ${A}${$}(${b}) {`),K.push(` ${H.setter.body}`),K.push(" }")}}else{K.push(` ${I}${M}${A}${$}(${P}) {`);for(let b of k)K.push(` ${b}`);K.push(" }")}}return K.push("}"),K.push(""),K.push(`export { ${q} };`),K.push(`export default ${q};`),K.push(""),K.join(`
|
|
178
178
|
`)}function Qz(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 A7(Z){return Z.map((X)=>{if(X.$ref)return X.$ref.split("/").pop();let q=X.identifier??X.name;return typeof q==="string"?q:"arg"}).join(", ")}function Jz(Z){if(!Z)return[""];return Array.isArray(Z)?Z:[Z]}function zz(Z){return(Array.isArray(Z.body)?Z.body.join(`
|
|
179
179
|
`):Z.body??"").includes("await ")}import{readFileSync as Gz}from"node:fs";async function l5(Z,X={}){let{title:q="Jx App",reactivitySrc:W=y6,litHtmlSrc:Q=g6,projectStyle:J=null}=X,z;if(typeof Z==="string"){let Y=Gz(Z,"utf8");if(Z.endsWith(".json"))z=V6(Y,Z);else{let{extname:U}=await import("node:path"),K=U(Z).toLowerCase(),V=X.formats?.byExtension?.(K,"parse");if(!V){let{unknownFormatError:B}=await Promise.resolve().then(() => (s6(),f5));throw B(Z,K)}z=await V.call("parse",Y)}}else z=Z;if(o3(z)){let{compileClassJson:Y}=await Promise.resolve().then(() => M7),U=Y(z,X),K=typeof Z==="string"?Z.replace(/\.class\.json$/,".js"):`${z.title}.js`;return{files:[{content:U,path:K}],html:""}}if(!o1(z))return U7(z,{litHtmlSrc:Q,projectStyle:J,reactivitySrc:W,title:q});if(z.tagName&&z.tagName.includes("-")){let{tagName:Y}=z,U=c4(Y),V={content:R4(z,U,[]),path:`${Y}.js`,tagName:Y},B=f6(z,z.$media??{}),H=`<!DOCTYPE html>
|
|
180
180
|
<html lang="en">
|
|
@@ -237,13 +237,13 @@ ${k.join(`,
|
|
|
237
237
|
*/O3=hB(import.meta.url),rX=S1.runtimePlatformArch(),x3=v.libvipsVersion(),A6=v.format();A6.heif.output.alias=["avif","heic"];A6.jpeg.output.alias=["jpe","jpg"];A6.tiff.output.alias=["tif"];A6.jp2.output.alias=["j2c","j2k","jp2","jpx"];fB={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},G4={vips:x3.semver};if(!x3.isGlobal)if(!x3.isWasm)try{G4=O3(`@img/sharp-${rX}/versions`)}catch(Z){try{G4=O3(`@img/sharp-libvips-${rX}/versions`)}catch(X){}}else try{G4=O3("@img/sharp-wasm32/versions")}catch(Z){}G4.sharp=q6.version;if(G4.heif&&A6.heif)A6.heif.input.fileSuffix=[".avif"],A6.heif.output.alias=["avif"];aX(!0);if(v4.default.familySync()===v4.default.GLIBC&&!v._isUsingJemalloc())v.concurrency(1);else if(v4.default.familySync()===v4.default.MUSL&&v.concurrency()===1024)v.concurrency(mB());dB=new gB.EventEmitter});var k3={};f4(k3,{default:()=>iB});var iB;var S3=R(()=>{VX();$X();wX();NX();jX();fX();dX();iX();oX();/*!
|
|
238
238
|
Copyright 2013 Lovell Fuller and others.
|
|
239
239
|
SPDX-License-Identifier: Apache-2.0
|
|
240
|
-
*/HX(l0);IX(l0);DX(l0);PX(l0);mX(l0);uX(l0);nX(l0);sX(l0);iB=l0});import{createHash as tX}from"node:crypto";import{existsSync as rB,mkdirSync as aB,readFileSync as sB}from"node:fs";import{basename as oB,extname as tB,resolve as b3}from"node:path";import{createRequire as eB}from"node:module";async function eX(){if(Y4)return Y4;try{return Y4=(await Promise.resolve().then(() => (S3(),k3))).default,Y4}catch{}try{return Y4=eB(b3(process.cwd(),"package.json"))("sharp"),Y4}catch(Z){throw Error(`Sharp is required for image optimization but failed to load: ${t0(Z)}`,{cause:Z})}}async function v3(Z){let q=await(await eX())(Z).metadata();return{format:q.format??"unknown",height:q.height??0,width:q.width??0}}function y4(Z){let X=sB(Z);return tX("md5").update(X).digest("hex").slice(0,8)}function y3(Z){let X=JSON.stringify({formats:Z.formats,quality:Z.quality,widths:Z.widths});return tX("md5").update(X).digest("hex").slice(0,8)}function XH(Z,X,q,W){return`${Z}-${X}-${q}.${W}`}async function Zq(Z,X,q){let W=await eX(),Q=await v3(Z),J=y4(Z),z=oB(Z,tB(Z)),Y=b3(X,"_optimized");aB(Y,{recursive:!0});let U=[],K=q.widths.filter((H)=>H<=Q.width);if(K.length===0||!K.includes(Q.width))K.push(Q.width);K.sort((H,$)=>H-$);let V=[];for(let H of K)for(let $ of q.formats){let F=XH(z,H,J,$),L=`/${ZH}/${F}`,A=b3(Y,F);if(U.push({absolutePath:A,format:$,outputPath:L,width:H}),rB(A))continue;let I=q.quality[$]??80,M=W(Z).resize(H).toFormat($,{quality:I}).toFile(A).then(()=>{});V.push(M)}let B=4;for(let H=0;H<V.length;H+=B)await Promise.all(V.slice(H,H+B));return{contentHash:J,original:{format:Q.format,height:Q.height,width:Q.width},variants:U}}function g3(Z,X){return Z.filter((q)=>q.format===X).map((q)=>`${q.outputPath} ${q.width}w`).join(", ")}var Y4=null,ZH="images/_optimized";var h3=R(()=>{e0()});import{existsSync as qH,mkdirSync as WH,readFileSync as QH,writeFileSync as JH}from"node:fs";import{basename as zH,resolve as g1}from"node:path";import{execSync as GH}from"node:child_process";import{tmpdir as YH}from"node:os";function U4(Z){if(g4===void 0)try{let X=GH("npm config get cache",{cwd:YH(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();g4=X&&X!=="undefined"?X:null}catch{g4=null}if(g4)return g1(g4,"jxsuite-images",zH(Z));return g1(Z,".cache/images")}function Xq(Z){let X=g1(U4(Z),"manifest.json");if(!qH(X))return{entries:{},version:1};try{return JSON.parse(QH(X,"utf8"))}catch{return{entries:{},version:1}}}function qq(Z,X){let q=U4(Z);WH(q,{recursive:!0}),JH(g1(q,"manifest.json"),JSON.stringify(X,null,2),"utf8")}function Wq(Z,X){let q=Z.entries[X];if(!q)return null;return q.manifest}function Qq(Z,X,q,W){Z.entries[X]={manifest:W,source:q,timestamp:Date.now()}}var g4;var m3=R(()=>{h3()});import{existsSync as f3}from"node:fs";import{basename as UH,extname as Gq,resolve as Jq}from"node:path";async function Uq(Z,X){let q=X.get(Z);if(!q){let W=y4(Z);try{let Q=await v3(Z);q={width:Q.width,height:Q.height,hash:W}}catch(Q){if(!zq)zq=!0,console.warn(`Could not read image dimensions (${Q.message}) — `+"emitting srcsets without width/height attributes.");q={width:null,height:null,hash:W}}X.set(Z,q)}return q}function h1(Z,X,q,W){let Q=X.quality?.webp??80,J=Z.startsWith("/")?"":"/",z=W?`?v=${W}`:"";return X.widths.filter((Y)=>Y<=q).toSorted((Y,U)=>Y-U).map((Y)=>`/cdn-cgi/image/width=${Y},quality=${Q},fit=scale-down,format=auto${J}${Z}${z} ${Y}w`).join(", ")}async function Kq(Z,X,q,W,Q){let J=`${y4(Z)}:${y3(q)}`,z=Wq(Q,J);if(z){if(z.variants.every((K)=>f3(K.absolutePath)))return z}if(!z)console.log(` Optimizing ${UH(Z)}...`);let Y=await Zq(Z,U4(W),q);return Qq(Q,J,X,Y),Y}function Vq(Z){if(typeof Z!=="string")return!0;if(!Z)return!0;if(Z.includes("${"))return!0;if(KH.some((X)=>Z.startsWith(X)))return!0;if(Yq.has(Gq(Z).toLowerCase()))return!0;return!1}function Bq(Z,X){if(X.service!=="cloudflare")return!1;if(!X.remoteDomains?.length)return!1;if(typeof Z!=="string"||!Z.startsWith("https://"))return!1;if(Z.includes("${"))return!1;try{let q=new URL(Z);if(Yq.has(Gq(q.pathname).toLowerCase()))return!1;return X.remoteDomains.includes(q.hostname)}catch{return!1}}function Hq(Z,X){if(Z.startsWith("/"))return Jq(X,"public",Z.slice(1));return Jq(X,Z)}async function $q(Z,X,q,W,Q){let J=new Map;if(!X.optimize)return{imageRefs:J};return await Fq(Z,X,q,W,Q??new Map,J),{imageRefs:J}}async function Fq(Z,X,q,W,Q,J){if(!Z||typeof Z!=="object")return;if(Z.tagName==="img")await VH(Z,X,q,W,Q,J);if(typeof Z.innerHTML==="string"&&Z.innerHTML.includes("<img"))Z.innerHTML=await AH(Z.innerHTML,X,q,W,Q,J);if(Array.isArray(Z.children))for(let z of Z.children){if(typeof z==="string")continue;await Fq(z,X,q,W,Q,J)}}async function VH(Z,X,q,W,Q,J){if(!Z.attributes)Z.attributes={};let z=Z.attributes.src??Z.src;if(typeof z!=="string")return;let Y=Bq(z,X);if(!Y&&Vq(z))return;if(Z.attributes["data-no-optimize"]!==void 0)return;let U,K;if(Y)U=h1(z,X,1/0,null);else{let V=Hq(z,q);if(!f3(V))return;if(X.service==="cloudflare"){let B=await Uq(V,Q);if(U=h1(z,X,B.width??1/0,B.hash),B.width!=null&&B.height!=null)K={width:B.width,height:B.height}}else{let B=J.get(V);if(!B)B=await Kq(V,z,X,q,W),J.set(V,B);let H=X.formats.includes("avif")?"avif":X.formats[0];U=g3(B.variants,H),{original:K}=B}}if(U)Z.attributes.srcset=U,Z.attributes.sizes??=X.sizes;if(!Z.attributes.width&&K?.width)Z.attributes.width=String(K.width);if(!Z.attributes.height&&K?.height)Z.attributes.height=String(K.height);if(X.lazyLoad&&Z.attributes.loading!=="eager")Z.attributes.loading="lazy",Z.attributes.decoding="async"}async function AH(Z,X,q,W,Q,J){let z=[];for(let U of Z.matchAll(BH)){let[K]=U,[,V]=U;if($H.test(V))continue;if(FH.test(V))continue;let B=V.match(HH);if(!B)continue;let H=B[1].replaceAll("&","&"),$=Bq(H,X);if(!$&&Vq(H))continue;let F=$?null:Hq(H,q);if(F&&!f3(F))continue;let L,A;if($)L=h1(H,X,1/0,null);else if(X.service==="cloudflare"){let M=await Uq(F,Q);if(L=h1(H,X,M.width??1/0,M.hash),M.width!=null&&M.height!=null)A={width:M.width,height:M.height}}else{let M=J.get(F);if(!M)M=await Kq(F,H,X,q,W),J.set(F,M);let _=X.formats.includes("avif")?"avif":X.formats[0];L=g3(M.variants,_),{original:A}=M}if(!L)continue;let I=` srcset="${L}" sizes="${X.sizes}"`;if(!/\bwidth=/.test(V)&&A?.width)I+=` width="${A.width}"`;if(!/\bheight=/.test(V)&&A?.height)I+=` height="${A.height}"`;if(X.lazyLoad&&!/\bloading="eager"/.test(V)){if(!/\bloading=/.test(V))I+=' loading="lazy"';if(!/\bdecoding=/.test(V))I+=' decoding="async"'}z.push({match:K,replacement:`<img${V}${I}>`})}let Y=Z;for(let{match:U,replacement:K}of z)Y=Y.replace(U,K);return Y}var Yq,KH,zq=!1,BH,HH,$H,FH;var Aq=R(()=>{h3();m3();Yq=new Set([".svg",".gif"]),KH=["http://","https://","data:","//"];BH=/<img\b([^>]*)>/gi,HH=/\bsrc="([^"]*)"/,$H=/\bsrcset="/,FH=/\bdata-no-optimize\b/});var wq={};f4(wq,{buildSite:()=>wH});import{copyFileSync as MH,cpSync as u3,existsSync as K4,mkdirSync as M6,readdirSync as LH,rmSync as IH,writeFileSync as n0}from"node:fs";import{dirname as V4,join as f1,resolve as e}from"node:path";async function wH(Z,X={}){let{clean:q=!0,verbose:W=!1}=X,Q=[],J=W?console.log.bind(console):()=>{};J("Loading project.json...");let{config:z}=w7(Z),Y=e(Z,z.build.outDir),U=e(Z,"pages"),K=e(Z,"public"),V=z.build.trailingSlash??"always",B=await T4(Z,z);if(B.entries.length>0)J(` Registered ${B.entries.length} format(s): ${B.entries.map((j)=>j.name).join(", ")}`);if(q&&K4(Y))IH(Y,{force:!0,recursive:!0});if(M6(Y,{recursive:!0}),!K4(U))throw Error(`pages/ directory not found in ${Z}`);J("Discovering pages...");let H=await T7(U,B);J(` Found ${H.length} page(s)`),J("Loading content types...");let $=await v7(Z,z,B);if($.size>0){J(` Loaded ${$.size} content type(s): ${[...$.keys()].join(", ")}`);let j=a5(Z,z);if(j)y7($,j.config)}let F=await _7(H,Z,$,B);J(` ${F.length} route(s) after expansion`);let L=0,A=e(Z,"components"),I=[],M=new Map,_=new Map;if(K4(A)){J("Compiling components...");let j=[".json",...B.documentExtensions("component")],S=LH(A).filter((f)=>j.some((h)=>f.endsWith(h))),g=e(Y,"components");M6(g,{recursive:!0});for(let f of S)try{let h=e(A,f),X0=await B1(h,{...z.$media?{$media:z.$media}:{},formats:B});for(let G0 of X0.files){let u1=G0.path.includes("/")?G0.path.split("/").pop():G0.path;if(n0(e(g,u1),G0.content,"utf8"),G0.tagName)I.push(G0.tagName);L+=1}let l=await _4(h,B);if(l.tagName){_.set(l.tagName,l);let G0=W8(l.tagName,l.style,l,z.$media??{});if(G0)M.set(l.tagName,G0),n0(e(g,`${l.tagName}.css`),G0,"utf8"),L+=1}}catch(h){let X0=h;Q.push(`Error compiling component ${f}: ${X0.message}`),console.error(`Error compiling component ${f}: ${X0.message}`)}J(` Compiled ${I.length} component(s): ${I.join(", ")}`)}let k=[];if(z.build.adapter)for(let[,j]of _){let S=l4(j);for(let g of S){let f=`./components/${g.src.replace(/^\.\//,"")}`;k.push({exportName:g.exportName,src:f})}}let b=z.images.optimize&&z.images.service==="cloudflare",C=z.images.optimize&&!b?Xq(Z):null,T=b?new Map:null;if(b)console.log('images.service is "cloudflare" — srcsets use /cdn-cgi/image transform URLs. '+"Ensure Image Transformations are enabled for your zone (Cloudflare dashboard → "+"Images → Transformations); these URLs do not work on *.pages.dev / *.workers.dev previews.");for(let j of F)try{J(` Compiling ${j.urlPattern} ...`);let S=await DH(j,z,Z,$,C,_,T,B),g=new Set;for(let[h,X0]of _)if(e1(X0))g.add(h);if(I.length>0)S.html=RH(S.html,I,M,g);let f=Iq(j.urlPattern,Y,V);M6(V4(f),{recursive:!0}),n0(f,S.html,"utf8"),L+=1;for(let h of B.withCapability("serialize")){if(!h.exportTarget)continue;try{let X0=await h.call("serialize",S.doc,{buildScope:(l)=>m6(l,null),componentDefs:_,evaluateTemplate:(l,G0)=>{if(!x(l))return;return Y0(l,G0)??l},mode:"export"});if(X0){let l=f.replace(/\.html$/,h.extensions[0]);n0(l,X0,"utf8"),L+=1}}catch(X0){let l=X0;Q.push(`Error exporting ${h.name} for ${j.urlPattern}: ${l.message}`)}}for(let h of S.files){let X0=e(V4(f),h.path);M6(V4(X0),{recursive:!0}),n0(X0,h.content,"utf8"),L+=1}if(S.serverHandler){let h=e(V4(f),"_server.js");n0(h,S.serverHandler,"utf8"),L+=1}}catch(S){let g=S,f=`Error compiling ${j.urlPattern}: ${g.message}`;Q.push(f),console.error(f)}if(C&&z.images.optimize){qq(Z,C);let j=e(U4(Z),"_optimized");if(K4(j)){let g=e(Y,"images/_optimized");M6(g,{recursive:!0}),u3(j,g,{recursive:!0})}let S=Object.keys(C.entries).length;if(S>0)J(` Optimized ${S} image(s)`)}if(z.build.adapter){let{adapter:j}=z.build;J("Generating site-wide server worker...");let S=new Map;for(let h of k)if(!S.has(h.exportName))S.set(h.exportName,h);let f=j==="cloudflare-pages"&&S.size===0?null:y5([...S.values()],{adapter:j});if(f){let h=j==="cloudflare-pages"?"_worker.js":"worker.js";if(n0(e(Y,h),f,"utf8"),L+=1,J(` Generated dist/${h} (${S.size} server function(s))`),j==="cloudflare-pages")n0(e(Y,"_routes.json"),`${JSON.stringify({exclude:[],include:["/_jx/*"],version:1},null,2)}
|
|
240
|
+
*/HX(l0);IX(l0);DX(l0);PX(l0);mX(l0);uX(l0);nX(l0);sX(l0);iB=l0});import{createHash as tX}from"node:crypto";import{existsSync as rB,mkdirSync as aB,readFileSync as sB}from"node:fs";import{basename as oB,extname as tB,resolve as b3}from"node:path";import{createRequire as eB}from"node:module";async function eX(){if(Y4)return Y4;try{return Y4=(await Promise.resolve().then(() => (S3(),k3))).default,Y4}catch{}try{return Y4=eB(b3(process.cwd(),"package.json"))("sharp"),Y4}catch(Z){throw Error(`Sharp is required for image optimization but failed to load: ${t0(Z)}`,{cause:Z})}}async function v3(Z){let q=await(await eX())(Z).metadata();return{format:q.format??"unknown",height:q.height??0,width:q.width??0}}function y4(Z){let X=sB(Z);return tX("md5").update(X).digest("hex").slice(0,8)}function y3(Z){let X=JSON.stringify({formats:Z.formats,quality:Z.quality,widths:Z.widths});return tX("md5").update(X).digest("hex").slice(0,8)}function XH(Z,X,q,W){return`${Z}-${X}-${q}.${W}`}async function Zq(Z,X,q){let W=await eX(),Q=await v3(Z),J=y4(Z),z=oB(Z,tB(Z)),Y=b3(X,"_optimized");aB(Y,{recursive:!0});let U=[],K=q.widths.filter((H)=>H<=Q.width);if(K.length===0||!K.includes(Q.width))K.push(Q.width);K.sort((H,$)=>H-$);let V=[];for(let H of K)for(let $ of q.formats){let F=XH(z,H,J,$),L=`/${ZH}/${F}`,A=b3(Y,F);if(U.push({absolutePath:A,format:$,outputPath:L,width:H}),rB(A))continue;let I=q.quality[$]??80,M=W(Z).resize(H).toFormat($,{quality:I}).toFile(A).then(()=>{});V.push(M)}let B=4;for(let H=0;H<V.length;H+=B)await Promise.all(V.slice(H,H+B));return{contentHash:J,original:{format:Q.format,height:Q.height,width:Q.width},variants:U}}function g3(Z,X){return Z.filter((q)=>q.format===X).map((q)=>`${q.outputPath} ${q.width}w`).join(", ")}var Y4=null,ZH="images/_optimized";var h3=R(()=>{e0()});import{existsSync as qH,mkdirSync as WH,readFileSync as QH,writeFileSync as JH}from"node:fs";import{basename as zH,resolve as g1}from"node:path";import{execSync as GH}from"node:child_process";import{tmpdir as YH}from"node:os";function U4(Z){if(g4===void 0)try{let X=GH("npm config get cache",{cwd:YH(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();g4=X&&X!=="undefined"?X:null}catch{g4=null}if(g4)return g1(g4,"jxsuite-images",zH(Z));return g1(Z,".cache/images")}function Xq(Z){let X=g1(U4(Z),"manifest.json");if(!qH(X))return{entries:{},version:1};try{return JSON.parse(QH(X,"utf8"))}catch{return{entries:{},version:1}}}function qq(Z,X){let q=U4(Z);WH(q,{recursive:!0}),JH(g1(q,"manifest.json"),JSON.stringify(X,null,2),"utf8")}function Wq(Z,X){let q=Z.entries[X];if(!q)return null;return q.manifest}function Qq(Z,X,q,W){Z.entries[X]={manifest:W,source:q,timestamp:Date.now()}}var g4;var m3=R(()=>{h3()});import{existsSync as f3}from"node:fs";import{basename as UH,extname as Gq,resolve as Jq}from"node:path";async function Uq(Z,X){let q=X.get(Z);if(!q){let W=y4(Z);try{let Q=await v3(Z);q={width:Q.width,height:Q.height,hash:W}}catch(Q){if(!zq)zq=!0,console.warn(`Could not read image dimensions (${Q.message}) — `+"emitting srcsets without width/height attributes.");q={width:null,height:null,hash:W}}X.set(Z,q)}return q}function h1(Z,X,q,W){let Q=X.quality?.webp??80,J=Z.startsWith("/")?"":"/",z=W?`?v=${W}`:"";return X.widths.filter((Y)=>Y<=q).toSorted((Y,U)=>Y-U).map((Y)=>`/cdn-cgi/image/width=${Y},quality=${Q},fit=scale-down,format=auto${J}${Z}${z} ${Y}w`).join(", ")}async function Kq(Z,X,q,W,Q){let J=`${y4(Z)}:${y3(q)}`,z=Wq(Q,J);if(z){if(z.variants.every((K)=>f3(K.absolutePath)))return z}if(!z)console.log(` Optimizing ${UH(Z)}...`);let Y=await Zq(Z,U4(W),q);return Qq(Q,J,X,Y),Y}function Vq(Z){if(typeof Z!=="string")return!0;if(!Z)return!0;if(Z.includes("${"))return!0;if(KH.some((X)=>Z.startsWith(X)))return!0;if(Yq.has(Gq(Z).toLowerCase()))return!0;return!1}function Bq(Z,X){if(X.service!=="cloudflare")return!1;if(!X.remoteDomains?.length)return!1;if(typeof Z!=="string"||!Z.startsWith("https://"))return!1;if(Z.includes("${"))return!1;try{let q=new URL(Z);if(Yq.has(Gq(q.pathname).toLowerCase()))return!1;return X.remoteDomains.includes(q.hostname)}catch{return!1}}function Hq(Z,X){if(Z.startsWith("/"))return Jq(X,"public",Z.slice(1));return Jq(X,Z)}async function $q(Z,X,q,W,Q){let J=new Map;if(!X.optimize)return{imageRefs:J};return await Fq(Z,X,q,W,Q??new Map,J),{imageRefs:J}}async function Fq(Z,X,q,W,Q,J){if(!Z||typeof Z!=="object")return;if(Z.tagName==="img")await VH(Z,X,q,W,Q,J);if(typeof Z.innerHTML==="string"&&Z.innerHTML.includes("<img"))Z.innerHTML=await AH(Z.innerHTML,X,q,W,Q,J);if(Array.isArray(Z.children))for(let z of Z.children){if(typeof z==="string")continue;await Fq(z,X,q,W,Q,J)}}async function VH(Z,X,q,W,Q,J){if(!Z.attributes)Z.attributes={};let z=Z.attributes.src??Z.src;if(typeof z!=="string")return;let Y=Bq(z,X);if(!Y&&Vq(z))return;if(Z.attributes["data-no-optimize"]!==void 0)return;let U;if(Y)U=h1(z,X,1/0,null);else{let K=Hq(z,q);if(!f3(K))return;if(X.service==="cloudflare"){let V=await Uq(K,Q);U=h1(z,X,V.width??1/0,V.hash)}else{let V=J.get(K);if(!V)V=await Kq(K,z,X,q,W),J.set(K,V);let B=X.formats.includes("avif")?"avif":X.formats[0];U=g3(V.variants,B)}}if(U)Z.attributes.srcset=U,Z.attributes.sizes??=X.sizes;if(X.lazyLoad&&Z.attributes.loading!=="eager")Z.attributes.loading="lazy",Z.attributes.decoding="async"}async function AH(Z,X,q,W,Q,J){let z=[];for(let U of Z.matchAll(BH)){let[K]=U,[,V]=U;if($H.test(V))continue;if(FH.test(V))continue;let B=V.match(HH);if(!B)continue;let H=B[1].replaceAll("&","&"),$=Bq(H,X);if(!$&&Vq(H))continue;let F=$?null:Hq(H,q);if(F&&!f3(F))continue;let L;if($)L=h1(H,X,1/0,null);else if(X.service==="cloudflare"){let I=await Uq(F,Q);L=h1(H,X,I.width??1/0,I.hash)}else{let I=J.get(F);if(!I)I=await Kq(F,H,X,q,W),J.set(F,I);let M=X.formats.includes("avif")?"avif":X.formats[0];L=g3(I.variants,M)}if(!L)continue;let A=` srcset="${L}" sizes="${X.sizes}"`;if(X.lazyLoad&&!/\bloading="eager"/.test(V)){if(!/\bloading=/.test(V))A+=' loading="lazy"';if(!/\bdecoding=/.test(V))A+=' decoding="async"'}z.push({match:K,replacement:`<img${V}${A}>`})}let Y=Z;for(let{match:U,replacement:K}of z)Y=Y.replace(U,K);return Y}var Yq,KH,zq=!1,BH,HH,$H,FH;var Aq=R(()=>{h3();m3();Yq=new Set([".svg",".gif"]),KH=["http://","https://","data:","//"];BH=/<img\b([^>]*)>/gi,HH=/\bsrc="([^"]*)"/,$H=/\bsrcset="/,FH=/\bdata-no-optimize\b/});var wq={};f4(wq,{buildSite:()=>wH});import{copyFileSync as MH,cpSync as u3,existsSync as K4,mkdirSync as M6,readdirSync as LH,rmSync as IH,writeFileSync as n0}from"node:fs";import{dirname as V4,join as f1,resolve as e}from"node:path";async function wH(Z,X={}){let{clean:q=!0,verbose:W=!1}=X,Q=[],J=W?console.log.bind(console):()=>{};J("Loading project.json...");let{config:z}=w7(Z),Y=e(Z,z.build.outDir),U=e(Z,"pages"),K=e(Z,"public"),V=z.build.trailingSlash??"always",B=await T4(Z,z);if(B.entries.length>0)J(` Registered ${B.entries.length} format(s): ${B.entries.map((j)=>j.name).join(", ")}`);if(q&&K4(Y))IH(Y,{force:!0,recursive:!0});if(M6(Y,{recursive:!0}),!K4(U))throw Error(`pages/ directory not found in ${Z}`);J("Discovering pages...");let H=await T7(U,B);J(` Found ${H.length} page(s)`),J("Loading content types...");let $=await v7(Z,z,B);if($.size>0){J(` Loaded ${$.size} content type(s): ${[...$.keys()].join(", ")}`);let j=a5(Z,z);if(j)y7($,j.config)}let F=await _7(H,Z,$,B);J(` ${F.length} route(s) after expansion`);let L=0,A=e(Z,"components"),I=[],M=new Map,P=new Map;if(K4(A)){J("Compiling components...");let j=[".json",...B.documentExtensions("component")],S=LH(A).filter((f)=>j.some((h)=>f.endsWith(h))),g=e(Y,"components");M6(g,{recursive:!0});for(let f of S)try{let h=e(A,f),X0=await B1(h,{...z.$media?{$media:z.$media}:{},formats:B});for(let G0 of X0.files){let u1=G0.path.includes("/")?G0.path.split("/").pop():G0.path;if(n0(e(g,u1),G0.content,"utf8"),G0.tagName)I.push(G0.tagName);L+=1}let l=await _4(h,B);if(l.tagName){P.set(l.tagName,l);let G0=W8(l.tagName,l.style,l,z.$media??{});if(G0)M.set(l.tagName,G0),n0(e(g,`${l.tagName}.css`),G0,"utf8"),L+=1}}catch(h){let X0=h;Q.push(`Error compiling component ${f}: ${X0.message}`),console.error(`Error compiling component ${f}: ${X0.message}`)}J(` Compiled ${I.length} component(s): ${I.join(", ")}`)}let k=[];if(z.build.adapter)for(let[,j]of P){let S=l4(j);for(let g of S){let f=`./components/${g.src.replace(/^\.\//,"")}`;k.push({exportName:g.exportName,src:f})}}let b=z.images.optimize&&z.images.service==="cloudflare",C=z.images.optimize&&!b?Xq(Z):null,T=b?new Map:null;if(b)console.log('images.service is "cloudflare" — srcsets use /cdn-cgi/image transform URLs. '+"Ensure Image Transformations are enabled for your zone (Cloudflare dashboard → "+"Images → Transformations); these URLs do not work on *.pages.dev / *.workers.dev previews.");for(let j of F)try{J(` Compiling ${j.urlPattern} ...`);let S=await DH(j,z,Z,$,C,P,T,B),g=new Set;for(let[h,X0]of P)if(e1(X0))g.add(h);if(I.length>0)S.html=RH(S.html,I,M,g);let f=Iq(j.urlPattern,Y,V);M6(V4(f),{recursive:!0}),n0(f,S.html,"utf8"),L+=1;for(let h of B.withCapability("serialize")){if(!h.exportTarget)continue;try{let X0=await h.call("serialize",S.doc,{buildScope:(l)=>m6(l,null),componentDefs:P,evaluateTemplate:(l,G0)=>{if(!x(l))return;return Y0(l,G0)??l},mode:"export"});if(X0){let l=f.replace(/\.html$/,h.extensions[0]);n0(l,X0,"utf8"),L+=1}}catch(X0){let l=X0;Q.push(`Error exporting ${h.name} for ${j.urlPattern}: ${l.message}`)}}for(let h of S.files){let X0=e(V4(f),h.path);M6(V4(X0),{recursive:!0}),n0(X0,h.content,"utf8"),L+=1}if(S.serverHandler){let h=e(V4(f),"_server.js");n0(h,S.serverHandler,"utf8"),L+=1}}catch(S){let g=S,f=`Error compiling ${j.urlPattern}: ${g.message}`;Q.push(f),console.error(f)}if(C&&z.images.optimize){qq(Z,C);let j=e(U4(Z),"_optimized");if(K4(j)){let g=e(Y,"images/_optimized");M6(g,{recursive:!0}),u3(j,g,{recursive:!0})}let S=Object.keys(C.entries).length;if(S>0)J(` Optimized ${S} image(s)`)}if(z.build.adapter){let{adapter:j}=z.build;J("Generating site-wide server worker...");let S=new Map;for(let h of k)if(!S.has(h.exportName))S.set(h.exportName,h);let f=j==="cloudflare-pages"&&S.size===0?null:y5([...S.values()],{adapter:j});if(f){let h=j==="cloudflare-pages"?"_worker.js":"worker.js";if(n0(e(Y,h),f,"utf8"),L+=1,J(` Generated dist/${h} (${S.size} server function(s))`),j==="cloudflare-pages")n0(e(Y,"_routes.json"),`${JSON.stringify({exclude:[],include:["/_jx/*"],version:1},null,2)}
|
|
241
241
|
`,"utf8"),L+=1;let X0=e(Y,"components");M6(X0,{recursive:!0});for(let{src:l}of S.values()){let G0=e(Z,l.replace(/^\.\//,"")),u1=e(X0,l.replace(/^\.\/components\//,""));if(K4(G0))MH(G0,u1)}}}if(z.redirects&&Object.keys(z.redirects).length>0){J("Generating redirects...");let j=jH(z.redirects,Y);L+=j}if(K4(K))J("Copying public/ assets..."),u3(K,Y,{recursive:!0});if(z.copy){J("Copying mapped files...");for(let[j,S]of Object.entries(z.copy)){let g=e(Z,j),f=e(Y,S);M6(V4(f),{recursive:!0}),u3(g,f)}}if(J(`
|
|
242
|
-
Build complete: ${F.length} routes, ${L} files`),Q.length>0)J(` ${Q.length} error(s)`);return{errors:Q,files:L,routes:F.length}}async function DH(Z,X,q,W=new Map,Q=null,J=new Map,z=null,Y){let U=await _4(Z.sourcePath,Y),K=n5(U,X,q),V=U.$head??K._pageHead??[],B=K.$head??[],H=U.title??K._pageTitle??null;delete K._pageHead,delete K._pageTitle,x7(K,X,Z,W,q),await h7(K,Z,q,{config:X,contentTypes:W});let $=m6(K.state??{}),F=H??X.name??"Jx Site";if(typeof F==="string"&&x(F))F=Y0(F,$)??F;let L=Mq(V,$),A=Mq(B,$);h4(K,$);let I={counter:{n:0},media:{...X.$media,...K.$media},rules:[]};if(c3(K,J,I),K.state)for(let[T,j]of Object.entries(K.state)){if(T==="$site"||T==="$page")continue;if(j&&typeof j==="object"&&!Array.isArray(j)&&j.timing==="compiler")delete K.state[T];else if(Array.isArray(j))delete K.state[T]}let M=NH(X.$head??[]),
|
|
242
|
+
Build complete: ${F.length} routes, ${L} files`),Q.length>0)J(` ${Q.length} error(s)`);return{errors:Q,files:L,routes:F.length}}async function DH(Z,X,q,W=new Map,Q=null,J=new Map,z=null,Y){let U=await _4(Z.sourcePath,Y),K=n5(U,X,q),V=U.$head??K._pageHead??[],B=K.$head??[],H=U.title??K._pageTitle??null;delete K._pageHead,delete K._pageTitle,x7(K,X,Z,W,q),await h7(K,Z,q,{config:X,contentTypes:W});let $=m6(K.state??{}),F=H??X.name??"Jx Site";if(typeof F==="string"&&x(F))F=Y0(F,$)??F;let L=Mq(V,$),A=Mq(B,$);h4(K,$);let I={counter:{n:0},media:{...X.$media,...K.$media},rules:[]};if(c3(K,J,I),K.state)for(let[T,j]of Object.entries(K.state)){if(T==="$site"||T==="$page")continue;if(j&&typeof j==="object"&&!Array.isArray(j)&&j.timing==="compiler")delete K.state[T];else if(Array.isArray(j))delete K.state[T]}let M=NH(X.$head??[]),P=C7(M,A,L,{title:F,charset:X.defaults?.charset??"utf8",...X.name!=null&&{siteName:X.name},...X.url!=null&&{siteUrl:X.url},pageUrl:Z.urlPattern});if(X.$media)K.$media={...X.$media,...K.$media};if(X.images?.optimize&&(Q||z))await $q(K,X.images,q,Q,z??void 0);let k=await l5(K,{lang:X.defaults?.lang??"en",projectStyle:X.style??null,title:F});if(I.rules.length>0)k.html=k.html.replace("</head>",`<style>
|
|
243
243
|
${I.rules.join(`
|
|
244
244
|
`)}
|
|
245
245
|
</style>
|
|
246
|
-
</head>`);k.html=PH(k.html,
|
|
246
|
+
</head>`);k.html=PH(k.html,P,X.defaults?.lang??"en");let b=(K.$elements??[]).filter((T)=>typeof T==="string"&&!T.startsWith("./")&&!T.startsWith("../"));if(b.length>0)k.html=_H(k.html,b);let C=null;if(!X.build?.adapter)try{let T=await Y1(Z.sourcePath);if(T)C=T}catch{}return{doc:K,files:k.files,html:k.html,serverHandler:C}}function Mq(Z,X){return Z.map((q)=>{if(!q||typeof q!=="object")return q;let W={...q};if(W.attributes){W.attributes={...W.attributes};for(let[Q,J]of Object.entries(W.attributes))if(typeof J==="string"&&x(J))W.attributes[Q]=Y0(J,X)??J}if(typeof W.textContent==="string"&&x(W.textContent))W.textContent=Y0(W.textContent,X)??W.textContent;return W})}function NH(Z){return Z.map((X)=>{if(!X||typeof X!=="object"||!X.attributes)return X;let q={...X,attributes:{...X.attributes}};for(let W of["href","src"]){let Q=q.attributes[W];if(typeof Q==="string"&&TH(Q))q.attributes[W]=`/node_modules/${Q}`}return q})}function TH(Z){return!Z.startsWith("/")&&!Z.startsWith("./")&&!Z.startsWith("../")&&!Z.startsWith("http")&&!Z.startsWith("data:")}function Lq(Z,X){if(!Z||typeof Z!=="object")return Z;let q={};for(let[W,Q]of Object.entries(Z))if(W==="children"&&Array.isArray(Q))q.children=Q.map((J)=>{if(typeof J==="string")return J;return Lq(J,X)});else if(W==="style"&&Q&&typeof Q==="object"){let J={...Q};for(let[z,Y]of Object.entries(J))if(x(Y))J[z]=m1(Y,X)??Y;q.style=J}else if(W==="attributes"&&Q&&typeof Q==="object"){let J={...Q};for(let[z,Y]of Object.entries(J))if(x(Y))J[z]=m1(Y,X)??Y;q.attributes=J}else if(W==="$props"&&Q&&typeof Q==="object"){let J={...Q};for(let[z,Y]of Object.entries(J))if(x(Y)){let U=m1(Y,X);J[z]=U!==null?U??null:Y}q.$props=J}else if(typeof Q==="string"&&x(Q))q[W]=m1(Q,X)??Q;else q[W]=Q;return q}function m1(Z,X){try{let q=X.$map?.item,W=X.$map?.index,Q=Z.match(/^\$\{(.+)\}$/s);if(Q)return Function("state","$map","item","index",`return (${Q[1]})`)(X,X.$map,q,W);return Function("state","$map","item","index",`return \`${Z}\``)(X,X.$map,q,W)}catch{return null}}function h4(Z,X){if(!Z||typeof Z!=="object")return;if(typeof Z.innerHTML==="string"&&x(Z.innerHTML)){let W=Y0(Z.innerHTML,X);if(W!=null)Z.innerHTML=String(W).replaceAll("${","${")}if(typeof Z.textContent==="string"&&x(Z.textContent))Z.textContent=Y0(Z.textContent,X)??Z.textContent;if(Z.style&&typeof Z.style==="object"){for(let[W,Q]of Object.entries(Z.style))if(typeof Q==="string"&&x(Q))Z.style[W]=Y0(Q,X)??Q}if(Z.attributes&&typeof Z.attributes==="object"){for(let[W,Q]of Object.entries(Z.attributes))if(typeof Q==="string"&&x(Q))Z.attributes[W]=Y0(Q,X)??Q}if(Z.$props&&typeof Z.$props==="object"){for(let[W,Q]of Object.entries(Z.$props))if(typeof Q==="string"&&x(Q))Z.$props[W]=Y0(Q,X)??Q}let q=Z.children;if(w6(q)){let W=q.items,Q=null;if(L0(W))Q=t1(W.$ref,X);else if(Array.isArray(W))Q=W;let J=q.map;if(Array.isArray(Q)&&J){Z.children=Q.map((z,Y)=>{let U=Object.create(X);U.$map={index:Y,item:z},U["$map/item"]=z,U["$map/index"]=Y;let K=Lq(J,U);return h4(K,U),K});return}}if(typeof q==="string"&&x(q)){let W=Y0(q,X);if(Array.isArray(W)){let Q=W;Z.children=Q;for(let J of Q)h4(J,X)}}else if(Array.isArray(Z.children)){let W=0;while(W<Z.children.length){let Q=Z.children[W];if(typeof Q==="string"&&x(Q)){let J=Y0(Q,X);if(Array.isArray(J)){let z=J;Z.children.splice(W,1,...z);for(let Y of z)h4(Y,X);W+=z.length;continue}}h4(Q,X),W+=1}}}function c3(Z,X,q){if(!Z||typeof Z!=="object")return;if(Array.isArray(Z)){for(let Q of Z)c3(Q,X,q);return}if(Array.isArray(Z.children))for(let Q of Z.children)c3(Q,X,q);let W=X.get(Z.tagName);if(W){let Q=Array.isArray(Z.children)&&Z.children.length>0?Z.children.map((Y)=>{if(q&&Y&&typeof Y==="object")G6(Y,q.rules,q.media,"",q.counter,"jxs");return b6(Y,{},null)}).join(`
|
|
247
247
|
`):null,J=q8(W,Z.$props||null,Q),z=e1(W);if(Z.innerHTML=J,delete Z.children,W.style&&Z.$props){let Y={...W.state};for(let[V,B]of Object.entries(Z.$props))Y[V]=V in Y?B:B;let U=m6(Y,null),K={};for(let[V,B]of Object.entries(W.style))if(typeof B==="string"&&x(B)){let H=p(B,U);if(H!=null)K[V]=H}if(Object.keys(K).length>0)Z.style={...Z.style,...K}}if(delete Z.$props,z)Z.$static=!0;else Z.$prerendered=!0}}function RH(Z,X,q=new Map,W=new Set){let Q=X.filter((H)=>Z.includes(`<${H}`));if(Q.length===0)return Z;let J=Q.filter((H)=>q.has(H)).map((H)=>`<link rel="stylesheet" href="/components/${H}.css">`).join(`
|
|
248
248
|
`),z=Z;if(J)z=z.replace("</head>",` ${J}
|
|
249
249
|
</head>`);let Y=Q.filter((H)=>!W.has(H));if(Y.length===0)return z;let U=`<script type="importmap">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jxsuite/compiler",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.4",
|
|
4
4
|
"description": "Jx static HTML compiler, island detector, and site builder",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@apidevtools/json-schema-ref-parser": "^15.3.5",
|
|
45
|
-
"@jxsuite/parser": "^0.28.
|
|
46
|
-
"@jxsuite/runtime": "^0.28.
|
|
47
|
-
"@jxsuite/schema": "^0.28.
|
|
45
|
+
"@jxsuite/parser": "^0.28.4",
|
|
46
|
+
"@jxsuite/runtime": "^0.28.4",
|
|
47
|
+
"@jxsuite/schema": "^0.28.4",
|
|
48
48
|
"sharp": "^0.35.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
@@ -318,7 +318,6 @@ async function transformImgNode(
|
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
let srcset;
|
|
321
|
-
let original: { width: number; height: number } | undefined;
|
|
322
321
|
|
|
323
322
|
if (remote) {
|
|
324
323
|
// Original dimensions are unknown without fetching — emit every configured width and let
|
|
@@ -333,9 +332,6 @@ async function transformImgNode(
|
|
|
333
332
|
if (config.service === "cloudflare") {
|
|
334
333
|
const meta = await resolveCfMeta(absoluteSrc, metaCache);
|
|
335
334
|
srcset = buildCloudflareSrcset(src, config, meta.width ?? Infinity, meta.hash);
|
|
336
|
-
if (meta.width != null && meta.height != null) {
|
|
337
|
-
original = { width: meta.width, height: meta.height };
|
|
338
|
-
}
|
|
339
335
|
} else {
|
|
340
336
|
let manifest = imageRefs.get(absoluteSrc);
|
|
341
337
|
|
|
@@ -346,7 +342,6 @@ async function transformImgNode(
|
|
|
346
342
|
|
|
347
343
|
const preferredFormat = config.formats.includes("avif") ? "avif" : config.formats[0];
|
|
348
344
|
srcset = buildSrcset(manifest.variants, preferredFormat);
|
|
349
|
-
({ original } = manifest);
|
|
350
345
|
}
|
|
351
346
|
}
|
|
352
347
|
|
|
@@ -355,13 +350,6 @@ async function transformImgNode(
|
|
|
355
350
|
node.attributes.sizes ??= config.sizes;
|
|
356
351
|
}
|
|
357
352
|
|
|
358
|
-
if (!node.attributes.width && original?.width) {
|
|
359
|
-
node.attributes.width = String(original.width);
|
|
360
|
-
}
|
|
361
|
-
if (!node.attributes.height && original?.height) {
|
|
362
|
-
node.attributes.height = String(original.height);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
353
|
if (config.lazyLoad && node.attributes.loading !== "eager") {
|
|
366
354
|
node.attributes.loading = "lazy";
|
|
367
355
|
node.attributes.decoding = "async";
|
|
@@ -424,16 +412,12 @@ async function transformInnerHtmlImages(
|
|
|
424
412
|
}
|
|
425
413
|
|
|
426
414
|
let srcset;
|
|
427
|
-
let original: { width: number; height: number } | undefined;
|
|
428
415
|
|
|
429
416
|
if (remote) {
|
|
430
417
|
srcset = buildCloudflareSrcset(src, config, Infinity, null);
|
|
431
418
|
} else if (config.service === "cloudflare") {
|
|
432
419
|
const meta = await resolveCfMeta(absoluteSrc as string, metaCache);
|
|
433
420
|
srcset = buildCloudflareSrcset(src, config, meta.width ?? Infinity, meta.hash);
|
|
434
|
-
if (meta.width != null && meta.height != null) {
|
|
435
|
-
original = { width: meta.width, height: meta.height };
|
|
436
|
-
}
|
|
437
421
|
} else {
|
|
438
422
|
let manifest = imageRefs.get(absoluteSrc as string);
|
|
439
423
|
if (!manifest) {
|
|
@@ -443,19 +427,12 @@ async function transformInnerHtmlImages(
|
|
|
443
427
|
|
|
444
428
|
const preferredFormat = config.formats.includes("avif") ? "avif" : config.formats[0];
|
|
445
429
|
srcset = buildSrcset(manifest.variants, preferredFormat);
|
|
446
|
-
({ original } = manifest);
|
|
447
430
|
}
|
|
448
431
|
if (!srcset) {
|
|
449
432
|
continue;
|
|
450
433
|
}
|
|
451
434
|
|
|
452
435
|
let extra = ` srcset="${srcset}" sizes="${config.sizes}"`;
|
|
453
|
-
if (!/\bwidth=/.test(attrs) && original?.width) {
|
|
454
|
-
extra += ` width="${original.width}"`;
|
|
455
|
-
}
|
|
456
|
-
if (!/\bheight=/.test(attrs) && original?.height) {
|
|
457
|
-
extra += ` height="${original.height}"`;
|
|
458
|
-
}
|
|
459
436
|
if (config.lazyLoad && !/\bloading="eager"/.test(attrs)) {
|
|
460
437
|
if (!/\bloading=/.test(attrs)) {
|
|
461
438
|
extra += ` loading="lazy"`;
|