@jxsuite/compiler 0.28.4 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,290 +1,296 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as kq}from"node:module";var Tq=Object.create;var{getPrototypeOf:Rq,defineProperty:d1,getOwnPropertyNames:_q}=Object;var Pq=Object.prototype.hasOwnProperty;function jq(Z){return this[Z]}var Eq,Cq,B4=(Z,X,q)=>{var W=Z!=null&&typeof Z==="object";if(W){var Q=X?Eq??=new WeakMap:Cq??=new WeakMap,J=Q.get(Z);if(J)return J}q=Z!=null?Tq(Rq(Z)):{};let z=X||!Z||!Z.__esModule?d1(q,"default",{value:Z,enumerable:!0}):q;for(let Y of _q(Z))if(!Pq.call(z,Y))d1(z,Y,{get:jq.bind(Z,Y),enumerable:!0});if(W)Q.set(Z,z);return z};var E=(Z,X)=>()=>(X||Z((X={exports:{}}).exports,X),X.exports);var Oq=(Z)=>Z;function xq(Z,X){this[Z]=Oq.bind(null,X)}var f4=(Z,X)=>{for(var q in X)d1(Z,q,{get:X[q],enumerable:!0,configurable:!0,set:xq.bind(X,q)})};var R=(Z,X)=>()=>(Z&&(X=Z(Z=0)),X);var q0=kq(import.meta.url);function c1(Z){let X=Z.$map;return X&&typeof X==="object"?X:void 0}function L6(Z){return p3.has(Z)}function C0(Z,X,q,W){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return Q6(Z,X,q,W);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return bq(Z.$ref,X,q,W);if(Array.isArray(Z))return Z.map((Q)=>C0(Q,X,q,W));return Z}function bq(Z,X,q,W){if(Z==="$reduce/acc")return W?.acc;if(Z.startsWith("$reduce/"))return W?.acc;if(Z.startsWith("event#/")){let Q=Z.slice(7);return S6(q,Q)}if(Z.startsWith("$map/")){let Q=Z.split("/"),[,J]=Q,z,Y=c1(X);if(J==="item")z=W?.item??Y?.item??X["$map/item"];else if(J==="index")z=W?.index??Y?.index??X["$map/index"];else z=Y?.[J]??X[`$map/${J}`];return Q.length>2?S6(z,Q.slice(2).join("/")):z}if(Z.startsWith("#/state/")){let Q=Z.slice(8),J=Q.indexOf("/");if(J===-1)return X[Q];return S6(X[Q.slice(0,J)],Q.slice(J+1))}if(Z.startsWith("parent#/"))return X[Z.slice(8)];if(Z.startsWith("window#/"))return S6(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return S6(globalThis.document,Z.slice(10));return X[Z]??null}function vq(Z,X,q,W){if(Z.startsWith("$map/")){let Q=Z.split("/"),[,J]=Q,z,Y=c1(X);if(J==="item")z=W?.item??Y?.item??X["$map/item"];else if(J==="index")z=W?.index??Y?.index??X["$map/index"];else z=Y?.[J]??X[`$map/${J}`];if(Q.length>2){let U=Q.slice(2),K=U.pop(),V=U.length>0?S6(z,U.join("/")):z;return{key:K,obj:V}}return{key:J==="item"?"$map/item":"$map/index",obj:c1(X)??X}}if(Z.startsWith("#/state/")){let Q=Z.slice(8);if(Q.indexOf("/")===-1)return{key:Q,obj:X};let z=Q.split("/"),Y=z.pop(),U=X;for(let K of z)U=U[K];return{key:Y,obj:U}}return{key:Z,obj:X}}function Q6(Z,X,q,W){let{operator:Q,target:J,value:z,initial:Y}=Z;if(!Sq.has(Q))throw Error(`$expression: unknown operator "${Q}"`);if(l1.has(Q)&&!("value"in Z)){let U=C0(J,X,q,W);if(Q==="!")return!U;if(Q==="-")return-U}if(p1.has(Q)){let U=C0(J,X,q,W),K=C0(z,X,q,W);switch(Q){case"+":return U+K;case"-":return U-K;case"*":return U*K;case"/":return U/K;case"%":return U%K;case"===":return U===K;case"!==":return U!==K;case"<":return U<K;case"<=":return U<=K;case">":return U>K;case">=":return U>=K;case"&&":return U&&K;case"||":return U||K;default:break}}if(n3.has(Q)){let U=C0(z,X,q,W),{obj:K,key:V}=vq(J.$ref,X,q,W);switch(Q){case"=":{K[V]=U;break}case"+=":{let B=K[V];K[V]=B+U;break}case"-=":{let B=K[V];K[V]=B-U;break}case"*=":{let B=K[V];K[V]=B*U;break}case"/=":{let B=K[V];K[V]=B/U;break}default:break}return}if(i3.has(Q)){let U=C0(J,X,q,W);switch(Q){case"push":return U.push(C0(z,X,q,W));case"unshift":return U.unshift(C0(z,X,q,W));case"pop":return U.pop();case"shift":return U.shift();case"splice":{let K=C0(z,X,q,W);return U.splice(...K)}default:break}}if(n1.has(Q)){let U=C0(J,X,q,W);if(Q==="reduce"){let K=C0(Y,X,q,W);for(let[V,B]of U.entries())K=Q6(z,X,q,{acc:K,index:V,item:B});return K}if(Q==="map")return U.map((K,V)=>Q6(z,X,q,{...W,index:V,item:K}));if(Q==="filter")return U.filter((K,V)=>Q6(z,X,q,{...W,index:V,item:K}))}return}function N0(Z,X){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return T0(Z,X);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return r3(Z.$ref,X);if(Array.isArray(Z))return Z.map((q)=>N0(q,X)).join(", ");return JSON.stringify(Z)}function r3(Z,X){let q=X.statePrefix??"state",W=X.eventParam??"event";if(Z==="$reduce/acc")return"_acc";if(Z.startsWith("$reduce/"))return"_acc";if(Z.startsWith("event#/")){let Q=Z.slice(7);return`${W}.${Q.replaceAll("/",".")}`}if(Z.startsWith("$map/")){let Q=Z.split("/"),[,J]=Q;if(J==="item")return Q.length>2?`_item.${Q.slice(2).join(".")}`:"_item";if(J==="index")return"_index";return`_${J}`}if(Z.startsWith("#/state/")){let Q=Z.slice(8);return`${q}.${Q.replaceAll("/",".")}`}if(Z.startsWith("parent#/"))return`${q}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replaceAll("/",".")}`;return`${q}.${Z}`}function l3(Z,X){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return r3(Z.$ref,X);return N0(Z,X)}function T0(Z,X={}){let{operator:q,target:W,value:Q,initial:J}=Z;if(l1.has(q)&&!("value"in Z)){let z=N0(W,X);if(q==="!")return`!(${z})`;if(q==="-")return`-(${z})`}if(p1.has(q)){let z=N0(W,X),Y=N0(Q,X);return`(${z} ${q} ${Y})`}if(n3.has(q)){let z=l3(W,X),Y=N0(Q,X);return`${z} ${q} ${Y}`}if(i3.has(q)){let z=l3(W,X);switch(q){case"push":return`${z}.push(${N0(Q,X)})`;case"unshift":return`${z}.unshift(${N0(Q,X)})`;case"pop":return`${z}.pop()`;case"shift":return`${z}.shift()`;case"splice":{let Y=Array.isArray(Q)?Q.map((U)=>N0(U,X)).join(", "):N0(Q,X);return`${z}.splice(${Y})`}default:break}}if(n1.has(q)){let z=N0(W,X),Y=T0(Q,X);if(q==="reduce"){let U=N0(J,X);return`${z}.reduce((_acc, _item, _index) => ${Y}, ${U})`}if(q==="map")return`${z}.map((_item, _index) => ${Y})`;if(q==="filter")return`${z}.filter((_item, _index) => ${Y})`}return"undefined"}function S6(Z,X){let q=Z;for(let W of X.split(/[./]/))q=q?.[W];return q}var p3,l1,p1,n3,i3,n1,Sq;var i1=R(()=>{p3=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),l1=new Set(["!","-"]),p1=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||"]),n3=new Set(["=","+=","-=","*=","/="]),i3=new Set(["push","pop","shift","unshift","splice"]),n1=new Set(["reduce","map","filter"]),Sq=new Set([...p3,...l1,...p1,...n1])});function M0(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function L0(Z){return M0(Z)&&typeof Z.$ref==="string"}function i0(Z){return M0(Z)&&Z.$prototype==="Function"}function O0(Z){return M0(Z)&&M0(Z.$expression)}function I6(Z){return M0(Z)&&typeof Z.$prototype==="string"&&Z.$prototype!=="Function"}function r1(Z){return M0(Z)&&Z.timing==="server"&&typeof Z.$src==="string"&&typeof Z.$export==="string"&&!Z.$prototype}function a3(Z){return M0(Z)&&!Z.$prototype&&!Z.$expression&&"default"in Z}function J6(Z){if(!M0(Z))return!1;for(let X of Object.keys(Z))if(!s3.has(X))return!1;return!0}function w6(Z){return M0(Z)&&Z.$prototype==="Array"}function o3(Z){return M0(Z)&&Z.$prototype==="Class"}function x(Z){return typeof Z==="string"&&Z.includes("${")}function z6(Z){if(!Z)return[];return Z.map((X)=>typeof X==="string"?X:X.name)}var s3;var S0=R(()=>{s3=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function yq(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function I0(Z){return Z.replaceAll(/[A-Z]/g,(X)=>`-${X.toLowerCase()}`)}function B0(Z){return Object.entries(Z).filter(([X,q])=>!yq(X)&&(q===null||typeof q!=="object")).map(([X,q])=>`${I0(X)}: ${q}`).join("; ")}var D6;var u4=R(()=>{i1();S0();D6=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"])});function o1(Z){if(!Z||typeof Z!=="object")return!1;if(Z.state)for(let[X,q]of Object.entries(Z.state)){if(X==="$site"||X==="$page")continue;if(q&&typeof q==="object"&&!Array.isArray(q)&&q.timing==="compiler")continue;if(typeof q!=="object"||q===null||Array.isArray(q))return!0;if(q.$prototype)return!0;if("default"in q)return!0;if(J6(q))continue;return!0}if(Z.$switch)return!0;if(!Array.isArray(Z.children)&&Z.children?.$prototype==="Array")return!0;if(Array.isArray(Z.children)&&Z.children.some((X)=>o1(X)))return!0;for(let[X,q]of Object.entries(Z)){if(D6.has(X))continue;if(q!==null&&typeof q==="object"&&typeof q.$ref==="string")return!0;if(x(q))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(x(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(x(X))return!0}return!1}function e3(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(!Array.isArray(Z.children)&&Z.children?.$prototype==="Array")return!0;for(let[X,q]of Object.entries(Z)){if(D6.has(X))continue;if(q!==null&&typeof q==="object"&&typeof q.$ref==="string")return!0;if(x(q))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(x(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(x(X))return!0}return!1}function h6(Z,X=null,q={},W={}){let Q=Z?.state?m6(Z.state,X):X??Object.create(null);return{media:W,scope:Q,scopeDefs:q}}function m6(Z={},X=null){let q=Object.create(X??null);for(let[W,Q]of Object.entries(Z)){if(typeof Q!=="object"||Q===null||Array.isArray(Q)){N6(q,W,d4(Q));continue}let J=Q;if("default"in J){N6(q,W,d4(J.default));continue}if(!J.$prototype&&!("$expression"in J)&&!J6(J))N6(q,W,d4(J))}for(let[W,Q]of Object.entries(Z)){if(typeof Q==="string"&&x(Q)){a1(q,W,()=>Y0(Q,q));continue}if(!Q||typeof Q!=="object")continue;if(O0(Q)){let J=Q.$expression;if(L6(J.operator))N6(q,W,(z,Y)=>Q6(J,z,Y));else a1(q,W,()=>Q6(J,q,null));continue}if(i0(Q)){if(Q.body){let J=Q.parameters?z6(Q.parameters):Q.arguments??[],z=Function("state",...J,Q.body);if(Q.body.includes("return"))a1(q,W,()=>z(q));else N6(q,W,z)}else N6(q,W,()=>{});continue}if(I6(Q)&&(Q.$prototype==="LocalStorage"||Q.$prototype==="SessionStorage"))N6(q,W,d4(Q.default??null))}return q}function N6(Z,X,q){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,value:q,writable:!0})}function a1(Z,X,q){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,get:q})}function p(Z,X){if(b0(Z))return t1(Z.$ref,X);if(x(Z))return Y0(Z,X);return Z}function b0(Z){return L0(Z)}function t1(Z,X){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let q=Z.split("/"),[,W]=q,Q=X.$map?.[W]??X[`$map/${W}`];return q.length>2?t3(Q,q.slice(2).join("/")):Q}if(Z.startsWith("#/state/")){let q=Z.slice(8),W=q.indexOf("/");if(W===-1)return X[q];return t3(X[q.slice(0,W)],q.slice(W+1))}return X[Z]??null}function Y0(Z,X){try{let q=Z.match(/^\$\{(.+)\}$/s);if(q)return Function("state","$map",`return (${q[1]})`)(X,X?.$map);return Function("state","$map",`return \`${Z}\``)(X,X?.$map)}catch{return null}}function t3(Z,X){if(!X)return Z;let q=Z;for(let W of X.split("/"))q=q==null?void 0:q[W];return q}function d4(Z){if(Z===null||typeof Z!=="object")return Z;return structuredClone(Z)}function v6(Z,X){let q="",W=p(Z.id,X),Q=p(Z.className,X),J=p(Z.hidden,X),z=p(Z.tabIndex,X),Y=p(Z.title,X),U=p(Z.lang,X),K=p(Z.dir,X);if(W)q+=` id="${y(String(W))}"`;if(Q)q+=` class="${y(String(Q))}"`;if(J)q+=" hidden";if(z!==void 0&&z!==null)q+=` tabindex="${y(String(z))}"`;if(Y)q+=` title="${y(String(Y))}"`;if(U)q+=` lang="${y(String(U))}"`;if(K)q+=` dir="${y(String(K))}"`;if(Z.style&&X){let V=Object.entries(Z.style).filter(([B,H])=>!B.startsWith(":")&&!B.startsWith(".")&&!B.startsWith("&")&&!B.startsWith("[")&&!B.startsWith("@")&&H!==null&&typeof H!=="object"&&typeof H==="string"&&x(H)).map(([B,H])=>{let $=p(H,X);return $==null?null:`${I0(B)}: ${$}`}).filter(Boolean).join("; ");if(V)q+=` style="${V}"`}if(Z.attributes)for(let[V,B]of Object.entries(Z.attributes)){let H=p(B,X);if(H!==null&&H!==void 0&&(typeof H==="string"||typeof H==="number"||typeof H==="boolean"))q+=` ${V}="${y(String(H))}"`}if(Z.tagName==="img"){if(!Z.attributes?.loading)q+=' loading="lazy"';if(!Z.attributes?.decoding)q+=' decoding="async"'}if(Z.$static)q+=" data-jx-static";else if(Z.$prerendered)q+=" data-jx-prerendered";return q}function f6(Z,X={},q=null){let W=[];if(q&&typeof q==="object"){let J=(V,B)=>{let H=B0(B);if(H)W.push(`${V} { ${H} }`);for(let[$,F]of Object.entries(B)){if(F===null||typeof F!=="object"||Array.isArray(F))continue;if($.startsWith("@")){let A=$.startsWith("@--")?`@media ${X[$.slice(1)]??$.slice(1)}`:$,I=B0(F);if(I)W.push(`${A} { ${V} { ${I} } }`);for(let[M,P]of Object.entries(F)){if(P===null||typeof P!=="object"||Array.isArray(P))continue;if(M.startsWith("@"))continue;let k=M.startsWith("&")?M.replace("&",V):M.startsWith(":")||M.startsWith(".")||M.startsWith("[")?`${V}${M}`:`${V} ${M}`,b=B0(P);if(b)W.push(`${A} { ${k} { ${b} } }`)}continue}let L=$.startsWith("&")?$.replace("&",V):$.startsWith(":")||$.startsWith(".")||$.startsWith("[")?`${V}${$}`:`${V} ${$}`;J(L,F)}};for(let[V,B]of Object.entries(q))if(V.startsWith(":")||V.startsWith(".")||V.startsWith("["))J(V,B);else if(B!==null&&typeof B==="object"&&!Array.isArray(B)&&!V.startsWith("@")&&!V.startsWith("--"))J(V,B);else if(V.startsWith("@")){let H=V.startsWith("@--")?`@media ${X[V.slice(1)]??V.slice(1)}`:V.startsWith("@(")?`@media ${V.slice(1)}`:V;W.push(`${H} { body { ${B0(B)} } }`)}let z={},Y={};for(let[V,B]of Object.entries(q)){if(V.startsWith(":")||V.startsWith(".")||V.startsWith("[")||V.startsWith("@"))continue;if(B!==null&&typeof B==="object"&&!Array.isArray(B))continue;if(V.startsWith("--"))z[V]=B;else Y[V]=B}let U=B0(z);if(U)W.push(`:root { ${U} }`);let K=B0(Y);if(K)W.push(`body { ${K} }`)}if(G6(Z,W,X,"",{n:0}),W.length===0)return"";return`<style>
3
- ${W.join(`
2
+ import{createRequire as NX}from"node:module";var BX=Object.create;var{getPrototypeOf:HX,defineProperty:N2,getOwnPropertyNames:$X}=Object;var FX=Object.prototype.hasOwnProperty;function LX(Z){return this[Z]}var AX,MX,v6=(Z,W,X)=>{var Q=Z!=null&&typeof Z==="object";if(Q){var J=W?AX??=new WeakMap:MX??=new WeakMap,G=J.get(Z);if(G)return G}X=Z!=null?BX(HX(Z)):{};let z=W||!Z||!Z.__esModule?N2(X,"default",{value:Z,enumerable:!0}):X;for(let q of $X(Z))if(!FX.call(z,q))N2(z,q,{get:LX.bind(Z,q),enumerable:!0});if(Q)J.set(Z,z);return z};var i=(Z,W)=>()=>(W||Z((W={exports:{}}).exports,W),W.exports);var IX=(Z)=>Z;function wX(Z,W){this[Z]=IX.bind(null,W)}var w4=(Z,W)=>{for(var X in W)N2(Z,X,{get:W[X],enumerable:!0,configurable:!0,set:wX.bind(W,X)})};var d=(Z,W)=>()=>(Z&&(W=Z(Z=0)),W);var T0=NX(import.meta.url);function D2(Z){let W=Z.$map;return W&&typeof W==="object"?W:void 0}function E1(Z){return H8.has(Z)}function r0(Z,W,X,Q){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return L1(Z,W,X,Q);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return TX(Z.$ref,W,X,Q);if(Array.isArray(Z))return Z.map((J)=>r0(J,W,X,Q));return Z}function TX(Z,W,X,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 Q6(X,J)}if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J,z,q=D2(W);if(G==="item")z=Q?.item??q?.item??W["$map/item"];else if(G==="index")z=Q?.index??q?.index??W["$map/index"];else z=q?.[G]??W[`$map/${G}`];return J.length>2?Q6(z,J.slice(2).join("/")):z}if(Z.startsWith("#/state/")){let J=Z.slice(8),G=J.indexOf("/");if(G===-1)return W[J];return Q6(W[J.slice(0,G)],J.slice(G+1))}if(Z.startsWith("parent#/"))return W[Z.slice(8)];if(Z.startsWith("window#/"))return Q6(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return Q6(globalThis.document,Z.slice(10));return W[Z]??null}function RX(Z,W,X,Q){if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J,z,q=D2(W);if(G==="item")z=Q?.item??q?.item??W["$map/item"];else if(G==="index")z=Q?.index??q?.index??W["$map/index"];else z=q?.[G]??W[`$map/${G}`];if(J.length>2){let K=J.slice(2),V=K.pop(),H=K.length>0?Q6(z,K.join("/")):z;return{key:V,obj:H}}return{key:G==="item"?"$map/item":"$map/index",obj:D2(W)??W}}if(Z.startsWith("#/state/")){let J=Z.slice(8);if(J.indexOf("/")===-1)return{key:J,obj:W};let z=J.split("/"),q=z.pop(),K=W;for(let V of z)K=K[V];return{key:q,obj:K}}return{key:Z,obj:W}}function L1(Z,W,X,Q){let{operator:J,target:G,value:z,initial:q}=Z;if(!DX.has(J))throw Error(`$expression: unknown operator "${J}"`);if(T2.has(J)&&!("value"in Z)){let K=r0(G,W,X,Q);if(J==="!")return!K;if(J==="-")return-K}if(R2.has(J)){let K=r0(G,W,X,Q),V=r0(z,W,X,Q);switch(J){case"+":return K+V;case"-":return K-V;case"*":return K*V;case"/":return K/V;case"%":return K%V;case"===":return K===V;case"!==":return K!==V;case"<":return K<V;case"<=":return K<=V;case">":return K>V;case">=":return K>=V;case"&&":return K&&V;case"||":return K||V;default:break}}if($8.has(J)){let K=r0(z,W,X,Q),{obj:V,key:H}=RX(G.$ref,W,X,Q);switch(J){case"=":{V[H]=K;break}case"+=":{let B=V[H];V[H]=B+K;break}case"-=":{let B=V[H];V[H]=B-K;break}case"*=":{let B=V[H];V[H]=B*K;break}case"/=":{let B=V[H];V[H]=B/K;break}default:break}return}if(F8.has(J)){let K=r0(G,W,X,Q);switch(J){case"push":return K.push(r0(z,W,X,Q));case"unshift":return K.unshift(r0(z,W,X,Q));case"pop":return K.pop();case"shift":return K.shift();case"splice":{let V=r0(z,W,X,Q);return K.splice(...V)}default:break}}if(P2.has(J)){let K=r0(G,W,X,Q);if(J==="reduce"){let V=r0(q,W,X,Q);for(let[H,B]of K.entries())V=L1(z,W,X,{acc:V,index:H,item:B});return V}if(J==="map")return K.map((V,H)=>L1(z,W,X,{...Q,index:H,item:V}));if(J==="filter")return K.filter((V,H)=>L1(z,W,X,{...Q,index:H,item:V}))}return}function d0(Z,W){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return c0(Z,W);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return L8(Z.$ref,W);if(Array.isArray(Z))return Z.map((X)=>d0(X,W)).join(", ");return JSON.stringify(Z)}function L8(Z,W){let X=W.statePrefix??"state",Q=W.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.replaceAll("/",".")}`}if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J;if(G==="item")return J.length>2?`_item.${J.slice(2).join(".")}`:"_item";if(G==="index")return"_index";return`_${G}`}if(Z.startsWith("#/state/")){let J=Z.slice(8);return`${X}.${J.replaceAll("/",".")}`}if(Z.startsWith("parent#/"))return`${X}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replaceAll("/",".")}`;return`${X}.${Z}`}function B8(Z,W){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return L8(Z.$ref,W);return d0(Z,W)}function c0(Z,W={}){let{operator:X,target:Q,value:J,initial:G}=Z;if(T2.has(X)&&!("value"in Z)){let z=d0(Q,W);if(X==="!")return`!(${z})`;if(X==="-")return`-(${z})`}if(R2.has(X)){let z=d0(Q,W),q=d0(J,W);return`(${z} ${X} ${q})`}if($8.has(X)){let z=B8(Q,W),q=d0(J,W);return`${z} ${X} ${q}`}if(F8.has(X)){let z=B8(Q,W);switch(X){case"push":return`${z}.push(${d0(J,W)})`;case"unshift":return`${z}.unshift(${d0(J,W)})`;case"pop":return`${z}.pop()`;case"shift":return`${z}.shift()`;case"splice":{let q=Array.isArray(J)?J.map((K)=>d0(K,W)).join(", "):d0(J,W);return`${z}.splice(${q})`}default:break}}if(P2.has(X)){let z=d0(Q,W),q=c0(J,W);if(X==="reduce"){let K=d0(G,W);return`${z}.reduce((_acc, _item, _index) => ${q}, ${K})`}if(X==="map")return`${z}.map((_item, _index) => ${q})`;if(X==="filter")return`${z}.filter((_item, _index) => ${q})`}return"undefined"}function Q6(Z,W){let X=Z;for(let Q of W.split(/[./]/))X=X?.[Q];return X}var H8,T2,R2,$8,F8,P2,DX;var N4=d(()=>{H8=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),T2=new Set(["!","-"]),R2=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||"]),$8=new Set(["=","+=","-=","*=","/="]),F8=new Set(["push","pop","shift","unshift","splice"]),P2=new Set(["reduce","map","filter"]),DX=new Set([...H8,...T2,...R2,...P2])});function g0(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function h0(Z){return g0(Z)&&typeof Z.$ref==="string"}function A1(Z){return g0(Z)&&Z.$prototype==="Function"}function a0(Z){return g0(Z)&&g0(Z.$expression)}function c1(Z){return g0(Z)&&typeof Z.$prototype==="string"&&Z.$prototype!=="Function"}function _2(Z){return g0(Z)&&Z.timing==="server"&&typeof Z.$src==="string"&&typeof Z.$export==="string"&&!Z.$prototype}function A8(Z){return g0(Z)&&!Z.$prototype&&!Z.$expression&&"default"in Z}function C1(Z){if(!g0(Z))return!1;for(let W of Object.keys(Z))if(!M8.has(W))return!1;return!0}function R0(Z){return g0(Z)&&Z.$prototype==="Array"}function j2(Z){if(R0(Z))return!0;return Array.isArray(Z)&&Z.some((W)=>R0(W))}function I8(Z){return g0(Z)&&Z.$prototype==="Class"}function s(Z){return typeof Z==="string"&&Z.includes("${")}function O1(Z){if(!Z)return[];return Z.map((W)=>typeof W==="string"?W:W.name)}var M8;var e0=d(()=>{M8=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function PX(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function k0(Z){return Z.replaceAll(/[A-Z]/g,(W)=>`-${W.toLowerCase()}`)}function j0(Z){return Object.entries(Z).filter(([W,X])=>!PX(W)&&(X===null||typeof X!=="object")).map(([W,X])=>`${k0(W)}: ${X}`).join("; ")}var x1;var y6=d(()=>{N4();e0();x1=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 T4(Z){if(!Z||typeof Z!=="object")return!1;if(Z.state)for(let[W,X]of Object.entries(Z.state)){if(W==="$site"||W==="$page")continue;if(X&&typeof X==="object"&&!Array.isArray(X)&&X.timing==="compiler")continue;if(typeof X!=="object"||X===null||Array.isArray(X))return!0;if(X.$prototype)return!0;if("default"in X)return!0;if(C1(X))continue;return!0}if(Z.$switch)return!0;if(R0(Z)||j2(Z.children))return!0;if(Array.isArray(Z.children)&&Z.children.some((W)=>T4(W)))return!0;for(let[W,X]of Object.entries(Z)){if(x1.has(W))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(s(X))return!0}if(Z.style&&typeof Z.style==="object"){for(let W of Object.values(Z.style))if(s(W))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let W of Object.values(Z.attributes))if(s(W))return!0}return!1}function N8(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(R0(Z)||j2(Z.children))return!0;for(let[W,X]of Object.entries(Z)){if(x1.has(W))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(s(X))return!0}if(Z.style&&typeof Z.style==="object"){for(let W of Object.values(Z.style))if(s(W))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let W of Object.values(Z.attributes))if(s(W))return!0}return!1}function U6(Z,W=null,X={},Q={}){let J=Z?.state?q6(Z.state,W):W??Object.create(null);return{media:Q,scope:J,scopeDefs:X}}function q6(Z={},W=null){let X=Object.create(W??null);for(let[Q,J]of Object.entries(Z)){if(typeof J!=="object"||J===null||Array.isArray(J)){l1(X,Q,D4(J));continue}let G=J;if("default"in G){l1(X,Q,D4(G.default));continue}if(!G.$prototype&&!("$expression"in G)&&!C1(G))l1(X,Q,D4(G))}for(let[Q,J]of Object.entries(Z)){if(typeof J==="string"&&s(J)){E2(X,Q,()=>E0(J,X));continue}if(!J||typeof J!=="object")continue;if(a0(J)){let G=J.$expression;if(E1(G.operator))l1(X,Q,(z,q)=>L1(G,z,q));else E2(X,Q,()=>L1(G,X,null));continue}if(A1(J)){if(J.body){let G=J.parameters?O1(J.parameters):J.arguments??[],z=Function("state",...G,J.body);if(J.body.includes("return"))E2(X,Q,()=>z(X));else l1(X,Q,z)}else l1(X,Q,()=>{});continue}if(c1(J)&&(J.$prototype==="LocalStorage"||J.$prototype==="SessionStorage"))l1(X,Q,D4(J.default??null))}return X}function l1(Z,W,X){Object.defineProperty(Z,W,{configurable:!0,enumerable:!0,value:X,writable:!0})}function E2(Z,W,X){Object.defineProperty(Z,W,{configurable:!0,enumerable:!0,get:X})}function F0(Z,W){if(s0(Z))return O2(Z.$ref,W);if(s(Z))return E0(Z,W);return Z}function s0(Z){return h0(Z)}function O2(Z,W){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let X=Z.split("/"),Q=X[1],J=W.$map?.[Q]??W[`$map/${Q}`];return X.length>2?w8(J,X.slice(2).join("/")):J}if(Z.startsWith("#/state/")){let X=Z.slice(8),Q=X.indexOf("/");if(Q===-1)return W[X];return w8(W[X.slice(0,Q)],X.slice(Q+1))}return W[Z]??null}function E0(Z,W){try{let X=Z.match(/^\$\{(.+)\}$/s);if(X)return Function("state","$map",`return (${X[1]})`)(W,W?.$map);return Function("state","$map",`return \`${Z}\``)(W,W?.$map)}catch{return null}}function w8(Z,W){if(!W)return Z;let X=Z;for(let Q of W.split("/"))X=X==null?void 0:X[Q];return X}function D4(Z){if(Z===null||typeof Z!=="object")return Z;return structuredClone(Z)}function G6(Z,W){let X="",Q=F0(Z.id,W),J=F0(Z.className,W),G=F0(Z.hidden,W),z=F0(Z.tabIndex,W),q=F0(Z.title,W),K=F0(Z.lang,W),V=F0(Z.dir,W);if(Q)X+=` id="${e(String(Q))}"`;if(J)X+=` class="${e(String(J))}"`;if(G)X+=" hidden";if(z!==void 0&&z!==null)X+=` tabindex="${e(String(z))}"`;if(q)X+=` title="${e(String(q))}"`;if(K)X+=` lang="${e(String(K))}"`;if(V)X+=` dir="${e(String(V))}"`;if(Z.style&&W){let H=Object.entries(Z.style).filter(([B,$])=>!B.startsWith(":")&&!B.startsWith(".")&&!B.startsWith("&")&&!B.startsWith("[")&&!B.startsWith("@")&&$!==null&&typeof $!=="object"&&typeof $==="string"&&s($)).map(([B,$])=>{let L=F0($,W);return L==null?null:`${k0(B)}: ${L}`}).filter(Boolean).join("; ");if(H)X+=` style="${H}"`}if(Z.attributes)for(let[H,B]of Object.entries(Z.attributes)){let $=F0(B,W);if($!==null&&$!==void 0&&(typeof $==="string"||typeof $==="number"||typeof $==="boolean"))X+=` ${H}="${e(String($))}"`}if(Z.tagName==="img"){if(!Z.attributes?.loading)X+=' loading="lazy"';if(!Z.attributes?.decoding)X+=' decoding="async"'}if(Z.$static)X+=" data-jx-static";else if(Z.$prerendered)X+=" data-jx-prerendered";return X}function K6(Z,W={},X=null){let Q=[];if(X&&typeof X==="object"){let G=(H,B)=>{let $=j0(B);if($)Q.push(`${H} { ${$} }`);for(let[L,A]of Object.entries(B)){if(A===null||typeof A!=="object"||Array.isArray(A))continue;if(L.startsWith("@")){let D=L.startsWith("@--")?`@media ${W[L.slice(1)]??L.slice(1)}`:L,R=j0(A);if(R)Q.push(`${D} { ${H} { ${R} } }`);for(let[x,f]of Object.entries(A)){if(f===null||typeof f!=="object"||Array.isArray(f))continue;if(x.startsWith("@"))continue;let p=x.startsWith("&")?x.replace("&",H):x.startsWith(":")||x.startsWith(".")||x.startsWith("[")?`${H}${x}`:`${H} ${x}`,r=j0(f);if(r)Q.push(`${D} { ${p} { ${r} } }`)}continue}let j=L.startsWith("&")?L.replace("&",H):L.startsWith(":")||L.startsWith(".")||L.startsWith("[")?`${H}${L}`:`${H} ${L}`;G(j,A)}};for(let[H,B]of Object.entries(X))if(H.startsWith(":")||H.startsWith(".")||H.startsWith("["))G(H,B);else if(B!==null&&typeof B==="object"&&!Array.isArray(B)&&!H.startsWith("@")&&!H.startsWith("--"))G(H,B);else if(H.startsWith("@")){let $=H.startsWith("@--")?`@media ${W[H.slice(1)]??H.slice(1)}`:H.startsWith("@(")?`@media ${H.slice(1)}`:H;Q.push(`${$} { body { ${j0(B)} } }`)}let z={},q={};for(let[H,B]of Object.entries(X)){if(H.startsWith(":")||H.startsWith(".")||H.startsWith("[")||H.startsWith("@"))continue;if(B!==null&&typeof B==="object"&&!Array.isArray(B))continue;if(H.startsWith("--"))z[H]=B;else q[H]=B}let K=j0(z);if(K)Q.push(`:root { ${K} }`);let V=j0(q);if(V)Q.push(`body { ${V} }`)}if(k1(Z,Q,W,"",{n:0}),Q.length===0)return"";return`<style>
3
+ ${Q.join(`
4
4
  `)}
5
- </style>`}function Z8(Z,X,q,W){let Q=B0(X);if(Q)q.push(`${Z} { ${Q} }`);for(let[J,z]of Object.entries(X)){if(z===null||typeof z!=="object"||Array.isArray(z))continue;if(J.startsWith("@")){let U=J.startsWith("@--")?`@media ${W[J.slice(1)]??J.slice(1)}`:J.startsWith("@(")?`@media ${J.slice(1)}`:J,K=B0(z);if(K)q.push(`${U} { ${Z} { ${K} } }`);for(let[V,B]of Object.entries(z)){if(B===null||typeof B!=="object"||Array.isArray(B))continue;if(V.startsWith("@"))continue;let H=V.startsWith("&")?V.replace("&",Z):V.startsWith(":")||V.startsWith(".")||V.startsWith("[")?`${Z}${V}`:`${Z} ${V}`,$=B0(B);if($)q.push(`${U} { ${H} { ${$} } }`)}continue}let Y=J.startsWith("&")?J.replace("&",Z):J.startsWith(":")||J.startsWith(".")||J.startsWith("[")?`${Z}${J}`:`${Z} ${J}`;Z8(Y,z,q,W)}}function G6(Z,X,q,W="",Q,J="jx"){let z=Q??{n:0};if(!Z||typeof Z!=="object")return;if(Z.style&&!Z.id&&!Z.className)Z.className=`${J}-${z.n}`,z.n+=1;let Y=Z.id?`#${Z.id}`:Z.className?`.${Z.className.split(" ")[0]}`:Z.tagName??"*";if(Z.style){let U=[];for(let[K,V]of Object.entries(Z.style)){if(K.startsWith(":")||K.startsWith(".")||K.startsWith("&")||K.startsWith("[")||K.startsWith("@"))continue;if(V===null||typeof V==="object")continue;if(typeof V==="string"&&x(V))continue;U.push(` ${I0(K)}: ${V};`)}if(U.length>0)X.push(`${Y} {
6
- ${U.join(`
5
+ </style>`}function D8(Z,W,X,Q){let J=j0(W);if(J)X.push(`${Z} { ${J} }`);for(let[G,z]of Object.entries(W)){if(z===null||typeof z!=="object"||Array.isArray(z))continue;if(G.startsWith("@")){let K=G.startsWith("@--")?`@media ${Q[G.slice(1)]??G.slice(1)}`:G.startsWith("@(")?`@media ${G.slice(1)}`:G,V=j0(z);if(V)X.push(`${K} { ${Z} { ${V} } }`);for(let[H,B]of Object.entries(z)){if(B===null||typeof B!=="object"||Array.isArray(B))continue;if(H.startsWith("@"))continue;let $=H.startsWith("&")?H.replace("&",Z):H.startsWith(":")||H.startsWith(".")||H.startsWith("[")?`${Z}${H}`:`${Z} ${H}`,L=j0(B);if(L)X.push(`${K} { ${$} { ${L} } }`)}continue}let q=G.startsWith("&")?G.replace("&",Z):G.startsWith(":")||G.startsWith(".")||G.startsWith("[")?`${Z}${G}`:`${Z} ${G}`;D8(q,z,X,Q)}}function k1(Z,W,X,Q="",J,G="jx"){let z=J??{n:0};if(!Z||typeof Z!=="object")return;if(Z.style&&!Z.id&&!Z.className)Z.className=`${G}-${z.n}`,z.n+=1;let q=Z.id?`#${Z.id}`:Z.className?`.${Z.className.split(" ")[0]}`:Z.tagName??"*";if(Z.style){let K=[];for(let[V,H]of Object.entries(Z.style)){if(V.startsWith(":")||V.startsWith(".")||V.startsWith("&")||V.startsWith("[")||V.startsWith("@"))continue;if(H===null||typeof H==="object")continue;if(typeof H==="string"&&s(H))continue;K.push(` ${k0(V)}: ${H};`)}if(K.length>0)W.push(`${q} {
6
+ ${K.join(`
7
7
  `)}
8
- }`);for(let[K,V]of Object.entries(Z.style)){if(V===null||typeof V!=="object"||Array.isArray(V))continue;if(K.startsWith("@")){let B=K.startsWith("@--")?`@media ${q[K.slice(1)]??K.slice(1)}`:K.startsWith("@(")?`@media ${K.slice(1)}`:K,H=B0(V);if(H)X.push(`${B} { ${Y} { ${H} } }`);for(let[$,F]of Object.entries(V)){if(F===null||typeof F!=="object"||Array.isArray(F))continue;if($.startsWith("@"))continue;let L=$.startsWith("&")?$.replace("&",Y):$.startsWith(":")||$.startsWith(".")||$.startsWith("[")?`${Y}${$}`:`${Y} ${$}`;X.push(`${B} { ${L} { ${B0(F)} } }`)}}else{let B=K.startsWith("&")?K.replace("&",Y):K.startsWith(":")||K.startsWith(".")||K.startsWith("[")?`${Y}${K}`:`${Y} ${K}`;Z8(B,V,X,q)}}}if(Array.isArray(Z.children))for(let U of Z.children)G6(U,X,q,Y,z,J);if(Z.cases&&typeof Z.cases==="object")for(let U of Object.values(Z.cases))G6(U,X,q,Y,z,J)}function y(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function c4(Z){return Z.split("-").map((X)=>X.charAt(0).toUpperCase()+X.slice(1)).join("")}function l4(Z){let X=new Map;return X8(Z,X),[...X.values()]}function X8(Z,X){if(!Z||typeof Z!=="object")return;if(Z.state){for(let[q,W]of Object.entries(Z.state))if(r1(W))X.set(W.$export,{exportName:W.$export,key:q,src:W.$src})}if(Array.isArray(Z.children))for(let q of Z.children)X8(q,X)}function b6(Z,X,q=null){if(typeof Z==="string"){if(x(Z)&&X){let z=Y0(Z,X);return z!=null?y(String(z)):y(Z)}return y(Z)}if(typeof Z==="number"||typeof Z==="boolean")return y(String(Z));if(Array.isArray(Z))return Z.map((z)=>b6(z,X,q)).join(`
9
- `);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";if(Z.$switch){let z=Z.tagName??"div",Y=v6(Z,X),U=p(Z.$switch,X),K=U==null?void 0:Z.cases?.[String(U)],V=K!==void 0&&!b0(K)?b6(K,X,q):"";return`<${z}${Y}>${V}</${z}>`}let W=Z.tagName??"div";if(W==="slot"&&q!=null)return q;let Q=v6(Z,X);if(gq.has(W))return`<${W}${Q}>`;let J="";if(Z.textContent!==void 0){let z=p(Z.textContent,X);J=z!=null?y(String(z)):""}else if(Z.innerHTML){let z=p(Z.innerHTML,X);J=z!=null?String(z):Z.innerHTML}else if(Array.isArray(Z.children))J=Z.children.map((z)=>b6(z,X,q)).join(`
10
- `);return`<${W}${Q}>${J}</${W}>`}function q8(Z,X=null,q=null){let W=Z.state??{};if(X){W={...W};for(let[J,z]of Object.entries(X))if(J in W){let Y=W[J];W[J]=Y&&typeof Y==="object"&&!Array.isArray(Y)&&"default"in Y?{...Y,default:z}:z}else W[J]=z}let Q=m6(W,null);if(!Array.isArray(Z.children))return"";return Z.children.map((J)=>b6(J,Q,q)).join(`
11
- `)}function e1(Z){return s1(Z)}function s1(Z){if(!Z||typeof Z!=="object")return!0;if(Array.isArray(Z))return Z.every((X)=>s1(X));if(Z.$prototype)return!1;if(Z.$ref)return!1;if(Z.state)for(let X of Object.values(Z.state)){if(!X||typeof X!=="object")continue;let q=X;if(q.$prototype)return!1;if(q.$ref)return!1}for(let X of Object.keys(Z))if(X.startsWith("on")&&X!=="observedAttributes")return!1;if(Array.isArray(Z.children))return Z.children.every((X)=>s1(X));if(Z.children&&typeof Z.children==="object"&&Z.children.$prototype)return!1;return!0}function W8(Z,X,q=null,W={}){let Q=[];if(X&&typeof X==="object"){let J=[];for(let[z,Y]of Object.entries(X)){if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")||z.startsWith("@"))continue;if(Y===null||typeof Y==="object")continue;if(typeof Y==="string"&&x(Y))continue;J.push(` ${I0(z)}: ${Y};`)}if(J.length>0)Q.push(`${Z} {
12
- ${J.join(`
8
+ }`);for(let[V,H]of Object.entries(Z.style)){if(H===null||typeof H!=="object"||Array.isArray(H))continue;if(V.startsWith("@")){let B=V.startsWith("@--")?`@media ${X[V.slice(1)]??V.slice(1)}`:V.startsWith("@(")?`@media ${V.slice(1)}`:V,$=j0(H);if($)W.push(`${B} { ${q} { ${$} } }`);for(let[L,A]of Object.entries(H)){if(A===null||typeof A!=="object"||Array.isArray(A))continue;if(L.startsWith("@"))continue;let j=L.startsWith("&")?L.replace("&",q):L.startsWith(":")||L.startsWith(".")||L.startsWith("[")?`${q}${L}`:`${q} ${L}`;W.push(`${B} { ${j} { ${j0(A)} } }`)}}else{let B=V.startsWith("&")?V.replace("&",q):V.startsWith(":")||V.startsWith(".")||V.startsWith("[")?`${q}${V}`:`${q} ${V}`;D8(B,H,W,X)}}}if(Array.isArray(Z.children))for(let K of Z.children)k1(K,W,X,q,z,G);if(Z.cases&&typeof Z.cases==="object")for(let K of Object.values(Z.cases))k1(K,W,X,q,z,G)}function e(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function R4(Z){return Z.split("-").map((W)=>W.charAt(0).toUpperCase()+W.slice(1)).join("")}function P4(Z){let W=new Map;return T8(Z,W),[...W.values()]}function T8(Z,W){if(!Z||typeof Z!=="object")return;if(Z.state){for(let[X,Q]of Object.entries(Z.state))if(_2(Q))W.set(Q.$export,{exportName:Q.$export,key:X,src:Q.$src})}if(Array.isArray(Z.children))for(let X of Z.children)T8(X,W)}function J6(Z,W,X=null){if(typeof Z==="string"){if(s(Z)&&W){let z=E0(Z,W);return z!=null?e(String(z)):e(Z)}return e(Z)}if(typeof Z==="number"||typeof Z==="boolean")return e(String(Z));if(Array.isArray(Z))return Z.map((z)=>J6(z,W,X)).join(`
9
+ `);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";if(Z.$switch){let z=Z.tagName??"div",q=G6(Z,W),K=F0(Z.$switch,W),V=K==null?void 0:Z.cases?.[String(K)],H=V!==void 0&&!s0(V)?J6(V,W,X):"";return`<${z}${q}>${H}</${z}>`}let Q=Z.tagName??"div";if(Q==="slot"&&X!=null)return X;let J=G6(Z,W);if(_X.has(Q))return`<${Q}${J}>`;let G="";if(Z.textContent!==void 0){let z=F0(Z.textContent,W);G=z!=null?e(String(z)):""}else if(Z.innerHTML){let z=F0(Z.innerHTML,W);G=z!=null?String(z):Z.innerHTML}else if(Array.isArray(Z.children))G=Z.children.map((z)=>J6(z,W,X)).join(`
10
+ `);return`<${Q}${J}>${G}</${Q}>`}function R8(Z,W=null,X=null){let Q=Z.state??{};if(W){Q={...Q};for(let[G,z]of Object.entries(W))if(G in Q){let q=Q[G];Q[G]=q&&typeof q==="object"&&!Array.isArray(q)&&"default"in q?{...q,default:z}:z}else Q[G]=z}let J=q6(Q,null);if(!Array.isArray(Z.children))return"";return Z.children.map((G)=>J6(G,J,X)).join(`
11
+ `)}function x2(Z){return C2(Z)}function C2(Z){if(!Z||typeof Z!=="object")return!0;if(Array.isArray(Z))return Z.every((W)=>C2(W));if(Z.$prototype)return!1;if(Z.$ref)return!1;if(Z.state)for(let W of Object.values(Z.state)){if(!W||typeof W!=="object")continue;let X=W;if(X.$prototype)return!1;if(X.$ref)return!1}for(let W of Object.keys(Z))if(W.startsWith("on")&&W!=="observedAttributes")return!1;if(Array.isArray(Z.children))return Z.children.every((W)=>C2(W));if(Z.children&&typeof Z.children==="object"&&Z.children.$prototype)return!1;return!0}function P8(Z,W,X=null,Q={}){let J=[];if(W&&typeof W==="object"){let G=[];for(let[z,q]of Object.entries(W)){if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")||z.startsWith("@"))continue;if(q===null||typeof q==="object")continue;if(typeof q==="string"&&s(q))continue;G.push(` ${k0(z)}: ${q};`)}if(G.length>0)J.push(`${Z} {
12
+ ${G.join(`
13
13
  `)}
14
- }`);for(let[z,Y]of Object.entries(X))if(z.startsWith("@")){let U=z.startsWith("@--")?`@media ${W[z.slice(1)]??z.slice(1)}`:z.startsWith("@(")?`@media ${z.slice(1)}`:z;Q.push(`${U} { ${Z} { ${B0(Y)} } }`)}else if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")){let U=z.startsWith("&")?z.replace("&",Z):`${Z}${z}`;Q.push(`${U} { ${B0(Y)} }`)}}if(q&&Array.isArray(q.children)){let J={n:0};for(let z of q.children)G6(z,Q,W,"",J,Z)}return Q.length>0?`${Q.join(`
14
+ }`);for(let[z,q]of Object.entries(W))if(z.startsWith("@")){let K=z.startsWith("@--")?`@media ${Q[z.slice(1)]??z.slice(1)}`:z.startsWith("@(")?`@media ${z.slice(1)}`:z;J.push(`${K} { ${Z} { ${j0(q)} } }`)}else if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")){let K=z.startsWith("&")?z.replace("&",Z):`${Z}${z}`;J.push(`${K} { ${j0(q)} }`)}}if(X&&Array.isArray(X.children)){let G={n:0};for(let z of X.children)k1(z,J,Q,"",G,Z)}return J.length>0?`${J.join(`
15
15
  `)}
16
- `:""}var y6="https://esm.sh/@vue/reactivity@3.5.32",g6="https://esm.sh/lit-html@3.3.0",gq;var T6=R(()=>{u4();i1();S0();S0();gq=new Set(["input","br","hr","img","meta","link","area","col","source"])});function a0(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var hq,H4=()=>hq;var Q8=R(()=>{hq=/^win/.test(globalThis.process?globalThis.process.platform:"")});function r(Z,X){let q=new URL(a0(Z),"https://aaa.nonexistanturl.com"),W=new URL(a0(X),q),Q=X.match(/(\s*)$/)?.[1]||"";if(W.hostname==="aaa.nonexistanturl.com"){let{pathname:z,search:Y,hash:U}=W;return z+Y+decodeURIComponent(U)+Q}let J=W.toString()+Q;if(J.includes("#")){let[z,Y]=J.split("#",2);return z+"#"+decodeURIComponent(Y||"")}return J}function R6(){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 J8(Z){let X=fq.exec(Z||"");if(X)return X[1].toLowerCase();return}function z8(Z){let X=Z.lastIndexOf(".");if(X>=0)return pq(Z.substring(X).toLowerCase());return""}function pq(Z){let X=Z.indexOf("?");if(X>=0)Z=Z.substring(0,X);return Z}function v0(Z){if(!Z)return"#";let X=Z.indexOf("#");if(X>=0)return Z.substring(X);return"#"}function n(Z){if(!Z)return"";let X=Z.indexOf("#");if(X>=0)Z=Z.substring(0,X);return Z}function G8(Z){let X=J8(Z);if(X==="http"||X==="https")return!0;else if(X===void 0)return typeof window<"u";else return!1}function X5(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 q=["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 W=new URL(X.startsWith("//")?"http:"+X:X),Q=W.hostname.toLowerCase();for(let z of q)if(Q===z||Q.startsWith(z)||Q.endsWith(z))return!0;if(nq(Q))return!0;let J=W.port;if(J&&iq(parseInt(J)))return!0}catch{if(X.startsWith("/")&&!X.startsWith("//"))return!1;for(let W of q)if(X.includes(W))return!0}return!1}function nq(Z){let X=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,q=Z.match(X);if(!q)return!1;let[,W,Q,J,z]=q.map(Number);if(W>255||Q>255||J>255||z>255)return!1;return W===10||W===127||W===172&&Q>=16&&Q<=31||W===192&&Q===168||W===169&&Q===254}function iq(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 p4(Z){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let X=J8(Z);return X===void 0||X==="file"}function Y8(Z){if(H4()){let X=R6(),q=Z.toUpperCase(),Q=a0(X).toUpperCase(),J=q.includes(Q),z=q.includes(Q),Y=cq.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(J||z||Y)&&!X.startsWith("http"))Z=((K,V)=>{if(K.endsWith("/")||K.endsWith("\\"))return K+V;else return K+"/"+V})(X,Z);Z=a0(Z)}Z=encodeURI(Z);for(let X of lq)Z=Z.replace(X[0],X[1]);return Z}function d6(Z,X){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let W=0;W<Z5.length;W+=2)Z=Z.replace(Z5[W],Z5[W+1]);let q=Z.toLowerCase().startsWith("file://");if(q){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),H4()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(X)Z="file:///"+Z;else q=!1,Z=H4()?Z:"/"+Z}if(H4()&&!q){if(Z=Z.replace(mq,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function n4(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((X)=>{return X.replace(uq,"/").replace(dq,"~")})}var mq,fq,uq,dq,cq,lq,Z5,u6=(Z)=>new URL(Z);var H0=R(()=>{Q8();mq=/\//g,fq=/^(\w{2,}):\/\//i,uq=/~1/g,dq=/~0/g,cq=/^[a-zA-Z]:[\\/]/,lq=[[/\?/g,"%3F"],[/#/g,"%23"]],Z5=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"]});function U8(){let Z={},X=this;for(let q of oq(X))if(typeof q==="string"){let W=X[q],Q=typeof W;if(!rq.includes(Q))Z[q]=W}return Z}function oq(Z,X=[]){let q=[];while(Z&&Z!==sq)q=q.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let W=new Set(q);for(let Q of X.concat(aq))W.delete(Q);return W}function g0(Z){return Z instanceof R0||Z instanceof c6}function W5(Z){if(Z.path===null)Z.path=[];return Z}var rq,aq,sq,R0,c6,_0,i4,x0,r4,a4,q5,l6;var P0=R(()=>{H0();rq=["function","symbol","undefined"],aq=["constructor","prototype","__proto__"],sq=Object.getPrototypeOf({});R0=class R0 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=U8.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};c6=class c6 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 '${d6(Z.$refs._root$Ref.path)}'`}toJSON=U8.bind(this);static getParserErrors(Z){let X=[];for(let q of Object.values(Z.$refs._$refs))if(q.errors)X.push(...q.errors);return X}get errors(){return c6.getParserErrors(this.files)}};_0=class _0 extends R0{code="EPARSER";name="ParserError";constructor(Z,X){super(`Error parsing ${X}: ${Z}`,X)}};i4=class i4 extends R0{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};x0=class x0 extends R0{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)}};r4=class r4 extends R0{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};a4=class a4 extends R0{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,X,q,W,Q){super(`Missing $ref pointer "${v0(X)}". Token "${Z}" does not exist.`,n(X));this.targetToken=Z,this.targetRef=q,this.targetFound=W,this.parentPath=Q}};q5=class q5 extends R0{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};l6=class l6 extends R0{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,X){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,n(X))}}});function U0(Z,X){let q=tq(X);return q?r(Z,q):Z}function s4(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 q=Z.openapi;return typeof q==="string"&&/^3\.1(?:\.|$)/.test(q)}function o4(Z,X,q,W,Q=!1){if(!Q)return;let J=new Set,z=(Y,U)=>{if(!Y||typeof Y!=="object"||ArrayBuffer.isView(Y)||J.has(Y))return;J.add(Y);let K=U0(U,Y);if(K!==U)Z._addAlias(K,Y,W,Q);for(let V of Object.keys(Y))z(Y[V],K)};z(q,X)}function tq(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var _6=R(()=>{H0()});class P6{$ref;path;originalPath;scopeBase;value;circular;indirections;constructor(Z,X,q){this.$ref=Z,this.path=X,this.originalPath=q||X,this.scopeBase=Z.path||n(X),this.value=void 0,this.circular=!1,this.indirections=0}resolve(Z,X,q){let W=P6.parse(this.path,this.originalPath),Q=[];if(this.value=V8(Z),this.$ref.dynamicIdScope&&!B8(this.$ref))this.scopeBase=U0(this.scopeBase,this.value);for(let z=0;z<W.length;z++){let Y=this.circular,U=d.isExtended$Ref(this.value);if(t4(this,X,q))this.path=P6.join(this.path,W.slice(z));else if(!Y&&this.circular&&U)this.circular=!1;let K=W[z];if(this.value[K]===void 0||this.value[K]===null&&z===W.length-1){let V=!1;for(let L=W.length-1;L>z;L--){let A=W.slice(z,L+1).join("/");if(this.value[A]!==void 0){this.value=this.value[A],z=L,V=!0;break}}if(V)continue;if(K in this.value&&this.value[K]===null){this.value=e4;continue}this.value=null;let B=this.$ref.path||"",H=this.path.replace(B,""),$=P6.join("",Q),F=q?.replace(B,"");throw new a4(K,decodeURI(this.originalPath),H,$,F)}else this.value=this.value[K];if(Q.push(K),this.$ref.dynamicIdScope)this.scopeBase=U0(this.scopeBase,this.value)}let J=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(!this.value||this.value.$ref&&r(J,this.value.$ref)!==q)t4(this,X,q);return this}set(Z,X,q){let W=P6.parse(this.path),Q;if(W.length===0)return this.value=X,X;if(this.value=V8(Z),this.$ref.dynamicIdScope&&!B8(this.$ref))this.scopeBase=U0(this.scopeBase,this.value);for(let J=0;J<W.length-1;J++){if(t4(this,q),Q=W[J],this.value&&this.value[Q]!==void 0)this.value=this.value[Q];else this.value=K8(this,Q,{});if(this.$ref.dynamicIdScope)this.scopeBase=U0(this.scopeBase,this.value)}return t4(this,q),Q=W[W.length-1],K8(this,Q,X),Z}static parse(Z,X){let q=v0(Z).substring(1);if(!q)return[];let W=q.split("/");for(let Q=0;Q<W.length;Q++)W[Q]=W[Q].replace(XW,"/").replace(qW,"~");if(W[0]!=="")throw new l6(q,X===void 0?Z:X);return W.slice(1)}static join(Z,X){if(Z.indexOf("#")===-1)Z+="#";X=Array.isArray(X)?X:[X];for(let q=0;q<X.length;q++){let W=X[q];Z+="/"+W.replace(ZW,"~0").replace(eq,"~1")}return Z}}function t4(Z,X,q){if(d.isAllowed$Ref(Z.value,X)){let W=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,Q=r(W,Z.value.$ref);if(Q===Z.path&&!WW(q))Z.circular=!0;else{let J=Z.$ref.$refs._resolve(Q,Z.path,X);if(J===null)return!1;if(Z.indirections+=J.indirections+1,d.isExtended$Ref(Z.value))return Z.value=d.dereference(Z.value,J.value,X),!1;else Z.$ref=J.$ref,Z.path=J.path,Z.value=J.value,Z.scopeBase=Z.$ref.path;return!0}}return}function K8(Z,X,q){if(Z.value&&typeof Z.value==="object")if(X==="-"&&Array.isArray(Z.value))Z.value.push(q);else Z.value[X]=q;else throw new R0(`Error assigning $ref pointer "${Z.path}".
17
- Cannot set "${X}" of a non-object.`);return q}function V8(Z){if(g0(Z))throw Z;return Z}function WW(Z){return typeof Z=="string"&&P6.parse(Z).length==0}function B8(Z){return Boolean(Z.path&&Z.path in Z.$refs._aliases)}var e4,eq,ZW,XW,qW,$0;var $4=R(()=>{p6();H0();P0();_6();e4=Symbol("null"),eq=/\//g,ZW=/~/g,XW=/~1/g,qW=/~0/g;$0=P6});class F4{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:q})=>q);if("errors"in Z&&Array.isArray(Z.errors))this.errors.push(...Z.errors.map(W5).filter(({footprint:q})=>!X.includes(q)));else if(!("footprint"in Z)||!X.includes(Z.footprint))this.errors.push(W5(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,q,W){let Q=new $0(this,Z,q);try{let J=Q.resolve(this.value,X,W);if(J.value===e4)J.value=null;return J}catch(J){if(!X||!X.continueOnError||!g0(J))throw J;if(J.path===null)J.path=n4(v0(W));if(J instanceof l6)J.source=decodeURI(n(W));return this.addError(J),null}}set(Z,X){let q=new $0(this,Z);if(this.value=q.set(this.value,X),this.value===e4)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 F4.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 F4.is$Ref(Z)&&Object.keys(Z).length>1}static dereference(Z,X,q){if(X&&typeof X==="object"&&F4.isExtended$Ref(Z)){let W={};for(let J of Object.keys(Z))if(J!=="$ref")W[J]=Z[J];let Q=q?.dereference?.mergeKeys??!0;for(let J of Object.keys(X)){let z=J;if(!(z in W))W[z]=X[z];else if(Q&&typeof W[z]==="object"&&W[z]!==null&&typeof X[z]==="object"&&X[z]!==null)W[z]=H8(X[z],W[z])}return W}else return X}}function H8(Z,X){if(typeof Z!=="object"||Z===null)return X;if(typeof X!=="object"||X===null)return X;let q=Array.isArray(Z)?[...Z]:{...Z};for(let W of Object.keys(X))if(Array.isArray(X[W]))q[W]=[...X[W]];else if(typeof X[W]==="object"&&X[W]!==null)q[W]=H8(Z[W],X[W]);else q[W]=X[W];return q}var d;var p6=R(()=>{$4();P0();H0();d=F4});class A4{circular;paths(...Z){return $8(this._$refs,Z.flat()).map((q)=>{return a0(q.decoded)})}values(...Z){let X=this._$refs;return $8(X,Z.flat()).reduce((W,Q)=>{return W[a0(Q.decoded)]=X[Q.encoded].value,W},{})}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 q=r(this._root$Ref.path,Z),W=this._getRef(q);if(!W)throw Error(`Error resolving $ref pointer "${Z}".
18
- "${n(q)}" not found.`);W.set(q,X)}_get$Ref(Z){return Z=r(this._root$Ref.path,Z),this._getRef(Z)}_add(Z){let X=n(Z),q=new d(this);return q.path=X,this._$refs[X]=q,this._root$Ref=this._root$Ref||q,q}_addAlias(Z,X,q,W=!1){let Q=n(Z);if(!Q||this._$refs[Q]||this._aliases[Q])return this._$refs[Q]||this._aliases[Q];let J=new d(this);return J.path=Q,J.pathType=q,J.value=X,J.dynamicIdScope=W,this._aliases[Q]=J,J}_resolve(Z,X,q){let W=r(this._root$Ref.path,Z),Q=this._getRef(W);if(!Q)throw Error(`Error resolving $ref pointer "${Z}".
19
- "${n(W)}" not found.`);return Q.resolve(W,q,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=n(Z);return this._$refs[X]||this._aliases[X]}}function $8(Z,X){let q=Object.keys(Z);if(X=Array.isArray(X[0])?X[0]:Array.prototype.slice.call(X),X.length>0&&X[0])q=q.filter((W)=>{return X.includes(Z[W].pathType)});return q.map((W)=>{return{encoded:W,decoded:Z[W].pathType==="file"?d6(W,!0):W}})}var F8=R(()=>{p6();H0()});function Q5(Z){return Object.keys(Z||{}).filter((X)=>{return typeof Z[X]==="object"}).map((X)=>{return Z[X].name=X,Z[X]})}function J5(Z,X,q,W,Q){return Z.filter((J)=>{return!!A8(J,X,q,W,Q)})}function z5(Z){for(let X of Z)X.order=X.order||Number.MAX_SAFE_INTEGER;return Z.sort((X,q)=>{return X.order-q.order})}async function G5(Z,X,q,W){let Q,J,z=0;return new Promise((Y,U)=>{K();function K(){if(Q=Z[z++],!Q)return U(J);try{let $=A8(Q,X,q,V,W);if($&&typeof $.then==="function")$.then(B,H);else if($!==void 0)B($);else if(z===Z.length)throw Error("No promise has been returned or callback has been called.")}catch($){H($)}}function V($,F){if($)H($);else B(F)}function B($){Y({plugin:Q,result:$})}function H($){J={plugin:Q,error:$},K()}})}function A8(Z,X,q,W,Q){let J=Z[X];if(typeof J==="function")return J.apply(Z,[q,W,Q]);if(!W){if(J instanceof RegExp)return J.test(q.url);else if(typeof J==="string")return J===q.extension;else if(Array.isArray(J))return J.indexOf(q.extension)!==-1}return J}async function QW(Z,X,q){let W=typeof Z==="string"?Z:Z.url,Q=typeof Z==="string"?void 0:Z.baseUrl,J=typeof Z==="string"?void 0:Z.reference,z=W.indexOf("#"),Y="";if(z>=0)Y=W.substring(z),W=W.substring(0,z);if(J){let V=J.indexOf("#");if(V>=0)J=J.substring(0,V)}let U=X._add(W),K={url:W,hash:Y,extension:z8(W),...J!==void 0?{reference:J}:{},...Q!==void 0?{baseUrl:Q}:{}};try{let V=await JW(K,q,X);U.pathType=V.plugin.name,K.data=V.result;let B=await zW(K,q,X);return U.value=B.result,U.dynamicIdScope=s4(U.value),o4(X,U.path,U.value,U.pathType,U.dynamicIdScope),B.result}catch(V){if(g0(V))U.value=V;throw V}}async function JW(Z,X,q){let W=Q5(X.resolve);W=J5(W,"canRead",Z,void 0,q),z5(W);try{return await G5(W,"read",Z,q)}catch(Q){if(!Q&&X.continueOnError)throw new r4(Z.url);else if(!Q||!("error"in Q))throw SyntaxError(`Unable to resolve $ref pointer "${Z.url}"`,{cause:Q});else if(Q.error instanceof x0)throw Q.error;else throw new x0(Q,Z.url)}}async function zW(Z,X,q){let W=Q5(X.parse),Q=J5(W,"canParse",Z),J=Q.length>0?Q:W;z5(J);try{let z=await G5(J,"parse",Z,q);if(!z.plugin.allowEmpty&&GW(z.result))throw SyntaxError(`Error parsing "${Z.url}" as ${z.plugin.name}.
20
- Parsed value is empty`);else return z}catch(z){if(!z&&X.continueOnError)throw new i4(Z.url);else if(z&&z.message&&z.message.startsWith("Error parsing"))throw z;else if(!z||!("error"in z))throw SyntaxError(`Unable to parse ${Z.url}`,{cause:z});else if(z.error instanceof _0)throw z.error;else throw new _0(z.error.message,Z.url)}}function GW(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 Z1;var Y5=R(()=>{H0();_6();P0();Z1=QW});var M8;var L8=R(()=>{P0();M8={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(q){if(this.allowBOM)try{let W=X.indexOf("{");return X=X.slice(W),JSON.parse(X)}catch(W){throw new _0(W.message,Z.url)}throw new _0(q.message,Z.url)}else return X}}});function b8(Z){return typeof Z>"u"||Z===null}function YW(Z){return typeof Z==="object"&&Z!==null}function UW(Z){if(Array.isArray(Z))return Z;else if(b8(Z))return[];return[Z]}function KW(Z,X){var q,W,Q,J;if(X){J=Object.keys(X);for(q=0,W=J.length;q<W;q+=1)Q=J[q],Z[Q]=X[Q]}return Z}function VW(Z,X){var q="",W;for(W=0;W<X;W+=1)q+=Z;return q}function BW(Z){return Z===0&&Number.NEGATIVE_INFINITY===1/Z}function v8(Z,X){var q="",W=Z.reason||"(unknown reason)";if(!Z.mark)return W;if(Z.mark.name)q+='in "'+Z.mark.name+'" ';if(q+="("+(Z.mark.line+1)+":"+(Z.mark.column+1)+")",!X&&Z.mark.snippet)q+=`
16
+ `:""}var z6="https://esm.sh/@vue/reactivity@3.5.32",Y6="https://esm.sh/lit-html@3.3.0",_X;var S1=d(()=>{y6();N4();e0();y6();N4();e0();_X=new Set(["input","br","hr","img","meta","link","area","col","source"])});function I1(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var jX,g6=()=>jX;var _8=d(()=>{jX=/^win/.test(globalThis.process?globalThis.process.platform:"")});function A0(Z,W){let X=new URL(I1(Z),"https://aaa.nonexistanturl.com"),Q=new URL(I1(W),X),J=W.match(/(\s*)$/)?.[1]||"";if(Q.hostname==="aaa.nonexistanturl.com"){let{pathname:z,search:q,hash:K}=Q;return z+q+decodeURIComponent(K)+J}let G=Q.toString()+J;if(G.includes("#")){let[z,q]=G.split("#",2);return z+"#"+decodeURIComponent(q||"")}return G}function p1(){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(),W=Z.slice(-1);if(W==="/"||W==="\\")return Z;else return Z+"/"}return"/"}function E8(Z){let W=CX.exec(Z||"");if(W)return W[1].toLowerCase();return}function C8(Z){let W=Z.lastIndexOf(".");if(W>=0)return vX(Z.substring(W).toLowerCase());return""}function vX(Z){let W=Z.indexOf("?");if(W>=0)Z=Z.substring(0,W);return Z}function Z1(Z){if(!Z)return"#";let W=Z.indexOf("#");if(W>=0)return Z.substring(W);return"#"}function L0(Z){if(!Z)return"";let W=Z.indexOf("#");if(W>=0)Z=Z.substring(0,W);return Z}function O8(Z){let W=E8(Z);if(W==="http"||W==="https")return!0;else if(W===void 0)return typeof window<"u";else return!1}function _4(Z){if(!Z||typeof Z!=="string")return!0;let W=Z.trim().toLowerCase();if(!W)return!0;if(W.startsWith("javascript:")||W.startsWith("vbscript:")||W.startsWith("data:"))return!0;if(W.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;try{let X=new URL(W.startsWith("//")?"http:"+W:W);if(x8(X.hostname))return!0;let Q=X.port;if(Q&&uX(parseInt(Q)))return!0}catch{if(W.startsWith("/")&&!W.startsWith("//"))return!1;if(mX(W))return!0}return!1}function x8(Z){let W=yX(Z);if(!W)return!0;if(W==="localhost"||bX.some((J)=>W.endsWith(J)))return!0;let X=k8(W);if(X)return S8(X);let Q=gX(W);if(Q)return hX(Q);return!1}function yX(Z){let W=Z.trim().toLowerCase();if(W.startsWith("[")&&W.endsWith("]"))W=W.slice(1,-1);while(W.endsWith("."))W=W.slice(0,-1);return W}function k8(Z){let W=Z.split(".");if(W.length!==4)return;let X=W.map((Q)=>{if(!/^\d+$/.test(Q))return Number.NaN;return Number(Q)});if(X.some((Q)=>!Number.isInteger(Q)||Q<0||Q>255))return;return X}function S8([Z,W,X,Q]){return Z===0||Z===10||Z===127||Z===100&&W>=64&&W<=127||Z===169&&W===254||Z===172&&W>=16&&W<=31||Z===192&&W===0&&X===0||Z===192&&W===168||Z===198&&(W===18||W===19)||Z>=224||Z===255&&W===255&&X===255&&Q===255}function gX(Z){if(!Z.includes(":"))return;let W=Z,X=W.lastIndexOf(":"),Q=W.slice(X+1);if(Q.includes(".")){let K=k8(Q);if(!K)return;let V=K[0]*256+K[1],H=K[2]*256+K[3];W=`${W.slice(0,X+1)}${V.toString(16)}:${H.toString(16)}`}let J=W.split("::");if(J.length>2)return;let G=j8(J[0]),z=J.length===2?j8(J[1]):[];if(!G||!z)return;if(J.length===1)return G.length===8?G:void 0;let q=8-G.length-z.length;if(q<1)return;return[...G,...Array(q).fill(0),...z]}function j8(Z){if(!Z)return[];let W=Z.split(":").map((X)=>{if(!/^[\da-f]{1,4}$/i.test(X))return Number.NaN;return Number.parseInt(X,16)});if(W.some((X)=>!Number.isInteger(X)||X<0||X>65535))return;return W}function hX(Z){if(Z.length!==8)return!1;let W=Z.every((q)=>q===0),X=Z.slice(0,7).every((q)=>q===0)&&Z[7]===1,Q=(Z[0]&65024)===64512,J=(Z[0]&65472)===65152,G=(Z[0]&65280)===65280;if(W||X||Q||J||G)return!0;let z=fX(Z);return z?S8(z):!1}function fX(Z){let W=Z.slice(0,5).every((J)=>J===0),X=W&&Z[5]===0,Q=W&&Z[5]===65535;if(!X&&!Q)return;return[Math.floor(Z[6]/256),Z[6]%256,Math.floor(Z[7]/256),Z[7]%256]}function mX(Z){return Z.split(/[\s/?#]+/).map((X)=>X.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((X)=>x8(X))}function uX(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 j4(Z){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let W=E8(Z);return W===void 0||W==="file"}function b8(Z){if(g6()){let W=p1(),X=Z.toUpperCase(),J=I1(W).toUpperCase(),G=X.includes(J),z=X.includes(J),q=kX.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(G||z||q)&&!W.startsWith("http"))Z=((V,H)=>{if(V.endsWith("/")||V.endsWith("\\"))return V+H;else return V+"/"+H})(W,Z);Z=I1(Z)}Z=encodeURI(Z);for(let W of SX)Z=Z.replace(W[0],W[1]);return Z}function B6(Z,W){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let Q=0;Q<k2.length;Q+=2)Z=Z.replace(k2[Q],k2[Q+1]);let X=Z.toLowerCase().startsWith("file://");if(X){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),g6()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(W)Z="file:///"+Z;else X=!1,Z=g6()?Z:"/"+Z}if(g6()&&!X){if(Z=Z.replace(EX,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function E4(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((W)=>{return W.replace(OX,"/").replace(xX,"~")})}var EX,CX,OX,xX,kX,SX,k2,bX,V6=(Z)=>new URL(Z);var S0=d(()=>{_8();EX=/\//g,CX=/^(\w{2,}):\/\//i,OX=/~1/g,xX=/~0/g,kX=/^[a-zA-Z]:[\\/]/,SX=[[/\?/g,"%3F"],[/#/g,"%23"]],k2=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],bX=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function v8(){let Z={},W=this;for(let X of pX(W))if(typeof X==="string"){let Q=W[X],J=typeof Q;if(!dX.includes(J))Z[X]=Q}return Z}function pX(Z,W=[]){let X=[];while(Z&&Z!==lX)X=X.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let Q=new Set(X);for(let J of W.concat(cX))Q.delete(J);return Q}function X1(Z){return Z instanceof f0||Z instanceof H6}function b2(Z){if(Z.path===null)Z.path=[];return Z}var dX,cX,lX,f0,H6,l0,C4,o0,O4,x4,S2,$6;var p0=d(()=>{S0();dX=["function","symbol","undefined"],cX=["constructor","prototype","__proto__"],lX=Object.getPrototypeOf({});f0=class f0 extends Error{name;message;source;path;code;constructor(Z,W){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=Z,this.source=W,this.path=null}toJSON=v8.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};H6=class H6 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 '${B6(Z.$refs._root$Ref.path)}'`}toJSON=v8.bind(this);static getParserErrors(Z){let W=[];for(let X of Object.values(Z.$refs._$refs))if(X.errors)W.push(...X.errors);return W}get errors(){return H6.getParserErrors(this.files)}};l0=class l0 extends f0{code="EPARSER";name="ParserError";constructor(Z,W){super(`Error parsing ${W}: ${Z}`,W)}};C4=class C4 extends f0{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};o0=class o0 extends f0{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(Z,W){super(Z.message||`Error reading file "${W}"`,W);if("code"in Z)this.ioErrorCode=String(Z.code)}};O4=class O4 extends f0{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};x4=class x4 extends f0{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,W,X,Q,J){super(`Missing $ref pointer "${Z1(W)}". Token "${Z}" does not exist.`,L0(W));this.targetToken=Z,this.targetRef=X,this.targetFound=Q,this.parentPath=J}};S2=class S2 extends f0{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};$6=class $6 extends f0{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,W){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,L0(W))}}});function C0(Z,W){let X=nX(W);return X?A0(Z,X):Z}function k4(Z){if(!Z||typeof Z!=="object"||ArrayBuffer.isView(Z))return!1;let W=Z.$schema;if(typeof W==="string"&&(W.includes("draft/2019-09/")||W.includes("draft/2020-12/")||W.includes("oas/3.1/")))return!0;let X=Z.openapi;return typeof X==="string"&&/^3\.1(?:\.|$)/.test(X)}function S4(Z,W,X,Q,J=!1){if(!J)return;let G=new Set,z=(q,K)=>{if(!q||typeof q!=="object"||ArrayBuffer.isView(q)||G.has(q))return;G.add(q);let V=C0(K,q);if(V!==K)Z._addAlias(V,q,Q,J);for(let H of Object.keys(q))z(q[H],V)};z(X,W)}function nX(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var n1=d(()=>{S0()});class i1{$ref;path;originalPath;scopeBase;value;circular;indirections;constructor(Z,W,X){this.$ref=Z,this.path=W,this.originalPath=X||W,this.scopeBase=Z.path||L0(W),this.value=void 0,this.circular=!1,this.indirections=0}resolve(Z,W,X){let Q=i1.parse(this.path,this.originalPath),J=[];if(this.value=g8(Z),this.$ref.dynamicIdScope&&!h8(this.$ref))this.scopeBase=C0(this.scopeBase,this.value);for(let z=0;z<Q.length;z++){let q=this.circular,K=B0.isExtended$Ref(this.value);if(b4(this,W,X))this.path=i1.join(this.path,Q.slice(z));else if(!q&&this.circular&&K)this.circular=!1;let V=Q[z];if(this.value[V]===void 0||this.value[V]===null&&z===Q.length-1){let H=!1;for(let j=Q.length-1;j>z;j--){let D=Q.slice(z,j+1).join("/");if(this.value[D]!==void 0){this.value=this.value[D],z=j,H=!0;break}}if(H)continue;if(V in this.value&&this.value[V]===null){this.value=v4;continue}this.value=null;let B=this.$ref.path||"",$=this.path.replace(B,""),L=i1.join("",J),A=X?.replace(B,"");throw new x4(V,decodeURI(this.originalPath),$,L,A)}else this.value=this.value[V];if(J.push(V),this.$ref.dynamicIdScope)this.scopeBase=C0(this.scopeBase,this.value)}let G=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(!this.value||this.value.$ref&&A0(G,this.value.$ref)!==X)b4(this,W,X);return this}set(Z,W,X){let Q=i1.parse(this.path),J;if(Q.length===0)return this.value=W,W;if(tX(this.path,Q),this.value=g8(Z),this.$ref.dynamicIdScope&&!h8(this.$ref))this.scopeBase=C0(this.scopeBase,this.value);for(let G=0;G<Q.length-1;G++){if(b4(this,X),J=Q[G],this.value&&this.value[J]!==void 0)this.value=this.value[J];else this.value=y8(this,J,{});if(this.$ref.dynamicIdScope)this.scopeBase=C0(this.scopeBase,this.value)}return b4(this,X),J=Q[Q.length-1],y8(this,J,W),Z}static parse(Z,W){let X=Z1(Z).substring(1);if(!X)return[];let Q=X.split("/");for(let J=0;J<Q.length;J++)Q[J]=Q[J].replace(aX,"/").replace(sX,"~");if(Q[0]!=="")throw new $6(X,W===void 0?Z:W);return Q.slice(1)}static join(Z,W){if(Z.indexOf("#")===-1)Z+="#";W=Array.isArray(W)?W:[W];for(let X=0;X<W.length;X++){let Q=W[X];Z+="/"+Q.replace(rX,"~0").replace(iX,"~1")}return Z}}function b4(Z,W,X){if(B0.isAllowed$Ref(Z.value,W)){let Q=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,J=A0(Q,Z.value.$ref);if(J===Z.path&&!eX(X))Z.circular=!0;else{let G=Z.$ref.$refs._resolve(J,Z.path,W);if(G===null)return!1;if(Z.indirections+=G.indirections+1,B0.isExtended$Ref(Z.value))return Z.value=B0.dereference(Z.value,G.value,W),!1;else Z.$ref=G.$ref,Z.path=G.path,Z.value=G.value,Z.scopeBase=Z.$ref.path;return!0}}return}function y8(Z,W,X){if(Z.value&&typeof Z.value==="object")if(W==="-"&&Array.isArray(Z.value))Z.value.push(X);else Z.value[W]=X;else throw new f0(`Error assigning $ref pointer "${Z.path}".
17
+ Cannot set "${W}" of a non-object.`);return X}function tX(Z,W){for(let X of W)if(oX.has(X))throw new f0(`Error assigning $ref pointer "${Z}".
18
+ Unsafe JSON Pointer token "${X}" cannot be used for assignment.`)}function g8(Z){if(X1(Z))throw Z;return Z}function eX(Z){return typeof Z=="string"&&i1.parse(Z).length==0}function h8(Z){return Boolean(Z.path&&Z.path in Z.$refs._aliases)}var v4,iX,rX,aX,sX,oX,b0;var h6=d(()=>{F6();S0();p0();n1();v4=Symbol("null"),iX=/\//g,rX=/~/g,aX=/~1/g,sX=/~0/g,oX=new Set(["__proto__","constructor","prototype"]);b0=i1});class f6{path;value;$refs;pathType;dynamicIdScope=!1;errors=[];constructor(Z){this.$refs=Z}addError(Z){if(this.errors===void 0)this.errors=[];let W=this.errors.map(({footprint:X})=>X);if("errors"in Z&&Array.isArray(Z.errors))this.errors.push(...Z.errors.map(b2).filter(({footprint:X})=>!W.includes(X)));else if(!("footprint"in Z)||!W.includes(Z.footprint))this.errors.push(b2(Z))}exists(Z,W){try{return this.resolve(Z,W),!0}catch{return!1}}get(Z,W){return this.resolve(Z,W)?.value}resolve(Z,W,X,Q){let J=new b0(this,Z,X);try{let G=J.resolve(this.value,W,Q);if(G.value===v4)G.value=null;return G}catch(G){if(!W||!W.continueOnError||!X1(G))throw G;if(G.path===null)G.path=E4(Z1(Q));if(G instanceof $6)G.source=decodeURI(L0(Q));return this.addError(G),null}}set(Z,W){let X=new b0(this,Z);if(this.value=X.set(this.value,W),this.value===v4)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 f6.is$Ref(Z)&&Z.$ref[0]!=="#"}static isAllowed$Ref(Z,W){if(this.is$Ref(Z)){if(Z.$ref.substring(0,2)==="#/"||Z.$ref==="#")return!0;else if(Z.$ref[0]!=="#"&&(!W||W.resolve?.external))return!0}return}static isExtended$Ref(Z){return f6.is$Ref(Z)&&Object.keys(Z).length>1}static dereference(Z,W,X){if(W&&typeof W==="object"&&f6.isExtended$Ref(Z)){let Q={};for(let G of Object.keys(Z))if(G!=="$ref")Q[G]=Z[G];let J=X?.dereference?.mergeKeys??!0;for(let G of Object.keys(W)){let z=G;if(!(z in Q))Q[z]=W[z];else if(J&&typeof Q[z]==="object"&&Q[z]!==null&&typeof W[z]==="object"&&W[z]!==null)Q[z]=f8(W[z],Q[z])}return Q}else return W}}function f8(Z,W){if(typeof Z!=="object"||Z===null)return W;if(typeof W!=="object"||W===null)return W;let X=Array.isArray(Z)?[...Z]:{...Z};for(let Q of Object.keys(W))if(Array.isArray(W[Q]))X[Q]=[...W[Q]];else if(typeof W[Q]==="object"&&W[Q]!==null)X[Q]=f8(Z[Q],W[Q]);else X[Q]=W[Q];return X}var B0;var F6=d(()=>{h6();p0();S0();B0=f6});class m6{circular;paths(...Z){return m8(this._$refs,Z.flat()).map((X)=>{return I1(X.decoded)})}values(...Z){let W=this._$refs;return m8(W,Z.flat()).reduce((Q,J)=>{return Q[I1(J.decoded)]=W[J.encoded].value,Q},{})}exists(Z,W){try{return this._resolve(Z,"",W),!0}catch{return!1}}get(Z,W){return this._resolve(Z,"",W).value}set(Z,W){let X=A0(this._root$Ref.path,Z),Q=this._getRef(X);if(!Q)throw Error(`Error resolving $ref pointer "${Z}".
19
+ "${L0(X)}" not found.`);Q.set(X,W)}_get$Ref(Z){return Z=A0(this._root$Ref.path,Z),this._getRef(Z)}_add(Z){let W=L0(Z),X=new B0(this);return X.path=W,this._$refs[W]=X,this._root$Ref=this._root$Ref||X,X}_addAlias(Z,W,X,Q=!1){let J=L0(Z);if(!J||this._$refs[J]||this._aliases[J])return this._$refs[J]||this._aliases[J];let G=new B0(this);return G.path=J,G.pathType=X,G.value=W,G.dynamicIdScope=Q,this._aliases[J]=G,G}_resolve(Z,W,X){let Q=A0(this._root$Ref.path,Z),J=this._getRef(Q);if(!J)throw Error(`Error resolving $ref pointer "${Z}".
20
+ "${L0(Q)}" not found.`);return J.resolve(Q,X,Z,W)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=this.values;_getRef(Z){let W=L0(Z);return this._$refs[W]||this._aliases[W]}}function m8(Z,W){let X=Object.keys(Z);if(W=Array.isArray(W[0])?W[0]:Array.prototype.slice.call(W),W.length>0&&W[0])X=X.filter((Q)=>{return W.includes(Z[Q].pathType)});return X.map((Q)=>{return{encoded:Q,decoded:Z[Q].pathType==="file"?B6(Q,!0):Q}})}var u8=d(()=>{F6();S0()});function v2(Z){return Object.keys(Z||{}).filter((W)=>{return typeof Z[W]==="object"}).map((W)=>{return Z[W].name=W,Z[W]})}function y2(Z,W,X,Q,J){return Z.filter((G)=>{return!!d8(G,W,X,Q,J)})}function g2(Z){for(let W of Z)W.order=W.order||Number.MAX_SAFE_INTEGER;return Z.sort((W,X)=>{return W.order-X.order})}async function h2(Z,W,X,Q){let J,G,z=0;return new Promise((q,K)=>{V();function V(){if(J=Z[z++],!J)return K(G);try{let L=d8(J,W,X,H,Q);if(L&&typeof L.then==="function")L.then(B,$);else if(L!==void 0)B(L);else if(z===Z.length)throw Error("No promise has been returned or callback has been called.")}catch(L){$(L)}}function H(L,A){if(L)$(L);else B(A)}function B(L){q({plugin:J,result:L})}function $(L){G={plugin:J,error:L},V()}})}function d8(Z,W,X,Q,J){let G=Z[W];if(typeof G==="function")return G.apply(Z,[X,Q,J]);if(!Q){if(G instanceof RegExp)return G.test(X.url);else if(typeof G==="string")return G===X.extension;else if(Array.isArray(G))return G.indexOf(X.extension)!==-1}return G}async function ZQ(Z,W,X){let Q=typeof Z==="string"?Z:Z.url,J=typeof Z==="string"?void 0:Z.baseUrl,G=typeof Z==="string"?void 0:Z.reference,z=Q.indexOf("#"),q="";if(z>=0)q=Q.substring(z),Q=Q.substring(0,z);if(G){let H=G.indexOf("#");if(H>=0)G=G.substring(0,H)}let K=W._add(Q),V={url:Q,hash:q,extension:C8(Q),...G!==void 0?{reference:G}:{},...J!==void 0?{baseUrl:J}:{}};try{let H=await WQ(V,X,W);K.pathType=H.plugin.name,V.data=H.result;let B=await XQ(V,X,W);return K.value=B.result,K.dynamicIdScope=k4(K.value),S4(W,K.path,K.value,K.pathType,K.dynamicIdScope),B.result}catch(H){if(X1(H))K.value=H;throw H}}async function WQ(Z,W,X){let Q=v2(W.resolve);Q=y2(Q,"canRead",Z,void 0,X),g2(Q);try{return await h2(Q,"read",Z,X)}catch(J){if(!J&&W.continueOnError)throw new O4(Z.url);else if(!J||!("error"in J))throw SyntaxError(`Unable to resolve $ref pointer "${Z.url}"`,{cause:J});else if(J.error instanceof o0)throw J.error;else throw new o0(J,Z.url)}}async function XQ(Z,W,X){let Q=v2(W.parse),J=y2(Q,"canParse",Z),G=J.length>0?J:Q;g2(G);try{let z=await h2(G,"parse",Z,X);if(!z.plugin.allowEmpty&&QQ(z.result))throw SyntaxError(`Error parsing "${Z.url}" as ${z.plugin.name}.
21
+ Parsed value is empty`);else return z}catch(z){if(!z&&W.continueOnError)throw new C4(Z.url);else if(z&&z.message&&z.message.startsWith("Error parsing"))throw z;else if(!z||!("error"in z))throw SyntaxError(`Unable to parse ${Z.url}`,{cause:z});else if(z.error instanceof l0)throw z.error;else throw new l0(z.error.message,Z.url)}}function QQ(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 y4;var f2=d(()=>{S0();n1();p0();y4=ZQ});var c8;var l8=d(()=>{p0();c8={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(Z){let W=Z.data;if(Buffer.isBuffer(W))W=W.toString();if(typeof W==="string")if(W.trim().length===0)return;else try{return JSON.parse(W)}catch(X){if(this.allowBOM)try{let Q=W.indexOf("{");return W=W.slice(Q),JSON.parse(W)}catch(Q){throw new l0(Q.message,Z.url)}throw new l0(X.message,Z.url)}else return W}}});var JQ,p8,GQ,zQ,YQ,UQ,G0=(Z,W)=>()=>(W||(Z((W={exports:{}}).exports,W),Z=null),W.exports),qQ=(Z,W,X,Q)=>{if(W&&typeof W==="object"||typeof W==="function"){for(var J=zQ(W),G=0,z=J.length,q;G<z;G++)if(q=J[G],!UQ.call(Z,q)&&q!==X)p8(Z,q,{get:((K)=>W[K]).bind(null,q),enumerable:!(Q=GQ(W,q))||Q.enumerable})}return Z},KQ=(Z,W,X)=>(X=Z!=null?JQ(YQ(Z)):{},qQ(W||!Z||!Z.__esModule?p8(X,"default",{value:Z,enumerable:!0}):X,Z)),u6,d6,VQ,O0,n8,i8,r8,a8,s8,o8,t8,e8,Z9,W9,X9,Q9,J9,G9,z9,Y9,U9,m2,BQ,HQ,q9,QB,JB,GB,K9,zB,YB,UB,qB,KB,VB,BB,HB,$B,FB,u2;var d2=d(()=>{/*! js-yaml 4.2.0 https://github.com/nodeca/js-yaml @license MIT */JQ=Object.create,p8=Object.defineProperty,GQ=Object.getOwnPropertyDescriptor,zQ=Object.getOwnPropertyNames,YQ=Object.getPrototypeOf,UQ=Object.prototype.hasOwnProperty,u6=G0((Z,W)=>{function X(K){return typeof K>"u"||K===null}function Q(K){return typeof K==="object"&&K!==null}function J(K){if(Array.isArray(K))return K;else if(X(K))return[];return[K]}function G(K,V){if(V){let H=Object.keys(V);for(let B=0,$=H.length;B<$;B+=1){let L=H[B];K[L]=V[L]}}return K}function z(K,V){let H="";for(let B=0;B<V;B+=1)H+=K;return H}function q(K){return K===0&&Number.NEGATIVE_INFINITY===1/K}W.exports.isNothing=X,W.exports.isObject=Q,W.exports.toArray=J,W.exports.repeat=z,W.exports.isNegativeZero=q,W.exports.extend=G}),d6=G0((Z,W)=>{function X(J,G){let z="",q=J.reason||"(unknown reason)";if(!J.mark)return q;if(J.mark.name)z+='in "'+J.mark.name+'" ';if(z+="("+(J.mark.line+1)+":"+(J.mark.column+1)+")",!G&&J.mark.snippet)z+=`
21
22
 
22
- `+Z.mark.snippet;return W+" "+q}function L4(Z,X){if(Error.call(this),this.name="YAMLException",this.reason=Z,this.mark=X,this.message=v8(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}function U5(Z,X,q,W,Q){var J="",z="",Y=Math.floor(Q/2)-1;if(W-X>Y)J=" ... ",X=W-Y+J.length;if(q-W>Y)z=" ...",q=W+Y-z.length;return{str:J+Z.slice(X,q).replace(/\t/g,"→")+z,pos:W-X+J.length}}function K5(Z,X){return a.repeat(" ",X-Z.length)+Z}function IW(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 q=/\r?\n|\r|\0/g,W=[0],Q=[],J,z=-1;while(J=q.exec(Z.buffer))if(Q.push(J.index),W.push(J.index+J[0].length),Z.position<=J.index&&z<0)z=W.length-2;if(z<0)z=W.length-1;var Y="",U,K,V=Math.min(Z.line+X.linesAfter,Q.length).toString().length,B=X.maxLength-(X.indent+V+3);for(U=1;U<=X.linesBefore;U++){if(z-U<0)break;K=U5(Z.buffer,W[z-U],Q[z-U],Z.position-(W[z]-W[z-U]),B),Y=a.repeat(" ",X.indent)+K5((Z.line-U+1).toString(),V)+" | "+K.str+`
23
- `+Y}K=U5(Z.buffer,W[z],Q[z],Z.position,B),Y+=a.repeat(" ",X.indent)+K5((Z.line+1).toString(),V)+" | "+K.str+`
24
- `,Y+=a.repeat("-",X.indent+V+3+K.pos)+`^
25
- `;for(U=1;U<=X.linesAfter;U++){if(z+U>=Q.length)break;K=U5(Z.buffer,W[z+U],Q[z+U],Z.position-(W[z]-W[z+U]),B),Y+=a.repeat(" ",X.indent)+K5((Z.line+U+1).toString(),V)+" | "+K.str+`
26
- `}return Y.replace(/\n$/,"")}function TW(Z){var X={};if(Z!==null)Object.keys(Z).forEach(function(q){Z[q].forEach(function(W){X[String(W)]=q})});return X}function RW(Z,X){if(X=X||{},Object.keys(X).forEach(function(q){if(DW.indexOf(q)===-1)throw new K0('Unknown option "'+q+'" is met in definition of "'+Z+'" YAML type.')}),this.options=X,this.tag=Z,this.kind=X.kind||null,this.resolve=X.resolve||function(){return!0},this.construct=X.construct||function(q){return q},this.instanceOf=X.instanceOf||null,this.predicate=X.predicate||null,this.represent=X.represent||null,this.representName=X.representName||null,this.defaultStyle=X.defaultStyle||null,this.multi=X.multi||!1,this.styleAliases=TW(X.styleAliases||null),NW.indexOf(this.kind)===-1)throw new K0('Unknown kind "'+this.kind+'" is specified for "'+Z+'" YAML type.')}function I8(Z,X){var q=[];return Z[X].forEach(function(W){var Q=q.length;q.forEach(function(J,z){if(J.tag===W.tag&&J.kind===W.kind&&J.multi===W.multi)Q=z}),q[Q]=W}),q}function _W(){var Z={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},X,q;function W(Q){if(Q.multi)Z.multi[Q.kind].push(Q),Z.multi.fallback.push(Q);else Z[Q.kind][Q.tag]=Z.fallback[Q.tag]=Q}for(X=0,q=arguments.length;X<q;X+=1)arguments[X].forEach(W);return Z}function B5(Z){return this.extend(Z)}function PW(Z){if(Z===null)return!0;var X=Z.length;return X===1&&Z==="~"||X===4&&(Z==="null"||Z==="Null"||Z==="NULL")}function jW(){return null}function EW(Z){return Z===null}function CW(Z){if(Z===null)return!1;var X=Z.length;return X===4&&(Z==="true"||Z==="True"||Z==="TRUE")||X===5&&(Z==="false"||Z==="False"||Z==="FALSE")}function OW(Z){return Z==="true"||Z==="True"||Z==="TRUE"}function xW(Z){return Object.prototype.toString.call(Z)==="[object Boolean]"}function kW(Z){return 48<=Z&&Z<=57||65<=Z&&Z<=70||97<=Z&&Z<=102}function SW(Z){return 48<=Z&&Z<=55}function bW(Z){return 48<=Z&&Z<=57}function vW(Z){if(Z===null)return!1;var X=Z.length,q=0,W=!1,Q;if(!X)return!1;if(Q=Z[q],Q==="-"||Q==="+")Q=Z[++q];if(Q==="0"){if(q+1===X)return!0;if(Q=Z[++q],Q==="b"){q++;for(;q<X;q++){if(Q=Z[q],Q==="_")continue;if(Q!=="0"&&Q!=="1")return!1;W=!0}return W&&Q!=="_"}if(Q==="x"){q++;for(;q<X;q++){if(Q=Z[q],Q==="_")continue;if(!kW(Z.charCodeAt(q)))return!1;W=!0}return W&&Q!=="_"}if(Q==="o"){q++;for(;q<X;q++){if(Q=Z[q],Q==="_")continue;if(!SW(Z.charCodeAt(q)))return!1;W=!0}return W&&Q!=="_"}}if(Q==="_")return!1;for(;q<X;q++){if(Q=Z[q],Q==="_")continue;if(!bW(Z.charCodeAt(q)))return!1;W=!0}if(!W||Q==="_")return!1;return!0}function yW(Z){var X=Z,q=1,W;if(X.indexOf("_")!==-1)X=X.replace(/_/g,"");if(W=X[0],W==="-"||W==="+"){if(W==="-")q=-1;X=X.slice(1),W=X[0]}if(X==="0")return 0;if(W==="0"){if(X[1]==="b")return q*parseInt(X.slice(2),2);if(X[1]==="x")return q*parseInt(X.slice(2),16);if(X[1]==="o")return q*parseInt(X.slice(2),8)}return q*parseInt(X,10)}function gW(Z){return Object.prototype.toString.call(Z)==="[object Number]"&&(Z%1===0&&!a.isNegativeZero(Z))}function mW(Z){if(Z===null)return!1;if(!hW.test(Z)||Z[Z.length-1]==="_")return!1;return!0}function fW(Z){var X,q;if(X=Z.replace(/_/g,"").toLowerCase(),q=X[0]==="-"?-1:1,"+-".indexOf(X[0])>=0)X=X.slice(1);if(X===".inf")return q===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(X===".nan")return NaN;return q*parseFloat(X,10)}function dW(Z,X){var q;if(isNaN(Z))switch(X){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===Z)switch(X){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===Z)switch(X){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(a.isNegativeZero(Z))return"-0.0";return q=Z.toString(10),uW.test(q)?q.replace("e",".e"):q}function cW(Z){return Object.prototype.toString.call(Z)==="[object Number]"&&(Z%1!==0||a.isNegativeZero(Z))}function lW(Z){if(Z===null)return!1;if(i8.exec(Z)!==null)return!0;if(r8.exec(Z)!==null)return!0;return!1}function pW(Z){var X,q,W,Q,J,z,Y,U=0,K=null,V,B,H;if(X=i8.exec(Z),X===null)X=r8.exec(Z);if(X===null)throw Error("Date resolve error");if(q=+X[1],W=+X[2]-1,Q=+X[3],!X[4])return new Date(Date.UTC(q,W,Q));if(J=+X[4],z=+X[5],Y=+X[6],X[7]){U=X[7].slice(0,3);while(U.length<3)U+="0";U=+U}if(X[9]){if(V=+X[10],B=+(X[11]||0),K=(V*60+B)*60000,X[9]==="-")K=-K}if(H=new Date(Date.UTC(q,W,Q,J,z,Y,U)),K)H.setTime(H.getTime()-K);return H}function nW(Z){return Z.toISOString()}function iW(Z){return Z==="<<"||Z===null}function rW(Z){if(Z===null)return!1;var X,q,W=0,Q=Z.length,J=M5;for(q=0;q<Q;q++){if(X=J.indexOf(Z.charAt(q)),X>64)continue;if(X<0)return!1;W+=6}return W%8===0}function aW(Z){var X,q,W=Z.replace(/[\r\n=]/g,""),Q=W.length,J=M5,z=0,Y=[];for(X=0;X<Q;X++){if(X%4===0&&X)Y.push(z>>16&255),Y.push(z>>8&255),Y.push(z&255);z=z<<6|J.indexOf(W.charAt(X))}if(q=Q%4*6,q===0)Y.push(z>>16&255),Y.push(z>>8&255),Y.push(z&255);else if(q===18)Y.push(z>>10&255),Y.push(z>>2&255);else if(q===12)Y.push(z>>4&255);return new Uint8Array(Y)}function sW(Z){var X="",q=0,W,Q,J=Z.length,z=M5;for(W=0;W<J;W++){if(W%3===0&&W)X+=z[q>>18&63],X+=z[q>>12&63],X+=z[q>>6&63],X+=z[q&63];q=(q<<8)+Z[W]}if(Q=J%3,Q===0)X+=z[q>>18&63],X+=z[q>>12&63],X+=z[q>>6&63],X+=z[q&63];else if(Q===2)X+=z[q>>10&63],X+=z[q>>4&63],X+=z[q<<2&63],X+=z[64];else if(Q===1)X+=z[q>>2&63],X+=z[q<<4&63],X+=z[64],X+=z[64];return X}function oW(Z){return Object.prototype.toString.call(Z)==="[object Uint8Array]"}function ZQ(Z){if(Z===null)return!0;var X=[],q,W,Q,J,z,Y=Z;for(q=0,W=Y.length;q<W;q+=1){if(Q=Y[q],z=!1,eW.call(Q)!=="[object Object]")return!1;for(J in Q)if(tW.call(Q,J))if(!z)z=!0;else return!1;if(!z)return!1;if(X.indexOf(J)===-1)X.push(J);else return!1}return!0}function XQ(Z){return Z!==null?Z:[]}function WQ(Z){if(Z===null)return!0;var X,q,W,Q,J,z=Z;J=Array(z.length);for(X=0,q=z.length;X<q;X+=1){if(W=z[X],qQ.call(W)!=="[object Object]")return!1;if(Q=Object.keys(W),Q.length!==1)return!1;J[X]=[Q[0],W[Q[0]]]}return!0}function QQ(Z){if(Z===null)return[];var X,q,W,Q,J,z=Z;J=Array(z.length);for(X=0,q=z.length;X<q;X+=1)W=z[X],Q=Object.keys(W),J[X]=[Q[0],W[Q[0]]];return J}function zQ(Z){if(Z===null)return!0;var X,q=Z;for(X in q)if(JQ.call(q,X)){if(q[X]!==null)return!1}return!0}function GQ(Z){return Z!==null?Z:{}}function D8(Z){return Object.prototype.toString.call(Z)}function h0(Z){return Z===10||Z===13}function j6(Z){return Z===9||Z===32}function F0(Z){return Z===9||Z===32||Z===10||Z===13}function i6(Z){return Z===44||Z===91||Z===93||Z===123||Z===125}function BQ(Z){var X;if(48<=Z&&Z<=57)return Z-48;if(X=Z|32,97<=X&&X<=102)return X-97+10;return-1}function HQ(Z){if(Z===120)return 2;if(Z===117)return 4;if(Z===85)return 8;return 0}function $Q(Z){if(48<=Z&&Z<=57)return Z-48;return-1}function N8(Z){return Z===48?"\x00":Z===97?"\x07":Z===98?"\b":Z===116?"\t":Z===9?"\t":Z===110?`
27
- `:Z===118?"\v":Z===102?"\f":Z===114?"\r":Z===101?"\x1B":Z===32?" ":Z===34?'"':Z===47?"/":Z===92?"\\":Z===78?"…":Z===95?" ":Z===76?"\u2028":Z===80?"\u2029":""}function FQ(Z){if(Z<=65535)return String.fromCharCode(Z);return String.fromCharCode((Z-65536>>10)+55296,(Z-65536&1023)+56320)}function J9(Z,X,q){if(X==="__proto__")Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,writable:!0,value:q});else Z[X]=q}function AQ(Z,X){this.input=Z,this.filename=X.filename||null,this.schema=X.schema||L5,this.onWarning=X.onWarning||null,this.legacy=X.legacy||!1,this.json=X.json||!1,this.listener=X.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=Z.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Y9(Z,X){var q={name:Z.filename,buffer:Z.input.slice(0,-1),position:Z.position,line:Z.line,column:Z.position-Z.lineStart};return q.snippet=wW(q),new K0(X,q)}function _(Z,X){throw Y9(Z,X)}function W1(Z,X){if(Z.onWarning)Z.onWarning.call(null,Y9(Z,X))}function U6(Z,X,q,W){var Q,J,z,Y;if(X<q){if(Y=Z.input.slice(X,q),W){for(Q=0,J=Y.length;Q<J;Q+=1)if(z=Y.charCodeAt(Q),!(z===9||32<=z&&z<=1114111))_(Z,"expected valid JSON character")}else if(UQ.test(Y))_(Z,"the stream contains non-printable characters");Z.result+=Y}}function R8(Z,X,q,W){var Q,J,z,Y;if(!a.isObject(q))_(Z,"cannot merge mappings; the provided source object is unacceptable");Q=Object.keys(q);for(z=0,Y=Q.length;z<Y;z+=1)if(J=Q[z],!K6.call(X,J))J9(X,J,q[J]),W[J]=!0}function r6(Z,X,q,W,Q,J,z,Y,U){var K,V;if(Array.isArray(Q)){Q=Array.prototype.slice.call(Q);for(K=0,V=Q.length;K<V;K+=1){if(Array.isArray(Q[K]))_(Z,"nested arrays are not supported inside keys");if(typeof Q==="object"&&D8(Q[K])==="[object Object]")Q[K]="[object Object]"}}if(typeof Q==="object"&&D8(Q)==="[object Object]")Q="[object Object]";if(Q=String(Q),X===null)X={};if(W==="tag:yaml.org,2002:merge")if(Array.isArray(J))for(K=0,V=J.length;K<V;K+=1)R8(Z,X,J[K],q);else R8(Z,X,J,q);else{if(!Z.json&&!K6.call(q,Q)&&K6.call(X,Q))Z.line=z||Z.line,Z.lineStart=Y||Z.lineStart,Z.position=U||Z.position,_(Z,"duplicated mapping key");J9(X,Q,J),delete q[Q]}return X}function I5(Z){var X=Z.input.charCodeAt(Z.position);if(X===10)Z.position++;else if(X===13){if(Z.position++,Z.input.charCodeAt(Z.position)===10)Z.position++}else _(Z,"a line break is expected");Z.line+=1,Z.lineStart=Z.position,Z.firstTabInLine=-1}function i(Z,X,q){var W=0,Q=Z.input.charCodeAt(Z.position);while(Q!==0){while(j6(Q)){if(Q===9&&Z.firstTabInLine===-1)Z.firstTabInLine=Z.position;Q=Z.input.charCodeAt(++Z.position)}if(X&&Q===35)do Q=Z.input.charCodeAt(++Z.position);while(Q!==10&&Q!==13&&Q!==0);if(h0(Q)){I5(Z),Q=Z.input.charCodeAt(Z.position),W++,Z.lineIndent=0;while(Q===32)Z.lineIndent++,Q=Z.input.charCodeAt(++Z.position)}else break}if(q!==-1&&W!==0&&Z.lineIndent<q)W1(Z,"deficient indentation");return W}function z1(Z){var X=Z.position,q;if(q=Z.input.charCodeAt(X),(q===45||q===46)&&q===Z.input.charCodeAt(X+1)&&q===Z.input.charCodeAt(X+2)){if(X+=3,q=Z.input.charCodeAt(X),q===0||F0(q))return!0}return!1}function w5(Z,X){if(X===1)Z.result+=" ";else if(X>1)Z.result+=a.repeat(`
28
- `,X-1)}function MQ(Z,X,q){var W,Q,J,z,Y,U,K,V,B=Z.kind,H=Z.result,$;if($=Z.input.charCodeAt(Z.position),F0($)||i6($)||$===35||$===38||$===42||$===33||$===124||$===62||$===39||$===34||$===37||$===64||$===96)return!1;if($===63||$===45){if(Q=Z.input.charCodeAt(Z.position+1),F0(Q)||q&&i6(Q))return!1}Z.kind="scalar",Z.result="",J=z=Z.position,Y=!1;while($!==0){if($===58){if(Q=Z.input.charCodeAt(Z.position+1),F0(Q)||q&&i6(Q))break}else if($===35){if(W=Z.input.charCodeAt(Z.position-1),F0(W))break}else if(Z.position===Z.lineStart&&z1(Z)||q&&i6($))break;else if(h0($))if(U=Z.line,K=Z.lineStart,V=Z.lineIndent,i(Z,!1,-1),Z.lineIndent>=X){Y=!0,$=Z.input.charCodeAt(Z.position);continue}else{Z.position=z,Z.line=U,Z.lineStart=K,Z.lineIndent=V;break}if(Y)U6(Z,J,z,!1),w5(Z,Z.line-U),J=z=Z.position,Y=!1;if(!j6($))z=Z.position+1;$=Z.input.charCodeAt(++Z.position)}if(U6(Z,J,z,!1),Z.result)return!0;return Z.kind=B,Z.result=H,!1}function LQ(Z,X){var q,W,Q;if(q=Z.input.charCodeAt(Z.position),q!==39)return!1;Z.kind="scalar",Z.result="",Z.position++,W=Q=Z.position;while((q=Z.input.charCodeAt(Z.position))!==0)if(q===39)if(U6(Z,W,Z.position,!0),q=Z.input.charCodeAt(++Z.position),q===39)W=Z.position,Z.position++,Q=Z.position;else return!0;else if(h0(q))U6(Z,W,Q,!0),w5(Z,i(Z,!1,X)),W=Q=Z.position;else if(Z.position===Z.lineStart&&z1(Z))_(Z,"unexpected end of the document within a single quoted scalar");else Z.position++,Q=Z.position;_(Z,"unexpected end of the stream within a single quoted scalar")}function IQ(Z,X){var q,W,Q,J,z,Y;if(Y=Z.input.charCodeAt(Z.position),Y!==34)return!1;Z.kind="scalar",Z.result="",Z.position++,q=W=Z.position;while((Y=Z.input.charCodeAt(Z.position))!==0)if(Y===34)return U6(Z,q,Z.position,!0),Z.position++,!0;else if(Y===92){if(U6(Z,q,Z.position,!0),Y=Z.input.charCodeAt(++Z.position),h0(Y))i(Z,!1,X);else if(Y<256&&z9[Y])Z.result+=G9[Y],Z.position++;else if((z=HQ(Y))>0){Q=z,J=0;for(;Q>0;Q--)if(Y=Z.input.charCodeAt(++Z.position),(z=BQ(Y))>=0)J=(J<<4)+z;else _(Z,"expected hexadecimal character");Z.result+=FQ(J),Z.position++}else _(Z,"unknown escape sequence");q=W=Z.position}else if(h0(Y))U6(Z,q,W,!0),w5(Z,i(Z,!1,X)),q=W=Z.position;else if(Z.position===Z.lineStart&&z1(Z))_(Z,"unexpected end of the document within a double quoted scalar");else Z.position++,W=Z.position;_(Z,"unexpected end of the stream within a double quoted scalar")}function wQ(Z,X){var q=!0,W,Q,J,z=Z.tag,Y,U=Z.anchor,K,V,B,H,$,F=Object.create(null),L,A,I,M;if(M=Z.input.charCodeAt(Z.position),M===91)V=93,$=!1,Y=[];else if(M===123)V=125,$=!0,Y={};else return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Y;M=Z.input.charCodeAt(++Z.position);while(M!==0){if(i(Z,!0,X),M=Z.input.charCodeAt(Z.position),M===V)return Z.position++,Z.tag=z,Z.anchor=U,Z.kind=$?"mapping":"sequence",Z.result=Y,!0;else if(!q)_(Z,"missed comma between flow collection entries");else if(M===44)_(Z,"expected the node content, but found ','");if(A=L=I=null,B=H=!1,M===63){if(K=Z.input.charCodeAt(Z.position+1),F0(K))B=H=!0,Z.position++,i(Z,!0,X)}if(W=Z.line,Q=Z.lineStart,J=Z.position,a6(Z,X,X1,!1,!0),A=Z.tag,L=Z.result,i(Z,!0,X),M=Z.input.charCodeAt(Z.position),(H||Z.line===W)&&M===58)B=!0,M=Z.input.charCodeAt(++Z.position),i(Z,!0,X),a6(Z,X,X1,!1,!0),I=Z.result;if($)r6(Z,Y,F,A,L,I,W,Q,J);else if(B)Y.push(r6(Z,null,F,A,L,I,W,Q,J));else Y.push(L);if(i(Z,!0,X),M=Z.input.charCodeAt(Z.position),M===44)q=!0,M=Z.input.charCodeAt(++Z.position);else q=!1}_(Z,"unexpected end of the stream within a flow collection")}function DQ(Z,X){var q,W,Q=V5,J=!1,z=!1,Y=X,U=0,K=!1,V,B;if(B=Z.input.charCodeAt(Z.position),B===124)W=!1;else if(B===62)W=!0;else return!1;Z.kind="scalar",Z.result="";while(B!==0)if(B=Z.input.charCodeAt(++Z.position),B===43||B===45)if(V5===Q)Q=B===43?w8:YQ;else _(Z,"repeat of a chomping mode identifier");else if((V=$Q(B))>=0)if(V===0)_(Z,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!z)Y=X+V-1,z=!0;else _(Z,"repeat of an indentation width identifier");else break;if(j6(B)){do B=Z.input.charCodeAt(++Z.position);while(j6(B));if(B===35)do B=Z.input.charCodeAt(++Z.position);while(!h0(B)&&B!==0)}while(B!==0){I5(Z),Z.lineIndent=0,B=Z.input.charCodeAt(Z.position);while((!z||Z.lineIndent<Y)&&B===32)Z.lineIndent++,B=Z.input.charCodeAt(++Z.position);if(!z&&Z.lineIndent>Y)Y=Z.lineIndent;if(h0(B)){U++;continue}if(Z.lineIndent<Y){if(Q===w8)Z.result+=a.repeat(`
29
- `,J?1+U:U);else if(Q===V5){if(J)Z.result+=`
30
- `}break}if(W)if(j6(B))K=!0,Z.result+=a.repeat(`
31
- `,J?1+U:U);else if(K)K=!1,Z.result+=a.repeat(`
32
- `,U+1);else if(U===0){if(J)Z.result+=" "}else Z.result+=a.repeat(`
33
- `,U);else Z.result+=a.repeat(`
34
- `,J?1+U:U);J=!0,z=!0,U=0,q=Z.position;while(!h0(B)&&B!==0)B=Z.input.charCodeAt(++Z.position);U6(Z,q,Z.position,!1)}return!0}function _8(Z,X){var q,W=Z.tag,Q=Z.anchor,J=[],z,Y=!1,U;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=J;U=Z.input.charCodeAt(Z.position);while(U!==0){if(Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,_(Z,"tab characters must not be used in indentation");if(U!==45)break;if(z=Z.input.charCodeAt(Z.position+1),!F0(z))break;if(Y=!0,Z.position++,i(Z,!0,-1)){if(Z.lineIndent<=X){J.push(null),U=Z.input.charCodeAt(Z.position);continue}}if(q=Z.line,a6(Z,X,q9,!1,!0),J.push(Z.result),i(Z,!0,-1),U=Z.input.charCodeAt(Z.position),(Z.line===q||Z.lineIndent>X)&&U!==0)_(Z,"bad indentation of a sequence entry");else if(Z.lineIndent<X)break}if(Y)return Z.tag=W,Z.anchor=Q,Z.kind="sequence",Z.result=J,!0;return!1}function NQ(Z,X,q){var W,Q,J,z,Y,U,K=Z.tag,V=Z.anchor,B={},H=Object.create(null),$=null,F=null,L=null,A=!1,I=!1,M;if(Z.firstTabInLine!==-1)return!1;if(Z.anchor!==null)Z.anchorMap[Z.anchor]=B;M=Z.input.charCodeAt(Z.position);while(M!==0){if(!A&&Z.firstTabInLine!==-1)Z.position=Z.firstTabInLine,_(Z,"tab characters must not be used in indentation");if(W=Z.input.charCodeAt(Z.position+1),J=Z.line,(M===63||M===58)&&F0(W)){if(M===63){if(A)r6(Z,B,H,$,F,null,z,Y,U),$=F=L=null;I=!0,A=!0,Q=!0}else if(A)A=!1,Q=!0;else _(Z,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");Z.position+=1,M=W}else{if(z=Z.line,Y=Z.lineStart,U=Z.position,!a6(Z,q,X9,!1,!0))break;if(Z.line===J){M=Z.input.charCodeAt(Z.position);while(j6(M))M=Z.input.charCodeAt(++Z.position);if(M===58){if(M=Z.input.charCodeAt(++Z.position),!F0(M))_(Z,"a whitespace character is expected after the key-value separator within a block mapping");if(A)r6(Z,B,H,$,F,null,z,Y,U),$=F=L=null;I=!0,A=!1,Q=!1,$=Z.tag,F=Z.result}else if(I)_(Z,"can not read an implicit mapping pair; a colon is missed");else return Z.tag=K,Z.anchor=V,!0}else if(I)_(Z,"can not read a block mapping entry; a multiline key may not be an implicit key");else return Z.tag=K,Z.anchor=V,!0}if(Z.line===J||Z.lineIndent>X){if(A)z=Z.line,Y=Z.lineStart,U=Z.position;if(a6(Z,X,q1,!0,Q))if(A)F=Z.result;else L=Z.result;if(!A)r6(Z,B,H,$,F,L,z,Y,U),$=F=L=null;i(Z,!0,-1),M=Z.input.charCodeAt(Z.position)}if((Z.line===J||Z.lineIndent>X)&&M!==0)_(Z,"bad indentation of a mapping entry");else if(Z.lineIndent<X)break}if(A)r6(Z,B,H,$,F,null,z,Y,U);if(I)Z.tag=K,Z.anchor=V,Z.kind="mapping",Z.result=B;return I}function TQ(Z){var X,q=!1,W=!1,Q,J,z;if(z=Z.input.charCodeAt(Z.position),z!==33)return!1;if(Z.tag!==null)_(Z,"duplication of a tag property");if(z=Z.input.charCodeAt(++Z.position),z===60)q=!0,z=Z.input.charCodeAt(++Z.position);else if(z===33)W=!0,Q="!!",z=Z.input.charCodeAt(++Z.position);else Q="!";if(X=Z.position,q){do z=Z.input.charCodeAt(++Z.position);while(z!==0&&z!==62);if(Z.position<Z.length)J=Z.input.slice(X,Z.position),z=Z.input.charCodeAt(++Z.position);else _(Z,"unexpected end of the stream within a verbatim tag")}else{while(z!==0&&!F0(z)){if(z===33)if(!W){if(Q=Z.input.slice(X-1,Z.position+1),!W9.test(Q))_(Z,"named tag handle cannot contain such characters");W=!0,X=Z.position+1}else _(Z,"tag suffix cannot contain exclamation marks");z=Z.input.charCodeAt(++Z.position)}if(J=Z.input.slice(X,Z.position),VQ.test(J))_(Z,"tag suffix cannot contain flow indicator characters")}if(J&&!Q9.test(J))_(Z,"tag name cannot contain such characters: "+J);try{J=decodeURIComponent(J)}catch(Y){_(Z,"tag name is malformed: "+J)}if(q)Z.tag=J;else if(K6.call(Z.tagMap,Q))Z.tag=Z.tagMap[Q]+J;else if(Q==="!")Z.tag="!"+J;else if(Q==="!!")Z.tag="tag:yaml.org,2002:"+J;else _(Z,'undeclared tag handle "'+Q+'"');return!0}function RQ(Z){var X,q;if(q=Z.input.charCodeAt(Z.position),q!==38)return!1;if(Z.anchor!==null)_(Z,"duplication of an anchor property");q=Z.input.charCodeAt(++Z.position),X=Z.position;while(q!==0&&!F0(q)&&!i6(q))q=Z.input.charCodeAt(++Z.position);if(Z.position===X)_(Z,"name of an anchor node must contain at least one character");return Z.anchor=Z.input.slice(X,Z.position),!0}function _Q(Z){var X,q,W;if(W=Z.input.charCodeAt(Z.position),W!==42)return!1;W=Z.input.charCodeAt(++Z.position),X=Z.position;while(W!==0&&!F0(W)&&!i6(W))W=Z.input.charCodeAt(++Z.position);if(Z.position===X)_(Z,"name of an alias node must contain at least one character");if(q=Z.input.slice(X,Z.position),!K6.call(Z.anchorMap,q))_(Z,'unidentified alias "'+q+'"');return Z.result=Z.anchorMap[q],i(Z,!0,-1),!0}function a6(Z,X,q,W,Q){var J,z,Y,U=1,K=!1,V=!1,B,H,$,F,L,A;if(Z.listener!==null)Z.listener("open",Z);if(Z.tag=null,Z.anchor=null,Z.kind=null,Z.result=null,J=z=Y=q1===q||q9===q,W){if(i(Z,!0,-1)){if(K=!0,Z.lineIndent>X)U=1;else if(Z.lineIndent===X)U=0;else if(Z.lineIndent<X)U=-1}}if(U===1)while(TQ(Z)||RQ(Z))if(i(Z,!0,-1)){if(K=!0,Y=J,Z.lineIndent>X)U=1;else if(Z.lineIndent===X)U=0;else if(Z.lineIndent<X)U=-1}else Y=!1;if(Y)Y=K||Q;if(U===1||q1===q){if(X1===q||X9===q)L=X;else L=X+1;if(A=Z.position-Z.lineStart,U===1)if(Y&&(_8(Z,A)||NQ(Z,A,L))||wQ(Z,L))V=!0;else{if(z&&DQ(Z,L)||LQ(Z,L)||IQ(Z,L))V=!0;else if(_Q(Z)){if(V=!0,Z.tag!==null||Z.anchor!==null)_(Z,"alias node should not have any properties")}else if(MQ(Z,L,X1===q)){if(V=!0,Z.tag===null)Z.tag="?"}if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}else if(U===0)V=Y&&_8(Z,A)}if(Z.tag===null){if(Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}else if(Z.tag==="?"){if(Z.result!==null&&Z.kind!=="scalar")_(Z,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+Z.kind+'"');for(B=0,H=Z.implicitTypes.length;B<H;B+=1)if(F=Z.implicitTypes[B],F.resolve(Z.result)){if(Z.result=F.construct(Z.result),Z.tag=F.tag,Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result;break}}else if(Z.tag!=="!"){if(K6.call(Z.typeMap[Z.kind||"fallback"],Z.tag))F=Z.typeMap[Z.kind||"fallback"][Z.tag];else{F=null,$=Z.typeMap.multi[Z.kind||"fallback"];for(B=0,H=$.length;B<H;B+=1)if(Z.tag.slice(0,$[B].tag.length)===$[B].tag){F=$[B];break}}if(!F)_(Z,"unknown tag !<"+Z.tag+">");if(Z.result!==null&&F.kind!==Z.kind)_(Z,"unacceptable node kind for !<"+Z.tag+'> tag; it should be "'+F.kind+'", not "'+Z.kind+'"');if(!F.resolve(Z.result,Z.tag))_(Z,"cannot resolve a node with !<"+Z.tag+"> explicit tag");else if(Z.result=F.construct(Z.result,Z.tag),Z.anchor!==null)Z.anchorMap[Z.anchor]=Z.result}if(Z.listener!==null)Z.listener("close",Z);return Z.tag!==null||Z.anchor!==null||V}function PQ(Z){var X=Z.position,q,W,Q,J=!1,z;Z.version=null,Z.checkLineBreaks=Z.legacy,Z.tagMap=Object.create(null),Z.anchorMap=Object.create(null);while((z=Z.input.charCodeAt(Z.position))!==0){if(i(Z,!0,-1),z=Z.input.charCodeAt(Z.position),Z.lineIndent>0||z!==37)break;J=!0,z=Z.input.charCodeAt(++Z.position),q=Z.position;while(z!==0&&!F0(z))z=Z.input.charCodeAt(++Z.position);if(W=Z.input.slice(q,Z.position),Q=[],W.length<1)_(Z,"directive name must not be less than one character in length");while(z!==0){while(j6(z))z=Z.input.charCodeAt(++Z.position);if(z===35){do z=Z.input.charCodeAt(++Z.position);while(z!==0&&!h0(z));break}if(h0(z))break;q=Z.position;while(z!==0&&!F0(z))z=Z.input.charCodeAt(++Z.position);Q.push(Z.input.slice(q,Z.position))}if(z!==0)I5(Z);if(K6.call(T8,W))T8[W](Z,W,Q);else W1(Z,'unknown document directive "'+W+'"')}if(i(Z,!0,-1),Z.lineIndent===0&&Z.input.charCodeAt(Z.position)===45&&Z.input.charCodeAt(Z.position+1)===45&&Z.input.charCodeAt(Z.position+2)===45)Z.position+=3,i(Z,!0,-1);else if(J)_(Z,"directives end mark is expected");if(a6(Z,Z.lineIndent-1,q1,!1,!0),i(Z,!0,-1),Z.checkLineBreaks&&KQ.test(Z.input.slice(X,Z.position)))W1(Z,"non-ASCII line breaks are interpreted as content");if(Z.documents.push(Z.result),Z.position===Z.lineStart&&z1(Z)){if(Z.input.charCodeAt(Z.position)===46)Z.position+=3,i(Z,!0,-1);return}if(Z.position<Z.length-1)_(Z,"end of the stream or a document separator is expected");else return}function U9(Z,X){if(Z=String(Z),X=X||{},Z.length!==0){if(Z.charCodeAt(Z.length-1)!==10&&Z.charCodeAt(Z.length-1)!==13)Z+=`
35
- `;if(Z.charCodeAt(0)===65279)Z=Z.slice(1)}var q=new AQ(Z,X),W=Z.indexOf("\x00");if(W!==-1)q.position=W,_(q,"null byte is not allowed in input");q.input+="\x00";while(q.input.charCodeAt(q.position)===32)q.lineIndent+=1,q.position+=1;while(q.position<q.length-1)PQ(q);return q.documents}function jQ(Z,X,q){if(X!==null&&typeof X==="object"&&typeof q>"u")q=X,X=null;var W=U9(Z,q);if(typeof X!=="function")return W;for(var Q=0,J=W.length;Q<J;Q+=1)X(W[Q])}function EQ(Z,X){var q=U9(Z,X);if(q.length===0)return;else if(q.length===1)return q[0];throw new K0("expected a single document in the stream, but found more")}function aQ(Z,X){var q,W,Q,J,z,Y,U;if(X===null)return{};q={},W=Object.keys(X);for(Q=0,J=W.length;Q<J;Q+=1){if(z=W[Q],Y=String(X[z]),z.slice(0,2)==="!!")z="tag:yaml.org,2002:"+z.slice(2);if(U=Z.compiledTypeMap.fallback[z],U&&B9.call(U.styleAliases,Y))Y=U.styleAliases[Y];q[z]=Y}return q}function sQ(Z){var X,q,W;if(X=Z.toString(16).toUpperCase(),Z<=255)q="x",W=2;else if(Z<=65535)q="u",W=4;else if(Z<=4294967295)q="U",W=8;else throw new K0("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+q+a.repeat("0",W-X.length)+X}function tQ(Z){this.schema=Z.schema||L5,this.indent=Math.max(1,Z.indent||2),this.noArrayIndent=Z.noArrayIndent||!1,this.skipInvalid=Z.skipInvalid||!1,this.flowLevel=a.isNothing(Z.flowLevel)?-1:Z.flowLevel,this.styleMap=aQ(this.schema,Z.styles||null),this.sortKeys=Z.sortKeys||!1,this.lineWidth=Z.lineWidth||80,this.noRefs=Z.noRefs||!1,this.noCompatMode=Z.noCompatMode||!1,this.condenseFlow=Z.condenseFlow||!1,this.quotingType=Z.quotingType==='"'?w4:oQ,this.forceQuotes=Z.forceQuotes||!1,this.replacer=typeof Z.replacer==="function"?Z.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function P8(Z,X){var q=a.repeat(" ",X),W=0,Q=-1,J="",z,Y=Z.length;while(W<Y){if(Q=Z.indexOf(`
36
- `,W),Q===-1)z=Z.slice(W),W=Y;else z=Z.slice(W,Q+1),W=Q+1;if(z.length&&z!==`
37
- `)J+=q;J+=z}return J}function $5(Z,X){return`
38
- `+a.repeat(" ",Z.indent*X)}function eQ(Z,X){var q,W,Q;for(q=0,W=Z.implicitTypes.length;q<W;q+=1)if(Q=Z.implicitTypes[q],Q.resolve(X))return!0;return!1}function J1(Z){return Z===SQ||Z===xQ}function D4(Z){return 32<=Z&&Z<=126||161<=Z&&Z<=55295&&Z!==8232&&Z!==8233||57344<=Z&&Z<=65533&&Z!==D5||65536<=Z&&Z<=1114111}function j8(Z){return D4(Z)&&Z!==D5&&Z!==kQ&&Z!==I4}function E8(Z,X,q){var W=j8(Z),Q=W&&!J1(Z);return(q?W:W&&Z!==H9&&Z!==$9&&Z!==F9&&Z!==A9&&Z!==M9)&&Z!==H5&&!(X===Q1&&!Q)||j8(X)&&!J1(X)&&Z===H5||X===Q1&&Q}function ZJ(Z){return D4(Z)&&Z!==D5&&!J1(Z)&&Z!==fQ&&Z!==cQ&&Z!==Q1&&Z!==H9&&Z!==$9&&Z!==F9&&Z!==A9&&Z!==M9&&Z!==H5&&Z!==gQ&&Z!==mQ&&Z!==bQ&&Z!==nQ&&Z!==uQ&&Z!==dQ&&Z!==hQ&&Z!==vQ&&Z!==yQ&&Z!==lQ&&Z!==pQ}function XJ(Z){return!J1(Z)&&Z!==Q1}function M4(Z,X){var q=Z.charCodeAt(X),W;if(q>=55296&&q<=56319&&X+1<Z.length){if(W=Z.charCodeAt(X+1),W>=56320&&W<=57343)return(q-55296)*1024+W-56320+65536}return q}function L9(Z){var X=/^\n* /;return X.test(Z)}function qJ(Z,X,q,W,Q,J,z,Y){var U,K=0,V=null,B=!1,H=!1,$=W!==-1,F=-1,L=ZJ(M4(Z,0))&&XJ(M4(Z,Z.length-1));if(X||z)for(U=0;U<Z.length;K>=65536?U+=2:U++){if(K=M4(Z,U),!D4(K))return n6;L=L&&E8(K,V,Y),V=K}else{for(U=0;U<Z.length;K>=65536?U+=2:U++){if(K=M4(Z,U),K===I4){if(B=!0,$)H=H||U-F-1>W&&Z[F+1]!==" ",F=U}else if(!D4(K))return n6;L=L&&E8(K,V,Y),V=K}H=H||$&&(U-F-1>W&&Z[F+1]!==" ")}if(!B&&!H){if(L&&!z&&!Q(Z))return I9;return J===w4?n6:F5}if(q>9&&L9(Z))return n6;if(!z)return H?D9:w9;return J===w4?n6:F5}function WJ(Z,X,q,W,Q){Z.dump=function(){if(X.length===0)return Z.quotingType===w4?'""':"''";if(!Z.noCompatMode){if(iQ.indexOf(X)!==-1||rQ.test(X))return Z.quotingType===w4?'"'+X+'"':"'"+X+"'"}var J=Z.indent*Math.max(1,q),z=Z.lineWidth===-1?-1:Math.max(Math.min(Z.lineWidth,40),Z.lineWidth-J),Y=W||Z.flowLevel>-1&&q>=Z.flowLevel;function U(K){return eQ(Z,K)}switch(qJ(X,Y,Z.indent,z,U,Z.quotingType,Z.forceQuotes&&!W,Q)){case I9:return X;case F5:return"'"+X.replace(/'/g,"''")+"'";case w9:return"|"+C8(X,Z.indent)+O8(P8(X,J));case D9:return">"+C8(X,Z.indent)+O8(P8(QJ(X,z),J));case n6:return'"'+JJ(X)+'"';default:throw new K0("impossible error: invalid scalar style")}}()}function C8(Z,X){var q=L9(Z)?String(X):"",W=Z[Z.length-1]===`
39
- `,Q=W&&(Z[Z.length-2]===`
40
- `||Z===`
41
- `),J=Q?"+":W?"":"-";return q+J+`
42
- `}function O8(Z){return Z[Z.length-1]===`
43
- `?Z.slice(0,-1):Z}function QJ(Z,X){var q=/(\n+)([^\n]*)/g,W=function(){var K=Z.indexOf(`
44
- `);return K=K!==-1?K:Z.length,q.lastIndex=K,x8(Z.slice(0,K),X)}(),Q=Z[0]===`
45
- `||Z[0]===" ",J,z;while(z=q.exec(Z)){var Y=z[1],U=z[2];J=U[0]===" ",W+=Y+(!Q&&!J&&U!==""?`
46
- `:"")+x8(U,X),Q=J}return W}function x8(Z,X){if(Z===""||Z[0]===" ")return Z;var q=/ [^ ]/g,W,Q=0,J,z=0,Y=0,U="";while(W=q.exec(Z)){if(Y=W.index,Y-Q>X)J=z>Q?z:Y,U+=`
47
- `+Z.slice(Q,J),Q=J+1;z=Y}if(U+=`
48
- `,Z.length-Q>X&&z>Q)U+=Z.slice(Q,z)+`
49
- `+Z.slice(z+1);else U+=Z.slice(Q);return U.slice(1)}function JJ(Z){var X="",q=0,W;for(var Q=0;Q<Z.length;q>=65536?Q+=2:Q++)if(q=M4(Z,Q),W=z0[q],!W&&D4(q)){if(X+=Z[Q],q>=65536)X+=Z[Q+1]}else X+=W||sQ(q);return X}function zJ(Z,X,q){var W="",Q=Z.tag,J,z,Y;for(J=0,z=q.length;J<z;J+=1){if(Y=q[J],Z.replacer)Y=Z.replacer.call(q,String(J),Y);if(s0(Z,X,Y,!1,!1)||typeof Y>"u"&&s0(Z,X,null,!1,!1)){if(W!=="")W+=","+(!Z.condenseFlow?" ":"");W+=Z.dump}}Z.tag=Q,Z.dump="["+W+"]"}function k8(Z,X,q,W){var Q="",J=Z.tag,z,Y,U;for(z=0,Y=q.length;z<Y;z+=1){if(U=q[z],Z.replacer)U=Z.replacer.call(q,String(z),U);if(s0(Z,X+1,U,!0,!0,!1,!0)||typeof U>"u"&&s0(Z,X+1,null,!0,!0,!1,!0)){if(!W||Q!=="")Q+=$5(Z,X);if(Z.dump&&I4===Z.dump.charCodeAt(0))Q+="-";else Q+="- ";Q+=Z.dump}}Z.tag=J,Z.dump=Q||"[]"}function GJ(Z,X,q){var W="",Q=Z.tag,J=Object.keys(q),z,Y,U,K,V;for(z=0,Y=J.length;z<Y;z+=1){if(V="",W!=="")V+=", ";if(Z.condenseFlow)V+='"';if(U=J[z],K=q[U],Z.replacer)K=Z.replacer.call(q,U,K);if(!s0(Z,X,U,!1,!1))continue;if(Z.dump.length>1024)V+="? ";if(V+=Z.dump+(Z.condenseFlow?'"':"")+":"+(Z.condenseFlow?"":" "),!s0(Z,X,K,!1,!1))continue;V+=Z.dump,W+=V}Z.tag=Q,Z.dump="{"+W+"}"}function YJ(Z,X,q,W){var Q="",J=Z.tag,z=Object.keys(q),Y,U,K,V,B,H;if(Z.sortKeys===!0)z.sort();else if(typeof Z.sortKeys==="function")z.sort(Z.sortKeys);else if(Z.sortKeys)throw new K0("sortKeys must be a boolean or a function");for(Y=0,U=z.length;Y<U;Y+=1){if(H="",!W||Q!=="")H+=$5(Z,X);if(K=z[Y],V=q[K],Z.replacer)V=Z.replacer.call(q,K,V);if(!s0(Z,X+1,K,!0,!0,!0))continue;if(B=Z.tag!==null&&Z.tag!=="?"||Z.dump&&Z.dump.length>1024,B)if(Z.dump&&I4===Z.dump.charCodeAt(0))H+="?";else H+="? ";if(H+=Z.dump,B)H+=$5(Z,X);if(!s0(Z,X+1,V,!0,B))continue;if(Z.dump&&I4===Z.dump.charCodeAt(0))H+=":";else H+=": ";H+=Z.dump,Q+=H}Z.tag=J,Z.dump=Q||"{}"}function S8(Z,X,q){var W,Q,J,z,Y,U;Q=q?Z.explicitTypes:Z.implicitTypes;for(J=0,z=Q.length;J<z;J+=1)if(Y=Q[J],(Y.instanceOf||Y.predicate)&&(!Y.instanceOf||typeof X==="object"&&X instanceof Y.instanceOf)&&(!Y.predicate||Y.predicate(X))){if(q)if(Y.multi&&Y.representName)Z.tag=Y.representName(X);else Z.tag=Y.tag;else Z.tag="?";if(Y.represent){if(U=Z.styleMap[Y.tag]||Y.defaultStyle,V9.call(Y.represent)==="[object Function]")W=Y.represent(X,U);else if(B9.call(Y.represent,U))W=Y.represent[U](X,U);else throw new K0("!<"+Y.tag+'> tag resolver accepts not "'+U+'" style');Z.dump=W}return!0}return!1}function s0(Z,X,q,W,Q,J,z){if(Z.tag=null,Z.dump=q,!S8(Z,q,!1))S8(Z,q,!0);var Y=V9.call(Z.dump),U=W,K;if(W)W=Z.flowLevel<0||Z.flowLevel>X;var V=Y==="[object Object]"||Y==="[object Array]",B,H;if(V)B=Z.duplicates.indexOf(q),H=B!==-1;if(Z.tag!==null&&Z.tag!=="?"||H||Z.indent!==2&&X>0)Q=!1;if(H&&Z.usedDuplicates[B])Z.dump="*ref_"+B;else{if(V&&H&&!Z.usedDuplicates[B])Z.usedDuplicates[B]=!0;if(Y==="[object Object]"){if(W&&Object.keys(Z.dump).length!==0){if(YJ(Z,X,Z.dump,Q),H)Z.dump="&ref_"+B+Z.dump}else if(GJ(Z,X,Z.dump),H)Z.dump="&ref_"+B+" "+Z.dump}else if(Y==="[object Array]"){if(W&&Z.dump.length!==0){if(Z.noArrayIndent&&!z&&X>0)k8(Z,X-1,Z.dump,Q);else k8(Z,X,Z.dump,Q);if(H)Z.dump="&ref_"+B+Z.dump}else if(zJ(Z,X,Z.dump),H)Z.dump="&ref_"+B+" "+Z.dump}else if(Y==="[object String]"){if(Z.tag!=="?")WJ(Z,Z.dump,X,J,U)}else if(Y==="[object Undefined]")return!1;else{if(Z.skipInvalid)return!1;throw new K0("unacceptable kind of an object to dump "+Y)}if(Z.tag!==null&&Z.tag!=="?"){if(K=encodeURI(Z.tag[0]==="!"?Z.tag.slice(1):Z.tag).replace(/!/g,"%21"),Z.tag[0]==="!")K="!"+K;else if(K.slice(0,18)==="tag:yaml.org,2002:")K="!!"+K.slice(18);else K="!<"+K+">";Z.dump=K+" "+Z.dump}}return!0}function UJ(Z,X){var q=[],W=[],Q,J;A5(Z,q,W);for(Q=0,J=W.length;Q<J;Q+=1)X.duplicates.push(q[W[Q]]);X.usedDuplicates=Array(J)}function A5(Z,X,q){var W,Q,J;if(Z!==null&&typeof Z==="object")if(Q=X.indexOf(Z),Q!==-1){if(q.indexOf(Q)===-1)q.push(Q)}else if(X.push(Z),Array.isArray(Z))for(Q=0,J=Z.length;Q<J;Q+=1)A5(Z[Q],X,q);else{W=Object.keys(Z);for(Q=0,J=W.length;Q<J;Q+=1)A5(Z[W[Q]],X,q)}}function KJ(Z,X){X=X||{};var q=new tQ(X);if(!q.noRefs)UJ(Z,q);var W=Z;if(q.replacer)W=q.replacer.call({"":W},"",W);if(s0(q,0,W,!0,!0))return q.dump+`
50
- `;return""}function N5(Z,X){return function(){throw Error("Function yaml."+Z+" is removed in js-yaml 4. Use yaml."+X+" instead, which is now safe by default.")}}var HW,$W,FW,AW,MW,LW,a,K0,wW,DW,NW,W0,y8,g8,h8,m8,f8,u8,d8,c8,hW,uW,l8,p8,n8,i8,r8,a8,s8,M5=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
51
- \r`,o8,tW,eW,t8,qQ,e8,JQ,Z9,L5,K6,X1=1,X9=2,q9=3,q1=4,V5=1,YQ=2,w8=3,UQ,KQ,VQ,W9,Q9,z9,G9,Y6,T8,CQ,OQ,K9,V9,B9,D5=65279,xQ=9,I4=10,kQ=13,SQ=32,bQ=33,vQ=34,H5=35,yQ=37,gQ=38,hQ=39,mQ=42,H9=44,fQ=45,Q1=58,uQ=61,dQ=62,cQ=63,lQ=64,$9=91,F9=93,pQ=96,A9=123,nQ=124,M9=125,z0,iQ,rQ,oQ=1,w4=2,I9=1,F5=2,w9=3,D9=4,n6=5,VJ,BJ,HJ,$J,FJ,T5,AJ,MJ,LJ,IJ,wJ,DJ,NJ,TJ,RJ,_J,R5;var _5=R(()=>{/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */HW=b8,$W=YW,FW=UW,AW=VW,MW=BW,LW=KW,a={isNothing:HW,isObject:$W,toArray:FW,repeat:AW,isNegativeZero:MW,extend:LW};L4.prototype=Object.create(Error.prototype);L4.prototype.constructor=L4;L4.prototype.toString=function(X){return this.name+": "+v8(this,X)};K0=L4;wW=IW,DW=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],NW=["scalar","sequence","mapping"];W0=RW;B5.prototype.extend=function(X){var q=[],W=[];if(X instanceof W0)W.push(X);else if(Array.isArray(X))W=W.concat(X);else if(X&&(Array.isArray(X.implicit)||Array.isArray(X.explicit))){if(X.implicit)q=q.concat(X.implicit);if(X.explicit)W=W.concat(X.explicit)}else throw new K0("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");q.forEach(function(J){if(!(J instanceof W0))throw new K0("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(J.loadKind&&J.loadKind!=="scalar")throw new K0("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(J.multi)throw new K0("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),W.forEach(function(J){if(!(J instanceof W0))throw new K0("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var Q=Object.create(B5.prototype);return Q.implicit=(this.implicit||[]).concat(q),Q.explicit=(this.explicit||[]).concat(W),Q.compiledImplicit=I8(Q,"implicit"),Q.compiledExplicit=I8(Q,"explicit"),Q.compiledTypeMap=_W(Q.compiledImplicit,Q.compiledExplicit),Q};y8=B5,g8=new W0("tag:yaml.org,2002:str",{kind:"scalar",construct:function(Z){return Z!==null?Z:""}}),h8=new W0("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(Z){return Z!==null?Z:[]}}),m8=new W0("tag:yaml.org,2002:map",{kind:"mapping",construct:function(Z){return Z!==null?Z:{}}}),f8=new y8({explicit:[g8,h8,m8]});u8=new W0("tag:yaml.org,2002:null",{kind:"scalar",resolve:PW,construct:jW,predicate:EW,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});d8=new W0("tag:yaml.org,2002:bool",{kind:"scalar",resolve:CW,construct:OW,predicate:xW,represent:{lowercase:function(Z){return Z?"true":"false"},uppercase:function(Z){return Z?"TRUE":"FALSE"},camelcase:function(Z){return Z?"True":"False"}},defaultStyle:"lowercase"});c8=new W0("tag:yaml.org,2002:int",{kind:"scalar",resolve:vW,construct:yW,predicate:gW,represent:{binary:function(Z){return Z>=0?"0b"+Z.toString(2):"-0b"+Z.toString(2).slice(1)},octal:function(Z){return Z>=0?"0o"+Z.toString(8):"-0o"+Z.toString(8).slice(1)},decimal:function(Z){return Z.toString(10)},hexadecimal:function(Z){return Z>=0?"0x"+Z.toString(16).toUpperCase():"-0x"+Z.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),hW=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");uW=/^[-+]?[0-9]+e/;l8=new W0("tag:yaml.org,2002:float",{kind:"scalar",resolve:mW,construct:fW,predicate:cW,represent:dW,defaultStyle:"lowercase"}),p8=f8.extend({implicit:[u8,d8,c8,l8]}),n8=p8,i8=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r8=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");a8=new W0("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:lW,construct:pW,instanceOf:Date,represent:nW});s8=new W0("tag:yaml.org,2002:merge",{kind:"scalar",resolve:iW});o8=new W0("tag:yaml.org,2002:binary",{kind:"scalar",resolve:rW,construct:aW,predicate:oW,represent:sW}),tW=Object.prototype.hasOwnProperty,eW=Object.prototype.toString;t8=new W0("tag:yaml.org,2002:omap",{kind:"sequence",resolve:ZQ,construct:XQ}),qQ=Object.prototype.toString;e8=new W0("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:WQ,construct:QQ}),JQ=Object.prototype.hasOwnProperty;Z9=new W0("tag:yaml.org,2002:set",{kind:"mapping",resolve:zQ,construct:GQ}),L5=n8.extend({implicit:[a8,s8],explicit:[o8,t8,e8,Z9]}),K6=Object.prototype.hasOwnProperty,UQ=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,KQ=/[\x85\u2028\u2029]/,VQ=/[,\[\]\{\}]/,W9=/^(?:!|!!|![a-z\-]+!)$/i,Q9=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;z9=Array(256),G9=Array(256);for(Y6=0;Y6<256;Y6++)z9[Y6]=N8(Y6)?1:0,G9[Y6]=N8(Y6);T8={YAML:function(X,q,W){var Q,J,z;if(X.version!==null)_(X,"duplication of %YAML directive");if(W.length!==1)_(X,"YAML directive accepts exactly one argument");if(Q=/^([0-9]+)\.([0-9]+)$/.exec(W[0]),Q===null)_(X,"ill-formed argument of the YAML directive");if(J=parseInt(Q[1],10),z=parseInt(Q[2],10),J!==1)_(X,"unacceptable YAML version of the document");if(X.version=W[0],X.checkLineBreaks=z<2,z!==1&&z!==2)W1(X,"unsupported YAML version of the document")},TAG:function(X,q,W){var Q,J;if(W.length!==2)_(X,"TAG directive accepts exactly two arguments");if(Q=W[0],J=W[1],!W9.test(Q))_(X,"ill-formed tag handle (first argument) of the TAG directive");if(K6.call(X.tagMap,Q))_(X,'there is a previously declared suffix for "'+Q+'" tag handle');if(!Q9.test(J))_(X,"ill-formed tag prefix (second argument) of the TAG directive");try{J=decodeURIComponent(J)}catch(z){_(X,"tag prefix is malformed: "+J)}X.tagMap[Q]=J}};CQ=jQ,OQ=EQ,K9={loadAll:CQ,load:OQ},V9=Object.prototype.toString,B9=Object.prototype.hasOwnProperty,z0={};z0[0]="\\0";z0[7]="\\a";z0[8]="\\b";z0[9]="\\t";z0[10]="\\n";z0[11]="\\v";z0[12]="\\f";z0[13]="\\r";z0[27]="\\e";z0[34]="\\\"";z0[92]="\\\\";z0[133]="\\N";z0[160]="\\_";z0[8232]="\\L";z0[8233]="\\P";iQ=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],rQ=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;VJ=KJ,BJ={dump:VJ};HJ=W0,$J=y8,FJ=f8,T5=p8,AJ=n8,MJ=L5,LJ=K9.load,IJ=K9.loadAll,wJ=BJ.dump,DJ=K0,NJ={binary:o8,float:l8,map:m8,null:u8,pairs:e8,set:Z9,timestamp:a8,bool:d8,int:c8,merge:s8,omap:t8,seq:h8,str:g8},TJ=N5("safeLoad","load"),RJ=N5("safeLoadAll","loadAll"),_J=N5("safeDump","dump"),R5={Type:HJ,Schema:$J,FAILSAFE_SCHEMA:FJ,JSON_SCHEMA:T5,CORE_SCHEMA:AJ,DEFAULT_SCHEMA:MJ,load:LJ,loadAll:IJ,dump:wJ,YAMLException:DJ,types:NJ,safeLoad:TJ,safeLoadAll:RJ,safeDump:_J}});var N9;var T9=R(()=>{P0();_5();_5();N9={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(Z){let X=Z.data;if(Buffer.isBuffer(X))X=X.toString();if(typeof X==="string")try{return R5.load(X,{schema:T5})}catch{try{return R5.load(X)}catch(q){throw new _0(q?.message||"Parser Error",Z.url)}}else return X}}});var PJ,R9;var _9=R(()=>{P0();PJ=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,R9={order:300,allowEmpty:!0,encoding:"utf8",canParse(Z){return(typeof Z.data==="string"||Buffer.isBuffer(Z.data))&&PJ.test(Z.url)},parse(Z){if(typeof Z.data==="string")return Z.data;else if(Buffer.isBuffer(Z.data))return Z.data.toString(this.encoding);else throw new _0("data is not text",Z.url)}}});var jJ,P9;var j9=R(()=>{jJ=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,P9={order:400,allowEmpty:!0,canParse(Z){return Buffer.isBuffer(Z.data)&&jJ.test(Z.url)},parse(Z){if(Buffer.isBuffer(Z.data))return Z.data;else return Buffer.from(Z.data)}}});var P5;var j5=R(()=>{H0();P0();P5={order:100,canRead(Z){return p4(Z.url)},async read(Z){let X,q=await import("fs");try{X=d6(Z.url)}catch(W){let Q=W;throw Q.message=`Malformed URI: ${Z.url}: ${Q.message}`,new x0(Q,Z.url)}if(X.endsWith("/")||X.endsWith("\\"))X=X.slice(0,-1);try{return await q.promises.readFile(X)}catch(W){let Q=W;throw Q.message=`Error opening file ${X}: ${Q.message}`,new x0(Q,X)}}}});async function E9(Z,X,q){Z=u6(Z);let W=q||[];W.push(Z.href);try{let Q=await EJ(Z,X);if(Q.status>=400){let J=Error(`HTTP ERROR ${Q.status}`);throw J.status=Q.status,J}else if(Q.status>=300)if(!Number.isNaN(X.redirects)&&W.length>X.redirects){let J=Error(`Error downloading ${W[0]}.
23
+ `+J.mark.snippet;return q+" "+z}function Q(J,G){if(Error.call(this),this.name="YAMLException",this.reason=J,this.mark=G,this.message=X(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}Q.prototype=Object.create(Error.prototype),Q.prototype.constructor=Q,Q.prototype.toString=function(G){return this.name+": "+X(this,G)},W.exports=Q}),VQ=G0((Z,W)=>{var X=u6();function Q(z,q,K,V,H){let B="",$="",L=Math.floor(H/2)-1;if(V-q>L)B=" ... ",q=V-L+B.length;if(K-V>L)$=" ...",K=V+L-$.length;return{str:B+z.slice(q,K).replace(/\t/g,"→")+$,pos:V-q+B.length}}function J(z,q){return X.repeat(" ",q-z.length)+z}function G(z,q){if(q=Object.create(q||null),!z.buffer)return null;if(!q.maxLength)q.maxLength=79;if(typeof q.indent!=="number")q.indent=1;if(typeof q.linesBefore!=="number")q.linesBefore=3;if(typeof q.linesAfter!=="number")q.linesAfter=2;let K=/\r?\n|\r|\0/g,V=[0],H=[],B,$=-1;while(B=K.exec(z.buffer))if(H.push(B.index),V.push(B.index+B[0].length),z.position<=B.index&&$<0)$=V.length-2;if($<0)$=V.length-1;let L="",A=Math.min(z.line+q.linesAfter,H.length).toString().length,j=q.maxLength-(q.indent+A+3);for(let R=1;R<=q.linesBefore;R++){if($-R<0)break;let x=Q(z.buffer,V[$-R],H[$-R],z.position-(V[$]-V[$-R]),j);L=X.repeat(" ",q.indent)+J((z.line-R+1).toString(),A)+" | "+x.str+`
24
+ `+L}let D=Q(z.buffer,V[$],H[$],z.position,j);L+=X.repeat(" ",q.indent)+J((z.line+1).toString(),A)+" | "+D.str+`
25
+ `,L+=X.repeat("-",q.indent+A+3+D.pos)+`^
26
+ `;for(let R=1;R<=q.linesAfter;R++){if($+R>=H.length)break;let x=Q(z.buffer,V[$+R],H[$+R],z.position-(V[$]-V[$+R]),j);L+=X.repeat(" ",q.indent)+J((z.line+R+1).toString(),A)+" | "+x.str+`
27
+ `}return L.replace(/\n$/,"")}W.exports=G}),O0=G0((Z,W)=>{var X=d6(),Q=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],J=["scalar","sequence","mapping"];function G(q){let K={};if(q!==null)Object.keys(q).forEach(function(V){q[V].forEach(function(H){K[String(H)]=V})});return K}function z(q,K){if(K=K||{},Object.keys(K).forEach(function(V){if(Q.indexOf(V)===-1)throw new X('Unknown option "'+V+'" is met in definition of "'+q+'" YAML type.')}),this.options=K,this.tag=q,this.kind=K.kind||null,this.resolve=K.resolve||function(){return!0},this.construct=K.construct||function(V){return V},this.instanceOf=K.instanceOf||null,this.predicate=K.predicate||null,this.represent=K.represent||null,this.representName=K.representName||null,this.defaultStyle=K.defaultStyle||null,this.multi=K.multi||!1,this.styleAliases=G(K.styleAliases||null),J.indexOf(this.kind)===-1)throw new X('Unknown kind "'+this.kind+'" is specified for "'+q+'" YAML type.')}W.exports=z}),n8=G0((Z,W)=>{var X=d6(),Q=O0();function J(q,K){let V=[];return q[K].forEach(function(H){let B=V.length;V.forEach(function($,L){if($.tag===H.tag&&$.kind===H.kind&&$.multi===H.multi)B=L}),V[B]=H}),V}function G(){let q={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function K(V){if(V.multi)q.multi[V.kind].push(V),q.multi.fallback.push(V);else q[V.kind][V.tag]=q.fallback[V.tag]=V}for(let V=0,H=arguments.length;V<H;V+=1)arguments[V].forEach(K);return q}function z(q){return this.extend(q)}z.prototype.extend=function(K){let V=[],H=[];if(K instanceof Q)H.push(K);else if(Array.isArray(K))H=H.concat(K);else if(K&&(Array.isArray(K.implicit)||Array.isArray(K.explicit))){if(K.implicit)V=V.concat(K.implicit);if(K.explicit)H=H.concat(K.explicit)}else throw new X("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");V.forEach(function($){if(!($ instanceof Q))throw new X("Specified list of YAML types (or a single Type object) contains a non-Type object.");if($.loadKind&&$.loadKind!=="scalar")throw new X("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if($.multi)throw new X("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),H.forEach(function($){if(!($ instanceof Q))throw new X("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let B=Object.create(z.prototype);return B.implicit=(this.implicit||[]).concat(V),B.explicit=(this.explicit||[]).concat(H),B.compiledImplicit=J(B,"implicit"),B.compiledExplicit=J(B,"explicit"),B.compiledTypeMap=G(B.compiledImplicit,B.compiledExplicit),B},W.exports=z}),i8=G0((Z,W)=>{W.exports=new(O0())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(X){return X!==null?X:""}})}),r8=G0((Z,W)=>{W.exports=new(O0())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(X){return X!==null?X:[]}})}),a8=G0((Z,W)=>{W.exports=new(O0())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(X){return X!==null?X:{}}})}),s8=G0((Z,W)=>{W.exports=new(n8())({explicit:[i8(),r8(),a8()]})}),o8=G0((Z,W)=>{var X=O0();function Q(z){if(z===null)return!0;let q=z.length;return q===1&&z==="~"||q===4&&(z==="null"||z==="Null"||z==="NULL")}function J(){return null}function G(z){return z===null}W.exports=new X("tag:yaml.org,2002:null",{kind:"scalar",resolve:Q,construct:J,predicate:G,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})}),t8=G0((Z,W)=>{var X=O0();function Q(z){if(z===null)return!1;let q=z.length;return q===4&&(z==="true"||z==="True"||z==="TRUE")||q===5&&(z==="false"||z==="False"||z==="FALSE")}function J(z){return z==="true"||z==="True"||z==="TRUE"}function G(z){return Object.prototype.toString.call(z)==="[object Boolean]"}W.exports=new X("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Q,construct:J,predicate:G,represent:{lowercase:function(z){return z?"true":"false"},uppercase:function(z){return z?"TRUE":"FALSE"},camelcase:function(z){return z?"True":"False"}},defaultStyle:"lowercase"})}),e8=G0((Z,W)=>{var X=u6(),Q=O0();function J(B){return B>=48&&B<=57||B>=65&&B<=70||B>=97&&B<=102}function G(B){return B>=48&&B<=55}function z(B){return B>=48&&B<=57}function q(B){if(B===null)return!1;let $=B.length,L=0,A=!1;if(!$)return!1;let j=B[L];if(j==="-"||j==="+")j=B[++L];if(j==="0"){if(L+1===$)return!0;if(j=B[++L],j==="b"){L++;for(;L<$;L++){if(j=B[L],j!=="0"&&j!=="1")return!1;A=!0}return A&&Number.isFinite(K(B))}if(j==="x"){L++;for(;L<$;L++){if(!J(B.charCodeAt(L)))return!1;A=!0}return A&&Number.isFinite(K(B))}if(j==="o"){L++;for(;L<$;L++){if(!G(B.charCodeAt(L)))return!1;A=!0}return A&&Number.isFinite(K(B))}}for(;L<$;L++){if(!z(B.charCodeAt(L)))return!1;A=!0}if(!A)return!1;return Number.isFinite(K(B))}function K(B){let $=B,L=1,A=$[0];if(A==="-"||A==="+"){if(A==="-")L=-1;$=$.slice(1),A=$[0]}if($==="0")return 0;if(A==="0"){if($[1]==="b")return L*parseInt($.slice(2),2);if($[1]==="x")return L*parseInt($.slice(2),16);if($[1]==="o")return L*parseInt($.slice(2),8)}return L*parseInt($,10)}function V(B){return K(B)}function H(B){return Object.prototype.toString.call(B)==="[object Number]"&&B%1===0&&!X.isNegativeZero(B)}W.exports=new Q("tag:yaml.org,2002:int",{kind:"scalar",resolve:q,construct:V,predicate:H,represent:{binary:function(B){return B>=0?"0b"+B.toString(2):"-0b"+B.toString(2).slice(1)},octal:function(B){return B>=0?"0o"+B.toString(8):"-0o"+B.toString(8).slice(1)},decimal:function(B){return B.toString(10)},hexadecimal:function(B){return B>=0?"0x"+B.toString(16).toUpperCase():"-0x"+B.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})}),Z9=G0((Z,W)=>{var X=u6(),Q=O0(),J=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),G=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function z(B){if(B===null)return!1;if(!J.test(B))return!1;if(Number.isFinite(parseFloat(B,10)))return!0;return G.test(B)}function q(B){let $=B.toLowerCase(),L=$[0]==="-"?-1:1;if("+-".indexOf($[0])>=0)$=$.slice(1);if($===".inf")return L===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if($===".nan")return NaN;return L*parseFloat($,10)}var K=/^[-+]?[0-9]+e/;function V(B,$){if(isNaN(B))switch($){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===B)switch($){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===B)switch($){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(X.isNegativeZero(B))return"-0.0";let L=B.toString(10);return K.test(L)?L.replace("e",".e"):L}function H(B){return Object.prototype.toString.call(B)==="[object Number]"&&(B%1!==0||X.isNegativeZero(B))}W.exports=new Q("tag:yaml.org,2002:float",{kind:"scalar",resolve:z,construct:q,predicate:H,represent:V,defaultStyle:"lowercase"})}),W9=G0((Z,W)=>{W.exports=s8().extend({implicit:[o8(),t8(),e8(),Z9()]})}),X9=G0((Z,W)=>{W.exports=W9()}),Q9=G0((Z,W)=>{var X=O0(),Q=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),J=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function G(K){if(K===null)return!1;if(Q.exec(K)!==null)return!0;if(J.exec(K)!==null)return!0;return!1}function z(K){let V=0,H=null,B=Q.exec(K);if(B===null)B=J.exec(K);if(B===null)throw Error("Date resolve error");let $=+B[1],L=+B[2]-1,A=+B[3];if(!B[4])return new Date(Date.UTC($,L,A));let j=+B[4],D=+B[5],R=+B[6];if(B[7]){V=B[7].slice(0,3);while(V.length<3)V+="0";V=+V}if(B[9]){let f=+B[10],p=+(B[11]||0);if(H=(f*60+p)*60000,B[9]==="-")H=-H}let x=new Date(Date.UTC($,L,A,j,D,R,V));if(H)x.setTime(x.getTime()-H);return x}function q(K){return K.toISOString()}W.exports=new X("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:G,construct:z,instanceOf:Date,represent:q})}),J9=G0((Z,W)=>{var X=O0();function Q(J){return J==="<<"||J===null}W.exports=new X("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Q})}),G9=G0((Z,W)=>{var X=O0(),Q=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
28
+ \r`;function J(K){if(K===null)return!1;let V=0,H=K.length,B=Q;for(let $=0;$<H;$++){let L=B.indexOf(K.charAt($));if(L>64)continue;if(L<0)return!1;V+=6}return V%8===0}function G(K){let V=K.replace(/[\r\n=]/g,""),H=V.length,B=Q,$=0,L=[];for(let j=0;j<H;j++){if(j%4===0&&j)L.push($>>16&255),L.push($>>8&255),L.push($&255);$=$<<6|B.indexOf(V.charAt(j))}let A=H%4*6;if(A===0)L.push($>>16&255),L.push($>>8&255),L.push($&255);else if(A===18)L.push($>>10&255),L.push($>>2&255);else if(A===12)L.push($>>4&255);return new Uint8Array(L)}function z(K){let V="",H=0,B=K.length,$=Q;for(let A=0;A<B;A++){if(A%3===0&&A)V+=$[H>>18&63],V+=$[H>>12&63],V+=$[H>>6&63],V+=$[H&63];H=(H<<8)+K[A]}let L=B%3;if(L===0)V+=$[H>>18&63],V+=$[H>>12&63],V+=$[H>>6&63],V+=$[H&63];else if(L===2)V+=$[H>>10&63],V+=$[H>>4&63],V+=$[H<<2&63],V+=$[64];else if(L===1)V+=$[H>>2&63],V+=$[H<<4&63],V+=$[64],V+=$[64];return V}function q(K){return Object.prototype.toString.call(K)==="[object Uint8Array]"}W.exports=new X("tag:yaml.org,2002:binary",{kind:"scalar",resolve:J,construct:G,predicate:q,represent:z})}),z9=G0((Z,W)=>{var X=O0(),Q=Object.prototype.hasOwnProperty,J=Object.prototype.toString;function G(q){if(q===null)return!0;let K=[],V=q;for(let H=0,B=V.length;H<B;H+=1){let $=V[H],L=!1;if(J.call($)!=="[object Object]")return!1;let A;for(A in $)if(Q.call($,A))if(!L)L=!0;else return!1;if(!L)return!1;if(K.indexOf(A)===-1)K.push(A);else return!1}return!0}function z(q){return q!==null?q:[]}W.exports=new X("tag:yaml.org,2002:omap",{kind:"sequence",resolve:G,construct:z})}),Y9=G0((Z,W)=>{var X=O0(),Q=Object.prototype.toString;function J(z){if(z===null)return!0;let q=z,K=Array(q.length);for(let V=0,H=q.length;V<H;V+=1){let B=q[V];if(Q.call(B)!=="[object Object]")return!1;let $=Object.keys(B);if($.length!==1)return!1;K[V]=[$[0],B[$[0]]]}return!0}function G(z){if(z===null)return[];let q=z,K=Array(q.length);for(let V=0,H=q.length;V<H;V+=1){let B=q[V],$=Object.keys(B);K[V]=[$[0],B[$[0]]]}return K}W.exports=new X("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:J,construct:G})}),U9=G0((Z,W)=>{var X=O0(),Q=Object.prototype.hasOwnProperty;function J(z){if(z===null)return!0;let q=z;for(let K in q)if(Q.call(q,K)){if(q[K]!==null)return!1}return!0}function G(z){return z!==null?z:{}}W.exports=new X("tag:yaml.org,2002:set",{kind:"mapping",resolve:J,construct:G})}),m2=G0((Z,W)=>{W.exports=X9().extend({implicit:[Q9(),J9()],explicit:[G9(),z9(),Y9(),U9()]})}),BQ=G0((Z,W)=>{var X=u6(),Q=d6(),J=VQ(),G=m2(),z=Object.prototype.hasOwnProperty,q=1,K=2,V=3,H=4,B=1,$=2,L=3,A=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,j=/[\x85\u2028\u2029]/,D=/[,\[\]{}]/,R=/^(?:!|!!|![0-9A-Za-z-]+!)$/,x=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function f(U){return Object.prototype.toString.call(U)}function p(U){return U===10||U===13}function r(U){return U===9||U===32}function m(U){return U===9||U===32||U===10||U===13}function S(U){return U===44||U===91||U===93||U===123||U===125}function c(U){if(U>=48&&U<=57)return U-48;let M=U|32;if(M>=97&&M<=102)return M-97+10;return-1}function o(U){if(U===120)return 2;if(U===117)return 4;if(U===85)return 8;return 0}function W0(U){if(U>=48&&U<=57)return U-48;return-1}function X0(U){switch(U){case 48:return"\x00";case 97:return"\x07";case 98:return"\b";case 116:return"\t";case 9:return"\t";case 110:return`
29
+ `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"…";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function Q0(U){if(U<=65535)return String.fromCharCode(U);return String.fromCharCode((U-65536>>10)+55296,(U-65536&1023)+56320)}function U0(U,M,N){if(M==="__proto__")Object.defineProperty(U,M,{configurable:!0,enumerable:!0,writable:!0,value:N});else U[M]=N}var J0=Array(256),$0=Array(256);for(let U=0;U<256;U++)J0[U]=X0(U)?1:0,$0[U]=X0(U);function K0(U,M){this.input=U,this.filename=M.filename||null,this.schema=M.schema||G,this.onWarning=M.onWarning||null,this.legacy=M.legacy||!1,this.json=M.json||!1,this.listener=M.listener||null,this.maxDepth=typeof M.maxDepth==="number"?M.maxDepth:100,this.maxMergeSeqLength=typeof M.maxMergeSeqLength==="number"?M.maxMergeSeqLength:20,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=U.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function q4(U,M){let N={name:U.filename,buffer:U.input.slice(0,-1),position:U.position,line:U.line,column:U.position-U.lineStart};return N.snippet=J(N),new Q(M,N)}function u(U,M){throw q4(U,M)}function e1(U,M){if(U.onWarning)U.onWarning.call(null,q4(U,M))}function V1(U,M,N){let _=U.anchorMapTransactions;if(_.length!==0){let w=_[_.length-1];if(!z.call(w,M))w[M]={existed:z.call(U.anchorMap,M),value:U.anchorMap[M]}}U.anchorMap[M]=N}function F2(U){U.anchorMapTransactions.push(Object.create(null))}function d1(U){let M=U.anchorMapTransactions.pop(),N=U.anchorMapTransactions;if(N.length===0)return;let _=N[N.length-1],w=Object.keys(M);for(let k=0,F=w.length;k<F;k+=1){let I=w[k];if(!z.call(_,I))_[I]=M[I]}}function L2(U){let M=U.anchorMapTransactions.pop(),N=Object.keys(M);for(let _=N.length-1;_>=0;_-=1){let w=M[N[_]];if(w.existed)U.anchorMap[N[_]]=w.value;else delete U.anchorMap[N[_]]}}function x6(U){return{position:U.position,line:U.line,lineStart:U.lineStart,lineIndent:U.lineIndent,firstTabInLine:U.firstTabInLine,tag:U.tag,anchor:U.anchor,kind:U.kind,result:U.result}}function Z6(U,M){U.position=M.position,U.line=M.line,U.lineStart=M.lineStart,U.lineIndent=M.lineIndent,U.firstTabInLine=M.firstTabInLine,U.tag=M.tag,U.anchor=M.anchor,U.kind=M.kind,U.result=M.result}var K4={YAML:function(M,N,_){if(M.version!==null)u(M,"duplication of %YAML directive");if(_.length!==1)u(M,"YAML directive accepts exactly one argument");let w=/^([0-9]+)\.([0-9]+)$/.exec(_[0]);if(w===null)u(M,"ill-formed argument of the YAML directive");let k=parseInt(w[1],10),F=parseInt(w[2],10);if(k!==1)u(M,"unacceptable YAML version of the document");if(M.version=_[0],M.checkLineBreaks=F<2,F!==1&&F!==2)e1(M,"unsupported YAML version of the document")},TAG:function(M,N,_){let w;if(_.length!==2)u(M,"TAG directive accepts exactly two arguments");let k=_[0];if(w=_[1],!R.test(k))u(M,"ill-formed tag handle (first argument) of the TAG directive");if(z.call(M.tagMap,k))u(M,'there is a previously declared suffix for "'+k+'" tag handle');if(!x.test(w))u(M,"ill-formed tag prefix (second argument) of the TAG directive");try{w=decodeURIComponent(w)}catch(F){u(M,"tag prefix is malformed: "+w)}M.tagMap[k]=w}};function y0(U,M,N,_){if(M<N){let w=U.input.slice(M,N);if(_)for(let k=0,F=w.length;k<F;k+=1){let I=w.charCodeAt(k);if(!(I===9||I>=32&&I<=1114111))u(U,"expected valid JSON character")}else if(A.test(w))u(U,"the stream contains non-printable characters");U.result+=w}}function j1(U,M,N,_){if(!X.isObject(N))u(U,"cannot merge mappings; the provided source object is unacceptable");let w=Object.keys(N);for(let k=0,F=w.length;k<F;k+=1){let I=w[k];if(!z.call(M,I))U0(M,I,N[I]),_[I]=!0}}function B1(U,M,N,_,w,k,F,I,O){if(Array.isArray(w)){w=Array.prototype.slice.call(w);for(let T=0,P=w.length;T<P;T+=1){if(Array.isArray(w[T]))u(U,"nested arrays are not supported inside keys");if(typeof w==="object"&&f(w[T])==="[object Object]")w[T]="[object Object]"}}if(typeof w==="object"&&f(w)==="[object Object]")w="[object Object]";if(w=String(w),M===null)M={};if(_==="tag:yaml.org,2002:merge")if(Array.isArray(k)){if(k.length>U.maxMergeSeqLength)u(U,"merge sequence length exceeded maxMergeSeqLength ("+U.maxMergeSeqLength+")");let T=new Set;for(let P=0,C=k.length;P<C;P+=1){let E=k[P];if(T.has(E))continue;T.add(E),j1(U,M,E,N)}}else j1(U,M,k,N);else{if(!U.json&&!z.call(N,w)&&z.call(M,w))U.line=F||U.line,U.lineStart=I||U.lineStart,U.position=O||U.position,u(U,"duplicated mapping key");U0(M,w,k),delete N[w]}return M}function W6(U){let M=U.input.charCodeAt(U.position);if(M===10)U.position++;else if(M===13){if(U.position++,U.input.charCodeAt(U.position)===10)U.position++}else u(U,"a line break is expected");U.line+=1,U.lineStart=U.position,U.firstTabInLine=-1}function V0(U,M,N){let _=0,w=U.input.charCodeAt(U.position);while(w!==0){while(r(w)){if(w===9&&U.firstTabInLine===-1)U.firstTabInLine=U.position;w=U.input.charCodeAt(++U.position)}if(M&&w===35)do w=U.input.charCodeAt(++U.position);while(w!==10&&w!==13&&w!==0);if(p(w)){W6(U),w=U.input.charCodeAt(U.position),_++,U.lineIndent=0;while(w===32)U.lineIndent++,w=U.input.charCodeAt(++U.position)}else break}if(N!==-1&&_!==0&&U.lineIndent<N)e1(U,"deficient indentation");return _}function X6(U){let M=U.position,N=U.input.charCodeAt(M);if((N===45||N===46)&&N===U.input.charCodeAt(M+1)&&N===U.input.charCodeAt(M+2)){if(M+=3,N=U.input.charCodeAt(M),N===0||m(N))return!0}return!1}function H1(U,M){if(M===1)U.result+=" ";else if(M>1)U.result+=X.repeat(`
30
+ `,M-1)}function V4(U,M,N){let _,w,k,F,I,O,T=U.kind,P=U.result,C=U.input.charCodeAt(U.position);if(m(C)||S(C)||C===35||C===38||C===42||C===33||C===124||C===62||C===39||C===34||C===37||C===64||C===96)return!1;if(C===63||C===45){let E=U.input.charCodeAt(U.position+1);if(m(E)||N&&S(E))return!1}U.kind="scalar",U.result="",_=w=U.position,k=!1;while(C!==0){if(C===58){let E=U.input.charCodeAt(U.position+1);if(m(E)||N&&S(E))break}else if(C===35){if(m(U.input.charCodeAt(U.position-1)))break}else if(U.position===U.lineStart&&X6(U)||N&&S(C))break;else if(p(C))if(F=U.line,I=U.lineStart,O=U.lineIndent,V0(U,!1,-1),U.lineIndent>=M){k=!0,C=U.input.charCodeAt(U.position);continue}else{U.position=w,U.line=F,U.lineStart=I,U.lineIndent=O;break}if(k)y0(U,_,w,!1),H1(U,U.line-F),_=w=U.position,k=!1;if(!r(C))w=U.position+1;C=U.input.charCodeAt(++U.position)}if(y0(U,_,w,!1),U.result)return!0;return U.kind=T,U.result=P,!1}function B4(U,M){let N,_,w=U.input.charCodeAt(U.position);if(w!==39)return!1;U.kind="scalar",U.result="",U.position++,N=_=U.position;while((w=U.input.charCodeAt(U.position))!==0)if(w===39)if(y0(U,N,U.position,!0),w=U.input.charCodeAt(++U.position),w===39)N=U.position,U.position++,_=U.position;else return!0;else if(p(w))y0(U,N,_,!0),H1(U,V0(U,!1,M)),N=_=U.position;else if(U.position===U.lineStart&&X6(U))u(U,"unexpected end of the document within a single quoted scalar");else if(U.position++,!r(w))_=U.position;u(U,"unexpected end of the stream within a single quoted scalar")}function k6(U,M){let N,_,w,k=U.input.charCodeAt(U.position);if(k!==34)return!1;U.kind="scalar",U.result="",U.position++,N=_=U.position;while((k=U.input.charCodeAt(U.position))!==0)if(k===34)return y0(U,N,U.position,!0),U.position++,!0;else if(k===92){if(y0(U,N,U.position,!0),k=U.input.charCodeAt(++U.position),p(k))V0(U,!1,M);else if(k<256&&J0[k])U.result+=$0[k],U.position++;else if((w=o(k))>0){let F=w,I=0;for(;F>0;F--)if(k=U.input.charCodeAt(++U.position),(w=c(k))>=0)I=(I<<4)+w;else u(U,"expected hexadecimal character");U.result+=Q0(I),U.position++}else u(U,"unknown escape sequence");N=_=U.position}else if(p(k))y0(U,N,_,!0),H1(U,V0(U,!1,M)),N=_=U.position;else if(U.position===U.lineStart&&X6(U))u(U,"unexpected end of the document within a double quoted scalar");else if(U.position++,!r(k))_=U.position;u(U,"unexpected end of the stream within a double quoted scalar")}function H4(U,M){let N=!0,_,w,k,F=U.tag,I,O=U.anchor,T,P,C,E,h=Object.create(null),b,l,n,t=U.input.charCodeAt(U.position);if(t===91)T=93,E=!1,I=[];else if(t===123)T=125,E=!0,I={};else return!1;if(U.anchor!==null)V1(U,U.anchor,I);t=U.input.charCodeAt(++U.position);while(t!==0){if(V0(U,!0,M),t=U.input.charCodeAt(U.position),t===T)return U.position++,U.tag=F,U.anchor=O,U.kind=E?"mapping":"sequence",U.result=I,!0;else if(!N)u(U,"missed comma between flow collection entries");else if(t===44)u(U,"expected the node content, but found ','");if(l=b=n=null,P=C=!1,t===63){if(m(U.input.charCodeAt(U.position+1)))P=C=!0,U.position++,V0(U,!0,M)}if(_=U.line,w=U.lineStart,k=U.position,F1(U,M,q,!1,!0),l=U.tag,b=U.result,V0(U,!0,M),t=U.input.charCodeAt(U.position),(C||U.line===_)&&t===58)P=!0,t=U.input.charCodeAt(++U.position),V0(U,!0,M),F1(U,M,q,!1,!0),n=U.result;if(E)B1(U,I,h,l,b,n,_,w,k);else if(P)I.push(B1(U,null,h,l,b,n,_,w,k));else I.push(b);if(V0(U,!0,M),t=U.input.charCodeAt(U.position),t===44)N=!0,t=U.input.charCodeAt(++U.position);else N=!1}u(U,"unexpected end of the stream within a flow collection")}function $4(U,M){let N,_=B,w=!1,k=!1,F=M,I=0,O=!1,T,P=U.input.charCodeAt(U.position);if(P===124)N=!1;else if(P===62)N=!0;else return!1;U.kind="scalar",U.result="";while(P!==0)if(P=U.input.charCodeAt(++U.position),P===43||P===45)if(B===_)_=P===43?L:$;else u(U,"repeat of a chomping mode identifier");else if((T=W0(P))>=0)if(T===0)u(U,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!k)F=M+T-1,k=!0;else u(U,"repeat of an indentation width identifier");else break;if(r(P)){do P=U.input.charCodeAt(++U.position);while(r(P));if(P===35)do P=U.input.charCodeAt(++U.position);while(!p(P)&&P!==0)}while(P!==0){W6(U),U.lineIndent=0,P=U.input.charCodeAt(U.position);while((!k||U.lineIndent<F)&&P===32)U.lineIndent++,P=U.input.charCodeAt(++U.position);if(!k&&U.lineIndent>F)F=U.lineIndent;if(p(P)){I++;continue}if(!k&&F===0)u(U,"missing indentation for block scalar");if(U.lineIndent<F){if(_===L)U.result+=X.repeat(`
31
+ `,w?1+I:I);else if(_===B){if(w)U.result+=`
32
+ `}break}if(N)if(r(P))O=!0,U.result+=X.repeat(`
33
+ `,w?1+I:I);else if(O)O=!1,U.result+=X.repeat(`
34
+ `,I+1);else if(I===0){if(w)U.result+=" "}else U.result+=X.repeat(`
35
+ `,I);else U.result+=X.repeat(`
36
+ `,w?1+I:I);w=!0,k=!0,I=0;let C=U.position;while(!p(P)&&P!==0)P=U.input.charCodeAt(++U.position);y0(U,C,U.position,!1)}return!0}function $1(U,M){let{tag:N,anchor:_}=U,w=[],k=!1;if(U.firstTabInLine!==-1)return!1;if(U.anchor!==null)V1(U,U.anchor,w);let F=U.input.charCodeAt(U.position);while(F!==0){if(U.firstTabInLine!==-1)U.position=U.firstTabInLine,u(U,"tab characters must not be used in indentation");if(F!==45)break;if(!m(U.input.charCodeAt(U.position+1)))break;if(k=!0,U.position++,V0(U,!0,-1)){if(U.lineIndent<=M){w.push(null),F=U.input.charCodeAt(U.position);continue}}let I=U.line;if(F1(U,M,V,!1,!0),w.push(U.result),V0(U,!0,-1),F=U.input.charCodeAt(U.position),(U.line===I||U.lineIndent>M)&&F!==0)u(U,"bad indentation of a sequence entry");else if(U.lineIndent<M)break}if(k)return U.tag=N,U.anchor=_,U.kind="sequence",U.result=w,!0;return!1}function F4(U,M,N){let _,w,k,F,I=U.tag,O=U.anchor,T={},P=Object.create(null),C=null,E=null,h=null,b=!1,l=!1;if(U.firstTabInLine!==-1)return!1;if(U.anchor!==null)V1(U,U.anchor,T);let n=U.input.charCodeAt(U.position);while(n!==0){if(!b&&U.firstTabInLine!==-1)U.position=U.firstTabInLine,u(U,"tab characters must not be used in indentation");let t=U.input.charCodeAt(U.position+1),q0=U.line;if((n===63||n===58)&&m(t)){if(n===63){if(b)B1(U,T,P,C,E,null,w,k,F),C=E=h=null;l=!0,b=!0,_=!0}else if(b)b=!1,_=!0;else u(U,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");U.position+=1,n=t}else{if(w=U.line,k=U.lineStart,F=U.position,!F1(U,N,K,!1,!0))break;if(U.line===q0){n=U.input.charCodeAt(U.position);while(r(n))n=U.input.charCodeAt(++U.position);if(n===58){if(n=U.input.charCodeAt(++U.position),!m(n))u(U,"a whitespace character is expected after the key-value separator within a block mapping");if(b)B1(U,T,P,C,E,null,w,k,F),C=E=h=null;l=!0,b=!1,_=!1,C=U.tag,E=U.result}else if(l)u(U,"can not read an implicit mapping pair; a colon is missed");else return U.tag=I,U.anchor=O,!0}else if(l)u(U,"can not read a block mapping entry; a multiline key may not be an implicit key");else return U.tag=I,U.anchor=O,!0}if(U.line===q0||U.lineIndent>M){if(b)w=U.line,k=U.lineStart,F=U.position;if(F1(U,M,H,!0,_))if(b)E=U.result;else h=U.result;if(!b)B1(U,T,P,C,E,h,w,k,F),C=E=h=null;V0(U,!0,-1),n=U.input.charCodeAt(U.position)}if((U.line===q0||U.lineIndent>M)&&n!==0)u(U,"bad indentation of a mapping entry");else if(U.lineIndent<M)break}if(b)B1(U,T,P,C,E,null,w,k,F);if(l)U.tag=I,U.anchor=O,U.kind="mapping",U.result=T;return l}function A2(U){let M=!1,N=!1,_,w,k=U.input.charCodeAt(U.position);if(k!==33)return!1;if(U.tag!==null)u(U,"duplication of a tag property");if(k=U.input.charCodeAt(++U.position),k===60)M=!0,k=U.input.charCodeAt(++U.position);else if(k===33)N=!0,_="!!",k=U.input.charCodeAt(++U.position);else _="!";let F=U.position;if(M){do k=U.input.charCodeAt(++U.position);while(k!==0&&k!==62);if(U.position<U.length)w=U.input.slice(F,U.position),k=U.input.charCodeAt(++U.position);else u(U,"unexpected end of the stream within a verbatim tag")}else{while(k!==0&&!m(k)){if(k===33)if(!N){if(_=U.input.slice(F-1,U.position+1),!R.test(_))u(U,"named tag handle cannot contain such characters");N=!0,F=U.position+1}else u(U,"tag suffix cannot contain exclamation marks");k=U.input.charCodeAt(++U.position)}if(w=U.input.slice(F,U.position),D.test(w))u(U,"tag suffix cannot contain flow indicator characters")}if(w&&!x.test(w))u(U,"tag name cannot contain such characters: "+w);try{w=decodeURIComponent(w)}catch(I){u(U,"tag name is malformed: "+w)}if(M)U.tag=w;else if(z.call(U.tagMap,_))U.tag=U.tagMap[_]+w;else if(_==="!")U.tag="!"+w;else if(_==="!!")U.tag="tag:yaml.org,2002:"+w;else u(U,'undeclared tag handle "'+_+'"');return!0}function L4(U){let M=U.input.charCodeAt(U.position);if(M!==38)return!1;if(U.anchor!==null)u(U,"duplication of an anchor property");M=U.input.charCodeAt(++U.position);let N=U.position;while(M!==0&&!m(M)&&!S(M))M=U.input.charCodeAt(++U.position);if(U.position===N)u(U,"name of an anchor node must contain at least one character");return U.anchor=U.input.slice(N,U.position),!0}function A4(U){let M=U.input.charCodeAt(U.position);if(M!==42)return!1;M=U.input.charCodeAt(++U.position);let N=U.position;while(M!==0&&!m(M)&&!S(M))M=U.input.charCodeAt(++U.position);if(U.position===N)u(U,"name of an alias node must contain at least one character");let _=U.input.slice(N,U.position);if(!z.call(U.anchorMap,_))u(U,'unidentified alias "'+_+'"');return U.result=U.anchorMap[_],V0(U,!0,-1),!0}function M2(U,M,N,_){let w=x6(U);if(F2(U),Z6(U,M),U.tag=null,U.anchor=null,U.kind=null,U.result=null,F4(U,N,_)&&U.kind==="mapping")return d1(U),!0;return L2(U),Z6(U,w),!1}function F1(U,M,N,_,w){let k,F,I=1,O=!1,T=!1,P=null,C,E,h;if(U.depth>=U.maxDepth)u(U,"nesting exceeded maxDepth ("+U.maxDepth+")");if(U.depth+=1,U.listener!==null)U.listener("open",U);U.tag=null,U.anchor=null,U.kind=null,U.result=null;let b=k=F=H===N||V===N;if(_){if(V0(U,!0,-1)){if(O=!0,U.lineIndent>M)I=1;else if(U.lineIndent===M)I=0;else if(U.lineIndent<M)I=-1}}if(I===1)while(!0){let l=U.input.charCodeAt(U.position),n=x6(U);if(O&&(l===33&&U.tag!==null||l===38&&U.anchor!==null))break;if(!A2(U)&&!L4(U))break;if(P===null)P=n;if(V0(U,!0,-1)){if(O=!0,F=b,U.lineIndent>M)I=1;else if(U.lineIndent===M)I=0;else if(U.lineIndent<M)I=-1}else F=!1}if(F)F=O||w;if(I===1||H===N){if(q===N||K===N)E=M;else E=M+1;if(h=U.position-U.lineStart,I===1)if(F&&($1(U,h)||F4(U,h,E))||H4(U,E))T=!0;else{let l=U.input.charCodeAt(U.position);if(P!==null&&b&&!F&&l!==124&&l!==62&&M2(U,P,P.position-P.lineStart,E))T=!0;else if(k&&$4(U,E)||B4(U,E)||k6(U,E))T=!0;else if(A4(U)){if(T=!0,U.tag!==null||U.anchor!==null)u(U,"alias node should not have any properties")}else if(V4(U,E,q===N)){if(T=!0,U.tag===null)U.tag="?"}if(U.anchor!==null)V1(U,U.anchor,U.result)}else if(I===0)T=F&&$1(U,h)}if(U.tag===null){if(U.anchor!==null)V1(U,U.anchor,U.result)}else if(U.tag==="?"){if(U.result!==null&&U.kind!=="scalar")u(U,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+U.kind+'"');for(let l=0,n=U.implicitTypes.length;l<n;l+=1)if(C=U.implicitTypes[l],C.resolve(U.result)){if(U.result=C.construct(U.result),U.tag=C.tag,U.anchor!==null)V1(U,U.anchor,U.result);break}}else if(U.tag!=="!"){if(z.call(U.typeMap[U.kind||"fallback"],U.tag))C=U.typeMap[U.kind||"fallback"][U.tag];else{C=null;let l=U.typeMap.multi[U.kind||"fallback"];for(let n=0,t=l.length;n<t;n+=1)if(U.tag.slice(0,l[n].tag.length)===l[n].tag){C=l[n];break}}if(!C)u(U,"unknown tag !<"+U.tag+">");if(U.result!==null&&C.kind!==U.kind)u(U,"unacceptable node kind for !<"+U.tag+'> tag; it should be "'+C.kind+'", not "'+U.kind+'"');if(!C.resolve(U.result,U.tag))u(U,"cannot resolve a node with !<"+U.tag+"> explicit tag");else if(U.result=C.construct(U.result,U.tag),U.anchor!==null)V1(U,U.anchor,U.result)}if(U.listener!==null)U.listener("close",U);return U.depth-=1,U.tag!==null||U.anchor!==null||T}function I2(U){let M=U.position,N=!1,_;U.version=null,U.checkLineBreaks=U.legacy,U.tagMap=Object.create(null),U.anchorMap=Object.create(null);while((_=U.input.charCodeAt(U.position))!==0){if(V0(U,!0,-1),_=U.input.charCodeAt(U.position),U.lineIndent>0||_!==37)break;N=!0,_=U.input.charCodeAt(++U.position);let w=U.position;while(_!==0&&!m(_))_=U.input.charCodeAt(++U.position);let k=U.input.slice(w,U.position),F=[];if(k.length<1)u(U,"directive name must not be less than one character in length");while(_!==0){while(r(_))_=U.input.charCodeAt(++U.position);if(_===35){do _=U.input.charCodeAt(++U.position);while(_!==0&&!p(_));break}if(p(_))break;w=U.position;while(_!==0&&!m(_))_=U.input.charCodeAt(++U.position);F.push(U.input.slice(w,U.position))}if(_!==0)W6(U);if(z.call(K4,k))K4[k](U,k,F);else e1(U,'unknown document directive "'+k+'"')}if(V0(U,!0,-1),U.lineIndent===0&&U.input.charCodeAt(U.position)===45&&U.input.charCodeAt(U.position+1)===45&&U.input.charCodeAt(U.position+2)===45)U.position+=3,V0(U,!0,-1);else if(N)u(U,"directives end mark is expected");if(F1(U,U.lineIndent-1,H,!1,!0),V0(U,!0,-1),U.checkLineBreaks&&j.test(U.input.slice(M,U.position)))e1(U,"non-ASCII line breaks are interpreted as content");if(U.documents.push(U.result),U.position===U.lineStart&&X6(U)){if(U.input.charCodeAt(U.position)===46)U.position+=3,V0(U,!0,-1);return}if(U.position<U.length-1)u(U,"end of the stream or a document separator is expected")}function M4(U,M){if(U=String(U),M=M||{},U.length!==0){if(U.charCodeAt(U.length-1)!==10&&U.charCodeAt(U.length-1)!==13)U+=`
37
+ `;if(U.charCodeAt(0)===65279)U=U.slice(1)}let N=new K0(U,M),_=U.indexOf("\x00");if(_!==-1)N.position=_,u(N,"null byte is not allowed in input");N.input+="\x00";while(N.input.charCodeAt(N.position)===32)N.lineIndent+=1,N.position+=1;while(N.position<N.length-1)I2(N);return N.documents}function I4(U,M,N){if(M!==null&&typeof M==="object"&&typeof N>"u")N=M,M=null;let _=M4(U,N);if(typeof M!=="function")return _;for(let w=0,k=_.length;w<k;w+=1)M(_[w])}function w2(U,M){let N=M4(U,M);if(N.length===0)return;else if(N.length===1)return N[0];throw new Q("expected a single document in the stream, but found more")}W.exports.loadAll=I4,W.exports.load=w2}),HQ=G0((Z,W)=>{var X=u6(),Q=d6(),J=m2(),G=Object.prototype.toString,z=Object.prototype.hasOwnProperty,q=65279,K=9,V=10,H=13,B=32,$=33,L=34,A=35,j=37,D=38,R=39,x=42,f=44,p=45,r=58,m=61,S=62,c=63,o=64,W0=91,X0=93,Q0=96,U0=123,J0=124,$0=125,K0={};K0[0]="\\0",K0[7]="\\a",K0[8]="\\b",K0[9]="\\t",K0[10]="\\n",K0[11]="\\v",K0[12]="\\f",K0[13]="\\r",K0[27]="\\e",K0[34]="\\\"",K0[92]="\\\\",K0[133]="\\N",K0[160]="\\_",K0[8232]="\\L",K0[8233]="\\P";var q4=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],u=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function e1(F,I){if(I===null)return{};let O={},T=Object.keys(I);for(let P=0,C=T.length;P<C;P+=1){let E=T[P],h=String(I[E]);if(E.slice(0,2)==="!!")E="tag:yaml.org,2002:"+E.slice(2);let b=F.compiledTypeMap.fallback[E];if(b&&z.call(b.styleAliases,h))h=b.styleAliases[h];O[E]=h}return O}function V1(F){let I,O,T=F.toString(16).toUpperCase();if(F<=255)I="x",O=2;else if(F<=65535)I="u",O=4;else if(F<=4294967295)I="U",O=8;else throw new Q("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+I+X.repeat("0",O-T.length)+T}var F2=1,d1=2;function L2(F){this.schema=F.schema||J,this.indent=Math.max(1,F.indent||2),this.noArrayIndent=F.noArrayIndent||!1,this.skipInvalid=F.skipInvalid||!1,this.flowLevel=X.isNothing(F.flowLevel)?-1:F.flowLevel,this.styleMap=e1(this.schema,F.styles||null),this.sortKeys=F.sortKeys||!1,this.lineWidth=F.lineWidth||80,this.noRefs=F.noRefs||!1,this.noCompatMode=F.noCompatMode||!1,this.condenseFlow=F.condenseFlow||!1,this.quotingType=F.quotingType==='"'?d1:F2,this.forceQuotes=F.forceQuotes||!1,this.replacer=typeof F.replacer==="function"?F.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function x6(F,I){let O=X.repeat(" ",I),T=0,P="",C=F.length;while(T<C){let E,h=F.indexOf(`
38
+ `,T);if(h===-1)E=F.slice(T),T=C;else E=F.slice(T,h+1),T=h+1;if(E.length&&E!==`
39
+ `)P+=O;P+=E}return P}function Z6(F,I){return`
40
+ `+X.repeat(" ",F.indent*I)}function K4(F,I){for(let O=0,T=F.implicitTypes.length;O<T;O+=1)if(F.implicitTypes[O].resolve(I))return!0;return!1}function y0(F){return F===B||F===K}function j1(F){return F>=32&&F<=126||F>=161&&F<=55295&&F!==8232&&F!==8233||F>=57344&&F<=65533&&F!==q||F>=65536&&F<=1114111}function B1(F){return j1(F)&&F!==q&&F!==H&&F!==V}function W6(F,I,O){let T=B1(F),P=T&&!y0(F);return(O?T:T&&F!==f&&F!==W0&&F!==X0&&F!==U0&&F!==$0)&&F!==A&&!(I===r&&!P)||B1(I)&&!y0(I)&&F===A||I===r&&P}function V0(F){return j1(F)&&F!==q&&!y0(F)&&F!==p&&F!==c&&F!==r&&F!==f&&F!==W0&&F!==X0&&F!==U0&&F!==$0&&F!==A&&F!==D&&F!==x&&F!==$&&F!==J0&&F!==m&&F!==S&&F!==R&&F!==L&&F!==j&&F!==o&&F!==Q0}function X6(F){return!y0(F)&&F!==r}function H1(F,I){let O=F.charCodeAt(I),T;if(O>=55296&&O<=56319&&I+1<F.length){if(T=F.charCodeAt(I+1),T>=56320&&T<=57343)return(O-55296)*1024+T-56320+65536}return O}function V4(F){return/^\n* /.test(F)}var B4=1,k6=2,H4=3,$4=4,$1=5;function F4(F,I,O,T,P,C,E,h){let b,l=0,n=null,t=!1,q0=!1,V8=T!==-1,S6=-1,b6=V0(H1(F,0))&&X6(H1(F,F.length-1));if(I||E)for(b=0;b<F.length;l>=65536?b+=2:b++){if(l=H1(F,b),!j1(l))return $1;b6=b6&&W6(l,n,h),n=l}else{for(b=0;b<F.length;l>=65536?b+=2:b++){if(l=H1(F,b),l===V){if(t=!0,V8)q0=q0||b-S6-1>T&&F[S6+1]!==" ",S6=b}else if(!j1(l))return $1;b6=b6&&W6(l,n,h),n=l}q0=q0||V8&&b-S6-1>T&&F[S6+1]!==" "}if(!t&&!q0){if(b6&&!E&&!P(F))return B4;return C===d1?$1:k6}if(O>9&&V4(F))return $1;if(!E)return q0?$4:H4;return C===d1?$1:k6}function A2(F,I,O,T,P){F.dump=function(){if(I.length===0)return F.quotingType===d1?'""':"''";if(!F.noCompatMode){if(q4.indexOf(I)!==-1||u.test(I))return F.quotingType===d1?'"'+I+'"':"'"+I+"'"}let C=F.indent*Math.max(1,O),E=F.lineWidth===-1?-1:Math.max(Math.min(F.lineWidth,40),F.lineWidth-C),h=T||F.flowLevel>-1&&O>=F.flowLevel;function b(l){return K4(F,l)}switch(F4(I,h,F.indent,E,b,F.quotingType,F.forceQuotes&&!T,P)){case B4:return I;case k6:return"'"+I.replace(/'/g,"''")+"'";case H4:return"|"+L4(I,F.indent)+A4(x6(I,C));case $4:return">"+L4(I,F.indent)+A4(x6(M2(I,E),C));case $1:return'"'+I2(I,E)+'"';default:throw new Q("impossible error: invalid scalar style")}}()}function L4(F,I){let O=V4(F)?String(I):"",T=F[F.length-1]===`
41
+ `;return O+(T&&(F[F.length-2]===`
42
+ `||F===`
43
+ `)?"+":T?"":"-")+`
44
+ `}function A4(F){return F[F.length-1]===`
45
+ `?F.slice(0,-1):F}function M2(F,I){let O=/(\n+)([^\n]*)/g,T=function(){let h=F.indexOf(`
46
+ `);return h=h!==-1?h:F.length,O.lastIndex=h,F1(F.slice(0,h),I)}(),P=F[0]===`
47
+ `||F[0]===" ",C,E;while(E=O.exec(F)){let h=E[1],b=E[2];C=b[0]===" ",T+=h+(!P&&!C&&b!==""?`
48
+ `:"")+F1(b,I),P=C}return T}function F1(F,I){if(F===""||F[0]===" ")return F;let O=/ [^ ]/g,T,P=0,C,E=0,h=0,b="";while(T=O.exec(F)){if(h=T.index,h-P>I)C=E>P?E:h,b+=`
49
+ `+F.slice(P,C),P=C+1;E=h}if(b+=`
50
+ `,F.length-P>I&&E>P)b+=F.slice(P,E)+`
51
+ `+F.slice(E+1);else b+=F.slice(P);return b.slice(1)}function I2(F){let I="",O=0;for(let T=0;T<F.length;O>=65536?T+=2:T++){O=H1(F,T);let P=K0[O];if(!P&&j1(O)){if(I+=F[T],O>=65536)I+=F[T+1]}else I+=P||V1(O)}return I}function M4(F,I,O){let T="",P=F.tag;for(let C=0,E=O.length;C<E;C+=1){let h=O[C];if(F.replacer)h=F.replacer.call(O,String(C),h);if(N(F,I,h,!1,!1)||typeof h>"u"&&N(F,I,null,!1,!1)){if(T!=="")T+=","+(!F.condenseFlow?" ":"");T+=F.dump}}F.tag=P,F.dump="["+T+"]"}function I4(F,I,O,T){let P="",C=F.tag;for(let E=0,h=O.length;E<h;E+=1){let b=O[E];if(F.replacer)b=F.replacer.call(O,String(E),b);if(N(F,I+1,b,!0,!0,!1,!0)||typeof b>"u"&&N(F,I+1,null,!0,!0,!1,!0)){if(!T||P!=="")P+=Z6(F,I);if(F.dump&&V===F.dump.charCodeAt(0))P+="-";else P+="- ";P+=F.dump}}F.tag=C,F.dump=P||"[]"}function w2(F,I,O){let T="",P=F.tag,C=Object.keys(O);for(let E=0,h=C.length;E<h;E+=1){let b="";if(T!=="")b+=", ";if(F.condenseFlow)b+='"';let l=C[E],n=O[l];if(F.replacer)n=F.replacer.call(O,l,n);if(!N(F,I,l,!1,!1))continue;if(F.dump.length>1024)b+="? ";if(b+=F.dump+(F.condenseFlow?'"':"")+":"+(F.condenseFlow?"":" "),!N(F,I,n,!1,!1))continue;b+=F.dump,T+=b}F.tag=P,F.dump="{"+T+"}"}function U(F,I,O,T){let P="",C=F.tag,E=Object.keys(O);if(F.sortKeys===!0)E.sort();else if(typeof F.sortKeys==="function")E.sort(F.sortKeys);else if(F.sortKeys)throw new Q("sortKeys must be a boolean or a function");for(let h=0,b=E.length;h<b;h+=1){let l="";if(!T||P!=="")l+=Z6(F,I);let n=E[h],t=O[n];if(F.replacer)t=F.replacer.call(O,n,t);if(!N(F,I+1,n,!0,!0,!0))continue;let q0=F.tag!==null&&F.tag!=="?"||F.dump&&F.dump.length>1024;if(q0)if(F.dump&&V===F.dump.charCodeAt(0))l+="?";else l+="? ";if(l+=F.dump,q0)l+=Z6(F,I);if(!N(F,I+1,t,!0,q0))continue;if(F.dump&&V===F.dump.charCodeAt(0))l+=":";else l+=": ";l+=F.dump,P+=l}F.tag=C,F.dump=P||"{}"}function M(F,I,O){let T=O?F.explicitTypes:F.implicitTypes;for(let P=0,C=T.length;P<C;P+=1){let E=T[P];if((E.instanceOf||E.predicate)&&(!E.instanceOf||typeof I==="object"&&I instanceof E.instanceOf)&&(!E.predicate||E.predicate(I))){if(O)if(E.multi&&E.representName)F.tag=E.representName(I);else F.tag=E.tag;else F.tag="?";if(E.represent){let h=F.styleMap[E.tag]||E.defaultStyle,b;if(G.call(E.represent)==="[object Function]")b=E.represent(I,h);else if(z.call(E.represent,h))b=E.represent[h](I,h);else throw new Q("!<"+E.tag+'> tag resolver accepts not "'+h+'" style');F.dump=b}return!0}}return!1}function N(F,I,O,T,P,C,E){if(F.tag=null,F.dump=O,!M(F,O,!1))M(F,O,!0);let h=G.call(F.dump),b=T;if(T)T=F.flowLevel<0||F.flowLevel>I;let l=h==="[object Object]"||h==="[object Array]",n,t;if(l)n=F.duplicates.indexOf(O),t=n!==-1;if(F.tag!==null&&F.tag!=="?"||t||F.indent!==2&&I>0)P=!1;if(t&&F.usedDuplicates[n])F.dump="*ref_"+n;else{if(l&&t&&!F.usedDuplicates[n])F.usedDuplicates[n]=!0;if(h==="[object Object]"){if(T&&Object.keys(F.dump).length!==0){if(U(F,I,F.dump,P),t)F.dump="&ref_"+n+F.dump}else if(w2(F,I,F.dump),t)F.dump="&ref_"+n+" "+F.dump}else if(h==="[object Array]"){if(T&&F.dump.length!==0){if(F.noArrayIndent&&!E&&I>0)I4(F,I-1,F.dump,P);else I4(F,I,F.dump,P);if(t)F.dump="&ref_"+n+F.dump}else if(M4(F,I,F.dump),t)F.dump="&ref_"+n+" "+F.dump}else if(h==="[object String]"){if(F.tag!=="?")A2(F,F.dump,I,C,b)}else if(h==="[object Undefined]")return!1;else{if(F.skipInvalid)return!1;throw new Q("unacceptable kind of an object to dump "+h)}if(F.tag!==null&&F.tag!=="?"){let q0=encodeURI(F.tag[0]==="!"?F.tag.slice(1):F.tag).replace(/!/g,"%21");if(F.tag[0]==="!")q0="!"+q0;else if(q0.slice(0,18)==="tag:yaml.org,2002:")q0="!!"+q0.slice(18);else q0="!<"+q0+">";F.dump=q0+" "+F.dump}}return!0}function _(F,I){let O=[],T=[];w(F,O,T);let P=T.length;for(let C=0;C<P;C+=1)I.duplicates.push(O[T[C]]);I.usedDuplicates=Array(P)}function w(F,I,O){if(F!==null&&typeof F==="object"){let T=I.indexOf(F);if(T!==-1){if(O.indexOf(T)===-1)O.push(T)}else if(I.push(F),Array.isArray(F))for(let P=0,C=F.length;P<C;P+=1)w(F[P],I,O);else{let P=Object.keys(F);for(let C=0,E=P.length;C<E;C+=1)w(F[P[C]],I,O)}}}function k(F,I){I=I||{};let O=new L2(I);if(!O.noRefs)_(F,O);let T=F;if(O.replacer)T=O.replacer.call({"":T},"",T);if(N(O,0,T,!0,!0))return O.dump+`
52
+ `;return""}W.exports.dump=k}),q9=KQ(G0((Z,W)=>{var X=BQ(),Q=HQ();function J(G,z){return function(){throw Error("Function yaml."+G+" is removed in js-yaml 4. Use yaml."+z+" instead, which is now safe by default.")}}W.exports.Type=O0(),W.exports.Schema=n8(),W.exports.FAILSAFE_SCHEMA=s8(),W.exports.JSON_SCHEMA=W9(),W.exports.CORE_SCHEMA=X9(),W.exports.DEFAULT_SCHEMA=m2(),W.exports.load=X.load,W.exports.loadAll=X.loadAll,W.exports.dump=Q.dump,W.exports.YAMLException=d6(),W.exports.types={binary:G9(),float:Z9(),map:a8(),null:o8(),pairs:Y9(),set:U9(),timestamp:Q9(),bool:t8(),int:e8(),merge:J9(),omap:z9(),seq:r8(),str:i8()},W.exports.safeLoad=J("safeLoad","load"),W.exports.safeLoadAll=J("safeLoadAll","loadAll"),W.exports.safeDump=J("safeDump","dump")})(),1),{Type:QB,Schema:JB,FAILSAFE_SCHEMA:GB,JSON_SCHEMA:K9,CORE_SCHEMA:zB,DEFAULT_SCHEMA:YB,load:UB,loadAll:qB,dump:KB,YAMLException:VB,types:BB,safeLoad:HB,safeLoadAll:$B,safeDump:FB}=q9.default,u2=q9.default});var V9;var B9=d(()=>{p0();d2();d2();V9={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(Z){let W=Z.data;if(Buffer.isBuffer(W))W=W.toString();if(typeof W==="string")try{return u2.load(W,{schema:K9})}catch{try{return u2.load(W)}catch(X){throw new l0(X?.message||"Parser Error",Z.url)}}else return W}}});var $Q,H9;var $9=d(()=>{p0();$Q=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,H9={order:300,allowEmpty:!0,encoding:"utf8",canParse(Z){return(typeof Z.data==="string"||Buffer.isBuffer(Z.data))&&$Q.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 l0("data is not text",Z.url)}}});var FQ,F9;var L9=d(()=>{FQ=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,F9={order:400,allowEmpty:!0,canParse(Z){return Buffer.isBuffer(Z.data)&&FQ.test(Z.url)},parse(Z){if(Buffer.isBuffer(Z.data))return Z.data;else return Buffer.from(Z.data)}}});var c2;var l2=d(()=>{S0();p0();c2={order:100,canRead(Z){return j4(Z.url)},async read(Z){let W,X=await import("fs");try{W=B6(Z.url)}catch(Q){let J=Q;throw J.message=`Malformed URI: ${Z.url}: ${J.message}`,new o0(J,Z.url)}if(W.endsWith("/")||W.endsWith("\\"))W=W.slice(0,-1);try{return await X.promises.readFile(W)}catch(Q){let J=Q;throw J.message=`Error opening file ${W}: ${J.message}`,new o0(J,W)}}}});async function A9(Z,W,X){Z=V6(Z);let Q=X||[];Q.push(Z.href);try{if(W.safeUrlResolver&&_4(Z.href))throw Error(`Unsafe URL blocked by safeUrlResolver: ${Z.href}`);let J=await LQ(Z,W);if(J.status>=400){let G=Error(`HTTP ERROR ${J.status}`);throw G.status=J.status,G}else if(J.status>=300)if(!Number.isNaN(W.redirects)&&Q.length>W.redirects){let G=Error(`Error downloading ${Q[0]}.
52
53
  Too many redirects:
53
- ${W.join(`
54
- `)}`);throw J.status=Q.status,new x0(J)}else if(!("location"in Q.headers)||!Q.headers.location){let J=Error(`HTTP ${Q.status} redirect with no location header`);throw J.status=Q.status,J}else{let J=r(Z.href,Q.headers.location);return E9(J,X,W)}else{if(Q.body){let J=await Q.arrayBuffer();return Buffer.from(J)}return Buffer.alloc(0)}}catch(Q){let J=Q;throw J.message=`Error downloading ${Z.href}: ${J.message}`,new x0(J,Z.href)}}async function EJ(Z,X){let q,W;if(X.timeout&&typeof AbortController<"u")q=new AbortController,W=setTimeout(()=>q.abort(),X.timeout);let Q=await fetch(Z,{method:"GET",headers:X.headers||{},credentials:X.withCredentials?"include":"same-origin",signal:q?q.signal:null});if(W)clearTimeout(W);return Q}var E5;var C5=R(()=>{H0();P0();E5={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return G8(Z.url)&&(!this.safeUrlResolver||!X5(Z.url))},read(Z){let X=u6(Z.url);if(typeof window<"u"&&!X.protocol)X.protocol=u6(location.href).protocol;return E9(X,this)}}});function k9(Z,X){if(C9(X)){let q=Object.keys(X).filter((W)=>!["__proto__","constructor","prototype"].includes(W));for(let W=0;W<q.length;W++){let Q=q[W],J=X[Q],z=Z[Q];if(C9(J))Z[Q]=k9(z||{},J);else if(J!==void 0)Z[Q]=J}}return Z}function C9(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var O9=()=>{return{parse:{json:{...M8},yaml:{...N9},text:{...R9},binary:{...P9}},resolve:{file:{...P5},http:{...E5},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},x9=(Z)=>{let X=O9();if(Z)k9(X,Z);return X};var O5=R(()=>{L8();T9();_9();j9();j5();C5()});function CJ(Z){let X,q,W,Q,J=Array.prototype.slice.call(Z);if(typeof J[J.length-1]==="function")Q=J.pop();if(typeof J[0]==="string")if(X=J[0],typeof J[2]==="object")q=J[1],W=J[2];else q=void 0,W=J[1];else X="",q=J[0],W=J[1];try{W=x9(W)}catch(z){console.error(`JSON Schema Ref Parser: Error normalizing options: ${z}`)}if(!W.mutateInputSchema&&typeof q==="object")q=JSON.parse(JSON.stringify(q));return{path:X,schema:q,options:W,callback:Q}}var N4;var S9=R(()=>{O5();N4=CJ});function OJ(Z,X){if(!X.resolve?.external)return Promise.resolve();try{let q=Z.$refs._root$Ref.dynamicIdScope?U0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,W=x5(Z.schema,Z.$refs._root$Ref.path+"#",q,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,X);return Promise.all(W)}catch(q){return Promise.reject(q)}}function x5(Z,X,q,W,Q,J,z,Y){z||=new Set;let U=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!z.has(Z)){z.add(Z);let K=q;if(d.isExternal$Ref(Z))U.push(xJ(Z,X,K,W,Q,J));let V=Object.keys(Z);for(let B of V){let H=$0.join(X,B),$=Z[B],F=W&&$&&typeof $==="object"&&!ArrayBuffer.isView($)?U0(K,$):K;U=U.concat(x5($,H,F,W,Q,J,z,Y))}}return U}async function xJ(Z,X,q,W,Q,J){let Y=J.dereference?.externalReferenceResolution==="root"?R6():W?q:X,U=r(Y,Z.$ref),K=n(U),V=Q._get$Ref(K);if(V)return Promise.resolve(V.value);try{let B=Z.$ref,H={url:U,baseUrl:Y};if(typeof B==="string")H.reference=B;let $=await Z1(H,Q,J),F=Q._get$Ref(K),L=x5($,K+"#",K,F?.dynamicIdScope??!1,Q,J,new Set,!0);return Promise.all(L)}catch(B){if(!J?.continueOnError||!g0(B))throw B;if(Q._$refs[K])B.source=decodeURI(n(X)),B.path=n4(v0(X));return[]}}var b9;var v9=R(()=>{p6();$4();Y5();H0();P0();_6();b9=OJ});function kJ(Z,X){let q=Z.$refs._root$Ref.dynamicIdScope?U0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,W=[];k5(Z,"schema",Z.$refs._root$Ref.path+"#",q,Z.$refs._root$Ref.dynamicIdScope,"#",0,W,Z.$refs,X);let Q=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(SJ(W,X,Q),(X.bundle||{}).optimizeInternalRefs!==!1)yJ(W,Z.schema)}function k5(Z,X,q,W,Q,J,z,Y,U,K){let V=X===null?Z:Z[X],B=K.bundle||{},H=B.excludedPathMatcher||(()=>!1);if(V&&typeof V==="object"&&!ArrayBuffer.isView(V)&&!H(J)){let $=W;if(d.isAllowed$Ref(V))y9(Z,X,q,$,Q,J,z,Y,U,K);else{let F=Object.keys(V).sort((L,A)=>{if(L==="definitions"||L==="$defs")return-1;else if(A==="definitions"||A==="$defs")return 1;else return L.length-A.length});for(let L of F){let A=$0.join(q,L),I=$0.join(J,L),M=V[L],P=Q&&M&&typeof M==="object"&&!ArrayBuffer.isView(M)?U0($,M):$;if(d.isAllowed$Ref(M))y9(V,L,A,P,Q,I,z,Y,U,K);else k5(V,L,A,P,Q,I,z,Y,U,K);if(M&&typeof M==="object"&&!Array.isArray(M)){if("$ref"in M)B?.onBundle?.(M.$ref,V[L],V,L)}}}}}function y9(Z,X,q,W,Q,J,z,Y,U,K){let V=X===null?Z:Z[X],B=r(Q?W:q,V.$ref),H=U._resolve(B,J,K);if(H===null)return;let F=$0.parse(J).length,L=n(H.path),A=v0(H.path),I=L!==U._root$Ref.path&&!U._aliases[L],M=d.isExtended$Ref(V);z+=H.indirections;let P=bJ(Y,Z,X);if(P)if(F<P.depth||z<P.indirections)vJ(Y,P);else return;if(Y.push({$ref:V,parent:Z,key:X,pathFromRoot:J,depth:F,file:L,hash:A,value:H.value,circular:H.circular,extended:M,external:I,indirections:z}),!P||I)k5(H.value,null,H.path,H.$ref.path,H.$ref.dynamicIdScope,J,z+1,Y,U,K)}function SJ(Z,X,q){Z.sort((z,Y)=>{if(z.file!==Y.file)return z.file<Y.file?-1:1;else if(z.hash!==Y.hash)return z.hash<Y.hash?-1:1;else if(z.circular!==Y.circular)return z.circular?-1:1;else if(z.extended!==Y.extended)return z.extended?1:-1;else if(z.indirections!==Y.indirections)return z.indirections-Y.indirections;else if(z.depth!==Y.depth)return z.depth-Y.depth;else{let U=Math.max(z.pathFromRoot.lastIndexOf("/definitions"),z.pathFromRoot.lastIndexOf("/$defs")),K=Math.max(Y.pathFromRoot.lastIndexOf("/definitions"),Y.pathFromRoot.lastIndexOf("/$defs"));if(U!==K)return K-U;else return z.pathFromRoot.length-Y.pathFromRoot.length}});let W,Q,J;for(let z of Z){let Y=X.bundle||{};if(!z.external){if(Y.optimizeInternalRefs!==!1)z.$ref.$ref=z.hash}else if(z.file===W&&z.hash===Q)if(q&&g9(Z,z))z.$ref.$ref=q+J;else z.$ref.$ref=J;else if(z.file===W&&z.hash.indexOf(Q+"/")===0){let U=$0.join(J,$0.parse(z.hash.replace(Q,"#")));if(q&&g9(Z,z))z.$ref.$ref=q+U;else z.$ref.$ref=U}else if(W=z.file,Q=z.hash,J=z.pathFromRoot,z.$ref=z.parent[z.key]=d.dereference(z.$ref,z.value,X),z.circular)z.$ref.$ref=z.pathFromRoot}}function bJ(Z,X,q){for(let W of Z)if(W&&W.parent===X&&W.key===q)return W;return}function vJ(Z,X){let q=Z.indexOf(X);Z.splice(q,1)}function yJ(Z,X){for(let q of Z){if(!q.$ref||typeof q.$ref!=="object"||!("$ref"in q.$ref))continue;let W=q.$ref.$ref;if(typeof W!=="string"||!W.startsWith("#/"))continue;let Q=gJ(X,W);if(Q!==W)q.$ref.$ref=Q}}function gJ(Z,X){if(!X.startsWith("#/"))return X;let q=X.slice(2).split("/"),W=Z,Q=[];for(let z of q){if(W===null||W===void 0||typeof W!=="object")return X;if("$ref"in W&&typeof W.$ref==="string"&&W.$ref.startsWith("#/")){let K=W.$ref.slice(2).split("/");if(Q.length=0,Q.push(...K),W=hJ(Z,W.$ref),W===null||W===void 0||typeof W!=="object")return X}let Y=z.replace(/~1/g,"/").replace(/~0/g,"~"),U=Array.isArray(W)?parseInt(Y):Y;W=W[U],Q.push(z)}return"#/"+Q.join("/")}function hJ(Z,X){if(!X.startsWith("#/"))return;let q=X.slice(2).split("/"),W=Z;for(let Q of q){if(W===null||W===void 0||typeof W!=="object")return;let J=Q.replace(/~1/g,"/").replace(/~0/g,"~"),z=Array.isArray(W)?parseInt(J):J;W=W[z]}return W}function g9(Z,X){for(let q of Z){if(q.pathFromRoot==="#"||q.pathFromRoot==="#/")continue;if(X.pathFromRoot.startsWith(q.pathFromRoot+"/")){if(q.value&&typeof q.value==="object"&&"$id"in q.value)return!0}}return!1}var h9;var m9=R(()=>{p6();$4();H0();_6();h9=kJ});function mJ(Z,X){let q=Date.now(),W=Z.$refs._root$Ref.dynamicIdScope?U0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=S5(Z.schema,Z.$refs._root$Ref.path,W,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,X,q,0);Z.$refs.circular=Q.circular,Z.schema=Q.value}function S5(Z,X,q,W,Q,J,z,Y,U,K,V,B){let H,$={value:Z,circular:!1};u9(V,K);let F=K.dereference||{},L=F.maxDepth??500;if(B>L)throw RangeError(`Maximum dereference depth (${L}) exceeded at ${Q}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let A=F.excludedPathMatcher||(()=>!1);if(F?.circular==="ignore"||!z.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!A(Q)){J.add(Z),z.add(Z);let I=q;if(d.isAllowed$Ref(Z,K))H=f9(Z,X,I,W,Q,J,z,Y,U,K,V,B),$.circular=H.circular,$.value=H.value;else for(let M of Object.keys(Z)){u9(V,K);let P=$0.join(X,M),k=$0.join(Q,M);if(A(k))continue;let b=Z[M],C=W&&b&&typeof b==="object"&&!ArrayBuffer.isView(b)?U0(I,b):I,T;if(d.isAllowed$Ref(b,K)){if(H=f9(b,P,C,W,k,J,z,Y,U,K,V,B),T=H.circular,Z[M]!==H.value){let j=new Map;if(F?.preservedProperties){if(typeof Z[M]==="object"&&!Array.isArray(Z[M]))F?.preservedProperties.forEach((g)=>{if(g in Z[M])j.set(g,Z[M][g])})}let S=H.value;if(F?.cloneReferences&&!T&&S&&typeof S==="object")S=structuredClone(S);if(Z[M]=S,F?.preservedProperties){if(j.size&&typeof Z[M]==="object"&&!Array.isArray(Z[M]))j.forEach((g,f)=>{Z[M][f]=g})}F?.onDereference?.(b.$ref,Z[M],Z,M)}}else if(!J.has(b)){if(H=S5(b,P,C,W,k,J,z,Y,U,K,V,B+1),T=H.circular,Z[M]!==H.value)Z[M]=H.value}else T=G1(P,U,K);$.circular=$.circular||T}J.delete(Z)}}return $}function f9(Z,X,q,W,Q,J,z,Y,U,K,V,B){let F=d.isExternal$Ref(Z)&&K?.dereference?.externalReferenceResolution==="root"?R6():W?q:X,L=r(F,Z.$ref),A=Y.get(L);if(A){if(!A.circular){let C=Object.keys(Z);if(C.length>1){let T={};for(let j of C)if(j!=="$ref"&&!(j in A.value))T[j]=Z[j];return{circular:A.circular,value:Object.assign({},A.value,T)}}return A}if(typeof A.value==="object"&&"$ref"in A.value&&"$ref"in Z){if(A.value.$ref===Z.$ref)return G1(X,U,K),A}else return G1(X,U,K),A}let I=U._resolve(L,X,K);if(I===null)return{circular:!1,value:null};let M=I.circular,P=M||J.has(I.value);if(P)G1(X,U,K);let k=d.dereference(Z,I.value,K);if(!P){let C=S5(k,I.path,I.$ref.path,I.$ref.dynamicIdScope,Q,J,z,Y,U,K,V,B+1);P=C.circular,k=C.value}if(P&&!M&&K.dereference?.circular==="ignore")k=Z;if(M)k.$ref=Q;let b={circular:P,value:k};if(Object.keys(Z).length===1)Y.set(L,b);return b}function u9(Z,X){if(X&&X.timeoutMs){if(Date.now()-Z>X.timeoutMs)throw new q5(X.timeoutMs)}}function G1(Z,X,q){if(X.circular=!0,q?.dereference?.onCircular?.(Z),!q.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var d9;var c9=R(()=>{p6();$4();H0();_6();P0();d9=mJ});function fJ(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(X){setTimeout(X,0)}}var b5;var l9=R(()=>{b5=fJ()});function w0(Z,X){if(Z){X.then(function(q){b5(function(){Z(null,q)})},function(q){b5(function(){Z(q)})});return}else return X}var p9=R(()=>{l9()});class o0{schema=null;$refs=new A4;async parse(){let Z=N4(arguments),X;if(!Z.path&&!Z.schema){let W=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return w0(Z.callback,Promise.reject(W))}this.schema=null,this.$refs=new A4;let q="http";if(p4(Z.path))Z.path=Y8(Z.path),q="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let W=u6(Z.schema.$id),Q=W.port??(W.protocol==="https:"?443:80);Z.path=`${W.protocol}//${W.hostname}:${Q}`}if(Z.path=r(R6(),Z.path),Z.schema&&typeof Z.schema==="object"){let W=this.$refs._add(Z.path);W.value=Z.schema,W.pathType=q,W.dynamicIdScope=s4(W.value),o4(this.$refs,W.path,W.value,W.pathType,W.dynamicIdScope),X=Promise.resolve(Z.schema)}else X=Z1(Z.path,this.$refs,Z.options);try{let W=await X;if(W!==null&&typeof W==="object"&&!Buffer.isBuffer(W))return this.schema=W,w0(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,w0(Z.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||W}" is not a valid JSON Schema`)}catch(W){if(!Z.options.continueOnError||!g0(W))return w0(Z.callback,Promise.reject(W));if(this.$refs._$refs[n(Z.path)])this.$refs._$refs[n(Z.path)].addError(W);return w0(Z.callback,Promise.resolve(null))}}static parse(){let Z=new o0;return Z.parse.apply(Z,arguments)}async resolve(){let Z=N4(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await b9(this,Z.options),v5(this),w0(Z.callback,Promise.resolve(this.$refs))}catch(X){return w0(Z.callback,Promise.reject(X))}}static resolve(){let Z=new o0;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new o0;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=N4(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),h9(this,Z.options),v5(this),w0(Z.callback,Promise.resolve(this.schema))}catch(X){return w0(Z.callback,Promise.reject(X))}}static dereference(){let Z=new o0;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=N4(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),d9(this,Z.options),v5(this),w0(Z.callback,Promise.resolve(this.schema))}catch(X){return w0(Z.callback,Promise.reject(X))}}}function v5(Z){if(c6.getParserErrors(Z).length>0)throw new c6(Z)}var VF,BF,HF,n9;var i9=R(()=>{F8();Y5();S9();v9();m9();c9();H0();j5();C5();P0();p9();_6();O5();H0();VF=o0.parse,BF=o0.resolve,HF=o0.bundle,n9=o0.dereference});async function Y1(Z,X={}){let{baseUrl:q="/_jx/server"}=X,W=await n9(Z),Q=l4(W);if(Q.length===0)return null;let J=Q.map(({exportName:Y,src:U})=>`import { ${Y} } from '${U}'`).join(`
55
- `),z=Q.map(({exportName:Y})=>r9(Y,q)).join(`
54
+ ${Q.join(`
55
+ `)}`);throw G.status=J.status,new o0(G)}else{let G=AQ(J,"location");if(!G){let q=Error(`HTTP ${J.status} redirect with no location header`);throw q.status=J.status,q}let z=A0(Z.href,G);return A9(z,W,Q)}else{if(J.body){let G=await J.arrayBuffer();return Buffer.from(G)}return Buffer.alloc(0)}}catch(J){let G=J;throw G.message=`Error downloading ${Z.href}: ${G.message}`,new o0(G,Z.href)}}async function LQ(Z,W){let X,Q;if(W.timeout&&typeof AbortController<"u")X=new AbortController,Q=setTimeout(()=>X.abort(),W.timeout);let J=await fetch(Z,{method:"GET",headers:W.headers||{},credentials:W.withCredentials?"include":"same-origin",redirect:"manual",signal:X?X.signal:null});if(Q)clearTimeout(Q);return J}function AQ(Z,W){return Z.headers.get(W)}var p2;var n2=d(()=>{S0();p0();p2={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return O8(Z.url)&&(!this.safeUrlResolver||!_4(Z.url))},read(Z){let W=V6(Z.url);if(typeof window<"u"&&!W.protocol)W.protocol=V6(location.href).protocol;return A9(W,this)}}});function N9(Z,W){if(M9(W)){let X=Object.keys(W).filter((Q)=>!["__proto__","constructor","prototype"].includes(Q));for(let Q=0;Q<X.length;Q++){let J=X[Q],G=W[J],z=Z[J];if(M9(G))Z[J]=N9(z||{},G);else if(G!==void 0)Z[J]=G}}return Z}function M9(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var I9=()=>{return{parse:{json:{...c8},yaml:{...V9},text:{...H9},binary:{...F9}},resolve:{file:{...c2},http:{...p2},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},w9=(Z)=>{let W=I9();if(Z)N9(W,Z);return W};var i2=d(()=>{l8();B9();$9();L9();l2();n2()});function MQ(Z){let W,X,Q,J,G=Array.prototype.slice.call(Z);if(typeof G[G.length-1]==="function")J=G.pop();if(typeof G[0]==="string")if(W=G[0],typeof G[2]==="object")X=G[1],Q=G[2];else X=void 0,Q=G[1];else W="",X=G[0],Q=G[1];try{Q=w9(Q)}catch(z){console.error(`JSON Schema Ref Parser: Error normalizing options: ${z}`)}if(!Q.mutateInputSchema&&typeof X==="object")X=JSON.parse(JSON.stringify(X));return{path:W,schema:X,options:Q,callback:J}}var c6;var D9=d(()=>{i2();c6=MQ});function IQ(Z,W){if(!W.resolve?.external)return Promise.resolve();try{let X=Z.$refs._root$Ref.dynamicIdScope?C0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=r2(Z.schema,Z.$refs._root$Ref.path+"#",X,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,W);return Promise.all(Q)}catch(X){return Promise.reject(X)}}function r2(Z,W,X,Q,J,G,z,q){z||=new Set;let K=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!z.has(Z)){z.add(Z);let V=X;if(B0.isExternal$Ref(Z))K.push(wQ(Z,W,V,Q,J,G));let H=Object.keys(Z);for(let B of H){let $=b0.join(W,B),L=Z[B],A=Q&&L&&typeof L==="object"&&!ArrayBuffer.isView(L)?C0(V,L):V;K=K.concat(r2(L,$,A,Q,J,G,z,q))}}return K}async function wQ(Z,W,X,Q,J,G){let q=G.dereference?.externalReferenceResolution==="root"?p1():Q?X:W,K=A0(q,Z.$ref),V=L0(K),H=J._get$Ref(V);if(H)return Promise.resolve(H.value);try{let B=Z.$ref,$={url:K,baseUrl:q};if(typeof B==="string")$.reference=B;let L=await y4($,J,G),A=J._get$Ref(V),j=r2(L,V+"#",V,A?.dynamicIdScope??!1,J,G,new Set,!0);return Promise.all(j)}catch(B){if(!G?.continueOnError||!X1(B))throw B;if(J._$refs[V])B.source=decodeURI(L0(W)),B.path=E4(Z1(W));return[]}}var T9;var R9=d(()=>{F6();h6();f2();S0();p0();n1();T9=IQ});function NQ(Z,W){let X=Z.$refs._root$Ref.dynamicIdScope?C0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=[];a2(Z,"schema",Z.$refs._root$Ref.path+"#",X,Z.$refs._root$Ref.dynamicIdScope,"#",0,Q,Z.$refs,W);let J=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(DQ(Q,W,J),(W.bundle||{}).optimizeInternalRefs!==!1)PQ(Q,Z.schema)}function a2(Z,W,X,Q,J,G,z,q,K,V){let H=W===null?Z:Z[W],B=V.bundle||{},$=B.excludedPathMatcher||(()=>!1);if(H&&typeof H==="object"&&!ArrayBuffer.isView(H)&&!$(G)){let L=Q;if(B0.isAllowed$Ref(H))P9(Z,W,X,L,J,G,z,q,K,V);else{let A=Object.keys(H).sort((j,D)=>{if(j==="definitions"||j==="$defs")return-1;else if(D==="definitions"||D==="$defs")return 1;else return j.length-D.length});for(let j of A){let D=b0.join(X,j),R=b0.join(G,j),x=H[j],f=J&&x&&typeof x==="object"&&!ArrayBuffer.isView(x)?C0(L,x):L;if(B0.isAllowed$Ref(x))P9(H,j,D,f,J,R,z,q,K,V);else a2(H,j,D,f,J,R,z,q,K,V);if(x&&typeof x==="object"&&!Array.isArray(x)){if("$ref"in x)B?.onBundle?.(x.$ref,H[j],H,j)}}}}}function P9(Z,W,X,Q,J,G,z,q,K,V){let H=W===null?Z:Z[W],B=A0(J?Q:X,H.$ref),$=K._resolve(B,G,V);if($===null)return;let A=b0.parse(G).length,j=L0($.path),D=Z1($.path),R=j!==K._root$Ref.path&&!K._aliases[j],x=B0.isExtended$Ref(H);z+=$.indirections;let f=TQ(q,Z,W);if(f)if(A<f.depth||z<f.indirections)RQ(q,f);else return;if(q.push({$ref:H,parent:Z,key:W,pathFromRoot:G,depth:A,file:j,hash:D,value:$.value,circular:$.circular,extended:x,external:R,indirections:z}),!f||R)a2($.value,null,$.path,$.$ref.path,$.$ref.dynamicIdScope,G,z+1,q,K,V)}function DQ(Z,W,X){Z.sort((z,q)=>{if(z.file!==q.file)return z.file<q.file?-1:1;else if(z.hash!==q.hash)return z.hash<q.hash?-1:1;else if(z.circular!==q.circular)return z.circular?-1:1;else if(z.extended!==q.extended)return z.extended?1:-1;else if(z.indirections!==q.indirections)return z.indirections-q.indirections;else if(z.depth!==q.depth)return z.depth-q.depth;else{let K=Math.max(z.pathFromRoot.lastIndexOf("/definitions"),z.pathFromRoot.lastIndexOf("/$defs")),V=Math.max(q.pathFromRoot.lastIndexOf("/definitions"),q.pathFromRoot.lastIndexOf("/$defs"));if(K!==V)return V-K;else return z.pathFromRoot.length-q.pathFromRoot.length}});let Q,J,G;for(let z of Z){let q=W.bundle||{};if(!z.external){if(q.optimizeInternalRefs!==!1)z.$ref.$ref=z.hash}else if(z.file===Q&&z.hash===J)if(X&&_9(Z,z))z.$ref.$ref=X+G;else z.$ref.$ref=G;else if(z.file===Q&&z.hash.indexOf(J+"/")===0){let K=b0.join(G,b0.parse(z.hash.replace(J,"#")));if(X&&_9(Z,z))z.$ref.$ref=X+K;else z.$ref.$ref=K}else if(Q=z.file,J=z.hash,G=z.pathFromRoot,z.$ref=z.parent[z.key]=B0.dereference(z.$ref,z.value,W),z.circular)z.$ref.$ref=z.pathFromRoot}}function TQ(Z,W,X){for(let Q of Z)if(Q&&Q.parent===W&&Q.key===X)return Q;return}function RQ(Z,W){let X=Z.indexOf(W);Z.splice(X,1)}function PQ(Z,W){for(let X of Z){if(!X.$ref||typeof X.$ref!=="object"||!("$ref"in X.$ref))continue;let Q=X.$ref.$ref;if(typeof Q!=="string"||!Q.startsWith("#/"))continue;let J=_Q(W,Q);if(J!==Q)X.$ref.$ref=J}}function _Q(Z,W){if(!W.startsWith("#/"))return W;let X=W.slice(2).split("/"),Q=Z,J=[];for(let z of X){if(Q===null||Q===void 0||typeof Q!=="object")return W;if("$ref"in Q&&typeof Q.$ref==="string"&&Q.$ref.startsWith("#/")){let V=Q.$ref.slice(2).split("/");if(J.length=0,J.push(...V),Q=jQ(Z,Q.$ref),Q===null||Q===void 0||typeof Q!=="object")return W}let q=z.replace(/~1/g,"/").replace(/~0/g,"~"),K=Array.isArray(Q)?parseInt(q):q;Q=Q[K],J.push(z)}return"#/"+J.join("/")}function jQ(Z,W){if(!W.startsWith("#/"))return;let X=W.slice(2).split("/"),Q=Z;for(let J of X){if(Q===null||Q===void 0||typeof Q!=="object")return;let G=J.replace(/~1/g,"/").replace(/~0/g,"~"),z=Array.isArray(Q)?parseInt(G):G;Q=Q[z]}return Q}function _9(Z,W){for(let X of Z){if(X.pathFromRoot==="#"||X.pathFromRoot==="#/")continue;if(W.pathFromRoot.startsWith(X.pathFromRoot+"/")){if(X.value&&typeof X.value==="object"&&"$id"in X.value)return!0}}return!1}var j9;var E9=d(()=>{F6();h6();S0();n1();j9=NQ});function EQ(Z,W){let X=Date.now(),Q=Z.$refs._root$Ref.dynamicIdScope?C0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,J=s2(Z.schema,Z.$refs._root$Ref.path,Q,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,W,X,0);Z.$refs.circular=J.circular,Z.schema=J.value}function s2(Z,W,X,Q,J,G,z,q,K,V,H,B){let $,L={value:Z,circular:!1};O9(H,V);let A=V.dereference||{},j=A.maxDepth??500;if(B>j)throw RangeError(`Maximum dereference depth (${j}) exceeded at ${J}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let D=A.excludedPathMatcher||(()=>!1);if(A?.circular==="ignore"||!z.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!D(J)){G.add(Z),z.add(Z);let R=X;if(B0.isAllowed$Ref(Z,V))$=C9(Z,W,R,Q,J,G,z,q,K,V,H,B),L.circular=$.circular,L.value=$.value;else for(let x of Object.keys(Z)){O9(H,V);let f=b0.join(W,x),p=b0.join(J,x);if(D(p))continue;let r=Z[x],m=Q&&r&&typeof r==="object"&&!ArrayBuffer.isView(r)?C0(R,r):R,S;if(B0.isAllowed$Ref(r,V)){if($=C9(r,f,m,Q,p,G,z,q,K,V,H,B),S=$.circular,Z[x]!==$.value){let c=new Map;if(A?.preservedProperties){if(typeof Z[x]==="object"&&!Array.isArray(Z[x]))A?.preservedProperties.forEach((W0)=>{if(W0 in Z[x])c.set(W0,Z[x][W0])})}let o=$.value;if(A?.cloneReferences&&!S&&o&&typeof o==="object")o=structuredClone(o);if(Z[x]=o,A?.preservedProperties){if(c.size&&typeof Z[x]==="object"&&!Array.isArray(Z[x]))c.forEach((W0,X0)=>{Z[x][X0]=W0})}A?.onDereference?.(r.$ref,Z[x],Z,x)}}else if(!G.has(r)){if($=s2(r,f,m,Q,p,G,z,q,K,V,H,B+1),S=$.circular,Z[x]!==$.value)Z[x]=$.value}else S=g4(f,K,V);L.circular=L.circular||S}G.delete(Z)}}return L}function C9(Z,W,X,Q,J,G,z,q,K,V,H,B){let A=B0.isExternal$Ref(Z)&&V?.dereference?.externalReferenceResolution==="root"?p1():Q?X:W,j=A0(A,Z.$ref),D=q.get(j);if(D){if(!D.circular){let m=Object.keys(Z);if(m.length>1){let S={};for(let c of m)if(c!=="$ref"&&!(c in D.value))S[c]=Z[c];return{circular:D.circular,value:Object.assign({},D.value,S)}}return D}if(typeof D.value==="object"&&"$ref"in D.value&&"$ref"in Z){if(D.value.$ref===Z.$ref)return g4(W,K,V),D}else return g4(W,K,V),D}let R=K._resolve(j,W,V);if(R===null)return{circular:!1,value:null};let x=R.circular,f=x||G.has(R.value);if(f)g4(W,K,V);let p=B0.dereference(Z,R.value,V);if(!f){let m=s2(p,R.path,R.$ref.path,R.$ref.dynamicIdScope,J,G,z,q,K,V,H,B+1);f=m.circular,p=m.value}if(f&&!x&&V.dereference?.circular==="ignore")p=Z;if(x)p.$ref=J;let r={circular:f,value:p};if(Object.keys(Z).length===1)q.set(j,r);return r}function O9(Z,W){if(W&&W.timeoutMs){if(Date.now()-Z>W.timeoutMs)throw new S2(W.timeoutMs)}}function g4(Z,W,X){if(W.circular=!0,X?.dereference?.onCircular?.(Z),!X.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var x9;var k9=d(()=>{F6();h6();S0();n1();p0();x9=EQ});function CQ(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(W){setTimeout(W,0)}}var o2;var S9=d(()=>{o2=CQ()});function m0(Z,W){if(Z){W.then(function(X){o2(function(){Z(null,X)})},function(X){o2(function(){Z(X)})});return}else return W}var b9=d(()=>{S9()});class w1{schema=null;$refs=new m6;async parse(){let Z=c6(arguments),W;if(!Z.path&&!Z.schema){let Q=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return m0(Z.callback,Promise.reject(Q))}this.schema=null,this.$refs=new m6;let X="http";if(j4(Z.path))Z.path=b8(Z.path),X="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let Q=V6(Z.schema.$id),J=Q.port??(Q.protocol==="https:"?443:80);Z.path=`${Q.protocol}//${Q.hostname}:${J}`}if(Z.path=A0(p1(),Z.path),Z.schema&&typeof Z.schema==="object"){let Q=this.$refs._add(Z.path);Q.value=Z.schema,Q.pathType=X,Q.dynamicIdScope=k4(Q.value),S4(this.$refs,Q.path,Q.value,Q.pathType,Q.dynamicIdScope),W=Promise.resolve(Z.schema)}else W=y4(Z.path,this.$refs,Z.options);try{let Q=await W;if(Q!==null&&typeof Q==="object"&&!Buffer.isBuffer(Q))return this.schema=Q,m0(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,m0(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||!X1(Q))return m0(Z.callback,Promise.reject(Q));if(this.$refs._$refs[L0(Z.path)])this.$refs._$refs[L0(Z.path)].addError(Q);return m0(Z.callback,Promise.resolve(null))}}static parse(){let Z=new w1;return Z.parse.apply(Z,arguments)}async resolve(){let Z=c6(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await T9(this,Z.options),t2(this),m0(Z.callback,Promise.resolve(this.$refs))}catch(W){return m0(Z.callback,Promise.reject(W))}}static resolve(){let Z=new w1;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new w1;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=c6(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),j9(this,Z.options),t2(this),m0(Z.callback,Promise.resolve(this.schema))}catch(W){return m0(Z.callback,Promise.reject(W))}}static dereference(){let Z=new w1;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=c6(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),x9(this,Z.options),t2(this),m0(Z.callback,Promise.resolve(this.schema))}catch(W){return m0(Z.callback,Promise.reject(W))}}}function t2(Z){if(H6.getParserErrors(Z).length>0)throw new H6(Z)}var $H,FH,LH,v9;var y9=d(()=>{u8();f2();D9();R9();E9();k9();S0();l2();n2();p0();b9();n1();i2();S0();$H=w1.parse,FH=w1.resolve,LH=w1.bundle,v9=w1.dereference});async function l6(Z,W={}){let{baseUrl:X="/_jx/server"}=W,Q=await v9(Z),J=P4(Q);if(J.length===0)return null;let G=J.map(({exportName:q,src:K})=>`import { ${q} } from '${K}'`).join(`
56
+ `),z=J.map(({exportName:q})=>g9(q,X)).join(`
56
57
  `);return`// Generated by @jxsuite/compiler — do not edit manually
57
58
  // Deploy as a Cloudflare Worker, Node server, or Bun process.
58
59
  // Requires: npm install hono
59
60
 
60
61
  import { Hono } from 'hono'
61
- ${J}
62
+ ${G}
62
63
 
63
64
  const app = new Hono()
64
65
  ${z}
65
66
 
66
67
  export default app
67
- `}function y5(Z,X={}){let{baseUrl:q="/_jx/server",adapter:W=null}=X;if(Z.length===0&&!W)return null;let Q=Z.map(({exportName:Y,src:U})=>`import { ${Y} } from '${U}'`).join(`
68
- `),J=Z.map(({exportName:Y})=>r9(Y,q)).join(`
68
+ `}function e2(Z,W={}){let{baseUrl:X="/_jx/server",adapter:Q=null}=W;if(Z.length===0&&!Q)return null;let J=Z.map(({exportName:q,src:K})=>`import { ${q} } from '${K}'`).join(`
69
+ `),G=Z.map(({exportName:q})=>g9(q,X)).join(`
69
70
  `);return`// Generated by @jxsuite/compiler — do not edit manually
70
71
  import { Hono } from 'hono'
71
- ${Q}
72
+ ${J}
72
73
 
73
74
  const app = new Hono()
74
- ${J}
75
- ${W==="cloudflare-workers"||W==="cloudflare-pages"?`
75
+ ${G}
76
+ ${Q==="cloudflare-workers"||Q==="cloudflare-pages"?`
76
77
  app.all('*', (c) => c.env.ASSETS.fetch(c.req.raw))
77
78
  `:`
78
79
  `}
79
80
  export default app
80
- `}function r9(Z,X){return`
81
- app.post('${X}/${Z}', async (c) => {
81
+ `}function g9(Z,W){return`
82
+ app.post('${W}/${Z}', async (c) => {
82
83
  const args = await c.req.json().catch(() => ({}))
83
84
  try {
84
85
  return c.json(await ${Z}(args, c.env))
85
86
  } catch (e) {
86
87
  return c.json({ ok: false, error: e?.message ?? 'Server error' }, 500)
87
88
  }
88
- })`}var a9=R(()=>{i9();T6()});function t0(Z){return Z instanceof Error?Z.message:String(Z)}function g5(Z,X,q){let W;try{W=JSON.parse(Z)}catch(Q){throw Error(`Failed to parse ${q} at ${X}: ${t0(Q)}`,{cause:Q})}if(!M0(W))throw Error(`Invalid ${q} at ${X}: expected a JSON object`);return W}function V6(Z,X){return g5(Z,X,"Jx document")}function s9(Z,X){return g5(Z,X,"project config")}function o9(Z,X){return g5(Z,X,"class definition")}var e0=R(()=>{S0()});class Z7{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;capabilities;#Z;#X=null;constructor(Z,X,q,W){this.name=Z,this.classPath=X,this.classDef=q,this.#Z=W;let Q=q.format;this.extensions=(Q.extensions??[]).map((J)=>J.toLowerCase()),this.mediaType=Q.mediaType??null,this.documentKinds=Q.documentKinds??[],this.exportTarget=Q.exportTarget===!0,this.remote=Q.remote===!0,this.studio=q.$studio??null,this.capabilities=dJ(q)}implementation(){if(!this.#X){let Z=this.classDef.$implementation;if(!Z)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#X=this.#Z.importModule(this.#Z.resolvePath(this.classPath,Z))}return this.#X}async call(Z,...X){let q=this.capabilities[Z];if(!q)throw Error(`Format class "${this.name}" does not declare a "${Z}" capability`);let W=await this.implementation(),Q=this.classDef.title??this.name,J=W[Q]??W.default?.[Q]??W.default,z=J?.[q.identifier];if(typeof z!=="function")throw TypeError(`Format class "${this.name}": implementation export "${Q}" has no static "${q.identifier}" method`);return await z.call(J,...X)}}class X7{#Z;constructor(Z){this.#Z=Z;for(let X of e9){let q=new Map;for(let W of Z){if(!W.capabilities[X])continue;for(let Q of W.extensions){let J=q.get(Q);if(J)throw Error(`Format conflict: "${J.name}" and "${W.name}" both claim "${Q}" with the "${X}" capability`);q.set(Q,W)}}}}get entries(){return this.#Z}byExtension(Z,X){let q=t9(Z);return this.#Z.find((W)=>W.extensions.includes(q)&&(!X||W.capabilities[X]))}byName(Z){return this.#Z.find((X)=>X.name===Z)}withCapability(Z){return this.#Z.filter((X)=>X.capabilities[Z])}documentExtensions(Z){let X=new Set;for(let q of this.#Z){if(Z&&!q.documentKinds.includes(Z))continue;for(let W of q.extensions)X.add(W)}return X.delete(".json"),[...X]}has(Z){let X=t9(Z);return this.#Z.some((q)=>q.extensions.includes(X))}}async function q7(Z,X,q){let W=[];for(let[Q,J]of Object.entries(Z??{})){if(typeof J!=="string"||!J.endsWith(".class.json"))continue;let z,Y;try{z=q?X.resolvePath(q,J):J,Y=await X.loadJson(z)}catch{continue}if(!Y||typeof Y!=="object")continue;if(!Y.format||!Array.isArray(Y.format.extensions))continue;W.push(new Z7(Q,z,Y,X))}return new X7(W)}function dJ(Z){let X={},q=Z.$defs?.methods??{};for(let[W,Q]of Object.entries(q)){let J=Q.role;if(!J||!e9.includes(J))continue;X[J]={identifier:Q.identifier??W,timing:Q.timing??uJ}}return X}function t9(Z){let X=Z.toLowerCase();return X.startsWith(".")?X:`.${X}`}var e9,uJ;var W7=R(()=>{e9=["parse","serialize","discover","load"],uJ=["compiler","server"]});var f5={};f4(f5,{unknownFormatError:()=>m5,importImplementation:()=>K1,createNodeFormatIO:()=>J7,buildProjectFormatRegistry:()=>T4});import{readFileSync as cJ}from"node:fs";import{dirname as lJ,isAbsolute as pJ,resolve as h5,sep as U1}from"node:path";import{pathToFileURL as nJ}from"node:url";import{createRequire as Q7}from"node:module";async function K1(Z){let X=[Z],q=`${U1}src${U1}`,W=`${U1}dist${U1}`;if(Z.includes(q))X.push(Z.replace(q,W));if(Z.endsWith(".js"))X.push(`${Z.slice(0,-3)}.ts`);let Q;for(let J of X)try{return await import(nJ(J).href)}catch(z){Q=z}throw Q instanceof Error?Q:Error(String(Q))}function J7(Z){return{importModule:(X)=>K1(X),loadJson:async(X)=>JSON.parse(cJ(X,"utf8")),resolvePath:(X,q)=>{if(q.startsWith("./")||q.startsWith("../"))return h5(lJ(X),q);if(pJ(q))return q;let W=Q7(h5(Z,"package.json"));try{return W.resolve(q)}catch{return Q7(import.meta.url).resolve(q)}}}}async function T4(Z,X){return q7(X?.imports,J7(Z),h5(Z,"project.json"))}function m5(Z,X){return Error(`No format class imported for "${X}" (${Z}). Add a format class to project.json imports, e.g. "Markdown": "@jxsuite/parser/Markdown.class.json".`)}var s6=R(()=>{W7()});async function B1(Z,X={}){let{resolveElementPath:q,$media:W,formats:Q}=X,J=[],z=new Set;async function Y(U,K){let V,B;if(typeof U==="string"){let{readFileSync:P}=await import("node:fs"),{resolve:k}=await import("node:path");if(B=K?k(K,U):k(U),z.has(B))return;if(z.add(B),B.endsWith(".json"))V=V6(P(B,"utf8"),B);else{let{extname:b}=await import("node:path"),C=b(B).toLowerCase(),T=Q?.byExtension?.(C,"parse");if(!T){let{unknownFormatError:j}=await Promise.resolve().then(() => (s6(),f5));throw j(B,C)}V=await T.call("parse",P(B,"utf8"))}}else{if(V=U,B=null,V.tagName&&z.has(V.tagName))return;if(V.tagName)z.add(V.tagName)}let{tagName:H}=V;if(!H||!H.includes("-"))throw Error(`compileElement: tagName "${H}" must contain a hyphen`);let{dirname:$}=await import("node:path"),F=B?$(B):null,L=[];if(Array.isArray(V.$elements))for(let P of V.$elements){let k=L0(P)?P.$ref:P;if(typeof k!=="string")continue;if(F)await Y(k,F);let b=q?q(k,F):k.replace(/\.json$/,".js");L.push(b)}let A=c4(H);if(W)V.$media={...W,...V.$media};let I=R4(V,A,L),M=B?B.replace(/\.json$/,".js"):`${H}.js`;J.push({content:I,path:M,tagName:H})}return await Y(Z,X.basePath??null),{files:J}}async function iJ(Z,X={}){let{title:q="Jx App",reactivitySrc:W="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:Q="https://esm.sh/lit-html@3.3.0"}=X,J=await B1(Z,X),z=J.files.at(-1);if(!z)throw Error("compileElementPage: no element modules were produced");let{basename:Y}=await import("node:path"),U=Y(z.path),K=`<!DOCTYPE html>
89
+ })`}var Z3=d(()=>{y9();S1()});function N1(Z){return Z instanceof Error?Z.message:String(Z)}function W3(Z,W,X){let Q;try{Q=JSON.parse(Z)}catch(J){throw Error(`Failed to parse ${X} at ${W}: ${N1(J)}`,{cause:J})}if(!g0(Q))throw Error(`Invalid ${X} at ${W}: expected a JSON object`);return Q}function b1(Z,W){return W3(Z,W,"Jx document")}function h9(Z,W){return W3(Z,W,"project config")}function f9(Z,W){return W3(Z,W,"class definition")}var D1=d(()=>{e0()});class d9{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;capabilities;#Z;#W=null;constructor(Z,W,X,Q){this.name=Z,this.classPath=W,this.classDef=X,this.#Z=Q;let J=X.format;this.extensions=(J.extensions??[]).map((G)=>G.toLowerCase()),this.mediaType=J.mediaType??null,this.documentKinds=J.documentKinds??[],this.exportTarget=J.exportTarget===!0,this.remote=J.remote===!0,this.studio=X.$studio??null,this.capabilities=xQ(X)}implementation(){if(!this.#W){let Z=this.classDef.$implementation;if(!Z)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#W=this.#Z.importModule(this.#Z.resolvePath(this.classPath,Z))}return this.#W}async call(Z,...W){let X=this.capabilities[Z];if(!X)throw Error(`Format class "${this.name}" does not declare a "${Z}" capability`);let Q=await this.implementation(),J=this.classDef.title??this.name,G=Q[J]??Q.default?.[J]??Q.default,z=G?.[X.identifier];if(typeof z!=="function")throw TypeError(`Format class "${this.name}": implementation export "${J}" has no static "${X.identifier}" method`);return await z.call(G,...W)}}class c9{#Z;constructor(Z){this.#Z=Z;for(let W of u9){let X=new Map;for(let Q of Z){if(!Q.capabilities[W])continue;for(let J of Q.extensions){let G=X.get(J);if(G)throw Error(`Format conflict: "${G.name}" and "${Q.name}" both claim "${J}" with the "${W}" capability`);X.set(J,Q)}}}}get entries(){return this.#Z}byExtension(Z,W){let X=m9(Z);return this.#Z.find((Q)=>Q.extensions.includes(X)&&(!W||Q.capabilities[W]))}byName(Z){return this.#Z.find((W)=>W.name===Z)}withCapability(Z){return this.#Z.filter((W)=>W.capabilities[Z])}documentExtensions(Z){let W=new Set;for(let X of this.#Z){if(Z&&!X.documentKinds.includes(Z))continue;for(let Q of X.extensions)W.add(Q)}return W.delete(".json"),[...W]}has(Z){let W=m9(Z);return this.#Z.some((X)=>X.extensions.includes(W))}}async function l9(Z,W,X){let Q=[];for(let[J,G]of Object.entries(Z??{})){if(typeof G!=="string"||!G.endsWith(".class.json"))continue;let z,q;try{z=X?W.resolvePath(X,G):G,q=await W.loadJson(z)}catch{continue}if(!q||typeof q!=="object")continue;if(!q.format||!Array.isArray(q.format.extensions))continue;Q.push(new d9(J,z,q,W))}return new c9(Q)}function xQ(Z){let W={},X=Z.$defs?.methods??{};for(let[Q,J]of Object.entries(X)){let G=J.role;if(!G||!u9.includes(G))continue;W[G]={identifier:J.identifier??Q,timing:J.timing??OQ}}return W}function m9(Z){let W=Z.toLowerCase();return W.startsWith(".")?W:`.${W}`}var u9,OQ;var p9=d(()=>{u9=["parse","serialize","discover","load"],OQ=["compiler","server"]});var J3={};w4(J3,{unknownFormatError:()=>Q3,importImplementation:()=>f4,createNodeFormatIO:()=>i9,buildProjectFormatRegistry:()=>p6});import{readFileSync as kQ}from"node:fs";import{dirname as SQ,isAbsolute as bQ,resolve as X3,sep as h4}from"node:path";import{pathToFileURL as vQ}from"node:url";import{createRequire as n9}from"node:module";async function f4(Z){let W=[Z],X=`${h4}src${h4}`,Q=`${h4}dist${h4}`;if(Z.includes(X))W.push(Z.replace(X,Q));if(Z.endsWith(".js"))W.push(`${Z.slice(0,-3)}.ts`);let J;for(let G of W)try{return await import(vQ(G).href)}catch(z){J=z}throw J instanceof Error?J:Error(String(J))}function i9(Z){return{importModule:(W)=>f4(W),loadJson:async(W)=>JSON.parse(kQ(W,"utf8")),resolvePath:(W,X)=>{if(X.startsWith("./")||X.startsWith("../"))return X3(SQ(W),X);if(bQ(X))return X;let Q=n9(X3(Z,"package.json"));try{return Q.resolve(X)}catch{return n9(import.meta.url).resolve(X)}}}}async function p6(Z,W){return l9(W?.imports,i9(Z),X3(Z,"project.json"))}function Q3(Z,W){return Error(`No format class imported for "${W}" (${Z}). Add a format class to project.json imports, e.g. "Markdown": "@jxsuite/parser/Markdown.class.json".`)}var L6=d(()=>{p9()});async function u4(Z,W={}){let{resolveElementPath:X,$media:Q,formats:J}=W,G=[],z=new Set;async function q(K,V){let H,B;if(typeof K==="string"){let{readFileSync:f}=await import("node:fs"),{resolve:p}=await import("node:path");if(B=V?p(V,K):p(K),z.has(B))return;if(z.add(B),B.endsWith(".json"))H=b1(f(B,"utf8"),B);else{let{extname:r}=await import("node:path"),m=r(B).toLowerCase(),S=J?.byExtension?.(m,"parse");if(!S){let{unknownFormatError:c}=await Promise.resolve().then(() => (L6(),J3));throw c(B,m)}H=await S.call("parse",f(B,"utf8"))}}else{if(H=K,B=null,H.tagName&&z.has(H.tagName))return;if(H.tagName)z.add(H.tagName)}let{tagName:$}=H;if(!$||!$.includes("-"))throw Error(`compileElement: tagName "${$}" must contain a hyphen`);let{dirname:L}=await import("node:path"),A=B?L(B):null,j=[];if(Array.isArray(H.$elements))for(let f of H.$elements){let p=h0(f)?f.$ref:f;if(typeof p!=="string")continue;if(A)await q(p,A);let r=X?X(p,A):p.replace(/\.json$/,".js");j.push(r)}let D=R4($);if(Q)H.$media={...Q,...H.$media};let R=n6(H,D,j),x=B?B.replace(/\.json$/,".js"):`${$}.js`;G.push({content:R,path:x,tagName:$})}return await q(Z,W.basePath??null),{files:G}}async function yQ(Z,W={}){let{title:X="Jx App",reactivitySrc:Q="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:J="https://esm.sh/lit-html@3.3.0"}=W,G=await u4(Z,W),z=G.files.at(-1);if(!z)throw Error("compileElementPage: no element modules were produced");let{basename:q}=await import("node:path"),K=q(z.path),V=`<!DOCTYPE html>
89
90
  <html lang="en">
90
91
  <head>
91
92
  <meta charset="utf-8">
92
93
  <meta name="viewport" content="width=device-width, initial-scale=1">
93
- <title>${y(q)}</title>
94
+ <title>${e(X)}</title>
94
95
  <script type="importmap">
95
96
  {
96
97
  "imports": {
97
- "@vue/reactivity": "${W}",
98
- "lit-html": "${Q}"
98
+ "@vue/reactivity": "${Q}",
99
+ "lit-html": "${J}"
99
100
  }
100
101
  }
101
102
  </script>
102
103
  </head>
103
104
  <body>
104
105
  <${z.tagName}></${z.tagName}>
105
- <script type="module" src="./${U}"></script>
106
+ <script type="module" src="./${K}"></script>
106
107
  </body>
107
- </html>`;return{files:J.files,html:K}}function rJ(Z){if(Z===null||typeof Z!=="object"||Array.isArray(Z))return JSON.stringify(Z);if("default"in Z)return JSON.stringify(Z.default);if(J6(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 R4(Z,X,q){let W=["// Generated by @jxsuite/compiler — do not edit manually"];if(Z.$id)W.push(`// Source: ${Z.$id}`);for(let B of q)W.push(`import '${B}';`);let Q=new Map,J=Z.state??{};for(let[B,H]of Object.entries(J)){let $=H;if($&&typeof $==="object"&&!Array.isArray($)&&$.$prototype==="Function"&&$.$src){let F=$.$src;if(!Q.has(F))Q.set(F,[]);Q.get(F).push(B)}}for(let[B,H]of Q)W.push(`import { ${H.join(", ")} } from '${B}';`);W.push("import { reactive, computed, effect } from '@vue/reactivity';"),W.push("import { render, html } from 'lit-html';"),W.push(""),W.push(`class ${X} extends HTMLElement {`),W.push(" #dispose = null;"),W.push(""),W.push(" constructor() {"),W.push(" super();");let z=[],Y=[],U=[];for(let[B,H]of Object.entries(J)){let $=H;if(O0($)){let F=$.$expression;if(L6(F.operator))U.push([B,$]);else Y.push([B,$])}else if(i0($))if(typeof $.body==="string"&&$.body.includes("return"))Y.push([B,$]);else U.push([B,$]);else{let F=rJ($);if(F!==void 0)z.push([B,F])}}W.push(" this.state = reactive({");for(let[B,H]of z)W.push(` ${B}: ${H},`);W.push(" });");for(let[B,H]of U)if(W.push(""),O0(H)){let $=T0(H.$expression,{eventParam:"e",statePrefix:"s"});W.push(` this.state.${B} = (s, e) => { ${$}; };`)}else{let F=(H.parameters?z6(H.parameters):H.arguments??["state"]).join(", ");if(H.$src)W.push(` this.state.${B} = (${F}) => ${B}(${F});`);else W.push(` this.state.${B} = (${F}) => {`),W.push(` ${H.body??""}`),W.push(" };")}for(let[B,H]of Y)if(W.push(""),O0(H)){let $=T0(H.$expression,{eventParam:"e",statePrefix:"this.state"});W.push(` this.state.${B} = computed(() => ${$});`)}else if(H.$src)W.push(` this.state.${B} = computed(() => ${B}(this.state));`);else{W.push(` this.state.${B} = computed(() => {`);let $=(H.body??"").replaceAll("state.","this.state.");W.push(` ${$}`),W.push(" });")}W.push(" }"),W.push("");let K=[];if(Array.isArray(Z.children)){let B={n:0};for(let H of Z.children)G6(H,K,Z.$media??{},"",B,Z.tagName)}if(W.push(" template() {"),W.push(" const s = this.state;"),W.push(" return html`"),W.push(d5(Z.children,Z.style," ")),W.push(" `;"),W.push(" }"),W.push(""),W.push(" connectedCallback() {"),W.push(" const _pa = this.getAttribute('data-jx-props');"),W.push(" if (_pa) {"),W.push(" try {"),W.push(" const _p = JSON.parse(_pa);"),W.push(" for (const [k, v] of Object.entries(_p)) {"),W.push(" if (k in this.state) this.state[k] = v;"),W.push(" }"),W.push(" } catch {}"),W.push(" this.removeAttribute('data-jx-props');"),W.push(" }"),W.push(" for (const key of Object.keys(this.state)) {"),W.push(" if (this.hasOwnProperty(key) && this[key] !== undefined) {"),W.push(" this.state[key] = this[key];"),W.push(" }"),W.push(" }"),Z.style&&typeof Z.style==="object"){let B=[];for(let[H,$]of Object.entries(Z.style)){if(H.startsWith(":")||H.startsWith(".")||H.startsWith("&")||H.startsWith("[")||H.startsWith("@"))continue;if($===null||typeof $==="object")continue;let F=I0(H);if(typeof $==="string"&&$.includes("${"))B.push([F,$])}if(B.length>0){W.push(" effect(() => {");for(let[H,$]of B){let F=$.replaceAll(/\$\{([^}]+)\}/g,(L,A)=>`\${${A.replaceAll("state.","this.state.")}}`);W.push(` this.style['${H}'] = \`${F}\`;`)}W.push(" });")}}let V=Y7(Z.children);if(V)W.push(" const _slotted = Array.from(this.childNodes).filter(n => n.nodeType === 1 || (n.nodeType === 3 && n.textContent.trim()));");if(W.push(" if (this.hasAttribute('data-jx-prerendered')) {"),W.push(" this.removeAttribute('data-jx-prerendered');"),W.push(" }"),W.push(" this.innerHTML = '';"),W.push(" this.#dispose = effect(() => render(this.template(), this));"),V)W.push(" const _slot = this.querySelector('slot');"),W.push(" if (_slot && _slotted.length > 0) {"),W.push(" for (const n of _slotted) _slot.before(n);"),W.push(" _slot.remove();"),W.push(" }");return W.push(" }"),W.push(""),W.push(" disconnectedCallback() {"),W.push(" if (this.#dispose) { this.#dispose(); this.#dispose = null; }"),W.push(" }"),W.push("}"),W.push(""),W.push(`customElements.define('${Z.tagName}', ${X});`),W.push(""),W.join(`
108
- `)}function d5(Z,X,q){if(!Z)return"";if(w6(Z))return aJ(Z,q);if(!Array.isArray(Z))return"";return Z.map((W)=>z7(W,q)).join(`
109
- `)}function z7(Z,X){if(typeof Z==="string"){if(Z.includes("${"))return`${X}${u5(Z)}`;return`${X}${y(Z)}`}if(typeof Z==="number"||typeof Z==="boolean")return`${X}${y(String(Z))}`;if(!Z||typeof Z!=="object")return"";let q=Z.tagName??"div",W=[];if(Z.attributes)for(let[U,K]of Object.entries(Z.attributes))if(K&&typeof K==="object"&&L0(K))W.push(`${U}="\${${Z6(K.$ref)}}"`);else if(typeof K==="string"&&K.includes("${"))W.push(`${U}="${V1(K)}"`);else W.push(`${U}="${K}"`);if(Z.id)W.push(`id="${Z.id}"`);if(Z.className)W.push(`class="${Z.className}"`);for(let[U,K]of Object.entries(Z)){if(D6.has(U)||U.startsWith("$")||U.startsWith("on")||U==="tagName"||U==="id"||U==="className"||U==="style"||U==="children"||U==="textContent"||U==="innerHTML"||U==="attributes")continue;if(K&&typeof K==="object"&&K.$ref)W.push(`.${U}="\${${Z6(K.$ref)}}"`);else if(typeof K==="string"&&K.includes("${"))W.push(`.${U}="${V1(K)}"`)}if(Z.$props)for(let[U,K]of Object.entries(Z.$props))if(K&&typeof K==="object"&&K.$ref)W.push(`.${U}="\${${Z6(K.$ref)}}"`);else W.push(`.${U}="\${${JSON.stringify(K)}}"`);for(let[U,K]of Object.entries(Z)){if(!U.startsWith("on")||U==="observedAttributes")continue;let V=U.slice(2).toLowerCase();if(K&&typeof K==="object"&&K.$ref)W.push(`@${V}="\${(e) => ${Z6(K.$ref)}(s, e)}"`);else if(K&&typeof K==="object"&&"$expression"in K){let B=T0(K.$expression,{eventParam:"e",statePrefix:"s"});W.push(`@${V}="\${(e) => { ${B}; }}"`)}else if(i0(K))W.push(`@${V}="\${(e) => { ${oJ(K)} }}"`)}let Q=G7(Z.style);if(Q)W.push(`style="${Q}"`);let J=W.length>0?`
110
- ${X} ${W.join(`
111
- ${X} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(q))return`${X}<${q}${J}
112
- ${X}>`;let Y="";if(Z.$switch){let U=L0(Z.$switch)?Z.$switch.$ref:Z.$switch,K=Z6(U),V=Z.cases??{},B=[];for(let[H,$]of Object.entries(V)){if(!$||L0($))continue;let F=z7($,`${X} `);B.push(` ${JSON.stringify(H)}: html\`
113
- ${F}
114
- \``)}Y=`\${{
108
+ </html>`;return{files:G.files,html:V}}function gQ(Z){if(Z===null||typeof Z!=="object"||Array.isArray(Z))return JSON.stringify(Z);if("default"in Z)return JSON.stringify(Z.default);if(C1(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 n6(Z,W,X){let Q=["// Generated by @jxsuite/compiler — do not edit manually"];if(Z.$id)Q.push(`// Source: ${Z.$id}`);for(let B of X)Q.push(`import '${B}';`);let J=new Map,G=Z.state??{};for(let[B,$]of Object.entries(G)){let L=$;if(L&&typeof L==="object"&&!Array.isArray(L)&&L.$prototype==="Function"&&L.$src){let A=L.$src;if(!J.has(A))J.set(A,[]);J.get(A).push(B)}}for(let[B,$]of J)Q.push(`import { ${$.join(", ")} } from '${B}';`);Q.push("import { reactive, computed, effect } from '@vue/reactivity';","import { render, html } from 'lit-html';","",`class ${W} extends HTMLElement {`," #dispose = null;",""," constructor() {"," super();");let z=[],q=[],K=[];for(let[B,$]of Object.entries(G)){let L=$;if(a0(L)){let A=L.$expression;if(E1(A.operator))K.push([B,L]);else q.push([B,L])}else if(A1(L))if(typeof L.body==="string"&&L.body.includes("return"))q.push([B,L]);else K.push([B,L]);else{let A=gQ(L);if(A!==void 0)z.push([B,A])}}Q.push(" this.state = reactive({");for(let[B,$]of z)Q.push(` ${B}: ${$},`);Q.push(" });");for(let[B,$]of K)if(Q.push(""),a0($)){let L=c0($.$expression,{eventParam:"e",statePrefix:"s"});Q.push(` this.state.${B} = (s, e) => { ${L}; };`)}else{let A=($.parameters?O1($.parameters):$.arguments??["state"]).join(", ");if($.$src)Q.push(` this.state.${B} = (${A}) => ${B}(${A});`);else Q.push(` this.state.${B} = (${A}) => {`,` ${$.body??""}`," };")}for(let[B,$]of q)if(Q.push(""),a0($)){let L=c0($.$expression,{eventParam:"e",statePrefix:"this.state"});Q.push(` this.state.${B} = computed(() => ${L});`)}else if($.$src)Q.push(` this.state.${B} = computed(() => ${B}(this.state));`);else{Q.push(` this.state.${B} = computed(() => {`);let L=($.body??"").replaceAll("state.","this.state.");Q.push(` ${L}`," });")}Q.push(" }","");let V=[];if(Array.isArray(Z.children)){let B={n:0};for(let $ of Z.children)k1($,V,Z.$media??{},"",B,Z.tagName)}if(Q.push(" template() {"," const s = this.state;"," return html`",z3(Z.children,Z.style," ")," `;"," }",""," connectedCallback() {"," const _pa = this.getAttribute('data-jx-props');"," if (_pa) {"," try {"," const _p = JSON.parse(_pa);"," for (const [k, v] of Object.entries(_p)) {"," if (k in this.state) this.state[k] = v;"," }"," } catch {}"," this.removeAttribute('data-jx-props');"," }"," for (const key of Object.keys(this.state)) {"," if (this.hasOwnProperty(key) && this[key] !== undefined) {"," this.state[key] = this[key];"," }"," }"),Z.style&&typeof Z.style==="object"){let B=[];for(let[$,L]of Object.entries(Z.style)){if($.startsWith(":")||$.startsWith(".")||$.startsWith("&")||$.startsWith("[")||$.startsWith("@"))continue;if(L===null||typeof L==="object")continue;let A=k0($);if(typeof L==="string"&&L.includes("${"))B.push([A,L])}if(B.length>0){Q.push(" effect(() => {");for(let[$,L]of B){let A=L.replaceAll(/\$\{([^}]+)\}/g,(j,D)=>`\${${D.replaceAll("state.","this.state.")}}`);Q.push(` this.style['${$}'] = \`${A}\`;`)}Q.push(" });")}}let H=o9(Z.children);if(H)Q.push(" const _slotted = Array.from(this.childNodes).filter(n => n.nodeType === 1 || (n.nodeType === 3 && n.textContent.trim()));");if(Q.push(" if (this.hasAttribute('data-jx-prerendered')) {"," this.removeAttribute('data-jx-prerendered');"," }"," this.innerHTML = '';"," this.#dispose = effect(() => render(this.template(), this));"),H)Q.push(" const _slot = this.querySelector('slot');"," if (_slot && _slotted.length > 0) {"," for (const n of _slotted) _slot.before(n);"," _slot.remove();"," }");return Q.push(" }",""," disconnectedCallback() {"," if (this.#dispose) { this.#dispose(); this.#dispose = null; }"," }","}","",`customElements.define('${Z.tagName}', ${W});`,""),Q.join(`
109
+ `)}function z3(Z,W,X){if(!Z)return"";if(R0(Z))return r9(Z,X);if(!Array.isArray(Z))return"";return Z.map((Q)=>R0(Q)?r9(Q,X):a9(Q,X)).join(`
110
+ `)}function a9(Z,W){if(typeof Z==="string"){if(Z.includes("${"))return`${W}${G3(Z)}`;return`${W}${e(Z)}`}if(typeof Z==="number"||typeof Z==="boolean")return`${W}${e(String(Z))}`;if(!Z||typeof Z!=="object")return"";let X=Z.tagName??"div",Q=[];if(Z.attributes)for(let[K,V]of Object.entries(Z.attributes))if(V&&typeof V==="object"&&h0(V))Q.push(`${K}="\${${T1(V.$ref)}}"`);else if(typeof V==="string"&&V.includes("${"))Q.push(`${K}="${m4(V)}"`);else Q.push(`${K}="${V}"`);if(Z.id)Q.push(`id="${Z.id}"`);if(Z.className)Q.push(`class="${Z.className}"`);for(let[K,V]of Object.entries(Z)){if(x1.has(K)||K.startsWith("$")||K.startsWith("on")||K==="tagName"||K==="id"||K==="className"||K==="style"||K==="children"||K==="textContent"||K==="innerHTML"||K==="attributes")continue;if(V&&typeof V==="object"&&V.$ref)Q.push(`.${K}="\${${T1(V.$ref)}}"`);else if(typeof V==="string"&&V.includes("${"))Q.push(`.${K}="${m4(V)}"`)}if(Z.$props)for(let[K,V]of Object.entries(Z.$props))if(V&&typeof V==="object"&&V.$ref)Q.push(`.${K}="\${${T1(V.$ref)}}"`);else Q.push(`.${K}="\${${JSON.stringify(V)}}"`);for(let[K,V]of Object.entries(Z)){if(!K.startsWith("on")||K==="observedAttributes")continue;let H=K.slice(2).toLowerCase();if(V&&typeof V==="object"&&V.$ref)Q.push(`@${H}="\${(e) => ${T1(V.$ref)}(s, e)}"`);else if(V&&typeof V==="object"&&"$expression"in V){let B=c0(V.$expression,{eventParam:"e",statePrefix:"s"});Q.push(`@${H}="\${(e) => { ${B}; }}"`)}else if(A1(V))Q.push(`@${H}="\${(e) => { ${fQ(V)} }}"`)}let J=s9(Z.style);if(J)Q.push(`style="${J}"`);let G=Q.length>0?`
111
+ ${W} ${Q.join(`
112
+ ${W} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(X))return`${W}<${X}${G}
113
+ ${W}>`;let q="";if(Z.$switch){let K=h0(Z.$switch)?Z.$switch.$ref:Z.$switch,V=T1(K),H=Z.cases??{},B=[];for(let[$,L]of Object.entries(H)){if(!L||h0(L))continue;let A=a9(L,`${W} `);B.push(` ${JSON.stringify($)}: html\`
114
+ ${A}
115
+ \``)}q=`\${{
115
116
  ${B.join(`,
116
117
  `)}
117
- }[${K}]}`}else if(Z.textContent!==void 0)Y=u5(Z.textContent);else if(Z.innerHTML!==void 0)Y=Z.innerHTML;else if(Z.children)Y=`
118
- ${d5(Z.children,Z.style,`${X} `)}
119
- ${X}`;return`${X}<${q}${J}
120
- ${X}>${Y}</${q}>`}function aJ(Z,X){let q=L0(Z.items)?Z6(Z.items.$ref):"ITEMS",W=Z.map;if(!W)return"";let Q=W.tagName??"div",J=[];if(W.$props)for(let[K,V]of Object.entries(W.$props))if(L0(V))J.push(`.${K}="\${${sJ(V.$ref)}}"`);else J.push(`.${K}="\${${JSON.stringify(V)}}"`);let z=G7(W.style);if(z)J.push(`style="${z}"`);for(let[K,V]of Object.entries(W)){if(!K.startsWith("on"))continue;let B=K.slice(2).toLowerCase();if(L0(V))J.push(`@${B}="\${(e) => ${Z6(V.$ref)}(s, e)}"`);else if(O0(V)){let H=T0(V.$expression,{eventParam:"e",statePrefix:"s"});J.push(`@${B}="\${(e) => { ${H}; }}"`)}}let Y=J.length>0?`
121
- ${X} ${J.join(`
122
- ${X} `)}`:"",U="";if(W.textContent!==void 0)U=u5(W.textContent);else if(W.children)U=`
123
- ${d5(W.children,null,`${X} `)}
124
- ${X} `;return`${X}\${${q}.map((item, index) => html\`
125
- ${X} <${Q}${Y}
126
- ${X} >${U}</${Q}>
127
- ${X}\`)}`}function Z6(Z){if(Z.startsWith("#/state/"))return`s.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return`s.${Z}`}function sJ(Z){if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return Z6(Z)}function V1(Z){return Z.replaceAll("state.","s.")}function u5(Z){if(Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string")return`\${${Z6(Z.$ref)}}`;if(typeof Z==="string"&&Z.includes("${"))return V1(Z);return String(Z)}function oJ(Z){return(Z.body??"").replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function G7(Z){if(!Z||typeof Z!=="object")return"";let X=[];for(let[q,W]of Object.entries(Z)){if(q.startsWith(":")||q.startsWith(".")||q.startsWith("&")||q.startsWith("[")||q.startsWith("@"))continue;if(W===null||typeof W==="object")continue;if(typeof W==="string"&&W.includes("${")){let Q=I0(q);X.push(`${Q}: ${V1(W)}`)}}return X.join("; ")}function Y7(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(Y7(X.children))return!0}return!1}var H1=R(()=>{u4();T6();S0();e0()});function U7(Z,X){let{title:q="Jx App",reactivitySrc:W,litHtmlSrc:Q}=X,J=h6(Z,null,Z.state??{},Z.$media??{}),z=f6(Z,Z.$media??{},X.projectStyle??null),Y=[],U=K7(Z,!1,Z,J,Y),K=[],V="",B="";if(Y.length>0){for(let $ of Y){let F=R4($.def,$.className,[]);K.push({content:F,path:`_islands/${$.tagName}.js`,tagName:$.tagName})}V=`<script type="importmap">
118
+ }[${V}]}`}else if(Z.textContent!==void 0)q=G3(Z.textContent);else if(Z.innerHTML!==void 0)q=Z.innerHTML;else if(Z.children)q=`
119
+ ${z3(Z.children,Z.style,`${W} `)}
120
+ ${W}`;return`${W}<${X}${G}
121
+ ${W}>${q}</${X}>`}function r9(Z,W){let X=h0(Z.items)?T1(Z.items.$ref):"ITEMS",Q=Z.map;if(!Q)return"";let J=Q.tagName??"div",G=[];if(Q.$props)for(let[V,H]of Object.entries(Q.$props))if(h0(H))G.push(`.${V}="\${${hQ(H.$ref)}}"`);else G.push(`.${V}="\${${JSON.stringify(H)}}"`);let z=s9(Q.style);if(z)G.push(`style="${z}"`);for(let[V,H]of Object.entries(Q)){if(!V.startsWith("on"))continue;let B=V.slice(2).toLowerCase();if(h0(H))G.push(`@${B}="\${(e) => ${T1(H.$ref)}(s, e)}"`);else if(a0(H)){let $=c0(H.$expression,{eventParam:"e",statePrefix:"s"});G.push(`@${B}="\${(e) => { ${$}; }}"`)}}let q=G.length>0?`
122
+ ${W} ${G.join(`
123
+ ${W} `)}`:"",K="";if(Q.textContent!==void 0)K=G3(Q.textContent);else if(Q.children)K=`
124
+ ${z3(Q.children,null,`${W} `)}
125
+ ${W} `;return`${W}\${${X}.map((item, index) => html\`
126
+ ${W} <${J}${q}
127
+ ${W} >${K}</${J}>
128
+ ${W}\`)}`}function T1(Z){if(Z.startsWith("#/state/"))return`s.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return`s.${Z}`}function hQ(Z){if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return T1(Z)}function m4(Z){return Z.replaceAll("state.","s.")}function G3(Z){if(Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string")return`\${${T1(Z.$ref)}}`;if(typeof Z==="string"&&Z.includes("${"))return m4(Z);return String(Z)}function fQ(Z){return(Z.body??"").replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function s9(Z){if(!Z||typeof Z!=="object")return"";let W=[];for(let[X,Q]of Object.entries(Z)){if(X.startsWith(":")||X.startsWith(".")||X.startsWith("&")||X.startsWith("[")||X.startsWith("@"))continue;if(Q===null||typeof Q==="object")continue;if(typeof Q==="string"&&Q.includes("${")){let J=k0(X);W.push(`${J}: ${m4(Q)}`)}}return W.join("; ")}function o9(Z){if(!Array.isArray(Z))return!1;for(let W of Z){if(!W||typeof W!=="object")continue;if(W.tagName==="slot")return!0;if(o9(W.children))return!0}return!1}var i6=d(()=>{y6();S1();e0();D1()});function t9(Z,W){let{title:X="Jx App",reactivitySrc:Q,litHtmlSrc:J}=W,G=U6(Z,null,Z.state??{},Z.$media??{}),z=K6(Z,Z.$media??{},W.projectStyle??null),q=[],K=e9(Z,!1,Z,G,q),V=[],H="",B="";if(q.length>0){for(let L of q){let A=n6(L.def,L.className,[]);V.push({content:A,path:`_islands/${L.tagName}.js`,tagName:L.tagName})}H=`<script type="importmap">
128
129
  {
129
130
  "imports": {
130
- "@vue/reactivity": "${W}",
131
- "lit-html": "${Q}"
131
+ "@vue/reactivity": "${Q}",
132
+ "lit-html": "${J}"
132
133
  }
133
134
  }
134
- </script>`,B=K.map(($)=>`<script type="module" src="./${$.path}"></script>`).join(`
135
- `)}let H=`<!DOCTYPE html>
135
+ </script>`,B=V.map((L)=>`<script type="module" src="./${L.path}"></script>`).join(`
136
+ `)}let $=`<!DOCTYPE html>
136
137
  <html lang="en">
137
138
  <head>
138
139
  <meta charset="utf-8">
139
140
  <meta name="viewport" content="width=device-width, initial-scale=1">
140
- <title>${y(q)}</title>
141
- ${V}
141
+ <title>${e(X)}</title>
142
+ ${H}
142
143
  ${z}
143
144
  </head>
144
145
  <body>
145
- ${U}
146
+ ${K}
146
147
  ${B}
147
148
  </body>
148
- </html>`;return{files:K,html:H}}function K7(Z,X,q,W,Q){if(typeof Z==="string")return y(Z);if(typeof Z==="number"||typeof Z==="boolean")return y(String(Z));if(!Z||typeof Z!=="object")return"";let J=h6(q,W.scope,q?.state??W.scopeDefs,q?.$media??W.media);if(X){let K=Q.length,V=`jx-island-${K}`,B=`JxIsland${K}`,H={...q??Z,tagName:V};return Q.push({className:B,def:H,tagName:V}),`<${V}></${V}>`}let z=Z.tagName??"div",Y=v6(Z,J.scope),U=tJ(Z,q,J,Q);return`<${z}${Y}>${U}</${z}>`}function tJ(Z,X,q,W){let Q=X??Z;if(Q.textContent!==void 0){let J=p(Q.textContent,q.scope);return J==null?"":y(String(J))}if(Q.innerHTML)return p(Q.innerHTML,q.scope)??Q.innerHTML;if(Array.isArray(Q.children)){let J=Array.isArray(X?.children)?X.children:void 0;return Q.children.map((z,Y)=>{let U=z,K=e3(U),V=J?.[Y]??z;return K7(U,K,V,q,W)}).join(`
149
- `)}return""}var V7=R(()=>{T6();H1()});function B7(Z,X){let{title:q="Jx App",reactivitySrc:W=y6,litHtmlSrc:Q=g6,modulePath:J="app.js"}=X,z=h6(Z,null,Z.state??{},Z.$media??{}),Y=f6(Z,Z.$media??{},X.projectStyle??null),U={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},K=new Map,V=new Map,B=[],H=[],$=[],F=[],L=[],A=new Map,I=Z.state??{};for(let[C,T]of Object.entries(I)){if(T===null||typeof T!=="object"||Array.isArray(T)){if(typeof T==="string"&&x(T))H.push([C,`() => \`${T}\``]);else B.push([C,T]);continue}if(O0(T)){let j=T.$expression,S=T0(j,{eventParam:"e",statePrefix:"state"});if(L6(j.operator))F.push([C,{args:["state","e"],body:S}]);else H.push([C,`() => ${S}`]);continue}if(i0(T)){let j=T.parameters?z6(T.parameters):T.arguments;if(T.$src){if(!A.has(T.$src))A.set(T.$src,new Set);A.get(T.$src).add(C),H.push([C,`() => { return ${C}(state); }`])}else if(T.body&&T.body.includes("return"))H.push([C,`() => { ${T.body} }`]);else F.push([C,{args:j??["state"],body:T.body}]);continue}if(J6(T))continue;if(a3(T)){B.push([C,T.default]);continue}if(I6(T)){if(T.$prototype==="LocalStorage"||T.$prototype==="SessionStorage"){let j=T.$prototype==="LocalStorage"?"localStorage":"sessionStorage",S=T.key??C,g=T.default??null;B.push([C,null]),L.push(Xz(C,j,S,g));continue}if(T.$prototype==="Request"){B.push([C,null]),L.push(Zz(C,T));continue}if(T.$prototype==="Cookie"){B.push([C,null]),L.push(qz(C,T.name??C,T.default??null));continue}}B.push([C,T])}let M=H7(Z,Z,z,K,V,U);for(let[C,T]of K)if(!$.some(([j])=>j===C))$.push([C,T]);for(let[C,T]of V)if(!F.some(([j])=>j===C))F.push([C,T]);let P=eJ(B,H,$,F,L,A,U,W),k=[` "@vue/reactivity": "${W}"`,` "lit-html": "${Q}"`],b=`<!DOCTYPE html>
149
+ </html>`;return{files:V,html:$}}function e9(Z,W,X,Q,J){if(typeof Z==="string")return e(Z);if(typeof Z==="number"||typeof Z==="boolean")return e(String(Z));if(!Z||typeof Z!=="object")return"";let G=U6(X,Q.scope,X?.state??Q.scopeDefs,X?.$media??Q.media);if(W){let V=J.length,H=`jx-island-${V}`,B=`JxIsland${V}`,$={...X??Z,tagName:H};return J.push({className:B,def:$,tagName:H}),`<${H}></${H}>`}let z=Z.tagName??"div",q=G6(Z,G.scope),K=mQ(Z,X,G,J);return`<${z}${q}>${K}</${z}>`}function mQ(Z,W,X,Q){let J=W??Z;if(J.textContent!==void 0){let G=F0(J.textContent,X.scope);return G==null?"":e(String(G))}if(J.innerHTML)return F0(J.innerHTML,X.scope)??J.innerHTML;if(Array.isArray(J.children)){let G=Array.isArray(W?.children)?W.children:void 0;return J.children.map((z,q)=>{let K=z,V=N8(K),H=G?.[q]??z;return e9(K,V,H,X,Q)}).join(`
150
+ `)}return""}var Z5=d(()=>{S1();i6()});function U3(Z,W){let{title:X="Jx App",reactivitySrc:Q=z6,litHtmlSrc:J=Y6,modulePath:G="app.js"}=W,z=U6(Z,null,Z.state??{},Z.$media??{}),q=K6(Z,Z.$media??{},W.projectStyle??null),K={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},V=new Map,H=new Map,B=[],$=[],L=[],A=[],j=[],D=new Map,R=Z.state??{};for(let[m,S]of Object.entries(R)){if(S===null||typeof S!=="object"||Array.isArray(S)){if(typeof S==="string"&&s(S))$.push([m,`() => \`${S}\``]);else B.push([m,S]);continue}if(a0(S)){let c=S.$expression,o=c0(c,{eventParam:"e",statePrefix:"state"});if(E1(c.operator))A.push([m,{args:["state","e"],body:o}]);else $.push([m,`() => ${o}`]);continue}if(A1(S)){let c=S.parameters?O1(S.parameters):S.arguments;if(S.$src){if(!D.has(S.$src))D.set(S.$src,new Set);D.get(S.$src).add(m),$.push([m,`() => { return ${m}(state); }`])}else if(S.body&&S.body.includes("return"))$.push([m,`() => { ${S.body} }`]);else A.push([m,{args:c??["state"],body:S.body}]);continue}if(C1(S))continue;if(A8(S)){B.push([m,S.default]);continue}if(c1(S)){if(S.$prototype==="LocalStorage"||S.$prototype==="SessionStorage"){let c=S.$prototype==="LocalStorage"?"localStorage":"sessionStorage",o=S.key??m,W0=S.default??null;B.push([m,null]),j.push(cQ(m,c,o,W0));continue}if(S.$prototype==="Request"){B.push([m,null]),j.push(dQ(m,S));continue}if(S.$prototype==="Cookie"){B.push([m,null]),j.push(lQ(m,S.name??m,S.default??null));continue}}B.push([m,S])}let x=W5(Z,Z,z,V,H,K);for(let[m,S]of V)if(!L.some(([c])=>c===m))L.push([m,S]);for(let[m,S]of H)if(!A.some(([c])=>c===m))A.push([m,S]);let f=uQ(B,$,L,A,j,D,K,Q),p=[` "@vue/reactivity": "${Q}"`,` "lit-html": "${J}"`],r=`<!DOCTYPE html>
150
151
  <html lang="en">
151
152
  <head>
152
153
  <meta charset="utf-8">
153
154
  <meta name="viewport" content="width=device-width, initial-scale=1">
154
- <title>${y(q)}</title>
155
+ <title>${e(X)}</title>
155
156
  <script type="importmap">
156
157
  {
157
158
  "imports": {
158
- ${k.join(`,
159
+ ${p.join(`,
159
160
  `)}
160
161
  }
161
162
  }
162
163
  </script>
163
- ${Y}
164
- <script type="module" src="./${J}"></script>
164
+ ${q}
165
+ <script type="module" src="./${G}"></script>
165
166
  </head>
166
167
  <body>
167
- ${M}
168
+ ${x}
168
169
  </body>
169
- </html>`;return{files:[{content:P,path:J}],html:b}}function H7(Z,X,q,W,Q,J){if(typeof Z==="string")return y(Z);if(typeof Z==="number"||typeof Z==="boolean")return y(String(Z));if(!Z||typeof Z!=="object")return"";let z=h6(X,q.scope,X?.state??q.scopeDefs,X?.$media??q.media),Y=Z.tagName??"div",U=[],K=!1;if(Z.textContent!==void 0){let A=X?.textContent??Z.textContent;if(b0(A)){let I=E6(A.$ref);U.push(`:text-content="${I}"`),c5(W,I,A.$ref),K=!0}else if(x(A)){let I=`_t${J.t}`;J.t+=1,U.push(`:text-content="${I}"`),W.set(I,`() => \`${A}\``),K=!0}}for(let[A,I]of Object.entries(Z)){if(!A.startsWith("on")||A==="observedAttributes")continue;let M=A.slice(2).toLowerCase();if(b0(I)){let P=E6(I.$ref);U.push(`@${M}="${P}"`),K=!0}else if(i0(I)){let P=`_h${J.h}`;J.h+=1,U.push(`@${M}="${P}"`),Q.set(P,{args:I.parameters?z6(I.parameters):I.arguments??["state","event"],body:I.body}),K=!0}else if(O0(I)){let P=`_h${J.h}`;J.h+=1,U.push(`@${M}="${P}"`);let k=T0(I.$expression,{eventParam:"e",statePrefix:"state"});Q.set(P,{args:["state","e"],body:k}),K=!0}}if(Z.style&&typeof Z.style==="object")for(let[A,I]of Object.entries(Z.style)){if(A.startsWith(":")||A.startsWith(".")||A.startsWith("&")||A.startsWith("[")||A.startsWith("@"))continue;if(I===null||typeof I==="object")continue;if(x(I)){let M=`_s${J.s}`;J.s+=1,U.push(`:style.${I0(A)}="${M}"`),W.set(M,`() => \`${I}\``),K=!0}}if(Z.attributes&&typeof Z.attributes==="object"){for(let[A,I]of Object.entries(Z.attributes))if(b0(I)){let M=E6(I.$ref);U.push(`:attr.${A}="${M}"`),c5(W,M,I.$ref),K=!0}else if(x(I)){let M=`_t${J.t}`;J.t+=1,U.push(`:attr.${A}="${M}"`),W.set(M,`() => \`${I}\``),K=!0}}for(let[A,I]of Object.entries(Z)){if(D6.has(A)||A.startsWith("on")||A.startsWith("$")||A==="tagName"||A==="id"||A==="className"||A==="style"||A==="children"||A==="textContent"||A==="innerHTML"||A==="attributes")continue;if(b0(I)){let M=E6(I.$ref);U.push(`:${I0(A)}="${M}"`),c5(W,M,I.$ref),K=!0}else if(x(I)){let M=`_t${J.t}`;J.t+=1,U.push(`:${I0(A)}="${M}"`),W.set(M,`() => \`${I}\``),K=!0}}let V=v6(Z,z.scope),B=K?" data-bind":"",H=U.length>0?` ${U.join(" ")}`:"",$="",F=X??Z;if(F.textContent!==void 0&&!K){let A=p(F.textContent,z.scope);$=A==null?"":y(String(A))}else if(F.textContent!==void 0&&K){let A=p(F.textContent,z.scope);$=A==null?"":y(String(A))}else if(F.innerHTML)$=p(F.innerHTML,z.scope)??F.innerHTML;else if(w6(F.children)){J.needsLit=!0;let A=`_list${J.l}`;J.l+=1;let I=F.children,M;if(b0(I.items))M=`state.${E6(I.items.$ref)}`;else M=JSON.stringify(I.items);let P=$7(I.map);W.set(A,`() => (${M} ?? []).map((item, index) => html\`${P}\`)`),U.push(`:render="${A}"`),K=!0;let k=" data-bind",b=` ${U.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${V}${k}${b}>`;return`<${Y}${V}${k}${b}></${Y}>`}else if(Array.isArray(F.children)){let A=Array.isArray(X?.children)?X.children:void 0;$=F.children.map((I,M)=>{let P=A?.[M]??I;return H7(I,P,z,W,Q,J)}).join(`
170
- `)}if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${V}${B}${H}>`;return`<${Y}${V}${B}${H}>${$}</${Y}>`}function $7(Z){if(!Z)return"";let X=Z.tagName??"div",q="";if(Z.id)q+=` id="${Z.id}"`;if(Z.className)q+=` class="${o6(Z.className)}"`;if(Z.attributes&&typeof Z.attributes==="object")for(let[J,z]of Object.entries(Z.attributes))q+=typeof z==="string"&&x(z)?` ${J}="${o6(z)}"`:` ${J}="${y(String(z))}"`;if(Z.style&&typeof Z.style==="object"){let J=[];for(let[z,Y]of Object.entries(Z.style)){if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")||z.startsWith("@"))continue;if(Y===null||typeof Y==="object")continue;let U=I0(z);if(x(String(Y)))J.push(`${U}: ${o6(String(Y))}`);else J.push(`${U}: ${Y}`)}if(J.length>0)q+=` style="${J.join("; ")}"`}for(let[J,z]of Object.entries(Z)){if(!J.startsWith("on")||J==="observedAttributes")continue;let Y=J.slice(2).toLowerCase();if(b0(z)){let U=E6(z.$ref);q+=` @${Y}=\${(e) => { state.$map = { item, index }; on.${U}(e); }}`}else if(z&&typeof z==="object"&&z.$prototype==="Function"){let U=o6(z.body);q+=` @${Y}=\${(e) => { ${U} }}`}else if(z&&typeof z==="object"&&"$expression"in z){let U=T0(z.$expression,{eventParam:"e",statePrefix:"state"});q+=` @${Y}=\${(e) => { state.$map = { item, index }; ${U}; }}`}}if(Z.contentEditable)q+=` contenteditable="${Z.contentEditable}"`;let W="";if(Z.textContent!==void 0){let J=String(Z.textContent);if(x(J))W=o6(J);else if(b0(Z.textContent))W=`\${state.${E6(Z.textContent.$ref)}}`;else W=y(J)}else if(Z.innerHTML)W=o6(String(Z.innerHTML));else if(Array.isArray(Z.children))W=`
171
- ${Z.children.map((J)=>$7(J)).join(`
170
+ </html>`;return{files:[{content:f,path:G}],html:r}}function W5(Z,W,X,Q,J,G){if(typeof Z==="string")return e(Z);if(typeof Z==="number"||typeof Z==="boolean")return e(String(Z));if(!Z||typeof Z!=="object")return"";let z=U6(W,X.scope,W?.state??X.scopeDefs,W?.$media??X.media),q=Z.tagName??"div",K=[],V=!1;if(Z.textContent!==void 0){let D=W?.textContent??Z.textContent;if(s0(D)){let R=v1(D.$ref);K.push(`:text-content="${R}"`),Y3(Q,R,D.$ref),V=!0}else if(s(D)){let R=`_t${G.t}`;G.t+=1,K.push(`:text-content="${R}"`),Q.set(R,`() => \`${D}\``),V=!0}}for(let[D,R]of Object.entries(Z)){if(!D.startsWith("on")||D==="observedAttributes")continue;let x=D.slice(2).toLowerCase();if(s0(R)){let f=v1(R.$ref);K.push(`@${x}="${f}"`),V=!0}else if(A1(R)){let f=`_h${G.h}`;G.h+=1,K.push(`@${x}="${f}"`),J.set(f,{args:R.parameters?O1(R.parameters):R.arguments??["state","event"],body:R.body}),V=!0}else if(a0(R)){let f=`_h${G.h}`;G.h+=1,K.push(`@${x}="${f}"`);let p=c0(R.$expression,{eventParam:"e",statePrefix:"state"});J.set(f,{args:["state","e"],body:p}),V=!0}}if(Z.style&&typeof Z.style==="object")for(let[D,R]of Object.entries(Z.style)){if(D.startsWith(":")||D.startsWith(".")||D.startsWith("&")||D.startsWith("[")||D.startsWith("@"))continue;if(R===null||typeof R==="object")continue;if(s(R)){let x=`_s${G.s}`;G.s+=1,K.push(`:style.${k0(D)}="${x}"`),Q.set(x,`() => \`${R}\``),V=!0}}if(Z.attributes&&typeof Z.attributes==="object"){for(let[D,R]of Object.entries(Z.attributes))if(s0(R)){let x=v1(R.$ref);K.push(`:attr.${D}="${x}"`),Y3(Q,x,R.$ref),V=!0}else if(s(R)){let x=`_t${G.t}`;G.t+=1,K.push(`:attr.${D}="${x}"`),Q.set(x,`() => \`${R}\``),V=!0}}for(let[D,R]of Object.entries(Z)){if(x1.has(D)||D.startsWith("on")||D.startsWith("$")||D==="tagName"||D==="id"||D==="className"||D==="style"||D==="children"||D==="textContent"||D==="innerHTML"||D==="attributes")continue;if(s0(R)){let x=v1(R.$ref);K.push(`:${k0(D)}="${x}"`),Y3(Q,x,R.$ref),V=!0}else if(s(R)){let x=`_t${G.t}`;G.t+=1,K.push(`:${k0(D)}="${x}"`),Q.set(x,`() => \`${R}\``),V=!0}}let H=G6(Z,z.scope),B=V?" data-bind":"",$=K.length>0?` ${K.join(" ")}`:"",L="",A=W??Z;if(A.textContent!==void 0&&!V){let D=F0(A.textContent,z.scope);L=D==null?"":e(String(D))}else if(A.textContent!==void 0&&V){let D=F0(A.textContent,z.scope);L=D==null?"":e(String(D))}else if(A.innerHTML)L=F0(A.innerHTML,z.scope)??A.innerHTML;else if(R0(A.children)){G.needsLit=!0;let D=`_list${G.l}`;G.l+=1;let R=A.children,x;if(s0(R.items))x=`state.${v1(R.items.$ref)}`;else x=JSON.stringify(R.items);let f=q3(R.map);Q.set(D,`() => (${x} ?? []).map((item, index) => html\`${f}\`)`),K.push(`:render="${D}"`),V=!0;let p=" data-bind",r=` ${K.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(q))return`<${q}${H}${p}${r}>`;return`<${q}${H}${p}${r}></${q}>`}else if(Array.isArray(A.children)&&A.children.some((D)=>R0(D))){G.needsLit=!0;let D=`_children${G.l}`;G.l+=1;let R=A.children.map((f)=>X5(f)).join(`
171
+ `);Q.set(D,`() => html\`
172
+ ${R}
173
+ \``),K.push(`:render="${D}"`),V=!0;let x=` ${K.join(" ")}`;return`<${q}${H} data-bind${x}></${q}>`}else if(Array.isArray(A.children)){let D=Array.isArray(W?.children)?W.children:void 0;L=A.children.map((R,x)=>{let f=D?.[x]??R;return W5(R,f,z,Q,J,G)}).join(`
174
+ `)}if(new Set(["input","br","hr","img","meta","link"]).has(q))return`<${q}${H}${B}${$}>`;return`<${q}${H}${B}${$}>${L}</${q}>`}function q3(Z){if(!Z)return"";let W=Z.tagName??"div",X="";if(Z.id)X+=` id="${Z.id}"`;if(Z.className)X+=` class="${r1(Z.className)}"`;if(Z.attributes&&typeof Z.attributes==="object")for(let[G,z]of Object.entries(Z.attributes))X+=typeof z==="string"&&s(z)?` ${G}="${r1(z)}"`:` ${G}="${e(String(z))}"`;if(Z.style&&typeof Z.style==="object"){let G=[];for(let[z,q]of Object.entries(Z.style)){if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")||z.startsWith("@"))continue;if(q===null||typeof q==="object")continue;let K=k0(z);if(s(String(q)))G.push(`${K}: ${r1(String(q))}`);else G.push(`${K}: ${q}`)}if(G.length>0)X+=` style="${G.join("; ")}"`}for(let[G,z]of Object.entries(Z)){if(!G.startsWith("on")||G==="observedAttributes")continue;let q=G.slice(2).toLowerCase();if(s0(z)){let K=v1(z.$ref);X+=` @${q}=\${(e) => { state.$map = { item, index }; on.${K}(e); }}`}else if(z&&typeof z==="object"&&z.$prototype==="Function"){let K=r1(z.body);X+=` @${q}=\${(e) => { ${K} }}`}else if(z&&typeof z==="object"&&"$expression"in z){let K=c0(z.$expression,{eventParam:"e",statePrefix:"state"});X+=` @${q}=\${(e) => { state.$map = { item, index }; ${K}; }}`}}if(Z.contentEditable)X+=` contenteditable="${Z.contentEditable}"`;let Q="";if(Z.textContent!==void 0){let G=String(Z.textContent);if(s(G))Q=r1(G);else if(s0(Z.textContent))Q=`\${state.${v1(Z.textContent.$ref)}}`;else Q=e(G)}else if(Z.innerHTML)Q=r1(String(Z.innerHTML));else if(R0(Z.children))Q=`
175
+ ${Q5(Z.children)}
176
+ `;else if(Array.isArray(Z.children))Q=`
177
+ ${Z.children.map((G)=>X5(G)).join(`
172
178
  `)}
173
- `;if(new Set(["input","br","hr","img","meta","link"]).has(X))return`<${X}${q}>`;return`<${X}${q}>${W}</${X}>`}function o6(Z){return Z.replaceAll("$map.","")}function eJ(Z,X,q,W,Q,J,z,Y){let U=[],{needsLit:K}=z,V=X.length>0;U.push("// Generated by @jxsuite/compiler — do not edit manually");let B=["reactive","effect"];if(V)B.push("computed");if(U.push(`import { ${B.join(", ")} } from '@vue/reactivity';`),K)U.push("import { html, render } from 'lit-html';");for(let[H,$]of J)U.push(`import { ${[...$].join(", ")} } from '${H}';`);U.push(""),U.push("const state = reactive({");for(let[H,$]of Z)U.push(` ${H}: ${JSON.stringify($)},`);if(U.push("});"),U.push(""),Q.length>0){for(let H of Q)U.push(H);U.push("")}if(X.length>0){for(let[H,$]of X)U.push(`state.${H} = computed(${$});`);U.push("")}if(q.length>0){U.push("const bind = {");for(let[H,$]of q)U.push(` ${H}: ${$},`);U.push("};")}else U.push("const bind = {};");if(U.push(""),W.length>0){U.push("const on = {");for(let[H,$]of W){let F=$.args??["state"],L=F.map((A)=>A==="state"?"state":"e").join(", ");U.push(` ${H}: (e) => { const fn = (${F.join(", ")}) => { ${$.body} }; fn(${L}); },`)}U.push("};")}else U.push("const on = {};");if(U.push(""),U.push("function hydrate(root) {"),U.push(" root.querySelectorAll('[data-bind]').forEach(el => {"),U.push(" [...el.attributes].forEach(a => {"),U.push(" if (a.name.startsWith(':')) {"),U.push(" const parts = a.name.slice(1).split('.');"),U.push(" const key = a.value;"),K)U.push(" if (parts[0] === 'render') {"),U.push(" effect(() => { render(bind[key](), el); });"),U.push(" } else if (parts[0] === 'style' && parts.length > 1) {");else U.push(" if (parts[0] === 'style' && parts.length > 1) {");return U.push(" effect(() => { el.style[parts[1]] = bind[key](); });"),U.push(" } else if (parts[0] === 'attr' && parts.length > 1) {"),U.push(" effect(() => { el.setAttribute(parts[1], bind[key]()); });"),U.push(" } else {"),U.push(" const prop = parts[0].replace(/-([a-z])/g, (_, c) => c.toUpperCase());"),U.push(" effect(() => { el[prop] = bind[key](); });"),U.push(" }"),U.push(" } else if (a.name.startsWith('@')) {"),U.push(" el.addEventListener(a.name.slice(1), on[a.value]);"),U.push(" }"),U.push(" });"),U.push(" });"),U.push("}"),U.push(""),U.push("hydrate(document);"),U.push(""),U.join(`
174
- `)}function Zz(Z,X){let{url:q}=X,W=X.method??"GET",Q=x(q);if(X.manual)return`// ${Z}: manual Request — fetch triggered by user action`;let J=[`// ${Z}: auto-fetch from ${Q?"(dynamic URL)":q}`,"effect(() => {"];if(Q)J.push(` const url = \`${q}\`;`),J.push(' if (!url || url === "undefined" || url.includes("undefined")) return;');else J.push(` const url = ${JSON.stringify(q)};`);let z=[];if(W!=="GET")z.push(`method: ${JSON.stringify(W)}`);if(X.headers)z.push(`headers: ${JSON.stringify(X.headers)}`);if(X.body){let U=typeof X.body==="object"?JSON.stringify(JSON.stringify(X.body)):JSON.stringify(X.body);z.push(`body: ${U}`)}let Y=z.length>0?`, { ${z.join(", ")} }`:"";return J.push(` fetch(url${Y})`),J.push(" .then(r => r.ok ? r.json() : Promise.reject(r.statusText))"),J.push(` .then(d => { state.${Z} = d; })`),J.push(` .catch(e => { state.${Z} = { error: String(e) }; });`),J.push("});"),J.join(`
175
- `)}function Xz(Z,X,q,W){return[`// ${Z}: ${X} (key: "${q}")`,"try {",` const _s = ${X}.getItem(${JSON.stringify(q)});`,` state.${Z} = _s !== null ? JSON.parse(_s) : ${JSON.stringify(W)};`,`} catch { state.${Z} = ${JSON.stringify(W)}; }`,"effect(() => {",` const v = state.${Z};`," try {",` if (v === null) ${X}.removeItem(${JSON.stringify(q)});`,` else ${X}.setItem(${JSON.stringify(q)}, JSON.stringify(v));`," } catch {}","});"].join(`
176
- `)}function qz(Z,X,q){return[`// ${Z}: Cookie (name: "${X}")`,"{",` const _m = document.cookie.match(new RegExp("(?:^|; )${X}=([^;]*)"));`,` try { state.${Z} = _m ? JSON.parse(decodeURIComponent(_m[1])) : ${JSON.stringify(q)}; }`,` catch { state.${Z} = _m ? _m[1] : ${JSON.stringify(q)}; }`,"}"].join(`
177
- `)}function E6(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replaceAll("/","_");return Z.replaceAll("/","_")}function c5(Z,X,q){if(Z.has(X))return;if(q.startsWith("#/state/")){let Q=q.slice(8).split("/");Z.set(X,`() => state.${Q.join(".")}`)}else Z.set(X,`() => state.${q}`)}var F7=R(()=>{u4();T6();S0()});var M7={};f4(M7,{compileClassJson:()=>Wz});function Wz(Z,X={}){let q=Z.title;if(!q)throw Error("compileClassJson: missing title (class name)");let W=Qz(Z.extends),Q=Z.$defs,J=Q?.fields??{},z=Q?.constructor,Y=typeof z==="object"?z:void 0,U=Q?.methods??{},K=["// Generated by @jxsuite/compiler from .class.json — do not edit manually"];if(Z.$id)K.push(`// Source: ${Z.$id}`);K.push("");let V=W!=="Object"?` extends ${W}`:"";K.push(`class ${q}${V} {`);for(let[B,H]of Object.entries(J)){if(H.scope!=="static")continue;let $=H.identifier??B,F=H.access==="private"?"#":"",L=H.initializer!==void 0?JSON.stringify(H.initializer):H.default!==void 0?JSON.stringify(H.default):"null";K.push(` static ${F}${$} = ${L};`)}for(let[B,H]of Object.entries(J)){if(H.scope==="static")continue;if(H.access!=="private")continue;let $=H.identifier??B;K.push(` #${$};`)}if(Object.keys(J).length>0)K.push("");if(K.push(" constructor(config = {}) {"),Y?.superCall||W!=="Object"){let B=Y?.superCall?.arguments?Y.superCall.arguments.join(", "):"";K.push(` super(${B});`)}for(let[B,H]of Object.entries(J)){if(H.scope==="static")continue;let $=H.identifier??B,F=H.access==="private"?"#":"",L=H.initializer!==void 0?JSON.stringify(H.initializer):H.default!==void 0?JSON.stringify(H.default):"null";K.push(` this.${F}${$} = config.${$} !== undefined ? config.${$} : ${L};`)}if(Y?.body){let B=Array.isArray(Y.body)?Y.body:[Y.body];for(let H of B)K.push(` ${H}`)}K.push(" }");for(let[B,H]of Object.entries(U)){let $=H.identifier??B,F=H.scope==="static",A=H.access==="private"?"#":"",I=F?"static ":"",M=H.returnType?.$ref?.includes("Promise")||zz(H)?"async ":"",P=A7(H.parameters??[]),k=Jz(H.body);if(K.push(""),H.role==="accessor"){if(H.getter)K.push(` ${I}get ${A}${$}() {`),K.push(` ${H.getter.body}`),K.push(" }");if(H.setter){let b=A7(H.setter.parameters??[]);K.push(` ${I}set ${A}${$}(${b}) {`),K.push(` ${H.setter.body}`),K.push(" }")}}else{K.push(` ${I}${M}${A}${$}(${P}) {`);for(let b of k)K.push(` ${b}`);K.push(" }")}}return K.push("}"),K.push(""),K.push(`export { ${q} };`),K.push(`export default ${q};`),K.push(""),K.join(`
178
- `)}function Qz(Z){if(!Z)return"Object";if(typeof Z==="string")return Z;if(Z.$ref){let X=Z.$ref.match(/([A-Za-z0-9_]+)\.class\.json/);return X?X[1]:"Object"}return"Object"}function A7(Z){return Z.map((X)=>{if(X.$ref)return X.$ref.split("/").pop();let q=X.identifier??X.name;return typeof q==="string"?q:"arg"}).join(", ")}function Jz(Z){if(!Z)return[""];return Array.isArray(Z)?Z:[Z]}function zz(Z){return(Array.isArray(Z.body)?Z.body.join(`
179
- `):Z.body??"").includes("await ")}import{readFileSync as Gz}from"node:fs";async function l5(Z,X={}){let{title:q="Jx App",reactivitySrc:W=y6,litHtmlSrc:Q=g6,projectStyle:J=null}=X,z;if(typeof Z==="string"){let Y=Gz(Z,"utf8");if(Z.endsWith(".json"))z=V6(Y,Z);else{let{extname:U}=await import("node:path"),K=U(Z).toLowerCase(),V=X.formats?.byExtension?.(K,"parse");if(!V){let{unknownFormatError:B}=await Promise.resolve().then(() => (s6(),f5));throw B(Z,K)}z=await V.call("parse",Y)}}else z=Z;if(o3(z)){let{compileClassJson:Y}=await Promise.resolve().then(() => M7),U=Y(z,X),K=typeof Z==="string"?Z.replace(/\.class\.json$/,".js"):`${z.title}.js`;return{files:[{content:U,path:K}],html:""}}if(!o1(z))return U7(z,{litHtmlSrc:Q,projectStyle:J,reactivitySrc:W,title:q});if(z.tagName&&z.tagName.includes("-")){let{tagName:Y}=z,U=c4(Y),V={content:R4(z,U,[]),path:`${Y}.js`,tagName:Y},B=f6(z,z.$media??{}),H=`<!DOCTYPE html>
179
+ `;if(new Set(["input","br","hr","img","meta","link"]).has(W))return`<${W}${X}>`;return`<${W}${X}>${Q}</${W}>`}function X5(Z){if(typeof Z==="string")return s(Z)?r1(Z):e(Z);if(typeof Z==="number"||typeof Z==="boolean")return e(String(Z));if(R0(Z))return Q5(Z);return q3(Z)}function Q5(Z){let{items:W}=Z,X=s0(W)?`state.${v1(W.$ref)}`:JSON.stringify(W??[]),Q=q3(Z.map);return`\${(${X} ?? []).map((item, index) => html\`${Q}\`)}`}function r1(Z){return Z.replaceAll("$map.","")}function uQ(Z,W,X,Q,J,G,z,q){let K=[],{needsLit:V}=z,H=W.length>0;K.push("// Generated by @jxsuite/compiler — do not edit manually");let B=["reactive","effect"];if(H)B.push("computed");if(K.push(`import { ${B.join(", ")} } from '@vue/reactivity';`),V)K.push("import { html, render } from 'lit-html';");for(let[$,L]of G)K.push(`import { ${[...L].join(", ")} } from '${$}';`);K.push("","const state = reactive({");for(let[$,L]of Z)K.push(` ${$}: ${JSON.stringify(L)},`);if(K.push("});",""),J.length>0){for(let $ of J)K.push($);K.push("")}if(W.length>0){for(let[$,L]of W)K.push(`state.${$} = computed(${L});`);K.push("")}if(X.length>0){K.push("const bind = {");for(let[$,L]of X)K.push(` ${$}: ${L},`);K.push("};")}else K.push("const bind = {};");if(K.push(""),Q.length>0){K.push("const on = {");for(let[$,L]of Q){let A=L.args??["state"],j=A.map((D)=>D==="state"?"state":"e").join(", ");K.push(` ${$}: (e) => { const fn = (${A.join(", ")}) => { ${L.body} }; fn(${j}); },`)}K.push("};")}else K.push("const on = {};");if(K.push("","function hydrate(root) {"," root.querySelectorAll('[data-bind]').forEach(el => {"," [...el.attributes].forEach(a => {"," if (a.name.startsWith(':')) {"," const parts = a.name.slice(1).split('.');"," const key = a.value;"),V)K.push(" if (parts[0] === 'render') {"," effect(() => { render(bind[key](), el); });"," } else if (parts[0] === 'style' && parts.length > 1) {");else K.push(" if (parts[0] === 'style' && parts.length > 1) {");return K.push(" effect(() => { el.style[parts[1]] = bind[key](); });"," } else if (parts[0] === 'attr' && parts.length > 1) {"," effect(() => { el.setAttribute(parts[1], bind[key]()); });"," } else {"," const prop = parts[0].replace(/-([a-z])/g, (_, c) => c.toUpperCase());"," effect(() => { el[prop] = bind[key](); });"," }"," } else if (a.name.startsWith('@')) {"," el.addEventListener(a.name.slice(1), on[a.value]);"," }"," });"," });","}","","hydrate(document);",""),K.join(`
180
+ `)}function dQ(Z,W){let{url:X}=W,Q=W.method??"GET",J=s(X);if(W.manual)return`// ${Z}: manual Request — fetch triggered by user action`;let G=[`// ${Z}: auto-fetch from ${J?"(dynamic URL)":X}`,"effect(() => {"];if(J)G.push(` const url = \`${X}\`;`,' if (!url || url === "undefined" || url.includes("undefined")) return;');else G.push(` const url = ${JSON.stringify(X)};`);let z=[];if(Q!=="GET")z.push(`method: ${JSON.stringify(Q)}`);if(W.headers)z.push(`headers: ${JSON.stringify(W.headers)}`);if(W.body){let K=typeof W.body==="object"?JSON.stringify(JSON.stringify(W.body)):JSON.stringify(W.body);z.push(`body: ${K}`)}let q=z.length>0?`, { ${z.join(", ")} }`:"";return G.push(` fetch(url${q})`," .then(r => r.ok ? r.json() : Promise.reject(r.statusText))",` .then(d => { state.${Z} = d; })`,` .catch(e => { state.${Z} = { error: String(e) }; });`,"});"),G.join(`
181
+ `)}function cQ(Z,W,X,Q){return[`// ${Z}: ${W} (key: "${X}")`,"try {",` const _s = ${W}.getItem(${JSON.stringify(X)});`,` state.${Z} = _s !== null ? JSON.parse(_s) : ${JSON.stringify(Q)};`,`} catch { state.${Z} = ${JSON.stringify(Q)}; }`,"effect(() => {",` const v = state.${Z};`," try {",` if (v === null) ${W}.removeItem(${JSON.stringify(X)});`,` else ${W}.setItem(${JSON.stringify(X)}, JSON.stringify(v));`," } catch {}","});"].join(`
182
+ `)}function lQ(Z,W,X){return[`// ${Z}: Cookie (name: "${W}")`,"{",` const _m = document.cookie.match(new RegExp("(?:^|; )${W}=([^;]*)"));`,` try { state.${Z} = _m ? JSON.parse(decodeURIComponent(_m[1])) : ${JSON.stringify(X)}; }`,` catch { state.${Z} = _m ? _m[1] : ${JSON.stringify(X)}; }`,"}"].join(`
183
+ `)}function v1(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replaceAll("/","_");return Z.replaceAll("/","_")}function Y3(Z,W,X){if(Z.has(W))return;if(X.startsWith("#/state/")){let J=X.slice(8).split("/");Z.set(W,`() => state.${J.join(".")}`)}else Z.set(W,`() => state.${X}`)}var K3=d(()=>{y6();S1();e0()});var G5={};w4(G5,{compileClassJson:()=>pQ});function pQ(Z,W={}){let X=Z.title;if(!X)throw Error("compileClassJson: missing title (class name)");let Q=nQ(Z.extends),J=Z.$defs,G=J?.fields??{},z=J?.constructor,q=typeof z==="object"?z:void 0,K=J?.methods??{},V=["// Generated by @jxsuite/compiler from .class.json — do not edit manually"];if(Z.$id)V.push(`// Source: ${Z.$id}`);V.push("");let H=Q!=="Object"?` extends ${Q}`:"";V.push(`class ${X}${H} {`);for(let[B,$]of Object.entries(G)){if($.scope!=="static")continue;let L=$.identifier??B,A=$.access==="private"?"#":"",j=$.initializer!==void 0?JSON.stringify($.initializer):$.default!==void 0?JSON.stringify($.default):"null";V.push(` static ${A}${L} = ${j};`)}for(let[B,$]of Object.entries(G)){if($.scope==="static")continue;if($.access!=="private")continue;let L=$.identifier??B;V.push(` #${L};`)}if(Object.keys(G).length>0)V.push("");if(V.push(" constructor(config = {}) {"),q?.superCall||Q!=="Object"){let B=q?.superCall?.arguments?q.superCall.arguments.join(", "):"";V.push(` super(${B});`)}for(let[B,$]of Object.entries(G)){if($.scope==="static")continue;let L=$.identifier??B,A=$.access==="private"?"#":"",j=$.initializer!==void 0?JSON.stringify($.initializer):$.default!==void 0?JSON.stringify($.default):"null";V.push(` this.${A}${L} = config.${L} !== undefined ? config.${L} : ${j};`)}if(q?.body){let B=Array.isArray(q.body)?q.body:[q.body];for(let $ of B)V.push(` ${$}`)}V.push(" }");for(let[B,$]of Object.entries(K)){let L=$.identifier??B,A=$.scope==="static",D=$.access==="private"?"#":"",R=A?"static ":"",x=$.returnType?.$ref?.includes("Promise")||rQ($)?"async ":"",f=J5($.parameters??[]),p=iQ($.body);if(V.push(""),$.role==="accessor"){if($.getter)V.push(` ${R}get ${D}${L}() {`,` ${$.getter.body}`," }");if($.setter){let r=J5($.setter.parameters??[]);V.push(` ${R}set ${D}${L}(${r}) {`,` ${$.setter.body}`," }")}}else{V.push(` ${R}${x}${D}${L}(${f}) {`);for(let r of p)V.push(` ${r}`);V.push(" }")}}return V.push("}","",`export { ${X} };`,`export default ${X};`,""),V.join(`
184
+ `)}function nQ(Z){if(!Z)return"Object";if(typeof Z==="string")return Z;if(Z.$ref){let W=Z.$ref.match(/([A-Za-z0-9_]+)\.class\.json/);return W?W[1]:"Object"}return"Object"}function J5(Z){return Z.map((W)=>{if(W.$ref)return W.$ref.split("/").pop();let X=W.identifier??W.name;return typeof X==="string"?X:"arg"}).join(", ")}function iQ(Z){if(!Z)return[""];return Array.isArray(Z)?Z:[Z]}function rQ(Z){return(Array.isArray(Z.body)?Z.body.join(`
185
+ `):Z.body??"").includes("await ")}import{readFileSync as aQ}from"node:fs";async function V3(Z,W={}){let{title:X="Jx App",reactivitySrc:Q=z6,litHtmlSrc:J=Y6,projectStyle:G=null}=W,z;if(typeof Z==="string"){let q=aQ(Z,"utf8");if(Z.endsWith(".json"))z=b1(q,Z);else{let{extname:K}=await import("node:path"),V=K(Z).toLowerCase(),H=W.formats?.byExtension?.(V,"parse");if(!H){let{unknownFormatError:B}=await Promise.resolve().then(() => (L6(),J3));throw B(Z,V)}z=await H.call("parse",q)}}else z=Z;if(I8(z)){let{compileClassJson:q}=await Promise.resolve().then(() => G5),K=q(z,W),V=typeof Z==="string"?Z.replace(/\.class\.json$/,".js"):`${z.title}.js`;return{files:[{content:K,path:V}],html:""}}if(!T4(z))return t9(z,{litHtmlSrc:J,projectStyle:G,reactivitySrc:Q,title:X});if(z.tagName&&z.tagName.includes("-")){let{tagName:q}=z,K=R4(q),H={content:n6(z,K,[]),path:`${q}.js`,tagName:q},B=K6(z,z.$media??{}),$=`<!DOCTYPE html>
180
186
  <html lang="en">
181
187
  <head>
182
188
  <meta charset="utf-8">
183
189
  <meta name="viewport" content="width=device-width, initial-scale=1">
184
- <title>${y(q)}</title>
190
+ <title>${e(X)}</title>
185
191
  <script type="importmap">
186
192
  {
187
193
  "imports": {
188
- "@vue/reactivity": "${W}",
189
- "lit-html": "${Q}"
194
+ "@vue/reactivity": "${Q}",
195
+ "lit-html": "${J}"
190
196
  }
191
197
  }
192
198
  </script>
193
199
  ${B}
194
200
  </head>
195
201
  <body>
196
- <${Y}></${Y}>
197
- <script type="module" src="./${Y}.js"></script>
202
+ <${q}></${q}>
203
+ <script type="module" src="./${q}.js"></script>
198
204
  </body>
199
- </html>`;return{files:[V],html:H}}return B7(z,{litHtmlSrc:Q,projectStyle:J,reactivitySrc:W,title:q})}async function nF(Z,X){let[q,W]=await Promise.all([l5(Z),Y1(Z)]),{writeFileSync:Q,mkdirSync:J}=await import("node:fs"),{dirname:z,join:Y}=await import("node:path");if(X){Q(X,q.html,"utf8"),console.error(`Written to ${X}`);let U=z(X);for(let K of q.files){let V=Y(U,K.path);J(z(V),{recursive:!0}),Q(V,K.content,"utf8"),console.error(`Written to ${V}`)}}else process.stdout.write(q.html);if(W&&X){let U=X.replace(/(\.[^.]+)?$/,"-server.js");Q(U,W,"utf8"),console.error(`Server handler written to ${U}`)}}var L7=R(()=>{T6();a9();H1();V7();F7();S0();e0()});import{existsSync as Yz,readFileSync as Uz}from"node:fs";import{resolve as I7}from"node:path";function w7(Z){let X=I7(Z,"project.json");if(!Yz(X))throw Error(`project.json not found in ${Z}`);let q;try{q=s9(Uz(X,"utf8"),X)}catch(z){throw Error(`Invalid project.json: ${t0(z)}`,{cause:z})}let W={...$1,...q,build:{...$1.build,...q.build},defaults:{...$1.defaults,...q.defaults},images:{...$1.images,...q.images}};if(q.$head)W.$head=q.$head;if(q.$media)W.$media=q.$media;if(q.style)W.style=q.style;if(q.state)W.state=q.state;if(q.redirects)W.redirects=q.redirects;if(q.imports)W.imports=q.imports;if(q.contentTypes)W.contentTypes=q.contentTypes;let Q=["cloudflare-workers","cloudflare-pages","node","bun"];if(W.build.adapter&&!Q.includes(W.build.adapter))throw Error(`Unknown build adapter "${W.build.adapter}" in project.json. Valid adapters: ${Q.join(", ")}`);let J=["build","cloudflare"];if(!J.includes(W.images.service))throw Error(`Unknown images.service "${W.images.service}" in project.json. Valid services: ${J.join(", ")}`);return{config:W,configPath:X,projectRoot:I7(Z)}}var $1;var D7=R(()=>{e0();$1={$head:[],$media:{},build:{format:"directory",outDir:"./dist",provider:null,trailingSlash:"always"},contentTypes:{},defaults:{charset:"utf8",lang:"en",layout:null},images:{formats:["webp","avif"],lazyLoad:!0,optimize:!0,quality:{avif:65,jpeg:80,png:80,webp:80},service:"build",sizes:"(max-width: 768px) 100vw, 50vw",widths:[320,640,960,1280,1920]},imports:{},name:"Jx Site",redirects:{},state:{},style:{},url:""}});import{readFileSync as N7,readdirSync as Kz}from"node:fs";import{extname as p5,join as Vz,relative as Bz,resolve as Hz}from"node:path";async function _4(Z,X){let q=N7(Z,"utf8");if(Z.endsWith(".json"))return V6(q,Z);let W=p5(Z).toLowerCase(),Q=X?.byExtension(W,"parse");if(!Q)throw Error(`No format class imported for "${W}" (${Z}). Add a format class to project.json imports, e.g. "Markdown": "@jxsuite/parser/Markdown.class.json".`);return await Q.call("parse",q)}async function T7(Z,X){let q=[],W=new Set([".json",...X?.documentExtensions("page")??[]]);return await R7(Z,Z,q,W,X),q.sort((Q,J)=>{if(Q.isDynamic!==J.isDynamic)return Q.isDynamic?1:-1;if(Q.isCatchAll!==J.isCatchAll)return Q.isCatchAll?1:-1;return Q.urlPattern.localeCompare(J.urlPattern)}),q}async function R7(Z,X,q,W,Q){let J=Kz(Z,{withFileTypes:!0});for(let z of J){let Y=Vz(Z,z.name);if(z.isDirectory()){if(z.name.startsWith("_"))continue;await R7(Y,X,q,W,Q);continue}let U=p5(z.name).toLowerCase();if(!W.has(U))continue;if(z.name.startsWith("_"))continue;let K=Bz(X,Y),V=await $z(K,Y,Q);if(V)q.push(V)}}async function $z(Z,X,q){let W=p5(Z),Q=W?Z.slice(0,-W.length):Z;if(Q=Q.split("\\").join("/"),Q.endsWith("/index"))Q=Q.slice(0,-6)||"/";else if(Q==="index")Q="/";if(!Q.startsWith("/"))Q=`/${Q}`;let J=[],z=!1,Y=!1,U=Q.replaceAll(/\[\.\.\.(\w+)\]|\[(\w+)\]/g,(V,B,H)=>{if(B)return Y=!0,z=!0,J.push(B),"*";return z=!0,J.push(H),`:${H}`}),K=null;try{let B=(await _4(X,q)).$layout;if(typeof B==="string")K=B}catch{}return{$layout:K,isCatchAll:Y,isDynamic:z,params:J,relativePath:Z,sourcePath:X,urlPattern:U}}async function _7(Z,X,q=new Map,W){let Q=[];for(let J of Z){if(!J.isDynamic){Q.push(J);continue}let z;try{z=await _4(J.sourcePath,W)}catch{Q.push(J);continue}if(!z.$paths){console.warn(`Warning: dynamic route ${J.urlPattern} has no $paths — skipping`);continue}let Y=Fz(z.$paths,X,q);for(let U of Y){let K=J.urlPattern,V={};for(let[B,H]of Object.entries(U))V[B]=String(H),K=K.replace(`:${B}`,V[B]),K=K.replace("*",V[B]);Q.push({...J,_pathParams:V,isCatchAll:!1,isDynamic:!1,params:[],urlPattern:K})}}return Q}function Fz(Z,X,q){if(Array.isArray(Z))return Z;if("contentType"in Z&&Z.contentType){let W=q.get(Z.contentType);if(!W||W.length===0)return console.warn(`Warning: $paths references content type "${Z.contentType}" but it has no entries`),[];let Q=Z.param??"slug",J=Z.field??"id";return W.map((z)=>({[Q]:J==="id"?z.id:z.data[J]??z.id})).filter((z)=>z[Q])}if("values"in Z&&Array.isArray(Z.values)){let W=Z.param??"value";return Z.values.map((Q)=>({[W]:Q}))}if("$ref"in Z&&Z.$ref){let W=Hz(X,Z.$ref),Q;try{Q=JSON.parse(N7(W,"utf8"))}catch(Y){let U=Y;return console.warn(`Warning: $paths.$ref could not load "${Z.$ref}": ${U.message}`),[]}if(!Array.isArray(Q))return console.warn(`Warning: $paths.$ref "${Z.$ref}" must be a JSON array`),[];let J=Z.param??"id",z=Z.field??"id";return Q.map((Y)=>({[J]:Y[z]??Y.id??String(Y)}))}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var P7=R(()=>{e0()});import{existsSync as Az,readFileSync as Mz}from"node:fs";import{resolve as Lz}from"node:path";function n5(Z,X,q){let W=Z.$layout??X.defaults?.layout??null;if(!W)return Z;let Q=Lz(q,W);if(!Az(Q))throw Error(`Layout not found: ${W} (resolved to ${Q})`);let J;try{J=V6(Mz(Q,"utf8"),Q)}catch(K){throw Error(`Invalid layout JSON at ${Q}: ${K.message}`,{cause:K})}if(J.$layout)J=n5(J,X,q);let z=Z.children??[],Y=typeof z==="string"?[z]:Array.isArray(z)?z:[],U=wz(J);if(Iz(U,Y),Z.state)U.state={...U.state,...Z.state};if(Z.$media)U.$media={...U.$media,...Z.$media};if(Z.style)U.style={...U.style,...Z.style};if(Z.attributes)U.attributes={...U.attributes,...Z.attributes};if(Z.$head)U._pageHead=Z.$head;if(Z.title)U._pageTitle=Z.title;return delete U.$layout,U}function Iz(Z,X){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let q=new Map,W=[];for(let Q of X)if(Q&&typeof Q==="object"&&Q.attributes?.slot){let J=Q.attributes.slot;if(!q.has(J))q.set(J,[]);q.get(J).push(Q)}else W.push(Q);j7(Z,q,W)}function j7(Z,X,q){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let W=[];for(let Q of Z.children)if(Q&&typeof Q==="object"&&Q.tagName==="slot"){let J=Q.attributes?.name;if(J&&X.has(J))W.push(...X.get(J)),X.delete(J);else if(!J&&q.length>0)W.push(...q);else if(Array.isArray(Q.children))W.push(...Q.children)}else j7(Q,X,q),W.push(Q);Z.children=W}function wz(Z){return structuredClone(Z)}var E7=R(()=>{e0()});function C7(Z=[],X=[],q=[],W={}){let Q=[{attributes:{charset:W.charset??"utf8"},tagName:"meta"},{attributes:{content:"width=device-width, initial-scale=1",name:"viewport"},tagName:"meta"}],J=new Map;for(let Y of[...Q,...Z,...X,...q]){let U=Dz(Y);J.set(U,Y)}let z=W.title??W.siteName??"Jx Site";if(J.set("title",{children:[z],tagName:"title"}),W.pageUrl&&W.siteUrl){let Y=new URL(W.pageUrl,W.siteUrl).href;J.set("link:canonical",{attributes:{href:Y,rel:"canonical"},tagName:"link"})}return[...J.values()]}function Dz(Z){if(!Z||typeof Z!=="object")return String(Z);let X=Z.tagName??"unknown",q=Z.attributes??{};if(X==="title")return"title";if(q.charset)return"meta:charset";if(X==="meta"&&q.name)return`meta:${q.name}`;if(X==="meta"&&q.property)return`meta:${q.property}`;if(X==="link"&&q.rel)return`link:${q.rel}:${q.href??""}`;if(X==="script"&&q.src)return`script:${q.src}`;if(X==="style"){let W=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`style:${Nz(W)}`}return`${X}:${JSON.stringify(Z)}`}function Nz(Z){let X=0;for(let q=0;q<Z.length;q++)X=Math.trunc((X<<5)-X+(Z.codePointAt(q)??0));return X.toString(36)}function O7(Z){return Z.map((X)=>Tz(X)).join(`
200
- `)}function Tz(Z){if(typeof Z==="string")return Z;if(!Z||typeof Z!=="object")return"";let X=Z.tagName,q=Z.attributes??{},W=Object.entries(q).map(([Y,U])=>U===!0?Y:`${Y}="${Rz(U)}"`).join(" "),Q=W?`<${X} ${W}>`:`<${X}>`;if(new Set(["meta","link","base","br","hr","img","input"]).has(X))return Q;let z=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`${Q}${z}</${X}>`}function Rz(Z){return String(Z).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}import{dirname as _z,relative as Pz,resolve as jz}from"node:path";function x7(Z,X,q,W=new Map,Q=null){if(!Z.state)Z.state={};if(Z.state.$site={name:X.name??"Jx Site",url:X.url??"",...X.state},Z.state.$page={params:q._pathParams??{},title:Z.title??Z._pageTitle??X.name??"",url:q.urlPattern},X.state){for(let[J,z]of Object.entries(X.state))if(J!=="$site"&&J!=="$page"&&!(J in Z.state))Z.state[J]=z}if(X.$media)Z.$media={...X.$media,...Z.$media};if(X.imports&&Object.keys(X.imports).length>0){if(!Z.imports)Z.imports={};for(let[J,z]of Object.entries(X.imports))if(!(J in Z.imports)){let Y=z;if(Q&&q.sourcePath&&(Y.startsWith("./")||Y.startsWith("../"))){let U=jz(Q,Y);Z.imports[J]=`./${Pz(_z(q.sourcePath),U)}`}else Z.imports[J]=Y}}if(X.$elements?.length)if(!Z.$elements?.length)Z.$elements=[...X.$elements];else{let J=new Set,z=[];for(let Y of[...X.$elements,...Z.$elements]){let U=typeof Y==="string"?Y:Y?.$ref;if(U&&!J.has(U))J.add(U),z.push(Y)}Z.$elements=z}return Z}var k7=()=>{};import{existsSync as Ez,readFileSync as Cz,readdirSync as Oz}from"node:fs";import{basename as S7,extname as b7,resolve as r5}from"node:path";function xz(Z){let X=JSON.parse(Cz(Z,"utf8"));if(Array.isArray(X))return X.map((W,Q)=>({body:null,data:W,id:W.id??`${S7(Z,".json")}-${Q}`}));let q=X;return[{body:null,data:q,id:q.id??S7(Z,".json")}]}function kz(Z){if(b7(Z))return Ez(Z)?[Z]:[];try{return Oz(Z,{recursive:!0}).filter((X)=>String(X).endsWith(".json")).map((X)=>r5(Z,String(X)))}catch{return[]}}function a5(Z,X){let q=r5(Z,"content");return{config:{contentTypes:X?.contentTypes??{}},contentDir:q}}async function v7(Z,X,q){let W=a5(Z,X);if(!W)return new Map;let{config:Q}=W,J=new Map;if(Object.keys(Q.contentTypes).length===0)return J;let z=q??await T4(Z,X);for(let[Y,U]of Object.entries(Q.contentTypes)){let K=await Sz(Y,U,Z,z);J.set(Y,K)}return J}async function Sz(Z,X,q,W){let{source:Q}=X;if(!Q)return[];let{schema:J}=X,z=X.$elements?.length?{allowedNames:X.$elements.filter(($)=>typeof $==="string"||typeof $==="object"&&$?.$ref).map(($)=>typeof $==="string"?$:$.$ref)}:void 0,Y=X.format,U;if(Y&&Y!=="json"){if(U=W.byName(Y),!U)throw Error(`Content type "${Z}": format "${Y}" is not an imported format class. Add it to project.json imports, e.g. "${Y}": "@jxsuite/parser/${Y}.class.json".`)}if(Q.startsWith("http://")||Q.startsWith("https://")){if(!U)throw Error(`Content type "${Z}": remote sources require an explicit "format" naming an imported format class with "remote": true (e.g. "Csv").`);if(!U.remote)throw Error(`Content type "${Z}": format "${U.name}" does not support remote sources (its format block lacks "remote": true).`);try{let $=await U.call("load",Q,{directiveOptions:z,schema:J});if(J)i5($,J,Z);return $}catch($){return console.warn(`Content type "${Z}": ${t0($)}`),[]}}let K=r5(q,Q).split("\\").join("/"),V=b7(Q).toLowerCase();if(Y==="json"||!U&&V===".json"){let $=kz(K),F=[];for(let L of $)F.push(...xz(L));if(J)i5(F,J,Z);return F}if(!U&&V)U=W.byExtension(V,"load");if(!U)throw m5(Q,V||`content type "${Z}" (directory sources need an explicit "format")`);let B=U.capabilities.discover?await U.call("discover",Q,{baseDir:q}):[K],H=[];for(let $ of B)H.push(...await U.call("load",$,{directiveOptions:z,schema:J}));if(J)i5(H,J,Z);return H}function i5(Z,X,q){let W=X.required??[],Q=X.properties??{};for(let J of Z){for(let z of W)if(!(z in J.data)||J.data[z]==null)console.warn(`Content validation: "${q}/${J.id}" missing required field "${z}"`);for(let[z,Y]of Object.entries(Q)){let U=J.data[z];if(U==null)continue;if(Y.type==="string"&&typeof U!=="string")console.warn(`Content validation: "${q}/${J.id}" field "${z}" expected string, got ${typeof U}`);else if(Y.type==="number"&&typeof U!=="number")console.warn(`Content validation: "${q}/${J.id}" field "${z}" expected number, got ${typeof U}`);else if(Y.type==="boolean"&&typeof U!=="boolean")console.warn(`Content validation: "${q}/${J.id}" field "${z}" expected boolean, got ${typeof U}`);else if(Y.type==="array"&&!Array.isArray(U))console.warn(`Content validation: "${q}/${J.id}" field "${z}" expected array, got ${typeof U}`)}}}function y7(Z,X){for(let[q,W]of Object.entries(X.contentTypes)){let{schema:Q}=W;if(!Q?.properties)continue;let J=Z.get(q);if(!J)continue;for(let[z,Y]of Object.entries(Q.properties)){if(!Y.$ref?.startsWith("#/contentTypes/"))continue;let U=Y.$ref.replace("#/contentTypes/",""),K=Z.get(U);if(!K)continue;for(let V of J){let B=V.data[z];if(typeof B==="string"){let H=K.find(($)=>$.id===B);if(H)V.data[z]=H}}}}}var g7=R(()=>{e0();s6()});import{readFileSync as bz}from"node:fs";import{dirname as s5,resolve as F1}from"node:path";import{createRequire as vz}from"node:module";async function h7(Z,X,q,W={}){let Q=Z.imports??{},{state:J}=Z;if(!J)return;for(let[z,Y]of Object.entries(J)){if(!I6(Y))continue;if(yz.has(Y.$prototype))continue;if(Y.timing&&Y.timing!=="compiler")continue;if(!Y.$src){let U=Q[Y.$prototype];if(!U)continue;Y.$src=U}try{let U=await hz(Y,X,q,J,W);if(Y.timing&&U&&typeof U==="object"&&!Array.isArray(U))U.timing=Y.timing;J[z]=U}catch(U){console.warn(`prototype-resolver: failed to resolve "${z}" ($prototype: "${Y.$prototype}"):`,t0(U))}}}async function hz(Z,X,q,W,Q){let J=Z.$src;if(!J)throw Error(`$prototype "${Z.$prototype}" has no $src to resolve`);let z;if(J.startsWith("./")||J.startsWith("../"))z=X.sourcePath?F1(s5(X.sourcePath),J):F1(q,J);else z=vz(F1(q,"package.json")).resolve(J);let Y=bz(z,"utf8"),U=o9(Y,z);if(!U.$implementation)throw Error(`${J} has no $implementation field`);let K=F1(s5(z),U.$implementation),V=await K1(K),B=Z.$export??U.title??Z.$prototype,H=V[B]??V.default?.[B];if(!H)throw Error(`Module ${U.$implementation} does not export "${B}"`);let $={};for(let[L,A]of Object.entries(Z))if(!gz.has(L))$[L]=A;if($.src&&!$.basePath&&X.sourcePath)$.basePath=s5(X.sourcePath);$._project={config:Q.config??null,contentTypes:Q.contentTypes??null,root:q},$._document={route:X,state:W};let F=new H($);if(typeof F.resolve==="function")return await F.resolve();return F}var yz,gz;var m7=R(()=>{s6();S0();e0();yz=new Set(["Function","LocalStorage","SessionStorage","Array"]),gz=new Set(["$prototype","$src","$export","timing","default","description"])});var f7=(Z)=>typeof Z<"u"&&Z!==null,mz=(Z)=>typeof Z==="object",fz=(Z)=>Object.prototype.toString.call(Z)==="[object Object]",uz=(Z)=>typeof Z==="function",dz=(Z)=>typeof Z==="boolean",cz=(Z)=>Z instanceof Buffer,lz=(Z)=>{if(f7(Z))switch(Z.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},pz=(Z)=>Z instanceof ArrayBuffer,nz=(Z)=>typeof Z==="string"&&Z.length>0,iz=(Z)=>typeof Z==="number"&&!Number.isNaN(Z),rz=(Z)=>Number.isInteger(Z),az=(Z,X,q)=>Z>=X&&Z<=q,sz=(Z,X)=>X.includes(Z),oz=(Z,X,q)=>Error(`Expected ${X} for ${Z} but received ${q} of type ${typeof q}`),tz=(Z,X)=>{return X.message=Z.message,X},G;var m0=R(()=>{/*!
205
+ </html>`;return{files:[H],html:$}}return U3(z,{litHtmlSrc:J,projectStyle:G,reactivitySrc:Q,title:X})}async function aH(Z,W){let[X,Q]=await Promise.all([V3(Z),l6(Z)]),{writeFileSync:J,mkdirSync:G}=await import("node:fs"),{dirname:z,join:q}=await import("node:path");if(W){J(W,X.html,"utf8"),console.error(`Written to ${W}`);let K=z(W);for(let V of X.files){let H=q(K,V.path);G(z(H),{recursive:!0}),J(H,V.content,"utf8"),console.error(`Written to ${H}`)}}else process.stdout.write(X.html);if(Q&&W){let K=W.replace(/(\.[^.]+)?$/,"-server.js");J(K,Q,"utf8"),console.error(`Server handler written to ${K}`)}}var z5=d(()=>{S1();Z3();i6();Z5();K3();e0();D1();S1();Z3();i6();K3()});import{existsSync as sQ,readFileSync as oQ}from"node:fs";import{resolve as Y5}from"node:path";function U5(Z){let W=Y5(Z,"project.json");if(!sQ(W))throw Error(`project.json not found in ${Z}`);let X;try{X=h9(oQ(W,"utf8"),W)}catch(z){throw Error(`Invalid project.json: ${N1(z)}`,{cause:z})}let Q={...d4,...X,build:{...d4.build,...X.build},defaults:{...d4.defaults,...X.defaults},images:{...d4.images,...X.images}};if(X.$head)Q.$head=X.$head;if(X.$media)Q.$media=X.$media;if(X.style)Q.style=X.style;if(X.state)Q.state=X.state;if(X.redirects)Q.redirects=X.redirects;if(X.imports)Q.imports=X.imports;if(X.contentTypes)Q.contentTypes=X.contentTypes;let J=["cloudflare-workers","cloudflare-pages","node","bun"];if(Q.build.adapter&&!J.includes(Q.build.adapter))throw Error(`Unknown build adapter "${Q.build.adapter}" in project.json. Valid adapters: ${J.join(", ")}`);let G=["build","cloudflare"];if(!G.includes(Q.images.service))throw Error(`Unknown images.service "${Q.images.service}" in project.json. Valid services: ${G.join(", ")}`);return{config:Q,configPath:W,projectRoot:Y5(Z)}}var d4;var q5=d(()=>{D1();d4={$head:[],$media:{},build:{format:"directory",outDir:"./dist",provider:null,trailingSlash:"always"},contentTypes:{},defaults:{charset:"utf8",lang:"en",layout:null},images:{formats:["webp","avif"],lazyLoad:!0,optimize:!0,quality:{avif:65,jpeg:80,png:80,webp:80},service:"build",sizes:"(max-width: 768px) 100vw, 50vw",widths:[320,640,960,1280,1920]},imports:{},name:"Jx Site",redirects:{},state:{},style:{},url:""}});import{readFileSync as K5,readdirSync as tQ}from"node:fs";import{extname as B3,join as eQ,relative as ZJ,resolve as WJ}from"node:path";async function r6(Z,W){let X=K5(Z,"utf8");if(Z.endsWith(".json"))return b1(X,Z);let Q=B3(Z).toLowerCase(),J=W?.byExtension(Q,"parse");if(!J)throw Error(`No format class imported for "${Q}" (${Z}). Add a format class to project.json imports, e.g. "Markdown": "@jxsuite/parser/Markdown.class.json".`);return await J.call("parse",X)}async function V5(Z,W){let X=[],Q=new Set([".json",...W?.documentExtensions("page")??[]]);return await B5(Z,Z,X,Q,W),X.sort((J,G)=>{if(J.isDynamic!==G.isDynamic)return J.isDynamic?1:-1;if(J.isCatchAll!==G.isCatchAll)return J.isCatchAll?1:-1;return J.urlPattern.localeCompare(G.urlPattern)}),X}async function B5(Z,W,X,Q,J){let G=tQ(Z,{withFileTypes:!0});for(let z of G){let q=eQ(Z,z.name);if(z.isDirectory()){if(z.name.startsWith("_"))continue;await B5(q,W,X,Q,J);continue}let K=B3(z.name).toLowerCase();if(!Q.has(K))continue;if(z.name.startsWith("_"))continue;let V=ZJ(W,q),H=await XJ(V,q,J);if(H)X.push(H)}}async function XJ(Z,W,X){let Q=B3(Z),J=Q?Z.slice(0,-Q.length):Z;if(J=J.split("\\").join("/"),J.endsWith("/index"))J=J.slice(0,-6)||"/";else if(J==="index")J="/";if(!J.startsWith("/"))J=`/${J}`;let G=[],z=!1,q=!1,K=J.replaceAll(/\[\.\.\.(\w+)\]|\[(\w+)\]/g,(H,B,$)=>{if(B)return q=!0,z=!0,G.push(B),"*";return z=!0,G.push($),`:${$}`}),V=null;try{let B=(await r6(W,X)).$layout;if(typeof B==="string")V=B}catch{}return{$layout:V,isCatchAll:q,isDynamic:z,params:G,relativePath:Z,sourcePath:W,urlPattern:K}}async function H5(Z,W,X=new Map,Q){let J=[];for(let G of Z){if(!G.isDynamic){J.push(G);continue}let z;try{z=await r6(G.sourcePath,Q)}catch{J.push(G);continue}if(!z.$paths){console.warn(`Warning: dynamic route ${G.urlPattern} has no $paths — skipping`);continue}let q=QJ(z.$paths,W,X);for(let K of q){let V=G.urlPattern,H={};for(let[B,$]of Object.entries(K))H[B]=String($),V=V.replace(`:${B}`,H[B]),V=V.replace("*",H[B]);J.push({...G,_pathParams:H,isCatchAll:!1,isDynamic:!1,params:[],urlPattern:V})}}return J}function QJ(Z,W,X){if(Array.isArray(Z))return Z;if("contentType"in Z&&Z.contentType){let Q=X.get(Z.contentType);if(!Q||Q.length===0)return console.warn(`Warning: $paths references content type "${Z.contentType}" but it has no entries`),[];let J=Z.param??"slug",G=Z.field??"id";return Q.map((z)=>({[J]:G==="id"?z.id:z.data[G]??z.id})).filter((z)=>z[J])}if("values"in Z&&Array.isArray(Z.values)){let Q=Z.param??"value";return Z.values.map((J)=>({[Q]:J}))}if("$ref"in Z&&Z.$ref){let Q=WJ(W,Z.$ref),J;try{J=JSON.parse(K5(Q,"utf8"))}catch(q){let K=q;return console.warn(`Warning: $paths.$ref could not load "${Z.$ref}": ${K.message}`),[]}if(!Array.isArray(J))return console.warn(`Warning: $paths.$ref "${Z.$ref}" must be a JSON array`),[];let G=Z.param??"id",z=Z.field??"id";return J.map((q)=>({[G]:q[z]??q.id??String(q)}))}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var $5=d(()=>{D1()});import{existsSync as JJ,readFileSync as GJ}from"node:fs";import{resolve as zJ}from"node:path";function H3(Z,W,X){let Q=Z.$layout??W.defaults?.layout??null;if(!Q)return Z;let J=zJ(X,Q);if(!JJ(J))throw Error(`Layout not found: ${Q} (resolved to ${J})`);let G;try{G=b1(GJ(J,"utf8"),J)}catch(V){throw Error(`Invalid layout JSON at ${J}: ${V.message}`,{cause:V})}if(G.$layout)G=H3(G,W,X);let z=Z.children??[],q=typeof z==="string"?[z]:Array.isArray(z)?z:[],K=UJ(G);if(YJ(K,q),Z.state)K.state={...K.state,...Z.state};if(Z.$media)K.$media={...K.$media,...Z.$media};if(Z.style)K.style={...K.style,...Z.style};if(Z.attributes)K.attributes={...K.attributes,...Z.attributes};if(Z.$head)K._pageHead=Z.$head;if(Z.title)K._pageTitle=Z.title;return delete K.$layout,K}function YJ(Z,W){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let X=new Map,Q=[];for(let J of W)if(J&&typeof J==="object"&&J.attributes?.slot){let G=J.attributes.slot;if(!X.has(G))X.set(G,[]);X.get(G).push(J)}else Q.push(J);F5(Z,X,Q)}function F5(Z,W,X){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let Q=[];for(let J of Z.children)if(J&&typeof J==="object"&&J.tagName==="slot"){let G=J.attributes?.name;if(G&&W.has(G))Q.push(...W.get(G)),W.delete(G);else if(!G&&X.length>0)Q.push(...X);else if(Array.isArray(J.children))Q.push(...J.children)}else F5(J,W,X),Q.push(J);Z.children=Q}function UJ(Z){return structuredClone(Z)}var L5=d(()=>{D1()});function A5(Z=[],W=[],X=[],Q={}){let J=[{attributes:{charset:Q.charset??"utf8"},tagName:"meta"},{attributes:{content:"width=device-width, initial-scale=1",name:"viewport"},tagName:"meta"}],G=new Map;for(let q of[...J,...Z,...W,...X]){let K=qJ(q);G.set(K,q)}let z=Q.title??Q.siteName??"Jx Site";if(G.set("title",{children:[z],tagName:"title"}),Q.pageUrl&&Q.siteUrl){let q=new URL(Q.pageUrl,Q.siteUrl).href;G.set("link:canonical",{attributes:{href:q,rel:"canonical"},tagName:"link"})}return[...G.values()]}function qJ(Z){if(!Z||typeof Z!=="object")return String(Z);let W=Z.tagName??"unknown",X=Z.attributes??{};if(W==="title")return"title";if(X.charset)return"meta:charset";if(W==="meta"&&X.name)return`meta:${X.name}`;if(W==="meta"&&X.property)return`meta:${X.property}`;if(W==="link"&&X.rel)return`link:${X.rel}:${X.href??""}`;if(W==="script"&&X.src)return`script:${X.src}`;if(W==="style"){let Q=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`style:${KJ(Q)}`}return`${W}:${JSON.stringify(Z)}`}function KJ(Z){let W=0;for(let X=0;X<Z.length;X++)W=Math.trunc((W<<5)-W+(Z.codePointAt(X)??0));return W.toString(36)}function M5(Z){return Z.map((W)=>VJ(W)).join(`
206
+ `)}function VJ(Z){if(typeof Z==="string")return Z;if(!Z||typeof Z!=="object")return"";let W=Z.tagName,X=Z.attributes??{},Q=Object.entries(X).map(([q,K])=>K===!0?q:`${q}="${BJ(K)}"`).join(" "),J=Q?`<${W} ${Q}>`:`<${W}>`;if(new Set(["meta","link","base","br","hr","img","input"]).has(W))return J;let z=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`${J}${z}</${W}>`}function BJ(Z){return String(Z).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}import{dirname as HJ,relative as $J,resolve as FJ}from"node:path";function I5(Z,W,X,Q=new Map,J=null){if(!Z.state)Z.state={};if(Z.state.$site={name:W.name??"Jx Site",url:W.url??"",...W.state},Z.state.$page={params:X._pathParams??{},title:Z.title??Z._pageTitle??W.name??"",url:X.urlPattern},W.state){for(let[G,z]of Object.entries(W.state))if(G!=="$site"&&G!=="$page"&&!(G in Z.state))Z.state[G]=z}if(W.$media)Z.$media={...W.$media,...Z.$media};if(W.imports&&Object.keys(W.imports).length>0){if(!Z.imports)Z.imports={};for(let[G,z]of Object.entries(W.imports))if(!(G in Z.imports)){let q=z;if(J&&X.sourcePath&&(q.startsWith("./")||q.startsWith("../"))){let K=FJ(J,q);Z.imports[G]=`./${$J(HJ(X.sourcePath),K)}`}else Z.imports[G]=q}}if(W.$elements?.length)if(!Z.$elements?.length)Z.$elements=[...W.$elements];else{let G=new Set,z=[];for(let q of[...W.$elements,...Z.$elements]){let K=typeof q==="string"?q:q?.$ref;if(K&&!G.has(K))G.add(K),z.push(q)}Z.$elements=z}return Z}var w5=()=>{};import{existsSync as LJ,readFileSync as AJ,readdirSync as MJ}from"node:fs";import{basename as N5,extname as D5,resolve as F3}from"node:path";function IJ(Z){let W=JSON.parse(AJ(Z,"utf8"));if(Array.isArray(W))return W.map((Q,J)=>({body:null,data:Q,id:Q.id??`${N5(Z,".json")}-${J}`}));let X=W;return[{body:null,data:X,id:X.id??N5(Z,".json")}]}function wJ(Z){if(D5(Z))return LJ(Z)?[Z]:[];try{return MJ(Z,{recursive:!0}).filter((W)=>String(W).endsWith(".json")).map((W)=>F3(Z,String(W)))}catch{return[]}}function L3(Z,W){let X=F3(Z,"content");return{config:{contentTypes:W?.contentTypes??{}},contentDir:X}}async function T5(Z,W,X){let Q=L3(Z,W);if(!Q)return new Map;let{config:J}=Q,G=new Map;if(Object.keys(J.contentTypes).length===0)return G;let z=X??await p6(Z,W);for(let[q,K]of Object.entries(J.contentTypes)){let V=await NJ(q,K,Z,z);G.set(q,V)}return G}async function NJ(Z,W,X,Q){let{source:J}=W;if(!J)return[];let{schema:G}=W,z=W.$elements?.length?{allowedNames:W.$elements.filter((L)=>typeof L==="string"||typeof L==="object"&&L?.$ref).map((L)=>typeof L==="string"?L:L.$ref)}:void 0,q=W.format,K;if(q&&q!=="json"){if(K=Q.byName(q),!K)throw Error(`Content type "${Z}": format "${q}" is not an imported format class. Add it to project.json imports, e.g. "${q}": "@jxsuite/parser/${q}.class.json".`)}if(J.startsWith("http://")||J.startsWith("https://")){if(!K)throw Error(`Content type "${Z}": remote sources require an explicit "format" naming an imported format class with "remote": true (e.g. "Csv").`);if(!K.remote)throw Error(`Content type "${Z}": format "${K.name}" does not support remote sources (its format block lacks "remote": true).`);try{let L=await K.call("load",J,{directiveOptions:z,schema:G});if(G)$3(L,G,Z);return L}catch(L){return console.warn(`Content type "${Z}": ${N1(L)}`),[]}}let V=F3(X,J).split("\\").join("/"),H=D5(J).toLowerCase();if(q==="json"||!K&&H===".json"){let L=wJ(V),A=[];for(let j of L)A.push(...IJ(j));if(G)$3(A,G,Z);return A}if(!K&&H)K=Q.byExtension(H,"load");if(!K)throw Q3(J,H||`content type "${Z}" (directory sources need an explicit "format")`);let B=K.capabilities.discover?await K.call("discover",J,{baseDir:X}):[V],$=[];for(let L of B)$.push(...await K.call("load",L,{directiveOptions:z,schema:G}));if(G)$3($,G,Z);return $}function $3(Z,W,X){let Q=W.required??[],J=W.properties??{};for(let G of Z){for(let z of Q)if(!(z in G.data)||G.data[z]==null)console.warn(`Content validation: "${X}/${G.id}" missing required field "${z}"`);for(let[z,q]of Object.entries(J)){let K=G.data[z];if(K==null)continue;if(q.type==="string"&&typeof K!=="string")console.warn(`Content validation: "${X}/${G.id}" field "${z}" expected string, got ${typeof K}`);else if(q.type==="number"&&typeof K!=="number")console.warn(`Content validation: "${X}/${G.id}" field "${z}" expected number, got ${typeof K}`);else if(q.type==="boolean"&&typeof K!=="boolean")console.warn(`Content validation: "${X}/${G.id}" field "${z}" expected boolean, got ${typeof K}`);else if(q.type==="array"&&!Array.isArray(K))console.warn(`Content validation: "${X}/${G.id}" field "${z}" expected array, got ${typeof K}`)}}}function R5(Z,W){for(let[X,Q]of Object.entries(W.contentTypes)){let{schema:J}=Q;if(!J?.properties)continue;let G=Z.get(X);if(!G)continue;for(let[z,q]of Object.entries(J.properties)){let K=q;if(!K.$ref?.startsWith("#/contentTypes/"))continue;let V=K.$ref.replace("#/contentTypes/",""),H=Z.get(V);if(!H)continue;for(let B of G){let $=B.data[z];if(typeof $==="string"){let L=H.find((A)=>A.id===$);if(L)B.data[z]=L}}}}}var P5=d(()=>{D1();L6()});import{readFileSync as DJ}from"node:fs";import{dirname as A3,resolve as c4}from"node:path";import{createRequire as TJ}from"node:module";async function _5(Z,W,X,Q={}){let J=Z.imports??{},{state:G}=Z;if(!G)return;for(let[z,q]of Object.entries(G)){if(!c1(q))continue;if(RJ.has(q.$prototype))continue;if(q.timing&&q.timing!=="compiler")continue;if(!q.$src){let K=J[q.$prototype];if(!K)continue;q.$src=K}try{let K=await _J(q,W,X,G,Q);if(q.timing&&K&&typeof K==="object"&&!Array.isArray(K))K.timing=q.timing;G[z]=K}catch(K){console.warn(`prototype-resolver: failed to resolve "${z}" ($prototype: "${q.$prototype}"):`,N1(K))}}}async function _J(Z,W,X,Q,J){let G=Z.$src;if(!G)throw Error(`$prototype "${Z.$prototype}" has no $src to resolve`);let z;if(G.startsWith("./")||G.startsWith("../"))z=W.sourcePath?c4(A3(W.sourcePath),G):c4(X,G);else z=TJ(c4(X,"package.json")).resolve(G);let q=DJ(z,"utf8"),K=f9(q,z);if(!K.$implementation)throw Error(`${G} has no $implementation field`);let V=c4(A3(z),K.$implementation),H=await f4(V),B=Z.$export??K.title??Z.$prototype,$=H[B]??H.default?.[B];if(!$)throw Error(`Module ${K.$implementation} does not export "${B}"`);let L={};for(let[j,D]of Object.entries(Z))if(!PJ.has(j))L[j]=D;if(L.src&&!L.basePath&&W.sourcePath)L.basePath=A3(W.sourcePath);L._project={config:J.config??null,contentTypes:J.contentTypes??null,root:X},L._document={route:W,state:Q};let A=new $(L);if(typeof A.resolve==="function")return await A.resolve();return A}var RJ,PJ;var j5=d(()=>{L6();e0();D1();RJ=new Set(["Function","LocalStorage","SessionStorage","Array"]),PJ=new Set(["$prototype","$src","$export","timing","default","description"])});var E5=(Z)=>typeof Z<"u"&&Z!==null,jJ=(Z)=>typeof Z==="object",EJ=(Z)=>Object.prototype.toString.call(Z)==="[object Object]",CJ=(Z)=>typeof Z==="function",OJ=(Z)=>typeof Z==="boolean",xJ=(Z)=>Z instanceof Buffer,kJ=(Z)=>{if(E5(Z))switch(Z.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},SJ=(Z)=>Z instanceof ArrayBuffer,bJ=(Z)=>typeof Z==="string"&&Z.length>0,vJ=(Z)=>typeof Z==="number"&&!Number.isNaN(Z),yJ=(Z)=>Number.isInteger(Z),gJ=(Z,W,X)=>Z>=W&&Z<=X,hJ=(Z,W)=>W.includes(Z),fJ=(Z,W,X)=>Error(`Expected ${W} for ${Z} but received ${X} of type ${typeof X}`),mJ=(Z,W)=>{return W.message=Z.message,W},Y;var Q1=d(()=>{/*!
201
207
  Copyright 2013 Lovell Fuller and others.
202
208
  SPDX-License-Identifier: Apache-2.0
203
- */G={defined:f7,object:mz,plainObject:fz,fn:uz,bool:dz,buffer:cz,typedArray:lz,arrayBuffer:pz,string:nz,number:iz,integer:rz,inRange:az,inArray:sz,invalidParameterError:oz,nativeError:tz}});var c7=E((PA,d7)=>{var u7=()=>process.platform==="linux",A1=null,ez=()=>{if(!A1)if(u7()&&process.report){let Z=process.report.excludeNetwork;process.report.excludeNetwork=!0,A1=process.report.getReport(),process.report.excludeNetwork=Z}else A1={};return A1};d7.exports={isLinux:u7,getReport:ez}});var p7=E((jA,l7)=>{var t6=q0("fs"),ZG=(Z)=>{let X=t6.openSync(Z,"r"),q=Buffer.alloc(2048),W=t6.readSync(X,q,0,2048,0);return t6.close(X,()=>{}),q.subarray(0,W)},XG=(Z)=>new Promise((X,q)=>{t6.open(Z,"r",(W,Q)=>{if(W)q(W);else{let J=Buffer.alloc(2048);t6.read(Q,J,0,2048,0,(z,Y)=>{X(J.subarray(0,Y)),t6.close(Q,()=>{})})}})});l7.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:ZG,readFile:XG}});var i7=E((EA,n7)=>{var qG=(Z)=>{if(Z.length<64)return null;if(Z.readUInt32BE(0)!==2135247942)return null;if(Z.readUInt8(4)!==2)return null;if(Z.readUInt8(5)!==1)return null;let X=Z.readUInt32LE(32),q=Z.readUInt16LE(54),W=Z.readUInt16LE(56);for(let Q=0;Q<W;Q++){let J=X+Q*q;if(Z.readUInt32LE(J)===3){let Y=Z.readUInt32LE(J+8),U=Z.readUInt32LE(J+32);return Z.subarray(Y,Y+U).toString().replace(/\0.*$/g,"")}}return null};n7.exports={interpreterPath:qG}});var L1=E((CA,KZ)=>{var a7=q0("child_process"),{isLinux:e6,getReport:s7}=c7(),{LDD_PATH:M1,SELF_PATH:o7,readFile:o5,readFileSync:t5}=p7(),{interpreterPath:t7}=i7(),f0,u0,d0,B6="",e7=()=>{if(!B6)return new Promise((Z)=>{a7.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(X,q)=>{B6=X?" ":q,Z(B6)})});return B6},ZZ=()=>{if(!B6)try{B6=a7.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(Z){B6=" "}return B6},X6="glibc",XZ=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,C6="musl",WG=(Z)=>Z.includes("libc.musl-")||Z.includes("ld-musl-"),qZ=()=>{let Z=s7();if(Z.header&&Z.header.glibcVersionRuntime)return X6;if(Array.isArray(Z.sharedObjects)){if(Z.sharedObjects.some(WG))return C6}return null},WZ=(Z)=>{let[X,q]=Z.split(/[\r\n]+/);if(X&&X.includes(X6))return X6;if(q&&q.includes(C6))return C6;return null},QZ=(Z)=>{if(Z){if(Z.includes("/ld-musl-"))return C6;else if(Z.includes("/ld-linux-"))return X6}return null},JZ=(Z)=>{if(Z=Z.toString(),Z.includes("musl"))return C6;if(Z.includes("GNU C Library"))return X6;return null},QG=async()=>{if(u0!==void 0)return u0;u0=null;try{let Z=await o5(M1);u0=JZ(Z)}catch(Z){}return u0},JG=()=>{if(u0!==void 0)return u0;u0=null;try{let Z=t5(M1);u0=JZ(Z)}catch(Z){}return u0},zG=async()=>{if(f0!==void 0)return f0;f0=null;try{let Z=await o5(o7),X=t7(Z);f0=QZ(X)}catch(Z){}return f0},GG=()=>{if(f0!==void 0)return f0;f0=null;try{let Z=t5(o7),X=t7(Z);f0=QZ(X)}catch(Z){}return f0},zZ=async()=>{let Z=null;if(e6()){if(Z=await zG(),!Z){if(Z=await QG(),!Z)Z=qZ();if(!Z){let X=await e7();Z=WZ(X)}}}return Z},GZ=()=>{let Z=null;if(e6()){if(Z=GG(),!Z){if(Z=JG(),!Z)Z=qZ();if(!Z){let X=ZZ();Z=WZ(X)}}}return Z},YG=async()=>e6()&&await zZ()!==X6,UG=()=>e6()&&GZ()!==X6,KG=async()=>{if(d0!==void 0)return d0;d0=null;try{let X=(await o5(M1)).match(XZ);if(X)d0=X[1]}catch(Z){}return d0},VG=()=>{if(d0!==void 0)return d0;d0=null;try{let X=t5(M1).match(XZ);if(X)d0=X[1]}catch(Z){}return d0},YZ=()=>{let Z=s7();if(Z.header&&Z.header.glibcVersionRuntime)return Z.header.glibcVersionRuntime;return null},r7=(Z)=>Z.trim().split(/\s+/)[1],UZ=(Z)=>{let[X,q,W]=Z.split(/[\r\n]+/);if(X&&X.includes(X6))return r7(X);if(q&&W&&q.includes(C6))return r7(W);return null},BG=async()=>{let Z=null;if(e6()){if(Z=await KG(),!Z)Z=YZ();if(!Z){let X=await e7();Z=UZ(X)}}return Z},HG=()=>{let Z=null;if(e6()){if(Z=VG(),!Z)Z=YZ();if(!Z){let X=ZZ();Z=UZ(X)}}return Z};KZ.exports={GLIBC:X6,MUSL:C6,family:zZ,familySync:GZ,isNonGlibcLinux:YG,isNonGlibcLinuxSync:UG,version:BG,versionSync:HG}});var Z4=E((OA,VZ)=>{var $G=Number.MAX_SAFE_INTEGER||9007199254740991,FG=["major","premajor","minor","preminor","patch","prepatch","prerelease"];VZ.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:$G,RELEASE_TYPES:FG,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var P4=E((xA,BZ)=>{var AG=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...Z)=>console.error("SEMVER",...Z):()=>{};BZ.exports=AG});var X4=E((c0,HZ)=>{var{MAX_SAFE_COMPONENT_LENGTH:e5,MAX_SAFE_BUILD_LENGTH:MG,MAX_LENGTH:LG}=Z4(),IG=P4();c0=HZ.exports={};var wG=c0.re=[],DG=c0.safeRe=[],D=c0.src=[],NG=c0.safeSrc=[],N=c0.t={},TG=0,Z3="[a-zA-Z0-9-]",RG=[["\\s",1],["\\d",LG],[Z3,MG]],_G=(Z)=>{for(let[X,q]of RG)Z=Z.split(`${X}*`).join(`${X}{0,${q}}`).split(`${X}+`).join(`${X}{1,${q}}`);return Z},O=(Z,X,q)=>{let W=_G(X),Q=TG++;IG(Z,Q,X),N[Z]=Q,D[Q]=X,NG[Q]=W,wG[Q]=new RegExp(X,q?"g":void 0),DG[Q]=new RegExp(W,q?"g":void 0)};O("NUMERICIDENTIFIER","0|[1-9]\\d*");O("NUMERICIDENTIFIERLOOSE","\\d+");O("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Z3}*`);O("MAINVERSION",`(${D[N.NUMERICIDENTIFIER]})\\.(${D[N.NUMERICIDENTIFIER]})\\.(${D[N.NUMERICIDENTIFIER]})`);O("MAINVERSIONLOOSE",`(${D[N.NUMERICIDENTIFIERLOOSE]})\\.(${D[N.NUMERICIDENTIFIERLOOSE]})\\.(${D[N.NUMERICIDENTIFIERLOOSE]})`);O("PRERELEASEIDENTIFIER",`(?:${D[N.NONNUMERICIDENTIFIER]}|${D[N.NUMERICIDENTIFIER]})`);O("PRERELEASEIDENTIFIERLOOSE",`(?:${D[N.NONNUMERICIDENTIFIER]}|${D[N.NUMERICIDENTIFIERLOOSE]})`);O("PRERELEASE",`(?:-(${D[N.PRERELEASEIDENTIFIER]}(?:\\.${D[N.PRERELEASEIDENTIFIER]})*))`);O("PRERELEASELOOSE",`(?:-?(${D[N.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${D[N.PRERELEASEIDENTIFIERLOOSE]})*))`);O("BUILDIDENTIFIER",`${Z3}+`);O("BUILD",`(?:\\+(${D[N.BUILDIDENTIFIER]}(?:\\.${D[N.BUILDIDENTIFIER]})*))`);O("FULLPLAIN",`v?${D[N.MAINVERSION]}${D[N.PRERELEASE]}?${D[N.BUILD]}?`);O("FULL",`^${D[N.FULLPLAIN]}$`);O("LOOSEPLAIN",`[v=\\s]*${D[N.MAINVERSIONLOOSE]}${D[N.PRERELEASELOOSE]}?${D[N.BUILD]}?`);O("LOOSE",`^${D[N.LOOSEPLAIN]}$`);O("GTLT","((?:<|>)?=?)");O("XRANGEIDENTIFIERLOOSE",`${D[N.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);O("XRANGEIDENTIFIER",`${D[N.NUMERICIDENTIFIER]}|x|X|\\*`);O("XRANGEPLAIN",`[v=\\s]*(${D[N.XRANGEIDENTIFIER]})(?:\\.(${D[N.XRANGEIDENTIFIER]})(?:\\.(${D[N.XRANGEIDENTIFIER]})(?:${D[N.PRERELEASE]})?${D[N.BUILD]}?)?)?`);O("XRANGEPLAINLOOSE",`[v=\\s]*(${D[N.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[N.XRANGEIDENTIFIERLOOSE]})(?:\\.(${D[N.XRANGEIDENTIFIERLOOSE]})(?:${D[N.PRERELEASELOOSE]})?${D[N.BUILD]}?)?)?`);O("XRANGE",`^${D[N.GTLT]}\\s*${D[N.XRANGEPLAIN]}$`);O("XRANGELOOSE",`^${D[N.GTLT]}\\s*${D[N.XRANGEPLAINLOOSE]}$`);O("COERCEPLAIN",`(^|[^\\d])(\\d{1,${e5}})(?:\\.(\\d{1,${e5}}))?(?:\\.(\\d{1,${e5}}))?`);O("COERCE",`${D[N.COERCEPLAIN]}(?:$|[^\\d])`);O("COERCEFULL",D[N.COERCEPLAIN]+`(?:${D[N.PRERELEASE]})?(?:${D[N.BUILD]})?(?:$|[^\\d])`);O("COERCERTL",D[N.COERCE],!0);O("COERCERTLFULL",D[N.COERCEFULL],!0);O("LONETILDE","(?:~>?)");O("TILDETRIM",`(\\s*)${D[N.LONETILDE]}\\s+`,!0);c0.tildeTrimReplace="$1~";O("TILDE",`^${D[N.LONETILDE]}${D[N.XRANGEPLAIN]}$`);O("TILDELOOSE",`^${D[N.LONETILDE]}${D[N.XRANGEPLAINLOOSE]}$`);O("LONECARET","(?:\\^)");O("CARETTRIM",`(\\s*)${D[N.LONECARET]}\\s+`,!0);c0.caretTrimReplace="$1^";O("CARET",`^${D[N.LONECARET]}${D[N.XRANGEPLAIN]}$`);O("CARETLOOSE",`^${D[N.LONECARET]}${D[N.XRANGEPLAINLOOSE]}$`);O("COMPARATORLOOSE",`^${D[N.GTLT]}\\s*(${D[N.LOOSEPLAIN]})$|^$`);O("COMPARATOR",`^${D[N.GTLT]}\\s*(${D[N.FULLPLAIN]})$|^$`);O("COMPARATORTRIM",`(\\s*)${D[N.GTLT]}\\s*(${D[N.LOOSEPLAIN]}|${D[N.XRANGEPLAIN]})`,!0);c0.comparatorTrimReplace="$1$2$3";O("HYPHENRANGE",`^\\s*(${D[N.XRANGEPLAIN]})\\s+-\\s+(${D[N.XRANGEPLAIN]})\\s*$`);O("HYPHENRANGELOOSE",`^\\s*(${D[N.XRANGEPLAINLOOSE]})\\s+-\\s+(${D[N.XRANGEPLAINLOOSE]})\\s*$`);O("STAR","(<|>)?=?\\s*\\*");O("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");O("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var I1=E((kA,$Z)=>{var PG=Object.freeze({loose:!0}),jG=Object.freeze({}),EG=(Z)=>{if(!Z)return jG;if(typeof Z!=="object")return PG;return Z};$Z.exports=EG});var X3=E((SA,MZ)=>{var FZ=/^[0-9]+$/,AZ=(Z,X)=>{if(typeof Z==="number"&&typeof X==="number")return Z===X?0:Z<X?-1:1;let q=FZ.test(Z),W=FZ.test(X);if(q&&W)Z=+Z,X=+X;return Z===X?0:q&&!W?-1:W&&!q?1:Z<X?-1:1},CG=(Z,X)=>AZ(X,Z);MZ.exports={compareIdentifiers:AZ,rcompareIdentifiers:CG}});var Q0=E((bA,IZ)=>{var w1=P4(),{MAX_LENGTH:LZ,MAX_SAFE_INTEGER:D1}=Z4(),{safeRe:N1,t:T1}=X4(),OG=I1(),{compareIdentifiers:q3}=X3(),xG=(Z,X)=>{let q=X.split(".");if(q.length>Z.length)return!1;for(let W=0;W<q.length;W++)if(q3(Z[W],q[W])!==0)return!1;return!0};class k0{constructor(Z,X){if(X=OG(X),Z instanceof k0)if(Z.loose===!!X.loose&&Z.includePrerelease===!!X.includePrerelease)return Z;else Z=Z.version;else if(typeof Z!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof Z}".`);if(Z.length>LZ)throw TypeError(`version is longer than ${LZ} characters`);w1("SemVer",Z,X),this.options=X,this.loose=!!X.loose,this.includePrerelease=!!X.includePrerelease;let q=Z.trim().match(X.loose?N1[T1.LOOSE]:N1[T1.FULL]);if(!q)throw TypeError(`Invalid Version: ${Z}`);if(this.raw=Z,this.major=+q[1],this.minor=+q[2],this.patch=+q[3],this.major>D1||this.major<0)throw TypeError("Invalid major version");if(this.minor>D1||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>D1||this.patch<0)throw TypeError("Invalid patch version");if(!q[4])this.prerelease=[];else this.prerelease=q[4].split(".").map((W)=>{if(/^[0-9]+$/.test(W)){let Q=+W;if(Q>=0&&Q<D1)return Q}return W});this.build=q[5]?q[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(Z){if(w1("SemVer.compare",this.version,this.options,Z),!(Z instanceof k0)){if(typeof Z==="string"&&Z===this.version)return 0;Z=new k0(Z,this.options)}if(Z.version===this.version)return 0;return this.compareMain(Z)||this.comparePre(Z)}compareMain(Z){if(!(Z instanceof k0))Z=new k0(Z,this.options);if(this.major<Z.major)return-1;if(this.major>Z.major)return 1;if(this.minor<Z.minor)return-1;if(this.minor>Z.minor)return 1;if(this.patch<Z.patch)return-1;if(this.patch>Z.patch)return 1;return 0}comparePre(Z){if(!(Z instanceof k0))Z=new k0(Z,this.options);if(this.prerelease.length&&!Z.prerelease.length)return-1;else if(!this.prerelease.length&&Z.prerelease.length)return 1;else if(!this.prerelease.length&&!Z.prerelease.length)return 0;let X=0;do{let q=this.prerelease[X],W=Z.prerelease[X];if(w1("prerelease compare",X,q,W),q===void 0&&W===void 0)return 0;else if(W===void 0)return 1;else if(q===void 0)return-1;else if(q===W)continue;else return q3(q,W)}while(++X)}compareBuild(Z){if(!(Z instanceof k0))Z=new k0(Z,this.options);let X=0;do{let q=this.build[X],W=Z.build[X];if(w1("build compare",X,q,W),q===void 0&&W===void 0)return 0;else if(W===void 0)return 1;else if(q===void 0)return-1;else if(q===W)continue;else return q3(q,W)}while(++X)}inc(Z,X,q){if(Z.startsWith("pre")){if(!X&&q===!1)throw Error("invalid increment argument: identifier is empty");if(X){let W=`-${X}`.match(this.options.loose?N1[T1.PRERELEASELOOSE]:N1[T1.PRERELEASE]);if(!W||W[1]!==X)throw Error(`invalid identifier: ${X}`)}}switch(Z){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",X,q);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",X,q);break;case"prepatch":this.prerelease.length=0,this.inc("patch",X,q),this.inc("pre",X,q);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",X,q);this.inc("pre",X,q);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let W=Number(q)?1:0;if(this.prerelease.length===0)this.prerelease=[W];else{let Q=this.prerelease.length;while(--Q>=0)if(typeof this.prerelease[Q]==="number")this.prerelease[Q]++,Q=-2;if(Q===-1){if(X===this.prerelease.join(".")&&q===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(W)}}if(X){let Q=[X,W];if(q===!1)Q=[X];if(xG(this.prerelease,X)){let J=this.prerelease[X.split(".").length];if(isNaN(J))this.prerelease=Q}else this.prerelease=Q}break}default:throw Error(`invalid increment argument: ${Z}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}IZ.exports=k0});var H6=E((vA,DZ)=>{var wZ=Q0(),kG=(Z,X,q=!1)=>{if(Z instanceof wZ)return Z;try{return new wZ(Z,X)}catch(W){if(!q)return null;throw W}};DZ.exports=kG});var TZ=E((yA,NZ)=>{var SG=H6(),bG=(Z,X)=>{let q=SG(Z,X);return q?q.version:null};NZ.exports=bG});var _Z=E((gA,RZ)=>{var vG=H6(),yG=(Z,X)=>{let q=vG(Z.trim().replace(/^[=v]+/,""),X);return q?q.version:null};RZ.exports=yG});var EZ=E((hA,jZ)=>{var PZ=Q0(),gG=(Z,X,q,W,Q)=>{if(typeof q==="string")Q=W,W=q,q=void 0;try{return new PZ(Z instanceof PZ?Z.version:Z,q).inc(X,W,Q).version}catch(J){return null}};jZ.exports=gG});var xZ=E((mA,OZ)=>{var CZ=H6(),hG=(Z,X)=>{let q=CZ(Z,null,!0),W=CZ(X,null,!0),Q=q.compare(W);if(Q===0)return null;let J=Q>0,z=J?q:W,Y=J?W:q,U=!!z.prerelease.length;if(!!Y.prerelease.length&&!U){if(!Y.patch&&!Y.minor)return"major";if(Y.compareMain(z)===0){if(Y.minor&&!Y.patch)return"minor";return"patch"}}let V=U?"pre":"";if(q.major!==W.major)return V+"major";if(q.minor!==W.minor)return V+"minor";if(q.patch!==W.patch)return V+"patch";return"prerelease"};OZ.exports=hG});var SZ=E((fA,kZ)=>{var mG=Q0(),fG=(Z,X)=>new mG(Z,X).major;kZ.exports=fG});var vZ=E((uA,bZ)=>{var uG=Q0(),dG=(Z,X)=>new uG(Z,X).minor;bZ.exports=dG});var gZ=E((dA,yZ)=>{var cG=Q0(),lG=(Z,X)=>new cG(Z,X).patch;yZ.exports=lG});var mZ=E((cA,hZ)=>{var pG=H6(),nG=(Z,X)=>{let q=pG(Z,X);return q&&q.prerelease.length?q.prerelease:null};hZ.exports=nG});var j0=E((lA,uZ)=>{var fZ=Q0(),iG=(Z,X,q)=>new fZ(Z,q).compare(new fZ(X,q));uZ.exports=iG});var cZ=E((pA,dZ)=>{var rG=j0(),aG=(Z,X,q)=>rG(X,Z,q);dZ.exports=aG});var pZ=E((nA,lZ)=>{var sG=j0(),oG=(Z,X)=>sG(Z,X,!0);lZ.exports=oG});var R1=E((iA,iZ)=>{var nZ=Q0(),tG=(Z,X,q)=>{let W=new nZ(Z,q),Q=new nZ(X,q);return W.compare(Q)||W.compareBuild(Q)};iZ.exports=tG});var aZ=E((rA,rZ)=>{var eG=R1(),ZY=(Z,X)=>Z.sort((q,W)=>eG(q,W,X));rZ.exports=ZY});var oZ=E((aA,sZ)=>{var XY=R1(),qY=(Z,X)=>Z.sort((q,W)=>XY(W,q,X));sZ.exports=qY});var j4=E((sA,tZ)=>{var WY=j0(),QY=(Z,X,q)=>WY(Z,X,q)>0;tZ.exports=QY});var _1=E((oA,eZ)=>{var JY=j0(),zY=(Z,X,q)=>JY(Z,X,q)<0;eZ.exports=zY});var W3=E((tA,Z2)=>{var GY=j0(),YY=(Z,X,q)=>GY(Z,X,q)===0;Z2.exports=YY});var Q3=E((eA,X2)=>{var UY=j0(),KY=(Z,X,q)=>UY(Z,X,q)!==0;X2.exports=KY});var P1=E((ZM,q2)=>{var VY=j0(),BY=(Z,X,q)=>VY(Z,X,q)>=0;q2.exports=BY});var j1=E((XM,W2)=>{var HY=j0(),$Y=(Z,X,q)=>HY(Z,X,q)<=0;W2.exports=$Y});var J3=E((qM,Q2)=>{var FY=W3(),AY=Q3(),MY=j4(),LY=P1(),IY=_1(),wY=j1(),DY=(Z,X,q,W)=>{switch(X){case"===":if(typeof Z==="object")Z=Z.version;if(typeof q==="object")q=q.version;return Z===q;case"!==":if(typeof Z==="object")Z=Z.version;if(typeof q==="object")q=q.version;return Z!==q;case"":case"=":case"==":return FY(Z,q,W);case"!=":return AY(Z,q,W);case">":return MY(Z,q,W);case">=":return LY(Z,q,W);case"<":return IY(Z,q,W);case"<=":return wY(Z,q,W);default:throw TypeError(`Invalid operator: ${X}`)}};Q2.exports=DY});var z2=E((WM,J2)=>{var NY=Q0(),TY=H6(),{safeRe:E1,t:C1}=X4(),RY=(Z,X)=>{if(Z instanceof NY)return Z;if(typeof Z==="number")Z=String(Z);if(typeof Z!=="string")return null;X=X||{};let q=null;if(!X.rtl)q=Z.match(X.includePrerelease?E1[C1.COERCEFULL]:E1[C1.COERCE]);else{let U=X.includePrerelease?E1[C1.COERCERTLFULL]:E1[C1.COERCERTL],K;while((K=U.exec(Z))&&(!q||q.index+q[0].length!==Z.length)){if(!q||K.index+K[0].length!==q.index+q[0].length)q=K;U.lastIndex=K.index+K[1].length+K[2].length}U.lastIndex=-1}if(q===null)return null;let W=q[2],Q=q[3]||"0",J=q[4]||"0",z=X.includePrerelease&&q[5]?`-${q[5]}`:"",Y=X.includePrerelease&&q[6]?`+${q[6]}`:"";return TY(`${W}.${Q}.${J}${z}${Y}`,X)};J2.exports=RY});var Y2=E((QM,G2)=>{var _Y=H6(),PY=Z4(),jY=Q0(),EY=(Z,X,q)=>{if(!PY.RELEASE_TYPES.includes(X))return null;let W=CY(Z,q);return W&&OY(W,X)},CY=(Z,X)=>{let q=Z instanceof jY?Z.version:Z;return _Y(q,X)},OY=(Z,X)=>{if(xY(X))return Z.version;switch(Z.prerelease=[],X){case"major":Z.minor=0,Z.patch=0;break;case"minor":Z.patch=0;break}return Z.format()},xY=(Z)=>{return Z.startsWith("pre")};G2.exports=EY});var V2=E((JM,K2)=>{class U2{constructor(){this.max=1000,this.map=new Map}get(Z){let X=this.map.get(Z);if(X===void 0)return;else return this.map.delete(Z),this.map.set(Z,X),X}delete(Z){return this.map.delete(Z)}set(Z,X){if(!this.delete(Z)&&X!==void 0){if(this.map.size>=this.max){let W=this.map.keys().next().value;this.delete(W)}this.map.set(Z,X)}return this}}K2.exports=U2});var E0=E((zM,F2)=>{var kY=/\s+/g;class E4{constructor(Z,X){if(X=bY(X),Z instanceof E4)if(Z.loose===!!X.loose&&Z.includePrerelease===!!X.includePrerelease)return Z;else return new E4(Z.raw,X);if(Z instanceof z3)return this.raw=Z.value,this.set=[[Z]],this.formatted=void 0,this;if(this.options=X,this.loose=!!X.loose,this.includePrerelease=!!X.includePrerelease,this.raw=Z.trim().replace(kY," "),this.set=this.raw.split("||").map((q)=>this.parseRange(q.trim())).filter((q)=>q.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let q=this.set[0];if(this.set=this.set.filter((W)=>!H2(W[0])),this.set.length===0)this.set=[q];else if(this.set.length>1){for(let W of this.set)if(W.length===1&&cY(W[0])){this.set=[W];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let Z=0;Z<this.set.length;Z++){if(Z>0)this.formatted+="||";let X=this.set[Z];for(let q=0;q<X.length;q++){if(q>0)this.formatted+=" ";this.formatted+=X[q].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(Z){Z=Z.replace(dY,"");let q=((this.options.includePrerelease&&fY)|(this.options.loose&&uY))+":"+Z,W=B2.get(q);if(W)return W;let Q=this.options.loose,J=Q?V0[J0.HYPHENRANGELOOSE]:V0[J0.HYPHENRANGE];Z=Z.replace(J,ZU(this.options.includePrerelease)),m("hyphen replace",Z),Z=Z.replace(V0[J0.COMPARATORTRIM],gY),m("comparator trim",Z),Z=Z.replace(V0[J0.TILDETRIM],hY),m("tilde trim",Z),Z=Z.replace(V0[J0.CARETTRIM],mY),m("caret trim",Z);let z=Z.split(" ").map((V)=>lY(V,this.options)).join(" ").split(/\s+/).map((V)=>eY(V,this.options));if(Q)z=z.filter((V)=>{return m("loose invalid filter",V,this.options),!!V.match(V0[J0.COMPARATORLOOSE])});m("range list",z);let Y=new Map,U=z.map((V)=>new z3(V,this.options));for(let V of U){if(H2(V))return[V];Y.set(V.value,V)}if(Y.size>1&&Y.has(""))Y.delete("");let K=[...Y.values()];return B2.set(q,K),K}intersects(Z,X){if(!(Z instanceof E4))throw TypeError("a Range is required");return this.set.some((q)=>{return $2(q,X)&&Z.set.some((W)=>{return $2(W,X)&&q.every((Q)=>{return W.every((J)=>{return Q.intersects(J,X)})})})})}test(Z){if(!Z)return!1;if(typeof Z==="string")try{Z=new vY(Z,this.options)}catch(X){return!1}for(let X=0;X<this.set.length;X++)if(XU(this.set[X],Z,this.options))return!0;return!1}}F2.exports=E4;var SY=V2(),B2=new SY,bY=I1(),z3=C4(),m=P4(),vY=Q0(),{safeRe:V0,src:yY,t:J0,comparatorTrimReplace:gY,tildeTrimReplace:hY,caretTrimReplace:mY}=X4(),{FLAG_INCLUDE_PRERELEASE:fY,FLAG_LOOSE:uY}=Z4(),dY=new RegExp(yY[J0.BUILD],"g"),H2=(Z)=>Z.value==="<0.0.0-0",cY=(Z)=>Z.value==="",$2=(Z,X)=>{let q=!0,W=Z.slice(),Q=W.pop();while(q&&W.length)q=W.every((J)=>{return Q.intersects(J,X)}),Q=W.pop();return q},lY=(Z,X)=>{return Z=Z.replace(V0[J0.BUILD],""),m("comp",Z,X),Z=rY(Z,X),m("caret",Z),Z=nY(Z,X),m("tildes",Z),Z=sY(Z,X),m("xrange",Z),Z=tY(Z,X),m("stars",Z),Z},s=(Z)=>!Z||Z.toLowerCase()==="x"||Z==="*",pY=(Z,X,q)=>s(Z)&&!s(X)||s(X)&&q&&!s(q),nY=(Z,X)=>{return Z.trim().split(/\s+/).map((q)=>iY(q,X)).join(" ")},iY=(Z,X)=>{let q=X.loose?V0[J0.TILDELOOSE]:V0[J0.TILDE];return Z.replace(q,(W,Q,J,z,Y)=>{m("tilde",Z,W,Q,J,z,Y);let U;if(s(Q))U="";else if(s(J))U=`>=${Q}.0.0 <${+Q+1}.0.0-0`;else if(s(z))U=`>=${Q}.${J}.0 <${Q}.${+J+1}.0-0`;else if(Y)m("replaceTilde pr",Y),U=`>=${Q}.${J}.${z}-${Y} <${Q}.${+J+1}.0-0`;else U=`>=${Q}.${J}.${z} <${Q}.${+J+1}.0-0`;return m("tilde return",U),U})},rY=(Z,X)=>{return Z.trim().split(/\s+/).map((q)=>aY(q,X)).join(" ")},aY=(Z,X)=>{m("caret",Z,X);let q=X.loose?V0[J0.CARETLOOSE]:V0[J0.CARET],W=X.includePrerelease?"-0":"";return Z.replace(q,(Q,J,z,Y,U)=>{m("caret",Z,Q,J,z,Y,U);let K;if(s(J))K="";else if(s(z))K=`>=${J}.0.0${W} <${+J+1}.0.0-0`;else if(s(Y))if(J==="0")K=`>=${J}.${z}.0${W} <${J}.${+z+1}.0-0`;else K=`>=${J}.${z}.0${W} <${+J+1}.0.0-0`;else if(U)if(m("replaceCaret pr",U),J==="0")if(z==="0")K=`>=${J}.${z}.${Y}-${U} <${J}.${z}.${+Y+1}-0`;else K=`>=${J}.${z}.${Y}-${U} <${J}.${+z+1}.0-0`;else K=`>=${J}.${z}.${Y}-${U} <${+J+1}.0.0-0`;else if(m("no pr"),J==="0")if(z==="0")K=`>=${J}.${z}.${Y} <${J}.${z}.${+Y+1}-0`;else K=`>=${J}.${z}.${Y} <${J}.${+z+1}.0-0`;else K=`>=${J}.${z}.${Y} <${+J+1}.0.0-0`;return m("caret return",K),K})},sY=(Z,X)=>{return m("replaceXRanges",Z,X),Z.split(/\s+/).map((q)=>oY(q,X)).join(" ")},oY=(Z,X)=>{Z=Z.trim();let q=X.loose?V0[J0.XRANGELOOSE]:V0[J0.XRANGE];return Z.replace(q,(W,Q,J,z,Y,U)=>{if(m("xRange",Z,W,Q,J,z,Y,U),pY(J,z,Y))return Z;let K=s(J),V=K||s(z),B=V||s(Y),H=B;if(Q==="="&&H)Q="";if(U=X.includePrerelease?"-0":"",K)if(Q===">"||Q==="<")W="<0.0.0-0";else W="*";else if(Q&&H){if(V)z=0;if(Y=0,Q===">")if(Q=">=",V)J=+J+1,z=0,Y=0;else z=+z+1,Y=0;else if(Q==="<=")if(Q="<",V)J=+J+1;else z=+z+1;if(Q==="<")U="-0";W=`${Q+J}.${z}.${Y}${U}`}else if(V)W=`>=${J}.0.0${U} <${+J+1}.0.0-0`;else if(B)W=`>=${J}.${z}.0${U} <${J}.${+z+1}.0-0`;return m("xRange return",W),W})},tY=(Z,X)=>{return m("replaceStars",Z,X),Z.trim().replace(V0[J0.STAR],"")},eY=(Z,X)=>{return m("replaceGTE0",Z,X),Z.trim().replace(V0[X.includePrerelease?J0.GTE0PRE:J0.GTE0],"")},ZU=(Z)=>(X,q,W,Q,J,z,Y,U,K,V,B,H)=>{if(s(W))q="";else if(s(Q))q=`>=${W}.0.0${Z?"-0":""}`;else if(s(J))q=`>=${W}.${Q}.0${Z?"-0":""}`;else if(z)q=`>=${q}`;else q=`>=${q}${Z?"-0":""}`;if(s(K))U="";else if(s(V))U=`<${+K+1}.0.0-0`;else if(s(B))U=`<${K}.${+V+1}.0-0`;else if(H)U=`<=${K}.${V}.${B}-${H}`;else if(Z)U=`<${K}.${V}.${+B+1}-0`;else U=`<=${U}`;return`${q} ${U}`.trim()},XU=(Z,X,q)=>{for(let W=0;W<Z.length;W++)if(!Z[W].test(X))return!1;if(X.prerelease.length&&!q.includePrerelease){for(let W=0;W<Z.length;W++){if(m(Z[W].semver),Z[W].semver===z3.ANY)continue;if(Z[W].semver.prerelease.length>0){let Q=Z[W].semver;if(Q.major===X.major&&Q.minor===X.minor&&Q.patch===X.patch)return!0}}return!1}return!0}});var C4=E((GM,D2)=>{var O4=Symbol("SemVer ANY");class O1{static get ANY(){return O4}constructor(Z,X){if(X=A2(X),Z instanceof O1)if(Z.loose===!!X.loose)return Z;else Z=Z.value;if(Z=Z.trim().split(/\s+/).join(" "),Y3("comparator",Z,X),this.options=X,this.loose=!!X.loose,this.parse(Z),this.semver===O4)this.value="";else this.value=this.operator+this.semver.version;Y3("comp",this)}parse(Z){let X=this.options.loose?M2[L2.COMPARATORLOOSE]:M2[L2.COMPARATOR],q=Z.match(X);if(!q)throw TypeError(`Invalid comparator: ${Z}`);if(this.operator=q[1]!==void 0?q[1]:"",this.operator==="=")this.operator="";if(!q[2])this.semver=O4;else this.semver=new I2(q[2],this.options.loose)}toString(){return this.value}test(Z){if(Y3("Comparator.test",Z,this.options.loose),this.semver===O4||Z===O4)return!0;if(typeof Z==="string")try{Z=new I2(Z,this.options)}catch(X){return!1}return G3(Z,this.operator,this.semver,this.options)}intersects(Z,X){if(!(Z instanceof O1))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new w2(Z.value,X).test(this.value)}else if(Z.operator===""){if(Z.value==="")return!0;return new w2(this.value,X).test(Z.semver)}if(X=A2(X),X.includePrerelease&&(this.value==="<0.0.0-0"||Z.value==="<0.0.0-0"))return!1;if(!X.includePrerelease&&(this.value.startsWith("<0.0.0")||Z.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&Z.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&Z.operator.startsWith("<"))return!0;if(this.semver.version===Z.semver.version&&this.operator.includes("=")&&Z.operator.includes("="))return!0;if(G3(this.semver,"<",Z.semver,X)&&this.operator.startsWith(">")&&Z.operator.startsWith("<"))return!0;if(G3(this.semver,">",Z.semver,X)&&this.operator.startsWith("<")&&Z.operator.startsWith(">"))return!0;return!1}}D2.exports=O1;var A2=I1(),{safeRe:M2,t:L2}=X4(),G3=J3(),Y3=P4(),I2=Q0(),w2=E0()});var x4=E((YM,N2)=>{var qU=E0(),WU=(Z,X,q)=>{try{X=new qU(X,q)}catch(W){return!1}return X.test(Z)};N2.exports=WU});var R2=E((UM,T2)=>{var QU=E0(),JU=(Z,X)=>new QU(Z,X).set.map((q)=>q.map((W)=>W.value).join(" ").trim().split(" "));T2.exports=JU});var P2=E((KM,_2)=>{var zU=Q0(),GU=E0(),YU=(Z,X,q)=>{let W=null,Q=null,J=null;try{J=new GU(X,q)}catch(z){return null}return Z.forEach((z)=>{if(J.test(z)){if(!W||Q.compare(z)===-1)W=z,Q=new zU(W,q)}}),W};_2.exports=YU});var E2=E((VM,j2)=>{var UU=Q0(),KU=E0(),VU=(Z,X,q)=>{let W=null,Q=null,J=null;try{J=new KU(X,q)}catch(z){return null}return Z.forEach((z)=>{if(J.test(z)){if(!W||Q.compare(z)===1)W=z,Q=new UU(W,q)}}),W};j2.exports=VU});var x2=E((BM,O2)=>{var U3=Q0(),BU=E0(),C2=j4(),HU=(Z,X)=>{Z=new BU(Z,X);let q=new U3("0.0.0");if(Z.test(q))return q;if(q=new U3("0.0.0-0"),Z.test(q))return q;q=null;for(let W=0;W<Z.set.length;++W){let Q=Z.set[W],J=null;if(Q.forEach((z)=>{let Y=new U3(z.semver.version);switch(z.operator){case">":if(Y.prerelease.length===0)Y.patch++;else Y.prerelease.push(0);Y.raw=Y.format();case"":case">=":if(!J||C2(Y,J))J=Y;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${z.operator}`)}}),J&&(!q||C2(q,J)))q=J}if(q&&Z.test(q))return q;return null};O2.exports=HU});var S2=E((HM,k2)=>{var $U=E0(),FU=(Z,X)=>{try{return new $U(Z,X).range||"*"}catch(q){return null}};k2.exports=FU});var x1=E(($M,g2)=>{var AU=Q0(),y2=C4(),{ANY:MU}=y2,LU=E0(),IU=x4(),b2=j4(),v2=_1(),wU=j1(),DU=P1(),NU=(Z,X,q,W)=>{Z=new AU(Z,W),X=new LU(X,W);let Q,J,z,Y,U;switch(q){case">":Q=b2,J=wU,z=v2,Y=">",U=">=";break;case"<":Q=v2,J=DU,z=b2,Y="<",U="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(IU(Z,X,W))return!1;for(let K=0;K<X.set.length;++K){let V=X.set[K],B=null,H=null;if(V.forEach(($)=>{if($.semver===MU)$=new y2(">=0.0.0");if(B=B||$,H=H||$,Q($.semver,B.semver,W))B=$;else if(z($.semver,H.semver,W))H=$}),B.operator===Y||B.operator===U)return!1;if((!H.operator||H.operator===Y)&&J(Z,H.semver))return!1;else if(H.operator===U&&z(Z,H.semver))return!1}return!0};g2.exports=NU});var m2=E((FM,h2)=>{var TU=x1(),RU=(Z,X,q)=>TU(Z,X,">",q);h2.exports=RU});var u2=E((AM,f2)=>{var _U=x1(),PU=(Z,X,q)=>_U(Z,X,"<",q);f2.exports=PU});var l2=E((MM,c2)=>{var d2=E0(),jU=(Z,X,q)=>{return Z=new d2(Z,q),X=new d2(X,q),Z.intersects(X,q)};c2.exports=jU});var n2=E((LM,p2)=>{var EU=x4(),CU=j0();p2.exports=(Z,X,q)=>{let W=[],Q=null,J=null,z=Z.sort((V,B)=>CU(V,B,q));for(let V of z)if(EU(V,X,q)){if(J=V,!Q)Q=V}else{if(J)W.push([Q,J]);J=null,Q=null}if(Q)W.push([Q,null]);let Y=[];for(let[V,B]of W)if(V===B)Y.push(V);else if(!B&&V===z[0])Y.push("*");else if(!B)Y.push(`>=${V}`);else if(V===z[0])Y.push(`<=${B}`);else Y.push(`${V} - ${B}`);let U=Y.join(" || "),K=typeof X.raw==="string"?X.raw:String(X);return U.length<K.length?U:X}});var t2=E((IM,o2)=>{var i2=E0(),B3=C4(),{ANY:K3}=B3,V3=x4(),H3=j0(),OU=(Z,X,q={})=>{if(Z===X)return!0;Z=new i2(Z,q),X=new i2(X,q);let W=!1;Z:for(let Q of Z.set){for(let J of X.set){let z=kU(Q,J,q);if(W=W||z!==null,z)continue Z}if(W)return!1}return!0},xU=[new B3(">=0.0.0-0")],r2=[new B3(">=0.0.0")],kU=(Z,X,q)=>{if(Z===X)return!0;if(Z.length===1&&Z[0].semver===K3)if(X.length===1&&X[0].semver===K3)return!0;else if(q.includePrerelease)Z=xU;else Z=r2;if(X.length===1&&X[0].semver===K3)if(q.includePrerelease)return!0;else X=r2;let W=new Set,Q,J;for(let $ of Z)if($.operator===">"||$.operator===">=")Q=a2(Q,$,q);else if($.operator==="<"||$.operator==="<=")J=s2(J,$,q);else W.add($.semver);if(W.size>1)return null;let z;if(Q&&J){if(z=H3(Q.semver,J.semver,q),z>0)return null;else if(z===0&&(Q.operator!==">="||J.operator!=="<="))return null}for(let $ of W){if(Q&&!V3($,String(Q),q))return null;if(J&&!V3($,String(J),q))return null;for(let F of X)if(!V3($,String(F),q))return!1;return!0}let Y,U,K,V,B=J&&!q.includePrerelease&&J.semver.prerelease.length?J.semver:!1,H=Q&&!q.includePrerelease&&Q.semver.prerelease.length?Q.semver:!1;if(B&&B.prerelease.length===1&&J.operator==="<"&&B.prerelease[0]===0)B=!1;for(let $ of X){if(V=V||$.operator===">"||$.operator===">=",K=K||$.operator==="<"||$.operator==="<=",Q){if(H){if($.semver.prerelease&&$.semver.prerelease.length&&$.semver.major===H.major&&$.semver.minor===H.minor&&$.semver.patch===H.patch)H=!1}if($.operator===">"||$.operator===">="){if(Y=a2(Q,$,q),Y===$&&Y!==Q)return!1}else if(Q.operator===">="&&!$.test(Q.semver))return!1}if(J){if(B){if($.semver.prerelease&&$.semver.prerelease.length&&$.semver.major===B.major&&$.semver.minor===B.minor&&$.semver.patch===B.patch)B=!1}if($.operator==="<"||$.operator==="<="){if(U=s2(J,$,q),U===$&&U!==J)return!1}else if(J.operator==="<="&&!$.test(J.semver))return!1}if(!$.operator&&(J||Q)&&z!==0)return!1}if(Q&&K&&!J&&z!==0)return!1;if(J&&V&&!Q&&z!==0)return!1;if(H||B)return!1;return!0},a2=(Z,X,q)=>{if(!Z)return X;let W=H3(Z.semver,X.semver,q);return W>0?Z:W<0?X:X.operator===">"&&Z.operator===">="?X:Z},s2=(Z,X,q)=>{if(!Z)return X;let W=H3(Z.semver,X.semver,q);return W<0?Z:W>0?X:X.operator==="<"&&Z.operator==="<="?X:Z};o2.exports=OU});var qX=E((wM,XX)=>{var $3=X4(),e2=Z4(),SU=Q0(),ZX=X3(),bU=H6(),vU=TZ(),yU=_Z(),gU=EZ(),hU=xZ(),mU=SZ(),fU=vZ(),uU=gZ(),dU=mZ(),cU=j0(),lU=cZ(),pU=pZ(),nU=R1(),iU=aZ(),rU=oZ(),aU=j4(),sU=_1(),oU=W3(),tU=Q3(),eU=P1(),ZK=j1(),XK=J3(),qK=z2(),WK=Y2(),QK=C4(),JK=E0(),zK=x4(),GK=R2(),YK=P2(),UK=E2(),KK=x2(),VK=S2(),BK=x1(),HK=m2(),$K=u2(),FK=l2(),AK=n2(),MK=t2();XX.exports={parse:bU,valid:vU,clean:yU,inc:gU,diff:hU,major:mU,minor:fU,patch:uU,prerelease:dU,compare:cU,rcompare:lU,compareLoose:pU,compareBuild:nU,sort:iU,rsort:rU,gt:aU,lt:sU,eq:oU,neq:tU,gte:eU,lte:ZK,cmp:XK,coerce:qK,truncate:WK,Comparator:QK,Range:JK,satisfies:zK,toComparators:GK,maxSatisfying:YK,minSatisfying:UK,minVersion:KK,validRange:VK,outside:BK,gtr:HK,ltr:$K,intersects:FK,simplifyRange:AK,subset:MK,SemVer:SU,re:$3.re,src:$3.src,tokens:$3.t,SEMVER_SPEC_VERSION:e2.SEMVER_SPEC_VERSION,RELEASE_TYPES:e2.RELEASE_TYPES,compareIdentifiers:ZX.compareIdentifiers,rcompareIdentifiers:ZX.rcompareIdentifiers}});var q6;var k1=R(()=>{q6={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.35.0",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unnebäck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix Bünemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","Jérémy Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kotěšovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouciño <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugué <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>","Dmytro Tiapukhin <cool.gegeg@gmail.com>","Florian Lefebvre <contact@florian-lefebvre.dev>"],scripts:{build:"node install/build.js","build:dist":"node scripts/build.mjs",clean:"rm -rf src/build/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-types":"tsd --files ./test/types/sharp.test-d.ts","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./lib/index.d.ts",exports:{".":{import:"./dist/index.mjs",require:"./dist/index.cjs"}},repository:{type:"git",url:"git://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.1.0","detect-libc":"^2.1.2",semver:"^7.8.4"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.0","@img/sharp-darwin-x64":"0.35.0","@img/sharp-freebsd-wasm32":"0.35.0","@img/sharp-libvips-darwin-arm64":"1.3.0","@img/sharp-libvips-darwin-x64":"1.3.0","@img/sharp-libvips-linux-arm":"1.3.0","@img/sharp-libvips-linux-arm64":"1.3.0","@img/sharp-libvips-linux-ppc64":"1.3.0","@img/sharp-libvips-linux-riscv64":"1.3.0","@img/sharp-libvips-linux-s390x":"1.3.0","@img/sharp-libvips-linux-x64":"1.3.0","@img/sharp-libvips-linuxmusl-arm64":"1.3.0","@img/sharp-libvips-linuxmusl-x64":"1.3.0","@img/sharp-linux-arm":"0.35.0","@img/sharp-linux-arm64":"0.35.0","@img/sharp-linux-ppc64":"0.35.0","@img/sharp-linux-riscv64":"0.35.0","@img/sharp-linux-s390x":"0.35.0","@img/sharp-linux-x64":"0.35.0","@img/sharp-linuxmusl-arm64":"0.35.0","@img/sharp-linuxmusl-x64":"0.35.0","@img/sharp-webcontainers-wasm32":"0.35.0","@img/sharp-win32-arm64":"0.35.0","@img/sharp-win32-ia32":"0.35.0","@img/sharp-win32-x64":"0.35.0"},devDependencies:{"@biomejs/biome":"^2.4.16","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.0","@img/sharp-libvips-dev":"1.3.0","@img/sharp-libvips-dev-wasm32":"1.3.0","@img/sharp-libvips-win32-arm64":"1.3.0","@img/sharp-libvips-win32-ia32":"1.3.0","@img/sharp-libvips-win32-x64":"1.3.0","@types/node":"*",emnapi:"^1.11.0","exif-reader":"^2.0.3","extract-zip":"^2.0.1",icc:"^4.0.0","node-addon-api":"^8.8.0","node-gyp":"^12.4.0","tar-fs":"^3.1.2",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.3"},funding:{url:"https://opencollective.com/libvips"}}});import{spawnSync as k4}from"node:child_process";import{createHash as IK}from"node:crypto";var S4,A3,wK,QX,DK,M3,NK=(Z)=>{if(Z instanceof Error)console.error(`sharp: Installation error: ${Z.message}`);else console.log(`sharp: ${Z}`)},JX=()=>A3.default.isNonGlibcLinuxSync()?A3.default.familySync():"",TK=()=>`${process.platform}${JX()}-${process.arch}`,q4=()=>{if(zX())return"wasm32";let{npm_config_arch:Z,npm_config_platform:X,npm_config_libc:q}=process.env,W=typeof q==="string"?q:JX();return`${X||process.platform}${W}-${Z||process.arch}`},RK=()=>{try{return q0(`@img/sharp-libvips-dev-${q4()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},_K=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},PK=()=>{try{return q0(`@img/sharp-libvips-dev-${q4()}/lib`)}catch{try{return q0(`@img/sharp-libvips-${q4()}/lib`)}catch{}}return""},jK=()=>{if(process.release?.name==="node"&&process.versions){if(!S4.default.satisfies(process.versions.node,q6.engines.node))return{found:process.versions.node,expected:q6.engines.node}}},zX=()=>{let{CC:Z}=process.env;return Boolean(Z?.endsWith("/emcc"))},EK=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(k4("sysctl sysctl.proc_translated",M3).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},WX=(Z)=>IK("sha512").update(Z).digest("hex"),CK=()=>{try{let Z=WX(`imgsharp-libvips-${q4()}`),X=S4.default.coerce(q6.optionalDependencies[`@img/sharp-libvips-${q4()}`],{includePrerelease:!0}).version;return WX(`${Z}npm:${X}`).slice(0,10)}catch{}return""},OK=()=>k4(`node-gyp rebuild --directory=src ${zX()?"--nodedir=emscripten":""}`,{...M3,stdio:"inherit"}).status,GX=()=>{if(process.platform!=="win32")return(k4("pkg-config --modversion vips-cpp",{...M3,env:{...process.env,PKG_CONFIG_PATH:YX()}}).stdout||"").trim();else return""},xK=()=>{try{let Z=(k4("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(Z)return`${Z}/lib/pkgconfig`}catch(Z){}return},kK=()=>{try{let Z=(k4("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(Z)return Z}catch(Z){}return},YX=()=>{if(process.platform!=="win32")return[xK(),kK(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},F3=(Z,X,q)=>{if(q)q(`Detected ${X}, skipping search for globally-installed libvips`);return Z},SK=(Z)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return F3(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",Z);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return F3(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",Z);if(EK())return F3(!1,"Rosetta",Z);let X=GX();return!!X&&S4.default.gte(X,QX)},S1;var L3=R(()=>{k1();S4=B4(qX(),1),A3=B4(L1(),1);/*!
209
+ */Y={defined:E5,object:jJ,plainObject:EJ,fn:CJ,bool:OJ,buffer:xJ,typedArray:kJ,arrayBuffer:SJ,string:bJ,number:vJ,integer:yJ,inRange:gJ,inArray:hJ,invalidParameterError:fJ,nativeError:mJ}});var x5=i((S$,O5)=>{var C5=()=>process.platform==="linux",l4=null,uJ=()=>{if(!l4)if(C5()&&process.report){let Z=process.report.excludeNetwork;process.report.excludeNetwork=!0,l4=process.report.getReport(),process.report.excludeNetwork=Z}else l4={};return l4};O5.exports={isLinux:C5,getReport:uJ}});var S5=i((b$,k5)=>{var A6=T0("fs"),dJ=(Z)=>{let W=A6.openSync(Z,"r"),X=Buffer.alloc(2048),Q=A6.readSync(W,X,0,2048,0);return A6.close(W,()=>{}),X.subarray(0,Q)},cJ=(Z)=>new Promise((W,X)=>{A6.open(Z,"r",(Q,J)=>{if(Q)X(Q);else{let G=Buffer.alloc(2048);A6.read(J,G,0,2048,0,(z,q)=>{W(G.subarray(0,q)),A6.close(J,()=>{})})}})});k5.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:dJ,readFile:cJ}});var v5=i((v$,b5)=>{var lJ=(Z)=>{if(Z.length<64)return null;if(Z.readUInt32BE(0)!==2135247942)return null;if(Z.readUInt8(4)!==2)return null;if(Z.readUInt8(5)!==1)return null;let W=Z.readUInt32LE(32),X=Z.readUInt16LE(54),Q=Z.readUInt16LE(56);for(let J=0;J<Q;J++){let G=W+J*X;if(Z.readUInt32LE(G)===3){let q=Z.readUInt32LE(G+8),K=Z.readUInt32LE(G+32);return Z.subarray(q,q+K).toString().replace(/\0.*$/g,"")}}return null};b5.exports={interpreterPath:lJ}});var n4=i((y$,t5)=>{var g5=T0("child_process"),{isLinux:M6,getReport:h5}=x5(),{LDD_PATH:p4,SELF_PATH:f5,readFile:M3,readFileSync:I3}=S5(),{interpreterPath:m5}=v5(),J1,G1,z1,y1="",u5=()=>{if(!y1)return new Promise((Z)=>{g5.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(W,X)=>{y1=W?" ":X,Z(y1)})});return y1},d5=()=>{if(!y1)try{y1=g5.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(Z){y1=" "}return y1},R1="glibc",c5=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,a1="musl",pJ=(Z)=>Z.includes("libc.musl-")||Z.includes("ld-musl-"),l5=()=>{let Z=h5();if(Z.header&&Z.header.glibcVersionRuntime)return R1;if(Array.isArray(Z.sharedObjects)){if(Z.sharedObjects.some(pJ))return a1}return null},p5=(Z)=>{let[W,X]=Z.split(/[\r\n]+/);if(W&&W.includes(R1))return R1;if(X&&X.includes(a1))return a1;return null},n5=(Z)=>{if(Z){if(Z.includes("/ld-musl-"))return a1;else if(Z.includes("/ld-linux-"))return R1}return null},i5=(Z)=>{if(Z=Z.toString(),Z.includes("musl"))return a1;if(Z.includes("GNU C Library"))return R1;return null},nJ=async()=>{if(G1!==void 0)return G1;G1=null;try{let Z=await M3(p4);G1=i5(Z)}catch(Z){}return G1},iJ=()=>{if(G1!==void 0)return G1;G1=null;try{let Z=I3(p4);G1=i5(Z)}catch(Z){}return G1},rJ=async()=>{if(J1!==void 0)return J1;J1=null;try{let Z=await M3(f5),W=m5(Z);J1=n5(W)}catch(Z){}return J1},aJ=()=>{if(J1!==void 0)return J1;J1=null;try{let Z=I3(f5),W=m5(Z);J1=n5(W)}catch(Z){}return J1},r5=async()=>{let Z=null;if(M6()){if(Z=await rJ(),!Z){if(Z=await nJ(),!Z)Z=l5();if(!Z){let W=await u5();Z=p5(W)}}}return Z},a5=()=>{let Z=null;if(M6()){if(Z=aJ(),!Z){if(Z=iJ(),!Z)Z=l5();if(!Z){let W=d5();Z=p5(W)}}}return Z},sJ=async()=>M6()&&await r5()!==R1,oJ=()=>M6()&&a5()!==R1,tJ=async()=>{if(z1!==void 0)return z1;z1=null;try{let W=(await M3(p4)).match(c5);if(W)z1=W[1]}catch(Z){}return z1},eJ=()=>{if(z1!==void 0)return z1;z1=null;try{let W=I3(p4).match(c5);if(W)z1=W[1]}catch(Z){}return z1},s5=()=>{let Z=h5();if(Z.header&&Z.header.glibcVersionRuntime)return Z.header.glibcVersionRuntime;return null},y5=(Z)=>Z.trim().split(/\s+/)[1],o5=(Z)=>{let[W,X,Q]=Z.split(/[\r\n]+/);if(W&&W.includes(R1))return y5(W);if(X&&Q&&X.includes(a1))return y5(Q);return null},ZG=async()=>{let Z=null;if(M6()){if(Z=await tJ(),!Z)Z=s5();if(!Z){let W=await u5();Z=o5(W)}}return Z},WG=()=>{let Z=null;if(M6()){if(Z=eJ(),!Z)Z=s5();if(!Z){let W=d5();Z=o5(W)}}return Z};t5.exports={GLIBC:R1,MUSL:a1,family:r5,familySync:a5,isNonGlibcLinux:sJ,isNonGlibcLinuxSync:oJ,version:ZG,versionSync:WG}});var I6=i((g$,e5)=>{var XG=Number.MAX_SAFE_INTEGER||9007199254740991,QG=["major","premajor","minor","preminor","patch","prepatch","prerelease"];e5.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:XG,RELEASE_TYPES:QG,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var a6=i((h$,ZZ)=>{var JG=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...Z)=>console.error("SEMVER",...Z):()=>{};ZZ.exports=JG});var w6=i((Y1,WZ)=>{var{MAX_SAFE_COMPONENT_LENGTH:w3,MAX_SAFE_BUILD_LENGTH:GG,MAX_LENGTH:zG}=I6(),YG=a6();Y1=WZ.exports={};var UG=Y1.re=[],qG=Y1.safeRe=[],y=Y1.src=[],KG=Y1.safeSrc=[],g=Y1.t={},VG=0,N3="[a-zA-Z0-9-]",BG=[["\\s",1],["\\d",zG],[N3,GG]],HG=(Z)=>{for(let[W,X]of BG)Z=Z.split(`${W}*`).join(`${W}{0,${X}}`).split(`${W}+`).join(`${W}{1,${X}}`);return Z},a=(Z,W,X)=>{let Q=HG(W),J=VG++;YG(Z,J,W),g[Z]=J,y[J]=W,KG[J]=Q,UG[J]=new RegExp(W,X?"g":void 0),qG[J]=new RegExp(Q,X?"g":void 0)};a("NUMERICIDENTIFIER","0|[1-9]\\d*");a("NUMERICIDENTIFIERLOOSE","\\d+");a("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${N3}*`);a("MAINVERSION",`(${y[g.NUMERICIDENTIFIER]})\\.(${y[g.NUMERICIDENTIFIER]})\\.(${y[g.NUMERICIDENTIFIER]})`);a("MAINVERSIONLOOSE",`(${y[g.NUMERICIDENTIFIERLOOSE]})\\.(${y[g.NUMERICIDENTIFIERLOOSE]})\\.(${y[g.NUMERICIDENTIFIERLOOSE]})`);a("PRERELEASEIDENTIFIER",`(?:${y[g.NONNUMERICIDENTIFIER]}|${y[g.NUMERICIDENTIFIER]})`);a("PRERELEASEIDENTIFIERLOOSE",`(?:${y[g.NONNUMERICIDENTIFIER]}|${y[g.NUMERICIDENTIFIERLOOSE]})`);a("PRERELEASE",`(?:-(${y[g.PRERELEASEIDENTIFIER]}(?:\\.${y[g.PRERELEASEIDENTIFIER]})*))`);a("PRERELEASELOOSE",`(?:-?(${y[g.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${y[g.PRERELEASEIDENTIFIERLOOSE]})*))`);a("BUILDIDENTIFIER",`${N3}+`);a("BUILD",`(?:\\+(${y[g.BUILDIDENTIFIER]}(?:\\.${y[g.BUILDIDENTIFIER]})*))`);a("FULLPLAIN",`v?${y[g.MAINVERSION]}${y[g.PRERELEASE]}?${y[g.BUILD]}?`);a("FULL",`^${y[g.FULLPLAIN]}$`);a("LOOSEPLAIN",`[v=\\s]*${y[g.MAINVERSIONLOOSE]}${y[g.PRERELEASELOOSE]}?${y[g.BUILD]}?`);a("LOOSE",`^${y[g.LOOSEPLAIN]}$`);a("GTLT","((?:<|>)?=?)");a("XRANGEIDENTIFIERLOOSE",`${y[g.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);a("XRANGEIDENTIFIER",`${y[g.NUMERICIDENTIFIER]}|x|X|\\*`);a("XRANGEPLAIN",`[v=\\s]*(${y[g.XRANGEIDENTIFIER]})(?:\\.(${y[g.XRANGEIDENTIFIER]})(?:\\.(${y[g.XRANGEIDENTIFIER]})(?:${y[g.PRERELEASE]})?${y[g.BUILD]}?)?)?`);a("XRANGEPLAINLOOSE",`[v=\\s]*(${y[g.XRANGEIDENTIFIERLOOSE]})(?:\\.(${y[g.XRANGEIDENTIFIERLOOSE]})(?:\\.(${y[g.XRANGEIDENTIFIERLOOSE]})(?:${y[g.PRERELEASELOOSE]})?${y[g.BUILD]}?)?)?`);a("XRANGE",`^${y[g.GTLT]}\\s*${y[g.XRANGEPLAIN]}$`);a("XRANGELOOSE",`^${y[g.GTLT]}\\s*${y[g.XRANGEPLAINLOOSE]}$`);a("COERCEPLAIN",`(^|[^\\d])(\\d{1,${w3}})(?:\\.(\\d{1,${w3}}))?(?:\\.(\\d{1,${w3}}))?`);a("COERCE",`${y[g.COERCEPLAIN]}(?:$|[^\\d])`);a("COERCEFULL",y[g.COERCEPLAIN]+`(?:${y[g.PRERELEASE]})?(?:${y[g.BUILD]})?(?:$|[^\\d])`);a("COERCERTL",y[g.COERCE],!0);a("COERCERTLFULL",y[g.COERCEFULL],!0);a("LONETILDE","(?:~>?)");a("TILDETRIM",`(\\s*)${y[g.LONETILDE]}\\s+`,!0);Y1.tildeTrimReplace="$1~";a("TILDE",`^${y[g.LONETILDE]}${y[g.XRANGEPLAIN]}$`);a("TILDELOOSE",`^${y[g.LONETILDE]}${y[g.XRANGEPLAINLOOSE]}$`);a("LONECARET","(?:\\^)");a("CARETTRIM",`(\\s*)${y[g.LONECARET]}\\s+`,!0);Y1.caretTrimReplace="$1^";a("CARET",`^${y[g.LONECARET]}${y[g.XRANGEPLAIN]}$`);a("CARETLOOSE",`^${y[g.LONECARET]}${y[g.XRANGEPLAINLOOSE]}$`);a("COMPARATORLOOSE",`^${y[g.GTLT]}\\s*(${y[g.LOOSEPLAIN]})$|^$`);a("COMPARATOR",`^${y[g.GTLT]}\\s*(${y[g.FULLPLAIN]})$|^$`);a("COMPARATORTRIM",`(\\s*)${y[g.GTLT]}\\s*(${y[g.LOOSEPLAIN]}|${y[g.XRANGEPLAIN]})`,!0);Y1.comparatorTrimReplace="$1$2$3";a("HYPHENRANGE",`^\\s*(${y[g.XRANGEPLAIN]})\\s+-\\s+(${y[g.XRANGEPLAIN]})\\s*$`);a("HYPHENRANGELOOSE",`^\\s*(${y[g.XRANGEPLAINLOOSE]})\\s+-\\s+(${y[g.XRANGEPLAINLOOSE]})\\s*$`);a("STAR","(<|>)?=?\\s*\\*");a("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");a("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var i4=i((f$,XZ)=>{var $G=Object.freeze({loose:!0}),FG=Object.freeze({}),LG=(Z)=>{if(!Z)return FG;if(typeof Z!=="object")return $G;return Z};XZ.exports=LG});var D3=i((m$,GZ)=>{var QZ=/^[0-9]+$/,JZ=(Z,W)=>{if(typeof Z==="number"&&typeof W==="number")return Z===W?0:Z<W?-1:1;let X=QZ.test(Z),Q=QZ.test(W);if(X&&Q)Z=+Z,W=+W;return Z===W?0:X&&!Q?-1:Q&&!X?1:Z<W?-1:1},AG=(Z,W)=>JZ(W,Z);GZ.exports={compareIdentifiers:JZ,rcompareIdentifiers:AG}});var P0=i((u$,YZ)=>{var r4=a6(),{MAX_LENGTH:zZ,MAX_SAFE_INTEGER:a4}=I6(),{safeRe:s4,t:o4}=w6(),MG=i4(),{compareIdentifiers:T3}=D3(),IG=(Z,W)=>{let X=W.split(".");if(X.length>Z.length)return!1;for(let Q=0;Q<X.length;Q++)if(T3(Z[Q],X[Q])!==0)return!1;return!0};class t0{constructor(Z,W){if(W=MG(W),Z instanceof t0)if(Z.loose===!!W.loose&&Z.includePrerelease===!!W.includePrerelease)return Z;else Z=Z.version;else if(typeof Z!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof Z}".`);if(Z.length>zZ)throw TypeError(`version is longer than ${zZ} characters`);r4("SemVer",Z,W),this.options=W,this.loose=!!W.loose,this.includePrerelease=!!W.includePrerelease;let X=Z.trim().match(W.loose?s4[o4.LOOSE]:s4[o4.FULL]);if(!X)throw TypeError(`Invalid Version: ${Z}`);if(this.raw=Z,this.major=+X[1],this.minor=+X[2],this.patch=+X[3],this.major>a4||this.major<0)throw TypeError("Invalid major version");if(this.minor>a4||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>a4||this.patch<0)throw TypeError("Invalid patch version");if(!X[4])this.prerelease=[];else this.prerelease=X[4].split(".").map((Q)=>{if(/^[0-9]+$/.test(Q)){let J=+Q;if(J>=0&&J<a4)return J}return Q});this.build=X[5]?X[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(Z){if(r4("SemVer.compare",this.version,this.options,Z),!(Z instanceof t0)){if(typeof Z==="string"&&Z===this.version)return 0;Z=new t0(Z,this.options)}if(Z.version===this.version)return 0;return this.compareMain(Z)||this.comparePre(Z)}compareMain(Z){if(!(Z instanceof t0))Z=new t0(Z,this.options);if(this.major<Z.major)return-1;if(this.major>Z.major)return 1;if(this.minor<Z.minor)return-1;if(this.minor>Z.minor)return 1;if(this.patch<Z.patch)return-1;if(this.patch>Z.patch)return 1;return 0}comparePre(Z){if(!(Z instanceof t0))Z=new t0(Z,this.options);if(this.prerelease.length&&!Z.prerelease.length)return-1;else if(!this.prerelease.length&&Z.prerelease.length)return 1;else if(!this.prerelease.length&&!Z.prerelease.length)return 0;let W=0;do{let X=this.prerelease[W],Q=Z.prerelease[W];if(r4("prerelease compare",W,X,Q),X===void 0&&Q===void 0)return 0;else if(Q===void 0)return 1;else if(X===void 0)return-1;else if(X===Q)continue;else return T3(X,Q)}while(++W)}compareBuild(Z){if(!(Z instanceof t0))Z=new t0(Z,this.options);let W=0;do{let X=this.build[W],Q=Z.build[W];if(r4("build compare",W,X,Q),X===void 0&&Q===void 0)return 0;else if(Q===void 0)return 1;else if(X===void 0)return-1;else if(X===Q)continue;else return T3(X,Q)}while(++W)}inc(Z,W,X){if(Z.startsWith("pre")){if(!W&&X===!1)throw Error("invalid increment argument: identifier is empty");if(W){let Q=`-${W}`.match(this.options.loose?s4[o4.PRERELEASELOOSE]:s4[o4.PRERELEASE]);if(!Q||Q[1]!==W)throw Error(`invalid identifier: ${W}`)}}switch(Z){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",W,X);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",W,X);break;case"prepatch":this.prerelease.length=0,this.inc("patch",W,X),this.inc("pre",W,X);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",W,X);this.inc("pre",W,X);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let Q=Number(X)?1:0;if(this.prerelease.length===0)this.prerelease=[Q];else{let J=this.prerelease.length;while(--J>=0)if(typeof this.prerelease[J]==="number")this.prerelease[J]++,J=-2;if(J===-1){if(W===this.prerelease.join(".")&&X===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(Q)}}if(W){let J=[W,Q];if(X===!1)J=[W];if(IG(this.prerelease,W)){let G=this.prerelease[W.split(".").length];if(isNaN(G))this.prerelease=J}else this.prerelease=J}break}default:throw Error(`invalid increment argument: ${Z}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}YZ.exports=t0});var g1=i((d$,qZ)=>{var UZ=P0(),wG=(Z,W,X=!1)=>{if(Z instanceof UZ)return Z;try{return new UZ(Z,W)}catch(Q){if(!X)return null;throw Q}};qZ.exports=wG});var VZ=i((c$,KZ)=>{var NG=g1(),DG=(Z,W)=>{let X=NG(Z,W);return X?X.version:null};KZ.exports=DG});var HZ=i((l$,BZ)=>{var TG=g1(),RG=(Z,W)=>{let X=TG(Z.trim().replace(/^[=v]+/,""),W);return X?X.version:null};BZ.exports=RG});var LZ=i((p$,FZ)=>{var $Z=P0(),PG=(Z,W,X,Q,J)=>{if(typeof X==="string")J=Q,Q=X,X=void 0;try{return new $Z(Z instanceof $Z?Z.version:Z,X).inc(W,Q,J).version}catch(G){return null}};FZ.exports=PG});var IZ=i((n$,MZ)=>{var AZ=g1(),_G=(Z,W)=>{let X=AZ(Z,null,!0),Q=AZ(W,null,!0),J=X.compare(Q);if(J===0)return null;let G=J>0,z=G?X:Q,q=G?Q:X,K=!!z.prerelease.length;if(!!q.prerelease.length&&!K){if(!q.patch&&!q.minor)return"major";if(q.compareMain(z)===0){if(q.minor&&!q.patch)return"minor";return"patch"}}let H=K?"pre":"";if(X.major!==Q.major)return H+"major";if(X.minor!==Q.minor)return H+"minor";if(X.patch!==Q.patch)return H+"patch";return"prerelease"};MZ.exports=_G});var NZ=i((i$,wZ)=>{var jG=P0(),EG=(Z,W)=>new jG(Z,W).major;wZ.exports=EG});var TZ=i((r$,DZ)=>{var CG=P0(),OG=(Z,W)=>new CG(Z,W).minor;DZ.exports=OG});var PZ=i((a$,RZ)=>{var xG=P0(),kG=(Z,W)=>new xG(Z,W).patch;RZ.exports=kG});var jZ=i((s$,_Z)=>{var SG=g1(),bG=(Z,W)=>{let X=SG(Z,W);return X&&X.prerelease.length?X.prerelease:null};_Z.exports=bG});var n0=i((o$,CZ)=>{var EZ=P0(),vG=(Z,W,X)=>new EZ(Z,X).compare(new EZ(W,X));CZ.exports=vG});var xZ=i((t$,OZ)=>{var yG=n0(),gG=(Z,W,X)=>yG(W,Z,X);OZ.exports=gG});var SZ=i((e$,kZ)=>{var hG=n0(),fG=(Z,W)=>hG(Z,W,!0);kZ.exports=fG});var t4=i((ZF,vZ)=>{var bZ=P0(),mG=(Z,W,X)=>{let Q=new bZ(Z,X),J=new bZ(W,X);return Q.compare(J)||Q.compareBuild(J)};vZ.exports=mG});var gZ=i((WF,yZ)=>{var uG=t4(),dG=(Z,W)=>Z.sort((X,Q)=>uG(X,Q,W));yZ.exports=dG});var fZ=i((XF,hZ)=>{var cG=t4(),lG=(Z,W)=>Z.sort((X,Q)=>cG(Q,X,W));hZ.exports=lG});var s6=i((QF,mZ)=>{var pG=n0(),nG=(Z,W,X)=>pG(Z,W,X)>0;mZ.exports=nG});var e4=i((JF,uZ)=>{var iG=n0(),rG=(Z,W,X)=>iG(Z,W,X)<0;uZ.exports=rG});var R3=i((GF,dZ)=>{var aG=n0(),sG=(Z,W,X)=>aG(Z,W,X)===0;dZ.exports=sG});var P3=i((zF,cZ)=>{var oG=n0(),tG=(Z,W,X)=>oG(Z,W,X)!==0;cZ.exports=tG});var Z2=i((YF,lZ)=>{var eG=n0(),Zz=(Z,W,X)=>eG(Z,W,X)>=0;lZ.exports=Zz});var W2=i((UF,pZ)=>{var Wz=n0(),Xz=(Z,W,X)=>Wz(Z,W,X)<=0;pZ.exports=Xz});var _3=i((qF,nZ)=>{var Qz=R3(),Jz=P3(),Gz=s6(),zz=Z2(),Yz=e4(),Uz=W2(),qz=(Z,W,X,Q)=>{switch(W){case"===":if(typeof Z==="object")Z=Z.version;if(typeof X==="object")X=X.version;return Z===X;case"!==":if(typeof Z==="object")Z=Z.version;if(typeof X==="object")X=X.version;return Z!==X;case"":case"=":case"==":return Qz(Z,X,Q);case"!=":return Jz(Z,X,Q);case">":return Gz(Z,X,Q);case">=":return zz(Z,X,Q);case"<":return Yz(Z,X,Q);case"<=":return Uz(Z,X,Q);default:throw TypeError(`Invalid operator: ${W}`)}};nZ.exports=qz});var rZ=i((KF,iZ)=>{var Kz=P0(),Vz=g1(),{safeRe:X2,t:Q2}=w6(),Bz=(Z,W)=>{if(Z instanceof Kz)return Z;if(typeof Z==="number")Z=String(Z);if(typeof Z!=="string")return null;W=W||{};let X=null;if(!W.rtl)X=Z.match(W.includePrerelease?X2[Q2.COERCEFULL]:X2[Q2.COERCE]);else{let K=W.includePrerelease?X2[Q2.COERCERTLFULL]:X2[Q2.COERCERTL],V;while((V=K.exec(Z))&&(!X||X.index+X[0].length!==Z.length)){if(!X||V.index+V[0].length!==X.index+X[0].length)X=V;K.lastIndex=V.index+V[1].length+V[2].length}K.lastIndex=-1}if(X===null)return null;let Q=X[2],J=X[3]||"0",G=X[4]||"0",z=W.includePrerelease&&X[5]?`-${X[5]}`:"",q=W.includePrerelease&&X[6]?`+${X[6]}`:"";return Vz(`${Q}.${J}.${G}${z}${q}`,W)};iZ.exports=Bz});var sZ=i((VF,aZ)=>{var Hz=g1(),$z=I6(),Fz=P0(),Lz=(Z,W,X)=>{if(!$z.RELEASE_TYPES.includes(W))return null;let Q=Az(Z,X);return Q&&Mz(Q,W)},Az=(Z,W)=>{let X=Z instanceof Fz?Z.version:Z;return Hz(X,W)},Mz=(Z,W)=>{if(Iz(W))return Z.version;switch(Z.prerelease=[],W){case"major":Z.minor=0,Z.patch=0;break;case"minor":Z.patch=0;break}return Z.format()},Iz=(Z)=>{return Z.startsWith("pre")};aZ.exports=Lz});var eZ=i((BF,tZ)=>{class oZ{constructor(){this.max=1000,this.map=new Map}get(Z){let W=this.map.get(Z);if(W===void 0)return;else return this.map.delete(Z),this.map.set(Z,W),W}delete(Z){return this.map.delete(Z)}set(Z,W){if(!this.delete(Z)&&W!==void 0){if(this.map.size>=this.max){let Q=this.map.keys().next().value;this.delete(Q)}this.map.set(Z,W)}return this}}tZ.exports=oZ});var i0=i((HF,Q7)=>{var wz=/\s+/g;class o6{constructor(Z,W){if(W=Dz(W),Z instanceof o6)if(Z.loose===!!W.loose&&Z.includePrerelease===!!W.includePrerelease)return Z;else return new o6(Z.raw,W);if(Z instanceof j3)return this.raw=Z.value,this.set=[[Z]],this.formatted=void 0,this;if(this.options=W,this.loose=!!W.loose,this.includePrerelease=!!W.includePrerelease,this.raw=Z.trim().replace(wz," "),this.set=this.raw.split("||").map((X)=>this.parseRange(X.trim())).filter((X)=>X.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let X=this.set[0];if(this.set=this.set.filter((Q)=>!W7(Q[0])),this.set.length===0)this.set=[X];else if(this.set.length>1){for(let Q of this.set)if(Q.length===1&&xz(Q[0])){this.set=[Q];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let Z=0;Z<this.set.length;Z++){if(Z>0)this.formatted+="||";let W=this.set[Z];for(let X=0;X<W.length;X++){if(X>0)this.formatted+=" ";this.formatted+=W[X].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(Z){Z=Z.replace(Oz,"");let X=((this.options.includePrerelease&&Ez)|(this.options.loose&&Cz))+":"+Z,Q=Z7.get(X);if(Q)return Q;let J=this.options.loose,G=J?x0[_0.HYPHENRANGELOOSE]:x0[_0.HYPHENRANGE];Z=Z.replace(G,dz(this.options.includePrerelease)),z0("hyphen replace",Z),Z=Z.replace(x0[_0.COMPARATORTRIM],Pz),z0("comparator trim",Z),Z=Z.replace(x0[_0.TILDETRIM],_z),z0("tilde trim",Z),Z=Z.replace(x0[_0.CARETTRIM],jz),z0("caret trim",Z);let z=Z.split(" ").map((H)=>kz(H,this.options)).join(" ").split(/\s+/).map((H)=>uz(H,this.options));if(J)z=z.filter((H)=>{return z0("loose invalid filter",H,this.options),!!H.match(x0[_0.COMPARATORLOOSE])});z0("range list",z);let q=new Map,K=z.map((H)=>new j3(H,this.options));for(let H of K){if(W7(H))return[H];q.set(H.value,H)}if(q.size>1&&q.has(""))q.delete("");let V=[...q.values()];return Z7.set(X,V),V}intersects(Z,W){if(!(Z instanceof o6))throw TypeError("a Range is required");return this.set.some((X)=>{return X7(X,W)&&Z.set.some((Q)=>{return X7(Q,W)&&X.every((J)=>{return Q.every((G)=>{return J.intersects(G,W)})})})})}test(Z){if(!Z)return!1;if(typeof Z==="string")try{Z=new Tz(Z,this.options)}catch(W){return!1}for(let W=0;W<this.set.length;W++)if(cz(this.set[W],Z,this.options))return!0;return!1}}Q7.exports=o6;var Nz=eZ(),Z7=new Nz,Dz=i4(),j3=t6(),z0=a6(),Tz=P0(),{safeRe:x0,src:Rz,t:_0,comparatorTrimReplace:Pz,tildeTrimReplace:_z,caretTrimReplace:jz}=w6(),{FLAG_INCLUDE_PRERELEASE:Ez,FLAG_LOOSE:Cz}=I6(),Oz=new RegExp(Rz[_0.BUILD],"g"),W7=(Z)=>Z.value==="<0.0.0-0",xz=(Z)=>Z.value==="",X7=(Z,W)=>{let X=!0,Q=Z.slice(),J=Q.pop();while(X&&Q.length)X=Q.every((G)=>{return J.intersects(G,W)}),J=Q.pop();return X},kz=(Z,W)=>{return Z=Z.replace(x0[_0.BUILD],""),z0("comp",Z,W),Z=yz(Z,W),z0("caret",Z),Z=bz(Z,W),z0("tildes",Z),Z=hz(Z,W),z0("xrange",Z),Z=mz(Z,W),z0("stars",Z),Z},M0=(Z)=>!Z||Z.toLowerCase()==="x"||Z==="*",Sz=(Z,W,X)=>M0(Z)&&!M0(W)||M0(W)&&X&&!M0(X),bz=(Z,W)=>{return Z.trim().split(/\s+/).map((X)=>vz(X,W)).join(" ")},vz=(Z,W)=>{let X=W.loose?x0[_0.TILDELOOSE]:x0[_0.TILDE];return Z.replace(X,(Q,J,G,z,q)=>{z0("tilde",Z,Q,J,G,z,q);let K;if(M0(J))K="";else if(M0(G))K=`>=${J}.0.0 <${+J+1}.0.0-0`;else if(M0(z))K=`>=${J}.${G}.0 <${J}.${+G+1}.0-0`;else if(q)z0("replaceTilde pr",q),K=`>=${J}.${G}.${z}-${q} <${J}.${+G+1}.0-0`;else K=`>=${J}.${G}.${z} <${J}.${+G+1}.0-0`;return z0("tilde return",K),K})},yz=(Z,W)=>{return Z.trim().split(/\s+/).map((X)=>gz(X,W)).join(" ")},gz=(Z,W)=>{z0("caret",Z,W);let X=W.loose?x0[_0.CARETLOOSE]:x0[_0.CARET],Q=W.includePrerelease?"-0":"";return Z.replace(X,(J,G,z,q,K)=>{z0("caret",Z,J,G,z,q,K);let V;if(M0(G))V="";else if(M0(z))V=`>=${G}.0.0${Q} <${+G+1}.0.0-0`;else if(M0(q))if(G==="0")V=`>=${G}.${z}.0${Q} <${G}.${+z+1}.0-0`;else V=`>=${G}.${z}.0${Q} <${+G+1}.0.0-0`;else if(K)if(z0("replaceCaret pr",K),G==="0")if(z==="0")V=`>=${G}.${z}.${q}-${K} <${G}.${z}.${+q+1}-0`;else V=`>=${G}.${z}.${q}-${K} <${G}.${+z+1}.0-0`;else V=`>=${G}.${z}.${q}-${K} <${+G+1}.0.0-0`;else if(z0("no pr"),G==="0")if(z==="0")V=`>=${G}.${z}.${q} <${G}.${z}.${+q+1}-0`;else V=`>=${G}.${z}.${q} <${G}.${+z+1}.0-0`;else V=`>=${G}.${z}.${q} <${+G+1}.0.0-0`;return z0("caret return",V),V})},hz=(Z,W)=>{return z0("replaceXRanges",Z,W),Z.split(/\s+/).map((X)=>fz(X,W)).join(" ")},fz=(Z,W)=>{Z=Z.trim();let X=W.loose?x0[_0.XRANGELOOSE]:x0[_0.XRANGE];return Z.replace(X,(Q,J,G,z,q,K)=>{if(z0("xRange",Z,Q,J,G,z,q,K),Sz(G,z,q))return Z;let V=M0(G),H=V||M0(z),B=H||M0(q),$=B;if(J==="="&&$)J="";if(K=W.includePrerelease?"-0":"",V)if(J===">"||J==="<")Q="<0.0.0-0";else Q="*";else if(J&&$){if(H)z=0;if(q=0,J===">")if(J=">=",H)G=+G+1,z=0,q=0;else z=+z+1,q=0;else if(J==="<=")if(J="<",H)G=+G+1;else z=+z+1;if(J==="<")K="-0";Q=`${J+G}.${z}.${q}${K}`}else if(H)Q=`>=${G}.0.0${K} <${+G+1}.0.0-0`;else if(B)Q=`>=${G}.${z}.0${K} <${G}.${+z+1}.0-0`;return z0("xRange return",Q),Q})},mz=(Z,W)=>{return z0("replaceStars",Z,W),Z.trim().replace(x0[_0.STAR],"")},uz=(Z,W)=>{return z0("replaceGTE0",Z,W),Z.trim().replace(x0[W.includePrerelease?_0.GTE0PRE:_0.GTE0],"")},dz=(Z)=>(W,X,Q,J,G,z,q,K,V,H,B,$)=>{if(M0(Q))X="";else if(M0(J))X=`>=${Q}.0.0${Z?"-0":""}`;else if(M0(G))X=`>=${Q}.${J}.0${Z?"-0":""}`;else if(z)X=`>=${X}`;else X=`>=${X}${Z?"-0":""}`;if(M0(V))K="";else if(M0(H))K=`<${+V+1}.0.0-0`;else if(M0(B))K=`<${V}.${+H+1}.0-0`;else if($)K=`<=${V}.${H}.${B}-${$}`;else if(Z)K=`<${V}.${H}.${+B+1}-0`;else K=`<=${K}`;return`${X} ${K}`.trim()},cz=(Z,W,X)=>{for(let Q=0;Q<Z.length;Q++)if(!Z[Q].test(W))return!1;if(W.prerelease.length&&!X.includePrerelease){for(let Q=0;Q<Z.length;Q++){if(z0(Z[Q].semver),Z[Q].semver===j3.ANY)continue;if(Z[Q].semver.prerelease.length>0){let J=Z[Q].semver;if(J.major===W.major&&J.minor===W.minor&&J.patch===W.patch)return!0}}return!1}return!0}});var t6=i(($F,q7)=>{var e6=Symbol("SemVer ANY");class J2{static get ANY(){return e6}constructor(Z,W){if(W=J7(W),Z instanceof J2)if(Z.loose===!!W.loose)return Z;else Z=Z.value;if(Z=Z.trim().split(/\s+/).join(" "),C3("comparator",Z,W),this.options=W,this.loose=!!W.loose,this.parse(Z),this.semver===e6)this.value="";else this.value=this.operator+this.semver.version;C3("comp",this)}parse(Z){let W=this.options.loose?G7[z7.COMPARATORLOOSE]:G7[z7.COMPARATOR],X=Z.match(W);if(!X)throw TypeError(`Invalid comparator: ${Z}`);if(this.operator=X[1]!==void 0?X[1]:"",this.operator==="=")this.operator="";if(!X[2])this.semver=e6;else this.semver=new Y7(X[2],this.options.loose)}toString(){return this.value}test(Z){if(C3("Comparator.test",Z,this.options.loose),this.semver===e6||Z===e6)return!0;if(typeof Z==="string")try{Z=new Y7(Z,this.options)}catch(W){return!1}return E3(Z,this.operator,this.semver,this.options)}intersects(Z,W){if(!(Z instanceof J2))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new U7(Z.value,W).test(this.value)}else if(Z.operator===""){if(Z.value==="")return!0;return new U7(this.value,W).test(Z.semver)}if(W=J7(W),W.includePrerelease&&(this.value==="<0.0.0-0"||Z.value==="<0.0.0-0"))return!1;if(!W.includePrerelease&&(this.value.startsWith("<0.0.0")||Z.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&Z.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&Z.operator.startsWith("<"))return!0;if(this.semver.version===Z.semver.version&&this.operator.includes("=")&&Z.operator.includes("="))return!0;if(E3(this.semver,"<",Z.semver,W)&&this.operator.startsWith(">")&&Z.operator.startsWith("<"))return!0;if(E3(this.semver,">",Z.semver,W)&&this.operator.startsWith("<")&&Z.operator.startsWith(">"))return!0;return!1}}q7.exports=J2;var J7=i4(),{safeRe:G7,t:z7}=w6(),E3=_3(),C3=a6(),Y7=P0(),U7=i0()});var Z4=i((FF,K7)=>{var lz=i0(),pz=(Z,W,X)=>{try{W=new lz(W,X)}catch(Q){return!1}return W.test(Z)};K7.exports=pz});var B7=i((LF,V7)=>{var nz=i0(),iz=(Z,W)=>new nz(Z,W).set.map((X)=>X.map((Q)=>Q.value).join(" ").trim().split(" "));V7.exports=iz});var $7=i((AF,H7)=>{var rz=P0(),az=i0(),sz=(Z,W,X)=>{let Q=null,J=null,G=null;try{G=new az(W,X)}catch(z){return null}return Z.forEach((z)=>{if(G.test(z)){if(!Q||J.compare(z)===-1)Q=z,J=new rz(Q,X)}}),Q};H7.exports=sz});var L7=i((MF,F7)=>{var oz=P0(),tz=i0(),ez=(Z,W,X)=>{let Q=null,J=null,G=null;try{G=new tz(W,X)}catch(z){return null}return Z.forEach((z)=>{if(G.test(z)){if(!Q||J.compare(z)===1)Q=z,J=new oz(Q,X)}}),Q};F7.exports=ez});var I7=i((IF,M7)=>{var O3=P0(),ZY=i0(),A7=s6(),WY=(Z,W)=>{Z=new ZY(Z,W);let X=new O3("0.0.0");if(Z.test(X))return X;if(X=new O3("0.0.0-0"),Z.test(X))return X;X=null;for(let Q=0;Q<Z.set.length;++Q){let J=Z.set[Q],G=null;if(J.forEach((z)=>{let q=new O3(z.semver.version);switch(z.operator){case">":if(q.prerelease.length===0)q.patch++;else q.prerelease.push(0);q.raw=q.format();case"":case">=":if(!G||A7(q,G))G=q;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${z.operator}`)}}),G&&(!X||A7(X,G)))X=G}if(X&&Z.test(X))return X;return null};M7.exports=WY});var N7=i((wF,w7)=>{var XY=i0(),QY=(Z,W)=>{try{return new XY(Z,W).range||"*"}catch(X){return null}};w7.exports=QY});var G2=i((NF,P7)=>{var JY=P0(),R7=t6(),{ANY:GY}=R7,zY=i0(),YY=Z4(),D7=s6(),T7=e4(),UY=W2(),qY=Z2(),KY=(Z,W,X,Q)=>{Z=new JY(Z,Q),W=new zY(W,Q);let J,G,z,q,K;switch(X){case">":J=D7,G=UY,z=T7,q=">",K=">=";break;case"<":J=T7,G=qY,z=D7,q="<",K="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(YY(Z,W,Q))return!1;for(let V=0;V<W.set.length;++V){let H=W.set[V],B=null,$=null;if(H.forEach((L)=>{if(L.semver===GY)L=new R7(">=0.0.0");if(B=B||L,$=$||L,J(L.semver,B.semver,Q))B=L;else if(z(L.semver,$.semver,Q))$=L}),B.operator===q||B.operator===K)return!1;if((!$.operator||$.operator===q)&&G(Z,$.semver))return!1;else if($.operator===K&&z(Z,$.semver))return!1}return!0};P7.exports=KY});var j7=i((DF,_7)=>{var VY=G2(),BY=(Z,W,X)=>VY(Z,W,">",X);_7.exports=BY});var C7=i((TF,E7)=>{var HY=G2(),$Y=(Z,W,X)=>HY(Z,W,"<",X);E7.exports=$Y});var k7=i((RF,x7)=>{var O7=i0(),FY=(Z,W,X)=>{return Z=new O7(Z,X),W=new O7(W,X),Z.intersects(W,X)};x7.exports=FY});var b7=i((PF,S7)=>{var LY=Z4(),AY=n0();S7.exports=(Z,W,X)=>{let Q=[],J=null,G=null,z=Z.sort((H,B)=>AY(H,B,X));for(let H of z)if(LY(H,W,X)){if(G=H,!J)J=H}else{if(G)Q.push([J,G]);G=null,J=null}if(J)Q.push([J,null]);let q=[];for(let[H,B]of Q)if(H===B)q.push(H);else if(!B&&H===z[0])q.push("*");else if(!B)q.push(`>=${H}`);else if(H===z[0])q.push(`<=${B}`);else q.push(`${H} - ${B}`);let K=q.join(" || "),V=typeof W.raw==="string"?W.raw:String(W);return K.length<V.length?K:W}});var m7=i((_F,f7)=>{var v7=i0(),S3=t6(),{ANY:x3}=S3,k3=Z4(),b3=n0(),MY=(Z,W,X={})=>{if(Z===W)return!0;Z=new v7(Z,X),W=new v7(W,X);let Q=!1;Z:for(let J of Z.set){for(let G of W.set){let z=wY(J,G,X);if(Q=Q||z!==null,z)continue Z}if(Q)return!1}return!0},IY=[new S3(">=0.0.0-0")],y7=[new S3(">=0.0.0")],wY=(Z,W,X)=>{if(Z===W)return!0;if(Z.length===1&&Z[0].semver===x3)if(W.length===1&&W[0].semver===x3)return!0;else if(X.includePrerelease)Z=IY;else Z=y7;if(W.length===1&&W[0].semver===x3)if(X.includePrerelease)return!0;else W=y7;let Q=new Set,J,G;for(let L of Z)if(L.operator===">"||L.operator===">=")J=g7(J,L,X);else if(L.operator==="<"||L.operator==="<=")G=h7(G,L,X);else Q.add(L.semver);if(Q.size>1)return null;let z;if(J&&G){if(z=b3(J.semver,G.semver,X),z>0)return null;else if(z===0&&(J.operator!==">="||G.operator!=="<="))return null}for(let L of Q){if(J&&!k3(L,String(J),X))return null;if(G&&!k3(L,String(G),X))return null;for(let A of W)if(!k3(L,String(A),X))return!1;return!0}let q,K,V,H,B=G&&!X.includePrerelease&&G.semver.prerelease.length?G.semver:!1,$=J&&!X.includePrerelease&&J.semver.prerelease.length?J.semver:!1;if(B&&B.prerelease.length===1&&G.operator==="<"&&B.prerelease[0]===0)B=!1;for(let L of W){if(H=H||L.operator===">"||L.operator===">=",V=V||L.operator==="<"||L.operator==="<=",J){if($){if(L.semver.prerelease&&L.semver.prerelease.length&&L.semver.major===$.major&&L.semver.minor===$.minor&&L.semver.patch===$.patch)$=!1}if(L.operator===">"||L.operator===">="){if(q=g7(J,L,X),q===L&&q!==J)return!1}else if(J.operator===">="&&!L.test(J.semver))return!1}if(G){if(B){if(L.semver.prerelease&&L.semver.prerelease.length&&L.semver.major===B.major&&L.semver.minor===B.minor&&L.semver.patch===B.patch)B=!1}if(L.operator==="<"||L.operator==="<="){if(K=h7(G,L,X),K===L&&K!==G)return!1}else if(G.operator==="<="&&!L.test(G.semver))return!1}if(!L.operator&&(G||J)&&z!==0)return!1}if(J&&V&&!G&&z!==0)return!1;if(G&&H&&!J&&z!==0)return!1;if($||B)return!1;return!0},g7=(Z,W,X)=>{if(!Z)return W;let Q=b3(Z.semver,W.semver,X);return Q>0?Z:Q<0?W:W.operator===">"&&Z.operator===">="?W:Z},h7=(Z,W,X)=>{if(!Z)return W;let Q=b3(Z.semver,W.semver,X);return Q<0?Z:Q>0?W:W.operator==="<"&&Z.operator==="<="?W:Z};f7.exports=MY});var l7=i((jF,c7)=>{var v3=w6(),u7=I6(),NY=P0(),d7=D3(),DY=g1(),TY=VZ(),RY=HZ(),PY=LZ(),_Y=IZ(),jY=NZ(),EY=TZ(),CY=PZ(),OY=jZ(),xY=n0(),kY=xZ(),SY=SZ(),bY=t4(),vY=gZ(),yY=fZ(),gY=s6(),hY=e4(),fY=R3(),mY=P3(),uY=Z2(),dY=W2(),cY=_3(),lY=rZ(),pY=sZ(),nY=t6(),iY=i0(),rY=Z4(),aY=B7(),sY=$7(),oY=L7(),tY=I7(),eY=N7(),ZU=G2(),WU=j7(),XU=C7(),QU=k7(),JU=b7(),GU=m7();c7.exports={parse:DY,valid:TY,clean:RY,inc:PY,diff:_Y,major:jY,minor:EY,patch:CY,prerelease:OY,compare:xY,rcompare:kY,compareLoose:SY,compareBuild:bY,sort:vY,rsort:yY,gt:gY,lt:hY,eq:fY,neq:mY,gte:uY,lte:dY,cmp:cY,coerce:lY,truncate:pY,Comparator:nY,Range:iY,satisfies:rY,toComparators:aY,maxSatisfying:sY,minSatisfying:oY,minVersion:tY,validRange:eY,outside:ZU,gtr:WU,ltr:XU,intersects:QU,simplifyRange:JU,subset:GU,SemVer:NY,re:v3.re,src:v3.src,tokens:v3.t,SEMVER_SPEC_VERSION:u7.SEMVER_SPEC_VERSION,RELEASE_TYPES:u7.RELEASE_TYPES,compareIdentifiers:d7.compareIdentifiers,rcompareIdentifiers:d7.rcompareIdentifiers}});var P1;var z2=d(()=>{P1={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.35.1",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unnebäck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix Bünemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","Jérémy Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kotěšovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouciño <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugué <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <me@rreverser.com>","Don Denton <don@happycollision.com>","Dmytro Tiapukhin <cool.gegeg@gmail.com>","Florian Lefebvre <contact@florian-lefebvre.dev>"],scripts:{build:"node install/build.js","build:dist":"node scripts/build.mjs",clean:"rm -rf src/build/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types && npm run lint-publish","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-publish":"publint --strict","lint-types":"tsd --files ./test/types/sharp.test-d.ts","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./dist/index.d.mts",exports:{".":{import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}}},sideEffects:!0,repository:{type:"git",url:"git+https://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.1.0","detect-libc":"^2.1.2",semver:"^7.8.4"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.1","@img/sharp-darwin-x64":"0.35.1","@img/sharp-freebsd-wasm32":"0.35.1","@img/sharp-libvips-darwin-arm64":"1.3.0","@img/sharp-libvips-darwin-x64":"1.3.0","@img/sharp-libvips-linux-arm":"1.3.0","@img/sharp-libvips-linux-arm64":"1.3.0","@img/sharp-libvips-linux-ppc64":"1.3.0","@img/sharp-libvips-linux-riscv64":"1.3.0","@img/sharp-libvips-linux-s390x":"1.3.0","@img/sharp-libvips-linux-x64":"1.3.0","@img/sharp-libvips-linuxmusl-arm64":"1.3.0","@img/sharp-libvips-linuxmusl-x64":"1.3.0","@img/sharp-linux-arm":"0.35.1","@img/sharp-linux-arm64":"0.35.1","@img/sharp-linux-ppc64":"0.35.1","@img/sharp-linux-riscv64":"0.35.1","@img/sharp-linux-s390x":"0.35.1","@img/sharp-linux-x64":"0.35.1","@img/sharp-linuxmusl-arm64":"0.35.1","@img/sharp-linuxmusl-x64":"0.35.1","@img/sharp-webcontainers-wasm32":"0.35.1","@img/sharp-win32-arm64":"0.35.1","@img/sharp-win32-ia32":"0.35.1","@img/sharp-win32-x64":"0.35.1"},devDependencies:{"@biomejs/biome":"^2.4.16","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.0","@img/sharp-libvips-dev":"1.3.0","@img/sharp-libvips-dev-wasm32":"1.3.0","@img/sharp-libvips-win32-arm64":"1.3.0","@img/sharp-libvips-win32-ia32":"1.3.0","@img/sharp-libvips-win32-x64":"1.3.0","@types/node":"*",emnapi:"^1.11.0","exif-reader":"^2.0.3","extract-zip":"^2.0.1",icc:"^4.0.0","node-addon-api":"^8.8.0","node-gyp":"^12.4.0",publint:"^0.3.21","tar-fs":"^3.1.2",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.3"},funding:{url:"https://opencollective.com/libvips"}}});import{spawnSync as W4}from"node:child_process";import{createHash as YU}from"node:crypto";var X4,g3,UU,n7,qU,h3,KU=(Z)=>{if(Z instanceof Error)console.error(`sharp: Installation error: ${Z.message}`);else console.log(`sharp: ${Z}`)},i7=()=>g3.default.isNonGlibcLinuxSync()?g3.default.familySync():"",VU=()=>`${process.platform}${i7()}-${process.arch}`,N6=()=>{if(r7())return"wasm32";let{npm_config_arch:Z,npm_config_platform:W,npm_config_libc:X}=process.env,Q=typeof X==="string"?X:i7();return`${W||process.platform}${Q}-${Z||process.arch}`},BU=()=>{try{return T0(`@img/sharp-libvips-dev-${N6()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},HU=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},$U=()=>{try{return T0(`@img/sharp-libvips-dev-${N6()}/lib`)}catch{try{return T0(`@img/sharp-libvips-${N6()}/lib`)}catch{}}return""},FU=()=>{if(process.release?.name==="node"&&process.versions){if(!X4.default.satisfies(process.versions.node,P1.engines.node))return{found:process.versions.node,expected:P1.engines.node}}},r7=()=>{let{CC:Z}=process.env;return Boolean(Z?.endsWith("/emcc"))},LU=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(W4("sysctl sysctl.proc_translated",h3).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},p7=(Z)=>YU("sha512").update(Z).digest("hex"),AU=()=>{try{let Z=p7(`imgsharp-libvips-${N6()}`),W=X4.default.coerce(P1.optionalDependencies[`@img/sharp-libvips-${N6()}`],{includePrerelease:!0}).version;return p7(`${Z}npm:${W}`).slice(0,10)}catch{}return""},MU=()=>W4(`node-gyp rebuild --directory=src ${r7()?"--nodedir=emscripten":""}`,{...h3,stdio:"inherit"}).status,a7=()=>{if(process.platform!=="win32")return(W4("pkg-config --modversion vips-cpp",{...h3,env:{...process.env,PKG_CONFIG_PATH:s7()}}).stdout||"").trim();else return""},IU=()=>{try{let Z=(W4("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(Z)return`${Z}/lib/pkgconfig`}catch(Z){}return},wU=()=>{try{let Z=(W4("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(Z)return Z}catch(Z){}return},s7=()=>{if(process.platform!=="win32")return[IU(),wU(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},y3=(Z,W,X)=>{if(X)X(`Detected ${W}, skipping search for globally-installed libvips`);return Z},NU=(Z)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return y3(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",Z);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return y3(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",Z);if(LU())return y3(!1,"Rosetta",Z);let W=a7();return!!W&&X4.default.gte(W,n7)},Y2;var f3=d(()=>{z2();X4=v6(l7(),1),g3=v6(n4(),1);/*!
204
210
  Copyright 2013 Lovell Fuller and others.
205
211
  SPDX-License-Identifier: Apache-2.0
206
- */wK=process.env.npm_package_config_libvips||q6.config.libvips,QX=S4.default.coerce(wK).version,DK=["darwin-arm64","darwin-x64","freebsd-arm64","freebsd-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-wasm32","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],M3={encoding:"utf8",shell:!0},S1={minimumLibvipsVersion:QX,prebuiltPlatforms:DK,buildPlatformArch:q4,buildSharpLibvipsIncludeDir:RK,buildSharpLibvipsCPlusPlusDir:_K,buildSharpLibvipsLibDir:PK,isUnsupportedNodeRuntime:jK,runtimePlatformArch:TK,log:NK,yarnLocator:CK,spawnRebuild:OK,globalLibvipsVersion:GX,pkgConfigPath:YX,useGlobalLibvips:SK}});import{createRequire as bK}from"node:module";var b1,o,KX,vK,UX,yK,gK,$6,u,O6,v;var b4=R(()=>{L3();k1();b1=B4(L1(),1);/*!
212
+ */UU=process.env.npm_package_config_libvips||P1.config.libvips,n7=X4.default.coerce(UU).version,qU=["darwin-arm64","darwin-x64","freebsd-arm64","freebsd-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-wasm32","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],h3={encoding:"utf8",shell:!0},Y2={minimumLibvipsVersion:n7,prebuiltPlatforms:qU,buildPlatformArch:N6,buildSharpLibvipsIncludeDir:BU,buildSharpLibvipsCPlusPlusDir:HU,buildSharpLibvipsLibDir:$U,isUnsupportedNodeRuntime:FU,runtimePlatformArch:VU,log:KU,yarnLocator:AU,spawnRebuild:MU,globalLibvipsVersion:a7,pkgConfigPath:s7,useGlobalLibvips:NU}});import{createRequire as DU}from"node:module";var U2,I0,t7,TU,o7,RU,PU,h1,Y0,s1,Z0;var Q4=d(()=>{f3();z2();U2=v6(n4(),1);/*!
207
213
  Copyright 2013 Lovell Fuller and others.
208
214
  SPDX-License-Identifier: Apache-2.0
209
- */o=bK(import.meta.url),{version:KX}=q6,{runtimePlatformArch:vK,isUnsupportedNodeRuntime:UX,prebuiltPlatforms:yK,minimumLibvipsVersion:gK}=S1,$6=vK(),O6=[];try{u=o(`../src/build/Release/sharp-${$6}-${KX}.node`)}catch(Z){O6.push(Z)}if(!u)try{u=o(`../src/build/Release/sharp-wasm32-${KX}.node`)}catch(Z){O6.push(Z)}if(!u)try{switch($6){case"darwin-arm64":u=o("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":u=o("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":u=o("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":u=o("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":u=o("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":u=o("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":u=o("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":u=o("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":u=o("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":u=o("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":u=o("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":u=o("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":u=o("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":u=o("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":u=o("@img/sharp-webcontainers-wasm32/sharp.node");break;default:u=o("@img/sharp-wasm32/sharp.node");break}if(["linux-x64","linuxmusl-x64"].includes($6)&&!u._isUsingX64V2()){let Z=Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");Z.code="Unsupported CPU",O6.push(Z),u=null}}catch(Z){O6.push(Z)}if(!u){let[Z,X,q]=["linux","darwin","win32"].map((J)=>$6.startsWith(J)),W=[`Could not load the "sharp" module using the ${$6} runtime`];O6.forEach((J)=>{if(!J.code.endsWith("MODULE_NOT_FOUND"))W.push(`${J.code}: ${J.message}`)});let Q=O6.map((J)=>J.message).join(" ");if(W.push("Possible solutions:"),UX()){let{found:J,expected:z}=UX();W.push("- Please upgrade Node.js:",` Found ${J}`,` Requires ${z}`)}else if(yK.includes($6)){let[J,z]=$6.split("-"),Y=J.endsWith("musl")?" --libc=musl":"";W.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${J.replace("musl","")}${Y} --cpu=${z} sharp`)}else W.push(`- Manually install libvips >= ${gK}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if(Z&&/(symbol not found|CXXABI_)/i.test(Q))try{let{config:J}=o(`@img/sharp-libvips-${$6}/package`),z=`${b1.familySync()} ${b1.versionSync()}`,Y=`${J.musl?"musl":"glibc"} ${J.musl||J.glibc}`;W.push("- Update your OS:",` Found ${z}`,` Requires ${Y}`)}catch(J){}if(Z&&/\/snap\/core[0-9]{2}/.test(Q))W.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(X&&/Incompatible library version/.test(Q))W.push("- Update Homebrew:"," brew update && brew upgrade vips");if(O6.some((J)=>J.code==="ERR_DLOPEN_DISABLED"))W.push("- Run Node.js without using the --no-addons flag");if(q&&/The specified procedure could not be found/.test(Q))W.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp");throw W.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),Error(W.join(`
210
- `))}v=u});import hK from"node:util";import I3 from"node:stream";function uK(){let Z=this.constructor.call(),{debuglog:X,queueListener:q,...W}=this.options;if(Z.options=structuredClone(W),Z.options.debuglog=X,Z.options.queueListener=q,this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Z.options.input.buffer=this.options.input.buffer,Z.emit("finish")});return Z}var mK,fK=(Z)=>{x6.queue.emit("change",Z)},x6=function(Z,X){if(arguments.length===1&&!G.defined(Z))throw Error("Invalid input");if(!(this instanceof x6))return new x6(Z,X);return I3.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:0.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:(q)=>{this.emit("warning",q),mK(q)},queueListener:fK},this.options.input=this._createInputDescriptor(Z,X,{allowStream:!0}),this},l0;var VX=R(()=>{m0();b4();/*!
215
+ */I0=DU(import.meta.url),{version:t7}=P1,{runtimePlatformArch:TU,isUnsupportedNodeRuntime:o7,prebuiltPlatforms:RU,minimumLibvipsVersion:PU}=Y2,h1=TU(),s1=[];try{Y0=I0(`../src/build/Release/sharp-${h1}-${t7}.node`)}catch(Z){s1.push(Z)}if(!Y0)try{Y0=I0(`../src/build/Release/sharp-wasm32-${t7}.node`)}catch(Z){s1.push(Z)}if(!Y0)try{switch(h1){case"darwin-arm64":Y0=I0("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":Y0=I0("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":Y0=I0("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":Y0=I0("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":Y0=I0("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":Y0=I0("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":Y0=I0("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":Y0=I0("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":Y0=I0("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":Y0=I0("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":Y0=I0("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":Y0=I0("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":Y0=I0("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":Y0=I0("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":Y0=I0("@img/sharp-webcontainers-wasm32/sharp.node");break;default:Y0=I0("@img/sharp-wasm32/sharp.node");break}if(["linux-x64","linuxmusl-x64"].includes(h1)&&!Y0._isUsingX64V2()){let Z=Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");Z.code="Unsupported CPU",s1.push(Z),Y0=null}}catch(Z){s1.push(Z)}if(!Y0){let[Z,W,X]=["linux","darwin","win32"].map((G)=>h1.startsWith(G)),Q=[`Could not load the "sharp" module using the ${h1} runtime`];s1.forEach((G)=>{if(!G.code.endsWith("MODULE_NOT_FOUND"))Q.push(`${G.code}: ${G.message}`)});let J=s1.map((G)=>G.message).join(" ");if(Q.push("Possible solutions:"),o7()){let{found:G,expected:z}=o7();Q.push("- Please upgrade Node.js:",` Found ${G}`,` Requires ${z}`)}else if(RU.includes(h1)){let[G,z]=h1.split("-"),q=G.endsWith("musl")?" --libc=musl":"";Q.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${G.replace("musl","")}${q} --cpu=${z} sharp`)}else Q.push(`- Manually install libvips >= ${PU}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if(Z&&/(symbol not found|CXXABI_)/i.test(J))try{let{config:G}=I0(`@img/sharp-libvips-${h1}/package`),z=`${U2.familySync()} ${U2.versionSync()}`,q=`${G.musl?"musl":"glibc"} ${G.musl||G.glibc}`;Q.push("- Update your OS:",` Found ${z}`,` Requires ${q}`)}catch(G){}if(Z&&/\/snap\/core[0-9]{2}/.test(J))Q.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(W&&/Incompatible library version/.test(J))Q.push("- Update Homebrew:"," brew update && brew upgrade vips");if(s1.some((G)=>G.code==="ERR_DLOPEN_DISABLED"))Q.push("- Run Node.js without using the --no-addons flag");if(X&&/The specified procedure could not be found/.test(J))Q.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp");throw Q.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),Error(Q.join(`
216
+ `))}Z0=Y0});import _U from"node:util";import m3 from"node:stream";function CU(){let Z=this.constructor.call(),{debuglog:W,queueListener:X,...Q}=this.options;if(Z.options=structuredClone(Q),Z.options.debuglog=W,Z.options.queueListener=X,this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Z.options.input.buffer=this.options.input.buffer,Z.emit("finish")});return Z}var jU,EU=(Z)=>{o1.queue.emit("change",Z)},o1=function(Z,W){if(arguments.length===1&&!Y.defined(Z))throw Error("Invalid input");if(!(this instanceof o1))return new o1(Z,W);return m3.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:0.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:(X)=>{this.emit("warning",X),jU(X)},queueListener:EU},this.options.input=this._createInputDescriptor(Z,W,{allowStream:!0}),this},U1;var e7=d(()=>{Q1();Q4();/*!
211
217
  Copyright 2013 Lovell Fuller and others.
212
218
  SPDX-License-Identifier: Apache-2.0
213
- */mK=hK.debuglog("sharp");Object.setPrototypeOf(x6.prototype,I3.Duplex.prototype);Object.setPrototypeOf(x6,I3.Duplex);Object.assign(x6.prototype,{clone:uK});l0=x6});function BX(Z){let X=cK.filter((q)=>G.defined(Z[q])).map((q)=>[q,Z[q]]);return X.length?Object.fromEntries(X):void 0}function lK(Z,X,q){let W={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(G.string(Z))W.file=Z;else if(G.buffer(Z)){if(Z.length===0)throw Error("Input Buffer is empty");W.buffer=Z}else if(G.arrayBuffer(Z)){if(Z.byteLength===0)throw Error("Input bit Array is empty");W.buffer=Buffer.from(Z,0,Z.byteLength)}else if(G.typedArray(Z)){if(Z.length===0)throw Error("Input Bit Array is empty");W.buffer=Buffer.from(Z.buffer,Z.byteOffset,Z.byteLength)}else if(G.plainObject(Z)&&!G.defined(X)){if(X=Z,BX(X))W.buffer=[]}else if(!G.defined(Z)&&!G.defined(X)&&G.object(q)&&q.allowStream)W.buffer=[];else if(Array.isArray(Z))if(Z.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=Z.map((Q)=>this._createInputDescriptor(Q));else throw Error("Recursive join is unsupported");else throw Error("Expected at least two images to join");else throw Error(`Unsupported input '${Z}' of type ${typeof Z}${G.defined(X)?` when also providing options of type ${typeof X}`:""}`);if(G.object(X)){if(G.defined(X.failOn))if(G.string(X.failOn)&&G.inArray(X.failOn,["none","truncated","error","warning"]))W.failOn=X.failOn;else throw G.invalidParameterError("failOn","one of: none, truncated, error, warning",X.failOn);if(G.defined(X.autoOrient))if(G.bool(X.autoOrient))W.autoOrient=X.autoOrient;else throw G.invalidParameterError("autoOrient","boolean",X.autoOrient);if(G.defined(X.density))if(G.number(X.density)&&G.inRange(X.density,1,1e5))W.density=X.density;else throw G.invalidParameterError("density","number between 1 and 100000",X.density);if(G.defined(X.ignoreIcc))if(G.bool(X.ignoreIcc))W.ignoreIcc=X.ignoreIcc;else throw G.invalidParameterError("ignoreIcc","boolean",X.ignoreIcc);if(G.defined(X.limitInputPixels))if(G.bool(X.limitInputPixels))W.limitInputPixels=X.limitInputPixels?268402689:0;else if(G.integer(X.limitInputPixels)&&G.inRange(X.limitInputPixels,0,Number.MAX_SAFE_INTEGER))W.limitInputPixels=X.limitInputPixels;else throw G.invalidParameterError("limitInputPixels","positive integer",X.limitInputPixels);if(G.defined(X.limitInputChannels))if(G.bool(X.limitInputChannels))W.limitInputChannels=X.limitInputChannels?5:0;else if(G.integer(X.limitInputChannels)&&G.inRange(X.limitInputChannels,0,Number.MAX_SAFE_INTEGER))W.limitInputChannels=X.limitInputChannels;else throw G.invalidParameterError("limitInputChannels","positive integer",X.limitInputChannels);if(G.defined(X.unlimited))if(G.bool(X.unlimited))W.unlimited=X.unlimited;else throw G.invalidParameterError("unlimited","boolean",X.unlimited);if(G.defined(X.sequentialRead))if(G.bool(X.sequentialRead))W.sequentialRead=X.sequentialRead;else throw G.invalidParameterError("sequentialRead","boolean",X.sequentialRead);if(G.defined(X.raw)){if(G.object(X.raw)&&G.integer(X.raw.width)&&X.raw.width>0&&G.integer(X.raw.height)&&X.raw.height>0&&G.integer(X.raw.channels)&&G.inRange(X.raw.channels,1,4))switch(W.rawWidth=X.raw.width,W.rawHeight=X.raw.height,W.rawChannels=X.raw.channels,Z.constructor){case Uint8Array:case Uint8ClampedArray:W.rawDepth="uchar";break;case Int8Array:W.rawDepth="char";break;case Uint16Array:W.rawDepth="ushort";break;case Int16Array:W.rawDepth="short";break;case Uint32Array:W.rawDepth="uint";break;case Int32Array:W.rawDepth="int";break;case Float32Array:W.rawDepth="float";break;case Float64Array:W.rawDepth="double";break;default:W.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(W.rawPremultiplied=!1,G.defined(X.raw.premultiplied))if(G.bool(X.raw.premultiplied))W.rawPremultiplied=X.raw.premultiplied;else throw G.invalidParameterError("raw.premultiplied","boolean",X.raw.premultiplied);if(W.rawPageHeight=0,G.defined(X.raw.pageHeight))if(G.integer(X.raw.pageHeight)&&X.raw.pageHeight>0&&X.raw.pageHeight<=X.raw.height){if(X.raw.height%X.raw.pageHeight!==0)throw Error(`Expected raw.height ${X.raw.height} to be a multiple of raw.pageHeight ${X.raw.pageHeight}`);W.rawPageHeight=X.raw.pageHeight}else throw G.invalidParameterError("raw.pageHeight","positive integer",X.raw.pageHeight)}if(G.defined(X.animated))if(G.bool(X.animated))W.pages=X.animated?-1:1;else throw G.invalidParameterError("animated","boolean",X.animated);if(G.defined(X.pages))if(G.integer(X.pages)&&G.inRange(X.pages,-1,1e5))W.pages=X.pages;else throw G.invalidParameterError("pages","integer between -1 and 100000",X.pages);if(G.defined(X.page))if(G.integer(X.page)&&G.inRange(X.page,0,1e5))W.page=X.page;else throw G.invalidParameterError("page","integer between 0 and 100000",X.page);if(G.object(X.openSlide)&&G.defined(X.openSlide.level))if(G.integer(X.openSlide.level)&&G.inRange(X.openSlide.level,0,256))W.openSlideLevel=X.openSlide.level;else throw G.invalidParameterError("openSlide.level","integer between 0 and 256",X.openSlide.level);else if(G.defined(X.level))if(G.integer(X.level)&&G.inRange(X.level,0,256))W.openSlideLevel=X.level;else throw G.invalidParameterError("level","integer between 0 and 256",X.level);if(G.object(X.tiff)&&G.defined(X.tiff.subifd))if(G.integer(X.tiff.subifd)&&G.inRange(X.tiff.subifd,-1,1e5))W.tiffSubifd=X.tiff.subifd;else throw G.invalidParameterError("tiff.subifd","integer between -1 and 100000",X.tiff.subifd);else if(G.defined(X.subifd))if(G.integer(X.subifd)&&G.inRange(X.subifd,-1,1e5))W.tiffSubifd=X.subifd;else throw G.invalidParameterError("subifd","integer between -1 and 100000",X.subifd);if(G.object(X.svg)){if(G.defined(X.svg.stylesheet))if(G.string(X.svg.stylesheet))W.svgStylesheet=X.svg.stylesheet;else throw G.invalidParameterError("svg.stylesheet","string",X.svg.stylesheet);if(G.defined(X.svg.highBitdepth))if(G.bool(X.svg.highBitdepth))W.svgHighBitdepth=X.svg.highBitdepth;else throw G.invalidParameterError("svg.highBitdepth","boolean",X.svg.highBitdepth)}if(G.object(X.pdf)&&G.defined(X.pdf.background))W.pdfBackground=this._getBackgroundColourOption(X.pdf.background);else if(G.defined(X.pdfBackground))W.pdfBackground=this._getBackgroundColourOption(X.pdfBackground);if(G.object(X.jp2)&&G.defined(X.jp2.oneshot))if(G.bool(X.jp2.oneshot))W.jp2Oneshot=X.jp2.oneshot;else throw G.invalidParameterError("jp2.oneshot","boolean",X.jp2.oneshot);if(G.defined(X.create))if(G.object(X.create)&&G.integer(X.create.width)&&X.create.width>0&&G.integer(X.create.height)&&X.create.height>0&&G.integer(X.create.channels)){if(W.createWidth=X.create.width,W.createHeight=X.create.height,W.createChannels=X.create.channels,W.createPageHeight=0,G.defined(X.create.pageHeight))if(G.integer(X.create.pageHeight)&&X.create.pageHeight>0&&X.create.pageHeight<=X.create.height){if(X.create.height%X.create.pageHeight!==0)throw Error(`Expected create.height ${X.create.height} to be a multiple of create.pageHeight ${X.create.pageHeight}`);W.createPageHeight=X.create.pageHeight}else throw G.invalidParameterError("create.pageHeight","positive integer",X.create.pageHeight);if(G.defined(X.create.noise)){if(!G.object(X.create.noise))throw Error("Expected noise to be an object");if(X.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(W.createNoiseType=X.create.noise.type,!G.inRange(X.create.channels,1,4))throw G.invalidParameterError("create.channels","number between 1 and 4",X.create.channels);if(W.createNoiseMean=128,G.defined(X.create.noise.mean))if(G.number(X.create.noise.mean)&&G.inRange(X.create.noise.mean,0,1e4))W.createNoiseMean=X.create.noise.mean;else throw G.invalidParameterError("create.noise.mean","number between 0 and 10000",X.create.noise.mean);if(W.createNoiseSigma=30,G.defined(X.create.noise.sigma))if(G.number(X.create.noise.sigma)&&G.inRange(X.create.noise.sigma,0,1e4))W.createNoiseSigma=X.create.noise.sigma;else throw G.invalidParameterError("create.noise.sigma","number between 0 and 10000",X.create.noise.sigma)}else if(G.defined(X.create.background)){if(!G.inRange(X.create.channels,3,4))throw G.invalidParameterError("create.channels","number between 3 and 4",X.create.channels);W.createBackground=this._getBackgroundColourOption(X.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete W.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(G.defined(X.text))if(G.object(X.text)&&G.string(X.text.text)){if(W.textValue=X.text.text,G.defined(X.text.height)&&G.defined(X.text.dpi))throw Error("Expected only one of dpi or height");if(G.defined(X.text.font))if(G.string(X.text.font))W.textFont=X.text.font;else throw G.invalidParameterError("text.font","string",X.text.font);if(G.defined(X.text.fontfile))if(G.string(X.text.fontfile))W.textFontfile=X.text.fontfile;else throw G.invalidParameterError("text.fontfile","string",X.text.fontfile);if(G.defined(X.text.width))if(G.integer(X.text.width)&&X.text.width>0)W.textWidth=X.text.width;else throw G.invalidParameterError("text.width","positive integer",X.text.width);if(G.defined(X.text.height))if(G.integer(X.text.height)&&X.text.height>0)W.textHeight=X.text.height;else throw G.invalidParameterError("text.height","positive integer",X.text.height);if(G.defined(X.text.align))if(G.string(X.text.align)&&G.string(this.constructor.align[X.text.align]))W.textAlign=this.constructor.align[X.text.align];else throw G.invalidParameterError("text.align","valid alignment",X.text.align);if(G.defined(X.text.justify))if(G.bool(X.text.justify))W.textJustify=X.text.justify;else throw G.invalidParameterError("text.justify","boolean",X.text.justify);if(G.defined(X.text.dpi))if(G.integer(X.text.dpi)&&G.inRange(X.text.dpi,1,1e6))W.textDpi=X.text.dpi;else throw G.invalidParameterError("text.dpi","integer between 1 and 1000000",X.text.dpi);if(G.defined(X.text.rgba))if(G.bool(X.text.rgba))W.textRgba=X.text.rgba;else throw G.invalidParameterError("text.rgba","bool",X.text.rgba);if(G.defined(X.text.spacing))if(G.integer(X.text.spacing)&&G.inRange(X.text.spacing,-1e6,1e6))W.textSpacing=X.text.spacing;else throw G.invalidParameterError("text.spacing","integer between -1000000 and 1000000",X.text.spacing);if(G.defined(X.text.wrap))if(G.string(X.text.wrap)&&G.inArray(X.text.wrap,["word","char","word-char","none"]))W.textWrap=X.text.wrap;else throw G.invalidParameterError("text.wrap","one of: word, char, word-char, none",X.text.wrap);delete W.buffer}else throw Error("Expected a valid string to create an image with text.");if(G.defined(X.join))if(G.defined(this.options.join)){if(G.defined(X.join.animated))if(G.bool(X.join.animated))W.joinAnimated=X.join.animated;else throw G.invalidParameterError("join.animated","boolean",X.join.animated);if(G.defined(X.join.across))if(G.integer(X.join.across)&&G.inRange(X.join.across,1,1e6))W.joinAcross=X.join.across;else throw G.invalidParameterError("join.across","integer between 1 and 100000",X.join.across);if(G.defined(X.join.shim))if(G.integer(X.join.shim)&&G.inRange(X.join.shim,0,1e6))W.joinShim=X.join.shim;else throw G.invalidParameterError("join.shim","integer between 0 and 100000",X.join.shim);if(G.defined(X.join.background))W.joinBackground=this._getBackgroundColourOption(X.join.background);if(G.defined(X.join.halign))if(G.string(X.join.halign)&&G.string(this.constructor.align[X.join.halign]))W.joinHalign=this.constructor.align[X.join.halign];else throw G.invalidParameterError("join.halign","valid alignment",X.join.halign);if(G.defined(X.join.valign))if(G.string(X.join.valign)&&G.string(this.constructor.align[X.join.valign]))W.joinValign=this.constructor.align[X.join.valign];else throw G.invalidParameterError("join.valign","valid alignment",X.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(G.defined(X))throw Error(`Invalid input options ${X}`);return W}function pK(Z,X,q){if(Array.isArray(this.options.input.buffer))if(G.buffer(Z)){if(this.options.input.buffer.length===0)this.on("finish",()=>{this.streamInFinished=!0});this.options.input.buffer.push(Z),q()}else q(Error("Non-Buffer data on Writable Stream"));else q(Error("Unexpected data on Writable Stream"))}function nK(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function iK(){return Array.isArray(this.options.input.buffer)}function rK(Z){let X=Error();if(G.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),v.metadata(this.options,(q,W)=>{if(q)Z(G.nativeError(q,X));else Z(null,W)})});else v.metadata(this.options,(q,W)=>{if(q)Z(G.nativeError(q,X));else Z(null,W)});return this}else if(this._isStreamInput())return new Promise((q,W)=>{let Q=()=>{this._flattenBufferIn(),v.metadata(this.options,(J,z)=>{if(J)W(G.nativeError(J,X));else q(z)})};if(this.writableFinished)Q();else this.once("finish",Q)});else return new Promise((q,W)=>{v.metadata(this.options,(Q,J)=>{if(Q)W(G.nativeError(Q,X));else q(J)})})}function aK(Z){let X=Error();if(G.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),v.stats(this.options,(q,W)=>{if(q)Z(G.nativeError(q,X));else Z(null,W)})});else v.stats(this.options,(q,W)=>{if(q)Z(G.nativeError(q,X));else Z(null,W)});return this}else if(this._isStreamInput())return new Promise((q,W)=>{this.on("finish",function(){this._flattenBufferIn(),v.stats(this.options,(Q,J)=>{if(Q)W(G.nativeError(Q,X));else q(J)})})});else return new Promise((q,W)=>{v.stats(this.options,(Q,J)=>{if(Q)W(G.nativeError(Q,X));else q(J)})})}var dK,cK,HX=(Z)=>{Object.assign(Z.prototype,{_inputOptionsFromObject:BX,_createInputDescriptor:lK,_write:pK,_flattenBufferIn:nK,_isStreamInput:iK,metadata:rK,stats:aK}),Z.align=dK};var $X=R(()=>{m0();b4();/*!
219
+ */jU=_U.debuglog("sharp");Object.setPrototypeOf(o1.prototype,m3.Duplex.prototype);Object.setPrototypeOf(o1,m3.Duplex);Object.assign(o1.prototype,{clone:CU});U1=o1});function ZW(Z){let W=xU.filter((X)=>Y.defined(Z[X])).map((X)=>[X,Z[X]]);return W.length?Object.fromEntries(W):void 0}function kU(Z,W,X){let Q={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(Y.string(Z))Q.file=Z;else if(Y.buffer(Z)){if(Z.length===0)throw Error("Input Buffer is empty");Q.buffer=Z}else if(Y.arrayBuffer(Z)){if(Z.byteLength===0)throw Error("Input bit Array is empty");Q.buffer=Buffer.from(Z,0,Z.byteLength)}else if(Y.typedArray(Z)){if(Z.length===0)throw Error("Input Bit Array is empty");Q.buffer=Buffer.from(Z.buffer,Z.byteOffset,Z.byteLength)}else if(Y.plainObject(Z)&&!Y.defined(W)){if(W=Z,ZW(W))Q.buffer=[]}else if(!Y.defined(Z)&&!Y.defined(W)&&Y.object(X)&&X.allowStream)Q.buffer=[];else if(Array.isArray(Z))if(Z.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=Z.map((J)=>this._createInputDescriptor(J));else throw Error("Recursive join is unsupported");else throw Error("Expected at least two images to join");else throw Error(`Unsupported input '${Z}' of type ${typeof Z}${Y.defined(W)?` when also providing options of type ${typeof W}`:""}`);if(Y.object(W)){if(Y.defined(W.failOn))if(Y.string(W.failOn)&&Y.inArray(W.failOn,["none","truncated","error","warning"]))Q.failOn=W.failOn;else throw Y.invalidParameterError("failOn","one of: none, truncated, error, warning",W.failOn);if(Y.defined(W.autoOrient))if(Y.bool(W.autoOrient))Q.autoOrient=W.autoOrient;else throw Y.invalidParameterError("autoOrient","boolean",W.autoOrient);if(Y.defined(W.density))if(Y.number(W.density)&&Y.inRange(W.density,1,1e5))Q.density=W.density;else throw Y.invalidParameterError("density","number between 1 and 100000",W.density);if(Y.defined(W.ignoreIcc))if(Y.bool(W.ignoreIcc))Q.ignoreIcc=W.ignoreIcc;else throw Y.invalidParameterError("ignoreIcc","boolean",W.ignoreIcc);if(Y.defined(W.limitInputPixels))if(Y.bool(W.limitInputPixels))Q.limitInputPixels=W.limitInputPixels?268402689:0;else if(Y.integer(W.limitInputPixels)&&Y.inRange(W.limitInputPixels,0,Number.MAX_SAFE_INTEGER))Q.limitInputPixels=W.limitInputPixels;else throw Y.invalidParameterError("limitInputPixels","positive integer",W.limitInputPixels);if(Y.defined(W.limitInputChannels))if(Y.bool(W.limitInputChannels))Q.limitInputChannels=W.limitInputChannels?5:0;else if(Y.integer(W.limitInputChannels)&&Y.inRange(W.limitInputChannels,0,Number.MAX_SAFE_INTEGER))Q.limitInputChannels=W.limitInputChannels;else throw Y.invalidParameterError("limitInputChannels","positive integer",W.limitInputChannels);if(Y.defined(W.unlimited))if(Y.bool(W.unlimited))Q.unlimited=W.unlimited;else throw Y.invalidParameterError("unlimited","boolean",W.unlimited);if(Y.defined(W.sequentialRead))if(Y.bool(W.sequentialRead))Q.sequentialRead=W.sequentialRead;else throw Y.invalidParameterError("sequentialRead","boolean",W.sequentialRead);if(Y.defined(W.raw)){if(Y.object(W.raw)&&Y.integer(W.raw.width)&&W.raw.width>0&&Y.integer(W.raw.height)&&W.raw.height>0&&Y.integer(W.raw.channels)&&Y.inRange(W.raw.channels,1,4))switch(Q.rawWidth=W.raw.width,Q.rawHeight=W.raw.height,Q.rawChannels=W.raw.channels,Z.constructor){case Uint8Array:case Uint8ClampedArray:Q.rawDepth="uchar";break;case Int8Array:Q.rawDepth="char";break;case Uint16Array:Q.rawDepth="ushort";break;case Int16Array:Q.rawDepth="short";break;case Uint32Array:Q.rawDepth="uint";break;case Int32Array:Q.rawDepth="int";break;case Float32Array:Q.rawDepth="float";break;case Float64Array:Q.rawDepth="double";break;default:Q.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(Q.rawPremultiplied=!1,Y.defined(W.raw.premultiplied))if(Y.bool(W.raw.premultiplied))Q.rawPremultiplied=W.raw.premultiplied;else throw Y.invalidParameterError("raw.premultiplied","boolean",W.raw.premultiplied);if(Q.rawPageHeight=0,Y.defined(W.raw.pageHeight))if(Y.integer(W.raw.pageHeight)&&W.raw.pageHeight>0&&W.raw.pageHeight<=W.raw.height){if(W.raw.height%W.raw.pageHeight!==0)throw Error(`Expected raw.height ${W.raw.height} to be a multiple of raw.pageHeight ${W.raw.pageHeight}`);Q.rawPageHeight=W.raw.pageHeight}else throw Y.invalidParameterError("raw.pageHeight","positive integer",W.raw.pageHeight)}if(Y.defined(W.animated))if(Y.bool(W.animated))Q.pages=W.animated?-1:1;else throw Y.invalidParameterError("animated","boolean",W.animated);if(Y.defined(W.pages))if(Y.integer(W.pages)&&Y.inRange(W.pages,-1,1e5))Q.pages=W.pages;else throw Y.invalidParameterError("pages","integer between -1 and 100000",W.pages);if(Y.defined(W.page))if(Y.integer(W.page)&&Y.inRange(W.page,0,1e5))Q.page=W.page;else throw Y.invalidParameterError("page","integer between 0 and 100000",W.page);if(Y.object(W.openSlide)&&Y.defined(W.openSlide.level))if(Y.integer(W.openSlide.level)&&Y.inRange(W.openSlide.level,0,256))Q.openSlideLevel=W.openSlide.level;else throw Y.invalidParameterError("openSlide.level","integer between 0 and 256",W.openSlide.level);else if(Y.defined(W.level))if(Y.integer(W.level)&&Y.inRange(W.level,0,256))Q.openSlideLevel=W.level;else throw Y.invalidParameterError("level","integer between 0 and 256",W.level);if(Y.object(W.tiff)&&Y.defined(W.tiff.subifd))if(Y.integer(W.tiff.subifd)&&Y.inRange(W.tiff.subifd,-1,1e5))Q.tiffSubifd=W.tiff.subifd;else throw Y.invalidParameterError("tiff.subifd","integer between -1 and 100000",W.tiff.subifd);else if(Y.defined(W.subifd))if(Y.integer(W.subifd)&&Y.inRange(W.subifd,-1,1e5))Q.tiffSubifd=W.subifd;else throw Y.invalidParameterError("subifd","integer between -1 and 100000",W.subifd);if(Y.object(W.svg)){if(Y.defined(W.svg.stylesheet))if(Y.string(W.svg.stylesheet))Q.svgStylesheet=W.svg.stylesheet;else throw Y.invalidParameterError("svg.stylesheet","string",W.svg.stylesheet);if(Y.defined(W.svg.highBitdepth))if(Y.bool(W.svg.highBitdepth))Q.svgHighBitdepth=W.svg.highBitdepth;else throw Y.invalidParameterError("svg.highBitdepth","boolean",W.svg.highBitdepth)}if(Y.object(W.pdf)&&Y.defined(W.pdf.background))Q.pdfBackground=this._getBackgroundColourOption(W.pdf.background);else if(Y.defined(W.pdfBackground))Q.pdfBackground=this._getBackgroundColourOption(W.pdfBackground);if(Y.object(W.jp2)&&Y.defined(W.jp2.oneshot))if(Y.bool(W.jp2.oneshot))Q.jp2Oneshot=W.jp2.oneshot;else throw Y.invalidParameterError("jp2.oneshot","boolean",W.jp2.oneshot);if(Y.defined(W.create))if(Y.object(W.create)&&Y.integer(W.create.width)&&W.create.width>0&&Y.integer(W.create.height)&&W.create.height>0&&Y.integer(W.create.channels)){if(Q.createWidth=W.create.width,Q.createHeight=W.create.height,Q.createChannels=W.create.channels,Q.createPageHeight=0,Y.defined(W.create.pageHeight))if(Y.integer(W.create.pageHeight)&&W.create.pageHeight>0&&W.create.pageHeight<=W.create.height){if(W.create.height%W.create.pageHeight!==0)throw Error(`Expected create.height ${W.create.height} to be a multiple of create.pageHeight ${W.create.pageHeight}`);Q.createPageHeight=W.create.pageHeight}else throw Y.invalidParameterError("create.pageHeight","positive integer",W.create.pageHeight);if(Y.defined(W.create.noise)){if(!Y.object(W.create.noise))throw Error("Expected noise to be an object");if(W.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(Q.createNoiseType=W.create.noise.type,!Y.inRange(W.create.channels,1,4))throw Y.invalidParameterError("create.channels","number between 1 and 4",W.create.channels);if(Q.createNoiseMean=128,Y.defined(W.create.noise.mean))if(Y.number(W.create.noise.mean)&&Y.inRange(W.create.noise.mean,0,1e4))Q.createNoiseMean=W.create.noise.mean;else throw Y.invalidParameterError("create.noise.mean","number between 0 and 10000",W.create.noise.mean);if(Q.createNoiseSigma=30,Y.defined(W.create.noise.sigma))if(Y.number(W.create.noise.sigma)&&Y.inRange(W.create.noise.sigma,0,1e4))Q.createNoiseSigma=W.create.noise.sigma;else throw Y.invalidParameterError("create.noise.sigma","number between 0 and 10000",W.create.noise.sigma)}else if(Y.defined(W.create.background)){if(!Y.inRange(W.create.channels,3,4))throw Y.invalidParameterError("create.channels","number between 3 and 4",W.create.channels);Q.createBackground=this._getBackgroundColourOption(W.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete Q.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(Y.defined(W.text))if(Y.object(W.text)&&Y.string(W.text.text)){if(Q.textValue=W.text.text,Y.defined(W.text.height)&&Y.defined(W.text.dpi))throw Error("Expected only one of dpi or height");if(Y.defined(W.text.font))if(Y.string(W.text.font))Q.textFont=W.text.font;else throw Y.invalidParameterError("text.font","string",W.text.font);if(Y.defined(W.text.fontfile))if(Y.string(W.text.fontfile))Q.textFontfile=W.text.fontfile;else throw Y.invalidParameterError("text.fontfile","string",W.text.fontfile);if(Y.defined(W.text.width))if(Y.integer(W.text.width)&&W.text.width>0)Q.textWidth=W.text.width;else throw Y.invalidParameterError("text.width","positive integer",W.text.width);if(Y.defined(W.text.height))if(Y.integer(W.text.height)&&W.text.height>0)Q.textHeight=W.text.height;else throw Y.invalidParameterError("text.height","positive integer",W.text.height);if(Y.defined(W.text.align))if(Y.string(W.text.align)&&Y.string(this.constructor.align[W.text.align]))Q.textAlign=this.constructor.align[W.text.align];else throw Y.invalidParameterError("text.align","valid alignment",W.text.align);if(Y.defined(W.text.justify))if(Y.bool(W.text.justify))Q.textJustify=W.text.justify;else throw Y.invalidParameterError("text.justify","boolean",W.text.justify);if(Y.defined(W.text.dpi))if(Y.integer(W.text.dpi)&&Y.inRange(W.text.dpi,1,1e6))Q.textDpi=W.text.dpi;else throw Y.invalidParameterError("text.dpi","integer between 1 and 1000000",W.text.dpi);if(Y.defined(W.text.rgba))if(Y.bool(W.text.rgba))Q.textRgba=W.text.rgba;else throw Y.invalidParameterError("text.rgba","bool",W.text.rgba);if(Y.defined(W.text.spacing))if(Y.integer(W.text.spacing)&&Y.inRange(W.text.spacing,-1e6,1e6))Q.textSpacing=W.text.spacing;else throw Y.invalidParameterError("text.spacing","integer between -1000000 and 1000000",W.text.spacing);if(Y.defined(W.text.wrap))if(Y.string(W.text.wrap)&&Y.inArray(W.text.wrap,["word","char","word-char","none"]))Q.textWrap=W.text.wrap;else throw Y.invalidParameterError("text.wrap","one of: word, char, word-char, none",W.text.wrap);delete Q.buffer}else throw Error("Expected a valid string to create an image with text.");if(Y.defined(W.join))if(Y.defined(this.options.join)){if(Y.defined(W.join.animated))if(Y.bool(W.join.animated))Q.joinAnimated=W.join.animated;else throw Y.invalidParameterError("join.animated","boolean",W.join.animated);if(Y.defined(W.join.across))if(Y.integer(W.join.across)&&Y.inRange(W.join.across,1,1e6))Q.joinAcross=W.join.across;else throw Y.invalidParameterError("join.across","integer between 1 and 100000",W.join.across);if(Y.defined(W.join.shim))if(Y.integer(W.join.shim)&&Y.inRange(W.join.shim,0,1e6))Q.joinShim=W.join.shim;else throw Y.invalidParameterError("join.shim","integer between 0 and 100000",W.join.shim);if(Y.defined(W.join.background))Q.joinBackground=this._getBackgroundColourOption(W.join.background);if(Y.defined(W.join.halign))if(Y.string(W.join.halign)&&Y.string(this.constructor.align[W.join.halign]))Q.joinHalign=this.constructor.align[W.join.halign];else throw Y.invalidParameterError("join.halign","valid alignment",W.join.halign);if(Y.defined(W.join.valign))if(Y.string(W.join.valign)&&Y.string(this.constructor.align[W.join.valign]))Q.joinValign=this.constructor.align[W.join.valign];else throw Y.invalidParameterError("join.valign","valid alignment",W.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(Y.defined(W))throw Error(`Invalid input options ${W}`);return Q}function SU(Z,W,X){if(Array.isArray(this.options.input.buffer))if(Y.buffer(Z)){if(this.options.input.buffer.length===0)this.on("finish",()=>{this.streamInFinished=!0});this.options.input.buffer.push(Z),X()}else X(Error("Non-Buffer data on Writable Stream"));else X(Error("Unexpected data on Writable Stream"))}function bU(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function vU(){return Array.isArray(this.options.input.buffer)}function yU(Z){let W=Error();if(Y.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Z0.metadata(this.options,(X,Q)=>{if(X)Z(Y.nativeError(X,W));else Z(null,Q)})});else Z0.metadata(this.options,(X,Q)=>{if(X)Z(Y.nativeError(X,W));else Z(null,Q)});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{let J=()=>{this._flattenBufferIn(),Z0.metadata(this.options,(G,z)=>{if(G)Q(Y.nativeError(G,W));else X(z)})};if(this.writableFinished)J();else this.once("finish",J)});else return new Promise((X,Q)=>{Z0.metadata(this.options,(J,G)=>{if(J)Q(Y.nativeError(J,W));else X(G)})})}function gU(Z){let W=Error();if(Y.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Z0.stats(this.options,(X,Q)=>{if(X)Z(Y.nativeError(X,W));else Z(null,Q)})});else Z0.stats(this.options,(X,Q)=>{if(X)Z(Y.nativeError(X,W));else Z(null,Q)});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{this.on("finish",function(){this._flattenBufferIn(),Z0.stats(this.options,(J,G)=>{if(J)Q(Y.nativeError(J,W));else X(G)})})});else return new Promise((X,Q)=>{Z0.stats(this.options,(J,G)=>{if(J)Q(Y.nativeError(J,W));else X(G)})})}var OU,xU,WW=(Z)=>{Object.assign(Z.prototype,{_inputOptionsFromObject:ZW,_createInputDescriptor:kU,_write:SU,_flattenBufferIn:bU,_isStreamInput:vU,metadata:yU,stats:gU}),Z.align=OU};var XW=d(()=>{Q1();Q4();/*!
214
220
  Copyright 2013 Lovell Fuller and others.
215
221
  SPDX-License-Identifier: Apache-2.0
216
- */dK={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},cK=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"]});function D3(Z){return Z.angle%360!==0||Z.rotationAngle!==0}function v1(Z){return Z.width!==-1||Z.height!==-1}function tK(Z,X,q){if(v1(this.options))this.options.debuglog("ignoring previous resize options");if(this.options.widthPost!==-1)this.options.debuglog("operation order will be: extract, resize, extract");if(G.defined(Z))if(G.object(Z)&&!G.defined(q))q=Z;else if(G.integer(Z)&&Z>0)this.options.width=Z;else throw G.invalidParameterError("width","positive integer",Z);else this.options.width=-1;if(G.defined(X))if(G.integer(X)&&X>0)this.options.height=X;else throw G.invalidParameterError("height","positive integer",X);else this.options.height=-1;if(G.object(q)){if(G.defined(q.width))if(G.integer(q.width)&&q.width>0)this.options.width=q.width;else throw G.invalidParameterError("width","positive integer",q.width);if(G.defined(q.height))if(G.integer(q.height)&&q.height>0)this.options.height=q.height;else throw G.invalidParameterError("height","positive integer",q.height);if(G.defined(q.fit)){let W=oK[q.fit];if(G.string(W))this.options.canvas=W;else throw G.invalidParameterError("fit","valid fit",q.fit)}if(G.defined(q.position)){let W=G.integer(q.position)?q.position:LX[q.position]||MX[q.position]||AX[q.position];if(G.integer(W)&&(G.inRange(W,0,8)||G.inRange(W,16,17)))this.options.position=W;else throw G.invalidParameterError("position","valid position/gravity/strategy",q.position)}if(this._setBackgroundColourOption("resizeBackground",q.background),G.defined(q.kernel))if(G.string(w3[q.kernel]))this.options.kernel=w3[q.kernel];else throw G.invalidParameterError("kernel","valid kernel name",q.kernel);if(G.defined(q.withoutEnlargement))this._setBooleanOption("withoutEnlargement",q.withoutEnlargement);if(G.defined(q.withoutReduction))this._setBooleanOption("withoutReduction",q.withoutReduction);if(G.defined(q.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",q.fastShrinkOnLoad)}if(D3(this.options)&&v1(this.options))this.options.rotateBefore=!0;return this}function eK(Z){if(G.integer(Z)&&Z>0)this.options.extendTop=Z,this.options.extendBottom=Z,this.options.extendLeft=Z,this.options.extendRight=Z;else if(G.object(Z)){if(G.defined(Z.top))if(G.integer(Z.top)&&Z.top>=0)this.options.extendTop=Z.top;else throw G.invalidParameterError("top","positive integer",Z.top);if(G.defined(Z.bottom))if(G.integer(Z.bottom)&&Z.bottom>=0)this.options.extendBottom=Z.bottom;else throw G.invalidParameterError("bottom","positive integer",Z.bottom);if(G.defined(Z.left))if(G.integer(Z.left)&&Z.left>=0)this.options.extendLeft=Z.left;else throw G.invalidParameterError("left","positive integer",Z.left);if(G.defined(Z.right))if(G.integer(Z.right)&&Z.right>=0)this.options.extendRight=Z.right;else throw G.invalidParameterError("right","positive integer",Z.right);if(this._setBackgroundColourOption("extendBackground",Z.background),G.defined(Z.extendWith))if(G.string(FX[Z.extendWith]))this.options.extendWith=FX[Z.extendWith];else throw G.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",Z.extendWith)}else throw G.invalidParameterError("extend","integer or object",Z);return this}function ZV(Z){let X=v1(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${X}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function(q){let W=Z[q];if(G.integer(W)&&W>=0)this.options[q+(q==="left"||q==="top"?"Offset":"")+X]=W;else throw G.invalidParameterError(q,"integer",W)},this),D3(this.options)&&!v1(this.options)){if(this.options.widthPre===-1||this.options.widthPost===-1)this.options.rotateBefore=!0}if(this.options.input.autoOrient)this.options.orientBefore=!0;return this}function XV(Z){if(this.options.trimThreshold=10,G.defined(Z))if(G.object(Z)){if(G.defined(Z.background))this._setBackgroundColourOption("trimBackground",Z.background);if(G.defined(Z.threshold))if(G.number(Z.threshold)&&Z.threshold>=0)this.options.trimThreshold=Z.threshold;else throw G.invalidParameterError("threshold","positive number",Z.threshold);if(G.defined(Z.lineArt))this._setBooleanOption("trimLineArt",Z.lineArt);if(G.defined(Z.margin))if(G.integer(Z.margin)&&Z.margin>=0)this.options.trimMargin=Z.margin;else throw G.invalidParameterError("margin","positive integer",Z.margin)}else throw G.invalidParameterError("trim","object",Z);if(D3(this.options))this.options.rotateBefore=!0;return this}var AX,MX,FX,LX,w3,sK,oK,IX=(Z)=>{Object.assign(Z.prototype,{resize:tK,extend:eK,extract:ZV,trim:XV}),Z.gravity=AX,Z.strategy=LX,Z.kernel=w3,Z.fit=sK,Z.position=MX};var wX=R(()=>{m0();/*!
222
+ */OU={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},xU=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"]});function d3(Z){return Z.angle%360!==0||Z.rotationAngle!==0}function q2(Z){return Z.width!==-1||Z.height!==-1}function mU(Z,W,X){if(q2(this.options))this.options.debuglog("ignoring previous resize options");if(this.options.widthPost!==-1)this.options.debuglog("operation order will be: extract, resize, extract");if(Y.defined(Z))if(Y.object(Z)&&!Y.defined(X))X=Z;else if(Y.integer(Z)&&Z>0)this.options.width=Z;else throw Y.invalidParameterError("width","positive integer",Z);else this.options.width=-1;if(Y.defined(W))if(Y.integer(W)&&W>0)this.options.height=W;else throw Y.invalidParameterError("height","positive integer",W);else this.options.height=-1;if(Y.object(X)){if(Y.defined(X.width))if(Y.integer(X.width)&&X.width>0)this.options.width=X.width;else throw Y.invalidParameterError("width","positive integer",X.width);if(Y.defined(X.height))if(Y.integer(X.height)&&X.height>0)this.options.height=X.height;else throw Y.invalidParameterError("height","positive integer",X.height);if(Y.defined(X.fit)){let Q=fU[X.fit];if(Y.string(Q))this.options.canvas=Q;else throw Y.invalidParameterError("fit","valid fit",X.fit)}if(Y.defined(X.position)){let Q=Y.integer(X.position)?X.position:zW[X.position]||GW[X.position]||JW[X.position];if(Y.integer(Q)&&(Y.inRange(Q,0,8)||Y.inRange(Q,16,17)))this.options.position=Q;else throw Y.invalidParameterError("position","valid position/gravity/strategy",X.position)}if(this._setBackgroundColourOption("resizeBackground",X.background),Y.defined(X.kernel))if(Y.string(u3[X.kernel]))this.options.kernel=u3[X.kernel];else throw Y.invalidParameterError("kernel","valid kernel name",X.kernel);if(Y.defined(X.withoutEnlargement))this._setBooleanOption("withoutEnlargement",X.withoutEnlargement);if(Y.defined(X.withoutReduction))this._setBooleanOption("withoutReduction",X.withoutReduction);if(Y.defined(X.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",X.fastShrinkOnLoad)}if(d3(this.options)&&q2(this.options))this.options.rotateBefore=!0;return this}function uU(Z){if(Y.integer(Z)&&Z>0)this.options.extendTop=Z,this.options.extendBottom=Z,this.options.extendLeft=Z,this.options.extendRight=Z;else if(Y.object(Z)){if(Y.defined(Z.top))if(Y.integer(Z.top)&&Z.top>=0)this.options.extendTop=Z.top;else throw Y.invalidParameterError("top","positive integer",Z.top);if(Y.defined(Z.bottom))if(Y.integer(Z.bottom)&&Z.bottom>=0)this.options.extendBottom=Z.bottom;else throw Y.invalidParameterError("bottom","positive integer",Z.bottom);if(Y.defined(Z.left))if(Y.integer(Z.left)&&Z.left>=0)this.options.extendLeft=Z.left;else throw Y.invalidParameterError("left","positive integer",Z.left);if(Y.defined(Z.right))if(Y.integer(Z.right)&&Z.right>=0)this.options.extendRight=Z.right;else throw Y.invalidParameterError("right","positive integer",Z.right);if(this._setBackgroundColourOption("extendBackground",Z.background),Y.defined(Z.extendWith))if(Y.string(QW[Z.extendWith]))this.options.extendWith=QW[Z.extendWith];else throw Y.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",Z.extendWith)}else throw Y.invalidParameterError("extend","integer or object",Z);return this}function dU(Z){let W=q2(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${W}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function(X){let Q=Z[X];if(Y.integer(Q)&&Q>=0)this.options[X+(X==="left"||X==="top"?"Offset":"")+W]=Q;else throw Y.invalidParameterError(X,"integer",Q)},this),d3(this.options)&&!q2(this.options)){if(this.options.widthPre===-1||this.options.widthPost===-1)this.options.rotateBefore=!0}if(this.options.input.autoOrient)this.options.orientBefore=!0;return this}function cU(Z){if(this.options.trimThreshold=10,Y.defined(Z))if(Y.object(Z)){if(Y.defined(Z.background))this._setBackgroundColourOption("trimBackground",Z.background);if(Y.defined(Z.threshold))if(Y.number(Z.threshold)&&Z.threshold>=0)this.options.trimThreshold=Z.threshold;else throw Y.invalidParameterError("threshold","positive number",Z.threshold);if(Y.defined(Z.lineArt))this._setBooleanOption("trimLineArt",Z.lineArt);if(Y.defined(Z.margin))if(Y.integer(Z.margin)&&Z.margin>=0)this.options.trimMargin=Z.margin;else throw Y.invalidParameterError("margin","positive integer",Z.margin)}else throw Y.invalidParameterError("trim","object",Z);if(d3(this.options))this.options.rotateBefore=!0;return this}var JW,GW,QW,zW,u3,hU,fU,YW=(Z)=>{Object.assign(Z.prototype,{resize:mU,extend:uU,extract:dU,trim:cU}),Z.gravity=JW,Z.strategy=zW,Z.kernel=u3,Z.fit=hU,Z.position=GW};var UW=d(()=>{Q1();/*!
217
223
  Copyright 2013 Lovell Fuller and others.
218
224
  SPDX-License-Identifier: Apache-2.0
219
- */AX={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},MX={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},FX={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},LX={entropy:16,attention:17},w3={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},sK={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},oK={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"}});function qV(Z){if(!Array.isArray(Z))throw G.invalidParameterError("images to composite","array",Z);return this.options.composite=Z.map((X)=>{if(!G.object(X))throw G.invalidParameterError("image to composite","object",X);let q=this._inputOptionsFromObject(X),W={input:this._createInputDescriptor(X.input,q,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(G.defined(X.blend))if(G.string(N3[X.blend]))W.blend=N3[X.blend];else throw G.invalidParameterError("blend","valid blend name",X.blend);if(G.defined(X.tile))if(G.bool(X.tile))W.tile=X.tile;else throw G.invalidParameterError("tile","boolean",X.tile);if(G.defined(X.left))if(G.integer(X.left))W.left=X.left;else throw G.invalidParameterError("left","integer",X.left);if(G.defined(X.top))if(G.integer(X.top))W.top=X.top;else throw G.invalidParameterError("top","integer",X.top);if(G.defined(X.top)!==G.defined(X.left))throw Error("Expected both left and top to be set");else W.hasOffset=G.integer(X.top)&&G.integer(X.left);if(G.defined(X.gravity))if(G.integer(X.gravity)&&G.inRange(X.gravity,0,8))W.gravity=X.gravity;else if(G.string(X.gravity)&&G.integer(this.constructor.gravity[X.gravity]))W.gravity=this.constructor.gravity[X.gravity];else throw G.invalidParameterError("gravity","valid gravity",X.gravity);if(G.defined(X.premultiplied))if(G.bool(X.premultiplied))W.premultiplied=X.premultiplied;else throw G.invalidParameterError("premultiplied","boolean",X.premultiplied);return W}),this}var N3,DX=(Z)=>{Z.prototype.composite=qV,Z.blend=N3};var NX=R(()=>{m0();/*!
225
+ */JW={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},GW={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},QW={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},zW={entropy:16,attention:17},u3={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},hU={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},fU={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"}});function lU(Z){if(!Array.isArray(Z))throw Y.invalidParameterError("images to composite","array",Z);return this.options.composite=Z.map((W)=>{if(!Y.object(W))throw Y.invalidParameterError("image to composite","object",W);let X=this._inputOptionsFromObject(W),Q={input:this._createInputDescriptor(W.input,X,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(Y.defined(W.blend))if(Y.string(c3[W.blend]))Q.blend=c3[W.blend];else throw Y.invalidParameterError("blend","valid blend name",W.blend);if(Y.defined(W.tile))if(Y.bool(W.tile))Q.tile=W.tile;else throw Y.invalidParameterError("tile","boolean",W.tile);if(Y.defined(W.left))if(Y.integer(W.left))Q.left=W.left;else throw Y.invalidParameterError("left","integer",W.left);if(Y.defined(W.top))if(Y.integer(W.top))Q.top=W.top;else throw Y.invalidParameterError("top","integer",W.top);if(Y.defined(W.top)!==Y.defined(W.left))throw Error("Expected both left and top to be set");else Q.hasOffset=Y.integer(W.top)&&Y.integer(W.left);if(Y.defined(W.gravity))if(Y.integer(W.gravity)&&Y.inRange(W.gravity,0,8))Q.gravity=W.gravity;else if(Y.string(W.gravity)&&Y.integer(this.constructor.gravity[W.gravity]))Q.gravity=this.constructor.gravity[W.gravity];else throw Y.invalidParameterError("gravity","valid gravity",W.gravity);if(Y.defined(W.premultiplied))if(Y.bool(W.premultiplied))Q.premultiplied=W.premultiplied;else throw Y.invalidParameterError("premultiplied","boolean",W.premultiplied);return Q}),this}var c3,qW=(Z)=>{Z.prototype.composite=lU,Z.blend=c3};var KW=d(()=>{Q1();/*!
220
226
  Copyright 2013 Lovell Fuller and others.
221
227
  SPDX-License-Identifier: Apache-2.0
222
- */N3={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"}});function WV(Z,X){if(!G.defined(Z))return this.autoOrient();if(this.options.angle||this.options.rotationAngle)this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0;if(G.integer(Z)&&!(Z%90))this.options.angle=Z;else if(G.number(Z)){if(this.options.rotationAngle=Z,G.object(X)&&X.background)this._setBackgroundColourOption("rotationBackground",X.background)}else throw G.invalidParameterError("angle","numeric",Z);return this}function QV(){return this.options.input.autoOrient=!0,this}function JV(Z){return this.options.flip=G.bool(Z)?Z:!0,this}function zV(Z){return this.options.flop=G.bool(Z)?Z:!0,this}function GV(Z,X){let q=Array.isArray(Z)?[].concat(...Z):[];if(q.length===4&&q.every(G.number))this.options.affineMatrix=q;else throw G.invalidParameterError("matrix","1x4 or 2x2 array",Z);if(G.defined(X))if(G.object(X)){if(this._setBackgroundColourOption("affineBackground",X.background),G.defined(X.idx))if(G.number(X.idx))this.options.affineIdx=X.idx;else throw G.invalidParameterError("options.idx","number",X.idx);if(G.defined(X.idy))if(G.number(X.idy))this.options.affineIdy=X.idy;else throw G.invalidParameterError("options.idy","number",X.idy);if(G.defined(X.odx))if(G.number(X.odx))this.options.affineOdx=X.odx;else throw G.invalidParameterError("options.odx","number",X.odx);if(G.defined(X.ody))if(G.number(X.ody))this.options.affineOdy=X.ody;else throw G.invalidParameterError("options.ody","number",X.ody);if(G.defined(X.interpolator))if(G.inArray(X.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=X.interpolator;else throw G.invalidParameterError("options.interpolator","valid interpolator name",X.interpolator)}else throw G.invalidParameterError("options","object",X);return this}function YV(Z){if(G.plainObject(Z)){if(G.number(Z.sigma)&&G.inRange(Z.sigma,0.000001,10))this.options.sharpenSigma=Z.sigma;else throw G.invalidParameterError("options.sigma","number between 0.000001 and 10",Z.sigma);if(G.defined(Z.m1))if(G.number(Z.m1)&&G.inRange(Z.m1,0,1e6))this.options.sharpenM1=Z.m1;else throw G.invalidParameterError("options.m1","number between 0 and 1000000",Z.m1);if(G.defined(Z.m2))if(G.number(Z.m2)&&G.inRange(Z.m2,0,1e6))this.options.sharpenM2=Z.m2;else throw G.invalidParameterError("options.m2","number between 0 and 1000000",Z.m2);if(G.defined(Z.x1))if(G.number(Z.x1)&&G.inRange(Z.x1,0,1e6))this.options.sharpenX1=Z.x1;else throw G.invalidParameterError("options.x1","number between 0 and 1000000",Z.x1);if(G.defined(Z.y2))if(G.number(Z.y2)&&G.inRange(Z.y2,0,1e6))this.options.sharpenY2=Z.y2;else throw G.invalidParameterError("options.y2","number between 0 and 1000000",Z.y2);if(G.defined(Z.y3))if(G.number(Z.y3)&&G.inRange(Z.y3,0,1e6))this.options.sharpenY3=Z.y3;else throw G.invalidParameterError("options.y3","number between 0 and 1000000",Z.y3)}else this.options.sharpenSigma=-1;return this}function UV(Z){if(!G.defined(Z))this.options.medianSize=3;else if(G.integer(Z)&&G.inRange(Z,1,1000))this.options.medianSize=Z;else throw G.invalidParameterError("size","integer between 1 and 1000",Z);return this}function KV(Z){let X;if(G.number(Z))X=Z;else if(G.plainObject(Z)){if(!G.number(Z.sigma))throw G.invalidParameterError("options.sigma","number between 0.3 and 1000",X);if(X=Z.sigma,"precision"in Z)if(G.string(TX[Z.precision]))this.options.precision=TX[Z.precision];else throw G.invalidParameterError("precision","one of: integer, float, approximate",Z.precision);if("minAmplitude"in Z)if(G.number(Z.minAmplitude)&&G.inRange(Z.minAmplitude,0.001,1))this.options.minAmpl=Z.minAmplitude;else throw G.invalidParameterError("minAmplitude","number between 0.001 and 1",Z.minAmplitude)}if(!G.defined(Z))this.options.blurSigma=-1;else if(G.bool(Z))this.options.blurSigma=Z?-1:0;else if(G.number(X)&&G.inRange(X,0.3,1000))this.options.blurSigma=X;else throw G.invalidParameterError("sigma","number between 0.3 and 1000",X);return this}function RX(Z){if(!G.defined(Z))this.options.dilateWidth=1;else if(G.integer(Z)&&Z>0)this.options.dilateWidth=Z;else throw G.invalidParameterError("dilate","positive integer",RX);return this}function _X(Z){if(!G.defined(Z))this.options.erodeWidth=1;else if(G.integer(Z)&&Z>0)this.options.erodeWidth=Z;else throw G.invalidParameterError("erode","positive integer",_X);return this}function VV(Z){if(this.options.flatten=G.bool(Z)?Z:!0,G.object(Z))this._setBackgroundColourOption("flattenBackground",Z.background);return this}function BV(){return this.options.unflatten=!0,this}function HV(Z,X){if(!G.defined(Z))this.options.gamma=2.2;else if(G.number(Z)&&G.inRange(Z,1,3))this.options.gamma=Z;else throw G.invalidParameterError("gamma","number between 1.0 and 3.0",Z);if(!G.defined(X))this.options.gammaOut=this.options.gamma;else if(G.number(X)&&G.inRange(X,1,3))this.options.gammaOut=X;else throw G.invalidParameterError("gammaOut","number between 1.0 and 3.0",X);return this}function $V(Z){if(this.options.negate=G.bool(Z)?Z:!0,G.plainObject(Z)&&"alpha"in Z)if(!G.bool(Z.alpha))throw G.invalidParameterError("alpha","should be boolean value",Z.alpha);else this.options.negateAlpha=Z.alpha;return this}function FV(Z){if(G.plainObject(Z)){if(G.defined(Z.lower))if(G.number(Z.lower)&&G.inRange(Z.lower,0,99))this.options.normaliseLower=Z.lower;else throw G.invalidParameterError("lower","number between 0 and 99",Z.lower);if(G.defined(Z.upper))if(G.number(Z.upper)&&G.inRange(Z.upper,1,100))this.options.normaliseUpper=Z.upper;else throw G.invalidParameterError("upper","number between 1 and 100",Z.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw G.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function AV(Z){return this.normalise(Z)}function MV(Z){if(G.plainObject(Z)){if(G.integer(Z.width)&&Z.width>0)this.options.claheWidth=Z.width;else throw G.invalidParameterError("width","integer greater than zero",Z.width);if(G.integer(Z.height)&&Z.height>0)this.options.claheHeight=Z.height;else throw G.invalidParameterError("height","integer greater than zero",Z.height);if(G.defined(Z.maxSlope))if(G.integer(Z.maxSlope)&&G.inRange(Z.maxSlope,0,100))this.options.claheMaxSlope=Z.maxSlope;else throw G.invalidParameterError("maxSlope","integer between 0 and 100",Z.maxSlope)}else throw G.invalidParameterError("options","plain object",Z);return this}function LV(Z){if(!G.object(Z)||!Array.isArray(Z.kernel)||!G.integer(Z.width)||!G.integer(Z.height)||!G.inRange(Z.width,3,1001)||!G.inRange(Z.height,3,1001)||Z.height*Z.width!==Z.kernel.length)throw Error("Invalid convolution kernel");if(!G.integer(Z.scale))Z.scale=Z.kernel.reduce((X,q)=>X+q,0);if(Z.scale<1)Z.scale=1;if(!G.integer(Z.offset))Z.offset=0;return this.options.convKernel=Z,this}function IV(Z,X){if(!G.defined(Z))this.options.threshold=128;else if(G.bool(Z))this.options.threshold=Z?128:0;else if(G.integer(Z)&&G.inRange(Z,0,255))this.options.threshold=Z;else throw G.invalidParameterError("threshold","integer between 0 and 255",Z);if(!G.object(X)||X.greyscale===!0||X.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function wV(Z,X,q){if(this.options.boolean=this._createInputDescriptor(Z,q),G.string(X)&&G.inArray(X,["and","or","eor"]))this.options.booleanOp=X;else throw G.invalidParameterError("operator","one of: and, or, eor",X);return this}function DV(Z,X){if(!G.defined(Z)&&G.number(X))Z=1;else if(G.number(Z)&&!G.defined(X))X=0;if(!G.defined(Z))this.options.linearA=[];else if(G.number(Z))this.options.linearA=[Z];else if(Array.isArray(Z)&&Z.length&&Z.every(G.number))this.options.linearA=Z;else throw G.invalidParameterError("a","number or array of numbers",Z);if(!G.defined(X))this.options.linearB=[];else if(G.number(X))this.options.linearB=[X];else if(Array.isArray(X)&&X.length&&X.every(G.number))this.options.linearB=X;else throw G.invalidParameterError("b","number or array of numbers",X);if(this.options.linearA.length!==this.options.linearB.length)throw Error("Expected a and b to be arrays of the same length");return this}function NV(Z){if(!Array.isArray(Z))throw G.invalidParameterError("inputMatrix","array",Z);if(Z.length!==3&&Z.length!==4)throw G.invalidParameterError("inputMatrix","3x3 or 4x4 array",Z.length);let X=Z.flat().map(Number);if(X.length!==9&&X.length!==16)throw G.invalidParameterError("inputMatrix","cardinality of 9 or 16",X.length);return this.options.recombMatrix=X,this}function TV(Z){if(!G.plainObject(Z))throw G.invalidParameterError("options","plain object",Z);if("brightness"in Z)if(G.number(Z.brightness)&&Z.brightness>=0)this.options.brightness=Z.brightness;else throw G.invalidParameterError("brightness","number above zero",Z.brightness);if("saturation"in Z)if(G.number(Z.saturation)&&Z.saturation>=0)this.options.saturation=Z.saturation;else throw G.invalidParameterError("saturation","number above zero",Z.saturation);if("hue"in Z)if(G.integer(Z.hue))this.options.hue=Z.hue%360;else throw G.invalidParameterError("hue","number",Z.hue);if("lightness"in Z)if(G.number(Z.lightness))this.options.lightness=Z.lightness;else throw G.invalidParameterError("lightness","number",Z.lightness);return this}var TX,PX=(Z)=>{Object.assign(Z.prototype,{autoOrient:QV,rotate:WV,flip:JV,flop:zV,affine:GV,sharpen:YV,erode:_X,dilate:RX,median:UV,blur:KV,flatten:VV,unflatten:BV,gamma:HV,negate:$V,normalise:FV,normalize:AV,clahe:MV,convolve:LV,threshold:IV,boolean:wV,linear:DV,recomb:NV,modulate:TV})};var jX=R(()=>{m0();/*!
228
+ */c3={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"}});function pU(Z,W){if(!Y.defined(Z))return this.autoOrient();if(this.options.angle||this.options.rotationAngle)this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0;if(Y.integer(Z)&&!(Z%90))this.options.angle=Z;else if(Y.number(Z)){if(this.options.rotationAngle=Z,Y.object(W)&&W.background)this._setBackgroundColourOption("rotationBackground",W.background)}else throw Y.invalidParameterError("angle","numeric",Z);return this}function nU(){return this.options.input.autoOrient=!0,this}function iU(Z){return this.options.flip=Y.bool(Z)?Z:!0,this}function rU(Z){return this.options.flop=Y.bool(Z)?Z:!0,this}function aU(Z,W){let X=Array.isArray(Z)?[].concat(...Z):[];if(X.length===4&&X.every(Y.number))this.options.affineMatrix=X;else throw Y.invalidParameterError("matrix","1x4 or 2x2 array",Z);if(Y.defined(W))if(Y.object(W)){if(this._setBackgroundColourOption("affineBackground",W.background),Y.defined(W.idx))if(Y.number(W.idx))this.options.affineIdx=W.idx;else throw Y.invalidParameterError("options.idx","number",W.idx);if(Y.defined(W.idy))if(Y.number(W.idy))this.options.affineIdy=W.idy;else throw Y.invalidParameterError("options.idy","number",W.idy);if(Y.defined(W.odx))if(Y.number(W.odx))this.options.affineOdx=W.odx;else throw Y.invalidParameterError("options.odx","number",W.odx);if(Y.defined(W.ody))if(Y.number(W.ody))this.options.affineOdy=W.ody;else throw Y.invalidParameterError("options.ody","number",W.ody);if(Y.defined(W.interpolator))if(Y.inArray(W.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=W.interpolator;else throw Y.invalidParameterError("options.interpolator","valid interpolator name",W.interpolator)}else throw Y.invalidParameterError("options","object",W);return this}function sU(Z){if(Y.plainObject(Z)){if(Y.number(Z.sigma)&&Y.inRange(Z.sigma,0.000001,10))this.options.sharpenSigma=Z.sigma;else throw Y.invalidParameterError("options.sigma","number between 0.000001 and 10",Z.sigma);if(Y.defined(Z.m1))if(Y.number(Z.m1)&&Y.inRange(Z.m1,0,1e6))this.options.sharpenM1=Z.m1;else throw Y.invalidParameterError("options.m1","number between 0 and 1000000",Z.m1);if(Y.defined(Z.m2))if(Y.number(Z.m2)&&Y.inRange(Z.m2,0,1e6))this.options.sharpenM2=Z.m2;else throw Y.invalidParameterError("options.m2","number between 0 and 1000000",Z.m2);if(Y.defined(Z.x1))if(Y.number(Z.x1)&&Y.inRange(Z.x1,0,1e6))this.options.sharpenX1=Z.x1;else throw Y.invalidParameterError("options.x1","number between 0 and 1000000",Z.x1);if(Y.defined(Z.y2))if(Y.number(Z.y2)&&Y.inRange(Z.y2,0,1e6))this.options.sharpenY2=Z.y2;else throw Y.invalidParameterError("options.y2","number between 0 and 1000000",Z.y2);if(Y.defined(Z.y3))if(Y.number(Z.y3)&&Y.inRange(Z.y3,0,1e6))this.options.sharpenY3=Z.y3;else throw Y.invalidParameterError("options.y3","number between 0 and 1000000",Z.y3)}else this.options.sharpenSigma=-1;return this}function oU(Z){if(!Y.defined(Z))this.options.medianSize=3;else if(Y.integer(Z)&&Y.inRange(Z,1,1000))this.options.medianSize=Z;else throw Y.invalidParameterError("size","integer between 1 and 1000",Z);return this}function tU(Z){let W;if(Y.number(Z))W=Z;else if(Y.plainObject(Z)){if(!Y.number(Z.sigma))throw Y.invalidParameterError("options.sigma","number between 0.3 and 1000",W);if(W=Z.sigma,"precision"in Z)if(Y.string(VW[Z.precision]))this.options.precision=VW[Z.precision];else throw Y.invalidParameterError("precision","one of: integer, float, approximate",Z.precision);if("minAmplitude"in Z)if(Y.number(Z.minAmplitude)&&Y.inRange(Z.minAmplitude,0.001,1))this.options.minAmpl=Z.minAmplitude;else throw Y.invalidParameterError("minAmplitude","number between 0.001 and 1",Z.minAmplitude)}if(!Y.defined(Z))this.options.blurSigma=-1;else if(Y.bool(Z))this.options.blurSigma=Z?-1:0;else if(Y.number(W)&&Y.inRange(W,0.3,1000))this.options.blurSigma=W;else throw Y.invalidParameterError("sigma","number between 0.3 and 1000",W);return this}function BW(Z){if(!Y.defined(Z))this.options.dilateWidth=1;else if(Y.integer(Z)&&Z>0)this.options.dilateWidth=Z;else throw Y.invalidParameterError("dilate","positive integer",BW);return this}function HW(Z){if(!Y.defined(Z))this.options.erodeWidth=1;else if(Y.integer(Z)&&Z>0)this.options.erodeWidth=Z;else throw Y.invalidParameterError("erode","positive integer",HW);return this}function eU(Z){if(this.options.flatten=Y.bool(Z)?Z:!0,Y.object(Z))this._setBackgroundColourOption("flattenBackground",Z.background);return this}function Zq(){return this.options.unflatten=!0,this}function Wq(Z,W){if(!Y.defined(Z))this.options.gamma=2.2;else if(Y.number(Z)&&Y.inRange(Z,1,3))this.options.gamma=Z;else throw Y.invalidParameterError("gamma","number between 1.0 and 3.0",Z);if(!Y.defined(W))this.options.gammaOut=this.options.gamma;else if(Y.number(W)&&Y.inRange(W,1,3))this.options.gammaOut=W;else throw Y.invalidParameterError("gammaOut","number between 1.0 and 3.0",W);return this}function Xq(Z){if(this.options.negate=Y.bool(Z)?Z:!0,Y.plainObject(Z)&&"alpha"in Z)if(!Y.bool(Z.alpha))throw Y.invalidParameterError("alpha","should be boolean value",Z.alpha);else this.options.negateAlpha=Z.alpha;return this}function Qq(Z){if(Y.plainObject(Z)){if(Y.defined(Z.lower))if(Y.number(Z.lower)&&Y.inRange(Z.lower,0,99))this.options.normaliseLower=Z.lower;else throw Y.invalidParameterError("lower","number between 0 and 99",Z.lower);if(Y.defined(Z.upper))if(Y.number(Z.upper)&&Y.inRange(Z.upper,1,100))this.options.normaliseUpper=Z.upper;else throw Y.invalidParameterError("upper","number between 1 and 100",Z.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw Y.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function Jq(Z){return this.normalise(Z)}function Gq(Z){if(Y.plainObject(Z)){if(Y.integer(Z.width)&&Z.width>0)this.options.claheWidth=Z.width;else throw Y.invalidParameterError("width","integer greater than zero",Z.width);if(Y.integer(Z.height)&&Z.height>0)this.options.claheHeight=Z.height;else throw Y.invalidParameterError("height","integer greater than zero",Z.height);if(Y.defined(Z.maxSlope))if(Y.integer(Z.maxSlope)&&Y.inRange(Z.maxSlope,0,100))this.options.claheMaxSlope=Z.maxSlope;else throw Y.invalidParameterError("maxSlope","integer between 0 and 100",Z.maxSlope)}else throw Y.invalidParameterError("options","plain object",Z);return this}function zq(Z){if(!Y.object(Z)||!Array.isArray(Z.kernel)||!Y.integer(Z.width)||!Y.integer(Z.height)||!Y.inRange(Z.width,3,1001)||!Y.inRange(Z.height,3,1001)||Z.height*Z.width!==Z.kernel.length)throw Error("Invalid convolution kernel");if(!Y.integer(Z.scale))Z.scale=Z.kernel.reduce((W,X)=>W+X,0);if(Z.scale<1)Z.scale=1;if(!Y.integer(Z.offset))Z.offset=0;return this.options.convKernel=Z,this}function Yq(Z,W){if(!Y.defined(Z))this.options.threshold=128;else if(Y.bool(Z))this.options.threshold=Z?128:0;else if(Y.integer(Z)&&Y.inRange(Z,0,255))this.options.threshold=Z;else throw Y.invalidParameterError("threshold","integer between 0 and 255",Z);if(!Y.object(W)||W.greyscale===!0||W.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function Uq(Z,W,X){if(this.options.boolean=this._createInputDescriptor(Z,X),Y.string(W)&&Y.inArray(W,["and","or","eor"]))this.options.booleanOp=W;else throw Y.invalidParameterError("operator","one of: and, or, eor",W);return this}function qq(Z,W){if(!Y.defined(Z)&&Y.number(W))Z=1;else if(Y.number(Z)&&!Y.defined(W))W=0;if(!Y.defined(Z))this.options.linearA=[];else if(Y.number(Z))this.options.linearA=[Z];else if(Array.isArray(Z)&&Z.length&&Z.every(Y.number))this.options.linearA=Z;else throw Y.invalidParameterError("a","number or array of numbers",Z);if(!Y.defined(W))this.options.linearB=[];else if(Y.number(W))this.options.linearB=[W];else if(Array.isArray(W)&&W.length&&W.every(Y.number))this.options.linearB=W;else throw Y.invalidParameterError("b","number or array of numbers",W);if(this.options.linearA.length!==this.options.linearB.length)throw Error("Expected a and b to be arrays of the same length");return this}function Kq(Z){if(!Array.isArray(Z))throw Y.invalidParameterError("inputMatrix","array",Z);if(Z.length!==3&&Z.length!==4)throw Y.invalidParameterError("inputMatrix","3x3 or 4x4 array",Z.length);let W=Z.flat().map(Number);if(W.length!==9&&W.length!==16)throw Y.invalidParameterError("inputMatrix","cardinality of 9 or 16",W.length);return this.options.recombMatrix=W,this}function Vq(Z){if(!Y.plainObject(Z))throw Y.invalidParameterError("options","plain object",Z);if("brightness"in Z)if(Y.number(Z.brightness)&&Z.brightness>=0)this.options.brightness=Z.brightness;else throw Y.invalidParameterError("brightness","number above zero",Z.brightness);if("saturation"in Z)if(Y.number(Z.saturation)&&Z.saturation>=0)this.options.saturation=Z.saturation;else throw Y.invalidParameterError("saturation","number above zero",Z.saturation);if("hue"in Z)if(Y.integer(Z.hue))this.options.hue=Z.hue%360;else throw Y.invalidParameterError("hue","number",Z.hue);if("lightness"in Z)if(Y.number(Z.lightness))this.options.lightness=Z.lightness;else throw Y.invalidParameterError("lightness","number",Z.lightness);return this}var VW,$W=(Z)=>{Object.assign(Z.prototype,{autoOrient:nU,rotate:pU,flip:iU,flop:rU,affine:aU,sharpen:sU,erode:HW,dilate:BW,median:oU,blur:tU,flatten:eU,unflatten:Zq,gamma:Wq,negate:Xq,normalise:Qq,normalize:Jq,clahe:Gq,convolve:zq,threshold:Yq,boolean:Uq,linear:qq,recomb:Kq,modulate:Vq})};var FW=d(()=>{Q1();/*!
223
229
  Copyright 2013 Lovell Fuller and others.
224
230
  SPDX-License-Identifier: Apache-2.0
225
- */TX={integer:"integer",float:"float",approximate:"approximate"}});var SX=E((pM,kX)=>{var{defineProperty:j3,getOwnPropertyDescriptor:RV,getOwnPropertyNames:_V}=Object,PV=Object.prototype.hasOwnProperty,jV=(Z,X)=>{for(var q in X)j3(Z,q,{get:X[q],enumerable:!0})},EV=(Z,X,q,W)=>{if(X&&typeof X==="object"||typeof X==="function"){for(let Q of _V(X))if(!PV.call(Z,Q)&&Q!==q)j3(Z,Q,{get:()=>X[Q],enumerable:!(W=RV(X,Q))||W.enumerable})}return Z},CV=(Z)=>EV(j3({},"__esModule",{value:!0}),Z),EX={};jV(EX,{default:()=>cV});kX.exports=CV(EX);var T3={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let Z in T3)Object.freeze(T3[Z]);var p0=Object.freeze(T3),CX=Object.create(null);for(let Z in p0)if(Object.hasOwn(p0,Z))CX[p0[Z]]=Z;var A0={to:{},get:{}};A0.get=function(Z){let X=Z.slice(0,3).toLowerCase(),q,W;switch(X){case"hsl":{q=A0.get.hsl(Z),W="hsl";break}case"hwb":{q=A0.get.hwb(Z),W="hwb";break}default:{q=A0.get.rgb(Z),W="rgb";break}}if(!q)return null;return{model:W,value:q}};A0.get.rgb=function(Z){if(!Z)return null;let X=/^#([a-f\d]{3,4})$/i,q=/^#([a-f\d]{6})([a-f\d]{2})?$/i,W=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,Q=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,J=/^(\w+)$/,z=[0,0,0,1],Y,U,K;if(Y=Z.match(q)){K=Y[2],Y=Y[1];for(U=0;U<3;U++){let V=U*2;z[U]=Number.parseInt(Y.slice(V,V+2),16)}if(K)z[3]=Number.parseInt(K,16)/255}else if(Y=Z.match(X)){Y=Y[1],K=Y[3];for(U=0;U<3;U++)z[U]=Number.parseInt(Y[U]+Y[U],16);if(K)z[3]=Number.parseInt(K+K,16)/255}else if(Y=Z.match(W)){for(U=0;U<3;U++)z[U]=Number.parseFloat(Y[U+1]);if(Y[4])z[3]=Y[5]?Number.parseFloat(Y[4])*0.01:Number.parseFloat(Y[4])}else if(Y=Z.match(Q)){for(U=0;U<3;U++)z[U]=Math.round(Number.parseFloat(Y[U+1])*2.55);if(Y[4])z[3]=Y[5]?Number.parseFloat(Y[4])*0.01:Number.parseFloat(Y[4])}else if(Y=Z.toLowerCase().match(J)){if(Y[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(p0,Y[1]))return null;return z=p0[Y[1]].slice(),z[3]=1,z}else return null;for(U=0;U<3;U++)z[U]=F6(z[U],0,255);return z[3]=F6(z[3],0,1),z};A0.get.hsl=function(Z){if(!Z)return null;let X=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,q=Z.match(X);if(q){let W=Number.parseFloat(q[4]),Q=(Number.parseFloat(q[1])%360+360)%360,J=F6(Number.parseFloat(q[2]),0,100),z=F6(Number.parseFloat(q[3]),0,100),Y=F6(Number.isNaN(W)?1:W,0,1);return[Q,J,z,Y]}return null};A0.get.hwb=function(Z){if(!Z)return null;let X=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,q=Z.match(X);if(q){let W=Number.parseFloat(q[4]),Q=(Number.parseFloat(q[1])%360+360)%360,J=F6(Number.parseFloat(q[2]),0,100),z=F6(Number.parseFloat(q[3]),0,100),Y=F6(Number.isNaN(W)?1:W,0,1);return[Q,J,z,Y]}return null};A0.to.hex=function(...Z){return"#"+y1(Z[0])+y1(Z[1])+y1(Z[2])+(Z[3]<1?y1(Math.round(Z[3]*255)):"")};A0.to.rgb=function(...Z){return Z.length<4||Z[3]===1?"rgb("+Math.round(Z[0])+", "+Math.round(Z[1])+", "+Math.round(Z[2])+")":"rgba("+Math.round(Z[0])+", "+Math.round(Z[1])+", "+Math.round(Z[2])+", "+Z[3]+")"};A0.to.rgb.percent=function(...Z){let X=Math.round(Z[0]/255*100),q=Math.round(Z[1]/255*100),W=Math.round(Z[2]/255*100);return Z.length<4||Z[3]===1?"rgb("+X+"%, "+q+"%, "+W+"%)":"rgba("+X+"%, "+q+"%, "+W+"%, "+Z[3]+")"};A0.to.hsl=function(...Z){return Z.length<4||Z[3]===1?"hsl("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%)":"hsla("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%, "+Z[3]+")"};A0.to.hwb=function(...Z){let X="";if(Z.length>=4&&Z[3]!==1)X=", "+Z[3];return"hwb("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%"+X+")"};A0.to.keyword=function(...Z){return CX[Z.slice(0,3)]};function F6(Z,X,q){return Math.min(Math.max(X,Z),q)}function y1(Z){let X=Math.round(Z).toString(16).toUpperCase();return X.length<2?"0"+X:X}var W4=A0,OX={};for(let Z of Object.keys(p0))OX[p0[Z]]=Z;var w={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},k6=w,W6=0.008856451679035631;function J4(Z){let X=Z>0.0031308?1.055*Z**0.4166666666666667-0.055:Z*12.92;return Math.min(Math.max(0,X),1)}function z4(Z){return Z>0.04045?((Z+0.055)/1.055)**2.4:Z/12.92}for(let Z of Object.keys(w)){if(!("channels"in w[Z]))throw Error("missing channels property: "+Z);if(!("labels"in w[Z]))throw Error("missing channel labels property: "+Z);if(w[Z].labels.length!==w[Z].channels)throw Error("channel and label counts mismatch: "+Z);let{channels:X,labels:q}=w[Z];delete w[Z].channels,delete w[Z].labels,Object.defineProperty(w[Z],"channels",{value:X}),Object.defineProperty(w[Z],"labels",{value:q})}w.rgb.hsl=function(Z){let X=Z[0]/255,q=Z[1]/255,W=Z[2]/255,Q=Math.min(X,q,W),J=Math.max(X,q,W),z=J-Q,Y,U;switch(J){case Q:{Y=0;break}case X:{Y=(q-W)/z;break}case q:{Y=2+(W-X)/z;break}case W:{Y=4+(X-q)/z;break}}if(Y=Math.min(Y*60,360),Y<0)Y+=360;let K=(Q+J)/2;if(J===Q)U=0;else if(K<=0.5)U=z/(J+Q);else U=z/(2-J-Q);return[Y,U*100,K*100]};w.rgb.hsv=function(Z){let X,q,W,Q,J,z=Z[0]/255,Y=Z[1]/255,U=Z[2]/255,K=Math.max(z,Y,U),V=K-Math.min(z,Y,U),B=function(H){return(K-H)/6/V+0.5};if(V===0)Q=0,J=0;else{switch(J=V/K,X=B(z),q=B(Y),W=B(U),K){case z:{Q=W-q;break}case Y:{Q=0.3333333333333333+X-W;break}case U:{Q=0.6666666666666666+q-X;break}}if(Q<0)Q+=1;else if(Q>1)Q-=1}return[Q*360,J*100,K*100]};w.rgb.hwb=function(Z){let X=Z[0],q=Z[1],W=Z[2],Q=w.rgb.hsl(Z)[0],J=0.00392156862745098*Math.min(X,Math.min(q,W));return W=1-0.00392156862745098*Math.max(X,Math.max(q,W)),[Q,J*100,W*100]};w.rgb.oklab=function(Z){let X=z4(Z[0]/255),q=z4(Z[1]/255),W=z4(Z[2]/255),Q=Math.cbrt(0.4122214708*X+0.5363325363*q+0.0514459929*W),J=Math.cbrt(0.2119034982*X+0.6806995451*q+0.1073969566*W),z=Math.cbrt(0.0883024619*X+0.2817188376*q+0.6299787005*W),Y=0.2104542553*Q+0.793617785*J-0.0040720468*z,U=1.9779984951*Q-2.428592205*J+0.4505937099*z,K=0.0259040371*Q+0.7827717662*J-0.808675766*z;return[Y*100,U*100,K*100]};w.rgb.cmyk=function(Z){let X=Z[0]/255,q=Z[1]/255,W=Z[2]/255,Q=Math.min(1-X,1-q,1-W),J=(1-X-Q)/(1-Q)||0,z=(1-q-Q)/(1-Q)||0,Y=(1-W-Q)/(1-Q)||0;return[J*100,z*100,Y*100,Q*100]};function OV(Z,X){return(Z[0]-X[0])**2+(Z[1]-X[1])**2+(Z[2]-X[2])**2}w.rgb.keyword=function(Z){let X=OX[Z];if(X)return X;let q=Number.POSITIVE_INFINITY,W;for(let Q of Object.keys(p0)){let J=p0[Q],z=OV(Z,J);if(z<q)q=z,W=Q}return W};w.keyword.rgb=function(Z){return[...p0[Z]]};w.rgb.xyz=function(Z){let X=z4(Z[0]/255),q=z4(Z[1]/255),W=z4(Z[2]/255),Q=X*0.4124564+q*0.3575761+W*0.1804375,J=X*0.2126729+q*0.7151522+W*0.072175,z=X*0.0193339+q*0.119192+W*0.9503041;return[Q*100,J*100,z*100]};w.rgb.lab=function(Z){let X=w.rgb.xyz(Z),q=X[0],W=X[1],Q=X[2];q/=95.047,W/=100,Q/=108.883,q=q>W6?q**0.3333333333333333:7.787*q+0.13793103448275862,W=W>W6?W**0.3333333333333333:7.787*W+0.13793103448275862,Q=Q>W6?Q**0.3333333333333333:7.787*Q+0.13793103448275862;let J=116*W-16,z=500*(q-W),Y=200*(W-Q);return[J,z,Y]};w.hsl.rgb=function(Z){let X=Z[0]/360,q=Z[1]/100,W=Z[2]/100,Q,J;if(q===0)return J=W*255,[J,J,J];let z=W<0.5?W*(1+q):W+q-W*q,Y=2*W-z,U=[0,0,0];for(let K=0;K<3;K++){if(Q=X+0.3333333333333333*-(K-1),Q<0)Q++;if(Q>1)Q--;if(6*Q<1)J=Y+(z-Y)*6*Q;else if(2*Q<1)J=z;else if(3*Q<2)J=Y+(z-Y)*(0.6666666666666666-Q)*6;else J=Y;U[K]=J*255}return U};w.hsl.hsv=function(Z){let X=Z[0],q=Z[1]/100,W=Z[2]/100,Q=q,J=Math.max(W,0.01);W*=2,q*=W<=1?W:2-W,Q*=J<=1?J:2-J;let z=(W+q)/2,Y=W===0?2*Q/(J+Q):2*q/(W+q);return[X,Y*100,z*100]};w.hsv.rgb=function(Z){let X=Z[0]/60,q=Z[1]/100,W=Z[2]/100,Q=Math.floor(X)%6,J=X-Math.floor(X),z=255*W*(1-q),Y=255*W*(1-q*J),U=255*W*(1-q*(1-J));switch(W*=255,Q){case 0:return[W,U,z];case 1:return[Y,W,z];case 2:return[z,W,U];case 3:return[z,Y,W];case 4:return[U,z,W];case 5:return[W,z,Y]}};w.hsv.hsl=function(Z){let X=Z[0],q=Z[1]/100,W=Z[2]/100,Q=Math.max(W,0.01),J,z;z=(2-q)*W;let Y=(2-q)*Q;return J=q*Q,J/=Y<=1?Y:2-Y,J=J||0,z/=2,[X,J*100,z*100]};w.hwb.rgb=function(Z){let X=Z[0]/360,q=Z[1]/100,W=Z[2]/100,Q=q+W,J;if(Q>1)q/=Q,W/=Q;let z=Math.floor(6*X),Y=1-W;if(J=6*X-z,(z&1)!==0)J=1-J;let U=q+J*(Y-q),K,V,B;switch(z){default:case 6:case 0:{K=Y,V=U,B=q;break}case 1:{K=U,V=Y,B=q;break}case 2:{K=q,V=Y,B=U;break}case 3:{K=q,V=U,B=Y;break}case 4:{K=U,V=q,B=Y;break}case 5:{K=Y,V=q,B=U;break}}return[K*255,V*255,B*255]};w.cmyk.rgb=function(Z){let X=Z[0]/100,q=Z[1]/100,W=Z[2]/100,Q=Z[3]/100,J=1-Math.min(1,X*(1-Q)+Q),z=1-Math.min(1,q*(1-Q)+Q),Y=1-Math.min(1,W*(1-Q)+Q);return[J*255,z*255,Y*255]};w.xyz.rgb=function(Z){let X=Z[0]/100,q=Z[1]/100,W=Z[2]/100,Q,J,z;return Q=X*3.2404542+q*-1.5371385+W*-0.4985314,J=X*-0.969266+q*1.8760108+W*0.041556,z=X*0.0556434+q*-0.2040259+W*1.0572252,Q=J4(Q),J=J4(J),z=J4(z),[Q*255,J*255,z*255]};w.xyz.lab=function(Z){let X=Z[0],q=Z[1],W=Z[2];X/=95.047,q/=100,W/=108.883,X=X>W6?X**0.3333333333333333:7.787*X+0.13793103448275862,q=q>W6?q**0.3333333333333333:7.787*q+0.13793103448275862,W=W>W6?W**0.3333333333333333:7.787*W+0.13793103448275862;let Q=116*q-16,J=500*(X-q),z=200*(q-W);return[Q,J,z]};w.xyz.oklab=function(Z){let X=Z[0]/100,q=Z[1]/100,W=Z[2]/100,Q=Math.cbrt(0.8189330101*X+0.3618667424*q-0.1288597137*W),J=Math.cbrt(0.0329845436*X+0.9293118715*q+0.0361456387*W),z=Math.cbrt(0.0482003018*X+0.2643662691*q+0.633851707*W),Y=0.2104542553*Q+0.793617785*J-0.0040720468*z,U=1.9779984951*Q-2.428592205*J+0.4505937099*z,K=0.0259040371*Q+0.7827717662*J-0.808675766*z;return[Y*100,U*100,K*100]};w.oklab.oklch=function(Z){return w.lab.lch(Z)};w.oklab.xyz=function(Z){let X=Z[0]/100,q=Z[1]/100,W=Z[2]/100,Q=(0.999999998*X+0.396337792*q+0.215803758*W)**3,J=(1.000000008*X-0.105561342*q-0.063854175*W)**3,z=(1.000000055*X-0.089484182*q-1.291485538*W)**3,Y=1.227013851*Q-0.55779998*J+0.281256149*z,U=-0.040580178*Q+1.11225687*J-0.071676679*z,K=-0.076381285*Q-0.421481978*J+1.58616322*z;return[Y*100,U*100,K*100]};w.oklab.rgb=function(Z){let X=Z[0]/100,q=Z[1]/100,W=Z[2]/100,Q=(X+0.3963377774*q+0.2158037573*W)**3,J=(X-0.1055613458*q-0.0638541728*W)**3,z=(X-0.0894841775*q-1.291485548*W)**3,Y=J4(4.0767416621*Q-3.3077115913*J+0.2309699292*z),U=J4(-1.2684380046*Q+2.6097574011*J-0.3413193965*z),K=J4(-0.0041960863*Q-0.7034186147*J+1.707614701*z);return[Y*255,U*255,K*255]};w.oklch.oklab=function(Z){return w.lch.lab(Z)};w.lab.xyz=function(Z){let X=Z[0],q=Z[1],W=Z[2],Q,J,z;J=(X+16)/116,Q=q/500+J,z=J-W/200;let Y=J**3,U=Q**3,K=z**3;return J=Y>W6?Y:(J-0.13793103448275862)/7.787,Q=U>W6?U:(Q-0.13793103448275862)/7.787,z=K>W6?K:(z-0.13793103448275862)/7.787,Q*=95.047,J*=100,z*=108.883,[Q,J,z]};w.lab.lch=function(Z){let X=Z[0],q=Z[1],W=Z[2],Q;if(Q=Math.atan2(W,q)*360/2/Math.PI,Q<0)Q+=360;let z=Math.sqrt(q*q+W*W);return[X,z,Q]};w.lch.lab=function(Z){let X=Z[0],q=Z[1],Q=Z[2]/360*2*Math.PI,J=q*Math.cos(Q),z=q*Math.sin(Q);return[X,J,z]};w.rgb.ansi16=function(Z,X=null){let[q,W,Q]=Z,J=X===null?w.rgb.hsv(Z)[2]:X;if(J=Math.round(J/50),J===0)return 30;let z=30+(Math.round(Q/255)<<2|Math.round(W/255)<<1|Math.round(q/255));if(J===2)z+=60;return z};w.hsv.ansi16=function(Z){return w.rgb.ansi16(w.hsv.rgb(Z),Z[2])};w.rgb.ansi256=function(Z){let X=Z[0],q=Z[1],W=Z[2];if(X>>4===q>>4&&q>>4===W>>4){if(X<8)return 16;if(X>248)return 231;return Math.round((X-8)/247*24)+232}return 16+36*Math.round(X/255*5)+6*Math.round(q/255*5)+Math.round(W/255*5)};w.ansi16.rgb=function(Z){Z=Z[0];let X=Z%10;if(X===0||X===7){if(Z>50)X+=3.5;return X=X/10.5*255,[X,X,X]}let q=(Math.trunc(Z>50)+1)*0.5,W=(X&1)*q*255,Q=(X>>1&1)*q*255,J=(X>>2&1)*q*255;return[W,Q,J]};w.ansi256.rgb=function(Z){if(Z=Z[0],Z>=232){let J=(Z-232)*10+8;return[J,J,J]}Z-=16;let X,q=Math.floor(Z/36)/5*255,W=Math.floor((X=Z%36)/6)/5*255,Q=X%6/5*255;return[q,W,Q]};w.rgb.hex=function(Z){let q=(((Math.round(Z[0])&255)<<16)+((Math.round(Z[1])&255)<<8)+(Math.round(Z[2])&255)).toString(16).toUpperCase();return"000000".slice(q.length)+q};w.hex.rgb=function(Z){let X=Z.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!X)return[0,0,0];let q=X[0];if(X[0].length===3)q=[...q].map((Y)=>Y+Y).join("");let W=Number.parseInt(q,16),Q=W>>16&255,J=W>>8&255,z=W&255;return[Q,J,z]};w.rgb.hcg=function(Z){let X=Z[0]/255,q=Z[1]/255,W=Z[2]/255,Q=Math.max(Math.max(X,q),W),J=Math.min(Math.min(X,q),W),z=Q-J,Y,U=z<1?J/(1-z):0;if(z<=0)Y=0;else if(Q===X)Y=(q-W)/z%6;else if(Q===q)Y=2+(W-X)/z;else Y=4+(X-q)/z;return Y/=6,Y%=1,[Y*360,z*100,U*100]};w.hsl.hcg=function(Z){let X=Z[1]/100,q=Z[2]/100,W=q<0.5?2*X*q:2*X*(1-q),Q=0;if(W<1)Q=(q-0.5*W)/(1-W);return[Z[0],W*100,Q*100]};w.hsv.hcg=function(Z){let X=Z[1]/100,q=Z[2]/100,W=X*q,Q=0;if(W<1)Q=(q-W)/(1-W);return[Z[0],W*100,Q*100]};w.hcg.rgb=function(Z){let X=Z[0]/360,q=Z[1]/100,W=Z[2]/100;if(q===0)return[W*255,W*255,W*255];let Q=[0,0,0],J=X%1*6,z=J%1,Y=1-z,U=0;switch(Math.floor(J)){case 0:{Q[0]=1,Q[1]=z,Q[2]=0;break}case 1:{Q[0]=Y,Q[1]=1,Q[2]=0;break}case 2:{Q[0]=0,Q[1]=1,Q[2]=z;break}case 3:{Q[0]=0,Q[1]=Y,Q[2]=1;break}case 4:{Q[0]=z,Q[1]=0,Q[2]=1;break}default:Q[0]=1,Q[1]=0,Q[2]=Y}return U=(1-q)*W,[(q*Q[0]+U)*255,(q*Q[1]+U)*255,(q*Q[2]+U)*255]};w.hcg.hsv=function(Z){let X=Z[1]/100,q=Z[2]/100,W=X+q*(1-X),Q=0;if(W>0)Q=X/W;return[Z[0],Q*100,W*100]};w.hcg.hsl=function(Z){let X=Z[1]/100,W=Z[2]/100*(1-X)+0.5*X,Q=0;if(W>0&&W<0.5)Q=X/(2*W);else if(W>=0.5&&W<1)Q=X/(2*(1-W));return[Z[0],Q*100,W*100]};w.hcg.hwb=function(Z){let X=Z[1]/100,q=Z[2]/100,W=X+q*(1-X);return[Z[0],(W-X)*100,(1-W)*100]};w.hwb.hcg=function(Z){let X=Z[1]/100,W=1-Z[2]/100,Q=W-X,J=0;if(Q<1)J=(W-Q)/(1-Q);return[Z[0],Q*100,J*100]};w.apple.rgb=function(Z){return[Z[0]/65535*255,Z[1]/65535*255,Z[2]/65535*255]};w.rgb.apple=function(Z){return[Z[0]/255*65535,Z[1]/255*65535,Z[2]/255*65535]};w.gray.rgb=function(Z){return[Z[0]/100*255,Z[0]/100*255,Z[0]/100*255]};w.gray.hsl=function(Z){return[0,0,Z[0]]};w.gray.hsv=w.gray.hsl;w.gray.hwb=function(Z){return[0,100,Z[0]]};w.gray.cmyk=function(Z){return[0,0,0,Z[0]]};w.gray.lab=function(Z){return[Z[0],0,0]};w.gray.hex=function(Z){let X=Math.round(Z[0]/100*255)&255,W=((X<<16)+(X<<8)+X).toString(16).toUpperCase();return"000000".slice(W.length)+W};w.rgb.gray=function(Z){return[(Z[0]+Z[1]+Z[2])/3/255*100]};function xV(){let Z={},X=Object.keys(k6);for(let{length:q}=X,W=0;W<q;W++)Z[X[W]]={distance:-1,parent:null};return Z}function kV(Z){let X=xV(),q=[Z];X[Z].distance=0;while(q.length>0){let W=q.pop(),Q=Object.keys(k6[W]);for(let{length:J}=Q,z=0;z<J;z++){let Y=Q[z],U=X[Y];if(U.distance===-1)U.distance=X[W].distance+1,U.parent=W,q.unshift(Y)}}return X}function SV(Z,X){return function(q){return X(Z(q))}}function bV(Z,X){let q=[X[Z].parent,Z],W=k6[X[Z].parent][Z],Q=X[Z].parent;while(X[Q].parent)q.unshift(X[Q].parent),W=SV(k6[X[Q].parent][Q],W),Q=X[Q].parent;return W.conversion=q,W}function vV(Z){let X=kV(Z),q={},W=Object.keys(X);for(let{length:Q}=W,J=0;J<Q;J++){let z=W[J];if(X[z].parent===null)continue;q[z]=bV(z,X)}return q}var yV=vV,Q4={},gV=Object.keys(k6);function hV(Z){let X=function(...q){let W=q[0];if(W===void 0||W===null)return W;if(W.length>1)q=W;return Z(q)};if("conversion"in Z)X.conversion=Z.conversion;return X}function mV(Z){let X=function(...q){let W=q[0];if(W===void 0||W===null)return W;if(W.length>1)q=W;let Q=Z(q);if(typeof Q==="object")for(let{length:J}=Q,z=0;z<J;z++)Q[z]=Math.round(Q[z]);return Q};if("conversion"in Z)X.conversion=Z.conversion;return X}for(let Z of gV){Q4[Z]={},Object.defineProperty(Q4[Z],"channels",{value:k6[Z].channels}),Object.defineProperty(Q4[Z],"labels",{value:k6[Z].labels});let X=yV(Z),q=Object.keys(X);for(let W of q){let Q=X[W];Q4[Z][W]=mV(Q),Q4[Z][W].raw=hV(Q)}}var D0=Q4,xX=["keyword","gray","hex"],R3={};for(let Z of Object.keys(D0))R3[[...D0[Z].labels].sort().join("")]=Z;var _3={};function Z0(Z,X){if(!(this instanceof Z0))return new Z0(Z,X);if(X&&X in xX)X=null;if(X&&!(X in D0))throw Error("Unknown model: "+X);let q,W;if(Z==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(Z instanceof Z0)this.model=Z.model,this.color=[...Z.color],this.valpha=Z.valpha;else if(typeof Z==="string"){let Q=W4.get(Z);if(Q===null)throw Error("Unable to parse color from string: "+Z);this.model=Q.model,W=D0[this.model].channels,this.color=Q.value.slice(0,W),this.valpha=typeof Q.value[W]==="number"?Q.value[W]:1}else if(Z.length>0){this.model=X||"rgb",W=D0[this.model].channels;let Q=Array.prototype.slice.call(Z,0,W);this.color=P3(Q,W),this.valpha=typeof Z[W]==="number"?Z[W]:1}else if(typeof Z==="number")this.model="rgb",this.color=[Z>>16&255,Z>>8&255,Z&255],this.valpha=1;else{this.valpha=1;let Q=Object.keys(Z);if("alpha"in Z)Q.splice(Q.indexOf("alpha"),1),this.valpha=typeof Z.alpha==="number"?Z.alpha:0;let J=Q.sort().join("");if(!(J in R3))throw Error("Unable to parse color from object: "+JSON.stringify(Z));this.model=R3[J];let{labels:z}=D0[this.model],Y=[];for(q=0;q<z.length;q++)Y.push(Z[z[q]]);this.color=P3(Y)}if(_3[this.model]){W=D0[this.model].channels;for(q=0;q<W;q++){let Q=_3[this.model][q];if(Q)this.color[q]=Q(this.color[q])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}Z0.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(Z){let X=this.model in W4.to?this:this.rgb();X=X.round(typeof Z==="number"?Z:1);let q=X.valpha===1?X.color:[...X.color,this.valpha];return W4.to[X.model](...q)},percentString(Z){let X=this.rgb().round(typeof Z==="number"?Z:1),q=X.valpha===1?X.color:[...X.color,this.valpha];return W4.to.rgb.percent(...q)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let Z={},{channels:X}=D0[this.model],{labels:q}=D0[this.model];for(let W=0;W<X;W++)Z[q[W]]=this.color[W];if(this.valpha!==1)Z.alpha=this.valpha;return Z},unitArray(){let Z=this.rgb().color;if(Z[0]/=255,Z[1]/=255,Z[2]/=255,this.valpha!==1)Z.push(this.valpha);return Z},unitObject(){let Z=this.rgb().object();if(Z.r/=255,Z.g/=255,Z.b/=255,this.valpha!==1)Z.alpha=this.valpha;return Z},round(Z){return Z=Math.max(Z||0,0),new Z0([...this.color.map(uV(Z)),this.valpha],this.model)},alpha(Z){if(Z!==void 0)return new Z0([...this.color,Math.max(0,Math.min(1,Z))],this.model);return this.valpha},red:c("rgb",0,t(255)),green:c("rgb",1,t(255)),blue:c("rgb",2,t(255)),hue:c(["hsl","hsv","hsl","hwb","hcg"],0,(Z)=>(Z%360+360)%360),saturationl:c("hsl",1,t(100)),lightness:c("hsl",2,t(100)),saturationv:c("hsv",1,t(100)),value:c("hsv",2,t(100)),chroma:c("hcg",1,t(100)),gray:c("hcg",2,t(100)),white:c("hwb",1,t(100)),wblack:c("hwb",2,t(100)),cyan:c("cmyk",0,t(100)),magenta:c("cmyk",1,t(100)),yellow:c("cmyk",2,t(100)),black:c("cmyk",3,t(100)),x:c("xyz",0,t(95.047)),y:c("xyz",1,t(100)),z:c("xyz",2,t(108.833)),l:c("lab",0,t(100)),a:c("lab",1),b:c("lab",2),keyword(Z){if(Z!==void 0)return new Z0(Z);return D0[this.model].keyword(this.color)},hex(Z){if(Z!==void 0)return new Z0(Z);return W4.to.hex(...this.rgb().round().color)},hexa(Z){if(Z!==void 0)return new Z0(Z);let X=this.rgb().round().color,q=Math.round(this.valpha*255).toString(16).toUpperCase();if(q.length===1)q="0"+q;return W4.to.hex(...X)+q},rgbNumber(){let Z=this.rgb().color;return(Z[0]&255)<<16|(Z[1]&255)<<8|Z[2]&255},luminosity(){let Z=this.rgb().color,X=[];for(let[q,W]of Z.entries()){let Q=W/255;X[q]=Q<=0.04045?Q/12.92:((Q+0.055)/1.055)**2.4}return 0.2126*X[0]+0.7152*X[1]+0.0722*X[2]},contrast(Z){let X=this.luminosity(),q=Z.luminosity();if(X>q)return(X+0.05)/(q+0.05);return(q+0.05)/(X+0.05)},level(Z){let X=this.contrast(Z);if(X>=7)return"AAA";return X>=4.5?"AA":""},isDark(){let Z=this.rgb().color;return(Z[0]*2126+Z[1]*7152+Z[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let Z=this.rgb();for(let X=0;X<3;X++)Z.color[X]=255-Z.color[X];return Z},lighten(Z){let X=this.hsl();return X.color[2]+=X.color[2]*Z,X},darken(Z){let X=this.hsl();return X.color[2]-=X.color[2]*Z,X},saturate(Z){let X=this.hsl();return X.color[1]+=X.color[1]*Z,X},desaturate(Z){let X=this.hsl();return X.color[1]-=X.color[1]*Z,X},whiten(Z){let X=this.hwb();return X.color[1]+=X.color[1]*Z,X},blacken(Z){let X=this.hwb();return X.color[2]+=X.color[2]*Z,X},grayscale(){let Z=this.rgb().color,X=Z[0]*0.3+Z[1]*0.59+Z[2]*0.11;return Z0.rgb(X,X,X)},fade(Z){return this.alpha(this.valpha-this.valpha*Z)},opaquer(Z){return this.alpha(this.valpha+this.valpha*Z)},rotate(Z){let X=this.hsl(),q=X.color[0];return q=(q+Z)%360,q=q<0?360+q:q,X.color[0]=q,X},mix(Z,X){if(!Z||!Z.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof Z);let q=Z.rgb(),W=this.rgb(),Q=X===void 0?0.5:X,J=2*Q-1,z=q.alpha()-W.alpha(),Y=((J*z===-1?J:(J+z)/(1+J*z))+1)/2,U=1-Y;return Z0.rgb(Y*q.red()+U*W.red(),Y*q.green()+U*W.green(),Y*q.blue()+U*W.blue(),q.alpha()*Q+W.alpha()*(1-Q))}};for(let Z of Object.keys(D0)){if(xX.includes(Z))continue;let{channels:X}=D0[Z];Z0.prototype[Z]=function(...q){if(this.model===Z)return new Z0(this);if(q.length>0)return new Z0(q,Z);return new Z0([...dV(D0[this.model][Z].raw(this.color)),this.valpha],Z)},Z0[Z]=function(...q){let W=q[0];if(typeof W==="number")W=P3(q,X);return new Z0(W,Z)}}function fV(Z,X){return Number(Z.toFixed(X))}function uV(Z){return function(X){return fV(X,Z)}}function c(Z,X,q){Z=Array.isArray(Z)?Z:[Z];for(let W of Z)(_3[W]||=[])[X]=q;return Z=Z[0],function(W){let Q;if(W!==void 0){if(q)W=q(W);return Q=this[Z](),Q.color[X]=W,Q}if(Q=this[Z]().color[X],q)Q=q(Q);return Q}}function t(Z){return function(X){return Math.max(0,Math.min(Z,X))}}function dV(Z){return Array.isArray(Z)?Z:[Z]}function P3(Z,X){for(let q=0;q<X;q++)if(typeof Z[q]!=="number")Z[q]=0;return Z}var cV=Z0});var vX=E((nM,bX)=>{bX.exports=SX().default});function lV(Z){return this._setBackgroundColourOption("tint",Z),this}function pV(Z){return this.options.greyscale=G.bool(Z)?Z:!0,this}function nV(Z){return this.greyscale(Z)}function iV(Z){if(!G.string(Z))throw G.invalidParameterError("colourspace","string",Z);return this.options.colourspacePipeline=Z,this}function rV(Z){return this.pipelineColourspace(Z)}function aV(Z){if(!G.string(Z))throw G.invalidParameterError("colourspace","string",Z);return this.options.colourspace=Z,this}function sV(Z){return this.toColourspace(Z)}function hX(Z){if(G.object(Z)||G.string(Z)&&Z.length>=3&&Z.length<=200){let X=gX.default(Z);return[X.red(),X.green(),X.blue(),Math.round(X.alpha()*255)]}else throw G.invalidParameterError("background","object or string",Z)}function oV(Z,X){if(G.defined(X))this.options[Z]=hX(X)}var gX,yX,mX=(Z)=>{Object.assign(Z.prototype,{tint:lV,greyscale:pV,grayscale:nV,pipelineColourspace:iV,pipelineColorspace:rV,toColourspace:aV,toColorspace:sV,_getBackgroundColourOption:hX,_setBackgroundColourOption:oV}),Z.colourspace=yX,Z.colorspace=yX};var fX=R(()=>{m0();gX=B4(vX(),1);/*!
231
+ */VW={integer:"integer",float:"float",approximate:"approximate"}});var NW=i((tF,wW)=>{var{defineProperty:r3,getOwnPropertyDescriptor:Bq,getOwnPropertyNames:Hq}=Object,$q=Object.prototype.hasOwnProperty,Fq=(Z,W)=>{for(var X in W)r3(Z,X,{get:W[X],enumerable:!0})},Lq=(Z,W,X,Q)=>{if(W&&typeof W==="object"||typeof W==="function"){for(let J of Hq(W))if(!$q.call(Z,J)&&J!==X)r3(Z,J,{get:()=>W[J],enumerable:!(Q=Bq(W,J))||Q.enumerable})}return Z},Aq=(Z)=>Lq(r3({},"__esModule",{value:!0}),Z),LW={};Fq(LW,{default:()=>xq});wW.exports=Aq(LW);var l3={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let Z in l3)Object.freeze(l3[Z]);var q1=Object.freeze(l3),AW=Object.create(null);for(let Z in q1)if(Object.hasOwn(q1,Z))AW[q1[Z]]=Z;var v0={to:{},get:{}};v0.get=function(Z){let W=Z.slice(0,3).toLowerCase(),X,Q;switch(W){case"hsl":{X=v0.get.hsl(Z),Q="hsl";break}case"hwb":{X=v0.get.hwb(Z),Q="hwb";break}default:{X=v0.get.rgb(Z),Q="rgb";break}}if(!X)return null;return{model:Q,value:X}};v0.get.rgb=function(Z){if(!Z)return null;let W=/^#([a-f\d]{3,4})$/i,X=/^#([a-f\d]{6})([a-f\d]{2})?$/i,Q=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,J=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,G=/^(\w+)$/,z=[0,0,0,1],q,K,V;if(q=Z.match(X)){V=q[2],q=q[1];for(K=0;K<3;K++){let H=K*2;z[K]=Number.parseInt(q.slice(H,H+2),16)}if(V)z[3]=Number.parseInt(V,16)/255}else if(q=Z.match(W)){q=q[1],V=q[3];for(K=0;K<3;K++)z[K]=Number.parseInt(q[K]+q[K],16);if(V)z[3]=Number.parseInt(V+V,16)/255}else if(q=Z.match(Q)){for(K=0;K<3;K++)z[K]=Number.parseFloat(q[K+1]);if(q[4])z[3]=q[5]?Number.parseFloat(q[4])*0.01:Number.parseFloat(q[4])}else if(q=Z.match(J)){for(K=0;K<3;K++)z[K]=Math.round(Number.parseFloat(q[K+1])*2.55);if(q[4])z[3]=q[5]?Number.parseFloat(q[4])*0.01:Number.parseFloat(q[4])}else if(q=Z.toLowerCase().match(G)){if(q[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(q1,q[1]))return null;return z=q1[q[1]].slice(),z[3]=1,z}else return null;for(K=0;K<3;K++)z[K]=f1(z[K],0,255);return z[3]=f1(z[3],0,1),z};v0.get.hsl=function(Z){if(!Z)return null;let W=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,X=Z.match(W);if(X){let Q=Number.parseFloat(X[4]),J=(Number.parseFloat(X[1])%360+360)%360,G=f1(Number.parseFloat(X[2]),0,100),z=f1(Number.parseFloat(X[3]),0,100),q=f1(Number.isNaN(Q)?1:Q,0,1);return[J,G,z,q]}return null};v0.get.hwb=function(Z){if(!Z)return null;let W=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,X=Z.match(W);if(X){let Q=Number.parseFloat(X[4]),J=(Number.parseFloat(X[1])%360+360)%360,G=f1(Number.parseFloat(X[2]),0,100),z=f1(Number.parseFloat(X[3]),0,100),q=f1(Number.isNaN(Q)?1:Q,0,1);return[J,G,z,q]}return null};v0.to.hex=function(...Z){return"#"+K2(Z[0])+K2(Z[1])+K2(Z[2])+(Z[3]<1?K2(Math.round(Z[3]*255)):"")};v0.to.rgb=function(...Z){return Z.length<4||Z[3]===1?"rgb("+Math.round(Z[0])+", "+Math.round(Z[1])+", "+Math.round(Z[2])+")":"rgba("+Math.round(Z[0])+", "+Math.round(Z[1])+", "+Math.round(Z[2])+", "+Z[3]+")"};v0.to.rgb.percent=function(...Z){let W=Math.round(Z[0]/255*100),X=Math.round(Z[1]/255*100),Q=Math.round(Z[2]/255*100);return Z.length<4||Z[3]===1?"rgb("+W+"%, "+X+"%, "+Q+"%)":"rgba("+W+"%, "+X+"%, "+Q+"%, "+Z[3]+")"};v0.to.hsl=function(...Z){return Z.length<4||Z[3]===1?"hsl("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%)":"hsla("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%, "+Z[3]+")"};v0.to.hwb=function(...Z){let W="";if(Z.length>=4&&Z[3]!==1)W=", "+Z[3];return"hwb("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%"+W+")"};v0.to.keyword=function(...Z){return AW[Z.slice(0,3)]};function f1(Z,W,X){return Math.min(Math.max(W,Z),X)}function K2(Z){let W=Math.round(Z).toString(16).toUpperCase();return W.length<2?"0"+W:W}var D6=v0,MW={};for(let Z of Object.keys(q1))MW[q1[Z]]=Z;var v={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},t1=v,_1=0.008856451679035631;function R6(Z){let W=Z>0.0031308?1.055*Z**0.4166666666666667-0.055:Z*12.92;return Math.min(Math.max(0,W),1)}function P6(Z){return Z>0.04045?((Z+0.055)/1.055)**2.4:Z/12.92}for(let Z of Object.keys(v)){if(!("channels"in v[Z]))throw Error("missing channels property: "+Z);if(!("labels"in v[Z]))throw Error("missing channel labels property: "+Z);if(v[Z].labels.length!==v[Z].channels)throw Error("channel and label counts mismatch: "+Z);let{channels:W,labels:X}=v[Z];delete v[Z].channels,delete v[Z].labels,Object.defineProperty(v[Z],"channels",{value:W}),Object.defineProperty(v[Z],"labels",{value:X})}v.rgb.hsl=function(Z){let W=Z[0]/255,X=Z[1]/255,Q=Z[2]/255,J=Math.min(W,X,Q),G=Math.max(W,X,Q),z=G-J,q,K;switch(G){case J:{q=0;break}case W:{q=(X-Q)/z;break}case X:{q=2+(Q-W)/z;break}case Q:{q=4+(W-X)/z;break}}if(q=Math.min(q*60,360),q<0)q+=360;let V=(J+G)/2;if(G===J)K=0;else if(V<=0.5)K=z/(G+J);else K=z/(2-G-J);return[q,K*100,V*100]};v.rgb.hsv=function(Z){let W,X,Q,J,G,z=Z[0]/255,q=Z[1]/255,K=Z[2]/255,V=Math.max(z,q,K),H=V-Math.min(z,q,K),B=function($){return(V-$)/6/H+0.5};if(H===0)J=0,G=0;else{switch(G=H/V,W=B(z),X=B(q),Q=B(K),V){case z:{J=Q-X;break}case q:{J=0.3333333333333333+W-Q;break}case K:{J=0.6666666666666666+X-W;break}}if(J<0)J+=1;else if(J>1)J-=1}return[J*360,G*100,V*100]};v.rgb.hwb=function(Z){let W=Z[0],X=Z[1],Q=Z[2],J=v.rgb.hsl(Z)[0],G=0.00392156862745098*Math.min(W,Math.min(X,Q));return Q=1-0.00392156862745098*Math.max(W,Math.max(X,Q)),[J,G*100,Q*100]};v.rgb.oklab=function(Z){let W=P6(Z[0]/255),X=P6(Z[1]/255),Q=P6(Z[2]/255),J=Math.cbrt(0.4122214708*W+0.5363325363*X+0.0514459929*Q),G=Math.cbrt(0.2119034982*W+0.6806995451*X+0.1073969566*Q),z=Math.cbrt(0.0883024619*W+0.2817188376*X+0.6299787005*Q),q=0.2104542553*J+0.793617785*G-0.0040720468*z,K=1.9779984951*J-2.428592205*G+0.4505937099*z,V=0.0259040371*J+0.7827717662*G-0.808675766*z;return[q*100,K*100,V*100]};v.rgb.cmyk=function(Z){let W=Z[0]/255,X=Z[1]/255,Q=Z[2]/255,J=Math.min(1-W,1-X,1-Q),G=(1-W-J)/(1-J)||0,z=(1-X-J)/(1-J)||0,q=(1-Q-J)/(1-J)||0;return[G*100,z*100,q*100,J*100]};function Mq(Z,W){return(Z[0]-W[0])**2+(Z[1]-W[1])**2+(Z[2]-W[2])**2}v.rgb.keyword=function(Z){let W=MW[Z];if(W)return W;let X=Number.POSITIVE_INFINITY,Q;for(let J of Object.keys(q1)){let G=q1[J],z=Mq(Z,G);if(z<X)X=z,Q=J}return Q};v.keyword.rgb=function(Z){return[...q1[Z]]};v.rgb.xyz=function(Z){let W=P6(Z[0]/255),X=P6(Z[1]/255),Q=P6(Z[2]/255),J=W*0.4124564+X*0.3575761+Q*0.1804375,G=W*0.2126729+X*0.7151522+Q*0.072175,z=W*0.0193339+X*0.119192+Q*0.9503041;return[J*100,G*100,z*100]};v.rgb.lab=function(Z){let W=v.rgb.xyz(Z),X=W[0],Q=W[1],J=W[2];X/=95.047,Q/=100,J/=108.883,X=X>_1?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>_1?Q**0.3333333333333333:7.787*Q+0.13793103448275862,J=J>_1?J**0.3333333333333333:7.787*J+0.13793103448275862;let G=116*Q-16,z=500*(X-Q),q=200*(Q-J);return[G,z,q]};v.hsl.rgb=function(Z){let W=Z[0]/360,X=Z[1]/100,Q=Z[2]/100,J,G;if(X===0)return G=Q*255,[G,G,G];let z=Q<0.5?Q*(1+X):Q+X-Q*X,q=2*Q-z,K=[0,0,0];for(let V=0;V<3;V++){if(J=W+0.3333333333333333*-(V-1),J<0)J++;if(J>1)J--;if(6*J<1)G=q+(z-q)*6*J;else if(2*J<1)G=z;else if(3*J<2)G=q+(z-q)*(0.6666666666666666-J)*6;else G=q;K[V]=G*255}return K};v.hsl.hsv=function(Z){let W=Z[0],X=Z[1]/100,Q=Z[2]/100,J=X,G=Math.max(Q,0.01);Q*=2,X*=Q<=1?Q:2-Q,J*=G<=1?G:2-G;let z=(Q+X)/2,q=Q===0?2*J/(G+J):2*X/(Q+X);return[W,q*100,z*100]};v.hsv.rgb=function(Z){let W=Z[0]/60,X=Z[1]/100,Q=Z[2]/100,J=Math.floor(W)%6,G=W-Math.floor(W),z=255*Q*(1-X),q=255*Q*(1-X*G),K=255*Q*(1-X*(1-G));switch(Q*=255,J){case 0:return[Q,K,z];case 1:return[q,Q,z];case 2:return[z,Q,K];case 3:return[z,q,Q];case 4:return[K,z,Q];case 5:return[Q,z,q]}};v.hsv.hsl=function(Z){let W=Z[0],X=Z[1]/100,Q=Z[2]/100,J=Math.max(Q,0.01),G,z;z=(2-X)*Q;let q=(2-X)*J;return G=X*J,G/=q<=1?q:2-q,G=G||0,z/=2,[W,G*100,z*100]};v.hwb.rgb=function(Z){let W=Z[0]/360,X=Z[1]/100,Q=Z[2]/100,J=X+Q,G;if(J>1)X/=J,Q/=J;let z=Math.floor(6*W),q=1-Q;if(G=6*W-z,(z&1)!==0)G=1-G;let K=X+G*(q-X),V,H,B;switch(z){default:case 6:case 0:{V=q,H=K,B=X;break}case 1:{V=K,H=q,B=X;break}case 2:{V=X,H=q,B=K;break}case 3:{V=X,H=K,B=q;break}case 4:{V=K,H=X,B=q;break}case 5:{V=q,H=X,B=K;break}}return[V*255,H*255,B*255]};v.cmyk.rgb=function(Z){let W=Z[0]/100,X=Z[1]/100,Q=Z[2]/100,J=Z[3]/100,G=1-Math.min(1,W*(1-J)+J),z=1-Math.min(1,X*(1-J)+J),q=1-Math.min(1,Q*(1-J)+J);return[G*255,z*255,q*255]};v.xyz.rgb=function(Z){let W=Z[0]/100,X=Z[1]/100,Q=Z[2]/100,J,G,z;return J=W*3.2404542+X*-1.5371385+Q*-0.4985314,G=W*-0.969266+X*1.8760108+Q*0.041556,z=W*0.0556434+X*-0.2040259+Q*1.0572252,J=R6(J),G=R6(G),z=R6(z),[J*255,G*255,z*255]};v.xyz.lab=function(Z){let W=Z[0],X=Z[1],Q=Z[2];W/=95.047,X/=100,Q/=108.883,W=W>_1?W**0.3333333333333333:7.787*W+0.13793103448275862,X=X>_1?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>_1?Q**0.3333333333333333:7.787*Q+0.13793103448275862;let J=116*X-16,G=500*(W-X),z=200*(X-Q);return[J,G,z]};v.xyz.oklab=function(Z){let W=Z[0]/100,X=Z[1]/100,Q=Z[2]/100,J=Math.cbrt(0.8189330101*W+0.3618667424*X-0.1288597137*Q),G=Math.cbrt(0.0329845436*W+0.9293118715*X+0.0361456387*Q),z=Math.cbrt(0.0482003018*W+0.2643662691*X+0.633851707*Q),q=0.2104542553*J+0.793617785*G-0.0040720468*z,K=1.9779984951*J-2.428592205*G+0.4505937099*z,V=0.0259040371*J+0.7827717662*G-0.808675766*z;return[q*100,K*100,V*100]};v.oklab.oklch=function(Z){return v.lab.lch(Z)};v.oklab.xyz=function(Z){let W=Z[0]/100,X=Z[1]/100,Q=Z[2]/100,J=(0.999999998*W+0.396337792*X+0.215803758*Q)**3,G=(1.000000008*W-0.105561342*X-0.063854175*Q)**3,z=(1.000000055*W-0.089484182*X-1.291485538*Q)**3,q=1.227013851*J-0.55779998*G+0.281256149*z,K=-0.040580178*J+1.11225687*G-0.071676679*z,V=-0.076381285*J-0.421481978*G+1.58616322*z;return[q*100,K*100,V*100]};v.oklab.rgb=function(Z){let W=Z[0]/100,X=Z[1]/100,Q=Z[2]/100,J=(W+0.3963377774*X+0.2158037573*Q)**3,G=(W-0.1055613458*X-0.0638541728*Q)**3,z=(W-0.0894841775*X-1.291485548*Q)**3,q=R6(4.0767416621*J-3.3077115913*G+0.2309699292*z),K=R6(-1.2684380046*J+2.6097574011*G-0.3413193965*z),V=R6(-0.0041960863*J-0.7034186147*G+1.707614701*z);return[q*255,K*255,V*255]};v.oklch.oklab=function(Z){return v.lch.lab(Z)};v.lab.xyz=function(Z){let W=Z[0],X=Z[1],Q=Z[2],J,G,z;G=(W+16)/116,J=X/500+G,z=G-Q/200;let q=G**3,K=J**3,V=z**3;return G=q>_1?q:(G-0.13793103448275862)/7.787,J=K>_1?K:(J-0.13793103448275862)/7.787,z=V>_1?V:(z-0.13793103448275862)/7.787,J*=95.047,G*=100,z*=108.883,[J,G,z]};v.lab.lch=function(Z){let W=Z[0],X=Z[1],Q=Z[2],J;if(J=Math.atan2(Q,X)*360/2/Math.PI,J<0)J+=360;let z=Math.sqrt(X*X+Q*Q);return[W,z,J]};v.lch.lab=function(Z){let W=Z[0],X=Z[1],J=Z[2]/360*2*Math.PI,G=X*Math.cos(J),z=X*Math.sin(J);return[W,G,z]};v.rgb.ansi16=function(Z,W=null){let[X,Q,J]=Z,G=W===null?v.rgb.hsv(Z)[2]:W;if(G=Math.round(G/50),G===0)return 30;let z=30+(Math.round(J/255)<<2|Math.round(Q/255)<<1|Math.round(X/255));if(G===2)z+=60;return z};v.hsv.ansi16=function(Z){return v.rgb.ansi16(v.hsv.rgb(Z),Z[2])};v.rgb.ansi256=function(Z){let W=Z[0],X=Z[1],Q=Z[2];if(W>>4===X>>4&&X>>4===Q>>4){if(W<8)return 16;if(W>248)return 231;return Math.round((W-8)/247*24)+232}return 16+36*Math.round(W/255*5)+6*Math.round(X/255*5)+Math.round(Q/255*5)};v.ansi16.rgb=function(Z){Z=Z[0];let W=Z%10;if(W===0||W===7){if(Z>50)W+=3.5;return W=W/10.5*255,[W,W,W]}let X=(Math.trunc(Z>50)+1)*0.5,Q=(W&1)*X*255,J=(W>>1&1)*X*255,G=(W>>2&1)*X*255;return[Q,J,G]};v.ansi256.rgb=function(Z){if(Z=Z[0],Z>=232){let G=(Z-232)*10+8;return[G,G,G]}Z-=16;let W,X=Math.floor(Z/36)/5*255,Q=Math.floor((W=Z%36)/6)/5*255,J=W%6/5*255;return[X,Q,J]};v.rgb.hex=function(Z){let X=(((Math.round(Z[0])&255)<<16)+((Math.round(Z[1])&255)<<8)+(Math.round(Z[2])&255)).toString(16).toUpperCase();return"000000".slice(X.length)+X};v.hex.rgb=function(Z){let W=Z.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!W)return[0,0,0];let X=W[0];if(W[0].length===3)X=[...X].map((q)=>q+q).join("");let Q=Number.parseInt(X,16),J=Q>>16&255,G=Q>>8&255,z=Q&255;return[J,G,z]};v.rgb.hcg=function(Z){let W=Z[0]/255,X=Z[1]/255,Q=Z[2]/255,J=Math.max(Math.max(W,X),Q),G=Math.min(Math.min(W,X),Q),z=J-G,q,K=z<1?G/(1-z):0;if(z<=0)q=0;else if(J===W)q=(X-Q)/z%6;else if(J===X)q=2+(Q-W)/z;else q=4+(W-X)/z;return q/=6,q%=1,[q*360,z*100,K*100]};v.hsl.hcg=function(Z){let W=Z[1]/100,X=Z[2]/100,Q=X<0.5?2*W*X:2*W*(1-X),J=0;if(Q<1)J=(X-0.5*Q)/(1-Q);return[Z[0],Q*100,J*100]};v.hsv.hcg=function(Z){let W=Z[1]/100,X=Z[2]/100,Q=W*X,J=0;if(Q<1)J=(X-Q)/(1-Q);return[Z[0],Q*100,J*100]};v.hcg.rgb=function(Z){let W=Z[0]/360,X=Z[1]/100,Q=Z[2]/100;if(X===0)return[Q*255,Q*255,Q*255];let J=[0,0,0],G=W%1*6,z=G%1,q=1-z,K=0;switch(Math.floor(G)){case 0:{J[0]=1,J[1]=z,J[2]=0;break}case 1:{J[0]=q,J[1]=1,J[2]=0;break}case 2:{J[0]=0,J[1]=1,J[2]=z;break}case 3:{J[0]=0,J[1]=q,J[2]=1;break}case 4:{J[0]=z,J[1]=0,J[2]=1;break}default:J[0]=1,J[1]=0,J[2]=q}return K=(1-X)*Q,[(X*J[0]+K)*255,(X*J[1]+K)*255,(X*J[2]+K)*255]};v.hcg.hsv=function(Z){let W=Z[1]/100,X=Z[2]/100,Q=W+X*(1-W),J=0;if(Q>0)J=W/Q;return[Z[0],J*100,Q*100]};v.hcg.hsl=function(Z){let W=Z[1]/100,Q=Z[2]/100*(1-W)+0.5*W,J=0;if(Q>0&&Q<0.5)J=W/(2*Q);else if(Q>=0.5&&Q<1)J=W/(2*(1-Q));return[Z[0],J*100,Q*100]};v.hcg.hwb=function(Z){let W=Z[1]/100,X=Z[2]/100,Q=W+X*(1-W);return[Z[0],(Q-W)*100,(1-Q)*100]};v.hwb.hcg=function(Z){let W=Z[1]/100,Q=1-Z[2]/100,J=Q-W,G=0;if(J<1)G=(Q-J)/(1-J);return[Z[0],J*100,G*100]};v.apple.rgb=function(Z){return[Z[0]/65535*255,Z[1]/65535*255,Z[2]/65535*255]};v.rgb.apple=function(Z){return[Z[0]/255*65535,Z[1]/255*65535,Z[2]/255*65535]};v.gray.rgb=function(Z){return[Z[0]/100*255,Z[0]/100*255,Z[0]/100*255]};v.gray.hsl=function(Z){return[0,0,Z[0]]};v.gray.hsv=v.gray.hsl;v.gray.hwb=function(Z){return[0,100,Z[0]]};v.gray.cmyk=function(Z){return[0,0,0,Z[0]]};v.gray.lab=function(Z){return[Z[0],0,0]};v.gray.hex=function(Z){let W=Math.round(Z[0]/100*255)&255,Q=((W<<16)+(W<<8)+W).toString(16).toUpperCase();return"000000".slice(Q.length)+Q};v.rgb.gray=function(Z){return[(Z[0]+Z[1]+Z[2])/3/255*100]};function Iq(){let Z={},W=Object.keys(t1);for(let{length:X}=W,Q=0;Q<X;Q++)Z[W[Q]]={distance:-1,parent:null};return Z}function wq(Z){let W=Iq(),X=[Z];W[Z].distance=0;while(X.length>0){let Q=X.pop(),J=Object.keys(t1[Q]);for(let{length:G}=J,z=0;z<G;z++){let q=J[z],K=W[q];if(K.distance===-1)K.distance=W[Q].distance+1,K.parent=Q,X.unshift(q)}}return W}function Nq(Z,W){return function(X){return W(Z(X))}}function Dq(Z,W){let X=[W[Z].parent,Z],Q=t1[W[Z].parent][Z],J=W[Z].parent;while(W[J].parent)X.unshift(W[J].parent),Q=Nq(t1[W[J].parent][J],Q),J=W[J].parent;return Q.conversion=X,Q}function Tq(Z){let W=wq(Z),X={},Q=Object.keys(W);for(let{length:J}=Q,G=0;G<J;G++){let z=Q[G];if(W[z].parent===null)continue;X[z]=Dq(z,W)}return X}var Rq=Tq,T6={},Pq=Object.keys(t1);function _q(Z){let W=function(...X){let Q=X[0];if(Q===void 0||Q===null)return Q;if(Q.length>1)X=Q;return Z(X)};if("conversion"in Z)W.conversion=Z.conversion;return W}function jq(Z){let W=function(...X){let Q=X[0];if(Q===void 0||Q===null)return Q;if(Q.length>1)X=Q;let J=Z(X);if(typeof J==="object")for(let{length:G}=J,z=0;z<G;z++)J[z]=Math.round(J[z]);return J};if("conversion"in Z)W.conversion=Z.conversion;return W}for(let Z of Pq){T6[Z]={},Object.defineProperty(T6[Z],"channels",{value:t1[Z].channels}),Object.defineProperty(T6[Z],"labels",{value:t1[Z].labels});let W=Rq(Z),X=Object.keys(W);for(let Q of X){let J=W[Q];T6[Z][Q]=jq(J),T6[Z][Q].raw=_q(J)}}var u0=T6,IW=["keyword","gray","hex"],p3={};for(let Z of Object.keys(u0))p3[[...u0[Z].labels].sort().join("")]=Z;var n3={};function D0(Z,W){if(!(this instanceof D0))return new D0(Z,W);if(W&&W in IW)W=null;if(W&&!(W in u0))throw Error("Unknown model: "+W);let X,Q;if(Z==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(Z instanceof D0)this.model=Z.model,this.color=[...Z.color],this.valpha=Z.valpha;else if(typeof Z==="string"){let J=D6.get(Z);if(J===null)throw Error("Unable to parse color from string: "+Z);this.model=J.model,Q=u0[this.model].channels,this.color=J.value.slice(0,Q),this.valpha=typeof J.value[Q]==="number"?J.value[Q]:1}else if(Z.length>0){this.model=W||"rgb",Q=u0[this.model].channels;let J=Array.prototype.slice.call(Z,0,Q);this.color=i3(J,Q),this.valpha=typeof Z[Q]==="number"?Z[Q]:1}else if(typeof Z==="number")this.model="rgb",this.color=[Z>>16&255,Z>>8&255,Z&255],this.valpha=1;else{this.valpha=1;let J=Object.keys(Z);if("alpha"in Z)J.splice(J.indexOf("alpha"),1),this.valpha=typeof Z.alpha==="number"?Z.alpha:0;let G=J.sort().join("");if(!(G in p3))throw Error("Unable to parse color from object: "+JSON.stringify(Z));this.model=p3[G];let{labels:z}=u0[this.model],q=[];for(X=0;X<z.length;X++)q.push(Z[z[X]]);this.color=i3(q)}if(n3[this.model]){Q=u0[this.model].channels;for(X=0;X<Q;X++){let J=n3[this.model][X];if(J)this.color[X]=J(this.color[X])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}D0.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(Z){let W=this.model in D6.to?this:this.rgb();W=W.round(typeof Z==="number"?Z:1);let X=W.valpha===1?W.color:[...W.color,this.valpha];return D6.to[W.model](...X)},percentString(Z){let W=this.rgb().round(typeof Z==="number"?Z:1),X=W.valpha===1?W.color:[...W.color,this.valpha];return D6.to.rgb.percent(...X)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let Z={},{channels:W}=u0[this.model],{labels:X}=u0[this.model];for(let Q=0;Q<W;Q++)Z[X[Q]]=this.color[Q];if(this.valpha!==1)Z.alpha=this.valpha;return Z},unitArray(){let Z=this.rgb().color;if(Z[0]/=255,Z[1]/=255,Z[2]/=255,this.valpha!==1)Z.push(this.valpha);return Z},unitObject(){let Z=this.rgb().object();if(Z.r/=255,Z.g/=255,Z.b/=255,this.valpha!==1)Z.alpha=this.valpha;return Z},round(Z){return Z=Math.max(Z||0,0),new D0([...this.color.map(Cq(Z)),this.valpha],this.model)},alpha(Z){if(Z!==void 0)return new D0([...this.color,Math.max(0,Math.min(1,Z))],this.model);return this.valpha},red:H0("rgb",0,w0(255)),green:H0("rgb",1,w0(255)),blue:H0("rgb",2,w0(255)),hue:H0(["hsl","hsv","hsl","hwb","hcg"],0,(Z)=>(Z%360+360)%360),saturationl:H0("hsl",1,w0(100)),lightness:H0("hsl",2,w0(100)),saturationv:H0("hsv",1,w0(100)),value:H0("hsv",2,w0(100)),chroma:H0("hcg",1,w0(100)),gray:H0("hcg",2,w0(100)),white:H0("hwb",1,w0(100)),wblack:H0("hwb",2,w0(100)),cyan:H0("cmyk",0,w0(100)),magenta:H0("cmyk",1,w0(100)),yellow:H0("cmyk",2,w0(100)),black:H0("cmyk",3,w0(100)),x:H0("xyz",0,w0(95.047)),y:H0("xyz",1,w0(100)),z:H0("xyz",2,w0(108.833)),l:H0("lab",0,w0(100)),a:H0("lab",1),b:H0("lab",2),keyword(Z){if(Z!==void 0)return new D0(Z);return u0[this.model].keyword(this.color)},hex(Z){if(Z!==void 0)return new D0(Z);return D6.to.hex(...this.rgb().round().color)},hexa(Z){if(Z!==void 0)return new D0(Z);let W=this.rgb().round().color,X=Math.round(this.valpha*255).toString(16).toUpperCase();if(X.length===1)X="0"+X;return D6.to.hex(...W)+X},rgbNumber(){let Z=this.rgb().color;return(Z[0]&255)<<16|(Z[1]&255)<<8|Z[2]&255},luminosity(){let Z=this.rgb().color,W=[];for(let[X,Q]of Z.entries()){let J=Q/255;W[X]=J<=0.04045?J/12.92:((J+0.055)/1.055)**2.4}return 0.2126*W[0]+0.7152*W[1]+0.0722*W[2]},contrast(Z){let W=this.luminosity(),X=Z.luminosity();if(W>X)return(W+0.05)/(X+0.05);return(X+0.05)/(W+0.05)},level(Z){let W=this.contrast(Z);if(W>=7)return"AAA";return W>=4.5?"AA":""},isDark(){let Z=this.rgb().color;return(Z[0]*2126+Z[1]*7152+Z[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let Z=this.rgb();for(let W=0;W<3;W++)Z.color[W]=255-Z.color[W];return Z},lighten(Z){let W=this.hsl();return W.color[2]+=W.color[2]*Z,W},darken(Z){let W=this.hsl();return W.color[2]-=W.color[2]*Z,W},saturate(Z){let W=this.hsl();return W.color[1]+=W.color[1]*Z,W},desaturate(Z){let W=this.hsl();return W.color[1]-=W.color[1]*Z,W},whiten(Z){let W=this.hwb();return W.color[1]+=W.color[1]*Z,W},blacken(Z){let W=this.hwb();return W.color[2]+=W.color[2]*Z,W},grayscale(){let Z=this.rgb().color,W=Z[0]*0.3+Z[1]*0.59+Z[2]*0.11;return D0.rgb(W,W,W)},fade(Z){return this.alpha(this.valpha-this.valpha*Z)},opaquer(Z){return this.alpha(this.valpha+this.valpha*Z)},rotate(Z){let W=this.hsl(),X=W.color[0];return X=(X+Z)%360,X=X<0?360+X:X,W.color[0]=X,W},mix(Z,W){if(!Z||!Z.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof Z);let X=Z.rgb(),Q=this.rgb(),J=W===void 0?0.5:W,G=2*J-1,z=X.alpha()-Q.alpha(),q=((G*z===-1?G:(G+z)/(1+G*z))+1)/2,K=1-q;return D0.rgb(q*X.red()+K*Q.red(),q*X.green()+K*Q.green(),q*X.blue()+K*Q.blue(),X.alpha()*J+Q.alpha()*(1-J))}};for(let Z of Object.keys(u0)){if(IW.includes(Z))continue;let{channels:W}=u0[Z];D0.prototype[Z]=function(...X){if(this.model===Z)return new D0(this);if(X.length>0)return new D0(X,Z);return new D0([...Oq(u0[this.model][Z].raw(this.color)),this.valpha],Z)},D0[Z]=function(...X){let Q=X[0];if(typeof Q==="number")Q=i3(X,W);return new D0(Q,Z)}}function Eq(Z,W){return Number(Z.toFixed(W))}function Cq(Z){return function(W){return Eq(W,Z)}}function H0(Z,W,X){Z=Array.isArray(Z)?Z:[Z];for(let Q of Z)(n3[Q]||=[])[W]=X;return Z=Z[0],function(Q){let J;if(Q!==void 0){if(X)Q=X(Q);return J=this[Z](),J.color[W]=Q,J}if(J=this[Z]().color[W],X)J=X(J);return J}}function w0(Z){return function(W){return Math.max(0,Math.min(Z,W))}}function Oq(Z){return Array.isArray(Z)?Z:[Z]}function i3(Z,W){for(let X=0;X<W;X++)if(typeof Z[X]!=="number")Z[X]=0;return Z}var xq=D0});var TW=i((eF,DW)=>{DW.exports=NW().default});function kq(Z){return this._setBackgroundColourOption("tint",Z),this}function Sq(Z){return this.options.greyscale=Y.bool(Z)?Z:!0,this}function bq(Z){return this.greyscale(Z)}function vq(Z){if(!Y.string(Z))throw Y.invalidParameterError("colourspace","string",Z);return this.options.colourspacePipeline=Z,this}function yq(Z){return this.pipelineColourspace(Z)}function gq(Z){if(!Y.string(Z))throw Y.invalidParameterError("colourspace","string",Z);return this.options.colourspace=Z,this}function hq(Z){return this.toColourspace(Z)}function _W(Z){if(Y.object(Z)||Y.string(Z)&&Z.length>=3&&Z.length<=200){let W=PW.default(Z);return[W.red(),W.green(),W.blue(),Math.round(W.alpha()*255)]}else throw Y.invalidParameterError("background","object or string",Z)}function fq(Z,W){if(Y.defined(W))this.options[Z]=_W(W)}var PW,RW,jW=(Z)=>{Object.assign(Z.prototype,{tint:kq,greyscale:Sq,grayscale:bq,pipelineColourspace:vq,pipelineColorspace:yq,toColourspace:gq,toColorspace:hq,_getBackgroundColourOption:_W,_setBackgroundColourOption:fq}),Z.colourspace=RW,Z.colorspace=RW};var EW=d(()=>{Q1();PW=v6(TW(),1);/*!
226
232
  Copyright 2013 Lovell Fuller and others.
227
233
  SPDX-License-Identifier: Apache-2.0
228
- */yX={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"}});function eV(){return this.options.removeAlpha=!0,this}function ZB(Z){if(G.defined(Z))if(G.number(Z)&&G.inRange(Z,0,1))this.options.ensureAlpha=Z;else throw G.invalidParameterError("alpha","number between 0 and 1",Z);else this.options.ensureAlpha=1;return this}function XB(Z){let X={red:0,green:1,blue:2,alpha:3};if(Object.keys(X).includes(Z))Z=X[Z];if(G.integer(Z)&&G.inRange(Z,0,4))this.options.extractChannel=Z;else throw G.invalidParameterError("channel","integer or one of: red, green, blue, alpha",Z);return this}function qB(Z,X){if(Array.isArray(Z))Z.forEach(function(q){this.options.joinChannelIn.push(this._createInputDescriptor(q,X))},this);else this.options.joinChannelIn.push(this._createInputDescriptor(Z,X));return this}function WB(Z){if(G.string(Z)&&G.inArray(Z,["and","or","eor"]))this.options.bandBoolOp=Z;else throw G.invalidParameterError("boolOp","one of: and, or, eor",Z);return this}var tV,uX=(Z)=>{Object.assign(Z.prototype,{removeAlpha:eV,ensureAlpha:ZB,extractChannel:XB,joinChannel:qB,bandbool:WB}),Z.bool=tV};var dX=R(()=>{m0();/*!
234
+ */RW={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"}});function uq(){return this.options.removeAlpha=!0,this}function dq(Z){if(Y.defined(Z))if(Y.number(Z)&&Y.inRange(Z,0,1))this.options.ensureAlpha=Z;else throw Y.invalidParameterError("alpha","number between 0 and 1",Z);else this.options.ensureAlpha=1;return this}function cq(Z){let W={red:0,green:1,blue:2,alpha:3};if(Object.keys(W).includes(Z))Z=W[Z];if(Y.integer(Z)&&Y.inRange(Z,0,4))this.options.extractChannel=Z;else throw Y.invalidParameterError("channel","integer or one of: red, green, blue, alpha",Z);return this}function lq(Z,W){if(Array.isArray(Z))Z.forEach(function(X){this.options.joinChannelIn.push(this._createInputDescriptor(X,W))},this);else this.options.joinChannelIn.push(this._createInputDescriptor(Z,W));return this}function pq(Z){if(Y.string(Z)&&Y.inArray(Z,["and","or","eor"]))this.options.bandBoolOp=Z;else throw Y.invalidParameterError("boolOp","one of: and, or, eor",Z);return this}var mq,CW=(Z)=>{Object.assign(Z.prototype,{removeAlpha:uq,ensureAlpha:dq,extractChannel:cq,joinChannel:lq,bandbool:pq}),Z.bool=mq};var OW=d(()=>{Q1();/*!
229
235
  Copyright 2013 Lovell Fuller and others.
230
236
  SPDX-License-Identifier: Apache-2.0
231
- */tV={and:"and",or:"or",eor:"eor"}});import E3 from"node:path";function JB(Z,X){let q;if(!G.string(Z))q=Error("Missing output file path");else if(G.string(this.options.input.file)&&E3.resolve(this.options.input.file)===E3.resolve(Z))q=Error("Cannot use same file for input and output");else if(QB.test(E3.extname(Z))&&!this.constructor.format.jp2.output.file)q=lX();if(q)if(G.fn(X))X(q);else return Promise.reject(q);else{this.options.fileOut=Z;let W=Error();return this._pipeline(X,W)}return this}function zB(Z,X){if(G.object(Z))this._setBooleanOption("resolveWithObject",Z.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let q=Error();return this._pipeline(G.fn(Z)?Z:X,q)}function GB(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let Z=Error();return this._pipeline(null,Z)}function YB(Z){if(G.number(Z)&&Z>0)this.options.withMetadataDensity=Z;else throw G.invalidParameterError("density","positive number",Z);return this.keepExif()}function UB(){return this.options.keepMetadata|=1,this}function KB(Z){if(G.object(Z))for(let[X,q]of Object.entries(Z))if(G.object(q))for(let[W,Q]of Object.entries(q))if(G.string(Q))this.options.withExif[`exif-${X.toLowerCase()}-${W}`]=Q;else throw G.invalidParameterError(`${X}.${W}`,"string",Q);else throw G.invalidParameterError(X,"object",q);else throw G.invalidParameterError("exif","object",Z);return this.options.withExifMerge=!1,this.keepExif()}function VB(Z){return this.withExif(Z),this.options.withExifMerge=!0,this}function BB(){return this.options.keepMetadata|=8,this}function HB(Z,X){if(G.string(Z))this.options.withIccProfile=Z;else throw G.invalidParameterError("icc","string",Z);if(this.keepIccProfile(),G.object(X)){if(G.defined(X.attach))if(G.bool(X.attach)){if(!X.attach)this.options.keepMetadata&=-9}else throw G.invalidParameterError("attach","boolean",X.attach)}return this}function $B(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function FB(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function AB(){return this.options.keepMetadata|=2,this}function MB(Z){if(G.string(Z)&&Z.length>0)this.options.withXmp=Z,this.options.keepMetadata|=2;else throw G.invalidParameterError("xmp","non-empty string",Z);return this}function LB(){return this.options.keepMetadata|=31,this}function IB(Z){if(this.keepMetadata(),this.withIccProfile("srgb"),G.object(Z)){if(G.defined(Z.orientation))if(G.integer(Z.orientation)&&G.inRange(Z.orientation,1,8))this.options.withMetadataOrientation=Z.orientation;else throw G.invalidParameterError("orientation","integer between 1 and 8",Z.orientation);if(G.defined(Z.density))if(G.number(Z.density)&&Z.density>0)this.options.withMetadataDensity=Z.density;else throw G.invalidParameterError("density","positive number",Z.density);if(G.defined(Z.icc))this.withIccProfile(Z.icc);if(G.defined(Z.exif))this.withExifMerge(Z.exif)}return this}function wB(Z,X){let q=cX.get((G.object(Z)&&G.string(Z.id)?Z.id:Z).toLowerCase());if(!q)throw G.invalidParameterError("format",`one of: ${[...cX.keys()].join(", ")}`,Z);return this[q](X)}function DB(Z){if(G.object(Z)){if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,1,100))this.options.jpegQuality=Z.quality;else throw G.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(G.defined(Z.progressive))this._setBooleanOption("jpegProgressive",Z.progressive);if(G.defined(Z.chromaSubsampling))if(G.string(Z.chromaSubsampling)&&G.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=Z.chromaSubsampling;else throw G.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);let X=G.bool(Z.optimizeCoding)?Z.optimizeCoding:Z.optimiseCoding;if(G.defined(X))this._setBooleanOption("jpegOptimiseCoding",X);if(G.defined(Z.mozjpeg))if(G.bool(Z.mozjpeg)){if(Z.mozjpeg)this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3}else throw G.invalidParameterError("mozjpeg","boolean",Z.mozjpeg);let q=G.bool(Z.trellisQuantization)?Z.trellisQuantization:Z.trellisQuantisation;if(G.defined(q))this._setBooleanOption("jpegTrellisQuantisation",q);if(G.defined(Z.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",Z.overshootDeringing);let W=G.bool(Z.optimizeScans)?Z.optimizeScans:Z.optimiseScans;if(G.defined(W)){if(this._setBooleanOption("jpegOptimiseScans",W),W)this.options.jpegProgressive=!0}let Q=G.number(Z.quantizationTable)?Z.quantizationTable:Z.quantisationTable;if(G.defined(Q))if(G.integer(Q)&&G.inRange(Q,0,8))this.options.jpegQuantisationTable=Q;else throw G.invalidParameterError("quantisationTable","integer between 0 and 8",Q)}return this._updateFormatOut("jpeg",Z)}function NB(Z){if(G.object(Z)){if(G.defined(Z.progressive))this._setBooleanOption("pngProgressive",Z.progressive);if(G.defined(Z.compressionLevel))if(G.integer(Z.compressionLevel)&&G.inRange(Z.compressionLevel,0,9))this.options.pngCompressionLevel=Z.compressionLevel;else throw G.invalidParameterError("compressionLevel","integer between 0 and 9",Z.compressionLevel);if(G.defined(Z.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",Z.adaptiveFiltering);let X=Z.colours||Z.colors;if(G.defined(X))if(G.integer(X)&&G.inRange(X,2,256))this.options.pngBitdepth=pX(X);else throw G.invalidParameterError("colours","integer between 2 and 256",X);if(G.defined(Z.palette))this._setBooleanOption("pngPalette",Z.palette);else if([Z.quality,Z.effort,Z.colours,Z.colors,Z.dither].some(G.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,0,100))this.options.pngQuality=Z.quality;else throw G.invalidParameterError("quality","integer between 0 and 100",Z.quality);if(G.defined(Z.effort))if(G.integer(Z.effort)&&G.inRange(Z.effort,1,10))this.options.pngEffort=Z.effort;else throw G.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(G.defined(Z.dither))if(G.number(Z.dither)&&G.inRange(Z.dither,0,1))this.options.pngDither=Z.dither;else throw G.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither)}}return this._updateFormatOut("png",Z)}function TB(Z){if(G.object(Z)){if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,1,100))this.options.webpQuality=Z.quality;else throw G.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(G.defined(Z.alphaQuality))if(G.integer(Z.alphaQuality)&&G.inRange(Z.alphaQuality,0,100))this.options.webpAlphaQuality=Z.alphaQuality;else throw G.invalidParameterError("alphaQuality","integer between 0 and 100",Z.alphaQuality);if(G.defined(Z.lossless))this._setBooleanOption("webpLossless",Z.lossless);if(G.defined(Z.nearLossless))this._setBooleanOption("webpNearLossless",Z.nearLossless);if(G.defined(Z.smartSubsample))this._setBooleanOption("webpSmartSubsample",Z.smartSubsample);if(G.defined(Z.smartDeblock))this._setBooleanOption("webpSmartDeblock",Z.smartDeblock);if(G.defined(Z.preset))if(G.string(Z.preset)&&G.inArray(Z.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=Z.preset;else throw G.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",Z.preset);if(G.defined(Z.effort))if(G.integer(Z.effort)&&G.inRange(Z.effort,0,6))this.options.webpEffort=Z.effort;else throw G.invalidParameterError("effort","integer between 0 and 6",Z.effort);if(G.defined(Z.minSize))this._setBooleanOption("webpMinSize",Z.minSize);if(G.defined(Z.mixed))this._setBooleanOption("webpMixed",Z.mixed);if(G.defined(Z.exact))this._setBooleanOption("webpExact",Z.exact)}return C3(Z,this.options),this._updateFormatOut("webp",Z)}function RB(Z){if(G.object(Z)){if(G.defined(Z.reuse))this._setBooleanOption("gifReuse",Z.reuse);if(G.defined(Z.progressive))this._setBooleanOption("gifProgressive",Z.progressive);let X=Z.colours||Z.colors;if(G.defined(X))if(G.integer(X)&&G.inRange(X,2,256))this.options.gifBitdepth=pX(X);else throw G.invalidParameterError("colours","integer between 2 and 256",X);if(G.defined(Z.effort))if(G.number(Z.effort)&&G.inRange(Z.effort,1,10))this.options.gifEffort=Z.effort;else throw G.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(G.defined(Z.dither))if(G.number(Z.dither)&&G.inRange(Z.dither,0,1))this.options.gifDither=Z.dither;else throw G.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither);if(G.defined(Z.interFrameMaxError))if(G.number(Z.interFrameMaxError)&&G.inRange(Z.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=Z.interFrameMaxError;else throw G.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",Z.interFrameMaxError);if(G.defined(Z.interPaletteMaxError))if(G.number(Z.interPaletteMaxError)&&G.inRange(Z.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=Z.interPaletteMaxError;else throw G.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",Z.interPaletteMaxError);if(G.defined(Z.keepDuplicateFrames))if(G.bool(Z.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",Z.keepDuplicateFrames);else throw G.invalidParameterError("keepDuplicateFrames","boolean",Z.keepDuplicateFrames)}return C3(Z,this.options),this._updateFormatOut("gif",Z)}function _B(Z){if(!this.constructor.format.jp2.output.buffer)throw lX();if(G.object(Z)){if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,1,100))this.options.jp2Quality=Z.quality;else throw G.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(G.defined(Z.lossless))if(G.bool(Z.lossless))this.options.jp2Lossless=Z.lossless;else throw G.invalidParameterError("lossless","boolean",Z.lossless);if(G.defined(Z.tileWidth))if(G.integer(Z.tileWidth)&&G.inRange(Z.tileWidth,1,32768))this.options.jp2TileWidth=Z.tileWidth;else throw G.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if(G.defined(Z.tileHeight))if(G.integer(Z.tileHeight)&&G.inRange(Z.tileHeight,1,32768))this.options.jp2TileHeight=Z.tileHeight;else throw G.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if(G.defined(Z.chromaSubsampling))if(G.string(Z.chromaSubsampling)&&G.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=Z.chromaSubsampling;else throw G.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling)}return this._updateFormatOut("jp2",Z)}function C3(Z,X){if(G.object(Z)&&G.defined(Z.loop))if(G.integer(Z.loop)&&G.inRange(Z.loop,0,65535))X.loop=Z.loop;else throw G.invalidParameterError("loop","integer between 0 and 65535",Z.loop);if(G.object(Z)&&G.defined(Z.delay))if(G.integer(Z.delay)&&G.inRange(Z.delay,0,65535))X.delay=[Z.delay];else if(Array.isArray(Z.delay)&&Z.delay.every(G.integer)&&Z.delay.every((q)=>G.inRange(q,0,65535)))X.delay=Z.delay;else throw G.invalidParameterError("delay","integer or an array of integers between 0 and 65535",Z.delay)}function PB(Z){if(G.object(Z)){if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,1,100))this.options.tiffQuality=Z.quality;else throw G.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(G.defined(Z.bitdepth))if(G.integer(Z.bitdepth)&&G.inArray(Z.bitdepth,[1,2,4]))this.options.tiffBitdepth=Z.bitdepth;else throw G.invalidParameterError("bitdepth","1, 2 or 4",Z.bitdepth);if(G.defined(Z.tile))this._setBooleanOption("tiffTile",Z.tile);if(G.defined(Z.tileWidth))if(G.integer(Z.tileWidth)&&Z.tileWidth>0)this.options.tiffTileWidth=Z.tileWidth;else throw G.invalidParameterError("tileWidth","integer greater than zero",Z.tileWidth);if(G.defined(Z.tileHeight))if(G.integer(Z.tileHeight)&&Z.tileHeight>0)this.options.tiffTileHeight=Z.tileHeight;else throw G.invalidParameterError("tileHeight","integer greater than zero",Z.tileHeight);if(G.defined(Z.miniswhite))this._setBooleanOption("tiffMiniswhite",Z.miniswhite);if(G.defined(Z.pyramid))this._setBooleanOption("tiffPyramid",Z.pyramid);if(G.defined(Z.xres))if(G.number(Z.xres)&&Z.xres>0)this.options.tiffXres=Z.xres;else throw G.invalidParameterError("xres","number greater than zero",Z.xres);if(G.defined(Z.yres))if(G.number(Z.yres)&&Z.yres>0)this.options.tiffYres=Z.yres;else throw G.invalidParameterError("yres","number greater than zero",Z.yres);if(G.defined(Z.compression))if(G.string(Z.compression)&&G.inArray(Z.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=Z.compression;else throw G.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",Z.compression);if(G.defined(Z.bigtiff))this._setBooleanOption("tiffBigtiff",Z.bigtiff);if(G.defined(Z.predictor))if(G.string(Z.predictor)&&G.inArray(Z.predictor,["none","horizontal","float"]))this.options.tiffPredictor=Z.predictor;else throw G.invalidParameterError("predictor","one of: none, horizontal, float",Z.predictor);if(G.defined(Z.resolutionUnit))if(G.string(Z.resolutionUnit)&&G.inArray(Z.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=Z.resolutionUnit;else throw G.invalidParameterError("resolutionUnit","one of: inch, cm",Z.resolutionUnit)}return this._updateFormatOut("tiff",Z)}function jB(Z){return this.heif({...Z,compression:"av1"})}function EB(Z){if(G.object(Z)){if(G.string(Z.compression)&&G.inArray(Z.compression,["av1","hevc"]))this.options.heifCompression=Z.compression;else throw G.invalidParameterError("compression","one of: av1, hevc",Z.compression);if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,1,100))this.options.heifQuality=Z.quality;else throw G.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(G.defined(Z.lossless))if(G.bool(Z.lossless))this.options.heifLossless=Z.lossless;else throw G.invalidParameterError("lossless","boolean",Z.lossless);if(G.defined(Z.effort))if(G.integer(Z.effort)&&G.inRange(Z.effort,0,9))this.options.heifEffort=Z.effort;else throw G.invalidParameterError("effort","integer between 0 and 9",Z.effort);if(G.defined(Z.chromaSubsampling))if(G.string(Z.chromaSubsampling)&&G.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=Z.chromaSubsampling;else throw G.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);if(G.defined(Z.bitdepth))if(G.integer(Z.bitdepth)&&G.inArray(Z.bitdepth,[8,10,12]))this.options.heifBitdepth=Z.bitdepth;else throw G.invalidParameterError("bitdepth","8, 10 or 12",Z.bitdepth);if(G.defined(Z.tune))if(G.string(Z.tune)&&G.inArray(Z.tune,["auto","iq","psnr","ssim"]))if(this.options.heifLossless&&Z.tune==="iq")this.options.heifTune="ssim";else this.options.heifTune=Z.tune;else throw G.invalidParameterError("tune","one of: auto, iq, psnr, ssim",Z.tune)}else throw G.invalidParameterError("options","Object",Z);return this._updateFormatOut("heif",Z)}function CB(Z){if(G.object(Z)){if(G.defined(Z.quality))if(G.integer(Z.quality)&&G.inRange(Z.quality,1,100))this.options.jxlDistance=Z.quality>=30?0.1+(100-Z.quality)*0.09:0.017666666666666667*Z.quality*Z.quality-1.15*Z.quality+25;else throw G.invalidParameterError("quality","integer between 1 and 100",Z.quality);else if(G.defined(Z.distance))if(G.number(Z.distance)&&G.inRange(Z.distance,0,15))this.options.jxlDistance=Z.distance;else throw G.invalidParameterError("distance","number between 0.0 and 15.0",Z.distance);if(G.defined(Z.decodingTier))if(G.integer(Z.decodingTier)&&G.inRange(Z.decodingTier,0,4))this.options.jxlDecodingTier=Z.decodingTier;else throw G.invalidParameterError("decodingTier","integer between 0 and 4",Z.decodingTier);if(G.defined(Z.lossless))if(G.bool(Z.lossless))this.options.jxlLossless=Z.lossless;else throw G.invalidParameterError("lossless","boolean",Z.lossless);if(G.defined(Z.effort))if(G.integer(Z.effort)&&G.inRange(Z.effort,1,9))this.options.jxlEffort=Z.effort;else throw G.invalidParameterError("effort","integer between 1 and 9",Z.effort)}return C3(Z,this.options),this._updateFormatOut("jxl",Z)}function OB(Z){if(G.object(Z)){if(G.defined(Z.depth))if(G.string(Z.depth)&&G.inArray(Z.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=Z.depth;else throw G.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",Z.depth)}return this._updateFormatOut("raw")}function xB(Z){if(G.object(Z)){if(G.defined(Z.size))if(G.integer(Z.size)&&G.inRange(Z.size,1,8192))this.options.tileSize=Z.size;else throw G.invalidParameterError("size","integer between 1 and 8192",Z.size);if(G.defined(Z.overlap))if(G.integer(Z.overlap)&&G.inRange(Z.overlap,0,8192)){if(Z.overlap>this.options.tileSize)throw G.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,Z.overlap);this.options.tileOverlap=Z.overlap}else throw G.invalidParameterError("overlap","integer between 0 and 8192",Z.overlap);if(G.defined(Z.container))if(G.string(Z.container)&&G.inArray(Z.container,["fs","zip"]))this.options.tileContainer=Z.container;else throw G.invalidParameterError("container","one of: fs, zip",Z.container);if(G.defined(Z.layout))if(G.string(Z.layout)&&G.inArray(Z.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=Z.layout;else throw G.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",Z.layout);if(G.defined(Z.angle))if(G.integer(Z.angle)&&!(Z.angle%90))this.options.tileAngle=Z.angle;else throw G.invalidParameterError("angle","positive/negative multiple of 90",Z.angle);if(this._setBackgroundColourOption("tileBackground",Z.background),G.defined(Z.depth))if(G.string(Z.depth)&&G.inArray(Z.depth,["onepixel","onetile","one"]))this.options.tileDepth=Z.depth;else throw G.invalidParameterError("depth","one of: onepixel, onetile, one",Z.depth);if(G.defined(Z.skipBlanks))if(G.integer(Z.skipBlanks)&&G.inRange(Z.skipBlanks,-1,65535))this.options.tileSkipBlanks=Z.skipBlanks;else throw G.invalidParameterError("skipBlanks","integer between -1 and 255/65535",Z.skipBlanks);else if(G.defined(Z.layout)&&Z.layout==="google")this.options.tileSkipBlanks=5;let X=G.bool(Z.center)?Z.center:Z.centre;if(G.defined(X))this._setBooleanOption("tileCentre",X);if(G.defined(Z.id))if(G.string(Z.id))this.options.tileId=Z.id;else throw G.invalidParameterError("id","string",Z.id);if(G.defined(Z.basename))if(G.string(Z.basename))this.options.tileBasename=Z.basename;else throw G.invalidParameterError("basename","string",Z.basename)}if(G.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw G.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function kB(Z){if(!G.plainObject(Z))throw G.invalidParameterError("options","object",Z);if(G.integer(Z.seconds)&&G.inRange(Z.seconds,0,3600))this.options.timeoutSeconds=Z.seconds;else throw G.invalidParameterError("seconds","integer between 0 and 3600",Z.seconds);return this}function SB(Z,X){if(!(G.object(X)&&X.force===!1))this.options.formatOut=Z;return this}function bB(Z,X){if(G.bool(X))this.options[Z]=X;else throw G.invalidParameterError(Z,"boolean",X)}function vB(){if(!this.options.streamOut){this.options.streamOut=!0;let Z=Error();this._pipeline(void 0,Z)}}function yB(Z,X){if(typeof Z==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),v.pipeline(this.options,(q,W,Q)=>{if(q)Z(G.nativeError(q,X));else Z(null,W,Q)})});else v.pipeline(this.options,(q,W,Q)=>{if(q)Z(G.nativeError(q,X));else Z(null,W,Q)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),v.pipeline(this.options,(q,W,Q)=>{if(q)this.emit("error",G.nativeError(q,X));else this.emit("info",Q),this.push(W);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else v.pipeline(this.options,(q,W,Q)=>{if(q)this.emit("error",G.nativeError(q,X));else this.emit("info",Q),this.push(W);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((q,W)=>{this.once("finish",()=>{this._flattenBufferIn(),v.pipeline(this.options,(Q,J,z)=>{if(Q)W(G.nativeError(Q,X));else if(this.options.resolveWithObject)q({data:J,info:z});else q(J)})})});else return new Promise((q,W)=>{v.pipeline(this.options,(Q,J,z)=>{if(Q)W(G.nativeError(Q,X));else if(this.options.resolveWithObject)q({data:J,info:z});else q(J)})})}var cX,QB,lX=()=>Error("JP2 output requires libvips with support for OpenJPEG"),pX=(Z)=>1<<31-Math.clz32(Math.ceil(Math.log2(Z))),nX=(Z)=>{Object.assign(Z.prototype,{toFile:JB,toBuffer:zB,toUint8Array:GB,withDensity:YB,keepExif:UB,withExif:KB,withExifMerge:VB,keepIccProfile:BB,withIccProfile:HB,keepGainMap:$B,withGainMap:FB,keepXmp:AB,withXmp:MB,keepMetadata:LB,withMetadata:IB,toFormat:wB,jpeg:DB,jp2:_B,png:NB,webp:TB,tiff:PB,avif:jB,heif:EB,jxl:CB,gif:RB,raw:OB,tile:xB,timeout:kB,_updateFormatOut:SB,_setBooleanOption:bB,_read:vB,_pipeline:yB})};var iX=R(()=>{m0();b4();/*!
237
+ */mq={and:"and",or:"or",eor:"eor"}});import a3 from"node:path";function iq(Z,W){let X;if(!Y.string(Z))X=Error("Missing output file path");else if(Y.string(this.options.input.file)&&a3.resolve(this.options.input.file)===a3.resolve(Z))X=Error("Cannot use same file for input and output");else if(nq.test(a3.extname(Z))&&!this.constructor.format.jp2.output.file)X=kW();if(X)if(Y.fn(W))W(X);else return Promise.reject(X);else{this.options.fileOut=Z;let Q=Error();return this._pipeline(W,Q)}return this}function rq(Z,W){if(Y.object(Z))this._setBooleanOption("resolveWithObject",Z.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let X=Error();return this._pipeline(Y.fn(Z)?Z:W,X)}function aq(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let Z=Error();return this._pipeline(null,Z)}function sq(Z){if(Y.number(Z)&&Z>0)this.options.withMetadataDensity=Z;else throw Y.invalidParameterError("density","positive number",Z);return this.keepExif()}function oq(){return this.options.keepMetadata|=1,this}function tq(Z){if(Y.object(Z))for(let[W,X]of Object.entries(Z))if(Y.object(X))for(let[Q,J]of Object.entries(X))if(Y.string(J))this.options.withExif[`exif-${W.toLowerCase()}-${Q}`]=J;else throw Y.invalidParameterError(`${W}.${Q}`,"string",J);else throw Y.invalidParameterError(W,"object",X);else throw Y.invalidParameterError("exif","object",Z);return this.options.withExifMerge=!1,this.keepExif()}function eq(Z){return this.withExif(Z),this.options.withExifMerge=!0,this}function ZK(){return this.options.keepMetadata|=8,this}function WK(Z,W){if(Y.string(Z))this.options.withIccProfile=Z;else throw Y.invalidParameterError("icc","string",Z);if(this.keepIccProfile(),Y.object(W)){if(Y.defined(W.attach))if(Y.bool(W.attach)){if(!W.attach)this.options.keepMetadata&=-9}else throw Y.invalidParameterError("attach","boolean",W.attach)}return this}function XK(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function QK(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function JK(){return this.options.keepMetadata|=2,this}function GK(Z){if(Y.string(Z)&&Z.length>0)this.options.withXmp=Z,this.options.keepMetadata|=2;else throw Y.invalidParameterError("xmp","non-empty string",Z);return this}function zK(){return this.options.keepMetadata|=31,this}function YK(Z){if(this.keepMetadata(),this.withIccProfile("srgb"),Y.object(Z)){if(Y.defined(Z.orientation))if(Y.integer(Z.orientation)&&Y.inRange(Z.orientation,1,8))this.options.withMetadataOrientation=Z.orientation;else throw Y.invalidParameterError("orientation","integer between 1 and 8",Z.orientation);if(Y.defined(Z.density))if(Y.number(Z.density)&&Z.density>0)this.options.withMetadataDensity=Z.density;else throw Y.invalidParameterError("density","positive number",Z.density);if(Y.defined(Z.icc))this.withIccProfile(Z.icc);if(Y.defined(Z.exif))this.withExifMerge(Z.exif)}return this}function UK(Z,W){let X=xW.get((Y.object(Z)&&Y.string(Z.id)?Z.id:Z).toLowerCase());if(!X)throw Y.invalidParameterError("format",`one of: ${[...xW.keys()].join(", ")}`,Z);return this[X](W)}function qK(Z){if(Y.object(Z)){if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,1,100))this.options.jpegQuality=Z.quality;else throw Y.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(Y.defined(Z.progressive))this._setBooleanOption("jpegProgressive",Z.progressive);if(Y.defined(Z.chromaSubsampling))if(Y.string(Z.chromaSubsampling)&&Y.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=Z.chromaSubsampling;else throw Y.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);let W=Y.bool(Z.optimizeCoding)?Z.optimizeCoding:Z.optimiseCoding;if(Y.defined(W))this._setBooleanOption("jpegOptimiseCoding",W);if(Y.defined(Z.mozjpeg))if(Y.bool(Z.mozjpeg)){if(Z.mozjpeg)this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3}else throw Y.invalidParameterError("mozjpeg","boolean",Z.mozjpeg);let X=Y.bool(Z.trellisQuantization)?Z.trellisQuantization:Z.trellisQuantisation;if(Y.defined(X))this._setBooleanOption("jpegTrellisQuantisation",X);if(Y.defined(Z.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",Z.overshootDeringing);let Q=Y.bool(Z.optimizeScans)?Z.optimizeScans:Z.optimiseScans;if(Y.defined(Q)){if(this._setBooleanOption("jpegOptimiseScans",Q),Q)this.options.jpegProgressive=!0}let J=Y.number(Z.quantizationTable)?Z.quantizationTable:Z.quantisationTable;if(Y.defined(J))if(Y.integer(J)&&Y.inRange(J,0,8))this.options.jpegQuantisationTable=J;else throw Y.invalidParameterError("quantisationTable","integer between 0 and 8",J)}return this._updateFormatOut("jpeg",Z)}function KK(Z){if(Y.object(Z)){if(Y.defined(Z.progressive))this._setBooleanOption("pngProgressive",Z.progressive);if(Y.defined(Z.compressionLevel))if(Y.integer(Z.compressionLevel)&&Y.inRange(Z.compressionLevel,0,9))this.options.pngCompressionLevel=Z.compressionLevel;else throw Y.invalidParameterError("compressionLevel","integer between 0 and 9",Z.compressionLevel);if(Y.defined(Z.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",Z.adaptiveFiltering);let W=Z.colours||Z.colors;if(Y.defined(W))if(Y.integer(W)&&Y.inRange(W,2,256))this.options.pngBitdepth=SW(W);else throw Y.invalidParameterError("colours","integer between 2 and 256",W);if(Y.defined(Z.palette))this._setBooleanOption("pngPalette",Z.palette);else if([Z.quality,Z.effort,Z.colours,Z.colors,Z.dither].some(Y.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,0,100))this.options.pngQuality=Z.quality;else throw Y.invalidParameterError("quality","integer between 0 and 100",Z.quality);if(Y.defined(Z.effort))if(Y.integer(Z.effort)&&Y.inRange(Z.effort,1,10))this.options.pngEffort=Z.effort;else throw Y.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(Y.defined(Z.dither))if(Y.number(Z.dither)&&Y.inRange(Z.dither,0,1))this.options.pngDither=Z.dither;else throw Y.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither)}}return this._updateFormatOut("png",Z)}function VK(Z){if(Y.object(Z)){if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,1,100))this.options.webpQuality=Z.quality;else throw Y.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(Y.defined(Z.alphaQuality))if(Y.integer(Z.alphaQuality)&&Y.inRange(Z.alphaQuality,0,100))this.options.webpAlphaQuality=Z.alphaQuality;else throw Y.invalidParameterError("alphaQuality","integer between 0 and 100",Z.alphaQuality);if(Y.defined(Z.lossless))this._setBooleanOption("webpLossless",Z.lossless);if(Y.defined(Z.nearLossless))this._setBooleanOption("webpNearLossless",Z.nearLossless);if(Y.defined(Z.smartSubsample))this._setBooleanOption("webpSmartSubsample",Z.smartSubsample);if(Y.defined(Z.smartDeblock))this._setBooleanOption("webpSmartDeblock",Z.smartDeblock);if(Y.defined(Z.preset))if(Y.string(Z.preset)&&Y.inArray(Z.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=Z.preset;else throw Y.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",Z.preset);if(Y.defined(Z.effort))if(Y.integer(Z.effort)&&Y.inRange(Z.effort,0,6))this.options.webpEffort=Z.effort;else throw Y.invalidParameterError("effort","integer between 0 and 6",Z.effort);if(Y.defined(Z.minSize))this._setBooleanOption("webpMinSize",Z.minSize);if(Y.defined(Z.mixed))this._setBooleanOption("webpMixed",Z.mixed);if(Y.defined(Z.exact))this._setBooleanOption("webpExact",Z.exact)}return s3(Z,this.options),this._updateFormatOut("webp",Z)}function BK(Z){if(Y.object(Z)){if(Y.defined(Z.reuse))this._setBooleanOption("gifReuse",Z.reuse);if(Y.defined(Z.progressive))this._setBooleanOption("gifProgressive",Z.progressive);let W=Z.colours||Z.colors;if(Y.defined(W))if(Y.integer(W)&&Y.inRange(W,2,256))this.options.gifBitdepth=SW(W);else throw Y.invalidParameterError("colours","integer between 2 and 256",W);if(Y.defined(Z.effort))if(Y.number(Z.effort)&&Y.inRange(Z.effort,1,10))this.options.gifEffort=Z.effort;else throw Y.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(Y.defined(Z.dither))if(Y.number(Z.dither)&&Y.inRange(Z.dither,0,1))this.options.gifDither=Z.dither;else throw Y.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither);if(Y.defined(Z.interFrameMaxError))if(Y.number(Z.interFrameMaxError)&&Y.inRange(Z.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=Z.interFrameMaxError;else throw Y.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",Z.interFrameMaxError);if(Y.defined(Z.interPaletteMaxError))if(Y.number(Z.interPaletteMaxError)&&Y.inRange(Z.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=Z.interPaletteMaxError;else throw Y.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",Z.interPaletteMaxError);if(Y.defined(Z.keepDuplicateFrames))if(Y.bool(Z.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",Z.keepDuplicateFrames);else throw Y.invalidParameterError("keepDuplicateFrames","boolean",Z.keepDuplicateFrames)}return s3(Z,this.options),this._updateFormatOut("gif",Z)}function HK(Z){if(!this.constructor.format.jp2.output.buffer)throw kW();if(Y.object(Z)){if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,1,100))this.options.jp2Quality=Z.quality;else throw Y.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(Y.defined(Z.lossless))if(Y.bool(Z.lossless))this.options.jp2Lossless=Z.lossless;else throw Y.invalidParameterError("lossless","boolean",Z.lossless);if(Y.defined(Z.tileWidth))if(Y.integer(Z.tileWidth)&&Y.inRange(Z.tileWidth,1,32768))this.options.jp2TileWidth=Z.tileWidth;else throw Y.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if(Y.defined(Z.tileHeight))if(Y.integer(Z.tileHeight)&&Y.inRange(Z.tileHeight,1,32768))this.options.jp2TileHeight=Z.tileHeight;else throw Y.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if(Y.defined(Z.chromaSubsampling))if(Y.string(Z.chromaSubsampling)&&Y.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=Z.chromaSubsampling;else throw Y.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling)}return this._updateFormatOut("jp2",Z)}function s3(Z,W){if(Y.object(Z)&&Y.defined(Z.loop))if(Y.integer(Z.loop)&&Y.inRange(Z.loop,0,65535))W.loop=Z.loop;else throw Y.invalidParameterError("loop","integer between 0 and 65535",Z.loop);if(Y.object(Z)&&Y.defined(Z.delay))if(Y.integer(Z.delay)&&Y.inRange(Z.delay,0,65535))W.delay=[Z.delay];else if(Array.isArray(Z.delay)&&Z.delay.every(Y.integer)&&Z.delay.every((X)=>Y.inRange(X,0,65535)))W.delay=Z.delay;else throw Y.invalidParameterError("delay","integer or an array of integers between 0 and 65535",Z.delay)}function $K(Z){if(Y.object(Z)){if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,1,100))this.options.tiffQuality=Z.quality;else throw Y.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(Y.defined(Z.bitdepth))if(Y.integer(Z.bitdepth)&&Y.inArray(Z.bitdepth,[1,2,4]))this.options.tiffBitdepth=Z.bitdepth;else throw Y.invalidParameterError("bitdepth","1, 2 or 4",Z.bitdepth);if(Y.defined(Z.tile))this._setBooleanOption("tiffTile",Z.tile);if(Y.defined(Z.tileWidth))if(Y.integer(Z.tileWidth)&&Z.tileWidth>0)this.options.tiffTileWidth=Z.tileWidth;else throw Y.invalidParameterError("tileWidth","integer greater than zero",Z.tileWidth);if(Y.defined(Z.tileHeight))if(Y.integer(Z.tileHeight)&&Z.tileHeight>0)this.options.tiffTileHeight=Z.tileHeight;else throw Y.invalidParameterError("tileHeight","integer greater than zero",Z.tileHeight);if(Y.defined(Z.miniswhite))this._setBooleanOption("tiffMiniswhite",Z.miniswhite);if(Y.defined(Z.pyramid))this._setBooleanOption("tiffPyramid",Z.pyramid);if(Y.defined(Z.xres))if(Y.number(Z.xres)&&Z.xres>0)this.options.tiffXres=Z.xres;else throw Y.invalidParameterError("xres","number greater than zero",Z.xres);if(Y.defined(Z.yres))if(Y.number(Z.yres)&&Z.yres>0)this.options.tiffYres=Z.yres;else throw Y.invalidParameterError("yres","number greater than zero",Z.yres);if(Y.defined(Z.compression))if(Y.string(Z.compression)&&Y.inArray(Z.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=Z.compression;else throw Y.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",Z.compression);if(Y.defined(Z.bigtiff))this._setBooleanOption("tiffBigtiff",Z.bigtiff);if(Y.defined(Z.predictor))if(Y.string(Z.predictor)&&Y.inArray(Z.predictor,["none","horizontal","float"]))this.options.tiffPredictor=Z.predictor;else throw Y.invalidParameterError("predictor","one of: none, horizontal, float",Z.predictor);if(Y.defined(Z.resolutionUnit))if(Y.string(Z.resolutionUnit)&&Y.inArray(Z.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=Z.resolutionUnit;else throw Y.invalidParameterError("resolutionUnit","one of: inch, cm",Z.resolutionUnit)}return this._updateFormatOut("tiff",Z)}function FK(Z){return this.heif({...Z,compression:"av1"})}function LK(Z){if(Y.object(Z)){if(Y.string(Z.compression)&&Y.inArray(Z.compression,["av1","hevc"]))this.options.heifCompression=Z.compression;else throw Y.invalidParameterError("compression","one of: av1, hevc",Z.compression);if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,1,100))this.options.heifQuality=Z.quality;else throw Y.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(Y.defined(Z.lossless))if(Y.bool(Z.lossless))this.options.heifLossless=Z.lossless;else throw Y.invalidParameterError("lossless","boolean",Z.lossless);if(Y.defined(Z.effort))if(Y.integer(Z.effort)&&Y.inRange(Z.effort,0,9))this.options.heifEffort=Z.effort;else throw Y.invalidParameterError("effort","integer between 0 and 9",Z.effort);if(Y.defined(Z.chromaSubsampling))if(Y.string(Z.chromaSubsampling)&&Y.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=Z.chromaSubsampling;else throw Y.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);if(Y.defined(Z.bitdepth))if(Y.integer(Z.bitdepth)&&Y.inArray(Z.bitdepth,[8,10,12]))this.options.heifBitdepth=Z.bitdepth;else throw Y.invalidParameterError("bitdepth","8, 10 or 12",Z.bitdepth);if(Y.defined(Z.tune))if(Y.string(Z.tune)&&Y.inArray(Z.tune,["auto","iq","psnr","ssim"]))if(this.options.heifLossless&&Z.tune==="iq")this.options.heifTune="ssim";else this.options.heifTune=Z.tune;else throw Y.invalidParameterError("tune","one of: auto, iq, psnr, ssim",Z.tune)}else throw Y.invalidParameterError("options","Object",Z);return this._updateFormatOut("heif",Z)}function AK(Z){if(Y.object(Z)){if(Y.defined(Z.quality))if(Y.integer(Z.quality)&&Y.inRange(Z.quality,1,100))this.options.jxlDistance=Z.quality>=30?0.1+(100-Z.quality)*0.09:0.017666666666666667*Z.quality*Z.quality-1.15*Z.quality+25;else throw Y.invalidParameterError("quality","integer between 1 and 100",Z.quality);else if(Y.defined(Z.distance))if(Y.number(Z.distance)&&Y.inRange(Z.distance,0,15))this.options.jxlDistance=Z.distance;else throw Y.invalidParameterError("distance","number between 0.0 and 15.0",Z.distance);if(Y.defined(Z.decodingTier))if(Y.integer(Z.decodingTier)&&Y.inRange(Z.decodingTier,0,4))this.options.jxlDecodingTier=Z.decodingTier;else throw Y.invalidParameterError("decodingTier","integer between 0 and 4",Z.decodingTier);if(Y.defined(Z.lossless))if(Y.bool(Z.lossless))this.options.jxlLossless=Z.lossless;else throw Y.invalidParameterError("lossless","boolean",Z.lossless);if(Y.defined(Z.effort))if(Y.integer(Z.effort)&&Y.inRange(Z.effort,1,9))this.options.jxlEffort=Z.effort;else throw Y.invalidParameterError("effort","integer between 1 and 9",Z.effort)}return s3(Z,this.options),this._updateFormatOut("jxl",Z)}function MK(Z){if(Y.object(Z)){if(Y.defined(Z.depth))if(Y.string(Z.depth)&&Y.inArray(Z.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=Z.depth;else throw Y.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",Z.depth)}return this._updateFormatOut("raw")}function IK(Z){if(Y.object(Z)){if(Y.defined(Z.size))if(Y.integer(Z.size)&&Y.inRange(Z.size,1,8192))this.options.tileSize=Z.size;else throw Y.invalidParameterError("size","integer between 1 and 8192",Z.size);if(Y.defined(Z.overlap))if(Y.integer(Z.overlap)&&Y.inRange(Z.overlap,0,8192)){if(Z.overlap>this.options.tileSize)throw Y.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,Z.overlap);this.options.tileOverlap=Z.overlap}else throw Y.invalidParameterError("overlap","integer between 0 and 8192",Z.overlap);if(Y.defined(Z.container))if(Y.string(Z.container)&&Y.inArray(Z.container,["fs","zip"]))this.options.tileContainer=Z.container;else throw Y.invalidParameterError("container","one of: fs, zip",Z.container);if(Y.defined(Z.layout))if(Y.string(Z.layout)&&Y.inArray(Z.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=Z.layout;else throw Y.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",Z.layout);if(Y.defined(Z.angle))if(Y.integer(Z.angle)&&!(Z.angle%90))this.options.tileAngle=Z.angle;else throw Y.invalidParameterError("angle","positive/negative multiple of 90",Z.angle);if(this._setBackgroundColourOption("tileBackground",Z.background),Y.defined(Z.depth))if(Y.string(Z.depth)&&Y.inArray(Z.depth,["onepixel","onetile","one"]))this.options.tileDepth=Z.depth;else throw Y.invalidParameterError("depth","one of: onepixel, onetile, one",Z.depth);if(Y.defined(Z.skipBlanks))if(Y.integer(Z.skipBlanks)&&Y.inRange(Z.skipBlanks,-1,65535))this.options.tileSkipBlanks=Z.skipBlanks;else throw Y.invalidParameterError("skipBlanks","integer between -1 and 255/65535",Z.skipBlanks);else if(Y.defined(Z.layout)&&Z.layout==="google")this.options.tileSkipBlanks=5;let W=Y.bool(Z.center)?Z.center:Z.centre;if(Y.defined(W))this._setBooleanOption("tileCentre",W);if(Y.defined(Z.id))if(Y.string(Z.id))this.options.tileId=Z.id;else throw Y.invalidParameterError("id","string",Z.id);if(Y.defined(Z.basename))if(Y.string(Z.basename))this.options.tileBasename=Z.basename;else throw Y.invalidParameterError("basename","string",Z.basename)}if(Y.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw Y.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function wK(Z){if(!Y.plainObject(Z))throw Y.invalidParameterError("options","object",Z);if(Y.integer(Z.seconds)&&Y.inRange(Z.seconds,0,3600))this.options.timeoutSeconds=Z.seconds;else throw Y.invalidParameterError("seconds","integer between 0 and 3600",Z.seconds);return this}function NK(Z,W){if(!(Y.object(W)&&W.force===!1))this.options.formatOut=Z;return this}function DK(Z,W){if(Y.bool(W))this.options[Z]=W;else throw Y.invalidParameterError(Z,"boolean",W)}function TK(){if(!this.options.streamOut){this.options.streamOut=!0;let Z=Error();this._pipeline(void 0,Z)}}function RK(Z,W){if(typeof Z==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Z0.pipeline(this.options,(X,Q,J)=>{if(X)Z(Y.nativeError(X,W));else Z(null,Q,J)})});else Z0.pipeline(this.options,(X,Q,J)=>{if(X)Z(Y.nativeError(X,W));else Z(null,Q,J)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),Z0.pipeline(this.options,(X,Q,J)=>{if(X)this.emit("error",Y.nativeError(X,W));else this.emit("info",J),this.push(Q);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else Z0.pipeline(this.options,(X,Q,J)=>{if(X)this.emit("error",Y.nativeError(X,W));else this.emit("info",J),this.push(Q);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{this.once("finish",()=>{this._flattenBufferIn(),Z0.pipeline(this.options,(J,G,z)=>{if(J)Q(Y.nativeError(J,W));else if(this.options.resolveWithObject)X({data:G,info:z});else X(G)})})});else return new Promise((X,Q)=>{Z0.pipeline(this.options,(J,G,z)=>{if(J)Q(Y.nativeError(J,W));else if(this.options.resolveWithObject)X({data:G,info:z});else X(G)})})}var xW,nq,kW=()=>Error("JP2 output requires libvips with support for OpenJPEG"),SW=(Z)=>1<<31-Math.clz32(Math.ceil(Math.log2(Z))),bW=(Z)=>{Object.assign(Z.prototype,{toFile:iq,toBuffer:rq,toUint8Array:aq,withDensity:sq,keepExif:oq,withExif:tq,withExifMerge:eq,keepIccProfile:ZK,withIccProfile:WK,keepGainMap:XK,withGainMap:QK,keepXmp:JK,withXmp:GK,keepMetadata:zK,withMetadata:YK,toFormat:UK,jpeg:qK,jp2:HK,png:KK,webp:VK,tiff:$K,avif:FK,heif:LK,jxl:AK,gif:BK,raw:MK,tile:IK,timeout:wK,_updateFormatOut:NK,_setBooleanOption:DK,_read:TK,_pipeline:RK})};var vW=d(()=>{Q1();Q4();/*!
232
238
  Copyright 2013 Lovell Fuller and others.
233
239
  SPDX-License-Identifier: Apache-2.0
234
- */cX=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),QB=/\.(jp[2x]|j2[kc])$/i});import gB from"node:events";import{createRequire as hB}from"node:module";import{availableParallelism as mB}from"node:os";function aX(Z){if(G.bool(Z))if(Z)return v.cache(50,20,100);else return v.cache(0,0,0);else if(G.object(Z))return v.cache(Z.memory,Z.files,Z.items);else return v.cache()}function uB(Z){return v.concurrency(G.integer(Z)?Z:null)}function cB(){return v.counters()}function lB(Z){return v.simd(G.bool(Z)?Z:null)}function pB(Z){if(G.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(G.string))v.block(Z.operation,!0);else throw G.invalidParameterError("operation","Array<string>",Z.operation);else throw G.invalidParameterError("options","object",Z)}function nB(Z){if(G.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(G.string))v.block(Z.operation,!1);else throw G.invalidParameterError("operation","Array<string>",Z.operation);else throw G.invalidParameterError("options","object",Z)}var v4,O3,rX,x3,A6,fB,G4,dB,sX=(Z)=>{Z.cache=aX,Z.concurrency=uB,Z.counters=cB,Z.simd=lB,Z.format=A6,Z.interpolators=fB,Z.versions=G4,Z.queue=dB,Z.block=pB,Z.unblock=nB};var oX=R(()=>{m0();L3();b4();k1();v4=B4(L1(),1);/*!
240
+ */xW=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),nq=/\.(jp[2x]|j2[kc])$/i});import PK from"node:events";import{createRequire as _K}from"node:module";import{availableParallelism as jK}from"node:os";function gW(Z){if(Y.bool(Z))if(Z)return Z0.cache(50,20,100);else return Z0.cache(0,0,0);else if(Y.object(Z))return Z0.cache(Z.memory,Z.files,Z.items);else return Z0.cache()}function CK(Z){return Z0.concurrency(Y.integer(Z)?Z:null)}function xK(){return Z0.counters()}function kK(Z){return Z0.simd(Y.bool(Z)?Z:null)}function SK(Z){if(Y.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(Y.string))Z0.block(Z.operation,!0);else throw Y.invalidParameterError("operation","Array<string>",Z.operation);else throw Y.invalidParameterError("options","object",Z)}function bK(Z){if(Y.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(Y.string))Z0.block(Z.operation,!1);else throw Y.invalidParameterError("operation","Array<string>",Z.operation);else throw Y.invalidParameterError("options","object",Z)}var J4,o3,yW,t3,m1,EK,_6,OK,hW=(Z)=>{Z.cache=gW,Z.concurrency=CK,Z.counters=xK,Z.simd=kK,Z.format=m1,Z.interpolators=EK,Z.versions=_6,Z.queue=OK,Z.block=SK,Z.unblock=bK};var fW=d(()=>{Q1();f3();Q4();z2();J4=v6(n4(),1);/*!
235
241
  Copyright 2013 Lovell Fuller and others.
236
242
  SPDX-License-Identifier: Apache-2.0
237
- */O3=hB(import.meta.url),rX=S1.runtimePlatformArch(),x3=v.libvipsVersion(),A6=v.format();A6.heif.output.alias=["avif","heic"];A6.jpeg.output.alias=["jpe","jpg"];A6.tiff.output.alias=["tif"];A6.jp2.output.alias=["j2c","j2k","jp2","jpx"];fB={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},G4={vips:x3.semver};if(!x3.isGlobal)if(!x3.isWasm)try{G4=O3(`@img/sharp-${rX}/versions`)}catch(Z){try{G4=O3(`@img/sharp-libvips-${rX}/versions`)}catch(X){}}else try{G4=O3("@img/sharp-wasm32/versions")}catch(Z){}G4.sharp=q6.version;if(G4.heif&&A6.heif)A6.heif.input.fileSuffix=[".avif"],A6.heif.output.alias=["avif"];aX(!0);if(v4.default.familySync()===v4.default.GLIBC&&!v._isUsingJemalloc())v.concurrency(1);else if(v4.default.familySync()===v4.default.MUSL&&v.concurrency()===1024)v.concurrency(mB());dB=new gB.EventEmitter});var k3={};f4(k3,{default:()=>iB});var iB;var S3=R(()=>{VX();$X();wX();NX();jX();fX();dX();iX();oX();/*!
243
+ */o3=_K(import.meta.url),yW=Y2.runtimePlatformArch(),t3=Z0.libvipsVersion(),m1=Z0.format();m1.heif.output.alias=["avif","heic"];m1.jpeg.output.alias=["jpe","jpg"];m1.tiff.output.alias=["tif"];m1.jp2.output.alias=["j2c","j2k","jp2","jpx"];EK={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},_6={vips:t3.semver};if(!t3.isGlobal)if(!t3.isWasm)try{_6=o3(`@img/sharp-${yW}/versions`)}catch(Z){try{_6=o3(`@img/sharp-libvips-${yW}/versions`)}catch(W){}}else try{_6=o3("@img/sharp-wasm32/versions")}catch(Z){}_6.sharp=P1.version;if(_6.heif&&m1.heif)m1.heif.input.fileSuffix=[".avif"],m1.heif.output.alias=["avif"];gW(!0);if(J4.default.familySync()===J4.default.GLIBC&&!Z0._isUsingJemalloc())Z0.concurrency(1);else if(J4.default.familySync()===J4.default.MUSL&&Z0.concurrency()===1024)Z0.concurrency(jK());OK=new PK.EventEmitter});var e3={};w4(e3,{default:()=>vK});var vK;var Z8=d(()=>{e7();XW();UW();KW();FW();EW();OW();vW();fW();/*!
238
244
  Copyright 2013 Lovell Fuller and others.
239
245
  SPDX-License-Identifier: Apache-2.0
240
- */HX(l0);IX(l0);DX(l0);PX(l0);mX(l0);uX(l0);nX(l0);sX(l0);iB=l0});import{createHash as tX}from"node:crypto";import{existsSync as rB,mkdirSync as aB,readFileSync as sB}from"node:fs";import{basename as oB,extname as tB,resolve as b3}from"node:path";import{createRequire as eB}from"node:module";async function eX(){if(Y4)return Y4;try{return Y4=(await Promise.resolve().then(() => (S3(),k3))).default,Y4}catch{}try{return Y4=eB(b3(process.cwd(),"package.json"))("sharp"),Y4}catch(Z){throw Error(`Sharp is required for image optimization but failed to load: ${t0(Z)}`,{cause:Z})}}async function v3(Z){let q=await(await eX())(Z).metadata();return{format:q.format??"unknown",height:q.height??0,width:q.width??0}}function y4(Z){let X=sB(Z);return tX("md5").update(X).digest("hex").slice(0,8)}function y3(Z){let X=JSON.stringify({formats:Z.formats,quality:Z.quality,widths:Z.widths});return tX("md5").update(X).digest("hex").slice(0,8)}function XH(Z,X,q,W){return`${Z}-${X}-${q}.${W}`}async function Zq(Z,X,q){let W=await eX(),Q=await v3(Z),J=y4(Z),z=oB(Z,tB(Z)),Y=b3(X,"_optimized");aB(Y,{recursive:!0});let U=[],K=q.widths.filter((H)=>H<=Q.width);if(K.length===0||!K.includes(Q.width))K.push(Q.width);K.sort((H,$)=>H-$);let V=[];for(let H of K)for(let $ of q.formats){let F=XH(z,H,J,$),L=`/${ZH}/${F}`,A=b3(Y,F);if(U.push({absolutePath:A,format:$,outputPath:L,width:H}),rB(A))continue;let I=q.quality[$]??80,M=W(Z).resize(H).toFormat($,{quality:I}).toFile(A).then(()=>{});V.push(M)}let B=4;for(let H=0;H<V.length;H+=B)await Promise.all(V.slice(H,H+B));return{contentHash:J,original:{format:Q.format,height:Q.height,width:Q.width},variants:U}}function g3(Z,X){return Z.filter((q)=>q.format===X).map((q)=>`${q.outputPath} ${q.width}w`).join(", ")}var Y4=null,ZH="images/_optimized";var h3=R(()=>{e0()});import{existsSync as qH,mkdirSync as WH,readFileSync as QH,writeFileSync as JH}from"node:fs";import{basename as zH,resolve as g1}from"node:path";import{execSync as GH}from"node:child_process";import{tmpdir as YH}from"node:os";function U4(Z){if(g4===void 0)try{let X=GH("npm config get cache",{cwd:YH(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();g4=X&&X!=="undefined"?X:null}catch{g4=null}if(g4)return g1(g4,"jxsuite-images",zH(Z));return g1(Z,".cache/images")}function Xq(Z){let X=g1(U4(Z),"manifest.json");if(!qH(X))return{entries:{},version:1};try{return JSON.parse(QH(X,"utf8"))}catch{return{entries:{},version:1}}}function qq(Z,X){let q=U4(Z);WH(q,{recursive:!0}),JH(g1(q,"manifest.json"),JSON.stringify(X,null,2),"utf8")}function Wq(Z,X){let q=Z.entries[X];if(!q)return null;return q.manifest}function Qq(Z,X,q,W){Z.entries[X]={manifest:W,source:q,timestamp:Date.now()}}var g4;var m3=R(()=>{h3()});import{existsSync as f3}from"node:fs";import{basename as UH,extname as Gq,resolve as Jq}from"node:path";async function Uq(Z,X){let q=X.get(Z);if(!q){let W=y4(Z);try{let Q=await v3(Z);q={width:Q.width,height:Q.height,hash:W}}catch(Q){if(!zq)zq=!0,console.warn(`Could not read image dimensions (${Q.message}) — `+"emitting srcsets without width/height attributes.");q={width:null,height:null,hash:W}}X.set(Z,q)}return q}function h1(Z,X,q,W){let Q=X.quality?.webp??80,J=Z.startsWith("/")?"":"/",z=W?`?v=${W}`:"";return X.widths.filter((Y)=>Y<=q).toSorted((Y,U)=>Y-U).map((Y)=>`/cdn-cgi/image/width=${Y},quality=${Q},fit=scale-down,format=auto${J}${Z}${z} ${Y}w`).join(", ")}async function Kq(Z,X,q,W,Q){let J=`${y4(Z)}:${y3(q)}`,z=Wq(Q,J);if(z){if(z.variants.every((K)=>f3(K.absolutePath)))return z}if(!z)console.log(` Optimizing ${UH(Z)}...`);let Y=await Zq(Z,U4(W),q);return Qq(Q,J,X,Y),Y}function Vq(Z){if(typeof Z!=="string")return!0;if(!Z)return!0;if(Z.includes("${"))return!0;if(KH.some((X)=>Z.startsWith(X)))return!0;if(Yq.has(Gq(Z).toLowerCase()))return!0;return!1}function Bq(Z,X){if(X.service!=="cloudflare")return!1;if(!X.remoteDomains?.length)return!1;if(typeof Z!=="string"||!Z.startsWith("https://"))return!1;if(Z.includes("${"))return!1;try{let q=new URL(Z);if(Yq.has(Gq(q.pathname).toLowerCase()))return!1;return X.remoteDomains.includes(q.hostname)}catch{return!1}}function Hq(Z,X){if(Z.startsWith("/"))return Jq(X,"public",Z.slice(1));return Jq(X,Z)}async function $q(Z,X,q,W,Q){let J=new Map;if(!X.optimize)return{imageRefs:J};return await Fq(Z,X,q,W,Q??new Map,J),{imageRefs:J}}async function Fq(Z,X,q,W,Q,J){if(!Z||typeof Z!=="object")return;if(Z.tagName==="img")await VH(Z,X,q,W,Q,J);if(typeof Z.innerHTML==="string"&&Z.innerHTML.includes("<img"))Z.innerHTML=await AH(Z.innerHTML,X,q,W,Q,J);if(Array.isArray(Z.children))for(let z of Z.children){if(typeof z==="string")continue;await Fq(z,X,q,W,Q,J)}}async function VH(Z,X,q,W,Q,J){if(!Z.attributes)Z.attributes={};let z=Z.attributes.src??Z.src;if(typeof z!=="string")return;let Y=Bq(z,X);if(!Y&&Vq(z))return;if(Z.attributes["data-no-optimize"]!==void 0)return;let U;if(Y)U=h1(z,X,1/0,null);else{let K=Hq(z,q);if(!f3(K))return;if(X.service==="cloudflare"){let V=await Uq(K,Q);U=h1(z,X,V.width??1/0,V.hash)}else{let V=J.get(K);if(!V)V=await Kq(K,z,X,q,W),J.set(K,V);let B=X.formats.includes("avif")?"avif":X.formats[0];U=g3(V.variants,B)}}if(U)Z.attributes.srcset=U,Z.attributes.sizes??=X.sizes;if(X.lazyLoad&&Z.attributes.loading!=="eager")Z.attributes.loading="lazy",Z.attributes.decoding="async"}async function AH(Z,X,q,W,Q,J){let z=[];for(let U of Z.matchAll(BH)){let[K]=U,[,V]=U;if($H.test(V))continue;if(FH.test(V))continue;let B=V.match(HH);if(!B)continue;let H=B[1].replaceAll("&amp;","&"),$=Bq(H,X);if(!$&&Vq(H))continue;let F=$?null:Hq(H,q);if(F&&!f3(F))continue;let L;if($)L=h1(H,X,1/0,null);else if(X.service==="cloudflare"){let I=await Uq(F,Q);L=h1(H,X,I.width??1/0,I.hash)}else{let I=J.get(F);if(!I)I=await Kq(F,H,X,q,W),J.set(F,I);let M=X.formats.includes("avif")?"avif":X.formats[0];L=g3(I.variants,M)}if(!L)continue;let A=` srcset="${L}" sizes="${X.sizes}"`;if(X.lazyLoad&&!/\bloading="eager"/.test(V)){if(!/\bloading=/.test(V))A+=' loading="lazy"';if(!/\bdecoding=/.test(V))A+=' decoding="async"'}z.push({match:K,replacement:`<img${V}${A}>`})}let Y=Z;for(let{match:U,replacement:K}of z)Y=Y.replace(U,K);return Y}var Yq,KH,zq=!1,BH,HH,$H,FH;var Aq=R(()=>{h3();m3();Yq=new Set([".svg",".gif"]),KH=["http://","https://","data:","//"];BH=/<img\b([^>]*)>/gi,HH=/\bsrc="([^"]*)"/,$H=/\bsrcset="/,FH=/\bdata-no-optimize\b/});var wq={};f4(wq,{buildSite:()=>wH});import{copyFileSync as MH,cpSync as u3,existsSync as K4,mkdirSync as M6,readdirSync as LH,rmSync as IH,writeFileSync as n0}from"node:fs";import{dirname as V4,join as f1,resolve as e}from"node:path";async function wH(Z,X={}){let{clean:q=!0,verbose:W=!1}=X,Q=[],J=W?console.log.bind(console):()=>{};J("Loading project.json...");let{config:z}=w7(Z),Y=e(Z,z.build.outDir),U=e(Z,"pages"),K=e(Z,"public"),V=z.build.trailingSlash??"always",B=await T4(Z,z);if(B.entries.length>0)J(` Registered ${B.entries.length} format(s): ${B.entries.map((j)=>j.name).join(", ")}`);if(q&&K4(Y))IH(Y,{force:!0,recursive:!0});if(M6(Y,{recursive:!0}),!K4(U))throw Error(`pages/ directory not found in ${Z}`);J("Discovering pages...");let H=await T7(U,B);J(` Found ${H.length} page(s)`),J("Loading content types...");let $=await v7(Z,z,B);if($.size>0){J(` Loaded ${$.size} content type(s): ${[...$.keys()].join(", ")}`);let j=a5(Z,z);if(j)y7($,j.config)}let F=await _7(H,Z,$,B);J(` ${F.length} route(s) after expansion`);let L=0,A=e(Z,"components"),I=[],M=new Map,P=new Map;if(K4(A)){J("Compiling components...");let j=[".json",...B.documentExtensions("component")],S=LH(A).filter((f)=>j.some((h)=>f.endsWith(h))),g=e(Y,"components");M6(g,{recursive:!0});for(let f of S)try{let h=e(A,f),X0=await B1(h,{...z.$media?{$media:z.$media}:{},formats:B});for(let G0 of X0.files){let u1=G0.path.includes("/")?G0.path.split("/").pop():G0.path;if(n0(e(g,u1),G0.content,"utf8"),G0.tagName)I.push(G0.tagName);L+=1}let l=await _4(h,B);if(l.tagName){P.set(l.tagName,l);let G0=W8(l.tagName,l.style,l,z.$media??{});if(G0)M.set(l.tagName,G0),n0(e(g,`${l.tagName}.css`),G0,"utf8"),L+=1}}catch(h){let X0=h;Q.push(`Error compiling component ${f}: ${X0.message}`),console.error(`Error compiling component ${f}: ${X0.message}`)}J(` Compiled ${I.length} component(s): ${I.join(", ")}`)}let k=[];if(z.build.adapter)for(let[,j]of P){let S=l4(j);for(let g of S){let f=`./components/${g.src.replace(/^\.\//,"")}`;k.push({exportName:g.exportName,src:f})}}let b=z.images.optimize&&z.images.service==="cloudflare",C=z.images.optimize&&!b?Xq(Z):null,T=b?new Map:null;if(b)console.log('images.service is "cloudflare" — srcsets use /cdn-cgi/image transform URLs. '+"Ensure Image Transformations are enabled for your zone (Cloudflare dashboard → "+"Images → Transformations); these URLs do not work on *.pages.dev / *.workers.dev previews.");for(let j of F)try{J(` Compiling ${j.urlPattern} ...`);let S=await DH(j,z,Z,$,C,P,T,B),g=new Set;for(let[h,X0]of P)if(e1(X0))g.add(h);if(I.length>0)S.html=RH(S.html,I,M,g);let f=Iq(j.urlPattern,Y,V);M6(V4(f),{recursive:!0}),n0(f,S.html,"utf8"),L+=1;for(let h of B.withCapability("serialize")){if(!h.exportTarget)continue;try{let X0=await h.call("serialize",S.doc,{buildScope:(l)=>m6(l,null),componentDefs:P,evaluateTemplate:(l,G0)=>{if(!x(l))return;return Y0(l,G0)??l},mode:"export"});if(X0){let l=f.replace(/\.html$/,h.extensions[0]);n0(l,X0,"utf8"),L+=1}}catch(X0){let l=X0;Q.push(`Error exporting ${h.name} for ${j.urlPattern}: ${l.message}`)}}for(let h of S.files){let X0=e(V4(f),h.path);M6(V4(X0),{recursive:!0}),n0(X0,h.content,"utf8"),L+=1}if(S.serverHandler){let h=e(V4(f),"_server.js");n0(h,S.serverHandler,"utf8"),L+=1}}catch(S){let g=S,f=`Error compiling ${j.urlPattern}: ${g.message}`;Q.push(f),console.error(f)}if(C&&z.images.optimize){qq(Z,C);let j=e(U4(Z),"_optimized");if(K4(j)){let g=e(Y,"images/_optimized");M6(g,{recursive:!0}),u3(j,g,{recursive:!0})}let S=Object.keys(C.entries).length;if(S>0)J(` Optimized ${S} image(s)`)}if(z.build.adapter){let{adapter:j}=z.build;J("Generating site-wide server worker...");let S=new Map;for(let h of k)if(!S.has(h.exportName))S.set(h.exportName,h);let f=j==="cloudflare-pages"&&S.size===0?null:y5([...S.values()],{adapter:j});if(f){let h=j==="cloudflare-pages"?"_worker.js":"worker.js";if(n0(e(Y,h),f,"utf8"),L+=1,J(` Generated dist/${h} (${S.size} server function(s))`),j==="cloudflare-pages")n0(e(Y,"_routes.json"),`${JSON.stringify({exclude:[],include:["/_jx/*"],version:1},null,2)}
241
- `,"utf8"),L+=1;let X0=e(Y,"components");M6(X0,{recursive:!0});for(let{src:l}of S.values()){let G0=e(Z,l.replace(/^\.\//,"")),u1=e(X0,l.replace(/^\.\/components\//,""));if(K4(G0))MH(G0,u1)}}}if(z.redirects&&Object.keys(z.redirects).length>0){J("Generating redirects...");let j=jH(z.redirects,Y);L+=j}if(K4(K))J("Copying public/ assets..."),u3(K,Y,{recursive:!0});if(z.copy){J("Copying mapped files...");for(let[j,S]of Object.entries(z.copy)){let g=e(Z,j),f=e(Y,S);M6(V4(f),{recursive:!0}),u3(g,f)}}if(J(`
242
- Build complete: ${F.length} routes, ${L} files`),Q.length>0)J(` ${Q.length} error(s)`);return{errors:Q,files:L,routes:F.length}}async function DH(Z,X,q,W=new Map,Q=null,J=new Map,z=null,Y){let U=await _4(Z.sourcePath,Y),K=n5(U,X,q),V=U.$head??K._pageHead??[],B=K.$head??[],H=U.title??K._pageTitle??null;delete K._pageHead,delete K._pageTitle,x7(K,X,Z,W,q),await h7(K,Z,q,{config:X,contentTypes:W});let $=m6(K.state??{}),F=H??X.name??"Jx Site";if(typeof F==="string"&&x(F))F=Y0(F,$)??F;let L=Mq(V,$),A=Mq(B,$);h4(K,$);let I={counter:{n:0},media:{...X.$media,...K.$media},rules:[]};if(c3(K,J,I),K.state)for(let[T,j]of Object.entries(K.state)){if(T==="$site"||T==="$page")continue;if(j&&typeof j==="object"&&!Array.isArray(j)&&j.timing==="compiler")delete K.state[T];else if(Array.isArray(j))delete K.state[T]}let M=NH(X.$head??[]),P=C7(M,A,L,{title:F,charset:X.defaults?.charset??"utf8",...X.name!=null&&{siteName:X.name},...X.url!=null&&{siteUrl:X.url},pageUrl:Z.urlPattern});if(X.$media)K.$media={...X.$media,...K.$media};if(X.images?.optimize&&(Q||z))await $q(K,X.images,q,Q,z??void 0);let k=await l5(K,{lang:X.defaults?.lang??"en",projectStyle:X.style??null,title:F});if(I.rules.length>0)k.html=k.html.replace("</head>",`<style>
243
- ${I.rules.join(`
246
+ */WW(U1);YW(U1);qW(U1);$W(U1);jW(U1);CW(U1);bW(U1);hW(U1);vK=U1});import{createHash as mW}from"node:crypto";import{existsSync as yK,mkdirSync as gK,readFileSync as hK}from"node:fs";import{basename as fK,extname as mK,resolve as W8}from"node:path";import{createRequire as uK}from"node:module";async function uW(){if(j6)return j6;try{return j6=(await Promise.resolve().then(() => (Z8(),e3))).default,j6}catch{}try{return j6=uK(W8(process.cwd(),"package.json"))("sharp"),j6}catch(Z){throw Error(`Sharp is required for image optimization but failed to load: ${N1(Z)}`,{cause:Z})}}async function X8(Z){let X=await(await uW())(Z).metadata();return{format:X.format??"unknown",height:X.height??0,width:X.width??0}}function G4(Z){let W=hK(Z);return mW("md5").update(W).digest("hex").slice(0,8)}function Q8(Z){let W=JSON.stringify({formats:Z.formats,quality:Z.quality,widths:Z.widths});return mW("md5").update(W).digest("hex").slice(0,8)}function cK(Z,W,X,Q){return`${Z}-${W}-${X}.${Q}`}async function dW(Z,W,X){let Q=await uW(),J=await X8(Z),G=G4(Z),z=fK(Z,mK(Z)),q=W8(W,"_optimized");gK(q,{recursive:!0});let K=[],V=X.widths.filter(($)=>$<=J.width);if(V.length===0||!V.includes(J.width))V.push(J.width);V.sort(($,L)=>$-L);let H=[];for(let $ of V)for(let L of X.formats){let A=cK(z,$,G,L),j=`/${dK}/${A}`,D=W8(q,A);if(K.push({absolutePath:D,format:L,outputPath:j,width:$}),yK(D))continue;let R=X.quality[L]??80,x=Q(Z).resize($).toFormat(L,{quality:R}).toFile(D).then(()=>{});H.push(x)}let B=4;for(let $=0;$<H.length;$+=B)await Promise.all(H.slice($,$+B));return{contentHash:G,original:{format:J.format,height:J.height,width:J.width},variants:K}}function J8(Z,W){return Z.filter((X)=>X.format===W).map((X)=>`${X.outputPath} ${X.width}w`).join(", ")}var j6=null,dK="images/_optimized";var G8=d(()=>{D1()});import{existsSync as lK,mkdirSync as pK,readFileSync as nK,writeFileSync as iK}from"node:fs";import{basename as rK,resolve as V2}from"node:path";import{execSync as aK}from"node:child_process";import{tmpdir as sK}from"node:os";function E6(Z){if(z4===void 0)try{let W=aK("npm config get cache",{cwd:sK(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();z4=W&&W!=="undefined"?W:null}catch{z4=null}if(z4)return V2(z4,"jxsuite-images",rK(Z));return V2(Z,".cache/images")}function cW(Z){let W=V2(E6(Z),"manifest.json");if(!lK(W))return{entries:{},version:1};try{return JSON.parse(nK(W,"utf8"))}catch{return{entries:{},version:1}}}function lW(Z,W){let X=E6(Z);pK(X,{recursive:!0}),iK(V2(X,"manifest.json"),JSON.stringify(W,null,2),"utf8")}function pW(Z,W){let X=Z.entries[W];if(!X)return null;return X.manifest}function nW(Z,W,X,Q){Z.entries[W]={manifest:Q,source:X,timestamp:Date.now()}}var z4;var z8=d(()=>{G8()});import{existsSync as Y8}from"node:fs";import{basename as oK,extname as aW,resolve as iW}from"node:path";async function oW(Z,W){let X=W.get(Z);if(!X){let Q=G4(Z);try{let J=await X8(Z);X={width:J.width,height:J.height,hash:Q}}catch(J){if(!rW)rW=!0,console.warn(`Could not read image dimensions (${J.message}) — `+"emitting srcsets without width/height attributes.");X={width:null,height:null,hash:Q}}W.set(Z,X)}return X}function B2(Z,W,X,Q){let J=W.quality?.webp??80,G=Z.startsWith("/")?"":"/",z=Q?`?v=${Q}`:"";return W.widths.filter((q)=>q<=X).toSorted((q,K)=>q-K).map((q)=>`/cdn-cgi/image/width=${q},quality=${J},fit=scale-down,format=auto${G}${Z}${z} ${q}w`).join(", ")}async function tW(Z,W,X,Q,J){let G=`${G4(Z)}:${Q8(X)}`,z=pW(J,G);if(z){if(z.variants.every((V)=>Y8(V.absolutePath)))return z}if(!z)console.log(` Optimizing ${oK(Z)}...`);let q=await dW(Z,E6(Q),X);return nW(J,G,W,q),q}function eW(Z){if(typeof Z!=="string")return!0;if(!Z)return!0;if(Z.includes("${"))return!0;if(tK.some((W)=>Z.startsWith(W)))return!0;if(sW.has(aW(Z).toLowerCase()))return!0;return!1}function ZX(Z,W){if(W.service!=="cloudflare")return!1;if(!W.remoteDomains?.length)return!1;if(typeof Z!=="string"||!Z.startsWith("https://"))return!1;if(Z.includes("${"))return!1;try{let X=new URL(Z);if(sW.has(aW(X.pathname).toLowerCase()))return!1;return W.remoteDomains.includes(X.hostname)}catch{return!1}}function WX(Z,W){if(Z.startsWith("/"))return iW(W,"public",Z.slice(1));return iW(W,Z)}async function XX(Z,W,X,Q,J){let G=new Map;if(!W.optimize)return{imageRefs:G};return await QX(Z,W,X,Q,J??new Map,G),{imageRefs:G}}async function QX(Z,W,X,Q,J,G){if(!Z||typeof Z!=="object")return;if(Z.tagName==="img")await eK(Z,W,X,Q,J,G);if(typeof Z.innerHTML==="string"&&Z.innerHTML.includes("<img"))Z.innerHTML=await JV(Z.innerHTML,W,X,Q,J,G);if(Array.isArray(Z.children))for(let z of Z.children){if(typeof z==="string")continue;await QX(z,W,X,Q,J,G)}}async function eK(Z,W,X,Q,J,G){if(!Z.attributes)Z.attributes={};let z=Z.attributes.src??Z.src;if(typeof z!=="string")return;let q=ZX(z,W);if(!q&&eW(z))return;if(Z.attributes["data-no-optimize"]!==void 0)return;let K;if(q)K=B2(z,W,1/0,null);else{let V=WX(z,X);if(!Y8(V))return;if(W.service==="cloudflare"){let H=await oW(V,J);K=B2(z,W,H.width??1/0,H.hash)}else{let H=G.get(V);if(!H)H=await tW(V,z,W,X,Q),G.set(V,H);let B=W.formats.includes("avif")?"avif":W.formats[0];K=J8(H.variants,B)}}if(K)Z.attributes.srcset=K,Z.attributes.sizes??=W.sizes;if(W.lazyLoad&&Z.attributes.loading!=="eager")Z.attributes.loading="lazy",Z.attributes.decoding="async"}async function JV(Z,W,X,Q,J,G){let z=[];for(let K of Z.matchAll(ZV)){let V=K[0],H=K[1];if(XV.test(H))continue;if(QV.test(H))continue;let B=H.match(WV);if(!B)continue;let $=B[1].replaceAll("&amp;","&"),L=ZX($,W);if(!L&&eW($))continue;let A=L?null:WX($,X);if(A&&!Y8(A))continue;let j;if(L)j=B2($,W,1/0,null);else if(W.service==="cloudflare"){let R=await oW(A,J);j=B2($,W,R.width??1/0,R.hash)}else{let R=G.get(A);if(!R)R=await tW(A,$,W,X,Q),G.set(A,R);let x=W.formats.includes("avif")?"avif":W.formats[0];j=J8(R.variants,x)}if(!j)continue;let D=` srcset="${j}" sizes="${W.sizes}"`;if(W.lazyLoad&&!/\bloading="eager"/.test(H)){if(!/\bloading=/.test(H))D+=' loading="lazy"';if(!/\bdecoding=/.test(H))D+=' decoding="async"'}z.push({match:V,replacement:`<img${H}${D}>`})}let q=Z;for(let{match:K,replacement:V}of z)q=q.replace(K,V);return q}var sW,tK,rW=!1,ZV,WV,XV,QV;var JX=d(()=>{G8();z8();sW=new Set([".svg",".gif"]),tK=["http://","https://","data:","//"];ZV=/<img\b([^>]*)>/gi,WV=/\bsrc="([^"]*)"/,XV=/\bsrcset="/,QV=/\bdata-no-optimize\b/});var qX={};w4(qX,{buildSite:()=>UV});import{copyFileSync as GV,cpSync as U8,existsSync as C6,mkdirSync as u1,readdirSync as zV,rmSync as YV,writeFileSync as K1}from"node:fs";import{dirname as O6,join as $2,resolve as N0}from"node:path";async function UV(Z,W={}){let{clean:X=!0,verbose:Q=!1}=W,J=[],G=Q?console.log.bind(console):()=>{};G("Loading project.json...");let{config:z}=U5(Z),q=N0(Z,z.build.outDir),K=N0(Z,"pages"),V=N0(Z,"public"),H=z.build.trailingSlash??"always",B=await p6(Z,z);if(B.entries.length>0)G(` Registered ${B.entries.length} format(s): ${B.entries.map((c)=>c.name).join(", ")}`);if(X&&C6(q))YV(q,{force:!0,recursive:!0});if(u1(q,{recursive:!0}),!C6(K))throw Error(`pages/ directory not found in ${Z}`);G("Discovering pages...");let $=await V5(K,B);G(` Found ${$.length} page(s)`),G("Loading content types...");let L=await T5(Z,z,B);if(L.size>0){G(` Loaded ${L.size} content type(s): ${[...L.keys()].join(", ")}`);let c=L3(Z,z);if(c)R5(L,c.config)}let A=await H5($,Z,L,B);G(` ${A.length} route(s) after expansion`);let j=0,D=N0(Z,"components"),R=[],x=new Map,f=new Map;if(C6(D)){G("Compiling components...");let c=[".json",...B.documentExtensions("component")],o=zV(D).filter((X0)=>c.some((Q0)=>X0.endsWith(Q0))),W0=N0(q,"components");u1(W0,{recursive:!0});for(let X0 of o)try{let Q0=N0(D,X0),U0=await u4(Q0,{...z.$media?{$media:z.$media}:{},formats:B});for(let $0 of U0.files){let K0=$0.path.includes("/")?$0.path.split("/").pop():$0.path;if(K1(N0(W0,K0),$0.content,"utf8"),$0.tagName)R.push($0.tagName);j+=1}let J0=await r6(Q0,B);if(J0.tagName){f.set(J0.tagName,J0);let $0=P8(J0.tagName,J0.style,J0,z.$media??{});if($0)x.set(J0.tagName,$0),K1(N0(W0,`${J0.tagName}.css`),$0,"utf8"),j+=1}}catch(Q0){let U0=Q0;J.push(`Error compiling component ${X0}: ${U0.message}`),console.error(`Error compiling component ${X0}: ${U0.message}`)}G(` Compiled ${R.length} component(s): ${R.join(", ")}`)}let p=[];if(z.build.adapter)for(let[,c]of f){let o=P4(c);for(let W0 of o){let X0=`./components/${W0.src.replace(/^\.\//,"")}`;p.push({exportName:W0.exportName,src:X0})}}let r=z.images.optimize&&z.images.service==="cloudflare",m=z.images.optimize&&!r?cW(Z):null,S=r?new Map:null;if(r)console.log('images.service is "cloudflare" — srcsets use /cdn-cgi/image transform URLs. '+"Ensure Image Transformations are enabled for your zone (Cloudflare dashboard → "+"Images → Transformations); these URLs do not work on *.pages.dev / *.workers.dev previews.");for(let c of A)try{G(` Compiling ${c.urlPattern} ...`);let o=await qV(c,z,Z,L,m,f,S,B),W0=new Set;for(let[Q0,U0]of f)if(x2(U0))W0.add(Q0);if(R.length>0)o.html=BV(o.html,R,x,W0);let X0=UX(c.urlPattern,q,H);u1(O6(X0),{recursive:!0}),K1(X0,o.html,"utf8"),j+=1;for(let Q0 of B.withCapability("serialize")){if(!Q0.exportTarget)continue;try{let U0=await Q0.call("serialize",o.doc,{buildScope:(J0)=>q6(J0,null),componentDefs:f,evaluateTemplate:(J0,$0)=>{if(!s(J0))return;return E0(J0,$0)??J0},mode:"export"});if(U0){let J0=X0.replace(/\.html$/,Q0.extensions[0]);K1(J0,U0,"utf8"),j+=1}}catch(U0){let J0=U0;J.push(`Error exporting ${Q0.name} for ${c.urlPattern}: ${J0.message}`)}}for(let Q0 of o.files){let U0=N0(O6(X0),Q0.path);u1(O6(U0),{recursive:!0}),K1(U0,Q0.content,"utf8"),j+=1}if(o.serverHandler){let Q0=N0(O6(X0),"_server.js");K1(Q0,o.serverHandler,"utf8"),j+=1}}catch(o){let W0=o,X0=`Error compiling ${c.urlPattern}: ${W0.message}`;J.push(X0),console.error(X0)}if(m&&z.images.optimize){lW(Z,m);let c=N0(E6(Z),"_optimized");if(C6(c)){let W0=N0(q,"images/_optimized");u1(W0,{recursive:!0}),U8(c,W0,{recursive:!0})}let o=Object.keys(m.entries).length;if(o>0)G(` Optimized ${o} image(s)`)}if(z.build.adapter){let{adapter:c}=z.build;G("Generating site-wide server worker...");let o=new Map;for(let Q0 of p)if(!o.has(Q0.exportName))o.set(Q0.exportName,Q0);let X0=c==="cloudflare-pages"&&o.size===0?null:e2([...o.values()],{adapter:c});if(X0){let Q0=c==="cloudflare-pages"?"_worker.js":"worker.js";if(K1(N0(q,Q0),X0,"utf8"),j+=1,G(` Generated dist/${Q0} (${o.size} server function(s))`),c==="cloudflare-pages")K1(N0(q,"_routes.json"),`${JSON.stringify({exclude:[],include:["/_jx/*"],version:1},null,2)}
247
+ `,"utf8"),j+=1;let U0=N0(q,"components");u1(U0,{recursive:!0});for(let{src:J0}of o.values()){let $0=N0(Z,J0.replace(/^\.\//,"")),K0=N0(U0,J0.replace(/^\.\/components\//,""));if(C6($0))GV($0,K0)}}}if(z.redirects&&Object.keys(z.redirects).length>0){G("Generating redirects...");let c=FV(z.redirects,q);j+=c}if(C6(V))G("Copying public/ assets..."),U8(V,q,{recursive:!0});if(z.copy){G("Copying mapped files...");for(let[c,o]of Object.entries(z.copy)){let W0=N0(Z,c),X0=N0(q,o);u1(O6(X0),{recursive:!0}),U8(W0,X0)}}if(G(`
248
+ Build complete: ${A.length} routes, ${j} files`),J.length>0)G(` ${J.length} error(s)`);return{errors:J,files:j,routes:A.length}}async function qV(Z,W,X,Q=new Map,J=null,G=new Map,z=null,q){let K=await r6(Z.sourcePath,q),V=H3(K,W,X),H=K.$head??V._pageHead??[],B=V.$head??[],$=K.title??V._pageTitle??null;delete V._pageHead,delete V._pageTitle,I5(V,W,Z,Q,X),await _5(V,Z,X,{config:W,contentTypes:Q});let L=q6(V.state??{}),A=$??W.name??"Jx Site";if(typeof A==="string"&&s(A))A=E0(A,L)??A;let j=GX(H,L),D=GX(B,L);Y4(V,L);let R={counter:{n:0},media:{...W.$media,...V.$media},rules:[]};if(K8(V,G,R),V.state)for(let[S,c]of Object.entries(V.state)){if(S==="$site"||S==="$page")continue;if(c&&typeof c==="object"&&!Array.isArray(c)&&c.timing==="compiler")delete V.state[S];else if(Array.isArray(c))delete V.state[S]}let x=KV(W.$head??[]),f=A5(x,D,j,{title:A,charset:W.defaults?.charset??"utf8",...W.name!=null&&{siteName:W.name},...W.url!=null&&{siteUrl:W.url},pageUrl:Z.urlPattern});if(W.$media)V.$media={...W.$media,...V.$media};if(W.images?.optimize&&(J||z))await XX(V,W.images,X,J,z??void 0);let p=await V3(V,{lang:W.defaults?.lang??"en",projectStyle:W.style??null,title:A});if(R.rules.length>0)p.html=p.html.replace("</head>",`<style>
249
+ ${R.rules.join(`
244
250
  `)}
245
251
  </style>
246
- </head>`);k.html=PH(k.html,P,X.defaults?.lang??"en");let b=(K.$elements??[]).filter((T)=>typeof T==="string"&&!T.startsWith("./")&&!T.startsWith("../"));if(b.length>0)k.html=_H(k.html,b);let C=null;if(!X.build?.adapter)try{let T=await Y1(Z.sourcePath);if(T)C=T}catch{}return{doc:K,files:k.files,html:k.html,serverHandler:C}}function Mq(Z,X){return Z.map((q)=>{if(!q||typeof q!=="object")return q;let W={...q};if(W.attributes){W.attributes={...W.attributes};for(let[Q,J]of Object.entries(W.attributes))if(typeof J==="string"&&x(J))W.attributes[Q]=Y0(J,X)??J}if(typeof W.textContent==="string"&&x(W.textContent))W.textContent=Y0(W.textContent,X)??W.textContent;return W})}function NH(Z){return Z.map((X)=>{if(!X||typeof X!=="object"||!X.attributes)return X;let q={...X,attributes:{...X.attributes}};for(let W of["href","src"]){let Q=q.attributes[W];if(typeof Q==="string"&&TH(Q))q.attributes[W]=`/node_modules/${Q}`}return q})}function TH(Z){return!Z.startsWith("/")&&!Z.startsWith("./")&&!Z.startsWith("../")&&!Z.startsWith("http")&&!Z.startsWith("data:")}function Lq(Z,X){if(!Z||typeof Z!=="object")return Z;let q={};for(let[W,Q]of Object.entries(Z))if(W==="children"&&Array.isArray(Q))q.children=Q.map((J)=>{if(typeof J==="string")return J;return Lq(J,X)});else if(W==="style"&&Q&&typeof Q==="object"){let J={...Q};for(let[z,Y]of Object.entries(J))if(x(Y))J[z]=m1(Y,X)??Y;q.style=J}else if(W==="attributes"&&Q&&typeof Q==="object"){let J={...Q};for(let[z,Y]of Object.entries(J))if(x(Y))J[z]=m1(Y,X)??Y;q.attributes=J}else if(W==="$props"&&Q&&typeof Q==="object"){let J={...Q};for(let[z,Y]of Object.entries(J))if(x(Y)){let U=m1(Y,X);J[z]=U!==null?U??null:Y}q.$props=J}else if(typeof Q==="string"&&x(Q))q[W]=m1(Q,X)??Q;else q[W]=Q;return q}function m1(Z,X){try{let q=X.$map?.item,W=X.$map?.index,Q=Z.match(/^\$\{(.+)\}$/s);if(Q)return Function("state","$map","item","index",`return (${Q[1]})`)(X,X.$map,q,W);return Function("state","$map","item","index",`return \`${Z}\``)(X,X.$map,q,W)}catch{return null}}function h4(Z,X){if(!Z||typeof Z!=="object")return;if(typeof Z.innerHTML==="string"&&x(Z.innerHTML)){let W=Y0(Z.innerHTML,X);if(W!=null)Z.innerHTML=String(W).replaceAll("${","&#36;{")}if(typeof Z.textContent==="string"&&x(Z.textContent))Z.textContent=Y0(Z.textContent,X)??Z.textContent;if(Z.style&&typeof Z.style==="object"){for(let[W,Q]of Object.entries(Z.style))if(typeof Q==="string"&&x(Q))Z.style[W]=Y0(Q,X)??Q}if(Z.attributes&&typeof Z.attributes==="object"){for(let[W,Q]of Object.entries(Z.attributes))if(typeof Q==="string"&&x(Q))Z.attributes[W]=Y0(Q,X)??Q}if(Z.$props&&typeof Z.$props==="object"){for(let[W,Q]of Object.entries(Z.$props))if(typeof Q==="string"&&x(Q))Z.$props[W]=Y0(Q,X)??Q}let q=Z.children;if(w6(q)){let W=q.items,Q=null;if(L0(W))Q=t1(W.$ref,X);else if(Array.isArray(W))Q=W;let J=q.map;if(Array.isArray(Q)&&J){Z.children=Q.map((z,Y)=>{let U=Object.create(X);U.$map={index:Y,item:z},U["$map/item"]=z,U["$map/index"]=Y;let K=Lq(J,U);return h4(K,U),K});return}}if(typeof q==="string"&&x(q)){let W=Y0(q,X);if(Array.isArray(W)){let Q=W;Z.children=Q;for(let J of Q)h4(J,X)}}else if(Array.isArray(Z.children)){let W=0;while(W<Z.children.length){let Q=Z.children[W];if(typeof Q==="string"&&x(Q)){let J=Y0(Q,X);if(Array.isArray(J)){let z=J;Z.children.splice(W,1,...z);for(let Y of z)h4(Y,X);W+=z.length;continue}}h4(Q,X),W+=1}}}function c3(Z,X,q){if(!Z||typeof Z!=="object")return;if(Array.isArray(Z)){for(let Q of Z)c3(Q,X,q);return}if(Array.isArray(Z.children))for(let Q of Z.children)c3(Q,X,q);let W=X.get(Z.tagName);if(W){let Q=Array.isArray(Z.children)&&Z.children.length>0?Z.children.map((Y)=>{if(q&&Y&&typeof Y==="object")G6(Y,q.rules,q.media,"",q.counter,"jxs");return b6(Y,{},null)}).join(`
247
- `):null,J=q8(W,Z.$props||null,Q),z=e1(W);if(Z.innerHTML=J,delete Z.children,W.style&&Z.$props){let Y={...W.state};for(let[V,B]of Object.entries(Z.$props))Y[V]=V in Y?B:B;let U=m6(Y,null),K={};for(let[V,B]of Object.entries(W.style))if(typeof B==="string"&&x(B)){let H=p(B,U);if(H!=null)K[V]=H}if(Object.keys(K).length>0)Z.style={...Z.style,...K}}if(delete Z.$props,z)Z.$static=!0;else Z.$prerendered=!0}}function RH(Z,X,q=new Map,W=new Set){let Q=X.filter((H)=>Z.includes(`<${H}`));if(Q.length===0)return Z;let J=Q.filter((H)=>q.has(H)).map((H)=>`<link rel="stylesheet" href="/components/${H}.css">`).join(`
248
- `),z=Z;if(J)z=z.replace("</head>",` ${J}
249
- </head>`);let Y=Q.filter((H)=>!W.has(H));if(Y.length===0)return z;let U=`<script type="importmap">
252
+ </head>`);p.html=$V(p.html,f,W.defaults?.lang??"en");let r=(V.$elements??[]).filter((S)=>typeof S==="string"&&!S.startsWith("./")&&!S.startsWith("../"));if(r.length>0)p.html=HV(p.html,r);let m=null;if(!W.build?.adapter)try{let S=await l6(Z.sourcePath);if(S)m=S}catch{}return{doc:V,files:p.files,html:p.html,serverHandler:m}}function GX(Z,W){return Z.map((X)=>{if(!X||typeof X!=="object")return X;let Q={...X};if(Q.attributes){Q.attributes={...Q.attributes};for(let[J,G]of Object.entries(Q.attributes))if(typeof G==="string"&&s(G))Q.attributes[J]=E0(G,W)??G}if(typeof Q.textContent==="string"&&s(Q.textContent))Q.textContent=E0(Q.textContent,W)??Q.textContent;return Q})}function KV(Z){return Z.map((W)=>{if(!W||typeof W!=="object"||!W.attributes)return W;let X={...W,attributes:{...W.attributes}};for(let Q of["href","src"]){let J=X.attributes[Q];if(typeof J==="string"&&VV(J))X.attributes[Q]=`/node_modules/${J}`}return X})}function VV(Z){return!Z.startsWith("/")&&!Z.startsWith("./")&&!Z.startsWith("../")&&!Z.startsWith("http")&&!Z.startsWith("data:")}function YX(Z,W){if(!Z||typeof Z!=="object")return Z;let X={};for(let[Q,J]of Object.entries(Z))if(Q==="children"&&Array.isArray(J))X.children=J.map((G)=>{if(typeof G==="string")return G;return YX(G,W)});else if(Q==="style"&&J&&typeof J==="object"){let G={...J};for(let[z,q]of Object.entries(G))if(s(q))G[z]=H2(q,W)??q;X.style=G}else if(Q==="attributes"&&J&&typeof J==="object"){let G={...J};for(let[z,q]of Object.entries(G))if(s(q))G[z]=H2(q,W)??q;X.attributes=G}else if(Q==="$props"&&J&&typeof J==="object"){let G={...J};for(let[z,q]of Object.entries(G))if(s(q)){let K=H2(q,W);G[z]=K!==null?K??null:q}X.$props=G}else if(typeof J==="string"&&s(J))X[Q]=H2(J,W)??J;else X[Q]=J;return X}function H2(Z,W){try{let X=W.$map?.item,Q=W.$map?.index,J=Z.match(/^\$\{(.+)\}$/s);if(J)return Function("state","$map","item","index",`return (${J[1]})`)(W,W.$map,X,Q);return Function("state","$map","item","index",`return \`${Z}\``)(W,W.$map,X,Q)}catch{return null}}function Y4(Z,W){if(!Z||typeof Z!=="object")return;if(typeof Z.innerHTML==="string"&&s(Z.innerHTML)){let Q=E0(Z.innerHTML,W);if(Q!=null)Z.innerHTML=String(Q).replaceAll("${","&#36;{")}if(typeof Z.textContent==="string"&&s(Z.textContent))Z.textContent=E0(Z.textContent,W)??Z.textContent;if(Z.style&&typeof Z.style==="object"){for(let[Q,J]of Object.entries(Z.style))if(typeof J==="string"&&s(J))Z.style[Q]=E0(J,W)??J}if(Z.attributes&&typeof Z.attributes==="object"){for(let[Q,J]of Object.entries(Z.attributes))if(typeof J==="string"&&s(J))Z.attributes[Q]=E0(J,W)??J}if(Z.$props&&typeof Z.$props==="object"){for(let[Q,J]of Object.entries(Z.$props))if(typeof J==="string"&&s(J))Z.$props[Q]=E0(J,W)??J}let X=Z.children;if(R0(X)){let Q=zX(X,W);if(Q){Z.children=Q;return}}if(typeof X==="string"&&s(X)){let Q=E0(X,W);if(Array.isArray(Q)){let J=Q;Z.children=J;for(let G of J)Y4(G,W)}}else if(Array.isArray(Z.children)){let Q=0;while(Q<Z.children.length){let J=Z.children[Q];if(typeof J==="string"&&s(J)){let G=E0(J,W);if(Array.isArray(G)){let z=G;Z.children.splice(Q,1,...z);for(let q of z)Y4(q,W);Q+=z.length;continue}}if(R0(J)){let G=zX(J,W);if(G){Z.children.splice(Q,1,...G),Q+=G.length;continue}}Y4(J,W),Q+=1}}}function zX(Z,W){let X=Z.items,Q=null;if(h0(X))Q=O2(X.$ref,W);else if(Array.isArray(X))Q=X;let J=Z.map;if(!Array.isArray(Q)||!J)return null;return Q.map((G,z)=>{let q=Object.create(W);q.$map={index:z,item:G},q["$map/item"]=G,q["$map/index"]=z;let K=YX(J,q);return Y4(K,q),K})}function K8(Z,W,X){if(!Z||typeof Z!=="object")return;if(Array.isArray(Z)){for(let J of Z)K8(J,W,X);return}if(Array.isArray(Z.children))for(let J of Z.children)K8(J,W,X);let Q=W.get(Z.tagName);if(Q){let J=Array.isArray(Z.children)&&Z.children.length>0?Z.children.map((q)=>{if(X&&q&&typeof q==="object")k1(q,X.rules,X.media,"",X.counter,"jxs");return J6(q,{},null)}).join(`
253
+ `):null,G=R8(Q,Z.$props||null,J),z=x2(Q);if(Z.innerHTML=G,delete Z.children,Q.style&&Z.$props){let q={...Q.state};for(let[H,B]of Object.entries(Z.$props))q[H]=H in q?B:B;let K=q6(q,null),V={};for(let[H,B]of Object.entries(Q.style))if(typeof B==="string"&&s(B)){let $=F0(B,K);if($!=null)V[H]=$}if(Object.keys(V).length>0)Z.style={...Z.style,...V}}if(delete Z.$props,z)Z.$static=!0;else Z.$prerendered=!0}}function BV(Z,W,X=new Map,Q=new Set){let J=W.filter(($)=>Z.includes(`<${$}`));if(J.length===0)return Z;let G=J.filter(($)=>X.has($)).map(($)=>`<link rel="stylesheet" href="/components/${$}.css">`).join(`
254
+ `),z=Z;if(G)z=z.replace("</head>",` ${G}
255
+ </head>`);let q=J.filter(($)=>!Q.has($));if(q.length===0)return z;let K=`<script type="importmap">
250
256
  {
251
257
  "imports": {
252
- "@vue/reactivity": "${y6}",
253
- "lit-html": "${g6}"
258
+ "@vue/reactivity": "${z6}",
259
+ "lit-html": "${Y6}"
254
260
  }
255
261
  }
256
- </script>`,K=Y.map((H)=>`<script type="module" src="/components/${H}.js"></script>`).join(`
257
- `),B=(z.includes('<script type="importmap">')?"":`${U}
258
- `)+K;return z.replace("</body>",` ${B}
259
- </body>`)}function _H(Z,X){let q=X.map((W)=>`<script type="module" src="/node_modules/${W}"></script>`).join(`
260
- `);return Z.replace("</body>",` ${q}
261
- </body>`)}function PH(Z,X,q){let W=O7(X),Q=/<head>([\s\S]*?)<\/head>/i,J=Z.match(Q),z="";if(J){let U=J[1].match(/<style>[\s\S]*?<\/style>/gi);if(U)z+=`
262
- ${U.join(`
263
- `)}`;let K=J[1].match(/<script[\s\S]*?<\/script>/gi);if(K)z+=`
262
+ </script>`,V=q.map(($)=>`<script type="module" src="/components/${$}.js"></script>`).join(`
263
+ `),B=(z.includes('<script type="importmap">')?"":`${K}
264
+ `)+V;return z.replace("</body>",` ${B}
265
+ </body>`)}function HV(Z,W){let X=W.map((Q)=>`<script type="module" src="/node_modules/${Q}"></script>`).join(`
266
+ `);return Z.replace("</body>",` ${X}
267
+ </body>`)}function $V(Z,W,X){let Q=M5(W),J=/<head>([\s\S]*?)<\/head>/i,G=Z.match(J),z="";if(G){let K=G[1].match(/<style>[\s\S]*?<\/style>/gi);if(K)z+=`
264
268
  ${K.join(`
265
- `)}`}let Y=Z;if(Q.test(Y))Y=Y.replace(Q,`<head>
266
- ${W}${z}
267
- </head>`);return Y=Y.replace(/<html\s[^>]*>/i,(U)=>{if(/lang=/.test(U))return U.replace(/lang="[^"]*"/,`lang="${q}"`);return U.replace("<html",`<html lang="${q}"`)}),Y}function Iq(Z,X,q){if(Z==="/")return f1(X,"index.html");let W=Z.replace(/^\//,"");if(q==="always")return f1(X,W,"index.html");return f1(X,`${W}.html`)}function jH(Z,X){let q=0,W=[];for(let[Q,J]of Object.entries(Z)){let z=typeof J==="object"?J.destination:J,Y=typeof J==="object"?J.status??301:301;if(Q.includes(":")||Q.includes("*")){W.push(`${Q} ${z} ${Y}`);continue}let U=Iq(Q,X,"always"),K=`<!DOCTYPE html>
269
+ `)}`;let V=G[1].match(/<script[\s\S]*?<\/script>/gi);if(V)z+=`
270
+ ${V.join(`
271
+ `)}`}let q=Z;if(J.test(q))q=q.replace(J,`<head>
272
+ ${Q}${z}
273
+ </head>`);return q=q.replace(/<html\s[^>]*>/i,(K)=>{if(/lang=/.test(K))return K.replace(/lang="[^"]*"/,`lang="${X}"`);return K.replace("<html",`<html lang="${X}"`)}),q}function UX(Z,W,X){if(Z==="/")return $2(W,"index.html");let Q=Z.replace(/^\//,"");if(X==="always")return $2(W,Q,"index.html");return $2(W,`${Q}.html`)}function FV(Z,W){let X=0,Q=[];for(let[J,G]of Object.entries(Z)){let z=typeof G==="object"?G.destination:G,q=typeof G==="object"?G.status??301:301;if(J.includes(":")||J.includes("*")){Q.push(`${J} ${z} ${q}`);continue}let K=UX(J,W,"always"),V=`<!DOCTYPE html>
268
274
  <html>
269
275
  <head>
270
276
  <meta charset="utf-8">
271
- <meta http-equiv="refresh" content="0;url=${d3(z)}">
272
- <link rel="canonical" href="${d3(z)}">
277
+ <meta http-equiv="refresh" content="0;url=${q8(z)}">
278
+ <link rel="canonical" href="${q8(z)}">
273
279
  <title>Redirecting...</title>
274
280
  </head>
275
281
  <body>
276
- <p>Redirecting to <a href="${d3(z)}">${EH(z)}</a>...</p>
282
+ <p>Redirecting to <a href="${q8(z)}">${LV(z)}</a>...</p>
277
283
  </body>
278
- </html>`;M6(V4(U),{recursive:!0}),n0(U,K,"utf8"),q+=1,W.push(`${Q} ${z} ${Y}`)}if(W.length>0)n0(f1(X,"_redirects"),`${W.join(`
284
+ </html>`;u1(O6(K),{recursive:!0}),K1(K,V,"utf8"),X+=1,Q.push(`${J} ${z} ${q}`)}if(Q.length>0)K1($2(W,"_redirects"),`${Q.join(`
279
285
  `)}
280
- `,"utf8"),q+=1;return q}function EH(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function d3(Z){return String(Z).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}var Dq=R(()=>{S0();D7();P7();s6();E7();k7();L7();H1();T6();g7();m7();Aq();m3()});import{resolve as CH}from"node:path";var Nq=process.argv.slice(2),[m4]=Nq;if(!m4||m4==="--help"||m4==="-h")console.log(`Usage: jx <command> [options]
286
+ `,"utf8"),X+=1;return X}function LV(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function q8(Z){return String(Z).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}var KX=d(()=>{e0();q5();$5();L6();L5();w5();z5();i6();S1();P5();j5();JX();z8()});import{resolve as AV}from"node:path";var VX=process.argv.slice(2),[U4]=VX;if(!U4||U4==="--help"||U4==="-h")console.log(`Usage: jx <command> [options]
281
287
 
282
288
  Commands:
283
289
  build [root] Build a Jx site to dist/
284
290
 
285
291
  Options:
286
292
  --verbose Print detailed build progress
287
- --no-clean Don't clean outDir before building`),process.exit(0);if(m4==="build"){let Z=Nq.slice(1),X=new Set(Z.filter((z)=>z.startsWith("--"))),q=Z.find((z)=>!z.startsWith("--")),W=CH(q??"."),Q=X.has("--verbose"),J=!X.has("--no-clean");console.log(`Building site from ${W}...`);try{let{buildSite:z}=await Promise.resolve().then(() => (Dq(),wq)),Y=await z(W,{clean:J,verbose:Q});if(Y.errors.length>0){console.error(`
288
- Build completed with ${Y.errors.length} error(s):`);for(let U of Y.errors)console.error(` - ${U}`);process.exit(1)}console.log(`
289
- Done: ${Y.routes} routes → ${Y.files} files`)}catch(z){console.error(`Build failed: ${z.message}`),process.exit(1)}}else console.error(`Unknown command: ${m4}
293
+ --no-clean Don't clean outDir before building`),process.exit(0);if(U4==="build"){let Z=VX.slice(1),W=new Set(Z.filter((z)=>z.startsWith("--"))),X=Z.find((z)=>!z.startsWith("--")),Q=AV(X??"."),J=W.has("--verbose"),G=!W.has("--no-clean");console.log(`Building site from ${Q}...`);try{let{buildSite:z}=await Promise.resolve().then(() => (KX(),qX)),q=await z(Q,{clean:G,verbose:J});if(q.errors.length>0){console.error(`
294
+ Build completed with ${q.errors.length} error(s):`);for(let K of q.errors)console.error(` - ${K}`);process.exit(1)}console.log(`
295
+ Done: ${q.routes} routes → ${q.files} files`)}catch(z){console.error(`Build failed: ${z.message}`),process.exit(1)}}else console.error(`Unknown command: ${U4}
290
296
  Run "jx --help" for usage.`),process.exit(1);