@jxsuite/compiler 0.33.0 → 0.34.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,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as MX}from"node:module";var UX=Object.create;var{getPrototypeOf:KX,defineProperty:N1,getOwnPropertyNames:VX}=Object;var BX=Object.prototype.hasOwnProperty;function HX(Z){return this[Z]}var $X,FX,g4=(Z,W,X)=>{var Q=Z!=null&&typeof Z==="object";if(Q){var J=W?$X??=new WeakMap:FX??=new WeakMap,G=J.get(Z);if(G)return G}X=Z!=null?UX(KX(Z)):{};let Y=W||!Z||!Z.__esModule?N1(X,"default",{value:Z,enumerable:!0}):X;for(let U of VX(Z))if(!BX.call(Y,U))N1(Y,U,{get:HX.bind(Z,U),enumerable:!0});if(Q)J.set(Z,Y);return Y};var n=(Z,W)=>()=>(W||Z((W={exports:{}}).exports,W),W.exports);var LX=(Z)=>Z;function AX(Z,W){this[Z]=LX.bind(null,W)}var N2=(Z,W)=>{for(var X in W)N1(Z,X,{get:W[X],enumerable:!0,configurable:!0,set:AX.bind(W,X)})};var c=(Z,W)=>()=>(Z&&(W=Z(Z=0)),W);var T0=MX(import.meta.url);function w1(Z){let W=Z.$map;return W&&typeof W==="object"?W:void 0}function x6(Z){return H8.has(Z)}function o0(Z,W,X,Q){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return M6(Z,W,X,Q);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return NX(Z.$ref,W,X,Q);if(Array.isArray(Z))return Z.map((J)=>o0(J,W,X,Q));return Z}function NX(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 G4(X,J)}if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J,Y,U=w1(W);if(G==="item")Y=Q?.item??U?.item??W["$map/item"];else if(G==="index")Y=Q?.index??U?.index??W["$map/index"];else Y=U?.[G]??W[`$map/${G}`];return J.length>2?G4(Y,J.slice(2).join("/")):Y}if(Z.startsWith("#/state/")){let J=Z.slice(8),G=J.indexOf("/");if(G===-1)return W[J];return G4(W[J.slice(0,G)],J.slice(G+1))}if(Z.startsWith("parent#/"))return W[Z.slice(8)];if(Z.startsWith("window#/"))return G4(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return G4(globalThis.document,Z.slice(10));return W[Z]??null}function wX(Z,W,X,Q){if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J,Y,U=w1(W);if(G==="item")Y=Q?.item??U?.item??W["$map/item"];else if(G==="index")Y=Q?.index??U?.index??W["$map/index"];else Y=U?.[G]??W[`$map/${G}`];if(J.length>2){let K=J.slice(2),V=K.pop(),H=K.length>0?G4(Y,K.join("/")):Y;return{key:V,obj:H}}return{key:G==="item"?"$map/item":"$map/index",obj:w1(W)??W}}if(Z.startsWith("#/state/")){let J=Z.slice(8);if(J.indexOf("/")===-1)return{key:J,obj:W};let Y=J.split("/"),U=Y.pop(),K=W;for(let V of Y)K=K[V];return{key:U,obj:K}}return{key:Z,obj:W}}function M6(Z,W,X,Q){let{operator:J,target:G,value:Y,initial:U}=Z;if(!IX.has(J))throw Error(`$expression: unknown operator "${J}"`);if(D1.has(J)&&!("value"in Z)){let K=o0(G,W,X,Q);if(J==="!")return!K;if(J==="-")return-K}if(T1.has(J)){let K=o0(G,W,X,Q),V=o0(Y,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=o0(Y,W,X,Q),{obj:V,key:H}=wX(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=o0(G,W,X,Q);switch(J){case"push":return K.push(o0(Y,W,X,Q));case"unshift":return K.unshift(o0(Y,W,X,Q));case"pop":return K.pop();case"shift":return K.shift();case"splice":{let V=o0(Y,W,X,Q);return K.splice(...V)}default:break}}if(R1.has(J)){let K=o0(G,W,X,Q);if(J==="reduce"){let V=o0(U,W,X,Q);for(let[H,B]of K.entries())V=M6(Y,W,X,{acc:V,index:H,item:B});return V}if(J==="map")return K.map((V,H)=>M6(Y,W,X,{...Q,index:H,item:V}));if(J==="filter")return K.filter((V,H)=>M6(Y,W,X,{...Q,index:H,item:V}))}return}function l0(Z,W){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return p0(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)=>l0(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 l0(Z,W)}function p0(Z,W={}){let{operator:X,target:Q,value:J,initial:G}=Z;if(D1.has(X)&&!("value"in Z)){let Y=l0(Q,W);if(X==="!")return`!(${Y})`;if(X==="-")return`-(${Y})`}if(T1.has(X)){let Y=l0(Q,W),U=l0(J,W);return`(${Y} ${X} ${U})`}if($8.has(X)){let Y=B8(Q,W),U=l0(J,W);return`${Y} ${X} ${U}`}if(F8.has(X)){let Y=B8(Q,W);switch(X){case"push":return`${Y}.push(${l0(J,W)})`;case"unshift":return`${Y}.unshift(${l0(J,W)})`;case"pop":return`${Y}.pop()`;case"shift":return`${Y}.shift()`;case"splice":{let U=Array.isArray(J)?J.map((K)=>l0(K,W)).join(", "):l0(J,W);return`${Y}.splice(${U})`}default:break}}if(R1.has(X)){let Y=l0(Q,W),U=p0(J,W);if(X==="reduce"){let K=l0(G,W);return`${Y}.reduce((_acc, _item, _index) => ${U}, ${K})`}if(X==="map")return`${Y}.map((_item, _index) => ${U})`;if(X==="filter")return`${Y}.filter((_item, _index) => ${U})`}return"undefined"}function G4(Z,W){let X=Z;for(let Q of W.split(/[./]/))X=X?.[Q];return X}var H8,D1,T1,$8,F8,R1,IX;var w2=c(()=>{H8=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),D1=new Set(["!","-"]),T1=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||"]),$8=new Set(["=","+=","-=","*=","/="]),F8=new Set(["push","pop","shift","unshift","splice"]),R1=new Set(["reduce","map","filter"]),IX=new Set([...H8,...D1,...T1,...R1])});function h0(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function f0(Z){return h0(Z)&&typeof Z.$ref==="string"}function I6(Z){return h0(Z)&&Z.$prototype==="Function"}function t0(Z){return h0(Z)&&h0(Z.$expression)}function n6(Z){return h0(Z)&&typeof Z.$prototype==="string"&&Z.$prototype!=="Function"}function P1(Z){return h0(Z)&&Z.timing==="server"&&typeof Z.$src==="string"&&typeof Z.$export==="string"&&!Z.$prototype}function A8(Z){return h0(Z)&&!Z.$prototype&&!Z.$expression&&"default"in Z}function k6(Z){if(!h0(Z))return!1;for(let W of Object.keys(Z))if(!M8.has(W))return!1;return!0}function R0(Z){return h0(Z)&&Z.$prototype==="Array"}function _1(Z){if(R0(Z))return!0;return Array.isArray(Z)&&Z.some((W)=>R0(W))}function I8(Z){return h0(Z)&&Z.$prototype==="Class"}function a(Z){return typeof Z==="string"&&Z.includes("${")}function S6(Z){if(!Z)return[];return Z.map((W)=>typeof W==="string"?W:W.name)}var M8;var X6=c(()=>{M8=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function DX(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function S0(Z){return Z.replaceAll(/[A-Z]/g,(W)=>`-${W.toLowerCase()}`)}function E0(Z){return Object.entries(Z).filter(([W,X])=>!DX(W)&&(X===null||typeof X!=="object")).map(([W,X])=>`${S0(W)}: ${X}`).join("; ")}var b6;var h4=c(()=>{w2();X6();b6=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 T2(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(k6(X))continue;return!0}if(Z.$switch)return!0;if(R0(Z)||_1(Z.children))return!0;if(Array.isArray(Z.children)&&Z.children.some((W)=>T2(W)))return!0;for(let[W,X]of Object.entries(Z)){if(b6.has(W))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(a(X))return!0}if(Z.style&&typeof Z.style==="object"){for(let W of Object.values(Z.style))if(a(W))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let W of Object.values(Z.attributes))if(a(W))return!0}return!1}function w8(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(R0(Z)||_1(Z.children))return!0;for(let[W,X]of Object.entries(Z)){if(b6.has(W))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(a(X))return!0}if(Z.style&&typeof Z.style==="object"){for(let W of Object.values(Z.style))if(a(W))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let W of Object.values(Z.attributes))if(a(W))return!0}return!1}function K4(Z,W=null,X={},Q={}){let J=Z?.state?V4(Z.state,W):W??Object.create(null);return{media:Q,scope:J,scopeDefs:X}}function V4(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)){i6(X,Q,D2(J));continue}let G=J;if("default"in G){i6(X,Q,D2(G.default));continue}if(!G.$prototype&&!("$expression"in G)&&!k6(G))i6(X,Q,D2(G))}for(let[Q,J]of Object.entries(Z)){if(typeof J==="string"&&a(J)){j1(X,Q,()=>C0(J,X));continue}if(!J||typeof J!=="object")continue;if(t0(J)){let G=J.$expression;if(x6(G.operator))i6(X,Q,(Y,U)=>M6(G,Y,U));else j1(X,Q,()=>M6(G,X,null));continue}if(I6(J)){if(J.body){let G=J.parameters?S6(J.parameters):J.arguments??[],Y=Function("state",...G,J.body);if(J.body.includes("return"))j1(X,Q,()=>Y(X));else i6(X,Q,Y)}else i6(X,Q,()=>{});continue}if(n6(J)&&(J.$prototype==="LocalStorage"||J.$prototype==="SessionStorage"))i6(X,Q,D2(J.default??null))}return X}function i6(Z,W,X){Object.defineProperty(Z,W,{configurable:!0,enumerable:!0,value:X,writable:!0})}function j1(Z,W,X){Object.defineProperty(Z,W,{configurable:!0,enumerable:!0,get:X})}function $0(Z,W){if(e0(Z))return C1(Z.$ref,W);if(a(Z))return C0(Z,W);return Z}function e0(Z){return f0(Z)}function C1(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?N8(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 N8(W[X.slice(0,Q)],X.slice(Q+1))}return W[Z]??null}function C0(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 N8(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 D2(Z){if(Z===null||typeof Z!=="object")return Z;return structuredClone(Z)}function z4(Z,W){let X="",Q=$0(Z.id,W),J=$0(Z.className,W),G=$0(Z.hidden,W),Y=$0(Z.tabIndex,W),U=$0(Z.title,W),K=$0(Z.lang,W),V=$0(Z.dir,W);if(Q)X+=` id="${Z0(String(Q))}"`;if(J)X+=` class="${Z0(String(J))}"`;if(G)X+=" hidden";if(Y!==void 0&&Y!==null)X+=` tabindex="${Z0(String(Y))}"`;if(U)X+=` title="${Z0(String(U))}"`;if(K)X+=` lang="${Z0(String(K))}"`;if(V)X+=` dir="${Z0(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"&&a($)).map(([B,$])=>{let L=$0($,W);return L==null?null:`${S0(B)}: ${L}`}).filter(Boolean).join("; ");if(H)X+=` style="${H}"`}if(Z.attributes)for(let[H,B]of Object.entries(Z.attributes)){let $=$0(B,W);if($!==null&&$!==void 0&&(typeof $==="string"||typeof $==="number"||typeof $==="boolean"))X+=` ${H}="${Z0(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 B4(Z,W={},X=null){let Q=[];if(X&&typeof X==="object"){let G=(H,B)=>{let $=E0(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=E0(A);if(R)Q.push(`${D} { ${H} { ${R} } }`);for(let[x,d]of Object.entries(A)){if(d===null||typeof d!=="object"||Array.isArray(d))continue;if(x.startsWith("@"))continue;let u=x.startsWith("&")?x.replace("&",H):x.startsWith(":")||x.startsWith(".")||x.startsWith("[")?`${H}${x}`:`${H} ${x}`,i=E0(d);if(i)Q.push(`${D} { ${u} { ${i} } }`)}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 { ${E0(B)} } }`)}let Y={},U={};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("--"))Y[H]=B;else U[H]=B}let K=E0(Y);if(K)Q.push(`:root { ${K} }`);let V=E0(U);if(V)Q.push(`body { ${V} }`)}if(v6(Z,Q,W,"",{n:0}),Q.length===0)return"";return`<style>
2
+ import{createRequire as MX}from"node:module";var UX=Object.create;var{getPrototypeOf:KX,defineProperty:N1,getOwnPropertyNames:VX}=Object;var BX=Object.prototype.hasOwnProperty;function HX(Z){return this[Z]}var $X,FX,g4=(Z,W,X)=>{var Q=Z!=null&&typeof Z==="object";if(Q){var J=W?$X??=new WeakMap:FX??=new WeakMap,G=J.get(Z);if(G)return G}X=Z!=null?UX(KX(Z)):{};let Y=W||!Z||!Z.__esModule?N1(X,"default",{value:Z,enumerable:!0}):X;for(let U of VX(Z))if(!BX.call(Y,U))N1(Y,U,{get:HX.bind(Z,U),enumerable:!0});if(Q)J.set(Z,Y);return Y};var n=(Z,W)=>()=>(W||Z((W={exports:{}}).exports,W),W.exports);var LX=(Z)=>Z;function AX(Z,W){this[Z]=LX.bind(null,W)}var N2=(Z,W)=>{for(var X in W)N1(Z,X,{get:W[X],enumerable:!0,configurable:!0,set:AX.bind(W,X)})};var c=(Z,W)=>()=>(Z&&(W=Z(Z=0)),W);var T0=MX(import.meta.url);function w1(Z){let W=Z.$map;return W&&typeof W==="object"?W:void 0}function x6(Z){return H8.has(Z)}function o0(Z,W,X,Q){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return M6(Z,W,X,Q);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return NX(Z.$ref,W,X,Q);if(Array.isArray(Z))return Z.map((J)=>o0(J,W,X,Q));return Z}function NX(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 G4(X,J)}if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J,Y,U=w1(W);if(G==="item")Y=Q?.item??U?.item??W["$map/item"];else if(G==="index")Y=Q?.index??U?.index??W["$map/index"];else Y=U?.[G]??W[`$map/${G}`];return J.length>2?G4(Y,J.slice(2).join("/")):Y}if(Z.startsWith("#/state/")){let J=Z.slice(8),G=J.indexOf("/");if(G===-1)return W[J];return G4(W[J.slice(0,G)],J.slice(G+1))}if(Z.startsWith("parent#/"))return W[Z.slice(8)];if(Z.startsWith("window#/"))return G4(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return G4(globalThis.document,Z.slice(10));return W[Z]??null}function wX(Z,W,X,Q){if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J,Y,U=w1(W);if(G==="item")Y=Q?.item??U?.item??W["$map/item"];else if(G==="index")Y=Q?.index??U?.index??W["$map/index"];else Y=U?.[G]??W[`$map/${G}`];if(J.length>2){let K=J.slice(2),V=K.pop(),H=K.length>0?G4(Y,K.join("/")):Y;return{key:V,obj:H}}return{key:G==="item"?"$map/item":"$map/index",obj:w1(W)??W}}if(Z.startsWith("#/state/")){let J=Z.slice(8);if(J.indexOf("/")===-1)return{key:J,obj:W};let Y=J.split("/"),U=Y.pop(),K=W;for(let V of Y)K=K[V];return{key:U,obj:K}}return{key:Z,obj:W}}function M6(Z,W,X,Q){let{operator:J,target:G,value:Y,initial:U}=Z;if(!IX.has(J))throw Error(`$expression: unknown operator "${J}"`);if(D1.has(J)&&!("value"in Z)){let K=o0(G,W,X,Q);if(J==="!")return!K;if(J==="-")return-K}if(T1.has(J)){let K=o0(G,W,X,Q),V=o0(Y,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=o0(Y,W,X,Q),{obj:V,key:H}=wX(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=o0(G,W,X,Q);switch(J){case"push":return K.push(o0(Y,W,X,Q));case"unshift":return K.unshift(o0(Y,W,X,Q));case"pop":return K.pop();case"shift":return K.shift();case"splice":{let V=o0(Y,W,X,Q);return K.splice(...V)}default:break}}if(R1.has(J)){let K=o0(G,W,X,Q);if(J==="reduce"){let V=o0(U,W,X,Q);for(let[H,B]of K.entries())V=M6(Y,W,X,{acc:V,index:H,item:B});return V}if(J==="map")return K.map((V,H)=>M6(Y,W,X,{...Q,index:H,item:V}));if(J==="filter")return K.filter((V,H)=>M6(Y,W,X,{...Q,index:H,item:V}))}return}function l0(Z,W){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return p0(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)=>l0(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 l0(Z,W)}function p0(Z,W={}){let{operator:X,target:Q,value:J,initial:G}=Z;if(D1.has(X)&&!("value"in Z)){let Y=l0(Q,W);if(X==="!")return`!(${Y})`;if(X==="-")return`-(${Y})`}if(T1.has(X)){let Y=l0(Q,W),U=l0(J,W);return`(${Y} ${X} ${U})`}if($8.has(X)){let Y=B8(Q,W),U=l0(J,W);return`${Y} ${X} ${U}`}if(F8.has(X)){let Y=B8(Q,W);switch(X){case"push":return`${Y}.push(${l0(J,W)})`;case"unshift":return`${Y}.unshift(${l0(J,W)})`;case"pop":return`${Y}.pop()`;case"shift":return`${Y}.shift()`;case"splice":{let U=Array.isArray(J)?J.map((K)=>l0(K,W)).join(", "):l0(J,W);return`${Y}.splice(${U})`}default:break}}if(R1.has(X)){let Y=l0(Q,W),U=p0(J,W);if(X==="reduce"){let K=l0(G,W);return`${Y}.reduce((_acc, _item, _index) => ${U}, ${K})`}if(X==="map")return`${Y}.map((_item, _index) => ${U})`;if(X==="filter")return`${Y}.filter((_item, _index) => ${U})`}return"undefined"}function G4(Z,W){let X=Z;for(let Q of W.split(/[./]/))X=X?.[Q];return X}var H8,D1,T1,$8,F8,R1,IX;var w2=c(()=>{H8=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),D1=new Set(["!","-"]),T1=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||"]),$8=new Set(["=","+=","-=","*=","/="]),F8=new Set(["push","pop","shift","unshift","splice"]),R1=new Set(["reduce","map","filter"]),IX=new Set([...H8,...D1,...T1,...R1])});function h0(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function f0(Z){return h0(Z)&&typeof Z.$ref==="string"}function I6(Z){return h0(Z)&&Z.$prototype==="Function"}function t0(Z){return h0(Z)&&h0(Z.$expression)}function n6(Z){return h0(Z)&&typeof Z.$prototype==="string"&&Z.$prototype!=="Function"}function P1(Z){return h0(Z)&&Z.timing==="server"&&typeof Z.$src==="string"&&typeof Z.$export==="string"&&!Z.$prototype}function A8(Z){return h0(Z)&&!Z.$prototype&&!Z.$expression&&"default"in Z}function k6(Z){if(!h0(Z))return!1;for(let W of Object.keys(Z))if(!M8.has(W))return!1;return!0}function R0(Z){return h0(Z)&&Z.$prototype==="Array"}function j1(Z){if(R0(Z))return!0;return Array.isArray(Z)&&Z.some((W)=>R0(W))}function I8(Z){return h0(Z)&&Z.$prototype==="Class"}function a(Z){return typeof Z==="string"&&Z.includes("${")}function S6(Z){if(!Z)return[];return Z.map((W)=>typeof W==="string"?W:W.name)}var M8;var X6=c(()=>{M8=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function PX(Z){if(!DX||!Z.includes("v"))return Z;return Z.replace(TX,(W,X,Q)=>`${X}${RX[Q.toLowerCase()]??`cq${Q}`}`)}function jX(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function S0(Z){return Z.replaceAll(/[A-Z]/g,(W)=>`-${W.toLowerCase()}`)}function E0(Z){return Object.entries(Z).filter(([W,X])=>!jX(W)&&(X===null||typeof X!=="object")).map(([W,X])=>`${S0(W)}: ${PX(String(X))}`).join("; ")}var DX=!1,TX,RX,b6;var h4=c(()=>{w2();X6();TX=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,RX={b:"cqb",h:"cqh",i:"cqi",max:"cqmax",min:"cqmin",w:"cqw"};b6=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 T2(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(k6(X))continue;return!0}if(Z.$switch)return!0;if(R0(Z)||j1(Z.children))return!0;if(Array.isArray(Z.children)&&Z.children.some((W)=>T2(W)))return!0;for(let[W,X]of Object.entries(Z)){if(b6.has(W))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(a(X))return!0}if(Z.style&&typeof Z.style==="object"){for(let W of Object.values(Z.style))if(a(W))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let W of Object.values(Z.attributes))if(a(W))return!0}return!1}function w8(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(R0(Z)||j1(Z.children))return!0;for(let[W,X]of Object.entries(Z)){if(b6.has(W))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(a(X))return!0}if(Z.style&&typeof Z.style==="object"){for(let W of Object.values(Z.style))if(a(W))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let W of Object.values(Z.attributes))if(a(W))return!0}return!1}function K4(Z,W=null,X={},Q={}){let J=Z?.state?V4(Z.state,W):W??Object.create(null);return{media:Q,scope:J,scopeDefs:X}}function V4(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)){i6(X,Q,D2(J));continue}let G=J;if("default"in G){i6(X,Q,D2(G.default));continue}if(!G.$prototype&&!("$expression"in G)&&!k6(G))i6(X,Q,D2(G))}for(let[Q,J]of Object.entries(Z)){if(typeof J==="string"&&a(J)){_1(X,Q,()=>C0(J,X));continue}if(!J||typeof J!=="object")continue;if(t0(J)){let G=J.$expression;if(x6(G.operator))i6(X,Q,(Y,U)=>M6(G,Y,U));else _1(X,Q,()=>M6(G,X,null));continue}if(I6(J)){if(J.body){let G=J.parameters?S6(J.parameters):J.arguments??[],Y=Function("state",...G,J.body);if(J.body.includes("return"))_1(X,Q,()=>Y(X));else i6(X,Q,Y)}else i6(X,Q,()=>{});continue}if(n6(J)&&(J.$prototype==="LocalStorage"||J.$prototype==="SessionStorage"))i6(X,Q,D2(J.default??null))}return X}function i6(Z,W,X){Object.defineProperty(Z,W,{configurable:!0,enumerable:!0,value:X,writable:!0})}function _1(Z,W,X){Object.defineProperty(Z,W,{configurable:!0,enumerable:!0,get:X})}function $0(Z,W){if(e0(Z))return C1(Z.$ref,W);if(a(Z))return C0(Z,W);return Z}function e0(Z){return f0(Z)}function C1(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?N8(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 N8(W[X.slice(0,Q)],X.slice(Q+1))}return W[Z]??null}function C0(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 N8(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 D2(Z){if(Z===null||typeof Z!=="object")return Z;return structuredClone(Z)}function z4(Z,W){let X="",Q=$0(Z.id,W),J=$0(Z.className,W),G=$0(Z.hidden,W),Y=$0(Z.tabIndex,W),U=$0(Z.title,W),K=$0(Z.lang,W),V=$0(Z.dir,W);if(Q)X+=` id="${Z0(String(Q))}"`;if(J)X+=` class="${Z0(String(J))}"`;if(G)X+=" hidden";if(Y!==void 0&&Y!==null)X+=` tabindex="${Z0(String(Y))}"`;if(U)X+=` title="${Z0(String(U))}"`;if(K)X+=` lang="${Z0(String(K))}"`;if(V)X+=` dir="${Z0(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"&&a($)).map(([B,$])=>{let L=$0($,W);return L==null?null:`${S0(B)}: ${L}`}).filter(Boolean).join("; ");if(H)X+=` style="${H}"`}if(Z.attributes)for(let[H,B]of Object.entries(Z.attributes)){let $=$0(B,W);if($!==null&&$!==void 0&&(typeof $==="string"||typeof $==="number"||typeof $==="boolean"))X+=` ${H}="${Z0(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 B4(Z,W={},X=null){let Q=[];if(X&&typeof X==="object"){let G=(H,B)=>{let $=E0(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=E0(A);if(R)Q.push(`${D} { ${H} { ${R} } }`);for(let[x,d]of Object.entries(A)){if(d===null||typeof d!=="object"||Array.isArray(d))continue;if(x.startsWith("@"))continue;let u=x.startsWith("&")?x.replace("&",H):x.startsWith(":")||x.startsWith(".")||x.startsWith("[")?`${H}${x}`:`${H} ${x}`,i=E0(d);if(i)Q.push(`${D} { ${u} { ${i} } }`)}continue}let _=L.startsWith("&")?L.replace("&",H):L.startsWith(":")||L.startsWith(".")||L.startsWith("[")?`${H}${L}`:`${H} ${L}`;G(_,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 { ${E0(B)} } }`)}let Y={},U={};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("--"))Y[H]=B;else U[H]=B}let K=E0(Y);if(K)Q.push(`:root { ${K} }`);let V=E0(U);if(V)Q.push(`body { ${V} }`)}if(v6(Z,Q,W,"",{n:0}),Q.length===0)return"";return`<style>
3
3
  ${Q.join(`
4
4
  `)}
5
5
  </style>`}function D8(Z,W,X,Q){let J=E0(W);if(J)X.push(`${Z} { ${J} }`);for(let[G,Y]of Object.entries(W)){if(Y===null||typeof Y!=="object"||Array.isArray(Y))continue;if(G.startsWith("@")){let K=G.startsWith("@--")?`@media ${Q[G.slice(1)]??G.slice(1)}`:G.startsWith("@(")?`@media ${G.slice(1)}`:G,V=E0(Y);if(V)X.push(`${K} { ${Z} { ${V} } }`);for(let[H,B]of Object.entries(Y)){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=E0(B);if(L)X.push(`${K} { ${$} { ${L} } }`)}continue}let U=G.startsWith("&")?G.replace("&",Z):G.startsWith(":")||G.startsWith(".")||G.startsWith("[")?`${Z}${G}`:`${Z} ${G}`;D8(U,Y,X,Q)}}function v6(Z,W,X,Q="",J,G="jx"){let Y=J??{n:0};if(!Z||typeof Z!=="object")return;if(Z.style&&!Z.id&&!Z.className)Z.className=`${G}-${Y.n}`,Y.n+=1;let U=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"&&a(H))continue;K.push(` ${S0(V)}: ${H};`)}if(K.length>0)W.push(`${U} {
6
6
  ${K.join(`
7
7
  `)}
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,$=E0(H);if($)W.push(`${B} { ${U} { ${$} } }`);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("&",U):L.startsWith(":")||L.startsWith(".")||L.startsWith("[")?`${U}${L}`:`${U} ${L}`;W.push(`${B} { ${j} { ${E0(A)} } }`)}}else{let B=V.startsWith("&")?V.replace("&",U):V.startsWith(":")||V.startsWith(".")||V.startsWith("[")?`${U}${V}`:`${U} ${V}`;D8(B,H,W,X)}}}if(Array.isArray(Z.children))for(let K of Z.children)v6(K,W,X,U,Y,G);if(Z.cases&&typeof Z.cases==="object")for(let K of Object.values(Z.cases))v6(K,W,X,U,Y,G)}function Z0(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function R2(Z){return Z.split("-").map((W)=>W.charAt(0).toUpperCase()+W.slice(1)).join("")}function P2(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(P1(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 Y4(Z,W,X=null){if(typeof Z==="string"){if(a(Z)&&W){let Y=C0(Z,W);return Y!=null?Z0(String(Y)):Z0(Z)}return Z0(Z)}if(typeof Z==="number"||typeof Z==="boolean")return Z0(String(Z));if(Array.isArray(Z))return Z.map((Y)=>Y4(Y,W,X)).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,$=E0(H);if($)W.push(`${B} { ${U} { ${$} } }`);for(let[L,A]of Object.entries(H)){if(A===null||typeof A!=="object"||Array.isArray(A))continue;if(L.startsWith("@"))continue;let _=L.startsWith("&")?L.replace("&",U):L.startsWith(":")||L.startsWith(".")||L.startsWith("[")?`${U}${L}`:`${U} ${L}`;W.push(`${B} { ${_} { ${E0(A)} } }`)}}else{let B=V.startsWith("&")?V.replace("&",U):V.startsWith(":")||V.startsWith(".")||V.startsWith("[")?`${U}${V}`:`${U} ${V}`;D8(B,H,W,X)}}}if(Array.isArray(Z.children))for(let K of Z.children)v6(K,W,X,U,Y,G);if(Z.cases&&typeof Z.cases==="object")for(let K of Object.values(Z.cases))v6(K,W,X,U,Y,G)}function Z0(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function R2(Z){return Z.split("-").map((W)=>W.charAt(0).toUpperCase()+W.slice(1)).join("")}function P2(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(P1(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 Y4(Z,W,X=null){if(typeof Z==="string"){if(a(Z)&&W){let Y=C0(Z,W);return Y!=null?Z0(String(Y)):Z0(Z)}return Z0(Z)}if(typeof Z==="number"||typeof Z==="boolean")return Z0(String(Z));if(Array.isArray(Z))return Z.map((Y)=>Y4(Y,W,X)).join(`
9
9
  `);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";if(Z.$switch){let Y=Z.tagName??"div",U=z4(Z,W),K=$0(Z.$switch,W),V=K==null?void 0:Z.cases?.[String(K)],H=V!==void 0&&!e0(V)?Y4(V,W,X):"";return`<${Y}${U}>${H}</${Y}>`}let Q=Z.tagName??"div";if(Q==="slot"&&X!=null)return X;let J=z4(Z,W);if(O1.has(Q))return`<${Q}${J}>`;let G="";if(Z.textContent!==void 0){let Y=$0(Z.textContent,W);G=Y!=null?Z0(String(Y)):""}else if(Z.innerHTML){let Y=$0(Z.innerHTML,W);G=Y!=null?String(Y):Z.innerHTML}else if(Array.isArray(Z.children))G=Z.children.map((Y)=>Y4(Y,W,X)).join(`
10
10
  `);return`<${Q}${J}>${G}</${Q}>`}function R8(Z,W=null,X=null){let Q=Z.state??{};if(W){Q={...Q};for(let[G,Y]of Object.entries(W))if(G in Q){let U=Q[G];Q[G]=U&&typeof U==="object"&&!Array.isArray(U)&&"default"in U?{...U,default:Y}:Y}else Q[G]=Y}let J=V4(Q,null);if(!Array.isArray(Z.children))return"";return Z.children.map((G)=>Y4(G,J,X)).join(`
11
11
  `)}function x1(Z){return E1(Z)}function E1(Z){if(!Z||typeof Z!=="object")return!0;if(Array.isArray(Z))return Z.every((W)=>E1(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)=>E1(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[Y,U]of Object.entries(W)){if(Y.startsWith(":")||Y.startsWith(".")||Y.startsWith("&")||Y.startsWith("[")||Y.startsWith("@"))continue;if(U===null||typeof U==="object")continue;if(typeof U==="string"&&a(U))continue;G.push(` ${S0(Y)}: ${U};`)}if(G.length>0)J.push(`${Z} {
@@ -13,31 +13,31 @@ ${G.join(`
13
13
  `)}
14
14
  }`);for(let[Y,U]of Object.entries(W))if(Y.startsWith("@")){let K=Y.startsWith("@--")?`@media ${Q[Y.slice(1)]??Y.slice(1)}`:Y.startsWith("@(")?`@media ${Y.slice(1)}`:Y;J.push(`${K} { ${Z} { ${E0(U)} } }`)}else if(Y.startsWith(":")||Y.startsWith(".")||Y.startsWith("&")||Y.startsWith("[")){let K=Y.startsWith("&")?Y.replace("&",Z):`${Z}${Y}`;J.push(`${K} { ${E0(U)} }`)}}if(X&&Array.isArray(X.children)){let G={n:0};for(let Y of X.children)v6(Y,J,Q,"",G,Z)}return J.length>0?`${J.join(`
15
15
  `)}
16
- `:""}var q4="https://esm.sh/@vue/reactivity@3.5.32",U4="https://esm.sh/lit-html@3.3.0",O1;var y6=c(()=>{h4();w2();X6();h4();w2();X6();O1=new Set(["input","br","hr","img","meta","link","area","col","source"])});function w6(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var TX,f4=()=>TX;var _8=c(()=>{TX=/^win/.test(globalThis.process?globalThis.process.platform:"")});function L0(Z,W){let X=new URL(w6(Z),"https://aaa.nonexistanturl.com"),Q=new URL(w6(W),X),J=W.match(/(\s*)$/)?.[1]||"";if(Q.hostname==="aaa.nonexistanturl.com"){let{pathname:Y,search:U,hash:K}=Q;return Y+U+decodeURIComponent(K)+J}let G=Q.toString()+J;if(G.includes("#")){let[Y,U]=G.split("#",2);return Y+"#"+decodeURIComponent(U||"")}return G}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(),W=Z.slice(-1);if(W==="/"||W==="\\")return Z;else return Z+"/"}return"/"}function E8(Z){let W=PX.exec(Z||"");if(W)return W[1].toLowerCase();return}function C8(Z){let W=Z.lastIndexOf(".");if(W>=0)return xX(Z.substring(W).toLowerCase());return""}function xX(Z){let W=Z.indexOf("?");if(W>=0)Z=Z.substring(0,W);return Z}function Q6(Z){if(!Z)return"#";let W=Z.indexOf("#");if(W>=0)return Z.substring(W);return"#"}function F0(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 _2(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&&gX(parseInt(Q)))return!0}catch{if(W.startsWith("/")&&!W.startsWith("//"))return!1;if(yX(W))return!0}return!1}function x8(Z){let W=kX(Z);if(!W)return!0;if(W==="localhost"||OX.some((J)=>W.endsWith(J)))return!0;let X=k8(W);if(X)return S8(X);let Q=SX(W);if(Q)return bX(Q);return!1}function kX(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 SX(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]),Y=J.length===2?j8(J[1]):[];if(!G||!Y)return;if(J.length===1)return G.length===8?G:void 0;let U=8-G.length-Y.length;if(U<1)return;return[...G,...Array(U).fill(0),...Y]}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 bX(Z){if(Z.length!==8)return!1;let W=Z.every((U)=>U===0),X=Z.slice(0,7).every((U)=>U===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 Y=vX(Z);return Y?S8(Y):!1}function vX(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 yX(Z){return Z.split(/[\s/?#]+/).map((X)=>X.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((X)=>x8(X))}function gX(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 j2(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(f4()){let W=r6(),X=Z.toUpperCase(),J=w6(W).toUpperCase(),G=X.includes(J),Y=X.includes(J),U=EX.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(G||Y||U)&&!W.startsWith("http"))Z=((V,H)=>{if(V.endsWith("/")||V.endsWith("\\"))return V+H;else return V+"/"+H})(W,Z);Z=w6(Z)}Z=encodeURI(Z);for(let W of CX)Z=Z.replace(W[0],W[1]);return Z}function $4(Z,W){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let Q=0;Q<k1.length;Q+=2)Z=Z.replace(k1[Q],k1[Q+1]);let X=Z.toLowerCase().startsWith("file://");if(X){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),f4()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(W)Z="file:///"+Z;else X=!1,Z=f4()?Z:"/"+Z}if(f4()&&!X){if(Z=Z.replace(RX,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function E2(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((W)=>{return W.replace(_X,"/").replace(jX,"~")})}var RX,PX,_X,jX,EX,CX,k1,OX,H4=(Z)=>new URL(Z);var b0=c(()=>{_8();RX=/\//g,PX=/^(\w{2,}):\/\//i,_X=/~1/g,jX=/~0/g,EX=/^[a-zA-Z]:[\\/]/,CX=[[/\?/g,"%3F"],[/#/g,"%23"]],k1=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],OX=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function v8(){let Z={},W=this;for(let X of uX(W))if(typeof X==="string"){let Q=W[X],J=typeof Q;if(!hX.includes(J))Z[X]=Q}return Z}function uX(Z,W=[]){let X=[];while(Z&&Z!==mX)X=X.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let Q=new Set(X);for(let J of W.concat(fX))Q.delete(J);return Q}function G6(Z){return Z instanceof m0||Z instanceof F4}function b1(Z){if(Z.path===null)Z.path=[];return Z}var hX,fX,mX,m0,F4,n0,C2,Z6,O2,x2,S1,L4;var i0=c(()=>{b0();hX=["function","symbol","undefined"],fX=["constructor","prototype","__proto__"],mX=Object.getPrototypeOf({});m0=class m0 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}`}};F4=class F4 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 '${$4(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 F4.getParserErrors(this.files)}};n0=class n0 extends m0{code="EPARSER";name="ParserError";constructor(Z,W){super(`Error parsing ${W}: ${Z}`,W)}};C2=class C2 extends m0{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};Z6=class Z6 extends m0{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)}};O2=class O2 extends m0{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};x2=class x2 extends m0{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,W,X,Q,J){super(`Missing $ref pointer "${Q6(W)}". Token "${Z}" does not exist.`,F0(W));this.targetToken=Z,this.targetRef=X,this.targetFound=Q,this.parentPath=J}};S1=class S1 extends m0{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};L4=class L4 extends m0{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,W){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,F0(W))}}});function O0(Z,W){let X=dX(W);return X?L0(Z,X):Z}function k2(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 S2(Z,W,X,Q,J=!1){if(!J)return;let G=new Set,Y=(U,K)=>{if(!U||typeof U!=="object"||ArrayBuffer.isView(U)||G.has(U))return;G.add(U);let V=O0(K,U);if(V!==K)Z._addAlias(V,U,Q,J);for(let H of Object.keys(U))Y(U[H],V)};Y(X,W)}function dX(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var a6=c(()=>{b0()});class s6{$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||F0(W),this.value=void 0,this.circular=!1,this.indirections=0}resolve(Z,W,X){let Q=s6.parse(this.path,this.originalPath),J=[];if(this.value=g8(Z),this.$ref.dynamicIdScope&&!h8(this.$ref))this.scopeBase=O0(this.scopeBase,this.value);for(let Y=0;Y<Q.length;Y++){let U=this.circular,K=V0.isExtended$Ref(this.value);if(b2(this,W,X))this.path=s6.join(this.path,Q.slice(Y));else if(!U&&this.circular&&K)this.circular=!1;let V=Q[Y];if(this.value[V]===void 0||this.value[V]===null&&Y===Q.length-1){let H=!1;for(let j=Q.length-1;j>Y;j--){let D=Q.slice(Y,j+1).join("/");if(this.value[D]!==void 0){this.value=this.value[D],Y=j,H=!0;break}}if(H)continue;if(V in this.value&&this.value[V]===null){this.value=v2;continue}this.value=null;let B=this.$ref.path||"",$=this.path.replace(B,""),L=s6.join("",J),A=X?.replace(B,"");throw new x2(V,decodeURI(this.originalPath),$,L,A)}else this.value=this.value[V];if(J.push(V),this.$ref.dynamicIdScope)this.scopeBase=O0(this.scopeBase,this.value)}let G=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(!this.value||this.value.$ref&&L0(G,this.value.$ref)!==X)b2(this,W,X);return this}set(Z,W,X){let Q=s6.parse(this.path),J;if(Q.length===0)return this.value=W,W;if(rX(this.path,Q),this.value=g8(Z),this.$ref.dynamicIdScope&&!h8(this.$ref))this.scopeBase=O0(this.scopeBase,this.value);for(let G=0;G<Q.length-1;G++){if(b2(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=O0(this.scopeBase,this.value)}return b2(this,X),J=Q[Q.length-1],y8(this,J,W),Z}static parse(Z,W){let X=Q6(Z).substring(1);if(!X)return[];let Q=X.split("/");for(let J=0;J<Q.length;J++)Q[J]=Q[J].replace(pX,"/").replace(nX,"~");if(Q[0]!=="")throw new L4(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(lX,"~0").replace(cX,"~1")}return Z}}function b2(Z,W,X){if(V0.isAllowed$Ref(Z.value,W)){let Q=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,J=L0(Q,Z.value.$ref);if(J===Z.path&&!aX(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,V0.isExtended$Ref(Z.value))return Z.value=V0.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 m0(`Error assigning $ref pointer "${Z.path}".
17
- Cannot set "${W}" of a non-object.`);return X}function rX(Z,W){for(let X of W)if(iX.has(X))throw new m0(`Error assigning $ref pointer "${Z}".
18
- Unsafe JSON Pointer token "${X}" cannot be used for assignment.`)}function g8(Z){if(G6(Z))throw Z;return Z}function aX(Z){return typeof Z=="string"&&s6.parse(Z).length==0}function h8(Z){return Boolean(Z.path&&Z.path in Z.$refs._aliases)}var v2,cX,lX,pX,nX,iX,v0;var m4=c(()=>{A4();b0();i0();a6();v2=Symbol("null"),cX=/\//g,lX=/~/g,pX=/~1/g,nX=/~0/g,iX=new Set(["__proto__","constructor","prototype"]);v0=s6});class u4{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(b1).filter(({footprint:X})=>!W.includes(X)));else if(!("footprint"in Z)||!W.includes(Z.footprint))this.errors.push(b1(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 v0(this,Z,X);try{let G=J.resolve(this.value,W,Q);if(G.value===v2)G.value=null;return G}catch(G){if(!W||!W.continueOnError||!G6(G))throw G;if(G.path===null)G.path=E2(Q6(Q));if(G instanceof L4)G.source=decodeURI(F0(Q));return this.addError(G),null}}set(Z,W){let X=new v0(this,Z);if(this.value=X.set(this.value,W),this.value===v2)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 u4.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 u4.is$Ref(Z)&&Object.keys(Z).length>1}static dereference(Z,W,X){if(W&&typeof W==="object"&&u4.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 Y=G;if(!(Y in Q))Q[Y]=W[Y];else if(J&&typeof Q[Y]==="object"&&Q[Y]!==null&&typeof W[Y]==="object"&&W[Y]!==null)Q[Y]=f8(W[Y],Q[Y])}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 V0;var A4=c(()=>{m4();i0();b0();V0=u4});class d4{circular;paths(...Z){return m8(this._$refs,Z.flat()).map((X)=>{return w6(X.decoded)})}values(...Z){let W=this._$refs;return m8(W,Z.flat()).reduce((Q,J)=>{return Q[w6(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=L0(this._root$Ref.path,Z),Q=this._getRef(X);if(!Q)throw Error(`Error resolving $ref pointer "${Z}".
16
+ `:""}var q4="https://esm.sh/@vue/reactivity@3.5.32",U4="https://esm.sh/lit-html@3.3.0",O1;var y6=c(()=>{h4();w2();X6();h4();w2();X6();O1=new Set(["input","br","hr","img","meta","link","area","col","source"])});function w6(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var _X,f4=()=>_X;var j8=c(()=>{_X=/^win/.test(globalThis.process?globalThis.process.platform:"")});function L0(Z,W){let X=new URL(w6(Z),"https://aaa.nonexistanturl.com"),Q=new URL(w6(W),X),J=W.match(/(\s*)$/)?.[1]||"";if(Q.hostname==="aaa.nonexistanturl.com"){let{pathname:Y,search:U,hash:K}=Q;return Y+U+decodeURIComponent(K)+J}let G=Q.toString()+J;if(G.includes("#")){let[Y,U]=G.split("#",2);return Y+"#"+decodeURIComponent(U||"")}return G}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(),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 Q6(Z){if(!Z)return"#";let W=Z.indexOf("#");if(W>=0)return Z.substring(W);return"#"}function F0(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 j2(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=_8(J[0]),Y=J.length===2?_8(J[1]):[];if(!G||!Y)return;if(J.length===1)return G.length===8?G:void 0;let U=8-G.length-Y.length;if(U<1)return;return[...G,...Array(U).fill(0),...Y]}function _8(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((U)=>U===0),X=Z.slice(0,7).every((U)=>U===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 Y=fX(Z);return Y?S8(Y):!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 _2(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(f4()){let W=r6(),X=Z.toUpperCase(),J=w6(W).toUpperCase(),G=X.includes(J),Y=X.includes(J),U=kX.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(G||Y||U)&&!W.startsWith("http"))Z=((V,H)=>{if(V.endsWith("/")||V.endsWith("\\"))return V+H;else return V+"/"+H})(W,Z);Z=w6(Z)}Z=encodeURI(Z);for(let W of SX)Z=Z.replace(W[0],W[1]);return Z}function $4(Z,W){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let Q=0;Q<k1.length;Q+=2)Z=Z.replace(k1[Q],k1[Q+1]);let X=Z.toLowerCase().startsWith("file://");if(X){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),f4()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(W)Z="file:///"+Z;else X=!1,Z=f4()?Z:"/"+Z}if(f4()&&!X){if(Z=Z.replace(EX,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function E2(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,k1,bX,H4=(Z)=>new URL(Z);var b0=c(()=>{j8();EX=/\//g,CX=/^(\w{2,}):\/\//i,OX=/~1/g,xX=/~0/g,kX=/^[a-zA-Z]:[\\/]/,SX=[[/\?/g,"%3F"],[/#/g,"%23"]],k1=[/%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 G6(Z){return Z instanceof m0||Z instanceof F4}function b1(Z){if(Z.path===null)Z.path=[];return Z}var dX,cX,lX,m0,F4,n0,C2,Z6,O2,x2,S1,L4;var i0=c(()=>{b0();dX=["function","symbol","undefined"],cX=["constructor","prototype","__proto__"],lX=Object.getPrototypeOf({});m0=class m0 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}`}};F4=class F4 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 '${$4(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 F4.getParserErrors(this.files)}};n0=class n0 extends m0{code="EPARSER";name="ParserError";constructor(Z,W){super(`Error parsing ${W}: ${Z}`,W)}};C2=class C2 extends m0{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};Z6=class Z6 extends m0{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)}};O2=class O2 extends m0{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};x2=class x2 extends m0{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,W,X,Q,J){super(`Missing $ref pointer "${Q6(W)}". Token "${Z}" does not exist.`,F0(W));this.targetToken=Z,this.targetRef=X,this.targetFound=Q,this.parentPath=J}};S1=class S1 extends m0{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};L4=class L4 extends m0{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,W){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,F0(W))}}});function O0(Z,W){let X=nX(W);return X?L0(Z,X):Z}function k2(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 S2(Z,W,X,Q,J=!1){if(!J)return;let G=new Set,Y=(U,K)=>{if(!U||typeof U!=="object"||ArrayBuffer.isView(U)||G.has(U))return;G.add(U);let V=O0(K,U);if(V!==K)Z._addAlias(V,U,Q,J);for(let H of Object.keys(U))Y(U[H],V)};Y(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 a6=c(()=>{b0()});class s6{$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||F0(W),this.value=void 0,this.circular=!1,this.indirections=0}resolve(Z,W,X){let Q=s6.parse(this.path,this.originalPath),J=[];if(this.value=g8(Z),this.$ref.dynamicIdScope&&!h8(this.$ref))this.scopeBase=O0(this.scopeBase,this.value);for(let Y=0;Y<Q.length;Y++){let U=this.circular,K=V0.isExtended$Ref(this.value);if(b2(this,W,X))this.path=s6.join(this.path,Q.slice(Y));else if(!U&&this.circular&&K)this.circular=!1;let V=Q[Y];if(this.value[V]===void 0||this.value[V]===null&&Y===Q.length-1){let H=!1;for(let _=Q.length-1;_>Y;_--){let D=Q.slice(Y,_+1).join("/");if(this.value[D]!==void 0){this.value=this.value[D],Y=_,H=!0;break}}if(H)continue;if(V in this.value&&this.value[V]===null){this.value=v2;continue}this.value=null;let B=this.$ref.path||"",$=this.path.replace(B,""),L=s6.join("",J),A=X?.replace(B,"");throw new x2(V,decodeURI(this.originalPath),$,L,A)}else this.value=this.value[V];if(J.push(V),this.$ref.dynamicIdScope)this.scopeBase=O0(this.scopeBase,this.value)}let G=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(!this.value||this.value.$ref&&L0(G,this.value.$ref)!==X)b2(this,W,X);return this}set(Z,W,X){let Q=s6.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=O0(this.scopeBase,this.value);for(let G=0;G<Q.length-1;G++){if(b2(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=O0(this.scopeBase,this.value)}return b2(this,X),J=Q[Q.length-1],y8(this,J,W),Z}static parse(Z,W){let X=Q6(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 L4(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 b2(Z,W,X){if(V0.isAllowed$Ref(Z.value,W)){let Q=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,J=L0(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,V0.isExtended$Ref(Z.value))return Z.value=V0.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 m0(`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 m0(`Error assigning $ref pointer "${Z}".
18
+ Unsafe JSON Pointer token "${X}" cannot be used for assignment.`)}function g8(Z){if(G6(Z))throw Z;return Z}function eX(Z){return typeof Z=="string"&&s6.parse(Z).length==0}function h8(Z){return Boolean(Z.path&&Z.path in Z.$refs._aliases)}var v2,iX,rX,aX,sX,oX,v0;var m4=c(()=>{A4();b0();i0();a6();v2=Symbol("null"),iX=/\//g,rX=/~/g,aX=/~1/g,sX=/~0/g,oX=new Set(["__proto__","constructor","prototype"]);v0=s6});class u4{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(b1).filter(({footprint:X})=>!W.includes(X)));else if(!("footprint"in Z)||!W.includes(Z.footprint))this.errors.push(b1(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 v0(this,Z,X);try{let G=J.resolve(this.value,W,Q);if(G.value===v2)G.value=null;return G}catch(G){if(!W||!W.continueOnError||!G6(G))throw G;if(G.path===null)G.path=E2(Q6(Q));if(G instanceof L4)G.source=decodeURI(F0(Q));return this.addError(G),null}}set(Z,W){let X=new v0(this,Z);if(this.value=X.set(this.value,W),this.value===v2)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 u4.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 u4.is$Ref(Z)&&Object.keys(Z).length>1}static dereference(Z,W,X){if(W&&typeof W==="object"&&u4.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 Y=G;if(!(Y in Q))Q[Y]=W[Y];else if(J&&typeof Q[Y]==="object"&&Q[Y]!==null&&typeof W[Y]==="object"&&W[Y]!==null)Q[Y]=f8(W[Y],Q[Y])}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 V0;var A4=c(()=>{m4();i0();b0();V0=u4});class d4{circular;paths(...Z){return m8(this._$refs,Z.flat()).map((X)=>{return w6(X.decoded)})}values(...Z){let W=this._$refs;return m8(W,Z.flat()).reduce((Q,J)=>{return Q[w6(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=L0(this._root$Ref.path,Z),Q=this._getRef(X);if(!Q)throw Error(`Error resolving $ref pointer "${Z}".
19
19
  "${F0(X)}" not found.`);Q.set(X,W)}_get$Ref(Z){return Z=L0(this._root$Ref.path,Z),this._getRef(Z)}_add(Z){let W=F0(Z),X=new V0(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=F0(Z);if(!J||this._$refs[J]||this._aliases[J])return this._$refs[J]||this._aliases[J];let G=new V0(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=L0(this._root$Ref.path,Z),J=this._getRef(Q);if(!J)throw Error(`Error resolving $ref pointer "${Z}".
20
- "${F0(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=F0(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"?$4(Q,!0):Q}})}var u8=c(()=>{A4();b0()});function v1(Z){return Object.keys(Z||{}).filter((W)=>{return typeof Z[W]==="object"}).map((W)=>{return Z[W].name=W,Z[W]})}function y1(Z,W,X,Q,J){return Z.filter((G)=>{return!!d8(G,W,X,Q,J)})}function g1(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 h1(Z,W,X,Q){let J,G,Y=0;return new Promise((U,K)=>{V();function V(){if(J=Z[Y++],!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(Y===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){U({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 sX(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,Y=Q.indexOf("#"),U="";if(Y>=0)U=Q.substring(Y),Q=Q.substring(0,Y);if(G){let H=G.indexOf("#");if(H>=0)G=G.substring(0,H)}let K=W._add(Q),V={url:Q,hash:U,extension:C8(Q),...G!==void 0?{reference:G}:{},...J!==void 0?{baseUrl:J}:{}};try{let H=await oX(V,X,W);K.pathType=H.plugin.name,V.data=H.result;let B=await tX(V,X,W);return K.value=B.result,K.dynamicIdScope=k2(K.value),S2(W,K.path,K.value,K.pathType,K.dynamicIdScope),B.result}catch(H){if(G6(H))K.value=H;throw H}}async function oX(Z,W,X){let Q=v1(W.resolve);Q=y1(Q,"canRead",Z,void 0,X),g1(Q);try{return await h1(Q,"read",Z,X)}catch(J){if(!J&&W.continueOnError)throw new O2(Z.url);else if(!J||!("error"in J))throw SyntaxError(`Unable to resolve $ref pointer "${Z.url}"`,{cause:J});else if(J.error instanceof Z6)throw J.error;else throw new Z6(J,Z.url)}}async function tX(Z,W,X){let Q=v1(W.parse),J=y1(Q,"canParse",Z),G=J.length>0?J:Q;g1(G);try{let Y=await h1(G,"parse",Z,X);if(!Y.plugin.allowEmpty&&eX(Y.result))throw SyntaxError(`Error parsing "${Z.url}" as ${Y.plugin.name}.
21
- Parsed value is empty`);else return Y}catch(Y){if(!Y&&W.continueOnError)throw new C2(Z.url);else if(Y&&Y.message&&Y.message.startsWith("Error parsing"))throw Y;else if(!Y||!("error"in Y))throw SyntaxError(`Unable to parse ${Z.url}`,{cause:Y});else if(Y.error instanceof n0)throw Y.error;else throw new n0(Y.error.message,Z.url)}}function eX(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 y2;var f1=c(()=>{b0();a6();i0();y2=sX});var c8;var l8=c(()=>{i0();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 n0(Q.message,Z.url)}throw new n0(X.message,Z.url)}else return W}}});var ZQ,p8,WQ,XQ,QQ,JQ,Y0=(Z,W)=>()=>(W||(Z((W={exports:{}}).exports,W),Z=null),W.exports),GQ=(Z,W,X,Q)=>{if(W&&typeof W==="object"||typeof W==="function"){for(var J=XQ(W),G=0,Y=J.length,U;G<Y;G++)if(U=J[G],!JQ.call(Z,U)&&U!==X)p8(Z,U,{get:((K)=>W[K]).bind(null,U),enumerable:!(Q=WQ(W,U))||Q.enumerable})}return Z},YQ=(Z,W,X)=>(X=Z!=null?ZQ(QQ(Z)):{},GQ(W||!Z||!Z.__esModule?p8(X,"default",{value:Z,enumerable:!0}):X,Z)),c4,l4,zQ,x0,n8,i8,r8,a8,s8,o8,t8,e8,Z5,W5,X5,Q5,J5,G5,Y5,z5,q5,m1,qQ,UQ,U5,qB,UB,KB,K5,VB,BB,HB,$B,FB,LB,AB,MB,IB,NB,u1;var d1=c(()=>{/*! js-yaml 4.2.0 https://github.com/nodeca/js-yaml @license MIT */ZQ=Object.create,p8=Object.defineProperty,WQ=Object.getOwnPropertyDescriptor,XQ=Object.getOwnPropertyNames,QQ=Object.getPrototypeOf,JQ=Object.prototype.hasOwnProperty,c4=Y0((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 Y(K,V){let H="";for(let B=0;B<V;B+=1)H+=K;return H}function U(K){return K===0&&Number.NEGATIVE_INFINITY===1/K}W.exports.isNothing=X,W.exports.isObject=Q,W.exports.toArray=J,W.exports.repeat=Y,W.exports.isNegativeZero=U,W.exports.extend=G}),l4=Y0((Z,W)=>{function X(J,G){let Y="",U=J.reason||"(unknown reason)";if(!J.mark)return U;if(J.mark.name)Y+='in "'+J.mark.name+'" ';if(Y+="("+(J.mark.line+1)+":"+(J.mark.column+1)+")",!G&&J.mark.snippet)Y+=`
20
+ "${F0(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=F0(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"?$4(Q,!0):Q}})}var u8=c(()=>{A4();b0()});function v1(Z){return Object.keys(Z||{}).filter((W)=>{return typeof Z[W]==="object"}).map((W)=>{return Z[W].name=W,Z[W]})}function y1(Z,W,X,Q,J){return Z.filter((G)=>{return!!d8(G,W,X,Q,J)})}function g1(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 h1(Z,W,X,Q){let J,G,Y=0;return new Promise((U,K)=>{V();function V(){if(J=Z[Y++],!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(Y===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){U({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,Y=Q.indexOf("#"),U="";if(Y>=0)U=Q.substring(Y),Q=Q.substring(0,Y);if(G){let H=G.indexOf("#");if(H>=0)G=G.substring(0,H)}let K=W._add(Q),V={url:Q,hash:U,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=k2(K.value),S2(W,K.path,K.value,K.pathType,K.dynamicIdScope),B.result}catch(H){if(G6(H))K.value=H;throw H}}async function WQ(Z,W,X){let Q=v1(W.resolve);Q=y1(Q,"canRead",Z,void 0,X),g1(Q);try{return await h1(Q,"read",Z,X)}catch(J){if(!J&&W.continueOnError)throw new O2(Z.url);else if(!J||!("error"in J))throw SyntaxError(`Unable to resolve $ref pointer "${Z.url}"`,{cause:J});else if(J.error instanceof Z6)throw J.error;else throw new Z6(J,Z.url)}}async function XQ(Z,W,X){let Q=v1(W.parse),J=y1(Q,"canParse",Z),G=J.length>0?J:Q;g1(G);try{let Y=await h1(G,"parse",Z,X);if(!Y.plugin.allowEmpty&&QQ(Y.result))throw SyntaxError(`Error parsing "${Z.url}" as ${Y.plugin.name}.
21
+ Parsed value is empty`);else return Y}catch(Y){if(!Y&&W.continueOnError)throw new C2(Z.url);else if(Y&&Y.message&&Y.message.startsWith("Error parsing"))throw Y;else if(!Y||!("error"in Y))throw SyntaxError(`Unable to parse ${Z.url}`,{cause:Y});else if(Y.error instanceof n0)throw Y.error;else throw new n0(Y.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 y2;var f1=c(()=>{b0();a6();i0();y2=ZQ});var c8;var l8=c(()=>{i0();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 n0(Q.message,Z.url)}throw new n0(X.message,Z.url)}else return W}}});var JQ,p8,GQ,YQ,zQ,qQ,Y0=(Z,W)=>()=>(W||(Z((W={exports:{}}).exports,W),Z=null),W.exports),UQ=(Z,W,X,Q)=>{if(W&&typeof W==="object"||typeof W==="function"){for(var J=YQ(W),G=0,Y=J.length,U;G<Y;G++)if(U=J[G],!qQ.call(Z,U)&&U!==X)p8(Z,U,{get:((K)=>W[K]).bind(null,U),enumerable:!(Q=GQ(W,U))||Q.enumerable})}return Z},KQ=(Z,W,X)=>(X=Z!=null?JQ(zQ(Z)):{},UQ(W||!Z||!Z.__esModule?p8(X,"default",{value:Z,enumerable:!0}):X,Z)),c4,l4,VQ,x0,n8,i8,r8,a8,s8,o8,t8,e8,Z5,W5,X5,Q5,J5,G5,Y5,z5,q5,m1,BQ,HQ,U5,BB,HB,$B,K5,FB,LB,AB,MB,IB,NB,wB,DB,TB,RB,u1;var d1=c(()=>{/*! js-yaml 4.2.0 https://github.com/nodeca/js-yaml @license MIT */JQ=Object.create,p8=Object.defineProperty,GQ=Object.getOwnPropertyDescriptor,YQ=Object.getOwnPropertyNames,zQ=Object.getPrototypeOf,qQ=Object.prototype.hasOwnProperty,c4=Y0((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 Y(K,V){let H="";for(let B=0;B<V;B+=1)H+=K;return H}function U(K){return K===0&&Number.NEGATIVE_INFINITY===1/K}W.exports.isNothing=X,W.exports.isObject=Q,W.exports.toArray=J,W.exports.repeat=Y,W.exports.isNegativeZero=U,W.exports.extend=G}),l4=Y0((Z,W)=>{function X(J,G){let Y="",U=J.reason||"(unknown reason)";if(!J.mark)return U;if(J.mark.name)Y+='in "'+J.mark.name+'" ';if(Y+="("+(J.mark.line+1)+":"+(J.mark.column+1)+")",!G&&J.mark.snippet)Y+=`
22
22
 
23
- `+J.mark.snippet;return U+" "+Y}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}),zQ=Y0((Z,W)=>{var X=c4();function Q(Y,U,K,V,H){let B="",$="",L=Math.floor(H/2)-1;if(V-U>L)B=" ... ",U=V-L+B.length;if(K-V>L)$=" ...",K=V+L-$.length;return{str:B+Y.slice(U,K).replace(/\t/g,"→")+$,pos:V-U+B.length}}function J(Y,U){return X.repeat(" ",U-Y.length)+Y}function G(Y,U){if(U=Object.create(U||null),!Y.buffer)return null;if(!U.maxLength)U.maxLength=79;if(typeof U.indent!=="number")U.indent=1;if(typeof U.linesBefore!=="number")U.linesBefore=3;if(typeof U.linesAfter!=="number")U.linesAfter=2;let K=/\r?\n|\r|\0/g,V=[0],H=[],B,$=-1;while(B=K.exec(Y.buffer))if(H.push(B.index),V.push(B.index+B[0].length),Y.position<=B.index&&$<0)$=V.length-2;if($<0)$=V.length-1;let L="",A=Math.min(Y.line+U.linesAfter,H.length).toString().length,j=U.maxLength-(U.indent+A+3);for(let R=1;R<=U.linesBefore;R++){if($-R<0)break;let x=Q(Y.buffer,V[$-R],H[$-R],Y.position-(V[$]-V[$-R]),j);L=X.repeat(" ",U.indent)+J((Y.line-R+1).toString(),A)+" | "+x.str+`
24
- `+L}let D=Q(Y.buffer,V[$],H[$],Y.position,j);L+=X.repeat(" ",U.indent)+J((Y.line+1).toString(),A)+" | "+D.str+`
23
+ `+J.mark.snippet;return U+" "+Y}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=Y0((Z,W)=>{var X=c4();function Q(Y,U,K,V,H){let B="",$="",L=Math.floor(H/2)-1;if(V-U>L)B=" ... ",U=V-L+B.length;if(K-V>L)$=" ...",K=V+L-$.length;return{str:B+Y.slice(U,K).replace(/\t/g,"→")+$,pos:V-U+B.length}}function J(Y,U){return X.repeat(" ",U-Y.length)+Y}function G(Y,U){if(U=Object.create(U||null),!Y.buffer)return null;if(!U.maxLength)U.maxLength=79;if(typeof U.indent!=="number")U.indent=1;if(typeof U.linesBefore!=="number")U.linesBefore=3;if(typeof U.linesAfter!=="number")U.linesAfter=2;let K=/\r?\n|\r|\0/g,V=[0],H=[],B,$=-1;while(B=K.exec(Y.buffer))if(H.push(B.index),V.push(B.index+B[0].length),Y.position<=B.index&&$<0)$=V.length-2;if($<0)$=V.length-1;let L="",A=Math.min(Y.line+U.linesAfter,H.length).toString().length,_=U.maxLength-(U.indent+A+3);for(let R=1;R<=U.linesBefore;R++){if($-R<0)break;let x=Q(Y.buffer,V[$-R],H[$-R],Y.position-(V[$]-V[$-R]),_);L=X.repeat(" ",U.indent)+J((Y.line-R+1).toString(),A)+" | "+x.str+`
24
+ `+L}let D=Q(Y.buffer,V[$],H[$],Y.position,_);L+=X.repeat(" ",U.indent)+J((Y.line+1).toString(),A)+" | "+D.str+`
25
25
  `,L+=X.repeat("-",U.indent+A+3+D.pos)+`^
26
- `;for(let R=1;R<=U.linesAfter;R++){if($+R>=H.length)break;let x=Q(Y.buffer,V[$+R],H[$+R],Y.position-(V[$]-V[$+R]),j);L+=X.repeat(" ",U.indent)+J((Y.line+R+1).toString(),A)+" | "+x.str+`
27
- `}return L.replace(/\n$/,"")}W.exports=G}),x0=Y0((Z,W)=>{var X=l4(),Q=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],J=["scalar","sequence","mapping"];function G(U){let K={};if(U!==null)Object.keys(U).forEach(function(V){U[V].forEach(function(H){K[String(H)]=V})});return K}function Y(U,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 "'+U+'" YAML type.')}),this.options=K,this.tag=U,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 "'+U+'" YAML type.')}W.exports=Y}),n8=Y0((Z,W)=>{var X=l4(),Q=x0();function J(U,K){let V=[];return U[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 U={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function K(V){if(V.multi)U.multi[V.kind].push(V),U.multi.fallback.push(V);else U[V.kind][V.tag]=U.fallback[V.tag]=V}for(let V=0,H=arguments.length;V<H;V+=1)arguments[V].forEach(K);return U}function Y(U){return this.extend(U)}Y.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(Y.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=Y}),i8=Y0((Z,W)=>{W.exports=new(x0())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(X){return X!==null?X:""}})}),r8=Y0((Z,W)=>{W.exports=new(x0())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(X){return X!==null?X:[]}})}),a8=Y0((Z,W)=>{W.exports=new(x0())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(X){return X!==null?X:{}}})}),s8=Y0((Z,W)=>{W.exports=new(n8())({explicit:[i8(),r8(),a8()]})}),o8=Y0((Z,W)=>{var X=x0();function Q(Y){if(Y===null)return!0;let U=Y.length;return U===1&&Y==="~"||U===4&&(Y==="null"||Y==="Null"||Y==="NULL")}function J(){return null}function G(Y){return Y===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=Y0((Z,W)=>{var X=x0();function Q(Y){if(Y===null)return!1;let U=Y.length;return U===4&&(Y==="true"||Y==="True"||Y==="TRUE")||U===5&&(Y==="false"||Y==="False"||Y==="FALSE")}function J(Y){return Y==="true"||Y==="True"||Y==="TRUE"}function G(Y){return Object.prototype.toString.call(Y)==="[object Boolean]"}W.exports=new X("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Q,construct:J,predicate:G,represent:{lowercase:function(Y){return Y?"true":"false"},uppercase:function(Y){return Y?"TRUE":"FALSE"},camelcase:function(Y){return Y?"True":"False"}},defaultStyle:"lowercase"})}),e8=Y0((Z,W)=>{var X=c4(),Q=x0();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 Y(B){return B>=48&&B<=57}function U(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(!Y(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:U,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"]}})}),Z5=Y0((Z,W)=>{var X=c4(),Q=x0(),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 Y(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 U(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:Y,construct:U,predicate:H,represent:V,defaultStyle:"lowercase"})}),W5=Y0((Z,W)=>{W.exports=s8().extend({implicit:[o8(),t8(),e8(),Z5()]})}),X5=Y0((Z,W)=>{W.exports=W5()}),Q5=Y0((Z,W)=>{var X=x0(),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 Y(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 d=+B[10],u=+(B[11]||0);if(H=(d*60+u)*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 U(K){return K.toISOString()}W.exports=new X("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:G,construct:Y,instanceOf:Date,represent:U})}),J5=Y0((Z,W)=>{var X=x0();function Q(J){return J==="<<"||J===null}W.exports=new X("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Q})}),G5=Y0((Z,W)=>{var X=x0(),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 Y(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 U(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:U,represent:Y})}),Y5=Y0((Z,W)=>{var X=x0(),Q=Object.prototype.hasOwnProperty,J=Object.prototype.toString;function G(U){if(U===null)return!0;let K=[],V=U;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 Y(U){return U!==null?U:[]}W.exports=new X("tag:yaml.org,2002:omap",{kind:"sequence",resolve:G,construct:Y})}),z5=Y0((Z,W)=>{var X=x0(),Q=Object.prototype.toString;function J(Y){if(Y===null)return!0;let U=Y,K=Array(U.length);for(let V=0,H=U.length;V<H;V+=1){let B=U[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(Y){if(Y===null)return[];let U=Y,K=Array(U.length);for(let V=0,H=U.length;V<H;V+=1){let B=U[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})}),q5=Y0((Z,W)=>{var X=x0(),Q=Object.prototype.hasOwnProperty;function J(Y){if(Y===null)return!0;let U=Y;for(let K in U)if(Q.call(U,K)){if(U[K]!==null)return!1}return!0}function G(Y){return Y!==null?Y:{}}W.exports=new X("tag:yaml.org,2002:set",{kind:"mapping",resolve:J,construct:G})}),m1=Y0((Z,W)=>{W.exports=X5().extend({implicit:[Q5(),J5()],explicit:[G5(),Y5(),z5(),q5()]})}),qQ=Y0((Z,W)=>{var X=c4(),Q=l4(),J=zQ(),G=m1(),Y=Object.prototype.hasOwnProperty,U=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 d(q){return Object.prototype.toString.call(q)}function u(q){return q===10||q===13}function i(q){return q===9||q===32}function m(q){return q===9||q===32||q===10||q===13}function b(q){return q===44||q===91||q===93||q===123||q===125}function t(q){if(q>=48&&q<=57)return q-48;let M=q|32;if(M>=97&&M<=102)return M-97+10;return-1}function w0(q){if(q===120)return 2;if(q===117)return 4;if(q===85)return 8;return 0}function j0(q){if(q>=48&&q<=57)return q-48;return-1}function s(q){switch(q){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 X0(q){if(q<=65535)return String.fromCharCode(q);return String.fromCharCode((q-65536>>10)+55296,(q-65536&1023)+56320)}function q0(q,M,w){if(M==="__proto__")Object.defineProperty(q,M,{configurable:!0,enumerable:!0,writable:!0,value:w});else q[M]=w}var Q0=Array(256),H0=Array(256);for(let q=0;q<256;q++)Q0[q]=s(q)?1:0,H0[q]=s(q);function o(q,M){this.input=q,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=q.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function G0(q,M){let w={name:q.filename,buffer:q.input.slice(0,-1),position:q.position,line:q.line,column:q.position-q.lineStart};return w.snippet=J(w),new Q(M,w)}function S(q,M){throw G0(q,M)}function c0(q,M){if(q.onWarning)q.onWarning.call(null,G0(q,M))}function H6(q,M,w){let _=q.anchorMapTransactions;if(_.length!==0){let N=_[_.length-1];if(!Y.call(N,M))N[M]={existed:Y.call(q.anchorMap,M),value:q.anchorMap[M]}}q.anchorMap[M]=w}function $1(q){q.anchorMapTransactions.push(Object.create(null))}function p6(q){let M=q.anchorMapTransactions.pop(),w=q.anchorMapTransactions;if(w.length===0)return;let _=w[w.length-1],N=Object.keys(M);for(let k=0,F=N.length;k<F;k+=1){let I=N[k];if(!Y.call(_,I))_[I]=M[I]}}function F1(q){let M=q.anchorMapTransactions.pop(),w=Object.keys(M);for(let _=w.length-1;_>=0;_-=1){let N=M[w[_]];if(N.existed)q.anchorMap[w[_]]=N.value;else delete q.anchorMap[w[_]]}}function S4(q){return{position:q.position,line:q.line,lineStart:q.lineStart,lineIndent:q.lineIndent,firstTabInLine:q.firstTabInLine,tag:q.tag,anchor:q.anchor,kind:q.kind,result:q.result}}function X4(q,M){q.position=M.position,q.line=M.line,q.lineStart=M.lineStart,q.lineIndent=M.lineIndent,q.firstTabInLine=M.firstTabInLine,q.tag=M.tag,q.anchor=M.anchor,q.kind=M.kind,q.result=M.result}var K2={YAML:function(M,w,_){if(M.version!==null)S(M,"duplication of %YAML directive");if(_.length!==1)S(M,"YAML directive accepts exactly one argument");let N=/^([0-9]+)\.([0-9]+)$/.exec(_[0]);if(N===null)S(M,"ill-formed argument of the YAML directive");let k=parseInt(N[1],10),F=parseInt(N[2],10);if(k!==1)S(M,"unacceptable YAML version of the document");if(M.version=_[0],M.checkLineBreaks=F<2,F!==1&&F!==2)c0(M,"unsupported YAML version of the document")},TAG:function(M,w,_){let N;if(_.length!==2)S(M,"TAG directive accepts exactly two arguments");let k=_[0];if(N=_[1],!R.test(k))S(M,"ill-formed tag handle (first argument) of the TAG directive");if(Y.call(M.tagMap,k))S(M,'there is a previously declared suffix for "'+k+'" tag handle');if(!x.test(N))S(M,"ill-formed tag prefix (second argument) of the TAG directive");try{N=decodeURIComponent(N)}catch(F){S(M,"tag prefix is malformed: "+N)}M.tagMap[k]=N}};function g0(q,M,w,_){if(M<w){let N=q.input.slice(M,w);if(_)for(let k=0,F=N.length;k<F;k+=1){let I=N.charCodeAt(k);if(!(I===9||I>=32&&I<=1114111))S(q,"expected valid JSON character")}else if(A.test(N))S(q,"the stream contains non-printable characters");q.result+=N}}function O6(q,M,w,_){if(!X.isObject(w))S(q,"cannot merge mappings; the provided source object is unacceptable");let N=Object.keys(w);for(let k=0,F=N.length;k<F;k+=1){let I=N[k];if(!Y.call(M,I))q0(M,I,w[I]),_[I]=!0}}function $6(q,M,w,_,N,k,F,I,O){if(Array.isArray(N)){N=Array.prototype.slice.call(N);for(let T=0,P=N.length;T<P;T+=1){if(Array.isArray(N[T]))S(q,"nested arrays are not supported inside keys");if(typeof N==="object"&&d(N[T])==="[object Object]")N[T]="[object Object]"}}if(typeof N==="object"&&d(N)==="[object Object]")N="[object Object]";if(N=String(N),M===null)M={};if(_==="tag:yaml.org,2002:merge")if(Array.isArray(k)){if(k.length>q.maxMergeSeqLength)S(q,"merge sequence length exceeded maxMergeSeqLength ("+q.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),O6(q,M,E,w)}}else O6(q,M,k,w);else{if(!q.json&&!Y.call(w,N)&&Y.call(M,N))q.line=F||q.line,q.lineStart=I||q.lineStart,q.position=O||q.position,S(q,"duplicated mapping key");q0(M,N,k),delete w[N]}return M}function Q4(q){let M=q.input.charCodeAt(q.position);if(M===10)q.position++;else if(M===13){if(q.position++,q.input.charCodeAt(q.position)===10)q.position++}else S(q,"a line break is expected");q.line+=1,q.lineStart=q.position,q.firstTabInLine=-1}function K0(q,M,w){let _=0,N=q.input.charCodeAt(q.position);while(N!==0){while(i(N)){if(N===9&&q.firstTabInLine===-1)q.firstTabInLine=q.position;N=q.input.charCodeAt(++q.position)}if(M&&N===35)do N=q.input.charCodeAt(++q.position);while(N!==10&&N!==13&&N!==0);if(u(N)){Q4(q),N=q.input.charCodeAt(q.position),_++,q.lineIndent=0;while(N===32)q.lineIndent++,N=q.input.charCodeAt(++q.position)}else break}if(w!==-1&&_!==0&&q.lineIndent<w)c0(q,"deficient indentation");return _}function J4(q){let M=q.position,w=q.input.charCodeAt(M);if((w===45||w===46)&&w===q.input.charCodeAt(M+1)&&w===q.input.charCodeAt(M+2)){if(M+=3,w=q.input.charCodeAt(M),w===0||m(w))return!0}return!1}function F6(q,M){if(M===1)q.result+=" ";else if(M>1)q.result+=X.repeat(`
30
- `,M-1)}function V2(q,M,w){let _,N,k,F,I,O,T=q.kind,P=q.result,C=q.input.charCodeAt(q.position);if(m(C)||b(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=q.input.charCodeAt(q.position+1);if(m(E)||w&&b(E))return!1}q.kind="scalar",q.result="",_=N=q.position,k=!1;while(C!==0){if(C===58){let E=q.input.charCodeAt(q.position+1);if(m(E)||w&&b(E))break}else if(C===35){if(m(q.input.charCodeAt(q.position-1)))break}else if(q.position===q.lineStart&&J4(q)||w&&b(C))break;else if(u(C))if(F=q.line,I=q.lineStart,O=q.lineIndent,K0(q,!1,-1),q.lineIndent>=M){k=!0,C=q.input.charCodeAt(q.position);continue}else{q.position=N,q.line=F,q.lineStart=I,q.lineIndent=O;break}if(k)g0(q,_,N,!1),F6(q,q.line-F),_=N=q.position,k=!1;if(!i(C))N=q.position+1;C=q.input.charCodeAt(++q.position)}if(g0(q,_,N,!1),q.result)return!0;return q.kind=T,q.result=P,!1}function B2(q,M){let w,_,N=q.input.charCodeAt(q.position);if(N!==39)return!1;q.kind="scalar",q.result="",q.position++,w=_=q.position;while((N=q.input.charCodeAt(q.position))!==0)if(N===39)if(g0(q,w,q.position,!0),N=q.input.charCodeAt(++q.position),N===39)w=q.position,q.position++,_=q.position;else return!0;else if(u(N))g0(q,w,_,!0),F6(q,K0(q,!1,M)),w=_=q.position;else if(q.position===q.lineStart&&J4(q))S(q,"unexpected end of the document within a single quoted scalar");else if(q.position++,!i(N))_=q.position;S(q,"unexpected end of the stream within a single quoted scalar")}function b4(q,M){let w,_,N,k=q.input.charCodeAt(q.position);if(k!==34)return!1;q.kind="scalar",q.result="",q.position++,w=_=q.position;while((k=q.input.charCodeAt(q.position))!==0)if(k===34)return g0(q,w,q.position,!0),q.position++,!0;else if(k===92){if(g0(q,w,q.position,!0),k=q.input.charCodeAt(++q.position),u(k))K0(q,!1,M);else if(k<256&&Q0[k])q.result+=H0[k],q.position++;else if((N=w0(k))>0){let F=N,I=0;for(;F>0;F--)if(k=q.input.charCodeAt(++q.position),(N=t(k))>=0)I=(I<<4)+N;else S(q,"expected hexadecimal character");q.result+=X0(I),q.position++}else S(q,"unknown escape sequence");w=_=q.position}else if(u(k))g0(q,w,_,!0),F6(q,K0(q,!1,M)),w=_=q.position;else if(q.position===q.lineStart&&J4(q))S(q,"unexpected end of the document within a double quoted scalar");else if(q.position++,!i(k))_=q.position;S(q,"unexpected end of the stream within a double quoted scalar")}function H2(q,M){let w=!0,_,N,k,F=q.tag,I,O=q.anchor,T,P,C,E,f=Object.create(null),v,l,p,e=q.input.charCodeAt(q.position);if(e===91)T=93,E=!1,I=[];else if(e===123)T=125,E=!0,I={};else return!1;if(q.anchor!==null)H6(q,q.anchor,I);e=q.input.charCodeAt(++q.position);while(e!==0){if(K0(q,!0,M),e=q.input.charCodeAt(q.position),e===T)return q.position++,q.tag=F,q.anchor=O,q.kind=E?"mapping":"sequence",q.result=I,!0;else if(!w)S(q,"missed comma between flow collection entries");else if(e===44)S(q,"expected the node content, but found ','");if(l=v=p=null,P=C=!1,e===63){if(m(q.input.charCodeAt(q.position+1)))P=C=!0,q.position++,K0(q,!0,M)}if(_=q.line,N=q.lineStart,k=q.position,A6(q,M,U,!1,!0),l=q.tag,v=q.result,K0(q,!0,M),e=q.input.charCodeAt(q.position),(C||q.line===_)&&e===58)P=!0,e=q.input.charCodeAt(++q.position),K0(q,!0,M),A6(q,M,U,!1,!0),p=q.result;if(E)$6(q,I,f,l,v,p,_,N,k);else if(P)I.push($6(q,null,f,l,v,p,_,N,k));else I.push(v);if(K0(q,!0,M),e=q.input.charCodeAt(q.position),e===44)w=!0,e=q.input.charCodeAt(++q.position);else w=!1}S(q,"unexpected end of the stream within a flow collection")}function $2(q,M){let w,_=B,N=!1,k=!1,F=M,I=0,O=!1,T,P=q.input.charCodeAt(q.position);if(P===124)w=!1;else if(P===62)w=!0;else return!1;q.kind="scalar",q.result="";while(P!==0)if(P=q.input.charCodeAt(++q.position),P===43||P===45)if(B===_)_=P===43?L:$;else S(q,"repeat of a chomping mode identifier");else if((T=j0(P))>=0)if(T===0)S(q,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!k)F=M+T-1,k=!0;else S(q,"repeat of an indentation width identifier");else break;if(i(P)){do P=q.input.charCodeAt(++q.position);while(i(P));if(P===35)do P=q.input.charCodeAt(++q.position);while(!u(P)&&P!==0)}while(P!==0){Q4(q),q.lineIndent=0,P=q.input.charCodeAt(q.position);while((!k||q.lineIndent<F)&&P===32)q.lineIndent++,P=q.input.charCodeAt(++q.position);if(!k&&q.lineIndent>F)F=q.lineIndent;if(u(P)){I++;continue}if(!k&&F===0)S(q,"missing indentation for block scalar");if(q.lineIndent<F){if(_===L)q.result+=X.repeat(`
31
- `,N?1+I:I);else if(_===B){if(N)q.result+=`
26
+ `;for(let R=1;R<=U.linesAfter;R++){if($+R>=H.length)break;let x=Q(Y.buffer,V[$+R],H[$+R],Y.position-(V[$]-V[$+R]),_);L+=X.repeat(" ",U.indent)+J((Y.line+R+1).toString(),A)+" | "+x.str+`
27
+ `}return L.replace(/\n$/,"")}W.exports=G}),x0=Y0((Z,W)=>{var X=l4(),Q=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],J=["scalar","sequence","mapping"];function G(U){let K={};if(U!==null)Object.keys(U).forEach(function(V){U[V].forEach(function(H){K[String(H)]=V})});return K}function Y(U,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 "'+U+'" YAML type.')}),this.options=K,this.tag=U,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 "'+U+'" YAML type.')}W.exports=Y}),n8=Y0((Z,W)=>{var X=l4(),Q=x0();function J(U,K){let V=[];return U[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 U={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function K(V){if(V.multi)U.multi[V.kind].push(V),U.multi.fallback.push(V);else U[V.kind][V.tag]=U.fallback[V.tag]=V}for(let V=0,H=arguments.length;V<H;V+=1)arguments[V].forEach(K);return U}function Y(U){return this.extend(U)}Y.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(Y.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=Y}),i8=Y0((Z,W)=>{W.exports=new(x0())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(X){return X!==null?X:""}})}),r8=Y0((Z,W)=>{W.exports=new(x0())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(X){return X!==null?X:[]}})}),a8=Y0((Z,W)=>{W.exports=new(x0())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(X){return X!==null?X:{}}})}),s8=Y0((Z,W)=>{W.exports=new(n8())({explicit:[i8(),r8(),a8()]})}),o8=Y0((Z,W)=>{var X=x0();function Q(Y){if(Y===null)return!0;let U=Y.length;return U===1&&Y==="~"||U===4&&(Y==="null"||Y==="Null"||Y==="NULL")}function J(){return null}function G(Y){return Y===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=Y0((Z,W)=>{var X=x0();function Q(Y){if(Y===null)return!1;let U=Y.length;return U===4&&(Y==="true"||Y==="True"||Y==="TRUE")||U===5&&(Y==="false"||Y==="False"||Y==="FALSE")}function J(Y){return Y==="true"||Y==="True"||Y==="TRUE"}function G(Y){return Object.prototype.toString.call(Y)==="[object Boolean]"}W.exports=new X("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Q,construct:J,predicate:G,represent:{lowercase:function(Y){return Y?"true":"false"},uppercase:function(Y){return Y?"TRUE":"FALSE"},camelcase:function(Y){return Y?"True":"False"}},defaultStyle:"lowercase"})}),e8=Y0((Z,W)=>{var X=c4(),Q=x0();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 Y(B){return B>=48&&B<=57}function U(B){if(B===null)return!1;let $=B.length,L=0,A=!1;if(!$)return!1;let _=B[L];if(_==="-"||_==="+")_=B[++L];if(_==="0"){if(L+1===$)return!0;if(_=B[++L],_==="b"){L++;for(;L<$;L++){if(_=B[L],_!=="0"&&_!=="1")return!1;A=!0}return A&&Number.isFinite(K(B))}if(_==="x"){L++;for(;L<$;L++){if(!J(B.charCodeAt(L)))return!1;A=!0}return A&&Number.isFinite(K(B))}if(_==="o"){L++;for(;L<$;L++){if(!G(B.charCodeAt(L)))return!1;A=!0}return A&&Number.isFinite(K(B))}}for(;L<$;L++){if(!Y(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:U,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"]}})}),Z5=Y0((Z,W)=>{var X=c4(),Q=x0(),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 Y(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 U(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:Y,construct:U,predicate:H,represent:V,defaultStyle:"lowercase"})}),W5=Y0((Z,W)=>{W.exports=s8().extend({implicit:[o8(),t8(),e8(),Z5()]})}),X5=Y0((Z,W)=>{W.exports=W5()}),Q5=Y0((Z,W)=>{var X=x0(),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 Y(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 _=+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 d=+B[10],u=+(B[11]||0);if(H=(d*60+u)*60000,B[9]==="-")H=-H}let x=new Date(Date.UTC($,L,A,_,D,R,V));if(H)x.setTime(x.getTime()-H);return x}function U(K){return K.toISOString()}W.exports=new X("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:G,construct:Y,instanceOf:Date,represent:U})}),J5=Y0((Z,W)=>{var X=x0();function Q(J){return J==="<<"||J===null}W.exports=new X("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Q})}),G5=Y0((Z,W)=>{var X=x0(),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 _=0;_<H;_++){if(_%4===0&&_)L.push($>>16&255),L.push($>>8&255),L.push($&255);$=$<<6|B.indexOf(V.charAt(_))}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 Y(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 U(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:U,represent:Y})}),Y5=Y0((Z,W)=>{var X=x0(),Q=Object.prototype.hasOwnProperty,J=Object.prototype.toString;function G(U){if(U===null)return!0;let K=[],V=U;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 Y(U){return U!==null?U:[]}W.exports=new X("tag:yaml.org,2002:omap",{kind:"sequence",resolve:G,construct:Y})}),z5=Y0((Z,W)=>{var X=x0(),Q=Object.prototype.toString;function J(Y){if(Y===null)return!0;let U=Y,K=Array(U.length);for(let V=0,H=U.length;V<H;V+=1){let B=U[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(Y){if(Y===null)return[];let U=Y,K=Array(U.length);for(let V=0,H=U.length;V<H;V+=1){let B=U[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})}),q5=Y0((Z,W)=>{var X=x0(),Q=Object.prototype.hasOwnProperty;function J(Y){if(Y===null)return!0;let U=Y;for(let K in U)if(Q.call(U,K)){if(U[K]!==null)return!1}return!0}function G(Y){return Y!==null?Y:{}}W.exports=new X("tag:yaml.org,2002:set",{kind:"mapping",resolve:J,construct:G})}),m1=Y0((Z,W)=>{W.exports=X5().extend({implicit:[Q5(),J5()],explicit:[G5(),Y5(),z5(),q5()]})}),BQ=Y0((Z,W)=>{var X=c4(),Q=l4(),J=VQ(),G=m1(),Y=Object.prototype.hasOwnProperty,U=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]/,_=/[\x85\u2028\u2029]/,D=/[,\[\]{}]/,R=/^(?:!|!!|![0-9A-Za-z-]+!)$/,x=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function d(q){return Object.prototype.toString.call(q)}function u(q){return q===10||q===13}function i(q){return q===9||q===32}function m(q){return q===9||q===32||q===10||q===13}function b(q){return q===44||q===91||q===93||q===123||q===125}function t(q){if(q>=48&&q<=57)return q-48;let M=q|32;if(M>=97&&M<=102)return M-97+10;return-1}function w0(q){if(q===120)return 2;if(q===117)return 4;if(q===85)return 8;return 0}function _0(q){if(q>=48&&q<=57)return q-48;return-1}function s(q){switch(q){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 X0(q){if(q<=65535)return String.fromCharCode(q);return String.fromCharCode((q-65536>>10)+55296,(q-65536&1023)+56320)}function q0(q,M,w){if(M==="__proto__")Object.defineProperty(q,M,{configurable:!0,enumerable:!0,writable:!0,value:w});else q[M]=w}var Q0=Array(256),H0=Array(256);for(let q=0;q<256;q++)Q0[q]=s(q)?1:0,H0[q]=s(q);function o(q,M){this.input=q,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=q.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function G0(q,M){let w={name:q.filename,buffer:q.input.slice(0,-1),position:q.position,line:q.line,column:q.position-q.lineStart};return w.snippet=J(w),new Q(M,w)}function S(q,M){throw G0(q,M)}function c0(q,M){if(q.onWarning)q.onWarning.call(null,G0(q,M))}function H6(q,M,w){let j=q.anchorMapTransactions;if(j.length!==0){let N=j[j.length-1];if(!Y.call(N,M))N[M]={existed:Y.call(q.anchorMap,M),value:q.anchorMap[M]}}q.anchorMap[M]=w}function $1(q){q.anchorMapTransactions.push(Object.create(null))}function p6(q){let M=q.anchorMapTransactions.pop(),w=q.anchorMapTransactions;if(w.length===0)return;let j=w[w.length-1],N=Object.keys(M);for(let k=0,F=N.length;k<F;k+=1){let I=N[k];if(!Y.call(j,I))j[I]=M[I]}}function F1(q){let M=q.anchorMapTransactions.pop(),w=Object.keys(M);for(let j=w.length-1;j>=0;j-=1){let N=M[w[j]];if(N.existed)q.anchorMap[w[j]]=N.value;else delete q.anchorMap[w[j]]}}function S4(q){return{position:q.position,line:q.line,lineStart:q.lineStart,lineIndent:q.lineIndent,firstTabInLine:q.firstTabInLine,tag:q.tag,anchor:q.anchor,kind:q.kind,result:q.result}}function X4(q,M){q.position=M.position,q.line=M.line,q.lineStart=M.lineStart,q.lineIndent=M.lineIndent,q.firstTabInLine=M.firstTabInLine,q.tag=M.tag,q.anchor=M.anchor,q.kind=M.kind,q.result=M.result}var K2={YAML:function(M,w,j){if(M.version!==null)S(M,"duplication of %YAML directive");if(j.length!==1)S(M,"YAML directive accepts exactly one argument");let N=/^([0-9]+)\.([0-9]+)$/.exec(j[0]);if(N===null)S(M,"ill-formed argument of the YAML directive");let k=parseInt(N[1],10),F=parseInt(N[2],10);if(k!==1)S(M,"unacceptable YAML version of the document");if(M.version=j[0],M.checkLineBreaks=F<2,F!==1&&F!==2)c0(M,"unsupported YAML version of the document")},TAG:function(M,w,j){let N;if(j.length!==2)S(M,"TAG directive accepts exactly two arguments");let k=j[0];if(N=j[1],!R.test(k))S(M,"ill-formed tag handle (first argument) of the TAG directive");if(Y.call(M.tagMap,k))S(M,'there is a previously declared suffix for "'+k+'" tag handle');if(!x.test(N))S(M,"ill-formed tag prefix (second argument) of the TAG directive");try{N=decodeURIComponent(N)}catch(F){S(M,"tag prefix is malformed: "+N)}M.tagMap[k]=N}};function g0(q,M,w,j){if(M<w){let N=q.input.slice(M,w);if(j)for(let k=0,F=N.length;k<F;k+=1){let I=N.charCodeAt(k);if(!(I===9||I>=32&&I<=1114111))S(q,"expected valid JSON character")}else if(A.test(N))S(q,"the stream contains non-printable characters");q.result+=N}}function O6(q,M,w,j){if(!X.isObject(w))S(q,"cannot merge mappings; the provided source object is unacceptable");let N=Object.keys(w);for(let k=0,F=N.length;k<F;k+=1){let I=N[k];if(!Y.call(M,I))q0(M,I,w[I]),j[I]=!0}}function $6(q,M,w,j,N,k,F,I,O){if(Array.isArray(N)){N=Array.prototype.slice.call(N);for(let T=0,P=N.length;T<P;T+=1){if(Array.isArray(N[T]))S(q,"nested arrays are not supported inside keys");if(typeof N==="object"&&d(N[T])==="[object Object]")N[T]="[object Object]"}}if(typeof N==="object"&&d(N)==="[object Object]")N="[object Object]";if(N=String(N),M===null)M={};if(j==="tag:yaml.org,2002:merge")if(Array.isArray(k)){if(k.length>q.maxMergeSeqLength)S(q,"merge sequence length exceeded maxMergeSeqLength ("+q.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),O6(q,M,E,w)}}else O6(q,M,k,w);else{if(!q.json&&!Y.call(w,N)&&Y.call(M,N))q.line=F||q.line,q.lineStart=I||q.lineStart,q.position=O||q.position,S(q,"duplicated mapping key");q0(M,N,k),delete w[N]}return M}function Q4(q){let M=q.input.charCodeAt(q.position);if(M===10)q.position++;else if(M===13){if(q.position++,q.input.charCodeAt(q.position)===10)q.position++}else S(q,"a line break is expected");q.line+=1,q.lineStart=q.position,q.firstTabInLine=-1}function K0(q,M,w){let j=0,N=q.input.charCodeAt(q.position);while(N!==0){while(i(N)){if(N===9&&q.firstTabInLine===-1)q.firstTabInLine=q.position;N=q.input.charCodeAt(++q.position)}if(M&&N===35)do N=q.input.charCodeAt(++q.position);while(N!==10&&N!==13&&N!==0);if(u(N)){Q4(q),N=q.input.charCodeAt(q.position),j++,q.lineIndent=0;while(N===32)q.lineIndent++,N=q.input.charCodeAt(++q.position)}else break}if(w!==-1&&j!==0&&q.lineIndent<w)c0(q,"deficient indentation");return j}function J4(q){let M=q.position,w=q.input.charCodeAt(M);if((w===45||w===46)&&w===q.input.charCodeAt(M+1)&&w===q.input.charCodeAt(M+2)){if(M+=3,w=q.input.charCodeAt(M),w===0||m(w))return!0}return!1}function F6(q,M){if(M===1)q.result+=" ";else if(M>1)q.result+=X.repeat(`
30
+ `,M-1)}function V2(q,M,w){let j,N,k,F,I,O,T=q.kind,P=q.result,C=q.input.charCodeAt(q.position);if(m(C)||b(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=q.input.charCodeAt(q.position+1);if(m(E)||w&&b(E))return!1}q.kind="scalar",q.result="",j=N=q.position,k=!1;while(C!==0){if(C===58){let E=q.input.charCodeAt(q.position+1);if(m(E)||w&&b(E))break}else if(C===35){if(m(q.input.charCodeAt(q.position-1)))break}else if(q.position===q.lineStart&&J4(q)||w&&b(C))break;else if(u(C))if(F=q.line,I=q.lineStart,O=q.lineIndent,K0(q,!1,-1),q.lineIndent>=M){k=!0,C=q.input.charCodeAt(q.position);continue}else{q.position=N,q.line=F,q.lineStart=I,q.lineIndent=O;break}if(k)g0(q,j,N,!1),F6(q,q.line-F),j=N=q.position,k=!1;if(!i(C))N=q.position+1;C=q.input.charCodeAt(++q.position)}if(g0(q,j,N,!1),q.result)return!0;return q.kind=T,q.result=P,!1}function B2(q,M){let w,j,N=q.input.charCodeAt(q.position);if(N!==39)return!1;q.kind="scalar",q.result="",q.position++,w=j=q.position;while((N=q.input.charCodeAt(q.position))!==0)if(N===39)if(g0(q,w,q.position,!0),N=q.input.charCodeAt(++q.position),N===39)w=q.position,q.position++,j=q.position;else return!0;else if(u(N))g0(q,w,j,!0),F6(q,K0(q,!1,M)),w=j=q.position;else if(q.position===q.lineStart&&J4(q))S(q,"unexpected end of the document within a single quoted scalar");else if(q.position++,!i(N))j=q.position;S(q,"unexpected end of the stream within a single quoted scalar")}function b4(q,M){let w,j,N,k=q.input.charCodeAt(q.position);if(k!==34)return!1;q.kind="scalar",q.result="",q.position++,w=j=q.position;while((k=q.input.charCodeAt(q.position))!==0)if(k===34)return g0(q,w,q.position,!0),q.position++,!0;else if(k===92){if(g0(q,w,q.position,!0),k=q.input.charCodeAt(++q.position),u(k))K0(q,!1,M);else if(k<256&&Q0[k])q.result+=H0[k],q.position++;else if((N=w0(k))>0){let F=N,I=0;for(;F>0;F--)if(k=q.input.charCodeAt(++q.position),(N=t(k))>=0)I=(I<<4)+N;else S(q,"expected hexadecimal character");q.result+=X0(I),q.position++}else S(q,"unknown escape sequence");w=j=q.position}else if(u(k))g0(q,w,j,!0),F6(q,K0(q,!1,M)),w=j=q.position;else if(q.position===q.lineStart&&J4(q))S(q,"unexpected end of the document within a double quoted scalar");else if(q.position++,!i(k))j=q.position;S(q,"unexpected end of the stream within a double quoted scalar")}function H2(q,M){let w=!0,j,N,k,F=q.tag,I,O=q.anchor,T,P,C,E,f=Object.create(null),v,l,p,e=q.input.charCodeAt(q.position);if(e===91)T=93,E=!1,I=[];else if(e===123)T=125,E=!0,I={};else return!1;if(q.anchor!==null)H6(q,q.anchor,I);e=q.input.charCodeAt(++q.position);while(e!==0){if(K0(q,!0,M),e=q.input.charCodeAt(q.position),e===T)return q.position++,q.tag=F,q.anchor=O,q.kind=E?"mapping":"sequence",q.result=I,!0;else if(!w)S(q,"missed comma between flow collection entries");else if(e===44)S(q,"expected the node content, but found ','");if(l=v=p=null,P=C=!1,e===63){if(m(q.input.charCodeAt(q.position+1)))P=C=!0,q.position++,K0(q,!0,M)}if(j=q.line,N=q.lineStart,k=q.position,A6(q,M,U,!1,!0),l=q.tag,v=q.result,K0(q,!0,M),e=q.input.charCodeAt(q.position),(C||q.line===j)&&e===58)P=!0,e=q.input.charCodeAt(++q.position),K0(q,!0,M),A6(q,M,U,!1,!0),p=q.result;if(E)$6(q,I,f,l,v,p,j,N,k);else if(P)I.push($6(q,null,f,l,v,p,j,N,k));else I.push(v);if(K0(q,!0,M),e=q.input.charCodeAt(q.position),e===44)w=!0,e=q.input.charCodeAt(++q.position);else w=!1}S(q,"unexpected end of the stream within a flow collection")}function $2(q,M){let w,j=B,N=!1,k=!1,F=M,I=0,O=!1,T,P=q.input.charCodeAt(q.position);if(P===124)w=!1;else if(P===62)w=!0;else return!1;q.kind="scalar",q.result="";while(P!==0)if(P=q.input.charCodeAt(++q.position),P===43||P===45)if(B===j)j=P===43?L:$;else S(q,"repeat of a chomping mode identifier");else if((T=_0(P))>=0)if(T===0)S(q,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!k)F=M+T-1,k=!0;else S(q,"repeat of an indentation width identifier");else break;if(i(P)){do P=q.input.charCodeAt(++q.position);while(i(P));if(P===35)do P=q.input.charCodeAt(++q.position);while(!u(P)&&P!==0)}while(P!==0){Q4(q),q.lineIndent=0,P=q.input.charCodeAt(q.position);while((!k||q.lineIndent<F)&&P===32)q.lineIndent++,P=q.input.charCodeAt(++q.position);if(!k&&q.lineIndent>F)F=q.lineIndent;if(u(P)){I++;continue}if(!k&&F===0)S(q,"missing indentation for block scalar");if(q.lineIndent<F){if(j===L)q.result+=X.repeat(`
31
+ `,N?1+I:I);else if(j===B){if(N)q.result+=`
32
32
  `}break}if(w)if(i(P))O=!0,q.result+=X.repeat(`
33
33
  `,N?1+I:I);else if(O)O=!1,q.result+=X.repeat(`
34
34
  `,I+1);else if(I===0){if(N)q.result+=" "}else q.result+=X.repeat(`
35
35
  `,I);else q.result+=X.repeat(`
36
- `,N?1+I:I);N=!0,k=!0,I=0;let C=q.position;while(!u(P)&&P!==0)P=q.input.charCodeAt(++q.position);g0(q,C,q.position,!1)}return!0}function L6(q,M){let{tag:w,anchor:_}=q,N=[],k=!1;if(q.firstTabInLine!==-1)return!1;if(q.anchor!==null)H6(q,q.anchor,N);let F=q.input.charCodeAt(q.position);while(F!==0){if(q.firstTabInLine!==-1)q.position=q.firstTabInLine,S(q,"tab characters must not be used in indentation");if(F!==45)break;if(!m(q.input.charCodeAt(q.position+1)))break;if(k=!0,q.position++,K0(q,!0,-1)){if(q.lineIndent<=M){N.push(null),F=q.input.charCodeAt(q.position);continue}}let I=q.line;if(A6(q,M,V,!1,!0),N.push(q.result),K0(q,!0,-1),F=q.input.charCodeAt(q.position),(q.line===I||q.lineIndent>M)&&F!==0)S(q,"bad indentation of a sequence entry");else if(q.lineIndent<M)break}if(k)return q.tag=w,q.anchor=_,q.kind="sequence",q.result=N,!0;return!1}function F2(q,M,w){let _,N,k,F,I=q.tag,O=q.anchor,T={},P=Object.create(null),C=null,E=null,f=null,v=!1,l=!1;if(q.firstTabInLine!==-1)return!1;if(q.anchor!==null)H6(q,q.anchor,T);let p=q.input.charCodeAt(q.position);while(p!==0){if(!v&&q.firstTabInLine!==-1)q.position=q.firstTabInLine,S(q,"tab characters must not be used in indentation");let e=q.input.charCodeAt(q.position+1),U0=q.line;if((p===63||p===58)&&m(e)){if(p===63){if(v)$6(q,T,P,C,E,null,N,k,F),C=E=f=null;l=!0,v=!0,_=!0}else if(v)v=!1,_=!0;else S(q,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");q.position+=1,p=e}else{if(N=q.line,k=q.lineStart,F=q.position,!A6(q,w,K,!1,!0))break;if(q.line===U0){p=q.input.charCodeAt(q.position);while(i(p))p=q.input.charCodeAt(++q.position);if(p===58){if(p=q.input.charCodeAt(++q.position),!m(p))S(q,"a whitespace character is expected after the key-value separator within a block mapping");if(v)$6(q,T,P,C,E,null,N,k,F),C=E=f=null;l=!0,v=!1,_=!1,C=q.tag,E=q.result}else if(l)S(q,"can not read an implicit mapping pair; a colon is missed");else return q.tag=I,q.anchor=O,!0}else if(l)S(q,"can not read a block mapping entry; a multiline key may not be an implicit key");else return q.tag=I,q.anchor=O,!0}if(q.line===U0||q.lineIndent>M){if(v)N=q.line,k=q.lineStart,F=q.position;if(A6(q,M,H,!0,_))if(v)E=q.result;else f=q.result;if(!v)$6(q,T,P,C,E,f,N,k,F),C=E=f=null;K0(q,!0,-1),p=q.input.charCodeAt(q.position)}if((q.line===U0||q.lineIndent>M)&&p!==0)S(q,"bad indentation of a mapping entry");else if(q.lineIndent<M)break}if(v)$6(q,T,P,C,E,null,N,k,F);if(l)q.tag=I,q.anchor=O,q.kind="mapping",q.result=T;return l}function L1(q){let M=!1,w=!1,_,N,k=q.input.charCodeAt(q.position);if(k!==33)return!1;if(q.tag!==null)S(q,"duplication of a tag property");if(k=q.input.charCodeAt(++q.position),k===60)M=!0,k=q.input.charCodeAt(++q.position);else if(k===33)w=!0,_="!!",k=q.input.charCodeAt(++q.position);else _="!";let F=q.position;if(M){do k=q.input.charCodeAt(++q.position);while(k!==0&&k!==62);if(q.position<q.length)N=q.input.slice(F,q.position),k=q.input.charCodeAt(++q.position);else S(q,"unexpected end of the stream within a verbatim tag")}else{while(k!==0&&!m(k)){if(k===33)if(!w){if(_=q.input.slice(F-1,q.position+1),!R.test(_))S(q,"named tag handle cannot contain such characters");w=!0,F=q.position+1}else S(q,"tag suffix cannot contain exclamation marks");k=q.input.charCodeAt(++q.position)}if(N=q.input.slice(F,q.position),D.test(N))S(q,"tag suffix cannot contain flow indicator characters")}if(N&&!x.test(N))S(q,"tag name cannot contain such characters: "+N);try{N=decodeURIComponent(N)}catch(I){S(q,"tag name is malformed: "+N)}if(M)q.tag=N;else if(Y.call(q.tagMap,_))q.tag=q.tagMap[_]+N;else if(_==="!")q.tag="!"+N;else if(_==="!!")q.tag="tag:yaml.org,2002:"+N;else S(q,'undeclared tag handle "'+_+'"');return!0}function L2(q){let M=q.input.charCodeAt(q.position);if(M!==38)return!1;if(q.anchor!==null)S(q,"duplication of an anchor property");M=q.input.charCodeAt(++q.position);let w=q.position;while(M!==0&&!m(M)&&!b(M))M=q.input.charCodeAt(++q.position);if(q.position===w)S(q,"name of an anchor node must contain at least one character");return q.anchor=q.input.slice(w,q.position),!0}function A2(q){let M=q.input.charCodeAt(q.position);if(M!==42)return!1;M=q.input.charCodeAt(++q.position);let w=q.position;while(M!==0&&!m(M)&&!b(M))M=q.input.charCodeAt(++q.position);if(q.position===w)S(q,"name of an alias node must contain at least one character");let _=q.input.slice(w,q.position);if(!Y.call(q.anchorMap,_))S(q,'unidentified alias "'+_+'"');return q.result=q.anchorMap[_],K0(q,!0,-1),!0}function A1(q,M,w,_){let N=S4(q);if($1(q),X4(q,M),q.tag=null,q.anchor=null,q.kind=null,q.result=null,F2(q,w,_)&&q.kind==="mapping")return p6(q),!0;return F1(q),X4(q,N),!1}function A6(q,M,w,_,N){let k,F,I=1,O=!1,T=!1,P=null,C,E,f;if(q.depth>=q.maxDepth)S(q,"nesting exceeded maxDepth ("+q.maxDepth+")");if(q.depth+=1,q.listener!==null)q.listener("open",q);q.tag=null,q.anchor=null,q.kind=null,q.result=null;let v=k=F=H===w||V===w;if(_){if(K0(q,!0,-1)){if(O=!0,q.lineIndent>M)I=1;else if(q.lineIndent===M)I=0;else if(q.lineIndent<M)I=-1}}if(I===1)while(!0){let l=q.input.charCodeAt(q.position),p=S4(q);if(O&&(l===33&&q.tag!==null||l===38&&q.anchor!==null))break;if(!L1(q)&&!L2(q))break;if(P===null)P=p;if(K0(q,!0,-1)){if(O=!0,F=v,q.lineIndent>M)I=1;else if(q.lineIndent===M)I=0;else if(q.lineIndent<M)I=-1}else F=!1}if(F)F=O||N;if(I===1||H===w){if(U===w||K===w)E=M;else E=M+1;if(f=q.position-q.lineStart,I===1)if(F&&(L6(q,f)||F2(q,f,E))||H2(q,E))T=!0;else{let l=q.input.charCodeAt(q.position);if(P!==null&&v&&!F&&l!==124&&l!==62&&A1(q,P,P.position-P.lineStart,E))T=!0;else if(k&&$2(q,E)||B2(q,E)||b4(q,E))T=!0;else if(A2(q)){if(T=!0,q.tag!==null||q.anchor!==null)S(q,"alias node should not have any properties")}else if(V2(q,E,U===w)){if(T=!0,q.tag===null)q.tag="?"}if(q.anchor!==null)H6(q,q.anchor,q.result)}else if(I===0)T=F&&L6(q,f)}if(q.tag===null){if(q.anchor!==null)H6(q,q.anchor,q.result)}else if(q.tag==="?"){if(q.result!==null&&q.kind!=="scalar")S(q,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+q.kind+'"');for(let l=0,p=q.implicitTypes.length;l<p;l+=1)if(C=q.implicitTypes[l],C.resolve(q.result)){if(q.result=C.construct(q.result),q.tag=C.tag,q.anchor!==null)H6(q,q.anchor,q.result);break}}else if(q.tag!=="!"){if(Y.call(q.typeMap[q.kind||"fallback"],q.tag))C=q.typeMap[q.kind||"fallback"][q.tag];else{C=null;let l=q.typeMap.multi[q.kind||"fallback"];for(let p=0,e=l.length;p<e;p+=1)if(q.tag.slice(0,l[p].tag.length)===l[p].tag){C=l[p];break}}if(!C)S(q,"unknown tag !<"+q.tag+">");if(q.result!==null&&C.kind!==q.kind)S(q,"unacceptable node kind for !<"+q.tag+'> tag; it should be "'+C.kind+'", not "'+q.kind+'"');if(!C.resolve(q.result,q.tag))S(q,"cannot resolve a node with !<"+q.tag+"> explicit tag");else if(q.result=C.construct(q.result,q.tag),q.anchor!==null)H6(q,q.anchor,q.result)}if(q.listener!==null)q.listener("close",q);return q.depth-=1,q.tag!==null||q.anchor!==null||T}function M1(q){let M=q.position,w=!1,_;q.version=null,q.checkLineBreaks=q.legacy,q.tagMap=Object.create(null),q.anchorMap=Object.create(null);while((_=q.input.charCodeAt(q.position))!==0){if(K0(q,!0,-1),_=q.input.charCodeAt(q.position),q.lineIndent>0||_!==37)break;w=!0,_=q.input.charCodeAt(++q.position);let N=q.position;while(_!==0&&!m(_))_=q.input.charCodeAt(++q.position);let k=q.input.slice(N,q.position),F=[];if(k.length<1)S(q,"directive name must not be less than one character in length");while(_!==0){while(i(_))_=q.input.charCodeAt(++q.position);if(_===35){do _=q.input.charCodeAt(++q.position);while(_!==0&&!u(_));break}if(u(_))break;N=q.position;while(_!==0&&!m(_))_=q.input.charCodeAt(++q.position);F.push(q.input.slice(N,q.position))}if(_!==0)Q4(q);if(Y.call(K2,k))K2[k](q,k,F);else c0(q,'unknown document directive "'+k+'"')}if(K0(q,!0,-1),q.lineIndent===0&&q.input.charCodeAt(q.position)===45&&q.input.charCodeAt(q.position+1)===45&&q.input.charCodeAt(q.position+2)===45)q.position+=3,K0(q,!0,-1);else if(w)S(q,"directives end mark is expected");if(A6(q,q.lineIndent-1,H,!1,!0),K0(q,!0,-1),q.checkLineBreaks&&j.test(q.input.slice(M,q.position)))c0(q,"non-ASCII line breaks are interpreted as content");if(q.documents.push(q.result),q.position===q.lineStart&&J4(q)){if(q.input.charCodeAt(q.position)===46)q.position+=3,K0(q,!0,-1);return}if(q.position<q.length-1)S(q,"end of the stream or a document separator is expected")}function M2(q,M){if(q=String(q),M=M||{},q.length!==0){if(q.charCodeAt(q.length-1)!==10&&q.charCodeAt(q.length-1)!==13)q+=`
37
- `;if(q.charCodeAt(0)===65279)q=q.slice(1)}let w=new o(q,M),_=q.indexOf("\x00");if(_!==-1)w.position=_,S(w,"null byte is not allowed in input");w.input+="\x00";while(w.input.charCodeAt(w.position)===32)w.lineIndent+=1,w.position+=1;while(w.position<w.length-1)M1(w);return w.documents}function I2(q,M,w){if(M!==null&&typeof M==="object"&&typeof w>"u")w=M,M=null;let _=M2(q,w);if(typeof M!=="function")return _;for(let N=0,k=_.length;N<k;N+=1)M(_[N])}function I1(q,M){let w=M2(q,M);if(w.length===0)return;else if(w.length===1)return w[0];throw new Q("expected a single document in the stream, but found more")}W.exports.loadAll=I2,W.exports.load=I1}),UQ=Y0((Z,W)=>{var X=c4(),Q=l4(),J=m1(),G=Object.prototype.toString,Y=Object.prototype.hasOwnProperty,U=65279,K=9,V=10,H=13,B=32,$=33,L=34,A=35,j=37,D=38,R=39,x=42,d=44,u=45,i=58,m=61,b=62,t=63,w0=64,j0=91,s=93,X0=96,q0=123,Q0=124,H0=125,o={};o[0]="\\0",o[7]="\\a",o[8]="\\b",o[9]="\\t",o[10]="\\n",o[11]="\\v",o[12]="\\f",o[13]="\\r",o[27]="\\e",o[34]="\\\"",o[92]="\\\\",o[133]="\\N",o[160]="\\_",o[8232]="\\L",o[8233]="\\P";var G0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],S=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function c0(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],f=String(I[E]);if(E.slice(0,2)==="!!")E="tag:yaml.org,2002:"+E.slice(2);let v=F.compiledTypeMap.fallback[E];if(v&&Y.call(v.styleAliases,f))f=v.styleAliases[f];O[E]=f}return O}function H6(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 $1=1,p6=2;function F1(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=c0(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==='"'?p6:$1,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 S4(F,I){let O=X.repeat(" ",I),T=0,P="",C=F.length;while(T<C){let E,f=F.indexOf(`
36
+ `,N?1+I:I);N=!0,k=!0,I=0;let C=q.position;while(!u(P)&&P!==0)P=q.input.charCodeAt(++q.position);g0(q,C,q.position,!1)}return!0}function L6(q,M){let{tag:w,anchor:j}=q,N=[],k=!1;if(q.firstTabInLine!==-1)return!1;if(q.anchor!==null)H6(q,q.anchor,N);let F=q.input.charCodeAt(q.position);while(F!==0){if(q.firstTabInLine!==-1)q.position=q.firstTabInLine,S(q,"tab characters must not be used in indentation");if(F!==45)break;if(!m(q.input.charCodeAt(q.position+1)))break;if(k=!0,q.position++,K0(q,!0,-1)){if(q.lineIndent<=M){N.push(null),F=q.input.charCodeAt(q.position);continue}}let I=q.line;if(A6(q,M,V,!1,!0),N.push(q.result),K0(q,!0,-1),F=q.input.charCodeAt(q.position),(q.line===I||q.lineIndent>M)&&F!==0)S(q,"bad indentation of a sequence entry");else if(q.lineIndent<M)break}if(k)return q.tag=w,q.anchor=j,q.kind="sequence",q.result=N,!0;return!1}function F2(q,M,w){let j,N,k,F,I=q.tag,O=q.anchor,T={},P=Object.create(null),C=null,E=null,f=null,v=!1,l=!1;if(q.firstTabInLine!==-1)return!1;if(q.anchor!==null)H6(q,q.anchor,T);let p=q.input.charCodeAt(q.position);while(p!==0){if(!v&&q.firstTabInLine!==-1)q.position=q.firstTabInLine,S(q,"tab characters must not be used in indentation");let e=q.input.charCodeAt(q.position+1),U0=q.line;if((p===63||p===58)&&m(e)){if(p===63){if(v)$6(q,T,P,C,E,null,N,k,F),C=E=f=null;l=!0,v=!0,j=!0}else if(v)v=!1,j=!0;else S(q,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");q.position+=1,p=e}else{if(N=q.line,k=q.lineStart,F=q.position,!A6(q,w,K,!1,!0))break;if(q.line===U0){p=q.input.charCodeAt(q.position);while(i(p))p=q.input.charCodeAt(++q.position);if(p===58){if(p=q.input.charCodeAt(++q.position),!m(p))S(q,"a whitespace character is expected after the key-value separator within a block mapping");if(v)$6(q,T,P,C,E,null,N,k,F),C=E=f=null;l=!0,v=!1,j=!1,C=q.tag,E=q.result}else if(l)S(q,"can not read an implicit mapping pair; a colon is missed");else return q.tag=I,q.anchor=O,!0}else if(l)S(q,"can not read a block mapping entry; a multiline key may not be an implicit key");else return q.tag=I,q.anchor=O,!0}if(q.line===U0||q.lineIndent>M){if(v)N=q.line,k=q.lineStart,F=q.position;if(A6(q,M,H,!0,j))if(v)E=q.result;else f=q.result;if(!v)$6(q,T,P,C,E,f,N,k,F),C=E=f=null;K0(q,!0,-1),p=q.input.charCodeAt(q.position)}if((q.line===U0||q.lineIndent>M)&&p!==0)S(q,"bad indentation of a mapping entry");else if(q.lineIndent<M)break}if(v)$6(q,T,P,C,E,null,N,k,F);if(l)q.tag=I,q.anchor=O,q.kind="mapping",q.result=T;return l}function L1(q){let M=!1,w=!1,j,N,k=q.input.charCodeAt(q.position);if(k!==33)return!1;if(q.tag!==null)S(q,"duplication of a tag property");if(k=q.input.charCodeAt(++q.position),k===60)M=!0,k=q.input.charCodeAt(++q.position);else if(k===33)w=!0,j="!!",k=q.input.charCodeAt(++q.position);else j="!";let F=q.position;if(M){do k=q.input.charCodeAt(++q.position);while(k!==0&&k!==62);if(q.position<q.length)N=q.input.slice(F,q.position),k=q.input.charCodeAt(++q.position);else S(q,"unexpected end of the stream within a verbatim tag")}else{while(k!==0&&!m(k)){if(k===33)if(!w){if(j=q.input.slice(F-1,q.position+1),!R.test(j))S(q,"named tag handle cannot contain such characters");w=!0,F=q.position+1}else S(q,"tag suffix cannot contain exclamation marks");k=q.input.charCodeAt(++q.position)}if(N=q.input.slice(F,q.position),D.test(N))S(q,"tag suffix cannot contain flow indicator characters")}if(N&&!x.test(N))S(q,"tag name cannot contain such characters: "+N);try{N=decodeURIComponent(N)}catch(I){S(q,"tag name is malformed: "+N)}if(M)q.tag=N;else if(Y.call(q.tagMap,j))q.tag=q.tagMap[j]+N;else if(j==="!")q.tag="!"+N;else if(j==="!!")q.tag="tag:yaml.org,2002:"+N;else S(q,'undeclared tag handle "'+j+'"');return!0}function L2(q){let M=q.input.charCodeAt(q.position);if(M!==38)return!1;if(q.anchor!==null)S(q,"duplication of an anchor property");M=q.input.charCodeAt(++q.position);let w=q.position;while(M!==0&&!m(M)&&!b(M))M=q.input.charCodeAt(++q.position);if(q.position===w)S(q,"name of an anchor node must contain at least one character");return q.anchor=q.input.slice(w,q.position),!0}function A2(q){let M=q.input.charCodeAt(q.position);if(M!==42)return!1;M=q.input.charCodeAt(++q.position);let w=q.position;while(M!==0&&!m(M)&&!b(M))M=q.input.charCodeAt(++q.position);if(q.position===w)S(q,"name of an alias node must contain at least one character");let j=q.input.slice(w,q.position);if(!Y.call(q.anchorMap,j))S(q,'unidentified alias "'+j+'"');return q.result=q.anchorMap[j],K0(q,!0,-1),!0}function A1(q,M,w,j){let N=S4(q);if($1(q),X4(q,M),q.tag=null,q.anchor=null,q.kind=null,q.result=null,F2(q,w,j)&&q.kind==="mapping")return p6(q),!0;return F1(q),X4(q,N),!1}function A6(q,M,w,j,N){let k,F,I=1,O=!1,T=!1,P=null,C,E,f;if(q.depth>=q.maxDepth)S(q,"nesting exceeded maxDepth ("+q.maxDepth+")");if(q.depth+=1,q.listener!==null)q.listener("open",q);q.tag=null,q.anchor=null,q.kind=null,q.result=null;let v=k=F=H===w||V===w;if(j){if(K0(q,!0,-1)){if(O=!0,q.lineIndent>M)I=1;else if(q.lineIndent===M)I=0;else if(q.lineIndent<M)I=-1}}if(I===1)while(!0){let l=q.input.charCodeAt(q.position),p=S4(q);if(O&&(l===33&&q.tag!==null||l===38&&q.anchor!==null))break;if(!L1(q)&&!L2(q))break;if(P===null)P=p;if(K0(q,!0,-1)){if(O=!0,F=v,q.lineIndent>M)I=1;else if(q.lineIndent===M)I=0;else if(q.lineIndent<M)I=-1}else F=!1}if(F)F=O||N;if(I===1||H===w){if(U===w||K===w)E=M;else E=M+1;if(f=q.position-q.lineStart,I===1)if(F&&(L6(q,f)||F2(q,f,E))||H2(q,E))T=!0;else{let l=q.input.charCodeAt(q.position);if(P!==null&&v&&!F&&l!==124&&l!==62&&A1(q,P,P.position-P.lineStart,E))T=!0;else if(k&&$2(q,E)||B2(q,E)||b4(q,E))T=!0;else if(A2(q)){if(T=!0,q.tag!==null||q.anchor!==null)S(q,"alias node should not have any properties")}else if(V2(q,E,U===w)){if(T=!0,q.tag===null)q.tag="?"}if(q.anchor!==null)H6(q,q.anchor,q.result)}else if(I===0)T=F&&L6(q,f)}if(q.tag===null){if(q.anchor!==null)H6(q,q.anchor,q.result)}else if(q.tag==="?"){if(q.result!==null&&q.kind!=="scalar")S(q,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+q.kind+'"');for(let l=0,p=q.implicitTypes.length;l<p;l+=1)if(C=q.implicitTypes[l],C.resolve(q.result)){if(q.result=C.construct(q.result),q.tag=C.tag,q.anchor!==null)H6(q,q.anchor,q.result);break}}else if(q.tag!=="!"){if(Y.call(q.typeMap[q.kind||"fallback"],q.tag))C=q.typeMap[q.kind||"fallback"][q.tag];else{C=null;let l=q.typeMap.multi[q.kind||"fallback"];for(let p=0,e=l.length;p<e;p+=1)if(q.tag.slice(0,l[p].tag.length)===l[p].tag){C=l[p];break}}if(!C)S(q,"unknown tag !<"+q.tag+">");if(q.result!==null&&C.kind!==q.kind)S(q,"unacceptable node kind for !<"+q.tag+'> tag; it should be "'+C.kind+'", not "'+q.kind+'"');if(!C.resolve(q.result,q.tag))S(q,"cannot resolve a node with !<"+q.tag+"> explicit tag");else if(q.result=C.construct(q.result,q.tag),q.anchor!==null)H6(q,q.anchor,q.result)}if(q.listener!==null)q.listener("close",q);return q.depth-=1,q.tag!==null||q.anchor!==null||T}function M1(q){let M=q.position,w=!1,j;q.version=null,q.checkLineBreaks=q.legacy,q.tagMap=Object.create(null),q.anchorMap=Object.create(null);while((j=q.input.charCodeAt(q.position))!==0){if(K0(q,!0,-1),j=q.input.charCodeAt(q.position),q.lineIndent>0||j!==37)break;w=!0,j=q.input.charCodeAt(++q.position);let N=q.position;while(j!==0&&!m(j))j=q.input.charCodeAt(++q.position);let k=q.input.slice(N,q.position),F=[];if(k.length<1)S(q,"directive name must not be less than one character in length");while(j!==0){while(i(j))j=q.input.charCodeAt(++q.position);if(j===35){do j=q.input.charCodeAt(++q.position);while(j!==0&&!u(j));break}if(u(j))break;N=q.position;while(j!==0&&!m(j))j=q.input.charCodeAt(++q.position);F.push(q.input.slice(N,q.position))}if(j!==0)Q4(q);if(Y.call(K2,k))K2[k](q,k,F);else c0(q,'unknown document directive "'+k+'"')}if(K0(q,!0,-1),q.lineIndent===0&&q.input.charCodeAt(q.position)===45&&q.input.charCodeAt(q.position+1)===45&&q.input.charCodeAt(q.position+2)===45)q.position+=3,K0(q,!0,-1);else if(w)S(q,"directives end mark is expected");if(A6(q,q.lineIndent-1,H,!1,!0),K0(q,!0,-1),q.checkLineBreaks&&_.test(q.input.slice(M,q.position)))c0(q,"non-ASCII line breaks are interpreted as content");if(q.documents.push(q.result),q.position===q.lineStart&&J4(q)){if(q.input.charCodeAt(q.position)===46)q.position+=3,K0(q,!0,-1);return}if(q.position<q.length-1)S(q,"end of the stream or a document separator is expected")}function M2(q,M){if(q=String(q),M=M||{},q.length!==0){if(q.charCodeAt(q.length-1)!==10&&q.charCodeAt(q.length-1)!==13)q+=`
37
+ `;if(q.charCodeAt(0)===65279)q=q.slice(1)}let w=new o(q,M),j=q.indexOf("\x00");if(j!==-1)w.position=j,S(w,"null byte is not allowed in input");w.input+="\x00";while(w.input.charCodeAt(w.position)===32)w.lineIndent+=1,w.position+=1;while(w.position<w.length-1)M1(w);return w.documents}function I2(q,M,w){if(M!==null&&typeof M==="object"&&typeof w>"u")w=M,M=null;let j=M2(q,w);if(typeof M!=="function")return j;for(let N=0,k=j.length;N<k;N+=1)M(j[N])}function I1(q,M){let w=M2(q,M);if(w.length===0)return;else if(w.length===1)return w[0];throw new Q("expected a single document in the stream, but found more")}W.exports.loadAll=I2,W.exports.load=I1}),HQ=Y0((Z,W)=>{var X=c4(),Q=l4(),J=m1(),G=Object.prototype.toString,Y=Object.prototype.hasOwnProperty,U=65279,K=9,V=10,H=13,B=32,$=33,L=34,A=35,_=37,D=38,R=39,x=42,d=44,u=45,i=58,m=61,b=62,t=63,w0=64,_0=91,s=93,X0=96,q0=123,Q0=124,H0=125,o={};o[0]="\\0",o[7]="\\a",o[8]="\\b",o[9]="\\t",o[10]="\\n",o[11]="\\v",o[12]="\\f",o[13]="\\r",o[27]="\\e",o[34]="\\\"",o[92]="\\\\",o[133]="\\N",o[160]="\\_",o[8232]="\\L",o[8233]="\\P";var G0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],S=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function c0(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],f=String(I[E]);if(E.slice(0,2)==="!!")E="tag:yaml.org,2002:"+E.slice(2);let v=F.compiledTypeMap.fallback[E];if(v&&Y.call(v.styleAliases,f))f=v.styleAliases[f];O[E]=f}return O}function H6(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 $1=1,p6=2;function F1(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=c0(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==='"'?p6:$1,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 S4(F,I){let O=X.repeat(" ",I),T=0,P="",C=F.length;while(T<C){let E,f=F.indexOf(`
38
38
  `,T);if(f===-1)E=F.slice(T),T=C;else E=F.slice(T,f+1),T=f+1;if(E.length&&E!==`
39
39
  `)P+=O;P+=E}return P}function X4(F,I){return`
40
- `+X.repeat(" ",F.indent*I)}function K2(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 g0(F){return F===B||F===K}function O6(F){return F>=32&&F<=126||F>=161&&F<=55295&&F!==8232&&F!==8233||F>=57344&&F<=65533&&F!==U||F>=65536&&F<=1114111}function $6(F){return O6(F)&&F!==U&&F!==H&&F!==V}function Q4(F,I,O){let T=$6(F),P=T&&!g0(F);return(O?T:T&&F!==d&&F!==j0&&F!==s&&F!==q0&&F!==H0)&&F!==A&&!(I===i&&!P)||$6(I)&&!g0(I)&&F===A||I===i&&P}function K0(F){return O6(F)&&F!==U&&!g0(F)&&F!==u&&F!==t&&F!==i&&F!==d&&F!==j0&&F!==s&&F!==q0&&F!==H0&&F!==A&&F!==D&&F!==x&&F!==$&&F!==Q0&&F!==m&&F!==b&&F!==R&&F!==L&&F!==j&&F!==w0&&F!==X0}function J4(F){return!g0(F)&&F!==i}function F6(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 V2(F){return/^\n* /.test(F)}var B2=1,b4=2,H2=3,$2=4,L6=5;function F2(F,I,O,T,P,C,E,f){let v,l=0,p=null,e=!1,U0=!1,V8=T!==-1,v4=-1,y4=K0(F6(F,0))&&J4(F6(F,F.length-1));if(I||E)for(v=0;v<F.length;l>=65536?v+=2:v++){if(l=F6(F,v),!O6(l))return L6;y4=y4&&Q4(l,p,f),p=l}else{for(v=0;v<F.length;l>=65536?v+=2:v++){if(l=F6(F,v),l===V){if(e=!0,V8)U0=U0||v-v4-1>T&&F[v4+1]!==" ",v4=v}else if(!O6(l))return L6;y4=y4&&Q4(l,p,f),p=l}U0=U0||V8&&v-v4-1>T&&F[v4+1]!==" "}if(!e&&!U0){if(y4&&!E&&!P(F))return B2;return C===p6?L6:b4}if(O>9&&V2(F))return L6;if(!E)return U0?$2:H2;return C===p6?L6:b4}function L1(F,I,O,T,P){F.dump=function(){if(I.length===0)return F.quotingType===p6?'""':"''";if(!F.noCompatMode){if(G0.indexOf(I)!==-1||S.test(I))return F.quotingType===p6?'"'+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),f=T||F.flowLevel>-1&&O>=F.flowLevel;function v(l){return K2(F,l)}switch(F2(I,f,F.indent,E,v,F.quotingType,F.forceQuotes&&!T,P)){case B2:return I;case b4:return"'"+I.replace(/'/g,"''")+"'";case H2:return"|"+L2(I,F.indent)+A2(S4(I,C));case $2:return">"+L2(I,F.indent)+A2(S4(A1(I,E),C));case L6:return'"'+M1(I,E)+'"';default:throw new Q("impossible error: invalid scalar style")}}()}function L2(F,I){let O=V2(F)?String(I):"",T=F[F.length-1]===`
40
+ `+X.repeat(" ",F.indent*I)}function K2(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 g0(F){return F===B||F===K}function O6(F){return F>=32&&F<=126||F>=161&&F<=55295&&F!==8232&&F!==8233||F>=57344&&F<=65533&&F!==U||F>=65536&&F<=1114111}function $6(F){return O6(F)&&F!==U&&F!==H&&F!==V}function Q4(F,I,O){let T=$6(F),P=T&&!g0(F);return(O?T:T&&F!==d&&F!==_0&&F!==s&&F!==q0&&F!==H0)&&F!==A&&!(I===i&&!P)||$6(I)&&!g0(I)&&F===A||I===i&&P}function K0(F){return O6(F)&&F!==U&&!g0(F)&&F!==u&&F!==t&&F!==i&&F!==d&&F!==_0&&F!==s&&F!==q0&&F!==H0&&F!==A&&F!==D&&F!==x&&F!==$&&F!==Q0&&F!==m&&F!==b&&F!==R&&F!==L&&F!==_&&F!==w0&&F!==X0}function J4(F){return!g0(F)&&F!==i}function F6(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 V2(F){return/^\n* /.test(F)}var B2=1,b4=2,H2=3,$2=4,L6=5;function F2(F,I,O,T,P,C,E,f){let v,l=0,p=null,e=!1,U0=!1,V8=T!==-1,v4=-1,y4=K0(F6(F,0))&&J4(F6(F,F.length-1));if(I||E)for(v=0;v<F.length;l>=65536?v+=2:v++){if(l=F6(F,v),!O6(l))return L6;y4=y4&&Q4(l,p,f),p=l}else{for(v=0;v<F.length;l>=65536?v+=2:v++){if(l=F6(F,v),l===V){if(e=!0,V8)U0=U0||v-v4-1>T&&F[v4+1]!==" ",v4=v}else if(!O6(l))return L6;y4=y4&&Q4(l,p,f),p=l}U0=U0||V8&&v-v4-1>T&&F[v4+1]!==" "}if(!e&&!U0){if(y4&&!E&&!P(F))return B2;return C===p6?L6:b4}if(O>9&&V2(F))return L6;if(!E)return U0?$2:H2;return C===p6?L6:b4}function L1(F,I,O,T,P){F.dump=function(){if(I.length===0)return F.quotingType===p6?'""':"''";if(!F.noCompatMode){if(G0.indexOf(I)!==-1||S.test(I))return F.quotingType===p6?'"'+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),f=T||F.flowLevel>-1&&O>=F.flowLevel;function v(l){return K2(F,l)}switch(F2(I,f,F.indent,E,v,F.quotingType,F.forceQuotes&&!T,P)){case B2:return I;case b4:return"'"+I.replace(/'/g,"''")+"'";case H2:return"|"+L2(I,F.indent)+A2(S4(I,C));case $2:return">"+L2(I,F.indent)+A2(S4(A1(I,E),C));case L6:return'"'+M1(I,E)+'"';default:throw new Q("impossible error: invalid scalar style")}}()}function L2(F,I){let O=V2(F)?String(I):"",T=F[F.length-1]===`
41
41
  `;return O+(T&&(F[F.length-2]===`
42
42
  `||F===`
43
43
  `)?"+":T?"":"-")+`
@@ -48,11 +48,11 @@ Parsed value is empty`);else return Y}catch(Y){if(!Y&&W.continueOnError)throw ne
48
48
  `:"")+A6(v,I),P=C}return T}function A6(F,I){if(F===""||F[0]===" ")return F;let O=/ [^ ]/g,T,P=0,C,E=0,f=0,v="";while(T=O.exec(F)){if(f=T.index,f-P>I)C=E>P?E:f,v+=`
49
49
  `+F.slice(P,C),P=C+1;E=f}if(v+=`
50
50
  `,F.length-P>I&&E>P)v+=F.slice(P,E)+`
51
- `+F.slice(E+1);else v+=F.slice(P);return v.slice(1)}function M1(F){let I="",O=0;for(let T=0;T<F.length;O>=65536?T+=2:T++){O=F6(F,T);let P=o[O];if(!P&&O6(O)){if(I+=F[T],O>=65536)I+=F[T+1]}else I+=P||H6(O)}return I}function M2(F,I,O){let T="",P=F.tag;for(let C=0,E=O.length;C<E;C+=1){let f=O[C];if(F.replacer)f=F.replacer.call(O,String(C),f);if(w(F,I,f,!1,!1)||typeof f>"u"&&w(F,I,null,!1,!1)){if(T!=="")T+=","+(!F.condenseFlow?" ":"");T+=F.dump}}F.tag=P,F.dump="["+T+"]"}function I2(F,I,O,T){let P="",C=F.tag;for(let E=0,f=O.length;E<f;E+=1){let v=O[E];if(F.replacer)v=F.replacer.call(O,String(E),v);if(w(F,I+1,v,!0,!0,!1,!0)||typeof v>"u"&&w(F,I+1,null,!0,!0,!1,!0)){if(!T||P!=="")P+=X4(F,I);if(F.dump&&V===F.dump.charCodeAt(0))P+="-";else P+="- ";P+=F.dump}}F.tag=C,F.dump=P||"[]"}function I1(F,I,O){let T="",P=F.tag,C=Object.keys(O);for(let E=0,f=C.length;E<f;E+=1){let v="";if(T!=="")v+=", ";if(F.condenseFlow)v+='"';let l=C[E],p=O[l];if(F.replacer)p=F.replacer.call(O,l,p);if(!w(F,I,l,!1,!1))continue;if(F.dump.length>1024)v+="? ";if(v+=F.dump+(F.condenseFlow?'"':"")+":"+(F.condenseFlow?"":" "),!w(F,I,p,!1,!1))continue;v+=F.dump,T+=v}F.tag=P,F.dump="{"+T+"}"}function q(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 f=0,v=E.length;f<v;f+=1){let l="";if(!T||P!=="")l+=X4(F,I);let p=E[f],e=O[p];if(F.replacer)e=F.replacer.call(O,p,e);if(!w(F,I+1,p,!0,!0,!0))continue;let U0=F.tag!==null&&F.tag!=="?"||F.dump&&F.dump.length>1024;if(U0)if(F.dump&&V===F.dump.charCodeAt(0))l+="?";else l+="? ";if(l+=F.dump,U0)l+=X4(F,I);if(!w(F,I+1,e,!0,U0))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 f=F.styleMap[E.tag]||E.defaultStyle,v;if(G.call(E.represent)==="[object Function]")v=E.represent(I,f);else if(Y.call(E.represent,f))v=E.represent[f](I,f);else throw new Q("!<"+E.tag+'> tag resolver accepts not "'+f+'" style');F.dump=v}return!0}}return!1}function w(F,I,O,T,P,C,E){if(F.tag=null,F.dump=O,!M(F,O,!1))M(F,O,!0);let f=G.call(F.dump),v=T;if(T)T=F.flowLevel<0||F.flowLevel>I;let l=f==="[object Object]"||f==="[object Array]",p,e;if(l)p=F.duplicates.indexOf(O),e=p!==-1;if(F.tag!==null&&F.tag!=="?"||e||F.indent!==2&&I>0)P=!1;if(e&&F.usedDuplicates[p])F.dump="*ref_"+p;else{if(l&&e&&!F.usedDuplicates[p])F.usedDuplicates[p]=!0;if(f==="[object Object]"){if(T&&Object.keys(F.dump).length!==0){if(q(F,I,F.dump,P),e)F.dump="&ref_"+p+F.dump}else if(I1(F,I,F.dump),e)F.dump="&ref_"+p+" "+F.dump}else if(f==="[object Array]"){if(T&&F.dump.length!==0){if(F.noArrayIndent&&!E&&I>0)I2(F,I-1,F.dump,P);else I2(F,I,F.dump,P);if(e)F.dump="&ref_"+p+F.dump}else if(M2(F,I,F.dump),e)F.dump="&ref_"+p+" "+F.dump}else if(f==="[object String]"){if(F.tag!=="?")L1(F,F.dump,I,C,v)}else if(f==="[object Undefined]")return!1;else{if(F.skipInvalid)return!1;throw new Q("unacceptable kind of an object to dump "+f)}if(F.tag!==null&&F.tag!=="?"){let U0=encodeURI(F.tag[0]==="!"?F.tag.slice(1):F.tag).replace(/!/g,"%21");if(F.tag[0]==="!")U0="!"+U0;else if(U0.slice(0,18)==="tag:yaml.org,2002:")U0="!!"+U0.slice(18);else U0="!<"+U0+">";F.dump=U0+" "+F.dump}}return!0}function _(F,I){let O=[],T=[];N(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 N(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)N(F[P],I,O);else{let P=Object.keys(F);for(let C=0,E=P.length;C<E;C+=1)N(F[P[C]],I,O)}}}function k(F,I){I=I||{};let O=new F1(I);if(!O.noRefs)_(F,O);let T=F;if(O.replacer)T=O.replacer.call({"":T},"",T);if(w(O,0,T,!0,!0))return O.dump+`
52
- `;return""}W.exports.dump=k}),U5=YQ(Y0((Z,W)=>{var X=qQ(),Q=UQ();function J(G,Y){return function(){throw Error("Function yaml."+G+" is removed in js-yaml 4. Use yaml."+Y+" instead, which is now safe by default.")}}W.exports.Type=x0(),W.exports.Schema=n8(),W.exports.FAILSAFE_SCHEMA=s8(),W.exports.JSON_SCHEMA=W5(),W.exports.CORE_SCHEMA=X5(),W.exports.DEFAULT_SCHEMA=m1(),W.exports.load=X.load,W.exports.loadAll=X.loadAll,W.exports.dump=Q.dump,W.exports.YAMLException=l4(),W.exports.types={binary:G5(),float:Z5(),map:a8(),null:o8(),pairs:z5(),set:q5(),timestamp:Q5(),bool:t8(),int:e8(),merge:J5(),omap:Y5(),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:UB,FAILSAFE_SCHEMA:KB,JSON_SCHEMA:K5,CORE_SCHEMA:VB,DEFAULT_SCHEMA:BB,load:HB,loadAll:$B,dump:FB,YAMLException:LB,types:AB,safeLoad:MB,safeLoadAll:IB,safeDump:NB}=U5.default,u1=U5.default});var V5;var B5=c(()=>{i0();d1();d1();V5={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 u1.load(W,{schema:K5})}catch{try{return u1.load(W)}catch(X){throw new n0(X?.message||"Parser Error",Z.url)}}else return W}}});var KQ,H5;var $5=c(()=>{i0();KQ=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,H5={order:300,allowEmpty:!0,encoding:"utf8",canParse(Z){return(typeof Z.data==="string"||Buffer.isBuffer(Z.data))&&KQ.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 n0("data is not text",Z.url)}}});var VQ,F5;var L5=c(()=>{VQ=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,F5={order:400,allowEmpty:!0,canParse(Z){return Buffer.isBuffer(Z.data)&&VQ.test(Z.url)},parse(Z){if(Buffer.isBuffer(Z.data))return Z.data;else return Buffer.from(Z.data)}}});var c1;var l1=c(()=>{b0();i0();c1={order:100,canRead(Z){return j2(Z.url)},async read(Z){let W,X=await import("fs");try{W=$4(Z.url)}catch(Q){let J=Q;throw J.message=`Malformed URI: ${Z.url}: ${J.message}`,new Z6(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 Z6(J,W)}}}});async function A5(Z,W,X){Z=H4(Z);let Q=X||[];Q.push(Z.href);try{if(W.safeUrlResolver&&_2(Z.href))throw Error(`Unsafe URL blocked by safeUrlResolver: ${Z.href}`);let J=await BQ(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]}.
51
+ `+F.slice(E+1);else v+=F.slice(P);return v.slice(1)}function M1(F){let I="",O=0;for(let T=0;T<F.length;O>=65536?T+=2:T++){O=F6(F,T);let P=o[O];if(!P&&O6(O)){if(I+=F[T],O>=65536)I+=F[T+1]}else I+=P||H6(O)}return I}function M2(F,I,O){let T="",P=F.tag;for(let C=0,E=O.length;C<E;C+=1){let f=O[C];if(F.replacer)f=F.replacer.call(O,String(C),f);if(w(F,I,f,!1,!1)||typeof f>"u"&&w(F,I,null,!1,!1)){if(T!=="")T+=","+(!F.condenseFlow?" ":"");T+=F.dump}}F.tag=P,F.dump="["+T+"]"}function I2(F,I,O,T){let P="",C=F.tag;for(let E=0,f=O.length;E<f;E+=1){let v=O[E];if(F.replacer)v=F.replacer.call(O,String(E),v);if(w(F,I+1,v,!0,!0,!1,!0)||typeof v>"u"&&w(F,I+1,null,!0,!0,!1,!0)){if(!T||P!=="")P+=X4(F,I);if(F.dump&&V===F.dump.charCodeAt(0))P+="-";else P+="- ";P+=F.dump}}F.tag=C,F.dump=P||"[]"}function I1(F,I,O){let T="",P=F.tag,C=Object.keys(O);for(let E=0,f=C.length;E<f;E+=1){let v="";if(T!=="")v+=", ";if(F.condenseFlow)v+='"';let l=C[E],p=O[l];if(F.replacer)p=F.replacer.call(O,l,p);if(!w(F,I,l,!1,!1))continue;if(F.dump.length>1024)v+="? ";if(v+=F.dump+(F.condenseFlow?'"':"")+":"+(F.condenseFlow?"":" "),!w(F,I,p,!1,!1))continue;v+=F.dump,T+=v}F.tag=P,F.dump="{"+T+"}"}function q(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 f=0,v=E.length;f<v;f+=1){let l="";if(!T||P!=="")l+=X4(F,I);let p=E[f],e=O[p];if(F.replacer)e=F.replacer.call(O,p,e);if(!w(F,I+1,p,!0,!0,!0))continue;let U0=F.tag!==null&&F.tag!=="?"||F.dump&&F.dump.length>1024;if(U0)if(F.dump&&V===F.dump.charCodeAt(0))l+="?";else l+="? ";if(l+=F.dump,U0)l+=X4(F,I);if(!w(F,I+1,e,!0,U0))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 f=F.styleMap[E.tag]||E.defaultStyle,v;if(G.call(E.represent)==="[object Function]")v=E.represent(I,f);else if(Y.call(E.represent,f))v=E.represent[f](I,f);else throw new Q("!<"+E.tag+'> tag resolver accepts not "'+f+'" style');F.dump=v}return!0}}return!1}function w(F,I,O,T,P,C,E){if(F.tag=null,F.dump=O,!M(F,O,!1))M(F,O,!0);let f=G.call(F.dump),v=T;if(T)T=F.flowLevel<0||F.flowLevel>I;let l=f==="[object Object]"||f==="[object Array]",p,e;if(l)p=F.duplicates.indexOf(O),e=p!==-1;if(F.tag!==null&&F.tag!=="?"||e||F.indent!==2&&I>0)P=!1;if(e&&F.usedDuplicates[p])F.dump="*ref_"+p;else{if(l&&e&&!F.usedDuplicates[p])F.usedDuplicates[p]=!0;if(f==="[object Object]"){if(T&&Object.keys(F.dump).length!==0){if(q(F,I,F.dump,P),e)F.dump="&ref_"+p+F.dump}else if(I1(F,I,F.dump),e)F.dump="&ref_"+p+" "+F.dump}else if(f==="[object Array]"){if(T&&F.dump.length!==0){if(F.noArrayIndent&&!E&&I>0)I2(F,I-1,F.dump,P);else I2(F,I,F.dump,P);if(e)F.dump="&ref_"+p+F.dump}else if(M2(F,I,F.dump),e)F.dump="&ref_"+p+" "+F.dump}else if(f==="[object String]"){if(F.tag!=="?")L1(F,F.dump,I,C,v)}else if(f==="[object Undefined]")return!1;else{if(F.skipInvalid)return!1;throw new Q("unacceptable kind of an object to dump "+f)}if(F.tag!==null&&F.tag!=="?"){let U0=encodeURI(F.tag[0]==="!"?F.tag.slice(1):F.tag).replace(/!/g,"%21");if(F.tag[0]==="!")U0="!"+U0;else if(U0.slice(0,18)==="tag:yaml.org,2002:")U0="!!"+U0.slice(18);else U0="!<"+U0+">";F.dump=U0+" "+F.dump}}return!0}function j(F,I){let O=[],T=[];N(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 N(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)N(F[P],I,O);else{let P=Object.keys(F);for(let C=0,E=P.length;C<E;C+=1)N(F[P[C]],I,O)}}}function k(F,I){I=I||{};let O=new F1(I);if(!O.noRefs)j(F,O);let T=F;if(O.replacer)T=O.replacer.call({"":T},"",T);if(w(O,0,T,!0,!0))return O.dump+`
52
+ `;return""}W.exports.dump=k}),U5=KQ(Y0((Z,W)=>{var X=BQ(),Q=HQ();function J(G,Y){return function(){throw Error("Function yaml."+G+" is removed in js-yaml 4. Use yaml."+Y+" instead, which is now safe by default.")}}W.exports.Type=x0(),W.exports.Schema=n8(),W.exports.FAILSAFE_SCHEMA=s8(),W.exports.JSON_SCHEMA=W5(),W.exports.CORE_SCHEMA=X5(),W.exports.DEFAULT_SCHEMA=m1(),W.exports.load=X.load,W.exports.loadAll=X.loadAll,W.exports.dump=Q.dump,W.exports.YAMLException=l4(),W.exports.types={binary:G5(),float:Z5(),map:a8(),null:o8(),pairs:z5(),set:q5(),timestamp:Q5(),bool:t8(),int:e8(),merge:J5(),omap:Y5(),seq:r8(),str:i8()},W.exports.safeLoad=J("safeLoad","load"),W.exports.safeLoadAll=J("safeLoadAll","loadAll"),W.exports.safeDump=J("safeDump","dump")})(),1),{Type:BB,Schema:HB,FAILSAFE_SCHEMA:$B,JSON_SCHEMA:K5,CORE_SCHEMA:FB,DEFAULT_SCHEMA:LB,load:AB,loadAll:MB,dump:IB,YAMLException:NB,types:wB,safeLoad:DB,safeLoadAll:TB,safeDump:RB}=U5.default,u1=U5.default});var V5;var B5=c(()=>{i0();d1();d1();V5={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 u1.load(W,{schema:K5})}catch{try{return u1.load(W)}catch(X){throw new n0(X?.message||"Parser Error",Z.url)}}else return W}}});var $Q,H5;var $5=c(()=>{i0();$Q=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,H5={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 n0("data is not text",Z.url)}}});var FQ,F5;var L5=c(()=>{FQ=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,F5={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 c1;var l1=c(()=>{b0();i0();c1={order:100,canRead(Z){return _2(Z.url)},async read(Z){let W,X=await import("fs");try{W=$4(Z.url)}catch(Q){let J=Q;throw J.message=`Malformed URI: ${Z.url}: ${J.message}`,new Z6(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 Z6(J,W)}}}});async function A5(Z,W,X){Z=H4(Z);let Q=X||[];Q.push(Z.href);try{if(W.safeUrlResolver&&j2(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]}.
53
53
  Too many redirects:
54
54
  ${Q.join(`
55
- `)}`);throw G.status=J.status,new Z6(G)}else{let G=HQ(J,"location");if(!G){let U=Error(`HTTP ${J.status} redirect with no location header`);throw U.status=J.status,U}let Y=L0(Z.href,G);return A5(Y,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 Z6(G,Z.href)}}async function BQ(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 HQ(Z,W){return Z.headers.get(W)}var p1;var n1=c(()=>{b0();i0();p1={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return O8(Z.url)&&(!this.safeUrlResolver||!_2(Z.url))},read(Z){let W=H4(Z.url);if(typeof window<"u"&&!W.protocol)W.protocol=H4(location.href).protocol;return A5(W,this)}}});function w5(Z,W){if(M5(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],Y=Z[J];if(M5(G))Z[J]=w5(Y||{},G);else if(G!==void 0)Z[J]=G}}return Z}function M5(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var I5=()=>{return{parse:{json:{...c8},yaml:{...V5},text:{...H5},binary:{...F5}},resolve:{file:{...c1},http:{...p1},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},N5=(Z)=>{let W=I5();if(Z)w5(W,Z);return W};var i1=c(()=>{l8();B5();$5();L5();l1();n1()});function $Q(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=N5(Q)}catch(Y){console.error(`JSON Schema Ref Parser: Error normalizing options: ${Y}`)}if(!Q.mutateInputSchema&&typeof X==="object")X=JSON.parse(JSON.stringify(X));return{path:W,schema:X,options:Q,callback:J}}var p4;var D5=c(()=>{i1();p4=$Q});function FQ(Z,W){if(!W.resolve?.external)return Promise.resolve();try{let X=Z.$refs._root$Ref.dynamicIdScope?O0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=r1(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 r1(Z,W,X,Q,J,G,Y,U){Y||=new Set;let K=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!Y.has(Z)){Y.add(Z);let V=X;if(V0.isExternal$Ref(Z))K.push(LQ(Z,W,V,Q,J,G));let H=Object.keys(Z);for(let B of H){let $=v0.join(W,B),L=Z[B],A=Q&&L&&typeof L==="object"&&!ArrayBuffer.isView(L)?O0(V,L):V;K=K.concat(r1(L,$,A,Q,J,G,Y,U))}}return K}async function LQ(Z,W,X,Q,J,G){let U=G.dereference?.externalReferenceResolution==="root"?r6():Q?X:W,K=L0(U,Z.$ref),V=F0(K),H=J._get$Ref(V);if(H)return Promise.resolve(H.value);try{let B=Z.$ref,$={url:K,baseUrl:U};if(typeof B==="string")$.reference=B;let L=await y2($,J,G),A=J._get$Ref(V),j=r1(L,V+"#",V,A?.dynamicIdScope??!1,J,G,new Set,!0);return Promise.all(j)}catch(B){if(!G?.continueOnError||!G6(B))throw B;if(J._$refs[V])B.source=decodeURI(F0(W)),B.path=E2(Q6(W));return[]}}var T5;var R5=c(()=>{A4();m4();f1();b0();i0();a6();T5=FQ});function AQ(Z,W){let X=Z.$refs._root$Ref.dynamicIdScope?O0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=[];a1(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(MQ(Q,W,J),(W.bundle||{}).optimizeInternalRefs!==!1)wQ(Q,Z.schema)}function a1(Z,W,X,Q,J,G,Y,U,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(V0.isAllowed$Ref(H))P5(Z,W,X,L,J,G,Y,U,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=v0.join(X,j),R=v0.join(G,j),x=H[j],d=J&&x&&typeof x==="object"&&!ArrayBuffer.isView(x)?O0(L,x):L;if(V0.isAllowed$Ref(x))P5(H,j,D,d,J,R,Y,U,K,V);else a1(H,j,D,d,J,R,Y,U,K,V);if(x&&typeof x==="object"&&!Array.isArray(x)){if("$ref"in x)B?.onBundle?.(x.$ref,H[j],H,j)}}}}}function P5(Z,W,X,Q,J,G,Y,U,K,V){let H=W===null?Z:Z[W],B=L0(J?Q:X,H.$ref),$=K._resolve(B,G,V);if($===null)return;let A=v0.parse(G).length,j=F0($.path),D=Q6($.path),R=j!==K._root$Ref.path&&!K._aliases[j],x=Boolean(K._aliases[j])&&$.$ref.value!==K._root$Ref.value,d=V0.isExtended$Ref(H);Y+=$.indirections;let u=IQ(U,Z,W);if(u)if(A<u.depth||Y<u.indirections)NQ(U,u);else return;if(U.push({$ref:H,parent:Z,key:W,pathFromRoot:G,depth:A,file:j,hash:D,value:$.value,circular:$.circular,extended:d,external:R,nestedResource:x,indirections:Y}),!u||R)a1($.value,null,$.path,$.$ref.path,$.$ref.dynamicIdScope,G,Y+1,U,K,V)}function MQ(Z,W,X){Z.sort((Y,U)=>{if(Y.file!==U.file)return Y.file<U.file?-1:1;else if(Y.hash!==U.hash)return Y.hash<U.hash?-1:1;else if(Y.circular!==U.circular)return Y.circular?-1:1;else if(Y.extended!==U.extended)return Y.extended?1:-1;else if(Y.indirections!==U.indirections)return Y.indirections-U.indirections;else if(Y.depth!==U.depth)return Y.depth-U.depth;else{let K=Math.max(Y.pathFromRoot.lastIndexOf("/definitions"),Y.pathFromRoot.lastIndexOf("/$defs")),V=Math.max(U.pathFromRoot.lastIndexOf("/definitions"),U.pathFromRoot.lastIndexOf("/$defs"));if(K!==V)return V-K;else return Y.pathFromRoot.length-U.pathFromRoot.length}});let Q,J,G;for(let Y of Z){let U=W.bundle||{};if(!Y.external){if(U.optimizeInternalRefs!==!1&&!Y.nestedResource)Y.$ref.$ref=Y.hash}else if(Y.file===Q&&Y.hash===J)if(X&&_5(Z,Y))Y.$ref.$ref=X+G;else Y.$ref.$ref=G;else if(Y.file===Q&&Y.hash.indexOf(J+"/")===0){let K=v0.join(G,v0.parse(Y.hash.replace(J,"#")));if(X&&_5(Z,Y))Y.$ref.$ref=X+K;else Y.$ref.$ref=K}else if(Q=Y.file,J=Y.hash,G=Y.pathFromRoot,Y.$ref=Y.parent[Y.key]=V0.dereference(Y.$ref,Y.value,W),Y.circular)Y.$ref.$ref=Y.pathFromRoot}}function IQ(Z,W,X){for(let Q of Z)if(Q&&Q.parent===W&&Q.key===X)return Q;return}function NQ(Z,W){let X=Z.indexOf(W);Z.splice(X,1)}function wQ(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=DQ(W,Q);if(J!==Q)X.$ref.$ref=J}}function DQ(Z,W){if(!W.startsWith("#/"))return W;let X=W.slice(2).split("/"),Q=Z,J=[];for(let Y 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=TQ(Z,Q.$ref),Q===null||Q===void 0||typeof Q!=="object")return W}let U=Y.replace(/~1/g,"/").replace(/~0/g,"~"),K=Array.isArray(Q)?parseInt(U):U;Q=Q[K],J.push(Y)}return"#/"+J.join("/")}function TQ(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,"~"),Y=Array.isArray(Q)?parseInt(G):G;Q=Q[Y]}return Q}function _5(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 j5;var E5=c(()=>{A4();m4();b0();a6();j5=AQ});function RQ(Z,W){let X=Date.now(),Q=Z.$refs._root$Ref.dynamicIdScope?O0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,J=s1(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 s1(Z,W,X,Q,J,G,Y,U,K,V,H,B){let $,L={value:Z,circular:!1};O5(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"||!Y.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!D(J)){G.add(Z),Y.add(Z);let R=X;if(V0.isAllowed$Ref(Z,V))$=C5(Z,W,R,Q,J,G,Y,U,K,V,H,B),L.circular=$.circular,L.value=$.value;else for(let x of Object.keys(Z)){O5(H,V);let d=v0.join(W,x),u=v0.join(J,x);if(D(u))continue;let i=Z[x],m=Q&&i&&typeof i==="object"&&!ArrayBuffer.isView(i)?O0(R,i):R,b;if(V0.isAllowed$Ref(i,V)){if($=C5(i,d,m,Q,u,G,Y,U,K,V,H,B),b=$.circular,Z[x]!==$.value){let t=new Map;if(A?.preservedProperties){if(typeof Z[x]==="object"&&!Array.isArray(Z[x]))A?.preservedProperties.forEach((j0)=>{if(j0 in Z[x])t.set(j0,Z[x][j0])})}let w0=$.value;if(A?.cloneReferences&&!b&&w0&&typeof w0==="object")w0=structuredClone(w0);if(Z[x]=w0,A?.preservedProperties){if(t.size&&typeof Z[x]==="object"&&!Array.isArray(Z[x]))t.forEach((j0,s)=>{Z[x][s]=j0})}A?.onDereference?.(i.$ref,Z[x],Z,x)}}else if(!G.has(i)){if($=s1(i,d,m,Q,u,G,Y,U,K,V,H,B+1),b=$.circular,Z[x]!==$.value)Z[x]=$.value}else b=g2(d,K,V);L.circular=L.circular||b}G.delete(Z)}}return L}function C5(Z,W,X,Q,J,G,Y,U,K,V,H,B){let A=V0.isExternal$Ref(Z)&&V?.dereference?.externalReferenceResolution==="root"?r6():Q?X:W,j=L0(A,Z.$ref),D=U.get(j);if(D){if(!D.circular){let m=Object.keys(Z);if(m.length>1){let b={};for(let t of m)if(t!=="$ref"&&!(t in D.value))b[t]=Z[t];return{circular:D.circular,value:Object.assign({},D.value,b)}}return D}if(typeof D.value==="object"&&"$ref"in D.value&&"$ref"in Z){if(D.value.$ref===Z.$ref)return g2(W,K,V),D}else return g2(W,K,V),D}let R=K._resolve(j,W,V);if(R===null)return{circular:!1,value:null};let x=R.circular,d=x||G.has(R.value);if(d)g2(W,K,V);let u=V0.dereference(Z,R.value,V);if(!d){let m=s1(u,R.path,R.$ref.path,R.$ref.dynamicIdScope,J,G,Y,U,K,V,H,B+1);d=m.circular,u=m.value}if(d&&!x&&V.dereference?.circular==="ignore")u=Z;if(x)u.$ref=J;let i={circular:d,value:u};if(Object.keys(Z).length===1)U.set(j,i);return i}function O5(Z,W){if(W&&W.timeoutMs){if(Date.now()-Z>W.timeoutMs)throw new S1(W.timeoutMs)}}function g2(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 x5;var k5=c(()=>{A4();m4();b0();a6();i0();x5=RQ});function PQ(){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 o1;var S5=c(()=>{o1=PQ()});function u0(Z,W){if(Z){W.then(function(X){o1(function(){Z(null,X)})},function(X){o1(function(){Z(X)})});return}else return W}var b5=c(()=>{S5()});class D6{schema=null;$refs=new d4;async parse(){let Z=p4(arguments),W;if(!Z.path&&!Z.schema){let Q=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return u0(Z.callback,Promise.reject(Q))}this.schema=null,this.$refs=new d4;let X="http";if(j2(Z.path))Z.path=b8(Z.path),X="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let Q=H4(Z.schema.$id),J=Q.port??(Q.protocol==="https:"?443:80);Z.path=`${Q.protocol}//${Q.hostname}:${J}`}if(Z.path=L0(r6(),Z.path),Z.schema&&typeof Z.schema==="object"){let Q=this.$refs._add(Z.path);Q.value=Z.schema,Q.pathType=X,Q.dynamicIdScope=k2(Q.value),S2(this.$refs,Q.path,Q.value,Q.pathType,Q.dynamicIdScope),W=Promise.resolve(Z.schema)}else W=y2(Z.path,this.$refs,Z.options);try{let Q=await W;if(Q!==null&&typeof Q==="object"&&!Buffer.isBuffer(Q))return this.schema=Q,u0(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,u0(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||!G6(Q))return u0(Z.callback,Promise.reject(Q));if(this.$refs._$refs[F0(Z.path)])this.$refs._$refs[F0(Z.path)].addError(Q);return u0(Z.callback,Promise.resolve(null))}}static parse(){let Z=new D6;return Z.parse.apply(Z,arguments)}async resolve(){let Z=p4(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await T5(this,Z.options),t1(this),u0(Z.callback,Promise.resolve(this.$refs))}catch(W){return u0(Z.callback,Promise.reject(W))}}static resolve(){let Z=new D6;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new D6;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=p4(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),j5(this,Z.options),t1(this),u0(Z.callback,Promise.resolve(this.schema))}catch(W){return u0(Z.callback,Promise.reject(W))}}static dereference(){let Z=new D6;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=p4(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),x5(this,Z.options),t1(this),u0(Z.callback,Promise.resolve(this.schema))}catch(W){return u0(Z.callback,Promise.reject(W))}}}function t1(Z){if(F4.getParserErrors(Z).length>0)throw new F4(Z)}var IH,NH,wH,v5;var y5=c(()=>{u8();f1();D5();R5();E5();k5();b0();l1();n1();i0();b5();a6();i1();b0();IH=D6.parse,NH=D6.resolve,wH=D6.bundle,v5=D6.dereference});async function n4(Z,W={}){let{baseUrl:X="/_jx/server"}=W,Q=await v5(Z),J=P2(Q);if(J.length===0)return null;let G=J.map(({exportName:U,src:K})=>`import { ${U} } from '${K}'`).join(`
55
+ `)}`);throw G.status=J.status,new Z6(G)}else{let G=AQ(J,"location");if(!G){let U=Error(`HTTP ${J.status} redirect with no location header`);throw U.status=J.status,U}let Y=L0(Z.href,G);return A5(Y,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 Z6(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 p1;var n1=c(()=>{b0();i0();p1={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return O8(Z.url)&&(!this.safeUrlResolver||!j2(Z.url))},read(Z){let W=H4(Z.url);if(typeof window<"u"&&!W.protocol)W.protocol=H4(location.href).protocol;return A5(W,this)}}});function w5(Z,W){if(M5(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],Y=Z[J];if(M5(G))Z[J]=w5(Y||{},G);else if(G!==void 0)Z[J]=G}}return Z}function M5(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var I5=()=>{return{parse:{json:{...c8},yaml:{...V5},text:{...H5},binary:{...F5}},resolve:{file:{...c1},http:{...p1},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},N5=(Z)=>{let W=I5();if(Z)w5(W,Z);return W};var i1=c(()=>{l8();B5();$5();L5();l1();n1()});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=N5(Q)}catch(Y){console.error(`JSON Schema Ref Parser: Error normalizing options: ${Y}`)}if(!Q.mutateInputSchema&&typeof X==="object")X=JSON.parse(JSON.stringify(X));return{path:W,schema:X,options:Q,callback:J}}var p4;var D5=c(()=>{i1();p4=MQ});function IQ(Z,W){if(!W.resolve?.external)return Promise.resolve();try{let X=Z.$refs._root$Ref.dynamicIdScope?O0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=r1(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 r1(Z,W,X,Q,J,G,Y,U){Y||=new Set;let K=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!Y.has(Z)){Y.add(Z);let V=X;if(V0.isExternal$Ref(Z))K.push(NQ(Z,W,V,Q,J,G));let H=Object.keys(Z);for(let B of H){let $=v0.join(W,B),L=Z[B],A=Q&&L&&typeof L==="object"&&!ArrayBuffer.isView(L)?O0(V,L):V;K=K.concat(r1(L,$,A,Q,J,G,Y,U))}}return K}async function NQ(Z,W,X,Q,J,G){let U=G.dereference?.externalReferenceResolution==="root"?r6():Q?X:W,K=L0(U,Z.$ref),V=F0(K),H=J._get$Ref(V);if(H)return Promise.resolve(H.value);try{let B=Z.$ref,$={url:K,baseUrl:U};if(typeof B==="string")$.reference=B;let L=await y2($,J,G),A=J._get$Ref(V),_=r1(L,V+"#",V,A?.dynamicIdScope??!1,J,G,new Set,!0);return Promise.all(_)}catch(B){if(!G?.continueOnError||!G6(B))throw B;if(J._$refs[V])B.source=decodeURI(F0(W)),B.path=E2(Q6(W));return[]}}var T5;var R5=c(()=>{A4();m4();f1();b0();i0();a6();T5=IQ});function wQ(Z,W){let X=Z.$refs._root$Ref.dynamicIdScope?O0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,Q=[];a1(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 a1(Z,W,X,Q,J,G,Y,U,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(V0.isAllowed$Ref(H))P5(Z,W,X,L,J,G,Y,U,K,V);else{let A=Object.keys(H).sort((_,D)=>{if(_==="definitions"||_==="$defs")return-1;else if(D==="definitions"||D==="$defs")return 1;else return _.length-D.length});for(let _ of A){let D=v0.join(X,_),R=v0.join(G,_),x=H[_],d=J&&x&&typeof x==="object"&&!ArrayBuffer.isView(x)?O0(L,x):L;if(V0.isAllowed$Ref(x))P5(H,_,D,d,J,R,Y,U,K,V);else a1(H,_,D,d,J,R,Y,U,K,V);if(x&&typeof x==="object"&&!Array.isArray(x)){if("$ref"in x)B?.onBundle?.(x.$ref,H[_],H,_)}}}}}function P5(Z,W,X,Q,J,G,Y,U,K,V){let H=W===null?Z:Z[W],B=L0(J?Q:X,H.$ref),$=K._resolve(B,G,V);if($===null)return;let A=v0.parse(G).length,_=F0($.path),D=Q6($.path),R=_!==K._root$Ref.path&&!K._aliases[_],x=Boolean(K._aliases[_])&&$.$ref.value!==K._root$Ref.value,d=V0.isExtended$Ref(H);Y+=$.indirections;let u=TQ(U,Z,W);if(u)if(A<u.depth||Y<u.indirections)RQ(U,u);else return;if(U.push({$ref:H,parent:Z,key:W,pathFromRoot:G,depth:A,file:_,hash:D,value:$.value,circular:$.circular,extended:d,external:R,nestedResource:x,indirections:Y}),!u||R)a1($.value,null,$.path,$.$ref.path,$.$ref.dynamicIdScope,G,Y+1,U,K,V)}function DQ(Z,W,X){Z.sort((Y,U)=>{if(Y.file!==U.file)return Y.file<U.file?-1:1;else if(Y.hash!==U.hash)return Y.hash<U.hash?-1:1;else if(Y.circular!==U.circular)return Y.circular?-1:1;else if(Y.extended!==U.extended)return Y.extended?1:-1;else if(Y.indirections!==U.indirections)return Y.indirections-U.indirections;else if(Y.depth!==U.depth)return Y.depth-U.depth;else{let K=Math.max(Y.pathFromRoot.lastIndexOf("/definitions"),Y.pathFromRoot.lastIndexOf("/$defs")),V=Math.max(U.pathFromRoot.lastIndexOf("/definitions"),U.pathFromRoot.lastIndexOf("/$defs"));if(K!==V)return V-K;else return Y.pathFromRoot.length-U.pathFromRoot.length}});let Q,J,G;for(let Y of Z){let U=W.bundle||{};if(!Y.external){if(U.optimizeInternalRefs!==!1&&!Y.nestedResource)Y.$ref.$ref=Y.hash}else if(Y.file===Q&&Y.hash===J)if(X&&j5(Z,Y))Y.$ref.$ref=X+G;else Y.$ref.$ref=G;else if(Y.file===Q&&Y.hash.indexOf(J+"/")===0){let K=v0.join(G,v0.parse(Y.hash.replace(J,"#")));if(X&&j5(Z,Y))Y.$ref.$ref=X+K;else Y.$ref.$ref=K}else if(Q=Y.file,J=Y.hash,G=Y.pathFromRoot,Y.$ref=Y.parent[Y.key]=V0.dereference(Y.$ref,Y.value,W),Y.circular)Y.$ref.$ref=Y.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=jQ(W,Q);if(J!==Q)X.$ref.$ref=J}}function jQ(Z,W){if(!W.startsWith("#/"))return W;let X=W.slice(2).split("/"),Q=Z,J=[];for(let Y 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=_Q(Z,Q.$ref),Q===null||Q===void 0||typeof Q!=="object")return W}let U=Y.replace(/~1/g,"/").replace(/~0/g,"~"),K=Array.isArray(Q)?parseInt(U):U;Q=Q[K],J.push(Y)}return"#/"+J.join("/")}function _Q(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,"~"),Y=Array.isArray(Q)?parseInt(G):G;Q=Q[Y]}return Q}function j5(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 _5;var E5=c(()=>{A4();m4();b0();a6();_5=wQ});function EQ(Z,W){let X=Date.now(),Q=Z.$refs._root$Ref.dynamicIdScope?O0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,J=s1(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 s1(Z,W,X,Q,J,G,Y,U,K,V,H,B){let $,L={value:Z,circular:!1};O5(H,V);let A=V.dereference||{},_=A.maxDepth??500;if(B>_)throw RangeError(`Maximum dereference depth (${_}) 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"||!Y.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!D(J)){G.add(Z),Y.add(Z);let R=X;if(V0.isAllowed$Ref(Z,V))$=C5(Z,W,R,Q,J,G,Y,U,K,V,H,B),L.circular=$.circular,L.value=$.value;else for(let x of Object.keys(Z)){O5(H,V);let d=v0.join(W,x),u=v0.join(J,x);if(D(u))continue;let i=Z[x],m=Q&&i&&typeof i==="object"&&!ArrayBuffer.isView(i)?O0(R,i):R,b;if(V0.isAllowed$Ref(i,V)){if($=C5(i,d,m,Q,u,G,Y,U,K,V,H,B),b=$.circular,Z[x]!==$.value){let t=new Map;if(A?.preservedProperties){if(typeof Z[x]==="object"&&!Array.isArray(Z[x]))A?.preservedProperties.forEach((_0)=>{if(_0 in Z[x])t.set(_0,Z[x][_0])})}let w0=$.value;if(A?.cloneReferences&&!b&&w0&&typeof w0==="object")w0=structuredClone(w0);if(Z[x]=w0,A?.preservedProperties){if(t.size&&typeof Z[x]==="object"&&!Array.isArray(Z[x]))t.forEach((_0,s)=>{Z[x][s]=_0})}A?.onDereference?.(i.$ref,Z[x],Z,x)}}else if(!G.has(i)){if($=s1(i,d,m,Q,u,G,Y,U,K,V,H,B+1),b=$.circular,Z[x]!==$.value)Z[x]=$.value}else b=g2(d,K,V);L.circular=L.circular||b}G.delete(Z)}}return L}function C5(Z,W,X,Q,J,G,Y,U,K,V,H,B){let A=V0.isExternal$Ref(Z)&&V?.dereference?.externalReferenceResolution==="root"?r6():Q?X:W,_=L0(A,Z.$ref),D=U.get(_);if(D){if(!D.circular){let m=Object.keys(Z);if(m.length>1){let b={};for(let t of m)if(t!=="$ref"&&!(t in D.value))b[t]=Z[t];return{circular:D.circular,value:Object.assign({},D.value,b)}}return D}if(typeof D.value==="object"&&"$ref"in D.value&&"$ref"in Z){if(D.value.$ref===Z.$ref)return g2(W,K,V),D}else return g2(W,K,V),D}let R=K._resolve(_,W,V);if(R===null)return{circular:!1,value:null};let x=R.circular,d=x||G.has(R.value);if(d)g2(W,K,V);let u=V0.dereference(Z,R.value,V);if(!d){let m=s1(u,R.path,R.$ref.path,R.$ref.dynamicIdScope,J,G,Y,U,K,V,H,B+1);d=m.circular,u=m.value}if(d&&!x&&V.dereference?.circular==="ignore")u=Z;if(x)u.$ref=J;let i={circular:d,value:u};if(Object.keys(Z).length===1)U.set(_,i);return i}function O5(Z,W){if(W&&W.timeoutMs){if(Date.now()-Z>W.timeoutMs)throw new S1(W.timeoutMs)}}function g2(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 x5;var k5=c(()=>{A4();m4();b0();a6();i0();x5=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 o1;var S5=c(()=>{o1=CQ()});function u0(Z,W){if(Z){W.then(function(X){o1(function(){Z(null,X)})},function(X){o1(function(){Z(X)})});return}else return W}var b5=c(()=>{S5()});class D6{schema=null;$refs=new d4;async parse(){let Z=p4(arguments),W;if(!Z.path&&!Z.schema){let Q=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return u0(Z.callback,Promise.reject(Q))}this.schema=null,this.$refs=new d4;let X="http";if(_2(Z.path))Z.path=b8(Z.path),X="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let Q=H4(Z.schema.$id),J=Q.port??(Q.protocol==="https:"?443:80);Z.path=`${Q.protocol}//${Q.hostname}:${J}`}if(Z.path=L0(r6(),Z.path),Z.schema&&typeof Z.schema==="object"){let Q=this.$refs._add(Z.path);Q.value=Z.schema,Q.pathType=X,Q.dynamicIdScope=k2(Q.value),S2(this.$refs,Q.path,Q.value,Q.pathType,Q.dynamicIdScope),W=Promise.resolve(Z.schema)}else W=y2(Z.path,this.$refs,Z.options);try{let Q=await W;if(Q!==null&&typeof Q==="object"&&!Buffer.isBuffer(Q))return this.schema=Q,u0(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,u0(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||!G6(Q))return u0(Z.callback,Promise.reject(Q));if(this.$refs._$refs[F0(Z.path)])this.$refs._$refs[F0(Z.path)].addError(Q);return u0(Z.callback,Promise.resolve(null))}}static parse(){let Z=new D6;return Z.parse.apply(Z,arguments)}async resolve(){let Z=p4(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await T5(this,Z.options),t1(this),u0(Z.callback,Promise.resolve(this.$refs))}catch(W){return u0(Z.callback,Promise.reject(W))}}static resolve(){let Z=new D6;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new D6;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=p4(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),_5(this,Z.options),t1(this),u0(Z.callback,Promise.resolve(this.schema))}catch(W){return u0(Z.callback,Promise.reject(W))}}static dereference(){let Z=new D6;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=p4(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),x5(this,Z.options),t1(this),u0(Z.callback,Promise.resolve(this.schema))}catch(W){return u0(Z.callback,Promise.reject(W))}}}function t1(Z){if(F4.getParserErrors(Z).length>0)throw new F4(Z)}var TH,RH,PH,v5;var y5=c(()=>{u8();f1();D5();R5();E5();k5();b0();l1();n1();i0();b5();a6();i1();b0();TH=D6.parse,RH=D6.resolve,PH=D6.bundle,v5=D6.dereference});async function n4(Z,W={}){let{baseUrl:X="/_jx/server"}=W,Q=await v5(Z),J=P2(Q);if(J.length===0)return null;let G=J.map(({exportName:U,src:K})=>`import { ${U} } from '${K}'`).join(`
56
56
  `),Y=J.map(({exportName:U})=>g5(U,X)).join(`
57
57
  `);return`// Generated by @jxsuite/compiler — do not edit manually
58
58
  // Deploy as a Cloudflare Worker, Node server, or Bun process.
@@ -86,7 +86,7 @@ app.post('${W}/${Z}', async (c) => {
86
86
  } catch (e) {
87
87
  return c.json({ ok: false, error: e?.message ?? 'Server error' }, 500)
88
88
  }
89
- })`}var Z3=c(()=>{y5();y6()});function T6(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}: ${T6(J)}`,{cause:J})}if(!h0(Q))throw Error(`Invalid ${X} at ${W}: expected a JSON object`);return Q}function g6(Z,W){return W3(Z,W,"Jx document")}function h5(Z,W){return W3(Z,W,"project config")}function f5(Z,W){return W3(Z,W,"class definition")}var R6=c(()=>{X6()});class d5{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=jQ(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,Y=G?.[X.identifier];if(typeof Y!=="function")throw TypeError(`Format class "${this.name}": implementation export "${J}" has no static "${X.identifier}" method`);return await Y.call(G,...W)}}class c5{#Z;constructor(Z){this.#Z=Z;for(let W of u5){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=m5(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=m5(Z);return this.#Z.some((X)=>X.extensions.includes(W))}}async function l5(Z,W,X){let Q=[];for(let[J,G]of Object.entries(Z??{})){if(typeof G!=="string"||!G.endsWith(".class.json"))continue;let Y,U;try{Y=X?W.resolvePath(X,G):G,U=await W.loadJson(Y)}catch{continue}if(!U||typeof U!=="object")continue;if(!U.format||!Array.isArray(U.format.extensions))continue;Q.push(new d5(J,Y,U,W))}return new c5(Q)}function jQ(Z){let W={},X=Z.$defs?.methods??{};for(let[Q,J]of Object.entries(X)){let G=J.role;if(!G||!u5.includes(G))continue;W[G]={identifier:J.identifier??Q,timing:J.timing??_Q}}return W}function m5(Z){let W=Z.toLowerCase();return W.startsWith(".")?W:`.${W}`}var u5,_Q;var p5=c(()=>{u5=["parse","serialize","discover","load"],_Q=["compiler","server"]});var J3={};N2(J3,{unknownFormatError:()=>Q3,importImplementation:()=>f2,createNodeFormatIO:()=>i5,buildProjectFormatRegistry:()=>i4});import{readFileSync as EQ}from"node:fs";import{dirname as CQ,isAbsolute as OQ,resolve as X3,sep as h2}from"node:path";import{pathToFileURL as xQ}from"node:url";import{createRequire as n5}from"node:module";async function f2(Z){let W=[Z],X=`${h2}src${h2}`,Q=`${h2}dist${h2}`;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(xQ(G).href)}catch(Y){J=Y}throw J instanceof Error?J:Error(String(J))}function i5(Z){return{importModule:(W)=>f2(W),loadJson:async(W)=>JSON.parse(EQ(W,"utf8")),resolvePath:(W,X)=>{if(X.startsWith("./")||X.startsWith("../"))return X3(CQ(W),X);if(OQ(X))return X;let Q=n5(X3(Z,"package.json"));try{return Q.resolve(X)}catch{return n5(import.meta.url).resolve(X)}}}}async function i4(Z,W){return l5(W?.imports,i5(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 M4=c(()=>{p5()});async function u2(Z,W={}){let{resolveElementPath:X,$media:Q,formats:J}=W,G=[],Y=new Set;async function U(K,V){let H,B;if(typeof K==="string"){let{readFileSync:d}=await import("node:fs"),{resolve:u}=await import("node:path");if(B=V?u(V,K):u(K),Y.has(B))return;if(Y.add(B),B.endsWith(".json"))H=g6(d(B,"utf8"),B);else{let{extname:i}=await import("node:path"),m=i(B).toLowerCase(),b=J?.byExtension?.(m,"parse");if(!b){let{unknownFormatError:t}=await Promise.resolve().then(() => (M4(),J3));throw t(B,m)}H=await b.call("parse",d(B,"utf8"))}}else{if(H=K,B=null,H.tagName&&Y.has(H.tagName))return;if(H.tagName)Y.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 d of H.$elements){let u=f0(d)?d.$ref:d;if(typeof u!=="string")continue;if(A)await U(u,A);let i=X?X(u,A):u.replace(/\.json$/,".js");j.push(i)}let D=R2($);if(Q)H.$media={...Q,...H.$media};let R=r4(H,D,j),x=B?B.replace(/\.json$/,".js"):`${$}.js`;G.push({content:R,path:x,tagName:$})}return await U(Z,W.basePath??null),{files:G}}async function kQ(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 u2(Z,W),Y=G.files.at(-1);if(!Y)throw Error("compileElementPage: no element modules were produced");let{basename:U}=await import("node:path"),K=U(Y.path),V=`<!DOCTYPE html>
89
+ })`}var Z3=c(()=>{y5();y6()});function T6(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}: ${T6(J)}`,{cause:J})}if(!h0(Q))throw Error(`Invalid ${X} at ${W}: expected a JSON object`);return Q}function g6(Z,W){return W3(Z,W,"Jx document")}function h5(Z,W){return W3(Z,W,"project config")}function f5(Z,W){return W3(Z,W,"class definition")}var R6=c(()=>{X6()});class d5{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,Y=G?.[X.identifier];if(typeof Y!=="function")throw TypeError(`Format class "${this.name}": implementation export "${J}" has no static "${X.identifier}" method`);return await Y.call(G,...W)}}class c5{#Z;constructor(Z){this.#Z=Z;for(let W of u5){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=m5(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=m5(Z);return this.#Z.some((X)=>X.extensions.includes(W))}}async function l5(Z,W,X){let Q=[];for(let[J,G]of Object.entries(Z??{})){if(typeof G!=="string"||!G.endsWith(".class.json"))continue;let Y,U;try{Y=X?W.resolvePath(X,G):G,U=await W.loadJson(Y)}catch{continue}if(!U||typeof U!=="object")continue;if(!U.format||!Array.isArray(U.format.extensions))continue;Q.push(new d5(J,Y,U,W))}return new c5(Q)}function xQ(Z){let W={},X=Z.$defs?.methods??{};for(let[Q,J]of Object.entries(X)){let G=J.role;if(!G||!u5.includes(G))continue;W[G]={identifier:J.identifier??Q,timing:J.timing??OQ}}return W}function m5(Z){let W=Z.toLowerCase();return W.startsWith(".")?W:`.${W}`}var u5,OQ;var p5=c(()=>{u5=["parse","serialize","discover","load"],OQ=["compiler","server"]});var J3={};N2(J3,{unknownFormatError:()=>Q3,importImplementation:()=>f2,createNodeFormatIO:()=>i5,buildProjectFormatRegistry:()=>i4});import{readFileSync as kQ}from"node:fs";import{dirname as SQ,isAbsolute as bQ,resolve as X3,sep as h2}from"node:path";import{pathToFileURL as vQ}from"node:url";import{createRequire as n5}from"node:module";async function f2(Z){let W=[Z],X=`${h2}src${h2}`,Q=`${h2}dist${h2}`;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(Y){J=Y}throw J instanceof Error?J:Error(String(J))}function i5(Z){return{importModule:(W)=>f2(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=n5(X3(Z,"package.json"));try{return Q.resolve(X)}catch{return n5(import.meta.url).resolve(X)}}}}async function i4(Z,W){return l5(W?.imports,i5(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 M4=c(()=>{p5()});async function u2(Z,W={}){let{resolveElementPath:X,$media:Q,formats:J}=W,G=[],Y=new Set;async function U(K,V){let H,B;if(typeof K==="string"){let{readFileSync:d}=await import("node:fs"),{resolve:u}=await import("node:path");if(B=V?u(V,K):u(K),Y.has(B))return;if(Y.add(B),B.endsWith(".json"))H=g6(d(B,"utf8"),B);else{let{extname:i}=await import("node:path"),m=i(B).toLowerCase(),b=J?.byExtension?.(m,"parse");if(!b){let{unknownFormatError:t}=await Promise.resolve().then(() => (M4(),J3));throw t(B,m)}H=await b.call("parse",d(B,"utf8"))}}else{if(H=K,B=null,H.tagName&&Y.has(H.tagName))return;if(H.tagName)Y.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,_=[];if(Array.isArray(H.$elements))for(let d of H.$elements){let u=f0(d)?d.$ref:d;if(typeof u!=="string")continue;if(A)await U(u,A);let i=X?X(u,A):u.replace(/\.json$/,".js");_.push(i)}let D=R2($);if(Q)H.$media={...Q,...H.$media};let R=r4(H,D,_),x=B?B.replace(/\.json$/,".js"):`${$}.js`;G.push({content:R,path:x,tagName:$})}return await U(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 u2(Z,W),Y=G.files.at(-1);if(!Y)throw Error("compileElementPage: no element modules were produced");let{basename:U}=await import("node:path"),K=U(Y.path),V=`<!DOCTYPE html>
90
90
  <html lang="en">
91
91
  <head>
92
92
  <meta charset="utf-8">
@@ -105,9 +105,9 @@ app.post('${W}/${Z}', async (c) => {
105
105
  <${Y.tagName}></${Y.tagName}>
106
106
  <script type="module" src="./${K}"></script>
107
107
  </body>
108
- </html>`;return{files:G.files,html:V}}function SQ(Z){if(Z===null||typeof Z!=="object"||Array.isArray(Z))return JSON.stringify(Z);if("default"in Z)return JSON.stringify(Z.default);if(k6(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,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 Y=[],U=[],K=[];for(let[B,$]of Object.entries(G)){let L=$;if(t0(L)){let A=L.$expression;if(x6(A.operator))K.push([B,L]);else U.push([B,L])}else if(I6(L))if(typeof L.body==="string"&&L.body.includes("return"))U.push([B,L]);else K.push([B,L]);else{let A=SQ(L);if(A!==void 0)Y.push([B,A])}}Q.push(" this.state = reactive({");for(let[B,$]of Y)Q.push(` ${B}: ${$},`);Q.push(" });");for(let[B,$]of K)if(Q.push(""),t0($)){let L=p0($.$expression,{eventParam:"e",statePrefix:"s"});Q.push(` this.state.${B} = (s, e) => { ${L}; };`)}else{let A=($.parameters?S6($.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 U)if(Q.push(""),t0($)){let L=p0($.$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)v6($,V,Z.$media??{},"",B,Z.tagName)}if(Q.push(" template() {"," const s = this.state;"," return html`",Y3(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=S0($);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=o5(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(`
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(k6(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,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 Y=[],U=[],K=[];for(let[B,$]of Object.entries(G)){let L=$;if(t0(L)){let A=L.$expression;if(x6(A.operator))K.push([B,L]);else U.push([B,L])}else if(I6(L))if(typeof L.body==="string"&&L.body.includes("return"))U.push([B,L]);else K.push([B,L]);else{let A=gQ(L);if(A!==void 0)Y.push([B,A])}}Q.push(" this.state = reactive({");for(let[B,$]of Y)Q.push(` ${B}: ${$},`);Q.push(" });");for(let[B,$]of K)if(Q.push(""),t0($)){let L=p0($.$expression,{eventParam:"e",statePrefix:"s"});Q.push(` this.state.${B} = (s, e) => { ${L}; };`)}else{let A=($.parameters?S6($.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 U)if(Q.push(""),t0($)){let L=p0($.$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)v6($,V,Z.$media??{},"",B,Z.tagName)}if(Q.push(" template() {"," const s = this.state;"," return html`",Y3(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=S0($);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,(_,D)=>`\${${D.replaceAll("state.","this.state.")}}`);Q.push(` this.style['${$}'] = \`${A}\`;`)}Q.push(" });")}}let H=o5(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
109
  `)}function Y3(Z,W,X){if(!Z)return"";if(R0(Z))return r5(Z,X);if(!Array.isArray(Z))return"";return Z.map((Q)=>R0(Q)?r5(Q,X):a5(Q,X)).join(`
110
- `)}function a5(Z,W){if(typeof Z==="string"){if(Z.includes("${"))return`${W}${G3(Z)}`;return`${W}${Z0(Z)}`}if(typeof Z==="number"||typeof Z==="boolean")return`${W}${Z0(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"&&f0(V))Q.push(`${K}="\${${P6(V.$ref)}}"`);else if(typeof V==="string"&&V.includes("${"))Q.push(`${K}="${m2(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(b6.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}="\${${P6(V.$ref)}}"`);else if(typeof V==="string"&&V.includes("${"))Q.push(`.${K}="${m2(V)}"`)}if(Z.$props)for(let[K,V]of Object.entries(Z.$props))if(V&&typeof V==="object"&&V.$ref)Q.push(`.${K}="\${${P6(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) => ${P6(V.$ref)}(s, e)}"`);else if(V&&typeof V==="object"&&"$expression"in V){let B=p0(V.$expression,{eventParam:"e",statePrefix:"s"});Q.push(`@${H}="\${(e) => { ${B}; }}"`)}else if(I6(V))Q.push(`@${H}="\${(e) => { ${vQ(V)} }}"`)}let J=s5(Z.style);if(J)Q.push(`style="${J}"`);let G=Q.length>0?`
110
+ `)}function a5(Z,W){if(typeof Z==="string"){if(Z.includes("${"))return`${W}${G3(Z)}`;return`${W}${Z0(Z)}`}if(typeof Z==="number"||typeof Z==="boolean")return`${W}${Z0(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"&&f0(V))Q.push(`${K}="\${${P6(V.$ref)}}"`);else if(typeof V==="string"&&V.includes("${"))Q.push(`${K}="${m2(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(b6.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}="\${${P6(V.$ref)}}"`);else if(typeof V==="string"&&V.includes("${"))Q.push(`.${K}="${m2(V)}"`)}if(Z.$props)for(let[K,V]of Object.entries(Z.$props))if(V&&typeof V==="object"&&V.$ref)Q.push(`.${K}="\${${P6(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) => ${P6(V.$ref)}(s, e)}"`);else if(V&&typeof V==="object"&&"$expression"in V){let B=p0(V.$expression,{eventParam:"e",statePrefix:"s"});Q.push(`@${H}="\${(e) => { ${B}; }}"`)}else if(I6(V))Q.push(`@${H}="\${(e) => { ${fQ(V)} }}"`)}let J=s5(Z.style);if(J)Q.push(`style="${J}"`);let G=Q.length>0?`
111
111
  ${W} ${Q.join(`
112
112
  ${W} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(X))return`${W}<${X}${G}
113
113
  ${W}>`;let U="";if(Z.$switch){let K=f0(Z.$switch)?Z.$switch.$ref:Z.$switch,V=P6(K),H=Z.cases??{},B=[];for(let[$,L]of Object.entries(H)){if(!L||f0(L))continue;let A=a5(L,`${W} `);B.push(` ${JSON.stringify($)}: html\`
@@ -118,14 +118,14 @@ ${B.join(`,
118
118
  }[${V}]}`}else if(Z.textContent!==void 0)U=G3(Z.textContent);else if(Z.innerHTML!==void 0)U=Z.innerHTML;else if(Z.children)U=`
119
119
  ${Y3(Z.children,Z.style,`${W} `)}
120
120
  ${W}`;return`${W}<${X}${G}
121
- ${W}>${U}</${X}>`}function r5(Z,W){let X=f0(Z.items)?P6(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(f0(H))G.push(`.${V}="\${${bQ(H.$ref)}}"`);else G.push(`.${V}="\${${JSON.stringify(H)}}"`);let Y=s5(Q.style);if(Y)G.push(`style="${Y}"`);for(let[V,H]of Object.entries(Q)){if(!V.startsWith("on"))continue;let B=V.slice(2).toLowerCase();if(f0(H))G.push(`@${B}="\${(e) => ${P6(H.$ref)}(s, e)}"`);else if(t0(H)){let $=p0(H.$expression,{eventParam:"e",statePrefix:"s"});G.push(`@${B}="\${(e) => { ${$}; }}"`)}}let U=G.length>0?`
121
+ ${W}>${U}</${X}>`}function r5(Z,W){let X=f0(Z.items)?P6(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(f0(H))G.push(`.${V}="\${${hQ(H.$ref)}}"`);else G.push(`.${V}="\${${JSON.stringify(H)}}"`);let Y=s5(Q.style);if(Y)G.push(`style="${Y}"`);for(let[V,H]of Object.entries(Q)){if(!V.startsWith("on"))continue;let B=V.slice(2).toLowerCase();if(f0(H))G.push(`@${B}="\${(e) => ${P6(H.$ref)}(s, e)}"`);else if(t0(H)){let $=p0(H.$expression,{eventParam:"e",statePrefix:"s"});G.push(`@${B}="\${(e) => { ${$}; }}"`)}}let U=G.length>0?`
122
122
  ${W} ${G.join(`
123
123
  ${W} `)}`:"",K="";if(Q.textContent!==void 0)K=G3(Q.textContent);else if(Q.children)K=`
124
124
  ${Y3(Q.children,null,`${W} `)}
125
125
  ${W} `;return`${W}\${${X}.map((item, index) => html\`
126
126
  ${W} <${J}${U}
127
127
  ${W} >${K}</${J}>
128
- ${W}\`)}`}function P6(Z){if(Z.startsWith("#/state/"))return`s.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return`s.${Z}`}function bQ(Z){if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return P6(Z)}function m2(Z){return Z.replaceAll("state.","s.")}function G3(Z){if(Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string")return`\${${P6(Z.$ref)}}`;if(typeof Z==="string"&&Z.includes("${"))return m2(Z);return String(Z)}function vQ(Z){return(Z.body??"").replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function s5(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=S0(X);W.push(`${J}: ${m2(Q)}`)}}return W.join("; ")}function o5(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(o5(W.children))return!0}return!1}var a4=c(()=>{h4();y6();X6();R6()});function t5(Z,W){let{title:X="Jx App",reactivitySrc:Q,litHtmlSrc:J}=W,G=K4(Z,null,Z.state??{},Z.$media??{}),Y=B4(Z,Z.$media??{},W.projectStyle??null),U=[],K=e5(Z,!1,Z,G,U),V=[],H="",B="";if(U.length>0){for(let L of U){let A=r4(L.def,L.className,[]);V.push({content:A,path:`_islands/${L.tagName}.js`,tagName:L.tagName})}H=`<script type="importmap">
128
+ ${W}\`)}`}function P6(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 P6(Z)}function m2(Z){return Z.replaceAll("state.","s.")}function G3(Z){if(Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string")return`\${${P6(Z.$ref)}}`;if(typeof Z==="string"&&Z.includes("${"))return m2(Z);return String(Z)}function fQ(Z){return(Z.body??"").replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function s5(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=S0(X);W.push(`${J}: ${m2(Q)}`)}}return W.join("; ")}function o5(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(o5(W.children))return!0}return!1}var a4=c(()=>{h4();y6();X6();R6()});function t5(Z,W){let{title:X="Jx App",reactivitySrc:Q,litHtmlSrc:J}=W,G=K4(Z,null,Z.state??{},Z.$media??{}),Y=B4(Z,Z.$media??{},W.projectStyle??null),U=[],K=e5(Z,!1,Z,G,U),V=[],H="",B="";if(U.length>0){for(let L of U){let A=r4(L.def,L.className,[]);V.push({content:A,path:`_islands/${L.tagName}.js`,tagName:L.tagName})}H=`<script type="importmap">
129
129
  {
130
130
  "imports": {
131
131
  "@vue/reactivity": "${Q}",
@@ -146,8 +146,8 @@ ${W}\`)}`}function P6(Z){if(Z.startsWith("#/state/"))return`s.${Z.slice(8).repla
146
146
  ${K}
147
147
  ${B}
148
148
  </body>
149
- </html>`;return{files:V,html:$}}function e5(Z,W,X,Q,J){if(typeof Z==="string")return Z0(Z);if(typeof Z==="number"||typeof Z==="boolean")return Z0(String(Z));if(!Z||typeof Z!=="object")return"";let G=K4(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 Y=Z.tagName??"div",U=z4(Z,G.scope);if(O1.has(Y))return`<${Y}${U}>`;let K=yQ(Z,X,G,J);return`<${Y}${U}>${K}</${Y}>`}function yQ(Z,W,X,Q){let J=W??Z;if(J.textContent!==void 0){let G=$0(J.textContent,X.scope);return G==null?"":Z0(String(G))}if(J.innerHTML)return $0(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((Y,U)=>{let K=Y,V=w8(K),H=G?.[U]??Y;return e5(K,V,H,X,Q)}).join(`
150
- `)}return""}var Z9=c(()=>{y6();a4()});function q3(Z,W){let{title:X="Jx App",reactivitySrc:Q=q4,litHtmlSrc:J=U4,modulePath:G="app.js"}=W,Y=K4(Z,null,Z.state??{},Z.$media??{}),U=B4(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,b]of Object.entries(R)){if(b===null||typeof b!=="object"||Array.isArray(b)){if(typeof b==="string"&&a(b))$.push([m,`() => \`${b}\``]);else B.push([m,b]);continue}if(t0(b)){let t=b.$expression,w0=p0(t,{eventParam:"e",statePrefix:"state"});if(x6(t.operator))A.push([m,{args:["state","e"],body:w0}]);else $.push([m,`() => ${w0}`]);continue}if(I6(b)){let t=b.parameters?S6(b.parameters):b.arguments;if(b.$src){if(!D.has(b.$src))D.set(b.$src,new Set);D.get(b.$src).add(m),$.push([m,`() => { return ${m}(state); }`])}else if(b.body&&b.body.includes("return"))$.push([m,`() => { ${b.body} }`]);else A.push([m,{args:t??["state"],body:b.body}]);continue}if(k6(b))continue;if(A8(b)){B.push([m,b.default]);continue}if(n6(b)){if(b.$prototype==="LocalStorage"||b.$prototype==="SessionStorage"){let t=b.$prototype==="LocalStorage"?"localStorage":"sessionStorage",w0=b.key??m,j0=b.default??null;B.push([m,null]),j.push(fQ(m,t,w0,j0));continue}if(b.$prototype==="Request"){B.push([m,null]),j.push(hQ(m,b));continue}if(b.$prototype==="Cookie"){B.push([m,null]),j.push(mQ(m,b.name??m,b.default??null));continue}}B.push([m,b])}let x=W9(Z,Z,Y,V,H,K);for(let[m,b]of V)if(!L.some(([t])=>t===m))L.push([m,b]);for(let[m,b]of H)if(!A.some(([t])=>t===m))A.push([m,b]);let d=gQ(B,$,L,A,j,D,K,Q),u=[` "@vue/reactivity": "${Q}"`,` "lit-html": "${J}"`],i=`<!DOCTYPE html>
149
+ </html>`;return{files:V,html:$}}function e5(Z,W,X,Q,J){if(typeof Z==="string")return Z0(Z);if(typeof Z==="number"||typeof Z==="boolean")return Z0(String(Z));if(!Z||typeof Z!=="object")return"";let G=K4(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 Y=Z.tagName??"div",U=z4(Z,G.scope);if(O1.has(Y))return`<${Y}${U}>`;let K=mQ(Z,X,G,J);return`<${Y}${U}>${K}</${Y}>`}function mQ(Z,W,X,Q){let J=W??Z;if(J.textContent!==void 0){let G=$0(J.textContent,X.scope);return G==null?"":Z0(String(G))}if(J.innerHTML)return $0(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((Y,U)=>{let K=Y,V=w8(K),H=G?.[U]??Y;return e5(K,V,H,X,Q)}).join(`
150
+ `)}return""}var Z9=c(()=>{y6();a4()});function q3(Z,W){let{title:X="Jx App",reactivitySrc:Q=q4,litHtmlSrc:J=U4,modulePath:G="app.js"}=W,Y=K4(Z,null,Z.state??{},Z.$media??{}),U=B4(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=[],_=[],D=new Map,R=Z.state??{};for(let[m,b]of Object.entries(R)){if(b===null||typeof b!=="object"||Array.isArray(b)){if(typeof b==="string"&&a(b))$.push([m,`() => \`${b}\``]);else B.push([m,b]);continue}if(t0(b)){let t=b.$expression,w0=p0(t,{eventParam:"e",statePrefix:"state"});if(x6(t.operator))A.push([m,{args:["state","e"],body:w0}]);else $.push([m,`() => ${w0}`]);continue}if(I6(b)){let t=b.parameters?S6(b.parameters):b.arguments;if(b.$src){if(!D.has(b.$src))D.set(b.$src,new Set);D.get(b.$src).add(m),$.push([m,`() => { return ${m}(state); }`])}else if(b.body&&b.body.includes("return"))$.push([m,`() => { ${b.body} }`]);else A.push([m,{args:t??["state"],body:b.body}]);continue}if(k6(b))continue;if(A8(b)){B.push([m,b.default]);continue}if(n6(b)){if(b.$prototype==="LocalStorage"||b.$prototype==="SessionStorage"){let t=b.$prototype==="LocalStorage"?"localStorage":"sessionStorage",w0=b.key??m,_0=b.default??null;B.push([m,null]),_.push(cQ(m,t,w0,_0));continue}if(b.$prototype==="Request"){B.push([m,null]),_.push(dQ(m,b));continue}if(b.$prototype==="Cookie"){B.push([m,null]),_.push(lQ(m,b.name??m,b.default??null));continue}}B.push([m,b])}let x=W9(Z,Z,Y,V,H,K);for(let[m,b]of V)if(!L.some(([t])=>t===m))L.push([m,b]);for(let[m,b]of H)if(!A.some(([t])=>t===m))A.push([m,b]);let d=uQ(B,$,L,A,_,D,K,Q),u=[` "@vue/reactivity": "${Q}"`,` "lit-html": "${J}"`],i=`<!DOCTYPE html>
151
151
  <html lang="en">
152
152
  <head>
153
153
  <meta charset="utf-8">
@@ -176,13 +176,13 @@ ${u.join(`,
176
176
  `;else if(Array.isArray(Z.children))Q=`
177
177
  ${Z.children.map((G)=>X9(G)).join(`
178
178
  `)}
179
- `;if(new Set(["input","br","hr","img","meta","link"]).has(W))return`<${W}${X}>`;return`<${W}${X}>${Q}</${W}>`}function X9(Z){if(typeof Z==="string")return a(Z)?o6(Z):Z0(Z);if(typeof Z==="number"||typeof Z==="boolean")return Z0(String(Z));if(R0(Z))return Q9(Z);return U3(Z)}function Q9(Z){let{items:W}=Z,X=e0(W)?`state.${h6(W.$ref)}`:JSON.stringify(W??[]),Q=U3(Z.map);return`\${(${X} ?? []).map((item, index) => html\`${Q}\`)}`}function o6(Z){return Z.replaceAll("$map.","")}function gQ(Z,W,X,Q,J,G,Y,U){let K=[],{needsLit:V}=Y,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 hQ(Z,W){let{url:X}=W,Q=W.method??"GET",J=a(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 Y=[];if(Q!=="GET")Y.push(`method: ${JSON.stringify(Q)}`);if(W.headers)Y.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);Y.push(`body: ${K}`)}let U=Y.length>0?`, { ${Y.join(", ")} }`:"";return G.push(` fetch(url${U})`," .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 fQ(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 mQ(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 h6(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replaceAll("/","_");return Z.replaceAll("/","_")}function z3(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=c(()=>{h4();y6();X6()});var G9={};N2(G9,{compileClassJson:()=>uQ});function uQ(Z,W={}){let X=Z.title;if(!X)throw Error("compileClassJson: missing title (class name)");let Q=dQ(Z.extends),J=Z.$defs,G=J?.fields??{},Y=J?.constructor,U=typeof Y==="object"?Y: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 = {}) {"),U?.superCall||Q!=="Object"){let B=U?.superCall?.arguments?U.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(U?.body){let B=Array.isArray(U.body)?U.body:[U.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")||lQ($)?"async ":"",d=J9($.parameters??[]),u=cQ($.body);if(V.push(""),$.role==="accessor"){if($.getter)V.push(` ${R}get ${D}${L}() {`,` ${$.getter.body}`," }");if($.setter){let i=J9($.setter.parameters??[]);V.push(` ${R}set ${D}${L}(${i}) {`,` ${$.setter.body}`," }")}}else{V.push(` ${R}${x}${D}${L}(${d}) {`);for(let i of u)V.push(` ${i}`);V.push(" }")}}return V.push("}","",`export { ${X} };`,`export default ${X};`,""),V.join(`
184
- `)}function dQ(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 J9(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 cQ(Z){if(!Z)return[""];return Array.isArray(Z)?Z:[Z]}function lQ(Z){return(Array.isArray(Z.body)?Z.body.join(`
185
- `):Z.body??"").includes("await ")}import{readFileSync as pQ}from"node:fs";async function V3(Z,W={}){let{title:X="Jx App",reactivitySrc:Q=q4,litHtmlSrc:J=U4,projectStyle:G=null}=W,Y;if(typeof Z==="string"){let U=pQ(Z,"utf8");if(Z.endsWith(".json"))Y=g6(U,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(() => (M4(),J3));throw B(Z,V)}Y=await H.call("parse",U)}}else Y=Z;if(I8(Y)){let{compileClassJson:U}=await Promise.resolve().then(() => G9),K=U(Y,W),V=typeof Z==="string"?Z.replace(/\.class\.json$/,".js"):`${Y.title}.js`;return{files:[{content:K,path:V}],html:""}}if(!T2(Y))return t5(Y,{litHtmlSrc:J,projectStyle:G,reactivitySrc:Q,title:X});if(Y.tagName&&Y.tagName.includes("-")){let{tagName:U}=Y,K=R2(U),H={content:r4(Y,K,[]),path:`${U}.js`,tagName:U},B=B4(Y,Y.$media??{}),$=`<!DOCTYPE html>
179
+ `;if(new Set(["input","br","hr","img","meta","link"]).has(W))return`<${W}${X}>`;return`<${W}${X}>${Q}</${W}>`}function X9(Z){if(typeof Z==="string")return a(Z)?o6(Z):Z0(Z);if(typeof Z==="number"||typeof Z==="boolean")return Z0(String(Z));if(R0(Z))return Q9(Z);return U3(Z)}function Q9(Z){let{items:W}=Z,X=e0(W)?`state.${h6(W.$ref)}`:JSON.stringify(W??[]),Q=U3(Z.map);return`\${(${X} ?? []).map((item, index) => html\`${Q}\`)}`}function o6(Z){return Z.replaceAll("$map.","")}function uQ(Z,W,X,Q,J,G,Y,U){let K=[],{needsLit:V}=Y,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"],_=A.map((D)=>D==="state"?"state":"e").join(", ");K.push(` ${$}: (e) => { const fn = (${A.join(", ")}) => { ${L.body} }; fn(${_}); },`)}K.push("};")}else K.push("const on = {};");if(K.push("","function hydrate(root) {"," root.querySelectorAll('[data-bind]').forEach(el => {"," [...el.attributes].forEach(a => {"," if (a.name.startsWith(':')) {"," const parts = a.name.slice(1).split('.');"," const key = a.value;"),V)K.push(" if (parts[0] === 'render') {"," effect(() => { render(bind[key](), el); });"," } else if (parts[0] === 'style' && parts.length > 1) {");else K.push(" if (parts[0] === 'style' && parts.length > 1) {");return K.push(" effect(() => { el.style[parts[1]] = bind[key](); });"," } else if (parts[0] === 'attr' && parts.length > 1) {"," effect(() => { el.setAttribute(parts[1], bind[key]()); });"," } else {"," const prop = parts[0].replace(/-([a-z])/g, (_, c) => c.toUpperCase());"," effect(() => { el[prop] = bind[key](); });"," }"," } else if (a.name.startsWith('@')) {"," el.addEventListener(a.name.slice(1), on[a.value]);"," }"," });"," });","}","","hydrate(document);",""),K.join(`
180
+ `)}function dQ(Z,W){let{url:X}=W,Q=W.method??"GET",J=a(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 Y=[];if(Q!=="GET")Y.push(`method: ${JSON.stringify(Q)}`);if(W.headers)Y.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);Y.push(`body: ${K}`)}let U=Y.length>0?`, { ${Y.join(", ")} }`:"";return G.push(` fetch(url${U})`," .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 h6(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replaceAll("/","_");return Z.replaceAll("/","_")}function z3(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=c(()=>{h4();y6();X6()});var G9={};N2(G9,{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??{},Y=J?.constructor,U=typeof Y==="object"?Y: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"?"#":"",_=$.initializer!==void 0?JSON.stringify($.initializer):$.default!==void 0?JSON.stringify($.default):"null";V.push(` static ${A}${L} = ${_};`)}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 = {}) {"),U?.superCall||Q!=="Object"){let B=U?.superCall?.arguments?U.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"?"#":"",_=$.initializer!==void 0?JSON.stringify($.initializer):$.default!==void 0?JSON.stringify($.default):"null";V.push(` this.${A}${L} = config.${L} !== undefined ? config.${L} : ${_};`)}if(U?.body){let B=Array.isArray(U.body)?U.body:[U.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 ":"",d=J9($.parameters??[]),u=iQ($.body);if(V.push(""),$.role==="accessor"){if($.getter)V.push(` ${R}get ${D}${L}() {`,` ${$.getter.body}`," }");if($.setter){let i=J9($.setter.parameters??[]);V.push(` ${R}set ${D}${L}(${i}) {`,` ${$.setter.body}`," }")}}else{V.push(` ${R}${x}${D}${L}(${d}) {`);for(let i of u)V.push(` ${i}`);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 J9(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=q4,litHtmlSrc:J=U4,projectStyle:G=null}=W,Y;if(typeof Z==="string"){let U=aQ(Z,"utf8");if(Z.endsWith(".json"))Y=g6(U,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(() => (M4(),J3));throw B(Z,V)}Y=await H.call("parse",U)}}else Y=Z;if(I8(Y)){let{compileClassJson:U}=await Promise.resolve().then(() => G9),K=U(Y,W),V=typeof Z==="string"?Z.replace(/\.class\.json$/,".js"):`${Y.title}.js`;return{files:[{content:K,path:V}],html:""}}if(!T2(Y))return t5(Y,{litHtmlSrc:J,projectStyle:G,reactivitySrc:Q,title:X});if(Y.tagName&&Y.tagName.includes("-")){let{tagName:U}=Y,K=R2(U),H={content:r4(Y,K,[]),path:`${U}.js`,tagName:U},B=B4(Y,Y.$media??{}),$=`<!DOCTYPE html>
186
186
  <html lang="en">
187
187
  <head>
188
188
  <meta charset="utf-8">
@@ -202,55 +202,55 @@ ${u.join(`,
202
202
  <${U}></${U}>
203
203
  <script type="module" src="./${U}.js"></script>
204
204
  </body>
205
- </html>`;return{files:[H],html:$}}return q3(Y,{litHtmlSrc:J,projectStyle:G,reactivitySrc:Q,title:X})}async function Z$(Z,W){let[X,Q]=await Promise.all([V3(Z),n4(Z)]),{writeFileSync:J,mkdirSync:G}=await import("node:fs"),{dirname:Y,join:U}=await import("node:path");if(W){J(W,X.html,"utf8"),console.error(`Written to ${W}`);let K=Y(W);for(let V of X.files){let H=U(K,V.path);G(Y(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 Y9=c(()=>{y6();Z3();a4();Z9();K3();X6();R6();y6();Z3();a4();K3()});import{existsSync as nQ,readFileSync as iQ}from"node:fs";import{resolve as z9}from"node:path";function q9(Z){let W=z9(Z,"project.json");if(!nQ(W))throw Error(`project.json not found in ${Z}`);let X;try{X=h5(iQ(W,"utf8"),W)}catch(Y){throw Error(`Invalid project.json: ${T6(Y)}`,{cause:Y})}let Q={...d2,...X,build:{...d2.build,...X.build},defaults:{...d2.defaults,...X.defaults},images:{...d2.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:z9(Z)}}var d2;var U9=c(()=>{R6();d2={$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 K9,readdirSync as rQ}from"node:fs";import{extname as B3,join as aQ,relative as sQ,resolve as oQ}from"node:path";async function s4(Z,W){let X=K9(Z,"utf8");if(Z.endsWith(".json"))return g6(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 V9(Z,W){let X=[],Q=new Set([".json",...W?.documentExtensions("page")??[]]);return await B9(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 B9(Z,W,X,Q,J){let G=rQ(Z,{withFileTypes:!0});for(let Y of G){let U=aQ(Z,Y.name);if(Y.isDirectory()){if(Y.name.startsWith("_"))continue;await B9(U,W,X,Q,J);continue}let K=B3(Y.name).toLowerCase();if(!Q.has(K))continue;if(Y.name.startsWith("_"))continue;let V=sQ(W,U),H=await tQ(V,U,J);if(H)X.push(H)}}async function tQ(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=[],Y=!1,U=!1,K=J.replaceAll(/\[\.\.\.(\w+)\]|\[(\w+)\]/g,(H,B,$)=>{if(B)return U=!0,Y=!0,G.push(B),"*";return Y=!0,G.push($),`:${$}`}),V=null;try{let B=(await s4(W,X)).$layout;if(typeof B==="string")V=B}catch{}return{$layout:V,isCatchAll:U,isDynamic:Y,params:G,relativePath:Z,sourcePath:W,urlPattern:K}}async function H9(Z,W,X=new Map,Q){let J=[];for(let G of Z){if(!G.isDynamic){J.push(G);continue}let Y;try{Y=await s4(G.sourcePath,Q)}catch{J.push(G);continue}if(!Y.$paths){console.warn(`Warning: dynamic route ${G.urlPattern} has no $paths — skipping`);continue}let U=eQ(Y.$paths,W,X);for(let K of U){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 eQ(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((Y)=>({[J]:G==="id"?Y.id:Y.data[G]??Y.id})).filter((Y)=>Y[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=oQ(W,Z.$ref),J;try{J=JSON.parse(K9(Q,"utf8"))}catch(U){let K=U;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",Y=Z.field??"id";return J.map((U)=>({[G]:U[Y]??U.id??String(U)}))}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var $9=c(()=>{R6()});import{existsSync as ZJ,readFileSync as WJ}from"node:fs";import{resolve as XJ}from"node:path";function H3(Z,W,X){let Q=Z.$layout??W.defaults?.layout??null;if(!Q)return Z;let J=XJ(X,Q);if(!ZJ(J))throw Error(`Layout not found: ${Q} (resolved to ${J})`);let G;try{G=g6(WJ(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 Y=Z.children??[],U=typeof Y==="string"?[Y]:Array.isArray(Y)?Y:[],K=JJ(G);if(QJ(K,U),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 QJ(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);F9(Z,X,Q)}function F9(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 F9(J,W,X),Q.push(J);Z.children=Q}function JJ(Z){return structuredClone(Z)}var L9=c(()=>{R6()});function A9(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 U of[...J,...Z,...W,...X]){let K=GJ(U);G.set(K,U)}let Y=Q.title??Q.siteName??"Jx Site";if(G.set("title",{children:[Y],tagName:"title"}),Q.pageUrl&&Q.siteUrl){let U=new URL(Q.pageUrl,Q.siteUrl).href;G.set("link:canonical",{attributes:{href:U,rel:"canonical"},tagName:"link"})}return[...G.values()]}function GJ(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:${YJ(Q)}`}return`${W}:${JSON.stringify(Z)}`}function YJ(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 M9(Z){return Z.map((W)=>zJ(W)).join(`
206
- `)}function zJ(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(([U,K])=>K===!0?U:`${U}="${qJ(K)}"`).join(" "),J=Q?`<${W} ${Q}>`:`<${W}>`;if(new Set(["meta","link","base","br","hr","img","input"]).has(W))return J;let Y=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`${J}${Y}</${W}>`}function qJ(Z){return String(Z).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}import{dirname as UJ,relative as KJ,resolve as VJ}from"node:path";function I9(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,Y]of Object.entries(W.state))if(G!=="$site"&&G!=="$page"&&!(G in Z.state))Z.state[G]=Y}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,Y]of Object.entries(W.imports))if(!(G in Z.imports)){let U=Y;if(J&&X.sourcePath&&(U.startsWith("./")||U.startsWith("../"))){let K=VJ(J,U);Z.imports[G]=`./${KJ(UJ(X.sourcePath),K)}`}else Z.imports[G]=U}}if(W.$elements?.length)if(!Z.$elements?.length)Z.$elements=[...W.$elements];else{let G=new Set,Y=[];for(let U of[...W.$elements,...Z.$elements]){let K=typeof U==="string"?U:U?.$ref;if(K&&!G.has(K))G.add(K),Y.push(U)}Z.$elements=Y}return Z}var N9=()=>{};import{existsSync as BJ,readFileSync as HJ,readdirSync as $J}from"node:fs";import{basename as w9,extname as D9,resolve as F3}from"node:path";function FJ(Z){let W=JSON.parse(HJ(Z,"utf8"));if(Array.isArray(W))return W.map((Q,J)=>({body:null,data:Q,id:Q.id??`${w9(Z,".json")}-${J}`}));let X=W;return[{body:null,data:X,id:X.id??w9(Z,".json")}]}function LJ(Z){if(D9(Z))return BJ(Z)?[Z]:[];try{return $J(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 T9(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 Y=X??await i4(Z,W);for(let[U,K]of Object.entries(J.contentTypes)){let V=await AJ(U,K,Z,Y);G.set(U,V)}return G}async function AJ(Z,W,X,Q){let{source:J}=W;if(!J)return[];let{schema:G}=W,Y=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,U=W.format,K;if(U&&U!=="json"){if(K=Q.byName(U),!K)throw Error(`Content type "${Z}": format "${U}" is not an imported format class. Add it to project.json imports, e.g. "${U}": "@jxsuite/parser/${U}.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:Y,schema:G});if(G)$3(L,G,Z);return L}catch(L){return console.warn(`Content type "${Z}": ${T6(L)}`),[]}}let V=F3(X,J).split("\\").join("/"),H=D9(J).toLowerCase();if(U==="json"||!K&&H===".json"){let L=LJ(V),A=[];for(let j of L)A.push(...FJ(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:Y,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 Y of Q)if(!(Y in G.data)||G.data[Y]==null)console.warn(`Content validation: "${X}/${G.id}" missing required field "${Y}"`);for(let[Y,U]of Object.entries(J)){let K=G.data[Y];if(K==null)continue;if(U.type==="string"&&typeof K!=="string")console.warn(`Content validation: "${X}/${G.id}" field "${Y}" expected string, got ${typeof K}`);else if(U.type==="number"&&typeof K!=="number")console.warn(`Content validation: "${X}/${G.id}" field "${Y}" expected number, got ${typeof K}`);else if(U.type==="boolean"&&typeof K!=="boolean")console.warn(`Content validation: "${X}/${G.id}" field "${Y}" expected boolean, got ${typeof K}`);else if(U.type==="array"&&!Array.isArray(K))console.warn(`Content validation: "${X}/${G.id}" field "${Y}" expected array, got ${typeof K}`)}}}function R9(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[Y,U]of Object.entries(J.properties)){let K=U;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[Y];if(typeof $==="string"){let L=H.find((A)=>A.id===$);if(L)B.data[Y]=L}}}}}var P9=c(()=>{R6();M4()});import{readFileSync as MJ}from"node:fs";import{dirname as A3,resolve as c2}from"node:path";import{createRequire as IJ}from"node:module";async function _9(Z,W,X,Q={}){let J=Z.imports??{},{state:G}=Z;if(!G)return;for(let[Y,U]of Object.entries(G)){if(!n6(U))continue;if(NJ.has(U.$prototype))continue;if(U.timing&&U.timing!=="compiler")continue;if(!U.$src){let K=J[U.$prototype];if(!K)continue;U.$src=K}try{let K=await DJ(U,W,X,G,Q);if(U.timing&&K&&typeof K==="object"&&!Array.isArray(K))K.timing=U.timing;G[Y]=K}catch(K){console.warn(`prototype-resolver: failed to resolve "${Y}" ($prototype: "${U.$prototype}"):`,T6(K))}}}async function DJ(Z,W,X,Q,J){let G=Z.$src;if(!G)throw Error(`$prototype "${Z.$prototype}" has no $src to resolve`);let Y;if(G.startsWith("./")||G.startsWith("../"))Y=W.sourcePath?c2(A3(W.sourcePath),G):c2(X,G);else Y=IJ(c2(X,"package.json")).resolve(G);let U=MJ(Y,"utf8"),K=f5(U,Y);if(!K.$implementation)throw Error(`${G} has no $implementation field`);let V=c2(A3(Y),K.$implementation),H=await f2(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(!wJ.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 NJ,wJ;var j9=c(()=>{M4();X6();R6();NJ=new Set(["Function","LocalStorage","SessionStorage","Array"]),wJ=new Set(["$prototype","$src","$export","timing","default","description"])});var E9=(Z)=>typeof Z<"u"&&Z!==null,TJ=(Z)=>typeof Z==="object",RJ=(Z)=>Object.prototype.toString.call(Z)==="[object Object]",PJ=(Z)=>typeof Z==="function",_J=(Z)=>typeof Z==="boolean",jJ=(Z)=>Z instanceof Buffer,EJ=(Z)=>{if(E9(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},CJ=(Z)=>Z instanceof ArrayBuffer,OJ=(Z)=>typeof Z==="string"&&Z.length>0,xJ=(Z)=>typeof Z==="number"&&Number.isFinite(Z),kJ=(Z)=>Number.isInteger(Z),SJ=(Z,W,X)=>Z>=W&&Z<=X,bJ=(Z,W)=>W.includes(Z),vJ=(Z,W,X)=>Error(`Expected ${W} for ${Z} but received ${X} of type ${typeof X}`),yJ=(Z,W)=>{return W.message=Z.message,W},z;var Y6=c(()=>{/*!
205
+ </html>`;return{files:[H],html:$}}return q3(Y,{litHtmlSrc:J,projectStyle:G,reactivitySrc:Q,title:X})}async function J$(Z,W){let[X,Q]=await Promise.all([V3(Z),n4(Z)]),{writeFileSync:J,mkdirSync:G}=await import("node:fs"),{dirname:Y,join:U}=await import("node:path");if(W){J(W,X.html,"utf8"),console.error(`Written to ${W}`);let K=Y(W);for(let V of X.files){let H=U(K,V.path);G(Y(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 Y9=c(()=>{y6();Z3();a4();Z9();K3();X6();R6();y6();Z3();a4();K3()});import{existsSync as sQ,readFileSync as oQ}from"node:fs";import{resolve as z9}from"node:path";function q9(Z){let W=z9(Z,"project.json");if(!sQ(W))throw Error(`project.json not found in ${Z}`);let X;try{X=h5(oQ(W,"utf8"),W)}catch(Y){throw Error(`Invalid project.json: ${T6(Y)}`,{cause:Y})}let Q={...d2,...X,build:{...d2.build,...X.build},defaults:{...d2.defaults,...X.defaults},images:{...d2.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:z9(Z)}}var d2;var U9=c(()=>{R6();d2={$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 K9,readdirSync as tQ}from"node:fs";import{extname as B3,join as eQ,relative as ZJ,resolve as WJ}from"node:path";async function s4(Z,W){let X=K9(Z,"utf8");if(Z.endsWith(".json"))return g6(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 V9(Z,W){let X=[],Q=new Set([".json",...W?.documentExtensions("page")??[]]);return await B9(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 B9(Z,W,X,Q,J){let G=tQ(Z,{withFileTypes:!0});for(let Y of G){let U=eQ(Z,Y.name);if(Y.isDirectory()){if(Y.name.startsWith("_"))continue;await B9(U,W,X,Q,J);continue}let K=B3(Y.name).toLowerCase();if(!Q.has(K))continue;if(Y.name.startsWith("_"))continue;let V=ZJ(W,U),H=await XJ(V,U,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=[],Y=!1,U=!1,K=J.replaceAll(/\[\.\.\.(\w+)\]|\[(\w+)\]/g,(H,B,$)=>{if(B)return U=!0,Y=!0,G.push(B),"*";return Y=!0,G.push($),`:${$}`}),V=null;try{let B=(await s4(W,X)).$layout;if(typeof B==="string")V=B}catch{}return{$layout:V,isCatchAll:U,isDynamic:Y,params:G,relativePath:Z,sourcePath:W,urlPattern:K}}async function H9(Z,W,X=new Map,Q){let J=[];for(let G of Z){if(!G.isDynamic){J.push(G);continue}let Y;try{Y=await s4(G.sourcePath,Q)}catch{J.push(G);continue}if(!Y.$paths){console.warn(`Warning: dynamic route ${G.urlPattern} has no $paths — skipping`);continue}let U=QJ(Y.$paths,W,X);for(let K of U){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((Y)=>({[J]:G==="id"?Y.id:Y.data[G]??Y.id})).filter((Y)=>Y[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(K9(Q,"utf8"))}catch(U){let K=U;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",Y=Z.field??"id";return J.map((U)=>({[G]:U[Y]??U.id??String(U)}))}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var $9=c(()=>{R6()});import{existsSync as JJ,readFileSync as GJ}from"node:fs";import{resolve as YJ}from"node:path";function H3(Z,W,X){let Q=Z.$layout??W.defaults?.layout??null;if(!Q)return Z;let J=YJ(X,Q);if(!JJ(J))throw Error(`Layout not found: ${Q} (resolved to ${J})`);let G;try{G=g6(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 Y=Z.children??[],U=typeof Y==="string"?[Y]:Array.isArray(Y)?Y:[],K=qJ(G);if(zJ(K,U),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 zJ(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);F9(Z,X,Q)}function F9(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 F9(J,W,X),Q.push(J);Z.children=Q}function qJ(Z){return structuredClone(Z)}var L9=c(()=>{R6()});function A9(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 U of[...J,...Z,...W,...X]){let K=UJ(U);G.set(K,U)}let Y=Q.title??Q.siteName??"Jx Site";if(G.set("title",{children:[Y],tagName:"title"}),Q.pageUrl&&Q.siteUrl){let U=new URL(Q.pageUrl,Q.siteUrl).href;G.set("link:canonical",{attributes:{href:U,rel:"canonical"},tagName:"link"})}return[...G.values()]}function UJ(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 M9(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(([U,K])=>K===!0?U:`${U}="${BJ(K)}"`).join(" "),J=Q?`<${W} ${Q}>`:`<${W}>`;if(new Set(["meta","link","base","br","hr","img","input"]).has(W))return J;let Y=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`${J}${Y}</${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 I9(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,Y]of Object.entries(W.state))if(G!=="$site"&&G!=="$page"&&!(G in Z.state))Z.state[G]=Y}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,Y]of Object.entries(W.imports))if(!(G in Z.imports)){let U=Y;if(J&&X.sourcePath&&(U.startsWith("./")||U.startsWith("../"))){let K=FJ(J,U);Z.imports[G]=`./${$J(HJ(X.sourcePath),K)}`}else Z.imports[G]=U}}if(W.$elements?.length)if(!Z.$elements?.length)Z.$elements=[...W.$elements];else{let G=new Set,Y=[];for(let U of[...W.$elements,...Z.$elements]){let K=typeof U==="string"?U:U?.$ref;if(K&&!G.has(K))G.add(K),Y.push(U)}Z.$elements=Y}return Z}var N9=()=>{};import{existsSync as LJ,readFileSync as AJ,readdirSync as MJ}from"node:fs";import{basename as w9,extname as D9,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??`${w9(Z,".json")}-${J}`}));let X=W;return[{body:null,data:X,id:X.id??w9(Z,".json")}]}function NJ(Z){if(D9(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 T9(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 Y=X??await i4(Z,W);for(let[U,K]of Object.entries(J.contentTypes)){let V=await wJ(U,K,Z,Y);G.set(U,V)}return G}async function wJ(Z,W,X,Q){let{source:J}=W;if(!J)return[];let{schema:G}=W,Y=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,U=W.format,K;if(U&&U!=="json"){if(K=Q.byName(U),!K)throw Error(`Content type "${Z}": format "${U}" is not an imported format class. Add it to project.json imports, e.g. "${U}": "@jxsuite/parser/${U}.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:Y,schema:G});if(G)$3(L,G,Z);return L}catch(L){return console.warn(`Content type "${Z}": ${T6(L)}`),[]}}let V=F3(X,J).split("\\").join("/"),H=D9(J).toLowerCase();if(U==="json"||!K&&H===".json"){let L=NJ(V),A=[];for(let _ of L)A.push(...IJ(_));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:Y,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 Y of Q)if(!(Y in G.data)||G.data[Y]==null)console.warn(`Content validation: "${X}/${G.id}" missing required field "${Y}"`);for(let[Y,U]of Object.entries(J)){let K=G.data[Y];if(K==null)continue;if(U.type==="string"&&typeof K!=="string")console.warn(`Content validation: "${X}/${G.id}" field "${Y}" expected string, got ${typeof K}`);else if(U.type==="number"&&typeof K!=="number")console.warn(`Content validation: "${X}/${G.id}" field "${Y}" expected number, got ${typeof K}`);else if(U.type==="boolean"&&typeof K!=="boolean")console.warn(`Content validation: "${X}/${G.id}" field "${Y}" expected boolean, got ${typeof K}`);else if(U.type==="array"&&!Array.isArray(K))console.warn(`Content validation: "${X}/${G.id}" field "${Y}" expected array, got ${typeof K}`)}}}function R9(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[Y,U]of Object.entries(J.properties)){let K=U;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[Y];if(typeof $==="string"){let L=H.find((A)=>A.id===$);if(L)B.data[Y]=L}}}}}var P9=c(()=>{R6();M4()});import{readFileSync as DJ}from"node:fs";import{dirname as A3,resolve as c2}from"node:path";import{createRequire as TJ}from"node:module";async function j9(Z,W,X,Q={}){let J=Z.imports??{},{state:G}=Z;if(!G)return;for(let[Y,U]of Object.entries(G)){if(!n6(U))continue;if(RJ.has(U.$prototype))continue;if(U.timing&&U.timing!=="compiler")continue;if(!U.$src){let K=J[U.$prototype];if(!K)continue;U.$src=K}try{let K=await jJ(U,W,X,G,Q);if(U.timing&&K&&typeof K==="object"&&!Array.isArray(K))K.timing=U.timing;G[Y]=K}catch(K){console.warn(`prototype-resolver: failed to resolve "${Y}" ($prototype: "${U.$prototype}"):`,T6(K))}}}async function jJ(Z,W,X,Q,J){let G=Z.$src;if(!G)throw Error(`$prototype "${Z.$prototype}" has no $src to resolve`);let Y;if(G.startsWith("./")||G.startsWith("../"))Y=W.sourcePath?c2(A3(W.sourcePath),G):c2(X,G);else Y=TJ(c2(X,"package.json")).resolve(G);let U=DJ(Y,"utf8"),K=f5(U,Y);if(!K.$implementation)throw Error(`${G} has no $implementation field`);let V=c2(A3(Y),K.$implementation),H=await f2(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[_,D]of Object.entries(Z))if(!PJ.has(_))L[_]=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 _9=c(()=>{M4();X6();R6();RJ=new Set(["Function","LocalStorage","SessionStorage","Array"]),PJ=new Set(["$prototype","$src","$export","timing","default","description"])});var E9=(Z)=>typeof Z<"u"&&Z!==null,_J=(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(E9(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.isFinite(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},z;var Y6=c(()=>{/*!
207
207
  Copyright 2013 Lovell Fuller and others.
208
208
  SPDX-License-Identifier: Apache-2.0
209
- */z={defined:E9,object:TJ,plainObject:RJ,fn:PJ,bool:_J,buffer:jJ,typedArray:EJ,arrayBuffer:CJ,string:OJ,number:xJ,integer:kJ,inRange:SJ,inArray:bJ,invalidParameterError:vJ,nativeError:yJ}});var x9=n((h$,O9)=>{var C9=()=>process.platform==="linux",l2=null,gJ=()=>{if(!l2)if(C9()&&process.report){let Z=process.report.excludeNetwork;process.report.excludeNetwork=!0,l2=process.report.getReport(),process.report.excludeNetwork=Z}else l2={};return l2};O9.exports={isLinux:C9,getReport:gJ}});var S9=n((f$,k9)=>{var I4=T0("fs"),hJ=(Z)=>{let W=I4.openSync(Z,"r"),X=Buffer.alloc(2048),Q=I4.readSync(W,X,0,2048,0);return I4.close(W,()=>{}),X.subarray(0,Q)},fJ=(Z)=>new Promise((W,X)=>{I4.open(Z,"r",(Q,J)=>{if(Q)X(Q);else{let G=Buffer.alloc(2048);I4.read(J,G,0,2048,0,(Y,U)=>{W(G.subarray(0,U)),I4.close(J,()=>{})})}})});k9.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:hJ,readFile:fJ}});var v9=n((m$,b9)=>{var mJ=(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 U=Z.readUInt32LE(G+8),K=Z.readUInt32LE(G+32);return Z.subarray(U,U+K).toString().replace(/\0.*$/g,"")}}return null};b9.exports={interpreterPath:mJ}});var n2=n((u$,t9)=>{var g9=T0("child_process"),{isLinux:N4,getReport:h9}=x9(),{LDD_PATH:p2,SELF_PATH:f9,readFile:M3,readFileSync:I3}=S9(),{interpreterPath:m9}=v9(),z6,q6,U6,f6="",u9=()=>{if(!f6)return new Promise((Z)=>{g9.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(W,X)=>{f6=W?" ":X,Z(f6)})});return f6},d9=()=>{if(!f6)try{f6=g9.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(Z){f6=" "}return f6},_6="glibc",c9=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,t6="musl",uJ=(Z)=>Z.includes("libc.musl-")||Z.includes("ld-musl-"),l9=()=>{let Z=h9();if(Z.header&&Z.header.glibcVersionRuntime)return _6;if(Array.isArray(Z.sharedObjects)){if(Z.sharedObjects.some(uJ))return t6}return null},p9=(Z)=>{let[W,X]=Z.split(/[\r\n]+/);if(W&&W.includes(_6))return _6;if(X&&X.includes(t6))return t6;return null},n9=(Z)=>{if(Z){if(Z.includes("/ld-musl-"))return t6;else if(Z.includes("/ld-linux-"))return _6}return null},i9=(Z)=>{if(Z=Z.toString(),Z.includes("musl"))return t6;if(Z.includes("GNU C Library"))return _6;return null},dJ=async()=>{if(q6!==void 0)return q6;q6=null;try{let Z=await M3(p2);q6=i9(Z)}catch(Z){}return q6},cJ=()=>{if(q6!==void 0)return q6;q6=null;try{let Z=I3(p2);q6=i9(Z)}catch(Z){}return q6},lJ=async()=>{if(z6!==void 0)return z6;z6=null;try{let Z=await M3(f9),W=m9(Z);z6=n9(W)}catch(Z){}return z6},pJ=()=>{if(z6!==void 0)return z6;z6=null;try{let Z=I3(f9),W=m9(Z);z6=n9(W)}catch(Z){}return z6},r9=async()=>{let Z=null;if(N4()){if(Z=await lJ(),!Z){if(Z=await dJ(),!Z)Z=l9();if(!Z){let W=await u9();Z=p9(W)}}}return Z},a9=()=>{let Z=null;if(N4()){if(Z=pJ(),!Z){if(Z=cJ(),!Z)Z=l9();if(!Z){let W=d9();Z=p9(W)}}}return Z},nJ=async()=>N4()&&await r9()!==_6,iJ=()=>N4()&&a9()!==_6,rJ=async()=>{if(U6!==void 0)return U6;U6=null;try{let W=(await M3(p2)).match(c9);if(W)U6=W[1]}catch(Z){}return U6},aJ=()=>{if(U6!==void 0)return U6;U6=null;try{let W=I3(p2).match(c9);if(W)U6=W[1]}catch(Z){}return U6},s9=()=>{let Z=h9();if(Z.header&&Z.header.glibcVersionRuntime)return Z.header.glibcVersionRuntime;return null},y9=(Z)=>Z.trim().split(/\s+/)[1],o9=(Z)=>{let[W,X,Q]=Z.split(/[\r\n]+/);if(W&&W.includes(_6))return y9(W);if(X&&Q&&X.includes(t6))return y9(Q);return null},sJ=async()=>{let Z=null;if(N4()){if(Z=await rJ(),!Z)Z=s9();if(!Z){let W=await u9();Z=o9(W)}}return Z},oJ=()=>{let Z=null;if(N4()){if(Z=aJ(),!Z)Z=s9();if(!Z){let W=d9();Z=o9(W)}}return Z};t9.exports={GLIBC:_6,MUSL:t6,family:r9,familySync:a9,isNonGlibcLinux:nJ,isNonGlibcLinuxSync:iJ,version:sJ,versionSync:oJ}});var w4=n((d$,e9)=>{var tJ=Number.MAX_SAFE_INTEGER||9007199254740991,eJ=["major","premajor","minor","preminor","patch","prepatch","prerelease"];e9.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:tJ,RELEASE_TYPES:eJ,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var o4=n((c$,ZZ)=>{var ZG=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...Z)=>console.error("SEMVER",...Z):()=>{};ZZ.exports=ZG});var D4=n((K6,WZ)=>{var{MAX_SAFE_COMPONENT_LENGTH:N3,MAX_SAFE_BUILD_LENGTH:WG,MAX_LENGTH:XG}=w4(),QG=o4();K6=WZ.exports={};var JG=K6.re=[],GG=K6.safeRe=[],g=K6.src=[],YG=K6.safeSrc=[],h=K6.t={},zG=0,w3="[a-zA-Z0-9-]",qG=[["\\s",1],["\\d",XG],[w3,WG]],UG=(Z)=>{for(let[W,X]of qG)Z=Z.split(`${W}*`).join(`${W}{0,${X}}`).split(`${W}+`).join(`${W}{1,${X}}`);return Z},r=(Z,W,X)=>{let Q=UG(W),J=zG++;QG(Z,J,W),h[Z]=J,g[J]=W,YG[J]=Q,JG[J]=new RegExp(W,X?"g":void 0),GG[J]=new RegExp(Q,X?"g":void 0)};r("NUMERICIDENTIFIER","0|[1-9]\\d*");r("NUMERICIDENTIFIERLOOSE","\\d+");r("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${w3}*`);r("MAINVERSION",`(${g[h.NUMERICIDENTIFIER]})\\.(${g[h.NUMERICIDENTIFIER]})\\.(${g[h.NUMERICIDENTIFIER]})`);r("MAINVERSIONLOOSE",`(${g[h.NUMERICIDENTIFIERLOOSE]})\\.(${g[h.NUMERICIDENTIFIERLOOSE]})\\.(${g[h.NUMERICIDENTIFIERLOOSE]})`);r("PRERELEASEIDENTIFIER",`(?:${g[h.NONNUMERICIDENTIFIER]}|${g[h.NUMERICIDENTIFIER]})`);r("PRERELEASEIDENTIFIERLOOSE",`(?:${g[h.NONNUMERICIDENTIFIER]}|${g[h.NUMERICIDENTIFIERLOOSE]})`);r("PRERELEASE",`(?:-(${g[h.PRERELEASEIDENTIFIER]}(?:\\.${g[h.PRERELEASEIDENTIFIER]})*))`);r("PRERELEASELOOSE",`(?:-?(${g[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${g[h.PRERELEASEIDENTIFIERLOOSE]})*))`);r("BUILDIDENTIFIER",`${w3}+`);r("BUILD",`(?:\\+(${g[h.BUILDIDENTIFIER]}(?:\\.${g[h.BUILDIDENTIFIER]})*))`);r("FULLPLAIN",`v?${g[h.MAINVERSION]}${g[h.PRERELEASE]}?${g[h.BUILD]}?`);r("FULL",`^${g[h.FULLPLAIN]}$`);r("LOOSEPLAIN",`[v=\\s]*${g[h.MAINVERSIONLOOSE]}${g[h.PRERELEASELOOSE]}?${g[h.BUILD]}?`);r("LOOSE",`^${g[h.LOOSEPLAIN]}$`);r("GTLT","((?:<|>)?=?)");r("XRANGEIDENTIFIERLOOSE",`${g[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);r("XRANGEIDENTIFIER",`${g[h.NUMERICIDENTIFIER]}|x|X|\\*`);r("XRANGEPLAIN",`[v=\\s]*(${g[h.XRANGEIDENTIFIER]})(?:\\.(${g[h.XRANGEIDENTIFIER]})(?:\\.(${g[h.XRANGEIDENTIFIER]})(?:${g[h.PRERELEASE]})?${g[h.BUILD]}?)?)?`);r("XRANGEPLAINLOOSE",`[v=\\s]*(${g[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${g[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${g[h.XRANGEIDENTIFIERLOOSE]})(?:${g[h.PRERELEASELOOSE]})?${g[h.BUILD]}?)?)?`);r("XRANGE",`^${g[h.GTLT]}\\s*${g[h.XRANGEPLAIN]}$`);r("XRANGELOOSE",`^${g[h.GTLT]}\\s*${g[h.XRANGEPLAINLOOSE]}$`);r("COERCEPLAIN",`(^|[^\\d])(\\d{1,${N3}})(?:\\.(\\d{1,${N3}}))?(?:\\.(\\d{1,${N3}}))?`);r("COERCE",`${g[h.COERCEPLAIN]}(?:$|[^\\d])`);r("COERCEFULL",g[h.COERCEPLAIN]+`(?:${g[h.PRERELEASE]})?(?:${g[h.BUILD]})?(?:$|[^\\d])`);r("COERCERTL",g[h.COERCE],!0);r("COERCERTLFULL",g[h.COERCEFULL],!0);r("LONETILDE","(?:~>?)");r("TILDETRIM",`(\\s*)${g[h.LONETILDE]}\\s+`,!0);K6.tildeTrimReplace="$1~";r("TILDE",`^${g[h.LONETILDE]}${g[h.XRANGEPLAIN]}$`);r("TILDELOOSE",`^${g[h.LONETILDE]}${g[h.XRANGEPLAINLOOSE]}$`);r("LONECARET","(?:\\^)");r("CARETTRIM",`(\\s*)${g[h.LONECARET]}\\s+`,!0);K6.caretTrimReplace="$1^";r("CARET",`^${g[h.LONECARET]}${g[h.XRANGEPLAIN]}$`);r("CARETLOOSE",`^${g[h.LONECARET]}${g[h.XRANGEPLAINLOOSE]}$`);r("COMPARATORLOOSE",`^${g[h.GTLT]}\\s*(${g[h.LOOSEPLAIN]})$|^$`);r("COMPARATOR",`^${g[h.GTLT]}\\s*(${g[h.FULLPLAIN]})$|^$`);r("COMPARATORTRIM",`(\\s*)${g[h.GTLT]}\\s*(${g[h.LOOSEPLAIN]}|${g[h.XRANGEPLAIN]})`,!0);K6.comparatorTrimReplace="$1$2$3";r("HYPHENRANGE",`^\\s*(${g[h.XRANGEPLAIN]})\\s+-\\s+(${g[h.XRANGEPLAIN]})\\s*$`);r("HYPHENRANGELOOSE",`^\\s*(${g[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${g[h.XRANGEPLAINLOOSE]})\\s*$`);r("STAR","(<|>)?=?\\s*\\*");r("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");r("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var i2=n((l$,XZ)=>{var KG=Object.freeze({loose:!0}),VG=Object.freeze({}),BG=(Z)=>{if(!Z)return VG;if(typeof Z!=="object")return KG;return Z};XZ.exports=BG});var D3=n((p$,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},HG=(Z,W)=>JZ(W,Z);GZ.exports={compareIdentifiers:JZ,rcompareIdentifiers:HG}});var P0=n((n$,zZ)=>{var r2=o4(),{MAX_LENGTH:YZ,MAX_SAFE_INTEGER:a2}=w4(),{safeRe:s2,t:o2}=D4(),$G=i2(),{compareIdentifiers:T3}=D3(),FG=(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 W6{constructor(Z,W){if(W=$G(W),Z instanceof W6)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>YZ)throw TypeError(`version is longer than ${YZ} characters`);r2("SemVer",Z,W),this.options=W,this.loose=!!W.loose,this.includePrerelease=!!W.includePrerelease;let X=Z.trim().match(W.loose?s2[o2.LOOSE]:s2[o2.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>a2||this.major<0)throw TypeError("Invalid major version");if(this.minor>a2||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>a2||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<a2)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(r2("SemVer.compare",this.version,this.options,Z),!(Z instanceof W6)){if(typeof Z==="string"&&Z===this.version)return 0;Z=new W6(Z,this.options)}if(Z.version===this.version)return 0;return this.compareMain(Z)||this.comparePre(Z)}compareMain(Z){if(!(Z instanceof W6))Z=new W6(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 W6))Z=new W6(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(r2("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 W6))Z=new W6(Z,this.options);let W=0;do{let X=this.build[W],Q=Z.build[W];if(r2("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?s2[o2.PRERELEASELOOSE]:s2[o2.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(FG(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}}zZ.exports=W6});var m6=n((i$,UZ)=>{var qZ=P0(),LG=(Z,W,X=!1)=>{if(Z instanceof qZ)return Z;try{return new qZ(Z,W)}catch(Q){if(!X)return null;throw Q}};UZ.exports=LG});var VZ=n((r$,KZ)=>{var AG=m6(),MG=(Z,W)=>{let X=AG(Z,W);return X?X.version:null};KZ.exports=MG});var HZ=n((a$,BZ)=>{var IG=m6(),NG=(Z,W)=>{let X=IG(Z.trim().replace(/^[=v]+/,""),W);return X?X.version:null};BZ.exports=NG});var LZ=n((s$,FZ)=>{var $Z=P0(),wG=(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=wG});var IZ=n((o$,MZ)=>{var AZ=m6(),DG=(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,Y=G?X:Q,U=G?Q:X,K=!!Y.prerelease.length;if(!!U.prerelease.length&&!K){if(!U.patch&&!U.minor)return"major";if(U.compareMain(Y)===0){if(U.minor&&!U.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=DG});var wZ=n((t$,NZ)=>{var TG=P0(),RG=(Z,W)=>new TG(Z,W).major;NZ.exports=RG});var TZ=n((e$,DZ)=>{var PG=P0(),_G=(Z,W)=>new PG(Z,W).minor;DZ.exports=_G});var PZ=n((ZF,RZ)=>{var jG=P0(),EG=(Z,W)=>new jG(Z,W).patch;RZ.exports=EG});var jZ=n((WF,_Z)=>{var CG=m6(),OG=(Z,W)=>{let X=CG(Z,W);return X&&X.prerelease.length?X.prerelease:null};_Z.exports=OG});var r0=n((XF,CZ)=>{var EZ=P0(),xG=(Z,W,X)=>new EZ(Z,X).compare(new EZ(W,X));CZ.exports=xG});var xZ=n((QF,OZ)=>{var kG=r0(),SG=(Z,W,X)=>kG(W,Z,X);OZ.exports=SG});var SZ=n((JF,kZ)=>{var bG=r0(),vG=(Z,W)=>bG(Z,W,!0);kZ.exports=vG});var t2=n((GF,vZ)=>{var bZ=P0(),yG=(Z,W,X)=>{let Q=new bZ(Z,X),J=new bZ(W,X);return Q.compare(J)||Q.compareBuild(J)};vZ.exports=yG});var gZ=n((YF,yZ)=>{var gG=t2(),hG=(Z,W)=>Z.sort((X,Q)=>gG(X,Q,W));yZ.exports=hG});var fZ=n((zF,hZ)=>{var fG=t2(),mG=(Z,W)=>Z.sort((X,Q)=>fG(Q,X,W));hZ.exports=mG});var t4=n((qF,mZ)=>{var uG=r0(),dG=(Z,W,X)=>uG(Z,W,X)>0;mZ.exports=dG});var e2=n((UF,uZ)=>{var cG=r0(),lG=(Z,W,X)=>cG(Z,W,X)<0;uZ.exports=lG});var R3=n((KF,dZ)=>{var pG=r0(),nG=(Z,W,X)=>pG(Z,W,X)===0;dZ.exports=nG});var P3=n((VF,cZ)=>{var iG=r0(),rG=(Z,W,X)=>iG(Z,W,X)!==0;cZ.exports=rG});var Z1=n((BF,lZ)=>{var aG=r0(),sG=(Z,W,X)=>aG(Z,W,X)>=0;lZ.exports=sG});var W1=n((HF,pZ)=>{var oG=r0(),tG=(Z,W,X)=>oG(Z,W,X)<=0;pZ.exports=tG});var _3=n(($F,nZ)=>{var eG=R3(),ZY=P3(),WY=t4(),XY=Z1(),QY=e2(),JY=W1(),GY=(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 eG(Z,X,Q);case"!=":return ZY(Z,X,Q);case">":return WY(Z,X,Q);case">=":return XY(Z,X,Q);case"<":return QY(Z,X,Q);case"<=":return JY(Z,X,Q);default:throw TypeError(`Invalid operator: ${W}`)}};nZ.exports=GY});var rZ=n((FF,iZ)=>{var YY=P0(),zY=m6(),{safeRe:X1,t:Q1}=D4(),qY=(Z,W)=>{if(Z instanceof YY)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?X1[Q1.COERCEFULL]:X1[Q1.COERCE]);else{let K=W.includePrerelease?X1[Q1.COERCERTLFULL]:X1[Q1.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",Y=W.includePrerelease&&X[5]?`-${X[5]}`:"",U=W.includePrerelease&&X[6]?`+${X[6]}`:"";return zY(`${Q}.${J}.${G}${Y}${U}`,W)};iZ.exports=qY});var sZ=n((LF,aZ)=>{var UY=m6(),KY=w4(),VY=P0(),BY=(Z,W,X)=>{if(!KY.RELEASE_TYPES.includes(W))return null;let Q=HY(Z,X);return Q&&$Y(Q,W)},HY=(Z,W)=>{let X=Z instanceof VY?Z.version:Z;return UY(X,W)},$Y=(Z,W)=>{if(FY(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()},FY=(Z)=>{return Z.startsWith("pre")};aZ.exports=BY});var eZ=n((AF,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 a0=n((MF,Q7)=>{var LY=/\s+/g;class e4{constructor(Z,W){if(W=MY(W),Z instanceof e4)if(Z.loose===!!W.loose&&Z.includePrerelease===!!W.includePrerelease)return Z;else return new e4(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(LY," "),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&&jY(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(_Y,"");let X=((this.options.includePrerelease&&RY)|(this.options.loose&&PY))+":"+Z,Q=Z7.get(X);if(Q)return Q;let J=this.options.loose,G=J?k0[_0.HYPHENRANGELOOSE]:k0[_0.HYPHENRANGE];Z=Z.replace(G,hY(this.options.includePrerelease)),z0("hyphen replace",Z),Z=Z.replace(k0[_0.COMPARATORTRIM],wY),z0("comparator trim",Z),Z=Z.replace(k0[_0.TILDETRIM],DY),z0("tilde trim",Z),Z=Z.replace(k0[_0.CARETTRIM],TY),z0("caret trim",Z);let Y=Z.split(" ").map((H)=>EY(H,this.options)).join(" ").split(/\s+/).map((H)=>gY(H,this.options));if(J)Y=Y.filter((H)=>{return z0("loose invalid filter",H,this.options),!!H.match(k0[_0.COMPARATORLOOSE])});z0("range list",Y);let U=new Map,K=Y.map((H)=>new j3(H,this.options));for(let H of K){if(W7(H))return[H];U.set(H.value,H)}if(U.size>1&&U.has(""))U.delete("");let V=[...U.values()];return Z7.set(X,V),V}intersects(Z,W){if(!(Z instanceof e4))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 IY(Z,this.options)}catch(W){return!1}for(let W=0;W<this.set.length;W++)if(fY(this.set[W],Z,this.options))return!0;return!1}}Q7.exports=e4;var AY=eZ(),Z7=new AY,MY=i2(),j3=Z2(),z0=o4(),IY=P0(),{safeRe:k0,src:NY,t:_0,comparatorTrimReplace:wY,tildeTrimReplace:DY,caretTrimReplace:TY}=D4(),{FLAG_INCLUDE_PRERELEASE:RY,FLAG_LOOSE:PY}=w4(),_Y=new RegExp(NY[_0.BUILD],"g"),W7=(Z)=>Z.value==="<0.0.0-0",jY=(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},EY=(Z,W)=>{return Z=Z.replace(k0[_0.BUILD],""),z0("comp",Z,W),Z=kY(Z,W),z0("caret",Z),Z=OY(Z,W),z0("tildes",Z),Z=bY(Z,W),z0("xrange",Z),Z=yY(Z,W),z0("stars",Z),Z},A0=(Z)=>!Z||Z.toLowerCase()==="x"||Z==="*",CY=(Z,W,X)=>A0(Z)&&!A0(W)||A0(W)&&X&&!A0(X),OY=(Z,W)=>{return Z.trim().split(/\s+/).map((X)=>xY(X,W)).join(" ")},xY=(Z,W)=>{let X=W.loose?k0[_0.TILDELOOSE]:k0[_0.TILDE],Q=W.includePrerelease?"-0":"";return Z.replace(X,(J,G,Y,U,K)=>{z0("tilde",Z,J,G,Y,U,K);let V;if(A0(G))V="";else if(A0(Y))V=`>=${G}.0.0${Q} <${+G+1}.0.0-0`;else if(A0(U))V=`>=${G}.${Y}.0${Q} <${G}.${+Y+1}.0-0`;else if(K)z0("replaceTilde pr",K),V=`>=${G}.${Y}.${U}-${K} <${G}.${+Y+1}.0-0`;else V=`>=${G}.${Y}.${U} <${G}.${+Y+1}.0-0`;return z0("tilde return",V),V})},kY=(Z,W)=>{return Z.trim().split(/\s+/).map((X)=>SY(X,W)).join(" ")},SY=(Z,W)=>{z0("caret",Z,W);let X=W.loose?k0[_0.CARETLOOSE]:k0[_0.CARET],Q=W.includePrerelease?"-0":"";return Z.replace(X,(J,G,Y,U,K)=>{z0("caret",Z,J,G,Y,U,K);let V;if(A0(G))V="";else if(A0(Y))V=`>=${G}.0.0${Q} <${+G+1}.0.0-0`;else if(A0(U))if(G==="0")V=`>=${G}.${Y}.0${Q} <${G}.${+Y+1}.0-0`;else V=`>=${G}.${Y}.0${Q} <${+G+1}.0.0-0`;else if(K)if(z0("replaceCaret pr",K),G==="0")if(Y==="0")V=`>=${G}.${Y}.${U}-${K} <${G}.${Y}.${+U+1}-0`;else V=`>=${G}.${Y}.${U}-${K} <${G}.${+Y+1}.0-0`;else V=`>=${G}.${Y}.${U}-${K} <${+G+1}.0.0-0`;else if(z0("no pr"),G==="0")if(Y==="0")V=`>=${G}.${Y}.${U} <${G}.${Y}.${+U+1}-0`;else V=`>=${G}.${Y}.${U} <${G}.${+Y+1}.0-0`;else V=`>=${G}.${Y}.${U} <${+G+1}.0.0-0`;return z0("caret return",V),V})},bY=(Z,W)=>{return z0("replaceXRanges",Z,W),Z.split(/\s+/).map((X)=>vY(X,W)).join(" ")},vY=(Z,W)=>{Z=Z.trim();let X=W.loose?k0[_0.XRANGELOOSE]:k0[_0.XRANGE];return Z.replace(X,(Q,J,G,Y,U,K)=>{if(z0("xRange",Z,Q,J,G,Y,U,K),CY(G,Y,U))return Z;let V=A0(G),H=V||A0(Y),B=H||A0(U),$=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)Y=0;if(U=0,J===">")if(J=">=",H)G=+G+1,Y=0,U=0;else Y=+Y+1,U=0;else if(J==="<=")if(J="<",H)G=+G+1;else Y=+Y+1;if(J==="<")K="-0";Q=`${J+G}.${Y}.${U}${K}`}else if(H)Q=`>=${G}.0.0${K} <${+G+1}.0.0-0`;else if(B)Q=`>=${G}.${Y}.0${K} <${G}.${+Y+1}.0-0`;return z0("xRange return",Q),Q})},yY=(Z,W)=>{return z0("replaceStars",Z,W),Z.trim().replace(k0[_0.STAR],"")},gY=(Z,W)=>{return z0("replaceGTE0",Z,W),Z.trim().replace(k0[W.includePrerelease?_0.GTE0PRE:_0.GTE0],"")},hY=(Z)=>(W,X,Q,J,G,Y,U,K,V,H,B,$)=>{if(A0(Q))X="";else if(A0(J))X=`>=${Q}.0.0${Z?"-0":""}`;else if(A0(G))X=`>=${Q}.${J}.0${Z?"-0":""}`;else if(Y)X=`>=${X}`;else X=`>=${X}${Z?"-0":""}`;if(A0(V))K="";else if(A0(H))K=`<${+V+1}.0.0-0`;else if(A0(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()},fY=(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 Z2=n((IF,U7)=>{var W2=Symbol("SemVer ANY");class J1{static get ANY(){return W2}constructor(Z,W){if(W=J7(W),Z instanceof J1)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===W2)this.value="";else this.value=this.operator+this.semver.version;C3("comp",this)}parse(Z){let W=this.options.loose?G7[Y7.COMPARATORLOOSE]:G7[Y7.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=W2;else this.semver=new z7(X[2],this.options.loose)}toString(){return this.value}test(Z){if(C3("Comparator.test",Z,this.options.loose),this.semver===W2||Z===W2)return!0;if(typeof Z==="string")try{Z=new z7(Z,this.options)}catch(W){return!1}return E3(Z,this.operator,this.semver,this.options)}intersects(Z,W){if(!(Z instanceof J1))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new q7(Z.value,W).test(this.value)}else if(Z.operator===""){if(Z.value==="")return!0;return new q7(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}}U7.exports=J1;var J7=i2(),{safeRe:G7,t:Y7}=D4(),E3=_3(),C3=o4(),z7=P0(),q7=a0()});var X2=n((NF,K7)=>{var mY=a0(),uY=(Z,W,X)=>{try{W=new mY(W,X)}catch(Q){return!1}return W.test(Z)};K7.exports=uY});var B7=n((wF,V7)=>{var dY=a0(),cY=(Z,W)=>new dY(Z,W).set.map((X)=>X.map((Q)=>Q.value).join(" ").trim().split(" "));V7.exports=cY});var $7=n((DF,H7)=>{var lY=P0(),pY=a0(),nY=(Z,W,X)=>{let Q=null,J=null,G=null;try{G=new pY(W,X)}catch(Y){return null}return Z.forEach((Y)=>{if(G.test(Y)){if(!Q||J.compare(Y)===-1)Q=Y,J=new lY(Q,X)}}),Q};H7.exports=nY});var L7=n((TF,F7)=>{var iY=P0(),rY=a0(),aY=(Z,W,X)=>{let Q=null,J=null,G=null;try{G=new rY(W,X)}catch(Y){return null}return Z.forEach((Y)=>{if(G.test(Y)){if(!Q||J.compare(Y)===1)Q=Y,J=new iY(Q,X)}}),Q};F7.exports=aY});var I7=n((RF,M7)=>{var O3=P0(),sY=a0(),A7=t4(),oY=(Z,W)=>{Z=new sY(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((Y)=>{let U=new O3(Y.semver.version);switch(Y.operator){case">":if(U.prerelease.length===0)U.patch++;else U.prerelease.push(0);U.raw=U.format();case"":case">=":if(!G||A7(U,G))G=U;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${Y.operator}`)}}),G&&(!X||A7(X,G)))X=G}if(X&&Z.test(X))return X;return null};M7.exports=oY});var w7=n((PF,N7)=>{var tY=a0(),eY=(Z,W)=>{try{return new tY(Z,W).range||"*"}catch(X){return null}};N7.exports=eY});var G1=n((_F,P7)=>{var Zz=P0(),R7=Z2(),{ANY:Wz}=R7,Xz=a0(),Qz=X2(),D7=t4(),T7=e2(),Jz=W1(),Gz=Z1(),Yz=(Z,W,X,Q)=>{Z=new Zz(Z,Q),W=new Xz(W,Q);let J,G,Y,U,K;switch(X){case">":J=D7,G=Jz,Y=T7,U=">",K=">=";break;case"<":J=T7,G=Gz,Y=D7,U="<",K="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(Qz(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===Wz)L=new R7(">=0.0.0");if(B=B||L,$=$||L,J(L.semver,B.semver,Q))B=L;else if(Y(L.semver,$.semver,Q))$=L}),B.operator===U||B.operator===K)return!1;if((!$.operator||$.operator===U)&&G(Z,$.semver))return!1;else if($.operator===K&&Y(Z,$.semver))return!1}return!0};P7.exports=Yz});var j7=n((jF,_7)=>{var zz=G1(),qz=(Z,W,X)=>zz(Z,W,">",X);_7.exports=qz});var C7=n((EF,E7)=>{var Uz=G1(),Kz=(Z,W,X)=>Uz(Z,W,"<",X);E7.exports=Kz});var k7=n((CF,x7)=>{var O7=a0(),Vz=(Z,W,X)=>{return Z=new O7(Z,X),W=new O7(W,X),Z.intersects(W,X)};x7.exports=Vz});var b7=n((OF,S7)=>{var Bz=X2(),Hz=r0();S7.exports=(Z,W,X)=>{let Q=[],J=null,G=null,Y=Z.sort((H,B)=>Hz(H,B,X));for(let H of Y)if(Bz(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 U=[];for(let[H,B]of Q)if(H===B)U.push(H);else if(!B&&H===Y[0])U.push("*");else if(!B)U.push(`>=${H}`);else if(H===Y[0])U.push(`<=${B}`);else U.push(`${H} - ${B}`);let K=U.join(" || "),V=typeof W.raw==="string"?W.raw:String(W);return K.length<V.length?K:W}});var m7=n((xF,f7)=>{var v7=a0(),S3=Z2(),{ANY:x3}=S3,k3=X2(),b3=r0(),$z=(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 Y=Lz(J,G,X);if(Q=Q||Y!==null,Y)continue Z}if(Q)return!1}return!0},Fz=[new S3(">=0.0.0-0")],y7=[new S3(">=0.0.0")],Lz=(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=Fz;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 Y;if(J&&G){if(Y=b3(J.semver,G.semver,X),Y>0)return null;else if(Y===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 U,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(U=g7(J,L,X),U===L&&U!==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)&&Y!==0)return!1}if(J&&V&&!G&&Y!==0)return!1;if(G&&H&&!J&&Y!==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=$z});var l7=n((kF,c7)=>{var v3=D4(),u7=w4(),Az=P0(),d7=D3(),Mz=m6(),Iz=VZ(),Nz=HZ(),wz=LZ(),Dz=IZ(),Tz=wZ(),Rz=TZ(),Pz=PZ(),_z=jZ(),jz=r0(),Ez=xZ(),Cz=SZ(),Oz=t2(),xz=gZ(),kz=fZ(),Sz=t4(),bz=e2(),vz=R3(),yz=P3(),gz=Z1(),hz=W1(),fz=_3(),mz=rZ(),uz=sZ(),dz=Z2(),cz=a0(),lz=X2(),pz=B7(),nz=$7(),iz=L7(),rz=I7(),az=w7(),sz=G1(),oz=j7(),tz=C7(),ez=k7(),Zq=b7(),Wq=m7();c7.exports={parse:Mz,valid:Iz,clean:Nz,inc:wz,diff:Dz,major:Tz,minor:Rz,patch:Pz,prerelease:_z,compare:jz,rcompare:Ez,compareLoose:Cz,compareBuild:Oz,sort:xz,rsort:kz,gt:Sz,lt:bz,eq:vz,neq:yz,gte:gz,lte:hz,cmp:fz,coerce:mz,truncate:uz,Comparator:dz,Range:cz,satisfies:lz,toComparators:pz,maxSatisfying:nz,minSatisfying:iz,minVersion:rz,validRange:az,outside:sz,gtr:oz,ltr:tz,intersects:ez,simplifyRange:Zq,subset:Wq,SemVer:Az,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 j6;var Y1=c(()=>{j6={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.3",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.{cts,mts}","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.5"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.3","@img/sharp-darwin-x64":"0.35.3","@img/sharp-freebsd-wasm32":"0.35.3","@img/sharp-libvips-darwin-arm64":"1.3.2","@img/sharp-libvips-darwin-x64":"1.3.2","@img/sharp-libvips-linux-arm":"1.3.2","@img/sharp-libvips-linux-arm64":"1.3.2","@img/sharp-libvips-linux-ppc64":"1.3.2","@img/sharp-libvips-linux-riscv64":"1.3.2","@img/sharp-libvips-linux-s390x":"1.3.2","@img/sharp-libvips-linux-x64":"1.3.2","@img/sharp-libvips-linuxmusl-arm64":"1.3.2","@img/sharp-libvips-linuxmusl-x64":"1.3.2","@img/sharp-linux-arm":"0.35.3","@img/sharp-linux-arm64":"0.35.3","@img/sharp-linux-ppc64":"0.35.3","@img/sharp-linux-riscv64":"0.35.3","@img/sharp-linux-s390x":"0.35.3","@img/sharp-linux-x64":"0.35.3","@img/sharp-linuxmusl-arm64":"0.35.3","@img/sharp-linuxmusl-x64":"0.35.3","@img/sharp-webcontainers-wasm32":"0.35.3","@img/sharp-win32-arm64":"0.35.3","@img/sharp-win32-ia32":"0.35.3","@img/sharp-win32-x64":"0.35.3"},peerDependenciesMeta:{"@types/node":{optional:!0}},devDependencies:{"@biomejs/biome":"^2.5.1","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.1","@img/sharp-libvips-dev":"1.3.2","@img/sharp-libvips-dev-wasm32":"1.3.2","@img/sharp-libvips-win32-arm64":"1.3.2","@img/sharp-libvips-win32-ia32":"1.3.2","@img/sharp-libvips-win32-x64":"1.3.2","@types/node":"*",emnapi:"^1.11.1","exif-reader":"^2.0.3","extract-zip":"^2.0.1",icc:"^4.0.0","node-addon-api":"^8.9.0","node-gyp":"^12.4.0",publint:"^0.3.21","tar-fs":"^3.1.3",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 Q2}from"node:child_process";import{createHash as Qq}from"node:crypto";var J2,g3,Jq,n7,Gq,h3,Yq=(Z)=>{if(Z instanceof Error)console.error(`sharp: Installation error: ${Z.message}`);else console.log(`sharp: ${Z}`)},i7=()=>g3.default.isNonGlibcLinuxSync()?g3.default.familySync():"",zq=()=>`${process.platform}${i7()}-${process.arch}`,T4=()=>{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}`},qq=()=>{try{return T0(`@img/sharp-libvips-dev-${T4()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},Uq=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},Kq=()=>{try{return T0(`@img/sharp-libvips-dev-${T4()}/lib`)}catch{try{return T0(`@img/sharp-libvips-${T4()}/lib`)}catch{}}return""},Vq=()=>{if(process.release?.name==="node"&&process.versions){if(!J2.default.satisfies(process.versions.node,j6.engines.node))return{found:process.versions.node,expected:j6.engines.node}}},r7=()=>{let{CC:Z}=process.env;return Boolean(Z?.endsWith("/emcc"))},Bq=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(Q2("sysctl sysctl.proc_translated",h3).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},p7=(Z)=>Qq("sha512").update(Z).digest("hex"),Hq=()=>{try{let Z=p7(`imgsharp-libvips-${T4()}`),W=J2.default.coerce(j6.optionalDependencies[`@img/sharp-libvips-${T4()}`],{includePrerelease:!0}).version;return p7(`${Z}npm:${W}`).slice(0,10)}catch{}return""},$q=()=>Q2(`node-gyp rebuild --directory=src ${r7()?"--nodedir=emscripten":""}`,{...h3,stdio:"inherit"}).status,a7=()=>{if(process.platform!=="win32")return(Q2("pkg-config --modversion vips-cpp",{...h3,env:{...process.env,PKG_CONFIG_PATH:s7()}}).stdout||"").trim();else return""},Fq=()=>{try{let Z=(Q2("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(Z)return`${Z}/lib/pkgconfig`}catch(Z){}return},Lq=()=>{try{let Z=(Q2("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(Z)return Z}catch(Z){}return},s7=()=>{if(process.platform!=="win32")return[Fq(),Lq(),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},Aq=(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(Bq())return y3(!1,"Rosetta",Z);let W=a7();return!!W&&J2.default.gte(W,n7)},z1;var f3=c(()=>{Y1();J2=g4(l7(),1),g3=g4(n2(),1);/*!
209
+ */z={defined:E9,object:_J,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 x9=n((d$,O9)=>{var C9=()=>process.platform==="linux",l2=null,uJ=()=>{if(!l2)if(C9()&&process.report){let Z=process.report.excludeNetwork;process.report.excludeNetwork=!0,l2=process.report.getReport(),process.report.excludeNetwork=Z}else l2={};return l2};O9.exports={isLinux:C9,getReport:uJ}});var S9=n((c$,k9)=>{var I4=T0("fs"),dJ=(Z)=>{let W=I4.openSync(Z,"r"),X=Buffer.alloc(2048),Q=I4.readSync(W,X,0,2048,0);return I4.close(W,()=>{}),X.subarray(0,Q)},cJ=(Z)=>new Promise((W,X)=>{I4.open(Z,"r",(Q,J)=>{if(Q)X(Q);else{let G=Buffer.alloc(2048);I4.read(J,G,0,2048,0,(Y,U)=>{W(G.subarray(0,U)),I4.close(J,()=>{})})}})});k9.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:dJ,readFile:cJ}});var v9=n((l$,b9)=>{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 U=Z.readUInt32LE(G+8),K=Z.readUInt32LE(G+32);return Z.subarray(U,U+K).toString().replace(/\0.*$/g,"")}}return null};b9.exports={interpreterPath:lJ}});var n2=n((p$,t9)=>{var g9=T0("child_process"),{isLinux:N4,getReport:h9}=x9(),{LDD_PATH:p2,SELF_PATH:f9,readFile:M3,readFileSync:I3}=S9(),{interpreterPath:m9}=v9(),z6,q6,U6,f6="",u9=()=>{if(!f6)return new Promise((Z)=>{g9.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(W,X)=>{f6=W?" ":X,Z(f6)})});return f6},d9=()=>{if(!f6)try{f6=g9.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(Z){f6=" "}return f6},j6="glibc",c9=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,t6="musl",pJ=(Z)=>Z.includes("libc.musl-")||Z.includes("ld-musl-"),l9=()=>{let Z=h9();if(Z.header&&Z.header.glibcVersionRuntime)return j6;if(Array.isArray(Z.sharedObjects)){if(Z.sharedObjects.some(pJ))return t6}return null},p9=(Z)=>{let[W,X]=Z.split(/[\r\n]+/);if(W&&W.includes(j6))return j6;if(X&&X.includes(t6))return t6;return null},n9=(Z)=>{if(Z){if(Z.includes("/ld-musl-"))return t6;else if(Z.includes("/ld-linux-"))return j6}return null},i9=(Z)=>{if(Z=Z.toString(),Z.includes("musl"))return t6;if(Z.includes("GNU C Library"))return j6;return null},nJ=async()=>{if(q6!==void 0)return q6;q6=null;try{let Z=await M3(p2);q6=i9(Z)}catch(Z){}return q6},iJ=()=>{if(q6!==void 0)return q6;q6=null;try{let Z=I3(p2);q6=i9(Z)}catch(Z){}return q6},rJ=async()=>{if(z6!==void 0)return z6;z6=null;try{let Z=await M3(f9),W=m9(Z);z6=n9(W)}catch(Z){}return z6},aJ=()=>{if(z6!==void 0)return z6;z6=null;try{let Z=I3(f9),W=m9(Z);z6=n9(W)}catch(Z){}return z6},r9=async()=>{let Z=null;if(N4()){if(Z=await rJ(),!Z){if(Z=await nJ(),!Z)Z=l9();if(!Z){let W=await u9();Z=p9(W)}}}return Z},a9=()=>{let Z=null;if(N4()){if(Z=aJ(),!Z){if(Z=iJ(),!Z)Z=l9();if(!Z){let W=d9();Z=p9(W)}}}return Z},sJ=async()=>N4()&&await r9()!==j6,oJ=()=>N4()&&a9()!==j6,tJ=async()=>{if(U6!==void 0)return U6;U6=null;try{let W=(await M3(p2)).match(c9);if(W)U6=W[1]}catch(Z){}return U6},eJ=()=>{if(U6!==void 0)return U6;U6=null;try{let W=I3(p2).match(c9);if(W)U6=W[1]}catch(Z){}return U6},s9=()=>{let Z=h9();if(Z.header&&Z.header.glibcVersionRuntime)return Z.header.glibcVersionRuntime;return null},y9=(Z)=>Z.trim().split(/\s+/)[1],o9=(Z)=>{let[W,X,Q]=Z.split(/[\r\n]+/);if(W&&W.includes(j6))return y9(W);if(X&&Q&&X.includes(t6))return y9(Q);return null},ZG=async()=>{let Z=null;if(N4()){if(Z=await tJ(),!Z)Z=s9();if(!Z){let W=await u9();Z=o9(W)}}return Z},WG=()=>{let Z=null;if(N4()){if(Z=eJ(),!Z)Z=s9();if(!Z){let W=d9();Z=o9(W)}}return Z};t9.exports={GLIBC:j6,MUSL:t6,family:r9,familySync:a9,isNonGlibcLinux:sJ,isNonGlibcLinuxSync:oJ,version:ZG,versionSync:WG}});var w4=n((n$,e9)=>{var XG=Number.MAX_SAFE_INTEGER||9007199254740991,QG=["major","premajor","minor","preminor","patch","prepatch","prerelease"];e9.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 o4=n((i$,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 D4=n((K6,WZ)=>{var{MAX_SAFE_COMPONENT_LENGTH:N3,MAX_SAFE_BUILD_LENGTH:GG,MAX_LENGTH:YG}=w4(),zG=o4();K6=WZ.exports={};var qG=K6.re=[],UG=K6.safeRe=[],g=K6.src=[],KG=K6.safeSrc=[],h=K6.t={},VG=0,w3="[a-zA-Z0-9-]",BG=[["\\s",1],["\\d",YG],[w3,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},r=(Z,W,X)=>{let Q=HG(W),J=VG++;zG(Z,J,W),h[Z]=J,g[J]=W,KG[J]=Q,qG[J]=new RegExp(W,X?"g":void 0),UG[J]=new RegExp(Q,X?"g":void 0)};r("NUMERICIDENTIFIER","0|[1-9]\\d*");r("NUMERICIDENTIFIERLOOSE","\\d+");r("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${w3}*`);r("MAINVERSION",`(${g[h.NUMERICIDENTIFIER]})\\.(${g[h.NUMERICIDENTIFIER]})\\.(${g[h.NUMERICIDENTIFIER]})`);r("MAINVERSIONLOOSE",`(${g[h.NUMERICIDENTIFIERLOOSE]})\\.(${g[h.NUMERICIDENTIFIERLOOSE]})\\.(${g[h.NUMERICIDENTIFIERLOOSE]})`);r("PRERELEASEIDENTIFIER",`(?:${g[h.NONNUMERICIDENTIFIER]}|${g[h.NUMERICIDENTIFIER]})`);r("PRERELEASEIDENTIFIERLOOSE",`(?:${g[h.NONNUMERICIDENTIFIER]}|${g[h.NUMERICIDENTIFIERLOOSE]})`);r("PRERELEASE",`(?:-(${g[h.PRERELEASEIDENTIFIER]}(?:\\.${g[h.PRERELEASEIDENTIFIER]})*))`);r("PRERELEASELOOSE",`(?:-?(${g[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${g[h.PRERELEASEIDENTIFIERLOOSE]})*))`);r("BUILDIDENTIFIER",`${w3}+`);r("BUILD",`(?:\\+(${g[h.BUILDIDENTIFIER]}(?:\\.${g[h.BUILDIDENTIFIER]})*))`);r("FULLPLAIN",`v?${g[h.MAINVERSION]}${g[h.PRERELEASE]}?${g[h.BUILD]}?`);r("FULL",`^${g[h.FULLPLAIN]}$`);r("LOOSEPLAIN",`[v=\\s]*${g[h.MAINVERSIONLOOSE]}${g[h.PRERELEASELOOSE]}?${g[h.BUILD]}?`);r("LOOSE",`^${g[h.LOOSEPLAIN]}$`);r("GTLT","((?:<|>)?=?)");r("XRANGEIDENTIFIERLOOSE",`${g[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);r("XRANGEIDENTIFIER",`${g[h.NUMERICIDENTIFIER]}|x|X|\\*`);r("XRANGEPLAIN",`[v=\\s]*(${g[h.XRANGEIDENTIFIER]})(?:\\.(${g[h.XRANGEIDENTIFIER]})(?:\\.(${g[h.XRANGEIDENTIFIER]})(?:${g[h.PRERELEASE]})?${g[h.BUILD]}?)?)?`);r("XRANGEPLAINLOOSE",`[v=\\s]*(${g[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${g[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${g[h.XRANGEIDENTIFIERLOOSE]})(?:${g[h.PRERELEASELOOSE]})?${g[h.BUILD]}?)?)?`);r("XRANGE",`^${g[h.GTLT]}\\s*${g[h.XRANGEPLAIN]}$`);r("XRANGELOOSE",`^${g[h.GTLT]}\\s*${g[h.XRANGEPLAINLOOSE]}$`);r("COERCEPLAIN",`(^|[^\\d])(\\d{1,${N3}})(?:\\.(\\d{1,${N3}}))?(?:\\.(\\d{1,${N3}}))?`);r("COERCE",`${g[h.COERCEPLAIN]}(?:$|[^\\d])`);r("COERCEFULL",g[h.COERCEPLAIN]+`(?:${g[h.PRERELEASE]})?(?:${g[h.BUILD]})?(?:$|[^\\d])`);r("COERCERTL",g[h.COERCE],!0);r("COERCERTLFULL",g[h.COERCEFULL],!0);r("LONETILDE","(?:~>?)");r("TILDETRIM",`(\\s*)${g[h.LONETILDE]}\\s+`,!0);K6.tildeTrimReplace="$1~";r("TILDE",`^${g[h.LONETILDE]}${g[h.XRANGEPLAIN]}$`);r("TILDELOOSE",`^${g[h.LONETILDE]}${g[h.XRANGEPLAINLOOSE]}$`);r("LONECARET","(?:\\^)");r("CARETTRIM",`(\\s*)${g[h.LONECARET]}\\s+`,!0);K6.caretTrimReplace="$1^";r("CARET",`^${g[h.LONECARET]}${g[h.XRANGEPLAIN]}$`);r("CARETLOOSE",`^${g[h.LONECARET]}${g[h.XRANGEPLAINLOOSE]}$`);r("COMPARATORLOOSE",`^${g[h.GTLT]}\\s*(${g[h.LOOSEPLAIN]})$|^$`);r("COMPARATOR",`^${g[h.GTLT]}\\s*(${g[h.FULLPLAIN]})$|^$`);r("COMPARATORTRIM",`(\\s*)${g[h.GTLT]}\\s*(${g[h.LOOSEPLAIN]}|${g[h.XRANGEPLAIN]})`,!0);K6.comparatorTrimReplace="$1$2$3";r("HYPHENRANGE",`^\\s*(${g[h.XRANGEPLAIN]})\\s+-\\s+(${g[h.XRANGEPLAIN]})\\s*$`);r("HYPHENRANGELOOSE",`^\\s*(${g[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${g[h.XRANGEPLAINLOOSE]})\\s*$`);r("STAR","(<|>)?=?\\s*\\*");r("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");r("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var i2=n((r$,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=n((a$,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=n((s$,zZ)=>{var r2=o4(),{MAX_LENGTH:YZ,MAX_SAFE_INTEGER:a2}=w4(),{safeRe:s2,t:o2}=D4(),MG=i2(),{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 W6{constructor(Z,W){if(W=MG(W),Z instanceof W6)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>YZ)throw TypeError(`version is longer than ${YZ} characters`);r2("SemVer",Z,W),this.options=W,this.loose=!!W.loose,this.includePrerelease=!!W.includePrerelease;let X=Z.trim().match(W.loose?s2[o2.LOOSE]:s2[o2.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>a2||this.major<0)throw TypeError("Invalid major version");if(this.minor>a2||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>a2||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<a2)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(r2("SemVer.compare",this.version,this.options,Z),!(Z instanceof W6)){if(typeof Z==="string"&&Z===this.version)return 0;Z=new W6(Z,this.options)}if(Z.version===this.version)return 0;return this.compareMain(Z)||this.comparePre(Z)}compareMain(Z){if(!(Z instanceof W6))Z=new W6(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 W6))Z=new W6(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(r2("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 W6))Z=new W6(Z,this.options);let W=0;do{let X=this.build[W],Q=Z.build[W];if(r2("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?s2[o2.PRERELEASELOOSE]:s2[o2.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}}zZ.exports=W6});var m6=n((o$,UZ)=>{var qZ=P0(),NG=(Z,W,X=!1)=>{if(Z instanceof qZ)return Z;try{return new qZ(Z,W)}catch(Q){if(!X)return null;throw Q}};UZ.exports=NG});var VZ=n((t$,KZ)=>{var wG=m6(),DG=(Z,W)=>{let X=wG(Z,W);return X?X.version:null};KZ.exports=DG});var HZ=n((e$,BZ)=>{var TG=m6(),RG=(Z,W)=>{let X=TG(Z.trim().replace(/^[=v]+/,""),W);return X?X.version:null};BZ.exports=RG});var LZ=n((ZF,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=n((WF,MZ)=>{var AZ=m6(),jG=(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,Y=G?X:Q,U=G?Q:X,K=!!Y.prerelease.length;if(!!U.prerelease.length&&!K){if(!U.patch&&!U.minor)return"major";if(U.compareMain(Y)===0){if(U.minor&&!U.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=jG});var wZ=n((XF,NZ)=>{var _G=P0(),EG=(Z,W)=>new _G(Z,W).major;NZ.exports=EG});var TZ=n((QF,DZ)=>{var CG=P0(),OG=(Z,W)=>new CG(Z,W).minor;DZ.exports=OG});var PZ=n((JF,RZ)=>{var xG=P0(),kG=(Z,W)=>new xG(Z,W).patch;RZ.exports=kG});var _Z=n((GF,jZ)=>{var SG=m6(),bG=(Z,W)=>{let X=SG(Z,W);return X&&X.prerelease.length?X.prerelease:null};jZ.exports=bG});var r0=n((YF,CZ)=>{var EZ=P0(),vG=(Z,W,X)=>new EZ(Z,X).compare(new EZ(W,X));CZ.exports=vG});var xZ=n((zF,OZ)=>{var yG=r0(),gG=(Z,W,X)=>yG(W,Z,X);OZ.exports=gG});var SZ=n((qF,kZ)=>{var hG=r0(),fG=(Z,W)=>hG(Z,W,!0);kZ.exports=fG});var t2=n((UF,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=n((KF,yZ)=>{var uG=t2(),dG=(Z,W)=>Z.sort((X,Q)=>uG(X,Q,W));yZ.exports=dG});var fZ=n((VF,hZ)=>{var cG=t2(),lG=(Z,W)=>Z.sort((X,Q)=>cG(Q,X,W));hZ.exports=lG});var t4=n((BF,mZ)=>{var pG=r0(),nG=(Z,W,X)=>pG(Z,W,X)>0;mZ.exports=nG});var e2=n((HF,uZ)=>{var iG=r0(),rG=(Z,W,X)=>iG(Z,W,X)<0;uZ.exports=rG});var R3=n(($F,dZ)=>{var aG=r0(),sG=(Z,W,X)=>aG(Z,W,X)===0;dZ.exports=sG});var P3=n((FF,cZ)=>{var oG=r0(),tG=(Z,W,X)=>oG(Z,W,X)!==0;cZ.exports=tG});var Z1=n((LF,lZ)=>{var eG=r0(),ZY=(Z,W,X)=>eG(Z,W,X)>=0;lZ.exports=ZY});var W1=n((AF,pZ)=>{var WY=r0(),XY=(Z,W,X)=>WY(Z,W,X)<=0;pZ.exports=XY});var j3=n((MF,nZ)=>{var QY=R3(),JY=P3(),GY=t4(),YY=Z1(),zY=e2(),qY=W1(),UY=(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 QY(Z,X,Q);case"!=":return JY(Z,X,Q);case">":return GY(Z,X,Q);case">=":return YY(Z,X,Q);case"<":return zY(Z,X,Q);case"<=":return qY(Z,X,Q);default:throw TypeError(`Invalid operator: ${W}`)}};nZ.exports=UY});var rZ=n((IF,iZ)=>{var KY=P0(),VY=m6(),{safeRe:X1,t:Q1}=D4(),BY=(Z,W)=>{if(Z instanceof KY)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?X1[Q1.COERCEFULL]:X1[Q1.COERCE]);else{let K=W.includePrerelease?X1[Q1.COERCERTLFULL]:X1[Q1.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",Y=W.includePrerelease&&X[5]?`-${X[5]}`:"",U=W.includePrerelease&&X[6]?`+${X[6]}`:"";return VY(`${Q}.${J}.${G}${Y}${U}`,W)};iZ.exports=BY});var sZ=n((NF,aZ)=>{var HY=m6(),$Y=w4(),FY=P0(),LY=(Z,W,X)=>{if(!$Y.RELEASE_TYPES.includes(W))return null;let Q=AY(Z,X);return Q&&MY(Q,W)},AY=(Z,W)=>{let X=Z instanceof FY?Z.version:Z;return HY(X,W)},MY=(Z,W)=>{if(IY(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()},IY=(Z)=>{return Z.startsWith("pre")};aZ.exports=LY});var eZ=n((wF,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 a0=n((DF,Q7)=>{var NY=/\s+/g;class e4{constructor(Z,W){if(W=DY(W),Z instanceof e4)if(Z.loose===!!W.loose&&Z.includePrerelease===!!W.includePrerelease)return Z;else return new e4(Z.raw,W);if(Z instanceof _3)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(NY," "),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&&xY(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(OY,"");let X=((this.options.includePrerelease&&EY)|(this.options.loose&&CY))+":"+Z,Q=Z7.get(X);if(Q)return Q;let J=this.options.loose,G=J?k0[j0.HYPHENRANGELOOSE]:k0[j0.HYPHENRANGE];Z=Z.replace(G,dY(this.options.includePrerelease)),z0("hyphen replace",Z),Z=Z.replace(k0[j0.COMPARATORTRIM],PY),z0("comparator trim",Z),Z=Z.replace(k0[j0.TILDETRIM],jY),z0("tilde trim",Z),Z=Z.replace(k0[j0.CARETTRIM],_Y),z0("caret trim",Z);let Y=Z.split(" ").map((H)=>kY(H,this.options)).join(" ").split(/\s+/).map((H)=>uY(H,this.options));if(J)Y=Y.filter((H)=>{return z0("loose invalid filter",H,this.options),!!H.match(k0[j0.COMPARATORLOOSE])});z0("range list",Y);let U=new Map,K=Y.map((H)=>new _3(H,this.options));for(let H of K){if(W7(H))return[H];U.set(H.value,H)}if(U.size>1&&U.has(""))U.delete("");let V=[...U.values()];return Z7.set(X,V),V}intersects(Z,W){if(!(Z instanceof e4))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 TY(Z,this.options)}catch(W){return!1}for(let W=0;W<this.set.length;W++)if(cY(this.set[W],Z,this.options))return!0;return!1}}Q7.exports=e4;var wY=eZ(),Z7=new wY,DY=i2(),_3=Z2(),z0=o4(),TY=P0(),{safeRe:k0,src:RY,t:j0,comparatorTrimReplace:PY,tildeTrimReplace:jY,caretTrimReplace:_Y}=D4(),{FLAG_INCLUDE_PRERELEASE:EY,FLAG_LOOSE:CY}=w4(),OY=new RegExp(RY[j0.BUILD],"g"),W7=(Z)=>Z.value==="<0.0.0-0",xY=(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},kY=(Z,W)=>{return Z=Z.replace(k0[j0.BUILD],""),z0("comp",Z,W),Z=yY(Z,W),z0("caret",Z),Z=bY(Z,W),z0("tildes",Z),Z=hY(Z,W),z0("xrange",Z),Z=mY(Z,W),z0("stars",Z),Z},A0=(Z)=>!Z||Z.toLowerCase()==="x"||Z==="*",SY=(Z,W,X)=>A0(Z)&&!A0(W)||A0(W)&&X&&!A0(X),bY=(Z,W)=>{return Z.trim().split(/\s+/).map((X)=>vY(X,W)).join(" ")},vY=(Z,W)=>{let X=W.loose?k0[j0.TILDELOOSE]:k0[j0.TILDE],Q=W.includePrerelease?"-0":"";return Z.replace(X,(J,G,Y,U,K)=>{z0("tilde",Z,J,G,Y,U,K);let V;if(A0(G))V="";else if(A0(Y))V=`>=${G}.0.0${Q} <${+G+1}.0.0-0`;else if(A0(U))V=`>=${G}.${Y}.0${Q} <${G}.${+Y+1}.0-0`;else if(K)z0("replaceTilde pr",K),V=`>=${G}.${Y}.${U}-${K} <${G}.${+Y+1}.0-0`;else V=`>=${G}.${Y}.${U} <${G}.${+Y+1}.0-0`;return z0("tilde return",V),V})},yY=(Z,W)=>{return Z.trim().split(/\s+/).map((X)=>gY(X,W)).join(" ")},gY=(Z,W)=>{z0("caret",Z,W);let X=W.loose?k0[j0.CARETLOOSE]:k0[j0.CARET],Q=W.includePrerelease?"-0":"";return Z.replace(X,(J,G,Y,U,K)=>{z0("caret",Z,J,G,Y,U,K);let V;if(A0(G))V="";else if(A0(Y))V=`>=${G}.0.0${Q} <${+G+1}.0.0-0`;else if(A0(U))if(G==="0")V=`>=${G}.${Y}.0${Q} <${G}.${+Y+1}.0-0`;else V=`>=${G}.${Y}.0${Q} <${+G+1}.0.0-0`;else if(K)if(z0("replaceCaret pr",K),G==="0")if(Y==="0")V=`>=${G}.${Y}.${U}-${K} <${G}.${Y}.${+U+1}-0`;else V=`>=${G}.${Y}.${U}-${K} <${G}.${+Y+1}.0-0`;else V=`>=${G}.${Y}.${U}-${K} <${+G+1}.0.0-0`;else if(z0("no pr"),G==="0")if(Y==="0")V=`>=${G}.${Y}.${U} <${G}.${Y}.${+U+1}-0`;else V=`>=${G}.${Y}.${U} <${G}.${+Y+1}.0-0`;else V=`>=${G}.${Y}.${U} <${+G+1}.0.0-0`;return z0("caret return",V),V})},hY=(Z,W)=>{return z0("replaceXRanges",Z,W),Z.split(/\s+/).map((X)=>fY(X,W)).join(" ")},fY=(Z,W)=>{Z=Z.trim();let X=W.loose?k0[j0.XRANGELOOSE]:k0[j0.XRANGE];return Z.replace(X,(Q,J,G,Y,U,K)=>{if(z0("xRange",Z,Q,J,G,Y,U,K),SY(G,Y,U))return Z;let V=A0(G),H=V||A0(Y),B=H||A0(U),$=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)Y=0;if(U=0,J===">")if(J=">=",H)G=+G+1,Y=0,U=0;else Y=+Y+1,U=0;else if(J==="<=")if(J="<",H)G=+G+1;else Y=+Y+1;if(J==="<")K="-0";Q=`${J+G}.${Y}.${U}${K}`}else if(H)Q=`>=${G}.0.0${K} <${+G+1}.0.0-0`;else if(B)Q=`>=${G}.${Y}.0${K} <${G}.${+Y+1}.0-0`;return z0("xRange return",Q),Q})},mY=(Z,W)=>{return z0("replaceStars",Z,W),Z.trim().replace(k0[j0.STAR],"")},uY=(Z,W)=>{return z0("replaceGTE0",Z,W),Z.trim().replace(k0[W.includePrerelease?j0.GTE0PRE:j0.GTE0],"")},dY=(Z)=>(W,X,Q,J,G,Y,U,K,V,H,B,$)=>{if(A0(Q))X="";else if(A0(J))X=`>=${Q}.0.0${Z?"-0":""}`;else if(A0(G))X=`>=${Q}.${J}.0${Z?"-0":""}`;else if(Y)X=`>=${X}`;else X=`>=${X}${Z?"-0":""}`;if(A0(V))K="";else if(A0(H))K=`<${+V+1}.0.0-0`;else if(A0(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()},cY=(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===_3.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 Z2=n((TF,U7)=>{var W2=Symbol("SemVer ANY");class J1{static get ANY(){return W2}constructor(Z,W){if(W=J7(W),Z instanceof J1)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===W2)this.value="";else this.value=this.operator+this.semver.version;C3("comp",this)}parse(Z){let W=this.options.loose?G7[Y7.COMPARATORLOOSE]:G7[Y7.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=W2;else this.semver=new z7(X[2],this.options.loose)}toString(){return this.value}test(Z){if(C3("Comparator.test",Z,this.options.loose),this.semver===W2||Z===W2)return!0;if(typeof Z==="string")try{Z=new z7(Z,this.options)}catch(W){return!1}return E3(Z,this.operator,this.semver,this.options)}intersects(Z,W){if(!(Z instanceof J1))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new q7(Z.value,W).test(this.value)}else if(Z.operator===""){if(Z.value==="")return!0;return new q7(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}}U7.exports=J1;var J7=i2(),{safeRe:G7,t:Y7}=D4(),E3=j3(),C3=o4(),z7=P0(),q7=a0()});var X2=n((RF,K7)=>{var lY=a0(),pY=(Z,W,X)=>{try{W=new lY(W,X)}catch(Q){return!1}return W.test(Z)};K7.exports=pY});var B7=n((PF,V7)=>{var nY=a0(),iY=(Z,W)=>new nY(Z,W).set.map((X)=>X.map((Q)=>Q.value).join(" ").trim().split(" "));V7.exports=iY});var $7=n((jF,H7)=>{var rY=P0(),aY=a0(),sY=(Z,W,X)=>{let Q=null,J=null,G=null;try{G=new aY(W,X)}catch(Y){return null}return Z.forEach((Y)=>{if(G.test(Y)){if(!Q||J.compare(Y)===-1)Q=Y,J=new rY(Q,X)}}),Q};H7.exports=sY});var L7=n((_F,F7)=>{var oY=P0(),tY=a0(),eY=(Z,W,X)=>{let Q=null,J=null,G=null;try{G=new tY(W,X)}catch(Y){return null}return Z.forEach((Y)=>{if(G.test(Y)){if(!Q||J.compare(Y)===1)Q=Y,J=new oY(Q,X)}}),Q};F7.exports=eY});var I7=n((EF,M7)=>{var O3=P0(),Zz=a0(),A7=t4(),Wz=(Z,W)=>{Z=new Zz(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((Y)=>{let U=new O3(Y.semver.version);switch(Y.operator){case">":if(U.prerelease.length===0)U.patch++;else U.prerelease.push(0);U.raw=U.format();case"":case">=":if(!G||A7(U,G))G=U;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${Y.operator}`)}}),G&&(!X||A7(X,G)))X=G}if(X&&Z.test(X))return X;return null};M7.exports=Wz});var w7=n((CF,N7)=>{var Xz=a0(),Qz=(Z,W)=>{try{return new Xz(Z,W).range||"*"}catch(X){return null}};N7.exports=Qz});var G1=n((OF,P7)=>{var Jz=P0(),R7=Z2(),{ANY:Gz}=R7,Yz=a0(),zz=X2(),D7=t4(),T7=e2(),qz=W1(),Uz=Z1(),Kz=(Z,W,X,Q)=>{Z=new Jz(Z,Q),W=new Yz(W,Q);let J,G,Y,U,K;switch(X){case">":J=D7,G=qz,Y=T7,U=">",K=">=";break;case"<":J=T7,G=Uz,Y=D7,U="<",K="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(zz(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===Gz)L=new R7(">=0.0.0");if(B=B||L,$=$||L,J(L.semver,B.semver,Q))B=L;else if(Y(L.semver,$.semver,Q))$=L}),B.operator===U||B.operator===K)return!1;if((!$.operator||$.operator===U)&&G(Z,$.semver))return!1;else if($.operator===K&&Y(Z,$.semver))return!1}return!0};P7.exports=Kz});var _7=n((xF,j7)=>{var Vz=G1(),Bz=(Z,W,X)=>Vz(Z,W,">",X);j7.exports=Bz});var C7=n((kF,E7)=>{var Hz=G1(),$z=(Z,W,X)=>Hz(Z,W,"<",X);E7.exports=$z});var k7=n((SF,x7)=>{var O7=a0(),Fz=(Z,W,X)=>{return Z=new O7(Z,X),W=new O7(W,X),Z.intersects(W,X)};x7.exports=Fz});var b7=n((bF,S7)=>{var Lz=X2(),Az=r0();S7.exports=(Z,W,X)=>{let Q=[],J=null,G=null,Y=Z.sort((H,B)=>Az(H,B,X));for(let H of Y)if(Lz(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 U=[];for(let[H,B]of Q)if(H===B)U.push(H);else if(!B&&H===Y[0])U.push("*");else if(!B)U.push(`>=${H}`);else if(H===Y[0])U.push(`<=${B}`);else U.push(`${H} - ${B}`);let K=U.join(" || "),V=typeof W.raw==="string"?W.raw:String(W);return K.length<V.length?K:W}});var m7=n((vF,f7)=>{var v7=a0(),S3=Z2(),{ANY:x3}=S3,k3=X2(),b3=r0(),Mz=(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 Y=Nz(J,G,X);if(Q=Q||Y!==null,Y)continue Z}if(Q)return!1}return!0},Iz=[new S3(">=0.0.0-0")],y7=[new S3(">=0.0.0")],Nz=(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=Iz;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 Y;if(J&&G){if(Y=b3(J.semver,G.semver,X),Y>0)return null;else if(Y===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 U,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(U=g7(J,L,X),U===L&&U!==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)&&Y!==0)return!1}if(J&&V&&!G&&Y!==0)return!1;if(G&&H&&!J&&Y!==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=Mz});var l7=n((yF,c7)=>{var v3=D4(),u7=w4(),wz=P0(),d7=D3(),Dz=m6(),Tz=VZ(),Rz=HZ(),Pz=LZ(),jz=IZ(),_z=wZ(),Ez=TZ(),Cz=PZ(),Oz=_Z(),xz=r0(),kz=xZ(),Sz=SZ(),bz=t2(),vz=gZ(),yz=fZ(),gz=t4(),hz=e2(),fz=R3(),mz=P3(),uz=Z1(),dz=W1(),cz=j3(),lz=rZ(),pz=sZ(),nz=Z2(),iz=a0(),rz=X2(),az=B7(),sz=$7(),oz=L7(),tz=I7(),ez=w7(),Zq=G1(),Wq=_7(),Xq=C7(),Qq=k7(),Jq=b7(),Gq=m7();c7.exports={parse:Dz,valid:Tz,clean:Rz,inc:Pz,diff:jz,major:_z,minor:Ez,patch:Cz,prerelease:Oz,compare:xz,rcompare:kz,compareLoose:Sz,compareBuild:bz,sort:vz,rsort:yz,gt:gz,lt:hz,eq:fz,neq:mz,gte:uz,lte:dz,cmp:cz,coerce:lz,truncate:pz,Comparator:nz,Range:iz,satisfies:rz,toComparators:az,maxSatisfying:sz,minSatisfying:oz,minVersion:tz,validRange:ez,outside:Zq,gtr:Wq,ltr:Xq,intersects:Qq,simplifyRange:Jq,subset:Gq,SemVer:wz,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 _6;var Y1=c(()=>{_6={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.3",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.{cts,mts}","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.5"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.3","@img/sharp-darwin-x64":"0.35.3","@img/sharp-freebsd-wasm32":"0.35.3","@img/sharp-libvips-darwin-arm64":"1.3.2","@img/sharp-libvips-darwin-x64":"1.3.2","@img/sharp-libvips-linux-arm":"1.3.2","@img/sharp-libvips-linux-arm64":"1.3.2","@img/sharp-libvips-linux-ppc64":"1.3.2","@img/sharp-libvips-linux-riscv64":"1.3.2","@img/sharp-libvips-linux-s390x":"1.3.2","@img/sharp-libvips-linux-x64":"1.3.2","@img/sharp-libvips-linuxmusl-arm64":"1.3.2","@img/sharp-libvips-linuxmusl-x64":"1.3.2","@img/sharp-linux-arm":"0.35.3","@img/sharp-linux-arm64":"0.35.3","@img/sharp-linux-ppc64":"0.35.3","@img/sharp-linux-riscv64":"0.35.3","@img/sharp-linux-s390x":"0.35.3","@img/sharp-linux-x64":"0.35.3","@img/sharp-linuxmusl-arm64":"0.35.3","@img/sharp-linuxmusl-x64":"0.35.3","@img/sharp-webcontainers-wasm32":"0.35.3","@img/sharp-win32-arm64":"0.35.3","@img/sharp-win32-ia32":"0.35.3","@img/sharp-win32-x64":"0.35.3"},peerDependenciesMeta:{"@types/node":{optional:!0}},devDependencies:{"@biomejs/biome":"^2.5.1","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.1","@img/sharp-libvips-dev":"1.3.2","@img/sharp-libvips-dev-wasm32":"1.3.2","@img/sharp-libvips-win32-arm64":"1.3.2","@img/sharp-libvips-win32-ia32":"1.3.2","@img/sharp-libvips-win32-x64":"1.3.2","@types/node":"*",emnapi:"^1.11.1","exif-reader":"^2.0.3","extract-zip":"^2.0.1",icc:"^4.0.0","node-addon-api":"^8.9.0","node-gyp":"^12.4.0",publint:"^0.3.21","tar-fs":"^3.1.3",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 Q2}from"node:child_process";import{createHash as zq}from"node:crypto";var J2,g3,qq,n7,Uq,h3,Kq=(Z)=>{if(Z instanceof Error)console.error(`sharp: Installation error: ${Z.message}`);else console.log(`sharp: ${Z}`)},i7=()=>g3.default.isNonGlibcLinuxSync()?g3.default.familySync():"",Vq=()=>`${process.platform}${i7()}-${process.arch}`,T4=()=>{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}`},Bq=()=>{try{return T0(`@img/sharp-libvips-dev-${T4()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},Hq=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},$q=()=>{try{return T0(`@img/sharp-libvips-dev-${T4()}/lib`)}catch{try{return T0(`@img/sharp-libvips-${T4()}/lib`)}catch{}}return""},Fq=()=>{if(process.release?.name==="node"&&process.versions){if(!J2.default.satisfies(process.versions.node,_6.engines.node))return{found:process.versions.node,expected:_6.engines.node}}},r7=()=>{let{CC:Z}=process.env;return Boolean(Z?.endsWith("/emcc"))},Lq=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(Q2("sysctl sysctl.proc_translated",h3).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},p7=(Z)=>zq("sha512").update(Z).digest("hex"),Aq=()=>{try{let Z=p7(`imgsharp-libvips-${T4()}`),W=J2.default.coerce(_6.optionalDependencies[`@img/sharp-libvips-${T4()}`],{includePrerelease:!0}).version;return p7(`${Z}npm:${W}`).slice(0,10)}catch{}return""},Mq=()=>Q2(`node-gyp rebuild --directory=src ${r7()?"--nodedir=emscripten":""}`,{...h3,stdio:"inherit"}).status,a7=()=>{if(process.platform!=="win32")return(Q2("pkg-config --modversion vips-cpp",{...h3,env:{...process.env,PKG_CONFIG_PATH:s7()}}).stdout||"").trim();else return""},Iq=()=>{try{let Z=(Q2("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(Z)return`${Z}/lib/pkgconfig`}catch(Z){}return},Nq=()=>{try{let Z=(Q2("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(Z)return Z}catch(Z){}return},s7=()=>{if(process.platform!=="win32")return[Iq(),Nq(),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},wq=(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(Lq())return y3(!1,"Rosetta",Z);let W=a7();return!!W&&J2.default.gte(W,n7)},z1;var f3=c(()=>{Y1();J2=g4(l7(),1),g3=g4(n2(),1);/*!
210
210
  Copyright 2013 Lovell Fuller and others.
211
211
  SPDX-License-Identifier: Apache-2.0
212
- */Jq=process.env.npm_package_config_libvips||j6.config.libvips,n7=J2.default.coerce(Jq).version,Gq=["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},z1={minimumLibvipsVersion:n7,prebuiltPlatforms:Gq,buildPlatformArch:T4,buildSharpLibvipsIncludeDir:qq,buildSharpLibvipsCPlusPlusDir:Uq,buildSharpLibvipsLibDir:Kq,isUnsupportedNodeRuntime:Vq,runtimePlatformArch:zq,log:Yq,yarnLocator:Hq,spawnRebuild:$q,globalLibvipsVersion:a7,pkgConfigPath:s7,useGlobalLibvips:Aq}});import{createRequire as Mq}from"node:module";var q1,M0,t7,Iq,o7,Nq,wq,E6,J0,u6,W0;var G2=c(()=>{f3();Y1();q1=g4(n2(),1);/*!
212
+ */qq=process.env.npm_package_config_libvips||_6.config.libvips,n7=J2.default.coerce(qq).version,Uq=["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},z1={minimumLibvipsVersion:n7,prebuiltPlatforms:Uq,buildPlatformArch:T4,buildSharpLibvipsIncludeDir:Bq,buildSharpLibvipsCPlusPlusDir:Hq,buildSharpLibvipsLibDir:$q,isUnsupportedNodeRuntime:Fq,runtimePlatformArch:Vq,log:Kq,yarnLocator:Aq,spawnRebuild:Mq,globalLibvipsVersion:a7,pkgConfigPath:s7,useGlobalLibvips:wq}});import{createRequire as Dq}from"node:module";var q1,M0,t7,Tq,o7,Rq,Pq,E6,J0,u6,W0;var G2=c(()=>{f3();Y1();q1=g4(n2(),1);/*!
213
213
  Copyright 2013 Lovell Fuller and others.
214
214
  SPDX-License-Identifier: Apache-2.0
215
- */M0=Mq(import.meta.url),{version:t7}=j6,{runtimePlatformArch:Iq,isUnsupportedNodeRuntime:o7,prebuiltPlatforms:Nq,minimumLibvipsVersion:wq}=z1,E6=Iq(),u6=[];try{J0=M0(`../src/build/Release/sharp-${E6}-${t7}.node`)}catch(Z){u6.push(Z)}if(!J0)try{J0=M0(`../src/build/Release/sharp-wasm32-${t7}.node`)}catch(Z){u6.push(Z)}if(!J0)try{switch(E6){case"darwin-arm64":J0=M0("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":J0=M0("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":J0=M0("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":J0=M0("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":J0=M0("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":J0=M0("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":J0=M0("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":J0=M0("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":J0=M0("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":J0=M0("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":J0=M0("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":J0=M0("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":J0=M0("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":J0=M0("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":J0=M0("@img/sharp-webcontainers-wasm32/sharp.node");break}if(J0&&["linux-x64","linuxmusl-x64"].includes(E6)&&!J0._isUsingX64V2()){let Z=Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");Z.code="Unsupported CPU",u6.push(Z),J0=null}if(J0&&process.versions.electron&&E6.startsWith("linux"))process.emitWarning("Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux",{code:"SharpElectronLinux"})}catch(Z){u6.push(Z)}if(!J0)try{J0=M0("@img/sharp-wasm32/sharp.node")}catch(Z){u6.push(Z)}if(!J0){let[Z,W,X]=["linux","darwin","win32"].map((G)=>E6.startsWith(G)),Q=[`Could not load the "sharp" module using the ${E6} runtime`];u6.forEach((G)=>{if(!G.code.endsWith("MODULE_NOT_FOUND"))Q.push(`${G.code}: ${G.message}`)});let J=u6.map((G)=>G.message).join(" ");if(Q.push("Possible solutions:"),o7()){let{found:G,expected:Y}=o7();Q.push("- Please upgrade Node.js:",` Found ${G}`,` Requires ${Y}`)}else if(Nq.includes(E6)){let[G,Y]=E6.split("-"),U=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","")}${U} --cpu=${Y} sharp`)}else Q.push(`- Manually install libvips >= ${wq}`," 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}=M0(`@img/sharp-libvips-${E6}/package`),Y=`${q1.familySync()} ${q1.versionSync()}`,U=`${G.musl?"musl":"glibc"} ${G.musl||G.glibc}`;Q.push("- Update your OS:",` Found ${Y}`,` Requires ${U}`)}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(u6.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
- `))}W0=J0});import Dq from"node:util";import m3 from"node:stream";function Pq(){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 Tq,Rq=(Z)=>{e6.queue.emit("change",Z)},e6=function(Z,W){if(arguments.length===1&&!z.defined(Z))throw Error("Invalid input");if(!(this instanceof e6))return new e6(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),Tq(X)},queueListener:Rq},this.options.input=this._createInputDescriptor(Z,W,{allowStream:!0}),this},V6;var e7=c(()=>{Y6();G2();/*!
215
+ */M0=Dq(import.meta.url),{version:t7}=_6,{runtimePlatformArch:Tq,isUnsupportedNodeRuntime:o7,prebuiltPlatforms:Rq,minimumLibvipsVersion:Pq}=z1,E6=Tq(),u6=[];try{J0=M0(`../src/build/Release/sharp-${E6}-${t7}.node`)}catch(Z){u6.push(Z)}if(!J0)try{J0=M0(`../src/build/Release/sharp-wasm32-${t7}.node`)}catch(Z){u6.push(Z)}if(!J0)try{switch(E6){case"darwin-arm64":J0=M0("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":J0=M0("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":J0=M0("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":J0=M0("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":J0=M0("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":J0=M0("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":J0=M0("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":J0=M0("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":J0=M0("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":J0=M0("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":J0=M0("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":J0=M0("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":J0=M0("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":J0=M0("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":J0=M0("@img/sharp-webcontainers-wasm32/sharp.node");break}if(J0&&["linux-x64","linuxmusl-x64"].includes(E6)&&!J0._isUsingX64V2()){let Z=Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");Z.code="Unsupported CPU",u6.push(Z),J0=null}if(J0&&process.versions.electron&&E6.startsWith("linux"))process.emitWarning("Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux",{code:"SharpElectronLinux"})}catch(Z){u6.push(Z)}if(!J0)try{J0=M0("@img/sharp-wasm32/sharp.node")}catch(Z){u6.push(Z)}if(!J0){let[Z,W,X]=["linux","darwin","win32"].map((G)=>E6.startsWith(G)),Q=[`Could not load the "sharp" module using the ${E6} runtime`];u6.forEach((G)=>{if(!G.code.endsWith("MODULE_NOT_FOUND"))Q.push(`${G.code}: ${G.message}`)});let J=u6.map((G)=>G.message).join(" ");if(Q.push("Possible solutions:"),o7()){let{found:G,expected:Y}=o7();Q.push("- Please upgrade Node.js:",` Found ${G}`,` Requires ${Y}`)}else if(Rq.includes(E6)){let[G,Y]=E6.split("-"),U=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","")}${U} --cpu=${Y} sharp`)}else Q.push(`- Manually install libvips >= ${Pq}`," 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}=M0(`@img/sharp-libvips-${E6}/package`),Y=`${q1.familySync()} ${q1.versionSync()}`,U=`${G.musl?"musl":"glibc"} ${G.musl||G.glibc}`;Q.push("- Update your OS:",` Found ${Y}`,` Requires ${U}`)}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(u6.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
+ `))}W0=J0});import jq from"node:util";import m3 from"node:stream";function Cq(){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 _q,Eq=(Z)=>{e6.queue.emit("change",Z)},e6=function(Z,W){if(arguments.length===1&&!z.defined(Z))throw Error("Invalid input");if(!(this instanceof e6))return new e6(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),_q(X)},queueListener:Eq},this.options.input=this._createInputDescriptor(Z,W,{allowStream:!0}),this},V6;var e7=c(()=>{Y6();G2();/*!
217
217
  Copyright 2013 Lovell Fuller and others.
218
218
  SPDX-License-Identifier: Apache-2.0
219
- */Tq=Dq.debuglog("sharp");Object.setPrototypeOf(e6.prototype,m3.Duplex.prototype);Object.setPrototypeOf(e6,m3.Duplex);Object.assign(e6.prototype,{clone:Pq});V6=e6});function ZW(Z){let W=jq.filter((X)=>z.defined(Z[X])).map((X)=>[X,Z[X]]);return W.length?Object.fromEntries(W):void 0}function Eq(Z,W,X){let Q={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(z.string(Z))Q.file=Z;else if(z.buffer(Z)){if(Z.length===0)throw Error("Input Buffer is empty");Q.buffer=Z}else if(z.arrayBuffer(Z)){if(Z.byteLength===0)throw Error("Input bit Array is empty");Q.buffer=Buffer.from(Z,0,Z.byteLength)}else if(z.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(z.plainObject(Z)&&!z.defined(W)){if(W=Z,ZW(W))Q.buffer=[]}else if(!z.defined(Z)&&!z.defined(W)&&z.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}${z.defined(W)?` when also providing options of type ${typeof W}`:""}`);if(z.object(W)){if(z.defined(W.failOn))if(z.string(W.failOn)&&z.inArray(W.failOn,["none","truncated","error","warning"]))Q.failOn=W.failOn;else throw z.invalidParameterError("failOn","one of: none, truncated, error, warning",W.failOn);if(z.defined(W.autoOrient))if(z.bool(W.autoOrient))Q.autoOrient=W.autoOrient;else throw z.invalidParameterError("autoOrient","boolean",W.autoOrient);if(z.defined(W.density))if(z.number(W.density)&&z.inRange(W.density,1,1e5))Q.density=W.density;else throw z.invalidParameterError("density","number between 1 and 100000",W.density);if(z.defined(W.ignoreIcc))if(z.bool(W.ignoreIcc))Q.ignoreIcc=W.ignoreIcc;else throw z.invalidParameterError("ignoreIcc","boolean",W.ignoreIcc);if(z.defined(W.limitInputPixels))if(z.bool(W.limitInputPixels))Q.limitInputPixels=W.limitInputPixels?268402689:0;else if(z.integer(W.limitInputPixels)&&z.inRange(W.limitInputPixels,0,Number.MAX_SAFE_INTEGER))Q.limitInputPixels=W.limitInputPixels;else throw z.invalidParameterError("limitInputPixels","positive integer",W.limitInputPixels);if(z.defined(W.limitInputChannels))if(z.bool(W.limitInputChannels))Q.limitInputChannels=W.limitInputChannels?5:0;else if(z.integer(W.limitInputChannels)&&z.inRange(W.limitInputChannels,0,Number.MAX_SAFE_INTEGER))Q.limitInputChannels=W.limitInputChannels;else throw z.invalidParameterError("limitInputChannels","positive integer",W.limitInputChannels);if(z.defined(W.unlimited))if(z.bool(W.unlimited))Q.unlimited=W.unlimited;else throw z.invalidParameterError("unlimited","boolean",W.unlimited);if(z.defined(W.sequentialRead))if(z.bool(W.sequentialRead))Q.sequentialRead=W.sequentialRead;else throw z.invalidParameterError("sequentialRead","boolean",W.sequentialRead);if(z.defined(W.raw)){if(z.object(W.raw)&&z.integer(W.raw.width)&&z.inRange(W.raw.width,1,1e8)&&z.integer(W.raw.height)&&z.inRange(W.raw.height,1,1e8)&&z.integer(W.raw.channels)&&z.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,z.defined(W.raw.premultiplied))if(z.bool(W.raw.premultiplied))Q.rawPremultiplied=W.raw.premultiplied;else throw z.invalidParameterError("raw.premultiplied","boolean",W.raw.premultiplied);if(Q.rawPageHeight=0,z.defined(W.raw.pageHeight))if(z.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 z.invalidParameterError("raw.pageHeight","positive integer",W.raw.pageHeight)}if(z.defined(W.animated))if(z.bool(W.animated))Q.pages=W.animated?-1:1;else throw z.invalidParameterError("animated","boolean",W.animated);if(z.defined(W.pages))if(z.integer(W.pages)&&z.inRange(W.pages,-1,1e5))Q.pages=W.pages;else throw z.invalidParameterError("pages","integer between -1 and 100000",W.pages);if(z.defined(W.page))if(z.integer(W.page)&&z.inRange(W.page,0,1e5))Q.page=W.page;else throw z.invalidParameterError("page","integer between 0 and 100000",W.page);if(z.object(W.openSlide)&&z.defined(W.openSlide.level))if(z.integer(W.openSlide.level)&&z.inRange(W.openSlide.level,0,256))Q.openSlideLevel=W.openSlide.level;else throw z.invalidParameterError("openSlide.level","integer between 0 and 256",W.openSlide.level);else if(z.defined(W.level))if(z.integer(W.level)&&z.inRange(W.level,0,256))Q.openSlideLevel=W.level;else throw z.invalidParameterError("level","integer between 0 and 256",W.level);if(z.object(W.tiff)&&z.defined(W.tiff.subifd))if(z.integer(W.tiff.subifd)&&z.inRange(W.tiff.subifd,-1,1e5))Q.tiffSubifd=W.tiff.subifd;else throw z.invalidParameterError("tiff.subifd","integer between -1 and 100000",W.tiff.subifd);else if(z.defined(W.subifd))if(z.integer(W.subifd)&&z.inRange(W.subifd,-1,1e5))Q.tiffSubifd=W.subifd;else throw z.invalidParameterError("subifd","integer between -1 and 100000",W.subifd);if(z.object(W.svg)){if(z.defined(W.svg.stylesheet))if(z.string(W.svg.stylesheet))Q.svgStylesheet=W.svg.stylesheet;else throw z.invalidParameterError("svg.stylesheet","string",W.svg.stylesheet);if(z.defined(W.svg.highBitdepth))if(z.bool(W.svg.highBitdepth))Q.svgHighBitdepth=W.svg.highBitdepth;else throw z.invalidParameterError("svg.highBitdepth","boolean",W.svg.highBitdepth)}if(z.object(W.pdf)&&z.defined(W.pdf.background))Q.pdfBackground=this._getBackgroundColourOption(W.pdf.background);else if(z.defined(W.pdfBackground))Q.pdfBackground=this._getBackgroundColourOption(W.pdfBackground);if(z.object(W.jp2)&&z.defined(W.jp2.oneshot))if(z.bool(W.jp2.oneshot))Q.jp2Oneshot=W.jp2.oneshot;else throw z.invalidParameterError("jp2.oneshot","boolean",W.jp2.oneshot);if(z.defined(W.create))if(z.object(W.create)&&z.integer(W.create.width)&&z.inRange(W.create.width,1,1e8)&&z.integer(W.create.height)&&z.inRange(W.create.height,1,1e8)&&z.integer(W.create.channels)){if(Q.createWidth=W.create.width,Q.createHeight=W.create.height,Q.createChannels=W.create.channels,Q.createPageHeight=0,z.defined(W.create.pageHeight))if(z.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 z.invalidParameterError("create.pageHeight","positive integer",W.create.pageHeight);if(z.defined(W.create.noise)){if(!z.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,!z.inRange(W.create.channels,1,4))throw z.invalidParameterError("create.channels","number between 1 and 4",W.create.channels);if(Q.createNoiseMean=128,z.defined(W.create.noise.mean))if(z.number(W.create.noise.mean)&&z.inRange(W.create.noise.mean,0,1e4))Q.createNoiseMean=W.create.noise.mean;else throw z.invalidParameterError("create.noise.mean","number between 0 and 10000",W.create.noise.mean);if(Q.createNoiseSigma=30,z.defined(W.create.noise.sigma))if(z.number(W.create.noise.sigma)&&z.inRange(W.create.noise.sigma,0,1e4))Q.createNoiseSigma=W.create.noise.sigma;else throw z.invalidParameterError("create.noise.sigma","number between 0 and 10000",W.create.noise.sigma)}else if(z.defined(W.create.background)){if(!z.inRange(W.create.channels,3,4))throw z.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(z.defined(W.text))if(z.object(W.text)&&z.string(W.text.text)){if(Q.textValue=W.text.text,z.defined(W.text.height)&&z.defined(W.text.dpi))throw Error("Expected only one of dpi or height");if(z.defined(W.text.font))if(z.string(W.text.font))Q.textFont=W.text.font;else throw z.invalidParameterError("text.font","string",W.text.font);if(z.defined(W.text.fontfile))if(z.string(W.text.fontfile))Q.textFontfile=W.text.fontfile;else throw z.invalidParameterError("text.fontfile","string",W.text.fontfile);if(z.defined(W.text.width))if(z.integer(W.text.width)&&z.inRange(W.text.width,1,1e6))Q.textWidth=W.text.width;else throw z.invalidParameterError("text.width","integer between 1 and 1000000",W.text.width);if(z.defined(W.text.height))if(z.integer(W.text.height)&&z.inRange(W.text.height,1,1e6))Q.textHeight=W.text.height;else throw z.invalidParameterError("text.height","integer between 1 and 1000000",W.text.height);if(z.defined(W.text.align))if(z.string(W.text.align)&&z.string(this.constructor.align[W.text.align]))Q.textAlign=this.constructor.align[W.text.align];else throw z.invalidParameterError("text.align","valid alignment",W.text.align);if(z.defined(W.text.justify))if(z.bool(W.text.justify))Q.textJustify=W.text.justify;else throw z.invalidParameterError("text.justify","boolean",W.text.justify);if(z.defined(W.text.dpi))if(z.integer(W.text.dpi)&&z.inRange(W.text.dpi,1,1e6))Q.textDpi=W.text.dpi;else throw z.invalidParameterError("text.dpi","integer between 1 and 1000000",W.text.dpi);if(z.defined(W.text.rgba))if(z.bool(W.text.rgba))Q.textRgba=W.text.rgba;else throw z.invalidParameterError("text.rgba","bool",W.text.rgba);if(z.defined(W.text.spacing))if(z.integer(W.text.spacing)&&z.inRange(W.text.spacing,-1e6,1e6))Q.textSpacing=W.text.spacing;else throw z.invalidParameterError("text.spacing","integer between -1000000 and 1000000",W.text.spacing);if(z.defined(W.text.wrap))if(z.string(W.text.wrap)&&z.inArray(W.text.wrap,["word","char","word-char","none"]))Q.textWrap=W.text.wrap;else throw z.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(z.defined(W.join))if(z.defined(this.options.join)){if(z.defined(W.join.animated))if(z.bool(W.join.animated))Q.joinAnimated=W.join.animated;else throw z.invalidParameterError("join.animated","boolean",W.join.animated);if(z.defined(W.join.across))if(z.integer(W.join.across)&&z.inRange(W.join.across,1,1e6))Q.joinAcross=W.join.across;else throw z.invalidParameterError("join.across","integer between 1 and 100000",W.join.across);if(z.defined(W.join.shim))if(z.integer(W.join.shim)&&z.inRange(W.join.shim,0,1e6))Q.joinShim=W.join.shim;else throw z.invalidParameterError("join.shim","integer between 0 and 100000",W.join.shim);if(z.defined(W.join.background))Q.joinBackground=this._getBackgroundColourOption(W.join.background);if(z.defined(W.join.halign))if(z.string(W.join.halign)&&z.string(this.constructor.align[W.join.halign]))Q.joinHalign=this.constructor.align[W.join.halign];else throw z.invalidParameterError("join.halign","valid alignment",W.join.halign);if(z.defined(W.join.valign))if(z.string(W.join.valign)&&z.string(this.constructor.align[W.join.valign]))Q.joinValign=this.constructor.align[W.join.valign];else throw z.invalidParameterError("join.valign","valid alignment",W.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(z.defined(W))throw Error(`Invalid input options ${W}`);return Q}function Cq(Z,W,X){if(Array.isArray(this.options.input.buffer))if(z.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 Oq(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function xq(){return Array.isArray(this.options.input.buffer)}function kq(Z){let W=Error();if(z.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),W0.metadata(this.options,(X,Q)=>{if(X)Z(z.nativeError(X,W));else Z(null,Q)})});else W0.metadata(this.options,(X,Q)=>{if(X)Z(z.nativeError(X,W));else Z(null,Q)});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{let J=()=>{this._flattenBufferIn(),W0.metadata(this.options,(G,Y)=>{if(G)Q(z.nativeError(G,W));else X(Y)})};if(this.writableFinished)J();else this.once("finish",J)});else return new Promise((X,Q)=>{W0.metadata(this.options,(J,G)=>{if(J)Q(z.nativeError(J,W));else X(G)})})}function Sq(Z){let W=Error();if(z.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),W0.stats(this.options,(X,Q)=>{if(X)Z(z.nativeError(X,W));else Z(null,Q)})});else W0.stats(this.options,(X,Q)=>{if(X)Z(z.nativeError(X,W));else Z(null,Q)});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{this.on("finish",function(){this._flattenBufferIn(),W0.stats(this.options,(J,G)=>{if(J)Q(z.nativeError(J,W));else X(G)})})});else return new Promise((X,Q)=>{W0.stats(this.options,(J,G)=>{if(J)Q(z.nativeError(J,W));else X(G)})})}var _q,jq,WW=(Z)=>{Object.assign(Z.prototype,{_inputOptionsFromObject:ZW,_createInputDescriptor:Eq,_write:Cq,_flattenBufferIn:Oq,_isStreamInput:xq,metadata:kq,stats:Sq}),Z.align=_q};var XW=c(()=>{Y6();G2();/*!
219
+ */_q=jq.debuglog("sharp");Object.setPrototypeOf(e6.prototype,m3.Duplex.prototype);Object.setPrototypeOf(e6,m3.Duplex);Object.assign(e6.prototype,{clone:Cq});V6=e6});function ZW(Z){let W=xq.filter((X)=>z.defined(Z[X])).map((X)=>[X,Z[X]]);return W.length?Object.fromEntries(W):void 0}function kq(Z,W,X){let Q={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(z.string(Z))Q.file=Z;else if(z.buffer(Z)){if(Z.length===0)throw Error("Input Buffer is empty");Q.buffer=Z}else if(z.arrayBuffer(Z)){if(Z.byteLength===0)throw Error("Input bit Array is empty");Q.buffer=Buffer.from(Z,0,Z.byteLength)}else if(z.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(z.plainObject(Z)&&!z.defined(W)){if(W=Z,ZW(W))Q.buffer=[]}else if(!z.defined(Z)&&!z.defined(W)&&z.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}${z.defined(W)?` when also providing options of type ${typeof W}`:""}`);if(z.object(W)){if(z.defined(W.failOn))if(z.string(W.failOn)&&z.inArray(W.failOn,["none","truncated","error","warning"]))Q.failOn=W.failOn;else throw z.invalidParameterError("failOn","one of: none, truncated, error, warning",W.failOn);if(z.defined(W.autoOrient))if(z.bool(W.autoOrient))Q.autoOrient=W.autoOrient;else throw z.invalidParameterError("autoOrient","boolean",W.autoOrient);if(z.defined(W.density))if(z.number(W.density)&&z.inRange(W.density,1,1e5))Q.density=W.density;else throw z.invalidParameterError("density","number between 1 and 100000",W.density);if(z.defined(W.ignoreIcc))if(z.bool(W.ignoreIcc))Q.ignoreIcc=W.ignoreIcc;else throw z.invalidParameterError("ignoreIcc","boolean",W.ignoreIcc);if(z.defined(W.limitInputPixels))if(z.bool(W.limitInputPixels))Q.limitInputPixels=W.limitInputPixels?268402689:0;else if(z.integer(W.limitInputPixels)&&z.inRange(W.limitInputPixels,0,Number.MAX_SAFE_INTEGER))Q.limitInputPixels=W.limitInputPixels;else throw z.invalidParameterError("limitInputPixels","positive integer",W.limitInputPixels);if(z.defined(W.limitInputChannels))if(z.bool(W.limitInputChannels))Q.limitInputChannels=W.limitInputChannels?5:0;else if(z.integer(W.limitInputChannels)&&z.inRange(W.limitInputChannels,0,Number.MAX_SAFE_INTEGER))Q.limitInputChannels=W.limitInputChannels;else throw z.invalidParameterError("limitInputChannels","positive integer",W.limitInputChannels);if(z.defined(W.unlimited))if(z.bool(W.unlimited))Q.unlimited=W.unlimited;else throw z.invalidParameterError("unlimited","boolean",W.unlimited);if(z.defined(W.sequentialRead))if(z.bool(W.sequentialRead))Q.sequentialRead=W.sequentialRead;else throw z.invalidParameterError("sequentialRead","boolean",W.sequentialRead);if(z.defined(W.raw)){if(z.object(W.raw)&&z.integer(W.raw.width)&&z.inRange(W.raw.width,1,1e8)&&z.integer(W.raw.height)&&z.inRange(W.raw.height,1,1e8)&&z.integer(W.raw.channels)&&z.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,z.defined(W.raw.premultiplied))if(z.bool(W.raw.premultiplied))Q.rawPremultiplied=W.raw.premultiplied;else throw z.invalidParameterError("raw.premultiplied","boolean",W.raw.premultiplied);if(Q.rawPageHeight=0,z.defined(W.raw.pageHeight))if(z.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 z.invalidParameterError("raw.pageHeight","positive integer",W.raw.pageHeight)}if(z.defined(W.animated))if(z.bool(W.animated))Q.pages=W.animated?-1:1;else throw z.invalidParameterError("animated","boolean",W.animated);if(z.defined(W.pages))if(z.integer(W.pages)&&z.inRange(W.pages,-1,1e5))Q.pages=W.pages;else throw z.invalidParameterError("pages","integer between -1 and 100000",W.pages);if(z.defined(W.page))if(z.integer(W.page)&&z.inRange(W.page,0,1e5))Q.page=W.page;else throw z.invalidParameterError("page","integer between 0 and 100000",W.page);if(z.object(W.openSlide)&&z.defined(W.openSlide.level))if(z.integer(W.openSlide.level)&&z.inRange(W.openSlide.level,0,256))Q.openSlideLevel=W.openSlide.level;else throw z.invalidParameterError("openSlide.level","integer between 0 and 256",W.openSlide.level);else if(z.defined(W.level))if(z.integer(W.level)&&z.inRange(W.level,0,256))Q.openSlideLevel=W.level;else throw z.invalidParameterError("level","integer between 0 and 256",W.level);if(z.object(W.tiff)&&z.defined(W.tiff.subifd))if(z.integer(W.tiff.subifd)&&z.inRange(W.tiff.subifd,-1,1e5))Q.tiffSubifd=W.tiff.subifd;else throw z.invalidParameterError("tiff.subifd","integer between -1 and 100000",W.tiff.subifd);else if(z.defined(W.subifd))if(z.integer(W.subifd)&&z.inRange(W.subifd,-1,1e5))Q.tiffSubifd=W.subifd;else throw z.invalidParameterError("subifd","integer between -1 and 100000",W.subifd);if(z.object(W.svg)){if(z.defined(W.svg.stylesheet))if(z.string(W.svg.stylesheet))Q.svgStylesheet=W.svg.stylesheet;else throw z.invalidParameterError("svg.stylesheet","string",W.svg.stylesheet);if(z.defined(W.svg.highBitdepth))if(z.bool(W.svg.highBitdepth))Q.svgHighBitdepth=W.svg.highBitdepth;else throw z.invalidParameterError("svg.highBitdepth","boolean",W.svg.highBitdepth)}if(z.object(W.pdf)&&z.defined(W.pdf.background))Q.pdfBackground=this._getBackgroundColourOption(W.pdf.background);else if(z.defined(W.pdfBackground))Q.pdfBackground=this._getBackgroundColourOption(W.pdfBackground);if(z.object(W.jp2)&&z.defined(W.jp2.oneshot))if(z.bool(W.jp2.oneshot))Q.jp2Oneshot=W.jp2.oneshot;else throw z.invalidParameterError("jp2.oneshot","boolean",W.jp2.oneshot);if(z.defined(W.create))if(z.object(W.create)&&z.integer(W.create.width)&&z.inRange(W.create.width,1,1e8)&&z.integer(W.create.height)&&z.inRange(W.create.height,1,1e8)&&z.integer(W.create.channels)){if(Q.createWidth=W.create.width,Q.createHeight=W.create.height,Q.createChannels=W.create.channels,Q.createPageHeight=0,z.defined(W.create.pageHeight))if(z.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 z.invalidParameterError("create.pageHeight","positive integer",W.create.pageHeight);if(z.defined(W.create.noise)){if(!z.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,!z.inRange(W.create.channels,1,4))throw z.invalidParameterError("create.channels","number between 1 and 4",W.create.channels);if(Q.createNoiseMean=128,z.defined(W.create.noise.mean))if(z.number(W.create.noise.mean)&&z.inRange(W.create.noise.mean,0,1e4))Q.createNoiseMean=W.create.noise.mean;else throw z.invalidParameterError("create.noise.mean","number between 0 and 10000",W.create.noise.mean);if(Q.createNoiseSigma=30,z.defined(W.create.noise.sigma))if(z.number(W.create.noise.sigma)&&z.inRange(W.create.noise.sigma,0,1e4))Q.createNoiseSigma=W.create.noise.sigma;else throw z.invalidParameterError("create.noise.sigma","number between 0 and 10000",W.create.noise.sigma)}else if(z.defined(W.create.background)){if(!z.inRange(W.create.channels,3,4))throw z.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(z.defined(W.text))if(z.object(W.text)&&z.string(W.text.text)){if(Q.textValue=W.text.text,z.defined(W.text.height)&&z.defined(W.text.dpi))throw Error("Expected only one of dpi or height");if(z.defined(W.text.font))if(z.string(W.text.font))Q.textFont=W.text.font;else throw z.invalidParameterError("text.font","string",W.text.font);if(z.defined(W.text.fontfile))if(z.string(W.text.fontfile))Q.textFontfile=W.text.fontfile;else throw z.invalidParameterError("text.fontfile","string",W.text.fontfile);if(z.defined(W.text.width))if(z.integer(W.text.width)&&z.inRange(W.text.width,1,1e6))Q.textWidth=W.text.width;else throw z.invalidParameterError("text.width","integer between 1 and 1000000",W.text.width);if(z.defined(W.text.height))if(z.integer(W.text.height)&&z.inRange(W.text.height,1,1e6))Q.textHeight=W.text.height;else throw z.invalidParameterError("text.height","integer between 1 and 1000000",W.text.height);if(z.defined(W.text.align))if(z.string(W.text.align)&&z.string(this.constructor.align[W.text.align]))Q.textAlign=this.constructor.align[W.text.align];else throw z.invalidParameterError("text.align","valid alignment",W.text.align);if(z.defined(W.text.justify))if(z.bool(W.text.justify))Q.textJustify=W.text.justify;else throw z.invalidParameterError("text.justify","boolean",W.text.justify);if(z.defined(W.text.dpi))if(z.integer(W.text.dpi)&&z.inRange(W.text.dpi,1,1e6))Q.textDpi=W.text.dpi;else throw z.invalidParameterError("text.dpi","integer between 1 and 1000000",W.text.dpi);if(z.defined(W.text.rgba))if(z.bool(W.text.rgba))Q.textRgba=W.text.rgba;else throw z.invalidParameterError("text.rgba","bool",W.text.rgba);if(z.defined(W.text.spacing))if(z.integer(W.text.spacing)&&z.inRange(W.text.spacing,-1e6,1e6))Q.textSpacing=W.text.spacing;else throw z.invalidParameterError("text.spacing","integer between -1000000 and 1000000",W.text.spacing);if(z.defined(W.text.wrap))if(z.string(W.text.wrap)&&z.inArray(W.text.wrap,["word","char","word-char","none"]))Q.textWrap=W.text.wrap;else throw z.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(z.defined(W.join))if(z.defined(this.options.join)){if(z.defined(W.join.animated))if(z.bool(W.join.animated))Q.joinAnimated=W.join.animated;else throw z.invalidParameterError("join.animated","boolean",W.join.animated);if(z.defined(W.join.across))if(z.integer(W.join.across)&&z.inRange(W.join.across,1,1e6))Q.joinAcross=W.join.across;else throw z.invalidParameterError("join.across","integer between 1 and 100000",W.join.across);if(z.defined(W.join.shim))if(z.integer(W.join.shim)&&z.inRange(W.join.shim,0,1e6))Q.joinShim=W.join.shim;else throw z.invalidParameterError("join.shim","integer between 0 and 100000",W.join.shim);if(z.defined(W.join.background))Q.joinBackground=this._getBackgroundColourOption(W.join.background);if(z.defined(W.join.halign))if(z.string(W.join.halign)&&z.string(this.constructor.align[W.join.halign]))Q.joinHalign=this.constructor.align[W.join.halign];else throw z.invalidParameterError("join.halign","valid alignment",W.join.halign);if(z.defined(W.join.valign))if(z.string(W.join.valign)&&z.string(this.constructor.align[W.join.valign]))Q.joinValign=this.constructor.align[W.join.valign];else throw z.invalidParameterError("join.valign","valid alignment",W.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(z.defined(W))throw Error(`Invalid input options ${W}`);return Q}function Sq(Z,W,X){if(Array.isArray(this.options.input.buffer))if(z.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 bq(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function vq(){return Array.isArray(this.options.input.buffer)}function yq(Z){let W=Error();if(z.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),W0.metadata(this.options,(X,Q)=>{if(X)Z(z.nativeError(X,W));else Z(null,Q)})});else W0.metadata(this.options,(X,Q)=>{if(X)Z(z.nativeError(X,W));else Z(null,Q)});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{let J=()=>{this._flattenBufferIn(),W0.metadata(this.options,(G,Y)=>{if(G)Q(z.nativeError(G,W));else X(Y)})};if(this.writableFinished)J();else this.once("finish",J)});else return new Promise((X,Q)=>{W0.metadata(this.options,(J,G)=>{if(J)Q(z.nativeError(J,W));else X(G)})})}function gq(Z){let W=Error();if(z.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),W0.stats(this.options,(X,Q)=>{if(X)Z(z.nativeError(X,W));else Z(null,Q)})});else W0.stats(this.options,(X,Q)=>{if(X)Z(z.nativeError(X,W));else Z(null,Q)});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{this.on("finish",function(){this._flattenBufferIn(),W0.stats(this.options,(J,G)=>{if(J)Q(z.nativeError(J,W));else X(G)})})});else return new Promise((X,Q)=>{W0.stats(this.options,(J,G)=>{if(J)Q(z.nativeError(J,W));else X(G)})})}var Oq,xq,WW=(Z)=>{Object.assign(Z.prototype,{_inputOptionsFromObject:ZW,_createInputDescriptor:kq,_write:Sq,_flattenBufferIn:bq,_isStreamInput:vq,metadata:yq,stats:gq}),Z.align=Oq};var XW=c(()=>{Y6();G2();/*!
220
220
  Copyright 2013 Lovell Fuller and others.
221
221
  SPDX-License-Identifier: Apache-2.0
222
- */_q={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},jq=["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 U1(Z){return Z.width!==-1||Z.height!==-1}function yq(Z,W,X){if(U1(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(z.defined(Z))if(z.object(Z)&&!z.defined(X))X=Z;else if(z.integer(Z)&&Z>0)this.options.width=Z;else throw z.invalidParameterError("width","positive integer",Z);else this.options.width=-1;if(z.defined(W))if(z.integer(W)&&W>0)this.options.height=W;else throw z.invalidParameterError("height","positive integer",W);else this.options.height=-1;if(z.object(X)){if(z.defined(X.width))if(z.integer(X.width)&&X.width>0)this.options.width=X.width;else throw z.invalidParameterError("width","positive integer",X.width);if(z.defined(X.height))if(z.integer(X.height)&&X.height>0)this.options.height=X.height;else throw z.invalidParameterError("height","positive integer",X.height);if(z.defined(X.fit)){let Q=vq[X.fit];if(z.string(Q))this.options.canvas=Q;else throw z.invalidParameterError("fit","valid fit",X.fit)}if(z.defined(X.position)){let Q=z.integer(X.position)?X.position:YW[X.position]||GW[X.position]||JW[X.position];if(z.integer(Q)&&(z.inRange(Q,0,8)||z.inRange(Q,16,17)))this.options.position=Q;else throw z.invalidParameterError("position","valid position/gravity/strategy",X.position)}if(this._setBackgroundColourOption("resizeBackground",X.background),z.defined(X.kernel))if(z.string(u3[X.kernel]))this.options.kernel=u3[X.kernel];else throw z.invalidParameterError("kernel","valid kernel name",X.kernel);if(z.defined(X.withoutEnlargement))this._setBooleanOption("withoutEnlargement",X.withoutEnlargement);if(z.defined(X.withoutReduction))this._setBooleanOption("withoutReduction",X.withoutReduction);if(z.defined(X.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",X.fastShrinkOnLoad)}if(d3(this.options)&&U1(this.options))this.options.rotateBefore=!0;return this}function gq(Z){if(z.integer(Z))if(z.inRange(Z,1,1e4))this.options.extendTop=Z,this.options.extendBottom=Z,this.options.extendLeft=Z,this.options.extendRight=Z;else throw z.invalidParameterError("extend","integer between 1 and 10000",Z);else if(z.object(Z)){if(z.defined(Z.top))if(z.integer(Z.top)&&z.inRange(Z.top,0,1e4))this.options.extendTop=Z.top;else throw z.invalidParameterError("top","integer between 0 and 10000",Z.top);if(z.defined(Z.bottom))if(z.integer(Z.bottom)&&z.inRange(Z.bottom,0,1e4))this.options.extendBottom=Z.bottom;else throw z.invalidParameterError("bottom","integer between 0 and 10000",Z.bottom);if(z.defined(Z.left))if(z.integer(Z.left)&&z.inRange(Z.left,0,1e4))this.options.extendLeft=Z.left;else throw z.invalidParameterError("left","integer between 0 and 10000",Z.left);if(z.defined(Z.right))if(z.integer(Z.right)&&z.inRange(Z.right,0,1e4))this.options.extendRight=Z.right;else throw z.invalidParameterError("right","integer between 0 and 10000",Z.right);if(this._setBackgroundColourOption("extendBackground",Z.background),z.defined(Z.extendWith))if(z.string(QW[Z.extendWith]))this.options.extendWith=QW[Z.extendWith];else throw z.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",Z.extendWith)}else throw z.invalidParameterError("extend","integer or object",Z);return this}function hq(Z){let W=U1(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(z.integer(Q)&&z.inRange(Q,0,1e8))this.options[X+(X==="left"||X==="top"?"Offset":"")+W]=Q;else throw z.invalidParameterError(X,"integer between 0 and 100000000",Q)},this),d3(this.options)&&!U1(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 fq(Z){if(this.options.trimThreshold=10,z.defined(Z))if(z.object(Z)){if(z.defined(Z.background))this._setBackgroundColourOption("trimBackground",Z.background);if(z.defined(Z.threshold))if(z.number(Z.threshold)&&Z.threshold>=0)this.options.trimThreshold=Z.threshold;else throw z.invalidParameterError("threshold","positive number",Z.threshold);if(z.defined(Z.lineArt))this._setBooleanOption("trimLineArt",Z.lineArt);if(z.defined(Z.margin))if(z.integer(Z.margin)&&z.inRange(Z.margin,0,1e7))this.options.trimMargin=Z.margin;else throw z.invalidParameterError("margin","integer between 0 and 10000000",Z.margin)}else throw z.invalidParameterError("trim","object",Z);if(d3(this.options))this.options.rotateBefore=!0;return this}var JW,GW,QW,YW,u3,bq,vq,zW=(Z)=>{Object.assign(Z.prototype,{resize:yq,extend:gq,extract:hq,trim:fq}),Z.gravity=JW,Z.strategy=YW,Z.kernel=u3,Z.fit=bq,Z.position=GW};var qW=c(()=>{Y6();/*!
222
+ */Oq={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},xq=["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 U1(Z){return Z.width!==-1||Z.height!==-1}function mq(Z,W,X){if(U1(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(z.defined(Z))if(z.object(Z)&&!z.defined(X))X=Z;else if(z.integer(Z)&&Z>0)this.options.width=Z;else throw z.invalidParameterError("width","positive integer",Z);else this.options.width=-1;if(z.defined(W))if(z.integer(W)&&W>0)this.options.height=W;else throw z.invalidParameterError("height","positive integer",W);else this.options.height=-1;if(z.object(X)){if(z.defined(X.width))if(z.integer(X.width)&&X.width>0)this.options.width=X.width;else throw z.invalidParameterError("width","positive integer",X.width);if(z.defined(X.height))if(z.integer(X.height)&&X.height>0)this.options.height=X.height;else throw z.invalidParameterError("height","positive integer",X.height);if(z.defined(X.fit)){let Q=fq[X.fit];if(z.string(Q))this.options.canvas=Q;else throw z.invalidParameterError("fit","valid fit",X.fit)}if(z.defined(X.position)){let Q=z.integer(X.position)?X.position:YW[X.position]||GW[X.position]||JW[X.position];if(z.integer(Q)&&(z.inRange(Q,0,8)||z.inRange(Q,16,17)))this.options.position=Q;else throw z.invalidParameterError("position","valid position/gravity/strategy",X.position)}if(this._setBackgroundColourOption("resizeBackground",X.background),z.defined(X.kernel))if(z.string(u3[X.kernel]))this.options.kernel=u3[X.kernel];else throw z.invalidParameterError("kernel","valid kernel name",X.kernel);if(z.defined(X.withoutEnlargement))this._setBooleanOption("withoutEnlargement",X.withoutEnlargement);if(z.defined(X.withoutReduction))this._setBooleanOption("withoutReduction",X.withoutReduction);if(z.defined(X.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",X.fastShrinkOnLoad)}if(d3(this.options)&&U1(this.options))this.options.rotateBefore=!0;return this}function uq(Z){if(z.integer(Z))if(z.inRange(Z,1,1e4))this.options.extendTop=Z,this.options.extendBottom=Z,this.options.extendLeft=Z,this.options.extendRight=Z;else throw z.invalidParameterError("extend","integer between 1 and 10000",Z);else if(z.object(Z)){if(z.defined(Z.top))if(z.integer(Z.top)&&z.inRange(Z.top,0,1e4))this.options.extendTop=Z.top;else throw z.invalidParameterError("top","integer between 0 and 10000",Z.top);if(z.defined(Z.bottom))if(z.integer(Z.bottom)&&z.inRange(Z.bottom,0,1e4))this.options.extendBottom=Z.bottom;else throw z.invalidParameterError("bottom","integer between 0 and 10000",Z.bottom);if(z.defined(Z.left))if(z.integer(Z.left)&&z.inRange(Z.left,0,1e4))this.options.extendLeft=Z.left;else throw z.invalidParameterError("left","integer between 0 and 10000",Z.left);if(z.defined(Z.right))if(z.integer(Z.right)&&z.inRange(Z.right,0,1e4))this.options.extendRight=Z.right;else throw z.invalidParameterError("right","integer between 0 and 10000",Z.right);if(this._setBackgroundColourOption("extendBackground",Z.background),z.defined(Z.extendWith))if(z.string(QW[Z.extendWith]))this.options.extendWith=QW[Z.extendWith];else throw z.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",Z.extendWith)}else throw z.invalidParameterError("extend","integer or object",Z);return this}function dq(Z){let W=U1(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(z.integer(Q)&&z.inRange(Q,0,1e8))this.options[X+(X==="left"||X==="top"?"Offset":"")+W]=Q;else throw z.invalidParameterError(X,"integer between 0 and 100000000",Q)},this),d3(this.options)&&!U1(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 cq(Z){if(this.options.trimThreshold=10,z.defined(Z))if(z.object(Z)){if(z.defined(Z.background))this._setBackgroundColourOption("trimBackground",Z.background);if(z.defined(Z.threshold))if(z.number(Z.threshold)&&Z.threshold>=0)this.options.trimThreshold=Z.threshold;else throw z.invalidParameterError("threshold","positive number",Z.threshold);if(z.defined(Z.lineArt))this._setBooleanOption("trimLineArt",Z.lineArt);if(z.defined(Z.margin))if(z.integer(Z.margin)&&z.inRange(Z.margin,0,1e7))this.options.trimMargin=Z.margin;else throw z.invalidParameterError("margin","integer between 0 and 10000000",Z.margin)}else throw z.invalidParameterError("trim","object",Z);if(d3(this.options))this.options.rotateBefore=!0;return this}var JW,GW,QW,YW,u3,hq,fq,zW=(Z)=>{Object.assign(Z.prototype,{resize:mq,extend:uq,extract:dq,trim:cq}),Z.gravity=JW,Z.strategy=YW,Z.kernel=u3,Z.fit=hq,Z.position=GW};var qW=c(()=>{Y6();/*!
223
223
  Copyright 2013 Lovell Fuller and others.
224
224
  SPDX-License-Identifier: Apache-2.0
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"},YW={entropy:16,attention:17},u3={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},bq={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},vq={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"}});function mq(Z){if(!Array.isArray(Z))throw z.invalidParameterError("images to composite","array",Z);return this.options.composite=Z.map((W)=>{if(!z.object(W))throw z.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(z.defined(W.blend))if(z.string(c3[W.blend]))Q.blend=c3[W.blend];else throw z.invalidParameterError("blend","valid blend name",W.blend);if(z.defined(W.tile))if(z.bool(W.tile))Q.tile=W.tile;else throw z.invalidParameterError("tile","boolean",W.tile);if(z.defined(W.left))if(z.integer(W.left))Q.left=W.left;else throw z.invalidParameterError("left","integer",W.left);if(z.defined(W.top))if(z.integer(W.top))Q.top=W.top;else throw z.invalidParameterError("top","integer",W.top);if(z.defined(W.top)!==z.defined(W.left))throw Error("Expected both left and top to be set");else Q.hasOffset=z.integer(W.top)&&z.integer(W.left);if(z.defined(W.gravity))if(z.integer(W.gravity)&&z.inRange(W.gravity,0,8))Q.gravity=W.gravity;else if(z.string(W.gravity)&&z.integer(this.constructor.gravity[W.gravity]))Q.gravity=this.constructor.gravity[W.gravity];else throw z.invalidParameterError("gravity","valid gravity",W.gravity);if(z.defined(W.premultiplied))if(z.bool(W.premultiplied))Q.premultiplied=W.premultiplied;else throw z.invalidParameterError("premultiplied","boolean",W.premultiplied);return Q}),this}var c3,UW=(Z)=>{Z.prototype.composite=mq,Z.blend=c3};var KW=c(()=>{Y6();/*!
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"},YW={entropy:16,attention:17},u3={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},hq={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},fq={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"}});function lq(Z){if(!Array.isArray(Z))throw z.invalidParameterError("images to composite","array",Z);return this.options.composite=Z.map((W)=>{if(!z.object(W))throw z.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(z.defined(W.blend))if(z.string(c3[W.blend]))Q.blend=c3[W.blend];else throw z.invalidParameterError("blend","valid blend name",W.blend);if(z.defined(W.tile))if(z.bool(W.tile))Q.tile=W.tile;else throw z.invalidParameterError("tile","boolean",W.tile);if(z.defined(W.left))if(z.integer(W.left))Q.left=W.left;else throw z.invalidParameterError("left","integer",W.left);if(z.defined(W.top))if(z.integer(W.top))Q.top=W.top;else throw z.invalidParameterError("top","integer",W.top);if(z.defined(W.top)!==z.defined(W.left))throw Error("Expected both left and top to be set");else Q.hasOffset=z.integer(W.top)&&z.integer(W.left);if(z.defined(W.gravity))if(z.integer(W.gravity)&&z.inRange(W.gravity,0,8))Q.gravity=W.gravity;else if(z.string(W.gravity)&&z.integer(this.constructor.gravity[W.gravity]))Q.gravity=this.constructor.gravity[W.gravity];else throw z.invalidParameterError("gravity","valid gravity",W.gravity);if(z.defined(W.premultiplied))if(z.bool(W.premultiplied))Q.premultiplied=W.premultiplied;else throw z.invalidParameterError("premultiplied","boolean",W.premultiplied);return Q}),this}var c3,UW=(Z)=>{Z.prototype.composite=lq,Z.blend=c3};var KW=c(()=>{Y6();/*!
226
226
  Copyright 2013 Lovell Fuller and others.
227
227
  SPDX-License-Identifier: Apache-2.0
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 uq(Z,W){if(!z.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(z.integer(Z)&&!(Z%90))this.options.angle=Z;else if(z.number(Z)){if(this.options.rotationAngle=Z,z.object(W)&&W.background)this._setBackgroundColourOption("rotationBackground",W.background)}else throw z.invalidParameterError("angle","numeric",Z);return this}function dq(){return this.options.input.autoOrient=!0,this}function cq(Z){return this.options.flip=z.bool(Z)?Z:!0,this}function lq(Z){return this.options.flop=z.bool(Z)?Z:!0,this}function pq(Z,W){let Q=Array.isArray(Z)&&(Z.length===4&&Z.every(z.number)||Z.length===2&&Z.every((J)=>Array.isArray(J)&&J.length===2))?Z.flat():[];if(Q.length===4&&Q.every(z.number))this.options.affineMatrix=Q;else throw z.invalidParameterError("matrix","1x4 or 2x2 array",Z);if(z.defined(W))if(z.object(W)){if(this._setBackgroundColourOption("affineBackground",W.background),z.defined(W.idx))if(z.number(W.idx))this.options.affineIdx=W.idx;else throw z.invalidParameterError("options.idx","number",W.idx);if(z.defined(W.idy))if(z.number(W.idy))this.options.affineIdy=W.idy;else throw z.invalidParameterError("options.idy","number",W.idy);if(z.defined(W.odx))if(z.number(W.odx))this.options.affineOdx=W.odx;else throw z.invalidParameterError("options.odx","number",W.odx);if(z.defined(W.ody))if(z.number(W.ody))this.options.affineOdy=W.ody;else throw z.invalidParameterError("options.ody","number",W.ody);if(z.defined(W.interpolator))if(z.inArray(W.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=W.interpolator;else throw z.invalidParameterError("options.interpolator","valid interpolator name",W.interpolator)}else throw z.invalidParameterError("options","object",W);return this}function nq(Z){if(z.plainObject(Z)){if(z.number(Z.sigma)&&z.inRange(Z.sigma,0.000001,10))this.options.sharpenSigma=Z.sigma;else throw z.invalidParameterError("options.sigma","number between 0.000001 and 10",Z.sigma);if(z.defined(Z.m1))if(z.number(Z.m1)&&z.inRange(Z.m1,0,1e6))this.options.sharpenM1=Z.m1;else throw z.invalidParameterError("options.m1","number between 0 and 1000000",Z.m1);if(z.defined(Z.m2))if(z.number(Z.m2)&&z.inRange(Z.m2,0,1e6))this.options.sharpenM2=Z.m2;else throw z.invalidParameterError("options.m2","number between 0 and 1000000",Z.m2);if(z.defined(Z.x1))if(z.number(Z.x1)&&z.inRange(Z.x1,0,1e6))this.options.sharpenX1=Z.x1;else throw z.invalidParameterError("options.x1","number between 0 and 1000000",Z.x1);if(z.defined(Z.y2))if(z.number(Z.y2)&&z.inRange(Z.y2,0,1e6))this.options.sharpenY2=Z.y2;else throw z.invalidParameterError("options.y2","number between 0 and 1000000",Z.y2);if(z.defined(Z.y3))if(z.number(Z.y3)&&z.inRange(Z.y3,0,1e6))this.options.sharpenY3=Z.y3;else throw z.invalidParameterError("options.y3","number between 0 and 1000000",Z.y3)}else this.options.sharpenSigma=-1;return this}function iq(Z){if(!z.defined(Z))this.options.medianSize=3;else if(z.integer(Z)&&z.inRange(Z,1,1000))this.options.medianSize=Z;else throw z.invalidParameterError("size","integer between 1 and 1000",Z);return this}function rq(Z){let W;if(z.number(Z))W=Z;else if(z.plainObject(Z)){if(!z.number(Z.sigma))throw z.invalidParameterError("options.sigma","number between 0.3 and 1000",W);if(W=Z.sigma,"precision"in Z)if(z.string(VW[Z.precision]))this.options.precision=VW[Z.precision];else throw z.invalidParameterError("precision","one of: integer, float, approximate",Z.precision);if("minAmplitude"in Z)if(z.number(Z.minAmplitude)&&z.inRange(Z.minAmplitude,0.001,1))this.options.minAmpl=Z.minAmplitude;else throw z.invalidParameterError("minAmplitude","number between 0.001 and 1",Z.minAmplitude)}if(!z.defined(Z))this.options.blurSigma=-1;else if(z.bool(Z))this.options.blurSigma=Z?-1:0;else if(z.number(W)&&z.inRange(W,0.3,1000))this.options.blurSigma=W;else throw z.invalidParameterError("sigma","number between 0.3 and 1000",W);return this}function aq(Z){if(!z.defined(Z))this.options.dilateWidth=1;else if(z.integer(Z)&&z.inRange(Z,1,65536))this.options.dilateWidth=Z;else throw z.invalidParameterError("width","integer between 1 and 65536",Z);return this}function sq(Z){if(!z.defined(Z))this.options.erodeWidth=1;else if(z.integer(Z)&&z.inRange(Z,1,65536))this.options.erodeWidth=Z;else throw z.invalidParameterError("width","integer between 1 and 65536",Z);return this}function oq(Z){if(this.options.flatten=z.bool(Z)?Z:!0,z.object(Z))this._setBackgroundColourOption("flattenBackground",Z.background);return this}function tq(){return this.options.unflatten=!0,this}function eq(Z,W){if(!z.defined(Z))this.options.gamma=2.2;else if(z.number(Z)&&z.inRange(Z,1,3))this.options.gamma=Z;else throw z.invalidParameterError("gamma","number between 1.0 and 3.0",Z);if(!z.defined(W))this.options.gammaOut=this.options.gamma;else if(z.number(W)&&z.inRange(W,1,3))this.options.gammaOut=W;else throw z.invalidParameterError("gammaOut","number between 1.0 and 3.0",W);return this}function ZU(Z){if(this.options.negate=z.bool(Z)?Z:!0,z.plainObject(Z)&&"alpha"in Z)if(!z.bool(Z.alpha))throw z.invalidParameterError("alpha","should be boolean value",Z.alpha);else this.options.negateAlpha=Z.alpha;return this}function WU(Z){if(z.plainObject(Z)){if(z.defined(Z.lower))if(z.number(Z.lower)&&z.inRange(Z.lower,0,99))this.options.normaliseLower=Z.lower;else throw z.invalidParameterError("lower","number between 0 and 99",Z.lower);if(z.defined(Z.upper))if(z.number(Z.upper)&&z.inRange(Z.upper,1,100))this.options.normaliseUpper=Z.upper;else throw z.invalidParameterError("upper","number between 1 and 100",Z.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw z.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function XU(Z){return this.normalise(Z)}function QU(Z){if(z.plainObject(Z)){if(z.integer(Z.width)&&z.inRange(Z.width,1,65536))this.options.claheWidth=Z.width;else throw z.invalidParameterError("width","integer between 1 and 65536",Z.width);if(z.integer(Z.height)&&z.inRange(Z.height,1,65536))this.options.claheHeight=Z.height;else throw z.invalidParameterError("height","integer between 1 and 65536",Z.height);if(z.defined(Z.maxSlope))if(z.integer(Z.maxSlope)&&z.inRange(Z.maxSlope,0,100))this.options.claheMaxSlope=Z.maxSlope;else throw z.invalidParameterError("maxSlope","integer between 0 and 100",Z.maxSlope)}else throw z.invalidParameterError("options","plain object",Z);return this}function JU(Z){if(!z.object(Z)||!Array.isArray(Z.kernel)||!z.integer(Z.width)||!z.integer(Z.height)||!z.inRange(Z.width,3,1001)||!z.inRange(Z.height,3,1001)||Z.height*Z.width!==Z.kernel.length||!Z.kernel.every(z.number))throw Error("Invalid convolution kernel");if(!z.integer(Z.scale))Z.scale=Z.kernel.reduce((W,X)=>W+X,0);if(Z.scale<1)Z.scale=1;if(!z.integer(Z.offset))Z.offset=0;return this.options.convKernel=Z,this}function GU(Z,W){if(!z.defined(Z))this.options.threshold=128;else if(z.bool(Z))this.options.threshold=Z?128:0;else if(z.integer(Z)&&z.inRange(Z,0,255))this.options.threshold=Z;else throw z.invalidParameterError("threshold","integer between 0 and 255",Z);if(!z.object(W)||W.greyscale===!0||W.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function YU(Z,W,X){if(this.options.boolean=this._createInputDescriptor(Z,X),z.string(W)&&z.inArray(W,["and","or","eor"]))this.options.booleanOp=W;else throw z.invalidParameterError("operator","one of: and, or, eor",W);return this}function zU(Z,W){if(!z.defined(Z)&&z.number(W))Z=1;else if(z.number(Z)&&!z.defined(W))W=0;if(!z.defined(Z))this.options.linearA=[];else if(z.number(Z))this.options.linearA=[Z];else if(Array.isArray(Z)&&Z.length&&Z.every(z.number))this.options.linearA=Z;else throw z.invalidParameterError("a","number or array of numbers",Z);if(!z.defined(W))this.options.linearB=[];else if(z.number(W))this.options.linearB=[W];else if(Array.isArray(W)&&W.length&&W.every(z.number))this.options.linearB=W;else throw z.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 qU(Z){if(!Array.isArray(Z))throw z.invalidParameterError("inputMatrix","array",Z);let W=Z.length;if(W!==3&&W!==4)throw z.invalidParameterError("inputMatrix","3x3 or 4x4 array",W);if(!Z.every((Q)=>Array.isArray(Q)&&Q.length===W))throw z.invalidParameterError("inputMatrix",`array of ${W} arrays of length ${W}`,Z);let X=Z.flat();if(!X.every(z.number))throw z.invalidParameterError("inputMatrix","array of numbers",X);return this.options.recombMatrix=X,this}function UU(Z){if(!z.plainObject(Z))throw z.invalidParameterError("options","plain object",Z);if("brightness"in Z)if(z.number(Z.brightness)&&Z.brightness>=0)this.options.brightness=Z.brightness;else throw z.invalidParameterError("brightness","number above zero",Z.brightness);if("saturation"in Z)if(z.number(Z.saturation)&&Z.saturation>=0)this.options.saturation=Z.saturation;else throw z.invalidParameterError("saturation","number above zero",Z.saturation);if("hue"in Z)if(z.integer(Z.hue))this.options.hue=Z.hue%360;else throw z.invalidParameterError("hue","number",Z.hue);if("lightness"in Z)if(z.number(Z.lightness))this.options.lightness=Z.lightness;else throw z.invalidParameterError("lightness","number",Z.lightness);return this}var VW,BW=(Z)=>{Object.assign(Z.prototype,{autoOrient:dq,rotate:uq,flip:cq,flop:lq,affine:pq,sharpen:nq,erode:sq,dilate:aq,median:iq,blur:rq,flatten:oq,unflatten:tq,gamma:eq,negate:ZU,normalise:WU,normalize:XU,clahe:QU,convolve:JU,threshold:GU,boolean:YU,linear:zU,recomb:qU,modulate:UU})};var HW=c(()=>{Y6();/*!
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 pq(Z,W){if(!z.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(z.integer(Z)&&!(Z%90))this.options.angle=Z;else if(z.number(Z)){if(this.options.rotationAngle=Z,z.object(W)&&W.background)this._setBackgroundColourOption("rotationBackground",W.background)}else throw z.invalidParameterError("angle","numeric",Z);return this}function nq(){return this.options.input.autoOrient=!0,this}function iq(Z){return this.options.flip=z.bool(Z)?Z:!0,this}function rq(Z){return this.options.flop=z.bool(Z)?Z:!0,this}function aq(Z,W){let Q=Array.isArray(Z)&&(Z.length===4&&Z.every(z.number)||Z.length===2&&Z.every((J)=>Array.isArray(J)&&J.length===2))?Z.flat():[];if(Q.length===4&&Q.every(z.number))this.options.affineMatrix=Q;else throw z.invalidParameterError("matrix","1x4 or 2x2 array",Z);if(z.defined(W))if(z.object(W)){if(this._setBackgroundColourOption("affineBackground",W.background),z.defined(W.idx))if(z.number(W.idx))this.options.affineIdx=W.idx;else throw z.invalidParameterError("options.idx","number",W.idx);if(z.defined(W.idy))if(z.number(W.idy))this.options.affineIdy=W.idy;else throw z.invalidParameterError("options.idy","number",W.idy);if(z.defined(W.odx))if(z.number(W.odx))this.options.affineOdx=W.odx;else throw z.invalidParameterError("options.odx","number",W.odx);if(z.defined(W.ody))if(z.number(W.ody))this.options.affineOdy=W.ody;else throw z.invalidParameterError("options.ody","number",W.ody);if(z.defined(W.interpolator))if(z.inArray(W.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=W.interpolator;else throw z.invalidParameterError("options.interpolator","valid interpolator name",W.interpolator)}else throw z.invalidParameterError("options","object",W);return this}function sq(Z){if(z.plainObject(Z)){if(z.number(Z.sigma)&&z.inRange(Z.sigma,0.000001,10))this.options.sharpenSigma=Z.sigma;else throw z.invalidParameterError("options.sigma","number between 0.000001 and 10",Z.sigma);if(z.defined(Z.m1))if(z.number(Z.m1)&&z.inRange(Z.m1,0,1e6))this.options.sharpenM1=Z.m1;else throw z.invalidParameterError("options.m1","number between 0 and 1000000",Z.m1);if(z.defined(Z.m2))if(z.number(Z.m2)&&z.inRange(Z.m2,0,1e6))this.options.sharpenM2=Z.m2;else throw z.invalidParameterError("options.m2","number between 0 and 1000000",Z.m2);if(z.defined(Z.x1))if(z.number(Z.x1)&&z.inRange(Z.x1,0,1e6))this.options.sharpenX1=Z.x1;else throw z.invalidParameterError("options.x1","number between 0 and 1000000",Z.x1);if(z.defined(Z.y2))if(z.number(Z.y2)&&z.inRange(Z.y2,0,1e6))this.options.sharpenY2=Z.y2;else throw z.invalidParameterError("options.y2","number between 0 and 1000000",Z.y2);if(z.defined(Z.y3))if(z.number(Z.y3)&&z.inRange(Z.y3,0,1e6))this.options.sharpenY3=Z.y3;else throw z.invalidParameterError("options.y3","number between 0 and 1000000",Z.y3)}else this.options.sharpenSigma=-1;return this}function oq(Z){if(!z.defined(Z))this.options.medianSize=3;else if(z.integer(Z)&&z.inRange(Z,1,1000))this.options.medianSize=Z;else throw z.invalidParameterError("size","integer between 1 and 1000",Z);return this}function tq(Z){let W;if(z.number(Z))W=Z;else if(z.plainObject(Z)){if(!z.number(Z.sigma))throw z.invalidParameterError("options.sigma","number between 0.3 and 1000",W);if(W=Z.sigma,"precision"in Z)if(z.string(VW[Z.precision]))this.options.precision=VW[Z.precision];else throw z.invalidParameterError("precision","one of: integer, float, approximate",Z.precision);if("minAmplitude"in Z)if(z.number(Z.minAmplitude)&&z.inRange(Z.minAmplitude,0.001,1))this.options.minAmpl=Z.minAmplitude;else throw z.invalidParameterError("minAmplitude","number between 0.001 and 1",Z.minAmplitude)}if(!z.defined(Z))this.options.blurSigma=-1;else if(z.bool(Z))this.options.blurSigma=Z?-1:0;else if(z.number(W)&&z.inRange(W,0.3,1000))this.options.blurSigma=W;else throw z.invalidParameterError("sigma","number between 0.3 and 1000",W);return this}function eq(Z){if(!z.defined(Z))this.options.dilateWidth=1;else if(z.integer(Z)&&z.inRange(Z,1,65536))this.options.dilateWidth=Z;else throw z.invalidParameterError("width","integer between 1 and 65536",Z);return this}function ZU(Z){if(!z.defined(Z))this.options.erodeWidth=1;else if(z.integer(Z)&&z.inRange(Z,1,65536))this.options.erodeWidth=Z;else throw z.invalidParameterError("width","integer between 1 and 65536",Z);return this}function WU(Z){if(this.options.flatten=z.bool(Z)?Z:!0,z.object(Z))this._setBackgroundColourOption("flattenBackground",Z.background);return this}function XU(){return this.options.unflatten=!0,this}function QU(Z,W){if(!z.defined(Z))this.options.gamma=2.2;else if(z.number(Z)&&z.inRange(Z,1,3))this.options.gamma=Z;else throw z.invalidParameterError("gamma","number between 1.0 and 3.0",Z);if(!z.defined(W))this.options.gammaOut=this.options.gamma;else if(z.number(W)&&z.inRange(W,1,3))this.options.gammaOut=W;else throw z.invalidParameterError("gammaOut","number between 1.0 and 3.0",W);return this}function JU(Z){if(this.options.negate=z.bool(Z)?Z:!0,z.plainObject(Z)&&"alpha"in Z)if(!z.bool(Z.alpha))throw z.invalidParameterError("alpha","should be boolean value",Z.alpha);else this.options.negateAlpha=Z.alpha;return this}function GU(Z){if(z.plainObject(Z)){if(z.defined(Z.lower))if(z.number(Z.lower)&&z.inRange(Z.lower,0,99))this.options.normaliseLower=Z.lower;else throw z.invalidParameterError("lower","number between 0 and 99",Z.lower);if(z.defined(Z.upper))if(z.number(Z.upper)&&z.inRange(Z.upper,1,100))this.options.normaliseUpper=Z.upper;else throw z.invalidParameterError("upper","number between 1 and 100",Z.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw z.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function YU(Z){return this.normalise(Z)}function zU(Z){if(z.plainObject(Z)){if(z.integer(Z.width)&&z.inRange(Z.width,1,65536))this.options.claheWidth=Z.width;else throw z.invalidParameterError("width","integer between 1 and 65536",Z.width);if(z.integer(Z.height)&&z.inRange(Z.height,1,65536))this.options.claheHeight=Z.height;else throw z.invalidParameterError("height","integer between 1 and 65536",Z.height);if(z.defined(Z.maxSlope))if(z.integer(Z.maxSlope)&&z.inRange(Z.maxSlope,0,100))this.options.claheMaxSlope=Z.maxSlope;else throw z.invalidParameterError("maxSlope","integer between 0 and 100",Z.maxSlope)}else throw z.invalidParameterError("options","plain object",Z);return this}function qU(Z){if(!z.object(Z)||!Array.isArray(Z.kernel)||!z.integer(Z.width)||!z.integer(Z.height)||!z.inRange(Z.width,3,1001)||!z.inRange(Z.height,3,1001)||Z.height*Z.width!==Z.kernel.length||!Z.kernel.every(z.number))throw Error("Invalid convolution kernel");if(!z.integer(Z.scale))Z.scale=Z.kernel.reduce((W,X)=>W+X,0);if(Z.scale<1)Z.scale=1;if(!z.integer(Z.offset))Z.offset=0;return this.options.convKernel=Z,this}function UU(Z,W){if(!z.defined(Z))this.options.threshold=128;else if(z.bool(Z))this.options.threshold=Z?128:0;else if(z.integer(Z)&&z.inRange(Z,0,255))this.options.threshold=Z;else throw z.invalidParameterError("threshold","integer between 0 and 255",Z);if(!z.object(W)||W.greyscale===!0||W.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function KU(Z,W,X){if(this.options.boolean=this._createInputDescriptor(Z,X),z.string(W)&&z.inArray(W,["and","or","eor"]))this.options.booleanOp=W;else throw z.invalidParameterError("operator","one of: and, or, eor",W);return this}function VU(Z,W){if(!z.defined(Z)&&z.number(W))Z=1;else if(z.number(Z)&&!z.defined(W))W=0;if(!z.defined(Z))this.options.linearA=[];else if(z.number(Z))this.options.linearA=[Z];else if(Array.isArray(Z)&&Z.length&&Z.every(z.number))this.options.linearA=Z;else throw z.invalidParameterError("a","number or array of numbers",Z);if(!z.defined(W))this.options.linearB=[];else if(z.number(W))this.options.linearB=[W];else if(Array.isArray(W)&&W.length&&W.every(z.number))this.options.linearB=W;else throw z.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 BU(Z){if(!Array.isArray(Z))throw z.invalidParameterError("inputMatrix","array",Z);let W=Z.length;if(W!==3&&W!==4)throw z.invalidParameterError("inputMatrix","3x3 or 4x4 array",W);if(!Z.every((Q)=>Array.isArray(Q)&&Q.length===W))throw z.invalidParameterError("inputMatrix",`array of ${W} arrays of length ${W}`,Z);let X=Z.flat();if(!X.every(z.number))throw z.invalidParameterError("inputMatrix","array of numbers",X);return this.options.recombMatrix=X,this}function HU(Z){if(!z.plainObject(Z))throw z.invalidParameterError("options","plain object",Z);if("brightness"in Z)if(z.number(Z.brightness)&&Z.brightness>=0)this.options.brightness=Z.brightness;else throw z.invalidParameterError("brightness","number above zero",Z.brightness);if("saturation"in Z)if(z.number(Z.saturation)&&Z.saturation>=0)this.options.saturation=Z.saturation;else throw z.invalidParameterError("saturation","number above zero",Z.saturation);if("hue"in Z)if(z.integer(Z.hue))this.options.hue=Z.hue%360;else throw z.invalidParameterError("hue","number",Z.hue);if("lightness"in Z)if(z.number(Z.lightness))this.options.lightness=Z.lightness;else throw z.invalidParameterError("lightness","number",Z.lightness);return this}var VW,BW=(Z)=>{Object.assign(Z.prototype,{autoOrient:nq,rotate:pq,flip:iq,flop:rq,affine:aq,sharpen:sq,erode:ZU,dilate:eq,median:oq,blur:tq,flatten:WU,unflatten:XU,gamma:QU,negate:JU,normalise:GU,normalize:YU,clahe:zU,convolve:qU,threshold:UU,boolean:KU,linear:VU,recomb:BU,modulate:HU})};var HW=c(()=>{Y6();/*!
229
229
  Copyright 2013 Lovell Fuller and others.
230
230
  SPDX-License-Identifier: Apache-2.0
231
- */VW={integer:"integer",float:"float",approximate:"approximate"}});var IW=n((QL,MW)=>{var{defineProperty:r3,getOwnPropertyDescriptor:KU,getOwnPropertyNames:VU}=Object,BU=Object.prototype.hasOwnProperty,HU=(Z,W)=>{for(var X in W)r3(Z,X,{get:W[X],enumerable:!0})},$U=(Z,W,X,Q)=>{if(W&&typeof W==="object"||typeof W==="function"){for(let J of VU(W))if(!BU.call(Z,J)&&J!==X)r3(Z,J,{get:()=>W[J],enumerable:!(Q=KU(W,J))||Q.enumerable})}return Z},FU=(Z)=>$U(r3({},"__esModule",{value:!0}),Z),$W={};HU($W,{default:()=>CU});MW.exports=FU($W);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 B6=Object.freeze(l3),FW=Object.create(null);for(let Z in B6)if(Object.hasOwn(B6,Z))FW[B6[Z]]=Z;var y0={to:{},get:{}};y0.get=function(Z){let W=Z.slice(0,3).toLowerCase(),X,Q;switch(W){case"hsl":{X=y0.get.hsl(Z),Q="hsl";break}case"hwb":{X=y0.get.hwb(Z),Q="hwb";break}default:{X=y0.get.rgb(Z),Q="rgb";break}}if(!X)return null;return{model:Q,value:X}};y0.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+)$/,Y=[0,0,0,1],U,K,V;if(U=Z.match(X)){V=U[2],U=U[1];for(K=0;K<3;K++){let H=K*2;Y[K]=Number.parseInt(U.slice(H,H+2),16)}if(V)Y[3]=Number.parseInt(V,16)/255}else if(U=Z.match(W)){U=U[1],V=U[3];for(K=0;K<3;K++)Y[K]=Number.parseInt(U[K]+U[K],16);if(V)Y[3]=Number.parseInt(V+V,16)/255}else if(U=Z.match(Q)){for(K=0;K<3;K++)Y[K]=Number.parseFloat(U[K+1]);if(U[4])Y[3]=U[5]?Number.parseFloat(U[4])*0.01:Number.parseFloat(U[4])}else if(U=Z.match(J)){for(K=0;K<3;K++)Y[K]=Math.round(Number.parseFloat(U[K+1])*2.55);if(U[4])Y[3]=U[5]?Number.parseFloat(U[4])*0.01:Number.parseFloat(U[4])}else if(U=Z.toLowerCase().match(G)){if(U[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(B6,U[1]))return null;return Y=B6[U[1]].slice(),Y[3]=1,Y}else return null;for(K=0;K<3;K++)Y[K]=d6(Y[K],0,255);return Y[3]=d6(Y[3],0,1),Y};y0.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=d6(Number.parseFloat(X[2]),0,100),Y=d6(Number.parseFloat(X[3]),0,100),U=d6(Number.isNaN(Q)?1:Q,0,1);return[J,G,Y,U]}return null};y0.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=d6(Number.parseFloat(X[2]),0,100),Y=d6(Number.parseFloat(X[3]),0,100),U=d6(Number.isNaN(Q)?1:Q,0,1);return[J,G,Y,U]}return null};y0.to.hex=function(...Z){return"#"+K1(Z[0])+K1(Z[1])+K1(Z[2])+(Z[3]<1?K1(Math.round(Z[3]*255)):"")};y0.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]+")"};y0.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]+")"};y0.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]+")"};y0.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+")"};y0.to.keyword=function(...Z){return FW[Z.slice(0,3)]};function d6(Z,W,X){return Math.min(Math.max(W,Z),X)}function K1(Z){let W=Math.round(Z).toString(16).toUpperCase();return W.length<2?"0"+W:W}var R4=y0,LW={};for(let Z of Object.keys(B6))LW[B6[Z]]=Z;var y={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"]}},Z4=y,C6=0.008856451679035631;function _4(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 j4(Z){return Z>0.04045?((Z+0.055)/1.055)**2.4:Z/12.92}for(let Z of Object.keys(y)){if(!("channels"in y[Z]))throw Error("missing channels property: "+Z);if(!("labels"in y[Z]))throw Error("missing channel labels property: "+Z);if(y[Z].labels.length!==y[Z].channels)throw Error("channel and label counts mismatch: "+Z);let{channels:W,labels:X}=y[Z];delete y[Z].channels,delete y[Z].labels,Object.defineProperty(y[Z],"channels",{value:W}),Object.defineProperty(y[Z],"labels",{value:X})}y.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),Y=G-J,U,K;switch(G){case J:{U=0;break}case W:{U=(X-Q)/Y;break}case X:{U=2+(Q-W)/Y;break}case Q:{U=4+(W-X)/Y;break}}if(U=Math.min(U*60,360),U<0)U+=360;let V=(J+G)/2;if(G===J)K=0;else if(V<=0.5)K=Y/(G+J);else K=Y/(2-G-J);return[U,K*100,V*100]};y.rgb.hsv=function(Z){let W,X,Q,J,G,Y=Z[0]/255,U=Z[1]/255,K=Z[2]/255,V=Math.max(Y,U,K),H=V-Math.min(Y,U,K),B=function($){return(V-$)/6/H+0.5};if(H===0)J=0,G=0;else{switch(G=H/V,W=B(Y),X=B(U),Q=B(K),V){case Y:{J=Q-X;break}case U:{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]};y.rgb.hwb=function(Z){let W=Z[0],X=Z[1],Q=Z[2],J=y.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]};y.rgb.oklab=function(Z){let W=j4(Z[0]/255),X=j4(Z[1]/255),Q=j4(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),Y=Math.cbrt(0.0883024619*W+0.2817188376*X+0.6299787005*Q),U=0.2104542553*J+0.793617785*G-0.0040720468*Y,K=1.9779984951*J-2.428592205*G+0.4505937099*Y,V=0.0259040371*J+0.7827717662*G-0.808675766*Y;return[U*100,K*100,V*100]};y.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,Y=(1-X-J)/(1-J)||0,U=(1-Q-J)/(1-J)||0;return[G*100,Y*100,U*100,J*100]};function LU(Z,W){return(Z[0]-W[0])**2+(Z[1]-W[1])**2+(Z[2]-W[2])**2}y.rgb.keyword=function(Z){let W=LW[Z];if(W)return W;let X=Number.POSITIVE_INFINITY,Q;for(let J of Object.keys(B6)){let G=B6[J],Y=LU(Z,G);if(Y<X)X=Y,Q=J}return Q};y.keyword.rgb=function(Z){return[...B6[Z]]};y.rgb.xyz=function(Z){let W=j4(Z[0]/255),X=j4(Z[1]/255),Q=j4(Z[2]/255),J=W*0.4124564+X*0.3575761+Q*0.1804375,G=W*0.2126729+X*0.7151522+Q*0.072175,Y=W*0.0193339+X*0.119192+Q*0.9503041;return[J*100,G*100,Y*100]};y.rgb.lab=function(Z){let W=y.rgb.xyz(Z),X=W[0],Q=W[1],J=W[2];X/=95.047,Q/=100,J/=108.883,X=X>C6?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>C6?Q**0.3333333333333333:7.787*Q+0.13793103448275862,J=J>C6?J**0.3333333333333333:7.787*J+0.13793103448275862;let G=116*Q-16,Y=500*(X-Q),U=200*(Q-J);return[G,Y,U]};y.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 Y=Q<0.5?Q*(1+X):Q+X-Q*X,U=2*Q-Y,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=U+(Y-U)*6*J;else if(2*J<1)G=Y;else if(3*J<2)G=U+(Y-U)*(0.6666666666666666-J)*6;else G=U;K[V]=G*255}return K};y.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 Y=(Q+X)/2,U=Q===0?2*J/(G+J):2*X/(Q+X);return[W,U*100,Y*100]};y.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),Y=255*Q*(1-X),U=255*Q*(1-X*G),K=255*Q*(1-X*(1-G));switch(Q*=255,J){case 0:return[Q,K,Y];case 1:return[U,Q,Y];case 2:return[Y,Q,K];case 3:return[Y,U,Q];case 4:return[K,Y,Q];case 5:return[Q,Y,U]}};y.hsv.hsl=function(Z){let W=Z[0],X=Z[1]/100,Q=Z[2]/100,J=Math.max(Q,0.01),G,Y;Y=(2-X)*Q;let U=(2-X)*J;return G=X*J,G/=U<=1?U:2-U,G=G||0,Y/=2,[W,G*100,Y*100]};y.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 Y=Math.floor(6*W),U=1-Q;if(G=6*W-Y,(Y&1)!==0)G=1-G;let K=X+G*(U-X),V,H,B;switch(Y){default:case 6:case 0:{V=U,H=K,B=X;break}case 1:{V=K,H=U,B=X;break}case 2:{V=X,H=U,B=K;break}case 3:{V=X,H=K,B=U;break}case 4:{V=K,H=X,B=U;break}case 5:{V=U,H=X,B=K;break}}return[V*255,H*255,B*255]};y.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),Y=1-Math.min(1,X*(1-J)+J),U=1-Math.min(1,Q*(1-J)+J);return[G*255,Y*255,U*255]};y.xyz.rgb=function(Z){let W=Z[0]/100,X=Z[1]/100,Q=Z[2]/100,J,G,Y;return J=W*3.2404542+X*-1.5371385+Q*-0.4985314,G=W*-0.969266+X*1.8760108+Q*0.041556,Y=W*0.0556434+X*-0.2040259+Q*1.0572252,J=_4(J),G=_4(G),Y=_4(Y),[J*255,G*255,Y*255]};y.xyz.lab=function(Z){let W=Z[0],X=Z[1],Q=Z[2];W/=95.047,X/=100,Q/=108.883,W=W>C6?W**0.3333333333333333:7.787*W+0.13793103448275862,X=X>C6?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>C6?Q**0.3333333333333333:7.787*Q+0.13793103448275862;let J=116*X-16,G=500*(W-X),Y=200*(X-Q);return[J,G,Y]};y.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),Y=Math.cbrt(0.0482003018*W+0.2643662691*X+0.633851707*Q),U=0.2104542553*J+0.793617785*G-0.0040720468*Y,K=1.9779984951*J-2.428592205*G+0.4505937099*Y,V=0.0259040371*J+0.7827717662*G-0.808675766*Y;return[U*100,K*100,V*100]};y.oklab.oklch=function(Z){return y.lab.lch(Z)};y.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,Y=(1.000000055*W-0.089484182*X-1.291485538*Q)**3,U=1.227013851*J-0.55779998*G+0.281256149*Y,K=-0.040580178*J+1.11225687*G-0.071676679*Y,V=-0.076381285*J-0.421481978*G+1.58616322*Y;return[U*100,K*100,V*100]};y.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,Y=(W-0.0894841775*X-1.291485548*Q)**3,U=_4(4.0767416621*J-3.3077115913*G+0.2309699292*Y),K=_4(-1.2684380046*J+2.6097574011*G-0.3413193965*Y),V=_4(-0.0041960863*J-0.7034186147*G+1.707614701*Y);return[U*255,K*255,V*255]};y.oklch.oklab=function(Z){return y.lch.lab(Z)};y.lab.xyz=function(Z){let W=Z[0],X=Z[1],Q=Z[2],J,G,Y;G=(W+16)/116,J=X/500+G,Y=G-Q/200;let U=G**3,K=J**3,V=Y**3;return G=U>C6?U:(G-0.13793103448275862)/7.787,J=K>C6?K:(J-0.13793103448275862)/7.787,Y=V>C6?V:(Y-0.13793103448275862)/7.787,J*=95.047,G*=100,Y*=108.883,[J,G,Y]};y.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 Y=Math.sqrt(X*X+Q*Q);return[W,Y,J]};y.lch.lab=function(Z){let W=Z[0],X=Z[1],J=Z[2]/360*2*Math.PI,G=X*Math.cos(J),Y=X*Math.sin(J);return[W,G,Y]};y.rgb.ansi16=function(Z,W=null){let[X,Q,J]=Z,G=W===null?y.rgb.hsv(Z)[2]:W;if(G=Math.round(G/50),G===0)return 30;let Y=30+(Math.round(J/255)<<2|Math.round(Q/255)<<1|Math.round(X/255));if(G===2)Y+=60;return Y};y.hsv.ansi16=function(Z){return y.rgb.ansi16(y.hsv.rgb(Z),Z[2])};y.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)};y.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]};y.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]};y.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};y.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((U)=>U+U).join("");let Q=Number.parseInt(X,16),J=Q>>16&255,G=Q>>8&255,Y=Q&255;return[J,G,Y]};y.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),Y=J-G,U,K=Y<1?G/(1-Y):0;if(Y<=0)U=0;else if(J===W)U=(X-Q)/Y%6;else if(J===X)U=2+(Q-W)/Y;else U=4+(W-X)/Y;return U/=6,U%=1,[U*360,Y*100,K*100]};y.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]};y.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]};y.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,Y=G%1,U=1-Y,K=0;switch(Math.floor(G)){case 0:{J[0]=1,J[1]=Y,J[2]=0;break}case 1:{J[0]=U,J[1]=1,J[2]=0;break}case 2:{J[0]=0,J[1]=1,J[2]=Y;break}case 3:{J[0]=0,J[1]=U,J[2]=1;break}case 4:{J[0]=Y,J[1]=0,J[2]=1;break}default:J[0]=1,J[1]=0,J[2]=U}return K=(1-X)*Q,[(X*J[0]+K)*255,(X*J[1]+K)*255,(X*J[2]+K)*255]};y.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]};y.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]};y.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]};y.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]};y.apple.rgb=function(Z){return[Z[0]/65535*255,Z[1]/65535*255,Z[2]/65535*255]};y.rgb.apple=function(Z){return[Z[0]/255*65535,Z[1]/255*65535,Z[2]/255*65535]};y.gray.rgb=function(Z){return[Z[0]/100*255,Z[0]/100*255,Z[0]/100*255]};y.gray.hsl=function(Z){return[0,0,Z[0]]};y.gray.hsv=y.gray.hsl;y.gray.hwb=function(Z){return[0,100,Z[0]]};y.gray.cmyk=function(Z){return[0,0,0,Z[0]]};y.gray.lab=function(Z){return[Z[0],0,0]};y.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};y.rgb.gray=function(Z){return[(Z[0]+Z[1]+Z[2])/3/255*100]};function AU(){let Z={},W=Object.keys(Z4);for(let{length:X}=W,Q=0;Q<X;Q++)Z[W[Q]]={distance:-1,parent:null};return Z}function MU(Z){let W=AU(),X=[Z];W[Z].distance=0;while(X.length>0){let Q=X.pop(),J=Object.keys(Z4[Q]);for(let{length:G}=J,Y=0;Y<G;Y++){let U=J[Y],K=W[U];if(K.distance===-1)K.distance=W[Q].distance+1,K.parent=Q,X.unshift(U)}}return W}function IU(Z,W){return function(X){return W(Z(X))}}function NU(Z,W){let X=[W[Z].parent,Z],Q=Z4[W[Z].parent][Z],J=W[Z].parent;while(W[J].parent)X.unshift(W[J].parent),Q=IU(Z4[W[J].parent][J],Q),J=W[J].parent;return Q.conversion=X,Q}function wU(Z){let W=MU(Z),X={},Q=Object.keys(W);for(let{length:J}=Q,G=0;G<J;G++){let Y=Q[G];if(W[Y].parent===null)continue;X[Y]=NU(Y,W)}return X}var DU=wU,P4={},TU=Object.keys(Z4);function RU(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 PU(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,Y=0;Y<G;Y++)J[Y]=Math.round(J[Y]);return J};if("conversion"in Z)W.conversion=Z.conversion;return W}for(let Z of TU){P4[Z]={},Object.defineProperty(P4[Z],"channels",{value:Z4[Z].channels}),Object.defineProperty(P4[Z],"labels",{value:Z4[Z].labels});let W=DU(Z),X=Object.keys(W);for(let Q of X){let J=W[Q];P4[Z][Q]=PU(J),P4[Z][Q].raw=RU(J)}}var d0=P4,AW=["keyword","gray","hex"],p3={};for(let Z of Object.keys(d0))p3[[...d0[Z].labels].sort().join("")]=Z;var n3={};function D0(Z,W){if(!(this instanceof D0))return new D0(Z,W);if(W&&W in AW)W=null;if(W&&!(W in d0))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=R4.get(Z);if(J===null)throw Error("Unable to parse color from string: "+Z);this.model=J.model,Q=d0[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=d0[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:Y}=d0[this.model],U=[];for(X=0;X<Y.length;X++)U.push(Z[Y[X]]);this.color=i3(U)}if(n3[this.model]){Q=d0[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 R4.to?this:this.rgb();W=W.round(typeof Z==="number"?Z:1);let X=W.valpha===1?W.color:[...W.color,this.valpha];return R4.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 R4.to.rgb.percent(...X)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let Z={},{channels:W}=d0[this.model],{labels:X}=d0[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(jU(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:B0("rgb",0,I0(255)),green:B0("rgb",1,I0(255)),blue:B0("rgb",2,I0(255)),hue:B0(["hsl","hsv","hsl","hwb","hcg"],0,(Z)=>(Z%360+360)%360),saturationl:B0("hsl",1,I0(100)),lightness:B0("hsl",2,I0(100)),saturationv:B0("hsv",1,I0(100)),value:B0("hsv",2,I0(100)),chroma:B0("hcg",1,I0(100)),gray:B0("hcg",2,I0(100)),white:B0("hwb",1,I0(100)),wblack:B0("hwb",2,I0(100)),cyan:B0("cmyk",0,I0(100)),magenta:B0("cmyk",1,I0(100)),yellow:B0("cmyk",2,I0(100)),black:B0("cmyk",3,I0(100)),x:B0("xyz",0,I0(95.047)),y:B0("xyz",1,I0(100)),z:B0("xyz",2,I0(108.833)),l:B0("lab",0,I0(100)),a:B0("lab",1),b:B0("lab",2),keyword(Z){if(Z!==void 0)return new D0(Z);return d0[this.model].keyword(this.color)},hex(Z){if(Z!==void 0)return new D0(Z);return R4.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 R4.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,Y=X.alpha()-Q.alpha(),U=((G*Y===-1?G:(G+Y)/(1+G*Y))+1)/2,K=1-U;return D0.rgb(U*X.red()+K*Q.red(),U*X.green()+K*Q.green(),U*X.blue()+K*Q.blue(),X.alpha()*J+Q.alpha()*(1-J))}};for(let Z of Object.keys(d0)){if(AW.includes(Z))continue;let{channels:W}=d0[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([...EU(d0[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 _U(Z,W){return Number(Z.toFixed(W))}function jU(Z){return function(W){return _U(W,Z)}}function B0(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 I0(Z){return function(W){return Math.max(0,Math.min(Z,W))}}function EU(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 CU=D0});var wW=n((JL,NW)=>{NW.exports=IW().default});function OU(Z){return this._setBackgroundColourOption("tint",Z),this}function xU(Z){return this.options.greyscale=z.bool(Z)?Z:!0,this}function kU(Z){return this.greyscale(Z)}function SU(Z){if(!z.string(Z))throw z.invalidParameterError("colourspace","string",Z);return this.options.colourspacePipeline=Z,this}function bU(Z){return this.pipelineColourspace(Z)}function vU(Z){if(!z.string(Z))throw z.invalidParameterError("colourspace","string",Z);return this.options.colourspace=Z,this}function yU(Z){return this.toColourspace(Z)}function RW(Z){if(z.object(Z)||z.string(Z)&&Z.length>=3&&Z.length<=200){let W=TW.default(Z),X=W.red(),Q=W.green(),J=W.blue(),G=Math.round(W.alpha()*255);for(let[Y,U]of[["red",X],["green",Q],["blue",J],["alpha",G]])if(!z.number(U))throw z.invalidParameterError(`background.${Y}`,"number",U);return[X,Q,J,G]}else throw z.invalidParameterError("background","object or string",Z)}function gU(Z,W){if(z.defined(W))this.options[Z]=RW(W)}var TW,DW,PW=(Z)=>{Object.assign(Z.prototype,{tint:OU,greyscale:xU,grayscale:kU,pipelineColourspace:SU,pipelineColorspace:bU,toColourspace:vU,toColorspace:yU,_getBackgroundColourOption:RW,_setBackgroundColourOption:gU}),Z.colourspace=DW,Z.colorspace=DW};var _W=c(()=>{Y6();TW=g4(wW(),1);/*!
231
+ */VW={integer:"integer",float:"float",approximate:"approximate"}});var IW=n((zL,MW)=>{var{defineProperty:r3,getOwnPropertyDescriptor:$U,getOwnPropertyNames:FU}=Object,LU=Object.prototype.hasOwnProperty,AU=(Z,W)=>{for(var X in W)r3(Z,X,{get:W[X],enumerable:!0})},MU=(Z,W,X,Q)=>{if(W&&typeof W==="object"||typeof W==="function"){for(let J of FU(W))if(!LU.call(Z,J)&&J!==X)r3(Z,J,{get:()=>W[J],enumerable:!(Q=$U(W,J))||Q.enumerable})}return Z},IU=(Z)=>MU(r3({},"__esModule",{value:!0}),Z),$W={};AU($W,{default:()=>SU});MW.exports=IU($W);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 B6=Object.freeze(l3),FW=Object.create(null);for(let Z in B6)if(Object.hasOwn(B6,Z))FW[B6[Z]]=Z;var y0={to:{},get:{}};y0.get=function(Z){let W=Z.slice(0,3).toLowerCase(),X,Q;switch(W){case"hsl":{X=y0.get.hsl(Z),Q="hsl";break}case"hwb":{X=y0.get.hwb(Z),Q="hwb";break}default:{X=y0.get.rgb(Z),Q="rgb";break}}if(!X)return null;return{model:Q,value:X}};y0.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+)$/,Y=[0,0,0,1],U,K,V;if(U=Z.match(X)){V=U[2],U=U[1];for(K=0;K<3;K++){let H=K*2;Y[K]=Number.parseInt(U.slice(H,H+2),16)}if(V)Y[3]=Number.parseInt(V,16)/255}else if(U=Z.match(W)){U=U[1],V=U[3];for(K=0;K<3;K++)Y[K]=Number.parseInt(U[K]+U[K],16);if(V)Y[3]=Number.parseInt(V+V,16)/255}else if(U=Z.match(Q)){for(K=0;K<3;K++)Y[K]=Number.parseFloat(U[K+1]);if(U[4])Y[3]=U[5]?Number.parseFloat(U[4])*0.01:Number.parseFloat(U[4])}else if(U=Z.match(J)){for(K=0;K<3;K++)Y[K]=Math.round(Number.parseFloat(U[K+1])*2.55);if(U[4])Y[3]=U[5]?Number.parseFloat(U[4])*0.01:Number.parseFloat(U[4])}else if(U=Z.toLowerCase().match(G)){if(U[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(B6,U[1]))return null;return Y=B6[U[1]].slice(),Y[3]=1,Y}else return null;for(K=0;K<3;K++)Y[K]=d6(Y[K],0,255);return Y[3]=d6(Y[3],0,1),Y};y0.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=d6(Number.parseFloat(X[2]),0,100),Y=d6(Number.parseFloat(X[3]),0,100),U=d6(Number.isNaN(Q)?1:Q,0,1);return[J,G,Y,U]}return null};y0.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=d6(Number.parseFloat(X[2]),0,100),Y=d6(Number.parseFloat(X[3]),0,100),U=d6(Number.isNaN(Q)?1:Q,0,1);return[J,G,Y,U]}return null};y0.to.hex=function(...Z){return"#"+K1(Z[0])+K1(Z[1])+K1(Z[2])+(Z[3]<1?K1(Math.round(Z[3]*255)):"")};y0.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]+")"};y0.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]+")"};y0.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]+")"};y0.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+")"};y0.to.keyword=function(...Z){return FW[Z.slice(0,3)]};function d6(Z,W,X){return Math.min(Math.max(W,Z),X)}function K1(Z){let W=Math.round(Z).toString(16).toUpperCase();return W.length<2?"0"+W:W}var R4=y0,LW={};for(let Z of Object.keys(B6))LW[B6[Z]]=Z;var y={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"]}},Z4=y,C6=0.008856451679035631;function j4(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 _4(Z){return Z>0.04045?((Z+0.055)/1.055)**2.4:Z/12.92}for(let Z of Object.keys(y)){if(!("channels"in y[Z]))throw Error("missing channels property: "+Z);if(!("labels"in y[Z]))throw Error("missing channel labels property: "+Z);if(y[Z].labels.length!==y[Z].channels)throw Error("channel and label counts mismatch: "+Z);let{channels:W,labels:X}=y[Z];delete y[Z].channels,delete y[Z].labels,Object.defineProperty(y[Z],"channels",{value:W}),Object.defineProperty(y[Z],"labels",{value:X})}y.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),Y=G-J,U,K;switch(G){case J:{U=0;break}case W:{U=(X-Q)/Y;break}case X:{U=2+(Q-W)/Y;break}case Q:{U=4+(W-X)/Y;break}}if(U=Math.min(U*60,360),U<0)U+=360;let V=(J+G)/2;if(G===J)K=0;else if(V<=0.5)K=Y/(G+J);else K=Y/(2-G-J);return[U,K*100,V*100]};y.rgb.hsv=function(Z){let W,X,Q,J,G,Y=Z[0]/255,U=Z[1]/255,K=Z[2]/255,V=Math.max(Y,U,K),H=V-Math.min(Y,U,K),B=function($){return(V-$)/6/H+0.5};if(H===0)J=0,G=0;else{switch(G=H/V,W=B(Y),X=B(U),Q=B(K),V){case Y:{J=Q-X;break}case U:{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]};y.rgb.hwb=function(Z){let W=Z[0],X=Z[1],Q=Z[2],J=y.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]};y.rgb.oklab=function(Z){let W=_4(Z[0]/255),X=_4(Z[1]/255),Q=_4(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),Y=Math.cbrt(0.0883024619*W+0.2817188376*X+0.6299787005*Q),U=0.2104542553*J+0.793617785*G-0.0040720468*Y,K=1.9779984951*J-2.428592205*G+0.4505937099*Y,V=0.0259040371*J+0.7827717662*G-0.808675766*Y;return[U*100,K*100,V*100]};y.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,Y=(1-X-J)/(1-J)||0,U=(1-Q-J)/(1-J)||0;return[G*100,Y*100,U*100,J*100]};function NU(Z,W){return(Z[0]-W[0])**2+(Z[1]-W[1])**2+(Z[2]-W[2])**2}y.rgb.keyword=function(Z){let W=LW[Z];if(W)return W;let X=Number.POSITIVE_INFINITY,Q;for(let J of Object.keys(B6)){let G=B6[J],Y=NU(Z,G);if(Y<X)X=Y,Q=J}return Q};y.keyword.rgb=function(Z){return[...B6[Z]]};y.rgb.xyz=function(Z){let W=_4(Z[0]/255),X=_4(Z[1]/255),Q=_4(Z[2]/255),J=W*0.4124564+X*0.3575761+Q*0.1804375,G=W*0.2126729+X*0.7151522+Q*0.072175,Y=W*0.0193339+X*0.119192+Q*0.9503041;return[J*100,G*100,Y*100]};y.rgb.lab=function(Z){let W=y.rgb.xyz(Z),X=W[0],Q=W[1],J=W[2];X/=95.047,Q/=100,J/=108.883,X=X>C6?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>C6?Q**0.3333333333333333:7.787*Q+0.13793103448275862,J=J>C6?J**0.3333333333333333:7.787*J+0.13793103448275862;let G=116*Q-16,Y=500*(X-Q),U=200*(Q-J);return[G,Y,U]};y.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 Y=Q<0.5?Q*(1+X):Q+X-Q*X,U=2*Q-Y,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=U+(Y-U)*6*J;else if(2*J<1)G=Y;else if(3*J<2)G=U+(Y-U)*(0.6666666666666666-J)*6;else G=U;K[V]=G*255}return K};y.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 Y=(Q+X)/2,U=Q===0?2*J/(G+J):2*X/(Q+X);return[W,U*100,Y*100]};y.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),Y=255*Q*(1-X),U=255*Q*(1-X*G),K=255*Q*(1-X*(1-G));switch(Q*=255,J){case 0:return[Q,K,Y];case 1:return[U,Q,Y];case 2:return[Y,Q,K];case 3:return[Y,U,Q];case 4:return[K,Y,Q];case 5:return[Q,Y,U]}};y.hsv.hsl=function(Z){let W=Z[0],X=Z[1]/100,Q=Z[2]/100,J=Math.max(Q,0.01),G,Y;Y=(2-X)*Q;let U=(2-X)*J;return G=X*J,G/=U<=1?U:2-U,G=G||0,Y/=2,[W,G*100,Y*100]};y.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 Y=Math.floor(6*W),U=1-Q;if(G=6*W-Y,(Y&1)!==0)G=1-G;let K=X+G*(U-X),V,H,B;switch(Y){default:case 6:case 0:{V=U,H=K,B=X;break}case 1:{V=K,H=U,B=X;break}case 2:{V=X,H=U,B=K;break}case 3:{V=X,H=K,B=U;break}case 4:{V=K,H=X,B=U;break}case 5:{V=U,H=X,B=K;break}}return[V*255,H*255,B*255]};y.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),Y=1-Math.min(1,X*(1-J)+J),U=1-Math.min(1,Q*(1-J)+J);return[G*255,Y*255,U*255]};y.xyz.rgb=function(Z){let W=Z[0]/100,X=Z[1]/100,Q=Z[2]/100,J,G,Y;return J=W*3.2404542+X*-1.5371385+Q*-0.4985314,G=W*-0.969266+X*1.8760108+Q*0.041556,Y=W*0.0556434+X*-0.2040259+Q*1.0572252,J=j4(J),G=j4(G),Y=j4(Y),[J*255,G*255,Y*255]};y.xyz.lab=function(Z){let W=Z[0],X=Z[1],Q=Z[2];W/=95.047,X/=100,Q/=108.883,W=W>C6?W**0.3333333333333333:7.787*W+0.13793103448275862,X=X>C6?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>C6?Q**0.3333333333333333:7.787*Q+0.13793103448275862;let J=116*X-16,G=500*(W-X),Y=200*(X-Q);return[J,G,Y]};y.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),Y=Math.cbrt(0.0482003018*W+0.2643662691*X+0.633851707*Q),U=0.2104542553*J+0.793617785*G-0.0040720468*Y,K=1.9779984951*J-2.428592205*G+0.4505937099*Y,V=0.0259040371*J+0.7827717662*G-0.808675766*Y;return[U*100,K*100,V*100]};y.oklab.oklch=function(Z){return y.lab.lch(Z)};y.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,Y=(1.000000055*W-0.089484182*X-1.291485538*Q)**3,U=1.227013851*J-0.55779998*G+0.281256149*Y,K=-0.040580178*J+1.11225687*G-0.071676679*Y,V=-0.076381285*J-0.421481978*G+1.58616322*Y;return[U*100,K*100,V*100]};y.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,Y=(W-0.0894841775*X-1.291485548*Q)**3,U=j4(4.0767416621*J-3.3077115913*G+0.2309699292*Y),K=j4(-1.2684380046*J+2.6097574011*G-0.3413193965*Y),V=j4(-0.0041960863*J-0.7034186147*G+1.707614701*Y);return[U*255,K*255,V*255]};y.oklch.oklab=function(Z){return y.lch.lab(Z)};y.lab.xyz=function(Z){let W=Z[0],X=Z[1],Q=Z[2],J,G,Y;G=(W+16)/116,J=X/500+G,Y=G-Q/200;let U=G**3,K=J**3,V=Y**3;return G=U>C6?U:(G-0.13793103448275862)/7.787,J=K>C6?K:(J-0.13793103448275862)/7.787,Y=V>C6?V:(Y-0.13793103448275862)/7.787,J*=95.047,G*=100,Y*=108.883,[J,G,Y]};y.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 Y=Math.sqrt(X*X+Q*Q);return[W,Y,J]};y.lch.lab=function(Z){let W=Z[0],X=Z[1],J=Z[2]/360*2*Math.PI,G=X*Math.cos(J),Y=X*Math.sin(J);return[W,G,Y]};y.rgb.ansi16=function(Z,W=null){let[X,Q,J]=Z,G=W===null?y.rgb.hsv(Z)[2]:W;if(G=Math.round(G/50),G===0)return 30;let Y=30+(Math.round(J/255)<<2|Math.round(Q/255)<<1|Math.round(X/255));if(G===2)Y+=60;return Y};y.hsv.ansi16=function(Z){return y.rgb.ansi16(y.hsv.rgb(Z),Z[2])};y.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)};y.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]};y.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]};y.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};y.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((U)=>U+U).join("");let Q=Number.parseInt(X,16),J=Q>>16&255,G=Q>>8&255,Y=Q&255;return[J,G,Y]};y.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),Y=J-G,U,K=Y<1?G/(1-Y):0;if(Y<=0)U=0;else if(J===W)U=(X-Q)/Y%6;else if(J===X)U=2+(Q-W)/Y;else U=4+(W-X)/Y;return U/=6,U%=1,[U*360,Y*100,K*100]};y.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]};y.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]};y.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,Y=G%1,U=1-Y,K=0;switch(Math.floor(G)){case 0:{J[0]=1,J[1]=Y,J[2]=0;break}case 1:{J[0]=U,J[1]=1,J[2]=0;break}case 2:{J[0]=0,J[1]=1,J[2]=Y;break}case 3:{J[0]=0,J[1]=U,J[2]=1;break}case 4:{J[0]=Y,J[1]=0,J[2]=1;break}default:J[0]=1,J[1]=0,J[2]=U}return K=(1-X)*Q,[(X*J[0]+K)*255,(X*J[1]+K)*255,(X*J[2]+K)*255]};y.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]};y.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]};y.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]};y.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]};y.apple.rgb=function(Z){return[Z[0]/65535*255,Z[1]/65535*255,Z[2]/65535*255]};y.rgb.apple=function(Z){return[Z[0]/255*65535,Z[1]/255*65535,Z[2]/255*65535]};y.gray.rgb=function(Z){return[Z[0]/100*255,Z[0]/100*255,Z[0]/100*255]};y.gray.hsl=function(Z){return[0,0,Z[0]]};y.gray.hsv=y.gray.hsl;y.gray.hwb=function(Z){return[0,100,Z[0]]};y.gray.cmyk=function(Z){return[0,0,0,Z[0]]};y.gray.lab=function(Z){return[Z[0],0,0]};y.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};y.rgb.gray=function(Z){return[(Z[0]+Z[1]+Z[2])/3/255*100]};function wU(){let Z={},W=Object.keys(Z4);for(let{length:X}=W,Q=0;Q<X;Q++)Z[W[Q]]={distance:-1,parent:null};return Z}function DU(Z){let W=wU(),X=[Z];W[Z].distance=0;while(X.length>0){let Q=X.pop(),J=Object.keys(Z4[Q]);for(let{length:G}=J,Y=0;Y<G;Y++){let U=J[Y],K=W[U];if(K.distance===-1)K.distance=W[Q].distance+1,K.parent=Q,X.unshift(U)}}return W}function TU(Z,W){return function(X){return W(Z(X))}}function RU(Z,W){let X=[W[Z].parent,Z],Q=Z4[W[Z].parent][Z],J=W[Z].parent;while(W[J].parent)X.unshift(W[J].parent),Q=TU(Z4[W[J].parent][J],Q),J=W[J].parent;return Q.conversion=X,Q}function PU(Z){let W=DU(Z),X={},Q=Object.keys(W);for(let{length:J}=Q,G=0;G<J;G++){let Y=Q[G];if(W[Y].parent===null)continue;X[Y]=RU(Y,W)}return X}var jU=PU,P4={},_U=Object.keys(Z4);function EU(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 CU(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,Y=0;Y<G;Y++)J[Y]=Math.round(J[Y]);return J};if("conversion"in Z)W.conversion=Z.conversion;return W}for(let Z of _U){P4[Z]={},Object.defineProperty(P4[Z],"channels",{value:Z4[Z].channels}),Object.defineProperty(P4[Z],"labels",{value:Z4[Z].labels});let W=jU(Z),X=Object.keys(W);for(let Q of X){let J=W[Q];P4[Z][Q]=CU(J),P4[Z][Q].raw=EU(J)}}var d0=P4,AW=["keyword","gray","hex"],p3={};for(let Z of Object.keys(d0))p3[[...d0[Z].labels].sort().join("")]=Z;var n3={};function D0(Z,W){if(!(this instanceof D0))return new D0(Z,W);if(W&&W in AW)W=null;if(W&&!(W in d0))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=R4.get(Z);if(J===null)throw Error("Unable to parse color from string: "+Z);this.model=J.model,Q=d0[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=d0[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:Y}=d0[this.model],U=[];for(X=0;X<Y.length;X++)U.push(Z[Y[X]]);this.color=i3(U)}if(n3[this.model]){Q=d0[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 R4.to?this:this.rgb();W=W.round(typeof Z==="number"?Z:1);let X=W.valpha===1?W.color:[...W.color,this.valpha];return R4.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 R4.to.rgb.percent(...X)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let Z={},{channels:W}=d0[this.model],{labels:X}=d0[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(xU(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:B0("rgb",0,I0(255)),green:B0("rgb",1,I0(255)),blue:B0("rgb",2,I0(255)),hue:B0(["hsl","hsv","hsl","hwb","hcg"],0,(Z)=>(Z%360+360)%360),saturationl:B0("hsl",1,I0(100)),lightness:B0("hsl",2,I0(100)),saturationv:B0("hsv",1,I0(100)),value:B0("hsv",2,I0(100)),chroma:B0("hcg",1,I0(100)),gray:B0("hcg",2,I0(100)),white:B0("hwb",1,I0(100)),wblack:B0("hwb",2,I0(100)),cyan:B0("cmyk",0,I0(100)),magenta:B0("cmyk",1,I0(100)),yellow:B0("cmyk",2,I0(100)),black:B0("cmyk",3,I0(100)),x:B0("xyz",0,I0(95.047)),y:B0("xyz",1,I0(100)),z:B0("xyz",2,I0(108.833)),l:B0("lab",0,I0(100)),a:B0("lab",1),b:B0("lab",2),keyword(Z){if(Z!==void 0)return new D0(Z);return d0[this.model].keyword(this.color)},hex(Z){if(Z!==void 0)return new D0(Z);return R4.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 R4.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,Y=X.alpha()-Q.alpha(),U=((G*Y===-1?G:(G+Y)/(1+G*Y))+1)/2,K=1-U;return D0.rgb(U*X.red()+K*Q.red(),U*X.green()+K*Q.green(),U*X.blue()+K*Q.blue(),X.alpha()*J+Q.alpha()*(1-J))}};for(let Z of Object.keys(d0)){if(AW.includes(Z))continue;let{channels:W}=d0[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([...kU(d0[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 OU(Z,W){return Number(Z.toFixed(W))}function xU(Z){return function(W){return OU(W,Z)}}function B0(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 I0(Z){return function(W){return Math.max(0,Math.min(Z,W))}}function kU(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 SU=D0});var wW=n((qL,NW)=>{NW.exports=IW().default});function bU(Z){return this._setBackgroundColourOption("tint",Z),this}function vU(Z){return this.options.greyscale=z.bool(Z)?Z:!0,this}function yU(Z){return this.greyscale(Z)}function gU(Z){if(!z.string(Z))throw z.invalidParameterError("colourspace","string",Z);return this.options.colourspacePipeline=Z,this}function hU(Z){return this.pipelineColourspace(Z)}function fU(Z){if(!z.string(Z))throw z.invalidParameterError("colourspace","string",Z);return this.options.colourspace=Z,this}function mU(Z){return this.toColourspace(Z)}function RW(Z){if(z.object(Z)||z.string(Z)&&Z.length>=3&&Z.length<=200){let W=TW.default(Z),X=W.red(),Q=W.green(),J=W.blue(),G=Math.round(W.alpha()*255);for(let[Y,U]of[["red",X],["green",Q],["blue",J],["alpha",G]])if(!z.number(U))throw z.invalidParameterError(`background.${Y}`,"number",U);return[X,Q,J,G]}else throw z.invalidParameterError("background","object or string",Z)}function uU(Z,W){if(z.defined(W))this.options[Z]=RW(W)}var TW,DW,PW=(Z)=>{Object.assign(Z.prototype,{tint:bU,greyscale:vU,grayscale:yU,pipelineColourspace:gU,pipelineColorspace:hU,toColourspace:fU,toColorspace:mU,_getBackgroundColourOption:RW,_setBackgroundColourOption:uU}),Z.colourspace=DW,Z.colorspace=DW};var jW=c(()=>{Y6();TW=g4(wW(),1);/*!
232
232
  Copyright 2013 Lovell Fuller and others.
233
233
  SPDX-License-Identifier: Apache-2.0
234
- */DW={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"}});function fU(){return this.options.removeAlpha=!0,this}function mU(Z){if(z.defined(Z))if(z.number(Z)&&z.inRange(Z,0,1))this.options.ensureAlpha=Z;else throw z.invalidParameterError("alpha","number between 0 and 1",Z);else this.options.ensureAlpha=1;return this}function uU(Z){let W={red:0,green:1,blue:2,alpha:3};if(Object.keys(W).includes(Z))Z=W[Z];if(z.integer(Z)&&z.inRange(Z,0,4))this.options.extractChannel=Z;else throw z.invalidParameterError("channel","integer or one of: red, green, blue, alpha",Z);return this}function dU(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 cU(Z){if(z.string(Z)&&z.inArray(Z,["and","or","eor"]))this.options.bandBoolOp=Z;else throw z.invalidParameterError("boolOp","one of: and, or, eor",Z);return this}var hU,jW=(Z)=>{Object.assign(Z.prototype,{removeAlpha:fU,ensureAlpha:mU,extractChannel:uU,joinChannel:dU,bandbool:cU}),Z.bool=hU};var EW=c(()=>{Y6();/*!
234
+ */DW={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"}});function cU(){return this.options.removeAlpha=!0,this}function lU(Z){if(z.defined(Z))if(z.number(Z)&&z.inRange(Z,0,1))this.options.ensureAlpha=Z;else throw z.invalidParameterError("alpha","number between 0 and 1",Z);else this.options.ensureAlpha=1;return this}function pU(Z){let W={red:0,green:1,blue:2,alpha:3};if(Object.keys(W).includes(Z))Z=W[Z];if(z.integer(Z)&&z.inRange(Z,0,4))this.options.extractChannel=Z;else throw z.invalidParameterError("channel","integer or one of: red, green, blue, alpha",Z);return this}function nU(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 iU(Z){if(z.string(Z)&&z.inArray(Z,["and","or","eor"]))this.options.bandBoolOp=Z;else throw z.invalidParameterError("boolOp","one of: and, or, eor",Z);return this}var dU,_W=(Z)=>{Object.assign(Z.prototype,{removeAlpha:cU,ensureAlpha:lU,extractChannel:pU,joinChannel:nU,bandbool:iU}),Z.bool=dU};var EW=c(()=>{Y6();/*!
235
235
  Copyright 2013 Lovell Fuller and others.
236
236
  SPDX-License-Identifier: Apache-2.0
237
- */hU={and:"and",or:"or",eor:"eor"}});import a3 from"node:path";function pU(Z,W){let X;if(!z.string(Z))X=Error("Missing output file path");else if(z.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(lU.test(a3.extname(Z))&&!this.constructor.format.jp2.output.file)X=OW();if(X)if(z.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 nU(Z,W){if(z.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(z.fn(Z)?Z:W,X)}function iU(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let Z=Error();return this._pipeline(null,Z)}function rU(Z){if(z.number(Z)&&Z>0)this.options.withMetadataDensity=Z;else throw z.invalidParameterError("density","positive number",Z);return this.keepExif()}function aU(){return this.options.keepMetadata|=1,this}function sU(Z){if(z.object(Z))for(let[W,X]of Object.entries(Z))if(z.object(X))for(let[Q,J]of Object.entries(X))if(z.string(J))this.options.withExif[`exif-${W.toLowerCase()}-${Q}`]=J;else throw z.invalidParameterError(`${W}.${Q}`,"string",J);else throw z.invalidParameterError(W,"object",X);else throw z.invalidParameterError("exif","object",Z);return this.options.withExifMerge=!1,this.keepExif()}function oU(Z){return this.withExif(Z),this.options.withExifMerge=!0,this}function tU(){return this.options.keepMetadata|=8,this}function eU(Z,W){if(z.string(Z))this.options.withIccProfile=Z;else throw z.invalidParameterError("icc","string",Z);if(this.keepIccProfile(),z.object(W)){if(z.defined(W.attach))if(z.bool(W.attach)){if(!W.attach)this.options.keepMetadata&=-9}else throw z.invalidParameterError("attach","boolean",W.attach)}return this}function ZK(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function WK(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function XK(){return this.options.keepMetadata|=2,this}function QK(Z){if(z.string(Z)&&Z.length>0)this.options.withXmp=Z,this.options.keepMetadata|=2;else throw z.invalidParameterError("xmp","non-empty string",Z);return this}function JK(){return this.options.keepMetadata|=31,this}function GK(Z){if(this.keepMetadata(),this.withIccProfile("srgb"),z.object(Z)){if(z.defined(Z.orientation))if(z.integer(Z.orientation)&&z.inRange(Z.orientation,1,8))this.options.withMetadataOrientation=Z.orientation;else throw z.invalidParameterError("orientation","integer between 1 and 8",Z.orientation);if(z.defined(Z.density))if(z.number(Z.density)&&Z.density>0)this.options.withMetadataDensity=Z.density;else throw z.invalidParameterError("density","positive number",Z.density);if(z.defined(Z.icc))this.withIccProfile(Z.icc);if(z.defined(Z.exif))this.withExifMerge(Z.exif)}return this}function YK(Z,W){let X=CW.get((z.object(Z)&&z.string(Z.id)?Z.id:Z).toLowerCase());if(!X)throw z.invalidParameterError("format",`one of: ${[...CW.keys()].join(", ")}`,Z);return this[X](W)}function zK(Z){if(z.object(Z)){if(z.defined(Z.quality))if(z.integer(Z.quality)&&z.inRange(Z.quality,1,100))this.options.jpegQuality=Z.quality;else throw z.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(z.defined(Z.progressive))this._setBooleanOption("jpegProgressive",Z.progressive);if(z.defined(Z.chromaSubsampling))if(z.string(Z.chromaSubsampling)&&z.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=Z.chromaSubsampling;else throw z.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);let W=z.bool(Z.optimizeCoding)?Z.optimizeCoding:Z.optimiseCoding;if(z.defined(W))this._setBooleanOption("jpegOptimiseCoding",W);if(z.defined(Z.mozjpeg))if(z.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 z.invalidParameterError("mozjpeg","boolean",Z.mozjpeg);let X=z.bool(Z.trellisQuantization)?Z.trellisQuantization:Z.trellisQuantisation;if(z.defined(X))this._setBooleanOption("jpegTrellisQuantisation",X);if(z.defined(Z.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",Z.overshootDeringing);let Q=z.bool(Z.optimizeScans)?Z.optimizeScans:Z.optimiseScans;if(z.defined(Q)){if(this._setBooleanOption("jpegOptimiseScans",Q),Q)this.options.jpegProgressive=!0}let J=z.number(Z.quantizationTable)?Z.quantizationTable:Z.quantisationTable;if(z.defined(J))if(z.integer(J)&&z.inRange(J,0,8))this.options.jpegQuantisationTable=J;else throw z.invalidParameterError("quantisationTable","integer between 0 and 8",J)}return this._updateFormatOut("jpeg",Z)}function qK(Z){if(z.object(Z)){if(z.defined(Z.progressive))this._setBooleanOption("pngProgressive",Z.progressive);if(z.defined(Z.compressionLevel))if(z.integer(Z.compressionLevel)&&z.inRange(Z.compressionLevel,0,9))this.options.pngCompressionLevel=Z.compressionLevel;else throw z.invalidParameterError("compressionLevel","integer between 0 and 9",Z.compressionLevel);if(z.defined(Z.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",Z.adaptiveFiltering);let W=Z.colours||Z.colors;if(z.defined(W))if(z.integer(W)&&z.inRange(W,2,256))this.options.pngBitdepth=xW(W);else throw z.invalidParameterError("colours","integer between 2 and 256",W);if(z.defined(Z.palette))this._setBooleanOption("pngPalette",Z.palette);else if([Z.quality,Z.effort,Z.colours,Z.colors,Z.dither].some(z.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(z.defined(Z.quality))if(z.integer(Z.quality)&&z.inRange(Z.quality,0,100))this.options.pngQuality=Z.quality;else throw z.invalidParameterError("quality","integer between 0 and 100",Z.quality);if(z.defined(Z.effort))if(z.integer(Z.effort)&&z.inRange(Z.effort,1,10))this.options.pngEffort=Z.effort;else throw z.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(z.defined(Z.dither))if(z.number(Z.dither)&&z.inRange(Z.dither,0,1))this.options.pngDither=Z.dither;else throw z.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither)}}return this._updateFormatOut("png",Z)}function UK(Z){if(z.object(Z)){if(z.defined(Z.quality))if(z.integer(Z.quality)&&z.inRange(Z.quality,1,100))this.options.webpQuality=Z.quality;else throw z.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(z.defined(Z.alphaQuality))if(z.integer(Z.alphaQuality)&&z.inRange(Z.alphaQuality,0,100))this.options.webpAlphaQuality=Z.alphaQuality;else throw z.invalidParameterError("alphaQuality","integer between 0 and 100",Z.alphaQuality);if(z.defined(Z.lossless))this._setBooleanOption("webpLossless",Z.lossless);if(z.defined(Z.nearLossless))this._setBooleanOption("webpNearLossless",Z.nearLossless);if(z.defined(Z.smartSubsample))this._setBooleanOption("webpSmartSubsample",Z.smartSubsample);if(z.defined(Z.smartDeblock))this._setBooleanOption("webpSmartDeblock",Z.smartDeblock);if(z.defined(Z.preset))if(z.string(Z.preset)&&z.inArray(Z.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=Z.preset;else throw z.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",Z.preset);if(z.defined(Z.effort))if(z.integer(Z.effort)&&z.inRange(Z.effort,0,6))this.options.webpEffort=Z.effort;else throw z.invalidParameterError("effort","integer between 0 and 6",Z.effort);if(z.defined(Z.minSize))this._setBooleanOption("webpMinSize",Z.minSize);if(z.defined(Z.mixed))this._setBooleanOption("webpMixed",Z.mixed);if(z.defined(Z.exact))this._setBooleanOption("webpExact",Z.exact)}return s3(Z,this.options),this._updateFormatOut("webp",Z)}function KK(Z){if(z.object(Z)){if(z.defined(Z.reuse))this._setBooleanOption("gifReuse",Z.reuse);if(z.defined(Z.progressive))this._setBooleanOption("gifProgressive",Z.progressive);let W=Z.colours||Z.colors;if(z.defined(W))if(z.integer(W)&&z.inRange(W,2,256))this.options.gifBitdepth=xW(W);else throw z.invalidParameterError("colours","integer between 2 and 256",W);if(z.defined(Z.effort))if(z.integer(Z.effort)&&z.inRange(Z.effort,1,10))this.options.gifEffort=Z.effort;else throw z.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(z.defined(Z.dither))if(z.number(Z.dither)&&z.inRange(Z.dither,0,1))this.options.gifDither=Z.dither;else throw z.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither);if(z.defined(Z.interFrameMaxError))if(z.number(Z.interFrameMaxError)&&z.inRange(Z.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=Z.interFrameMaxError;else throw z.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",Z.interFrameMaxError);if(z.defined(Z.interPaletteMaxError))if(z.number(Z.interPaletteMaxError)&&z.inRange(Z.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=Z.interPaletteMaxError;else throw z.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",Z.interPaletteMaxError);if(z.defined(Z.keepDuplicateFrames))if(z.bool(Z.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",Z.keepDuplicateFrames);else throw z.invalidParameterError("keepDuplicateFrames","boolean",Z.keepDuplicateFrames)}return s3(Z,this.options),this._updateFormatOut("gif",Z)}function VK(Z){if(!this.constructor.format.jp2.output.buffer)throw OW();if(z.object(Z)){if(z.defined(Z.quality))if(z.integer(Z.quality)&&z.inRange(Z.quality,1,100))this.options.jp2Quality=Z.quality;else throw z.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(z.defined(Z.lossless))if(z.bool(Z.lossless))this.options.jp2Lossless=Z.lossless;else throw z.invalidParameterError("lossless","boolean",Z.lossless);if(z.defined(Z.tileWidth))if(z.integer(Z.tileWidth)&&z.inRange(Z.tileWidth,1,32768))this.options.jp2TileWidth=Z.tileWidth;else throw z.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if(z.defined(Z.tileHeight))if(z.integer(Z.tileHeight)&&z.inRange(Z.tileHeight,1,32768))this.options.jp2TileHeight=Z.tileHeight;else throw z.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if(z.defined(Z.chromaSubsampling))if(z.string(Z.chromaSubsampling)&&z.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=Z.chromaSubsampling;else throw z.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling)}return this._updateFormatOut("jp2",Z)}function s3(Z,W){if(z.object(Z)&&z.defined(Z.loop))if(z.integer(Z.loop)&&z.inRange(Z.loop,0,65535))W.loop=Z.loop;else throw z.invalidParameterError("loop","integer between 0 and 65535",Z.loop);if(z.object(Z)&&z.defined(Z.delay))if(z.integer(Z.delay)&&z.inRange(Z.delay,0,65535))W.delay=[Z.delay];else if(Array.isArray(Z.delay)&&Z.delay.every(z.integer)&&Z.delay.every((X)=>z.inRange(X,0,65535)))W.delay=Z.delay;else throw z.invalidParameterError("delay","integer or an array of integers between 0 and 65535",Z.delay)}function BK(Z){if(z.object(Z)){if(z.defined(Z.quality))if(z.integer(Z.quality)&&z.inRange(Z.quality,1,100))this.options.tiffQuality=Z.quality;else throw z.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(z.defined(Z.bitdepth))if(z.integer(Z.bitdepth)&&z.inArray(Z.bitdepth,[1,2,4]))this.options.tiffBitdepth=Z.bitdepth;else throw z.invalidParameterError("bitdepth","1, 2 or 4",Z.bitdepth);if(z.defined(Z.tile))this._setBooleanOption("tiffTile",Z.tile);if(z.defined(Z.tileWidth))if(z.integer(Z.tileWidth)&&z.inRange(Z.tileWidth,1,32768))this.options.tiffTileWidth=Z.tileWidth;else throw z.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if(z.defined(Z.tileHeight))if(z.integer(Z.tileHeight)&&z.inRange(Z.tileHeight,1,32768))this.options.tiffTileHeight=Z.tileHeight;else throw z.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if(z.defined(Z.miniswhite))this._setBooleanOption("tiffMiniswhite",Z.miniswhite);if(z.defined(Z.pyramid))this._setBooleanOption("tiffPyramid",Z.pyramid);if(z.defined(Z.xres))if(z.number(Z.xres)&&z.inRange(Z.xres,0.001,1e6))this.options.tiffXres=Z.xres;else throw z.invalidParameterError("xres","number between 0.001 and 1000000",Z.xres);if(z.defined(Z.yres))if(z.number(Z.yres)&&z.inRange(Z.yres,0.001,1e6))this.options.tiffYres=Z.yres;else throw z.invalidParameterError("yres","number between 0.001 and 1000000",Z.yres);if(z.defined(Z.compression))if(z.string(Z.compression)&&z.inArray(Z.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=Z.compression;else throw z.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",Z.compression);if(z.defined(Z.bigtiff))this._setBooleanOption("tiffBigtiff",Z.bigtiff);if(z.defined(Z.predictor))if(z.string(Z.predictor)&&z.inArray(Z.predictor,["none","horizontal","float"]))this.options.tiffPredictor=Z.predictor;else throw z.invalidParameterError("predictor","one of: none, horizontal, float",Z.predictor);if(z.defined(Z.resolutionUnit))if(z.string(Z.resolutionUnit)&&z.inArray(Z.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=Z.resolutionUnit;else throw z.invalidParameterError("resolutionUnit","one of: inch, cm",Z.resolutionUnit)}return this._updateFormatOut("tiff",Z)}function HK(Z){return this.heif({...Z,compression:"av1"})}function $K(Z){if(z.object(Z)){if(z.string(Z.compression)&&z.inArray(Z.compression,["av1","hevc"]))this.options.heifCompression=Z.compression;else throw z.invalidParameterError("compression","one of: av1, hevc",Z.compression);if(z.defined(Z.quality))if(z.integer(Z.quality)&&z.inRange(Z.quality,1,100))this.options.heifQuality=Z.quality;else throw z.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(z.defined(Z.lossless))if(z.bool(Z.lossless))this.options.heifLossless=Z.lossless;else throw z.invalidParameterError("lossless","boolean",Z.lossless);if(z.defined(Z.effort))if(z.integer(Z.effort)&&z.inRange(Z.effort,0,9))this.options.heifEffort=Z.effort;else throw z.invalidParameterError("effort","integer between 0 and 9",Z.effort);if(z.defined(Z.chromaSubsampling))if(z.string(Z.chromaSubsampling)&&z.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=Z.chromaSubsampling;else throw z.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);if(z.defined(Z.bitdepth))if(z.integer(Z.bitdepth)&&z.inArray(Z.bitdepth,[8,10,12]))this.options.heifBitdepth=Z.bitdepth;else throw z.invalidParameterError("bitdepth","8, 10 or 12",Z.bitdepth);if(z.defined(Z.tune))if(z.string(Z.tune)&&z.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 z.invalidParameterError("tune","one of: auto, iq, psnr, ssim",Z.tune)}else throw z.invalidParameterError("options","Object",Z);return this._updateFormatOut("heif",Z)}function FK(Z){if(z.object(Z)){if(z.defined(Z.quality))if(z.integer(Z.quality)&&z.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 z.invalidParameterError("quality","integer between 1 and 100",Z.quality);else if(z.defined(Z.distance))if(z.number(Z.distance)&&z.inRange(Z.distance,0,15))this.options.jxlDistance=Z.distance;else throw z.invalidParameterError("distance","number between 0.0 and 15.0",Z.distance);if(z.defined(Z.decodingTier))if(z.integer(Z.decodingTier)&&z.inRange(Z.decodingTier,0,4))this.options.jxlDecodingTier=Z.decodingTier;else throw z.invalidParameterError("decodingTier","integer between 0 and 4",Z.decodingTier);if(z.defined(Z.lossless))if(z.bool(Z.lossless))this.options.jxlLossless=Z.lossless;else throw z.invalidParameterError("lossless","boolean",Z.lossless);if(z.defined(Z.effort))if(z.integer(Z.effort)&&z.inRange(Z.effort,1,9))this.options.jxlEffort=Z.effort;else throw z.invalidParameterError("effort","integer between 1 and 9",Z.effort)}return s3(Z,this.options),this._updateFormatOut("jxl",Z)}function LK(Z){if(z.object(Z)){if(z.defined(Z.depth))if(z.string(Z.depth)&&z.inArray(Z.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=Z.depth;else throw z.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",Z.depth)}return this._updateFormatOut("raw")}function AK(Z){if(z.object(Z)){if(z.defined(Z.size))if(z.integer(Z.size)&&z.inRange(Z.size,1,8192))this.options.tileSize=Z.size;else throw z.invalidParameterError("size","integer between 1 and 8192",Z.size);if(z.defined(Z.overlap))if(z.integer(Z.overlap)&&z.inRange(Z.overlap,0,8192)){if(Z.overlap>this.options.tileSize)throw z.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,Z.overlap);this.options.tileOverlap=Z.overlap}else throw z.invalidParameterError("overlap","integer between 0 and 8192",Z.overlap);if(z.defined(Z.container))if(z.string(Z.container)&&z.inArray(Z.container,["fs","zip"]))this.options.tileContainer=Z.container;else throw z.invalidParameterError("container","one of: fs, zip",Z.container);if(z.defined(Z.layout))if(z.string(Z.layout)&&z.inArray(Z.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=Z.layout;else throw z.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",Z.layout);if(z.defined(Z.angle))if(z.integer(Z.angle)&&!(Z.angle%90))this.options.tileAngle=Z.angle;else throw z.invalidParameterError("angle","positive/negative multiple of 90",Z.angle);if(this._setBackgroundColourOption("tileBackground",Z.background),z.defined(Z.depth))if(z.string(Z.depth)&&z.inArray(Z.depth,["onepixel","onetile","one"]))this.options.tileDepth=Z.depth;else throw z.invalidParameterError("depth","one of: onepixel, onetile, one",Z.depth);if(z.defined(Z.skipBlanks))if(z.integer(Z.skipBlanks)&&z.inRange(Z.skipBlanks,-1,65535))this.options.tileSkipBlanks=Z.skipBlanks;else throw z.invalidParameterError("skipBlanks","integer between -1 and 255/65535",Z.skipBlanks);else if(z.defined(Z.layout)&&Z.layout==="google")this.options.tileSkipBlanks=5;let W=z.bool(Z.center)?Z.center:Z.centre;if(z.defined(W))this._setBooleanOption("tileCentre",W);if(z.defined(Z.id))if(z.string(Z.id))this.options.tileId=Z.id;else throw z.invalidParameterError("id","string",Z.id);if(z.defined(Z.basename))if(z.string(Z.basename))this.options.tileBasename=Z.basename;else throw z.invalidParameterError("basename","string",Z.basename)}if(z.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw z.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function MK(Z){if(!z.plainObject(Z))throw z.invalidParameterError("options","object",Z);if(z.integer(Z.seconds)&&z.inRange(Z.seconds,0,3600))this.options.timeoutSeconds=Z.seconds;else throw z.invalidParameterError("seconds","integer between 0 and 3600",Z.seconds);return this}function IK(Z,W){if(!(z.object(W)&&W.force===!1))this.options.formatOut=Z;return this}function NK(Z,W){if(z.bool(W))this.options[Z]=W;else throw z.invalidParameterError(Z,"boolean",W)}function wK(){if(!this.options.streamOut){this.options.streamOut=!0;let Z=Error();this._pipeline(void 0,Z)}}function DK(Z,W){if(typeof Z==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),W0.pipeline(this.options,(X,Q,J)=>{if(X)Z(z.nativeError(X,W));else Z(null,Q,J)})});else W0.pipeline(this.options,(X,Q,J)=>{if(X)Z(z.nativeError(X,W));else Z(null,Q,J)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),W0.pipeline(this.options,(X,Q,J)=>{if(X)this.emit("error",z.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 W0.pipeline(this.options,(X,Q,J)=>{if(X)this.emit("error",z.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(),W0.pipeline(this.options,(J,G,Y)=>{if(J)Q(z.nativeError(J,W));else if(this.options.resolveWithObject)X({data:G,info:Y});else X(G)})})});else return new Promise((X,Q)=>{W0.pipeline(this.options,(J,G,Y)=>{if(J)Q(z.nativeError(J,W));else if(this.options.resolveWithObject)X({data:G,info:Y});else X(G)})})}var CW,lU,OW=()=>Error("JP2 output requires libvips with support for OpenJPEG"),xW=(Z)=>1<<31-Math.clz32(Math.ceil(Math.log2(Z))),kW=(Z)=>{Object.assign(Z.prototype,{toFile:pU,toBuffer:nU,toUint8Array:iU,withDensity:rU,keepExif:aU,withExif:sU,withExifMerge:oU,keepIccProfile:tU,withIccProfile:eU,keepGainMap:ZK,withGainMap:WK,keepXmp:XK,withXmp:QK,keepMetadata:JK,withMetadata:GK,toFormat:YK,jpeg:zK,jp2:VK,png:qK,webp:UK,tiff:BK,avif:HK,heif:$K,jxl:FK,gif:KK,raw:LK,tile:AK,timeout:MK,_updateFormatOut:IK,_setBooleanOption:NK,_read:wK,_pipeline:DK})};var SW=c(()=>{Y6();G2();/*!
237
+ */dU={and:"and",or:"or",eor:"eor"}});import a3 from"node:path";function aU(Z,W){let X;if(!z.string(Z))X=Error("Missing output file path");else if(z.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(rU.test(a3.extname(Z))&&!this.constructor.format.jp2.output.file)X=OW();if(X)if(z.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 sU(Z,W){if(z.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(z.fn(Z)?Z:W,X)}function oU(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let Z=Error();return this._pipeline(null,Z)}function tU(Z){if(z.number(Z)&&Z>0)this.options.withMetadataDensity=Z;else throw z.invalidParameterError("density","positive number",Z);return this.keepExif()}function eU(){return this.options.keepMetadata|=1,this}function ZK(Z){if(z.object(Z))for(let[W,X]of Object.entries(Z))if(z.object(X))for(let[Q,J]of Object.entries(X))if(z.string(J))this.options.withExif[`exif-${W.toLowerCase()}-${Q}`]=J;else throw z.invalidParameterError(`${W}.${Q}`,"string",J);else throw z.invalidParameterError(W,"object",X);else throw z.invalidParameterError("exif","object",Z);return this.options.withExifMerge=!1,this.keepExif()}function WK(Z){return this.withExif(Z),this.options.withExifMerge=!0,this}function XK(){return this.options.keepMetadata|=8,this}function QK(Z,W){if(z.string(Z))this.options.withIccProfile=Z;else throw z.invalidParameterError("icc","string",Z);if(this.keepIccProfile(),z.object(W)){if(z.defined(W.attach))if(z.bool(W.attach)){if(!W.attach)this.options.keepMetadata&=-9}else throw z.invalidParameterError("attach","boolean",W.attach)}return this}function JK(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function GK(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function YK(){return this.options.keepMetadata|=2,this}function zK(Z){if(z.string(Z)&&Z.length>0)this.options.withXmp=Z,this.options.keepMetadata|=2;else throw z.invalidParameterError("xmp","non-empty string",Z);return this}function qK(){return this.options.keepMetadata|=31,this}function UK(Z){if(this.keepMetadata(),this.withIccProfile("srgb"),z.object(Z)){if(z.defined(Z.orientation))if(z.integer(Z.orientation)&&z.inRange(Z.orientation,1,8))this.options.withMetadataOrientation=Z.orientation;else throw z.invalidParameterError("orientation","integer between 1 and 8",Z.orientation);if(z.defined(Z.density))if(z.number(Z.density)&&Z.density>0)this.options.withMetadataDensity=Z.density;else throw z.invalidParameterError("density","positive number",Z.density);if(z.defined(Z.icc))this.withIccProfile(Z.icc);if(z.defined(Z.exif))this.withExifMerge(Z.exif)}return this}function KK(Z,W){let X=CW.get((z.object(Z)&&z.string(Z.id)?Z.id:Z).toLowerCase());if(!X)throw z.invalidParameterError("format",`one of: ${[...CW.keys()].join(", ")}`,Z);return this[X](W)}function VK(Z){if(z.object(Z)){if(z.defined(Z.quality))if(z.integer(Z.quality)&&z.inRange(Z.quality,1,100))this.options.jpegQuality=Z.quality;else throw z.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(z.defined(Z.progressive))this._setBooleanOption("jpegProgressive",Z.progressive);if(z.defined(Z.chromaSubsampling))if(z.string(Z.chromaSubsampling)&&z.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=Z.chromaSubsampling;else throw z.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);let W=z.bool(Z.optimizeCoding)?Z.optimizeCoding:Z.optimiseCoding;if(z.defined(W))this._setBooleanOption("jpegOptimiseCoding",W);if(z.defined(Z.mozjpeg))if(z.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 z.invalidParameterError("mozjpeg","boolean",Z.mozjpeg);let X=z.bool(Z.trellisQuantization)?Z.trellisQuantization:Z.trellisQuantisation;if(z.defined(X))this._setBooleanOption("jpegTrellisQuantisation",X);if(z.defined(Z.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",Z.overshootDeringing);let Q=z.bool(Z.optimizeScans)?Z.optimizeScans:Z.optimiseScans;if(z.defined(Q)){if(this._setBooleanOption("jpegOptimiseScans",Q),Q)this.options.jpegProgressive=!0}let J=z.number(Z.quantizationTable)?Z.quantizationTable:Z.quantisationTable;if(z.defined(J))if(z.integer(J)&&z.inRange(J,0,8))this.options.jpegQuantisationTable=J;else throw z.invalidParameterError("quantisationTable","integer between 0 and 8",J)}return this._updateFormatOut("jpeg",Z)}function BK(Z){if(z.object(Z)){if(z.defined(Z.progressive))this._setBooleanOption("pngProgressive",Z.progressive);if(z.defined(Z.compressionLevel))if(z.integer(Z.compressionLevel)&&z.inRange(Z.compressionLevel,0,9))this.options.pngCompressionLevel=Z.compressionLevel;else throw z.invalidParameterError("compressionLevel","integer between 0 and 9",Z.compressionLevel);if(z.defined(Z.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",Z.adaptiveFiltering);let W=Z.colours||Z.colors;if(z.defined(W))if(z.integer(W)&&z.inRange(W,2,256))this.options.pngBitdepth=xW(W);else throw z.invalidParameterError("colours","integer between 2 and 256",W);if(z.defined(Z.palette))this._setBooleanOption("pngPalette",Z.palette);else if([Z.quality,Z.effort,Z.colours,Z.colors,Z.dither].some(z.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(z.defined(Z.quality))if(z.integer(Z.quality)&&z.inRange(Z.quality,0,100))this.options.pngQuality=Z.quality;else throw z.invalidParameterError("quality","integer between 0 and 100",Z.quality);if(z.defined(Z.effort))if(z.integer(Z.effort)&&z.inRange(Z.effort,1,10))this.options.pngEffort=Z.effort;else throw z.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(z.defined(Z.dither))if(z.number(Z.dither)&&z.inRange(Z.dither,0,1))this.options.pngDither=Z.dither;else throw z.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither)}}return this._updateFormatOut("png",Z)}function HK(Z){if(z.object(Z)){if(z.defined(Z.quality))if(z.integer(Z.quality)&&z.inRange(Z.quality,1,100))this.options.webpQuality=Z.quality;else throw z.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(z.defined(Z.alphaQuality))if(z.integer(Z.alphaQuality)&&z.inRange(Z.alphaQuality,0,100))this.options.webpAlphaQuality=Z.alphaQuality;else throw z.invalidParameterError("alphaQuality","integer between 0 and 100",Z.alphaQuality);if(z.defined(Z.lossless))this._setBooleanOption("webpLossless",Z.lossless);if(z.defined(Z.nearLossless))this._setBooleanOption("webpNearLossless",Z.nearLossless);if(z.defined(Z.smartSubsample))this._setBooleanOption("webpSmartSubsample",Z.smartSubsample);if(z.defined(Z.smartDeblock))this._setBooleanOption("webpSmartDeblock",Z.smartDeblock);if(z.defined(Z.preset))if(z.string(Z.preset)&&z.inArray(Z.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=Z.preset;else throw z.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",Z.preset);if(z.defined(Z.effort))if(z.integer(Z.effort)&&z.inRange(Z.effort,0,6))this.options.webpEffort=Z.effort;else throw z.invalidParameterError("effort","integer between 0 and 6",Z.effort);if(z.defined(Z.minSize))this._setBooleanOption("webpMinSize",Z.minSize);if(z.defined(Z.mixed))this._setBooleanOption("webpMixed",Z.mixed);if(z.defined(Z.exact))this._setBooleanOption("webpExact",Z.exact)}return s3(Z,this.options),this._updateFormatOut("webp",Z)}function $K(Z){if(z.object(Z)){if(z.defined(Z.reuse))this._setBooleanOption("gifReuse",Z.reuse);if(z.defined(Z.progressive))this._setBooleanOption("gifProgressive",Z.progressive);let W=Z.colours||Z.colors;if(z.defined(W))if(z.integer(W)&&z.inRange(W,2,256))this.options.gifBitdepth=xW(W);else throw z.invalidParameterError("colours","integer between 2 and 256",W);if(z.defined(Z.effort))if(z.integer(Z.effort)&&z.inRange(Z.effort,1,10))this.options.gifEffort=Z.effort;else throw z.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(z.defined(Z.dither))if(z.number(Z.dither)&&z.inRange(Z.dither,0,1))this.options.gifDither=Z.dither;else throw z.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither);if(z.defined(Z.interFrameMaxError))if(z.number(Z.interFrameMaxError)&&z.inRange(Z.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=Z.interFrameMaxError;else throw z.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",Z.interFrameMaxError);if(z.defined(Z.interPaletteMaxError))if(z.number(Z.interPaletteMaxError)&&z.inRange(Z.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=Z.interPaletteMaxError;else throw z.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",Z.interPaletteMaxError);if(z.defined(Z.keepDuplicateFrames))if(z.bool(Z.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",Z.keepDuplicateFrames);else throw z.invalidParameterError("keepDuplicateFrames","boolean",Z.keepDuplicateFrames)}return s3(Z,this.options),this._updateFormatOut("gif",Z)}function FK(Z){if(!this.constructor.format.jp2.output.buffer)throw OW();if(z.object(Z)){if(z.defined(Z.quality))if(z.integer(Z.quality)&&z.inRange(Z.quality,1,100))this.options.jp2Quality=Z.quality;else throw z.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(z.defined(Z.lossless))if(z.bool(Z.lossless))this.options.jp2Lossless=Z.lossless;else throw z.invalidParameterError("lossless","boolean",Z.lossless);if(z.defined(Z.tileWidth))if(z.integer(Z.tileWidth)&&z.inRange(Z.tileWidth,1,32768))this.options.jp2TileWidth=Z.tileWidth;else throw z.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if(z.defined(Z.tileHeight))if(z.integer(Z.tileHeight)&&z.inRange(Z.tileHeight,1,32768))this.options.jp2TileHeight=Z.tileHeight;else throw z.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if(z.defined(Z.chromaSubsampling))if(z.string(Z.chromaSubsampling)&&z.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=Z.chromaSubsampling;else throw z.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling)}return this._updateFormatOut("jp2",Z)}function s3(Z,W){if(z.object(Z)&&z.defined(Z.loop))if(z.integer(Z.loop)&&z.inRange(Z.loop,0,65535))W.loop=Z.loop;else throw z.invalidParameterError("loop","integer between 0 and 65535",Z.loop);if(z.object(Z)&&z.defined(Z.delay))if(z.integer(Z.delay)&&z.inRange(Z.delay,0,65535))W.delay=[Z.delay];else if(Array.isArray(Z.delay)&&Z.delay.every(z.integer)&&Z.delay.every((X)=>z.inRange(X,0,65535)))W.delay=Z.delay;else throw z.invalidParameterError("delay","integer or an array of integers between 0 and 65535",Z.delay)}function LK(Z){if(z.object(Z)){if(z.defined(Z.quality))if(z.integer(Z.quality)&&z.inRange(Z.quality,1,100))this.options.tiffQuality=Z.quality;else throw z.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(z.defined(Z.bitdepth))if(z.integer(Z.bitdepth)&&z.inArray(Z.bitdepth,[1,2,4]))this.options.tiffBitdepth=Z.bitdepth;else throw z.invalidParameterError("bitdepth","1, 2 or 4",Z.bitdepth);if(z.defined(Z.tile))this._setBooleanOption("tiffTile",Z.tile);if(z.defined(Z.tileWidth))if(z.integer(Z.tileWidth)&&z.inRange(Z.tileWidth,1,32768))this.options.tiffTileWidth=Z.tileWidth;else throw z.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if(z.defined(Z.tileHeight))if(z.integer(Z.tileHeight)&&z.inRange(Z.tileHeight,1,32768))this.options.tiffTileHeight=Z.tileHeight;else throw z.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if(z.defined(Z.miniswhite))this._setBooleanOption("tiffMiniswhite",Z.miniswhite);if(z.defined(Z.pyramid))this._setBooleanOption("tiffPyramid",Z.pyramid);if(z.defined(Z.xres))if(z.number(Z.xres)&&z.inRange(Z.xres,0.001,1e6))this.options.tiffXres=Z.xres;else throw z.invalidParameterError("xres","number between 0.001 and 1000000",Z.xres);if(z.defined(Z.yres))if(z.number(Z.yres)&&z.inRange(Z.yres,0.001,1e6))this.options.tiffYres=Z.yres;else throw z.invalidParameterError("yres","number between 0.001 and 1000000",Z.yres);if(z.defined(Z.compression))if(z.string(Z.compression)&&z.inArray(Z.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=Z.compression;else throw z.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",Z.compression);if(z.defined(Z.bigtiff))this._setBooleanOption("tiffBigtiff",Z.bigtiff);if(z.defined(Z.predictor))if(z.string(Z.predictor)&&z.inArray(Z.predictor,["none","horizontal","float"]))this.options.tiffPredictor=Z.predictor;else throw z.invalidParameterError("predictor","one of: none, horizontal, float",Z.predictor);if(z.defined(Z.resolutionUnit))if(z.string(Z.resolutionUnit)&&z.inArray(Z.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=Z.resolutionUnit;else throw z.invalidParameterError("resolutionUnit","one of: inch, cm",Z.resolutionUnit)}return this._updateFormatOut("tiff",Z)}function AK(Z){return this.heif({...Z,compression:"av1"})}function MK(Z){if(z.object(Z)){if(z.string(Z.compression)&&z.inArray(Z.compression,["av1","hevc"]))this.options.heifCompression=Z.compression;else throw z.invalidParameterError("compression","one of: av1, hevc",Z.compression);if(z.defined(Z.quality))if(z.integer(Z.quality)&&z.inRange(Z.quality,1,100))this.options.heifQuality=Z.quality;else throw z.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(z.defined(Z.lossless))if(z.bool(Z.lossless))this.options.heifLossless=Z.lossless;else throw z.invalidParameterError("lossless","boolean",Z.lossless);if(z.defined(Z.effort))if(z.integer(Z.effort)&&z.inRange(Z.effort,0,9))this.options.heifEffort=Z.effort;else throw z.invalidParameterError("effort","integer between 0 and 9",Z.effort);if(z.defined(Z.chromaSubsampling))if(z.string(Z.chromaSubsampling)&&z.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=Z.chromaSubsampling;else throw z.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);if(z.defined(Z.bitdepth))if(z.integer(Z.bitdepth)&&z.inArray(Z.bitdepth,[8,10,12]))this.options.heifBitdepth=Z.bitdepth;else throw z.invalidParameterError("bitdepth","8, 10 or 12",Z.bitdepth);if(z.defined(Z.tune))if(z.string(Z.tune)&&z.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 z.invalidParameterError("tune","one of: auto, iq, psnr, ssim",Z.tune)}else throw z.invalidParameterError("options","Object",Z);return this._updateFormatOut("heif",Z)}function IK(Z){if(z.object(Z)){if(z.defined(Z.quality))if(z.integer(Z.quality)&&z.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 z.invalidParameterError("quality","integer between 1 and 100",Z.quality);else if(z.defined(Z.distance))if(z.number(Z.distance)&&z.inRange(Z.distance,0,15))this.options.jxlDistance=Z.distance;else throw z.invalidParameterError("distance","number between 0.0 and 15.0",Z.distance);if(z.defined(Z.decodingTier))if(z.integer(Z.decodingTier)&&z.inRange(Z.decodingTier,0,4))this.options.jxlDecodingTier=Z.decodingTier;else throw z.invalidParameterError("decodingTier","integer between 0 and 4",Z.decodingTier);if(z.defined(Z.lossless))if(z.bool(Z.lossless))this.options.jxlLossless=Z.lossless;else throw z.invalidParameterError("lossless","boolean",Z.lossless);if(z.defined(Z.effort))if(z.integer(Z.effort)&&z.inRange(Z.effort,1,9))this.options.jxlEffort=Z.effort;else throw z.invalidParameterError("effort","integer between 1 and 9",Z.effort)}return s3(Z,this.options),this._updateFormatOut("jxl",Z)}function NK(Z){if(z.object(Z)){if(z.defined(Z.depth))if(z.string(Z.depth)&&z.inArray(Z.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=Z.depth;else throw z.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",Z.depth)}return this._updateFormatOut("raw")}function wK(Z){if(z.object(Z)){if(z.defined(Z.size))if(z.integer(Z.size)&&z.inRange(Z.size,1,8192))this.options.tileSize=Z.size;else throw z.invalidParameterError("size","integer between 1 and 8192",Z.size);if(z.defined(Z.overlap))if(z.integer(Z.overlap)&&z.inRange(Z.overlap,0,8192)){if(Z.overlap>this.options.tileSize)throw z.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,Z.overlap);this.options.tileOverlap=Z.overlap}else throw z.invalidParameterError("overlap","integer between 0 and 8192",Z.overlap);if(z.defined(Z.container))if(z.string(Z.container)&&z.inArray(Z.container,["fs","zip"]))this.options.tileContainer=Z.container;else throw z.invalidParameterError("container","one of: fs, zip",Z.container);if(z.defined(Z.layout))if(z.string(Z.layout)&&z.inArray(Z.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=Z.layout;else throw z.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",Z.layout);if(z.defined(Z.angle))if(z.integer(Z.angle)&&!(Z.angle%90))this.options.tileAngle=Z.angle;else throw z.invalidParameterError("angle","positive/negative multiple of 90",Z.angle);if(this._setBackgroundColourOption("tileBackground",Z.background),z.defined(Z.depth))if(z.string(Z.depth)&&z.inArray(Z.depth,["onepixel","onetile","one"]))this.options.tileDepth=Z.depth;else throw z.invalidParameterError("depth","one of: onepixel, onetile, one",Z.depth);if(z.defined(Z.skipBlanks))if(z.integer(Z.skipBlanks)&&z.inRange(Z.skipBlanks,-1,65535))this.options.tileSkipBlanks=Z.skipBlanks;else throw z.invalidParameterError("skipBlanks","integer between -1 and 255/65535",Z.skipBlanks);else if(z.defined(Z.layout)&&Z.layout==="google")this.options.tileSkipBlanks=5;let W=z.bool(Z.center)?Z.center:Z.centre;if(z.defined(W))this._setBooleanOption("tileCentre",W);if(z.defined(Z.id))if(z.string(Z.id))this.options.tileId=Z.id;else throw z.invalidParameterError("id","string",Z.id);if(z.defined(Z.basename))if(z.string(Z.basename))this.options.tileBasename=Z.basename;else throw z.invalidParameterError("basename","string",Z.basename)}if(z.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw z.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function DK(Z){if(!z.plainObject(Z))throw z.invalidParameterError("options","object",Z);if(z.integer(Z.seconds)&&z.inRange(Z.seconds,0,3600))this.options.timeoutSeconds=Z.seconds;else throw z.invalidParameterError("seconds","integer between 0 and 3600",Z.seconds);return this}function TK(Z,W){if(!(z.object(W)&&W.force===!1))this.options.formatOut=Z;return this}function RK(Z,W){if(z.bool(W))this.options[Z]=W;else throw z.invalidParameterError(Z,"boolean",W)}function PK(){if(!this.options.streamOut){this.options.streamOut=!0;let Z=Error();this._pipeline(void 0,Z)}}function jK(Z,W){if(typeof Z==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),W0.pipeline(this.options,(X,Q,J)=>{if(X)Z(z.nativeError(X,W));else Z(null,Q,J)})});else W0.pipeline(this.options,(X,Q,J)=>{if(X)Z(z.nativeError(X,W));else Z(null,Q,J)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),W0.pipeline(this.options,(X,Q,J)=>{if(X)this.emit("error",z.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 W0.pipeline(this.options,(X,Q,J)=>{if(X)this.emit("error",z.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(),W0.pipeline(this.options,(J,G,Y)=>{if(J)Q(z.nativeError(J,W));else if(this.options.resolveWithObject)X({data:G,info:Y});else X(G)})})});else return new Promise((X,Q)=>{W0.pipeline(this.options,(J,G,Y)=>{if(J)Q(z.nativeError(J,W));else if(this.options.resolveWithObject)X({data:G,info:Y});else X(G)})})}var CW,rU,OW=()=>Error("JP2 output requires libvips with support for OpenJPEG"),xW=(Z)=>1<<31-Math.clz32(Math.ceil(Math.log2(Z))),kW=(Z)=>{Object.assign(Z.prototype,{toFile:aU,toBuffer:sU,toUint8Array:oU,withDensity:tU,keepExif:eU,withExif:ZK,withExifMerge:WK,keepIccProfile:XK,withIccProfile:QK,keepGainMap:JK,withGainMap:GK,keepXmp:YK,withXmp:zK,keepMetadata:qK,withMetadata:UK,toFormat:KK,jpeg:VK,jp2:FK,png:BK,webp:HK,tiff:LK,avif:AK,heif:MK,jxl:IK,gif:$K,raw:NK,tile:wK,timeout:DK,_updateFormatOut:TK,_setBooleanOption:RK,_read:PK,_pipeline:jK})};var SW=c(()=>{Y6();G2();/*!
238
238
  Copyright 2013 Lovell Fuller and others.
239
239
  SPDX-License-Identifier: Apache-2.0
240
- */CW=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"]]),lU=/\.(jp[2x]|j2[kc])$/i});import TK from"node:events";import{createRequire as RK}from"node:module";import{availableParallelism as PK}from"node:os";function vW(Z){if(z.bool(Z))if(Z)return W0.cache(50,20,100);else return W0.cache(0,0,0);else if(z.object(Z)){for(let W of["memory","files","items"]){let X=Z[W];if(z.defined(X)&&!(z.integer(X)&&X>=0))throw z.invalidParameterError(W,"a positive integer",X)}return W0.cache(Z.memory,Z.files,Z.items)}else return W0.cache()}function jK(Z){return W0.concurrency(z.integer(Z)?Z:null)}function CK(){return W0.counters()}function OK(Z){return W0.simd(z.bool(Z)?Z:null)}function xK(Z){if(z.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(z.string))W0.block(Z.operation,!0);else throw z.invalidParameterError("operation","Array<string>",Z.operation);else throw z.invalidParameterError("options","object",Z)}function kK(Z){if(z.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(z.string))W0.block(Z.operation,!1);else throw z.invalidParameterError("operation","Array<string>",Z.operation);else throw z.invalidParameterError("options","object",Z)}var Y2,o3,bW,t3,c6,_K,E4,EK,yW=(Z)=>{Z.cache=vW,Z.concurrency=jK,Z.counters=CK,Z.simd=OK,Z.format=c6,Z.interpolators=_K,Z.versions=E4,Z.queue=EK,Z.block=xK,Z.unblock=kK};var gW=c(()=>{Y6();f3();G2();Y1();Y2=g4(n2(),1);/*!
240
+ */CW=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"]]),rU=/\.(jp[2x]|j2[kc])$/i});import _K from"node:events";import{createRequire as EK}from"node:module";import{availableParallelism as CK}from"node:os";function vW(Z){if(z.bool(Z))if(Z)return W0.cache(50,20,100);else return W0.cache(0,0,0);else if(z.object(Z)){for(let W of["memory","files","items"]){let X=Z[W];if(z.defined(X)&&!(z.integer(X)&&X>=0))throw z.invalidParameterError(W,"a positive integer",X)}return W0.cache(Z.memory,Z.files,Z.items)}else return W0.cache()}function xK(Z){return W0.concurrency(z.integer(Z)?Z:null)}function SK(){return W0.counters()}function bK(Z){return W0.simd(z.bool(Z)?Z:null)}function vK(Z){if(z.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(z.string))W0.block(Z.operation,!0);else throw z.invalidParameterError("operation","Array<string>",Z.operation);else throw z.invalidParameterError("options","object",Z)}function yK(Z){if(z.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(z.string))W0.block(Z.operation,!1);else throw z.invalidParameterError("operation","Array<string>",Z.operation);else throw z.invalidParameterError("options","object",Z)}var Y2,o3,bW,t3,c6,OK,E4,kK,yW=(Z)=>{Z.cache=vW,Z.concurrency=xK,Z.counters=SK,Z.simd=bK,Z.format=c6,Z.interpolators=OK,Z.versions=E4,Z.queue=kK,Z.block=vK,Z.unblock=yK};var gW=c(()=>{Y6();f3();G2();Y1();Y2=g4(n2(),1);/*!
241
241
  Copyright 2013 Lovell Fuller and others.
242
242
  SPDX-License-Identifier: Apache-2.0
243
- */o3=RK(import.meta.url),bW=z1.runtimePlatformArch(),t3=W0.libvipsVersion(),c6=W0.format();c6.heif.output.alias=["avif","heic"];c6.jpeg.output.alias=["jpe","jpg"];c6.tiff.output.alias=["tif"];c6.jp2.output.alias=["j2c","j2k","jp2","jpx"];_K={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},E4={vips:t3.semver};if(!t3.isGlobal)if(!t3.isWasm)try{E4=o3(`@img/sharp-${bW}/versions`)}catch(Z){try{E4=o3(`@img/sharp-libvips-${bW}/versions`)}catch(W){}}else try{E4=o3("@img/sharp-wasm32/versions")}catch(Z){}E4.sharp=j6.version;if(E4.heif&&c6.heif)c6.heif.input.fileSuffix=[".avif"],c6.heif.output.alias=["avif"];vW(!0);if(!process.env.MALLOC_ARENA_MAX&&Y2.default.familySync()===Y2.default.GLIBC&&!W0._isUsingJemalloc())W0.concurrency(1);else if(Y2.default.familySync()===Y2.default.MUSL&&W0.concurrency()===1024)W0.concurrency(PK());EK=new TK.EventEmitter});var e3={};N2(e3,{default:()=>SK});var SK;var Z8=c(()=>{e7();XW();qW();KW();HW();_W();EW();SW();gW();/*!
243
+ */o3=EK(import.meta.url),bW=z1.runtimePlatformArch(),t3=W0.libvipsVersion(),c6=W0.format();c6.heif.output.alias=["avif","heic"];c6.jpeg.output.alias=["jpe","jpg"];c6.tiff.output.alias=["tif"];c6.jp2.output.alias=["j2c","j2k","jp2","jpx"];OK={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},E4={vips:t3.semver};if(!t3.isGlobal)if(!t3.isWasm)try{E4=o3(`@img/sharp-${bW}/versions`)}catch(Z){try{E4=o3(`@img/sharp-libvips-${bW}/versions`)}catch(W){}}else try{E4=o3("@img/sharp-wasm32/versions")}catch(Z){}E4.sharp=_6.version;if(E4.heif&&c6.heif)c6.heif.input.fileSuffix=[".avif"],c6.heif.output.alias=["avif"];vW(!0);if(!process.env.MALLOC_ARENA_MAX&&Y2.default.familySync()===Y2.default.GLIBC&&!W0._isUsingJemalloc())W0.concurrency(1);else if(Y2.default.familySync()===Y2.default.MUSL&&W0.concurrency()===1024)W0.concurrency(CK());kK=new _K.EventEmitter});var e3={};N2(e3,{default:()=>gK});var gK;var Z8=c(()=>{e7();XW();qW();KW();HW();jW();EW();SW();gW();/*!
244
244
  Copyright 2013 Lovell Fuller and others.
245
245
  SPDX-License-Identifier: Apache-2.0
246
- */WW(V6);zW(V6);UW(V6);BW(V6);PW(V6);jW(V6);kW(V6);yW(V6);SK=V6});import{createHash as hW}from"node:crypto";import{existsSync as bK,mkdirSync as vK,readFileSync as yK}from"node:fs";import{basename as gK,extname as hK,resolve as W8}from"node:path";import{createRequire as fK}from"node:module";async function fW(){if(C4)return C4;try{return C4=(await Promise.resolve().then(() => (Z8(),e3))).default,C4}catch{}try{return C4=fK(W8(process.cwd(),"package.json"))("sharp"),C4}catch(Z){throw Error(`Sharp is required for image optimization but failed to load: ${T6(Z)}`,{cause:Z})}}async function X8(Z){let X=await(await fW())(Z).metadata();return{format:X.format??"unknown",height:X.height??0,width:X.width??0}}function z2(Z){let W=yK(Z);return hW("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 hW("md5").update(W).digest("hex").slice(0,8)}function uK(Z,W,X,Q){return`${Z}-${W}-${X}.${Q}`}async function mW(Z,W,X){let Q=await fW(),J=await X8(Z),G=z2(Z),Y=gK(Z,hK(Z)),U=W8(W,"_optimized");vK(U,{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=uK(Y,$,G,L),j=`/${mK}/${A}`,D=W8(U,A);if(K.push({absolutePath:D,format:L,outputPath:j,width:$}),bK(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 C4=null,mK="images/_optimized";var G8=c(()=>{R6()});import{existsSync as dK,mkdirSync as cK,readFileSync as lK,writeFileSync as pK}from"node:fs";import{basename as nK,resolve as V1}from"node:path";import{execSync as iK}from"node:child_process";import{tmpdir as rK}from"node:os";function O4(Z){if(q2===void 0)try{let W=iK("npm config get cache",{cwd:rK(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();q2=W&&W!=="undefined"?W:null}catch{q2=null}if(q2)return V1(q2,"jxsuite-images",nK(Z));return V1(Z,".cache/images")}function uW(Z){let W=V1(O4(Z),"manifest.json");if(!dK(W))return{entries:{},version:1};try{return JSON.parse(lK(W,"utf8"))}catch{return{entries:{},version:1}}}function dW(Z,W){let X=O4(Z);cK(X,{recursive:!0}),pK(V1(X,"manifest.json"),JSON.stringify(W,null,2),"utf8")}function cW(Z,W){let X=Z.entries[W];if(!X)return null;return X.manifest}function lW(Z,W,X,Q){Z.entries[W]={manifest:Q,source:X,timestamp:Date.now()}}var q2;var Y8=c(()=>{G8()});import{existsSync as z8}from"node:fs";import{basename as aK,extname as iW,resolve as pW}from"node:path";async function aW(Z,W){let X=W.get(Z);if(!X){let Q=z2(Z);try{let J=await X8(Z);X={width:J.width,height:J.height,hash:Q}}catch(J){if(!nW)nW=!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 B1(Z,W,X,Q){let J=W.quality?.webp??80,G=Z.startsWith("/")?"":"/",Y=Q?`?v=${Q}`:"";return W.widths.filter((U)=>U<=X).toSorted((U,K)=>U-K).map((U)=>`/cdn-cgi/image/width=${U},quality=${J},fit=scale-down,format=auto${G}${Z}${Y} ${U}w`).join(", ")}async function sW(Z,W,X,Q,J){let G=`${z2(Z)}:${Q8(X)}`,Y=cW(J,G);if(Y){if(Y.variants.every((V)=>z8(V.absolutePath)))return Y}if(!Y)console.log(` Optimizing ${aK(Z)}...`);let U=await mW(Z,O4(Q),X);return lW(J,G,W,U),U}function oW(Z){if(typeof Z!=="string")return!0;if(!Z)return!0;if(Z.includes("${"))return!0;if(sK.some((W)=>Z.startsWith(W)))return!0;if(rW.has(iW(Z).toLowerCase()))return!0;return!1}function tW(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(rW.has(iW(X.pathname).toLowerCase()))return!1;return W.remoteDomains.includes(X.hostname)}catch{return!1}}function eW(Z,W){if(Z.startsWith("/"))return pW(W,"public",Z.slice(1));return pW(W,Z)}async function ZX(Z,W,X,Q,J){let G=new Map;if(!W.optimize)return{imageRefs:G};return await WX(Z,W,X,Q,J??new Map,G),{imageRefs:G}}async function WX(Z,W,X,Q,J,G){if(!Z||typeof Z!=="object")return;if(Z.tagName==="img")await oK(Z,W,X,Q,J,G);if(typeof Z.innerHTML==="string"&&Z.innerHTML.includes("<img"))Z.innerHTML=await XV(Z.innerHTML,W,X,Q,J,G);if(Array.isArray(Z.children))for(let Y of Z.children){if(typeof Y==="string")continue;await WX(Y,W,X,Q,J,G)}}async function oK(Z,W,X,Q,J,G){if(!Z.attributes)Z.attributes={};let Y=Z.attributes.src??Z.src;if(typeof Y!=="string")return;let U=tW(Y,W);if(!U&&oW(Y))return;if(Z.attributes["data-no-optimize"]!==void 0)return;let K;if(U)K=B1(Y,W,1/0,null);else{let V=eW(Y,X);if(!z8(V))return;if(W.service==="cloudflare"){let H=await aW(V,J);K=B1(Y,W,H.width??1/0,H.hash)}else{let H=G.get(V);if(!H)H=await sW(V,Y,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 XV(Z,W,X,Q,J,G){let Y=[];for(let K of Z.matchAll(tK)){let V=K[0],H=K[1];if(ZV.test(H))continue;if(WV.test(H))continue;let B=H.match(eK);if(!B)continue;let $=B[1].replaceAll("&amp;","&"),L=tW($,W);if(!L&&oW($))continue;let A=L?null:eW($,X);if(A&&!z8(A))continue;let j;if(L)j=B1($,W,1/0,null);else if(W.service==="cloudflare"){let R=await aW(A,J);j=B1($,W,R.width??1/0,R.hash)}else{let R=G.get(A);if(!R)R=await sW(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"'}Y.push({match:V,replacement:`<img${H}${D}>`})}let U=Z;for(let{match:K,replacement:V}of Y)U=U.replace(K,V);return U}var rW,sK,nW=!1,tK,eK,ZV,WV;var XX=c(()=>{G8();Y8();rW=new Set([".svg",".gif"]),sK=["http://","https://","data:","//"];tK=/<img\b([^>]*)>/gi,eK=/\bsrc="([^"]*)"/,ZV=/\bsrcset="/,WV=/\bdata-no-optimize\b/});var zX={};N2(zX,{buildSite:()=>UV});import{copyFileSync as QV,cpSync as q8,existsSync as W4,mkdirSync as l6,readFileSync as JV,readdirSync as GV,rmSync as YV,statSync as zV,writeFileSync as s0}from"node:fs";import{basename as qV,dirname as x4,join as k4,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:Y}=q9(Z),U=N0(Z,Y.build.outDir),K=N0(Z,"pages"),V=N0(Z,"public"),H=Y.build.trailingSlash??"always",B=await i4(Z,Y);if(B.entries.length>0)G(` Registered ${B.entries.length} format(s): ${B.entries.map((s)=>s.name).join(", ")}`);if(X&&W4(U))YV(U,{force:!0,recursive:!0});if(l6(U,{recursive:!0}),!W4(K))throw Error(`pages/ directory not found in ${Z}`);G("Discovering pages...");let $=await V9(K,B);G(` Found ${$.length} page(s)`),G("Loading content types...");let L=await T9(Z,Y,B);if(L.size>0){G(` Loaded ${L.size} content type(s): ${[...L.keys()].join(", ")}`);let s=L3(Z,Y);if(s)R9(L,s.config)}let A=await H9($,Z,L,B);G(` ${A.length} route(s) after expansion`);let j=0,D=N0(Z,"components"),R=[],x=new Map,d=new Map;if(W4(D)){G("Compiling components...");let s=[".json",...B.documentExtensions("component")],X0=GV(D).filter((Q0)=>s.some((H0)=>Q0.endsWith(H0))),q0=N0(U,"components");l6(q0,{recursive:!0});for(let Q0 of X0)try{let H0=N0(D,Q0),o=await u2(H0,{...Y.$media?{$media:Y.$media}:{},formats:B});for(let S of o.files){let c0=qV(S.path);if(s0(N0(q0,c0),S.content,"utf8"),S.tagName)R.push(S.tagName);j+=1}let G0=await s4(H0,B);if(G0.tagName){d.set(G0.tagName,G0);let S=P8(G0.tagName,G0.style,G0,Y.$media??{});if(S)x.set(G0.tagName,S),s0(N0(q0,`${G0.tagName}.css`),S,"utf8"),j+=1}}catch(H0){let o=H0;J.push(`Error compiling component ${Q0}: ${o.message}`),console.error(`Error compiling component ${Q0}: ${o.message}`)}G(` Compiled ${R.length} component(s): ${R.join(", ")}`)}let u=[];if(Y.build.adapter)for(let[,s]of d){let X0=P2(s);for(let q0 of X0){let Q0=`./components/${q0.src.replace(/^\.\//,"")}`;u.push({exportName:q0.exportName,src:Q0})}}let i=Y.images.optimize&&Y.images.service==="cloudflare",m=Y.images.optimize&&!i?uW(Z):null,b=i?new Map:null;if(i)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.");let t=Y.url,w0=Boolean(t)&&Y.build.sitemap!==!1,j0=[];for(let s of A)try{G(` Compiling ${s.urlPattern} ...`);let X0=await KV(s,Y,Z,L,m,d,b,B),q0=new Set;for(let[o,G0]of d)if(x1(G0))q0.add(o);if(R.length>0)X0.html=HV(X0.html,R,x,q0);let Q0=YX(s.urlPattern,U,H);l6(x4(Q0),{recursive:!0}),s0(Q0,X0.html,"utf8"),j+=1;let H0=!s.urlPattern.includes(":")&&!s.urlPattern.includes("*");if(w0&&!X0.excludeFromSitemap&&H0)j0.push({lastmod:zV(s.sourcePath).mtime,loc:new URL(s.urlPattern,t).href});for(let o of B.withCapability("serialize")){if(!o.exportTarget)continue;try{let G0=await o.call("serialize",X0.doc,{buildScope:(S)=>V4(S,null),componentDefs:d,evaluateTemplate:(S,c0)=>{if(!a(S))return;return C0(S,c0)??S},mode:"export"});if(G0){let S=Q0.replace(/\.html$/,o.extensions[0]);s0(S,G0,"utf8"),j+=1}}catch(G0){let S=G0;J.push(`Error exporting ${o.name} for ${s.urlPattern}: ${S.message}`)}}for(let o of X0.files){let G0=N0(x4(Q0),o.path);l6(x4(G0),{recursive:!0}),s0(G0,o.content,"utf8"),j+=1}if(X0.serverHandler){let o=N0(x4(Q0),"_server.js");s0(o,X0.serverHandler,"utf8"),j+=1}}catch(X0){let q0=X0,Q0=`Error compiling ${s.urlPattern}: ${q0.message}`;J.push(Q0),console.error(Q0)}if(m&&Y.images.optimize){dW(Z,m);let s=N0(O4(Z),"_optimized");if(W4(s)){let q0=N0(U,"images/_optimized");l6(q0,{recursive:!0}),q8(s,q0,{recursive:!0})}let X0=Object.keys(m.entries).length;if(X0>0)G(` Optimized ${X0} image(s)`)}if(Y.build.adapter){let{adapter:s}=Y.build;G("Generating site-wide server worker...");let X0=new Map;for(let H0 of u)if(!X0.has(H0.exportName))X0.set(H0.exportName,H0);let Q0=s==="cloudflare-pages"&&X0.size===0?null:e1([...X0.values()],{adapter:s});if(Q0){let H0=s==="cloudflare-pages"?"_worker.js":"worker.js";if(s0(N0(U,H0),Q0,"utf8"),j+=1,G(` Generated dist/${H0} (${X0.size} server function(s))`),s==="cloudflare-pages")s0(N0(U,"_routes.json"),`${JSON.stringify({exclude:[],include:["/_jx/*"],version:1},null,2)}
247
- `,"utf8"),j+=1;let o=N0(U,"components");l6(o,{recursive:!0});for(let{src:G0}of X0.values()){let S=N0(Z,G0.replace(/^\.\//,"")),c0=N0(o,G0.replace(/^\.\/components\//,""));if(W4(S))QV(S,c0)}}}if(Y.redirects&&Object.keys(Y.redirects).length>0){G("Generating redirects...");let s=LV(Y.redirects,U);j+=s}if(w0)G(`Generating sitemap (${j0.length} URL(s))...`),j+=IV(j0,U);else if(!t&&Y.build.sitemap!==!1)console.warn("sitemap.xml skipped — set `url` in project.json to enable sitemap generation.");if(W4(V))G("Copying public/ assets..."),q8(V,U,{recursive:!0});if(w0)j+=NV(U,t);if(Y.copy){G("Copying mapped files...");for(let[s,X0]of Object.entries(Y.copy)){let q0=N0(Z,s),Q0=N0(U,X0);l6(x4(Q0),{recursive:!0}),q8(q0,Q0)}}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 KV(Z,W,X,Q=new Map,J=null,G=new Map,Y=null,U){let K=await s4(Z.sourcePath,U),V=H3(K,W,X),H=K.$head??V._pageHead??[],B=V.$head??[],$=K.title??V._pageTitle??null;delete V._pageHead,delete V._pageTitle,I9(V,W,Z,Q,X),await _9(V,Z,X,{config:W,contentTypes:Q});let L=V4(V.state??{}),A=$??W.name??"Jx Site";if(typeof A==="string"&&a(A))A=C0(A,L)??A;let j=QX(H,L),D=QX(B,L);U2(V,L);let R={counter:{n:0},media:{...W.$media,...V.$media},rules:[]};if(K8(V,G,R),V.state)for(let[b,t]of Object.entries(V.state)){if(b==="$site"||b==="$page")continue;if(t&&typeof t==="object"&&!Array.isArray(t)&&t.timing==="compiler")delete V.state[b];else if(Array.isArray(t))delete V.state[b]}let x=VV(W.$head??[]),d=A9(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||Y))await ZX(V,W.images,X,J,Y??void 0);let u=await V3(V,{lang:W.defaults?.lang??"en",projectStyle:W.style??null,title:A});if(R.rules.length>0)u.html=u.html.replace("</head>",`<style>
246
+ */WW(V6);zW(V6);UW(V6);BW(V6);PW(V6);_W(V6);kW(V6);yW(V6);gK=V6});import{createHash as hW}from"node:crypto";import{existsSync as hK,mkdirSync as fK,readFileSync as mK}from"node:fs";import{basename as uK,extname as dK,resolve as W8}from"node:path";import{createRequire as cK}from"node:module";async function fW(){if(C4)return C4;try{return C4=(await Promise.resolve().then(() => (Z8(),e3))).default,C4}catch{}try{return C4=cK(W8(process.cwd(),"package.json"))("sharp"),C4}catch(Z){throw Error(`Sharp is required for image optimization but failed to load: ${T6(Z)}`,{cause:Z})}}async function X8(Z){let X=await(await fW())(Z).metadata();return{format:X.format??"unknown",height:X.height??0,width:X.width??0}}function z2(Z){let W=mK(Z);return hW("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 hW("md5").update(W).digest("hex").slice(0,8)}function pK(Z,W,X,Q){return`${Z}-${W}-${X}.${Q}`}async function mW(Z,W,X){let Q=await fW(),J=await X8(Z),G=z2(Z),Y=uK(Z,dK(Z)),U=W8(W,"_optimized");fK(U,{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=pK(Y,$,G,L),_=`/${lK}/${A}`,D=W8(U,A);if(K.push({absolutePath:D,format:L,outputPath:_,width:$}),hK(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 C4=null,lK="images/_optimized";var G8=c(()=>{R6()});import{existsSync as nK,mkdirSync as iK,readFileSync as rK,writeFileSync as aK}from"node:fs";import{basename as sK,resolve as V1}from"node:path";import{execSync as oK}from"node:child_process";import{tmpdir as tK}from"node:os";function O4(Z){if(q2===void 0)try{let W=oK("npm config get cache",{cwd:tK(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();q2=W&&W!=="undefined"?W:null}catch{q2=null}if(q2)return V1(q2,"jxsuite-images",sK(Z));return V1(Z,".cache/images")}function uW(Z){let W=V1(O4(Z),"manifest.json");if(!nK(W))return{entries:{},version:1};try{return JSON.parse(rK(W,"utf8"))}catch{return{entries:{},version:1}}}function dW(Z,W){let X=O4(Z);iK(X,{recursive:!0}),aK(V1(X,"manifest.json"),JSON.stringify(W,null,2),"utf8")}function cW(Z,W){let X=Z.entries[W];if(!X)return null;return X.manifest}function lW(Z,W,X,Q){Z.entries[W]={manifest:Q,source:X,timestamp:Date.now()}}var q2;var Y8=c(()=>{G8()});import{existsSync as z8}from"node:fs";import{basename as eK,extname as iW,resolve as pW}from"node:path";async function aW(Z,W){let X=W.get(Z);if(!X){let Q=z2(Z);try{let J=await X8(Z);X={width:J.width,height:J.height,hash:Q}}catch(J){if(!nW)nW=!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 B1(Z,W,X,Q){let J=W.quality?.webp??80,G=Z.startsWith("/")?"":"/",Y=Q?`?v=${Q}`:"";return W.widths.filter((U)=>U<=X).toSorted((U,K)=>U-K).map((U)=>`/cdn-cgi/image/width=${U},quality=${J},fit=scale-down,format=auto${G}${Z}${Y} ${U}w`).join(", ")}async function sW(Z,W,X,Q,J){let G=`${z2(Z)}:${Q8(X)}`,Y=cW(J,G);if(Y){if(Y.variants.every((V)=>z8(V.absolutePath)))return Y}if(!Y)console.log(` Optimizing ${eK(Z)}...`);let U=await mW(Z,O4(Q),X);return lW(J,G,W,U),U}function oW(Z){if(typeof Z!=="string")return!0;if(!Z)return!0;if(Z.includes("${"))return!0;if(ZV.some((W)=>Z.startsWith(W)))return!0;if(rW.has(iW(Z).toLowerCase()))return!0;return!1}function tW(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(rW.has(iW(X.pathname).toLowerCase()))return!1;return W.remoteDomains.includes(X.hostname)}catch{return!1}}function eW(Z,W){if(Z.startsWith("/"))return pW(W,"public",Z.slice(1));return pW(W,Z)}async function ZX(Z,W,X,Q,J){let G=new Map;if(!W.optimize)return{imageRefs:G};return await WX(Z,W,X,Q,J??new Map,G),{imageRefs:G}}async function WX(Z,W,X,Q,J,G){if(!Z||typeof Z!=="object")return;if(Z.tagName==="img")await WV(Z,W,X,Q,J,G);if(typeof Z.innerHTML==="string"&&Z.innerHTML.includes("<img"))Z.innerHTML=await YV(Z.innerHTML,W,X,Q,J,G);if(Array.isArray(Z.children))for(let Y of Z.children){if(typeof Y==="string")continue;await WX(Y,W,X,Q,J,G)}}async function WV(Z,W,X,Q,J,G){if(!Z.attributes)Z.attributes={};let Y=Z.attributes.src??Z.src;if(typeof Y!=="string")return;let U=tW(Y,W);if(!U&&oW(Y))return;if(Z.attributes["data-no-optimize"]!==void 0)return;let K;if(U)K=B1(Y,W,1/0,null);else{let V=eW(Y,X);if(!z8(V))return;if(W.service==="cloudflare"){let H=await aW(V,J);K=B1(Y,W,H.width??1/0,H.hash)}else{let H=G.get(V);if(!H)H=await sW(V,Y,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 YV(Z,W,X,Q,J,G){let Y=[];for(let K of Z.matchAll(XV)){let V=K[0],H=K[1];if(JV.test(H))continue;if(GV.test(H))continue;let B=H.match(QV);if(!B)continue;let $=B[1].replaceAll("&amp;","&"),L=tW($,W);if(!L&&oW($))continue;let A=L?null:eW($,X);if(A&&!z8(A))continue;let _;if(L)_=B1($,W,1/0,null);else if(W.service==="cloudflare"){let R=await aW(A,J);_=B1($,W,R.width??1/0,R.hash)}else{let R=G.get(A);if(!R)R=await sW(A,$,W,X,Q),G.set(A,R);let x=W.formats.includes("avif")?"avif":W.formats[0];_=J8(R.variants,x)}if(!_)continue;let D=` srcset="${_}" sizes="${W.sizes}"`;if(W.lazyLoad&&!/\bloading="eager"/.test(H)){if(!/\bloading=/.test(H))D+=' loading="lazy"';if(!/\bdecoding=/.test(H))D+=' decoding="async"'}Y.push({match:V,replacement:`<img${H}${D}>`})}let U=Z;for(let{match:K,replacement:V}of Y)U=U.replace(K,V);return U}var rW,ZV,nW=!1,XV,QV,JV,GV;var XX=c(()=>{G8();Y8();rW=new Set([".svg",".gif"]),ZV=["http://","https://","data:","//"];XV=/<img\b([^>]*)>/gi,QV=/\bsrc="([^"]*)"/,JV=/\bsrcset="/,GV=/\bdata-no-optimize\b/});var zX={};N2(zX,{buildSite:()=>HV});import{copyFileSync as zV,cpSync as q8,existsSync as W4,mkdirSync as l6,readFileSync as qV,readdirSync as UV,rmSync as KV,statSync as VV,writeFileSync as s0}from"node:fs";import{basename as BV,dirname as x4,join as k4,resolve as N0}from"node:path";async function HV(Z,W={}){let{clean:X=!0,verbose:Q=!1}=W,J=[],G=Q?console.log.bind(console):()=>{};G("Loading project.json...");let{config:Y}=q9(Z),U=N0(Z,Y.build.outDir),K=N0(Z,"pages"),V=N0(Z,"public"),H=Y.build.trailingSlash??"always",B=await i4(Z,Y);if(B.entries.length>0)G(` Registered ${B.entries.length} format(s): ${B.entries.map((s)=>s.name).join(", ")}`);if(X&&W4(U))KV(U,{force:!0,recursive:!0});if(l6(U,{recursive:!0}),!W4(K))throw Error(`pages/ directory not found in ${Z}`);G("Discovering pages...");let $=await V9(K,B);G(` Found ${$.length} page(s)`),G("Loading content types...");let L=await T9(Z,Y,B);if(L.size>0){G(` Loaded ${L.size} content type(s): ${[...L.keys()].join(", ")}`);let s=L3(Z,Y);if(s)R9(L,s.config)}let A=await H9($,Z,L,B);G(` ${A.length} route(s) after expansion`);let _=0,D=N0(Z,"components"),R=[],x=new Map,d=new Map;if(W4(D)){G("Compiling components...");let s=[".json",...B.documentExtensions("component")],X0=UV(D).filter((Q0)=>s.some((H0)=>Q0.endsWith(H0))),q0=N0(U,"components");l6(q0,{recursive:!0});for(let Q0 of X0)try{let H0=N0(D,Q0),o=await u2(H0,{...Y.$media?{$media:Y.$media}:{},formats:B});for(let S of o.files){let c0=BV(S.path);if(s0(N0(q0,c0),S.content,"utf8"),S.tagName)R.push(S.tagName);_+=1}let G0=await s4(H0,B);if(G0.tagName){d.set(G0.tagName,G0);let S=P8(G0.tagName,G0.style,G0,Y.$media??{});if(S)x.set(G0.tagName,S),s0(N0(q0,`${G0.tagName}.css`),S,"utf8"),_+=1}}catch(H0){let o=H0;J.push(`Error compiling component ${Q0}: ${o.message}`),console.error(`Error compiling component ${Q0}: ${o.message}`)}G(` Compiled ${R.length} component(s): ${R.join(", ")}`)}let u=[];if(Y.build.adapter)for(let[,s]of d){let X0=P2(s);for(let q0 of X0){let Q0=`./components/${q0.src.replace(/^\.\//,"")}`;u.push({exportName:q0.exportName,src:Q0})}}let i=Y.images.optimize&&Y.images.service==="cloudflare",m=Y.images.optimize&&!i?uW(Z):null,b=i?new Map:null;if(i)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.");let t=Y.url,w0=Boolean(t)&&Y.build.sitemap!==!1,_0=[];for(let s of A)try{G(` Compiling ${s.urlPattern} ...`);let X0=await $V(s,Y,Z,L,m,d,b,B),q0=new Set;for(let[o,G0]of d)if(x1(G0))q0.add(o);if(R.length>0)X0.html=AV(X0.html,R,x,q0);let Q0=YX(s.urlPattern,U,H);l6(x4(Q0),{recursive:!0}),s0(Q0,X0.html,"utf8"),_+=1;let H0=!s.urlPattern.includes(":")&&!s.urlPattern.includes("*");if(w0&&!X0.excludeFromSitemap&&H0)_0.push({lastmod:VV(s.sourcePath).mtime,loc:new URL(s.urlPattern,t).href});for(let o of B.withCapability("serialize")){if(!o.exportTarget)continue;try{let G0=await o.call("serialize",X0.doc,{buildScope:(S)=>V4(S,null),componentDefs:d,evaluateTemplate:(S,c0)=>{if(!a(S))return;return C0(S,c0)??S},mode:"export"});if(G0){let S=Q0.replace(/\.html$/,o.extensions[0]);s0(S,G0,"utf8"),_+=1}}catch(G0){let S=G0;J.push(`Error exporting ${o.name} for ${s.urlPattern}: ${S.message}`)}}for(let o of X0.files){let G0=N0(x4(Q0),o.path);l6(x4(G0),{recursive:!0}),s0(G0,o.content,"utf8"),_+=1}if(X0.serverHandler){let o=N0(x4(Q0),"_server.js");s0(o,X0.serverHandler,"utf8"),_+=1}}catch(X0){let q0=X0,Q0=`Error compiling ${s.urlPattern}: ${q0.message}`;J.push(Q0),console.error(Q0)}if(m&&Y.images.optimize){dW(Z,m);let s=N0(O4(Z),"_optimized");if(W4(s)){let q0=N0(U,"images/_optimized");l6(q0,{recursive:!0}),q8(s,q0,{recursive:!0})}let X0=Object.keys(m.entries).length;if(X0>0)G(` Optimized ${X0} image(s)`)}if(Y.build.adapter){let{adapter:s}=Y.build;G("Generating site-wide server worker...");let X0=new Map;for(let H0 of u)if(!X0.has(H0.exportName))X0.set(H0.exportName,H0);let Q0=s==="cloudflare-pages"&&X0.size===0?null:e1([...X0.values()],{adapter:s});if(Q0){let H0=s==="cloudflare-pages"?"_worker.js":"worker.js";if(s0(N0(U,H0),Q0,"utf8"),_+=1,G(` Generated dist/${H0} (${X0.size} server function(s))`),s==="cloudflare-pages")s0(N0(U,"_routes.json"),`${JSON.stringify({exclude:[],include:["/_jx/*"],version:1},null,2)}
247
+ `,"utf8"),_+=1;let o=N0(U,"components");l6(o,{recursive:!0});for(let{src:G0}of X0.values()){let S=N0(Z,G0.replace(/^\.\//,"")),c0=N0(o,G0.replace(/^\.\/components\//,""));if(W4(S))zV(S,c0)}}}if(Y.redirects&&Object.keys(Y.redirects).length>0){G("Generating redirects...");let s=NV(Y.redirects,U);_+=s}if(w0)G(`Generating sitemap (${_0.length} URL(s))...`),_+=TV(_0,U);else if(!t&&Y.build.sitemap!==!1)console.warn("sitemap.xml skipped — set `url` in project.json to enable sitemap generation.");if(W4(V))G("Copying public/ assets..."),q8(V,U,{recursive:!0});if(w0)_+=RV(U,t);if(Y.copy){G("Copying mapped files...");for(let[s,X0]of Object.entries(Y.copy)){let q0=N0(Z,s),Q0=N0(U,X0);l6(x4(Q0),{recursive:!0}),q8(q0,Q0)}}if(G(`
248
+ Build complete: ${A.length} routes, ${_} files`),J.length>0)G(` ${J.length} error(s)`);return{errors:J,files:_,routes:A.length}}async function $V(Z,W,X,Q=new Map,J=null,G=new Map,Y=null,U){let K=await s4(Z.sourcePath,U),V=H3(K,W,X),H=K.$head??V._pageHead??[],B=V.$head??[],$=K.title??V._pageTitle??null;delete V._pageHead,delete V._pageTitle,I9(V,W,Z,Q,X),await j9(V,Z,X,{config:W,contentTypes:Q});let L=V4(V.state??{}),A=$??W.name??"Jx Site";if(typeof A==="string"&&a(A))A=C0(A,L)??A;let _=QX(H,L),D=QX(B,L);U2(V,L);let R={counter:{n:0},media:{...W.$media,...V.$media},rules:[]};if(K8(V,G,R),V.state)for(let[b,t]of Object.entries(V.state)){if(b==="$site"||b==="$page")continue;if(t&&typeof t==="object"&&!Array.isArray(t)&&t.timing==="compiler")delete V.state[b];else if(Array.isArray(t))delete V.state[b]}let x=FV(W.$head??[]),d=A9(x,D,_,{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||Y))await ZX(V,W.images,X,J,Y??void 0);let u=await V3(V,{lang:W.defaults?.lang??"en",projectStyle:W.style??null,title:A});if(R.rules.length>0)u.html=u.html.replace("</head>",`<style>
249
249
  ${R.rules.join(`
250
250
  `)}
251
251
  </style>
252
- </head>`);u.html=FV(u.html,d,W.defaults?.lang??"en");let i=(V.$elements??[]).filter((b)=>typeof b==="string"&&!b.startsWith("./")&&!b.startsWith("../"));if(i.length>0)u.html=$V(u.html,i);let m=null;if(!W.build?.adapter)try{let b=await n4(Z.sourcePath);if(b)m=b}catch{}return{doc:V,excludeFromSitemap:K.$sitemap===!1,files:u.files,html:u.html,serverHandler:m}}function QX(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"&&a(G))Q.attributes[J]=C0(G,W)??G}if(typeof Q.textContent==="string"&&a(Q.textContent))Q.textContent=C0(Q.textContent,W)??Q.textContent;return Q})}function VV(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"&&BV(J))X.attributes[Q]=`/node_modules/${J}`}return X})}function BV(Z){return!Z.startsWith("/")&&!Z.startsWith("./")&&!Z.startsWith("../")&&!Z.startsWith("http")&&!Z.startsWith("data:")}function GX(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 GX(G,W)});else if(Q==="style"&&J&&typeof J==="object"){let G={...J};for(let[Y,U]of Object.entries(G))if(a(U))G[Y]=H1(U,W)??U;X.style=G}else if(Q==="attributes"&&J&&typeof J==="object"){let G={...J};for(let[Y,U]of Object.entries(G))if(a(U))G[Y]=H1(U,W)??U;X.attributes=G}else if(Q==="$props"&&J&&typeof J==="object"){let G={...J};for(let[Y,U]of Object.entries(G))if(a(U)){let K=H1(U,W);G[Y]=K!==null?K??null:U}X.$props=G}else if(typeof J==="string"&&a(J))X[Q]=H1(J,W)??J;else X[Q]=J;return X}function H1(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 U2(Z,W){if(!Z||typeof Z!=="object")return;if(typeof Z.innerHTML==="string"&&a(Z.innerHTML)){let Q=C0(Z.innerHTML,W);if(Q!=null)Z.innerHTML=String(Q).replaceAll("${","&#36;{")}if(typeof Z.textContent==="string"&&a(Z.textContent))Z.textContent=C0(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"&&a(J))Z.style[Q]=C0(J,W)??J}if(Z.attributes&&typeof Z.attributes==="object"){for(let[Q,J]of Object.entries(Z.attributes))if(typeof J==="string"&&a(J))Z.attributes[Q]=C0(J,W)??J}if(Z.$props&&typeof Z.$props==="object"){for(let[Q,J]of Object.entries(Z.$props))if(typeof J==="string"&&a(J))Z.$props[Q]=C0(J,W)??J}let X=Z.children;if(R0(X)){let Q=JX(X,W);if(Q){Z.children=Q;return}}if(typeof X==="string"&&a(X)){let Q=C0(X,W);if(Array.isArray(Q)){let J=Q;Z.children=J;for(let G of J)U2(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"&&a(J)){let G=C0(J,W);if(Array.isArray(G)){let Y=G;Z.children.splice(Q,1,...Y);for(let U of Y)U2(U,W);Q+=Y.length;continue}}if(R0(J)){let G=JX(J,W);if(G){Z.children.splice(Q,1,...G),Q+=G.length;continue}}U2(J,W),Q+=1}}}function JX(Z,W){let X=Z.items,Q=null;if(f0(X))Q=C1(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,Y)=>{let U=Object.create(W);U.$map={index:Y,item:G},U["$map/item"]=G,U["$map/index"]=Y;let K=GX(J,U);return U2(K,U),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((U)=>{if(X&&U&&typeof U==="object")v6(U,X.rules,X.media,"",X.counter,"jxs");return Y4(U,{},null)}).join(`
253
- `):null,G=R8(Q,Z.$props||null,J),Y=x1(Q);if(Z.innerHTML=G,delete Z.children,Q.style&&Z.$props){let U={...Q.state};for(let[H,B]of Object.entries(Z.$props))U[H]=H in U?B:B;let K=V4(U,null),V={};for(let[H,B]of Object.entries(Q.style))if(typeof B==="string"&&a(B)){let $=$0(B,K);if($!=null)V[H]=$}if(Object.keys(V).length>0)Z.style={...Z.style,...V}}if(delete Z.$props,Y)Z.$static=!0;else Z.$prerendered=!0}}function HV(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(`
252
+ </head>`);u.html=IV(u.html,d,W.defaults?.lang??"en");let i=(V.$elements??[]).filter((b)=>typeof b==="string"&&!b.startsWith("./")&&!b.startsWith("../"));if(i.length>0)u.html=MV(u.html,i);let m=null;if(!W.build?.adapter)try{let b=await n4(Z.sourcePath);if(b)m=b}catch{}return{doc:V,excludeFromSitemap:K.$sitemap===!1,files:u.files,html:u.html,serverHandler:m}}function QX(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"&&a(G))Q.attributes[J]=C0(G,W)??G}if(typeof Q.textContent==="string"&&a(Q.textContent))Q.textContent=C0(Q.textContent,W)??Q.textContent;return Q})}function FV(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"&&LV(J))X.attributes[Q]=`/node_modules/${J}`}return X})}function LV(Z){return!Z.startsWith("/")&&!Z.startsWith("./")&&!Z.startsWith("../")&&!Z.startsWith("http")&&!Z.startsWith("data:")}function GX(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 GX(G,W)});else if(Q==="style"&&J&&typeof J==="object"){let G={...J};for(let[Y,U]of Object.entries(G))if(a(U))G[Y]=H1(U,W)??U;X.style=G}else if(Q==="attributes"&&J&&typeof J==="object"){let G={...J};for(let[Y,U]of Object.entries(G))if(a(U))G[Y]=H1(U,W)??U;X.attributes=G}else if(Q==="$props"&&J&&typeof J==="object"){let G={...J};for(let[Y,U]of Object.entries(G))if(a(U)){let K=H1(U,W);G[Y]=K!==null?K??null:U}X.$props=G}else if(typeof J==="string"&&a(J))X[Q]=H1(J,W)??J;else X[Q]=J;return X}function H1(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 U2(Z,W){if(!Z||typeof Z!=="object")return;if(typeof Z.innerHTML==="string"&&a(Z.innerHTML)){let Q=C0(Z.innerHTML,W);if(Q!=null)Z.innerHTML=String(Q).replaceAll("${","&#36;{")}if(typeof Z.textContent==="string"&&a(Z.textContent))Z.textContent=C0(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"&&a(J))Z.style[Q]=C0(J,W)??J}if(Z.attributes&&typeof Z.attributes==="object"){for(let[Q,J]of Object.entries(Z.attributes))if(typeof J==="string"&&a(J))Z.attributes[Q]=C0(J,W)??J}if(Z.$props&&typeof Z.$props==="object"){for(let[Q,J]of Object.entries(Z.$props))if(typeof J==="string"&&a(J))Z.$props[Q]=C0(J,W)??J}let X=Z.children;if(R0(X)){let Q=JX(X,W);if(Q){Z.children=Q;return}}if(typeof X==="string"&&a(X)){let Q=C0(X,W);if(Array.isArray(Q)){let J=Q;Z.children=J;for(let G of J)U2(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"&&a(J)){let G=C0(J,W);if(Array.isArray(G)){let Y=G;Z.children.splice(Q,1,...Y);for(let U of Y)U2(U,W);Q+=Y.length;continue}}if(R0(J)){let G=JX(J,W);if(G){Z.children.splice(Q,1,...G),Q+=G.length;continue}}U2(J,W),Q+=1}}}function JX(Z,W){let X=Z.items,Q=null;if(f0(X))Q=C1(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,Y)=>{let U=Object.create(W);U.$map={index:Y,item:G},U["$map/item"]=G,U["$map/index"]=Y;let K=GX(J,U);return U2(K,U),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((U)=>{if(X&&U&&typeof U==="object")v6(U,X.rules,X.media,"",X.counter,"jxs");return Y4(U,{},null)}).join(`
253
+ `):null,G=R8(Q,Z.$props||null,J),Y=x1(Q);if(Z.innerHTML=G,delete Z.children,Q.style&&Z.$props){let U={...Q.state};for(let[H,B]of Object.entries(Z.$props))U[H]=H in U?B:B;let K=V4(U,null),V={};for(let[H,B]of Object.entries(Q.style))if(typeof B==="string"&&a(B)){let $=$0(B,K);if($!=null)V[H]=$}if(Object.keys(V).length>0)Z.style={...Z.style,...V}}if(delete Z.$props,Y)Z.$static=!0;else Z.$prerendered=!0}}function AV(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
254
  `),Y=Z;if(G)Y=Y.replace("</head>",` ${G}
255
255
  </head>`);let U=J.filter(($)=>!Q.has($));if(U.length===0)return Y;let K=`<script type="importmap">
256
256
  {
@@ -262,15 +262,15 @@ ${R.rules.join(`
262
262
  </script>`,V=U.map(($)=>`<script type="module" src="/components/${$}.js"></script>`).join(`
263
263
  `),B=(Y.includes('<script type="importmap">')?"":`${K}
264
264
  `)+V;return Y.replace("</body>",` ${B}
265
- </body>`)}function $V(Z,W){let X=W.map((Q)=>`<script type="module" src="/node_modules/${Q}"></script>`).join(`
265
+ </body>`)}function MV(Z,W){let X=W.map((Q)=>`<script type="module" src="/node_modules/${Q}"></script>`).join(`
266
266
  `);return Z.replace("</body>",` ${X}
267
- </body>`)}function FV(Z,W,X){let Q=M9(W),J=/<head>([\s\S]*?)<\/head>/i,G=Z.match(J),Y="";if(G){let K=G[1].match(/<style>[\s\S]*?<\/style>/gi);if(K)Y+=`
267
+ </body>`)}function IV(Z,W,X){let Q=M9(W),J=/<head>([\s\S]*?)<\/head>/i,G=Z.match(J),Y="";if(G){let K=G[1].match(/<style>[\s\S]*?<\/style>/gi);if(K)Y+=`
268
268
  ${K.join(`
269
269
  `)}`;let V=G[1].match(/<script[\s\S]*?<\/script>/gi);if(V)Y+=`
270
270
  ${V.join(`
271
271
  `)}`}let U=Z;if(J.test(U))U=U.replace(J,`<head>
272
272
  ${Q}${Y}
273
- </head>`);return U=U.replace(/<html\s[^>]*>/i,(K)=>{if(/lang=/.test(K))return K.replace(/lang="[^"]*"/,`lang="${X}"`);return K.replace("<html",`<html lang="${X}"`)}),U}function YX(Z,W,X){if(Z==="/")return k4(W,"index.html");let Q=Z.replace(/^\//,"");if(X==="always")return k4(W,Q,"index.html");return k4(W,`${Q}.html`)}function LV(Z,W){let X=0,Q=[];for(let[J,G]of Object.entries(Z)){let Y=typeof G==="object"?G.destination:G,U=typeof G==="object"?G.status??301:301;if(J.includes(":")||J.includes("*")){Q.push(`${J} ${Y} ${U}`);continue}let K=YX(J,W,"always"),V=`<!DOCTYPE html>
273
+ </head>`);return U=U.replace(/<html\s[^>]*>/i,(K)=>{if(/lang=/.test(K))return K.replace(/lang="[^"]*"/,`lang="${X}"`);return K.replace("<html",`<html lang="${X}"`)}),U}function YX(Z,W,X){if(Z==="/")return k4(W,"index.html");let Q=Z.replace(/^\//,"");if(X==="always")return k4(W,Q,"index.html");return k4(W,`${Q}.html`)}function NV(Z,W){let X=0,Q=[];for(let[J,G]of Object.entries(Z)){let Y=typeof G==="object"?G.destination:G,U=typeof G==="object"?G.status??301:301;if(J.includes(":")||J.includes("*")){Q.push(`${J} ${Y} ${U}`);continue}let K=YX(J,W,"always"),V=`<!DOCTYPE html>
274
274
  <html>
275
275
  <head>
276
276
  <meta charset="utf-8">
@@ -279,32 +279,32 @@ ${R.rules.join(`
279
279
  <title>Redirecting...</title>
280
280
  </head>
281
281
  <body>
282
- <p>Redirecting to <a href="${U8(Y)}">${AV(Y)}</a>...</p>
282
+ <p>Redirecting to <a href="${U8(Y)}">${wV(Y)}</a>...</p>
283
283
  </body>
284
284
  </html>`;l6(x4(K),{recursive:!0}),s0(K,V,"utf8"),X+=1,Q.push(`${J} ${Y} ${U}`)}if(Q.length>0)s0(k4(W,"_redirects"),`${Q.join(`
285
285
  `)}
286
- `,"utf8"),X+=1;return X}function AV(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function U8(Z){return String(Z).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}function MV(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function IV(Z,W){if(Z.length===0)return 0;let Q=`<?xml version="1.0" encoding="UTF-8"?>
286
+ `,"utf8"),X+=1;return X}function wV(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function U8(Z){return String(Z).replaceAll("&","&amp;").replaceAll('"',"&quot;").replaceAll("<","&lt;")}function DV(Z){return String(Z).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;")}function TV(Z,W){if(Z.length===0)return 0;let Q=`<?xml version="1.0" encoding="UTF-8"?>
287
287
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
288
288
  ${Z.map((J)=>` <url>
289
- <loc>${MV(J.loc)}</loc>
289
+ <loc>${DV(J.loc)}</loc>
290
290
  <lastmod>${J.lastmod.toISOString().slice(0,10)}</lastmod>
291
291
  </url>`).join(`
292
292
  `)}
293
293
  </urlset>
294
- `;return s0(k4(W,"sitemap.xml"),Q,"utf8"),1}function NV(Z,W){let X=k4(Z,"robots.txt"),Q=W4(X),J=Q?JV(X,"utf8"):`User-agent: *
294
+ `;return s0(k4(W,"sitemap.xml"),Q,"utf8"),1}function RV(Z,W){let X=k4(Z,"robots.txt"),Q=W4(X),J=Q?qV(X,"utf8"):`User-agent: *
295
295
  Allow: /
296
296
  `;if(/^Sitemap:/im.test(J))return 0;if(!J.endsWith(`
297
297
  `))J+=`
298
298
  `;return J+=`
299
299
  Sitemap: ${new URL("/sitemap.xml",W).href}
300
- `,s0(X,J,"utf8"),Q?0:1}var qX=c(()=>{X6();U9();$9();M4();L9();N9();Y9();a4();y6();P9();j9();XX();Y8()});import{resolve as wV}from"node:path";async function DV(){let Z=process.argv.slice(2),[W]=Z;if(!W||W==="--help"||W==="-h")console.log(`Usage: jx <command> [options]
300
+ `,s0(X,J,"utf8"),Q?0:1}var qX=c(()=>{X6();U9();$9();M4();L9();N9();Y9();a4();y6();P9();_9();XX();Y8()});import{resolve as PV}from"node:path";async function jV(){let Z=process.argv.slice(2),[W]=Z;if(!W||W==="--help"||W==="-h")console.log(`Usage: jx <command> [options]
301
301
 
302
302
  Commands:
303
303
  build [root] Build a Jx site to dist/
304
304
 
305
305
  Options:
306
306
  --verbose Print detailed build progress
307
- --no-clean Don't clean outDir before building`),process.exit(0);if(W==="build"){let X=Z.slice(1),Q=new Set(X.filter((K)=>K.startsWith("--"))),J=X.find((K)=>!K.startsWith("--")),G=wV(J??"."),Y=Q.has("--verbose"),U=!Q.has("--no-clean");console.log(`Building site from ${G}...`);try{let{buildSite:K}=await Promise.resolve().then(() => (qX(),zX)),V=await K(G,{clean:U,verbose:Y});if(V.errors.length>0){console.error(`
307
+ --no-clean Don't clean outDir before building`),process.exit(0);if(W==="build"){let X=Z.slice(1),Q=new Set(X.filter((K)=>K.startsWith("--"))),J=X.find((K)=>!K.startsWith("--")),G=PV(J??"."),Y=Q.has("--verbose"),U=!Q.has("--no-clean");console.log(`Building site from ${G}...`);try{let{buildSite:K}=await Promise.resolve().then(() => (qX(),zX)),V=await K(G,{clean:U,verbose:Y});if(V.errors.length>0){console.error(`
308
308
  Build completed with ${V.errors.length} error(s):`);for(let H of V.errors)console.error(` - ${H}`);process.exit(1)}console.log(`
309
309
  Done: ${V.routes} routes → ${V.files} files`)}catch(K){console.error(`Build failed: ${K.message}`),process.exit(1)}}else console.error(`Unknown command: ${W}
310
- Run "jx --help" for usage.`),process.exit(1)}var KA=DV();export{KA as ready};
310
+ Run "jx --help" for usage.`),process.exit(1)}var $A=jV();export{$A as ready};