@jxsuite/compiler 0.28.0 → 0.28.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +123 -215
- package/dist/compiler.js +77 -170
- package/package.json +4 -4
- package/src/compiler.ts +1 -6
- package/src/site/image-optimizer.ts +2 -3
- package/src/site/image-transform.ts +31 -21
- package/src/site/site-build.ts +22 -49
- package/src/site/site-loader.ts +2 -10
- package/src/targets/compile-server.ts +8 -58
- package/src/targets/compile-image-endpoint.ts +0 -138
package/dist/compiler.js
CHANGED
|
@@ -1,163 +1,82 @@
|
|
|
1
|
-
import{createRequire as G6}from"node:module";var sZ=Object.create;var{getPrototypeOf:aZ,defineProperty:I1,getOwnPropertyNames:tZ}=Object;var eZ=Object.prototype.hasOwnProperty;function Z6(Z){return this[Z]}var X6,z6,l3=(Z,X,z)=>{var q=Z!=null&&typeof Z==="object";if(q){var J=X?X6??=new WeakMap:z6??=new WeakMap,Q=J.get(Z);if(Q)return Q}z=Z!=null?sZ(aZ(Z)):{};let G=X||!Z||!Z.__esModule?I1(z,"default",{value:Z,enumerable:!0}):z;for(let Y of tZ(Z))if(!eZ.call(G,Y))I1(G,Y,{get:Z6.bind(Z,Y),enumerable:!0});if(q)J.set(Z,G);return G};var i3=(Z,X)=>()=>(X||Z((X={exports:{}}).exports,X),X.exports);var q6=(Z)=>Z;function J6(Z,X){this[Z]=q6.bind(null,X)}var I8=(Z,X)=>{for(var z in X)I1(Z,z,{get:X[z],enumerable:!0,configurable:!0,set:J6.bind(X,z)})};var T=(Z,X)=>()=>(Z&&(X=Z(Z=0)),X);var G0=G6(import.meta.url);function F0(Z){return R8.has(Z)}function t(Z,X,z,q){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return U0(Z,X,z,q);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return W6(Z.$ref,X,z,q);if(Array.isArray(Z))return Z.map((J)=>t(J,X,z,q));return Z}function W6(Z,X,z,q){if(Z==="$reduce/acc")return q?.acc;if(Z.startsWith("$reduce/"))return q?.acc;if(Z.startsWith("event#/")){let J=Z.slice(7);return I0(z,J)}if(Z.startsWith("$map/")){let J=Z.split("/"),Q=J[1],G;if(Q==="item")G=q?.item??X.$map?.item??X["$map/item"];else if(Q==="index")G=q?.index??X.$map?.index??X["$map/index"];else G=X.$map?.[Q]??X["$map/"+Q];return J.length>2?I0(G,J.slice(2).join("/")):G}if(Z.startsWith("#/state/")){let J=Z.slice(8),Q=J.indexOf("/");if(Q<0)return X[J];return I0(X[J.slice(0,Q)],J.slice(Q+1))}if(Z.startsWith("parent#/"))return X[Z.slice(8)];if(Z.startsWith("window#/"))return I0(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return I0(globalThis.document,Z.slice(10));return X[Z]??null}function Y6(Z,X,z,q){if(Z.startsWith("$map/")){let J=Z.split("/"),Q=J[1],G;if(Q==="item")G=q?.item??X.$map?.item??X["$map/item"];else if(Q==="index")G=q?.index??X.$map?.index??X["$map/index"];else G=X.$map?.[Q]??X["$map/"+Q];if(J.length>2){let Y=J.slice(2),W=Y.pop();return{obj:Y.length>0?I0(G,Y.join("/")):G,key:W}}return{obj:X.$map??X,key:Q==="item"?"$map/item":"$map/index"}}if(Z.startsWith("#/state/")){let J=Z.slice(8);if(J.indexOf("/")<0)return{obj:X,key:J};let G=J.split("/"),Y=G.pop(),W=X;for(let U of G)W=W[U];return{obj:W,key:Y}}return{obj:X,key:Z}}function U0(Z,X,z,q){let{operator:J,target:Q,value:G,initial:Y}=Z;if(!Q6.has(J))throw Error(`$expression: unknown operator "${J}"`);if(T1.has(J)&&!("value"in Z)){let W=t(Q,X,z,q);if(J==="!")return!W;if(J==="-")return-W}if(R1.has(J)){let W=t(Q,X,z,q),U=t(G,X,z,q);switch(J){case"+":return W+U;case"-":return W-U;case"*":return W*U;case"/":return W/U;case"%":return W%U;case"===":return W===U;case"!==":return W!==U;case"<":return W<U;case"<=":return W<=U;case">":return W>U;case">=":return W>=U;case"&&":return W&&U;case"||":return W||U}}if(C8.has(J)){let W=t(G,X,z,q),{obj:U,key:K}=Y6(Q.$ref,X,z,q);switch(J){case"=":U[K]=W;break;case"+=":U[K]+=W;break;case"-=":U[K]-=W;break;case"*=":U[K]*=W;break;case"/=":U[K]/=W;break}return}if(j8.has(J)){let W=t(Q,X,z,q);switch(J){case"push":return W.push(t(G,X,z,q));case"unshift":return W.unshift(t(G,X,z,q));case"pop":return W.pop();case"shift":return W.shift();case"splice":{let U=t(G,X,z,q);return W.splice(...U)}}}if(C1.has(J)){let W=t(Q,X,z,q);if(J==="reduce"){let U=t(Y,X,z,q);return W.reduce((K,V,M)=>{return U0(G,X,z,{acc:K,item:V,index:M})},U)}if(J==="map")return W.map((U,K)=>{return U0(G,X,z,{...q,item:U,index:K})});if(J==="filter")return W.filter((U,K)=>{return U0(G,X,z,{...q,item:U,index:K})})}return}function n(Z,X){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return d(Z,X);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return N8(Z.$ref,X);if(Array.isArray(Z))return Z.map((z)=>n(z,X)).join(", ");return JSON.stringify(Z)}function N8(Z,X){let z=X.statePrefix??"state",q=X.eventParam??"event";if(Z==="$reduce/acc")return"_acc";if(Z.startsWith("$reduce/"))return"_acc";if(Z.startsWith("event#/")){let J=Z.slice(7);return`${q}.${J.replace(/\//g,".")}`}if(Z.startsWith("$map/")){let J=Z.split("/"),Q=J[1];if(Q==="item")return J.length>2?`_item.${J.slice(2).join(".")}`:"_item";if(Q==="index")return"_index";return`_${Q}`}if(Z.startsWith("#/state/")){let J=Z.slice(8);return`${z}.${J.replace(/\//g,".")}`}if(Z.startsWith("parent#/"))return`${z}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replace(/\//g,".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replace(/\//g,".")}`;return`${z}.${Z}`}function T8(Z,X){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return N8(Z.$ref,X);return n(Z,X)}function d(Z,X={}){let{operator:z,target:q,value:J,initial:Q}=Z;if(T1.has(z)&&!("value"in Z)){let G=n(q,X);if(z==="!")return`!(${G})`;if(z==="-")return`-(${G})`}if(R1.has(z)){let G=n(q,X),Y=n(J,X);return`(${G} ${z} ${Y})`}if(C8.has(z)){let G=T8(q,X),Y=n(J,X);return`${G} ${z} ${Y}`}if(j8.has(z)){let G=T8(q,X);switch(z){case"push":return`${G}.push(${n(J,X)})`;case"unshift":return`${G}.unshift(${n(J,X)})`;case"pop":return`${G}.pop()`;case"shift":return`${G}.shift()`;case"splice":{let Y=Array.isArray(J)?J.map((W)=>n(W,X)).join(", "):n(J,X);return`${G}.splice(${Y})`}}}if(C1.has(z)){let G=n(q,X),Y=d(J,X);if(z==="reduce"){let W=n(Q,X);return`${G}.reduce((_acc, _item, _index) => ${Y}, ${W})`}if(z==="map")return`${G}.map((_item, _index) => ${Y})`;if(z==="filter")return`${G}.filter((_item, _index) => ${Y})`}return"undefined"}function I0(Z,X){return X.split(/[./]/).reduce((z,q)=>z?.[q],Z)}var R8,T1,R1,C8,j8,C1,Q6;var j1=T(()=>{R8=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),T1=new Set(["!","-"]),R1=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||"]),C8=new Set(["=","+=","-=","*=","/="]),j8=new Set(["push","pop","shift","unshift","splice"]),C1=new Set(["reduce","map","filter"]),Q6=new Set([...R8,...T1,...R1,...C1])});function U6(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function l(Z){return Z.replace(/[A-Z]/g,(X)=>`-${X.toLowerCase()}`)}function u(Z){return Object.entries(Z).filter(([X,z])=>!U6(X)&&(z===null||typeof z!=="object")).map(([X,z])=>`${l(X)}: ${z}`).join("; ")}var H0;var a0=T(()=>{j1();H0=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 T0(Z){for(let X of Object.keys(Z))if(!K6.has(X))return!1;return!0}function P(Z){return typeof Z==="string"&&Z.includes("${")}function x1(Z){if(!Z||typeof Z!=="object")return!1;if(Z.state)for(let[X,z]of Object.entries(Z.state)){if(X==="$site"||X==="$page")continue;if(z&&typeof z==="object"&&!Array.isArray(z)&&z.timing==="compiler")continue;if(typeof z!=="object"||z===null||Array.isArray(z))return!0;if(z.$prototype)return!0;if("default"in z)return!0;if(T0(z))continue;return!0}if(Z.$switch)return!0;if(!Array.isArray(Z.children)&&Z.children?.$prototype==="Array")return!0;if(Array.isArray(Z.children)){if(Z.children.some((X)=>x1(X)))return!0}for(let[X,z]of Object.entries(Z)){if(H0.has(X))continue;if(z!==null&&typeof z==="object"&&typeof z.$ref==="string")return!0;if(P(z))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(P(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(P(X))return!0}return!1}function _8(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,z]of Object.entries(Z)){if(H0.has(X))continue;if(z!==null&&typeof z==="object"&&typeof z.$ref==="string")return!0;if(P(z))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(P(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(P(X))return!0}return!1}function R0(Z,X=null,z={},q={}){return{scope:Z?.state?x8(Z.state,X):X??Object.create(null),scopeDefs:z,media:q}}function x8(Z={},X=null){let z=Object.create(X??null);for(let[q,J]of Object.entries(Z)){if(typeof J!=="object"||J===null||Array.isArray(J)){B0(z,q,t0(J));continue}let Q=J;if("default"in Q){B0(z,q,t0(Q.default));continue}if(!Q.$prototype&&!("$expression"in Q)&&!T0(Q))B0(z,q,t0(Q))}for(let[q,J]of Object.entries(Z)){if(typeof J==="string"&&P(J)){N1(z,q,()=>E1(J,z));continue}if(!J||typeof J!=="object")continue;let Q=J;if("$expression"in Q){let G=Q.$expression;if(F0(G.operator))B0(z,q,(Y,W)=>U0(G,Y,W));else N1(z,q,()=>U0(G,z,null));continue}if(Q.$prototype==="Function"){if(Q.body){let G=Function("state",...Q.parameters??Q.arguments??[],Q.body);if(Q.body.includes("return"))N1(z,q,()=>G(z));else B0(z,q,G)}else if(!Q.body?.includes("return"))B0(z,q,()=>{});continue}if(Q.$prototype==="LocalStorage"||Q.$prototype==="SessionStorage")B0(z,q,t0(Q.default??null))}return z}function B0(Z,X,z){Object.defineProperty(Z,X,{value:z,enumerable:!0,configurable:!0,writable:!0})}function N1(Z,X,z){Object.defineProperty(Z,X,{enumerable:!0,configurable:!0,get:z})}function b(Z,X){if(Q0(Z))return V6(Z.$ref,X);if(P(Z))return E1(Z,X);return Z}function Q0(Z){return Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string"}function V6(Z,X){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let z=Z.split("/"),q=z[1],J=X.$map?.[q]??X["$map/"+q];return z.length>2?P8(J,z.slice(2).join("/")):J}if(Z.startsWith("#/state/")){let z=Z.slice(8),q=z.indexOf("/");if(q<0)return X[z];return P8(X[z.slice(0,q)],z.slice(q+1))}return X[Z]??null}function E1(Z,X){try{let z=Z.match(/^\$\{(.+)\}$/s);if(z)return Function("state","$map",`return (${z[1]})`)(X,X?.$map);return Function("state","$map",`return \`${Z}\``)(X,X?.$map)}catch{return null}}function P8(Z,X){if(!X)return Z;return X.split("/").reduce((z,q)=>z==null?void 0:z[q],Z)}function t0(Z){if(Z===null||typeof Z!=="object")return Z;return JSON.parse(JSON.stringify(Z))}function y0(Z,X){let z="",q=b(Z.id,X),J=b(Z.className,X),Q=b(Z.hidden,X),G=b(Z.tabIndex,X),Y=b(Z.title,X),W=b(Z.lang,X),U=b(Z.dir,X);if(q)z+=` id="${C(String(q))}"`;if(J)z+=` class="${C(String(J))}"`;if(Q)z+=" hidden";if(G!==void 0&&G!==null)z+=` tabindex="${C(String(G))}"`;if(Y)z+=` title="${C(String(Y))}"`;if(W)z+=` lang="${C(String(W))}"`;if(U)z+=` dir="${C(String(U))}"`;if(Z.style&&X){let K=Object.entries(Z.style).filter(([V,M])=>!V.startsWith(":")&&!V.startsWith(".")&&!V.startsWith("&")&&!V.startsWith("[")&&!V.startsWith("@")&&M!==null&&typeof M!=="object"&&typeof M==="string"&&P(M)).map(([V,M])=>{let F=b(M,X);return F==null?null:`${l(V)}: ${F}`}).filter(Boolean).join("; ");if(K)z+=` style="${K}"`}if(Z.attributes)for(let[K,V]of Object.entries(Z.attributes)){let M=b(V,X);if(M!==null&&M!==void 0&&(typeof M==="string"||typeof M==="number"||typeof M==="boolean"))z+=` ${K}="${C(String(M))}"`}if(Z.tagName==="img"){if(!Z.attributes?.loading)z+=' loading="lazy"';if(!Z.attributes?.decoding)z+=' decoding="async"'}if(Z.$static)z+=" data-jx-static";else if(Z.$prerendered)z+=" data-jx-prerendered";return z}function C0(Z,X={},z=null){let q=[];if(z&&typeof z==="object"){let Q=function(K,V){let M=u(V);if(M)q.push(`${K} { ${M} }`);for(let[F,H]of Object.entries(V)){if(H===null||typeof H!=="object"||Array.isArray(H))continue;if(F.startsWith("@")){let B=F.startsWith("@--")?`@media ${X[F.slice(1)]??F.slice(1)}`:F,$=u(H);if($)q.push(`${B} { ${K} { ${$} } }`);for(let[D,O]of Object.entries(H)){if(O===null||typeof O!=="object"||Array.isArray(O))continue;if(D.startsWith("@"))continue;let R=D.startsWith("&")?D.replace("&",K):D.startsWith(":")||D.startsWith(".")||D.startsWith("[")?`${K}${D}`:`${K} ${D}`,j=u(O);if(j)q.push(`${B} { ${R} { ${j} } }`)}continue}let A=F.startsWith("&")?F.replace("&",K):F.startsWith(":")||F.startsWith(".")||F.startsWith("[")?`${K}${F}`:`${K} ${F}`;Q(A,H)}};for(let[K,V]of Object.entries(z))if(K.startsWith(":")||K.startsWith(".")||K.startsWith("["))Q(K,V);else if(V!==null&&typeof V==="object"&&!Array.isArray(V)&&!K.startsWith("@")&&!K.startsWith("--"))Q(K,V);else if(K.startsWith("@")){let M=K.startsWith("@--")?`@media ${X[K.slice(1)]??K.slice(1)}`:K.startsWith("@(")?`@media ${K.slice(1)}`:K;q.push(`${M} { body { ${u(V)} } }`)}let G={},Y={};for(let[K,V]of Object.entries(z)){if(K.startsWith(":")||K.startsWith(".")||K.startsWith("[")||K.startsWith("@"))continue;if(V!==null&&typeof V==="object"&&!Array.isArray(V))continue;if(K.startsWith("--"))G[K]=V;else Y[K]=V}let W=u(G);if(W)q.push(`:root { ${W} }`);let U=u(Y);if(U)q.push(`body { ${U} }`)}if(m0(Z,q,X,"",{n:0}),q.length===0)return"";return`<style>
|
|
1
|
+
import{createRequire as X6}from"node:module";var iZ=Object.create;var{getPrototypeOf:nZ,defineProperty:I1,getOwnPropertyNames:oZ}=Object;var rZ=Object.prototype.hasOwnProperty;function sZ(Z){return this[Z]}var aZ,tZ,u3=(Z,X,z)=>{var q=Z!=null&&typeof Z==="object";if(q){var J=X?aZ??=new WeakMap:tZ??=new WeakMap,W=J.get(Z);if(W)return W}z=Z!=null?iZ(nZ(Z)):{};let G=X||!Z||!Z.__esModule?I1(z,"default",{value:Z,enumerable:!0}):z;for(let Y of oZ(Z))if(!rZ.call(G,Y))I1(G,Y,{get:sZ.bind(Z,Y),enumerable:!0});if(q)J.set(Z,G);return G};var f3=(Z,X)=>()=>(X||Z((X={exports:{}}).exports,X),X.exports);var eZ=(Z)=>Z;function Z6(Z,X){this[Z]=eZ.bind(null,X)}var w8=(Z,X)=>{for(var z in X)I1(Z,z,{get:X[z],enumerable:!0,configurable:!0,set:Z6.bind(X,z)})};var T=(Z,X)=>()=>(Z&&(X=Z(Z=0)),X);var G0=X6(import.meta.url);function F0(Z){return T8.has(Z)}function t(Z,X,z,q){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return U0(Z,X,z,q);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return q6(Z.$ref,X,z,q);if(Array.isArray(Z))return Z.map((J)=>t(J,X,z,q));return Z}function q6(Z,X,z,q){if(Z==="$reduce/acc")return q?.acc;if(Z.startsWith("$reduce/"))return q?.acc;if(Z.startsWith("event#/")){let J=Z.slice(7);return I0(z,J)}if(Z.startsWith("$map/")){let J=Z.split("/"),W=J[1],G;if(W==="item")G=q?.item??X.$map?.item??X["$map/item"];else if(W==="index")G=q?.index??X.$map?.index??X["$map/index"];else G=X.$map?.[W]??X["$map/"+W];return J.length>2?I0(G,J.slice(2).join("/")):G}if(Z.startsWith("#/state/")){let J=Z.slice(8),W=J.indexOf("/");if(W<0)return X[J];return I0(X[J.slice(0,W)],J.slice(W+1))}if(Z.startsWith("parent#/"))return X[Z.slice(8)];if(Z.startsWith("window#/"))return I0(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return I0(globalThis.document,Z.slice(10));return X[Z]??null}function J6(Z,X,z,q){if(Z.startsWith("$map/")){let J=Z.split("/"),W=J[1],G;if(W==="item")G=q?.item??X.$map?.item??X["$map/item"];else if(W==="index")G=q?.index??X.$map?.index??X["$map/index"];else G=X.$map?.[W]??X["$map/"+W];if(J.length>2){let Y=J.slice(2),Q=Y.pop();return{obj:Y.length>0?I0(G,Y.join("/")):G,key:Q}}return{obj:X.$map??X,key:W==="item"?"$map/item":"$map/index"}}if(Z.startsWith("#/state/")){let J=Z.slice(8);if(J.indexOf("/")<0)return{obj:X,key:J};let G=J.split("/"),Y=G.pop(),Q=X;for(let U of G)Q=Q[U];return{obj:Q,key:Y}}return{obj:X,key:Z}}function U0(Z,X,z,q){let{operator:J,target:W,value:G,initial:Y}=Z;if(!z6.has(J))throw Error(`$expression: unknown operator "${J}"`);if(T1.has(J)&&!("value"in Z)){let Q=t(W,X,z,q);if(J==="!")return!Q;if(J==="-")return-Q}if(R1.has(J)){let Q=t(W,X,z,q),U=t(G,X,z,q);switch(J){case"+":return Q+U;case"-":return Q-U;case"*":return Q*U;case"/":return Q/U;case"%":return Q%U;case"===":return Q===U;case"!==":return Q!==U;case"<":return Q<U;case"<=":return Q<=U;case">":return Q>U;case">=":return Q>=U;case"&&":return Q&&U;case"||":return Q||U}}if(R8.has(J)){let Q=t(G,X,z,q),{obj:U,key:K}=J6(W.$ref,X,z,q);switch(J){case"=":U[K]=Q;break;case"+=":U[K]+=Q;break;case"-=":U[K]-=Q;break;case"*=":U[K]*=Q;break;case"/=":U[K]/=Q;break}return}if(C8.has(J)){let Q=t(W,X,z,q);switch(J){case"push":return Q.push(t(G,X,z,q));case"unshift":return Q.unshift(t(G,X,z,q));case"pop":return Q.pop();case"shift":return Q.shift();case"splice":{let U=t(G,X,z,q);return Q.splice(...U)}}}if(C1.has(J)){let Q=t(W,X,z,q);if(J==="reduce"){let U=t(Y,X,z,q);return Q.reduce((K,V,M)=>{return U0(G,X,z,{acc:K,item:V,index:M})},U)}if(J==="map")return Q.map((U,K)=>{return U0(G,X,z,{...q,item:U,index:K})});if(J==="filter")return Q.filter((U,K)=>{return U0(G,X,z,{...q,item:U,index:K})})}return}function n(Z,X){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return d(Z,X);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return j8(Z.$ref,X);if(Array.isArray(Z))return Z.map((z)=>n(z,X)).join(", ");return JSON.stringify(Z)}function j8(Z,X){let z=X.statePrefix??"state",q=X.eventParam??"event";if(Z==="$reduce/acc")return"_acc";if(Z.startsWith("$reduce/"))return"_acc";if(Z.startsWith("event#/")){let J=Z.slice(7);return`${q}.${J.replace(/\//g,".")}`}if(Z.startsWith("$map/")){let J=Z.split("/"),W=J[1];if(W==="item")return J.length>2?`_item.${J.slice(2).join(".")}`:"_item";if(W==="index")return"_index";return`_${W}`}if(Z.startsWith("#/state/")){let J=Z.slice(8);return`${z}.${J.replace(/\//g,".")}`}if(Z.startsWith("parent#/"))return`${z}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replace(/\//g,".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replace(/\//g,".")}`;return`${z}.${Z}`}function I8(Z,X){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return j8(Z.$ref,X);return n(Z,X)}function d(Z,X={}){let{operator:z,target:q,value:J,initial:W}=Z;if(T1.has(z)&&!("value"in Z)){let G=n(q,X);if(z==="!")return`!(${G})`;if(z==="-")return`-(${G})`}if(R1.has(z)){let G=n(q,X),Y=n(J,X);return`(${G} ${z} ${Y})`}if(R8.has(z)){let G=I8(q,X),Y=n(J,X);return`${G} ${z} ${Y}`}if(C8.has(z)){let G=I8(q,X);switch(z){case"push":return`${G}.push(${n(J,X)})`;case"unshift":return`${G}.unshift(${n(J,X)})`;case"pop":return`${G}.pop()`;case"shift":return`${G}.shift()`;case"splice":{let Y=Array.isArray(J)?J.map((Q)=>n(Q,X)).join(", "):n(J,X);return`${G}.splice(${Y})`}}}if(C1.has(z)){let G=n(q,X),Y=d(J,X);if(z==="reduce"){let Q=n(W,X);return`${G}.reduce((_acc, _item, _index) => ${Y}, ${Q})`}if(z==="map")return`${G}.map((_item, _index) => ${Y})`;if(z==="filter")return`${G}.filter((_item, _index) => ${Y})`}return"undefined"}function I0(Z,X){return X.split(/[./]/).reduce((z,q)=>z?.[q],Z)}var T8,T1,R1,R8,C8,C1,z6;var j1=T(()=>{T8=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),T1=new Set(["!","-"]),R1=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||"]),R8=new Set(["=","+=","-=","*=","/="]),C8=new Set(["push","pop","shift","unshift","splice"]),C1=new Set(["reduce","map","filter"]),z6=new Set([...T8,...T1,...R1,...C1])});function G6(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function l(Z){return Z.replace(/[A-Z]/g,(X)=>`-${X.toLowerCase()}`)}function u(Z){return Object.entries(Z).filter(([X,z])=>!G6(X)&&(z===null||typeof z!=="object")).map(([X,z])=>`${l(X)}: ${z}`).join("; ")}var H0;var a0=T(()=>{j1();H0=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 T0(Z){for(let X of Object.keys(Z))if(!W6.has(X))return!1;return!0}function P(Z){return typeof Z==="string"&&Z.includes("${")}function x1(Z){if(!Z||typeof Z!=="object")return!1;if(Z.state)for(let[X,z]of Object.entries(Z.state)){if(X==="$site"||X==="$page")continue;if(z&&typeof z==="object"&&!Array.isArray(z)&&z.timing==="compiler")continue;if(typeof z!=="object"||z===null||Array.isArray(z))return!0;if(z.$prototype)return!0;if("default"in z)return!0;if(T0(z))continue;return!0}if(Z.$switch)return!0;if(!Array.isArray(Z.children)&&Z.children?.$prototype==="Array")return!0;if(Array.isArray(Z.children)){if(Z.children.some((X)=>x1(X)))return!0}for(let[X,z]of Object.entries(Z)){if(H0.has(X))continue;if(z!==null&&typeof z==="object"&&typeof z.$ref==="string")return!0;if(P(z))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(P(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(P(X))return!0}return!1}function P8(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,z]of Object.entries(Z)){if(H0.has(X))continue;if(z!==null&&typeof z==="object"&&typeof z.$ref==="string")return!0;if(P(z))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(P(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(P(X))return!0}return!1}function R0(Z,X=null,z={},q={}){return{scope:Z?.state?_8(Z.state,X):X??Object.create(null),scopeDefs:z,media:q}}function _8(Z={},X=null){let z=Object.create(X??null);for(let[q,J]of Object.entries(Z)){if(typeof J!=="object"||J===null||Array.isArray(J)){B0(z,q,t0(J));continue}let W=J;if("default"in W){B0(z,q,t0(W.default));continue}if(!W.$prototype&&!("$expression"in W)&&!T0(W))B0(z,q,t0(W))}for(let[q,J]of Object.entries(Z)){if(typeof J==="string"&&P(J)){N1(z,q,()=>E1(J,z));continue}if(!J||typeof J!=="object")continue;let W=J;if("$expression"in W){let G=W.$expression;if(F0(G.operator))B0(z,q,(Y,Q)=>U0(G,Y,Q));else N1(z,q,()=>U0(G,z,null));continue}if(W.$prototype==="Function"){if(W.body){let G=Function("state",...W.parameters??W.arguments??[],W.body);if(W.body.includes("return"))N1(z,q,()=>G(z));else B0(z,q,G)}else if(!W.body?.includes("return"))B0(z,q,()=>{});continue}if(W.$prototype==="LocalStorage"||W.$prototype==="SessionStorage")B0(z,q,t0(W.default??null))}return z}function B0(Z,X,z){Object.defineProperty(Z,X,{value:z,enumerable:!0,configurable:!0,writable:!0})}function N1(Z,X,z){Object.defineProperty(Z,X,{enumerable:!0,configurable:!0,get:z})}function b(Z,X){if(W0(Z))return Q6(Z.$ref,X);if(P(Z))return E1(Z,X);return Z}function W0(Z){return Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string"}function Q6(Z,X){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let z=Z.split("/"),q=z[1],J=X.$map?.[q]??X["$map/"+q];return z.length>2?N8(J,z.slice(2).join("/")):J}if(Z.startsWith("#/state/")){let z=Z.slice(8),q=z.indexOf("/");if(q<0)return X[z];return N8(X[z.slice(0,q)],z.slice(q+1))}return X[Z]??null}function E1(Z,X){try{let z=Z.match(/^\$\{(.+)\}$/s);if(z)return Function("state","$map",`return (${z[1]})`)(X,X?.$map);return Function("state","$map",`return \`${Z}\``)(X,X?.$map)}catch{return null}}function N8(Z,X){if(!X)return Z;return X.split("/").reduce((z,q)=>z==null?void 0:z[q],Z)}function t0(Z){if(Z===null||typeof Z!=="object")return Z;return JSON.parse(JSON.stringify(Z))}function y0(Z,X){let z="",q=b(Z.id,X),J=b(Z.className,X),W=b(Z.hidden,X),G=b(Z.tabIndex,X),Y=b(Z.title,X),Q=b(Z.lang,X),U=b(Z.dir,X);if(q)z+=` id="${C(String(q))}"`;if(J)z+=` class="${C(String(J))}"`;if(W)z+=" hidden";if(G!==void 0&&G!==null)z+=` tabindex="${C(String(G))}"`;if(Y)z+=` title="${C(String(Y))}"`;if(Q)z+=` lang="${C(String(Q))}"`;if(U)z+=` dir="${C(String(U))}"`;if(Z.style&&X){let K=Object.entries(Z.style).filter(([V,M])=>!V.startsWith(":")&&!V.startsWith(".")&&!V.startsWith("&")&&!V.startsWith("[")&&!V.startsWith("@")&&M!==null&&typeof M!=="object"&&typeof M==="string"&&P(M)).map(([V,M])=>{let F=b(M,X);return F==null?null:`${l(V)}: ${F}`}).filter(Boolean).join("; ");if(K)z+=` style="${K}"`}if(Z.attributes)for(let[K,V]of Object.entries(Z.attributes)){let M=b(V,X);if(M!==null&&M!==void 0&&(typeof M==="string"||typeof M==="number"||typeof M==="boolean"))z+=` ${K}="${C(String(M))}"`}if(Z.tagName==="img"){if(!Z.attributes?.loading)z+=' loading="lazy"';if(!Z.attributes?.decoding)z+=' decoding="async"'}if(Z.$static)z+=" data-jx-static";else if(Z.$prerendered)z+=" data-jx-prerendered";return z}function C0(Z,X={},z=null){let q=[];if(z&&typeof z==="object"){let W=function(K,V){let M=u(V);if(M)q.push(`${K} { ${M} }`);for(let[F,H]of Object.entries(V)){if(H===null||typeof H!=="object"||Array.isArray(H))continue;if(F.startsWith("@")){let B=F.startsWith("@--")?`@media ${X[F.slice(1)]??F.slice(1)}`:F,$=u(H);if($)q.push(`${B} { ${K} { ${$} } }`);for(let[D,O]of Object.entries(H)){if(O===null||typeof O!=="object"||Array.isArray(O))continue;if(D.startsWith("@"))continue;let R=D.startsWith("&")?D.replace("&",K):D.startsWith(":")||D.startsWith(".")||D.startsWith("[")?`${K}${D}`:`${K} ${D}`,j=u(O);if(j)q.push(`${B} { ${R} { ${j} } }`)}continue}let A=F.startsWith("&")?F.replace("&",K):F.startsWith(":")||F.startsWith(".")||F.startsWith("[")?`${K}${F}`:`${K} ${F}`;W(A,H)}};for(let[K,V]of Object.entries(z))if(K.startsWith(":")||K.startsWith(".")||K.startsWith("["))W(K,V);else if(V!==null&&typeof V==="object"&&!Array.isArray(V)&&!K.startsWith("@")&&!K.startsWith("--"))W(K,V);else if(K.startsWith("@")){let M=K.startsWith("@--")?`@media ${X[K.slice(1)]??K.slice(1)}`:K.startsWith("@(")?`@media ${K.slice(1)}`:K;q.push(`${M} { body { ${u(V)} } }`)}let G={},Y={};for(let[K,V]of Object.entries(z)){if(K.startsWith(":")||K.startsWith(".")||K.startsWith("[")||K.startsWith("@"))continue;if(V!==null&&typeof V==="object"&&!Array.isArray(V))continue;if(K.startsWith("--"))G[K]=V;else Y[K]=V}let Q=u(G);if(Q)q.push(`:root { ${Q} }`);let U=u(Y);if(U)q.push(`body { ${U} }`)}if(m0(Z,q,X,"",{n:0}),q.length===0)return"";return`<style>
|
|
2
2
|
${q.join(`
|
|
3
3
|
`)}
|
|
4
|
-
</style>`}function
|
|
4
|
+
</style>`}function x8(Z,X,z,q){let J=u(X);if(J)z.push(`${Z} { ${J} }`);for(let[W,G]of Object.entries(X)){if(G===null||typeof G!=="object"||Array.isArray(G))continue;if(W.startsWith("@")){let Q=W.startsWith("@--")?`@media ${q[W.slice(1)]??W.slice(1)}`:W.startsWith("@(")?`@media ${W.slice(1)}`:W,U=u(G);if(U)z.push(`${Q} { ${Z} { ${U} } }`);for(let[K,V]of Object.entries(G)){if(V===null||typeof V!=="object"||Array.isArray(V))continue;if(K.startsWith("@"))continue;let M=K.startsWith("&")?K.replace("&",Z):K.startsWith(":")||K.startsWith(".")||K.startsWith("[")?`${Z}${K}`:`${Z} ${K}`,F=u(V);if(F)z.push(`${Q} { ${M} { ${F} } }`)}continue}let Y=W.startsWith("&")?W.replace("&",Z):W.startsWith(":")||W.startsWith(".")||W.startsWith("[")?`${Z}${W}`:`${Z} ${W}`;x8(Y,G,z,q)}}function m0(Z,X,z,q="",J={n:0},W="jx"){if(!Z||typeof Z!=="object")return;if(Z.style){if(!Z.id&&!Z.className)Z.className=`${W}-${J.n++}`}let G=Z.id?`#${Z.id}`:Z.className?`.${Z.className.split(" ")[0]}`:Z.tagName??"*";if(Z.style){let Y=[];for(let[Q,U]of Object.entries(Z.style)){if(Q.startsWith(":")||Q.startsWith(".")||Q.startsWith("&")||Q.startsWith("[")||Q.startsWith("@"))continue;if(U===null||typeof U==="object")continue;if(typeof U==="string"&&P(U))continue;Y.push(` ${l(Q)}: ${U};`)}if(Y.length>0)X.push(`${G} {
|
|
5
5
|
${Y.join(`
|
|
6
6
|
`)}
|
|
7
|
-
}`);for(let[
|
|
8
|
-
`);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";let q=Z.tagName??"div";if(q==="slot"&&z!=null)return z;let J=y0(Z,X);if(
|
|
9
|
-
`);return`<${q}${J}>${
|
|
10
|
-
`)}function
|
|
11
|
-
${
|
|
7
|
+
}`);for(let[Q,U]of Object.entries(Z.style)){if(U===null||typeof U!=="object"||Array.isArray(U))continue;if(Q.startsWith("@")){let K=Q.startsWith("@--")?`@media ${z[Q.slice(1)]??Q.slice(1)}`:Q.startsWith("@(")?`@media ${Q.slice(1)}`:Q,V=u(U);if(V)X.push(`${K} { ${G} { ${V} } }`);for(let[M,F]of Object.entries(U)){if(F===null||typeof F!=="object"||Array.isArray(F))continue;if(M.startsWith("@"))continue;let H=M.startsWith("&")?M.replace("&",G):M.startsWith(":")||M.startsWith(".")||M.startsWith("[")?`${G}${M}`:`${G} ${M}`;X.push(`${K} { ${H} { ${u(F)} } }`)}}else{let K=Q.startsWith("&")?Q.replace("&",G):Q.startsWith(":")||Q.startsWith(".")||Q.startsWith("[")?`${G}${Q}`:`${G} ${Q}`;x8(K,U,X,z)}}}if(Array.isArray(Z.children))Z.children.forEach((Y)=>{m0(Y,X,z,G,J,W)})}function C(Z){return String(Z).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function X1(Z){return Z.split("-").map((X)=>X.charAt(0).toUpperCase()+X.slice(1)).join("")}function E8(Z){let X=new Map;return S8(Z,X),[...X.values()]}function S8(Z,X){if(!Z||typeof Z!=="object")return;if(Z.state)for(let[z,q]of Object.entries(Z.state)){let J=q;if(J&&typeof J==="object"&&J.timing==="server"&&J.$src&&J.$export&&!J.$prototype)X.set(J.$export,{key:z,exportName:J.$export,src:J.$src})}if(Array.isArray(Z.children))Z.children.forEach((z)=>S8(z,X))}function P1(Z,X,z=null){if(typeof Z==="string"){if(P(Z)&&X){let G=E1(Z,X);return G!=null?C(String(G)):C(Z)}return C(Z)}if(typeof Z==="number"||typeof Z==="boolean")return C(String(Z));if(Array.isArray(Z))return Z.map((G)=>P1(G,X,z)).join(`
|
|
8
|
+
`);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";let q=Z.tagName??"div";if(q==="slot"&&z!=null)return z;let J=y0(Z,X);if(Y6.has(q))return`<${q}${J}>`;let W="";if(Z.textContent!==void 0){let G=b(Z.textContent,X);W=G!=null?C(String(G)):""}else if(Z.innerHTML){let G=b(Z.innerHTML,X);W=G!=null?String(G):Z.innerHTML}else if(Array.isArray(Z.children))W=Z.children.map((G)=>P1(G,X,z)).join(`
|
|
9
|
+
`);return`<${q}${J}>${W}</${q}>`}function r3(Z,X=null,z=null){let q=Z.state??{};if(X){q={...q};for(let[W,G]of Object.entries(X))if(W in q){let Y=q[W];if(Y&&typeof Y==="object"&&!Array.isArray(Y)&&"default"in Y)q[W]={...Y,default:G};else q[W]=G}else q[W]=G}let J=_8(q,null);if(!Array.isArray(Z.children))return"";return Z.children.map((W)=>P1(W,J,z)).join(`
|
|
10
|
+
`)}function s3(Z){return _1(Z)}function _1(Z){if(!Z||typeof Z!=="object")return!0;if(Array.isArray(Z))return Z.every(_1);if(Z.$prototype)return!1;if(Z.$ref)return!1;if(Z.state)for(let X of Object.values(Z.state)){if(!X||typeof X!=="object")continue;let z=X;if(z.$prototype)return!1;if(z.$ref)return!1}for(let X of Object.keys(Z))if(X.startsWith("on")&&X!=="observedAttributes")return!1;if(Array.isArray(Z.children)){if(!Z.children.every(_1))return!1}else if(Z.children&&typeof Z.children==="object"){if(Z.children.$prototype)return!1}return!0}function a3(Z,X,z=null,q={}){let J=[];if(X&&typeof X==="object"){let W=[];for(let[G,Y]of Object.entries(X)){if(G.startsWith(":")||G.startsWith(".")||G.startsWith("&")||G.startsWith("[")||G.startsWith("@"))continue;if(Y===null||typeof Y==="object")continue;if(typeof Y==="string"&&P(Y))continue;W.push(` ${l(G)}: ${Y};`)}if(W.length>0)J.push(`${Z} {
|
|
11
|
+
${W.join(`
|
|
12
12
|
`)}
|
|
13
|
-
}`);for(let[G,Y]of Object.entries(X))if(G.startsWith("@")){let
|
|
13
|
+
}`);for(let[G,Y]of Object.entries(X))if(G.startsWith("@")){let Q=G.startsWith("@--")?`@media ${q[G.slice(1)]??G.slice(1)}`:G.startsWith("@(")?`@media ${G.slice(1)}`:G;J.push(`${Q} { ${Z} { ${u(Y)} } }`)}else if(G.startsWith(":")||G.startsWith(".")||G.startsWith("&")||G.startsWith("[")){let Q=G.startsWith("&")?G.replace("&",Z):`${Z}${G}`;J.push(`${Q} { ${u(Y)} }`)}}if(z&&Array.isArray(z.children)){let W={n:0};for(let G of z.children)m0(G,J,q,"",W,Z)}return J.length>0?J.join(`
|
|
14
14
|
`)+`
|
|
15
|
-
`:""}var e0="https://esm.sh/@vue/reactivity@3.5.32",Z1="https://esm.sh/lit-html@3.3.0",K6,M6;var j0=T(()=>{a0();j1();K6=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"]);M6=new Set(["input","br","hr","img","meta","link","area","col","source"])});function W0(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var F6,u0=()=>F6;var b8=T(()=>{F6=/^win/.test(globalThis.process?globalThis.process.platform:"")});function S(Z,X){let z=new URL(W0(Z),"https://aaa.nonexistanturl.com"),q=new URL(W0(X),z),J=X.match(/(\s*)$/)?.[1]||"";if(q.hostname==="aaa.nonexistanturl.com"){let{pathname:G,search:Y,hash:W}=q;return G+Y+decodeURIComponent(W)+J}let Q=q.toString()+J;if(Q.includes("#")){let[G,Y]=Q.split("#",2);return G+"#"+decodeURIComponent(Y||"")}return Q}function D0(){if(typeof window<"u"&&window.location&&window.location.href){let Z=window.location.href;if(!Z||!Z.startsWith("http"))try{return new URL(Z),Z}catch{return"/"}return Z}if(typeof process<"u"&&process.cwd){let Z=process.cwd(),X=Z.slice(-1);if(X==="/"||X==="\\")return Z;else return Z+"/"}return"/"}function g8(Z){let X=B6.exec(Z||"");if(X)return X[1].toLowerCase();return}function v8(Z){let X=Z.lastIndexOf(".");if(X>=0)return O6(Z.substring(X).toLowerCase());return""}function O6(Z){let X=Z.indexOf("?");if(X>=0)Z=Z.substring(0,X);return Z}function Z0(Z){if(!Z)return"#";let X=Z.indexOf("#");if(X>=0)return Z.substring(X);return"#"}function x(Z){if(!Z)return"";let X=Z.indexOf("#");if(X>=0)Z=Z.substring(0,X);return Z}function y8(Z){let X=g8(Z);if(X==="http"||X==="https")return!0;else if(X===void 0)return typeof window<"u";else return!1}function k1(Z){if(!Z||typeof Z!=="string")return!0;let X=Z.trim().toLowerCase();if(!X)return!0;if(X.startsWith("javascript:")||X.startsWith("vbscript:")||X.startsWith("data:"))return!0;if(X.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;let z=["localhost","127.0.0.1","::1","10.","172.16.","172.17.","172.18.","172.19.","172.20.","172.21.","172.22.","172.23.","172.24.","172.25.","172.26.","172.27.","172.28.","172.29.","172.30.","172.31.","192.168.","169.254.",".local",".internal",".intranet",".corp",".home",".lan"];try{let q=new URL(X.startsWith("//")?"http:"+X:X),J=q.hostname.toLowerCase();for(let G of z)if(J===G||J.startsWith(G)||J.endsWith(G))return!0;if(w6(J))return!0;let Q=q.port;if(Q&&I6(parseInt(Q)))return!0}catch{if(X.startsWith("/")&&!X.startsWith("//"))return!1;for(let q of z)if(X.includes(q))return!0}return!1}function w6(Z){let X=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,z=Z.match(X);if(!z)return!1;let[,q,J,Q,G]=z.map(Number);if(q>255||J>255||Q>255||G>255)return!1;return q===10||q===127||q===172&&J>=16&&J<=31||q===192&&J===168||q===169&&J===254}function I6(Z){return[22,23,25,53,135,139,445,993,995,1433,1521,3306,3389,5432,5900,6379,8080,8443,9200,27017].includes(Z)}function z1(Z){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let X=g8(Z);return X===void 0||X==="file"}function m8(Z){if(u0()){let X=D0(),z=Z.toUpperCase(),J=W0(X).toUpperCase(),Q=z.includes(J),G=z.includes(J),Y=A6.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(Q||G||Y)&&!X.startsWith("http"))Z=((U,K)=>{if(U.endsWith("/")||U.endsWith("\\"))return U+K;else return U+"/"+K})(X,Z);Z=W0(Z)}Z=encodeURI(Z);for(let X of L6)Z=Z.replace(X[0],X[1]);return Z}function P0(Z,X){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let q=0;q<S1.length;q+=2)Z=Z.replace(S1[q],S1[q+1]);let z=Z.toLowerCase().startsWith("file://");if(z){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),u0()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(X)Z="file:///"+Z;else z=!1,Z=u0()?Z:"/"+Z}if(u0()&&!z){if(Z=Z.replace(H6,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function q1(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((X)=>{return X.replace(D6,"/").replace($6,"~")})}var H6,B6,D6,$6,A6,L6,S1,N0=(Z)=>new URL(Z);var f=T(()=>{b8();H6=/\//g,B6=/^(\w{2,}):\/\//i,D6=/~1/g,$6=/~0/g,A6=/^[a-zA-Z]:[\\/]/,L6=[[/\?/g,"%3F"],[/#/g,"%23"]],S1=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"]});function h8(){let Z={},X=this;for(let z of j6(X))if(typeof z==="string"){let q=X[z],J=typeof q;if(!T6.includes(J))Z[z]=q}return Z}function j6(Z,X=[]){let z=[];while(Z&&Z!==C6)z=z.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let q=new Set(z);for(let J of X.concat(R6))q.delete(J);return q}function z0(Z){return Z instanceof o||Z instanceof _0}function g1(Z){if(Z.path===null)Z.path=[];return Z}var T6,R6,C6,o,_0,r,J1,e,G1,Q1,b1,x0;var s=T(()=>{f();T6=["function","symbol","undefined"],R6=["constructor","prototype","__proto__"],C6=Object.getPrototypeOf({});o=class o extends Error{name;message;source;path;code;constructor(Z,X){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=Z,this.source=X,this.path=null}toJSON=h8.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};_0=class _0 extends Error{files;constructor(Z){super();this.files=Z,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${P0(Z.$refs._root$Ref.path)}'`}toJSON=h8.bind(this);static getParserErrors(Z){let X=[];for(let z of Object.values(Z.$refs._$refs))if(z.errors)X.push(...z.errors);return X}get errors(){return _0.getParserErrors(this.files)}};r=class r extends o{code="EPARSER";name="ParserError";constructor(Z,X){super(`Error parsing ${X}: ${Z}`,X)}};J1=class J1 extends o{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};e=class e extends o{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(Z,X){super(Z.message||`Error reading file "${X}"`,X);if("code"in Z)this.ioErrorCode=String(Z.code)}};G1=class G1 extends o{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};Q1=class Q1 extends o{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,X,z,q,J){super(`Missing $ref pointer "${Z0(X)}". Token "${Z}" does not exist.`,x(X));this.targetToken=Z,this.targetRef=z,this.targetFound=q,this.parentPath=J}};b1=class b1 extends o{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};x0=class x0 extends o{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,X){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,x(X))}}});function m(Z,X){let z=N6(X);return z?S(Z,z):Z}function W1(Z){if(!Z||typeof Z!=="object"||ArrayBuffer.isView(Z))return!1;let X=Z.$schema;if(typeof X==="string"&&(X.includes("draft/2019-09/")||X.includes("draft/2020-12/")||X.includes("oas/3.1/")))return!0;let z=Z.openapi;return typeof z==="string"&&/^3\.1(?:\.|$)/.test(z)}function Y1(Z,X,z,q,J=!1){if(!J)return;let Q=new Set,G=(Y,W)=>{if(!Y||typeof Y!=="object"||ArrayBuffer.isView(Y)||Q.has(Y))return;Q.add(Y);let U=m(W,Y);if(U!==W)Z._addAlias(U,Y,q,J);for(let K of Object.keys(Y))G(Y[K],U)};G(z,X)}function N6(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var $0=T(()=>{f()});class A0{$ref;path;originalPath;scopeBase;value;circular;indirections;constructor(Z,X,z){this.$ref=Z,this.path=X,this.originalPath=z||X,this.scopeBase=Z.path||x(X),this.value=void 0,this.circular=!1,this.indirections=0}resolve(Z,X,z){let q=A0.parse(this.path,this.originalPath),J=[];if(this.value=f8(Z),this.$ref.dynamicIdScope&&!c8(this.$ref))this.scopeBase=m(this.scopeBase,this.value);for(let G=0;G<q.length;G++){let Y=this.circular,W=_.isExtended$Ref(this.value);if(U1(this,X,z))this.path=A0.join(this.path,q.slice(G));else if(!Y&&this.circular&&W)this.circular=!1;let U=q[G];if(this.value[U]===void 0||this.value[U]===null&&G===q.length-1){let K=!1;for(let A=q.length-1;A>G;A--){let B=q.slice(G,A+1).join("/");if(this.value[B]!==void 0){this.value=this.value[B],G=A,K=!0;break}}if(K)continue;if(U in this.value&&this.value[U]===null){this.value=K1;continue}this.value=null;let V=this.$ref.path||"",M=this.path.replace(V,""),F=A0.join("",J),H=z?.replace(V,"");throw new Q1(U,decodeURI(this.originalPath),M,F,H)}else this.value=this.value[U];if(J.push(U),this.$ref.dynamicIdScope)this.scopeBase=m(this.scopeBase,this.value)}let Q=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(!this.value||this.value.$ref&&S(Q,this.value.$ref)!==z)U1(this,X,z);return this}set(Z,X,z){let q=A0.parse(this.path),J;if(q.length===0)return this.value=X,X;if(this.value=f8(Z),this.$ref.dynamicIdScope&&!c8(this.$ref))this.scopeBase=m(this.scopeBase,this.value);for(let Q=0;Q<q.length-1;Q++){if(U1(this,z),J=q[Q],this.value&&this.value[J]!==void 0)this.value=this.value[J];else this.value=u8(this,J,{});if(this.$ref.dynamicIdScope)this.scopeBase=m(this.scopeBase,this.value)}return U1(this,z),J=q[q.length-1],u8(this,J,X),Z}static parse(Z,X){let z=Z0(Z).substring(1);if(!z)return[];let q=z.split("/");for(let J=0;J<q.length;J++)q[J]=q[J].replace(x6,"/").replace(E6,"~");if(q[0]!=="")throw new x0(z,X===void 0?Z:X);return q.slice(1)}static join(Z,X){if(Z.indexOf("#")===-1)Z+="#";X=Array.isArray(X)?X:[X];for(let z=0;z<X.length;z++){let q=X[z];Z+="/"+q.replace(_6,"~0").replace(P6,"~1")}return Z}}function U1(Z,X,z){if(_.isAllowed$Ref(Z.value,X)){let q=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,J=S(q,Z.value.$ref);if(J===Z.path&&!S6(z))Z.circular=!0;else{let Q=Z.$ref.$refs._resolve(J,Z.path,X);if(Q===null)return!1;if(Z.indirections+=Q.indirections+1,_.isExtended$Ref(Z.value))return Z.value=_.dereference(Z.value,Q.value,X),!1;else Z.$ref=Q.$ref,Z.path=Q.path,Z.value=Q.value,Z.scopeBase=Z.$ref.path;return!0}}return}function u8(Z,X,z){if(Z.value&&typeof Z.value==="object")if(X==="-"&&Array.isArray(Z.value))Z.value.push(z);else Z.value[X]=z;else throw new o(`Error assigning $ref pointer "${Z.path}".
|
|
16
|
-
Cannot set "${X}" of a non-object.`);return z}function
|
|
17
|
-
"${x(z)}" not found.`);q.set(z,X)}_get$Ref(Z){return Z=S(this._root$Ref.path,Z),this._getRef(Z)}_add(Z){let X=x(Z),z=new _(this);return z.path=X,this._$refs[X]=z,this._root$Ref=this._root$Ref||z,z}_addAlias(Z,X,z,q=!1){let J=x(Z);if(!J||this._$refs[J]||this._aliases[J])return this._$refs[J]||this._aliases[J];let
|
|
18
|
-
"${x(q)}" not found.`);return J.resolve(q,z,Z,X)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=this.values;_getRef(Z){let X=x(Z);return this._$refs[X]||this._aliases[X]}}function
|
|
19
|
-
Parsed value is empty`);else return G}catch(G){if(!G&&X.continueOnError)throw new J1(Z.url);else if(G&&G.message&&G.message.startsWith("Error parsing"))throw G;else if(!G||!("error"in G))throw SyntaxError(`Unable to parse ${Z.url}`,{cause:G});else if(G.error instanceof r)throw G.error;else throw new r(G.error.message,Z.url)}}function
|
|
15
|
+
`:""}var e0="https://esm.sh/@vue/reactivity@3.5.32",Z1="https://esm.sh/lit-html@3.3.0",W6,Y6;var j0=T(()=>{a0();j1();W6=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"]);Y6=new Set(["input","br","hr","img","meta","link","area","col","source"])});function Q0(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var U6,u0=()=>U6;var k8=T(()=>{U6=/^win/.test(globalThis.process?globalThis.process.platform:"")});function S(Z,X){let z=new URL(Q0(Z),"https://aaa.nonexistanturl.com"),q=new URL(Q0(X),z),J=X.match(/(\s*)$/)?.[1]||"";if(q.hostname==="aaa.nonexistanturl.com"){let{pathname:G,search:Y,hash:Q}=q;return G+Y+decodeURIComponent(Q)+J}let W=q.toString()+J;if(W.includes("#")){let[G,Y]=W.split("#",2);return G+"#"+decodeURIComponent(Y||"")}return W}function D0(){if(typeof window<"u"&&window.location&&window.location.href){let Z=window.location.href;if(!Z||!Z.startsWith("http"))try{return new URL(Z),Z}catch{return"/"}return Z}if(typeof process<"u"&&process.cwd){let Z=process.cwd(),X=Z.slice(-1);if(X==="/"||X==="\\")return Z;else return Z+"/"}return"/"}function b8(Z){let X=V6.exec(Z||"");if(X)return X[1].toLowerCase();return}function g8(Z){let X=Z.lastIndexOf(".");if(X>=0)return D6(Z.substring(X).toLowerCase());return""}function D6(Z){let X=Z.indexOf("?");if(X>=0)Z=Z.substring(0,X);return Z}function Z0(Z){if(!Z)return"#";let X=Z.indexOf("#");if(X>=0)return Z.substring(X);return"#"}function x(Z){if(!Z)return"";let X=Z.indexOf("#");if(X>=0)Z=Z.substring(0,X);return Z}function v8(Z){let X=b8(Z);if(X==="http"||X==="https")return!0;else if(X===void 0)return typeof window<"u";else return!1}function k1(Z){if(!Z||typeof Z!=="string")return!0;let X=Z.trim().toLowerCase();if(!X)return!0;if(X.startsWith("javascript:")||X.startsWith("vbscript:")||X.startsWith("data:"))return!0;if(X.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;let z=["localhost","127.0.0.1","::1","10.","172.16.","172.17.","172.18.","172.19.","172.20.","172.21.","172.22.","172.23.","172.24.","172.25.","172.26.","172.27.","172.28.","172.29.","172.30.","172.31.","192.168.","169.254.",".local",".internal",".intranet",".corp",".home",".lan"];try{let q=new URL(X.startsWith("//")?"http:"+X:X),J=q.hostname.toLowerCase();for(let G of z)if(J===G||J.startsWith(G)||J.endsWith(G))return!0;if($6(J))return!0;let W=q.port;if(W&&A6(parseInt(W)))return!0}catch{if(X.startsWith("/")&&!X.startsWith("//"))return!1;for(let q of z)if(X.includes(q))return!0}return!1}function $6(Z){let X=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,z=Z.match(X);if(!z)return!1;let[,q,J,W,G]=z.map(Number);if(q>255||J>255||W>255||G>255)return!1;return q===10||q===127||q===172&&J>=16&&J<=31||q===192&&J===168||q===169&&J===254}function A6(Z){return[22,23,25,53,135,139,445,993,995,1433,1521,3306,3389,5432,5900,6379,8080,8443,9200,27017].includes(Z)}function z1(Z){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let X=b8(Z);return X===void 0||X==="file"}function y8(Z){if(u0()){let X=D0(),z=Z.toUpperCase(),J=Q0(X).toUpperCase(),W=z.includes(J),G=z.includes(J),Y=H6.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(W||G||Y)&&!X.startsWith("http"))Z=((U,K)=>{if(U.endsWith("/")||U.endsWith("\\"))return U+K;else return U+"/"+K})(X,Z);Z=Q0(Z)}Z=encodeURI(Z);for(let X of B6)Z=Z.replace(X[0],X[1]);return Z}function P0(Z,X){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let q=0;q<S1.length;q+=2)Z=Z.replace(S1[q],S1[q+1]);let z=Z.toLowerCase().startsWith("file://");if(z){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),u0()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(X)Z="file:///"+Z;else z=!1,Z=u0()?Z:"/"+Z}if(u0()&&!z){if(Z=Z.replace(K6,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function q1(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((X)=>{return X.replace(M6,"/").replace(F6,"~")})}var K6,V6,M6,F6,H6,B6,S1,N0=(Z)=>new URL(Z);var f=T(()=>{k8();K6=/\//g,V6=/^(\w{2,}):\/\//i,M6=/~1/g,F6=/~0/g,H6=/^[a-zA-Z]:[\\/]/,B6=[[/\?/g,"%3F"],[/#/g,"%23"]],S1=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"]});function m8(){let Z={},X=this;for(let z of I6(X))if(typeof z==="string"){let q=X[z],J=typeof q;if(!L6.includes(J))Z[z]=q}return Z}function I6(Z,X=[]){let z=[];while(Z&&Z!==w6)z=z.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let q=new Set(z);for(let J of X.concat(O6))q.delete(J);return q}function z0(Z){return Z instanceof o||Z instanceof _0}function g1(Z){if(Z.path===null)Z.path=[];return Z}var L6,O6,w6,o,_0,r,J1,e,G1,W1,b1,x0;var s=T(()=>{f();L6=["function","symbol","undefined"],O6=["constructor","prototype","__proto__"],w6=Object.getPrototypeOf({});o=class o extends Error{name;message;source;path;code;constructor(Z,X){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=Z,this.source=X,this.path=null}toJSON=m8.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};_0=class _0 extends Error{files;constructor(Z){super();this.files=Z,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${P0(Z.$refs._root$Ref.path)}'`}toJSON=m8.bind(this);static getParserErrors(Z){let X=[];for(let z of Object.values(Z.$refs._$refs))if(z.errors)X.push(...z.errors);return X}get errors(){return _0.getParserErrors(this.files)}};r=class r extends o{code="EPARSER";name="ParserError";constructor(Z,X){super(`Error parsing ${X}: ${Z}`,X)}};J1=class J1 extends o{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};e=class e extends o{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(Z,X){super(Z.message||`Error reading file "${X}"`,X);if("code"in Z)this.ioErrorCode=String(Z.code)}};G1=class G1 extends o{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};W1=class W1 extends o{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,X,z,q,J){super(`Missing $ref pointer "${Z0(X)}". Token "${Z}" does not exist.`,x(X));this.targetToken=Z,this.targetRef=z,this.targetFound=q,this.parentPath=J}};b1=class b1 extends o{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};x0=class x0 extends o{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,X){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,x(X))}}});function m(Z,X){let z=T6(X);return z?S(Z,z):Z}function Q1(Z){if(!Z||typeof Z!=="object"||ArrayBuffer.isView(Z))return!1;let X=Z.$schema;if(typeof X==="string"&&(X.includes("draft/2019-09/")||X.includes("draft/2020-12/")||X.includes("oas/3.1/")))return!0;let z=Z.openapi;return typeof z==="string"&&/^3\.1(?:\.|$)/.test(z)}function Y1(Z,X,z,q,J=!1){if(!J)return;let W=new Set,G=(Y,Q)=>{if(!Y||typeof Y!=="object"||ArrayBuffer.isView(Y)||W.has(Y))return;W.add(Y);let U=m(Q,Y);if(U!==Q)Z._addAlias(U,Y,q,J);for(let K of Object.keys(Y))G(Y[K],U)};G(z,X)}function T6(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var $0=T(()=>{f()});class A0{$ref;path;originalPath;scopeBase;value;circular;indirections;constructor(Z,X,z){this.$ref=Z,this.path=X,this.originalPath=z||X,this.scopeBase=Z.path||x(X),this.value=void 0,this.circular=!1,this.indirections=0}resolve(Z,X,z){let q=A0.parse(this.path,this.originalPath),J=[];if(this.value=u8(Z),this.$ref.dynamicIdScope&&!f8(this.$ref))this.scopeBase=m(this.scopeBase,this.value);for(let G=0;G<q.length;G++){let Y=this.circular,Q=_.isExtended$Ref(this.value);if(U1(this,X,z))this.path=A0.join(this.path,q.slice(G));else if(!Y&&this.circular&&Q)this.circular=!1;let U=q[G];if(this.value[U]===void 0||this.value[U]===null&&G===q.length-1){let K=!1;for(let A=q.length-1;A>G;A--){let B=q.slice(G,A+1).join("/");if(this.value[B]!==void 0){this.value=this.value[B],G=A,K=!0;break}}if(K)continue;if(U in this.value&&this.value[U]===null){this.value=K1;continue}this.value=null;let V=this.$ref.path||"",M=this.path.replace(V,""),F=A0.join("",J),H=z?.replace(V,"");throw new W1(U,decodeURI(this.originalPath),M,F,H)}else this.value=this.value[U];if(J.push(U),this.$ref.dynamicIdScope)this.scopeBase=m(this.scopeBase,this.value)}let W=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(!this.value||this.value.$ref&&S(W,this.value.$ref)!==z)U1(this,X,z);return this}set(Z,X,z){let q=A0.parse(this.path),J;if(q.length===0)return this.value=X,X;if(this.value=u8(Z),this.$ref.dynamicIdScope&&!f8(this.$ref))this.scopeBase=m(this.scopeBase,this.value);for(let W=0;W<q.length-1;W++){if(U1(this,z),J=q[W],this.value&&this.value[J]!==void 0)this.value=this.value[J];else this.value=h8(this,J,{});if(this.$ref.dynamicIdScope)this.scopeBase=m(this.scopeBase,this.value)}return U1(this,z),J=q[q.length-1],h8(this,J,X),Z}static parse(Z,X){let z=Z0(Z).substring(1);if(!z)return[];let q=z.split("/");for(let J=0;J<q.length;J++)q[J]=q[J].replace(j6,"/").replace(N6,"~");if(q[0]!=="")throw new x0(z,X===void 0?Z:X);return q.slice(1)}static join(Z,X){if(Z.indexOf("#")===-1)Z+="#";X=Array.isArray(X)?X:[X];for(let z=0;z<X.length;z++){let q=X[z];Z+="/"+q.replace(C6,"~0").replace(R6,"~1")}return Z}}function U1(Z,X,z){if(_.isAllowed$Ref(Z.value,X)){let q=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,J=S(q,Z.value.$ref);if(J===Z.path&&!P6(z))Z.circular=!0;else{let W=Z.$ref.$refs._resolve(J,Z.path,X);if(W===null)return!1;if(Z.indirections+=W.indirections+1,_.isExtended$Ref(Z.value))return Z.value=_.dereference(Z.value,W.value,X),!1;else Z.$ref=W.$ref,Z.path=W.path,Z.value=W.value,Z.scopeBase=Z.$ref.path;return!0}}return}function h8(Z,X,z){if(Z.value&&typeof Z.value==="object")if(X==="-"&&Array.isArray(Z.value))Z.value.push(z);else Z.value[X]=z;else throw new o(`Error assigning $ref pointer "${Z.path}".
|
|
16
|
+
Cannot set "${X}" of a non-object.`);return z}function u8(Z){if(z0(Z))throw Z;return Z}function P6(Z){return typeof Z=="string"&&A0.parse(Z).length==0}function f8(Z){return Boolean(Z.path&&Z.path in Z.$refs._aliases)}var K1,R6,C6,j6,N6,c;var f0=T(()=>{E0();f();s();$0();K1=Symbol("null"),R6=/\//g,C6=/~/g,j6=/~1/g,N6=/~0/g;c=A0});class c0{path;value;$refs;pathType;dynamicIdScope=!1;errors=[];constructor(Z){this.$refs=Z}addError(Z){if(this.errors===void 0)this.errors=[];let X=this.errors.map(({footprint:z})=>z);if("errors"in Z&&Array.isArray(Z.errors))this.errors.push(...Z.errors.map(g1).filter(({footprint:z})=>!X.includes(z)));else if(!("footprint"in Z)||!X.includes(Z.footprint))this.errors.push(g1(Z))}exists(Z,X){try{return this.resolve(Z,X),!0}catch{return!1}}get(Z,X){return this.resolve(Z,X)?.value}resolve(Z,X,z,q){let J=new c(this,Z,z);try{let W=J.resolve(this.value,X,q);if(W.value===K1)W.value=null;return W}catch(W){if(!X||!X.continueOnError||!z0(W))throw W;if(W.path===null)W.path=q1(Z0(q));if(W instanceof x0)W.source=decodeURI(x(q));return this.addError(W),null}}set(Z,X){let z=new c(this,Z);if(this.value=z.set(this.value,X),this.value===K1)this.value=null}static is$Ref(Z){return Boolean(Z)&&typeof Z==="object"&&Z!==null&&"$ref"in Z&&typeof Z.$ref==="string"&&Z.$ref.length>0}static isExternal$Ref(Z){return c0.is$Ref(Z)&&Z.$ref[0]!=="#"}static isAllowed$Ref(Z,X){if(this.is$Ref(Z)){if(Z.$ref.substring(0,2)==="#/"||Z.$ref==="#")return!0;else if(Z.$ref[0]!=="#"&&(!X||X.resolve?.external))return!0}return}static isExtended$Ref(Z){return c0.is$Ref(Z)&&Object.keys(Z).length>1}static dereference(Z,X,z){if(X&&typeof X==="object"&&c0.isExtended$Ref(Z)){let q={};for(let W of Object.keys(Z))if(W!=="$ref")q[W]=Z[W];let J=z?.dereference?.mergeKeys??!0;for(let W of Object.keys(X)){let G=W;if(!(G in q))q[G]=X[G];else if(J&&typeof q[G]==="object"&&q[G]!==null&&typeof X[G]==="object"&&X[G]!==null)q[G]=c8(X[G],q[G])}return q}else return X}}function c8(Z,X){if(typeof Z!=="object"||Z===null)return X;if(typeof X!=="object"||X===null)return X;let z=Array.isArray(Z)?[...Z]:{...Z};for(let q of Object.keys(X))if(Array.isArray(X[q]))z[q]=[...X[q]];else if(typeof X[q]==="object"&&X[q]!==null)z[q]=c8(Z[q],X[q]);else z[q]=X[q];return z}var _;var E0=T(()=>{f0();s();f();_=c0});class p0{circular;paths(...Z){return p8(this._$refs,Z.flat()).map((z)=>{return Q0(z.decoded)})}values(...Z){let X=this._$refs;return p8(X,Z.flat()).reduce((q,J)=>{return q[Q0(J.decoded)]=X[J.encoded].value,q},{})}exists(Z,X){try{return this._resolve(Z,"",X),!0}catch{return!1}}get(Z,X){return this._resolve(Z,"",X).value}set(Z,X){let z=S(this._root$Ref.path,Z),q=this._getRef(z);if(!q)throw Error(`Error resolving $ref pointer "${Z}".
|
|
17
|
+
"${x(z)}" not found.`);q.set(z,X)}_get$Ref(Z){return Z=S(this._root$Ref.path,Z),this._getRef(Z)}_add(Z){let X=x(Z),z=new _(this);return z.path=X,this._$refs[X]=z,this._root$Ref=this._root$Ref||z,z}_addAlias(Z,X,z,q=!1){let J=x(Z);if(!J||this._$refs[J]||this._aliases[J])return this._$refs[J]||this._aliases[J];let W=new _(this);return W.path=J,W.pathType=z,W.value=X,W.dynamicIdScope=q,this._aliases[J]=W,W}_resolve(Z,X,z){let q=S(this._root$Ref.path,Z),J=this._getRef(q);if(!J)throw Error(`Error resolving $ref pointer "${Z}".
|
|
18
|
+
"${x(q)}" not found.`);return J.resolve(q,z,Z,X)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=this.values;_getRef(Z){let X=x(Z);return this._$refs[X]||this._aliases[X]}}function p8(Z,X){let z=Object.keys(Z);if(X=Array.isArray(X[0])?X[0]:Array.prototype.slice.call(X),X.length>0&&X[0])z=z.filter((q)=>{return X.includes(Z[q].pathType)});return z.map((q)=>{return{encoded:q,decoded:Z[q].pathType==="file"?P0(q,!0):q}})}var d8=T(()=>{E0();f()});function v1(Z){return Object.keys(Z||{}).filter((X)=>{return typeof Z[X]==="object"}).map((X)=>{return Z[X].name=X,Z[X]})}function y1(Z,X,z,q,J){return Z.filter((W)=>{return!!l8(W,X,z,q,J)})}function m1(Z){for(let X of Z)X.order=X.order||Number.MAX_SAFE_INTEGER;return Z.sort((X,z)=>{return X.order-z.order})}async function h1(Z,X,z,q){let J,W,G=0;return new Promise((Y,Q)=>{U();function U(){if(J=Z[G++],!J)return Q(W);try{let F=l8(J,X,z,K,q);if(F&&typeof F.then==="function")F.then(V,M);else if(F!==void 0)V(F);else if(G===Z.length)throw Error("No promise has been returned or callback has been called.")}catch(F){M(F)}}function K(F,H){if(F)M(F);else V(H)}function V(F){Y({plugin:J,result:F})}function M(F){W={plugin:J,error:F},U()}})}function l8(Z,X,z,q,J){let W=Z[X];if(typeof W==="function")return W.apply(Z,[z,q,J]);if(!q){if(W instanceof RegExp)return W.test(z.url);else if(typeof W==="string")return W===z.extension;else if(Array.isArray(W))return W.indexOf(z.extension)!==-1}return W}async function _6(Z,X,z){let q=typeof Z==="string"?Z:Z.url,J=typeof Z==="string"?void 0:Z.baseUrl,W=typeof Z==="string"?void 0:Z.reference,G=q.indexOf("#"),Y="";if(G>=0)Y=q.substring(G),q=q.substring(0,G);if(W){let K=W.indexOf("#");if(K>=0)W=W.substring(0,K)}let Q=X._add(q),U={url:q,hash:Y,extension:g8(q),...W!==void 0?{reference:W}:{},...J!==void 0?{baseUrl:J}:{}};try{let K=await x6(U,z,X);Q.pathType=K.plugin.name,U.data=K.result;let V=await E6(U,z,X);return Q.value=V.result,Q.dynamicIdScope=Q1(Q.value),Y1(X,Q.path,Q.value,Q.pathType,Q.dynamicIdScope),V.result}catch(K){if(z0(K))Q.value=K;throw K}}async function x6(Z,X,z){let q=v1(X.resolve);q=y1(q,"canRead",Z,void 0,z),m1(q);try{return await h1(q,"read",Z,z)}catch(J){if(!J&&X.continueOnError)throw new G1(Z.url);else if(!J||!("error"in J))throw SyntaxError(`Unable to resolve $ref pointer "${Z.url}"`,{cause:J});else if(J.error instanceof e)throw J.error;else throw new e(J,Z.url)}}async function E6(Z,X,z){let q=v1(X.parse),J=y1(q,"canParse",Z),W=J.length>0?J:q;m1(W);try{let G=await h1(W,"parse",Z,z);if(!G.plugin.allowEmpty&&S6(G.result))throw SyntaxError(`Error parsing "${Z.url}" as ${G.plugin.name}.
|
|
19
|
+
Parsed value is empty`);else return G}catch(G){if(!G&&X.continueOnError)throw new J1(Z.url);else if(G&&G.message&&G.message.startsWith("Error parsing"))throw G;else if(!G||!("error"in G))throw SyntaxError(`Unable to parse ${Z.url}`,{cause:G});else if(G.error instanceof r)throw G.error;else throw new r(G.error.message,Z.url)}}function S6(Z){return Z===void 0||typeof Z==="object"&&Object.keys(Z).length===0||typeof Z==="string"&&Z.trim().length===0||Buffer.isBuffer(Z)&&Z.length===0}var V1;var u1=T(()=>{f();$0();s();V1=_6});var i8;var n8=T(()=>{s();i8={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(Z){let X=Z.data;if(Buffer.isBuffer(X))X=X.toString();if(typeof X==="string")if(X.trim().length===0)return;else try{return JSON.parse(X)}catch(z){if(this.allowBOM)try{let q=X.indexOf("{");return X=X.slice(q),JSON.parse(X)}catch(q){throw new r(q.message,Z.url)}throw new r(z.message,Z.url)}else return X}}});function U9(Z){return typeof Z>"u"||Z===null}function k6(Z){return typeof Z==="object"&&Z!==null}function b6(Z){if(Array.isArray(Z))return Z;else if(U9(Z))return[];return[Z]}function g6(Z,X){var z,q,J,W;if(X){W=Object.keys(X);for(z=0,q=W.length;z<q;z+=1)J=W[z],Z[J]=X[J]}return Z}function v6(Z,X){var z="",q;for(q=0;q<X;q+=1)z+=Z;return z}function y6(Z){return Z===0&&Number.NEGATIVE_INFINITY===1/Z}function K9(Z,X){var z="",q=Z.reason||"(unknown reason)";if(!Z.mark)return q;if(Z.mark.name)z+='in "'+Z.mark.name+'" ';if(z+="("+(Z.mark.line+1)+":"+(Z.mark.column+1)+")",!X&&Z.mark.snippet)z+=`
|
|
20
20
|
|
|
21
|
-
`+Z.mark.snippet;return q+" "+z}function l0(Z,X){if(Error.call(this),this.name="YAMLException",this.reason=Z,this.mark=X,this.message=
|
|
21
|
+
`+Z.mark.snippet;return q+" "+z}function l0(Z,X){if(Error.call(this),this.name="YAMLException",this.reason=Z,this.mark=X,this.message=K9(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}function f1(Z,X,z,q,J){var W="",G="",Y=Math.floor(J/2)-1;if(q-X>Y)W=" ... ",X=q-Y+W.length;if(z-q>Y)G=" ...",z=q+Y-G.length;return{str:W+Z.slice(X,z).replace(/\t/g,"→")+G,pos:q-X+W.length}}function c1(Z,X){return k.repeat(" ",X-Z.length)+Z}function d6(Z,X){if(X=Object.create(X||null),!Z.buffer)return null;if(!X.maxLength)X.maxLength=79;if(typeof X.indent!=="number")X.indent=1;if(typeof X.linesBefore!=="number")X.linesBefore=3;if(typeof X.linesAfter!=="number")X.linesAfter=2;var z=/\r?\n|\r|\0/g,q=[0],J=[],W,G=-1;while(W=z.exec(Z.buffer))if(J.push(W.index),q.push(W.index+W[0].length),Z.position<=W.index&&G<0)G=q.length-2;if(G<0)G=q.length-1;var Y="",Q,U,K=Math.min(Z.line+X.linesAfter,J.length).toString().length,V=X.maxLength-(X.indent+K+3);for(Q=1;Q<=X.linesBefore;Q++){if(G-Q<0)break;U=f1(Z.buffer,q[G-Q],J[G-Q],Z.position-(q[G]-q[G-Q]),V),Y=k.repeat(" ",X.indent)+c1((Z.line-Q+1).toString(),K)+" | "+U.str+`
|
|
22
22
|
`+Y}U=f1(Z.buffer,q[G],J[G],Z.position,V),Y+=k.repeat(" ",X.indent)+c1((Z.line+1).toString(),K)+" | "+U.str+`
|
|
23
23
|
`,Y+=k.repeat("-",X.indent+K+3+U.pos)+`^
|
|
24
|
-
`;for(
|
|
25
|
-
`}return Y.replace(/\n$/,"")}function
|
|
26
|
-
`: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
|
|
27
|
-
`,X-1)}function
|
|
28
|
-
`,
|
|
24
|
+
`;for(Q=1;Q<=X.linesAfter;Q++){if(G+Q>=J.length)break;U=f1(Z.buffer,q[G+Q],J[G+Q],Z.position-(q[G]-q[G+Q]),V),Y+=k.repeat(" ",X.indent)+c1((Z.line+Q+1).toString(),K)+" | "+U.str+`
|
|
25
|
+
`}return Y.replace(/\n$/,"")}function o6(Z){var X={};if(Z!==null)Object.keys(Z).forEach(function(z){Z[z].forEach(function(q){X[String(q)]=z})});return X}function r6(Z,X){if(X=X||{},Object.keys(X).forEach(function(z){if(i6.indexOf(z)===-1)throw new h('Unknown option "'+z+'" 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(z){return z},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=o6(X.styleAliases||null),n6.indexOf(this.kind)===-1)throw new h('Unknown kind "'+this.kind+'" is specified for "'+Z+'" YAML type.')}function o8(Z,X){var z=[];return Z[X].forEach(function(q){var J=z.length;z.forEach(function(W,G){if(W.tag===q.tag&&W.kind===q.kind&&W.multi===q.multi)J=G}),z[J]=q}),z}function s6(){var Z={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},X,z;function q(J){if(J.multi)Z.multi[J.kind].push(J),Z.multi.fallback.push(J);else Z[J.kind][J.tag]=Z.fallback[J.tag]=J}for(X=0,z=arguments.length;X<z;X+=1)arguments[X].forEach(q);return Z}function d1(Z){return this.extend(Z)}function a6(Z){if(Z===null)return!0;var X=Z.length;return X===1&&Z==="~"||X===4&&(Z==="null"||Z==="Null"||Z==="NULL")}function t6(){return null}function e6(Z){return Z===null}function Z4(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 X4(Z){return Z==="true"||Z==="True"||Z==="TRUE"}function z4(Z){return Object.prototype.toString.call(Z)==="[object Boolean]"}function q4(Z){return 48<=Z&&Z<=57||65<=Z&&Z<=70||97<=Z&&Z<=102}function J4(Z){return 48<=Z&&Z<=55}function G4(Z){return 48<=Z&&Z<=57}function W4(Z){if(Z===null)return!1;var X=Z.length,z=0,q=!1,J;if(!X)return!1;if(J=Z[z],J==="-"||J==="+")J=Z[++z];if(J==="0"){if(z+1===X)return!0;if(J=Z[++z],J==="b"){z++;for(;z<X;z++){if(J=Z[z],J==="_")continue;if(J!=="0"&&J!=="1")return!1;q=!0}return q&&J!=="_"}if(J==="x"){z++;for(;z<X;z++){if(J=Z[z],J==="_")continue;if(!q4(Z.charCodeAt(z)))return!1;q=!0}return q&&J!=="_"}if(J==="o"){z++;for(;z<X;z++){if(J=Z[z],J==="_")continue;if(!J4(Z.charCodeAt(z)))return!1;q=!0}return q&&J!=="_"}}if(J==="_")return!1;for(;z<X;z++){if(J=Z[z],J==="_")continue;if(!G4(Z.charCodeAt(z)))return!1;q=!0}if(!q||J==="_")return!1;return!0}function Q4(Z){var X=Z,z=1,q;if(X.indexOf("_")!==-1)X=X.replace(/_/g,"");if(q=X[0],q==="-"||q==="+"){if(q==="-")z=-1;X=X.slice(1),q=X[0]}if(X==="0")return 0;if(q==="0"){if(X[1]==="b")return z*parseInt(X.slice(2),2);if(X[1]==="x")return z*parseInt(X.slice(2),16);if(X[1]==="o")return z*parseInt(X.slice(2),8)}return z*parseInt(X,10)}function Y4(Z){return Object.prototype.toString.call(Z)==="[object Number]"&&(Z%1===0&&!k.isNegativeZero(Z))}function K4(Z){if(Z===null)return!1;if(!U4.test(Z)||Z[Z.length-1]==="_")return!1;return!0}function V4(Z){var X,z;if(X=Z.replace(/_/g,"").toLowerCase(),z=X[0]==="-"?-1:1,"+-".indexOf(X[0])>=0)X=X.slice(1);if(X===".inf")return z===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(X===".nan")return NaN;return z*parseFloat(X,10)}function F4(Z,X){var z;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(k.isNegativeZero(Z))return"-0.0";return z=Z.toString(10),M4.test(z)?z.replace("e",".e"):z}function H4(Z){return Object.prototype.toString.call(Z)==="[object Number]"&&(Z%1!==0||k.isNegativeZero(Z))}function B4(Z){if(Z===null)return!1;if(I9.exec(Z)!==null)return!0;if(T9.exec(Z)!==null)return!0;return!1}function D4(Z){var X,z,q,J,W,G,Y,Q=0,U=null,K,V,M;if(X=I9.exec(Z),X===null)X=T9.exec(Z);if(X===null)throw Error("Date resolve error");if(z=+X[1],q=+X[2]-1,J=+X[3],!X[4])return new Date(Date.UTC(z,q,J));if(W=+X[4],G=+X[5],Y=+X[6],X[7]){Q=X[7].slice(0,3);while(Q.length<3)Q+="0";Q=+Q}if(X[9]){if(K=+X[10],V=+(X[11]||0),U=(K*60+V)*60000,X[9]==="-")U=-U}if(M=new Date(Date.UTC(z,q,J,W,G,Y,Q)),U)M.setTime(M.getTime()-U);return M}function $4(Z){return Z.toISOString()}function A4(Z){return Z==="<<"||Z===null}function L4(Z){if(Z===null)return!1;var X,z,q=0,J=Z.length,W=r1;for(z=0;z<J;z++){if(X=W.indexOf(Z.charAt(z)),X>64)continue;if(X<0)return!1;q+=6}return q%8===0}function O4(Z){var X,z,q=Z.replace(/[\r\n=]/g,""),J=q.length,W=r1,G=0,Y=[];for(X=0;X<J;X++){if(X%4===0&&X)Y.push(G>>16&255),Y.push(G>>8&255),Y.push(G&255);G=G<<6|W.indexOf(q.charAt(X))}if(z=J%4*6,z===0)Y.push(G>>16&255),Y.push(G>>8&255),Y.push(G&255);else if(z===18)Y.push(G>>10&255),Y.push(G>>2&255);else if(z===12)Y.push(G>>4&255);return new Uint8Array(Y)}function w4(Z){var X="",z=0,q,J,W=Z.length,G=r1;for(q=0;q<W;q++){if(q%3===0&&q)X+=G[z>>18&63],X+=G[z>>12&63],X+=G[z>>6&63],X+=G[z&63];z=(z<<8)+Z[q]}if(J=W%3,J===0)X+=G[z>>18&63],X+=G[z>>12&63],X+=G[z>>6&63],X+=G[z&63];else if(J===2)X+=G[z>>10&63],X+=G[z>>4&63],X+=G[z<<2&63],X+=G[64];else if(J===1)X+=G[z>>2&63],X+=G[z<<4&63],X+=G[64],X+=G[64];return X}function I4(Z){return Object.prototype.toString.call(Z)==="[object Uint8Array]"}function C4(Z){if(Z===null)return!0;var X=[],z,q,J,W,G,Y=Z;for(z=0,q=Y.length;z<q;z+=1){if(J=Y[z],G=!1,R4.call(J)!=="[object Object]")return!1;for(W in J)if(T4.call(J,W))if(!G)G=!0;else return!1;if(!G)return!1;if(X.indexOf(W)===-1)X.push(W);else return!1}return!0}function j4(Z){return Z!==null?Z:[]}function P4(Z){if(Z===null)return!0;var X,z,q,J,W,G=Z;W=Array(G.length);for(X=0,z=G.length;X<z;X+=1){if(q=G[X],N4.call(q)!=="[object Object]")return!1;if(J=Object.keys(q),J.length!==1)return!1;W[X]=[J[0],q[J[0]]]}return!0}function _4(Z){if(Z===null)return[];var X,z,q,J,W,G=Z;W=Array(G.length);for(X=0,z=G.length;X<z;X+=1)q=G[X],J=Object.keys(q),W[X]=[J[0],q[J[0]]];return W}function E4(Z){if(Z===null)return!0;var X,z=Z;for(X in z)if(x4.call(z,X)){if(z[X]!==null)return!1}return!0}function S4(Z){return Z!==null?Z:{}}function s8(Z){return Object.prototype.toString.call(Z)}function q0(Z){return Z===10||Z===13}function L0(Z){return Z===9||Z===32}function p(Z){return Z===9||Z===32||Z===10||Z===13}function k0(Z){return Z===44||Z===91||Z===93||Z===123||Z===125}function y4(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 m4(Z){if(Z===120)return 2;if(Z===117)return 4;if(Z===85)return 8;return 0}function h4(Z){if(48<=Z&&Z<=57)return Z-48;return-1}function a8(Z){return Z===48?"\x00":Z===97?"\x07":Z===98?"\b":Z===116?"\t":Z===9?"\t":Z===110?`
|
|
26
|
+
`: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 u4(Z){if(Z<=65535)return String.fromCharCode(Z);return String.fromCharCode((Z-65536>>10)+55296,(Z-65536&1023)+56320)}function b9(Z,X,z){if(X==="__proto__")Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,writable:!0,value:z});else Z[X]=z}function f4(Z,X){this.input=Z,this.filename=X.filename||null,this.schema=X.schema||s1,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 z={name:Z.filename,buffer:Z.input.slice(0,-1),position:Z.position,line:Z.line,column:Z.position-Z.lineStart};return z.snippet=l6(z),new h(X,z)}function L(Z,X){throw y9(Z,X)}function H1(Z,X){if(Z.onWarning)Z.onWarning.call(null,y9(Z,X))}function V0(Z,X,z,q){var J,W,G,Y;if(X<z){if(Y=Z.input.slice(X,z),q){for(J=0,W=Y.length;J<W;J+=1)if(G=Y.charCodeAt(J),!(G===9||32<=G&&G<=1114111))L(Z,"expected valid JSON character")}else if(b4.test(Y))L(Z,"the stream contains non-printable characters");Z.result+=Y}}function e8(Z,X,z,q){var J,W,G,Y;if(!k.isObject(z))L(Z,"cannot merge mappings; the provided source object is unacceptable");J=Object.keys(z);for(G=0,Y=J.length;G<Y;G+=1)if(W=J[G],!M0.call(X,W))b9(X,W,z[W]),q[W]=!0}function b0(Z,X,z,q,J,W,G,Y,Q){var U,K;if(Array.isArray(J)){J=Array.prototype.slice.call(J);for(U=0,K=J.length;U<K;U+=1){if(Array.isArray(J[U]))L(Z,"nested arrays are not supported inside keys");if(typeof J==="object"&&s8(J[U])==="[object Object]")J[U]="[object Object]"}}if(typeof J==="object"&&s8(J)==="[object Object]")J="[object Object]";if(J=String(J),X===null)X={};if(q==="tag:yaml.org,2002:merge")if(Array.isArray(W))for(U=0,K=W.length;U<K;U+=1)e8(Z,X,W[U],z);else e8(Z,X,W,z);else{if(!Z.json&&!M0.call(z,J)&&M0.call(X,J))Z.line=G||Z.line,Z.lineStart=Y||Z.lineStart,Z.position=Q||Z.position,L(Z,"duplicated mapping key");b9(X,J,W),delete z[J]}return X}function a1(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 L(Z,"a line break is expected");Z.line+=1,Z.lineStart=Z.position,Z.firstTabInLine=-1}function E(Z,X,z){var q=0,J=Z.input.charCodeAt(Z.position);while(J!==0){while(L0(J)){if(J===9&&Z.firstTabInLine===-1)Z.firstTabInLine=Z.position;J=Z.input.charCodeAt(++Z.position)}if(X&&J===35)do J=Z.input.charCodeAt(++Z.position);while(J!==10&&J!==13&&J!==0);if(q0(J)){a1(Z),J=Z.input.charCodeAt(Z.position),q++,Z.lineIndent=0;while(J===32)Z.lineIndent++,J=Z.input.charCodeAt(++Z.position)}else break}if(z!==-1&&q!==0&&Z.lineIndent<z)H1(Z,"deficient indentation");return q}function $1(Z){var X=Z.position,z;if(z=Z.input.charCodeAt(X),(z===45||z===46)&&z===Z.input.charCodeAt(X+1)&&z===Z.input.charCodeAt(X+2)){if(X+=3,z=Z.input.charCodeAt(X),z===0||p(z))return!0}return!1}function t1(Z,X){if(X===1)Z.result+=" ";else if(X>1)Z.result+=k.repeat(`
|
|
27
|
+
`,X-1)}function c4(Z,X,z){var q,J,W,G,Y,Q,U,K,V=Z.kind,M=Z.result,F;if(F=Z.input.charCodeAt(Z.position),p(F)||k0(F)||F===35||F===38||F===42||F===33||F===124||F===62||F===39||F===34||F===37||F===64||F===96)return!1;if(F===63||F===45){if(J=Z.input.charCodeAt(Z.position+1),p(J)||z&&k0(J))return!1}Z.kind="scalar",Z.result="",W=G=Z.position,Y=!1;while(F!==0){if(F===58){if(J=Z.input.charCodeAt(Z.position+1),p(J)||z&&k0(J))break}else if(F===35){if(q=Z.input.charCodeAt(Z.position-1),p(q))break}else if(Z.position===Z.lineStart&&$1(Z)||z&&k0(F))break;else if(q0(F))if(Q=Z.line,U=Z.lineStart,K=Z.lineIndent,E(Z,!1,-1),Z.lineIndent>=X){Y=!0,F=Z.input.charCodeAt(Z.position);continue}else{Z.position=G,Z.line=Q,Z.lineStart=U,Z.lineIndent=K;break}if(Y)V0(Z,W,G,!1),t1(Z,Z.line-Q),W=G=Z.position,Y=!1;if(!L0(F))G=Z.position+1;F=Z.input.charCodeAt(++Z.position)}if(V0(Z,W,G,!1),Z.result)return!0;return Z.kind=V,Z.result=M,!1}function p4(Z,X){var z,q,J;if(z=Z.input.charCodeAt(Z.position),z!==39)return!1;Z.kind="scalar",Z.result="",Z.position++,q=J=Z.position;while((z=Z.input.charCodeAt(Z.position))!==0)if(z===39)if(V0(Z,q,Z.position,!0),z=Z.input.charCodeAt(++Z.position),z===39)q=Z.position,Z.position++,J=Z.position;else return!0;else if(q0(z))V0(Z,q,J,!0),t1(Z,E(Z,!1,X)),q=J=Z.position;else if(Z.position===Z.lineStart&&$1(Z))L(Z,"unexpected end of the document within a single quoted scalar");else Z.position++,J=Z.position;L(Z,"unexpected end of the stream within a single quoted scalar")}function d4(Z,X){var z,q,J,W,G,Y;if(Y=Z.input.charCodeAt(Z.position),Y!==34)return!1;Z.kind="scalar",Z.result="",Z.position++,z=q=Z.position;while((Y=Z.input.charCodeAt(Z.position))!==0)if(Y===34)return V0(Z,z,Z.position,!0),Z.position++,!0;else if(Y===92){if(V0(Z,z,Z.position,!0),Y=Z.input.charCodeAt(++Z.position),q0(Y))E(Z,!1,X);else if(Y<256&&g9[Y])Z.result+=v9[Y],Z.position++;else if((G=m4(Y))>0){J=G,W=0;for(;J>0;J--)if(Y=Z.input.charCodeAt(++Z.position),(G=y4(Y))>=0)W=(W<<4)+G;else L(Z,"expected hexadecimal character");Z.result+=u4(W),Z.position++}else L(Z,"unknown escape sequence");z=q=Z.position}else if(q0(Y))V0(Z,z,q,!0),t1(Z,E(Z,!1,X)),z=q=Z.position;else if(Z.position===Z.lineStart&&$1(Z))L(Z,"unexpected end of the document within a double quoted scalar");else Z.position++,q=Z.position;L(Z,"unexpected end of the stream within a double quoted scalar")}function l4(Z,X){var z=!0,q,J,W,G=Z.tag,Y,Q=Z.anchor,U,K,V,M,F,H=Object.create(null),A,B,$,D;if(D=Z.input.charCodeAt(Z.position),D===91)K=93,F=!1,Y=[];else if(D===123)K=125,F=!0,Y={};else return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Y;D=Z.input.charCodeAt(++Z.position);while(D!==0){if(E(Z,!0,X),D=Z.input.charCodeAt(Z.position),D===K)return Z.position++,Z.tag=G,Z.anchor=Q,Z.kind=F?"mapping":"sequence",Z.result=Y,!0;else if(!z)L(Z,"missed comma between flow collection entries");else if(D===44)L(Z,"expected the node content, but found ','");if(B=A=$=null,V=M=!1,D===63){if(U=Z.input.charCodeAt(Z.position+1),p(U))V=M=!0,Z.position++,E(Z,!0,X)}if(q=Z.line,J=Z.lineStart,W=Z.position,g0(Z,X,M1,!1,!0),B=Z.tag,A=Z.result,E(Z,!0,X),D=Z.input.charCodeAt(Z.position),(M||Z.line===q)&&D===58)V=!0,D=Z.input.charCodeAt(++Z.position),E(Z,!0,X),g0(Z,X,M1,!1,!0),$=Z.result;if(F)b0(Z,Y,H,B,A,$,q,J,W);else if(V)Y.push(b0(Z,null,H,B,A,$,q,J,W));else Y.push(A);if(E(Z,!0,X),D=Z.input.charCodeAt(Z.position),D===44)z=!0,D=Z.input.charCodeAt(++Z.position);else z=!1}L(Z,"unexpected end of the stream within a flow collection")}function i4(Z,X){var z,q,J=p1,W=!1,G=!1,Y=X,Q=0,U=!1,K,V;if(V=Z.input.charCodeAt(Z.position),V===124)q=!1;else if(V===62)q=!0;else return!1;Z.kind="scalar",Z.result="";while(V!==0)if(V=Z.input.charCodeAt(++Z.position),V===43||V===45)if(p1===J)J=V===43?r8:k4;else L(Z,"repeat of a chomping mode identifier");else if((K=h4(V))>=0)if(K===0)L(Z,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!G)Y=X+K-1,G=!0;else L(Z,"repeat of an indentation width identifier");else break;if(L0(V)){do V=Z.input.charCodeAt(++Z.position);while(L0(V));if(V===35)do V=Z.input.charCodeAt(++Z.position);while(!q0(V)&&V!==0)}while(V!==0){a1(Z),Z.lineIndent=0,V=Z.input.charCodeAt(Z.position);while((!G||Z.lineIndent<Y)&&V===32)Z.lineIndent++,V=Z.input.charCodeAt(++Z.position);if(!G&&Z.lineIndent>Y)Y=Z.lineIndent;if(q0(V)){Q++;continue}if(Z.lineIndent<Y){if(J===r8)Z.result+=k.repeat(`
|
|
28
|
+
`,W?1+Q:Q);else if(J===p1){if(W)Z.result+=`
|
|
29
29
|
`}break}if(q)if(L0(V))U=!0,Z.result+=k.repeat(`
|
|
30
|
-
`,
|
|
31
|
-
`,
|
|
32
|
-
`,
|
|
33
|
-
`,
|
|
34
|
-
`;if(Z.charCodeAt(0)===65279)Z=Z.slice(1)}var z=new
|
|
30
|
+
`,W?1+Q:Q);else if(U)U=!1,Z.result+=k.repeat(`
|
|
31
|
+
`,Q+1);else if(Q===0){if(W)Z.result+=" "}else Z.result+=k.repeat(`
|
|
32
|
+
`,Q);else Z.result+=k.repeat(`
|
|
33
|
+
`,W?1+Q:Q);W=!0,G=!0,Q=0,z=Z.position;while(!q0(V)&&V!==0)V=Z.input.charCodeAt(++Z.position);V0(Z,z,Z.position,!1)}return!0}function Z9(Z,X){var z,q=Z.tag,J=Z.anchor,W=[],G,Y=!1,Q;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=W;Q=Z.input.charCodeAt(Z.position);while(Q!==0){if(Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,L(Z,"tab characters must not be used in indentation");if(Q!==45)break;if(G=Z.input.charCodeAt(Z.position+1),!p(G))break;if(Y=!0,Z.position++,E(Z,!0,-1)){if(Z.lineIndent<=X){W.push(null),Q=Z.input.charCodeAt(Z.position);continue}}if(z=Z.line,g0(Z,X,E9,!1,!0),W.push(Z.result),E(Z,!0,-1),Q=Z.input.charCodeAt(Z.position),(Z.line===z||Z.lineIndent>X)&&Q!==0)L(Z,"bad indentation of a sequence entry");else if(Z.lineIndent<X)break}if(Y)return Z.tag=q,Z.anchor=J,Z.kind="sequence",Z.result=W,!0;return!1}function n4(Z,X,z){var q,J,W,G,Y,Q,U=Z.tag,K=Z.anchor,V={},M=Object.create(null),F=null,H=null,A=null,B=!1,$=!1,D;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=V;D=Z.input.charCodeAt(Z.position);while(D!==0){if(!B&&Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,L(Z,"tab characters must not be used in indentation");if(q=Z.input.charCodeAt(Z.position+1),W=Z.line,(D===63||D===58)&&p(q)){if(D===63){if(B)b0(Z,V,M,F,H,null,G,Y,Q),F=H=A=null;$=!0,B=!0,J=!0}else if(B)B=!1,J=!0;else L(Z,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");Z.position+=1,D=q}else{if(G=Z.line,Y=Z.lineStart,Q=Z.position,!g0(Z,z,x9,!1,!0))break;if(Z.line===W){D=Z.input.charCodeAt(Z.position);while(L0(D))D=Z.input.charCodeAt(++Z.position);if(D===58){if(D=Z.input.charCodeAt(++Z.position),!p(D))L(Z,"a whitespace character is expected after the key-value separator within a block mapping");if(B)b0(Z,V,M,F,H,null,G,Y,Q),F=H=A=null;$=!0,B=!1,J=!1,F=Z.tag,H=Z.result}else if($)L(Z,"can not read an implicit mapping pair; a colon is missed");else return Z.tag=U,Z.anchor=K,!0}else if($)L(Z,"can not read a block mapping entry; a multiline key may not be an implicit key");else return Z.tag=U,Z.anchor=K,!0}if(Z.line===W||Z.lineIndent>X){if(B)G=Z.line,Y=Z.lineStart,Q=Z.position;if(g0(Z,X,F1,!0,J))if(B)H=Z.result;else A=Z.result;if(!B)b0(Z,V,M,F,H,A,G,Y,Q),F=H=A=null;E(Z,!0,-1),D=Z.input.charCodeAt(Z.position)}if((Z.line===W||Z.lineIndent>X)&&D!==0)L(Z,"bad indentation of a mapping entry");else if(Z.lineIndent<X)break}if(B)b0(Z,V,M,F,H,null,G,Y,Q);if($)Z.tag=U,Z.anchor=K,Z.kind="mapping",Z.result=V;return $}function o4(Z){var X,z=!1,q=!1,J,W,G;if(G=Z.input.charCodeAt(Z.position),G!==33)return!1;if(Z.tag!==null)L(Z,"duplication of a tag property");if(G=Z.input.charCodeAt(++Z.position),G===60)z=!0,G=Z.input.charCodeAt(++Z.position);else if(G===33)q=!0,J="!!",G=Z.input.charCodeAt(++Z.position);else J="!";if(X=Z.position,z){do G=Z.input.charCodeAt(++Z.position);while(G!==0&&G!==62);if(Z.position<Z.length)W=Z.input.slice(X,Z.position),G=Z.input.charCodeAt(++Z.position);else L(Z,"unexpected end of the stream within a verbatim tag")}else{while(G!==0&&!p(G)){if(G===33)if(!q){if(J=Z.input.slice(X-1,Z.position+1),!S9.test(J))L(Z,"named tag handle cannot contain such characters");q=!0,X=Z.position+1}else L(Z,"tag suffix cannot contain exclamation marks");G=Z.input.charCodeAt(++Z.position)}if(W=Z.input.slice(X,Z.position),v4.test(W))L(Z,"tag suffix cannot contain flow indicator characters")}if(W&&!k9.test(W))L(Z,"tag name cannot contain such characters: "+W);try{W=decodeURIComponent(W)}catch(Y){L(Z,"tag name is malformed: "+W)}if(z)Z.tag=W;else if(M0.call(Z.tagMap,J))Z.tag=Z.tagMap[J]+W;else if(J==="!")Z.tag="!"+W;else if(J==="!!")Z.tag="tag:yaml.org,2002:"+W;else L(Z,'undeclared tag handle "'+J+'"');return!0}function r4(Z){var X,z;if(z=Z.input.charCodeAt(Z.position),z!==38)return!1;if(Z.anchor!==null)L(Z,"duplication of an anchor property");z=Z.input.charCodeAt(++Z.position),X=Z.position;while(z!==0&&!p(z)&&!k0(z))z=Z.input.charCodeAt(++Z.position);if(Z.position===X)L(Z,"name of an anchor node must contain at least one character");return Z.anchor=Z.input.slice(X,Z.position),!0}function s4(Z){var X,z,q;if(q=Z.input.charCodeAt(Z.position),q!==42)return!1;q=Z.input.charCodeAt(++Z.position),X=Z.position;while(q!==0&&!p(q)&&!k0(q))q=Z.input.charCodeAt(++Z.position);if(Z.position===X)L(Z,"name of an alias node must contain at least one character");if(z=Z.input.slice(X,Z.position),!M0.call(Z.anchorMap,z))L(Z,'unidentified alias "'+z+'"');return Z.result=Z.anchorMap[z],E(Z,!0,-1),!0}function g0(Z,X,z,q,J){var W,G,Y,Q=1,U=!1,K=!1,V,M,F,H,A,B;if(Z.listener!==null)Z.listener("open",Z);if(Z.tag=null,Z.anchor=null,Z.kind=null,Z.result=null,W=G=Y=F1===z||E9===z,q){if(E(Z,!0,-1)){if(U=!0,Z.lineIndent>X)Q=1;else if(Z.lineIndent===X)Q=0;else if(Z.lineIndent<X)Q=-1}}if(Q===1)while(o4(Z)||r4(Z))if(E(Z,!0,-1)){if(U=!0,Y=W,Z.lineIndent>X)Q=1;else if(Z.lineIndent===X)Q=0;else if(Z.lineIndent<X)Q=-1}else Y=!1;if(Y)Y=U||J;if(Q===1||F1===z){if(M1===z||x9===z)A=X;else A=X+1;if(B=Z.position-Z.lineStart,Q===1)if(Y&&(Z9(Z,B)||n4(Z,B,A))||l4(Z,A))K=!0;else{if(G&&i4(Z,A)||p4(Z,A)||d4(Z,A))K=!0;else if(s4(Z)){if(K=!0,Z.tag!==null||Z.anchor!==null)L(Z,"alias node should not have any properties")}else if(c4(Z,A,M1===z)){if(K=!0,Z.tag===null)Z.tag="?"}if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}else if(Q===0)K=Y&&Z9(Z,B)}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")L(Z,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+Z.kind+'"');for(V=0,M=Z.implicitTypes.length;V<M;V+=1)if(H=Z.implicitTypes[V],H.resolve(Z.result)){if(Z.result=H.construct(Z.result),Z.tag=H.tag,Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result;break}}else if(Z.tag!=="!"){if(M0.call(Z.typeMap[Z.kind||"fallback"],Z.tag))H=Z.typeMap[Z.kind||"fallback"][Z.tag];else{H=null,F=Z.typeMap.multi[Z.kind||"fallback"];for(V=0,M=F.length;V<M;V+=1)if(Z.tag.slice(0,F[V].tag.length)===F[V].tag){H=F[V];break}}if(!H)L(Z,"unknown tag !<"+Z.tag+">");if(Z.result!==null&&H.kind!==Z.kind)L(Z,"unacceptable node kind for !<"+Z.tag+'> tag; it should be "'+H.kind+'", not "'+Z.kind+'"');if(!H.resolve(Z.result,Z.tag))L(Z,"cannot resolve a node with !<"+Z.tag+"> explicit tag");else if(Z.result=H.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||K}function a4(Z){var X=Z.position,z,q,J,W=!1,G;Z.version=null,Z.checkLineBreaks=Z.legacy,Z.tagMap=Object.create(null),Z.anchorMap=Object.create(null);while((G=Z.input.charCodeAt(Z.position))!==0){if(E(Z,!0,-1),G=Z.input.charCodeAt(Z.position),Z.lineIndent>0||G!==37)break;W=!0,G=Z.input.charCodeAt(++Z.position),z=Z.position;while(G!==0&&!p(G))G=Z.input.charCodeAt(++Z.position);if(q=Z.input.slice(z,Z.position),J=[],q.length<1)L(Z,"directive name must not be less than one character in length");while(G!==0){while(L0(G))G=Z.input.charCodeAt(++Z.position);if(G===35){do G=Z.input.charCodeAt(++Z.position);while(G!==0&&!q0(G));break}if(q0(G))break;z=Z.position;while(G!==0&&!p(G))G=Z.input.charCodeAt(++Z.position);J.push(Z.input.slice(z,Z.position))}if(G!==0)a1(Z);if(M0.call(t8,q))t8[q](Z,q,J);else H1(Z,'unknown document directive "'+q+'"')}if(E(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,E(Z,!0,-1);else if(W)L(Z,"directives end mark is expected");if(g0(Z,Z.lineIndent-1,F1,!1,!0),E(Z,!0,-1),Z.checkLineBreaks&&g4.test(Z.input.slice(X,Z.position)))H1(Z,"non-ASCII line breaks are interpreted as content");if(Z.documents.push(Z.result),Z.position===Z.lineStart&&$1(Z)){if(Z.input.charCodeAt(Z.position)===46)Z.position+=3,E(Z,!0,-1);return}if(Z.position<Z.length-1)L(Z,"end of the stream or a document separator is expected");else return}function m9(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+=`
|
|
34
|
+
`;if(Z.charCodeAt(0)===65279)Z=Z.slice(1)}var z=new f4(Z,X),q=Z.indexOf("\x00");if(q!==-1)z.position=q,L(z,"null byte is not allowed in input");z.input+="\x00";while(z.input.charCodeAt(z.position)===32)z.lineIndent+=1,z.position+=1;while(z.position<z.length-1)a4(z);return z.documents}function t4(Z,X,z){if(X!==null&&typeof X==="object"&&typeof z>"u")z=X,X=null;var q=m9(Z,z);if(typeof X!=="function")return q;for(var J=0,W=q.length;J<W;J+=1)X(q[J])}function e4(Z,X){var z=m9(Z,X);if(z.length===0)return;else if(z.length===1)return z[0];throw new h("expected a single document in the stream, but found more")}function O5(Z,X){var z,q,J,W,G,Y,Q;if(X===null)return{};z={},q=Object.keys(X);for(J=0,W=q.length;J<W;J+=1){if(G=q[J],Y=String(X[G]),G.slice(0,2)==="!!")G="tag:yaml.org,2002:"+G.slice(2);if(Q=Z.compiledTypeMap.fallback[G],Q&&f9.call(Q.styleAliases,Y))Y=Q.styleAliases[Y];z[G]=Y}return z}function w5(Z){var X,z,q;if(X=Z.toString(16).toUpperCase(),Z<=255)z="x",q=2;else if(Z<=65535)z="u",q=4;else if(Z<=4294967295)z="U",q=8;else throw new h("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+z+k.repeat("0",q-X.length)+X}function T5(Z){this.schema=Z.schema||s1,this.indent=Math.max(1,Z.indent||2),this.noArrayIndent=Z.noArrayIndent||!1,this.skipInvalid=Z.skipInvalid||!1,this.flowLevel=k.isNothing(Z.flowLevel)?-1:Z.flowLevel,this.styleMap=O5(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==='"'?n0:I5,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 X9(Z,X){var z=k.repeat(" ",X),q=0,J=-1,W="",G,Y=Z.length;while(q<Y){if(J=Z.indexOf(`
|
|
35
35
|
`,q),J===-1)G=Z.slice(q),q=Y;else G=Z.slice(q,J+1),q=J+1;if(G.length&&G!==`
|
|
36
|
-
`)
|
|
37
|
-
`+k.repeat(" ",Z.indent*X)}function
|
|
36
|
+
`)W+=z;W+=G}return W}function i1(Z,X){return`
|
|
37
|
+
`+k.repeat(" ",Z.indent*X)}function R5(Z,X){var z,q,J;for(z=0,q=Z.implicitTypes.length;z<q;z+=1)if(J=Z.implicitTypes[z],J.resolve(X))return!0;return!1}function D1(Z){return Z===J5||Z===z5}function o0(Z){return 32<=Z&&Z<=126||161<=Z&&Z<=55295&&Z!==8232&&Z!==8233||57344<=Z&&Z<=65533&&Z!==e1||65536<=Z&&Z<=1114111}function z9(Z){return o0(Z)&&Z!==e1&&Z!==q5&&Z!==i0}function q9(Z,X,z){var q=z9(Z),J=q&&!D1(Z);return(z?q:q&&Z!==c9&&Z!==p9&&Z!==d9&&Z!==l9&&Z!==i9)&&Z!==l1&&!(X===B1&&!J)||z9(X)&&!D1(X)&&Z===l1||X===B1&&J}function C5(Z){return o0(Z)&&Z!==e1&&!D1(Z)&&Z!==V5&&Z!==H5&&Z!==B1&&Z!==c9&&Z!==p9&&Z!==d9&&Z!==l9&&Z!==i9&&Z!==l1&&Z!==Y5&&Z!==K5&&Z!==G5&&Z!==$5&&Z!==M5&&Z!==F5&&Z!==U5&&Z!==W5&&Z!==Q5&&Z!==B5&&Z!==D5}function j5(Z){return!D1(Z)&&Z!==B1}function d0(Z,X){var z=Z.charCodeAt(X),q;if(z>=55296&&z<=56319&&X+1<Z.length){if(q=Z.charCodeAt(X+1),q>=56320&&q<=57343)return(z-55296)*1024+q-56320+65536}return z}function n9(Z){var X=/^\n* /;return X.test(Z)}function N5(Z,X,z,q,J,W,G,Y){var Q,U=0,K=null,V=!1,M=!1,F=q!==-1,H=-1,A=C5(d0(Z,0))&&j5(d0(Z,Z.length-1));if(X||G)for(Q=0;Q<Z.length;U>=65536?Q+=2:Q++){if(U=d0(Z,Q),!o0(U))return S0;A=A&&q9(U,K,Y),K=U}else{for(Q=0;Q<Z.length;U>=65536?Q+=2:Q++){if(U=d0(Z,Q),U===i0){if(V=!0,F)M=M||Q-H-1>q&&Z[H+1]!==" ",H=Q}else if(!o0(U))return S0;A=A&&q9(U,K,Y),K=U}M=M||F&&(Q-H-1>q&&Z[H+1]!==" ")}if(!V&&!M){if(A&&!G&&!J(Z))return o9;return W===n0?S0:n1}if(z>9&&n9(Z))return S0;if(!G)return M?s9:r9;return W===n0?S0:n1}function P5(Z,X,z,q,J){Z.dump=function(){if(X.length===0)return Z.quotingType===n0?'""':"''";if(!Z.noCompatMode){if(A5.indexOf(X)!==-1||L5.test(X))return Z.quotingType===n0?'"'+X+'"':"'"+X+"'"}var W=Z.indent*Math.max(1,z),G=Z.lineWidth===-1?-1:Math.max(Math.min(Z.lineWidth,40),Z.lineWidth-W),Y=q||Z.flowLevel>-1&&z>=Z.flowLevel;function Q(U){return R5(Z,U)}switch(N5(X,Y,Z.indent,G,Q,Z.quotingType,Z.forceQuotes&&!q,J)){case o9:return X;case n1:return"'"+X.replace(/'/g,"''")+"'";case r9:return"|"+J9(X,Z.indent)+G9(X9(X,W));case s9:return">"+J9(X,Z.indent)+G9(X9(_5(X,G),W));case S0:return'"'+x5(X)+'"';default:throw new h("impossible error: invalid scalar style")}}()}function J9(Z,X){var z=n9(Z)?String(X):"",q=Z[Z.length-1]===`
|
|
38
38
|
`,J=q&&(Z[Z.length-2]===`
|
|
39
39
|
`||Z===`
|
|
40
|
-
`),
|
|
41
|
-
`}function
|
|
42
|
-
`?Z.slice(0,-1):Z}function
|
|
40
|
+
`),W=J?"+":q?"":"-";return z+W+`
|
|
41
|
+
`}function G9(Z){return Z[Z.length-1]===`
|
|
42
|
+
`?Z.slice(0,-1):Z}function _5(Z,X){var z=/(\n+)([^\n]*)/g,q=function(){var U=Z.indexOf(`
|
|
43
43
|
`);return U=U!==-1?U:Z.length,z.lastIndex=U,W9(Z.slice(0,U),X)}(),J=Z[0]===`
|
|
44
|
-
`||Z[0]===" ",
|
|
45
|
-
`:"")+W9(
|
|
46
|
-
`+Z.slice(J,
|
|
47
|
-
`,Z.length-J>X&&G>J)
|
|
48
|
-
`+Z.slice(G+1);else
|
|
49
|
-
`;return""}function Z8(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
|
|
50
|
-
\r`,N9,N4,
|
|
44
|
+
`||Z[0]===" ",W,G;while(G=z.exec(Z)){var Y=G[1],Q=G[2];W=Q[0]===" ",q+=Y+(!J&&!W&&Q!==""?`
|
|
45
|
+
`:"")+W9(Q,X),J=W}return q}function W9(Z,X){if(Z===""||Z[0]===" ")return Z;var z=/ [^ ]/g,q,J=0,W,G=0,Y=0,Q="";while(q=z.exec(Z)){if(Y=q.index,Y-J>X)W=G>J?G:Y,Q+=`
|
|
46
|
+
`+Z.slice(J,W),J=W+1;G=Y}if(Q+=`
|
|
47
|
+
`,Z.length-J>X&&G>J)Q+=Z.slice(J,G)+`
|
|
48
|
+
`+Z.slice(G+1);else Q+=Z.slice(J);return Q.slice(1)}function x5(Z){var X="",z=0,q;for(var J=0;J<Z.length;z>=65536?J+=2:J++)if(z=d0(Z,J),q=v[z],!q&&o0(z)){if(X+=Z[J],z>=65536)X+=Z[J+1]}else X+=q||w5(z);return X}function E5(Z,X,z){var q="",J=Z.tag,W,G,Y;for(W=0,G=z.length;W<G;W+=1){if(Y=z[W],Z.replacer)Y=Z.replacer.call(z,String(W),Y);if(Y0(Z,X,Y,!1,!1)||typeof Y>"u"&&Y0(Z,X,null,!1,!1)){if(q!=="")q+=","+(!Z.condenseFlow?" ":"");q+=Z.dump}}Z.tag=J,Z.dump="["+q+"]"}function Q9(Z,X,z,q){var J="",W=Z.tag,G,Y,Q;for(G=0,Y=z.length;G<Y;G+=1){if(Q=z[G],Z.replacer)Q=Z.replacer.call(z,String(G),Q);if(Y0(Z,X+1,Q,!0,!0,!1,!0)||typeof Q>"u"&&Y0(Z,X+1,null,!0,!0,!1,!0)){if(!q||J!=="")J+=i1(Z,X);if(Z.dump&&i0===Z.dump.charCodeAt(0))J+="-";else J+="- ";J+=Z.dump}}Z.tag=W,Z.dump=J||"[]"}function S5(Z,X,z){var q="",J=Z.tag,W=Object.keys(z),G,Y,Q,U,K;for(G=0,Y=W.length;G<Y;G+=1){if(K="",q!=="")K+=", ";if(Z.condenseFlow)K+='"';if(Q=W[G],U=z[Q],Z.replacer)U=Z.replacer.call(z,Q,U);if(!Y0(Z,X,Q,!1,!1))continue;if(Z.dump.length>1024)K+="? ";if(K+=Z.dump+(Z.condenseFlow?'"':"")+":"+(Z.condenseFlow?"":" "),!Y0(Z,X,U,!1,!1))continue;K+=Z.dump,q+=K}Z.tag=J,Z.dump="{"+q+"}"}function k5(Z,X,z,q){var J="",W=Z.tag,G=Object.keys(z),Y,Q,U,K,V,M;if(Z.sortKeys===!0)G.sort();else if(typeof Z.sortKeys==="function")G.sort(Z.sortKeys);else if(Z.sortKeys)throw new h("sortKeys must be a boolean or a function");for(Y=0,Q=G.length;Y<Q;Y+=1){if(M="",!q||J!=="")M+=i1(Z,X);if(U=G[Y],K=z[U],Z.replacer)K=Z.replacer.call(z,U,K);if(!Y0(Z,X+1,U,!0,!0,!0))continue;if(V=Z.tag!==null&&Z.tag!=="?"||Z.dump&&Z.dump.length>1024,V)if(Z.dump&&i0===Z.dump.charCodeAt(0))M+="?";else M+="? ";if(M+=Z.dump,V)M+=i1(Z,X);if(!Y0(Z,X+1,K,!0,V))continue;if(Z.dump&&i0===Z.dump.charCodeAt(0))M+=":";else M+=": ";M+=Z.dump,J+=M}Z.tag=W,Z.dump=J||"{}"}function Y9(Z,X,z){var q,J,W,G,Y,Q;J=z?Z.explicitTypes:Z.implicitTypes;for(W=0,G=J.length;W<G;W+=1)if(Y=J[W],(Y.instanceOf||Y.predicate)&&(!Y.instanceOf||typeof X==="object"&&X instanceof Y.instanceOf)&&(!Y.predicate||Y.predicate(X))){if(z)if(Y.multi&&Y.representName)Z.tag=Y.representName(X);else Z.tag=Y.tag;else Z.tag="?";if(Y.represent){if(Q=Z.styleMap[Y.tag]||Y.defaultStyle,u9.call(Y.represent)==="[object Function]")q=Y.represent(X,Q);else if(f9.call(Y.represent,Q))q=Y.represent[Q](X,Q);else throw new h("!<"+Y.tag+'> tag resolver accepts not "'+Q+'" style');Z.dump=q}return!0}return!1}function Y0(Z,X,z,q,J,W,G){if(Z.tag=null,Z.dump=z,!Y9(Z,z,!1))Y9(Z,z,!0);var Y=u9.call(Z.dump),Q=q,U;if(q)q=Z.flowLevel<0||Z.flowLevel>X;var K=Y==="[object Object]"||Y==="[object Array]",V,M;if(K)V=Z.duplicates.indexOf(z),M=V!==-1;if(Z.tag!==null&&Z.tag!=="?"||M||Z.indent!==2&&X>0)J=!1;if(M&&Z.usedDuplicates[V])Z.dump="*ref_"+V;else{if(K&&M&&!Z.usedDuplicates[V])Z.usedDuplicates[V]=!0;if(Y==="[object Object]"){if(q&&Object.keys(Z.dump).length!==0){if(k5(Z,X,Z.dump,J),M)Z.dump="&ref_"+V+Z.dump}else if(S5(Z,X,Z.dump),M)Z.dump="&ref_"+V+" "+Z.dump}else if(Y==="[object Array]"){if(q&&Z.dump.length!==0){if(Z.noArrayIndent&&!G&&X>0)Q9(Z,X-1,Z.dump,J);else Q9(Z,X,Z.dump,J);if(M)Z.dump="&ref_"+V+Z.dump}else if(E5(Z,X,Z.dump),M)Z.dump="&ref_"+V+" "+Z.dump}else if(Y==="[object String]"){if(Z.tag!=="?")P5(Z,Z.dump,X,W,Q)}else if(Y==="[object Undefined]")return!1;else{if(Z.skipInvalid)return!1;throw new h("unacceptable kind of an object to dump "+Y)}if(Z.tag!==null&&Z.tag!=="?"){if(U=encodeURI(Z.tag[0]==="!"?Z.tag.slice(1):Z.tag).replace(/!/g,"%21"),Z.tag[0]==="!")U="!"+U;else if(U.slice(0,18)==="tag:yaml.org,2002:")U="!!"+U.slice(18);else U="!<"+U+">";Z.dump=U+" "+Z.dump}}return!0}function b5(Z,X){var z=[],q=[],J,W;o1(Z,z,q);for(J=0,W=q.length;J<W;J+=1)X.duplicates.push(z[q[J]]);X.usedDuplicates=Array(W)}function o1(Z,X,z){var q,J,W;if(Z!==null&&typeof Z==="object")if(J=X.indexOf(Z),J!==-1){if(z.indexOf(J)===-1)z.push(J)}else if(X.push(Z),Array.isArray(Z))for(J=0,W=Z.length;J<W;J+=1)o1(Z[J],X,z);else{q=Object.keys(Z);for(J=0,W=q.length;J<W;J+=1)o1(Z[q[J]],X,z)}}function g5(Z,X){X=X||{};var z=new T5(X);if(!z.noRefs)b5(Z,z);var q=Z;if(z.replacer)q=z.replacer.call({"":q},"",q);if(Y0(z,0,q,!0,!0))return z.dump+`
|
|
49
|
+
`;return""}function Z8(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 m6,h6,u6,f6,c6,p6,k,h,l6,i6,n6,g,V9,M9,F9,H9,B9,D9,$9,A9,U4,M4,L9,O9,w9,I9,T9,R9,C9,r1=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
50
|
+
\r`,j9,T4,R4,N9,N4,P9,x4,_9,s1,M0,M1=1,x9=2,E9=3,F1=4,p1=1,k4=2,r8=3,b4,g4,v4,S9,k9,g9,v9,K0,t8,Z5,X5,h9,u9,f9,e1=65279,z5=9,i0=10,q5=13,J5=32,G5=33,W5=34,l1=35,Q5=37,Y5=38,U5=39,K5=42,c9=44,V5=45,B1=58,M5=61,F5=62,H5=63,B5=64,p9=91,d9=93,D5=96,l9=123,$5=124,i9=125,v,A5,L5,I5=1,n0=2,o9=1,n1=2,r9=3,s9=4,S0=5,v5,y5,m5,h5,u5,X8,f5,c5,p5,d5,l5,i5,n5,o5,r5,s5,z8;var q8=T(()=>{/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */m6=U9,h6=k6,u6=b6,f6=v6,c6=y6,p6=g6,k={isNothing:m6,isObject:h6,toArray:u6,repeat:f6,isNegativeZero:c6,extend:p6};l0.prototype=Object.create(Error.prototype);l0.prototype.constructor=l0;l0.prototype.toString=function(X){return this.name+": "+K9(this,X)};h=l0;l6=d6,i6=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],n6=["scalar","sequence","mapping"];g=r6;d1.prototype.extend=function(X){var z=[],q=[];if(X instanceof g)q.push(X);else if(Array.isArray(X))q=q.concat(X);else if(X&&(Array.isArray(X.implicit)||Array.isArray(X.explicit))){if(X.implicit)z=z.concat(X.implicit);if(X.explicit)q=q.concat(X.explicit)}else throw new h("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");z.forEach(function(W){if(!(W instanceof g))throw new h("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(W.loadKind&&W.loadKind!=="scalar")throw new h("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(W.multi)throw new h("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),q.forEach(function(W){if(!(W instanceof g))throw new h("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var J=Object.create(d1.prototype);return J.implicit=(this.implicit||[]).concat(z),J.explicit=(this.explicit||[]).concat(q),J.compiledImplicit=o8(J,"implicit"),J.compiledExplicit=o8(J,"explicit"),J.compiledTypeMap=s6(J.compiledImplicit,J.compiledExplicit),J};V9=d1,M9=new g("tag:yaml.org,2002:str",{kind:"scalar",construct:function(Z){return Z!==null?Z:""}}),F9=new g("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(Z){return Z!==null?Z:[]}}),H9=new g("tag:yaml.org,2002:map",{kind:"mapping",construct:function(Z){return Z!==null?Z:{}}}),B9=new V9({explicit:[M9,F9,H9]});D9=new g("tag:yaml.org,2002:null",{kind:"scalar",resolve:a6,construct:t6,predicate:e6,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});$9=new g("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Z4,construct:X4,predicate:z4,represent:{lowercase:function(Z){return Z?"true":"false"},uppercase:function(Z){return Z?"TRUE":"FALSE"},camelcase:function(Z){return Z?"True":"False"}},defaultStyle:"lowercase"});A9=new g("tag:yaml.org,2002:int",{kind:"scalar",resolve:W4,construct:Q4,predicate:Y4,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"]}}),U4=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");M4=/^[-+]?[0-9]+e/;L9=new g("tag:yaml.org,2002:float",{kind:"scalar",resolve:K4,construct:V4,predicate:H4,represent:F4,defaultStyle:"lowercase"}),O9=B9.extend({implicit:[D9,$9,A9,L9]}),w9=O9,I9=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),T9=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]))?))?$");R9=new g("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:B4,construct:D4,instanceOf:Date,represent:$4});C9=new g("tag:yaml.org,2002:merge",{kind:"scalar",resolve:A4});j9=new g("tag:yaml.org,2002:binary",{kind:"scalar",resolve:L4,construct:O4,predicate:I4,represent:w4}),T4=Object.prototype.hasOwnProperty,R4=Object.prototype.toString;N9=new g("tag:yaml.org,2002:omap",{kind:"sequence",resolve:C4,construct:j4}),N4=Object.prototype.toString;P9=new g("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:P4,construct:_4}),x4=Object.prototype.hasOwnProperty;_9=new g("tag:yaml.org,2002:set",{kind:"mapping",resolve:E4,construct:S4}),s1=w9.extend({implicit:[R9,C9],explicit:[j9,N9,P9,_9]}),M0=Object.prototype.hasOwnProperty,b4=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,g4=/[\x85\u2028\u2029]/,v4=/[,\[\]\{\}]/,S9=/^(?:!|!!|![a-z\-]+!)$/i,k9=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;g9=Array(256),v9=Array(256);for(K0=0;K0<256;K0++)g9[K0]=a8(K0)?1:0,v9[K0]=a8(K0);t8={YAML:function(X,z,q){var J,W,G;if(X.version!==null)L(X,"duplication of %YAML directive");if(q.length!==1)L(X,"YAML directive accepts exactly one argument");if(J=/^([0-9]+)\.([0-9]+)$/.exec(q[0]),J===null)L(X,"ill-formed argument of the YAML directive");if(W=parseInt(J[1],10),G=parseInt(J[2],10),W!==1)L(X,"unacceptable YAML version of the document");if(X.version=q[0],X.checkLineBreaks=G<2,G!==1&&G!==2)H1(X,"unsupported YAML version of the document")},TAG:function(X,z,q){var J,W;if(q.length!==2)L(X,"TAG directive accepts exactly two arguments");if(J=q[0],W=q[1],!S9.test(J))L(X,"ill-formed tag handle (first argument) of the TAG directive");if(M0.call(X.tagMap,J))L(X,'there is a previously declared suffix for "'+J+'" tag handle');if(!k9.test(W))L(X,"ill-formed tag prefix (second argument) of the TAG directive");try{W=decodeURIComponent(W)}catch(G){L(X,"tag prefix is malformed: "+W)}X.tagMap[J]=W}};Z5=t4,X5=e4,h9={loadAll:Z5,load:X5},u9=Object.prototype.toString,f9=Object.prototype.hasOwnProperty,v={};v[0]="\\0";v[7]="\\a";v[8]="\\b";v[9]="\\t";v[10]="\\n";v[11]="\\v";v[12]="\\f";v[13]="\\r";v[27]="\\e";v[34]="\\\"";v[92]="\\\\";v[133]="\\N";v[160]="\\_";v[8232]="\\L";v[8233]="\\P";A5=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],L5=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;v5=g5,y5={dump:v5};m5=g,h5=V9,u5=B9,X8=O9,f5=w9,c5=s1,p5=h9.load,d5=h9.loadAll,l5=y5.dump,i5=h,n5={binary:j9,float:L9,map:H9,null:D9,pairs:P9,set:_9,timestamp:R9,bool:$9,int:A9,merge:C9,omap:N9,seq:F9,str:M9},o5=Z8("safeLoad","load"),r5=Z8("safeLoadAll","loadAll"),s5=Z8("safeDump","dump"),z8={Type:m5,Schema:h5,FAILSAFE_SCHEMA:u5,JSON_SCHEMA:X8,CORE_SCHEMA:f5,DEFAULT_SCHEMA:c5,load:p5,loadAll:d5,dump:l5,YAMLException:i5,types:n5,safeLoad:o5,safeLoadAll:r5,safeDump:s5}});var a9;var t9=T(()=>{s();q8();q8();a9={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 z8.load(X,{schema:X8})}catch{try{return z8.load(X)}catch(z){throw new r(z?.message||"Parser Error",Z.url)}}else return X}}});var a5,e9;var ZZ=T(()=>{s();a5=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,e9={order:300,allowEmpty:!0,encoding:"utf8",canParse(Z){return(typeof Z.data==="string"||Buffer.isBuffer(Z.data))&&a5.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 r("data is not text",Z.url)}}});var t5,XZ;var zZ=T(()=>{t5=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,XZ={order:400,allowEmpty:!0,canParse(Z){return Buffer.isBuffer(Z.data)&&t5.test(Z.url)},parse(Z){if(Buffer.isBuffer(Z.data))return Z.data;else return Buffer.from(Z.data)}}});var J8;var G8=T(()=>{f();s();J8={order:100,canRead(Z){return z1(Z.url)},async read(Z){let X,z=await import("fs");try{X=P0(Z.url)}catch(q){let J=q;throw J.message=`Malformed URI: ${Z.url}: ${J.message}`,new e(J,Z.url)}if(X.endsWith("/")||X.endsWith("\\"))X=X.slice(0,-1);try{return await z.promises.readFile(X)}catch(q){let J=q;throw J.message=`Error opening file ${X}: ${J.message}`,new e(J,X)}}}});async function qZ(Z,X,z){Z=N0(Z);let q=z||[];q.push(Z.href);try{let J=await e5(Z,X);if(J.status>=400){let W=Error(`HTTP ERROR ${J.status}`);throw W.status=J.status,W}else if(J.status>=300)if(!Number.isNaN(X.redirects)&&q.length>X.redirects){let W=Error(`Error downloading ${q[0]}.
|
|
51
51
|
Too many redirects:
|
|
52
52
|
${q.join(`
|
|
53
|
-
`)}`);throw Q.status=J.status,new e(Q)}else if(!("location"in J.headers)||!J.headers.location){let Q=Error(`HTTP ${J.status} redirect with no location header`);throw Q.status=J.status,Q}else{let Q=S(Z.href,J.headers.location);return JZ(Q,X,q)}else{if(J.body){let Q=await J.arrayBuffer();return Buffer.from(Q)}return Buffer.alloc(0)}}catch(J){let Q=J;throw Q.message=`Error downloading ${Z.href}: ${Q.message}`,new e(Q,Z.href)}}async function q3(Z,X){let z,q;if(X.timeout&&typeof AbortController<"u")z=new AbortController,q=setTimeout(()=>z.abort(),X.timeout);let J=await fetch(Z,{method:"GET",headers:X.headers||{},credentials:X.withCredentials?"include":"same-origin",signal:z?z.signal:null});if(q)clearTimeout(q);return J}var Q8;var W8=T(()=>{f();s();Q8={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return y8(Z.url)&&(!this.safeUrlResolver||!k1(Z.url))},read(Z){let X=N0(Z.url);if(typeof window<"u"&&!X.protocol)X.protocol=N0(location.href).protocol;return JZ(X,this)}}});function YZ(Z,X){if(GZ(X)){let z=Object.keys(X).filter((q)=>!["__proto__","constructor","prototype"].includes(q));for(let q=0;q<z.length;q++){let J=z[q],Q=X[J],G=Z[J];if(GZ(Q))Z[J]=YZ(G||{},Q);else if(Q!==void 0)Z[J]=Q}}return Z}function GZ(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var QZ=()=>{return{parse:{json:{...n8},yaml:{...t9},text:{...ZZ},binary:{...zZ}},resolve:{file:{...J8},http:{...Q8},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},WZ=(Z)=>{let X=QZ();if(Z)YZ(X,Z);return X};var Y8=T(()=>{o8();e9();XZ();qZ();G8();W8()});function J3(Z){let X,z,q,J,Q=Array.prototype.slice.call(Z);if(typeof Q[Q.length-1]==="function")J=Q.pop();if(typeof Q[0]==="string")if(X=Q[0],typeof Q[2]==="object")z=Q[1],q=Q[2];else z=void 0,q=Q[1];else X="",z=Q[0],q=Q[1];try{q=WZ(q)}catch(G){console.error(`JSON Schema Ref Parser: Error normalizing options: ${G}`)}if(!q.mutateInputSchema&&typeof z==="object")z=JSON.parse(JSON.stringify(z));return{path:X,schema:z,options:q,callback:J}}var r0;var UZ=T(()=>{Y8();r0=J3});function G3(Z,X){if(!X.resolve?.external)return Promise.resolve();try{let z=Z.$refs._root$Ref.dynamicIdScope?m(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,q=U8(Z.schema,Z.$refs._root$Ref.path+"#",z,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,X);return Promise.all(q)}catch(z){return Promise.reject(z)}}function U8(Z,X,z,q,J,Q,G,Y){G||=new Set;let W=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!G.has(Z)){G.add(Z);let U=z;if(_.isExternal$Ref(Z))W.push(Q3(Z,X,U,q,J,Q));let K=Object.keys(Z);for(let V of K){let M=c.join(X,V),F=Z[V],H=q&&F&&typeof F==="object"&&!ArrayBuffer.isView(F)?m(U,F):U;W=W.concat(U8(F,M,H,q,J,Q,G,Y))}}return W}async function Q3(Z,X,z,q,J,Q){let Y=Q.dereference?.externalReferenceResolution==="root"?D0():q?z:X,W=S(Y,Z.$ref),U=x(W),K=J._get$Ref(U);if(K)return Promise.resolve(K.value);try{let V=Z.$ref,M={url:W,baseUrl:Y};if(typeof V==="string")M.reference=V;let F=await V1(M,J,Q),H=J._get$Ref(U),A=U8(F,U+"#",U,H?.dynamicIdScope??!1,J,Q,new Set,!0);return Promise.all(A)}catch(V){if(!Q?.continueOnError||!z0(V))throw V;if(J._$refs[U])V.source=decodeURI(x(X)),V.path=q1(Z0(X));return[]}}var KZ;var VZ=T(()=>{E0();f0();u1();f();s();$0();KZ=G3});function W3(Z,X){let z=Z.$refs._root$Ref.dynamicIdScope?m(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,q=[];K8(Z,"schema",Z.$refs._root$Ref.path+"#",z,Z.$refs._root$Ref.dynamicIdScope,"#",0,q,Z.$refs,X);let J=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(Y3(q,X,J),(X.bundle||{}).optimizeInternalRefs!==!1)V3(q,Z.schema)}function K8(Z,X,z,q,J,Q,G,Y,W,U){let K=X===null?Z:Z[X],V=U.bundle||{},M=V.excludedPathMatcher||(()=>!1);if(K&&typeof K==="object"&&!ArrayBuffer.isView(K)&&!M(Q)){let F=q;if(_.isAllowed$Ref(K))MZ(Z,X,z,F,J,Q,G,Y,W,U);else{let H=Object.keys(K).sort((A,B)=>{if(A==="definitions"||A==="$defs")return-1;else if(B==="definitions"||B==="$defs")return 1;else return A.length-B.length});for(let A of H){let B=c.join(z,A),$=c.join(Q,A),D=K[A],O=J&&D&&typeof D==="object"&&!ArrayBuffer.isView(D)?m(F,D):F;if(_.isAllowed$Ref(D))MZ(K,A,B,O,J,$,G,Y,W,U);else K8(K,A,B,O,J,$,G,Y,W,U);if(D&&typeof D==="object"&&!Array.isArray(D)){if("$ref"in D)V?.onBundle?.(D.$ref,K[A],K,A)}}}}}function MZ(Z,X,z,q,J,Q,G,Y,W,U){let K=X===null?Z:Z[X],V=S(J?q:z,K.$ref),M=W._resolve(V,Q,U);if(M===null)return;let H=c.parse(Q).length,A=x(M.path),B=Z0(M.path),$=A!==W._root$Ref.path&&!W._aliases[A],D=_.isExtended$Ref(K);G+=M.indirections;let O=U3(Y,Z,X);if(O)if(H<O.depth||G<O.indirections)K3(Y,O);else return;if(Y.push({$ref:K,parent:Z,key:X,pathFromRoot:Q,depth:H,file:A,hash:B,value:M.value,circular:M.circular,extended:D,external:$,indirections:G}),!O||$)K8(M.value,null,M.path,M.$ref.path,M.$ref.dynamicIdScope,Q,G+1,Y,W,U)}function Y3(Z,X,z){Z.sort((G,Y)=>{if(G.file!==Y.file)return G.file<Y.file?-1:1;else if(G.hash!==Y.hash)return G.hash<Y.hash?-1:1;else if(G.circular!==Y.circular)return G.circular?-1:1;else if(G.extended!==Y.extended)return G.extended?1:-1;else if(G.indirections!==Y.indirections)return G.indirections-Y.indirections;else if(G.depth!==Y.depth)return G.depth-Y.depth;else{let W=Math.max(G.pathFromRoot.lastIndexOf("/definitions"),G.pathFromRoot.lastIndexOf("/$defs")),U=Math.max(Y.pathFromRoot.lastIndexOf("/definitions"),Y.pathFromRoot.lastIndexOf("/$defs"));if(W!==U)return U-W;else return G.pathFromRoot.length-Y.pathFromRoot.length}});let q,J,Q;for(let G of Z){let Y=X.bundle||{};if(!G.external){if(Y.optimizeInternalRefs!==!1)G.$ref.$ref=G.hash}else if(G.file===q&&G.hash===J)if(z&&FZ(Z,G))G.$ref.$ref=z+Q;else G.$ref.$ref=Q;else if(G.file===q&&G.hash.indexOf(J+"/")===0){let W=c.join(Q,c.parse(G.hash.replace(J,"#")));if(z&&FZ(Z,G))G.$ref.$ref=z+W;else G.$ref.$ref=W}else if(q=G.file,J=G.hash,Q=G.pathFromRoot,G.$ref=G.parent[G.key]=_.dereference(G.$ref,G.value,X),G.circular)G.$ref.$ref=G.pathFromRoot}}function U3(Z,X,z){for(let q of Z)if(q&&q.parent===X&&q.key===z)return q;return}function K3(Z,X){let z=Z.indexOf(X);Z.splice(z,1)}function V3(Z,X){for(let z of Z){if(!z.$ref||typeof z.$ref!=="object"||!("$ref"in z.$ref))continue;let q=z.$ref.$ref;if(typeof q!=="string"||!q.startsWith("#/"))continue;let J=M3(X,q);if(J!==q)z.$ref.$ref=J}}function M3(Z,X){if(!X.startsWith("#/"))return X;let z=X.slice(2).split("/"),q=Z,J=[];for(let G of z){if(q===null||q===void 0||typeof q!=="object")return X;if("$ref"in q&&typeof q.$ref==="string"&&q.$ref.startsWith("#/")){let U=q.$ref.slice(2).split("/");if(J.length=0,J.push(...U),q=F3(Z,q.$ref),q===null||q===void 0||typeof q!=="object")return X}let Y=G.replace(/~1/g,"/").replace(/~0/g,"~"),W=Array.isArray(q)?parseInt(Y):Y;q=q[W],J.push(G)}return"#/"+J.join("/")}function F3(Z,X){if(!X.startsWith("#/"))return;let z=X.slice(2).split("/"),q=Z;for(let J of z){if(q===null||q===void 0||typeof q!=="object")return;let Q=J.replace(/~1/g,"/").replace(/~0/g,"~"),G=Array.isArray(q)?parseInt(Q):Q;q=q[G]}return q}function FZ(Z,X){for(let z of Z){if(z.pathFromRoot==="#"||z.pathFromRoot==="#/")continue;if(X.pathFromRoot.startsWith(z.pathFromRoot+"/")){if(z.value&&typeof z.value==="object"&&"$id"in z.value)return!0}}return!1}var HZ;var BZ=T(()=>{E0();f0();f();$0();HZ=W3});function H3(Z,X){let z=Date.now(),q=Z.$refs._root$Ref.dynamicIdScope?m(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,J=V8(Z.schema,Z.$refs._root$Ref.path,q,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,X,z,0);Z.$refs.circular=J.circular,Z.schema=J.value}function V8(Z,X,z,q,J,Q,G,Y,W,U,K,V){let M,F={value:Z,circular:!1};$Z(K,U);let H=U.dereference||{},A=H.maxDepth??500;if(V>A)throw RangeError(`Maximum dereference depth (${A}) exceeded at ${J}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let B=H.excludedPathMatcher||(()=>!1);if(H?.circular==="ignore"||!G.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!B(J)){Q.add(Z),G.add(Z);let $=z;if(_.isAllowed$Ref(Z,U))M=DZ(Z,X,$,q,J,Q,G,Y,W,U,K,V),F.circular=M.circular,F.value=M.value;else for(let D of Object.keys(Z)){$Z(K,U);let O=c.join(X,D),R=c.join(J,D);if(B(R))continue;let j=Z[D],I=q&&j&&typeof j==="object"&&!ArrayBuffer.isView(j)?m($,j):$,N;if(_.isAllowed$Ref(j,U)){if(M=DZ(j,O,I,q,R,Q,G,Y,W,U,K,V),N=M.circular,Z[D]!==M.value){let w=new Map;if(H?.preservedProperties){if(typeof Z[D]==="object"&&!Array.isArray(Z[D]))H?.preservedProperties.forEach((a)=>{if(a in Z[D])w.set(a,Z[D][a])})}let y=M.value;if(H?.cloneReferences&&!N&&y&&typeof y==="object")y=structuredClone(y);if(Z[D]=y,H?.preservedProperties){if(w.size&&typeof Z[D]==="object"&&!Array.isArray(Z[D]))w.forEach((a,w1)=>{Z[D][w1]=a})}H?.onDereference?.(j.$ref,Z[D],Z,D)}}else if(!Q.has(j)){if(M=V8(j,O,I,q,R,Q,G,Y,W,U,K,V+1),N=M.circular,Z[D]!==M.value)Z[D]=M.value}else N=A1(O,W,U);F.circular=F.circular||N}Q.delete(Z)}}return F}function DZ(Z,X,z,q,J,Q,G,Y,W,U,K,V){let H=_.isExternal$Ref(Z)&&U?.dereference?.externalReferenceResolution==="root"?D0():q?z:X,A=S(H,Z.$ref),B=Y.get(A);if(B){if(!B.circular){let I=Object.keys(Z);if(I.length>1){let N={};for(let w of I)if(w!=="$ref"&&!(w in B.value))N[w]=Z[w];return{circular:B.circular,value:Object.assign({},B.value,N)}}return B}if(typeof B.value==="object"&&"$ref"in B.value&&"$ref"in Z){if(B.value.$ref===Z.$ref)return A1(X,W,U),B}else return A1(X,W,U),B}let $=W._resolve(A,X,U);if($===null)return{circular:!1,value:null};let D=$.circular,O=D||Q.has($.value);if(O)A1(X,W,U);let R=_.dereference(Z,$.value,U);if(!O){let I=V8(R,$.path,$.$ref.path,$.$ref.dynamicIdScope,J,Q,G,Y,W,U,K,V+1);O=I.circular,R=I.value}if(O&&!D&&U.dereference?.circular==="ignore")R=Z;if(D)R.$ref=J;let j={circular:O,value:R};if(Object.keys(Z).length===1)Y.set(A,j);return j}function $Z(Z,X){if(X&&X.timeoutMs){if(Date.now()-Z>X.timeoutMs)throw new b1(X.timeoutMs)}}function A1(Z,X,z){if(X.circular=!0,z?.dereference?.onCircular?.(Z),!z.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var AZ;var LZ=T(()=>{E0();f0();f();$0();s();AZ=H3});function B3(){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 M8;var OZ=T(()=>{M8=B3()});function i(Z,X){if(Z){X.then(function(z){M8(function(){Z(null,z)})},function(z){M8(function(){Z(z)})});return}else return X}var wZ=T(()=>{OZ()});class J0{schema=null;$refs=new p0;async parse(){let Z=r0(arguments),X;if(!Z.path&&!Z.schema){let q=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return i(Z.callback,Promise.reject(q))}this.schema=null,this.$refs=new p0;let z="http";if(z1(Z.path))Z.path=m8(Z.path),z="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let q=N0(Z.schema.$id),J=q.port??(q.protocol==="https:"?443:80);Z.path=`${q.protocol}//${q.hostname}:${J}`}if(Z.path=S(D0(),Z.path),Z.schema&&typeof Z.schema==="object"){let q=this.$refs._add(Z.path);q.value=Z.schema,q.pathType=z,q.dynamicIdScope=W1(q.value),Y1(this.$refs,q.path,q.value,q.pathType,q.dynamicIdScope),X=Promise.resolve(Z.schema)}else X=V1(Z.path,this.$refs,Z.options);try{let q=await X;if(q!==null&&typeof q==="object"&&!Buffer.isBuffer(q))return this.schema=q,i(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,i(Z.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||q}" is not a valid JSON Schema`)}catch(q){if(!Z.options.continueOnError||!z0(q))return i(Z.callback,Promise.reject(q));if(this.$refs._$refs[x(Z.path)])this.$refs._$refs[x(Z.path)].addError(q);return i(Z.callback,Promise.resolve(null))}}static parse(){let Z=new J0;return Z.parse.apply(Z,arguments)}async resolve(){let Z=r0(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await KZ(this,Z.options),F8(this),i(Z.callback,Promise.resolve(this.$refs))}catch(X){return i(Z.callback,Promise.reject(X))}}static resolve(){let Z=new J0;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new J0;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=r0(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),HZ(this,Z.options),F8(this),i(Z.callback,Promise.resolve(this.schema))}catch(X){return i(Z.callback,Promise.reject(X))}}static dereference(){let Z=new J0;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=r0(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),AZ(this,Z.options),F8(this),i(Z.callback,Promise.resolve(this.schema))}catch(X){return i(Z.callback,Promise.reject(X))}}}function F8(Z){if(_0.getParserErrors(Z).length>0)throw new _0(Z)}var IZ,NX,PX,_X,xX;var TZ=T(()=>{l8();u1();UZ();VZ();BZ();LZ();f();G8();W8();s();wZ();$0();Y8();f();IZ=J0;NX=J0.parse,PX=J0.resolve,_X=J0.bundle,xX=J0.dereference});function H8(Z){let X=Z.binding??"IMAGES",q=[...Z.formats??[]].filter((J)=>(J in RZ)).sort((J,Q)=>Number(Q==="avif")-Number(J==="avif")).map((J)=>[RZ[J],Z.quality?.[J]??80]);return`const JX_IMG_WIDTHS = new Set(${JSON.stringify(Z.widths??[])})
|
|
54
|
-
|
|
55
|
-
const JX_IMG_BINDING = ${JSON.stringify(X)}
|
|
56
|
-
const JX_IMG_REMOTE_DOMAINS = new Set(${JSON.stringify(Z.remoteDomains??[])})
|
|
57
|
-
|
|
58
|
-
async function jxHandleImage(request, env, waitUntil) {
|
|
59
|
-
const url = new URL(request.url)
|
|
60
|
-
const src = url.searchParams.get('src') ?? ''
|
|
61
|
-
const w = Number(url.searchParams.get('w') ?? '')
|
|
62
|
-
|
|
63
|
-
// Same-origin asset paths, or https sources from allowlisted remote domains —
|
|
64
|
-
// never act as an open proxy.
|
|
65
|
-
let remoteSrc = null
|
|
66
|
-
if (src.startsWith('https://')) {
|
|
67
|
-
try {
|
|
68
|
-
const remote = new URL(src)
|
|
69
|
-
if (JX_IMG_REMOTE_DOMAINS.has(remote.hostname)) remoteSrc = remote
|
|
70
|
-
} catch {}
|
|
71
|
-
if (!remoteSrc) return new Response('Invalid src', { status: 400 })
|
|
72
|
-
} else if (!src.startsWith('/') || src.startsWith('//') || src.includes('..') ||
|
|
73
|
-
src.includes(':') || src.includes('\\\\') || src.includes('?') || src.includes('#')) {
|
|
74
|
-
return new Response('Invalid src', { status: 400 })
|
|
75
|
-
}
|
|
76
|
-
if (!JX_IMG_WIDTHS.has(w)) return new Response('Invalid width', { status: 400 })
|
|
77
|
-
|
|
78
|
-
const accept = request.headers.get('accept') ?? ''
|
|
79
|
-
let target = null
|
|
80
|
-
for (const [mime, quality] of JX_IMG_FORMATS) {
|
|
81
|
-
if (accept.includes(mime)) { target = { mime, quality }; break }
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const v = url.searchParams.get('v') ?? ''
|
|
85
|
-
const cacheKey = new Request(url.origin + '/_jx/image?src=' + encodeURIComponent(src) +
|
|
86
|
-
'&w=' + w + '&f=' + (target ? target.mime : 'orig') + '&v=' + encodeURIComponent(v))
|
|
87
|
-
const cache = caches.default
|
|
88
|
-
const hit = await cache.match(cacheKey)
|
|
89
|
-
if (hit) {
|
|
90
|
-
const out = new Response(hit.body, hit)
|
|
91
|
-
out.headers.set('Vary', 'Accept')
|
|
92
|
-
return out
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const fetchSource = () =>
|
|
96
|
-
remoteSrc
|
|
97
|
-
? fetch(remoteSrc.href, { redirect: 'follow' })
|
|
98
|
-
: env.ASSETS.fetch(new Request(new URL(src, url.origin)))
|
|
99
|
-
|
|
100
|
-
const asset = await fetchSource()
|
|
101
|
-
if (!asset.ok || !asset.body) return new Response('Not found', { status: 404 })
|
|
102
|
-
|
|
103
|
-
let response
|
|
104
|
-
if (target && env[JX_IMG_BINDING]) {
|
|
105
|
-
try {
|
|
106
|
-
const result = await env[JX_IMG_BINDING]
|
|
107
|
-
.input(asset.body)
|
|
108
|
-
.transform({ width: w, fit: 'scale-down' })
|
|
109
|
-
.output({ format: target.mime, quality: target.quality })
|
|
110
|
-
response = result.response()
|
|
111
|
-
} catch (e) {
|
|
112
|
-
// Transform failed — serve the original source untouched.
|
|
113
|
-
const retry = await fetchSource()
|
|
114
|
-
response = new Response(retry.body, retry)
|
|
115
|
-
}
|
|
116
|
-
} else {
|
|
117
|
-
response = new Response(asset.body, asset)
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
response = new Response(response.body, response)
|
|
121
|
-
response.headers.set('Cache-Control', 'public, max-age=31536000, immutable')
|
|
122
|
-
if (waitUntil) waitUntil(cache.put(cacheKey, response.clone()))
|
|
123
|
-
response.headers.set('Vary', 'Accept')
|
|
124
|
-
return response
|
|
125
|
-
}`}function CZ(){return`
|
|
126
|
-
app.get('/_jx/image', (c) => jxHandleImage(c.req.raw, c.env, (p) => c.executionCtx?.waitUntil?.(p)))`}function SX(Z){return`// Generated by @jxsuite/compiler — do not edit manually
|
|
127
|
-
${H8(Z)}
|
|
128
|
-
|
|
129
|
-
export async function onRequestGet(context) {
|
|
130
|
-
return jxHandleImage(context.request, context.env, (p) => context.waitUntil(p))
|
|
131
|
-
}
|
|
132
|
-
`}var RZ;var jZ=T(()=>{RZ={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png"}});async function NZ(Z,X={}){let{baseUrl:z="/_jx/server"}=X,q=await IZ.dereference(Z),J=S8(q);if(J.length===0)return null;let Q=J.map(({exportName:Y,src:W})=>`import { ${Y} } from '${W}'`).join(`
|
|
133
|
-
`),G=J.map(({exportName:Y})=>PZ(Y,z)).join(`
|
|
53
|
+
`)}`);throw W.status=J.status,new e(W)}else if(!("location"in J.headers)||!J.headers.location){let W=Error(`HTTP ${J.status} redirect with no location header`);throw W.status=J.status,W}else{let W=S(Z.href,J.headers.location);return qZ(W,X,q)}else{if(J.body){let W=await J.arrayBuffer();return Buffer.from(W)}return Buffer.alloc(0)}}catch(J){let W=J;throw W.message=`Error downloading ${Z.href}: ${W.message}`,new e(W,Z.href)}}async function e5(Z,X){let z,q;if(X.timeout&&typeof AbortController<"u")z=new AbortController,q=setTimeout(()=>z.abort(),X.timeout);let J=await fetch(Z,{method:"GET",headers:X.headers||{},credentials:X.withCredentials?"include":"same-origin",signal:z?z.signal:null});if(q)clearTimeout(q);return J}var W8;var Q8=T(()=>{f();s();W8={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return v8(Z.url)&&(!this.safeUrlResolver||!k1(Z.url))},read(Z){let X=N0(Z.url);if(typeof window<"u"&&!X.protocol)X.protocol=N0(location.href).protocol;return qZ(X,this)}}});function QZ(Z,X){if(JZ(X)){let z=Object.keys(X).filter((q)=>!["__proto__","constructor","prototype"].includes(q));for(let q=0;q<z.length;q++){let J=z[q],W=X[J],G=Z[J];if(JZ(W))Z[J]=QZ(G||{},W);else if(W!==void 0)Z[J]=W}}return Z}function JZ(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var GZ=()=>{return{parse:{json:{...i8},yaml:{...a9},text:{...e9},binary:{...XZ}},resolve:{file:{...J8},http:{...W8},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},WZ=(Z)=>{let X=GZ();if(Z)QZ(X,Z);return X};var Y8=T(()=>{n8();t9();ZZ();zZ();G8();Q8()});function Z3(Z){let X,z,q,J,W=Array.prototype.slice.call(Z);if(typeof W[W.length-1]==="function")J=W.pop();if(typeof W[0]==="string")if(X=W[0],typeof W[2]==="object")z=W[1],q=W[2];else z=void 0,q=W[1];else X="",z=W[0],q=W[1];try{q=WZ(q)}catch(G){console.error(`JSON Schema Ref Parser: Error normalizing options: ${G}`)}if(!q.mutateInputSchema&&typeof z==="object")z=JSON.parse(JSON.stringify(z));return{path:X,schema:z,options:q,callback:J}}var r0;var YZ=T(()=>{Y8();r0=Z3});function X3(Z,X){if(!X.resolve?.external)return Promise.resolve();try{let z=Z.$refs._root$Ref.dynamicIdScope?m(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,q=U8(Z.schema,Z.$refs._root$Ref.path+"#",z,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,X);return Promise.all(q)}catch(z){return Promise.reject(z)}}function U8(Z,X,z,q,J,W,G,Y){G||=new Set;let Q=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!G.has(Z)){G.add(Z);let U=z;if(_.isExternal$Ref(Z))Q.push(z3(Z,X,U,q,J,W));let K=Object.keys(Z);for(let V of K){let M=c.join(X,V),F=Z[V],H=q&&F&&typeof F==="object"&&!ArrayBuffer.isView(F)?m(U,F):U;Q=Q.concat(U8(F,M,H,q,J,W,G,Y))}}return Q}async function z3(Z,X,z,q,J,W){let Y=W.dereference?.externalReferenceResolution==="root"?D0():q?z:X,Q=S(Y,Z.$ref),U=x(Q),K=J._get$Ref(U);if(K)return Promise.resolve(K.value);try{let V=Z.$ref,M={url:Q,baseUrl:Y};if(typeof V==="string")M.reference=V;let F=await V1(M,J,W),H=J._get$Ref(U),A=U8(F,U+"#",U,H?.dynamicIdScope??!1,J,W,new Set,!0);return Promise.all(A)}catch(V){if(!W?.continueOnError||!z0(V))throw V;if(J._$refs[U])V.source=decodeURI(x(X)),V.path=q1(Z0(X));return[]}}var UZ;var KZ=T(()=>{E0();f0();u1();f();s();$0();UZ=X3});function q3(Z,X){let z=Z.$refs._root$Ref.dynamicIdScope?m(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,q=[];K8(Z,"schema",Z.$refs._root$Ref.path+"#",z,Z.$refs._root$Ref.dynamicIdScope,"#",0,q,Z.$refs,X);let J=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(J3(q,X,J),(X.bundle||{}).optimizeInternalRefs!==!1)Q3(q,Z.schema)}function K8(Z,X,z,q,J,W,G,Y,Q,U){let K=X===null?Z:Z[X],V=U.bundle||{},M=V.excludedPathMatcher||(()=>!1);if(K&&typeof K==="object"&&!ArrayBuffer.isView(K)&&!M(W)){let F=q;if(_.isAllowed$Ref(K))VZ(Z,X,z,F,J,W,G,Y,Q,U);else{let H=Object.keys(K).sort((A,B)=>{if(A==="definitions"||A==="$defs")return-1;else if(B==="definitions"||B==="$defs")return 1;else return A.length-B.length});for(let A of H){let B=c.join(z,A),$=c.join(W,A),D=K[A],O=J&&D&&typeof D==="object"&&!ArrayBuffer.isView(D)?m(F,D):F;if(_.isAllowed$Ref(D))VZ(K,A,B,O,J,$,G,Y,Q,U);else K8(K,A,B,O,J,$,G,Y,Q,U);if(D&&typeof D==="object"&&!Array.isArray(D)){if("$ref"in D)V?.onBundle?.(D.$ref,K[A],K,A)}}}}}function VZ(Z,X,z,q,J,W,G,Y,Q,U){let K=X===null?Z:Z[X],V=S(J?q:z,K.$ref),M=Q._resolve(V,W,U);if(M===null)return;let H=c.parse(W).length,A=x(M.path),B=Z0(M.path),$=A!==Q._root$Ref.path&&!Q._aliases[A],D=_.isExtended$Ref(K);G+=M.indirections;let O=G3(Y,Z,X);if(O)if(H<O.depth||G<O.indirections)W3(Y,O);else return;if(Y.push({$ref:K,parent:Z,key:X,pathFromRoot:W,depth:H,file:A,hash:B,value:M.value,circular:M.circular,extended:D,external:$,indirections:G}),!O||$)K8(M.value,null,M.path,M.$ref.path,M.$ref.dynamicIdScope,W,G+1,Y,Q,U)}function J3(Z,X,z){Z.sort((G,Y)=>{if(G.file!==Y.file)return G.file<Y.file?-1:1;else if(G.hash!==Y.hash)return G.hash<Y.hash?-1:1;else if(G.circular!==Y.circular)return G.circular?-1:1;else if(G.extended!==Y.extended)return G.extended?1:-1;else if(G.indirections!==Y.indirections)return G.indirections-Y.indirections;else if(G.depth!==Y.depth)return G.depth-Y.depth;else{let Q=Math.max(G.pathFromRoot.lastIndexOf("/definitions"),G.pathFromRoot.lastIndexOf("/$defs")),U=Math.max(Y.pathFromRoot.lastIndexOf("/definitions"),Y.pathFromRoot.lastIndexOf("/$defs"));if(Q!==U)return U-Q;else return G.pathFromRoot.length-Y.pathFromRoot.length}});let q,J,W;for(let G of Z){let Y=X.bundle||{};if(!G.external){if(Y.optimizeInternalRefs!==!1)G.$ref.$ref=G.hash}else if(G.file===q&&G.hash===J)if(z&&MZ(Z,G))G.$ref.$ref=z+W;else G.$ref.$ref=W;else if(G.file===q&&G.hash.indexOf(J+"/")===0){let Q=c.join(W,c.parse(G.hash.replace(J,"#")));if(z&&MZ(Z,G))G.$ref.$ref=z+Q;else G.$ref.$ref=Q}else if(q=G.file,J=G.hash,W=G.pathFromRoot,G.$ref=G.parent[G.key]=_.dereference(G.$ref,G.value,X),G.circular)G.$ref.$ref=G.pathFromRoot}}function G3(Z,X,z){for(let q of Z)if(q&&q.parent===X&&q.key===z)return q;return}function W3(Z,X){let z=Z.indexOf(X);Z.splice(z,1)}function Q3(Z,X){for(let z of Z){if(!z.$ref||typeof z.$ref!=="object"||!("$ref"in z.$ref))continue;let q=z.$ref.$ref;if(typeof q!=="string"||!q.startsWith("#/"))continue;let J=Y3(X,q);if(J!==q)z.$ref.$ref=J}}function Y3(Z,X){if(!X.startsWith("#/"))return X;let z=X.slice(2).split("/"),q=Z,J=[];for(let G of z){if(q===null||q===void 0||typeof q!=="object")return X;if("$ref"in q&&typeof q.$ref==="string"&&q.$ref.startsWith("#/")){let U=q.$ref.slice(2).split("/");if(J.length=0,J.push(...U),q=U3(Z,q.$ref),q===null||q===void 0||typeof q!=="object")return X}let Y=G.replace(/~1/g,"/").replace(/~0/g,"~"),Q=Array.isArray(q)?parseInt(Y):Y;q=q[Q],J.push(G)}return"#/"+J.join("/")}function U3(Z,X){if(!X.startsWith("#/"))return;let z=X.slice(2).split("/"),q=Z;for(let J of z){if(q===null||q===void 0||typeof q!=="object")return;let W=J.replace(/~1/g,"/").replace(/~0/g,"~"),G=Array.isArray(q)?parseInt(W):W;q=q[G]}return q}function MZ(Z,X){for(let z of Z){if(z.pathFromRoot==="#"||z.pathFromRoot==="#/")continue;if(X.pathFromRoot.startsWith(z.pathFromRoot+"/")){if(z.value&&typeof z.value==="object"&&"$id"in z.value)return!0}}return!1}var FZ;var HZ=T(()=>{E0();f0();f();$0();FZ=q3});function K3(Z,X){let z=Date.now(),q=Z.$refs._root$Ref.dynamicIdScope?m(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,J=V8(Z.schema,Z.$refs._root$Ref.path,q,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,X,z,0);Z.$refs.circular=J.circular,Z.schema=J.value}function V8(Z,X,z,q,J,W,G,Y,Q,U,K,V){let M,F={value:Z,circular:!1};DZ(K,U);let H=U.dereference||{},A=H.maxDepth??500;if(V>A)throw RangeError(`Maximum dereference depth (${A}) exceeded at ${J}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let B=H.excludedPathMatcher||(()=>!1);if(H?.circular==="ignore"||!G.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!B(J)){W.add(Z),G.add(Z);let $=z;if(_.isAllowed$Ref(Z,U))M=BZ(Z,X,$,q,J,W,G,Y,Q,U,K,V),F.circular=M.circular,F.value=M.value;else for(let D of Object.keys(Z)){DZ(K,U);let O=c.join(X,D),R=c.join(J,D);if(B(R))continue;let j=Z[D],I=q&&j&&typeof j==="object"&&!ArrayBuffer.isView(j)?m($,j):$,N;if(_.isAllowed$Ref(j,U)){if(M=BZ(j,O,I,q,R,W,G,Y,Q,U,K,V),N=M.circular,Z[D]!==M.value){let w=new Map;if(H?.preservedProperties){if(typeof Z[D]==="object"&&!Array.isArray(Z[D]))H?.preservedProperties.forEach((a)=>{if(a in Z[D])w.set(a,Z[D][a])})}let y=M.value;if(H?.cloneReferences&&!N&&y&&typeof y==="object")y=structuredClone(y);if(Z[D]=y,H?.preservedProperties){if(w.size&&typeof Z[D]==="object"&&!Array.isArray(Z[D]))w.forEach((a,w1)=>{Z[D][w1]=a})}H?.onDereference?.(j.$ref,Z[D],Z,D)}}else if(!W.has(j)){if(M=V8(j,O,I,q,R,W,G,Y,Q,U,K,V+1),N=M.circular,Z[D]!==M.value)Z[D]=M.value}else N=A1(O,Q,U);F.circular=F.circular||N}W.delete(Z)}}return F}function BZ(Z,X,z,q,J,W,G,Y,Q,U,K,V){let H=_.isExternal$Ref(Z)&&U?.dereference?.externalReferenceResolution==="root"?D0():q?z:X,A=S(H,Z.$ref),B=Y.get(A);if(B){if(!B.circular){let I=Object.keys(Z);if(I.length>1){let N={};for(let w of I)if(w!=="$ref"&&!(w in B.value))N[w]=Z[w];return{circular:B.circular,value:Object.assign({},B.value,N)}}return B}if(typeof B.value==="object"&&"$ref"in B.value&&"$ref"in Z){if(B.value.$ref===Z.$ref)return A1(X,Q,U),B}else return A1(X,Q,U),B}let $=Q._resolve(A,X,U);if($===null)return{circular:!1,value:null};let D=$.circular,O=D||W.has($.value);if(O)A1(X,Q,U);let R=_.dereference(Z,$.value,U);if(!O){let I=V8(R,$.path,$.$ref.path,$.$ref.dynamicIdScope,J,W,G,Y,Q,U,K,V+1);O=I.circular,R=I.value}if(O&&!D&&U.dereference?.circular==="ignore")R=Z;if(D)R.$ref=J;let j={circular:O,value:R};if(Object.keys(Z).length===1)Y.set(A,j);return j}function DZ(Z,X){if(X&&X.timeoutMs){if(Date.now()-Z>X.timeoutMs)throw new b1(X.timeoutMs)}}function A1(Z,X,z){if(X.circular=!0,z?.dereference?.onCircular?.(Z),!z.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var $Z;var AZ=T(()=>{E0();f0();f();$0();s();$Z=K3});function V3(){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 M8;var LZ=T(()=>{M8=V3()});function i(Z,X){if(Z){X.then(function(z){M8(function(){Z(null,z)})},function(z){M8(function(){Z(z)})});return}else return X}var OZ=T(()=>{LZ()});class J0{schema=null;$refs=new p0;async parse(){let Z=r0(arguments),X;if(!Z.path&&!Z.schema){let q=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return i(Z.callback,Promise.reject(q))}this.schema=null,this.$refs=new p0;let z="http";if(z1(Z.path))Z.path=y8(Z.path),z="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let q=N0(Z.schema.$id),J=q.port??(q.protocol==="https:"?443:80);Z.path=`${q.protocol}//${q.hostname}:${J}`}if(Z.path=S(D0(),Z.path),Z.schema&&typeof Z.schema==="object"){let q=this.$refs._add(Z.path);q.value=Z.schema,q.pathType=z,q.dynamicIdScope=Q1(q.value),Y1(this.$refs,q.path,q.value,q.pathType,q.dynamicIdScope),X=Promise.resolve(Z.schema)}else X=V1(Z.path,this.$refs,Z.options);try{let q=await X;if(q!==null&&typeof q==="object"&&!Buffer.isBuffer(q))return this.schema=q,i(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,i(Z.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||q}" is not a valid JSON Schema`)}catch(q){if(!Z.options.continueOnError||!z0(q))return i(Z.callback,Promise.reject(q));if(this.$refs._$refs[x(Z.path)])this.$refs._$refs[x(Z.path)].addError(q);return i(Z.callback,Promise.resolve(null))}}static parse(){let Z=new J0;return Z.parse.apply(Z,arguments)}async resolve(){let Z=r0(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await UZ(this,Z.options),F8(this),i(Z.callback,Promise.resolve(this.$refs))}catch(X){return i(Z.callback,Promise.reject(X))}}static resolve(){let Z=new J0;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new J0;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=r0(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),FZ(this,Z.options),F8(this),i(Z.callback,Promise.resolve(this.schema))}catch(X){return i(Z.callback,Promise.reject(X))}}static dereference(){let Z=new J0;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=r0(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),$Z(this,Z.options),F8(this),i(Z.callback,Promise.resolve(this.schema))}catch(X){return i(Z.callback,Promise.reject(X))}}}function F8(Z){if(_0.getParserErrors(Z).length>0)throw new _0(Z)}var wZ,IX,TX,RX,CX;var IZ=T(()=>{d8();u1();YZ();KZ();HZ();AZ();f();G8();Q8();s();OZ();$0();Y8();f();wZ=J0;IX=J0.parse,TX=J0.resolve,RX=J0.bundle,CX=J0.dereference});async function TZ(Z,X={}){let{baseUrl:z="/_jx/server"}=X,q=await wZ.dereference(Z),J=E8(q);if(J.length===0)return null;let W=J.map(({exportName:Y,src:Q})=>`import { ${Y} } from '${Q}'`).join(`
|
|
54
|
+
`),G=J.map(({exportName:Y})=>RZ(Y,z)).join(`
|
|
134
55
|
`);return`// Generated by @jxsuite/compiler — do not edit manually
|
|
135
56
|
// Deploy as a Cloudflare Worker, Node server, or Bun process.
|
|
136
57
|
// Requires: npm install hono
|
|
137
58
|
|
|
138
59
|
import { Hono } from 'hono'
|
|
139
|
-
${
|
|
60
|
+
${W}
|
|
140
61
|
|
|
141
62
|
const app = new Hono()
|
|
142
63
|
${G}
|
|
143
64
|
|
|
144
65
|
export default app
|
|
145
|
-
`}function
|
|
146
|
-
`),
|
|
147
|
-
`)
|
|
148
|
-
${H8(J)}
|
|
149
|
-
`:"",W=J?CZ():"";return`// Generated by @jxsuite/compiler — do not edit manually
|
|
66
|
+
`}function M3(Z,X={}){let{baseUrl:z="/_jx/server",adapter:q=null}=X;if(Z.length===0&&!q)return null;let J=Z.map(({exportName:Y,src:Q})=>`import { ${Y} } from '${Q}'`).join(`
|
|
67
|
+
`),W=Z.map(({exportName:Y})=>RZ(Y,z)).join(`
|
|
68
|
+
`);return`// Generated by @jxsuite/compiler — do not edit manually
|
|
150
69
|
import { Hono } from 'hono'
|
|
151
|
-
${
|
|
152
|
-
|
|
70
|
+
${J}
|
|
71
|
+
|
|
153
72
|
const app = new Hono()
|
|
154
|
-
${
|
|
155
|
-
${q==="cloudflare-workers"?`
|
|
73
|
+
${W}
|
|
74
|
+
${q==="cloudflare-workers"||q==="cloudflare-pages"?`
|
|
156
75
|
app.all('*', (c) => c.env.ASSETS.fetch(c.req.raw))
|
|
157
76
|
`:`
|
|
158
77
|
`}
|
|
159
78
|
export default app
|
|
160
|
-
`}function
|
|
79
|
+
`}function RZ(Z,X){return`
|
|
161
80
|
app.post('${X}/${Z}', async (c) => {
|
|
162
81
|
const args = await c.req.json().catch(() => ({}))
|
|
163
82
|
try {
|
|
@@ -165,19 +84,7 @@ app.post('${X}/${Z}', async (c) => {
|
|
|
165
84
|
} catch (e) {
|
|
166
85
|
return c.json({ ok: false, error: e?.message ?? 'Server error' }, 500)
|
|
167
86
|
}
|
|
168
|
-
})`}
|
|
169
|
-
import { ${J} } from '${U}'
|
|
170
|
-
|
|
171
|
-
export async function onRequestPost(context) {
|
|
172
|
-
const args = await context.request.json().catch(() => ({}))
|
|
173
|
-
try {
|
|
174
|
-
const result = await ${J}(args, context.env)
|
|
175
|
-
return Response.json(result)
|
|
176
|
-
} catch (e) {
|
|
177
|
-
return Response.json({ ok: false, error: e?.message ?? 'Server error' }, { status: 500 })
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
`;q.set(Y,K)}return q}var _Z=T(()=>{TZ();j0();jZ()});class SZ{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;capabilities;#Z;#X=null;constructor(Z,X,z,q){this.name=Z,this.classPath=X,this.classDef=z,this.#Z=q;let J=z.format;this.extensions=(J.extensions??[]).map((Q)=>Q.toLowerCase()),this.mediaType=J.mediaType??null,this.documentKinds=J.documentKinds??[],this.exportTarget=J.exportTarget===!0,this.remote=J.remote===!0,this.studio=z.$studio??null,this.capabilities=L3(z)}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 z=this.capabilities[Z];if(!z)throw Error(`Format class "${this.name}" does not declare a "${Z}" capability`);let q=await this.implementation(),J=this.classDef.title??this.name,Q=q[J]??q.default?.[J]??q.default,G=Q?.[z.identifier];if(typeof G!=="function")throw Error(`Format class "${this.name}": implementation export "${J}" has no static "${z.identifier}" method`);return await G.call(Q,...X)}}class kZ{#Z;constructor(Z){this.#Z=Z;for(let X of EZ){let z=new Map;for(let q of Z){if(!q.capabilities[X])continue;for(let J of q.extensions){let Q=z.get(J);if(Q)throw Error(`Format conflict: "${Q.name}" and "${q.name}" both claim "${J}" with the "${X}" capability`);z.set(J,q)}}}}get entries(){return this.#Z}byExtension(Z,X){let z=xZ(Z);return this.#Z.find((q)=>q.extensions.includes(z)&&(!X||q.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 z of this.#Z){if(Z&&!z.documentKinds.includes(Z))continue;for(let q of z.extensions)X.add(q)}return X.delete(".json"),[...X]}has(Z){let X=xZ(Z);return this.#Z.some((z)=>z.extensions.includes(X))}}async function bZ(Z,X,z){let q=[];for(let[J,Q]of Object.entries(Z??{})){if(typeof Q!=="string"||!Q.endsWith(".class.json"))continue;let G=z?X.resolvePath(z,Q):Q,Y;try{Y=await X.loadJson(G)}catch{continue}if(!Y||typeof Y!=="object")continue;if(!Y.format||!Array.isArray(Y.format.extensions))continue;q.push(new SZ(J,G,Y,X))}return new kZ(q)}function L3(Z){let X={},z=Z.$defs?.methods??{};for(let[q,J]of Object.entries(z)){let Q=J.role;if(!Q||!EZ.includes(Q))continue;X[Q]={identifier:J.identifier??q,timing:J.timing??A3}}return X}function xZ(Z){let X=Z.toLowerCase();return X.startsWith(".")?X:`.${X}`}var EZ,A3;var gZ=T(()=>{EZ=["parse","serialize","discover","load"],A3=["compiler","server"]});var D8={};I8(D8,{unknownFormatError:()=>j3,importImplementation:()=>vZ,createNodeFormatIO:()=>yZ,buildProjectFormatRegistry:()=>C3});import{readFileSync as O3}from"node:fs";import{dirname as w3,resolve as B8,isAbsolute as I3,sep as L1}from"node:path";import{pathToFileURL as T3}from"node:url";import{createRequire as R3}from"node:module";async function vZ(Z){let X=[Z],z=`${L1}src${L1}`,q=`${L1}dist${L1}`;if(Z.includes(z))X.push(Z.replace(z,q));if(Z.endsWith(".js"))X.push(Z.slice(0,-3)+".ts");let J;for(let Q of X)try{return await import(T3(Q).href)}catch(G){J=G}throw J}function yZ(Z){return{loadJson:async(X)=>JSON.parse(O3(X,"utf-8")),importModule:(X)=>vZ(X),resolvePath:(X,z)=>{if(z.startsWith("./")||z.startsWith("../"))return B8(w3(X),z);if(I3(z))return z;return R3(B8(Z,"package.json")).resolve(z)}}}async function C3(Z,X){return bZ(X?.imports,yZ(Z),B8(Z,"project.json"))}function j3(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 $8=T(()=>{gZ()});async function mZ(Z,X={}){let{resolveElementPath:z,$media:q,formats:J}=X,Q=[],G=new Set;async function Y(W,U){let K,V;if(typeof W==="string"){let{readFileSync:O}=await import("node:fs"),{resolve:R}=await import("node:path");if(V=U?R(U,W):R(W),G.has(V))return;if(G.add(V),V.endsWith(".json"))K=JSON.parse(O(V,"utf8"));else{let{extname:j}=await import("node:path"),I=j(V).toLowerCase(),w=J?.byExtension?.(I,"parse");if(!w){let{unknownFormatError:y}=await Promise.resolve().then(() => ($8(),D8));throw y(V,I)}K=await w.call("parse",O(V,"utf8"))}}else{if(K=W,V=null,G.has(K.tagName))return;G.add(K.tagName)}let M=K.tagName;if(!M||!M.includes("-"))throw Error(`compileElement: tagName "${M}" must contain a hyphen`);let{dirname:F}=await import("node:path"),H=V?F(V):null,A=[];if(Array.isArray(K.$elements))for(let O of K.$elements){let R=O.$ref??O;if(typeof R!=="string")continue;if(H)await Y(R,H);let j;if(z)j=z(R,H);else j=R.replace(/\.json$/,".js");A.push(j)}let B=X1(M);if(q)K.$media={...q,...K.$media};let $=s0(K,B,A),D=V?V.replace(/\.json$/,".js"):`${M}.js`;Q.push({path:D,content:$,tagName:M})}return await Y(Z,X.basePath??null),{files:Q}}async function N3(Z,X={}){let{title:z="Jx App",reactivitySrc:q="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:J="https://esm.sh/lit-html@3.3.0"}=X,Q=await mZ(Z,X),G=Q.files[Q.files.length-1],{basename:Y}=await import("node:path"),W=Y(G.path);return{html:`<!DOCTYPE html>
|
|
87
|
+
})`}var CZ=T(()=>{IZ();j0()});class PZ{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;capabilities;#Z;#X=null;constructor(Z,X,z,q){this.name=Z,this.classPath=X,this.classDef=z,this.#Z=q;let J=z.format;this.extensions=(J.extensions??[]).map((W)=>W.toLowerCase()),this.mediaType=J.mediaType??null,this.documentKinds=J.documentKinds??[],this.exportTarget=J.exportTarget===!0,this.remote=J.remote===!0,this.studio=z.$studio??null,this.capabilities=H3(z)}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 z=this.capabilities[Z];if(!z)throw Error(`Format class "${this.name}" does not declare a "${Z}" capability`);let q=await this.implementation(),J=this.classDef.title??this.name,W=q[J]??q.default?.[J]??q.default,G=W?.[z.identifier];if(typeof G!=="function")throw Error(`Format class "${this.name}": implementation export "${J}" has no static "${z.identifier}" method`);return await G.call(W,...X)}}class _Z{#Z;constructor(Z){this.#Z=Z;for(let X of NZ){let z=new Map;for(let q of Z){if(!q.capabilities[X])continue;for(let J of q.extensions){let W=z.get(J);if(W)throw Error(`Format conflict: "${W.name}" and "${q.name}" both claim "${J}" with the "${X}" capability`);z.set(J,q)}}}}get entries(){return this.#Z}byExtension(Z,X){let z=jZ(Z);return this.#Z.find((q)=>q.extensions.includes(z)&&(!X||q.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 z of this.#Z){if(Z&&!z.documentKinds.includes(Z))continue;for(let q of z.extensions)X.add(q)}return X.delete(".json"),[...X]}has(Z){let X=jZ(Z);return this.#Z.some((z)=>z.extensions.includes(X))}}async function xZ(Z,X,z){let q=[];for(let[J,W]of Object.entries(Z??{})){if(typeof W!=="string"||!W.endsWith(".class.json"))continue;let G=z?X.resolvePath(z,W):W,Y;try{Y=await X.loadJson(G)}catch{continue}if(!Y||typeof Y!=="object")continue;if(!Y.format||!Array.isArray(Y.format.extensions))continue;q.push(new PZ(J,G,Y,X))}return new _Z(q)}function H3(Z){let X={},z=Z.$defs?.methods??{};for(let[q,J]of Object.entries(z)){let W=J.role;if(!W||!NZ.includes(W))continue;X[W]={identifier:J.identifier??q,timing:J.timing??F3}}return X}function jZ(Z){let X=Z.toLowerCase();return X.startsWith(".")?X:`.${X}`}var NZ,F3;var EZ=T(()=>{NZ=["parse","serialize","discover","load"],F3=["compiler","server"]});var B8={};w8(B8,{unknownFormatError:()=>w3,importImplementation:()=>SZ,createNodeFormatIO:()=>kZ,buildProjectFormatRegistry:()=>O3});import{readFileSync as B3}from"node:fs";import{dirname as D3,resolve as H8,isAbsolute as $3,sep as L1}from"node:path";import{pathToFileURL as A3}from"node:url";import{createRequire as L3}from"node:module";async function SZ(Z){let X=[Z],z=`${L1}src${L1}`,q=`${L1}dist${L1}`;if(Z.includes(z))X.push(Z.replace(z,q));if(Z.endsWith(".js"))X.push(Z.slice(0,-3)+".ts");let J;for(let W of X)try{return await import(A3(W).href)}catch(G){J=G}throw J}function kZ(Z){return{loadJson:async(X)=>JSON.parse(B3(X,"utf-8")),importModule:(X)=>SZ(X),resolvePath:(X,z)=>{if(z.startsWith("./")||z.startsWith("../"))return H8(D3(X),z);if($3(z))return z;return L3(H8(Z,"package.json")).resolve(z)}}}async function O3(Z,X){return xZ(X?.imports,kZ(Z),H8(Z,"project.json"))}function w3(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 D8=T(()=>{EZ()});async function bZ(Z,X={}){let{resolveElementPath:z,$media:q,formats:J}=X,W=[],G=new Set;async function Y(Q,U){let K,V;if(typeof Q==="string"){let{readFileSync:O}=await import("node:fs"),{resolve:R}=await import("node:path");if(V=U?R(U,Q):R(Q),G.has(V))return;if(G.add(V),V.endsWith(".json"))K=JSON.parse(O(V,"utf8"));else{let{extname:j}=await import("node:path"),I=j(V).toLowerCase(),w=J?.byExtension?.(I,"parse");if(!w){let{unknownFormatError:y}=await Promise.resolve().then(() => (D8(),B8));throw y(V,I)}K=await w.call("parse",O(V,"utf8"))}}else{if(K=Q,V=null,G.has(K.tagName))return;G.add(K.tagName)}let M=K.tagName;if(!M||!M.includes("-"))throw Error(`compileElement: tagName "${M}" must contain a hyphen`);let{dirname:F}=await import("node:path"),H=V?F(V):null,A=[];if(Array.isArray(K.$elements))for(let O of K.$elements){let R=O.$ref??O;if(typeof R!=="string")continue;if(H)await Y(R,H);let j;if(z)j=z(R,H);else j=R.replace(/\.json$/,".js");A.push(j)}let B=X1(M);if(q)K.$media={...q,...K.$media};let $=s0(K,B,A),D=V?V.replace(/\.json$/,".js"):`${M}.js`;W.push({path:D,content:$,tagName:M})}return await Y(Z,X.basePath??null),{files:W}}async function I3(Z,X={}){let{title:z="Jx App",reactivitySrc:q="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:J="https://esm.sh/lit-html@3.3.0"}=X,W=await bZ(Z,X),G=W.files[W.files.length-1],{basename:Y}=await import("node:path"),Q=Y(G.path);return{html:`<!DOCTYPE html>
|
|
181
88
|
<html lang="en">
|
|
182
89
|
<head>
|
|
183
90
|
<meta charset="utf-8">
|
|
@@ -194,24 +101,24 @@ export async function onRequestPost(context) {
|
|
|
194
101
|
</head>
|
|
195
102
|
<body>
|
|
196
103
|
<${G.tagName}></${G.tagName}>
|
|
197
|
-
<script type="module" src="./${
|
|
104
|
+
<script type="module" src="./${Q}"></script>
|
|
198
105
|
</body>
|
|
199
|
-
</html>`,files:
|
|
200
|
-
`)}function
|
|
201
|
-
`)}function
|
|
106
|
+
</html>`,files:W.files}}function T3(Z){if(Z===null||typeof Z!=="object"||Array.isArray(Z))return JSON.stringify(Z);if("default"in Z)return JSON.stringify(Z.default);if(T0(Z))return;if(Z.$prototype==="LocalStorage"||Z.$prototype==="SessionStorage")return JSON.stringify(Z.default??null);if(Z.$prototype==="Request")return"null";return JSON.stringify(Z)}function s0(Z,X,z){let q=[];if(q.push("// Generated by @jxsuite/compiler — do not edit manually"),Z.$id)q.push(`// Source: ${Z.$id}`);for(let V of z)q.push(`import '${V}';`);let J=new Map,W=Z.state??{};for(let[V,M]of Object.entries(W)){let F=M;if(F&&typeof F==="object"&&!Array.isArray(F)&&F.$prototype==="Function"&&F.$src){let H=F.$src;if(!J.has(H))J.set(H,[]);J.get(H).push(V)}}for(let[V,M]of J)q.push(`import { ${M.join(", ")} } from '${V}';`);q.push("import { reactive, computed, effect } from '@vue/reactivity';"),q.push("import { render, html } from 'lit-html';"),q.push(""),q.push(`class ${X} extends HTMLElement {`),q.push(" #dispose = null;"),q.push(""),q.push(" constructor() {"),q.push(" super();");let G=[],Y=[],Q=[];for(let[V,M]of Object.entries(W)){let F=M;if(F&&typeof F==="object"&&!Array.isArray(F)&&"$expression"in F){let H=F.$expression;if(F0(H.operator))Q.push([V,F]);else Y.push([V,F])}else if(F&&typeof F==="object"&&!Array.isArray(F)&&F.$prototype==="Function")if(typeof F.body==="string"&&F.body.includes("return"))Y.push([V,F]);else Q.push([V,F]);else{let H=T3(F);if(H!==void 0)G.push([V,H])}}q.push(" this.state = reactive({");for(let[V,M]of G)q.push(` ${V}: ${M},`);q.push(" });");for(let[V,M]of Q)if(q.push(""),"$expression"in M){let F=d(M.$expression,{statePrefix:"s",eventParam:"e"});q.push(` this.state.${V} = (s, e) => { ${F}; };`)}else if(M.$src){let H=(M.parameters??M.arguments??["state"]).join(", ");q.push(` this.state.${V} = (${H}) => ${V}(${H});`)}else{let H=(M.parameters??M.arguments??["state"]).join(", ");q.push(` this.state.${V} = (${H}) => {`),q.push(` ${M.body}`),q.push(" };")}for(let[V,M]of Y)if(q.push(""),"$expression"in M){let F=d(M.$expression,{statePrefix:"this.state",eventParam:"e"});q.push(` this.state.${V} = computed(() => ${F});`)}else if(M.$src)q.push(` this.state.${V} = computed(() => ${V}(this.state));`);else{q.push(` this.state.${V} = computed(() => {`);let F=M.body.replace(/state\./g,"this.state.");q.push(` ${F}`),q.push(" });")}q.push(" }"),q.push("");let U=[];if(Array.isArray(Z.children)){let V={n:0};for(let M of Z.children)m0(M,U,Z.$media??{},"",V,Z.tagName)}if(q.push(" template() {"),q.push(" const s = this.state;"),q.push(" return html`"),q.push(A8(Z.children,Z.style," ")),q.push(" `;"),q.push(" }"),q.push(""),q.push(" connectedCallback() {"),q.push(" const _pa = this.getAttribute('data-jx-props');"),q.push(" if (_pa) {"),q.push(" try {"),q.push(" const _p = JSON.parse(_pa);"),q.push(" for (const [k, v] of Object.entries(_p)) {"),q.push(" if (k in this.state) this.state[k] = v;"),q.push(" }"),q.push(" } catch {}"),q.push(" this.removeAttribute('data-jx-props');"),q.push(" }"),q.push(" for (const key of Object.keys(this.state)) {"),q.push(" if (this.hasOwnProperty(key) && this[key] !== undefined) {"),q.push(" this.state[key] = this[key];"),q.push(" }"),q.push(" }"),Z.style&&typeof Z.style==="object"){let V=[];for(let[M,F]of Object.entries(Z.style)){if(M.startsWith(":")||M.startsWith(".")||M.startsWith("&")||M.startsWith("[")||M.startsWith("@"))continue;if(F===null||typeof F==="object")continue;let H=l(M);if(typeof F==="string"&&F.includes("${"))V.push([H,F])}if(V.length>0){q.push(" effect(() => {");for(let[M,F]of V){let H=F.replace(/\$\{([^}]+)\}/g,(A,B)=>"${"+B.replace(/state\./g,"this.state.")+"}");q.push(` this.style['${M}'] = \`${H}\`;`)}q.push(" });")}}let K=vZ(Z.children);if(K)q.push(" const _slotted = Array.from(this.childNodes).filter(n => n.nodeType === 1 || (n.nodeType === 3 && n.textContent.trim()));");if(q.push(" if (this.hasAttribute('data-jx-prerendered')) {"),q.push(" this.removeAttribute('data-jx-prerendered');"),q.push(" }"),q.push(" this.innerHTML = '';"),q.push(" this.#dispose = effect(() => render(this.template(), this));"),K)q.push(" const _slot = this.querySelector('slot');"),q.push(" if (_slot && _slotted.length > 0) {"),q.push(" for (const n of _slotted) _slot.before(n);"),q.push(" _slot.remove();"),q.push(" }");return q.push(" }"),q.push(""),q.push(" disconnectedCallback() {"),q.push(" if (this.#dispose) { this.#dispose(); this.#dispose = null; }"),q.push(" }"),q.push("}"),q.push(""),q.push(`customElements.define('${Z.tagName}', ${X});`),q.push(""),q.join(`
|
|
107
|
+
`)}function A8(Z,X,z){if(!Z)return"";if(Z.$prototype==="Array")return C3(Z,z);if(!Array.isArray(Z))return"";return Z.map((q)=>R3(q,z)).join(`
|
|
108
|
+
`)}function R3(Z,X){if(typeof Z==="string"){if(Z.includes("${"))return`${X}${$8(Z)}`;return`${X}${C(Z)}`}if(typeof Z==="number"||typeof Z==="boolean")return`${X}${C(String(Z))}`;if(!Z||typeof Z!=="object")return"";let z=Z.tagName??"div",q=[];if(Z.attributes)for(let[Q,U]of Object.entries(Z.attributes))if(typeof U==="string"&&U.includes("${"))q.push(`${Q}="${O1(U)}"`);else q.push(`${Q}="${U}"`);if(Z.id)q.push(`id="${Z.id}"`);if(Z.className)q.push(`class="${Z.className}"`);for(let[Q,U]of Object.entries(Z)){if(H0.has(Q)||Q.startsWith("$")||Q.startsWith("on")||Q==="tagName"||Q==="id"||Q==="className"||Q==="style"||Q==="children"||Q==="textContent"||Q==="innerHTML"||Q==="attributes")continue;if(U&&typeof U==="object"&&U.$ref)q.push(`.${Q}="\${${O0(U.$ref)}}"`);else if(typeof U==="string"&&U.includes("${"))q.push(`.${Q}="${O1(U)}"`)}if(Z.$props)for(let[Q,U]of Object.entries(Z.$props))if(U&&typeof U==="object"&&U.$ref)q.push(`.${Q}="\${${O0(U.$ref)}}"`);else q.push(`.${Q}="\${${JSON.stringify(U)}}"`);for(let[Q,U]of Object.entries(Z)){if(!Q.startsWith("on")||Q==="observedAttributes")continue;let K=Q.slice(2).toLowerCase();if(U&&typeof U==="object"&&U.$ref)q.push(`@${K}="\${(e) => ${O0(U.$ref)}(s, e)}"`);else if(U&&typeof U==="object"&&"$expression"in U){let V=d(U.$expression,{statePrefix:"s",eventParam:"e"});q.push(`@${K}="\${(e) => { ${V}; }}"`)}else if(U&&typeof U==="object"&&U.$prototype==="Function")q.push(`@${K}="\${(e) => { ${N3(U)} }}"`)}let J=gZ(Z.style);if(J)q.push(`style="${J}"`);let W=q.length>0?`
|
|
202
109
|
`+X+" "+q.join(`
|
|
203
|
-
`+X+" "):"";if(new Set(["input","br","hr","img","meta","link"]).has(z))return`${X}<${z}${
|
|
204
|
-
${X}>`;let Y="";if(Z.textContent!==void 0)Y
|
|
205
|
-
`+
|
|
206
|
-
`+X;return`${X}<${z}${
|
|
207
|
-
${X}>${Y}</${z}>`}function
|
|
208
|
-
`+X+" "+
|
|
209
|
-
`+X+" "):"",
|
|
210
|
-
`+
|
|
110
|
+
`+X+" "):"";if(new Set(["input","br","hr","img","meta","link"]).has(z))return`${X}<${z}${W}
|
|
111
|
+
${X}>`;let Y="";if(Z.textContent!==void 0)Y=$8(Z.textContent);else if(Z.innerHTML!==void 0)Y=Z.innerHTML;else if(Z.children)Y=`
|
|
112
|
+
`+A8(Z.children,Z.style,X+" ")+`
|
|
113
|
+
`+X;return`${X}<${z}${W}
|
|
114
|
+
${X}>${Y}</${z}>`}function C3(Z,X){let z=Z.items?.$ref?O0(Z.items.$ref):"ITEMS",q=Z.map;if(!q)return"";let J=q.tagName??"div",W=[];if(q.$props)for(let[U,K]of Object.entries(q.$props))if(K&&typeof K==="object"&&K.$ref)W.push(`.${U}="\${${j3(K.$ref)}}"`);else W.push(`.${U}="\${${JSON.stringify(K)}}"`);let G=gZ(q.style);if(G)W.push(`style="${G}"`);for(let[U,K]of Object.entries(q)){if(!U.startsWith("on"))continue;let V=U.slice(2).toLowerCase();if(K&&typeof K==="object"&&K.$ref)W.push(`@${V}="\${(e) => ${O0(K.$ref)}(s, e)}"`);else if(K&&typeof K==="object"&&"$expression"in K){let M=d(K.$expression,{statePrefix:"s",eventParam:"e"});W.push(`@${V}="\${(e) => { ${M}; }}"`)}}let Y=W.length>0?`
|
|
115
|
+
`+X+" "+W.join(`
|
|
116
|
+
`+X+" "):"",Q="";if(q.textContent!==void 0)Q=$8(q.textContent);else if(q.children)Q=`
|
|
117
|
+
`+A8(q.children,null,X+" ")+`
|
|
211
118
|
`+X+" ";return`${X}\${${z}.map((item, index) => html\`
|
|
212
119
|
${X} <${J}${Y}
|
|
213
|
-
${X} >${
|
|
214
|
-
${X}\`)}`}function O0(Z){if(Z.startsWith("#/state/"))return"s."+Z.slice(8).replace(/\//g,".");if(Z.startsWith("$map/"))return Z.slice(5).replace(/\//g,".");return"s."+Z}function
|
|
120
|
+
${X} >${Q}</${J}>
|
|
121
|
+
${X}\`)}`}function O0(Z){if(Z.startsWith("#/state/"))return"s."+Z.slice(8).replace(/\//g,".");if(Z.startsWith("$map/"))return Z.slice(5).replace(/\//g,".");return"s."+Z}function j3(Z){if(Z.startsWith("$map/"))return Z.slice(5).replace(/\//g,".");return O0(Z)}function O1(Z){return Z.replace(/state\./g,"s.")}function $8(Z){if(Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string")return`\${${O0(Z.$ref)}}`;if(typeof Z==="string"&&Z.includes("${"))return O1(Z);return String(Z)}function N3(Z){return(Z.body??"").replace(/(?<!this\.)state\./g,"s.").replace(/(?<!this\.)state(?!\.)/g,"s")}function gZ(Z){if(!Z||typeof Z!=="object")return"";let X=[];for(let[z,q]of Object.entries(Z)){if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")||z.startsWith("@"))continue;if(q===null||typeof q==="object")continue;if(typeof q==="string"&&q.includes("${")){let J=l(z);X.push(`${J}: ${O1(q)}`)}}return X.join("; ")}function vZ(Z){if(!Array.isArray(Z))return!1;for(let X of Z){if(!X||typeof X!=="object")continue;if(X.tagName==="slot")return!0;if(vZ(X.children))return!0}return!1}var L8=T(()=>{a0();j0()});function yZ(Z,X){let{title:z,reactivitySrc:q,litHtmlSrc:J}=X,W=R0(Z,null,Z.state??{},Z.$media??{}),G=C0(Z,Z.$media??{},X.projectStyle??null),Y=[],Q=mZ(Z,!1,Z,W,Y),U=[],K="",V="";if(Y.length>0){for(let F of Y){let H=s0(F.def,F.className,[]);U.push({path:`_islands/${F.tagName}.js`,content:H,tagName:F.tagName})}K=`<script type="importmap">
|
|
215
122
|
{
|
|
216
123
|
"imports": {
|
|
217
124
|
"@vue/reactivity": "${q}",
|
|
@@ -229,11 +136,11 @@ ${X}\`)}`}function O0(Z){if(Z.startsWith("#/state/"))return"s."+Z.slice(8).repla
|
|
|
229
136
|
${G}
|
|
230
137
|
</head>
|
|
231
138
|
<body>
|
|
232
|
-
${
|
|
139
|
+
${Q}
|
|
233
140
|
${V}
|
|
234
141
|
</body>
|
|
235
|
-
</html>`,files:U}}function
|
|
236
|
-
`)}return""}var
|
|
142
|
+
</html>`,files:U}}function mZ(Z,X,z,q,J){if(typeof Z==="string")return C(Z);if(typeof Z==="number"||typeof Z==="boolean")return C(String(Z));if(!Z||typeof Z!=="object")return"";let W=R0(z,q.scope,z?.state??q.scopeDefs,z?.$media??q.media);if(X){let U=J.length,K=`jx-island-${U}`,V=`JxIsland${U}`,M={...z??Z,tagName:K};return J.push({def:M,tagName:K,className:V}),`<${K}></${K}>`}let G=Z.tagName??"div",Y=y0(Z,W.scope),Q=P3(Z,z,W,J);return`<${G}${Y}>${Q}</${G}>`}function P3(Z,X,z,q){let J=X??Z;if(J.textContent!==void 0){let W=b(J.textContent,z.scope);return W==null?"":C(String(W))}if(J.innerHTML)return b(J.innerHTML,z.scope)??J.innerHTML;if(Array.isArray(J.children)){let W=X?.children;return J.children.map((G,Y)=>{let Q=G,U=P8(Q),K=W?.[Y]??G;return mZ(Q,U,K,z,q)}).join(`
|
|
143
|
+
`)}return""}var hZ=T(()=>{j0();L8()});function uZ(Z,X){let{title:z,reactivitySrc:q=e0,litHtmlSrc:J=Z1,modulePath:W="app.js"}=X,G=R0(Z,null,Z.state??{},Z.$media??{}),Y=C0(Z,Z.$media??{},X.projectStyle??null),Q={t:0,s:0,h:0,m:0,sw:0,l:0,needsLit:!1},U=new Map,K=new Map,V=[],M=[],F=[],H=[],A=[],B=new Map,$=Z.state??{};for(let[I,N]of Object.entries($)){if(N===null||typeof N!=="object"||Array.isArray(N)){if(typeof N==="string"&&P(N))M.push([I,"() => `"+N+"`"]);else V.push([I,N]);continue}let w=N;if("$expression"in w){let y=w.$expression;if(F0(y.operator)){let a=d(y,{statePrefix:"state",eventParam:"e"});H.push([I,{args:["state","e"],body:a}])}else{let a=d(y,{statePrefix:"state",eventParam:"e"});M.push([I,`() => ${a}`])}continue}if(w.$prototype==="Function"){let y=w.parameters??w.arguments;if(w.$src){if(!B.has(w.$src))B.set(w.$src,new Set);B.get(w.$src).add(I),M.push([I,"() => { return "+I+"(state); }"])}else if(w.body&&w.body.includes("return"))M.push([I,"() => { "+w.body+" }"]);else H.push([I,{args:y??["state"],body:w.body}]);continue}if(T0(w))continue;if("default"in w&&!w.$prototype){V.push([I,w.default]);continue}if(w.$prototype==="LocalStorage"||w.$prototype==="SessionStorage"){let y=w.$prototype==="LocalStorage"?"localStorage":"sessionStorage",a=w.key??I,w1=w.default??null;V.push([I,null]),A.push(E3(I,y,a,w1));continue}if(w.$prototype==="Request"){V.push([I,null]),A.push(x3(I,w));continue}if(w.$prototype==="Cookie"){V.push([I,null]),A.push(S3(I,w.name??I,w.default??null));continue}V.push([I,w])}let D=fZ(Z,Z,G,U,K,Q);for(let[I,N]of U)if(!F.some(([w])=>w===I))F.push([I,N]);for(let[I,N]of K)if(!H.some(([w])=>w===I))H.push([I,N]);let O=_3(V,M,F,H,A,B,Q,q),R=[` "@vue/reactivity": "${q}"`,` "lit-html": "${J}"`];return{html:`<!DOCTYPE html>
|
|
237
144
|
<html lang="en">
|
|
238
145
|
<head>
|
|
239
146
|
<meta charset="utf-8">
|
|
@@ -248,22 +155,22 @@ ${R.join(`,
|
|
|
248
155
|
}
|
|
249
156
|
</script>
|
|
250
157
|
${Y}
|
|
251
|
-
<script type="module" src="./${
|
|
158
|
+
<script type="module" src="./${W}"></script>
|
|
252
159
|
</head>
|
|
253
160
|
<body>
|
|
254
161
|
${D}
|
|
255
162
|
</body>
|
|
256
|
-
</html>`,files:[{path:
|
|
257
|
-
`)}if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${K}${V}${M}>`;return`<${Y}${K}${V}${M}>${F}</${Y}>`}function
|
|
258
|
-
`+Z.children.map((
|
|
163
|
+
</html>`,files:[{path:W,content:O}]}}function fZ(Z,X,z,q,J,W){if(typeof Z==="string")return C(Z);if(typeof Z==="number"||typeof Z==="boolean")return C(String(Z));if(!Z||typeof Z!=="object")return"";let G=R0(X,z.scope,X?.state??z.scopeDefs,X?.$media??z.media),Y=Z.tagName??"div",Q=[],U=!1;if(Z.textContent!==void 0){let B=X?.textContent??Z.textContent;if(W0(B)){let $=w0(B.$ref);Q.push(`:text-content="${$}"`),O8(q,$,B.$ref),U=!0}else if(P(B)){let $=`_t${W.t++}`;Q.push(`:text-content="${$}"`),q.set($,"() => `"+B+"`"),U=!0}}for(let[B,$]of Object.entries(Z)){if(!B.startsWith("on")||B==="observedAttributes")continue;let D=B.slice(2).toLowerCase();if(W0($)){let O=w0($.$ref);Q.push(`@${D}="${O}"`),U=!0}else if($&&typeof $==="object"&&$.$prototype==="Function"){let O=$,R=`_h${W.h++}`;Q.push(`@${D}="${R}"`),J.set(R,{args:O.parameters??O.arguments??["state","event"],body:O.body}),U=!0}else if($&&typeof $==="object"&&"$expression"in $){let O=`_h${W.h++}`;Q.push(`@${D}="${O}"`);let R=d($.$expression,{statePrefix:"state",eventParam:"e"});J.set(O,{args:["state","e"],body:R}),U=!0}}if(Z.style&&typeof Z.style==="object")for(let[B,$]of Object.entries(Z.style)){if(B.startsWith(":")||B.startsWith(".")||B.startsWith("&")||B.startsWith("[")||B.startsWith("@"))continue;if($===null||typeof $==="object")continue;if(P($)){let D=`_s${W.s++}`;Q.push(`:style.${l(B)}="${D}"`),q.set(D,"() => `"+$+"`"),U=!0}}if(Z.attributes&&typeof Z.attributes==="object"){for(let[B,$]of Object.entries(Z.attributes))if(W0($)){let D=w0($.$ref);Q.push(`:attr.${B}="${D}"`),O8(q,D,$.$ref),U=!0}else if(P($)){let D=`_t${W.t++}`;Q.push(`:attr.${B}="${D}"`),q.set(D,"() => `"+$+"`"),U=!0}}for(let[B,$]of Object.entries(Z)){if(H0.has(B)||B.startsWith("on")||B.startsWith("$")||B==="tagName"||B==="id"||B==="className"||B==="style"||B==="children"||B==="textContent"||B==="innerHTML"||B==="attributes")continue;if(W0($)){let D=w0($.$ref);Q.push(`:${l(B)}="${D}"`),O8(q,D,$.$ref),U=!0}else if(P($)){let D=`_t${W.t++}`;Q.push(`:${l(B)}="${D}"`),q.set(D,"() => `"+$+"`"),U=!0}}let K=y0(Z,G.scope),V=U?" data-bind":"",M=Q.length>0?" "+Q.join(" "):"",F="",H=X??Z;if(H.textContent!==void 0&&!U){let B=b(H.textContent,G.scope);F=B==null?"":C(String(B))}else if(H.textContent!==void 0&&U){let B=b(H.textContent,G.scope);F=B==null?"":C(String(B))}else if(H.innerHTML)F=b(H.innerHTML,G.scope)??H.innerHTML;else if(H.children&&typeof H.children==="object"&&!Array.isArray(H.children)&&H.children.$prototype==="Array"){W.needsLit=!0;let B=`_list${W.l++}`,$=H.children,D;if(W0($.items))D="state."+w0($.items.$ref);else D=JSON.stringify($.items);let O=cZ($.map);q.set(B,"() => ("+D+" ?? []).map((item, index) => html`"+O+"`)"),Q.push(`:render="${B}"`),U=!0;let R=" data-bind",j=" "+Q.join(" ");if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${K}${R}${j}>`;return`<${Y}${K}${R}${j}></${Y}>`}else if(Array.isArray(H.children)){let B=X?.children;F=H.children.map(($,D)=>{let O=B?.[D]??$;return fZ($,O,G,q,J,W)}).join(`
|
|
164
|
+
`)}if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${K}${V}${M}>`;return`<${Y}${K}${V}${M}>${F}</${Y}>`}function cZ(Z){if(!Z)return"";let X=Z.tagName??"div",z="";if(Z.id)z+=' id="'+Z.id+'"';if(Z.className)z+=' class="'+v0(Z.className)+'"';if(Z.attributes&&typeof Z.attributes==="object")for(let[W,G]of Object.entries(Z.attributes))if(typeof G==="string"&&P(G))z+=" "+W+'="'+v0(G)+'"';else z+=" "+W+'="'+C(String(G))+'"';if(Z.style&&typeof Z.style==="object"){let W=[];for(let[G,Y]of Object.entries(Z.style)){if(G.startsWith(":")||G.startsWith(".")||G.startsWith("&")||G.startsWith("[")||G.startsWith("@"))continue;if(Y===null||typeof Y==="object")continue;let Q=l(G);if(P(String(Y)))W.push(Q+": "+v0(String(Y)));else W.push(Q+": "+Y)}if(W.length>0)z+=' style="'+W.join("; ")+'"'}for(let[W,G]of Object.entries(Z)){if(!W.startsWith("on")||W==="observedAttributes")continue;let Y=W.slice(2).toLowerCase();if(W0(G)){let Q=w0(G.$ref);z+=" @"+Y+"=${(e) => { state.$map = { item, index }; on."+Q+"(e); }}"}else if(G&&typeof G==="object"&&G.$prototype==="Function"){let Q=v0(G.body);z+=" @"+Y+"=${(e) => { "+Q+" }}"}else if(G&&typeof G==="object"&&"$expression"in G){let Q=d(G.$expression,{statePrefix:"state",eventParam:"e"});z+=" @"+Y+"=${(e) => { state.$map = { item, index }; "+Q+"; }}"}}if(Z.contentEditable)z+=' contenteditable="'+Z.contentEditable+'"';let q="";if(Z.textContent!==void 0){let W=String(Z.textContent);if(P(W))q=v0(W);else if(W0(Z.textContent))q="${state."+w0(Z.textContent.$ref)+"}";else q=C(W)}else if(Z.innerHTML)q=v0(String(Z.innerHTML));else if(Array.isArray(Z.children))q=`
|
|
165
|
+
`+Z.children.map((W)=>cZ(W)).join(`
|
|
259
166
|
`)+`
|
|
260
|
-
`;if(new Set(["input","br","hr","img","meta","link"]).has(X))return"<"+X+z+">";return"<"+X+z+">"+q+"</"+X+">"}function v0(Z){return Z.replace(/\$map\./g,"")}function
|
|
261
|
-
`)}function
|
|
262
|
-
`)}function
|
|
263
|
-
`)}function
|
|
264
|
-
`)}function w0(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replace(/\//g,"_");return Z.replace(/\//g,"_")}function
|
|
265
|
-
`)}function
|
|
266
|
-
`):Z.body??"").includes("await ")}import{readFileSync as
|
|
167
|
+
`;if(new Set(["input","br","hr","img","meta","link"]).has(X))return"<"+X+z+">";return"<"+X+z+">"+q+"</"+X+">"}function v0(Z){return Z.replace(/\$map\./g,"")}function _3(Z,X,z,q,J,W,G,Y){let Q=[],U=G.needsLit,K=X.length>0;Q.push("// Generated by @jxsuite/compiler — do not edit manually");let V=["reactive","effect"];if(K)V.push("computed");if(Q.push("import { "+V.join(", ")+" } from '@vue/reactivity';"),U)Q.push("import { html, render } from 'lit-html';");for(let[M,F]of W)Q.push("import { "+[...F].join(", ")+" } from '"+M+"';");Q.push(""),Q.push("const state = reactive({");for(let[M,F]of Z)Q.push(" "+M+": "+JSON.stringify(F)+",");if(Q.push("});"),Q.push(""),J.length>0){for(let M of J)Q.push(M);Q.push("")}if(X.length>0){for(let[M,F]of X)Q.push("state."+M+" = computed("+F+");");Q.push("")}if(z.length>0){Q.push("const bind = {");for(let[M,F]of z)Q.push(" "+M+": "+F+",");Q.push("};")}else Q.push("const bind = {};");if(Q.push(""),q.length>0){Q.push("const on = {");for(let[M,F]of q){let H=F.args??["state"],A=H.map((B)=>B==="state"?"state":"e").join(", ");Q.push(" "+M+": (e) => { const fn = ("+H.join(", ")+") => { "+F.body+" }; fn("+A+"); },")}Q.push("};")}else Q.push("const on = {};");if(Q.push(""),Q.push("function hydrate(root) {"),Q.push(" root.querySelectorAll('[data-bind]').forEach(el => {"),Q.push(" [...el.attributes].forEach(a => {"),Q.push(" if (a.name.startsWith(':')) {"),Q.push(" const parts = a.name.slice(1).split('.');"),Q.push(" const key = a.value;"),U)Q.push(" if (parts[0] === 'render') {"),Q.push(" effect(() => { render(bind[key](), el); });"),Q.push(" } else if (parts[0] === 'style' && parts.length > 1) {");else Q.push(" if (parts[0] === 'style' && parts.length > 1) {");return Q.push(" effect(() => { el.style[parts[1]] = bind[key](); });"),Q.push(" } else if (parts[0] === 'attr' && parts.length > 1) {"),Q.push(" effect(() => { el.setAttribute(parts[1], bind[key]()); });"),Q.push(" } else {"),Q.push(" const prop = parts[0].replace(/-([a-z])/g, (_, c) => c.toUpperCase());"),Q.push(" effect(() => { el[prop] = bind[key](); });"),Q.push(" }"),Q.push(" } else if (a.name.startsWith('@')) {"),Q.push(" el.addEventListener(a.name.slice(1), on[a.value]);"),Q.push(" }"),Q.push(" });"),Q.push(" });"),Q.push("}"),Q.push(""),Q.push("hydrate(document);"),Q.push(""),Q.join(`
|
|
168
|
+
`)}function x3(Z,X){let z=X.url,q=X.method??"GET",J=P(z);if(X.manual)return"// "+Z+": manual Request — fetch triggered by user action";let W=[];if(W.push("// "+Z+": auto-fetch from "+(J?"(dynamic URL)":z)),W.push("effect(() => {"),J)W.push(" const url = `"+z+"`;"),W.push(' if (!url || url === "undefined" || url.includes("undefined")) return;');else W.push(" const url = "+JSON.stringify(z)+";");let G=[];if(q!=="GET")G.push("method: "+JSON.stringify(q));if(X.headers)G.push("headers: "+JSON.stringify(X.headers));if(X.body){let Q=typeof X.body==="object"?JSON.stringify(JSON.stringify(X.body)):JSON.stringify(X.body);G.push("body: "+Q)}let Y=G.length>0?", { "+G.join(", ")+" }":"";return W.push(" fetch(url"+Y+")"),W.push(" .then(r => r.ok ? r.json() : Promise.reject(r.statusText))"),W.push(" .then(d => { state."+Z+" = d; })"),W.push(" .catch(e => { state."+Z+" = { error: String(e) }; });"),W.push("});"),W.join(`
|
|
169
|
+
`)}function E3(Z,X,z,q){let J=[];return J.push("// "+Z+": "+X+' (key: "'+z+'")'),J.push("try {"),J.push(" const _s = "+X+".getItem("+JSON.stringify(z)+");"),J.push(" state."+Z+" = _s !== null ? JSON.parse(_s) : "+JSON.stringify(q)+";"),J.push("} catch { state."+Z+" = "+JSON.stringify(q)+"; }"),J.push("effect(() => {"),J.push(" const v = state."+Z+";"),J.push(" try {"),J.push(" if (v === null) "+X+".removeItem("+JSON.stringify(z)+");"),J.push(" else "+X+".setItem("+JSON.stringify(z)+", JSON.stringify(v));"),J.push(" } catch {}"),J.push("});"),J.join(`
|
|
170
|
+
`)}function S3(Z,X,z){let q=[];return q.push("// "+Z+': Cookie (name: "'+X+'")'),q.push("{"),q.push(' const _m = document.cookie.match(new RegExp("(?:^|; )'+X+'=([^;]*)"));'),q.push(" try { state."+Z+" = _m ? JSON.parse(decodeURIComponent(_m[1])) : "+JSON.stringify(z)+"; }"),q.push(" catch { state."+Z+" = _m ? _m[1] : "+JSON.stringify(z)+"; }"),q.push("}"),q.join(`
|
|
171
|
+
`)}function w0(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replace(/\//g,"_");return Z.replace(/\//g,"_")}function O8(Z,X,z){if(Z.has(X))return;if(z.startsWith("#/state/")){let J=z.slice(8).split("/");Z.set(X,"() => state."+J.join("."))}else Z.set(X,"() => state."+z)}var pZ=T(()=>{a0();j0()});var lZ={};w8(lZ,{compileClassJson:()=>k3});function k3(Z,X={}){let z=Z.title;if(!z)throw Error("compileClassJson: missing title (class name)");let q=b3(Z.extends),J=Z.$defs,W=J?.fields??{},G=J?.constructor,Y=J?.methods??{},Q=[];if(Q.push("// Generated by @jxsuite/compiler from .class.json — do not edit manually"),Z.$id)Q.push(`// Source: ${Z.$id}`);Q.push("");let U=q!=="Object"?` extends ${q}`:"";Q.push(`class ${z}${U} {`);for(let[K,V]of Object.entries(W)){let M=V;if(M.scope!=="static")continue;let F=M.identifier??K,H=M.access==="private"?"#":"",A=M.initializer!==void 0?JSON.stringify(M.initializer):M.default!==void 0?JSON.stringify(M.default):"null";Q.push(` static ${H}${F} = ${A};`)}for(let[K,V]of Object.entries(W)){let M=V;if(M.scope==="static")continue;if(M.access!=="private")continue;let F=M.identifier??K;Q.push(` #${F};`)}if(Object.keys(W).length>0)Q.push("");if(Q.push(" constructor(config = {}) {"),G?.superCall||q!=="Object"){let K=G?.superCall?.arguments?G.superCall.arguments.join(", "):"";Q.push(` super(${K});`)}for(let[K,V]of Object.entries(W)){let M=V;if(M.scope==="static")continue;let F=M.identifier??K,H=M.access==="private"?"#":"",A=M.initializer!==void 0?JSON.stringify(M.initializer):M.default!==void 0?JSON.stringify(M.default):"null";Q.push(` this.${H}${F} = config.${F} !== undefined ? config.${F} : ${A};`)}if(G?.body){let K=Array.isArray(G.body)?G.body:[G.body];for(let V of K)Q.push(` ${V}`)}Q.push(" }");for(let[K,V]of Object.entries(Y)){let M=V,F=M.identifier??K,H=M.scope==="static",B=M.access==="private"?"#":"",$=H?"static ":"",D=M.returnType?.$ref?.includes("Promise")||v3(M)?"async ":"",O=dZ(M.parameters??[]),R=g3(M.body);if(Q.push(""),M.role==="accessor"){if(M.getter)Q.push(` ${$}get ${B}${F}() {`),Q.push(` ${M.getter.body}`),Q.push(" }");if(M.setter){let j=dZ(M.setter.parameters??[]);Q.push(` ${$}set ${B}${F}(${j}) {`),Q.push(` ${M.setter.body}`),Q.push(" }")}}else{Q.push(` ${$}${D}${B}${F}(${O}) {`);for(let j of R)Q.push(` ${j}`);Q.push(" }")}}return Q.push("}"),Q.push(""),Q.push(`export { ${z} };`),Q.push(`export default ${z};`),Q.push(""),Q.join(`
|
|
172
|
+
`)}function b3(Z){if(!Z)return"Object";if(typeof Z==="string")return Z;let X=Z;if(X.$ref){let q=X.$ref.match(/([A-Za-z0-9_]+)\.class\.json/);return q?q[1]:"Object"}return"Object"}function dZ(Z){return Z.map((X)=>{let z=X;if(z.$ref)return z.$ref.split("/").pop();return z.identifier??z.name??"arg"}).join(", ")}function g3(Z){if(!Z)return[""];if(Array.isArray(Z))return Z;return[Z]}function v3(Z){return(Array.isArray(Z.body)?Z.body.join(`
|
|
173
|
+
`):Z.body??"").includes("await ")}import{readFileSync as y3}from"node:fs";async function m3(Z,X={}){let{title:z="Jx App",reactivitySrc:q=e0,litHtmlSrc:J=Z1,projectStyle:W=null}=X,G;if(typeof Z==="string"){let Y=y3(Z,"utf8");if(Z.endsWith(".json"))G=JSON.parse(Y);else{let{extname:Q}=await import("node:path"),U=Q(Z).toLowerCase(),V=X.formats?.byExtension?.(U,"parse");if(!V){let{unknownFormatError:M}=await Promise.resolve().then(() => (D8(),B8));throw M(Z,U)}G=await V.call("parse",Y)}}else G=Z;if(G.$prototype==="Class"){let{compileClassJson:Y}=await Promise.resolve().then(() => lZ),Q=Y(G,X);return{html:"",files:[{path:typeof Z==="string"?Z.replace(/\.class\.json$/,".js"):`${G.title}.js`,content:Q}]}}if(!x1(G))return yZ(G,{title:z,reactivitySrc:q,litHtmlSrc:J,projectStyle:W});if(G.tagName&&G.tagName.includes("-")){let Y=G.tagName,Q=X1(Y),U=s0(G,Q,[]),K={path:`${Y}.js`,content:U,tagName:Y},V=C0(G,G.$media??{});return{html:`<!DOCTYPE html>
|
|
267
174
|
<html lang="en">
|
|
268
175
|
<head>
|
|
269
176
|
<meta charset="utf-8">
|
|
@@ -283,4 +190,4 @@ ${R.join(`,
|
|
|
283
190
|
<${Y}></${Y}>
|
|
284
191
|
<script type="module" src="./${Y}.js"></script>
|
|
285
192
|
</body>
|
|
286
|
-
</html>`,files:[K]}}return
|
|
193
|
+
</html>`,files:[K]}}return uZ(G,{title:z,reactivitySrc:q,litHtmlSrc:J,projectStyle:W})}async function aX(Z,X){let[z,q]=await Promise.all([m3(Z),TZ(Z)]),{writeFileSync:J,mkdirSync:W}=await import("node:fs"),{dirname:G,join:Y}=await import("node:path");if(X){J(X,z.html,"utf8"),console.error(`Written to ${X}`);let Q=G(X);for(let U of z.files){let K=Y(Q,U.path);W(G(K),{recursive:!0}),J(K,U.content,"utf8"),console.error(`Written to ${K}`)}}else process.stdout.write(z.html);if(q&&X){let Q=X.replace(/(\.[^.]+)?$/,"-server.js");J(Q,q,"utf8"),console.error(`Server handler written to ${Q}`)}}var h3=T(()=>{j0();CZ();L8();hZ();pZ()});h3();export{aX as runCli,x1 as isDynamic,M3 as compileSiteServer,TZ as compileServer,I3 as compileElementPage,bZ as compileElement,uZ as compileClient,m3 as compile};
|