@jxsuite/compiler 1.0.0 → 1.2.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 +251 -176
- package/dist/compiler.js +117 -112
- package/package.json +7 -6
- package/src/cli.ts +30 -0
- package/src/compiler.ts +18 -2
- package/src/shared.ts +220 -112
- package/src/site/bundler.ts +187 -0
- package/src/site/dev-command.ts +84 -0
- package/src/site/head-merger.ts +13 -0
- package/src/site/image-cache.ts +57 -6
- package/src/site/image-transform.ts +21 -0
- package/src/site/preview-server.ts +93 -0
- package/src/site/prototype-resolver.ts +15 -0
- package/src/site/site-build.ts +163 -15
- package/src/targets/compile-client.ts +53 -8
- package/src/targets/compile-element.ts +69 -7
- package/src/targets/compile-static.ts +17 -2
package/dist/cli.js
CHANGED
|
@@ -1,59 +1,60 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as zB}from"node:module";var tV=Object.create;var{getPrototypeOf:eV,defineProperty:l5,getOwnPropertyNames:ZB}=Object;var XB=Object.prototype.hasOwnProperty;function QB(Z){return this[Z]}var WB,JB,W1=(Z,X,Q)=>{var W=Z!=null&&typeof Z==="object";if(W){var J=X?WB??=new WeakMap:JB??=new WeakMap,G=J.get(Z);if(G)return G}Q=Z!=null?tV(eV(Z)):{};let Y=X||!Z||!Z.__esModule?l5(Q,"default",{value:Z,enumerable:!0}):Q;for(let z of ZB(Z))if(!XB.call(Y,z))l5(Y,z,{get:QB.bind(Z,z),enumerable:!0});if(W)J.set(Z,Y);return Y};var j=(Z,X)=>()=>(X||Z((X={exports:{}}).exports,X),X.exports);var GB=(Z)=>Z;function YB(Z,X){this[Z]=GB.bind(null,X)}var x6=(Z,X)=>{for(var Q in X)l5(Z,Q,{get:X[Q],enumerable:!0,configurable:!0,set:YB.bind(X,Q)})};var c=(Z,X)=>()=>(Z&&(X=Z(Z=0)),X);var _0=zB(import.meta.url);function d5(Z){let X=Z.$map;return X&&typeof X==="object"?X:void 0}function $6(Z){return zQ.has(Z)}function D4(Z,X,Q,W){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return r4(Z,X,Q,W);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return qB(Z.$ref,X,Q,W);if(Array.isArray(Z))return Z.map((J)=>D4(J,X,Q,W));return Z}function qB(Z,X,Q,W){if(Z==="$reduce/acc")return W?.acc;if(Z.startsWith("$reduce/"))return W?.acc;if(Z.startsWith("event#/")){let J=Z.slice(7);return J1(Q,J)}if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J,Y,z=d5(X);if(G==="item")Y=W?.item??z?.item??X["$map/item"];else if(G==="index")Y=W?.index??z?.index??X["$map/index"];else Y=z?.[G]??X[`$map/${G}`];return J.length>2?J1(Y,J.slice(2).join("/")):Y}if(Z.startsWith("#/state/")){let J=Z.slice(8),G=J.indexOf("/");if(G===-1)return X[J];return J1(X[J.slice(0,G)],J.slice(G+1))}if(Z.startsWith("parent#/"))return X[Z.slice(8)];if(Z.startsWith("window#/"))return J1(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return J1(globalThis.document,Z.slice(10));return X[Z]??null}function KB(Z,X,Q,W){if(Z.startsWith("$map/")){let J=Z.split("/"),[,G]=J,Y,z=d5(X);if(G==="item")Y=W?.item??z?.item??X["$map/item"];else if(G==="index")Y=W?.index??z?.index??X["$map/index"];else Y=z?.[G]??X[`$map/${G}`];if(J.length>2){let q=J.slice(2),K=q.pop(),V=q.length>0?J1(Y,q.join("/")):Y;return{key:K,obj:V}}return{key:G==="item"?"$map/item":"$map/index",obj:d5(X)??X}}if(Z.startsWith("#/state/")){let J=Z.slice(8);if(J.indexOf("/")===-1)return{key:J,obj:X};let Y=J.split("/"),z=Y.pop(),q=X;for(let K of Y)q=q[K];return{key:z,obj:q}}return{key:Z,obj:X}}function r4(Z,X,Q,W){let{operator:J,target:G,value:Y,initial:z}=Z;if(!$B.has(J))throw Error(`$expression: unknown operator "${J}"`);if(c5.has(J)&&!("value"in Z)){let q=D4(G,X,Q,W);if(J==="!")return!q;if(J==="-")return-q}if(p5.has(J)){let q=D4(G,X,Q,W),K=D4(Y,X,Q,W);switch(J){case"+":return q+K;case"-":return q-K;case"*":return q*K;case"/":return q/K;case"%":return q%K;case"===":return q===K;case"!==":return q!==K;case"<":return q<K;case"<=":return q<=K;case">":return q>K;case">=":return q>=K;case"&&":return q&&K;case"||":return q||K;default:break}}if($Q.has(J)){let q=D4(Y,X,Q,W),{obj:K,key:V}=KB(G.$ref,X,Q,W);switch(J){case"=":{K[V]=q;break}case"+=":{let B=K[V];K[V]=B+q;break}case"-=":{let B=K[V];K[V]=B-q;break}case"*=":{let B=K[V];K[V]=B*q;break}case"/=":{let B=K[V];K[V]=B/q;break}default:break}return}if(qQ.has(J)){let q=D4(G,X,Q,W);switch(J){case"push":return q.push(D4(Y,X,Q,W));case"unshift":return q.unshift(D4(Y,X,Q,W));case"pop":return q.pop();case"shift":return q.shift();case"splice":{let K=D4(Y,X,Q,W);return q.splice(...K)}default:break}}if(n5.has(J)){let q=D4(G,X,Q,W);if(J==="reduce"){let K=D4(z,X,Q,W);for(let[V,B]of q.entries())K=r4(Y,X,Q,{acc:K,index:V,item:B});return K}if(J==="map")return q.map((K,V)=>r4(Y,X,Q,{...W,index:V,item:K}));if(J==="filter")return q.filter((K,V)=>r4(Y,X,Q,{...W,index:V,item:K}))}return}function K4(Z,X){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return U4(Z,X);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return KQ(Z.$ref,X);if(Array.isArray(Z))return Z.map((Q)=>K4(Q,X)).join(", ");return JSON.stringify(Z)}function KQ(Z,X){let Q=X.statePrefix??"state",W=X.eventParam??"event";if(Z==="$reduce/acc")return"_acc";if(Z.startsWith("$reduce/"))return"_acc";if(Z.startsWith("event#/")){let J=Z.slice(7);return`${W}.${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`${Q}.${J.replaceAll("/",".")}`}if(Z.startsWith("parent#/"))return`${Q}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replaceAll("/",".")}`;return`${Q}.${Z}`}function YQ(Z,X){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return KQ(Z.$ref,X);return K4(Z,X)}function U4(Z,X={}){let{operator:Q,target:W,value:J,initial:G}=Z;if(c5.has(Q)&&!("value"in Z)){let Y=K4(W,X);if(Q==="!")return`!(${Y})`;if(Q==="-")return`-(${Y})`}if(p5.has(Q)){let Y=K4(W,X),z=K4(J,X);return`(${Y} ${Q} ${z})`}if($Q.has(Q)){let Y=YQ(W,X),z=K4(J,X);return`${Y} ${Q} ${z}`}if(qQ.has(Q)){let Y=YQ(W,X);switch(Q){case"push":return`${Y}.push(${K4(J,X)})`;case"unshift":return`${Y}.unshift(${K4(J,X)})`;case"pop":return`${Y}.pop()`;case"shift":return`${Y}.shift()`;case"splice":{let z=Array.isArray(J)?J.map((q)=>K4(q,X)).join(", "):K4(J,X);return`${Y}.splice(${z})`}default:break}}if(n5.has(Q)){let Y=K4(W,X),z=U4(J,X);if(Q==="reduce"){let q=K4(G,X);return`${Y}.reduce((_acc, _item, _index) => ${z}, ${q})`}if(Q==="map")return`${Y}.map((_item, _index) => ${z})`;if(Q==="filter")return`${Y}.filter((_item, _index) => ${z})`}return"undefined"}function J1(Z,X){let Q=Z;for(let W of X.split(/[./]/))Q=Q?.[W];return Q}var zQ,c5,p5,$Q,qQ,n5,$B;var o9=c(()=>{zQ=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),c5=new Set(["!","-"]),p5=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||"]),$Q=new Set(["=","+=","-=","*=","/="]),qQ=new Set(["push","pop","shift","unshift","splice"]),n5=new Set(["reduce","map","filter"]),$B=new Set([...zQ,...c5,...p5,...n5])});function W4(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function J4(Z){return W4(Z)&&typeof Z.$ref==="string"}function a4(Z){return W4(Z)&&Z.$prototype==="Function"}function T4(Z){return W4(Z)&&W4(Z.$expression)}function v6(Z){return W4(Z)&&typeof Z.$prototype==="string"&&Z.$prototype!=="Function"}function i5(Z){return W4(Z)&&Z.timing==="server"&&typeof Z.$src==="string"&&typeof Z.$export==="string"&&!Z.$prototype}function UQ(Z){return W4(Z)&&!Z.$prototype&&!Z.$expression&&"default"in Z}function q6(Z){if(!W4(Z))return!1;for(let X of Object.keys(Z))if(!VQ.has(X))return!1;return!0}function x0(Z){return W4(Z)&&Z.$prototype==="Array"}function r5(Z){if(x0(Z))return!0;return Array.isArray(Z)&&Z.some((X)=>x0(X))}function BQ(Z){return W4(Z)&&Z.$prototype==="Class"}function e(Z){return typeof Z==="string"&&Z.includes("${")}function K6(Z){if(!Z)return[];return Z.map((X)=>typeof X==="string"?X:X.name)}var VQ;var k4=c(()=>{VQ=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function HB(Z){if(!UB||!Z.includes("v"))return Z;return Z.replace(VB,(X,Q,W)=>`${Q}${BB[W.toLowerCase()]??`cq${W}`}`)}function FB(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function r0(Z){return Z.replaceAll(/[A-Z]/g,(X)=>`-${X.toLowerCase()}`)}function m0(Z){return Object.entries(Z).filter(([X,Q])=>!FB(X)&&(Q===null||typeof Q!=="object")).map(([X,Q])=>`${r0(X)}: ${HB(String(Q))}`).join("; ")}var UB=!1,VB,BB,U6;var i1=c(()=>{o9();k4();VB=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,BB={b:"cqb",h:"cqh",i:"cqi",max:"cqmax",min:"cqmin",w:"cqw"};U6=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 e9(Z){if(!Z||typeof Z!=="object")return!1;if(Z.state)for(let[X,Q]of Object.entries(Z.state)){if(X==="$site"||X==="$page")continue;if(Q&&typeof Q==="object"&&!Array.isArray(Q)&&Q.timing==="compiler")continue;if(typeof Q!=="object"||Q===null||Array.isArray(Q))return!0;if(Q.$prototype)return!0;if("default"in Q)return!0;if(q6(Q))continue;return!0}if(Z.$switch)return!0;if(x0(Z)||r5(Z.children))return!0;if(Array.isArray(Z.children)&&Z.children.some((X)=>e9(X)))return!0;for(let[X,Q]of Object.entries(Z)){if(U6.has(X))continue;if(Q!==null&&typeof Q==="object"&&typeof Q.$ref==="string")return!0;if(e(Q))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(e(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(e(X))return!0}return!1}function FQ(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(x0(Z)||r5(Z.children))return!0;for(let[X,Q]of Object.entries(Z)){if(U6.has(X))continue;if(Q!==null&&typeof Q==="object"&&typeof Q.$ref==="string")return!0;if(e(Q))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(e(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(e(X))return!0}return!1}function q1(Z,X=null,Q={},W={}){let J=Z?.state?K1(Z.state,X):X??Object.create(null);return{media:W,scope:J,scopeDefs:Q}}function K1(Z={},X=null){let Q=Object.create(X??null);for(let[W,J]of Object.entries(Z)){if(typeof J!=="object"||J===null||Array.isArray(J)){y6(Q,W,t9(J));continue}let G=J;if("default"in G){y6(Q,W,t9(G.default));continue}if(!G.$prototype&&!("$expression"in G)&&!q6(G))y6(Q,W,t9(G))}for(let[W,J]of Object.entries(Z)){if(typeof J==="string"&&e(J)){a5(Q,W,()=>l0(J,Q));continue}if(!J||typeof J!=="object")continue;if(T4(J)){let G=J.$expression;if($6(G.operator))y6(Q,W,(Y,z)=>r4(G,Y,z));else a5(Q,W,()=>r4(G,Q,null));continue}if(a4(J)){if(J.body){let G=J.parameters?K6(J.parameters):J.arguments??[],Y=Function("state",...G,J.body);if(J.body.includes("return"))a5(Q,W,()=>Y(Q));else y6(Q,W,Y)}else y6(Q,W,()=>{});continue}if(v6(J)&&(J.$prototype==="LocalStorage"||J.$prototype==="SessionStorage"))y6(Q,W,t9(J.default??null))}return Q}function y6(Z,X,Q){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,value:Q,writable:!0})}function a5(Z,X,Q){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,get:Q})}function T0(Z,X){if(w4(Z))return o5(Z.$ref,X);if(e(Z))return l0(Z,X);return Z}function w4(Z){return J4(Z)}function o5(Z,X){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let Q=Z.split("/"),W=Q[1],J=X.$map?.[W]??X[`$map/${W}`];return Q.length>2?HQ(J,Q.slice(2).join("/")):J}if(Z.startsWith("#/state/")){let Q=Z.slice(8),W=Q.indexOf("/");if(W===-1)return X[Q];return HQ(X[Q.slice(0,W)],Q.slice(W+1))}return X[Z]??null}function l0(Z,X){try{let Q=Z.match(/^\$\{(.+)\}$/s);if(Q)return Function("state","$map",`return (${Q[1]})`)(X,X?.$map);return Function("state","$map",`return \`${Z}\``)(X,X?.$map)}catch{return null}}function HQ(Z,X){if(!X)return Z;let Q=Z;for(let W of X.split("/"))Q=Q==null?void 0:Q[W];return Q}function t9(Z){if(Z===null||typeof Z!=="object")return Z;return structuredClone(Z)}function Y1(Z,X){let Q="",W=T0(Z.id,X),J=T0(Z.className,X),G=T0(Z.hidden,X),Y=T0(Z.tabIndex,X),z=T0(Z.title,X),q=T0(Z.lang,X),K=T0(Z.dir,X);if(W)Q+=` id="${$0(String(W))}"`;if(J)Q+=` class="${$0(String(J))}"`;if(G)Q+=" hidden";if(Y!==void 0&&Y!==null)Q+=` tabindex="${$0(String(Y))}"`;if(z)Q+=` title="${$0(String(z))}"`;if(q)Q+=` lang="${$0(String(q))}"`;if(K)Q+=` dir="${$0(String(K))}"`;if(Z.style&&X){let V=Object.entries(Z.style).filter(([B,H])=>!B.startsWith(":")&&!B.startsWith(".")&&!B.startsWith("&")&&!B.startsWith("[")&&!B.startsWith("@")&&H!==null&&typeof H!=="object"&&typeof H==="string"&&e(H)).map(([B,H])=>{let F=T0(H,X);return F==null?null:`${r0(B)}: ${F}`}).filter(Boolean).join("; ");if(V)Q+=` style="${V}"`}if(Z.attributes)for(let[V,B]of Object.entries(Z.attributes)){let H=T0(B,X);if(H!==null&&H!==void 0&&(typeof H==="string"||typeof H==="number"||typeof H==="boolean"))Q+=` ${V}="${$0(String(H))}"`}if(Z.tagName==="img"){if(!Z.attributes?.loading)Q+=' loading="lazy"';if(!Z.attributes?.decoding)Q+=' decoding="async"'}if(Z.$static)Q+=" data-jx-static";else if(Z.$prerendered)Q+=" data-jx-prerendered";return Q}function U1(Z,X={},Q=null){let W=[];if(Q&&typeof Q==="object"){let G=(V,B)=>{let H=m0(B);if(H)W.push(`${V} { ${H} }`);for(let[F,A]of Object.entries(B)){if(A===null||typeof A!=="object"||Array.isArray(A))continue;if(F.startsWith("@")){let I=F.startsWith("@--")?`@media ${X[F.slice(1)]??F.slice(1)}`:F,N=m0(A);if(N)W.push(`${I} { ${V} { ${N} } }`);for(let[T,S]of Object.entries(A)){if(S===null||typeof S!=="object"||Array.isArray(S))continue;if(T.startsWith("@"))continue;let v=T.startsWith("&")?T.replace("&",V):T.startsWith(":")||T.startsWith(".")||T.startsWith("[")?`${V}${T}`:`${V} ${T}`,x=m0(S);if(x)W.push(`${I} { ${v} { ${x} } }`)}continue}let M=F.startsWith("&")?F.replace("&",V):F.startsWith(":")||F.startsWith(".")||F.startsWith("[")?`${V}${F}`:`${V} ${F}`;G(M,A)}};for(let[V,B]of Object.entries(Q))if(V.startsWith(":")||V.startsWith(".")||V.startsWith("["))G(V,B);else if(B!==null&&typeof B==="object"&&!Array.isArray(B)&&!V.startsWith("@")&&!V.startsWith("--"))G(V,B);else if(V.startsWith("@")){let H=V.startsWith("@--")?`@media ${X[V.slice(1)]??V.slice(1)}`:V.startsWith("@(")?`@media ${V.slice(1)}`:V;W.push(`${H} { body { ${m0(B)} } }`)}let Y={},z={};for(let[V,B]of Object.entries(Q)){if(V.startsWith(":")||V.startsWith(".")||V.startsWith("[")||V.startsWith("@"))continue;if(B!==null&&typeof B==="object"&&!Array.isArray(B))continue;if(V.startsWith("--"))Y[V]=B;else z[V]=B}let q=m0(Y);if(q)W.push(`:root { ${q} }`);let K=m0(z);if(K)W.push(`body { ${K} }`)}if(V6(Z,W,X,"",{n:0}),W.length===0)return"";return`<style>
|
|
3
|
-
${W.join(`
|
|
2
|
+
import{createRequire as AF}from"node:module";var UF=Object.create;var{getPrototypeOf:KF,defineProperty:iZ,getOwnPropertyNames:VF}=Object;var HF=Object.prototype.hasOwnProperty;function qF(Z){return this[Z]}var BF,FF,J1=(Z,X,Q)=>{var J=Z!=null&&typeof Z==="object";if(J){var W=X?BF??=new WeakMap:FF??=new WeakMap,G=W.get(Z);if(G)return G}Q=Z!=null?UF(KF(Z)):{};let Y=X||!Z||!Z.__esModule?iZ(Q,"default",{value:Z,enumerable:!0}):Q;for(let $ of VF(Z))if(!HF.call(Y,$))iZ(Y,$,{get:qF.bind(Z,$),enumerable:!0});if(J)W.set(Z,Y);return Y};var C=(Z,X)=>()=>(X||Z((X={exports:{}}).exports,X),X.exports);var LF=(Z)=>Z;function MF(Z,X){this[Z]=LF.bind(null,X)}var D1=(Z,X)=>{for(var Q in X)iZ(Z,Q,{get:X[Q],enumerable:!0,configurable:!0,set:MF.bind(X,Q)})};var s=(Z,X)=>()=>(Z&&(X=Z(Z=0)),X);var w0=AF(import.meta.url);function nZ(Z){let X=Z.$map;return X&&typeof X==="object"?X:void 0}function PJ(Z){return Z.startsWith("window#/")&&NF.has(Z.slice(8))}function d1(Z){return OJ.has(Z)}function b0(Z,X){if(!Z)return;let Q=(Z.depth??0)+1;if(Q>TF)return;return{depth:Q,path:[...Z.path??[],...Array.isArray(X)?X:[X]],report:Z.report}}function S0(Z,X,Q,J,W){if(Z===null||Z===void 0)return Z;if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return E6(Z,X,Q,J,W);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z){let G=CJ(Z.$ref,X,Q,J);return W?.report(W.path??[],G),G}if(Array.isArray(Z))return Z.map((G,Y)=>S0(G,X,Q,J,b0(W,Y)));return W?.report(W.path??[],Z),Z}function CJ(Z,X,Q,J){if(Z==="$reduce/acc")return J?.acc;if(Z.startsWith("$reduce/"))return J?.acc;if(Z.startsWith("$args/")){let W=Z.slice(6).split("/"),G=J?.args?.[W[0]];return W.length>1?T1(G,W.slice(1).join("/")):G}if(Z.startsWith("event#/")){let W=Z.slice(7);return T1(Q,W)}if(Z.startsWith("$map/")){let W=Z.split("/"),[,G]=W,Y,$=nZ(X);if(G==="item")Y=J?.item??$?.item??X["$map/item"];else if(G==="index")Y=J?.index??$?.index??X["$map/index"];else Y=$?.[G]??X[`$map/${G}`];return W.length>2?T1(Y,W.slice(2).join("/")):Y}if(Z.startsWith("#/state/")){let W=Z.slice(8),G=W.indexOf("/");if(G===-1)return X[W];return T1(X[W.slice(0,G)],W.slice(G+1))}if(Z.startsWith("parent#/"))return X[Z.slice(8)];if(Z.startsWith("window#/"))return T1(globalThis.window,Z.slice(8));if(Z.startsWith("document#/"))return T1(globalThis.document,Z.slice(10));return X[Z]??null}function wF(Z,X,Q,J){if(Z.startsWith("$map/")){let W=Z.split("/"),[,G]=W,Y,$=nZ(X);if(G==="item")Y=J?.item??$?.item??X["$map/item"];else if(G==="index")Y=J?.index??$?.index??X["$map/index"];else Y=$?.[G]??X[`$map/${G}`];if(W.length>2){let z=W.slice(2),U=z.pop(),V=z.length>0?T1(Y,z.join("/")):Y;return{key:U,obj:V}}return{key:G==="item"?"$map/item":"$map/index",obj:nZ(X)??X}}if(Z.startsWith("#/state/")){let W=Z.slice(8);if(W.indexOf("/")===-1)return{key:W,obj:X};let Y=W.split("/"),$=Y.pop(),z=X;for(let U of Y)z=z[U];return{key:$,obj:z}}return{key:Z,obj:X}}function E6(Z,X,Q,J,W){let G=jF(Z,X,Q,J,W);return W?.report(W.path??[],G),G}function jF(Z,X,Q,J,W){let{operator:G,target:Y,value:$,initial:z}=Z;if(!IF.has(G))throw Error(`$expression: unknown operator "${G}"`);if(rZ.has(G)&&!("value"in Z)){let U=S0(Y,X,Q,J,b0(W,"target"));if(G==="!")return!U;if(G==="-")return-U}if(G==="call"){let U=Y?.$ref;if(typeof U!=="string")throw TypeError("$expression: call target must be a $ref pointer");let V=(J?.callDepth??0)+1;if(V>wJ)throw Error(`$expression: call depth exceeded (${wJ})`);let q=Array.isArray($)?$.map((F,L)=>S0(F,X,Q,J,b0(W,["value",L]))):[];if(U.startsWith("window#/")){if(!PJ(U))throw Error(`$expression: "${U}" is not a blessed pure global`);let F=U.slice(8),L=DF[F];if(L)return L(...q);let I=T1(globalThis.window,F),A=F.lastIndexOf("/"),N=A===-1?globalThis.window:T1(globalThis.window,F.slice(0,A));return I.apply(N,q)}let B=CJ(U,X,Q,J);if(typeof B==="function")return B(...q);if(B&&typeof B==="object"&&"$expression"in B){let F=B,L={};for(let[I,A]of(F.parameters??[]).entries()){let N=typeof A==="string"?A:A?.name??"";if(!N)continue;L[N]=q[I]===void 0&&typeof A==="object"&&A!==null&&"default"in A?A.default:q[I]}return E6(F.$expression,X,Q,{args:L,callDepth:V})}throw TypeError(`$expression: call target "${U}" is not callable`)}if(sZ.has(G)){if(G==="?:"){let F=S0(Y,X,Q,J,b0(W,"target"));if(W){let L=S0($,X,Q,J,b0(W,"value")),I=S0(z,X,Q,J,b0(W,"initial"));return F?L:I}return F?S0($,X,Q,J):S0(z,X,Q,J)}let U=S0(Y,X,Q,J,b0(W,"target")),V=String(U),q=Z.cases??{},B=Object.hasOwn(q,V);if(W){let F;for(let[I,A]of Object.entries(q)){let N=S0(A,X,Q,J,b0(W,["cases",I]));if(I===V)F=N}let L=S0(Z.default,X,Q,J,b0(W,"default"));return B?F:L}return B?S0(q[V],X,Q,J):S0(Z.default,X,Q,J)}if(aZ.has(G)){let U=S0(Y,X,Q,J,b0(W,"target")),V=S0($,X,Q,J,b0(W,"value"));switch(G){case"+":return U+V;case"-":return U-V;case"*":return U*V;case"/":return U/V;case"%":return U%V;case"===":return U===V;case"!==":return U!==V;case"<":return U<V;case"<=":return U<=V;case">":return U>V;case">=":return U>=V;case"&&":return U&&V;case"||":return U||V;case"??":return U??V;default:break}}if(EJ.has(G)){let U=S0($,X,Q,J,b0(W,"value")),{obj:V,key:q}=wF(Y.$ref,X,Q,J);switch(G){case"=":{V[q]=U;break}case"+=":{let B=V[q];V[q]=B+U;break}case"-=":{let B=V[q];V[q]=B-U;break}case"*=":{let B=V[q];V[q]=B*U;break}case"/=":{let B=V[q];V[q]=B/U;break}default:break}return}if(RJ.has(G)){let U=S0(Y,X,Q,J,b0(W,"target"));switch(G){case"push":return U.push(S0($,X,Q,J,b0(W,"value")));case"unshift":return U.unshift(S0($,X,Q,J,b0(W,"value")));case"pop":return U.pop();case"shift":return U.shift();case"splice":{let V=S0($,X,Q,J,b0(W,"value"));return U.splice(...V)}default:break}}if(tZ.has(G)){let U=S0(Y,X,Q,J,b0(W,"target")),V=$===void 0?[]:Array.isArray($)?S0($,X,Q,J,b0(W,"value")):[S0($,X,Q,J,b0(W,"value"))],q=U?.[G];if(typeof q!=="function")return;return q.apply(U,V)}if(oZ.has(G)){let U=S0(Y,X,Q,J,b0(W,"target"));if(G==="reduce"){let V=S0(z,X,Q,J,b0(W,"initial"));for(let[q,B]of U.entries())V=E6($,X,Q,{acc:V,index:q,item:B},q===0?b0(W,"value"):void 0);return V}if(G==="map")return U.map((V,q)=>E6($,X,Q,{...J,index:q,item:V},q===0?b0(W,"value"):void 0));if(G==="filter")return U.filter((V,q)=>E6($,X,Q,{...J,index:q,item:V},q===0?b0(W,"value"):void 0))}return}function y0(Z,X){if(Z===null)return"null";if(Z===void 0)return"undefined";if(typeof Z==="object"&&!Array.isArray(Z)&&"operator"in Z)return $6(Z,X);if(typeof Z==="object"&&!Array.isArray(Z)&&"$ref"in Z)return eZ(Z.$ref,X);if(Array.isArray(Z))return Z.map((Q)=>y0(Q,X)).join(", ");return JSON.stringify(Z)}function OF(Z){return`_fx_${Z.replaceAll(/[^A-Za-z0-9_$]/g,"_")}`}function eZ(Z,X){let Q=X.statePrefix??"state",J=X.eventParam??"event";if(Z==="$reduce/acc")return"_acc";if(Z.startsWith("$reduce/"))return"_acc";if(Z.startsWith("$args/"))return`_args${Z.slice(6).split("/").map((G)=>`[${JSON.stringify(G)}]`).join("")}`;if(Z.startsWith("event#/")){let W=Z.slice(7);return`${J}.${W.replaceAll("/",".")}`}if(Z.startsWith("$map/")){let W=Z.split("/"),[,G]=W;if(G==="item")return W.length>2?`_item.${W.slice(2).join(".")}`:"_item";if(G==="index")return"_index";return`_${G}`}if(Z.startsWith("#/state/")){let W=Z.slice(8);return`${Q}.${W.replaceAll("/",".")}`}if(Z.startsWith("parent#/"))return`${Q}.${Z.slice(8)}`;if(Z.startsWith("window#/"))return`window.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("document#/"))return`document.${Z.slice(10).replaceAll("/",".")}`;return`${Q}.${Z}`}function jJ(Z,X){if(typeof Z==="object"&&Z!==null&&"$ref"in Z)return eZ(Z.$ref,X);return y0(Z,X)}function EF(Z,X){let Q=(J)=>X[J]??"undefined";switch(Z){case"Intl/formatNumber":return`new Intl.NumberFormat(${Q(1)}, ${Q(2)}).format(${Q(0)})`;case"Intl/formatDate":return`new Intl.DateTimeFormat(${Q(1)}, ${Q(2)}).format(new Date(${Q(0)}))`;case"Intl/formatRelativeTime":return`new Intl.RelativeTimeFormat(${Q(2)}, ${Q(3)}).format(${Q(0)}, ${Q(1)})`;default:return null}}function $6(Z,X={}){let{operator:Q,target:J,value:W,initial:G}=Z;if(rZ.has(Q)&&!("value"in Z)){let Y=y0(J,X);if(Q==="!")return`!(${Y})`;if(Q==="-")return`-(${Y})`}if(Q==="call"){let Y=J?.$ref??"",$=Array.isArray(W)?W.map((z)=>y0(z,X)):[];if(Y.startsWith("window#/")){if(!PJ(Y))throw Error(`$expression: "${Y}" is not a blessed pure global`);let z=EF(Y.slice(8),$);if(z)return z;return`window.${Y.slice(8).replaceAll("/",".")}(${$.join(", ")})`}if(Y.startsWith("#/state/")){let z=Y.slice(8),U=X.formulaParams?.[z];if(U){let V=U.map((q,B)=>`${JSON.stringify(q)}: ${$[B]??"undefined"}`).join(", ");return`${OF(z)}(${X.statePrefix??"state"}, { ${V} })`}}return`${eZ(Y,X)}(${$.join(", ")})`}if(sZ.has(Q)){if(Q==="?:"){let U=y0(J,X),V=y0(W,X),q=y0(G,X);return`(${U} ? ${V} : ${q})`}let Y=y0(J,X),$=Object.entries(Z.cases??{}).map(([U,V])=>`_d === ${JSON.stringify(U)} ? ${y0(V,X)} : `).join(""),z="default"in Z?y0(Z.default,X):"undefined";return`((_d) => ${$}${z})(String(${Y}))`}if(aZ.has(Q)){let Y=y0(J,X),$=y0(W,X);return`(${Y} ${Q} ${$})`}if(EJ.has(Q)){let Y=jJ(J,X),$=y0(W,X);return`${Y} ${Q} ${$}`}if(RJ.has(Q)){let Y=jJ(J,X);switch(Q){case"push":return`${Y}.push(${y0(W,X)})`;case"unshift":return`${Y}.unshift(${y0(W,X)})`;case"pop":return`${Y}.pop()`;case"shift":return`${Y}.shift()`;case"splice":{let $=Array.isArray(W)?W.map((z)=>y0(z,X)).join(", "):y0(W,X);return`${Y}.splice(${$})`}default:break}}if(tZ.has(Q)){let Y=y0(J,X),$=W===void 0?"":Array.isArray(W)?W.map((z)=>y0(z,X)).join(", "):y0(W,X);return`(${Y})?.${Q}?.(${$})`}if(oZ.has(Q)){let Y=y0(J,X),$=$6(W,X);if(Q==="reduce"){let z=y0(G,X);return`${Y}.reduce((_acc, _item, _index) => ${$}, ${z})`}if(Q==="map")return`${Y}.map((_item, _index) => ${$})`;if(Q==="filter")return`${Y}.filter((_item, _index) => ${$})`}return"undefined"}function T1(Z,X){let Q=Z;for(let J of X.split(/[./]/))Q=Q?.[J];return Q}function u8(Z,X,Q,J){return S0(Z,X,Q,J)}function m8(Z,X={}){return y0(Z,X)}var OJ,rZ,aZ,EJ,RJ,oZ,sZ,tZ,IF,NF,DF,wJ=64,TF=64;var k9=s(()=>{OJ=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),rZ=new Set(["!","-"]),aZ=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),EJ=new Set(["=","+=","-=","*=","/="]),RJ=new Set(["push","pop","shift","unshift","splice"]),oZ=new Set(["reduce","map","filter"]),sZ=new Set(["?:","switch"]),tZ=new Set(["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]),IF=new Set([...OJ,...rZ,...aZ,...oZ,...sZ,...tZ,"call"]),NF=new Set(["isNaN","isFinite","parseFloat","parseInt","encodeURIComponent","decodeURIComponent","structuredClone","Math/abs","Math/ceil","Math/floor","Math/round","Math/trunc","Math/sign","Math/sqrt","Math/cbrt","Math/pow","Math/exp","Math/log","Math/log2","Math/log10","Math/min","Math/max","Math/hypot","Number/isInteger","Number/isFinite","Number/isNaN","Number/parseFloat","Number/parseInt","JSON/parse","JSON/stringify","Object/keys","Object/values","Object/entries","Object/fromEntries","Array/from","Array/isArray","Array/of","String/fromCharCode","String/fromCodePoint","Intl/formatNumber","Intl/formatDate","Intl/formatRelativeTime"]),DF={"Intl/formatDate":(Z,X,Q)=>new Intl.DateTimeFormat(X,Q).format(new Date(Z)),"Intl/formatNumber":(Z,X,Q)=>new Intl.NumberFormat(X,Q).format(Z),"Intl/formatRelativeTime":(Z,X,Q,J)=>new Intl.RelativeTimeFormat(Q,J).format(Z,X)}});function R6(Z){return typeof Z==="object"&&Z!==null&&!Array.isArray(Z)}function P6(Z){return R6(Z)&&typeof Z.$ref==="string"}function W1(Z){return R6(Z)&&Z.$prototype==="Function"}function b6(Z){return R6(Z)&&R6(Z.$expression)}function B4(Z){return b6(Z)&&Array.isArray(Z.parameters)&&Z.parameters.length>0}function G1(Z){return W1(Z)&&Array.isArray(Z.body)}function F4(Z){return R6(Z)&&typeof Z.$prototype==="string"&&Z.$prototype!=="Function"}function Z7(Z){return R6(Z)&&Z.timing==="server"&&typeof Z.$src==="string"&&typeof Z.$export==="string"&&!Z.$prototype}function SJ(Z){return R6(Z)&&!Z.$prototype&&!Z.$expression&&"default"in Z}function l1(Z){if(!R6(Z))return!1;for(let X of Object.keys(Z))if(!_J.has(X))return!1;return!0}function Z6(Z){return R6(Z)&&Z.$prototype==="Array"}function X7(Z){if(Z6(Z))return!0;return Array.isArray(Z)&&Z.some((X)=>Z6(X))}function kJ(Z){return R6(Z)&&Z.$prototype==="Class"}function F0(Z){return typeof Z==="string"&&Z.includes("${")}function c1(Z){if(!Z)return[];return Z.map((X)=>typeof X==="string"?X:X.name)}var _J;var Y1=s(()=>{_J=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function xJ(Z){if("operator"in Z)return"expression";if("if"in Z)return"if";if("$switch"in Z)return"switch";return"dispatch"}async function m4(Z,X,Q,J={}){let W=J.args?{args:J.args}:void 0;for(let G of Z)switch(xJ(G)){case"expression":{let Y=E6(G,X,Q,W);if(Y&&typeof Y.then==="function")await Y;break}case"if":{let Y=G,$=u8(Y.if,X,Q,W)?Y.then:Y.else;if(Array.isArray($))await m4($,X,Q,J);break}case"switch":{let Y=G,$=String(u8(Y.$switch,X,Q,W)),z=Y.cases??{},U=Object.hasOwn(z,$)?z[$]:Y.default;if(Array.isArray(U))await m4(U,X,Q,J);break}case"dispatch":{let Y=G,$=J.target??Q?.currentTarget;if(!$)break;let z={};if("detail"in Y)z.detail=u8(Y.detail,X,Q,W);if(Y.bubbles!==void 0)z.bubbles=Y.bubbles;if(Y.composed!==void 0)z.composed=Y.composed;$.dispatchEvent(new CustomEvent(Y.dispatchEvent,z));break}default:break}}function v6(Z,X={}){let Q=X.indent??"",J=[];for(let W of Z)switch(xJ(W)){case"expression":{J.push(`${Q}${$6(W,X)};`);break}case"if":{let G=W,Y=m8(G.if,X),$={...X,indent:`${Q} `};if(J.push(`${Q}if (${Y}) {`,v6(G.then??[],$)),G.else)J.push(`${Q}} else {`,v6(G.else,$));J.push(`${Q}}`);break}case"switch":{let G=W,Y=m8(G.$switch,X),$={...X,indent:`${Q} `};J.push(`${Q}switch (String(${Y})) {`);for(let[z,U]of Object.entries(G.cases??{}))J.push(`${Q} case ${JSON.stringify(z)}: {`,v6(U,$),`${Q} break;`,`${Q} }`);if(G.default)J.push(`${Q} default: {`,v6(G.default,$),`${Q} }`);J.push(`${Q}}`);break}case"dispatch":{let G=W,Y=X.eventParam??"event",$=X.dispatchTarget??`(${Y} && ${Y}.currentTarget)`,z=[];if("detail"in G)z.push(`detail: ${m8(G.detail,X)}`);if(G.bubbles!==void 0)z.push(`bubbles: ${JSON.stringify(G.bubbles)}`);if(G.composed!==void 0)z.push(`composed: ${JSON.stringify(G.composed)}`);let U=z.length>0?`, { ${z.join(", ")} }`:"";J.push(`${Q}${$}?.dispatchEvent(new CustomEvent(${JSON.stringify(G.dispatchEvent)}${U}));`);break}default:break}return J.join(`
|
|
3
|
+
`)}var d8=s(()=>{k9()});function SF(Z){if(!RF||!Z.includes("v"))return Z;return Z.replace(PF,(X,Q,J)=>`${Q}${CF[J.toLowerCase()]??`cq${J}`}`)}function _F(Z){return Z.startsWith(":")||Z.startsWith(".")||Z.startsWith("&")||Z.startsWith("[")}function L6(Z){return Z.replaceAll(/[A-Z]/g,(X)=>`-${X.toLowerCase()}`)}function y6(Z){return Object.entries(Z).filter(([X,Q])=>!_F(X)&&(Q===null||typeof Q!=="object")).map(([X,Q])=>`${L6(X)}: ${SF(String(Q))}`).join("; ")}function $1(Z){return/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(Z.trim())?.[1]??null}function J7(Z,X){if(Z===":root"||Z==="html")return{auto:`${Z}:where(:not([${w1}]))`,forced:`${Z}:where([${w1}="${X}"])`};return{auto:`:where(:root:not([${w1}])) ${Z}`,forced:`:where(:root[${w1}="${X}"]) ${Z}`}}var RF=!1,PF,CF,p1,w1="data-color-scheme",Q7="jx-color-scheme";var x9=s(()=>{k9();Y1();d8();PF=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,CF={b:"cqb",h:"cqh",i:"cqi",max:"cqmax",min:"cqmin",w:"cqw"};p1=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 b9(Z,X){let Q=[];for(let[J,W]of(Z.parameters??[]).entries()){let G=typeof W==="string"?W:W?.name??"";if(!G)continue;let $=typeof W==="object"&&W!==null&&"default"in W?`_a[${J}] === undefined ? ${JSON.stringify(W.default)} : _a[${J}]`:`_a[${J}]`;Q.push(`${JSON.stringify(G)}: ${$}`)}return`(..._a) => { const _args = { ${Q.join(", ")} }; return ${X}; }`}function c8(Z){if(!Z||typeof Z!=="object")return!1;if(Z.state)for(let[X,Q]of Object.entries(Z.state)){if(X==="$site"||X==="$page")continue;if(Q&&typeof Q==="object"&&!Array.isArray(Q)&&Q.timing==="compiler")continue;if(typeof Q!=="object"||Q===null||Array.isArray(Q))return!0;if(Q.$prototype)return!0;if("default"in Q)return!0;if(l1(Q))continue;return!0}if(Z.$switch)return!0;if(Z6(Z)||X7(Z.children))return!0;if(Array.isArray(Z.children)&&Z.children.some((X)=>c8(X)))return!0;for(let[X,Q]of Object.entries(Z)){if(p1.has(X))continue;if(Q!==null&&typeof Q==="object"&&typeof Q.$ref==="string")return!0;if(F0(Q))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(F0(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(F0(X))return!0}return!1}function vJ(Z){if(!Z||typeof Z!=="object")return!1;if(Z.$switch)return!0;if(Z6(Z)||X7(Z.children))return!0;for(let[X,Q]of Object.entries(Z)){if(p1.has(X))continue;if(Q!==null&&typeof Q==="object"&&typeof Q.$ref==="string")return!0;if(F0(Q))return!0}if(Z.style&&typeof Z.style==="object"){for(let X of Object.values(Z.style))if(F0(X))return!0}if(Z.attributes&&typeof Z.attributes==="object"){for(let X of Object.values(Z.attributes))if(F0(X))return!0}return!1}function i4(Z,X=null,Q={},J={}){let W=Z?.state?n4(Z.state,X):X??Object.create(null);return{media:J,scope:W,scopeDefs:Q}}function n4(Z={},X=null){let Q=Object.create(X??null);for(let[J,W]of Object.entries(Z)){if(typeof W!=="object"||W===null||Array.isArray(W)){j1(Q,J,l8(W));continue}let G=W;if("default"in G){j1(Q,J,l8(G.default));continue}if(!G.$prototype&&!("$expression"in G)&&!l1(G))j1(Q,J,l8(G))}for(let[J,W]of Object.entries(Z)){if(typeof W==="string"&&F0(W)){W7(Q,J,()=>z6(W,Q));continue}if(!W||typeof W!=="object")continue;if(b6(W)){let G=W.$expression;if(B4(W)){let Y=W.parameters;j1(Q,J,(...$)=>{let z={};for(let[U,V]of Y.entries()){let q=typeof V==="string"?V:V?.name??"";if(!q)continue;z[q]=$[U]===void 0&&typeof V==="object"&&V!==null&&"default"in V?V.default:$[U]}return E6(G,Q,null,{args:z})})}else if(d1(G.operator))j1(Q,J,(Y,$)=>E6(G,Y,$));else W7(Q,J,()=>E6(G,Q,null));continue}if(W1(W)){if(G1(W)){let{body:G}=W;j1(Q,J,(Y,$)=>{m4(G,Y??Q,$??null)})}else if(typeof W.body==="string"){let G=W.parameters?c1(W.parameters):W.arguments??[],{body:Y}=W,$=Function("state",...G,Y);if(Y.includes("return"))W7(Q,J,()=>$(Q));else j1(Q,J,$)}else j1(Q,J,()=>{});continue}if(F4(W)&&(W.$prototype==="LocalStorage"||W.$prototype==="SessionStorage"))j1(Q,J,l8(W.default??null))}return Q}function j1(Z,X,Q){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,value:Q,writable:!0})}function W7(Z,X,Q){Object.defineProperty(Z,X,{configurable:!0,enumerable:!0,get:Q})}function h0(Z,X){if(n6(Z))return Y7(Z.$ref,X);if(F0(Z))return z6(Z,X);return Z}function n6(Z){return P6(Z)}function Y7(Z,X){if(typeof Z!=="string")return Z;if(Z.startsWith("$map/")){let Q=Z.split("/"),J=Q[1],W=X.$map?.[J]??X[`$map/${J}`];return Q.length>2?bJ(W,Q.slice(2).join("/")):W}if(Z.startsWith("#/state/")){let Q=Z.slice(8),J=Q.indexOf("/");if(J===-1)return X[Q];return bJ(X[Q.slice(0,J)],Q.slice(J+1))}return X[Z]??null}function z6(Z,X){try{let Q=Z.match(/^\$\{(.+)\}$/s);if(Q)return Function("state","$map",`return (${Q[1]})`)(X,X?.$map);return Function("state","$map",`return \`${Z}\``)(X,X?.$map)}catch{return null}}function bJ(Z,X){if(!X)return Z;let Q=Z;for(let J of X.split("/"))Q=Q==null?void 0:Q[J];return Q}function l8(Z){if(Z===null||typeof Z!=="object")return Z;return structuredClone(Z)}function l4(Z,X){let Q="",J=h0(Z.id,X),W=h0(Z.className,X),G=h0(Z.hidden,X),Y=h0(Z.tabIndex,X),$=h0(Z.title,X),z=h0(Z.lang,X),U=h0(Z.dir,X);if(J)Q+=` id="${O0(String(J))}"`;if(W)Q+=` class="${O0(String(W))}"`;if(G)Q+=" hidden";if(Y!==void 0&&Y!==null)Q+=` tabindex="${O0(String(Y))}"`;if($)Q+=` title="${O0(String($))}"`;if(z)Q+=` lang="${O0(String(z))}"`;if(U)Q+=` dir="${O0(String(U))}"`;if(Z.style&&X){let V=Object.entries(Z.style).filter(([q,B])=>!q.startsWith(":")&&!q.startsWith(".")&&!q.startsWith("&")&&!q.startsWith("[")&&!q.startsWith("@")&&B!==null&&typeof B!=="object"&&typeof B==="string"&&F0(B)).map(([q,B])=>{let F=h0(B,X);return F==null?null:`${L6(q)}: ${F}`}).filter(Boolean).join("; ");if(V)Q+=` style="${V}"`}if(Z.attributes)for(let[V,q]of Object.entries(Z.attributes)){let B=h0(q,X);if(B!==null&&B!==void 0&&(typeof B==="string"||typeof B==="number"||typeof B==="boolean"))Q+=` ${V}="${O0(String(B))}"`}if(Z.tagName==="img"){if(!Z.attributes?.loading)Q+=' loading="lazy"';if(!Z.attributes?.decoding)Q+=' decoding="async"'}if(Z.$static)Q+=" data-jx-static";else if(Z.$prerendered)Q+=" data-jx-prerendered";return Q}function r4(){let Z=JSON.stringify(Q7),X=JSON.stringify(w1);return`(function(){try{var s=localStorage.getItem(${Z});if(s==="light"||s==="dark"){document.documentElement.setAttribute(${X},s)}}catch(e){}})()`}function yJ(Z,X,Q){let J=Z.startsWith("@--")?X[Z.slice(1)]??Z.slice(1):Z.startsWith("@(")?Z.slice(1):null,W=J===null?Z:`@media ${J}`,G=J===null?null:$1(J);return(Y,$)=>{if(!$)return;if(G){let{auto:z,forced:U}=J7(Y,G);Q.push(`${W} { ${z} { ${$} } }`,`${U} { ${$} }`)}else Q.push(`${W} { ${Y} { ${$} } }`)}}function p8(Z,X,Q,J,W){if(W===null||typeof W!=="object"||Array.isArray(W))return;let G=yJ(X,Q,Z);G(J,y6(W));for(let[Y,$]of Object.entries(W)){if($===null||typeof $!=="object"||Array.isArray($))continue;if(Y.startsWith("@"))continue;let z=Y.startsWith("&")?Y.replace("&",J):Y.startsWith(":")||Y.startsWith(".")||Y.startsWith("[")?`${J}${Y}`:`${J} ${Y}`;G(z,y6($))}}function a4(Z,X={},Q=null){let J=[];if(Q&&typeof Q==="object"){let G=(V,q)=>{let B=y6(q);if(B)J.push(`${V} { ${B} }`);for(let[F,L]of Object.entries(q)){if(L===null||typeof L!=="object"||Array.isArray(L))continue;if(F.startsWith("@")){p8(J,F,X,V,L);continue}let I=F.startsWith("&")?F.replace("&",V):F.startsWith(":")||F.startsWith(".")||F.startsWith("[")?`${V}${F}`:`${V} ${F}`;G(I,L)}},Y={},$={};for(let[V,q]of Object.entries(Q)){if(V.startsWith(":")||V.startsWith(".")||V.startsWith("[")||V.startsWith("@"))continue;if(q!==null&&typeof q==="object"&&!Array.isArray(q))continue;if(V.startsWith("--"))Y[V]=q;else $[V]=q}let z=y6(Y);if(z)J.push(`:root { ${z} }`);let U=y6($);if(U)J.push(`body { ${U} }`);for(let[V,q]of Object.entries(Q))if(V.startsWith(":")||V.startsWith(".")||V.startsWith("["))G(V,q);else if(q!==null&&typeof q==="object"&&!Array.isArray(q)&&!V.startsWith("@")&&!V.startsWith("--"))G(V,q);else if(V.startsWith("@")&&q!==null&&typeof q==="object"&&!Array.isArray(q)){let B=yJ(V,X,J),F={},L={},I=[];for(let[A,N]of Object.entries(q)){if(N!==null&&typeof N==="object"&&!Array.isArray(N)){if(!A.startsWith("@"))I.push([A,N]);continue}if(A.startsWith("--"))F[A]=N;else L[A]=N}B(":root",y6(F)),B("body",y6(L));for(let[A,N]of I)B(A,y6(N))}}if(Object.values(X).some((G)=>$1(G)!==null)&&!(Q&&typeof Q==="object"&&("colorScheme"in Q)))J.push(":root { color-scheme: light dark }",`:root:where([${w1}="light"]) { color-scheme: light }`,`:root:where([${w1}="dark"]) { color-scheme: dark }`);if(i1(Z,J,X,"",{n:0}),J.length===0)return"";return`<style>
|
|
4
|
+
${J.join(`
|
|
4
5
|
`)}
|
|
5
|
-
</style>`}function
|
|
6
|
-
${
|
|
6
|
+
</style>`}function gJ(Z,X,Q,J){let W=y6(X);if(W)Q.push(`${Z} { ${W} }`);for(let[G,Y]of Object.entries(X)){if(Y===null||typeof Y!=="object"||Array.isArray(Y))continue;if(G.startsWith("@")){p8(Q,G,J,Z,Y);continue}let $=G.startsWith("&")?G.replace("&",Z):G.startsWith(":")||G.startsWith(".")||G.startsWith("[")?`${Z}${G}`:`${Z} ${G}`;gJ($,Y,Q,J)}}function i1(Z,X,Q,J="",W,G="jx"){let Y=W??{n:0};if(!Z||typeof Z!=="object")return;if(Z.style&&!Z.id&&!Z.className)Z.className=`${G}-${Y.n}`,Y.n+=1;let $=Z.id?`#${Z.id}`:Z.className?`.${Z.className.split(" ")[0]}`:Z.tagName??"*";if(Z.style){let z=[];for(let[U,V]of Object.entries(Z.style)){if(U.startsWith(":")||U.startsWith(".")||U.startsWith("&")||U.startsWith("[")||U.startsWith("@"))continue;if(V===null||typeof V==="object")continue;if(typeof V==="string"&&F0(V))continue;z.push(` ${L6(U)}: ${V};`)}if(z.length>0)X.push(`${$} {
|
|
7
|
+
${z.join(`
|
|
7
8
|
`)}
|
|
8
|
-
}`);for(let[
|
|
9
|
-
`);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";if(Z.$switch){let Y=Z.tagName??"div"
|
|
10
|
-
`);return`<${
|
|
11
|
-
`)}function
|
|
9
|
+
}`);for(let[U,V]of Object.entries(Z.style)){if(V===null||typeof V!=="object"||Array.isArray(V))continue;if(U.startsWith("@"))p8(X,U,Q,$,V);else{let q=U.startsWith("&")?U.replace("&",$):U.startsWith(":")||U.startsWith(".")||U.startsWith("[")?`${$}${U}`:`${$} ${U}`;gJ(q,V,X,Q)}}}if(Array.isArray(Z.children))for(let z of Z.children)i1(z,X,Q,$,Y,G);if(Z.cases&&typeof Z.cases==="object")for(let z of Object.values(Z.cases))i1(z,X,Q,$,Y,G)}function O0(Z){return String(Z).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function i8(Z){return Z.split("-").map((X)=>X.charAt(0).toUpperCase()+X.slice(1)).join("")}function n8(Z){let X=new Map;return fJ(Z,X),[...X.values()]}function fJ(Z,X){if(!Z||typeof Z!=="object")return;if(Z.state){for(let[Q,J]of Object.entries(Z.state))if(Z7(J))X.set(J.$export,{exportName:J.$export,key:Q,src:J.$src})}if(Array.isArray(Z.children))for(let Q of Z.children)fJ(Q,X)}function d4(Z,X,Q=null){if(typeof Z==="string"){if(F0(Z)&&X){let Y=z6(Z,X);return Y!=null?O0(String(Y)):O0(Z)}return O0(Z)}if(typeof Z==="number"||typeof Z==="boolean")return O0(String(Z));if(Array.isArray(Z))return Z.map((Y)=>d4(Y,X,Q)).join(`
|
|
10
|
+
`);if(!Z||typeof Z!=="object")return"";if(Z.$prototype==="Array")return"";if(Z.$switch){let Y=Z.tagName??"div",$=l4(Z,X),z=h0(Z.$switch,X),U=z==null?void 0:Z.cases?.[String(z)],V=U!==void 0&&!n6(U)?d4(U,X,Q):"";return`<${Y}${$}>${V}</${Y}>`}let J=Z.tagName??"div";if(J==="slot"&&Q!=null)return Q;let W=l4(Z,X);if($7.has(J))return`<${J}${W}>`;let G="";if(Z.textContent!==void 0){let Y=h0(Z.textContent,X);G=Y!=null?O0(String(Y)):""}else if(Z.innerHTML){let Y=h0(Z.innerHTML,X);G=Y!=null?String(Y):Z.innerHTML}else if(Array.isArray(Z.children))G=Z.children.map((Y)=>d4(Y,X,Q)).join(`
|
|
11
|
+
`);return`<${J}${W}>${G}</${J}>`}function hJ(Z,X=null,Q=null){let J=Z.state??{};if(X){J={...J};for(let[G,Y]of Object.entries(X))if(G in J){let $=J[G];J[G]=$&&typeof $==="object"&&!Array.isArray($)&&"default"in $?{...$,default:Y}:Y}else J[G]=Y}let W=n4(J,null);if(!Array.isArray(Z.children))return"";return Z.children.map((G)=>d4(G,W,Q)).join(`
|
|
12
|
+
`)}function z7(Z){return G7(Z)}function G7(Z){if(!Z||typeof Z!=="object")return!0;if(Array.isArray(Z))return Z.every((X)=>G7(X));if(Z.$prototype)return!1;if(Z.$ref)return!1;if(Z.state)for(let X of Object.values(Z.state)){if(!X||typeof X!=="object")continue;let Q=X;if(Q.$prototype)return!1;if(Q.$ref)return!1}for(let X of Object.keys(Z))if(X.startsWith("on")&&X!=="observedAttributes")return!1;if(Array.isArray(Z.children))return Z.children.every((X)=>G7(X));if(Z.children&&typeof Z.children==="object"&&Z.children.$prototype)return!1;return!0}function uJ(Z,X,Q=null,J={}){let W=[];if(X&&typeof X==="object"){let G=[];for(let[Y,$]of Object.entries(X)){if(Y.startsWith(":")||Y.startsWith(".")||Y.startsWith("&")||Y.startsWith("[")||Y.startsWith("@"))continue;if($===null||typeof $==="object")continue;if(typeof $==="string"&&F0($))continue;G.push(` ${L6(Y)}: ${$};`)}if(G.length>0)W.push(`${Z} {
|
|
12
13
|
${G.join(`
|
|
13
14
|
`)}
|
|
14
|
-
}`);for(let[Y
|
|
15
|
+
}`);for(let[Y,$]of Object.entries(X))if(Y.startsWith("@"))p8(W,Y,J,Z,$);else if(Y.startsWith(":")||Y.startsWith(".")||Y.startsWith("&")||Y.startsWith("[")){let z=Y.startsWith("&")?Y.replace("&",Z):`${Z}${Y}`;W.push(`${z} { ${y6($)} }`)}}if(Q&&Array.isArray(Q.children)){let G={n:0};for(let Y of Q.children)i1(Y,W,J,"",G,Z)}return W.length>0?`${W.join(`
|
|
15
16
|
`)}
|
|
16
|
-
`:""}var z1="https://esm.sh/@vue/reactivity@3.5.32",$1="https://esm.sh/lit-html@3.3.0",t5;var B6=c(()=>{i1();o9();k4();i1();o9();k4();t5=new Set(["input","br","hr","img","meta","link","area","col","source"])});function s4(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var LB,r1=()=>LB;var NQ=c(()=>{LB=/^win/.test(globalThis.process?globalThis.process.platform:"")});function w0(Z,X){let Q=new URL(s4(Z),"https://aaa.nonexistanturl.com"),W=new URL(s4(X),Q),J=X.match(/(\s*)$/)?.[1]||"";if(W.hostname==="aaa.nonexistanturl.com"){let{pathname:Y,search:z,hash:q}=W;return Y+z+decodeURIComponent(q)+J}let G=W.toString()+J;if(G.includes("#")){let[Y,z]=G.split("#",2);return Y+"#"+decodeURIComponent(z||"")}return G}function f6(){if(typeof window<"u"&&window.location&&window.location.href){let Z=window.location.href;if(!Z||!Z.startsWith("http"))try{return new URL(Z),Z}catch{return"/"}return Z}if(typeof process<"u"&&process.cwd){let Z=process.cwd(),X=Z.slice(-1);if(X==="/"||X==="\\")return Z;else return Z+"/"}return"/"}function TQ(Z){let X=MB.exec(Z||"");if(X)return X[1].toLowerCase();return}function wQ(Z){let X=Z.lastIndexOf(".");if(X>=0)return jB(Z.substring(X).toLowerCase());return""}function jB(Z){let X=Z.indexOf("?");if(X>=0)Z=Z.substring(0,X);return Z}function b4(Z){if(!Z)return"#";let X=Z.indexOf("#");if(X>=0)return Z.substring(X);return"#"}function j0(Z){if(!Z)return"";let X=Z.indexOf("#");if(X>=0)Z=Z.substring(0,X);return Z}function jQ(Z){let X=TQ(Z);if(X==="http"||X==="https")return!0;else if(X===void 0)return typeof window<"u";else return!1}function Q8(Z){if(!Z||typeof Z!=="string")return!0;let X=Z.trim().toLowerCase();if(!X)return!0;if(X.startsWith("javascript:")||X.startsWith("vbscript:")||X.startsWith("data:"))return!0;if(X.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;try{let Q=new URL(X.startsWith("//")?"http:"+X:X);if(OQ(Q.hostname))return!0;let W=Q.port;if(W&&SB(parseInt(W)))return!0}catch{if(X.startsWith("/")&&!X.startsWith("//"))return!1;if(CB(X))return!0}return!1}function OQ(Z){let X=OB(Z);if(!X)return!0;if(X==="localhost"||wB.some((J)=>X.endsWith(J)))return!0;let Q=EQ(X);if(Q)return RQ(Q);let W=EB(X);if(W)return RB(W);return!1}function OB(Z){let X=Z.trim().toLowerCase();if(X.startsWith("[")&&X.endsWith("]"))X=X.slice(1,-1);while(X.endsWith("."))X=X.slice(0,-1);return X}function EQ(Z){let X=Z.split(".");if(X.length!==4)return;let Q=X.map((W)=>{if(!/^\d+$/.test(W))return Number.NaN;return Number(W)});if(Q.some((W)=>!Number.isInteger(W)||W<0||W>255))return;return Q}function RQ([Z,X,Q,W]){return Z===0||Z===10||Z===127||Z===100&&X>=64&&X<=127||Z===169&&X===254||Z===172&&X>=16&&X<=31||Z===192&&X===0&&Q===0||Z===192&&X===168||Z===198&&(X===18||X===19)||Z>=224||Z===255&&X===255&&Q===255&&W===255}function EB(Z){if(!Z.includes(":"))return;let X=Z,Q=X.lastIndexOf(":"),W=X.slice(Q+1);if(W.includes(".")){let q=EQ(W);if(!q)return;let K=q[0]*256+q[1],V=q[2]*256+q[3];X=`${X.slice(0,Q+1)}${K.toString(16)}:${V.toString(16)}`}let J=X.split("::");if(J.length>2)return;let G=DQ(J[0]),Y=J.length===2?DQ(J[1]):[];if(!G||!Y)return;if(J.length===1)return G.length===8?G:void 0;let z=8-G.length-Y.length;if(z<1)return;return[...G,...Array(z).fill(0),...Y]}function DQ(Z){if(!Z)return[];let X=Z.split(":").map((Q)=>{if(!/^[\da-f]{1,4}$/i.test(Q))return Number.NaN;return Number.parseInt(Q,16)});if(X.some((Q)=>!Number.isInteger(Q)||Q<0||Q>65535))return;return X}function RB(Z){if(Z.length!==8)return!1;let X=Z.every((z)=>z===0),Q=Z.slice(0,7).every((z)=>z===0)&&Z[7]===1,W=(Z[0]&65024)===64512,J=(Z[0]&65472)===65152,G=(Z[0]&65280)===65280;if(X||Q||W||J||G)return!0;let Y=PB(Z);return Y?RQ(Y):!1}function PB(Z){let X=Z.slice(0,5).every((J)=>J===0),Q=X&&Z[5]===0,W=X&&Z[5]===65535;if(!Q&&!W)return;return[Math.floor(Z[6]/256),Z[6]%256,Math.floor(Z[7]/256),Z[7]%256]}function CB(Z){return Z.split(/[\s/?#]+/).map((Q)=>Q.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((Q)=>OQ(Q))}function SB(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 W8(Z){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let X=TQ(Z);return X===void 0||X==="file"}function PQ(Z){if(r1()){let X=f6(),Q=Z.toUpperCase(),J=s4(X).toUpperCase(),G=Q.includes(J),Y=Q.includes(J),z=DB.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(G||Y||z)&&!X.startsWith("http"))Z=((K,V)=>{if(K.endsWith("/")||K.endsWith("\\"))return K+V;else return K+"/"+V})(X,Z);Z=s4(Z)}Z=encodeURI(Z);for(let X of TB)Z=Z.replace(X[0],X[1]);return Z}function B1(Z,X){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let W=0;W<ZZ.length;W+=2)Z=Z.replace(ZZ[W],ZZ[W+1]);let Q=Z.toLowerCase().startsWith("file://");if(Q){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),r1()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(X)Z="file:///"+Z;else Q=!1,Z=r1()?Z:"/"+Z}if(r1()&&!Q){if(Z=Z.replace(AB,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function J8(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((X)=>{return X.replace(IB,"/").replace(NB,"~")})}var AB,MB,IB,NB,DB,TB,ZZ,wB,V1=(Z)=>new URL(Z);var a0=c(()=>{NQ();AB=/\//g,MB=/^(\w{2,}):\/\//i,IB=/~1/g,NB=/~0/g,DB=/^[a-zA-Z]:[\\/]/,TB=[[/\?/g,"%3F"],[/#/g,"%23"]],ZZ=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],wB=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function CQ(){let Z={},X=this;for(let Q of xB(X))if(typeof Q==="string"){let W=X[Q],J=typeof W;if(!kB.includes(J))Z[Q]=W}return Z}function xB(Z,X=[]){let Q=[];while(Z&&Z!==_B)Q=Q.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let W=new Set(Q);for(let J of X.concat(bB))W.delete(J);return W}function x4(Z){return Z instanceof G4||Z instanceof H1}function QZ(Z){if(Z.path===null)Z.path=[];return Z}var kB,bB,_B,G4,H1,V4,G8,j4,Y8,z8,XZ,F1;var B4=c(()=>{a0();kB=["function","symbol","undefined"],bB=["constructor","prototype","__proto__"],_B=Object.getPrototypeOf({});G4=class G4 extends Error{name;message;source;path;code;constructor(Z,X){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=Z,this.source=X,this.path=null}toJSON=CQ.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};H1=class H1 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 '${B1(Z.$refs._root$Ref.path)}'`}toJSON=CQ.bind(this);static getParserErrors(Z){let X=[];for(let Q of Object.values(Z.$refs._$refs))if(Q.errors)X.push(...Q.errors);return X}get errors(){return H1.getParserErrors(this.files)}};V4=class V4 extends G4{code="EPARSER";name="ParserError";constructor(Z,X){super(`Error parsing ${X}: ${Z}`,X)}};G8=class G8 extends G4{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};j4=class j4 extends G4{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(Z,X){super(Z.message||`Error reading file "${X}"`,X);if("code"in Z)this.ioErrorCode=String(Z.code)}};Y8=class Y8 extends G4{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};z8=class z8 extends G4{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,X,Q,W,J){super(`Missing $ref pointer "${b4(X)}". Token "${Z}" does not exist.`,j0(X));this.targetToken=Z,this.targetRef=Q,this.targetFound=W,this.parentPath=J}};XZ=class XZ extends G4{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};F1=class F1 extends G4{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,X){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,j0(X))}}});function d0(Z,X){let Q=vB(X);return Q?w0(Z,Q):Z}function $8(Z){if(!Z||typeof Z!=="object"||ArrayBuffer.isView(Z))return!1;let X=Z.$schema;if(typeof X==="string"&&(X.includes("draft/2019-09/")||X.includes("draft/2020-12/")||X.includes("oas/3.1/")))return!0;let Q=Z.openapi;return typeof Q==="string"&&/^3\.1(?:\.|$)/.test(Q)}function q8(Z,X,Q,W,J=!1){if(!J)return;let G=new Set,Y=(z,q)=>{if(!z||typeof z!=="object"||ArrayBuffer.isView(z)||G.has(z))return;G.add(z);let K=d0(q,z);if(K!==q)Z._addAlias(K,z,W,J);for(let V of Object.keys(z))Y(z[V],K)};Y(Q,X)}function vB(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var h6=c(()=>{a0()});class u6{$ref;path;originalPath;scopeBase;value;circular;chainCircular;indirections;constructor(Z,X,Q){this.$ref=Z,this.path=X,this.originalPath=Q||X,this.scopeBase=Z.path||j0(X),this.value=void 0,this.circular=!1,this.chainCircular=!1,this.indirections=0}resolve(Z,X,Q,W=new Set,J=!0){let G=u6.parse(this.path,this.originalPath),Y=[];if(this.value=kQ(Z),this.$ref.dynamicIdScope&&!bQ(this.$ref))this.scopeBase=d0(this.scopeBase,this.value);for(let q=0;q<G.length;q++){let K=this.circular,V=this.chainCircular,B=I0.isExtended$Ref(this.value);if(K8(this,X,Q,W))this.path=u6.join(this.path,G.slice(q));else if(B)this.circular=K,this.chainCircular=V;let H=G[q];if(this.value[H]===void 0||this.value[H]===null&&q===G.length-1){let F=!1;for(let T=G.length-1;T>q;T--){let S=G.slice(q,T+1).join("/");if(this.value[S]!==void 0){this.value=this.value[S],q=T,F=!0;break}}if(F){this.chainCircular=V;continue}if(H in this.value&&this.value[H]===null){this.value=U8,this.chainCircular=V;continue}this.value=null;let A=this.$ref.path||"",M=this.path.replace(A,""),I=u6.join("",Y),N=Q?.replace(A,"");throw new z8(H,decodeURI(this.originalPath),M,I,N)}else this.value=this.value[H];if(this.chainCircular=V,Y.push(H),this.$ref.dynamicIdScope)this.scopeBase=d0(this.scopeBase,this.value)}let z=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(J){let q=this.value?.$ref?w0(z,this.value.$ref):void 0,K=typeof Q==="string"?w0(this.$ref.$refs._root$Ref.path,Q):Q;if(I0.isAllowed$Ref(this.value,X)&&q===K&&q!==this.path)this.chainCircular=!0;else if(!this.value||q)K8(this,X,Q,W)}return this}set(Z,X,Q){let W=u6.parse(this.path),J;if(W.length===0)return this.value=X,X;if(mB(this.path,W),this.value=kQ(Z),this.$ref.dynamicIdScope&&!bQ(this.$ref))this.scopeBase=d0(this.scopeBase,this.value);for(let G=0;G<W.length-1;G++){if(K8(this,Q),J=W[G],this.value&&this.value[J]!==void 0)this.value=this.value[J];else this.value=SQ(this,J,{});if(this.$ref.dynamicIdScope)this.scopeBase=d0(this.scopeBase,this.value)}return K8(this,Q),J=W[W.length-1],SQ(this,J,X),Z}static parse(Z,X){let Q=b4(Z).substring(1);if(!Q)return[];let W=Q.split("/");for(let J=0;J<W.length;J++)W[J]=W[J].replace(fB,"/").replace(hB,"~");if(W[0]!=="")throw new F1(Q,X===void 0?Z:X);return W.slice(1)}static join(Z,X){if(Z.indexOf("#")===-1)Z+="#";X=Array.isArray(X)?X:[X];for(let Q=0;Q<X.length;Q++){let W=X[Q];Z+="/"+W.replace(gB,"~0").replace(yB,"~1")}return Z}}function K8(Z,X,Q,W=new Set){let J=!1,G=Q,Y=[];try{while(I0.isAllowed$Ref(Z.value,X)){let z=I0.isExtended$Ref(Z.value),q=Z.value,K=Z.path,V=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,B=w0(V,Z.value.$ref);if(B===Z.path&&!lB(G))return Z.circular=!0,Z.chainCircular=!0,J;let H=typeof G==="string"?w0(Z.$ref.$refs._root$Ref.path,G):G;if(B===H&&B!==Z.path)return Z.chainCircular=!0,J;if(W.has(B))return Z.chainCircular=!0,J;let F=X?.dereference?.maxDepth??500;if(W.size>=F)throw RangeError(`Maximum dereference depth (${F}) exceeded at ${Z.path}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);W.add(B),Y.push(B);let A=Z.$ref.$refs._resolve(B,K,X,W,z);if(A===null)return J;if(Z.indirections+=A.indirections+1,Z.chainCircular||=A.circular||A.chainCircular,z){if(Z.chainCircular)return J;return Z.value=I0.dereference(q,A.value,X),J}else Z.$ref=A.$ref,Z.path=A.path,Z.value=A.value,Z.scopeBase=A.scopeBase,G=K,J=!0}return J}finally{for(let z of Y)W.delete(z)}}function SQ(Z,X,Q){if(Z.value&&typeof Z.value==="object")if(X==="-"&&Array.isArray(Z.value))Z.value.push(Q);else Z.value[X]=Q;else throw new G4(`Error assigning $ref pointer "${Z.path}".
|
|
17
|
-
Cannot set "${X}" of a non-object.`);return Q}function
|
|
18
|
-
Unsafe JSON Pointer token "${Q}" cannot be used for assignment.`)}function
|
|
19
|
-
"${
|
|
20
|
-
"${
|
|
21
|
-
Parsed value is empty`);else return Y}catch(Y){if(!Y&&X.continueOnError)throw new
|
|
17
|
+
`:""}var c4="https://esm.sh/@vue/reactivity@3.5.32",p4="https://esm.sh/lit-html@3.3.0",$7;var n1=s(()=>{x9();k9();d8();Y1();x9();k9();d8();Y1();$7=new Set(["input","br","hr","img","meta","link","area","col","source"])});function E1(Z){if(Z.startsWith("\\\\?\\"))return Z;return Z.split("\\").join("/")}var kF,v9=()=>kF;var mJ=s(()=>{kF=/^win/.test(globalThis.process?globalThis.process.platform:"")});function u0(Z,X){let Q=new URL(E1(Z),"https://aaa.nonexistanturl.com"),J=new URL(E1(X),Q),W=X.match(/(\s*)$/)?.[1]||"";if(J.hostname==="aaa.nonexistanturl.com"){let{pathname:Y,search:$,hash:z}=J;return Y+$+decodeURIComponent(z)+W}let G=J.toString()+W;if(G.includes("#")){let[Y,$]=G.split("#",2);return Y+"#"+decodeURIComponent($||"")}return G}function L4(){if(typeof window<"u"&&window.location&&window.location.href){let Z=window.location.href;if(!Z||!Z.startsWith("http"))try{return new URL(Z),Z}catch{return"/"}return Z}if(typeof process<"u"&&process.cwd){let Z=process.cwd(),X=Z.slice(-1);if(X==="/"||X==="\\")return Z;else return Z+"/"}return"/"}function lJ(Z){let X=bF.exec(Z||"");if(X)return X[1].toLowerCase();return}function cJ(Z){let X=Z.lastIndexOf(".");if(X>=0)return uF(Z.substring(X).toLowerCase());return""}function uF(Z){let X=Z.indexOf("?");if(X>=0)Z=Z.substring(0,X);return Z}function z1(Z){if(!Z)return"#";let X=Z.indexOf("#");if(X>=0)return Z.substring(X);return"#"}function m0(Z){if(!Z)return"";let X=Z.indexOf("#");if(X>=0)Z=Z.substring(0,X);return Z}function pJ(Z){let X=lJ(Z);if(X==="http"||X==="https")return!0;else if(X===void 0)return typeof window<"u";else return!1}function r8(Z){if(!Z||typeof Z!=="string")return!0;let X=Z.trim().toLowerCase();if(!X)return!0;if(X.startsWith("javascript:")||X.startsWith("vbscript:")||X.startsWith("data:"))return!0;if(X.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;try{let Q=new URL(X.startsWith("//")?"http:"+X:X);if(iJ(Q.hostname))return!0;let J=Q.port;if(J&&iF(parseInt(J)))return!0}catch{if(X.startsWith("/")&&!X.startsWith("//"))return!1;if(pF(X))return!0}return!1}function iJ(Z){let X=mF(Z);if(!X)return!0;if(X==="localhost"||hF.some((W)=>X.endsWith(W)))return!0;let Q=nJ(X);if(Q)return rJ(Q);let J=dF(X);if(J)return lF(J);return!1}function mF(Z){let X=Z.trim().toLowerCase();if(X.startsWith("[")&&X.endsWith("]"))X=X.slice(1,-1);while(X.endsWith("."))X=X.slice(0,-1);return X}function nJ(Z){let X=Z.split(".");if(X.length!==4)return;let Q=X.map((J)=>{if(!/^\d+$/.test(J))return Number.NaN;return Number(J)});if(Q.some((J)=>!Number.isInteger(J)||J<0||J>255))return;return Q}function rJ([Z,X,Q,J]){return Z===0||Z===10||Z===127||Z===100&&X>=64&&X<=127||Z===169&&X===254||Z===172&&X>=16&&X<=31||Z===192&&X===0&&Q===0||Z===192&&X===168||Z===198&&(X===18||X===19)||Z>=224||Z===255&&X===255&&Q===255&&J===255}function dF(Z){if(!Z.includes(":"))return;let X=Z,Q=X.lastIndexOf(":"),J=X.slice(Q+1);if(J.includes(".")){let z=nJ(J);if(!z)return;let U=z[0]*256+z[1],V=z[2]*256+z[3];X=`${X.slice(0,Q+1)}${U.toString(16)}:${V.toString(16)}`}let W=X.split("::");if(W.length>2)return;let G=dJ(W[0]),Y=W.length===2?dJ(W[1]):[];if(!G||!Y)return;if(W.length===1)return G.length===8?G:void 0;let $=8-G.length-Y.length;if($<1)return;return[...G,...Array($).fill(0),...Y]}function dJ(Z){if(!Z)return[];let X=Z.split(":").map((Q)=>{if(!/^[\da-f]{1,4}$/i.test(Q))return Number.NaN;return Number.parseInt(Q,16)});if(X.some((Q)=>!Number.isInteger(Q)||Q<0||Q>65535))return;return X}function lF(Z){if(Z.length!==8)return!1;let X=Z.every(($)=>$===0),Q=Z.slice(0,7).every(($)=>$===0)&&Z[7]===1,J=(Z[0]&65024)===64512,W=(Z[0]&65472)===65152,G=(Z[0]&65280)===65280;if(X||Q||J||W||G)return!0;let Y=cF(Z);return Y?rJ(Y):!1}function cF(Z){let X=Z.slice(0,5).every((W)=>W===0),Q=X&&Z[5]===0,J=X&&Z[5]===65535;if(!Q&&!J)return;return[Math.floor(Z[6]/256),Z[6]%256,Math.floor(Z[7]/256),Z[7]%256]}function pF(Z){return Z.split(/[\s/?#]+/).map((Q)=>Q.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((Q)=>iJ(Q))}function iF(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 a8(Z){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let X=lJ(Z);return X===void 0||X==="file"}function aJ(Z){if(v9()){let X=L4(),Q=Z.toUpperCase(),W=E1(X).toUpperCase(),G=Q.includes(W),Y=Q.includes(W),$=gF.test(Z)||Z.startsWith("http://")||Z.startsWith("https://")||Z.startsWith("file://");if(!(G||Y||$)&&!X.startsWith("http"))Z=((U,V)=>{if(U.endsWith("/")||U.endsWith("\\"))return U+V;else return U+"/"+V})(X,Z);Z=E1(Z)}Z=encodeURI(Z);for(let X of fF)Z=Z.replace(X[0],X[1]);return Z}function s4(Z,X){Z=Z.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),Z=decodeURI(Z);for(let J=0;J<U7.length;J+=2)Z=Z.replace(U7[J],U7[J+1]);let Q=Z.toLowerCase().startsWith("file://");if(Q){if(Z=Z.replace(/^file:\/\//,"").replace(/^\//,""),v9()&&Z[1]==="/")Z=`${Z[0]}:${Z.substring(1)}`;if(X)Z="file:///"+Z;else Q=!1,Z=v9()?Z:"/"+Z}if(v9()&&!Q){if(Z=Z.replace(xF,"\\"),Z.match(/^[a-z]:\\/i))Z=Z[0].toUpperCase()+Z.substring(1)}return Z}function o8(Z){if(Z.length<=1||Z[0]!=="#"||Z[1]!=="/")return[];return Z.slice(2).split("/").map((X)=>{return X.replace(vF,"/").replace(yF,"~")})}var xF,bF,vF,yF,gF,fF,U7,hF,o4=(Z)=>new URL(Z);var M6=s(()=>{mJ();xF=/\//g,bF=/^(\w{2,}):\/\//i,vF=/~1/g,yF=/~0/g,gF=/^[a-zA-Z]:[\\/]/,fF=[[/\?/g,"%3F"],[/#/g,"%23"]],U7=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],hF=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function oJ(){let Z={},X=this;for(let Q of oF(X))if(typeof Q==="string"){let J=X[Q],W=typeof J;if(!nF.includes(W))Z[Q]=J}return Z}function oF(Z,X=[]){let Q=[];while(Z&&Z!==aF)Q=Q.concat(Object.getOwnPropertyNames(Z),Object.getOwnPropertySymbols(Z)),Z=Object.getPrototypeOf(Z);let J=new Set(Q);for(let W of X.concat(rF))J.delete(W);return J}function K1(Z){return Z instanceof C6||Z instanceof t4}function V7(Z){if(Z.path===null)Z.path=[];return Z}var nF,rF,aF,C6,t4,g6,s8,r6,t8,e8,K7,e4;var f6=s(()=>{M6();nF=["function","symbol","undefined"],rF=["constructor","prototype","__proto__"],aF=Object.getPrototypeOf({});C6=class C6 extends Error{name;message;source;path;code;constructor(Z,X){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=Z,this.source=X,this.path=null}toJSON=oJ.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};t4=class t4 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 '${s4(Z.$refs._root$Ref.path)}'`}toJSON=oJ.bind(this);static getParserErrors(Z){let X=[];for(let Q of Object.values(Z.$refs._$refs))if(Q.errors)X.push(...Q.errors);return X}get errors(){return t4.getParserErrors(this.files)}};g6=class g6 extends C6{code="EPARSER";name="ParserError";constructor(Z,X){super(`Error parsing ${X}: ${Z}`,X)}};s8=class s8 extends C6{code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor(Z){super(`Could not find parser for "${Z}"`,Z)}};r6=class r6 extends C6{code="ERESOLVER";name="ResolverError";ioErrorCode;constructor(Z,X){super(Z.message||`Error reading file "${X}"`,X);if("code"in Z)this.ioErrorCode=String(Z.code)}};t8=class t8 extends C6{code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor(Z){super(`Could not find resolver for "${Z}"`,Z)}};e8=class e8 extends C6{code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor(Z,X,Q,J,W){super(`Missing $ref pointer "${z1(X)}". Token "${Z}" does not exist.`,m0(X));this.targetToken=Z,this.targetRef=Q,this.targetFound=J,this.parentPath=W}};K7=class K7 extends C6{code="ETIMEOUT";name="TimeoutError";constructor(Z){super(`Dereferencing timeout reached: ${Z}ms`)}};e4=class e4 extends C6{code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor(Z,X){super(`Invalid $ref pointer "${Z}". Pointers must begin with "#/"`,m0(X))}}});function U6(Z,X){let Q=sF(X);return Q?u0(Z,Q):Z}function Z5(Z){if(!Z||typeof Z!=="object"||ArrayBuffer.isView(Z))return!1;let X=Z.$schema;if(typeof X==="string"&&(X.includes("draft/2019-09/")||X.includes("draft/2020-12/")||X.includes("oas/3.1/")))return!0;let Q=Z.openapi;return typeof Q==="string"&&/^3\.1(?:\.|$)/.test(Q)}function X5(Z,X,Q,J,W=!1){if(!W)return;let G=new Set,Y=($,z)=>{if(!$||typeof $!=="object"||ArrayBuffer.isView($)||G.has($))return;G.add($);let U=U6(z,$);if(U!==z)Z._addAlias(U,$,J,W);for(let V of Object.keys($))Y($[V],U)};Y(Q,X)}function sF(Z){if(Z&&typeof Z==="object"&&"$id"in Z&&typeof Z.$id==="string"&&Z.$id.length>0)return Z.$id;return}var M4=s(()=>{M6()});class A4{$ref;path;originalPath;scopeBase;value;circular;chainCircular;indirections;constructor(Z,X,Q){this.$ref=Z,this.path=X,this.originalPath=Q||X,this.scopeBase=Z.path||m0(X),this.value=void 0,this.circular=!1,this.chainCircular=!1,this.indirections=0}resolve(Z,X,Q,J=new Set,W=!0){let G=A4.parse(this.path,this.originalPath),Y=[];if(this.value=tJ(Z),this.$ref.dynamicIdScope&&!eJ(this.$ref))this.scopeBase=U6(this.scopeBase,this.value);for(let z=0;z<G.length;z++){let U=this.circular,V=this.chainCircular,q=g0.isExtended$Ref(this.value);if(Q5(this,X,Q,J))this.path=A4.join(this.path,G.slice(z));else if(q)this.circular=U,this.chainCircular=V;let B=G[z];if(this.value[B]===void 0||this.value[B]===null&&z===G.length-1){let F=!1;for(let D=G.length-1;D>z;D--){let O=G.slice(z,D+1).join("/");if(this.value[O]!==void 0){this.value=this.value[O],z=D,F=!0;break}}if(F){this.chainCircular=V;continue}if(B in this.value&&this.value[B]===null){this.value=J5,this.chainCircular=V;continue}this.value=null;let L=this.$ref.path||"",I=this.path.replace(L,""),A=A4.join("",Y),N=Q?.replace(L,"");throw new e8(B,decodeURI(this.originalPath),I,A,N)}else this.value=this.value[B];if(this.chainCircular=V,Y.push(B),this.$ref.dynamicIdScope)this.scopeBase=U6(this.scopeBase,this.value)}let $=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(W){let z=this.value?.$ref?u0($,this.value.$ref):void 0,U=typeof Q==="string"?u0(this.$ref.$refs._root$Ref.path,Q):Q;if(g0.isAllowed$Ref(this.value,X)&&z===U&&z!==this.path)this.chainCircular=!0;else if(!this.value||z)Q5(this,X,Q,J)}return this}set(Z,X,Q){let J=A4.parse(this.path),W;if(J.length===0)return this.value=X,X;if(JL(this.path,J),this.value=tJ(Z),this.$ref.dynamicIdScope&&!eJ(this.$ref))this.scopeBase=U6(this.scopeBase,this.value);for(let G=0;G<J.length-1;G++){if(Q5(this,Q),W=J[G],this.value&&this.value[W]!==void 0)this.value=this.value[W];else this.value=sJ(this,W,{});if(this.$ref.dynamicIdScope)this.scopeBase=U6(this.scopeBase,this.value)}return Q5(this,Q),W=J[J.length-1],sJ(this,W,X),Z}static parse(Z,X){let Q=z1(Z).substring(1);if(!Q)return[];let J=Q.split("/");for(let W=0;W<J.length;W++)J[W]=J[W].replace(ZL,"/").replace(XL,"~");if(J[0]!=="")throw new e4(Q,X===void 0?Z:X);return J.slice(1)}static join(Z,X){if(Z.indexOf("#")===-1)Z+="#";X=Array.isArray(X)?X:[X];for(let Q=0;Q<X.length;Q++){let J=X[Q];Z+="/"+J.replace(eF,"~0").replace(tF,"~1")}return Z}}function Q5(Z,X,Q,J=new Set){let W=!1,G=Q,Y=[];try{while(g0.isAllowed$Ref(Z.value,X)){let $=g0.isExtended$Ref(Z.value),z=Z.value,U=Z.path,V=Z.$ref.dynamicIdScope?Z.scopeBase:Z.path,q=u0(V,Z.value.$ref);if(q===Z.path&&!WL(G))return Z.circular=!0,Z.chainCircular=!0,W;let B=typeof G==="string"?u0(Z.$ref.$refs._root$Ref.path,G):G;if(q===B&&q!==Z.path)return Z.chainCircular=!0,W;if(J.has(q))return Z.chainCircular=!0,W;let F=X?.dereference?.maxDepth??500;if(J.size>=F)throw RangeError(`Maximum dereference depth (${F}) exceeded at ${Z.path}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);J.add(q),Y.push(q);let L=Z.$ref.$refs._resolve(q,U,X,J,$);if(L===null)return W;if(Z.indirections+=L.indirections+1,Z.chainCircular||=L.circular||L.chainCircular,$){if(Z.chainCircular)return W;return Z.value=g0.dereference(z,L.value,X),W}else Z.$ref=L.$ref,Z.path=L.path,Z.value=L.value,Z.scopeBase=L.scopeBase,G=U,W=!0}return W}finally{for(let $ of Y)J.delete($)}}function sJ(Z,X,Q){if(Z.value&&typeof Z.value==="object")if(X==="-"&&Array.isArray(Z.value))Z.value.push(Q);else Z.value[X]=Q;else throw new C6(`Error assigning $ref pointer "${Z.path}".
|
|
18
|
+
Cannot set "${X}" of a non-object.`);return Q}function JL(Z,X){for(let Q of X)if(QL.has(Q))throw new C6(`Error assigning $ref pointer "${Z}".
|
|
19
|
+
Unsafe JSON Pointer token "${Q}" cannot be used for assignment.`)}function tJ(Z){if(K1(Z))throw Z;return Z}function WL(Z){return typeof Z=="string"&&A4.parse(Z).length==0}function eJ(Z){return Boolean(Z.path&&Z.path in Z.$refs._aliases)}var J5,tF,eF,ZL,XL,QL,A6;var y9=s(()=>{Z9();M6();f6();M4();J5=Symbol("null"),tF=/\//g,eF=/~/g,ZL=/~1/g,XL=/~0/g,QL=new Set(["__proto__","constructor","prototype"]);A6=A4});class g9{path;value;$refs;pathType;dynamicIdScope=!1;errors=[];constructor(Z){this.$refs=Z}addError(Z){if(this.errors===void 0)this.errors=[];let X=this.errors.map(({footprint:Q})=>Q);if("errors"in Z&&Array.isArray(Z.errors))this.errors.push(...Z.errors.map(V7).filter(({footprint:Q})=>!X.includes(Q)));else if(!("footprint"in Z)||!X.includes(Z.footprint))this.errors.push(V7(Z))}exists(Z,X){try{return this.resolve(Z,X),!0}catch{return!1}}get(Z,X){return this.resolve(Z,X)?.value}resolve(Z,X,Q,J,W,G=!0){let Y=new A6(this,Z,Q);try{let $=Y.resolve(this.value,X,J,W,G);if($.value===J5)$.value=null;return $}catch($){if(!X||!X.continueOnError||!K1($))throw $;if($.path===null)$.path=o8(z1(J));if($ instanceof e4)$.source=decodeURI(m0(J));return this.addError($),null}}set(Z,X){let Q=new A6(this,Z);if(this.value=Q.set(this.value,X),this.value===J5)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 g9.is$Ref(Z)&&Z.$ref[0]!=="#"}static isAllowed$Ref(Z,X){if(this.is$Ref(Z)){if(Z.$ref.substring(0,2)==="#/"||Z.$ref==="#")return!0;else if(Z.$ref[0]!=="#"&&(!X||X.resolve?.external))return!0}return}static isExtended$Ref(Z){return g9.is$Ref(Z)&&Object.keys(Z).length>1}static dereference(Z,X,Q){if(X&&typeof X==="object"&&g9.isExtended$Ref(Z)){let J={};for(let G of Object.keys(Z))if(G!=="$ref")J[G]=Z[G];let W=Q?.dereference?.mergeKeys??!0;for(let G of Object.keys(X)){let Y=G;if(!(Y in J))J[Y]=X[Y];else if(W&&typeof J[Y]==="object"&&J[Y]!==null&&typeof X[Y]==="object"&&X[Y]!==null)J[Y]=ZW(X[Y],J[Y])}return J}else return X}}function ZW(Z,X){if(typeof Z!=="object"||Z===null)return X;if(typeof X!=="object"||X===null)return X;let Q=Array.isArray(Z)?[...Z]:{...Z};for(let J of Object.keys(X))if(Array.isArray(X[J]))Q[J]=[...X[J]];else if(typeof X[J]==="object"&&X[J]!==null)Q[J]=ZW(Z[J],X[J]);else Q[J]=X[J];return Q}var g0;var Z9=s(()=>{y9();f6();M6();g0=g9});class f9{circular;paths(...Z){return XW(this._$refs,Z.flat()).map((Q)=>{return E1(Q.decoded)})}values(...Z){let X=this._$refs;return XW(X,Z.flat()).reduce((J,W)=>{return J[E1(W.decoded)]=X[W.encoded].value,J},{})}exists(Z,X){try{return this._resolve(Z,"",X),!0}catch{return!1}}get(Z,X){return this._resolve(Z,"",X).value}set(Z,X){let Q=u0(this._root$Ref.path,Z),J=this._getRef(Q);if(!J)throw Error(`Error resolving $ref pointer "${Z}".
|
|
20
|
+
"${m0(Q)}" not found.`);J.set(Q,X)}_get$Ref(Z){return Z=u0(this._root$Ref.path,Z),this._getRef(Z)}_add(Z){let X=m0(Z),Q=new g0(this);return Q.path=X,this._$refs[X]=Q,this._root$Ref=this._root$Ref||Q,Q}_addAlias(Z,X,Q,J=!1){let W=m0(Z);if(!W||this._$refs[W]||this._aliases[W])return this._$refs[W]||this._aliases[W];let G=new g0(this);return G.path=W,G.pathType=Q,G.value=X,G.dynamicIdScope=J,this._aliases[W]=G,G}_resolve(Z,X,Q,J,W=!0){let G=u0(this._root$Ref.path,Z),Y=this._getRef(G);if(!Y)throw Error(`Error resolving $ref pointer "${Z}".
|
|
21
|
+
"${m0(G)}" not found.`);return Y.resolve(G,Q,Z,X,J,W)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=this.values;_getRef(Z){let X=m0(Z);return this._$refs[X]||this._aliases[X]}}function XW(Z,X){let Q=Object.keys(Z);if(X=Array.isArray(X[0])?X[0]:Array.prototype.slice.call(X),X.length>0&&X[0])Q=Q.filter((J)=>{return X.includes(Z[J].pathType)});return Q.map((J)=>{return{encoded:J,decoded:Z[J].pathType==="file"?s4(J,!0):J}})}var QW=s(()=>{Z9();M6()});function H7(Z){return Object.keys(Z||{}).filter((X)=>{return typeof Z[X]==="object"}).map((X)=>{return Z[X].name=X,Z[X]})}function q7(Z,X,Q,J,W){return Z.filter((G)=>{return!!JW(G,X,Q,J,W)})}function B7(Z){for(let X of Z)X.order=X.order||Number.MAX_SAFE_INTEGER;return Z.sort((X,Q)=>{return X.order-Q.order})}async function F7(Z,X,Q,J){let W,G,Y=0;return new Promise(($,z)=>{U();function U(){if(W=Z[Y++],!W)return z(G);try{let F=JW(W,X,Q,V,J);if(F&&typeof F.then==="function")F.then(q,B);else if(F!==void 0)q(F);else if(Y===Z.length)throw Error("No promise has been returned or callback has been called.")}catch(F){B(F)}}function V(F,L){if(F)B(F);else q(L)}function q(F){$({plugin:W,result:F})}function B(F){G={plugin:W,error:F},U()}})}function JW(Z,X,Q,J,W){let G=Z[X];if(typeof G==="function")return G.apply(Z,[Q,J,W]);if(!J){if(G instanceof RegExp)return G.test(Q.url);else if(typeof G==="string")return G===Q.extension;else if(Array.isArray(G))return G.indexOf(Q.extension)!==-1}return G}async function GL(Z,X,Q){let J=typeof Z==="string"?Z:Z.url,W=typeof Z==="string"?void 0:Z.baseUrl,G=typeof Z==="string"?void 0:Z.reference,Y=J.indexOf("#"),$="";if(Y>=0)$=J.substring(Y),J=J.substring(0,Y);if(G){let V=G.indexOf("#");if(V>=0)G=G.substring(0,V)}let z=X._add(J),U={url:J,hash:$,extension:cJ(J),...G!==void 0?{reference:G}:{},...W!==void 0?{baseUrl:W}:{}};try{let V=await YL(U,Q,X);z.pathType=V.plugin.name,U.data=V.result;let q=await $L(U,Q,X);return z.value=q.result,z.dynamicIdScope=Z5(z.value),X5(X,z.path,z.value,z.pathType,z.dynamicIdScope),q.result}catch(V){if(K1(V))z.value=V;throw V}}async function YL(Z,X,Q){let J=H7(X.resolve);J=q7(J,"canRead",Z,void 0,Q),B7(J);try{return await F7(J,"read",Z,Q)}catch(W){if(!W&&X.continueOnError)throw new t8(Z.url);else if(!W||!("error"in W))throw SyntaxError(`Unable to resolve $ref pointer "${Z.url}"`,{cause:W});else if(W.error instanceof r6)throw W.error;else throw new r6(W,Z.url)}}async function $L(Z,X,Q){let J=H7(X.parse),W=q7(J,"canParse",Z),G=W.length>0?W:J;B7(G);try{let Y=await F7(G,"parse",Z,Q);if(!Y.plugin.allowEmpty&&zL(Y.result))throw SyntaxError(`Error parsing "${Z.url}" as ${Y.plugin.name}.
|
|
22
|
+
Parsed value is empty`);else return Y}catch(Y){if(!Y&&X.continueOnError)throw new s8(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 g6)throw Y.error;else throw new g6(Y.error.message,Z.url)}}function zL(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 W5;var L7=s(()=>{M6();M4();f6();W5=GL});var WW;var GW=s(()=>{f6();WW={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(Z){let X=Z.data;if(Buffer.isBuffer(X))X=X.toString();if(typeof X==="string")if(X.trim().length===0)return;else try{return JSON.parse(X)}catch(Q){if(this.allowBOM)try{let J=X.indexOf("{");return X=X.slice(J),JSON.parse(X)}catch(J){throw new g6(J.message,Z.url)}throw new g6(Q.message,Z.url)}else return X}}});function UL(Z){return Z&&Z.__esModule&&Object.prototype.hasOwnProperty.call(Z,"default")?Z.default:Z}function h9(){if(YW)return r1;YW=1;function Z(Y){return typeof Y>"u"||Y===null}function X(Y){return typeof Y==="object"&&Y!==null}function Q(Y){if(Array.isArray(Y))return Y;else if(Z(Y))return[];return[Y]}function J(Y,$){if($){let z=Object.keys($);for(let U=0,V=z.length;U<V;U+=1){let q=z[U];Y[q]=$[q]}}return Y}function W(Y,$){let z="";for(let U=0;U<$;U+=1)z+=Y;return z}function G(Y){return Y===0&&Number.NEGATIVE_INFINITY===1/Y}return r1.isNothing=Z,r1.isObject=X,r1.toArray=Q,r1.repeat=W,r1.isNegativeZero=G,r1.extend=J,r1}function u9(){if($W)return M7;$W=1;function Z(Q,J){let W="",G=Q.reason||"(unknown reason)";if(!Q.mark)return G;if(Q.mark.name)W+='in "'+Q.mark.name+'" ';if(W+="("+(Q.mark.line+1)+":"+(Q.mark.column+1)+")",!J&&Q.mark.snippet)W+=`
|
|
22
23
|
|
|
23
|
-
`+Q.mark.snippet;return G+" "+
|
|
24
|
-
`+
|
|
25
|
-
`,
|
|
26
|
-
`;for(let
|
|
27
|
-
`}return
|
|
28
|
-
\r`;function Q(Y){if(Y===null)return!1;let
|
|
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
|
|
30
|
-
`,
|
|
31
|
-
`,
|
|
32
|
-
`}break}if(
|
|
33
|
-
`,
|
|
34
|
-
`,
|
|
35
|
-
`,
|
|
36
|
-
`,
|
|
37
|
-
`;if(
|
|
38
|
-
`,
|
|
39
|
-
`)
|
|
40
|
-
`+Z.repeat(" ",
|
|
41
|
-
`,
|
|
42
|
-
`||
|
|
43
|
-
`)?"+":
|
|
44
|
-
`}function
|
|
45
|
-
`?
|
|
46
|
-
`);return
|
|
47
|
-
`||
|
|
48
|
-
`:"")+
|
|
49
|
-
`+
|
|
50
|
-
`,
|
|
51
|
-
`+
|
|
52
|
-
`;return""}return
|
|
24
|
+
`+Q.mark.snippet;return G+" "+W}function X(Q,J){if(Error.call(this),this.name="YAMLException",this.reason=Q,this.mark=J,this.message=Z(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}return X.prototype=Object.create(Error.prototype),X.prototype.constructor=X,X.prototype.toString=function(J){return this.name+": "+Z(this,J)},M7=X,M7}function KL(){if(zW)return A7;zW=1;let Z=h9();function X(W,G,Y,$,z){let U="",V="",q=Math.floor(z/2)-1;if($-G>q)U=" ... ",G=$-q+U.length;if(Y-$>q)V=" ...",Y=$+q-V.length;return{str:U+W.slice(G,Y).replace(/\t/g,"→")+V,pos:$-G+U.length}}function Q(W,G){return Z.repeat(" ",G-W.length)+W}function J(W,G){if(G=Object.create(G||null),!W.buffer)return null;if(!G.maxLength)G.maxLength=79;if(typeof G.indent!=="number")G.indent=1;if(typeof G.linesBefore!=="number")G.linesBefore=3;if(typeof G.linesAfter!=="number")G.linesAfter=2;let Y=/\r?\n|\r|\0/g,$=[0],z=[],U,V=-1;while(U=Y.exec(W.buffer))if(z.push(U.index),$.push(U.index+U[0].length),W.position<=U.index&&V<0)V=$.length-2;if(V<0)V=$.length-1;let q="",B=Math.min(W.line+G.linesAfter,z.length).toString().length,F=G.maxLength-(G.indent+B+3);for(let I=1;I<=G.linesBefore;I++){if(V-I<0)break;let A=X(W.buffer,$[V-I],z[V-I],W.position-($[V]-$[V-I]),F);q=Z.repeat(" ",G.indent)+Q((W.line-I+1).toString(),B)+" | "+A.str+`
|
|
25
|
+
`+q}let L=X(W.buffer,$[V],z[V],W.position,F);q+=Z.repeat(" ",G.indent)+Q((W.line+1).toString(),B)+" | "+L.str+`
|
|
26
|
+
`,q+=Z.repeat("-",G.indent+B+3+L.pos)+`^
|
|
27
|
+
`;for(let I=1;I<=G.linesAfter;I++){if(V+I>=z.length)break;let A=X(W.buffer,$[V+I],z[V+I],W.position-($[V]-$[V+I]),F);q+=Z.repeat(" ",G.indent)+Q((W.line+I+1).toString(),B)+" | "+A.str+`
|
|
28
|
+
`}return q.replace(/\n$/,"")}return A7=J,A7}function K6(){if(UW)return I7;UW=1;let Z=u9(),X=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Q=["scalar","sequence","mapping"];function J(G){let Y={};if(G!==null)Object.keys(G).forEach(function($){G[$].forEach(function(z){Y[String(z)]=$})});return Y}function W(G,Y){if(Y=Y||{},Object.keys(Y).forEach(function($){if(X.indexOf($)===-1)throw new Z('Unknown option "'+$+'" is met in definition of "'+G+'" YAML type.')}),this.options=Y,this.tag=G,this.kind=Y.kind||null,this.resolve=Y.resolve||function(){return!0},this.construct=Y.construct||function($){return $},this.instanceOf=Y.instanceOf||null,this.predicate=Y.predicate||null,this.represent=Y.represent||null,this.representName=Y.representName||null,this.defaultStyle=Y.defaultStyle||null,this.multi=Y.multi||!1,this.styleAliases=J(Y.styleAliases||null),Q.indexOf(this.kind)===-1)throw new Z('Unknown kind "'+this.kind+'" is specified for "'+G+'" YAML type.')}return I7=W,I7}function _W(){if(KW)return N7;KW=1;let Z=u9(),X=K6();function Q(G,Y){let $=[];return G[Y].forEach(function(z){let U=$.length;$.forEach(function(V,q){if(V.tag===z.tag&&V.kind===z.kind&&V.multi===z.multi)U=q}),$[U]=z}),$}function J(){let G={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function Y($){if($.multi)G.multi[$.kind].push($),G.multi.fallback.push($);else G[$.kind][$.tag]=G.fallback[$.tag]=$}for(let $=0,z=arguments.length;$<z;$+=1)arguments[$].forEach(Y);return G}function W(G){return this.extend(G)}return W.prototype.extend=function(Y){let $=[],z=[];if(Y instanceof X)z.push(Y);else if(Array.isArray(Y))z=z.concat(Y);else if(Y&&(Array.isArray(Y.implicit)||Array.isArray(Y.explicit))){if(Y.implicit)$=$.concat(Y.implicit);if(Y.explicit)z=z.concat(Y.explicit)}else throw new Z("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");$.forEach(function(V){if(!(V instanceof X))throw new Z("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(V.loadKind&&V.loadKind!=="scalar")throw new Z("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(V.multi)throw new Z("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),z.forEach(function(V){if(!(V instanceof X))throw new Z("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let U=Object.create(W.prototype);return U.implicit=(this.implicit||[]).concat($),U.explicit=(this.explicit||[]).concat(z),U.compiledImplicit=Q(U,"implicit"),U.compiledExplicit=Q(U,"explicit"),U.compiledTypeMap=J(U.compiledImplicit,U.compiledExplicit),U},N7=W,N7}function kW(){if(VW)return D7;return VW=1,D7=new(K6())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(X){return X!==null?X:""}}),D7}function xW(){if(HW)return T7;return HW=1,T7=new(K6())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(X){return X!==null?X:[]}}),T7}function bW(){if(qW)return w7;return qW=1,w7=new(K6())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(X){return X!==null?X:{}}}),w7}function vW(){if(BW)return j7;return BW=1,j7=new(_W())({explicit:[kW(),xW(),bW()]}),j7}function yW(){if(FW)return O7;FW=1;let Z=K6();function X(W){if(W===null)return!0;let G=W.length;return G===1&&W==="~"||G===4&&(W==="null"||W==="Null"||W==="NULL")}function Q(){return null}function J(W){return W===null}return O7=new Z("tag:yaml.org,2002:null",{kind:"scalar",resolve:X,construct:Q,predicate:J,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),O7}function gW(){if(LW)return E7;LW=1;let Z=K6();function X(W){if(W===null)return!1;let G=W.length;return G===4&&(W==="true"||W==="True"||W==="TRUE")||G===5&&(W==="false"||W==="False"||W==="FALSE")}function Q(W){return W==="true"||W==="True"||W==="TRUE"}function J(W){return Object.prototype.toString.call(W)==="[object Boolean]"}return E7=new Z("tag:yaml.org,2002:bool",{kind:"scalar",resolve:X,construct:Q,predicate:J,represent:{lowercase:function(W){return W?"true":"false"},uppercase:function(W){return W?"TRUE":"FALSE"},camelcase:function(W){return W?"True":"False"}},defaultStyle:"lowercase"}),E7}function fW(){if(MW)return R7;MW=1;let Z=h9(),X=K6();function Q(U){return U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102}function J(U){return U>=48&&U<=55}function W(U){return U>=48&&U<=57}function G(U){if(U===null)return!1;let V=U.length,q=0,B=!1;if(!V)return!1;let F=U[q];if(F==="-"||F==="+")F=U[++q];if(F==="0"){if(q+1===V)return!0;if(F=U[++q],F==="b"){q++;for(;q<V;q++){if(F=U[q],F!=="0"&&F!=="1")return!1;B=!0}return B&&isFinite(Y(U))}if(F==="x"){q++;for(;q<V;q++){if(!Q(U.charCodeAt(q)))return!1;B=!0}return B&&isFinite(Y(U))}if(F==="o"){q++;for(;q<V;q++){if(!J(U.charCodeAt(q)))return!1;B=!0}return B&&isFinite(Y(U))}}for(;q<V;q++){if(!W(U.charCodeAt(q)))return!1;B=!0}if(!B)return!1;return isFinite(Y(U))}function Y(U){let V=U,q=1,B=V[0];if(B==="-"||B==="+"){if(B==="-")q=-1;V=V.slice(1),B=V[0]}if(V==="0")return 0;if(B==="0"){if(V[1]==="b")return q*parseInt(V.slice(2),2);if(V[1]==="x")return q*parseInt(V.slice(2),16);if(V[1]==="o")return q*parseInt(V.slice(2),8)}return q*parseInt(V,10)}function $(U){return Y(U)}function z(U){return Object.prototype.toString.call(U)==="[object Number]"&&(U%1===0&&!Z.isNegativeZero(U))}return R7=new X("tag:yaml.org,2002:int",{kind:"scalar",resolve:G,construct:$,predicate:z,represent:{binary:function(U){return U>=0?"0b"+U.toString(2):"-0b"+U.toString(2).slice(1)},octal:function(U){return U>=0?"0o"+U.toString(8):"-0o"+U.toString(8).slice(1)},decimal:function(U){return U.toString(10)},hexadecimal:function(U){return U>=0?"0x"+U.toString(16).toUpperCase():"-0x"+U.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),R7}function hW(){if(AW)return P7;AW=1;let Z=h9(),X=K6(),Q=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),J=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function W(U){if(U===null)return!1;if(!Q.test(U))return!1;if(isFinite(parseFloat(U,10)))return!0;return J.test(U)}function G(U){let V=U.toLowerCase(),q=V[0]==="-"?-1:1;if("+-".indexOf(V[0])>=0)V=V.slice(1);if(V===".inf")return q===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(V===".nan")return NaN;return q*parseFloat(V,10)}let Y=/^[-+]?[0-9]+e/;function $(U,V){if(isNaN(U))switch(V){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===U)switch(V){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===U)switch(V){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Z.isNegativeZero(U))return"-0.0";let q=U.toString(10);return Y.test(q)?q.replace("e",".e"):q}function z(U){return Object.prototype.toString.call(U)==="[object Number]"&&(U%1!==0||Z.isNegativeZero(U))}return P7=new X("tag:yaml.org,2002:float",{kind:"scalar",resolve:W,construct:G,predicate:z,represent:$,defaultStyle:"lowercase"}),P7}function uW(){if(IW)return C7;return IW=1,C7=vW().extend({implicit:[yW(),gW(),fW(),hW()]}),C7}function mW(){if(NW)return S7;return NW=1,S7=uW(),S7}function dW(){if(DW)return _7;DW=1;let Z=K6(),X=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Q=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 J(Y){if(Y===null)return!1;if(X.exec(Y)!==null)return!0;if(Q.exec(Y)!==null)return!0;return!1}function W(Y){let $=0,z=null,U=X.exec(Y);if(U===null)U=Q.exec(Y);if(U===null)throw Error("Date resolve error");let V=+U[1],q=+U[2]-1,B=+U[3];if(!U[4])return new Date(Date.UTC(V,q,B));let F=+U[4],L=+U[5],I=+U[6];if(U[7]){$=U[7].slice(0,3);while($.length<3)$+="0";$=+$}if(U[9]){let N=+U[10],D=+(U[11]||0);if(z=(N*60+D)*60000,U[9]==="-")z=-z}let A=new Date(Date.UTC(V,q,B,F,L,I,$));if(z)A.setTime(A.getTime()-z);return A}function G(Y){return Y.toISOString()}return _7=new Z("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:J,construct:W,instanceOf:Date,represent:G}),_7}function lW(){if(TW)return k7;TW=1;let Z=K6();function X(Q){return Q==="<<"||Q===null}return k7=new Z("tag:yaml.org,2002:merge",{kind:"scalar",resolve:X}),k7}function cW(){if(wW)return x7;wW=1;let Z=K6(),X=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
29
|
+
\r`;function Q(Y){if(Y===null)return!1;let $=0,z=Y.length,U=X;for(let V=0;V<z;V++){let q=U.indexOf(Y.charAt(V));if(q>64)continue;if(q<0)return!1;$+=6}return $%8===0}function J(Y){let $=Y.replace(/[\r\n=]/g,""),z=$.length,U=X,V=0,q=[];for(let F=0;F<z;F++){if(F%4===0&&F)q.push(V>>16&255),q.push(V>>8&255),q.push(V&255);V=V<<6|U.indexOf($.charAt(F))}let B=z%4*6;if(B===0)q.push(V>>16&255),q.push(V>>8&255),q.push(V&255);else if(B===18)q.push(V>>10&255),q.push(V>>2&255);else if(B===12)q.push(V>>4&255);return new Uint8Array(q)}function W(Y){let $="",z=0,U=Y.length,V=X;for(let B=0;B<U;B++){if(B%3===0&&B)$+=V[z>>18&63],$+=V[z>>12&63],$+=V[z>>6&63],$+=V[z&63];z=(z<<8)+Y[B]}let q=U%3;if(q===0)$+=V[z>>18&63],$+=V[z>>12&63],$+=V[z>>6&63],$+=V[z&63];else if(q===2)$+=V[z>>10&63],$+=V[z>>4&63],$+=V[z<<2&63],$+=V[64];else if(q===1)$+=V[z>>2&63],$+=V[z<<4&63],$+=V[64],$+=V[64];return $}function G(Y){return Object.prototype.toString.call(Y)==="[object Uint8Array]"}return x7=new Z("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Q,construct:J,predicate:G,represent:W}),x7}function pW(){if(jW)return b7;jW=1;let Z=K6(),X=Object.prototype.hasOwnProperty,Q=Object.prototype.toString;function J(G){if(G===null)return!0;let Y=[],$=G;for(let z=0,U=$.length;z<U;z+=1){let V=$[z],q=!1;if(Q.call(V)!=="[object Object]")return!1;let B;for(B in V)if(X.call(V,B))if(!q)q=!0;else return!1;if(!q)return!1;if(Y.indexOf(B)===-1)Y.push(B);else return!1}return!0}function W(G){return G!==null?G:[]}return b7=new Z("tag:yaml.org,2002:omap",{kind:"sequence",resolve:J,construct:W}),b7}function iW(){if(OW)return v7;OW=1;let Z=K6(),X=Object.prototype.toString;function Q(W){if(W===null)return!0;let G=W,Y=Array(G.length);for(let $=0,z=G.length;$<z;$+=1){let U=G[$];if(X.call(U)!=="[object Object]")return!1;let V=Object.keys(U);if(V.length!==1)return!1;Y[$]=[V[0],U[V[0]]]}return!0}function J(W){if(W===null)return[];let G=W,Y=Array(G.length);for(let $=0,z=G.length;$<z;$+=1){let U=G[$],V=Object.keys(U);Y[$]=[V[0],U[V[0]]]}return Y}return v7=new Z("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Q,construct:J}),v7}function nW(){if(EW)return y7;EW=1;let Z=K6(),X=Object.prototype.hasOwnProperty;function Q(W){if(W===null)return!0;let G=W;for(let Y in G)if(X.call(G,Y)){if(G[Y]!==null)return!1}return!0}function J(W){return W!==null?W:{}}return y7=new Z("tag:yaml.org,2002:set",{kind:"mapping",resolve:Q,construct:J}),y7}function h7(){if(RW)return g7;return RW=1,g7=mW().extend({implicit:[dW(),lW()],explicit:[cW(),pW(),iW(),nW()]}),g7}function VL(){if(PW)return G5;PW=1;let Z=h9(),X=u9(),Q=KL(),J=h7(),W=Object.prototype.hasOwnProperty,G=1,Y=2,$=3,z=4,U=1,V=2,q=3,B=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,F=/[\x85\u2028\u2029]/,L=/[,\[\]{}]/,I=/^(?:!|!!|![0-9A-Za-z-]+!)$/,A=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function N(H){return Object.prototype.toString.call(H)}function D(H){return H===10||H===13}function O(H){return H===9||H===32}function T(H){return H===9||H===32||H===10||H===13}function w(H){return H===44||H===91||H===93||H===123||H===125}function S(H){if(H>=48&&H<=57)return H-48;let j=H|32;if(j>=97&&j<=102)return j-97+10;return-1}function y(H){if(H===120)return 2;if(H===117)return 4;if(H===85)return 8;return 0}function x(H){if(H>=48&&H<=57)return H-48;return-1}function i(H){switch(H){case 48:return"\x00";case 97:return"\x07";case 98:return"\b";case 116:return"\t";case 9:return"\t";case 110:return`
|
|
30
|
+
`;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 r(H){if(H<=65535)return String.fromCharCode(H);return String.fromCharCode((H-65536>>10)+55296,(H-65536&1023)+56320)}function h(H,j,k){if(j==="__proto__")Object.defineProperty(H,j,{configurable:!0,enumerable:!0,writable:!0,value:k});else H[j]=k}let n=Array(256),W0=Array(256);for(let H=0;H<256;H++)n[H]=i(H)?1:0,W0[H]=i(H);function G0(H,j){this.input=H,this.filename=j.filename||null,this.schema=j.schema||J,this.onWarning=j.onWarning||null,this.legacy=j.legacy||!1,this.json=j.json||!1,this.listener=j.listener||null,this.maxDepth=typeof j.maxDepth==="number"?j.maxDepth:100,this.maxTotalMergeKeys=typeof j.maxTotalMergeKeys==="number"?j.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=H.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function H0(H,j){let k={name:H.filename,buffer:H.input.slice(0,-1),position:H.position,line:H.line,column:H.position-H.lineStart};return k.snippet=Q(k),new X(j,k)}function E(H,j){throw H0(H,j)}function l(H,j){if(H.onWarning)H.onWarning.call(null,H0(H,j))}function c(H,j,k){let g=H.anchorMapTransactions;if(g.length!==0){let _=g[g.length-1];if(!W.call(_,j))_[j]={existed:W.call(H.anchorMap,j),value:H.anchorMap[j]}}H.anchorMap[j]=k}function $0(H){H.anchorMapTransactions.push(Object.create(null))}function m(H){let j=H.anchorMapTransactions.pop(),k=H.anchorMapTransactions;if(k.length===0)return;let g=k[k.length-1],_=Object.keys(j);for(let p=0,M=_.length;p<M;p+=1){let R=_[p];if(!W.call(g,R))g[R]=j[R]}}function X0(H){let j=H.anchorMapTransactions.pop(),k=Object.keys(j);for(let g=k.length-1;g>=0;g-=1){let _=j[k[g]];if(_.existed)H.anchorMap[k[g]]=_.value;else delete H.anchorMap[k[g]]}}function a(H){return{position:H.position,line:H.line,lineStart:H.lineStart,lineIndent:H.lineIndent,firstTabInLine:H.firstTabInLine,tag:H.tag,anchor:H.anchor,kind:H.kind,result:H.result}}function Y0(H,j){H.position=j.position,H.line=j.line,H.lineStart=j.lineStart,H.lineIndent=j.lineIndent,H.firstTabInLine=j.firstTabInLine,H.tag=j.tag,H.anchor=j.anchor,H.kind=j.kind,H.result=j.result}let C0={YAML:function(j,k,g){if(j.version!==null)E(j,"duplication of %YAML directive");if(g.length!==1)E(j,"YAML directive accepts exactly one argument");let _=/^([0-9]+)\.([0-9]+)$/.exec(g[0]);if(_===null)E(j,"ill-formed argument of the YAML directive");let p=parseInt(_[1],10),M=parseInt(_[2],10);if(p!==1)E(j,"unacceptable YAML version of the document");if(j.version=g[0],j.checkLineBreaks=M<2,M!==1&&M!==2)l(j,"unsupported YAML version of the document")},TAG:function(j,k,g){let _;if(g.length!==2)E(j,"TAG directive accepts exactly two arguments");let p=g[0];if(_=g[1],!I.test(p))E(j,"ill-formed tag handle (first argument) of the TAG directive");if(W.call(j.tagMap,p))E(j,'there is a previously declared suffix for "'+p+'" tag handle');if(!A.test(_))E(j,"ill-formed tag prefix (second argument) of the TAG directive");try{_=decodeURIComponent(_)}catch(M){E(j,"tag prefix is malformed: "+_)}j.tagMap[p]=_}};function I0(H,j,k,g){if(j<k){let _=H.input.slice(j,k);if(g)for(let p=0,M=_.length;p<M;p+=1){let R=_.charCodeAt(p);if(!(R===9||R>=32&&R<=1114111))E(H,"expected valid JSON character")}else if(B.test(_))E(H,"the stream contains non-printable characters");H.result+=_}}function a0(H,j,k,g){if(!Z.isObject(k))E(H,"cannot merge mappings; the provided source object is unacceptable");let _=Object.keys(k);for(let p=0,M=_.length;p<M;p+=1){let R=_[p];if(H.maxTotalMergeKeys!==-1&&++H.totalMergeKeys>H.maxTotalMergeKeys)E(H,"merge keys exceeded maxTotalMergeKeys ("+H.maxTotalMergeKeys+")");if(!W.call(j,R))h(j,R,k[R]),g[R]=!0}}function Q0(H,j,k,g,_,p,M,R,u){if(Array.isArray(_)){_=Array.prototype.slice.call(_);for(let b=0,v=_.length;b<v;b+=1){if(Array.isArray(_[b]))E(H,"nested arrays are not supported inside keys");if(typeof _==="object"&&N(_[b])==="[object Object]")_[b]="[object Object]"}}if(typeof _==="object"&&N(_)==="[object Object]")_="[object Object]";if(_=String(_),j===null)j={};if(g==="tag:yaml.org,2002:merge")if(Array.isArray(p))for(let b=0,v=p.length;b<v;b+=1)a0(H,j,p[b],k);else a0(H,j,p,k);else{if(!H.json&&!W.call(k,_)&&W.call(j,_))H.line=M||H.line,H.lineStart=R||H.lineStart,H.position=u||H.position,E(H,"duplicated mapping key");h(j,_,p),delete k[_]}return j}function W6(H){let j=H.input.charCodeAt(H.position);if(j===10)H.position++;else if(j===13){if(H.position++,H.input.charCodeAt(H.position)===10)H.position++}else E(H,"a line break is expected");H.line+=1,H.lineStart=H.position,H.firstTabInLine=-1}function N0(H,j,k){let g=0,_=H.input.charCodeAt(H.position);while(_!==0){while(O(_)){if(_===9&&H.firstTabInLine===-1)H.firstTabInLine=H.position;_=H.input.charCodeAt(++H.position)}if(j&&_===35)do _=H.input.charCodeAt(++H.position);while(_!==10&&_!==13&&_!==0);if(D(_)){W6(H),_=H.input.charCodeAt(H.position),g++,H.lineIndent=0;while(_===32)H.lineIndent++,_=H.input.charCodeAt(++H.position)}else break}if(k!==-1&&g!==0&&H.lineIndent<k)l(H,"deficient indentation");return g}function t0(H){let j=H.position,k=H.input.charCodeAt(j);if((k===45||k===46)&&k===H.input.charCodeAt(j+1)&&k===H.input.charCodeAt(j+2)){if(j+=3,k=H.input.charCodeAt(j),k===0||T(k))return!0}return!1}function p0(H,j){if(j===1)H.result+=" ";else if(j>1)H.result+=Z.repeat(`
|
|
31
|
+
`,j-1)}function e0(H,j,k){let g,_,p,M,R,u,b=H.kind,v=H.result,d=H.input.charCodeAt(H.position);if(T(d)||w(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96)return!1;if(d===63||d===45){let f=H.input.charCodeAt(H.position+1);if(T(f)||k&&w(f))return!1}H.kind="scalar",H.result="",g=_=H.position,p=!1;while(d!==0){if(d===58){let f=H.input.charCodeAt(H.position+1);if(T(f)||k&&w(f))break}else if(d===35){let f=H.input.charCodeAt(H.position-1);if(T(f))break}else if(H.position===H.lineStart&&t0(H)||k&&w(d))break;else if(D(d))if(M=H.line,R=H.lineStart,u=H.lineIndent,N0(H,!1,-1),H.lineIndent>=j){p=!0,d=H.input.charCodeAt(H.position);continue}else{H.position=_,H.line=M,H.lineStart=R,H.lineIndent=u;break}if(p)I0(H,g,_,!1),p0(H,H.line-M),g=_=H.position,p=!1;if(!O(d))_=H.position+1;d=H.input.charCodeAt(++H.position)}if(I0(H,g,_,!1),H.result)return!0;return H.kind=b,H.result=v,!1}function Q1(H,j){let k,g,_=H.input.charCodeAt(H.position);if(_!==39)return!1;H.kind="scalar",H.result="",H.position++,k=g=H.position;while((_=H.input.charCodeAt(H.position))!==0)if(_===39)if(I0(H,k,H.position,!0),_=H.input.charCodeAt(++H.position),_===39)k=H.position,H.position++,g=H.position;else return!0;else if(D(_))I0(H,k,g,!0),p0(H,N0(H,!1,j)),k=g=H.position;else if(H.position===H.lineStart&&t0(H))E(H,"unexpected end of the document within a single quoted scalar");else if(H.position++,!O(_))g=H.position;E(H,"unexpected end of the stream within a single quoted scalar")}function x6(H,j){let k,g,_,p=H.input.charCodeAt(H.position);if(p!==34)return!1;H.kind="scalar",H.result="",H.position++,k=g=H.position;while((p=H.input.charCodeAt(H.position))!==0)if(p===34)return I0(H,k,H.position,!0),H.position++,!0;else if(p===92){if(I0(H,k,H.position,!0),p=H.input.charCodeAt(++H.position),D(p))N0(H,!1,j);else if(p<256&&n[p])H.result+=W0[p],H.position++;else if((_=y(p))>0){let M=_,R=0;for(;M>0;M--)if(p=H.input.charCodeAt(++H.position),(_=S(p))>=0)R=(R<<4)+_;else E(H,"expected hexadecimal character");H.result+=r(R),H.position++}else E(H,"unknown escape sequence");k=g=H.position}else if(D(p))I0(H,k,g,!0),p0(H,N0(H,!1,j)),k=g=H.position;else if(H.position===H.lineStart&&t0(H))E(H,"unexpected end of the document within a double quoted scalar");else if(H.position++,!O(p))g=H.position;E(H,"unexpected end of the stream within a double quoted scalar")}function h4(H,j){let k=!0,g,_,p,M=H.tag,R,u=H.anchor,b,v,d,f,J0=Object.create(null),o,K0,V0,D0=H.input.charCodeAt(H.position);if(D0===91)b=93,f=!1,R=[];else if(D0===123)b=125,f=!0,R={};else return!1;if(H.anchor!==null)c(H,H.anchor,R);D0=H.input.charCodeAt(++H.position);while(D0!==0){if(N0(H,!0,j),D0=H.input.charCodeAt(H.position),D0===b)return H.position++,H.tag=M,H.anchor=u,H.kind=f?"mapping":"sequence",H.result=R,!0;else if(!k)E(H,"missed comma between flow collection entries");else if(D0===44)E(H,"expected the node content, but found ','");if(K0=o=V0=null,v=d=!1,D0===63){let _0=H.input.charCodeAt(H.position+1);if(T(_0))v=d=!0,H.position++,N0(H,!0,j)}if(g=H.line,_=H.lineStart,p=H.position,N1(H,j,G,!1,!0),K0=H.tag,o=H.result,N0(H,!0,j),D0=H.input.charCodeAt(H.position),(d||H.line===g)&&D0===58)v=!0,D0=H.input.charCodeAt(++H.position),N0(H,!0,j),N1(H,j,G,!1,!0),V0=H.result;if(f)Q0(H,R,J0,K0,o,V0,g,_,p);else if(v)R.push(Q0(H,null,J0,K0,o,V0,g,_,p));else R.push(o);if(N0(H,!0,j),D0=H.input.charCodeAt(H.position),D0===44)k=!0,D0=H.input.charCodeAt(++H.position);else k=!1}E(H,"unexpected end of the stream within a flow collection")}function u4(H,j){let k,g=U,_=!1,p=!1,M=j,R=0,u=!1,b,v=H.input.charCodeAt(H.position);if(v===124)k=!1;else if(v===62)k=!0;else return!1;H.kind="scalar",H.result="";while(v!==0)if(v=H.input.charCodeAt(++H.position),v===43||v===45)if(U===g)g=v===43?q:V;else E(H,"repeat of a chomping mode identifier");else if((b=x(v))>=0)if(b===0)E(H,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!p)M=j+b-1,p=!0;else E(H,"repeat of an indentation width identifier");else break;if(O(v)){do v=H.input.charCodeAt(++H.position);while(O(v));if(v===35)do v=H.input.charCodeAt(++H.position);while(!D(v)&&v!==0)}while(v!==0){W6(H),H.lineIndent=0,v=H.input.charCodeAt(H.position);while((!p||H.lineIndent<M)&&v===32)H.lineIndent++,v=H.input.charCodeAt(++H.position);if(!p&&H.lineIndent>M)M=H.lineIndent;if(D(v)){R++;continue}if(!p&&M===0)E(H,"missing indentation for block scalar");if(H.lineIndent<M){if(g===q)H.result+=Z.repeat(`
|
|
32
|
+
`,_?1+R:R);else if(g===U){if(_)H.result+=`
|
|
33
|
+
`}break}if(k)if(O(v))u=!0,H.result+=Z.repeat(`
|
|
34
|
+
`,_?1+R:R);else if(u)u=!1,H.result+=Z.repeat(`
|
|
35
|
+
`,R+1);else if(R===0){if(_)H.result+=" "}else H.result+=Z.repeat(`
|
|
36
|
+
`,R);else H.result+=Z.repeat(`
|
|
37
|
+
`,_?1+R:R);_=!0,p=!0,R=0;let d=H.position;while(!D(v)&&v!==0)v=H.input.charCodeAt(++H.position);I0(H,d,H.position,!1)}return!0}function I1(H,j){let{tag:k,anchor:g}=H,_=[],p=!1;if(H.firstTabInLine!==-1)return!1;if(H.anchor!==null)c(H,H.anchor,_);let M=H.input.charCodeAt(H.position);while(M!==0){if(H.firstTabInLine!==-1)H.position=H.firstTabInLine,E(H,"tab characters must not be used in indentation");if(M!==45)break;let R=H.input.charCodeAt(H.position+1);if(!T(R))break;if(p=!0,H.position++,N0(H,!0,-1)){if(H.lineIndent<=j){_.push(null),M=H.input.charCodeAt(H.position);continue}}let u=H.line;if(N1(H,j,$,!1,!0),_.push(H.result),N0(H,!0,-1),M=H.input.charCodeAt(H.position),(H.line===u||H.lineIndent>j)&&M!==0)E(H,"bad indentation of a sequence entry");else if(H.lineIndent<j)break}if(p)return H.tag=k,H.anchor=g,H.kind="sequence",H.result=_,!0;return!1}function v8(H,j,k){let g,_,p,M,R=H.tag,u=H.anchor,b={},v=Object.create(null),d=null,f=null,J0=null,o=!1,K0=!1;if(H.firstTabInLine!==-1)return!1;if(H.anchor!==null)c(H,H.anchor,b);let V0=H.input.charCodeAt(H.position);while(V0!==0){if(!o&&H.firstTabInLine!==-1)H.position=H.firstTabInLine,E(H,"tab characters must not be used in indentation");let D0=H.input.charCodeAt(H.position+1),_0=H.line;if((V0===63||V0===58)&&T(D0)){if(V0===63){if(o)Q0(H,b,v,d,f,null,_,p,M),d=f=J0=null;K0=!0,o=!0,g=!0}else if(o)o=!1,g=!0;else E(H,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");H.position+=1,V0=D0}else{if(_=H.line,p=H.lineStart,M=H.position,!N1(H,k,Y,!1,!0))break;if(H.line===_0){V0=H.input.charCodeAt(H.position);while(O(V0))V0=H.input.charCodeAt(++H.position);if(V0===58){if(V0=H.input.charCodeAt(++H.position),!T(V0))E(H,"a whitespace character is expected after the key-value separator within a block mapping");if(o)Q0(H,b,v,d,f,null,_,p,M),d=f=J0=null;K0=!0,o=!1,g=!1,d=H.tag,f=H.result}else if(K0)E(H,"can not read an implicit mapping pair; a colon is missed");else return H.tag=R,H.anchor=u,!0}else if(K0)E(H,"can not read a block mapping entry; a multiline key may not be an implicit key");else return H.tag=R,H.anchor=u,!0}if(H.line===_0||H.lineIndent>j){if(o)_=H.line,p=H.lineStart,M=H.position;if(N1(H,j,z,!0,g))if(o)f=H.result;else J0=H.result;if(!o)Q0(H,b,v,d,f,J0,_,p,M),d=f=J0=null;N0(H,!0,-1),V0=H.input.charCodeAt(H.position)}if((H.line===_0||H.lineIndent>j)&&V0!==0)E(H,"bad indentation of a mapping entry");else if(H.lineIndent<j)break}if(o)Q0(H,b,v,d,f,null,_,p,M);if(K0)H.tag=R,H.anchor=u,H.kind="mapping",H.result=b;return K0}function dZ(H){let j=!1,k=!1,g,_,p=H.input.charCodeAt(H.position);if(p!==33)return!1;if(H.tag!==null)E(H,"duplication of a tag property");if(p=H.input.charCodeAt(++H.position),p===60)j=!0,p=H.input.charCodeAt(++H.position);else if(p===33)k=!0,g="!!",p=H.input.charCodeAt(++H.position);else g="!";let M=H.position;if(j){do p=H.input.charCodeAt(++H.position);while(p!==0&&p!==62);if(H.position<H.length)_=H.input.slice(M,H.position),p=H.input.charCodeAt(++H.position);else E(H,"unexpected end of the stream within a verbatim tag")}else{while(p!==0&&!T(p)){if(p===33)if(!k){if(g=H.input.slice(M-1,H.position+1),!I.test(g))E(H,"named tag handle cannot contain such characters");k=!0,M=H.position+1}else E(H,"tag suffix cannot contain exclamation marks");p=H.input.charCodeAt(++H.position)}if(_=H.input.slice(M,H.position),L.test(_))E(H,"tag suffix cannot contain flow indicator characters")}if(_&&!A.test(_))E(H,"tag name cannot contain such characters: "+_);try{_=decodeURIComponent(_)}catch(R){E(H,"tag name is malformed: "+_)}if(j)H.tag=_;else if(W.call(H.tagMap,g))H.tag=H.tagMap[g]+_;else if(g==="!")H.tag="!"+_;else if(g==="!!")H.tag="tag:yaml.org,2002:"+_;else E(H,'undeclared tag handle "'+g+'"');return!0}function y8(H){let j=H.input.charCodeAt(H.position);if(j!==38)return!1;if(H.anchor!==null)E(H,"duplication of an anchor property");j=H.input.charCodeAt(++H.position);let k=H.position;while(j!==0&&!T(j)&&!w(j))j=H.input.charCodeAt(++H.position);if(H.position===k)E(H,"name of an anchor node must contain at least one character");return H.anchor=H.input.slice(k,H.position),!0}function g8(H){let j=H.input.charCodeAt(H.position);if(j!==42)return!1;j=H.input.charCodeAt(++H.position);let k=H.position;while(j!==0&&!T(j)&&!w(j))j=H.input.charCodeAt(++H.position);if(H.position===k)E(H,"name of an alias node must contain at least one character");let g=H.input.slice(k,H.position);if(!W.call(H.anchorMap,g))E(H,'unidentified alias "'+g+'"');return H.result=H.anchorMap[g],N0(H,!0,-1),!0}function lZ(H,j,k,g){let _=a(H);if($0(H),Y0(H,j),H.tag=null,H.anchor=null,H.kind=null,H.result=null,v8(H,k,g)&&H.kind==="mapping")return m(H),!0;return X0(H),Y0(H,_),!1}function N1(H,j,k,g,_){let p,M,R=1,u=!1,b=!1,v=null,d,f,J0;if(H.depth>=H.maxDepth)E(H,"nesting exceeded maxDepth ("+H.maxDepth+")");if(H.depth+=1,H.listener!==null)H.listener("open",H);H.tag=null,H.anchor=null,H.kind=null,H.result=null;let o=p=M=z===k||$===k;if(g){if(N0(H,!0,-1)){if(u=!0,H.lineIndent>j)R=1;else if(H.lineIndent===j)R=0;else if(H.lineIndent<j)R=-1}}if(R===1)while(!0){let K0=H.input.charCodeAt(H.position),V0=a(H);if(u&&(K0===33&&H.tag!==null||K0===38&&H.anchor!==null))break;if(!dZ(H)&&!y8(H))break;if(v===null)v=V0;if(N0(H,!0,-1)){if(u=!0,M=o,H.lineIndent>j)R=1;else if(H.lineIndent===j)R=0;else if(H.lineIndent<j)R=-1}else M=!1}if(M)M=u||_;if(R===1||z===k){if(G===k||Y===k)f=j;else f=j+1;if(J0=H.position-H.lineStart,R===1)if(M&&(I1(H,J0)||v8(H,J0,f))||h4(H,f))b=!0;else{let K0=H.input.charCodeAt(H.position);if(v!==null&&o&&!M&&K0!==124&&K0!==62&&lZ(H,v,v.position-v.lineStart,f))b=!0;else if(p&&u4(H,f)||Q1(H,f)||x6(H,f))b=!0;else if(g8(H)){if(b=!0,H.tag!==null||H.anchor!==null)E(H,"alias node should not have any properties")}else if(e0(H,f,G===k)){if(b=!0,H.tag===null)H.tag="?"}if(H.anchor!==null)c(H,H.anchor,H.result)}else if(R===0)b=M&&I1(H,J0)}if(H.tag===null){if(H.anchor!==null)c(H,H.anchor,H.result)}else if(H.tag==="?"){if(H.result!==null&&H.kind!=="scalar")E(H,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+H.kind+'"');for(let K0=0,V0=H.implicitTypes.length;K0<V0;K0+=1)if(d=H.implicitTypes[K0],d.resolve(H.result)){if(H.result=d.construct(H.result),H.tag=d.tag,H.anchor!==null)c(H,H.anchor,H.result);break}}else if(H.tag!=="!"){if(W.call(H.typeMap[H.kind||"fallback"],H.tag))d=H.typeMap[H.kind||"fallback"][H.tag];else{d=null;let K0=H.typeMap.multi[H.kind||"fallback"];for(let V0=0,D0=K0.length;V0<D0;V0+=1)if(H.tag.slice(0,K0[V0].tag.length)===K0[V0].tag){d=K0[V0];break}}if(!d)E(H,"unknown tag !<"+H.tag+">");if(H.result!==null&&d.kind!==H.kind)E(H,"unacceptable node kind for !<"+H.tag+'> tag; it should be "'+d.kind+'", not "'+H.kind+'"');if(!d.resolve(H.result,H.tag))E(H,"cannot resolve a node with !<"+H.tag+"> explicit tag");else if(H.result=d.construct(H.result,H.tag),H.anchor!==null)c(H,H.anchor,H.result)}if(H.listener!==null)H.listener("close",H);return H.depth-=1,H.tag!==null||H.anchor!==null||b}function cZ(H){let j=H.position,k=!1,g;H.version=null,H.checkLineBreaks=H.legacy,H.tagMap=Object.create(null),H.anchorMap=Object.create(null);while((g=H.input.charCodeAt(H.position))!==0){if(N0(H,!0,-1),g=H.input.charCodeAt(H.position),H.lineIndent>0||g!==37)break;k=!0,g=H.input.charCodeAt(++H.position);let _=H.position;while(g!==0&&!T(g))g=H.input.charCodeAt(++H.position);let p=H.input.slice(_,H.position),M=[];if(p.length<1)E(H,"directive name must not be less than one character in length");while(g!==0){while(O(g))g=H.input.charCodeAt(++H.position);if(g===35){do g=H.input.charCodeAt(++H.position);while(g!==0&&!D(g));break}if(D(g))break;_=H.position;while(g!==0&&!T(g))g=H.input.charCodeAt(++H.position);M.push(H.input.slice(_,H.position))}if(g!==0)W6(H);if(W.call(C0,p))C0[p](H,p,M);else l(H,'unknown document directive "'+p+'"')}if(N0(H,!0,-1),H.lineIndent===0&&H.input.charCodeAt(H.position)===45&&H.input.charCodeAt(H.position+1)===45&&H.input.charCodeAt(H.position+2)===45)H.position+=3,N0(H,!0,-1);else if(k)E(H,"directives end mark is expected");if(N1(H,H.lineIndent-1,z,!1,!0),N0(H,!0,-1),H.checkLineBreaks&&F.test(H.input.slice(j,H.position)))l(H,"non-ASCII line breaks are interpreted as content");if(H.documents.push(H.result),H.position===H.lineStart&&t0(H)){if(H.input.charCodeAt(H.position)===46)H.position+=3,N0(H,!0,-1);return}if(H.position<H.length-1)E(H,"end of the stream or a document separator is expected")}function f8(H,j){if(H=String(H),j=j||{},H.length!==0){if(H.charCodeAt(H.length-1)!==10&&H.charCodeAt(H.length-1)!==13)H+=`
|
|
38
|
+
`;if(H.charCodeAt(0)===65279)H=H.slice(1)}let k=new G0(H,j),g=H.indexOf("\x00");if(g!==-1)k.position=g,E(k,"null byte is not allowed in input");k.input+="\x00";while(k.input.charCodeAt(k.position)===32)k.lineIndent+=1,k.position+=1;while(k.position<k.length-1)cZ(k);return k.documents}function h8(H,j,k){if(j!==null&&typeof j==="object"&&typeof k>"u")k=j,j=null;let g=f8(H,k);if(typeof j!=="function")return g;for(let _=0,p=g.length;_<p;_+=1)j(g[_])}function pZ(H,j){let k=f8(H,j);if(k.length===0)return;else if(k.length===1)return k[0];throw new X("expected a single document in the stream, but found more")}return G5.loadAll=h8,G5.load=pZ,G5}function HL(){if(CW)return f7;CW=1;let Z=h9(),X=u9(),Q=h7(),J=Object.prototype.toString,W=Object.prototype.hasOwnProperty,G=65279,Y=9,$=10,z=13,U=32,V=33,q=34,B=35,F=37,L=38,I=39,A=42,N=44,D=45,O=58,T=61,w=62,S=63,y=64,x=91,i=93,r=96,h=123,n=124,W0=125,G0={};G0[0]="\\0",G0[7]="\\a",G0[8]="\\b",G0[9]="\\t",G0[10]="\\n",G0[11]="\\v",G0[12]="\\f",G0[13]="\\r",G0[27]="\\e",G0[34]="\\\"",G0[92]="\\\\",G0[133]="\\N",G0[160]="\\_",G0[8232]="\\L",G0[8233]="\\P";let H0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],E=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function l(M,R){if(R===null)return{};let u={},b=Object.keys(R);for(let v=0,d=b.length;v<d;v+=1){let f=b[v],J0=String(R[f]);if(f.slice(0,2)==="!!")f="tag:yaml.org,2002:"+f.slice(2);let o=M.compiledTypeMap.fallback[f];if(o&&W.call(o.styleAliases,J0))J0=o.styleAliases[J0];u[f]=J0}return u}function c(M){let R,u,b=M.toString(16).toUpperCase();if(M<=255)R="x",u=2;else if(M<=65535)R="u",u=4;else if(M<=4294967295)R="U",u=8;else throw new X("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+R+Z.repeat("0",u-b.length)+b}let $0=1,m=2;function X0(M){this.schema=M.schema||Q,this.indent=Math.max(1,M.indent||2),this.noArrayIndent=M.noArrayIndent||!1,this.skipInvalid=M.skipInvalid||!1,this.flowLevel=Z.isNothing(M.flowLevel)?-1:M.flowLevel,this.styleMap=l(this.schema,M.styles||null),this.sortKeys=M.sortKeys||!1,this.lineWidth=M.lineWidth||80,this.noRefs=M.noRefs||!1,this.noCompatMode=M.noCompatMode||!1,this.condenseFlow=M.condenseFlow||!1,this.quotingType=M.quotingType==='"'?m:$0,this.forceQuotes=M.forceQuotes||!1,this.replacer=typeof M.replacer==="function"?M.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function a(M,R){let u=Z.repeat(" ",R),b=0,v="",d=M.length;while(b<d){let f,J0=M.indexOf(`
|
|
39
|
+
`,b);if(J0===-1)f=M.slice(b),b=d;else f=M.slice(b,J0+1),b=J0+1;if(f.length&&f!==`
|
|
40
|
+
`)v+=u;v+=f}return v}function Y0(M,R){return`
|
|
41
|
+
`+Z.repeat(" ",M.indent*R)}function C0(M,R){for(let u=0,b=M.implicitTypes.length;u<b;u+=1)if(M.implicitTypes[u].resolve(R))return!0;return!1}function I0(M){return M===U||M===Y}function a0(M){return M>=32&&M<=126||M>=161&&M<=55295&&M!==8232&&M!==8233||M>=57344&&M<=65533&&M!==G||M>=65536&&M<=1114111}function Q0(M){return a0(M)&&M!==G&&M!==z&&M!==$}function W6(M,R,u){let b=Q0(M),v=b&&!I0(M);return(u?b:b&&M!==N&&M!==x&&M!==i&&M!==h&&M!==W0)&&M!==B&&!(R===O&&!v)||Q0(R)&&!I0(R)&&M===B||R===O&&v}function N0(M){return a0(M)&&M!==G&&!I0(M)&&M!==D&&M!==S&&M!==O&&M!==N&&M!==x&&M!==i&&M!==h&&M!==W0&&M!==B&&M!==L&&M!==A&&M!==V&&M!==n&&M!==T&&M!==w&&M!==I&&M!==q&&M!==F&&M!==y&&M!==r}function t0(M){return!I0(M)&&M!==O}function p0(M,R){let u=M.charCodeAt(R),b;if(u>=55296&&u<=56319&&R+1<M.length){if(b=M.charCodeAt(R+1),b>=56320&&b<=57343)return(u-55296)*1024+b-56320+65536}return u}function e0(M){return/^\n* /.test(M)}let Q1=1,x6=2,h4=3,u4=4,I1=5;function v8(M,R,u,b,v,d,f,J0){let o,K0=0,V0=null,D0=!1,_0=!1,TJ=b!==-1,S9=-1,_9=N0(p0(M,0))&&t0(p0(M,M.length-1));if(R||f)for(o=0;o<M.length;K0>=65536?o+=2:o++){if(K0=p0(M,o),!a0(K0))return I1;_9=_9&&W6(K0,V0,J0),V0=K0}else{for(o=0;o<M.length;K0>=65536?o+=2:o++){if(K0=p0(M,o),K0===$){if(D0=!0,TJ)_0=_0||o-S9-1>b&&M[S9+1]!==" ",S9=o}else if(!a0(K0))return I1;_9=_9&&W6(K0,V0,J0),V0=K0}_0=_0||TJ&&(o-S9-1>b&&M[S9+1]!==" ")}if(!D0&&!_0){if(_9&&!f&&!v(M))return Q1;return d===m?I1:x6}if(u>9&&e0(M))return I1;if(!f)return _0?u4:h4;return d===m?I1:x6}function dZ(M,R,u,b,v){M.dump=function(){if(R.length===0)return M.quotingType===m?'""':"''";if(!M.noCompatMode){if(H0.indexOf(R)!==-1||E.test(R))return M.quotingType===m?'"'+R+'"':"'"+R+"'"}let d=M.indent*Math.max(1,u),f=M.lineWidth===-1?-1:Math.max(Math.min(M.lineWidth,40),M.lineWidth-d),J0=b||M.flowLevel>-1&&u>=M.flowLevel;function o(K0){return C0(M,K0)}switch(v8(R,J0,M.indent,f,o,M.quotingType,M.forceQuotes&&!b,v)){case Q1:return R;case x6:return"'"+R.replace(/'/g,"''")+"'";case h4:return"|"+y8(R,M.indent)+g8(a(R,d));case u4:return">"+y8(R,M.indent)+g8(a(lZ(R,f),d));case I1:return'"'+cZ(R)+'"';default:throw new X("impossible error: invalid scalar style")}}()}function y8(M,R){let u=e0(M)?String(R):"",b=M[M.length-1]===`
|
|
42
|
+
`,d=b&&(M[M.length-2]===`
|
|
43
|
+
`||M===`
|
|
44
|
+
`)?"+":b?"":"-";return u+d+`
|
|
45
|
+
`}function g8(M){return M[M.length-1]===`
|
|
46
|
+
`?M.slice(0,-1):M}function lZ(M,R){let u=/(\n+)([^\n]*)/g,b=function(){let J0=M.indexOf(`
|
|
47
|
+
`);return J0=J0!==-1?J0:M.length,u.lastIndex=J0,N1(M.slice(0,J0),R)}(),v=M[0]===`
|
|
48
|
+
`||M[0]===" ",d,f;while(f=u.exec(M)){let J0=f[1],o=f[2];d=o[0]===" ",b+=J0+(!v&&!d&&o!==""?`
|
|
49
|
+
`:"")+N1(o,R),v=d}return b}function N1(M,R){if(M===""||M[0]===" ")return M;let u=/ [^ ]/g,b,v=0,d,f=0,J0=0,o="";while(b=u.exec(M)){if(J0=b.index,J0-v>R)d=f>v?f:J0,o+=`
|
|
50
|
+
`+M.slice(v,d),v=d+1;f=J0}if(o+=`
|
|
51
|
+
`,M.length-v>R&&f>v)o+=M.slice(v,f)+`
|
|
52
|
+
`+M.slice(f+1);else o+=M.slice(v);return o.slice(1)}function cZ(M){let R="",u=0;for(let b=0;b<M.length;u>=65536?b+=2:b++){u=p0(M,b);let v=G0[u];if(!v&&a0(u)){if(R+=M[b],u>=65536)R+=M[b+1]}else R+=v||c(u)}return R}function f8(M,R,u){let b="",v=M.tag;for(let d=0,f=u.length;d<f;d+=1){let J0=u[d];if(M.replacer)J0=M.replacer.call(u,String(d),J0);if(k(M,R,J0,!1,!1)||typeof J0>"u"&&k(M,R,null,!1,!1)){if(b!=="")b+=","+(!M.condenseFlow?" ":"");b+=M.dump}}M.tag=v,M.dump="["+b+"]"}function h8(M,R,u,b){let v="",d=M.tag;for(let f=0,J0=u.length;f<J0;f+=1){let o=u[f];if(M.replacer)o=M.replacer.call(u,String(f),o);if(k(M,R+1,o,!0,!0,!1,!0)||typeof o>"u"&&k(M,R+1,null,!0,!0,!1,!0)){if(!b||v!=="")v+=Y0(M,R);if(M.dump&&$===M.dump.charCodeAt(0))v+="-";else v+="- ";v+=M.dump}}M.tag=d,M.dump=v||"[]"}function pZ(M,R,u){let b="",v=M.tag,d=Object.keys(u);for(let f=0,J0=d.length;f<J0;f+=1){let o="";if(b!=="")o+=", ";if(M.condenseFlow)o+='"';let K0=d[f],V0=u[K0];if(M.replacer)V0=M.replacer.call(u,K0,V0);if(!k(M,R,K0,!1,!1))continue;if(M.dump.length>1024)o+="? ";if(o+=M.dump+(M.condenseFlow?'"':"")+":"+(M.condenseFlow?"":" "),!k(M,R,V0,!1,!1))continue;o+=M.dump,b+=o}M.tag=v,M.dump="{"+b+"}"}function H(M,R,u,b){let v="",d=M.tag,f=Object.keys(u);if(M.sortKeys===!0)f.sort();else if(typeof M.sortKeys==="function")f.sort(M.sortKeys);else if(M.sortKeys)throw new X("sortKeys must be a boolean or a function");for(let J0=0,o=f.length;J0<o;J0+=1){let K0="";if(!b||v!=="")K0+=Y0(M,R);let V0=f[J0],D0=u[V0];if(M.replacer)D0=M.replacer.call(u,V0,D0);if(!k(M,R+1,V0,!0,!0,!0))continue;let _0=M.tag!==null&&M.tag!=="?"||M.dump&&M.dump.length>1024;if(_0)if(M.dump&&$===M.dump.charCodeAt(0))K0+="?";else K0+="? ";if(K0+=M.dump,_0)K0+=Y0(M,R);if(!k(M,R+1,D0,!0,_0))continue;if(M.dump&&$===M.dump.charCodeAt(0))K0+=":";else K0+=": ";K0+=M.dump,v+=K0}M.tag=d,M.dump=v||"{}"}function j(M,R,u){let b=u?M.explicitTypes:M.implicitTypes;for(let v=0,d=b.length;v<d;v+=1){let f=b[v];if((f.instanceOf||f.predicate)&&(!f.instanceOf||typeof R==="object"&&R instanceof f.instanceOf)&&(!f.predicate||f.predicate(R))){if(u)if(f.multi&&f.representName)M.tag=f.representName(R);else M.tag=f.tag;else M.tag="?";if(f.represent){let J0=M.styleMap[f.tag]||f.defaultStyle,o;if(J.call(f.represent)==="[object Function]")o=f.represent(R,J0);else if(W.call(f.represent,J0))o=f.represent[J0](R,J0);else throw new X("!<"+f.tag+'> tag resolver accepts not "'+J0+'" style');M.dump=o}return!0}}return!1}function k(M,R,u,b,v,d,f){if(M.tag=null,M.dump=u,!j(M,u,!1))j(M,u,!0);let J0=J.call(M.dump),o=b;if(b)b=M.flowLevel<0||M.flowLevel>R;let K0=J0==="[object Object]"||J0==="[object Array]",V0,D0;if(K0)V0=M.duplicates.indexOf(u),D0=V0!==-1;if(M.tag!==null&&M.tag!=="?"||D0||M.indent!==2&&R>0)v=!1;if(D0&&M.usedDuplicates[V0])M.dump="*ref_"+V0;else{if(K0&&D0&&!M.usedDuplicates[V0])M.usedDuplicates[V0]=!0;if(J0==="[object Object]"){if(b&&Object.keys(M.dump).length!==0){if(H(M,R,M.dump,v),D0)M.dump="&ref_"+V0+M.dump}else if(pZ(M,R,M.dump),D0)M.dump="&ref_"+V0+" "+M.dump}else if(J0==="[object Array]"){if(b&&M.dump.length!==0){if(M.noArrayIndent&&!f&&R>0)h8(M,R-1,M.dump,v);else h8(M,R,M.dump,v);if(D0)M.dump="&ref_"+V0+M.dump}else if(f8(M,R,M.dump),D0)M.dump="&ref_"+V0+" "+M.dump}else if(J0==="[object String]"){if(M.tag!=="?")dZ(M,M.dump,R,d,o)}else if(J0==="[object Undefined]")return!1;else{if(M.skipInvalid)return!1;throw new X("unacceptable kind of an object to dump "+J0)}if(M.tag!==null&&M.tag!=="?"){let _0=encodeURI(M.tag[0]==="!"?M.tag.slice(1):M.tag).replace(/!/g,"%21");if(M.tag[0]==="!")_0="!"+_0;else if(_0.slice(0,18)==="tag:yaml.org,2002:")_0="!!"+_0.slice(18);else _0="!<"+_0+">";M.dump=_0+" "+M.dump}}return!0}function g(M,R){let u=[],b=[];_(M,u,b);let v=b.length;for(let d=0;d<v;d+=1)R.duplicates.push(u[b[d]]);R.usedDuplicates=Array(v)}function _(M,R,u){if(M!==null&&typeof M==="object"){let b=R.indexOf(M);if(b!==-1){if(u.indexOf(b)===-1)u.push(b)}else if(R.push(M),Array.isArray(M))for(let v=0,d=M.length;v<d;v+=1)_(M[v],R,u);else{let v=Object.keys(M);for(let d=0,f=v.length;d<f;d+=1)_(M[v[d]],R,u)}}}function p(M,R){R=R||{};let u=new X0(R);if(!u.noRefs)g(M,u);let b=M;if(u.replacer)b=u.replacer.call({"":b},"",b);if(k(u,0,b,!0,!0))return u.dump+`
|
|
53
|
+
`;return""}return f7.dump=p,f7}function qL(){if(SW)return G6;SW=1;let Z=VL(),X=HL();function Q(J,W){return function(){throw Error("Function yaml."+J+" is removed in js-yaml 4. Use yaml."+W+" instead, which is now safe by default.")}}return G6.Type=K6(),G6.Schema=_W(),G6.FAILSAFE_SCHEMA=vW(),G6.JSON_SCHEMA=uW(),G6.CORE_SCHEMA=mW(),G6.DEFAULT_SCHEMA=h7(),G6.load=Z.load,G6.loadAll=Z.loadAll,G6.dump=X.dump,G6.YAMLException=u9(),G6.types={binary:cW(),float:hW(),map:bW(),null:yW(),pairs:iW(),set:nW(),timestamp:dW(),bool:gW(),int:fW(),merge:lW(),omap:pW(),seq:xW(),str:kW()},G6.safeLoad=Q("safeLoad","load"),G6.safeLoadAll=Q("safeLoadAll","loadAll"),G6.safeDump=Q("safeDump","dump"),G6}var G6,G5,r1,YW,M7,$W,A7,zW,I7,UW,N7,KW,D7,VW,T7,HW,w7,qW,j7,BW,O7,FW,E7,LW,R7,MW,P7,AW,C7,IW,S7,NW,_7,DW,k7,TW,x7,wW,b7,jW,v7,OW,y7,EW,g7,RW,PW,f7,CW,SW,BL,Y5,Wv,Gv,Yv,rW,$v,zv,Uv,Kv,Vv,Hv,qv,Bv,Fv,Lv;var u7=s(()=>{G6={},G5={},r1={};f7={};BL=qL(),Y5=UL(BL),{Type:Wv,Schema:Gv,FAILSAFE_SCHEMA:Yv,JSON_SCHEMA:rW,CORE_SCHEMA:$v,DEFAULT_SCHEMA:zv,load:Uv,loadAll:Kv,dump:Vv,YAMLException:Hv,types:qv,safeLoad:Bv,safeLoadAll:Fv,safeDump:Lv}=Y5});var aW;var oW=s(()=>{f6();u7();u7();aW={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(Z){let X=Z.data;if(Buffer.isBuffer(X))X=X.toString();if(typeof X==="string")try{return Y5.load(X,{schema:rW})}catch{try{return Y5.load(X)}catch(Q){throw new g6(Q?.message||"Parser Error",Z.url)}}else return X}}});var FL,sW;var tW=s(()=>{f6();FL=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,sW={order:300,allowEmpty:!0,encoding:"utf8",canParse(Z){return(typeof Z.data==="string"||Buffer.isBuffer(Z.data))&&FL.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 g6("data is not text",Z.url)}}});var LL,eW;var ZG=s(()=>{LL=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,eW={order:400,allowEmpty:!0,canParse(Z){return Buffer.isBuffer(Z.data)&&LL.test(Z.url)},parse(Z){if(Buffer.isBuffer(Z.data))return Z.data;else return Buffer.from(Z.data)}}});var m7;var d7=s(()=>{M6();f6();m7={order:100,canRead(Z){return a8(Z.url)},async read(Z){let X,Q=await import("fs");try{X=s4(Z.url)}catch(J){let W=J;throw W.message=`Malformed URI: ${Z.url}: ${W.message}`,new r6(W,Z.url)}if(X.endsWith("/")||X.endsWith("\\"))X=X.slice(0,-1);try{return await Q.promises.readFile(X)}catch(J){let W=J;throw W.message=`Error opening file ${X}: ${W.message}`,new r6(W,X)}}}});async function XG(Z,X,Q){Z=o4(Z);let J=Q||[];J.push(Z.href);try{if(X.safeUrlResolver&&r8(Z.href))throw Error(`Unsafe URL blocked by safeUrlResolver: ${Z.href}`);let W=await ML(Z,X);if(W.status>=400){let G=Error(`HTTP ERROR ${W.status}`);throw G.status=W.status,G}else if(W.status>=300)if(!Number.isNaN(X.redirects)&&J.length>X.redirects){let G=Error(`Error downloading ${J[0]}.
|
|
53
54
|
Too many redirects:
|
|
54
|
-
${
|
|
55
|
-
`)}`);throw G.status=J.status,new j4(G)}else{let G=QH(J,"location");if(!G){let z=Error(`HTTP ${J.status} redirect with no location header`);throw z.status=J.status,z}let Y=w0(Z.href,G);return xW(Y,X,W)}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 j4(G,Z.href)}}async function XH(Z,X){let Q,W;if(X.timeout&&typeof AbortController<"u")Q=new AbortController,W=setTimeout(()=>Q.abort(),X.timeout);let J=await fetch(Z,{method:"GET",headers:X.headers||{},credentials:X.withCredentials?"include":"same-origin",redirect:"manual",signal:Q?Q.signal:null});if(W)clearTimeout(W);return J}function QH(Z,X){return Z.headers.get(X)}var xZ;var vZ=c(()=>{a0();B4();xZ={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return jQ(Z.url)&&(!this.safeUrlResolver||!Q8(Z.url))},read(Z){let X=V1(Z.url);if(typeof window<"u"&&!X.protocol)X.protocol=V1(location.href).protocol;return xW(X,this)}}});function fW(Z,X){if(vW(X)){let Q=Object.keys(X).filter((W)=>!["__proto__","constructor","prototype"].includes(W));for(let W=0;W<Q.length;W++){let J=Q[W],G=X[J],Y=Z[J];if(vW(G))Z[J]=fW(Y||{},G);else if(G!==void 0)Z[J]=G}}return Z}function vW(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var yW=()=>{return{parse:{json:{...gQ},yaml:{...PW},text:{...SW},binary:{...bW}},resolve:{file:{...bZ},http:{...xZ},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},gW=(Z)=>{let X=yW();if(Z)fW(X,Z);return X};var yZ=c(()=>{fQ();CW();kW();_W();_Z();vZ()});function WH(Z){let X,Q,W,J,G=Array.prototype.slice.call(Z);if(typeof G[G.length-1]==="function")J=G.pop();if(typeof G[0]==="string")if(X=G[0],typeof G[2]==="object")Q=G[1],W=G[2];else Q=void 0,W=G[1];else X="",Q=G[0],W=G[1];try{W=gW(W)}catch(Y){console.error(`JSON Schema Ref Parser: Error normalizing options: ${Y}`)}if(!W.mutateInputSchema&&typeof Q==="object")Q=JSON.parse(JSON.stringify(Q));return{path:X,schema:Q,options:W,callback:J}}var Z9;var hW=c(()=>{yZ();Z9=WH});function JH(Z,X){if(!X.resolve?.external)return Promise.resolve();try{let Q=Z.$refs._root$Ref.dynamicIdScope?d0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,W=gZ(Z.schema,Z.$refs._root$Ref.path+"#",Q,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,X);return Promise.all(W)}catch(Q){return Promise.reject(Q)}}function gZ(Z,X,Q,W,J,G,Y,z){Y||=new Set;let q=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!Y.has(Z)){Y.add(Z);let K=Q;if(I0.isExternal$Ref(Z))q.push(GH(Z,X,K,W,J,G));let V=Object.keys(Z);for(let B of V){let H=s0.join(X,B),F=Z[B],A=W&&F&&typeof F==="object"&&!ArrayBuffer.isView(F)?d0(K,F):K;q=q.concat(gZ(F,H,A,W,J,G,Y,z))}}return q}async function GH(Z,X,Q,W,J,G){let z=G.dereference?.externalReferenceResolution==="root"?f6():W?Q:X,q=w0(z,Z.$ref),K=j0(q),V=J._get$Ref(K);if(V)return Promise.resolve(V.value);try{let B=Z.$ref,H={url:q,baseUrl:z};if(typeof B==="string")H.reference=B;let F=await V8(H,J,G),A=J._get$Ref(K),M=gZ(F,K+"#",K,A?.dynamicIdScope??!1,J,G,new Set,!0);return Promise.all(M)}catch(B){if(!G?.continueOnError||!x4(B))throw B;if(J._$refs[K])B.source=decodeURI(j0(X)),B.path=J8(b4(X));return[]}}var uW;var mW=c(()=>{L1();a1();zZ();a0();B4();h6();uW=JH});function YH(Z,X){let Q=Z.$refs._root$Ref.dynamicIdScope?d0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,W=[];fZ(Z,"schema",Z.$refs._root$Ref.path+"#",Q,Z.$refs._root$Ref.dynamicIdScope,"#",0,W,Z.$refs,X);let J=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(zH(W,X,J),(X.bundle||{}).optimizeInternalRefs!==!1)KH(W,Z.schema)}function fZ(Z,X,Q,W,J,G,Y,z,q,K){let V=X===null?Z:Z[X],B=K.bundle||{},H=B.excludedPathMatcher||(()=>!1);if(V&&typeof V==="object"&&!ArrayBuffer.isView(V)&&!H(G)){let F=W;if(I0.isAllowed$Ref(V))lW(Z,X,Q,F,J,G,Y,z,q,K);else{let A=Object.keys(V).sort((M,I)=>{if(M==="definitions"||M==="$defs")return-1;else if(I==="definitions"||I==="$defs")return 1;else return M.length-I.length});for(let M of A){let I=s0.join(Q,M),N=s0.join(G,M),T=V[M],S=J&&T&&typeof T==="object"&&!ArrayBuffer.isView(T)?d0(F,T):F;if(I0.isAllowed$Ref(T))lW(V,M,I,S,J,N,Y,z,q,K);else fZ(V,M,I,S,J,N,Y,z,q,K);if(T&&typeof T==="object"&&!Array.isArray(T)){if("$ref"in T)B?.onBundle?.(T.$ref,V[M],V,M)}}}}}function lW(Z,X,Q,W,J,G,Y,z,q,K){let V=X===null?Z:Z[X],B=w0(J?W:Q,V.$ref),H=q._resolve(B,G,K);if(H===null)return;let A=s0.parse(G).length,M=j0(H.path),I=b4(H.path),N=M!==q._root$Ref.path&&!q._aliases[M],T=Boolean(q._aliases[M])&&H.$ref.value!==q._root$Ref.value,S=I0.isExtended$Ref(V);Y+=H.indirections;let v=$H(z,Z,X);if(v)if(A<v.depth||Y<v.indirections)qH(z,v);else return;if(z.push({$ref:V,parent:Z,key:X,pathFromRoot:G,depth:A,file:M,hash:I,value:H.value,circular:H.circular,extended:S,external:N,nestedResource:T,indirections:Y}),!v||N)fZ(H.value,null,H.path,H.$ref.path,H.$ref.dynamicIdScope,G,Y+1,z,q,K)}function zH(Z,X,Q){Z.sort((Y,z)=>{if(Y.file!==z.file)return Y.file<z.file?-1:1;else if(Y.hash!==z.hash)return Y.hash<z.hash?-1:1;else if(Y.circular!==z.circular)return Y.circular?-1:1;else if(Y.extended!==z.extended)return Y.extended?1:-1;else if(Y.indirections!==z.indirections)return Y.indirections-z.indirections;else if(Y.depth!==z.depth)return Y.depth-z.depth;else{let q=Math.max(Y.pathFromRoot.lastIndexOf("/definitions"),Y.pathFromRoot.lastIndexOf("/$defs")),K=Math.max(z.pathFromRoot.lastIndexOf("/definitions"),z.pathFromRoot.lastIndexOf("/$defs"));if(q!==K)return K-q;else return Y.pathFromRoot.length-z.pathFromRoot.length}});let W,J,G;for(let Y of Z){let z=X.bundle||{};if(!Y.external){if(z.optimizeInternalRefs!==!1&&!Y.nestedResource)Y.$ref.$ref=Y.hash}else if(Y.file===W&&Y.hash===J)if(Q&&dW(Z,Y))Y.$ref.$ref=Q+G;else Y.$ref.$ref=G;else if(Y.file===W&&Y.hash.indexOf(J+"/")===0){let q=s0.join(G,s0.parse(Y.hash.replace(J,"#")));if(Q&&dW(Z,Y))Y.$ref.$ref=Q+q;else Y.$ref.$ref=q}else if(W=Y.file,J=Y.hash,G=Y.pathFromRoot,Y.$ref=Y.parent[Y.key]=I0.dereference(Y.$ref,Y.value,X),Y.circular)Y.$ref.$ref=Y.pathFromRoot}}function $H(Z,X,Q){for(let W of Z)if(W&&W.parent===X&&W.key===Q)return W;return}function qH(Z,X){let Q=Z.indexOf(X);Z.splice(Q,1)}function KH(Z,X){for(let Q of Z){if(!Q.$ref||typeof Q.$ref!=="object"||!("$ref"in Q.$ref))continue;let W=Q.$ref.$ref;if(typeof W!=="string"||!W.startsWith("#/"))continue;let J=UH(X,W);if(J!==W)Q.$ref.$ref=J}}function UH(Z,X){if(!X.startsWith("#/"))return X;let Q=X.slice(2).split("/"),W=Z,J=[];for(let Y of Q){if(W===null||W===void 0||typeof W!=="object")return X;if("$ref"in W&&typeof W.$ref==="string"&&W.$ref.startsWith("#/")){let K=W.$ref.slice(2).split("/");if(J.length=0,J.push(...K),W=VH(Z,W.$ref),W===null||W===void 0||typeof W!=="object")return X}let z=Y.replace(/~1/g,"/").replace(/~0/g,"~"),q=Array.isArray(W)?parseInt(z):z;W=W[q],J.push(Y)}return"#/"+J.join("/")}function VH(Z,X){if(!X.startsWith("#/"))return;let Q=X.slice(2).split("/"),W=Z;for(let J of Q){if(W===null||W===void 0||typeof W!=="object")return;let G=J.replace(/~1/g,"/").replace(/~0/g,"~"),Y=Array.isArray(W)?parseInt(G):G;W=W[Y]}return W}function dW(Z,X){for(let Q of Z){if(Q.pathFromRoot==="#"||Q.pathFromRoot==="#/")continue;if(X.pathFromRoot.startsWith(Q.pathFromRoot+"/")){if(Q.value&&typeof Q.value==="object"&&"$id"in Q.value)return!0}}return!1}var cW;var pW=c(()=>{L1();a1();a0();h6();cW=YH});function BH(Z,X){let Q=Date.now(),W=Z.$refs._root$Ref.dynamicIdScope?d0(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,J=hZ(Z.schema,Z.$refs._root$Ref.path,W,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,X,Q,0);Z.$refs.circular=J.circular,Z.schema=J.value}function hZ(Z,X,Q,W,J,G,Y,z,q,K,V,B){let H,F={value:Z,circular:!1};iW(V,K);let A=K.dereference||{},M=A.maxDepth??500;if(B>M)throw RangeError(`Maximum dereference depth (${M}) exceeded at ${J}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let I=A.excludedPathMatcher||(()=>!1);if(A?.circular==="ignore"||!Y.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!I(J)){G.add(Z),Y.add(Z);let N=Q;if(I0.isAllowed$Ref(Z,K))H=nW(Z,X,N,W,J,G,Y,z,q,K,V,B),F.circular=H.circular,F.value=H.value;else for(let T of Object.keys(Z)){iW(V,K);let S=s0.join(X,T),v=s0.join(J,T);if(I(v))continue;let x=Z[T],p=W&&x&&typeof x==="object"&&!ArrayBuffer.isView(x)?d0(N,x):N,f;if(I0.isAllowed$Ref(x,K)){if(H=nW(x,S,p,W,v,G,Y,z,q,K,V,B),f=H.circular,Z[T]!==H.value){let s=new Map;if(A?.preservedProperties){if(typeof Z[T]==="object"&&!Array.isArray(Z[T]))A?.preservedProperties.forEach((E0)=>{if(E0 in Z[T])s.set(E0,Z[T][E0])})}let K0=H.value;if(A?.cloneReferences&&!f&&K0&&typeof K0==="object")K0=structuredClone(K0);if(Z[T]=K0,A?.preservedProperties){if(s.size&&typeof Z[T]==="object"&&!Array.isArray(Z[T]))s.forEach((E0,f0)=>{Z[T][f0]=E0})}A?.onDereference?.(x.$ref,Z[T],Z,T)}}else if(!G.has(x)){if(H=hZ(x,S,p,W,v,G,Y,z,q,K,V,B+1),f=H.circular,Z[T]!==H.value)Z[T]=H.value}else f=F8(S,q,K);F.circular=F.circular||f}G.delete(Z)}}return F}function nW(Z,X,Q,W,J,G,Y,z,q,K,V,B){let A=I0.isExternal$Ref(Z)&&K?.dereference?.externalReferenceResolution==="root"?f6():W?Q:X,M=w0(A,Z.$ref),I=z.get(M);if(I){if(!I.circular){let p=Object.keys(Z);if(p.length>1){let f={};for(let s of p)if(s!=="$ref"&&!(s in I.value))f[s]=Z[s];return{circular:I.circular,value:Object.assign({},I.value,f)}}return I}if(typeof I.value==="object"&&"$ref"in I.value&&"$ref"in Z){if(I.value.$ref===Z.$ref)return F8(X,q,K),I}else return F8(X,q,K),I}let N=q._resolve(M,X,K);if(N===null)return{circular:!1,value:null};let T=N.circular,S=T||N.chainCircular||G.has(N.value);if(S)F8(X,q,K);let v=I0.dereference(Z,N.value,K);if(!S){let p=hZ(v,N.path,N.$ref.path,N.$ref.dynamicIdScope,J,G,Y,z,q,K,V,B+1);S=p.circular,v=p.value}if(S&&!T&&K.dereference?.circular==="ignore")v=Z;if(T&&v!==Z)v.$ref=J;let x={circular:S,value:v};if(Object.keys(Z).length===1)z.set(M,x);return x}function iW(Z,X){if(X&&X.timeoutMs){if(Date.now()-Z>X.timeoutMs)throw new XZ(X.timeoutMs)}}function F8(Z,X,Q){if(X.circular=!0,Q?.dereference?.onCircular?.(Z),!Q.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var rW;var aW=c(()=>{L1();a1();a0();h6();B4();rW=BH});function HH(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(X){setTimeout(X,0)}}var uZ;var sW=c(()=>{uZ=HH()});function Y4(Z,X){if(Z){X.then(function(Q){uZ(function(){Z(null,Q)})},function(Q){uZ(function(){Z(Q)})});return}else return X}var oW=c(()=>{sW()});class o4{schema=null;$refs=new o1;async parse(){let Z=Z9(arguments),X;if(!Z.path&&!Z.schema){let W=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return Y4(Z.callback,Promise.reject(W))}this.schema=null,this.$refs=new o1;let Q="http";if(W8(Z.path))Z.path=PQ(Z.path),Q="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let W=V1(Z.schema.$id),J=W.port??(W.protocol==="https:"?443:80);Z.path=`${W.protocol}//${W.hostname}:${J}`}if(Z.path=w0(f6(),Z.path),Z.schema&&typeof Z.schema==="object"){let W=this.$refs._add(Z.path);W.value=Z.schema,W.pathType=Q,W.dynamicIdScope=$8(W.value),q8(this.$refs,W.path,W.value,W.pathType,W.dynamicIdScope),X=Promise.resolve(Z.schema)}else X=V8(Z.path,this.$refs,Z.options);try{let W=await X;if(W!==null&&typeof W==="object"&&!Buffer.isBuffer(W))return this.schema=W,Y4(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,Y4(Z.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||W}" is not a valid JSON Schema`)}catch(W){if(!Z.options.continueOnError||!x4(W))return Y4(Z.callback,Promise.reject(W));if(this.$refs._$refs[j0(Z.path)])this.$refs._$refs[j0(Z.path)].addError(W);return Y4(Z.callback,Promise.resolve(null))}}static parse(){let Z=new o4;return Z.parse.apply(Z,arguments)}async resolve(){let Z=Z9(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await uW(this,Z.options),mZ(this),Y4(Z.callback,Promise.resolve(this.$refs))}catch(X){return Y4(Z.callback,Promise.reject(X))}}static resolve(){let Z=new o4;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new o4;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=Z9(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),cW(this,Z.options),mZ(this),Y4(Z.callback,Promise.resolve(this.schema))}catch(X){return Y4(Z.callback,Promise.reject(X))}}static dereference(){let Z=new o4;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=Z9(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),rW(this,Z.options),mZ(this),Y4(Z.callback,Promise.resolve(this.schema))}catch(X){return Y4(Z.callback,Promise.reject(X))}}}function mZ(Z){if(H1.getParserErrors(Z).length>0)throw new H1(Z)}var hb,ub,mb,tW;var eW=c(()=>{vQ();zZ();hW();mW();pW();aW();a0();_Z();vZ();B4();oW();h6();yZ();a0();hb=o4.parse,ub=o4.resolve,mb=o4.bundle,tW=o4.dereference});async function X9(Z,X={}){let{baseUrl:Q="/_jx/server"}=X,W=await tW(Z),J=X8(W);if(J.length===0)return null;let G=J.map(({exportName:z,src:q})=>`import { ${z} } from '${q}'`).join(`
|
|
56
|
-
`),Y=
|
|
55
|
+
${J.join(`
|
|
56
|
+
`)}`);throw G.status=W.status,new r6(G)}else{let G=AL(W,"location");if(!G){let $=Error(`HTTP ${W.status} redirect with no location header`);throw $.status=W.status,$}let Y=u0(Z.href,G);return XG(Y,X,J)}else{if(W.body){let G=await W.arrayBuffer();return Buffer.from(G)}return Buffer.alloc(0)}}catch(W){let G=W;throw G.message=`Error downloading ${Z.href}: ${G.message}`,new r6(G,Z.href)}}async function ML(Z,X){let Q,J;if(X.timeout&&typeof AbortController<"u")Q=new AbortController,J=setTimeout(()=>Q.abort(),X.timeout);let W=await fetch(Z,{method:"GET",headers:X.headers||{},credentials:X.withCredentials?"include":"same-origin",redirect:"manual",signal:Q?Q.signal:null});if(J)clearTimeout(J);return W}function AL(Z,X){return Z.headers.get(X)}var l7;var c7=s(()=>{M6();f6();l7={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead(Z){return pJ(Z.url)&&(!this.safeUrlResolver||!r8(Z.url))},read(Z){let X=o4(Z.url);if(typeof window<"u"&&!X.protocol)X.protocol=o4(location.href).protocol;return XG(X,this)}}});function GG(Z,X){if(QG(X)){let Q=Object.keys(X).filter((J)=>!["__proto__","constructor","prototype"].includes(J));for(let J=0;J<Q.length;J++){let W=Q[J],G=X[W],Y=Z[W];if(QG(G))Z[W]=GG(Y||{},G);else if(G!==void 0)Z[W]=G}}return Z}function QG(Z){return Z&&typeof Z==="object"&&!Array.isArray(Z)&&!(Z instanceof RegExp)&&!(Z instanceof Date)}var JG=()=>{return{parse:{json:{...WW},yaml:{...aW},text:{...sW},binary:{...eW}},resolve:{file:{...m7},http:{...l7},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},WG=(Z)=>{let X=JG();if(Z)GG(X,Z);return X};var p7=s(()=>{GW();oW();tW();ZG();d7();c7()});function IL(Z){let X,Q,J,W,G=Array.prototype.slice.call(Z);if(typeof G[G.length-1]==="function")W=G.pop();if(typeof G[0]==="string")if(X=G[0],typeof G[2]==="object")Q=G[1],J=G[2];else Q=void 0,J=G[1];else X="",Q=G[0],J=G[1];try{J=WG(J)}catch(Y){console.error(`JSON Schema Ref Parser: Error normalizing options: ${Y}`)}if(!J.mutateInputSchema&&typeof Q==="object")Q=JSON.parse(JSON.stringify(Q));return{path:X,schema:Q,options:J,callback:W}}var m9;var YG=s(()=>{p7();m9=IL});function NL(Z,X){if(!X.resolve?.external)return Promise.resolve();try{let Q=Z.$refs._root$Ref.dynamicIdScope?U6(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,J=i7(Z.schema,Z.$refs._root$Ref.path+"#",Q,Z.$refs._root$Ref.dynamicIdScope,Z.$refs,X);return Promise.all(J)}catch(Q){return Promise.reject(Q)}}function i7(Z,X,Q,J,W,G,Y,$){Y||=new Set;let z=[];if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!Y.has(Z)){Y.add(Z);let U=Q;if(g0.isExternal$Ref(Z))z.push(DL(Z,X,U,J,W,G));let V=Object.keys(Z);for(let q of V){let B=A6.join(X,q),F=Z[q],L=J&&F&&typeof F==="object"&&!ArrayBuffer.isView(F)?U6(U,F):U;z=z.concat(i7(F,B,L,J,W,G,Y,$))}}return z}async function DL(Z,X,Q,J,W,G){let $=G.dereference?.externalReferenceResolution==="root"?L4():J?Q:X,z=u0($,Z.$ref),U=m0(z),V=W._get$Ref(U);if(V)return Promise.resolve(V.value);try{let q=Z.$ref,B={url:z,baseUrl:$};if(typeof q==="string")B.reference=q;let F=await W5(B,W,G),L=W._get$Ref(U),I=i7(F,U+"#",U,L?.dynamicIdScope??!1,W,G,new Set,!0);return Promise.all(I)}catch(q){if(!G?.continueOnError||!K1(q))throw q;if(W._$refs[U])q.source=decodeURI(m0(X)),q.path=o8(z1(X));return[]}}var $G;var zG=s(()=>{Z9();y9();L7();M6();f6();M4();$G=NL});function TL(Z,X){let Q=Z.$refs._root$Ref.dynamicIdScope?U6(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,J=[];n7(Z,"schema",Z.$refs._root$Ref.path+"#",Q,Z.$refs._root$Ref.dynamicIdScope,"#",0,J,Z.$refs,X);let W=Z.schema&&typeof Z.schema==="object"&&"$id"in Z.schema?Z.schema.$id:void 0;if(wL(J,X,W),(X.bundle||{}).optimizeInternalRefs!==!1)EL(J,Z.schema)}function n7(Z,X,Q,J,W,G,Y,$,z,U){let V=X===null?Z:Z[X],q=U.bundle||{},B=q.excludedPathMatcher||(()=>!1);if(V&&typeof V==="object"&&!ArrayBuffer.isView(V)&&!B(G)){let F=J;if(g0.isAllowed$Ref(V))UG(Z,X,Q,F,W,G,Y,$,z,U);else{let L=Object.keys(V).sort((I,A)=>{if(I==="definitions"||I==="$defs")return-1;else if(A==="definitions"||A==="$defs")return 1;else return I.length-A.length});for(let I of L){let A=A6.join(Q,I),N=A6.join(G,I),D=V[I],O=W&&D&&typeof D==="object"&&!ArrayBuffer.isView(D)?U6(F,D):F;if(g0.isAllowed$Ref(D))UG(V,I,A,O,W,N,Y,$,z,U);else n7(V,I,A,O,W,N,Y,$,z,U);if(D&&typeof D==="object"&&!Array.isArray(D)){if("$ref"in D)q?.onBundle?.(D.$ref,V[I],V,I)}}}}}function UG(Z,X,Q,J,W,G,Y,$,z,U){let V=X===null?Z:Z[X],q=u0(W?J:Q,V.$ref),B=z._resolve(q,G,U);if(B===null)return;let L=A6.parse(G).length,I=m0(B.path),A=z1(B.path),N=I!==z._root$Ref.path&&!z._aliases[I],D=Boolean(z._aliases[I])&&B.$ref.value!==z._root$Ref.value,O=g0.isExtended$Ref(V);Y+=B.indirections;let T=jL($,Z,X);if(T)if(L<T.depth||Y<T.indirections)OL($,T);else return;if($.push({$ref:V,parent:Z,key:X,pathFromRoot:G,depth:L,file:I,hash:A,value:B.value,circular:B.circular,extended:O,external:N,nestedResource:D,indirections:Y}),!T||N)n7(B.value,null,B.path,B.$ref.path,B.$ref.dynamicIdScope,G,Y+1,$,z,U)}function wL(Z,X,Q){Z.sort((Y,$)=>{if(Y.file!==$.file)return Y.file<$.file?-1:1;else if(Y.hash!==$.hash)return Y.hash<$.hash?-1:1;else if(Y.circular!==$.circular)return Y.circular?-1:1;else if(Y.extended!==$.extended)return Y.extended?1:-1;else if(Y.indirections!==$.indirections)return Y.indirections-$.indirections;else if(Y.depth!==$.depth)return Y.depth-$.depth;else{let z=Math.max(Y.pathFromRoot.lastIndexOf("/definitions"),Y.pathFromRoot.lastIndexOf("/$defs")),U=Math.max($.pathFromRoot.lastIndexOf("/definitions"),$.pathFromRoot.lastIndexOf("/$defs"));if(z!==U)return U-z;else return Y.pathFromRoot.length-$.pathFromRoot.length}});let J,W,G;for(let Y of Z){let $=X.bundle||{};if(!Y.external){if($.optimizeInternalRefs!==!1&&!Y.nestedResource)Y.$ref.$ref=Y.hash}else if(Y.file===J&&Y.hash===W)if(Q&&KG(Z,Y))Y.$ref.$ref=Q+G;else Y.$ref.$ref=G;else if(Y.file===J&&Y.hash.indexOf(W+"/")===0){let z=A6.join(G,A6.parse(Y.hash.replace(W,"#")));if(Q&&KG(Z,Y))Y.$ref.$ref=Q+z;else Y.$ref.$ref=z}else if(J=Y.file,W=Y.hash,G=Y.pathFromRoot,Y.$ref=Y.parent[Y.key]=g0.dereference(Y.$ref,Y.value,X),Y.circular)Y.$ref.$ref=Y.pathFromRoot}}function jL(Z,X,Q){for(let J of Z)if(J&&J.parent===X&&J.key===Q)return J;return}function OL(Z,X){let Q=Z.indexOf(X);Z.splice(Q,1)}function EL(Z,X){for(let Q of Z){if(!Q.$ref||typeof Q.$ref!=="object"||!("$ref"in Q.$ref))continue;let J=Q.$ref.$ref;if(typeof J!=="string"||!J.startsWith("#/"))continue;let W=RL(X,J);if(W!==J)Q.$ref.$ref=W}}function RL(Z,X){if(!X.startsWith("#/"))return X;let Q=X.slice(2).split("/"),J=Z,W=[];for(let Y of Q){if(J===null||J===void 0||typeof J!=="object")return X;if("$ref"in J&&typeof J.$ref==="string"&&J.$ref.startsWith("#/")){let U=J.$ref.slice(2).split("/");if(W.length=0,W.push(...U),J=PL(Z,J.$ref),J===null||J===void 0||typeof J!=="object")return X}let $=Y.replace(/~1/g,"/").replace(/~0/g,"~"),z=Array.isArray(J)?parseInt($):$;J=J[z],W.push(Y)}return"#/"+W.join("/")}function PL(Z,X){if(!X.startsWith("#/"))return;let Q=X.slice(2).split("/"),J=Z;for(let W of Q){if(J===null||J===void 0||typeof J!=="object")return;let G=W.replace(/~1/g,"/").replace(/~0/g,"~"),Y=Array.isArray(J)?parseInt(G):G;J=J[Y]}return J}function KG(Z,X){for(let Q of Z){if(Q.pathFromRoot==="#"||Q.pathFromRoot==="#/")continue;if(X.pathFromRoot.startsWith(Q.pathFromRoot+"/")){if(Q.value&&typeof Q.value==="object"&&"$id"in Q.value)return!0}}return!1}var VG;var HG=s(()=>{Z9();y9();M6();M4();VG=TL});function CL(Z,X){let Q=Date.now(),J=Z.$refs._root$Ref.dynamicIdScope?U6(Z.$refs._root$Ref.path,Z.schema):Z.$refs._root$Ref.path,W=r7(Z.schema,Z.$refs._root$Ref.path,J,Z.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,Z.$refs,X,Q,0);Z.$refs.circular=W.circular,Z.schema=W.value}function r7(Z,X,Q,J,W,G,Y,$,z,U,V,q){let B,F={value:Z,circular:!1};BG(V,U);let L=U.dereference||{},I=L.maxDepth??500;if(q>I)throw RangeError(`Maximum dereference depth (${I}) exceeded at ${W}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let A=L.excludedPathMatcher||(()=>!1);if(L?.circular==="ignore"||!Y.has(Z)){if(Z&&typeof Z==="object"&&!ArrayBuffer.isView(Z)&&!A(W)){G.add(Z),Y.add(Z);let N=Q;if(g0.isAllowed$Ref(Z,U))B=qG(Z,X,N,J,W,G,Y,$,z,U,V,q),F.circular=B.circular,F.value=B.value;else for(let D of Object.keys(Z)){BG(V,U);let O=A6.join(X,D),T=A6.join(W,D);if(A(T))continue;let w=Z[D],S=J&&w&&typeof w==="object"&&!ArrayBuffer.isView(w)?U6(N,w):N,y;if(g0.isAllowed$Ref(w,U)){if(B=qG(w,O,S,J,T,G,Y,$,z,U,V,q),y=B.circular,Z[D]!==B.value){let x=new Map;if(L?.preservedProperties){if(typeof Z[D]==="object"&&!Array.isArray(Z[D]))L?.preservedProperties.forEach((r)=>{if(r in Z[D])x.set(r,Z[D][r])})}let i=B.value;if(L?.cloneReferences&&!y&&i&&typeof i==="object")i=structuredClone(i);if(Z[D]=i,L?.preservedProperties){if(x.size&&typeof Z[D]==="object"&&!Array.isArray(Z[D]))x.forEach((r,h)=>{Z[D][h]=r})}L?.onDereference?.(w.$ref,Z[D],Z,D)}}else if(!G.has(w)){if(B=r7(w,O,S,J,T,G,Y,$,z,U,V,q+1),y=B.circular,Z[D]!==B.value)Z[D]=B.value}else y=$5(O,z,U);F.circular=F.circular||y}G.delete(Z)}}return F}function qG(Z,X,Q,J,W,G,Y,$,z,U,V,q){let L=g0.isExternal$Ref(Z)&&U?.dereference?.externalReferenceResolution==="root"?L4():J?Q:X,I=u0(L,Z.$ref),A=$.get(I);if(A){if(!A.circular){let S=Object.keys(Z);if(S.length>1){let y={};for(let x of S)if(x!=="$ref"&&!(x in A.value))y[x]=Z[x];return{circular:A.circular,value:Object.assign({},A.value,y)}}return A}if(typeof A.value==="object"&&"$ref"in A.value&&"$ref"in Z){if(A.value.$ref===Z.$ref)return $5(X,z,U),A}else return $5(X,z,U),A}let N=z._resolve(I,X,U);if(N===null)return{circular:!1,value:null};let D=N.circular,O=D||N.chainCircular||G.has(N.value);if(O)$5(X,z,U);let T=g0.dereference(Z,N.value,U);if(!O){let S=r7(T,N.path,N.$ref.path,N.$ref.dynamicIdScope,W,G,Y,$,z,U,V,q+1);O=S.circular,T=S.value}if(O&&!D&&U.dereference?.circular==="ignore")T=Z;if(D&&T!==Z)T.$ref=W;let w={circular:O,value:T};if(Object.keys(Z).length===1)$.set(I,w);return w}function BG(Z,X){if(X&&X.timeoutMs){if(Date.now()-Z>X.timeoutMs)throw new K7(X.timeoutMs)}}function $5(Z,X,Q){if(X.circular=!0,Q?.dereference?.onCircular?.(Z),!Q.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${Z}`);return!0}var FG;var LG=s(()=>{Z9();y9();M6();M4();f6();FG=CL});function SL(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(X){setTimeout(X,0)}}var a7;var MG=s(()=>{a7=SL()});function S6(Z,X){if(Z){X.then(function(Q){a7(function(){Z(null,Q)})},function(Q){a7(function(){Z(Q)})});return}else return X}var AG=s(()=>{MG()});class R1{schema=null;$refs=new f9;async parse(){let Z=m9(arguments),X;if(!Z.path&&!Z.schema){let J=Error(`Expected a file path, URL, or object. Got ${Z.path||Z.schema}`);return S6(Z.callback,Promise.reject(J))}this.schema=null,this.$refs=new f9;let Q="http";if(a8(Z.path))Z.path=aJ(Z.path),Q="file";else if(!Z.path&&Z.schema&&"$id"in Z.schema&&Z.schema.$id){let J=o4(Z.schema.$id),W=J.port??(J.protocol==="https:"?443:80);Z.path=`${J.protocol}//${J.hostname}:${W}`}if(Z.path=u0(L4(),Z.path),Z.schema&&typeof Z.schema==="object"){let J=this.$refs._add(Z.path);J.value=Z.schema,J.pathType=Q,J.dynamicIdScope=Z5(J.value),X5(this.$refs,J.path,J.value,J.pathType,J.dynamicIdScope),X=Promise.resolve(Z.schema)}else X=W5(Z.path,this.$refs,Z.options);try{let J=await X;if(J!==null&&typeof J==="object"&&!Buffer.isBuffer(J))return this.schema=J,S6(Z.callback,Promise.resolve(this.schema));else if(Z.options.continueOnError)return this.schema=null,S6(Z.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||J}" is not a valid JSON Schema`)}catch(J){if(!Z.options.continueOnError||!K1(J))return S6(Z.callback,Promise.reject(J));if(this.$refs._$refs[m0(Z.path)])this.$refs._$refs[m0(Z.path)].addError(J);return S6(Z.callback,Promise.resolve(null))}}static parse(){let Z=new R1;return Z.parse.apply(Z,arguments)}async resolve(){let Z=m9(arguments);try{return await this.parse(Z.path,Z.schema,Z.options),await $G(this,Z.options),o7(this),S6(Z.callback,Promise.resolve(this.$refs))}catch(X){return S6(Z.callback,Promise.reject(X))}}static resolve(){let Z=new R1;return Z.resolve.apply(Z,arguments)}static bundle(){let Z=new R1;return Z.bundle.apply(Z,arguments)}async bundle(){let Z=m9(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),VG(this,Z.options),o7(this),S6(Z.callback,Promise.resolve(this.schema))}catch(X){return S6(Z.callback,Promise.reject(X))}}static dereference(){let Z=new R1;return Z.dereference.apply(Z,arguments)}async dereference(){let Z=m9(arguments);try{return await this.resolve(Z.path,Z.schema,Z.options),FG(this,Z.options),o7(this),S6(Z.callback,Promise.resolve(this.schema))}catch(X){return S6(Z.callback,Promise.reject(X))}}}function o7(Z){if(t4.getParserErrors(Z).length>0)throw new t4(Z)}var Fy,Ly,My,IG;var NG=s(()=>{QW();L7();YG();zG();HG();LG();M6();d7();c7();f6();AG();M4();p7();M6();Fy=R1.parse,Ly=R1.resolve,My=R1.bundle,IG=R1.dereference});async function d9(Z,X={}){let{baseUrl:Q="/_jx/server"}=X,J=await IG(Z),W=n8(J);if(W.length===0)return null;let G=W.map(({exportName:$,src:z})=>`import { ${$} } from '${z}'`).join(`
|
|
57
|
+
`),Y=W.map(({exportName:$})=>DG($,Q)).join(`
|
|
57
58
|
`);return`// Generated by @jxsuite/compiler — do not edit manually
|
|
58
59
|
// Deploy as a Cloudflare Worker, Node server, or Bun process.
|
|
59
60
|
// Requires: npm install hono
|
|
@@ -65,24 +66,24 @@ const app = new Hono()
|
|
|
65
66
|
${Y}
|
|
66
67
|
|
|
67
68
|
export default app
|
|
68
|
-
`}function
|
|
69
|
-
`)
|
|
70
|
-
`),
|
|
69
|
+
`}function s7(Z,X={}){let{baseUrl:Q="/_jx/server",adapter:J=null,mounts:W=[],connectors:G=[]}=X;if(Z.length===0&&W.length===0&&!J)return null;let Y=Z.map(({exportName:V,src:q})=>`import { ${V} } from '${q}'`).join(`
|
|
70
|
+
`),$=_L(W,G),z=Z.map(({exportName:V})=>DG(V,Q)).join(`
|
|
71
|
+
`),U=J==="cloudflare-workers"||J==="cloudflare-pages"?`
|
|
71
72
|
app.all('*', (c) => c.env.ASSETS.fetch(c.req.raw))
|
|
72
73
|
`:`
|
|
73
74
|
`;return`// Generated by @jxsuite/compiler — do not edit manually
|
|
74
75
|
import { Hono } from 'hono'
|
|
75
|
-
${Y}${
|
|
76
|
+
${Y}${$.imports}
|
|
76
77
|
|
|
77
78
|
const app = new Hono()
|
|
78
|
-
${
|
|
79
|
-
${
|
|
79
|
+
${$.routes}${z}
|
|
80
|
+
${U}
|
|
80
81
|
export default app
|
|
81
|
-
`}function
|
|
82
|
-
${
|
|
83
|
-
`)}`,routes:`${
|
|
82
|
+
`}function _L(Z,X){if(Z.length===0)return{imports:"",routes:""};let Q=Z.toSorted((G,Y)=>G.order-Y.order),J=[];for(let G of Q)J.push(`import { ${G.className} } from '${G.module}'`);for(let G of X)J.push(`import { ${G.className} } from '${G.module}'`);let W=["// Extension server mounts (specs/extensions.md §11): one shared ctx, mounted in order.","const jxCtx = {}",`const jxConnectors = { ${X.map((G)=>`${JSON.stringify(G.provider)}: ${G.className}`).join(", ")} }`];for(let[G,Y]of Q.entries()){let $=JSON.stringify(Y.options);W.push(`const jxMount${G} = await ${Y.className}.mount({ ...${$}, connectors: jxConnectors }, jxCtx)`,`app.all('${Y.basePath}/*', (c) => jxMount${G}(c.req.raw, c.env))`,`app.all('${Y.basePath}', (c) => jxMount${G}(c.req.raw, c.env))`)}return{imports:`
|
|
83
|
+
${J.join(`
|
|
84
|
+
`)}`,routes:`${W.join(`
|
|
84
85
|
`)}
|
|
85
|
-
`}}function
|
|
86
|
+
`}}function DG(Z,X){return`
|
|
86
87
|
app.post('${X}/${Z}', async (c) => {
|
|
87
88
|
const args = await c.req.json().catch(() => ({}))
|
|
88
89
|
try {
|
|
@@ -90,232 +91,305 @@ app.post('${X}/${Z}', async (c) => {
|
|
|
90
91
|
} catch (e) {
|
|
91
92
|
return c.json({ ok: false, error: e?.message ?? 'Server error' }, 500)
|
|
92
93
|
}
|
|
93
|
-
})`}var
|
|
94
|
+
})`}var t7=s(()=>{NG();n1()});function a1(Z){return Z instanceof Error?Z.message:String(Z)}function e7(Z,X,Q){let J;try{J=JSON.parse(Z)}catch(W){throw Error(`Failed to parse ${Q} at ${X}: ${a1(W)}`,{cause:W})}if(!R6(J))throw Error(`Invalid ${Q} at ${X}: expected a JSON object`);return J}function o1(Z,X){return e7(Z,X,"Jx document")}function TG(Z,X){return e7(Z,X,"project config")}function wG(Z,X){return e7(Z,X,"class definition")}var s1=s(()=>{Y1()});class z5{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;project;server;connector;capabilities;#X;#Z=null;constructor(Z,X,Q,J){this.name=Z,this.classPath=X,this.classDef=Q,this.#X=J;let{format:W}=Q;this.extensions=(W?.extensions??[]).map((G)=>G.toLowerCase()),this.mediaType=W?.mediaType??null,this.documentKinds=W?.documentKinds??[],this.exportTarget=W?.exportTarget===!0,this.remote=W?.remote===!0,this.studio=Q.$studio??null,this.project=Q.project??null,this.server=Q.server??null,this.connector=Q.connector??null,this.capabilities=xL(Q)}implementation(){if(!this.#Z){let Z=this.classDef.$implementation;if(!Z)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#Z=this.#X.importModule(this.#X.resolvePath(this.classPath,Z))}return this.#Z}async call(Z,...X){let Q=this.capabilities[Z];if(!Q)throw Error(`Format class "${this.name}" does not declare a "${Z}" capability`);let J=await this.implementation(),W=this.classDef.title??this.name,G=J[W]??J.default?.[W]??J.default,Y=G?.[Q.identifier];if(typeof Y!=="function")throw TypeError(`Format class "${this.name}": implementation export "${W}" has no static "${Q.identifier}" method`);return await Y.call(G,...X)}}class U5{#X;constructor(Z){this.#X=Z;for(let X of OG){let Q=new Map;for(let J of Z){if(!J.capabilities[X])continue;for(let W of J.extensions){let G=Q.get(W);if(G)throw Error(`Format conflict: "${G.name}" and "${J.name}" both claim "${W}" with the "${X}" capability`);Q.set(W,J)}}}}get entries(){return this.#X}byExtension(Z,X){let Q=jG(Z);return this.#X.find((J)=>J.extensions.includes(Q)&&(!X||J.capabilities[X]))}byName(Z){return this.#X.find((X)=>X.name===Z)}withCapability(Z){return this.#X.filter((X)=>X.capabilities[Z])}documentExtensions(Z){let X=new Set;for(let Q of this.#X){if(Z&&!Q.documentKinds.includes(Z))continue;for(let J of Q.extensions)X.add(J)}return X.delete(".json"),[...X]}has(Z){let X=jG(Z);return this.#X.some((Q)=>Q.extensions.includes(X))}}function xL(Z){let X={},Q=Z.$defs?.methods??{};for(let[J,W]of Object.entries(Q)){let G=W.role;if(!G||!EG.includes(G))continue;let Y={identifier:W.identifier??J,timing:W.timing??kL};if(typeof W.discriminator==="string")Y.discriminator=W.discriminator;X[G]=Y}return X}function jG(Z){let X=Z.toLowerCase();return X.startsWith(".")?X:`.${X}`}var OG,EG,kL;var ZX=s(()=>{OG=["parse","serialize","discover","load"],EG=[...OG,"projectData","resolvePaths","lower","emit","mount","dialect","deploySchema","bindings","testConnection"],kL=["compiler","server"]});class RG{#X;#Z;#Q;constructor(Z){this.#X=Z,this.#Z=Z.flatMap((W)=>W.classes);let X=new Map;for(let W of Z)for(let G of W.classes){let Y=X.get(G.name);if(Y&&Y!==W.specifier)throw Error(`Extension conflict: "${Y}" and "${W.specifier}" both provide a class named "${G.name}"`);X.set(G.name,W.specifier)}let Q=new Map;for(let W of this.#Z){if(!W.project)continue;let G=Q.get(W.project.key);if(G)throw Error(`Extension conflict: "${G.name}" and "${W.name}" both claim the project section "${W.project.key}"`);Q.set(W.project.key,W)}let J=new Map;for(let W of this.#Z){if(!W.server)continue;let{basePath:G}=W.server;if(!G.startsWith("/_jx/"))throw Error(`Extension "${W.name}": server basePath "${G}" must be under /_jx/`);let Y=J.get(G);if(Y)throw Error(`Extension conflict: "${Y.name}" and "${W.name}" both mount "${G}"`);J.set(G,W)}this.#Q=new U5(this.#Z.filter((W)=>W.extensions.length>0))}get extensions(){return this.#X}get classes(){return this.#Z}get formats(){return this.#Q}byName(Z){return this.#Z.find((X)=>X.name===Z)}projectContributions(){return this.#Z.filter((Z)=>Z.project!==null)}byProjectKey(Z){return this.#Z.find((X)=>X.project?.key===Z)}byPathsDiscriminator(Z){return this.#Z.find((X)=>X.capabilities.resolvePaths?.discriminator===Z)}emitters(){return this.#Z.filter((Z)=>Z.capabilities.emit!==void 0)}serverMounts(){return this.#Z.filter((Z)=>Z.server!==null).toSorted((Z,X)=>(Z.server?.order??100)-(X.server?.order??100)||Z.name.localeCompare(X.name))}connectors(){return this.#Z.filter((Z)=>Z.connector!==null)}schemaFragments(Z){return this.#X.map((X)=>X.schemas[Z]).filter((X)=>typeof X==="string")}}async function PG(Z,X,Q){let J=[];for(let W of Z??[])J.push(await bL(W,X,Q));return new RG(J)}async function bL(Z,X,Q){let J;if(Z.startsWith("./")||Z.startsWith("../")){let $=X.resolvePath(Q,Z);J=X.resolvePath(`${$}/package.json`,`./${K5}`)}else try{J=X.resolvePath(Q,`${Z}/${K5}`)}catch($){throw Error(`Extension "${Z}" is not resolvable: it must export ${K5} (is the package installed, and does its exports map include it?): ${XX($)}`,{cause:$})}let W;try{W=await X.loadJson(J)}catch($){throw Error(`Extension "${Z}": cannot read manifest ${J}: ${XX($)}`,{cause:$})}if(!W||typeof W!=="object"||typeof W.name!=="string")throw Error(`Extension "${Z}": ${K5} must declare a "name"`);if(!Z.startsWith(".")&&W.name!==Z)throw Error(`Extension "${Z}": manifest name "${W.name}" does not match the specifier`);let G=[];for(let[$,z]of Object.entries(W.classes??{})){let U=X.resolvePath(J,z),V;try{V=await X.loadJson(U)}catch(q){throw Error(`Extension "${Z}": cannot read class "${$}" at ${U}: ${XX(q)}`,{cause:q})}G.push(new z5($,U,V,X))}let Y={};if(W.schemas?.project)Y.project=X.resolvePath(J,W.schemas.project);if(W.schemas?.document)Y.document=X.resolvePath(J,W.schemas.document);if(W.schemas?.fields)Y.fields=X.resolvePath(J,W.schemas.fields);return{specifier:Z,manifestPath:J,manifest:W,classes:G,schemas:Y}}function XX(Z){return Z instanceof Error?Z.message:String(Z)}var K5="jx-extension.json";var CG=s(()=>{ZX();ZX()});var JX={};D1(JX,{unknownFormatError:()=>uL,importImplementation:()=>H5,createNodeFormatIO:()=>q5,buildProjectFormatRegistry:()=>fL,buildProjectExtensionRegistry:()=>t1,buildExtensionsPayload:()=>hL});import{readFileSync as _G}from"node:fs";import{dirname as vL,isAbsolute as yL,resolve as QX,sep as V5}from"node:path";import{pathToFileURL as gL}from"node:url";import{createRequire as SG}from"node:module";async function H5(Z){let X=[Z],Q=`${V5}src${V5}`,J=`${V5}dist${V5}`;if(Z.includes(Q))X.push(Z.replace(Q,J));if(Z.endsWith(".js"))X.push(`${Z.slice(0,-3)}.ts`);let W;for(let G of X)try{return await import(gL(G).href)}catch(Y){W=Y}throw W instanceof Error?W:Error(String(W))}function q5(Z){return{importModule:(X)=>H5(X),loadJson:async(X)=>JSON.parse(_G(X,"utf8")),resolvePath:(X,Q)=>{if(Q.startsWith("./")||Q.startsWith("../"))return QX(vL(X),Q);if(yL(Q))return Q;let J=SG(QX(Z,"package.json"));try{return J.resolve(Q)}catch{return SG(import.meta.url).resolve(Q)}}}}async function t1(Z,X){return PG(X?.extensions,q5(Z),QX(Z,"project.json"))}async function fL(Z,X){return(await t1(Z,X)).formats}function hL(Z){let X=[];for(let Q of Z.extensions){let J={};if(Q.schemas.project)try{J=JSON.parse(_G(Q.schemas.project,"utf8")).properties??{}}catch{J={}}let W=[];for(let G of Q.classes){if(!G.project)continue;W.push({className:G.name,entrySchema:J[G.project.key]??null,project:G.project,studio:G.studio})}X.push({classes:Q.classes.map((G)=>{let Y=G.studio?.stateDefaults,$=G.project===null&&G.server===null&&G.connector===null&&G.extensions.length===0;return{name:G.name,path:G.classPath,...$?{state:!0}:{},...Y&&typeof Y==="object"?{stateDefaults:Y}:{}}}),contributions:W,name:Q.manifest.name,specifier:Q.specifier,...Q.manifest.title===void 0?{}:{title:Q.manifest.title},...Q.manifest.description===void 0?{}:{description:Q.manifest.description}})}return X}function uL(Z,X){return Error(`No format class registered for "${X}" (${Z}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`)}var e1=s(()=>{CG()});async function F5(Z,X={}){let{resolveElementPath:Q,$media:J,formats:W}=X,G=[],Y=new Set;async function $(z,U){let V,q;if(typeof z==="string"){let{readFileSync:T}=await import("node:fs"),{resolve:w}=await import("node:path");if(q=U?w(U,z):w(z),Y.has(q))return;if(Y.add(q),q.endsWith(".json"))V=o1(T(q,"utf8"),q);else{let{extname:S}=await import("node:path"),y=S(q).toLowerCase(),x=W?.byExtension?.(y,"parse");if(!x){let{unknownFormatError:i}=await Promise.resolve().then(() => (e1(),JX));throw i(q,y)}V=await x.call("parse",T(q,"utf8"))}}else{if(V=z,q=null,V.tagName&&Y.has(V.tagName))return;if(V.tagName)Y.add(V.tagName)}let{tagName:B}=V;if(!B||!B.includes("-"))throw Error(`compileElement: tagName "${B}" must contain a hyphen`);let{dirname:F}=await import("node:path"),L=q?F(q):null,I=[];if(Array.isArray(V.$elements))for(let T of V.$elements){let w=P6(T)?T.$ref:T;if(typeof w!=="string")continue;if(L)await $(w,L);let S=Q?Q(w,L):w.replace(/\.json$/,".js");I.push(S)}let A=i8(B);if(J)V.$media={...J,...V.$media};let{rewriteSrc:N}=X,D=l9(V,A,I,N?(T)=>N(T,L):void 0),O=q?q.replace(/\.json$/,".js"):`${B}.js`;G.push({content:D,path:O,tagName:B})}return await $(Z,X.basePath??null),{files:G}}async function mL(Z,X={}){let{title:Q="Jx App",reactivitySrc:J="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:W="https://esm.sh/lit-html@3.3.0"}=X,G=await F5(Z,X),Y=G.files.at(-1);if(!Y)throw Error("compileElementPage: no element modules were produced");let{basename:$}=await import("node:path"),z=$(Y.path),U=`<!DOCTYPE html>
|
|
94
95
|
<html lang="en">
|
|
95
96
|
<head>
|
|
96
97
|
<meta charset="utf-8">
|
|
97
98
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
98
|
-
<title>${
|
|
99
|
+
<title>${O0(Q)}</title>
|
|
99
100
|
<script type="importmap">
|
|
100
101
|
{
|
|
101
102
|
"imports": {
|
|
102
|
-
"@vue/reactivity": "${
|
|
103
|
-
"lit-html": "${
|
|
103
|
+
"@vue/reactivity": "${J}",
|
|
104
|
+
"lit-html": "${W}"
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
</script>
|
|
107
108
|
</head>
|
|
108
109
|
<body>
|
|
109
110
|
<${Y.tagName}></${Y.tagName}>
|
|
110
|
-
<script type="module" src="./${
|
|
111
|
+
<script type="module" src="./${z}"></script>
|
|
111
112
|
</body>
|
|
112
|
-
</html>`;return{files:G.files,html:
|
|
113
|
-
`)}function
|
|
114
|
-
`)}function
|
|
115
|
-
${X} ${
|
|
113
|
+
</html>`;return{files:G.files,html:U}}function dL(Z){if(Z===null||typeof Z!=="object"||Array.isArray(Z))return JSON.stringify(Z);if("default"in Z)return JSON.stringify(Z.default);if(l1(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 l9(Z,X,Q,J){let W=["// Generated by @jxsuite/compiler — do not edit manually"];if(Z.$id)W.push(`// Source: ${Z.$id}`);for(let F of Q)W.push(`import '${F}';`);let G=new Map,Y=Z.state??{};for(let[F,L]of Object.entries(Y)){let I=L;if(I&&typeof I==="object"&&!Array.isArray(I)&&I.$prototype==="Function"&&I.$src){let A=I.$src;if(!G.has(A))G.set(A,[]);G.get(A).push(F)}}for(let[F,L]of G){let I=J?J(F):F;W.push(`import { ${L.join(", ")} } from '${I}';`)}W.push("import { reactive, computed, effect } from '@vue/reactivity';","import { render, html } from 'lit-html';","",`class ${X} extends HTMLElement {`," #dispose = null;",""," constructor() {"," super();");let $=[],z=[],U=[],V=[];for(let[F,L]of Object.entries(Y)){let I=L;if(b6(I)){let A=I.$expression;if(B4(I))V.push([F,I]);else if(d1(A.operator))U.push([F,I]);else z.push([F,I])}else if(W1(I))if(typeof I.body==="string"&&I.body.includes("return"))z.push([F,I]);else U.push([F,I]);else{let A=dL(I);if(A!==void 0)$.push([F,A])}}W.push(" this.state = reactive({");for(let[F,L]of $)W.push(` ${F}: ${L},`);W.push(" });");for(let[F,L]of U)if(W.push(""),b6(L)){let I=$6(L.$expression,{eventParam:"e",statePrefix:"s"});W.push(` this.state.${F} = (s, e) => { ${I}; };`)}else if(G1(L)){let I=v6(L.body,{dispatchTarget:"this",eventParam:"e",indent:" ",statePrefix:"this.state"});W.push(` this.state.${F} = (s, e) => {`,I," };")}else{let A=(L.parameters?c1(L.parameters):L.arguments??["state"]).join(", ");if(L.$src)W.push(` this.state.${F} = (${A}) => ${F}(${A});`);else W.push(` this.state.${F} = (${A}) => {`,` ${typeof L.body==="string"?L.body:""}`," };")}for(let[F,L]of V){W.push("");let I=$6(L.$expression,{eventParam:"e",statePrefix:"this.state"});W.push(` this.state.${F} = ${b9(L,I)};`)}for(let[F,L]of z)if(W.push(""),b6(L)){let I=$6(L.$expression,{eventParam:"e",statePrefix:"this.state"});W.push(` this.state.${F} = computed(() => ${I});`)}else if(L.$src)W.push(` this.state.${F} = computed(() => ${F}(this.state));`);else{W.push(` this.state.${F} = computed(() => {`);let I=(typeof L.body==="string"?L.body:"").replaceAll("state.","this.state.");W.push(` ${I}`," });")}W.push(" }","");let q=[];if(Array.isArray(Z.children)){let F={n:0};for(let L of Z.children)i1(L,q,Z.$media??{},"",F,Z.tagName)}if(W.push(" template() {"," const s = this.state;"," return html`",GX(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 F=[];for(let[L,I]of Object.entries(Z.style)){if(L.startsWith(":")||L.startsWith(".")||L.startsWith("&")||L.startsWith("[")||L.startsWith("@"))continue;if(I===null||typeof I==="object")continue;let A=L6(L);if(typeof I==="string"&&I.includes("${"))F.push([A,I])}if(F.length>0){W.push(" effect(() => {");for(let[L,I]of F){let A=I.replaceAll(/\$\{([^}]+)\}/g,(N,D)=>`\${${D.replaceAll("state.","this.state.")}}`);W.push(` this.style['${L}'] = \`${A}\`;`)}W.push(" });")}}let B=vG(Z.children);if(B)W.push(" const _slotted = Array.from(this.childNodes).filter(n => n.nodeType === 1 || (n.nodeType === 3 && n.textContent.trim()));");if(W.push(" if (this.hasAttribute('data-jx-prerendered')) {"," this.removeAttribute('data-jx-prerendered');"," }"," this.innerHTML = '';"," this.#dispose = effect(() => render(this.template(), this));"),B)W.push(" const _slot = this.querySelector('slot');"," if (_slot && _slotted.length > 0) {"," for (const n of _slotted) _slot.before(n);"," _slot.remove();"," }");return W.push(" if (typeof this.state.onMount === 'function') {"," queueMicrotask(() => this.state.onMount(this.state));"," }"," }",""," disconnectedCallback() {"," if (this.#dispose) { this.#dispose(); this.#dispose = null; }"," if (typeof this.state.onUnmount === 'function') { this.state.onUnmount(this.state); }"," }","}","",`customElements.define('${Z.tagName}', ${X});`,""),W.join(`
|
|
114
|
+
`)}function GX(Z,X,Q){if(!Z)return"";if(Z6(Z))return kG(Z,Q);if(!Array.isArray(Z))return"";return Z.map((J)=>Z6(J)?kG(J,Q):xG(J,Q)).join(`
|
|
115
|
+
`)}function xG(Z,X){if(typeof Z==="string"){if(Z.includes("${"))return`${X}${WX(Z)}`;return`${X}${O0(Z)}`}if(typeof Z==="number"||typeof Z==="boolean")return`${X}${O0(String(Z))}`;if(!Z||typeof Z!=="object")return"";let Q=Z.tagName??"div",J=[];if(Z.attributes)for(let[z,U]of Object.entries(Z.attributes))if(U&&typeof U==="object"&&P6(U))J.push(`${z}="\${${P1(U.$ref)}}"`);else if(typeof U==="string"&&U.includes("${"))J.push(`${z}="${B5(U)}"`);else J.push(`${z}="${U}"`);if(Z.id)J.push(`id="${Z.id}"`);if(Z.className)J.push(`class="${Z.className}"`);for(let[z,U]of Object.entries(Z)){if(p1.has(z)||z.startsWith("$")||z.startsWith("on")||z==="tagName"||z==="id"||z==="className"||z==="style"||z==="children"||z==="textContent"||z==="innerHTML"||z==="attributes")continue;if(U&&typeof U==="object"&&U.$ref)J.push(`.${z}="\${${P1(U.$ref)}}"`);else if(typeof U==="string"&&U.includes("${"))J.push(`.${z}="${B5(U)}"`)}if(Z.$props)for(let[z,U]of Object.entries(Z.$props))if(U&&typeof U==="object"&&U.$ref)J.push(`.${z}="\${${P1(U.$ref)}}"`);else J.push(`.${z}="\${${JSON.stringify(U)}}"`);for(let[z,U]of Object.entries(Z)){if(!z.startsWith("on")||z==="observedAttributes")continue;let V=z.slice(2).toLowerCase();if(U&&typeof U==="object"&&U.$ref)J.push(`@${V}="\${(e) => ${P1(U.$ref)}(s, e)}"`);else if(U&&typeof U==="object"&&"$expression"in U){let q=$6(U.$expression,{eventParam:"e",statePrefix:"s"});J.push(`@${V}="\${(e) => { ${q}; }}"`)}else if(W1(U))J.push(`@${V}="\${(e) => { ${cL(U)} }}"`)}let W=bG(Z.style);if(W)J.push(`style="${W}"`);let G=J.length>0?`
|
|
116
|
+
${X} ${J.join(`
|
|
116
117
|
${X} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(Q))return`${X}<${Q}${G}
|
|
117
|
-
${X}>`;let
|
|
118
|
-
${
|
|
119
|
-
\``)}
|
|
120
|
-
${
|
|
118
|
+
${X}>`;let $="";if(Z.$switch){let z=P6(Z.$switch)?Z.$switch.$ref:Z.$switch,U=P1(z),V=Z.cases??{},q=[];for(let[B,F]of Object.entries(V)){if(!F||P6(F))continue;let L=xG(F,`${X} `);q.push(` ${JSON.stringify(B)}: html\`
|
|
119
|
+
${L}
|
|
120
|
+
\``)}$=`\${{
|
|
121
|
+
${q.join(`,
|
|
121
122
|
`)}
|
|
122
|
-
}[${
|
|
123
|
-
${
|
|
123
|
+
}[${U}]}`}else if(Z.textContent!==void 0)$=WX(Z.textContent);else if(Z.innerHTML!==void 0)$=Z.innerHTML;else if(Z.children)$=`
|
|
124
|
+
${GX(Z.children,Z.style,`${X} `)}
|
|
124
125
|
${X}`;return`${X}<${Q}${G}
|
|
125
|
-
${X}>${
|
|
126
|
+
${X}>${$}</${Q}>`}function kG(Z,X){let Q=P6(Z.items)?P1(Z.items.$ref):"ITEMS",J=Z.map;if(!J)return"";let W=J.tagName??"div",G=[];if(J.$props)for(let[U,V]of Object.entries(J.$props))if(P6(V))G.push(`.${U}="\${${lL(V.$ref)}}"`);else G.push(`.${U}="\${${JSON.stringify(V)}}"`);let Y=bG(J.style);if(Y)G.push(`style="${Y}"`);for(let[U,V]of Object.entries(J)){if(!U.startsWith("on"))continue;let q=U.slice(2).toLowerCase();if(P6(V))G.push(`@${q}="\${(e) => ${P1(V.$ref)}(s, e)}"`);else if(b6(V)){let B=$6(V.$expression,{eventParam:"e",statePrefix:"s"});G.push(`@${q}="\${(e) => { ${B}; }}"`)}}let $=G.length>0?`
|
|
126
127
|
${X} ${G.join(`
|
|
127
|
-
${X} `)}`:"",
|
|
128
|
-
${
|
|
128
|
+
${X} `)}`:"",z="";if(J.textContent!==void 0)z=WX(J.textContent);else if(J.children)z=`
|
|
129
|
+
${GX(J.children,null,`${X} `)}
|
|
129
130
|
${X} `;return`${X}\${${Q}.map((item, index) => html\`
|
|
130
|
-
${X} <${
|
|
131
|
-
${X} >${
|
|
132
|
-
${X}\`)}`}function
|
|
131
|
+
${X} <${W}${$}
|
|
132
|
+
${X} >${z}</${W}>
|
|
133
|
+
${X}\`)}`}function P1(Z){if(Z.startsWith("#/state/"))return`s.${Z.slice(8).replaceAll("/",".")}`;if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return`s.${Z}`}function lL(Z){if(Z.startsWith("$map/"))return Z.slice(5).replaceAll("/",".");return P1(Z)}function B5(Z){return Z.replaceAll("state.","s.")}function WX(Z){if(Z!==null&&typeof Z==="object"&&typeof Z.$ref==="string")return`\${${P1(Z.$ref)}}`;if(typeof Z==="string"&&Z.includes("${"))return B5(Z);return String(Z)}function cL(Z){if(G1(Z))return v6(Z.body,{dispatchTarget:"e.currentTarget",eventParam:"e",statePrefix:"s"});return(typeof Z.body==="string"?Z.body:"").replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function bG(Z){if(!Z||typeof Z!=="object")return"";let X=[];for(let[Q,J]of Object.entries(Z)){if(Q.startsWith(":")||Q.startsWith(".")||Q.startsWith("&")||Q.startsWith("[")||Q.startsWith("@"))continue;if(J===null||typeof J==="object")continue;if(typeof J==="string"&&J.includes("${")){let W=L6(Q);X.push(`${W}: ${B5(J)}`)}}return X.join("; ")}function vG(Z){if(!Array.isArray(Z))return!1;for(let X of Z){if(!X||typeof X!=="object")continue;if(X.tagName==="slot")return!0;if(vG(X.children))return!0}return!1}var c9=s(()=>{x9();n1();Y1();s1()});function yG(Z,X){let{title:Q="Jx App",reactivitySrc:J,litHtmlSrc:W}=X,G=i4(Z,null,Z.state??{},Z.$media??{}),Y=a4(Z,Z.$media??{},X.projectStyle??null),$=[],z=gG(Z,!1,Z,G,$),U=[],V="",q="";if($.length>0){for(let L of $){let I=l9(L.def,L.className,[],X.rewriteSrc);U.push({content:I,path:`_islands/${L.tagName}.js`,tagName:L.tagName})}V=`<script type="importmap">
|
|
133
134
|
{
|
|
134
135
|
"imports": {
|
|
135
|
-
"@vue/reactivity": "${
|
|
136
|
-
"lit-html": "${
|
|
136
|
+
"@vue/reactivity": "${J}",
|
|
137
|
+
"lit-html": "${W}"
|
|
137
138
|
}
|
|
138
139
|
}
|
|
139
|
-
</script>`,
|
|
140
|
-
`)}let
|
|
140
|
+
</script>`,q=U.map((L)=>`<script type="module" src="./${L.path}"></script>`).join(`
|
|
141
|
+
`)}let B=X.prePaintScheme!==!1&&Object.values(Z.$media??{}).some((L)=>$1(String(L))!==null)?`<script>${r4()}</script>
|
|
142
|
+
`:"",F=`<!DOCTYPE html>
|
|
141
143
|
<html lang="en">
|
|
142
144
|
<head>
|
|
143
145
|
<meta charset="utf-8">
|
|
144
146
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
145
|
-
<title>${
|
|
146
|
-
${V}
|
|
147
|
+
<title>${O0(Q)}</title>
|
|
148
|
+
${B}${V}
|
|
147
149
|
${Y}
|
|
148
150
|
</head>
|
|
149
151
|
<body>
|
|
152
|
+
${z}
|
|
150
153
|
${q}
|
|
151
|
-
${B}
|
|
152
154
|
</body>
|
|
153
|
-
</html>`;return{files:
|
|
154
|
-
`)}return""}var
|
|
155
|
+
</html>`;return{files:U,html:F}}function gG(Z,X,Q,J,W){if(typeof Z==="string")return O0(Z);if(typeof Z==="number"||typeof Z==="boolean")return O0(String(Z));if(!Z||typeof Z!=="object")return"";let G=i4(Q,J.scope,Q?.state??J.scopeDefs,Q?.$media??J.media);if(X){let U=W.length,V=`jx-island-${U}`,q=`JxIsland${U}`,B={...Q??Z,tagName:V};return W.push({className:q,def:B,tagName:V}),`<${V}></${V}>`}let Y=Z.tagName??"div",$=l4(Z,G.scope);if($7.has(Y))return`<${Y}${$}>`;let z=pL(Z,Q,G,W);return`<${Y}${$}>${z}</${Y}>`}function pL(Z,X,Q,J){let W=X??Z;if(W.textContent!==void 0){let G=h0(W.textContent,Q.scope);return G==null?"":O0(String(G))}if(W.innerHTML)return h0(W.innerHTML,Q.scope)??W.innerHTML;if(Array.isArray(W.children)){let G=Array.isArray(X?.children)?X.children:void 0;return W.children.map((Y,$)=>{let z=Y,U=vJ(z),V=G?.[$]??Y;return gG(z,U,V,Q,J)}).join(`
|
|
156
|
+
`)}return""}var fG=s(()=>{n1();c9()});function $X(Z,X){let{title:Q="Jx App",reactivitySrc:J=c4,litHtmlSrc:W=p4,modulePath:G="app.js"}=X,Y=i4(Z,null,Z.state??{},Z.$media??{}),$=a4(Z,Z.$media??{},X.projectStyle??null),z={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},U=new Map,V=new Map,q=[],B=[],F=[],L=[],I=[],A=new Map,N=Z.state??{};for(let[y,x]of Object.entries(N)){if(x===null||typeof x!=="object"||Array.isArray(x)){if(typeof x==="string"&&F0(x))B.push([y,`() => \`${x}\``]);else q.push([y,x]);continue}if(b6(x)){let i=x.$expression,r=$6(i,{eventParam:"e",statePrefix:"state"});if(B4(x))I.push(`state[${JSON.stringify(y)}] = ${b9(x,r)};`);else if(d1(i.operator))L.push([y,{args:["state","e"],body:r}]);else B.push([y,`() => ${r}`]);continue}if(W1(x)){let i=x.parameters?c1(x.parameters):x.arguments;if(G1(x)){let r=v6(x.body,{eventParam:"e",statePrefix:"state"});if(x.parameters&&x.parameters.length>0)I.push(`state[${JSON.stringify(y)}] = ${b9(x,`(() => {
|
|
157
|
+
${r}
|
|
158
|
+
})()`)};`);else L.push([y,{args:["state","e"],body:r}])}else if(x.$src){if(!A.has(x.$src))A.set(x.$src,new Set);A.get(x.$src).add(y),B.push([y,`() => { return ${y}(state); }`])}else if(typeof x.body==="string"&&x.body.includes("return"))B.push([y,`() => { ${x.body} }`]);else L.push([y,{args:i??["state"],body:x.body}]);continue}if(l1(x))continue;if(SJ(x)){q.push([y,x.default]);continue}if(F4(x)){if(x.$prototype==="LocalStorage"||x.$prototype==="SessionStorage"){let i=x.$prototype==="LocalStorage"?"localStorage":"sessionStorage",r=x.key??y,h=x.default??null;q.push([y,null]),I.push(rL(y,i,r,h));continue}if(x.$prototype==="Request"){q.push([y,null]),I.push(nL(y,x));continue}if(x.$prototype==="Cookie"){q.push([y,null]),I.push(aL(y,x.name??y,x.default??null));continue}}q.push([y,x])}let D=hG(Z,Z,Y,U,V,z);for(let[y,x]of U)if(!F.some(([i])=>i===y))F.push([y,x]);for(let[y,x]of V)if(!L.some(([i])=>i===y))L.push([y,x]);let O=iL(q,B,F,L,I,A,z,J,X.rewriteSrc),T=[` "@vue/reactivity": "${J}"`,` "lit-html": "${W}"`],w=X.prePaintScheme!==!1&&Object.values(Z.$media??{}).some((y)=>$1(String(y))!==null)?`<script>${r4()}</script>
|
|
159
|
+
`:"",S=`<!DOCTYPE html>
|
|
155
160
|
<html lang="en">
|
|
156
161
|
<head>
|
|
157
162
|
<meta charset="utf-8">
|
|
158
163
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
159
|
-
<title>${
|
|
160
|
-
<script type="importmap">
|
|
164
|
+
<title>${O0(Q)}</title>
|
|
165
|
+
${w}<script type="importmap">
|
|
161
166
|
{
|
|
162
167
|
"imports": {
|
|
163
|
-
${
|
|
168
|
+
${T.join(`,
|
|
164
169
|
`)}
|
|
165
170
|
}
|
|
166
171
|
}
|
|
167
172
|
</script>
|
|
168
|
-
${
|
|
173
|
+
${$}
|
|
169
174
|
<script type="module" src="./${G}"></script>
|
|
170
175
|
</head>
|
|
171
176
|
<body>
|
|
172
|
-
${
|
|
177
|
+
${D}
|
|
173
178
|
</body>
|
|
174
|
-
</html>`;return{files:[{content:
|
|
175
|
-
`);
|
|
179
|
+
</html>`;return{files:[{content:O,path:G}],html:S}}function hG(Z,X,Q,J,W,G){if(typeof Z==="string")return O0(Z);if(typeof Z==="number"||typeof Z==="boolean")return O0(String(Z));if(!Z||typeof Z!=="object")return"";let Y=i4(X,Q.scope,X?.state??Q.scopeDefs,X?.$media??Q.media),$=Z.tagName??"div",z=[],U=!1;if(Z.textContent!==void 0){let A=X?.textContent??Z.textContent;if(n6(A)){let N=Z4(A.$ref);z.push(`:text-content="${N}"`),YX(J,N,A.$ref),U=!0}else if(F0(A)){let N=`_t${G.t}`;G.t+=1,z.push(`:text-content="${N}"`),J.set(N,`() => \`${A}\``),U=!0}}for(let[A,N]of Object.entries(Z)){if(!A.startsWith("on")||A==="observedAttributes")continue;let D=A.slice(2).toLowerCase();if(n6(N)){let O=Z4(N.$ref);z.push(`@${D}="${O}"`),U=!0}else if(G1(N)){let O=`_h${G.h}`;G.h+=1,z.push(`@${D}="${O}"`),W.set(O,{args:["state","e"],body:v6(N.body,{eventParam:"e",statePrefix:"state"})}),U=!0}else if(W1(N)){let O=`_h${G.h}`;G.h+=1,z.push(`@${D}="${O}"`),W.set(O,{args:N.parameters?c1(N.parameters):N.arguments??["state","event"],body:N.body}),U=!0}else if(b6(N)){let O=`_h${G.h}`;G.h+=1,z.push(`@${D}="${O}"`);let T=$6(N.$expression,{eventParam:"e",statePrefix:"state"});W.set(O,{args:["state","e"],body:T}),U=!0}}if(Z.style&&typeof Z.style==="object")for(let[A,N]of Object.entries(Z.style)){if(A.startsWith(":")||A.startsWith(".")||A.startsWith("&")||A.startsWith("[")||A.startsWith("@"))continue;if(N===null||typeof N==="object")continue;if(F0(N)){let D=`_s${G.s}`;G.s+=1,z.push(`:style.${L6(A)}="${D}"`),J.set(D,`() => \`${N}\``),U=!0}}if(Z.attributes&&typeof Z.attributes==="object"){for(let[A,N]of Object.entries(Z.attributes))if(n6(N)){let D=Z4(N.$ref);z.push(`:attr.${A}="${D}"`),YX(J,D,N.$ref),U=!0}else if(F0(N)){let D=`_t${G.t}`;G.t+=1,z.push(`:attr.${A}="${D}"`),J.set(D,`() => \`${N}\``),U=!0}}for(let[A,N]of Object.entries(Z)){if(p1.has(A)||A.startsWith("on")||A.startsWith("$")||A==="tagName"||A==="id"||A==="className"||A==="style"||A==="children"||A==="textContent"||A==="innerHTML"||A==="attributes")continue;if(n6(N)){let D=Z4(N.$ref);z.push(`:${L6(A)}="${D}"`),YX(J,D,N.$ref),U=!0}else if(F0(N)){let D=`_t${G.t}`;G.t+=1,z.push(`:${L6(A)}="${D}"`),J.set(D,`() => \`${N}\``),U=!0}}let V=l4(Z,Y.scope),q=U?" data-bind":"",B=z.length>0?` ${z.join(" ")}`:"",F="",L=X??Z;if(L.textContent!==void 0&&!U){let A=h0(L.textContent,Y.scope);F=A==null?"":O0(String(A))}else if(L.textContent!==void 0&&U){let A=h0(L.textContent,Y.scope);F=A==null?"":O0(String(A))}else if(L.innerHTML)F=h0(L.innerHTML,Y.scope)??L.innerHTML;else if(Z6(L.children)){G.needsLit=!0;let A=`_list${G.l}`;G.l+=1;let N=L.children,D;if(n6(N.items))D=`state.${Z4(N.items.$ref)}`;else D=JSON.stringify(N.items);let O=zX(N.map);J.set(A,`() => (${D} ?? []).map((item, index) => html\`${O}\`)`),z.push(`:render="${A}"`),U=!0;let T=" data-bind",w=` ${z.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has($))return`<${$}${V}${T}${w}>`;return`<${$}${V}${T}${w}></${$}>`}else if(Array.isArray(L.children)&&L.children.some((A)=>Z6(A))){G.needsLit=!0;let A=`_children${G.l}`;G.l+=1;let N=L.children.map((O)=>uG(O)).join(`
|
|
180
|
+
`);J.set(A,`() => html\`
|
|
176
181
|
${N}
|
|
177
|
-
\``),
|
|
178
|
-
`)}if(new Set(["input","br","hr","img","meta","link"]).has(
|
|
179
|
-
${
|
|
180
|
-
`;else if(Array.isArray(Z.children))
|
|
181
|
-
${Z.children.map((G)=>
|
|
182
|
+
\``),z.push(`:render="${A}"`),U=!0;let D=` ${z.join(" ")}`;return`<${$}${V} data-bind${D}></${$}>`}else if(Array.isArray(L.children)){let A=Array.isArray(X?.children)?X.children:void 0;F=L.children.map((N,D)=>{let O=A?.[D]??N;return hG(N,O,Y,J,W,G)}).join(`
|
|
183
|
+
`)}if(new Set(["input","br","hr","img","meta","link"]).has($))return`<${$}${V}${q}${B}>`;return`<${$}${V}${q}${B}>${F}</${$}>`}function zX(Z){if(!Z)return"";let X=Z.tagName??"div",Q="";if(Z.id)Q+=` id="${Z.id}"`;if(Z.className)Q+=` class="${I4(Z.className)}"`;if(Z.attributes&&typeof Z.attributes==="object")for(let[G,Y]of Object.entries(Z.attributes))Q+=typeof Y==="string"&&F0(Y)?` ${G}="${I4(Y)}"`:` ${G}="${O0(String(Y))}"`;if(Z.style&&typeof Z.style==="object"){let G=[];for(let[Y,$]of Object.entries(Z.style)){if(Y.startsWith(":")||Y.startsWith(".")||Y.startsWith("&")||Y.startsWith("[")||Y.startsWith("@"))continue;if($===null||typeof $==="object")continue;let z=L6(Y);if(F0(String($)))G.push(`${z}: ${I4(String($))}`);else G.push(`${z}: ${$}`)}if(G.length>0)Q+=` style="${G.join("; ")}"`}for(let[G,Y]of Object.entries(Z)){if(!G.startsWith("on")||G==="observedAttributes")continue;let $=G.slice(2).toLowerCase();if(n6(Y)){let z=Z4(Y.$ref);Q+=` @${$}=\${(e) => { state.$map = { item, index }; on.${z}(e); }}`}else if(G1(Y)){let z=v6(Y.body,{eventParam:"e",statePrefix:"state"});Q+=` @${$}=\${(e) => { state.$map = { item, index }; ${z} }}`}else if(Y&&typeof Y==="object"&&Y.$prototype==="Function"){let z=I4(Y.body);Q+=` @${$}=\${(e) => { ${z} }}`}else if(Y&&typeof Y==="object"&&"$expression"in Y){let z=$6(Y.$expression,{eventParam:"e",statePrefix:"state"});Q+=` @${$}=\${(e) => { state.$map = { item, index }; ${z}; }}`}}if(Z.contentEditable)Q+=` contenteditable="${Z.contentEditable}"`;let J="";if(Z.textContent!==void 0){let G=String(Z.textContent);if(F0(G))J=I4(G);else if(n6(Z.textContent))J=`\${state.${Z4(Z.textContent.$ref)}}`;else J=O0(G)}else if(Z.innerHTML)J=I4(String(Z.innerHTML));else if(Z6(Z.children))J=`
|
|
184
|
+
${mG(Z.children)}
|
|
185
|
+
`;else if(Array.isArray(Z.children))J=`
|
|
186
|
+
${Z.children.map((G)=>uG(G)).join(`
|
|
182
187
|
`)}
|
|
183
|
-
`;if(new Set(["input","br","hr","img","meta","link"]).has(X))return`<${X}${Q}>`;return`<${X}${Q}>${
|
|
184
|
-
`)}function
|
|
185
|
-
`)}function
|
|
186
|
-
`)}function
|
|
187
|
-
`)}function
|
|
188
|
-
`)}function
|
|
189
|
-
`):Z.body??"").includes("await ")}import{readFileSync as
|
|
188
|
+
`;if(new Set(["input","br","hr","img","meta","link"]).has(X))return`<${X}${Q}>`;return`<${X}${Q}>${J}</${X}>`}function uG(Z){if(typeof Z==="string")return F0(Z)?I4(Z):O0(Z);if(typeof Z==="number"||typeof Z==="boolean")return O0(String(Z));if(Z6(Z))return mG(Z);return zX(Z)}function mG(Z){let{items:X}=Z,Q=n6(X)?`state.${Z4(X.$ref)}`:JSON.stringify(X??[]),J=zX(Z.map);return`\${(${Q} ?? []).map((item, index) => html\`${J}\`)}`}function I4(Z){return Z.replaceAll("$map.","")}function iL(Z,X,Q,J,W,G,Y,$,z){let U=[],{needsLit:V}=Y,q=X.length>0;U.push("// Generated by @jxsuite/compiler — do not edit manually");let B=["reactive","effect"];if(q)B.push("computed");if(U.push(`import { ${B.join(", ")} } from '@vue/reactivity';`),V)U.push("import { html, render } from 'lit-html';");for(let[F,L]of G){let I=z?z(F):F;U.push(`import { ${[...L].join(", ")} } from '${I}';`)}U.push("","const state = reactive({");for(let[F,L]of Z)U.push(` ${F}: ${JSON.stringify(L)},`);if(U.push("});",""),W.length>0){for(let F of W)U.push(F);U.push("")}if(X.length>0){for(let[F,L]of X)U.push(`state.${F} = computed(${L});`);U.push("")}if(Q.length>0){U.push("const bind = {");for(let[F,L]of Q)U.push(` ${F}: ${L},`);U.push("};")}else U.push("const bind = {};");if(U.push(""),J.length>0){U.push("const on = {");for(let[F,L]of J){let I=L.args??["state"],A=I.map((N)=>N==="state"?"state":"e").join(", ");U.push(` ${F}: (e) => { const fn = (${I.join(", ")}) => { ${L.body} }; fn(${A}); },`)}U.push("};")}else U.push("const on = {};");if(U.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)U.push(" if (parts[0] === 'render') {"," effect(() => { render(bind[key](), el); });"," } else if (parts[0] === 'style' && parts.length > 1) {");else U.push(" if (parts[0] === 'style' && parts.length > 1) {");return U.push(" effect(() => { el.style[parts[1]] = bind[key](); });"," } 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);",""),U.join(`
|
|
189
|
+
`)}function nL(Z,X){let{url:Q}=X,J=X.method??"GET",W=F0(Q);if(X.manual)return`// ${Z}: manual Request — fetch triggered by user action`;let G=[`// ${Z}: auto-fetch from ${W?"(dynamic URL)":Q}`,"effect(() => {"];if(W)G.push(` const url = \`${Q}\`;`,' if (!url || url === "undefined" || url.includes("undefined")) return;');else G.push(` const url = ${JSON.stringify(Q)};`);let Y=[];if(J!=="GET")Y.push(`method: ${JSON.stringify(J)}`);if(X.headers)Y.push(`headers: ${JSON.stringify(X.headers)}`);if(X.body){let z=typeof X.body==="object"?JSON.stringify(JSON.stringify(X.body)):JSON.stringify(X.body);Y.push(`body: ${z}`)}let $=Y.length>0?`, { ${Y.join(", ")} }`:"";return G.push(` fetch(url${$})`," .then(r => r.ok ? r.json() : Promise.reject(r.statusText))",` .then(d => { state.${Z} = d; })`,` .catch(e => { state.${Z} = { error: String(e) }; });`,"});"),G.join(`
|
|
190
|
+
`)}function rL(Z,X,Q,J){return[`// ${Z}: ${X} (key: "${Q}")`,"try {",` const _s = ${X}.getItem(${JSON.stringify(Q)});`,` state.${Z} = _s !== null ? JSON.parse(_s) : ${JSON.stringify(J)};`,`} catch { state.${Z} = ${JSON.stringify(J)}; }`,"effect(() => {",` const v = state.${Z};`," try {",` if (v === null) ${X}.removeItem(${JSON.stringify(Q)});`,` else ${X}.setItem(${JSON.stringify(Q)}, JSON.stringify(v));`," } catch {}","});"].join(`
|
|
191
|
+
`)}function aL(Z,X,Q){return[`// ${Z}: Cookie (name: "${X}")`,"{",` const _m = document.cookie.match(new RegExp("(?:^|; )${X}=([^;]*)"));`,` try { state.${Z} = _m ? JSON.parse(decodeURIComponent(_m[1])) : ${JSON.stringify(Q)}; }`,` catch { state.${Z} = _m ? _m[1] : ${JSON.stringify(Q)}; }`,"}"].join(`
|
|
192
|
+
`)}function Z4(Z){if(Z.startsWith("#/state/"))return Z.slice(8).replaceAll("/","_");return Z.replaceAll("/","_")}function YX(Z,X,Q){if(Z.has(X))return;if(Q.startsWith("#/state/")){let W=Q.slice(8).split("/");Z.set(X,`() => state.${W.join(".")}`)}else Z.set(X,`() => state.${Q}`)}var UX=s(()=>{x9();n1();Y1()});var lG={};D1(lG,{compileClassJson:()=>oL});function oL(Z,X={}){let Q=Z.title;if(!Q)throw Error("compileClassJson: missing title (class name)");let J=sL(Z.extends),W=Z.$defs,G=W?.fields??{},Y=W?.constructor,$=typeof Y==="object"?Y:void 0,z=W?.methods??{},U=["// Generated by @jxsuite/compiler from .class.json — do not edit manually"];if(Z.$id)U.push(`// Source: ${Z.$id}`);U.push("");let V=J!=="Object"?` extends ${J}`:"";U.push(`class ${Q}${V} {`);for(let[q,B]of Object.entries(G)){if(B.scope!=="static")continue;let F=B.identifier??q,L=B.access==="private"?"#":"",I=B.initializer!==void 0?JSON.stringify(B.initializer):B.default!==void 0?JSON.stringify(B.default):"null";U.push(` static ${L}${F} = ${I};`)}for(let[q,B]of Object.entries(G)){if(B.scope==="static")continue;if(B.access!=="private")continue;let F=B.identifier??q;U.push(` #${F};`)}if(Object.keys(G).length>0)U.push("");if(U.push(" constructor(config = {}) {"),$?.superCall||J!=="Object"){let q=$?.superCall?.arguments?$.superCall.arguments.join(", "):"";U.push(` super(${q});`)}for(let[q,B]of Object.entries(G)){if(B.scope==="static")continue;let F=B.identifier??q,L=B.access==="private"?"#":"",I=B.initializer!==void 0?JSON.stringify(B.initializer):B.default!==void 0?JSON.stringify(B.default):"null";U.push(` this.${L}${F} = config.${F} !== undefined ? config.${F} : ${I};`)}if($?.body){let q=Array.isArray($.body)?$.body:[$.body];for(let B of q)U.push(` ${B}`)}U.push(" }");for(let[q,B]of Object.entries(z)){let F=B.identifier??q,L=B.scope==="static",A=B.access==="private"?"#":"",N=L?"static ":"",D=B.returnType?.$ref?.includes("Promise")||eL(B)?"async ":"",O=dG(B.parameters??[]),T=tL(B.body);if(U.push(""),B.role==="accessor"){if(B.getter)U.push(` ${N}get ${A}${F}() {`,` ${B.getter.body}`," }");if(B.setter){let w=dG(B.setter.parameters??[]);U.push(` ${N}set ${A}${F}(${w}) {`,` ${B.setter.body}`," }")}}else{U.push(` ${N}${D}${A}${F}(${O}) {`);for(let w of T)U.push(` ${w}`);U.push(" }")}}return U.push("}","",`export { ${Q} };`,`export default ${Q};`,""),U.join(`
|
|
193
|
+
`)}function sL(Z){if(!Z)return"Object";if(typeof Z==="string")return Z;if(Z.$ref){let X=Z.$ref.match(/([A-Za-z0-9_]+)\.class\.json/);return X?X[1]:"Object"}return"Object"}function dG(Z){return Z.map((X)=>{if(X.$ref)return X.$ref.split("/").pop();let Q=X.identifier??X.name;return typeof Q==="string"?Q:"arg"}).join(", ")}function tL(Z){if(!Z)return[""];return Array.isArray(Z)?Z:[Z]}function eL(Z){return(Array.isArray(Z.body)?Z.body.join(`
|
|
194
|
+
`):Z.body??"").includes("await ")}import{readFileSync as ZM}from"node:fs";async function KX(Z,X={}){let{title:Q="Jx App",reactivitySrc:J=c4,litHtmlSrc:W=p4,projectStyle:G=null}=X,Y;if(typeof Z==="string"){let $=ZM(Z,"utf8");if(Z.endsWith(".json"))Y=o1($,Z);else{let{extname:z}=await import("node:path"),U=z(Z).toLowerCase(),V=X.formats?.byExtension?.(U,"parse");if(!V){let{unknownFormatError:q}=await Promise.resolve().then(() => (e1(),JX));throw q(Z,U)}Y=await V.call("parse",$)}}else Y=Z;if(kJ(Y)){let{compileClassJson:$}=await Promise.resolve().then(() => lG),z=$(Y,X),U=typeof Z==="string"?Z.replace(/\.class\.json$/,".js"):`${Y.title}.js`;return{files:[{content:z,path:U}],html:""}}if(!c8(Y))return yG(Y,{litHtmlSrc:W,projectStyle:G,reactivitySrc:J,...X.prePaintScheme===!1?{prePaintScheme:!1}:{},...X.rewriteSrc?{rewriteSrc:X.rewriteSrc}:{},title:Q});if(Y.tagName&&Y.tagName.includes("-")){let{tagName:$}=Y,z=i8($),V={content:l9(Y,z,[],X.rewriteSrc),path:`${$}.js`,tagName:$},q=a4(Y,Y.$media??{}),B=`<!DOCTYPE html>
|
|
190
195
|
<html lang="en">
|
|
191
196
|
<head>
|
|
192
197
|
<meta charset="utf-8">
|
|
193
198
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
194
|
-
<title>${
|
|
199
|
+
<title>${O0(Q)}</title>
|
|
195
200
|
<script type="importmap">
|
|
196
201
|
{
|
|
197
202
|
"imports": {
|
|
198
|
-
"@vue/reactivity": "${
|
|
199
|
-
"lit-html": "${
|
|
203
|
+
"@vue/reactivity": "${J}",
|
|
204
|
+
"lit-html": "${W}"
|
|
200
205
|
}
|
|
201
206
|
}
|
|
202
207
|
</script>
|
|
203
|
-
${
|
|
208
|
+
${q}
|
|
204
209
|
</head>
|
|
205
210
|
<body>
|
|
206
|
-
<${
|
|
207
|
-
<script type="module" src="./${
|
|
211
|
+
<${$}></${$}>
|
|
212
|
+
<script type="module" src="./${$}.js"></script>
|
|
208
213
|
</body>
|
|
209
|
-
</html>`;return{files:[V],html:
|
|
210
|
-
`,patched:!0}}function
|
|
211
|
-
`)){let J
|
|
212
|
-
|
|
214
|
+
</html>`;return{files:[V],html:B}}return $X(Y,{litHtmlSrc:W,projectStyle:G,reactivitySrc:J,...X.prePaintScheme===!1?{prePaintScheme:!1}:{},...X.rewriteSrc?{rewriteSrc:X.rewriteSrc}:{},title:Q})}async function ey(Z,X){let[Q,J]=await Promise.all([KX(Z),d9(Z)]),{writeFileSync:W,mkdirSync:G}=await import("node:fs"),{dirname:Y,join:$}=await import("node:path");if(X){W(X,Q.html,"utf8"),console.error(`Written to ${X}`);let z=Y(X);for(let U of Q.files){let V=$(z,U.path);G(Y(V),{recursive:!0}),W(V,U.content,"utf8"),console.error(`Written to ${V}`)}}else process.stdout.write(Q.html);if(J&&X){let z=X.replace(/(\.[^.]+)?$/,"-server.js");W(z,J,"utf8"),console.error(`Server handler written to ${z}`)}}var cG=s(()=>{n1();t7();c9();fG();UX();Y1();s1();n1();t7();c9();UX()});function pG(Z,X){if(X.length===0)return{content:Z??"",patched:!1};let Q={};if(Z)try{Q=JSON.parse(Z)}catch{return{content:Z,patched:!1}}for(let J of X)iG(Q,J);return{content:`${JSON.stringify(Q,null,"\t")}
|
|
215
|
+
`,patched:!0}}function iG(Z,X){for(let[Q,J]of Object.entries(X)){let W=Z[Q];if(Array.isArray(J)){Z[Q]=XM(Array.isArray(W)?W:[],J);continue}if(L5(J)){if(L5(W))iG(W,J);else if(W===void 0)Z[Q]=structuredClone(J);continue}if(W===void 0)Z[Q]=J}}function XM(Z,X){let Q=[...Z];for(let J of X){if(!L5(J)||typeof J.binding!=="string"){if(!Q.some((Y)=>JSON.stringify(Y)===JSON.stringify(J)))Q.push(structuredClone(J));continue}let W=Q.findIndex((G)=>L5(G)&&G.binding===J.binding);if(W===-1)Q.push(structuredClone(J));else Q[W]={...Q[W],...J}}return Q}function L5(Z){return Z!==null&&typeof Z==="object"&&!Array.isArray(Z)}var nG=()=>{};import{existsSync as QM,readFileSync as JM}from"node:fs";import{resolve as rG}from"node:path";function X9(Z){let X=rG(Z,"project.json");if(!QM(X))throw Error(`project.json not found in ${Z}`);let Q;try{Q=TG(JM(X,"utf8"),X)}catch(Y){throw Error(`Invalid project.json: ${a1(Y)}`,{cause:Y})}let J={...M5,...Q,build:{...M5.build,...Q.build},defaults:{...M5.defaults,...Q.defaults},images:{...M5.images,...Q.images}};if(Q.$head)J.$head=Q.$head;if(Q.$media)J.$media=Q.$media;if(Q.style)J.style=Q.style;if(Q.state)J.state=Q.state;if(Q.redirects)J.redirects=Q.redirects;if(Q.imports)J.imports=Q.imports;let W=["cloudflare-workers","cloudflare-pages","node","bun"];if(J.build.adapter==="static")delete J.build.adapter;if(J.build.adapter&&!W.includes(J.build.adapter))throw Error(`Unknown build adapter "${J.build.adapter}" in project.json. Valid adapters: ${W.join(", ")}`);let G=["build","cloudflare"];if(!G.includes(J.images.service))throw Error(`Unknown images.service "${J.images.service}" in project.json. Valid services: ${G.join(", ")}`);return{config:J,configPath:X,projectRoot:rG(Z)}}var M5;var A5=s(()=>{s1();M5={$head:[],$media:{},build:{format:"directory",outDir:"./dist",provider:null,trailingSlash:"always"},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:""}});var tG={};D1(tG,{readDevVars:()=>sG,dbPush:()=>GM});import{existsSync as VX,readFileSync as aG,writeFileSync as WM}from"node:fs";import{resolve as oG}from"node:path";async function GM(Z,X={}){let{dryRun:Q=!1,connection:J}=X,{config:W}=X9(Z),G=await t1(Z,W),Y=W.connections??{},$=W.data??{},z=Object.keys(Y).filter((L)=>!J||L===J);if(J&&z.length===0)throw Error(`Unknown connection "${J}" (no such connections entry in project.json)`);if(z.length===0)throw Error('project.json has no "connections" section — nothing to push. Declare a connection and '+'its tables in the "data" section first.');let U={...process.env,...sG(Z),JX_PROJECT_ROOT:Z},V=[],q=[];for(let L of z){let I={...Y[L],$name:L},A=String(I.provider??""),N=YM(G.connectors(),A);if(!N)throw Error(`Connection "${L}" names provider "${A}", but no enabled extension provides it (enable the extension in project.json "extensions")`);let D={};for(let[T,w]of Object.entries($))if(w.connection===L)D[T]=w;let O=await N.call("deploySchema",D,I,{dryRun:Q,env:U});if(V.push({applied:O.applied??!Q,connection:L,provider:A,statements:O.statements??[],tables:Object.keys(D),warnings:O.warnings??[]}),N.capabilities.bindings){let T=await N.call("bindings",I);if(T&&Object.keys(T).length>0)q.push(T)}}let B=oG(Z,"wrangler.jsonc"),F=!1;if(!Q&&q.length>0&&VX(B)){let L=aG(B,"utf8"),{content:I,patched:A}=pG(L,q);if(A&&I!==L)WM(B,I,"utf8"),F=!0}return{bindingsPatched:F,results:V,wranglerPath:VX(B)?B:null}}function YM(Z,X){return Z.find((Q)=>Q.connector?.provider===X)}function sG(Z){let X=oG(Z,".dev.vars");if(!VX(X))return{};let Q={};for(let J of aG(X,"utf8").split(`
|
|
216
|
+
`)){let W=J.trim();if(W===""||W.startsWith("#"))continue;let G=W.indexOf("=");if(G===-1)continue;let Y=W.slice(0,G).trim(),$=W.slice(G+1).trim();if($.startsWith('"')&&$.endsWith('"')||$.startsWith("'")&&$.endsWith("'"))$=$.slice(1,-1);if(Y!=="")Q[Y]=$}return Q}var eG=s(()=>{nG();e1();A5()});function N4(Z){return Z.startsWith("npm:")}function XY(Z){let X=Z;if(N4(X))X=X.slice(4);return X=X.replace(/^\.\//,"").replace(/\.(js|ts|mjs|mts)$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,""),`/assets/${X}.js`}var ZY="npm:";var o9=C((Lg,EY)=>{var __dirname="/home/runner/work/jx/jx/node_modules/esbuild/lib",__filename="/home/runner/work/jx/jx/node_modules/esbuild/lib/main.js",LX=Object.defineProperty,$M=Object.getOwnPropertyDescriptor,zM=Object.getOwnPropertyNames,UM=Object.prototype.hasOwnProperty,KM=(Z,X)=>{for(var Q in X)LX(Z,Q,{get:X[Q],enumerable:!0})},VM=(Z,X,Q,J)=>{if(X&&typeof X==="object"||typeof X==="function"){for(let W of zM(X))if(!UM.call(Z,W)&&W!==Q)LX(Z,W,{get:()=>X[W],enumerable:!(J=$M(X,W))||J.enumerable})}return Z},HM=(Z)=>VM(LX({},"__esModule",{value:!0}),Z),r9={};KM(r9,{analyzeMetafile:()=>lM,analyzeMetafileSync:()=>nM,build:()=>hM,buildSync:()=>cM,context:()=>uM,default:()=>sM,formatMessages:()=>dM,formatMessagesSync:()=>iM,initialize:()=>aM,stop:()=>rM,transform:()=>mM,transformSync:()=>pM,version:()=>fM});EY.exports=HM(r9);function QY(Z){let X=(J)=>{if(J===null)Q.write8(0);else if(typeof J==="boolean")Q.write8(1),Q.write8(+J);else if(typeof J==="number")Q.write8(2),Q.write32(J|0);else if(typeof J==="string")Q.write8(3),Q.write(a6(J));else if(J instanceof Uint8Array)Q.write8(4),Q.write(J);else if(J instanceof Array){Q.write8(5),Q.write32(J.length);for(let W of J)X(W)}else{let W=Object.keys(J);Q.write8(6),Q.write32(W.length);for(let G of W)Q.write(a6(G)),X(J[G])}},Q=new HY;return Q.write32(0),Q.write32(Z.id<<1|+!Z.isRequest),X(Z.value),qX(Q.buf,Q.len-4,0),Q.buf.subarray(0,Q.len)}function qM(Z){let X=()=>{switch(Q.read8()){case 0:return null;case 1:return!!Q.read8();case 2:return Q.read32();case 3:return O4(Q.read());case 4:return Q.read();case 5:{let Y=Q.read32(),$=[];for(let z=0;z<Y;z++)$.push(X());return $}case 6:{let Y=Q.read32(),$={};for(let z=0;z<Y;z++)$[O4(Q.read())]=X();return $}default:throw Error("Invalid packet")}},Q=new HY(Z),J=Q.read32(),W=(J&1)===0;J>>>=1;let G=X();if(Q.ptr!==Z.length)throw Error("Invalid packet");return{id:J,isRequest:W,value:G}}var HY=class{constructor(Z=new Uint8Array(1024)){this.buf=Z,this.len=0,this.ptr=0}_write(Z){if(this.len+Z>this.buf.length){let X=new Uint8Array((this.len+Z)*2);X.set(this.buf),this.buf=X}return this.len+=Z,this.len-Z}write8(Z){let X=this._write(1);this.buf[X]=Z}write32(Z){let X=this._write(4);qX(this.buf,Z,X)}write(Z){let X=this._write(4+Z.length);qX(this.buf,Z.length,X),this.buf.set(Z,X+4)}_read(Z){if(this.ptr+Z>this.buf.length)throw Error("Invalid packet");return this.ptr+=Z,this.ptr-Z}read8(){return this.buf[this._read(1)]}read32(){return qY(this.buf,this._read(4))}read(){let Z=this.read32(),X=new Uint8Array(Z),Q=this._read(X.length);return X.set(this.buf.subarray(Q,Q+Z)),X}},a6,O4,HX;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let Z=new TextEncoder,X=new TextDecoder;a6=(Q)=>Z.encode(Q),O4=(Q)=>X.decode(Q),HX='new TextEncoder().encode("")'}else if(typeof Buffer<"u")a6=(Z)=>Buffer.from(Z),O4=(Z)=>{let{buffer:X,byteOffset:Q,byteLength:J}=Z;return Buffer.from(X,Q,J).toString()},HX='Buffer.from("")';else throw Error("No UTF-8 codec found");if(!(a6("")instanceof Uint8Array))throw Error(`Invariant violation: "${HX} instanceof Uint8Array" is incorrectly false
|
|
217
|
+
|
|
218
|
+
This indicates that your JavaScript environment is broken. You cannot use
|
|
219
|
+
esbuild in this environment because esbuild relies on this invariant. This
|
|
220
|
+
is not a problem with esbuild. You need to fix your environment instead.
|
|
221
|
+
`);function qY(Z,X){return(Z[X++]|Z[X++]<<8|Z[X++]<<16|Z[X++]<<24)>>>0}function qX(Z,X,Q){Z[Q++]=X,Z[Q++]=X>>8,Z[Q++]=X>>16,Z[Q++]=X>>24}var C1=String.fromCharCode;function h6(Z,X,Q){let J=Z[X],W=1,G=0;for(let Y=0;Y<X;Y++)if(Z[Y]===10)W++,G=0;else G++;throw SyntaxError(Q?Q:X===Z.length?"Unexpected end of input while parsing JSON":J>=32&&J<=126?`Unexpected character ${C1(J)} in JSON at position ${X} (line ${W}, column ${G})`:`Unexpected byte 0x${J.toString(16)} in JSON at position ${X} (line ${W}, column ${G})`)}function BM(Z){if(!(Z instanceof Uint8Array))throw Error("JSON input must be a Uint8Array");let X=[],Q=[],J=[],W=Z.length,G=null,Y=0,$,z=0;while(z<W){let U=Z[z++];if(U<=32)continue;let V;if(Y===2&&G===null&&U!==34&&U!==125)h6(Z,--z);switch(U){case 116:{if(Z[z++]!==114||Z[z++]!==117||Z[z++]!==101)h6(Z,--z);V=!0;break}case 102:{if(Z[z++]!==97||Z[z++]!==108||Z[z++]!==115||Z[z++]!==101)h6(Z,--z);V=!1;break}case 110:{if(Z[z++]!==117||Z[z++]!==108||Z[z++]!==108)h6(Z,--z);V=null;break}case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:{let q=z;V=C1(U),U=Z[z];while(!0){switch(U){case 43:case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 101:case 69:{V+=C1(U),U=Z[++z];continue}}break}if(V=+V,isNaN(V))h6(Z,--q,"Invalid number");break}case 34:{V="";while(!0){if(z>=W)h6(Z,W);if(U=Z[z++],U===34)break;else if(U===92)switch(Z[z++]){case 34:V+='"';break;case 47:V+="/";break;case 92:V+="\\";break;case 98:V+="\b";break;case 102:V+="\f";break;case 110:V+=`
|
|
222
|
+
`;break;case 114:V+="\r";break;case 116:V+="\t";break;case 117:{let q=0;for(let B=0;B<4;B++)if(U=Z[z++],q<<=4,U>=48&&U<=57)q|=U-48;else if(U>=97&&U<=102)q|=U+-87;else if(U>=65&&U<=70)q|=U+-55;else h6(Z,--z);V+=C1(q);break}default:h6(Z,--z);break}else if(U<=127)V+=C1(U);else if((U&224)===192)V+=C1((U&31)<<6|Z[z++]&63);else if((U&240)===224)V+=C1((U&15)<<12|(Z[z++]&63)<<6|Z[z++]&63);else if((U&248)==240){let q=(U&7)<<18|(Z[z++]&63)<<12|(Z[z++]&63)<<6|Z[z++]&63;if(q>65535)q-=65536,V+=C1(q>>10&1023|55296),q=56320|q&1023;V+=C1(q)}}V[0];break}case 91:{V=[],X.push(G),Q.push($),J.push(Y),G=null,$=V,Y=1;continue}case 123:{V={},X.push(G),Q.push($),J.push(Y),G=null,$=V,Y=2;continue}case 93:{if(Y!==1)h6(Z,--z);V=$,G=X.pop(),$=Q.pop(),Y=J.pop();break}case 125:{if(Y!==2)h6(Z,--z);V=$,G=X.pop(),$=Q.pop(),Y=J.pop();break}default:h6(Z,--z)}U=Z[z];while(U<=32)U=Z[++z];switch(Y){case 0:{if(z===W)return V;break}case 1:{if($.push(V),U===44){z++;continue}if(U===93)continue;break}case 2:{if(G===null){if(G=V,U===58){z++;continue}}else{if($[G]=V,G=null,U===44){z++;continue}if(U===125)continue}break}}break}h6(Z,z)}var c0=JSON.stringify,JY="warning",WY="silent";function J9(Z,X){let Q=[];for(let J of Z){if(I6(J,X),J.indexOf(",")>=0)throw Error(`Invalid ${X}: ${J}`);Q.push(J)}return Q.join(",")}var D5=()=>null,v0=(Z)=>typeof Z==="boolean"?null:"a boolean",z0=(Z)=>typeof Z==="string"?null:"a string",T5=(Z)=>Z instanceof RegExp?null:"a RegExp object",T4=(Z)=>typeof Z==="number"&&Z===(Z|0)?null:"an integer",FM=(Z)=>typeof Z==="number"&&Z===(Z|0)&&Z>=0&&Z<=65535?null:"a valid port number",BY=(Z)=>typeof Z==="function"?null:"a function",S1=(Z)=>Array.isArray(Z)?null:"an array",N6=(Z)=>Array.isArray(Z)&&Z.every((X)=>typeof X==="string")?null:"an array of strings",_6=(Z)=>typeof Z==="object"&&Z!==null&&!Array.isArray(Z)?null:"an object",LM=(Z)=>typeof Z==="object"&&Z!==null?null:"an array or an object",MM=(Z)=>Z instanceof WebAssembly.Module?null:"a WebAssembly.Module",GY=(Z)=>typeof Z==="object"&&!Array.isArray(Z)?null:"an object or null",FY=(Z)=>typeof Z==="string"||typeof Z==="boolean"?null:"a string or a boolean",AM=(Z)=>typeof Z==="string"||typeof Z==="object"&&Z!==null&&!Array.isArray(Z)?null:"a string or an object",LY=(Z)=>typeof Z==="string"||Array.isArray(Z)&&Z.every((X)=>typeof X==="string")?null:"a string or an array of strings",MY=(Z)=>typeof Z==="string"||Z instanceof Uint8Array?null:"a string or a Uint8Array",IM=(Z)=>typeof Z==="string"||Z instanceof URL?null:"a string or a URL";function P(Z,X,Q,J){let W=Z[Q];if(X[Q+""]=!0,W===void 0)return;let G=J(W);if(G!==null)throw Error(`${c0(Q)} must be ${G}`);return W}function d0(Z,X,Q){for(let J in Z)if(!(J in X))throw Error(`Invalid option ${Q}: ${c0(J)}`)}function NM(Z){let X=Object.create(null),Q=P(Z,X,"wasmURL",IM),J=P(Z,X,"wasmModule",MM),W=P(Z,X,"worker",v0);return d0(Z,X,"in initialize() call"),{wasmURL:Q,wasmModule:J,worker:W}}function AY(Z){let X;if(Z!==void 0){X=Object.create(null);for(let Q in Z){let J=Z[Q];if(typeof J==="string"||J===!1)X[Q]=J;else throw Error(`Expected ${c0(Q)} in mangle cache to map to either a string or false`)}}return X}function R5(Z,X,Q,J,W){let G=P(X,Q,"color",v0),Y=P(X,Q,"logLevel",z0),$=P(X,Q,"logLimit",T4);if(G!==void 0)Z.push(`--color=${G}`);else if(J)Z.push("--color=true");Z.push(`--log-level=${Y||W}`),Z.push(`--log-limit=${$||0}`)}function I6(Z,X,Q){if(typeof Z!=="string")throw Error(`Expected value for ${X}${Q!==void 0?" "+c0(Q):""} to be a string, got ${typeof Z} instead`);return Z}function IY(Z,X,Q){let J=P(X,Q,"legalComments",z0),W=P(X,Q,"sourceRoot",z0),G=P(X,Q,"sourcesContent",v0),Y=P(X,Q,"target",LY),$=P(X,Q,"format",z0),z=P(X,Q,"globalName",z0),U=P(X,Q,"mangleProps",T5),V=P(X,Q,"reserveProps",T5),q=P(X,Q,"mangleQuoted",v0),B=P(X,Q,"minify",v0),F=P(X,Q,"minifySyntax",v0),L=P(X,Q,"minifyWhitespace",v0),I=P(X,Q,"minifyIdentifiers",v0),A=P(X,Q,"lineLimit",T4),N=P(X,Q,"drop",N6),D=P(X,Q,"dropLabels",N6),O=P(X,Q,"charset",z0),T=P(X,Q,"treeShaking",v0),w=P(X,Q,"ignoreAnnotations",v0),S=P(X,Q,"jsx",z0),y=P(X,Q,"jsxFactory",z0),x=P(X,Q,"jsxFragment",z0),i=P(X,Q,"jsxImportSource",z0),r=P(X,Q,"jsxDev",v0),h=P(X,Q,"jsxSideEffects",v0),n=P(X,Q,"define",_6),W0=P(X,Q,"logOverride",_6),G0=P(X,Q,"supported",_6),H0=P(X,Q,"pure",N6),E=P(X,Q,"keepNames",v0),l=P(X,Q,"platform",z0),c=P(X,Q,"tsconfigRaw",AM),$0=P(X,Q,"absPaths",N6);if(J)Z.push(`--legal-comments=${J}`);if(W!==void 0)Z.push(`--source-root=${W}`);if(G!==void 0)Z.push(`--sources-content=${G}`);if(Y)Z.push(`--target=${J9(Array.isArray(Y)?Y:[Y],"target")}`);if($)Z.push(`--format=${$}`);if(z)Z.push(`--global-name=${z}`);if(l)Z.push(`--platform=${l}`);if(c)Z.push(`--tsconfig-raw=${typeof c==="string"?c:JSON.stringify(c)}`);if(B)Z.push("--minify");if(F)Z.push("--minify-syntax");if(L)Z.push("--minify-whitespace");if(I)Z.push("--minify-identifiers");if(A)Z.push(`--line-limit=${A}`);if(O)Z.push(`--charset=${O}`);if(T!==void 0)Z.push(`--tree-shaking=${T}`);if(w)Z.push("--ignore-annotations");if(N)for(let m of N)Z.push(`--drop:${I6(m,"drop")}`);if(D)Z.push(`--drop-labels=${J9(D,"drop label")}`);if($0)Z.push(`--abs-paths=${J9($0,"abs paths")}`);if(U)Z.push(`--mangle-props=${w5(U)}`);if(V)Z.push(`--reserve-props=${w5(V)}`);if(q!==void 0)Z.push(`--mangle-quoted=${q}`);if(S)Z.push(`--jsx=${S}`);if(y)Z.push(`--jsx-factory=${y}`);if(x)Z.push(`--jsx-fragment=${x}`);if(i)Z.push(`--jsx-import-source=${i}`);if(r)Z.push("--jsx-dev");if(h)Z.push("--jsx-side-effects");if(n)for(let m in n){if(m.indexOf("=")>=0)throw Error(`Invalid define: ${m}`);Z.push(`--define:${m}=${I6(n[m],"define",m)}`)}if(W0)for(let m in W0){if(m.indexOf("=")>=0)throw Error(`Invalid log override: ${m}`);Z.push(`--log-override:${m}=${I6(W0[m],"log override",m)}`)}if(G0)for(let m in G0){if(m.indexOf("=")>=0)throw Error(`Invalid supported: ${m}`);let X0=G0[m];if(typeof X0!=="boolean")throw Error(`Expected value for supported ${c0(m)} to be a boolean, got ${typeof X0} instead`);Z.push(`--supported:${m}=${X0}`)}if(H0)for(let m of H0)Z.push(`--pure:${I6(m,"pure")}`);if(E)Z.push("--keep-names")}function DM(Z,X,Q,J,W){var G;let Y=[],$=[],z=Object.create(null),U=null,V=null;R5(Y,X,z,Q,J),IY(Y,X,z);let q=P(X,z,"sourcemap",FY),B=P(X,z,"bundle",v0),F=P(X,z,"splitting",v0),L=P(X,z,"preserveSymlinks",v0),I=P(X,z,"metafile",v0),A=P(X,z,"outfile",z0),N=P(X,z,"outdir",z0),D=P(X,z,"outbase",z0),O=P(X,z,"tsconfig",z0),T=P(X,z,"resolveExtensions",N6),w=P(X,z,"nodePaths",N6),S=P(X,z,"mainFields",N6),y=P(X,z,"conditions",N6),x=P(X,z,"external",N6),i=P(X,z,"packages",z0),r=P(X,z,"alias",_6),h=P(X,z,"loader",_6),n=P(X,z,"outExtension",_6),W0=P(X,z,"publicPath",z0),G0=P(X,z,"entryNames",z0),H0=P(X,z,"chunkNames",z0),E=P(X,z,"assetNames",z0),l=P(X,z,"inject",N6),c=P(X,z,"banner",_6),$0=P(X,z,"footer",_6),m=P(X,z,"entryPoints",LM),X0=P(X,z,"absWorkingDir",z0),a=P(X,z,"stdin",_6),Y0=(G=P(X,z,"write",v0))!=null?G:W,C0=P(X,z,"allowOverwrite",v0),I0=P(X,z,"mangleCache",_6);if(z.plugins=!0,d0(X,z,`in ${Z}() call`),q)Y.push(`--sourcemap${q===!0?"":`=${q}`}`);if(B)Y.push("--bundle");if(C0)Y.push("--allow-overwrite");if(F)Y.push("--splitting");if(L)Y.push("--preserve-symlinks");if(I)Y.push("--metafile");if(A)Y.push(`--outfile=${A}`);if(N)Y.push(`--outdir=${N}`);if(D)Y.push(`--outbase=${D}`);if(O)Y.push(`--tsconfig=${O}`);if(i)Y.push(`--packages=${i}`);if(T)Y.push(`--resolve-extensions=${J9(T,"resolve extension")}`);if(W0)Y.push(`--public-path=${W0}`);if(G0)Y.push(`--entry-names=${G0}`);if(H0)Y.push(`--chunk-names=${H0}`);if(E)Y.push(`--asset-names=${E}`);if(S)Y.push(`--main-fields=${J9(S,"main field")}`);if(y)Y.push(`--conditions=${J9(y,"condition")}`);if(x)for(let Q0 of x)Y.push(`--external:${I6(Q0,"external")}`);if(r)for(let Q0 in r){if(Q0.indexOf("=")>=0)throw Error(`Invalid package name in alias: ${Q0}`);Y.push(`--alias:${Q0}=${I6(r[Q0],"alias",Q0)}`)}if(c)for(let Q0 in c){if(Q0.indexOf("=")>=0)throw Error(`Invalid banner file type: ${Q0}`);Y.push(`--banner:${Q0}=${I6(c[Q0],"banner",Q0)}`)}if($0)for(let Q0 in $0){if(Q0.indexOf("=")>=0)throw Error(`Invalid footer file type: ${Q0}`);Y.push(`--footer:${Q0}=${I6($0[Q0],"footer",Q0)}`)}if(l)for(let Q0 of l)Y.push(`--inject:${I6(Q0,"inject")}`);if(h)for(let Q0 in h){if(Q0.indexOf("=")>=0)throw Error(`Invalid loader extension: ${Q0}`);Y.push(`--loader:${Q0}=${I6(h[Q0],"loader",Q0)}`)}if(n)for(let Q0 in n){if(Q0.indexOf("=")>=0)throw Error(`Invalid out extension: ${Q0}`);Y.push(`--out-extension:${Q0}=${I6(n[Q0],"out extension",Q0)}`)}if(m)if(Array.isArray(m))for(let Q0=0,W6=m.length;Q0<W6;Q0++){let N0=m[Q0];if(typeof N0==="object"&&N0!==null){let t0=Object.create(null),p0=P(N0,t0,"in",z0),e0=P(N0,t0,"out",z0);if(d0(N0,t0,"in entry point at index "+Q0),p0===void 0)throw Error('Missing property "in" for entry point at index '+Q0);if(e0===void 0)throw Error('Missing property "out" for entry point at index '+Q0);$.push([e0,p0])}else $.push(["",I6(N0,"entry point at index "+Q0)])}else for(let Q0 in m)$.push([Q0,I6(m[Q0],"entry point",Q0)]);if(a){let Q0=Object.create(null),W6=P(a,Q0,"contents",MY),N0=P(a,Q0,"resolveDir",z0),t0=P(a,Q0,"sourcefile",z0),p0=P(a,Q0,"loader",z0);if(d0(a,Q0,'in "stdin" object'),t0)Y.push(`--sourcefile=${t0}`);if(p0)Y.push(`--loader=${p0}`);if(N0)V=N0;if(typeof W6==="string")U=a6(W6);else if(W6 instanceof Uint8Array)U=W6}let a0=[];if(w)for(let Q0 of w)Q0+="",a0.push(Q0);return{entries:$,flags:Y,write:Y0,stdinContents:U,stdinResolveDir:V,absWorkingDir:X0,nodePaths:a0,mangleCache:AY(I0)}}function TM(Z,X,Q,J){let W=[],G=Object.create(null);R5(W,X,G,Q,J),IY(W,X,G);let Y=P(X,G,"sourcemap",FY),$=P(X,G,"sourcefile",z0),z=P(X,G,"loader",z0),U=P(X,G,"banner",z0),V=P(X,G,"footer",z0),q=P(X,G,"mangleCache",_6);if(d0(X,G,`in ${Z}() call`),Y)W.push(`--sourcemap=${Y===!0?"external":Y}`);if($)W.push(`--sourcefile=${$}`);if(z)W.push(`--loader=${z}`);if(U)W.push(`--banner=${U}`);if(V)W.push(`--footer=${V}`);return{flags:W,mangleCache:AY(q)}}function NY(Z){let X={},Q={didClose:!1,reason:""},J={},W=0,G=0,Y=new Uint8Array(16384),$=0,z=(O)=>{let T=$+O.length;if(T>Y.length){let S=new Uint8Array(T*2);S.set(Y),Y=S}Y.set(O,$),$+=O.length;let w=0;while(w+4<=$){let S=qY(Y,w);if(w+4+S>$)break;w+=4,L(Y.subarray(w,w+S)),w+=S}if(w>0)Y.copyWithin(0,w,$),$-=w},U=(O)=>{if(Q.didClose=!0,O)Q.reason=": "+(O.message||O);let T="The service was stopped"+Q.reason;for(let w in J)J[w](T,null);J={}},V=(O,T,w)=>{if(Q.didClose)return w("The service is no longer running"+Q.reason,null);let S=W++;if(J[S]=(y,x)=>{try{w(y,x)}finally{if(O)O.unref()}},O)O.ref();Z.writeToStdin(QY({id:S,isRequest:!0,value:T}))},q=(O,T)=>{if(Q.didClose)throw Error("The service is no longer running"+Q.reason);Z.writeToStdin(QY({id:O,isRequest:!1,value:T}))},B=async(O,T)=>{try{if(T.command==="ping"){q(O,{});return}if(typeof T.key==="number"){let w=X[T.key];if(!w)return;let S=w[T.command];if(S){await S(O,T);return}}throw Error("Invalid command: "+T.command)}catch(w){let S=[D4(w,Z,null,void 0,"")];try{q(O,{errors:S})}catch{}}},F=!0,L=(O)=>{if(F){F=!1;let w=String.fromCharCode(...O);if(w!=="0.28.1")throw Error(`Cannot start service: Host version "0.28.1" does not match binary version ${c0(w)}`);return}let T=qM(O);if(T.isRequest)B(T.id,T.value);else{let w=J[T.id];if(delete J[T.id],T.value.error)w(T.value.error,{});else w(null,T.value)}};return{readFromStdout:z,afterClose:U,service:{buildOrContext:({callName:O,refs:T,options:w,isTTY:S,defaultWD:y,callback:x})=>{let i=0,r=G++,h={},n={ref(){if(++i===1){if(T)T.ref()}},unref(){if(--i===0){if(delete X[r],T)T.unref()}}};X[r]=h,n.ref(),wM(O,r,V,q,n,Z,h,w,S,y,(W0,G0)=>{try{x(W0,G0)}finally{n.unref()}})},transform:({callName:O,refs:T,input:w,options:S,isTTY:y,fs:x,callback:i})=>{let r=DY(),h=(n)=>{try{if(typeof w!=="string"&&!(w instanceof Uint8Array))throw Error('The input to "transform" must be a string or a Uint8Array');let{flags:W0,mangleCache:G0}=TM(O,S,y,WY),H0={command:"transform",flags:W0,inputFS:n!==null,input:n!==null?a6(n):typeof w==="string"?a6(w):w};if(G0)H0.mangleCache=G0;V(T,H0,(E,l)=>{if(E)return i(Error(E),null);let c=W9(l.errors,r),$0=W9(l.warnings,r),m=1,X0=()=>{if(--m===0){let a={warnings:$0,code:l.code,map:l.map,mangleCache:void 0,legalComments:void 0};if("legalComments"in l)a.legalComments=l==null?void 0:l.legalComments;if(l.mangleCache)a.mangleCache=l==null?void 0:l.mangleCache;i(null,a)}};if(c.length>0)return i(i9("Transform failed",c,$0),null);if(l.codeFS)m++,x.readFile(l.code,(a,Y0)=>{if(a!==null)i(a,null);else l.code=Y0,X0()});if(l.mapFS)m++,x.readFile(l.map,(a,Y0)=>{if(a!==null)i(a,null);else l.map=Y0,X0()});X0()})}catch(W0){let G0=[];try{R5(G0,S,{},y,WY)}catch{}let H0=D4(W0,Z,r,void 0,"");V(T,{command:"error",flags:G0,error:H0},()=>{H0.detail=r.load(H0.detail),i(i9("Transform failed",[H0],[]),null)})}};if((typeof w==="string"||w instanceof Uint8Array)&&w.length>1048576){let n=h;h=()=>x.writeFile(w,n)}h(null)},formatMessages:({callName:O,refs:T,messages:w,options:S,callback:y})=>{if(!S)throw Error(`Missing second argument in ${O}() call`);let x={},i=P(S,x,"kind",z0),r=P(S,x,"color",v0),h=P(S,x,"terminalWidth",T4);if(d0(S,x,`in ${O}() call`),i===void 0)throw Error(`Missing "kind" in ${O}() call`);if(i!=="error"&&i!=="warning")throw Error(`Expected "kind" to be "error" or "warning" in ${O}() call`);let n={command:"format-msgs",messages:_1(w,"messages",null,"",h),isWarning:i==="warning"};if(r!==void 0)n.color=r;if(h!==void 0)n.terminalWidth=h;V(T,n,(W0,G0)=>{if(W0)return y(Error(W0),null);y(null,G0.messages)})},analyzeMetafile:({callName:O,refs:T,metafile:w,options:S,callback:y})=>{if(S===void 0)S={};let x={},i=P(S,x,"color",v0),r=P(S,x,"verbose",v0);d0(S,x,`in ${O}() call`);let h={command:"analyze-metafile",metafile:w};if(i!==void 0)h.color=i;if(r!==void 0)h.verbose=r;V(T,h,(n,W0)=>{if(n)return y(Error(n),null);y(null,W0.result)})}}}}function wM(Z,X,Q,J,W,G,Y,$,z,U,V){let q=DY(),B=Z==="context",F=(A,N)=>{let D=[];try{R5(D,$,{},z,JY)}catch{}let O=D4(A,G,q,void 0,N);Q(W,{command:"error",flags:D,error:O},()=>{O.detail=q.load(O.detail),V(i9(B?"Context failed":"Build failed",[O],[]),null)})},L;if(typeof $==="object"){let A=$.plugins;if(A!==void 0){if(!Array.isArray(A))return F(Error('"plugins" must be an array'),"");L=A}}if(L&&L.length>0){if(G.isSync)return F(Error("Cannot use plugins in synchronous API calls"),"");jM(X,Q,J,W,G,Y,$,L,q).then((A)=>{if(!A.ok)return F(A.error,A.pluginName);try{I(A.requestPlugins,A.runOnEndCallbacks,A.scheduleOnDisposeCallbacks)}catch(N){F(N,"")}},(A)=>F(A,""));return}try{I(null,(A,N)=>N([],[]),()=>{})}catch(A){F(A,"")}function I(A,N,D){let O=G.hasFS,{entries:T,flags:w,write:S,stdinContents:y,stdinResolveDir:x,absWorkingDir:i,nodePaths:r,mangleCache:h}=DM(Z,$,z,JY,O);if(S&&!G.hasFS)throw Error('The "write" option is unavailable in this environment');let n={command:"build",key:X,entries:T,flags:w,write:S,stdinContents:y,stdinResolveDir:x,absWorkingDir:i||U,nodePaths:r,context:B};if(A)n.plugins=A;if(h)n.mangleCache=h;let W0=(E,l)=>{let c={errors:W9(E.errors,q),warnings:W9(E.warnings,q),outputFiles:void 0,metafile:void 0,mangleCache:void 0},$0=c.errors.slice(),m=c.warnings.slice();if(E.outputFiles)c.outputFiles=E.outputFiles.map(EM);if(E.metafile&&E.metafile.length)c.metafile=RM(E.metafile);if(E.mangleCache)c.mangleCache=E.mangleCache;if(E.writeToStdout!==void 0)console.log(O4(E.writeToStdout).replace(/\n$/,""));N(c,(X0,a)=>{if($0.length>0||X0.length>0){let Y0=i9("Build failed",$0.concat(X0),m.concat(a));return l(Y0,null,X0,a)}l(null,c,X0,a)})},G0,H0;if(B)Y["on-end"]=(E,l)=>new Promise((c)=>{W0(l,($0,m,X0,a)=>{let Y0={errors:X0,warnings:a};if(H0)H0($0,m);G0=void 0,H0=void 0,J(E,Y0),c()})});Q(W,n,(E,l)=>{if(E)return V(Error(E),null);if(!B)return W0(l,(m,X0)=>{return D(),V(m,X0)});if(l.errors.length>0)return V(i9("Context failed",l.errors,l.warnings),null);let c=!1,$0={rebuild:()=>{if(!G0)G0=new Promise((m,X0)=>{let a;H0=(C0,I0)=>{if(!a)a=()=>C0?X0(C0):m(I0)};let Y0=()=>{Q(W,{command:"rebuild",key:X},(I0,a0)=>{if(I0)X0(Error(I0));else if(a)a();else Y0()})};Y0()});return G0},watch:(m={})=>new Promise((X0,a)=>{if(!G.hasFS)throw Error('Cannot use the "watch" API in this environment');let Y0={},C0=P(m,Y0,"delay",T4);d0(m,Y0,"in watch() call");let I0={command:"watch",key:X};if(C0)I0.delay=C0;Q(W,I0,(a0)=>{if(a0)a(Error(a0));else X0(void 0)})}),serve:(m={})=>new Promise((X0,a)=>{if(!G.hasFS)throw Error('Cannot use the "serve" API in this environment');let Y0={},C0=P(m,Y0,"port",FM),I0=P(m,Y0,"host",z0),a0=P(m,Y0,"servedir",z0),Q0=P(m,Y0,"keyfile",z0),W6=P(m,Y0,"certfile",z0),N0=P(m,Y0,"fallback",z0),t0=P(m,Y0,"cors",_6),p0=P(m,Y0,"onRequest",BY);d0(m,Y0,"in serve() call");let e0={command:"serve",key:X,onRequest:!!p0};if(C0!==void 0)e0.port=C0;if(I0!==void 0)e0.host=I0;if(a0!==void 0)e0.servedir=a0;if(Q0!==void 0)e0.keyfile=Q0;if(W6!==void 0)e0.certfile=W6;if(N0!==void 0)e0.fallback=N0;if(t0){let Q1={},x6=P(t0,Q1,"origin",LY);if(d0(t0,Q1,'on "cors" object'),Array.isArray(x6))e0.corsOrigin=x6;else if(x6!==void 0)e0.corsOrigin=[x6]}Q(W,e0,(Q1,x6)=>{if(Q1)return a(Error(Q1));if(p0)Y["serve-request"]=(h4,u4)=>{p0(u4.args),J(h4,{})};X0(x6)})}),cancel:()=>new Promise((m)=>{if(c)return m();Q(W,{command:"cancel",key:X},()=>{m()})}),dispose:()=>new Promise((m)=>{if(c)return m();c=!0,Q(W,{command:"dispose",key:X},()=>{m(),D(),W.unref()})})};W.ref(),V(null,$0)})}}var jM=async(Z,X,Q,J,W,G,Y,$,z)=>{let U=[],V=[],q={},B={},F=[],L=0,I=0,A=[],N=!1;$=[...$];for(let T of $){let w={};if(typeof T!=="object")throw Error(`Plugin at index ${I} must be an object`);let S=P(T,w,"name",z0);if(typeof S!=="string"||S==="")throw Error(`Plugin at index ${I} is missing a name`);try{let y=P(T,w,"setup",BY);if(typeof y!=="function")throw Error("Plugin is missing a setup function");d0(T,w,`on plugin ${c0(S)}`);let x={name:S,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};I++;let r=y({initialOptions:Y,resolve:(h,n={})=>{if(!N)throw Error('Cannot call "resolve" before plugin setup has completed');if(typeof h!=="string")throw Error("The path to resolve must be a string");let W0=Object.create(null),G0=P(n,W0,"pluginName",z0),H0=P(n,W0,"importer",z0),E=P(n,W0,"namespace",z0),l=P(n,W0,"resolveDir",z0),c=P(n,W0,"kind",z0),$0=P(n,W0,"pluginData",D5),m=P(n,W0,"with",_6);return d0(n,W0,"in resolve() call"),new Promise((X0,a)=>{let Y0={command:"resolve",path:h,key:Z,pluginName:S};if(G0!=null)Y0.pluginName=G0;if(H0!=null)Y0.importer=H0;if(E!=null)Y0.namespace=E;if(l!=null)Y0.resolveDir=l;if(c!=null)Y0.kind=c;else throw Error('Must specify "kind" when calling "resolve"');if($0!=null)Y0.pluginData=z.store($0);if(m!=null)Y0.with=OM(m,"with");X(J,Y0,(C0,I0)=>{if(C0!==null)a(Error(C0));else X0({errors:W9(I0.errors,z),warnings:W9(I0.warnings,z),path:I0.path,external:I0.external,sideEffects:I0.sideEffects,namespace:I0.namespace,suffix:I0.suffix,pluginData:z.load(I0.pluginData)})})})},onStart(h){let W0=I5(Error('This error came from the "onStart" callback registered here:'),W,"onStart");U.push({name:S,callback:h,note:W0}),x.onStart=!0},onEnd(h){let W0=I5(Error('This error came from the "onEnd" callback registered here:'),W,"onEnd");V.push({name:S,callback:h,note:W0}),x.onEnd=!0},onResolve(h,n){let G0=I5(Error('This error came from the "onResolve" callback registered here:'),W,"onResolve"),H0={},E=P(h,H0,"filter",T5),l=P(h,H0,"namespace",z0);if(d0(h,H0,`in onResolve() call for plugin ${c0(S)}`),E==null)throw Error("onResolve() call is missing a filter");let c=L++;q[c]={name:S,callback:n,note:G0},x.onResolve.push({id:c,filter:w5(E),namespace:l||""})},onLoad(h,n){let G0=I5(Error('This error came from the "onLoad" callback registered here:'),W,"onLoad"),H0={},E=P(h,H0,"filter",T5),l=P(h,H0,"namespace",z0);if(d0(h,H0,`in onLoad() call for plugin ${c0(S)}`),E==null)throw Error("onLoad() call is missing a filter");let c=L++;B[c]={name:S,callback:n,note:G0},x.onLoad.push({id:c,filter:w5(E),namespace:l||""})},onDispose(h){F.push(h)},esbuild:W.esbuild});if(r)await r;A.push(x)}catch(y){return{ok:!1,error:y,pluginName:S}}}G["on-start"]=async(T,w)=>{z.clear();let S={errors:[],warnings:[]};await Promise.all(U.map(async({name:y,callback:x,note:i})=>{try{let r=await x();if(r!=null){if(typeof r!=="object")throw Error(`Expected onStart() callback in plugin ${c0(y)} to return an object`);let h={},n=P(r,h,"errors",S1),W0=P(r,h,"warnings",S1);if(d0(r,h,`from onStart() callback in plugin ${c0(y)}`),n!=null)S.errors.push(..._1(n,"errors",z,y,void 0));if(W0!=null)S.warnings.push(..._1(W0,"warnings",z,y,void 0))}}catch(r){S.errors.push(D4(r,W,z,i&&i(),y))}})),Q(T,S)},G["on-resolve"]=async(T,w)=>{let S={},y="",x,i;for(let r of w.ids)try{({name:y,callback:x,note:i}=q[r]);let h=await x({path:w.path,importer:w.importer,namespace:w.namespace,resolveDir:w.resolveDir,kind:w.kind,pluginData:z.load(w.pluginData),with:w.with});if(h!=null){if(typeof h!=="object")throw Error(`Expected onResolve() callback in plugin ${c0(y)} to return an object`);let n={},W0=P(h,n,"pluginName",z0),G0=P(h,n,"path",z0),H0=P(h,n,"namespace",z0),E=P(h,n,"suffix",z0),l=P(h,n,"external",v0),c=P(h,n,"sideEffects",v0),$0=P(h,n,"pluginData",D5),m=P(h,n,"errors",S1),X0=P(h,n,"warnings",S1),a=P(h,n,"watchFiles",N6),Y0=P(h,n,"watchDirs",N6);if(d0(h,n,`from onResolve() callback in plugin ${c0(y)}`),S.id=r,W0!=null)S.pluginName=W0;if(G0!=null)S.path=G0;if(H0!=null)S.namespace=H0;if(E!=null)S.suffix=E;if(l!=null)S.external=l;if(c!=null)S.sideEffects=c;if($0!=null)S.pluginData=z.store($0);if(m!=null)S.errors=_1(m,"errors",z,y,void 0);if(X0!=null)S.warnings=_1(X0,"warnings",z,y,void 0);if(a!=null)S.watchFiles=N5(a,"watchFiles");if(Y0!=null)S.watchDirs=N5(Y0,"watchDirs");break}}catch(h){S={id:r,errors:[D4(h,W,z,i&&i(),y)]};break}Q(T,S)},G["on-load"]=async(T,w)=>{let S={},y="",x,i;for(let r of w.ids)try{({name:y,callback:x,note:i}=B[r]);let h=await x({path:w.path,namespace:w.namespace,suffix:w.suffix,pluginData:z.load(w.pluginData),with:w.with});if(h!=null){if(typeof h!=="object")throw Error(`Expected onLoad() callback in plugin ${c0(y)} to return an object`);let n={},W0=P(h,n,"pluginName",z0),G0=P(h,n,"contents",MY),H0=P(h,n,"resolveDir",z0),E=P(h,n,"pluginData",D5),l=P(h,n,"loader",z0),c=P(h,n,"errors",S1),$0=P(h,n,"warnings",S1),m=P(h,n,"watchFiles",N6),X0=P(h,n,"watchDirs",N6);if(d0(h,n,`from onLoad() callback in plugin ${c0(y)}`),S.id=r,W0!=null)S.pluginName=W0;if(G0 instanceof Uint8Array)S.contents=G0;else if(G0!=null)S.contents=a6(G0);if(H0!=null)S.resolveDir=H0;if(E!=null)S.pluginData=z.store(E);if(l!=null)S.loader=l;if(c!=null)S.errors=_1(c,"errors",z,y,void 0);if($0!=null)S.warnings=_1($0,"warnings",z,y,void 0);if(m!=null)S.watchFiles=N5(m,"watchFiles");if(X0!=null)S.watchDirs=N5(X0,"watchDirs");break}}catch(h){S={id:r,errors:[D4(h,W,z,i&&i(),y)]};break}Q(T,S)};let D=(T,w)=>w([],[]);if(V.length>0)D=(T,w)=>{(async()=>{let S=[],y=[];for(let{name:x,callback:i,note:r}of V){let h,n;try{let W0=await i(T);if(W0!=null){if(typeof W0!=="object")throw Error(`Expected onEnd() callback in plugin ${c0(x)} to return an object`);let G0={},H0=P(W0,G0,"errors",S1),E=P(W0,G0,"warnings",S1);if(d0(W0,G0,`from onEnd() callback in plugin ${c0(x)}`),H0!=null)h=_1(H0,"errors",z,x,void 0);if(E!=null)n=_1(E,"warnings",z,x,void 0)}}catch(W0){h=[D4(W0,W,z,r&&r(),x)]}if(h){S.push(...h);try{T.errors.push(...h)}catch{}}if(n){y.push(...n);try{T.warnings.push(...n)}catch{}}}w(S,y)})()};let O=()=>{for(let T of F)setTimeout(()=>T(),0)};return N=!0,{ok:!0,requestPlugins:A,runOnEndCallbacks:D,scheduleOnDisposeCallbacks:O}};function DY(){let Z=new Map,X=0;return{clear(){Z.clear()},load(Q){return Z.get(Q)},store(Q){if(Q===void 0)return-1;let J=X++;return Z.set(J,Q),J}}}function I5(Z,X,Q){let J,W=!1;return()=>{if(W)return J;W=!0;try{let G=(Z.stack+"").split(`
|
|
223
|
+
`);G.splice(1,1);let Y=TY(X,G,Q);if(Y)return J={text:Z.message,location:Y},J}catch{}}}function D4(Z,X,Q,J,W){let G="Internal error",Y=null;try{G=(Z&&Z.message||Z)+""}catch{}try{Y=TY(X,(Z.stack+"").split(`
|
|
224
|
+
`),"")}catch{}return{id:"",pluginName:W,text:G,location:Y,notes:J?[J]:[],detail:Q?Q.store(Z):-1}}function TY(Z,X,Q){let J=" at ";if(Z.readFileSync&&!X[0].startsWith(J)&&X[1].startsWith(J))for(let W=1;W<X.length;W++){let G=X[W];if(!G.startsWith(J))continue;G=G.slice(J.length);while(!0){let Y=/^(?:new |async )?\S+ \((.*)\)$/.exec(G);if(Y){G=Y[1];continue}if(Y=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(G),Y){G=Y[1];continue}if(Y=/^(\S+):(\d+):(\d+)$/.exec(G),Y){let $;try{$=Z.readFileSync(Y[1],"utf8")}catch{break}let z=$.split(/\r\n|\r|\n|\u2028|\u2029/)[+Y[2]-1]||"",U=+Y[3]-1,V=z.slice(U,U+Q.length)===Q?Q.length:0;return{file:Y[1],namespace:"file",line:+Y[2],column:a6(z.slice(0,U)).length,length:a6(z.slice(U,U+V)).length,lineText:z+`
|
|
225
|
+
`+X.slice(1).join(`
|
|
226
|
+
`),suggestion:""}}break}}return null}function i9(Z,X,Q){let J=5;Z+=X.length<1?"":` with ${X.length} error${X.length<2?"":"s"}:`+X.slice(0,J+1).map((G,Y)=>{if(Y===J)return`
|
|
227
|
+
...`;if(!G.location)return`
|
|
228
|
+
error: ${G.text}`;let{file:$,line:z,column:U}=G.location,V=G.pluginName?`[plugin: ${G.pluginName}] `:"";return`
|
|
229
|
+
${$}:${z}:${U}: ERROR: ${V}${G.text}`}).join("");let W=Error(Z);for(let[G,Y]of[["errors",X],["warnings",Q]])Object.defineProperty(W,G,{configurable:!0,enumerable:!0,get:()=>Y,set:($)=>Object.defineProperty(W,G,{configurable:!0,enumerable:!0,value:$})});return W}function W9(Z,X){for(let Q of Z)Q.detail=X.load(Q.detail);return Z}function YY(Z,X,Q){if(Z==null)return null;let J={},W=P(Z,J,"file",z0),G=P(Z,J,"namespace",z0),Y=P(Z,J,"line",T4),$=P(Z,J,"column",T4),z=P(Z,J,"length",T4),U=P(Z,J,"lineText",z0),V=P(Z,J,"suggestion",z0);if(d0(Z,J,X),U){let q=U.slice(0,($&&$>0?$:0)+(z&&z>0?z:0)+(Q&&Q>0?Q:80));if(!/[\x7F-\uFFFF]/.test(q)&&!/\n/.test(U))U=q}return{file:W||"",namespace:G||"",line:Y||0,column:$||0,length:z||0,lineText:U||"",suggestion:V||""}}function _1(Z,X,Q,J,W){let G=[],Y=0;for(let $ of Z){let z={},U=P($,z,"id",z0),V=P($,z,"pluginName",z0),q=P($,z,"text",z0),B=P($,z,"location",GY),F=P($,z,"notes",S1),L=P($,z,"detail",D5),I=`in element ${Y} of "${X}"`;d0($,z,I);let A=[];if(F)for(let N of F){let D={},O=P(N,D,"text",z0),T=P(N,D,"location",GY);d0(N,D,I),A.push({text:O||"",location:YY(T,I,W)})}G.push({id:U||"",pluginName:V||J,text:q||"",location:YY(B,I,W),notes:A,detail:Q?Q.store(L):-1}),Y++}return G}function N5(Z,X){let Q=[];for(let J of Z){if(typeof J!=="string")throw Error(`${c0(X)} must be an array of strings`);Q.push(J)}return Q}function OM(Z,X){let Q=Object.create(null);for(let J in Z){let W=Z[J];if(typeof W!=="string")throw Error(`key ${c0(J)} in object ${c0(X)} must be a string`);Q[J]=W}return Q}function EM({path:Z,contents:X,hash:Q}){let J=null;return{path:Z,contents:X,hash:Q,get text(){let W=this.contents;if(J===null||W!==X)X=W,J=O4(W);return J}}}function w5(Z){let X=Z.source;if(Z.flags)X=`(?${Z.flags})${X}`;return X}function RM(Z){let X;try{X=O4(Z)}catch{return BM(Z)}return JSON.parse(X)}var X4=w0("fs"),$Y=w0("os"),u6=w0("path"),Q9=process.env.ESBUILD_BINARY_PATH||Q9,PM=(Z)=>!!Z&&Z!=="/usr/bin/esbuild",zY="@esbuild/darwin-arm64",UY="@esbuild/darwin-x64",j5={"win32 arm64 LE":"@esbuild/win32-arm64","win32 ia32 LE":"@esbuild/win32-ia32","win32 x64 LE":"@esbuild/win32-x64"},O5={"aix ppc64 BE":"@esbuild/aix-ppc64","android arm64 LE":"@esbuild/android-arm64","darwin arm64 LE":"@esbuild/darwin-arm64","darwin x64 LE":"@esbuild/darwin-x64","freebsd arm64 LE":"@esbuild/freebsd-arm64","freebsd x64 LE":"@esbuild/freebsd-x64","linux arm LE":"@esbuild/linux-arm","linux arm64 LE":"@esbuild/linux-arm64","linux ia32 LE":"@esbuild/linux-ia32","linux mips64el LE":"@esbuild/linux-mips64el","linux ppc64 LE":"@esbuild/linux-ppc64","linux riscv64 LE":"@esbuild/linux-riscv64","linux s390x BE":"@esbuild/linux-s390x","linux x64 LE":"@esbuild/linux-x64","linux loong64 LE":"@esbuild/linux-loong64","netbsd arm64 LE":"@esbuild/netbsd-arm64","netbsd x64 LE":"@esbuild/netbsd-x64","openbsd arm64 LE":"@esbuild/openbsd-arm64","openbsd x64 LE":"@esbuild/openbsd-x64","sunos x64 LE":"@esbuild/sunos-x64"},KY={"android arm LE":"@esbuild/android-arm","android x64 LE":"@esbuild/android-x64","openharmony arm64 LE":"@esbuild/openharmony-arm64"};function CM(){let Z,X,Q=!1,J=`${process.platform} ${$Y.arch()} ${$Y.endianness()}`;if(J in j5)Z=j5[J],X="esbuild.exe";else if(J in O5)Z=O5[J],X="bin/esbuild";else if(J in KY)Z=KY[J],X="bin/esbuild",Q=!0;else throw Error(`Unsupported platform: ${J}`);return{pkg:Z,subpath:X,isWASM:Q}}function SM(){let Z=w0.resolve("esbuild"),X=u6.dirname(u6.dirname(u6.dirname(Z)));if(u6.basename(X)==="node_modules"){for(let Q in O5)try{let J=O5[Q];if(X4.existsSync(u6.join(X,J)))return J}catch{}for(let Q in j5)try{let J=j5[Q];if(X4.existsSync(u6.join(X,J)))return J}catch{}}return null}function _M(Z,X){let Q=u6.dirname(w0.resolve("esbuild"));return u6.join(Q,`downloaded-${Z.replace("/","-")}-${u6.basename(X)}`)}function kM(){if(PM(Q9))if(!X4.existsSync(Q9))console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${Q9}`);else return{binPath:Q9,isWASM:!1};let{pkg:Z,subpath:X,isWASM:Q}=CM(),J;try{J=w0.resolve(`${Z}/${X}`)}catch(W){if(J=_M(Z,X),!X4.existsSync(J)){try{w0.resolve(Z)}catch{let G=SM();if(G){let Y=`
|
|
230
|
+
Specifically the "${G}" package is present but this platform
|
|
231
|
+
needs the "${Z}" package instead. People often get into this
|
|
232
|
+
situation by installing esbuild on Windows or macOS and copying "node_modules"
|
|
233
|
+
into a Docker image that runs Linux, or by copying "node_modules" between
|
|
234
|
+
Windows and WSL environments.
|
|
235
|
+
|
|
236
|
+
If you are installing with npm, you can try not copying the "node_modules"
|
|
237
|
+
directory when you copy the files over, and running "npm ci" or "npm install"
|
|
238
|
+
on the destination platform after the copy. Or you could consider using yarn
|
|
239
|
+
instead of npm which has built-in support for installing a package on multiple
|
|
240
|
+
platforms simultaneously.
|
|
241
|
+
|
|
242
|
+
If you are installing with yarn, you can try listing both this platform and the
|
|
243
|
+
other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
|
|
244
|
+
feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
|
|
245
|
+
Keep in mind that this means multiple copies of esbuild will be present.
|
|
246
|
+
`;if(Z===UY&&G===zY||Z===zY&&G===UY)Y=`
|
|
247
|
+
Specifically the "${G}" package is present but this platform
|
|
248
|
+
needs the "${Z}" package instead. People often get into this
|
|
249
|
+
situation by installing esbuild with npm running inside of Rosetta 2 and then
|
|
250
|
+
trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta
|
|
251
|
+
2 is Apple's on-the-fly x86_64-to-arm64 translation service).
|
|
252
|
+
|
|
253
|
+
If you are installing with npm, you can try ensuring that both npm and node are
|
|
254
|
+
not running under Rosetta 2 and then reinstalling esbuild. This likely involves
|
|
255
|
+
changing how you installed npm and/or node. For example, installing node with
|
|
256
|
+
the universal installer here should work: https://nodejs.org/en/download/. Or
|
|
257
|
+
you could consider using yarn instead of npm which has built-in support for
|
|
258
|
+
installing a package on multiple platforms simultaneously.
|
|
259
|
+
|
|
260
|
+
If you are installing with yarn, you can try listing both "arm64" and "x64"
|
|
261
|
+
in your ".yarnrc.yml" file using the "supportedArchitectures" feature:
|
|
262
|
+
https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
|
|
263
|
+
Keep in mind that this means multiple copies of esbuild will be present.
|
|
264
|
+
`;throw Error(`
|
|
265
|
+
You installed esbuild for another platform than the one you're currently using.
|
|
266
|
+
This won't work because esbuild is written with native code and needs to
|
|
267
|
+
install a platform-specific binary executable.
|
|
268
|
+
${Y}
|
|
269
|
+
Another alternative is to use the "esbuild-wasm" package instead, which works
|
|
270
|
+
the same way on all platforms. But it comes with a heavy performance cost and
|
|
271
|
+
can sometimes be 10x slower than the "esbuild" package, so you may also not
|
|
272
|
+
want to do that.
|
|
273
|
+
`)}throw Error(`The package "${Z}" could not be found, and is needed by esbuild.
|
|
274
|
+
|
|
275
|
+
If you are installing esbuild with npm, make sure that you don't specify the
|
|
276
|
+
"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
|
|
277
|
+
of "package.json" is used by esbuild to install the correct binary executable
|
|
278
|
+
for your current platform.`)}throw W}}if(/\.zip\//.test(J)){let W;try{W=(()=>{throw new Error("Cannot require module "+"pnpapi");})()}catch(G){}if(W){let G=W.getPackageInformation(W.topLevel).packageLocation,Y=u6.join(G,"node_modules",".cache","esbuild",`pnpapi-${Z.replace("/","-")}-0.28.1-${u6.basename(X)}`);if(!X4.existsSync(Y))X4.mkdirSync(u6.dirname(Y),{recursive:!0}),X4.copyFileSync(J,Y),X4.chmodSync(Y,493);return{binPath:Y,isWASM:Q}}}return{binPath:J,isWASM:Q}}var wY=w0("child_process"),xM=w0("crypto"),BX=w0("path"),w4=w0("fs"),bM=w0("os"),vM=w0("tty"),V6;if(process.env.ESBUILD_WORKER_THREADS!=="0"){try{V6=w0("worker_threads")}catch{}let[Z,X]=process.versions.node.split(".");if(+Z<12||+Z===12&&+X<17||+Z===13&&+X<13)V6=void 0}var VY,a9=((VY=V6==null?void 0:V6.workerData)==null?void 0:VY.esbuildVersion)==="0.28.1",jY=()=>{if((!Q9||!1)&&(BX.basename(__filename)!=="main.js"||BX.basename(__dirname)!=="lib"))throw Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
|
|
279
|
+
|
|
280
|
+
More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.`);{let{binPath:Z,isWASM:X}=kM();if(X)return["node",[Z]];else return[Z,[]]}},n9=()=>vM.isatty(2),yM={readFile(Z,X){try{let Q=w4.readFileSync(Z,"utf8");try{w4.unlinkSync(Z)}catch{}X(null,Q)}catch(Q){X(Q,null)}},writeFile(Z,X){try{let Q=OY();w4.writeFileSync(Q,Z),X(Q)}catch{X(null)}}},gM={readFile(Z,X){try{w4.readFile(Z,"utf8",(Q,J)=>{try{w4.unlink(Z,()=>X(Q,J))}catch{X(Q,J)}})}catch(Q){X(Q,null)}},writeFile(Z,X){try{let Q=OY();w4.writeFile(Q,Z,(J)=>J!==null?X(null):X(Q))}catch{X(null)}}},fM="0.28.1",hM=(Z)=>E4().build(Z),uM=(Z)=>E4().context(Z),mM=(Z,X)=>E4().transform(Z,X),dM=(Z,X)=>E4().formatMessages(Z,X),lM=(Z,X)=>E4().analyzeMetafile(Z,X),cM=(Z)=>{if(V6&&!a9){if(!H6)H6=C5(V6);return H6.buildSync(Z)}let X;return P5((Q)=>Q.buildOrContext({callName:"buildSync",refs:null,options:Z,isTTY:n9(),defaultWD:j4,callback:(J,W)=>{if(J)throw J;X=W}})),X},pM=(Z,X)=>{if(V6&&!a9){if(!H6)H6=C5(V6);return H6.transformSync(Z,X)}let Q;return P5((J)=>J.transform({callName:"transformSync",refs:null,input:Z,options:X||{},isTTY:n9(),fs:yM,callback:(W,G)=>{if(W)throw W;Q=G}})),Q},iM=(Z,X)=>{if(V6&&!a9){if(!H6)H6=C5(V6);return H6.formatMessagesSync(Z,X)}let Q;return P5((J)=>J.formatMessages({callName:"formatMessagesSync",refs:null,messages:Z,options:X,callback:(W,G)=>{if(W)throw W;Q=G}})),Q},nM=(Z,X)=>{if(V6&&!a9){if(!H6)H6=C5(V6);return H6.analyzeMetafileSync(Z,X)}let Q;return P5((J)=>J.analyzeMetafile({callName:"analyzeMetafileSync",refs:null,metafile:typeof Z==="string"?Z:JSON.stringify(Z),options:X,callback:(W,G)=>{if(W)throw W;Q=G}})),Q},rM=()=>{if(E5)E5();if(H6)H6.stop();return Promise.resolve()},FX=!1,aM=(Z)=>{if(Z=NM(Z||{}),Z.wasmURL)throw Error('The "wasmURL" option only works in the browser');if(Z.wasmModule)throw Error('The "wasmModule" option only works in the browser');if(Z.worker)throw Error('The "worker" option only works in the browser');if(FX)throw Error('Cannot call "initialize" more than once');return E4(),FX=!0,Promise.resolve()},j4=process.cwd(),p9,E5,E4=()=>{if(p9)return p9;let[Z,X]=jY(),Q=wY.spawn(Z,X.concat("--service=0.28.1","--ping"),{windowsHide:!0,stdio:["pipe","pipe","inherit"],cwd:j4}),{readFromStdout:J,afterClose:W,service:G}=NY({writeToStdin(V){Q.stdin.write(V,(q)=>{if(q)W(q)})},readFileSync:w4.readFileSync,isSync:!1,hasFS:!0,esbuild:r9});Q.stdin.on("error",W),Q.on("error",W);let{stdin:Y,stdout:$}=Q;$.on("data",J),$.on("end",W),E5=()=>{Y.destroy(),$.destroy(),Q.kill(),FX=!1,p9=void 0,E5=void 0};let z=0;if(Q.unref(),Y.unref)Y.unref();if($.unref)$.unref();let U={ref(){if(++z===1)Q.ref()},unref(){if(--z===0)Q.unref()}};return p9={build:(V)=>new Promise((q,B)=>{G.buildOrContext({callName:"build",refs:U,options:V,isTTY:n9(),defaultWD:j4,callback:(F,L)=>F?B(F):q(L)})}),context:(V)=>new Promise((q,B)=>G.buildOrContext({callName:"context",refs:U,options:V,isTTY:n9(),defaultWD:j4,callback:(F,L)=>F?B(F):q(L)})),transform:(V,q)=>new Promise((B,F)=>G.transform({callName:"transform",refs:U,input:V,options:q||{},isTTY:n9(),fs:gM,callback:(L,I)=>L?F(L):B(I)})),formatMessages:(V,q)=>new Promise((B,F)=>G.formatMessages({callName:"formatMessages",refs:U,messages:V,options:q,callback:(L,I)=>L?F(L):B(I)})),analyzeMetafile:(V,q)=>new Promise((B,F)=>G.analyzeMetafile({callName:"analyzeMetafile",refs:U,metafile:typeof V==="string"?V:JSON.stringify(V),options:q,callback:(L,I)=>L?F(L):B(I)}))},p9},P5=(Z)=>{let[X,Q]=jY(),J=new Uint8Array,{readFromStdout:W,afterClose:G,service:Y}=NY({writeToStdin(z){if(J.length!==0)throw Error("Must run at most one command");J=z},isSync:!0,hasFS:!0,esbuild:r9});Z(Y);let $=wY.execFileSync(X,Q.concat("--service=0.28.1"),{cwd:j4,windowsHide:!0,input:J,maxBuffer:+process.env.ESBUILD_MAX_BUFFER||16777216});W($),G(null)},OY=()=>{return BX.join(bM.tmpdir(),`esbuild-${xM.randomBytes(32).toString("hex")}`)},H6=null,C5=(Z)=>{let{port1:X,port2:Q}=new Z.MessageChannel,J=new Z.Worker(__filename,{workerData:{workerPort:Q,defaultWD:j4,esbuildVersion:"0.28.1"},transferList:[Q],execArgv:[]}),W=0,G=(U)=>{let V=Error(`Build failed with 1 error:
|
|
281
|
+
error: ${U}`),q=[{id:"",pluginName:"",text:U,location:null,notes:[],detail:void 0}];return V.errors=q,V.warnings=[],V},Y=(U)=>{if(!U)return;let V=U.plugins;if(V&&V.length>0)throw G("Cannot use plugins in synchronous API calls")},$=(U,V)=>{for(let q in V)U[q]=V[q]},z=(U,V)=>{let q=W++,B=new SharedArrayBuffer(8),F=new Int32Array(B),L={sharedBuffer:B,id:q,command:U,args:V};J.postMessage(L);let I=Atomics.wait(F,0,0);if(I!=="ok"&&I!=="not-equal")throw Error("Internal error: Atomics.wait() failed: "+I);let{message:{id:A,resolve:N,reject:D,properties:O}}=Z.receiveMessageOnPort(X);if(q!==A)throw Error(`Internal error: Expected id ${q} but got id ${A}`);if(D)throw $(D,O),D;return N};return J.unref(),{buildSync(U){return Y(U),z("build",[U])},transformSync(U,V){return z("transform",[U,V])},formatMessagesSync(U,V){return z("formatMessages",[U,V])},analyzeMetafileSync(U,V){return z("analyzeMetafile",[U,V])},stop(){J.terminate(),H6=null}}},oM=()=>{let Z=V6.workerData.workerPort,X=V6.parentPort,Q=(J)=>{let W={};if(J&&typeof J==="object")for(let G in J)W[G]=J[G];return W};try{let J=E4();j4=V6.workerData.defaultWD,X.on("message",(W)=>{(async()=>{let{sharedBuffer:G,id:Y,command:$,args:z}=W,U=new Int32Array(G);try{switch($){case"build":Z.postMessage({id:Y,resolve:await J.build(z[0])});break;case"transform":Z.postMessage({id:Y,resolve:await J.transform(z[0],z[1])});break;case"formatMessages":Z.postMessage({id:Y,resolve:await J.formatMessages(z[0],z[1])});break;case"analyzeMetafile":Z.postMessage({id:Y,resolve:await J.analyzeMetafile(z[0],z[1])});break;default:throw Error(`Invalid command: ${$}`)}}catch(V){Z.postMessage({id:Y,reject:V,properties:Q(V)})}Atomics.add(U,0,1),Atomics.notify(U,0,1/0)})()})}catch(J){X.on("message",(W)=>{let{sharedBuffer:G,id:Y}=W,$=new Int32Array(G);Z.postMessage({id:Y,reject:J,properties:Q(J)}),Atomics.add($,0,1),Atomics.notify($,0,1/0)})}};if(a9)oM();var sM=r9});import{rmSync as tM,writeFileSync as RY}from"node:fs";import{createRequire as eM}from"node:module";import{join as PY,resolve as ZA}from"node:path";function SY(Z){return N4(Z)||Z.startsWith("./")||Z.startsWith("../")}function MX(){return typeof Bun>"u"||process.env.JX_BUNDLER==="esbuild"}function _Y(Z,X,Q){if(N4(Z)){let J=Z.slice(ZY.length);if(MX())return eM(PY(Q,"package.json")).resolve(J);return Bun.resolveSync(J,Q)}return ZA(X,Z)}function XA(Z){if(Z==="cloudflare-workers"||Z==="cloudflare-pages")return{conditions:["workerd","worker"],external:["cloudflare:*","node:*"],target:"workerd"};return{target:Z==="bun"?"bun":"node"}}function kY(Z){return Z==="node"||Z==="bun"?"node":"browser"}function QA(Z){if(Z==="workerd")return"browser";return Z}async function AX(Z,X){let Q=X.external??[];if(MX()){await(await Promise.resolve().then(() => J1(o9(),1))).build({bundle:!0,...X.conditions?{conditions:X.conditions}:{},entryPoints:[Z.entryPath],external:Q,format:"esm",logLevel:"silent",minify:!1,outfile:Z.outfile,platform:kY(X.target)});return}let J=await Bun.build({...X.conditions?{conditions:X.conditions}:{},entrypoints:[Z.entryPath],external:Q,format:"esm",minify:!1,target:QA(X.target),throw:!1});if(!J.success||J.outputs.length===0){let W=J.logs.map(String).join(`
|
|
282
|
+
`);throw Error(`Bun.build failed for ${Z.entryPath}:
|
|
283
|
+
${W}`)}RY(Z.outfile,await J.outputs[0].text(),"utf8")}async function xY(Z,{projectRoot:X,outfile:Q,adapter:J}){let W=XA(J);if(MX()){await(await Promise.resolve().then(() => J1(o9(),1))).build({bundle:!0,...W.conditions?{conditions:W.conditions}:{},external:W.external??[],format:"esm",logLevel:"silent",minify:!1,outfile:Q,platform:kY(W.target),stdin:{contents:Z,loader:"js",resolveDir:X,sourcefile:"jx-worker-entry.js"}});return}let G=PY(X,".jx-worker-entry.mjs");RY(G,Z,"utf8");try{await AX({entryPath:G,outfile:Q},W)}finally{tM(G,{force:!0})}}var CY;var bY=s(()=>{CY=["@vue/reactivity","lit-html"]});import{readFileSync as vY,readdirSync as JA}from"node:fs";import{extname as IX,join as WA,relative as GA,resolve as YA}from"node:path";async function s9(Z,X){let Q=vY(Z,"utf8");if(Z.endsWith(".json"))return o1(Q,Z);let J=IX(Z).toLowerCase(),W=X?.byExtension(J,"parse");if(!W)throw Error(`No format class registered for "${J}" (${Z}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`);return await W.call("parse",Q)}async function yY(Z,X){let Q=[],J=new Set([".json",...X?.documentExtensions("page")??[]]);return await gY(Z,Z,Q,J,X),Q.sort((W,G)=>{if(W.isDynamic!==G.isDynamic)return W.isDynamic?1:-1;if(W.isCatchAll!==G.isCatchAll)return W.isCatchAll?1:-1;return W.urlPattern.localeCompare(G.urlPattern)}),Q}async function gY(Z,X,Q,J,W){let G=JA(Z,{withFileTypes:!0});for(let Y of G){let $=WA(Z,Y.name);if(Y.isDirectory()){if(Y.name.startsWith("_"))continue;await gY($,X,Q,J,W);continue}let z=IX(Y.name).toLowerCase();if(!J.has(z))continue;if(Y.name.startsWith("_"))continue;let U=GA(X,$),V=await $A(U,$,W);if(V)Q.push(V)}}async function $A(Z,X,Q){let J=IX(Z),W=J?Z.slice(0,-J.length):Z;if(W=W.split("\\").join("/"),W.endsWith("/index"))W=W.slice(0,-6)||"/";else if(W==="index")W="/";if(!W.startsWith("/"))W=`/${W}`;let G=[],Y=!1,$=!1,z=W.replaceAll(/\[\.\.\.(\w+)\]|\[(\w+)\]/g,(V,q,B)=>{if(q)return $=!0,Y=!0,G.push(q),"*";return Y=!0,G.push(B),`:${B}`}),U=null;try{let q=(await s9(X,Q)).$layout;if(typeof q==="string")U=q}catch{}return{$layout:U,isCatchAll:$,isDynamic:Y,params:G,relativePath:Z,sourcePath:X,urlPattern:z}}async function fY(Z,X,Q={},J,W){let G=[];for(let Y of Z){if(!Y.isDynamic){G.push(Y);continue}let $;try{$=await s9(Y.sourcePath,J?.formats)}catch{G.push(Y);continue}if(!$.$paths){console.warn(`Warning: dynamic route ${Y.urlPattern} has no $paths — skipping`);continue}let z=await zA($.$paths,X,Q,J,W);for(let U of z){let V=Y.urlPattern,q={};for(let[B,F]of Object.entries(U))q[B]=String(F),V=V.replace(`:${B}`,q[B]),V=V.replace("*",q[B]);G.push({...Y,_pathParams:q,isCatchAll:!1,isDynamic:!1,params:[],urlPattern:V})}}return G}async function zA(Z,X,Q,J,W){if(Array.isArray(Z))return Z;if("values"in Z&&Array.isArray(Z.values)){let G=typeof Z.param==="string"?Z.param:"value";return Z.values.map((Y)=>({[G]:Y}))}if("$ref"in Z&&typeof Z.$ref==="string"&&Z.$ref){let G=Z.$ref,Y=YA(X,G),$;try{$=JSON.parse(vY(Y,"utf8"))}catch(V){return console.warn(`Warning: $paths.$ref could not load "${G}": ${V.message}`),[]}if(!Array.isArray($))return console.warn(`Warning: $paths.$ref "${G}" must be a JSON array`),[];let z=typeof Z.param==="string"?Z.param:"id",U=typeof Z.field==="string"?Z.field:"id";return $.map((V)=>({[z]:V[U]??V.id??String(V)}))}for(let G of Object.keys(Z)){let Y=J?.byPathsDiscriminator(G);if(!Y?.project)continue;return await Y.call("resolvePaths",Z,{data:Q[Y.project.key],projectConfig:W,root:X})}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var hY=s(()=>{s1()});async function uY(Z,X,Q){let J={},W=q5(Z);for(let G of Q.projectContributions()){let Y=G.project?.key;if(!Y||!G.capabilities.projectData)continue;if(!X||!(Y in X))continue;J[Y]=await G.call("projectData",X[Y],{io:W,projectConfig:X,registry:Q,root:Z})}return J}var mY=s(()=>{e1()});import{existsSync as UA,readFileSync as KA}from"node:fs";import{resolve as VA}from"node:path";function NX(Z,X,Q){let J=Z.$layout??X.defaults?.layout??null;if(!J)return Z;let W=VA(Q,J);if(!UA(W))throw Error(`Layout not found: ${J} (resolved to ${W})`);let G;try{G=o1(KA(W,"utf8"),W)}catch(U){throw Error(`Invalid layout JSON at ${W}: ${U.message}`,{cause:U})}if(G.$layout)G=NX(G,X,Q);let Y=Z.children??[],$=typeof Y==="string"?[Y]:Array.isArray(Y)?Y:[],z=qA(G);if(HA(z,$),Z.state)z.state={...z.state,...Z.state};if(Z.$media)z.$media={...z.$media,...Z.$media};if(Z.style)z.style={...z.style,...Z.style};if(Z.attributes)z.attributes={...z.attributes,...Z.attributes};if(Z.$head)z._pageHead=Z.$head;if(Z.title)z._pageTitle=Z.title;return delete z.$layout,z}function HA(Z,X){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let Q=new Map,J=[];for(let W of X)if(W&&typeof W==="object"&&W.attributes?.slot){let G=W.attributes.slot;if(!Q.has(G))Q.set(G,[]);Q.get(G).push(W)}else J.push(W);dY(Z,Q,J)}function dY(Z,X,Q){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let J=[];for(let W of Z.children)if(W&&typeof W==="object"&&W.tagName==="slot"){let G=W.attributes?.name;if(G&&X.has(G))J.push(...X.get(G)),X.delete(G);else if(!G&&Q.length>0)J.push(...Q);else if(Array.isArray(W.children))J.push(...W.children)}else dY(W,X,Q),J.push(W);Z.children=J}function qA(Z){return structuredClone(Z)}var lY=s(()=>{s1()});function cY(Z=[],X=[],Q=[],J={}){let W=[{attributes:{charset:J.charset??"utf8"},tagName:"meta"},{attributes:{content:"width=device-width, initial-scale=1",name:"viewport"},tagName:"meta"}],G=new Map;for(let $ of[...W,...Z,...X,...Q]){let z=BA($);G.set(z,$)}let Y=J.title??J.siteName??"Jx Site";if(G.set("title",{children:[Y],tagName:"title"}),J.pageUrl&&J.siteUrl){let $=new URL(J.pageUrl,J.siteUrl).href;if(G.set("link:canonical",{attributes:{href:$,rel:"canonical"},tagName:"link"}),!G.has("meta:og:url"))G.set("meta:og:url",{attributes:{content:$,property:"og:url"},tagName:"meta"})}if(J.siteName&&!G.has("meta:og:site_name"))G.set("meta:og:site_name",{attributes:{content:J.siteName,property:"og:site_name"},tagName:"meta"});return[...G.values()]}function BA(Z){if(!Z||typeof Z!=="object")return String(Z);let X=Z.tagName??"unknown",Q=Z.attributes??{};if(X==="title")return"title";if(Q.charset)return"meta:charset";if(X==="meta"&&Q.name)return`meta:${Q.name}`;if(X==="meta"&&Q.property)return`meta:${Q.property}`;if(X==="link"&&Q.rel)return`link:${Q.rel}:${Q.href??""}`;if(X==="script"&&Q.src)return`script:${Q.src}`;if(X==="style"){let J=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`style:${FA(J)}`}return`${X}:${JSON.stringify(Z)}`}function FA(Z){let X=0;for(let Q=0;Q<Z.length;Q++)X=Math.trunc((X<<5)-X+(Z.codePointAt(Q)??0));return X.toString(36)}function pY(Z){return Z.map((X)=>LA(X)).join(`
|
|
284
|
+
`)}function LA(Z){if(typeof Z==="string")return Z;if(!Z||typeof Z!=="object")return"";let X=Z.tagName,Q=Z.attributes??{},J=Object.entries(Q).map(([$,z])=>z===!0?$:`${$}="${MA(z)}"`).join(" "),W=J?`<${X} ${J}>`:`<${X}>`;if(new Set(["meta","link","base","br","hr","img","input"]).has(X))return W;let Y=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`${W}${Y}</${X}>`}function MA(Z){return String(Z).replaceAll("&","&").replaceAll('"',""").replaceAll("<","<")}import{dirname as AA,relative as IA,resolve as NA}from"node:path";function iY(Z,X,Q,J=null){if(!Z.state)Z.state={};if(Z.state.$site={name:X.name??"Jx Site",url:X.url??"",...X.state},Z.state.$page={params:Q._pathParams??{},title:Z.title??Z._pageTitle??X.name??"",url:Q.urlPattern},X.state){for(let[W,G]of Object.entries(X.state))if(W!=="$site"&&W!=="$page"&&!(W in Z.state))Z.state[W]=G}if(X.$media)Z.$media={...X.$media,...Z.$media};if(X.imports&&Object.keys(X.imports).length>0){if(!Z.imports)Z.imports={};for(let[W,G]of Object.entries(X.imports))if(!(W in Z.imports)){let Y=G;if(J&&Q.sourcePath&&(Y.startsWith("./")||Y.startsWith("../"))){let $=NA(J,Y);Z.imports[W]=`./${IA(AA(Q.sourcePath),$)}`}else Z.imports[W]=Y}}if(X.$elements?.length)if(!Z.$elements?.length)Z.$elements=[...X.$elements];else{let W=new Set,G=[];for(let Y of[...X.$elements,...Z.$elements]){let $=typeof Y==="string"?Y:Y?.$ref;if($&&!W.has($))W.add($),G.push(Y)}Z.$elements=G}return Z}var nY=()=>{};import{readFileSync as DA}from"node:fs";import{dirname as DX,resolve as S5}from"node:path";import{createRequire as TA}from"node:module";async function rY(Z,X,Q,J={}){let W=Z.imports??{},{state:G}=Z;if(!G)return;for(let[Y,$]of Object.entries(G)){if(!F4($))continue;if(wA.has($.$prototype))continue;if($.timing&&$.timing!=="compiler"){let z=J.registry?.byName($.$prototype);if(z?.capabilities.lower)try{let U=await z.call("lower",$,{projectConfig:J.config,root:Q,route:X});if(U&&typeof U==="object"&&!Array.isArray(U)){let V=U.$bundle;if(Array.isArray(V)){for(let q of V)if(typeof q==="string")J.registerBundle?.(q)}delete U.$bundle}G[Y]=U}catch(U){console.warn(`prototype-resolver: failed to lower "${Y}" ($prototype: "${$.$prototype}"):`,a1(U))}continue}if(!$.$src){let z=W[$.$prototype]??OA(J,$.$prototype);if(!z)continue;$.$src=z}try{let z=await EA($,X,Q,G,J);if($.timing&&z&&typeof z==="object"&&!Array.isArray(z))z.timing=$.timing;G[Y]=z}catch(z){console.warn(`prototype-resolver: failed to resolve "${Y}" ($prototype: "${$.$prototype}"):`,a1(z))}}}function OA(Z,X){return Z.registry?.byName(X)?.classPath}async function EA(Z,X,Q,J,W){let G=Z.$src;if(!G)throw Error(`$prototype "${Z.$prototype}" has no $src to resolve`);let Y;if(G.startsWith("./")||G.startsWith("../"))Y=X.sourcePath?S5(DX(X.sourcePath),G):S5(Q,G);else Y=TA(S5(Q,"package.json")).resolve(G);let $=DA(Y,"utf8"),z=wG($,Y);if(!z.$implementation)throw Error(`${G} has no $implementation field`);let U=S5(DX(Y),z.$implementation),V=await H5(U),q=Z.$export??z.title??Z.$prototype,B=V[q]??V.default?.[q];if(!B)throw Error(`Module ${z.$implementation} does not export "${q}"`);let F={};for(let[I,A]of Object.entries(Z))if(!jA.has(I))F[I]=A;if(F.src&&!F.basePath&&X.sourcePath)F.basePath=DX(X.sourcePath);F._project={config:W.config??null,root:Q,...W.sections},F._document={route:X,state:J};let L=new B(F);if(typeof L.resolve==="function")return await L.resolve();return L}var wA,jA;var aY=s(()=>{e1();Y1();s1();wA=new Set(["Function","LocalStorage","SessionStorage","Array"]),jA=new Set(["$prototype","$src","$export","timing","default","description"])});var oY=(Z)=>typeof Z<"u"&&Z!==null,RA=(Z)=>typeof Z==="object",PA=(Z)=>Object.prototype.toString.call(Z)==="[object Object]",CA=(Z)=>typeof Z==="function",SA=(Z)=>typeof Z==="boolean",_A=(Z)=>Z instanceof Buffer,kA=(Z)=>{if(oY(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},xA=(Z)=>Z instanceof ArrayBuffer,bA=(Z)=>typeof Z==="string"&&Z.length>0,vA=(Z)=>typeof Z==="number"&&Number.isFinite(Z),yA=(Z)=>Number.isInteger(Z),gA=(Z,X,Q)=>Z>=X&&Z<=Q,fA=(Z,X)=>X.includes(Z),hA=(Z,X,Q)=>Error(`Expected ${X} for ${Z} but received ${Q} of type ${typeof Q}`),uA=(Z,X)=>{return X.message=Z.message,X},K;var V1=s(()=>{/*!
|
|
213
285
|
Copyright 2013 Lovell Fuller and others.
|
|
214
286
|
SPDX-License-Identifier: Apache-2.0
|
|
215
|
-
*/$={defined:rJ,object:FF,plainObject:LF,fn:AF,bool:MF,buffer:IF,typedArray:NF,arrayBuffer:DF,string:TF,number:wF,integer:jF,inRange:OF,inArray:EF,invalidParameterError:RF,nativeError:PF}});var oJ=j((Yx,sJ)=>{var aJ=()=>process.platform==="linux",P8=null,CF=()=>{if(!P8)if(aJ()&&process.report){let Z=process.report.excludeNetwork;process.report.excludeNetwork=!0,P8=process.report.getReport(),process.report.excludeNetwork=Z}else P8={};return P8};sJ.exports={isLinux:aJ,getReport:CF}});var eJ=j((zx,tJ)=>{var M1=_0("fs"),SF=(Z)=>{let X=M1.openSync(Z,"r"),Q=Buffer.alloc(2048),W=M1.readSync(X,Q,0,2048,0);return M1.close(X,()=>{}),Q.subarray(0,W)},kF=(Z)=>new Promise((X,Q)=>{M1.open(Z,"r",(W,J)=>{if(W)Q(W);else{let G=Buffer.alloc(2048);M1.read(J,G,0,2048,0,(Y,z)=>{X(G.subarray(0,z)),M1.close(J,()=>{})})}})});tJ.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:SF,readFile:kF}});var XG=j(($x,ZG)=>{var bF=(Z)=>{if(Z.length<64)return null;if(Z.readUInt32BE(0)!==2135247942)return null;if(Z.readUInt8(4)!==2)return null;if(Z.readUInt8(5)!==1)return null;let X=Z.readUInt32LE(32),Q=Z.readUInt16LE(54),W=Z.readUInt16LE(56);for(let J=0;J<W;J++){let G=X+J*Q;if(Z.readUInt32LE(G)===3){let z=Z.readUInt32LE(G+8),q=Z.readUInt32LE(G+32);return Z.subarray(z,z+q).toString().replace(/\0.*$/g,"")}}return null};ZG.exports={interpreterPath:bF}});var S8=j((qx,MG)=>{var WG=_0("child_process"),{isLinux:I1,getReport:JG}=oJ(),{LDD_PATH:C8,SELF_PATH:GG,readFile:Y7,readFileSync:z7}=eJ(),{interpreterPath:YG}=XG(),y4,g4,f4,D6="",zG=()=>{if(!D6)return new Promise((Z)=>{WG.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(X,Q)=>{D6=X?" ":Q,Z(D6)})});return D6},$G=()=>{if(!D6)try{D6=WG.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(Z){D6=" "}return D6},e4="glibc",qG=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,l6="musl",_F=(Z)=>Z.includes("libc.musl-")||Z.includes("ld-musl-"),KG=()=>{let Z=JG();if(Z.header&&Z.header.glibcVersionRuntime)return e4;if(Array.isArray(Z.sharedObjects)){if(Z.sharedObjects.some(_F))return l6}return null},UG=(Z)=>{let[X,Q]=Z.split(/[\r\n]+/);if(X&&X.includes(e4))return e4;if(Q&&Q.includes(l6))return l6;return null},VG=(Z)=>{if(Z){if(Z.includes("/ld-musl-"))return l6;else if(Z.includes("/ld-linux-"))return e4}return null},BG=(Z)=>{if(Z=Z.toString(),Z.includes("musl"))return l6;if(Z.includes("GNU C Library"))return e4;return null},xF=async()=>{if(g4!==void 0)return g4;g4=null;try{let Z=await Y7(C8);g4=BG(Z)}catch(Z){}return g4},vF=()=>{if(g4!==void 0)return g4;g4=null;try{let Z=z7(C8);g4=BG(Z)}catch(Z){}return g4},yF=async()=>{if(y4!==void 0)return y4;y4=null;try{let Z=await Y7(GG),X=YG(Z);y4=VG(X)}catch(Z){}return y4},gF=()=>{if(y4!==void 0)return y4;y4=null;try{let Z=z7(GG),X=YG(Z);y4=VG(X)}catch(Z){}return y4},HG=async()=>{let Z=null;if(I1()){if(Z=await yF(),!Z){if(Z=await xF(),!Z)Z=KG();if(!Z){let X=await zG();Z=UG(X)}}}return Z},FG=()=>{let Z=null;if(I1()){if(Z=gF(),!Z){if(Z=vF(),!Z)Z=KG();if(!Z){let X=$G();Z=UG(X)}}}return Z},fF=async()=>I1()&&await HG()!==e4,hF=()=>I1()&&FG()!==e4,uF=async()=>{if(f4!==void 0)return f4;f4=null;try{let X=(await Y7(C8)).match(qG);if(X)f4=X[1]}catch(Z){}return f4},mF=()=>{if(f4!==void 0)return f4;f4=null;try{let X=z7(C8).match(qG);if(X)f4=X[1]}catch(Z){}return f4},LG=()=>{let Z=JG();if(Z.header&&Z.header.glibcVersionRuntime)return Z.header.glibcVersionRuntime;return null},QG=(Z)=>Z.trim().split(/\s+/)[1],AG=(Z)=>{let[X,Q,W]=Z.split(/[\r\n]+/);if(X&&X.includes(e4))return QG(X);if(Q&&W&&Q.includes(l6))return QG(W);return null},lF=async()=>{let Z=null;if(I1()){if(Z=await uF(),!Z)Z=LG();if(!Z){let X=await zG();Z=AG(X)}}return Z},dF=()=>{let Z=null;if(I1()){if(Z=mF(),!Z)Z=LG();if(!Z){let X=$G();Z=AG(X)}}return Z};MG.exports={GLIBC:e4,MUSL:l6,family:HG,familySync:FG,isNonGlibcLinux:fF,isNonGlibcLinuxSync:hF,version:lF,versionSync:dF}});var N1=j((Kx,IG)=>{var cF=Number.MAX_SAFE_INTEGER||9007199254740991,pF=["major","premajor","minor","preminor","patch","prepatch","prerelease"];IG.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:cF,RELEASE_TYPES:pF,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var G9=j((Ux,NG)=>{var nF=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...Z)=>console.error("SEMVER",...Z):()=>{};NG.exports=nF});var D1=j((h4,DG)=>{var{MAX_SAFE_COMPONENT_LENGTH:$7,MAX_SAFE_BUILD_LENGTH:iF,MAX_LENGTH:rF}=N1(),aF=G9();h4=DG.exports={};var sF=h4.re=[],oF=h4.safeRe=[],m=h4.src=[],tF=h4.safeSrc=[],l=h4.t={},eF=0,q7="[a-zA-Z0-9-]",ZL=[["\\s",1],["\\d",rF],[q7,iF]],XL=(Z)=>{for(let[X,Q]of ZL)Z=Z.split(`${X}*`).join(`${X}{0,${Q}}`).split(`${X}+`).join(`${X}{1,${Q}}`);return Z},t=(Z,X,Q)=>{let W=XL(X),J=eF++;aF(Z,J,X),l[Z]=J,m[J]=X,tF[J]=W,sF[J]=new RegExp(X,Q?"g":void 0),oF[J]=new RegExp(W,Q?"g":void 0)};t("NUMERICIDENTIFIER","0|[1-9]\\d*");t("NUMERICIDENTIFIERLOOSE","\\d+");t("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${q7}*`);t("MAINVERSION",`(${m[l.NUMERICIDENTIFIER]})\\.(${m[l.NUMERICIDENTIFIER]})\\.(${m[l.NUMERICIDENTIFIER]})`);t("MAINVERSIONLOOSE",`(${m[l.NUMERICIDENTIFIERLOOSE]})\\.(${m[l.NUMERICIDENTIFIERLOOSE]})\\.(${m[l.NUMERICIDENTIFIERLOOSE]})`);t("PRERELEASEIDENTIFIER",`(?:${m[l.NONNUMERICIDENTIFIER]}|${m[l.NUMERICIDENTIFIER]})`);t("PRERELEASEIDENTIFIERLOOSE",`(?:${m[l.NONNUMERICIDENTIFIER]}|${m[l.NUMERICIDENTIFIERLOOSE]})`);t("PRERELEASE",`(?:-(${m[l.PRERELEASEIDENTIFIER]}(?:\\.${m[l.PRERELEASEIDENTIFIER]})*))`);t("PRERELEASELOOSE",`(?:-?(${m[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${m[l.PRERELEASEIDENTIFIERLOOSE]})*))`);t("BUILDIDENTIFIER",`${q7}+`);t("BUILD",`(?:\\+(${m[l.BUILDIDENTIFIER]}(?:\\.${m[l.BUILDIDENTIFIER]})*))`);t("FULLPLAIN",`v?${m[l.MAINVERSION]}${m[l.PRERELEASE]}?${m[l.BUILD]}?`);t("FULL",`^${m[l.FULLPLAIN]}$`);t("LOOSEPLAIN",`[v=\\s]*${m[l.MAINVERSIONLOOSE]}${m[l.PRERELEASELOOSE]}?${m[l.BUILD]}?`);t("LOOSE",`^${m[l.LOOSEPLAIN]}$`);t("GTLT","((?:<|>)?=?)");t("XRANGEIDENTIFIERLOOSE",`${m[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);t("XRANGEIDENTIFIER",`${m[l.NUMERICIDENTIFIER]}|x|X|\\*`);t("XRANGEPLAIN",`[v=\\s]*(${m[l.XRANGEIDENTIFIER]})(?:\\.(${m[l.XRANGEIDENTIFIER]})(?:\\.(${m[l.XRANGEIDENTIFIER]})(?:${m[l.PRERELEASE]})?${m[l.BUILD]}?)?)?`);t("XRANGEPLAINLOOSE",`[v=\\s]*(${m[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${m[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${m[l.XRANGEIDENTIFIERLOOSE]})(?:${m[l.PRERELEASELOOSE]})?${m[l.BUILD]}?)?)?`);t("XRANGE",`^${m[l.GTLT]}\\s*${m[l.XRANGEPLAIN]}$`);t("XRANGELOOSE",`^${m[l.GTLT]}\\s*${m[l.XRANGEPLAINLOOSE]}$`);t("COERCEPLAIN",`(^|[^\\d])(\\d{1,${$7}})(?:\\.(\\d{1,${$7}}))?(?:\\.(\\d{1,${$7}}))?`);t("COERCE",`${m[l.COERCEPLAIN]}(?:$|[^\\d])`);t("COERCEFULL",m[l.COERCEPLAIN]+`(?:${m[l.PRERELEASE]})?(?:${m[l.BUILD]})?(?:$|[^\\d])`);t("COERCERTL",m[l.COERCE],!0);t("COERCERTLFULL",m[l.COERCEFULL],!0);t("LONETILDE","(?:~>?)");t("TILDETRIM",`(\\s*)${m[l.LONETILDE]}\\s+`,!0);h4.tildeTrimReplace="$1~";t("TILDE",`^${m[l.LONETILDE]}${m[l.XRANGEPLAIN]}$`);t("TILDELOOSE",`^${m[l.LONETILDE]}${m[l.XRANGEPLAINLOOSE]}$`);t("LONECARET","(?:\\^)");t("CARETTRIM",`(\\s*)${m[l.LONECARET]}\\s+`,!0);h4.caretTrimReplace="$1^";t("CARET",`^${m[l.LONECARET]}${m[l.XRANGEPLAIN]}$`);t("CARETLOOSE",`^${m[l.LONECARET]}${m[l.XRANGEPLAINLOOSE]}$`);t("COMPARATORLOOSE",`^${m[l.GTLT]}\\s*(${m[l.LOOSEPLAIN]})$|^$`);t("COMPARATOR",`^${m[l.GTLT]}\\s*(${m[l.FULLPLAIN]})$|^$`);t("COMPARATORTRIM",`(\\s*)${m[l.GTLT]}\\s*(${m[l.LOOSEPLAIN]}|${m[l.XRANGEPLAIN]})`,!0);h4.comparatorTrimReplace="$1$2$3";t("HYPHENRANGE",`^\\s*(${m[l.XRANGEPLAIN]})\\s+-\\s+(${m[l.XRANGEPLAIN]})\\s*$`);t("HYPHENRANGELOOSE",`^\\s*(${m[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${m[l.XRANGEPLAINLOOSE]})\\s*$`);t("STAR","(<|>)?=?\\s*\\*");t("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");t("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var k8=j((Vx,TG)=>{var QL=Object.freeze({loose:!0}),WL=Object.freeze({}),JL=(Z)=>{if(!Z)return WL;if(typeof Z!=="object")return QL;return Z};TG.exports=JL});var K7=j((Bx,OG)=>{var wG=/^[0-9]+$/,jG=(Z,X)=>{if(typeof Z==="number"&&typeof X==="number")return Z===X?0:Z<X?-1:1;let Q=wG.test(Z),W=wG.test(X);if(Q&&W)Z=+Z,X=+X;return Z===X?0:Q&&!W?-1:W&&!Q?1:Z<X?-1:1},GL=(Z,X)=>jG(X,Z);OG.exports={compareIdentifiers:jG,rcompareIdentifiers:GL}});var v0=j((Hx,RG)=>{var b8=G9(),{MAX_LENGTH:EG,MAX_SAFE_INTEGER:_8}=N1(),{safeRe:x8,t:v8}=D1(),YL=k8(),{compareIdentifiers:U7}=K7(),zL=(Z,X)=>{let Q=X.split(".");if(Q.length>Z.length)return!1;for(let W=0;W<Q.length;W++)if(U7(Z[W],Q[W])!==0)return!1;return!0};class O4{constructor(Z,X){if(X=YL(X),Z instanceof O4)if(Z.loose===!!X.loose&&Z.includePrerelease===!!X.includePrerelease)return Z;else Z=Z.version;else if(typeof Z!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof Z}".`);if(Z.length>EG)throw TypeError(`version is longer than ${EG} characters`);b8("SemVer",Z,X),this.options=X,this.loose=!!X.loose,this.includePrerelease=!!X.includePrerelease;let Q=Z.trim().match(X.loose?x8[v8.LOOSE]:x8[v8.FULL]);if(!Q)throw TypeError(`Invalid Version: ${Z}`);if(this.raw=Z,this.major=+Q[1],this.minor=+Q[2],this.patch=+Q[3],this.major>_8||this.major<0)throw TypeError("Invalid major version");if(this.minor>_8||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>_8||this.patch<0)throw TypeError("Invalid patch version");if(!Q[4])this.prerelease=[];else this.prerelease=Q[4].split(".").map((W)=>{if(/^[0-9]+$/.test(W)){let J=+W;if(J>=0&&J<_8)return J}return W});this.build=Q[5]?Q[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(Z){if(b8("SemVer.compare",this.version,this.options,Z),!(Z instanceof O4)){if(typeof Z==="string"&&Z===this.version)return 0;Z=new O4(Z,this.options)}if(Z.version===this.version)return 0;return this.compareMain(Z)||this.comparePre(Z)}compareMain(Z){if(!(Z instanceof O4))Z=new O4(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 O4))Z=new O4(Z,this.options);if(this.prerelease.length&&!Z.prerelease.length)return-1;else if(!this.prerelease.length&&Z.prerelease.length)return 1;else if(!this.prerelease.length&&!Z.prerelease.length)return 0;let X=0;do{let Q=this.prerelease[X],W=Z.prerelease[X];if(b8("prerelease compare",X,Q,W),Q===void 0&&W===void 0)return 0;else if(W===void 0)return 1;else if(Q===void 0)return-1;else if(Q===W)continue;else return U7(Q,W)}while(++X)}compareBuild(Z){if(!(Z instanceof O4))Z=new O4(Z,this.options);let X=0;do{let Q=this.build[X],W=Z.build[X];if(b8("build compare",X,Q,W),Q===void 0&&W===void 0)return 0;else if(W===void 0)return 1;else if(Q===void 0)return-1;else if(Q===W)continue;else return U7(Q,W)}while(++X)}inc(Z,X,Q){if(Z.startsWith("pre")){if(!X&&Q===!1)throw Error("invalid increment argument: identifier is empty");if(X){let W=`-${X}`.match(this.options.loose?x8[v8.PRERELEASELOOSE]:x8[v8.PRERELEASE]);if(!W||W[1]!==X)throw Error(`invalid identifier: ${X}`)}}switch(Z){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",X,Q);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",X,Q);break;case"prepatch":this.prerelease.length=0,this.inc("patch",X,Q),this.inc("pre",X,Q);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",X,Q);this.inc("pre",X,Q);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let W=Number(Q)?1:0;if(this.prerelease.length===0)this.prerelease=[W];else{let J=this.prerelease.length;while(--J>=0)if(typeof this.prerelease[J]==="number")this.prerelease[J]++,J=-2;if(J===-1){if(X===this.prerelease.join(".")&&Q===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(W)}}if(X){let J=[X,W];if(Q===!1)J=[X];if(zL(this.prerelease,X)){let G=this.prerelease[X.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}}RG.exports=O4});var T6=j((Fx,CG)=>{var PG=v0(),$L=(Z,X,Q=!1)=>{if(Z instanceof PG)return Z;try{return new PG(Z,X)}catch(W){if(!Q)return null;throw W}};CG.exports=$L});var kG=j((Lx,SG)=>{var qL=T6(),KL=(Z,X)=>{let Q=qL(Z,X);return Q?Q.version:null};SG.exports=KL});var _G=j((Ax,bG)=>{var UL=T6(),VL=(Z,X)=>{let Q=UL(Z.trim().replace(/^[=v]+/,""),X);return Q?Q.version:null};bG.exports=VL});var yG=j((Mx,vG)=>{var xG=v0(),BL=(Z,X,Q,W,J)=>{if(typeof Q==="string")J=W,W=Q,Q=void 0;try{return new xG(Z instanceof xG?Z.version:Z,Q).inc(X,W,J).version}catch(G){return null}};vG.exports=BL});var hG=j((Ix,fG)=>{var gG=T6(),HL=(Z,X)=>{let Q=gG(Z,null,!0),W=gG(X,null,!0),J=Q.compare(W);if(J===0)return null;let G=J>0,Y=G?Q:W,z=G?W:Q,q=!!Y.prerelease.length;if(!!z.prerelease.length&&!q){if(!z.patch&&!z.minor)return"major";if(z.compareMain(Y)===0){if(z.minor&&!z.patch)return"minor";return"patch"}}let V=q?"pre":"";if(Q.major!==W.major)return V+"major";if(Q.minor!==W.minor)return V+"minor";if(Q.patch!==W.patch)return V+"patch";return"prerelease"};fG.exports=HL});var mG=j((Nx,uG)=>{var FL=v0(),LL=(Z,X)=>new FL(Z,X).major;uG.exports=LL});var dG=j((Dx,lG)=>{var AL=v0(),ML=(Z,X)=>new AL(Z,X).minor;lG.exports=ML});var pG=j((Tx,cG)=>{var IL=v0(),NL=(Z,X)=>new IL(Z,X).patch;cG.exports=NL});var iG=j((wx,nG)=>{var DL=T6(),TL=(Z,X)=>{let Q=DL(Z,X);return Q&&Q.prerelease.length?Q.prerelease:null};nG.exports=TL});var H4=j((jx,aG)=>{var rG=v0(),wL=(Z,X,Q)=>new rG(Z,Q).compare(new rG(X,Q));aG.exports=wL});var oG=j((Ox,sG)=>{var jL=H4(),OL=(Z,X,Q)=>jL(X,Z,Q);sG.exports=OL});var eG=j((Ex,tG)=>{var EL=H4(),RL=(Z,X)=>EL(Z,X,!0);tG.exports=RL});var y8=j((Rx,XY)=>{var ZY=v0(),PL=(Z,X,Q)=>{let W=new ZY(Z,Q),J=new ZY(X,Q);return W.compare(J)||W.compareBuild(J)};XY.exports=PL});var WY=j((Px,QY)=>{var CL=y8(),SL=(Z,X)=>Z.sort((Q,W)=>CL(Q,W,X));QY.exports=SL});var GY=j((Cx,JY)=>{var kL=y8(),bL=(Z,X)=>Z.sort((Q,W)=>kL(W,Q,X));JY.exports=bL});var Y9=j((Sx,YY)=>{var _L=H4(),xL=(Z,X,Q)=>_L(Z,X,Q)>0;YY.exports=xL});var g8=j((kx,zY)=>{var vL=H4(),yL=(Z,X,Q)=>vL(Z,X,Q)<0;zY.exports=yL});var V7=j((bx,$Y)=>{var gL=H4(),fL=(Z,X,Q)=>gL(Z,X,Q)===0;$Y.exports=fL});var B7=j((_x,qY)=>{var hL=H4(),uL=(Z,X,Q)=>hL(Z,X,Q)!==0;qY.exports=uL});var f8=j((xx,KY)=>{var mL=H4(),lL=(Z,X,Q)=>mL(Z,X,Q)>=0;KY.exports=lL});var h8=j((vx,UY)=>{var dL=H4(),cL=(Z,X,Q)=>dL(Z,X,Q)<=0;UY.exports=cL});var H7=j((yx,VY)=>{var pL=V7(),nL=B7(),iL=Y9(),rL=f8(),aL=g8(),sL=h8(),oL=(Z,X,Q,W)=>{switch(X){case"===":if(typeof Z==="object")Z=Z.version;if(typeof Q==="object")Q=Q.version;return Z===Q;case"!==":if(typeof Z==="object")Z=Z.version;if(typeof Q==="object")Q=Q.version;return Z!==Q;case"":case"=":case"==":return pL(Z,Q,W);case"!=":return nL(Z,Q,W);case">":return iL(Z,Q,W);case">=":return rL(Z,Q,W);case"<":return aL(Z,Q,W);case"<=":return sL(Z,Q,W);default:throw TypeError(`Invalid operator: ${X}`)}};VY.exports=oL});var HY=j((gx,BY)=>{var tL=v0(),eL=T6(),{safeRe:u8,t:m8}=D1(),ZA=(Z,X)=>{if(Z instanceof tL)return Z;if(typeof Z==="number")Z=String(Z);if(typeof Z!=="string")return null;X=X||{};let Q=null;if(!X.rtl)Q=Z.match(X.includePrerelease?u8[m8.COERCEFULL]:u8[m8.COERCE]);else{let q=X.includePrerelease?u8[m8.COERCERTLFULL]:u8[m8.COERCERTL],K;while((K=q.exec(Z))&&(!Q||Q.index+Q[0].length!==Z.length)){if(!Q||K.index+K[0].length!==Q.index+Q[0].length)Q=K;q.lastIndex=K.index+K[1].length+K[2].length}q.lastIndex=-1}if(Q===null)return null;let W=Q[2],J=Q[3]||"0",G=Q[4]||"0",Y=X.includePrerelease&&Q[5]?`-${Q[5]}`:"",z=X.includePrerelease&&Q[6]?`+${Q[6]}`:"";return eL(`${W}.${J}.${G}${Y}${z}`,X)};BY.exports=ZA});var LY=j((fx,FY)=>{var XA=T6(),QA=N1(),WA=v0(),JA=(Z,X,Q)=>{if(!QA.RELEASE_TYPES.includes(X))return null;let W=GA(Z,Q);return W&&YA(W,X)},GA=(Z,X)=>{let Q=Z instanceof WA?Z.version:Z;return XA(Q,X)},YA=(Z,X)=>{if(zA(X))return Z.version;switch(Z.prerelease=[],X){case"major":Z.minor=0,Z.patch=0;break;case"minor":Z.patch=0;break}return Z.format()},zA=(Z)=>{return Z.startsWith("pre")};FY.exports=JA});var IY=j((hx,MY)=>{class AY{constructor(){this.max=1000,this.map=new Map}get(Z){let X=this.map.get(Z);if(X===void 0)return;else return this.map.delete(Z),this.map.set(Z,X),X}delete(Z){return this.map.delete(Z)}set(Z,X){if(!this.delete(Z)&&X!==void 0){if(this.map.size>=this.max){let W=this.map.keys().next().value;this.delete(W)}this.map.set(Z,X)}return this}}MY.exports=AY});var F4=j((ux,wY)=>{var $A=/\s+/g;class z9{constructor(Z,X){if(X=KA(X),Z instanceof z9)if(Z.loose===!!X.loose&&Z.includePrerelease===!!X.includePrerelease)return Z;else return new z9(Z.raw,X);if(Z instanceof F7)return this.raw=Z.value,this.set=[[Z]],this.formatted=void 0,this;if(this.options=X,this.loose=!!X.loose,this.includePrerelease=!!X.includePrerelease,this.raw=Z.trim().replace($A," "),this.set=this.raw.split("||").map((Q)=>this.parseRange(Q.trim())).filter((Q)=>Q.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let Q=this.set[0];if(this.set=this.set.filter((W)=>!DY(W[0])),this.set.length===0)this.set=[Q];else if(this.set.length>1){for(let W of this.set)if(W.length===1&&IA(W[0])){this.set=[W];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let Z=0;Z<this.set.length;Z++){if(Z>0)this.formatted+="||";let X=this.set[Z];for(let Q=0;Q<X.length;Q++){if(Q>0)this.formatted+=" ";this.formatted+=X[Q].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(Z){Z=Z.replace(MA,"");let Q=((this.options.includePrerelease&&LA)|(this.options.loose&&AA))+":"+Z,W=NY.get(Q);if(W)return W;let J=this.options.loose,G=J?p0[y0.HYPHENRANGELOOSE]:p0[y0.HYPHENRANGE];Z=Z.replace(G,SA(this.options.includePrerelease)),L0("hyphen replace",Z),Z=Z.replace(p0[y0.COMPARATORTRIM],BA),L0("comparator trim",Z),Z=Z.replace(p0[y0.TILDETRIM],HA),L0("tilde trim",Z),Z=Z.replace(p0[y0.CARETTRIM],FA),L0("caret trim",Z);let Y=Z.split(" ").map((V)=>NA(V,this.options)).join(" ").split(/\s+/).map((V)=>CA(V,this.options));if(J)Y=Y.filter((V)=>{return L0("loose invalid filter",V,this.options),!!V.match(p0[y0.COMPARATORLOOSE])});L0("range list",Y);let z=new Map,q=Y.map((V)=>new F7(V,this.options));for(let V of q){if(DY(V))return[V];z.set(V.value,V)}if(z.size>1&&z.has(""))z.delete("");let K=[...z.values()];return NY.set(Q,K),K}intersects(Z,X){if(!(Z instanceof z9))throw TypeError("a Range is required");return this.set.some((Q)=>{return TY(Q,X)&&Z.set.some((W)=>{return TY(W,X)&&Q.every((J)=>{return W.every((G)=>{return J.intersects(G,X)})})})})}test(Z){if(!Z)return!1;if(typeof Z==="string")try{Z=new UA(Z,this.options)}catch(X){return!1}for(let X=0;X<this.set.length;X++)if(kA(this.set[X],Z,this.options))return!0;return!1}}wY.exports=z9;var qA=IY(),NY=new qA,KA=k8(),F7=$9(),L0=G9(),UA=v0(),{safeRe:p0,src:VA,t:y0,comparatorTrimReplace:BA,tildeTrimReplace:HA,caretTrimReplace:FA}=D1(),{FLAG_INCLUDE_PRERELEASE:LA,FLAG_LOOSE:AA}=N1(),MA=new RegExp(VA[y0.BUILD],"g"),DY=(Z)=>Z.value==="<0.0.0-0",IA=(Z)=>Z.value==="",TY=(Z,X)=>{let Q=!0,W=Z.slice(),J=W.pop();while(Q&&W.length)Q=W.every((G)=>{return J.intersects(G,X)}),J=W.pop();return Q},NA=(Z,X)=>{return Z=Z.replace(p0[y0.BUILD],""),L0("comp",Z,X),Z=jA(Z,X),L0("caret",Z),Z=TA(Z,X),L0("tildes",Z),Z=EA(Z,X),L0("xrange",Z),Z=PA(Z,X),L0("stars",Z),Z},P0=(Z)=>!Z||Z.toLowerCase()==="x"||Z==="*",DA=(Z,X,Q)=>P0(Z)&&!P0(X)||P0(X)&&Q&&!P0(Q),TA=(Z,X)=>{return Z.trim().split(/\s+/).map((Q)=>wA(Q,X)).join(" ")},wA=(Z,X)=>{let Q=X.loose?p0[y0.TILDELOOSE]:p0[y0.TILDE],W=X.includePrerelease?"-0":"";return Z.replace(Q,(J,G,Y,z,q)=>{L0("tilde",Z,J,G,Y,z,q);let K;if(P0(G))K="";else if(P0(Y))K=`>=${G}.0.0${W} <${+G+1}.0.0-0`;else if(P0(z))K=`>=${G}.${Y}.0${W} <${G}.${+Y+1}.0-0`;else if(q)L0("replaceTilde pr",q),K=`>=${G}.${Y}.${z}-${q} <${G}.${+Y+1}.0-0`;else K=`>=${G}.${Y}.${z} <${G}.${+Y+1}.0-0`;return L0("tilde return",K),K})},jA=(Z,X)=>{return Z.trim().split(/\s+/).map((Q)=>OA(Q,X)).join(" ")},OA=(Z,X)=>{L0("caret",Z,X);let Q=X.loose?p0[y0.CARETLOOSE]:p0[y0.CARET],W=X.includePrerelease?"-0":"";return Z.replace(Q,(J,G,Y,z,q)=>{L0("caret",Z,J,G,Y,z,q);let K;if(P0(G))K="";else if(P0(Y))K=`>=${G}.0.0${W} <${+G+1}.0.0-0`;else if(P0(z))if(G==="0")K=`>=${G}.${Y}.0${W} <${G}.${+Y+1}.0-0`;else K=`>=${G}.${Y}.0${W} <${+G+1}.0.0-0`;else if(q)if(L0("replaceCaret pr",q),G==="0")if(Y==="0")K=`>=${G}.${Y}.${z}-${q} <${G}.${Y}.${+z+1}-0`;else K=`>=${G}.${Y}.${z}-${q} <${G}.${+Y+1}.0-0`;else K=`>=${G}.${Y}.${z}-${q} <${+G+1}.0.0-0`;else if(L0("no pr"),G==="0")if(Y==="0")K=`>=${G}.${Y}.${z} <${G}.${Y}.${+z+1}-0`;else K=`>=${G}.${Y}.${z} <${G}.${+Y+1}.0-0`;else K=`>=${G}.${Y}.${z} <${+G+1}.0.0-0`;return L0("caret return",K),K})},EA=(Z,X)=>{return L0("replaceXRanges",Z,X),Z.split(/\s+/).map((Q)=>RA(Q,X)).join(" ")},RA=(Z,X)=>{Z=Z.trim();let Q=X.loose?p0[y0.XRANGELOOSE]:p0[y0.XRANGE];return Z.replace(Q,(W,J,G,Y,z,q)=>{if(L0("xRange",Z,W,J,G,Y,z,q),DA(G,Y,z))return Z;let K=P0(G),V=K||P0(Y),B=V||P0(z),H=B;if(J==="="&&H)J="";if(q=X.includePrerelease?"-0":"",K)if(J===">"||J==="<")W="<0.0.0-0";else W="*";else if(J&&H){if(V)Y=0;if(z=0,J===">")if(J=">=",V)G=+G+1,Y=0,z=0;else Y=+Y+1,z=0;else if(J==="<=")if(J="<",V)G=+G+1;else Y=+Y+1;if(J==="<")q="-0";W=`${J+G}.${Y}.${z}${q}`}else if(V)W=`>=${G}.0.0${q} <${+G+1}.0.0-0`;else if(B)W=`>=${G}.${Y}.0${q} <${G}.${+Y+1}.0-0`;return L0("xRange return",W),W})},PA=(Z,X)=>{return L0("replaceStars",Z,X),Z.trim().replace(p0[y0.STAR],"")},CA=(Z,X)=>{return L0("replaceGTE0",Z,X),Z.trim().replace(p0[X.includePrerelease?y0.GTE0PRE:y0.GTE0],"")},SA=(Z)=>(X,Q,W,J,G,Y,z,q,K,V,B,H)=>{if(P0(W))Q="";else if(P0(J))Q=`>=${W}.0.0${Z?"-0":""}`;else if(P0(G))Q=`>=${W}.${J}.0${Z?"-0":""}`;else if(Y)Q=`>=${Q}`;else Q=`>=${Q}${Z?"-0":""}`;if(P0(K))q="";else if(P0(V))q=`<${+K+1}.0.0-0`;else if(P0(B))q=`<${K}.${+V+1}.0-0`;else if(H)q=`<=${K}.${V}.${B}-${H}`;else if(Z)q=`<${K}.${V}.${+B+1}-0`;else q=`<=${q}`;return`${Q} ${q}`.trim()},kA=(Z,X,Q)=>{for(let W=0;W<Z.length;W++)if(!Z[W].test(X))return!1;if(X.prerelease.length&&!Q.includePrerelease){for(let W=0;W<Z.length;W++){if(L0(Z[W].semver),Z[W].semver===F7.ANY)continue;if(Z[W].semver.prerelease.length>0){let J=Z[W].semver;if(J.major===X.major&&J.minor===X.minor&&J.patch===X.patch)return!0}}return!1}return!0}});var $9=j((mx,CY)=>{var q9=Symbol("SemVer ANY");class l8{static get ANY(){return q9}constructor(Z,X){if(X=jY(X),Z instanceof l8)if(Z.loose===!!X.loose)return Z;else Z=Z.value;if(Z=Z.trim().split(/\s+/).join(" "),A7("comparator",Z,X),this.options=X,this.loose=!!X.loose,this.parse(Z),this.semver===q9)this.value="";else this.value=this.operator+this.semver.version;A7("comp",this)}parse(Z){let X=this.options.loose?OY[EY.COMPARATORLOOSE]:OY[EY.COMPARATOR],Q=Z.match(X);if(!Q)throw TypeError(`Invalid comparator: ${Z}`);if(this.operator=Q[1]!==void 0?Q[1]:"",this.operator==="=")this.operator="";if(!Q[2])this.semver=q9;else this.semver=new RY(Q[2],this.options.loose)}toString(){return this.value}test(Z){if(A7("Comparator.test",Z,this.options.loose),this.semver===q9||Z===q9)return!0;if(typeof Z==="string")try{Z=new RY(Z,this.options)}catch(X){return!1}return L7(Z,this.operator,this.semver,this.options)}intersects(Z,X){if(!(Z instanceof l8))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new PY(Z.value,X).test(this.value)}else if(Z.operator===""){if(Z.value==="")return!0;return new PY(this.value,X).test(Z.semver)}if(X=jY(X),X.includePrerelease&&(this.value==="<0.0.0-0"||Z.value==="<0.0.0-0"))return!1;if(!X.includePrerelease&&(this.value.startsWith("<0.0.0")||Z.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&Z.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&Z.operator.startsWith("<"))return!0;if(this.semver.version===Z.semver.version&&this.operator.includes("=")&&Z.operator.includes("="))return!0;if(L7(this.semver,"<",Z.semver,X)&&this.operator.startsWith(">")&&Z.operator.startsWith("<"))return!0;if(L7(this.semver,">",Z.semver,X)&&this.operator.startsWith("<")&&Z.operator.startsWith(">"))return!0;return!1}}CY.exports=l8;var jY=k8(),{safeRe:OY,t:EY}=D1(),L7=H7(),A7=G9(),RY=v0(),PY=F4()});var K9=j((lx,SY)=>{var bA=F4(),_A=(Z,X,Q)=>{try{X=new bA(X,Q)}catch(W){return!1}return X.test(Z)};SY.exports=_A});var bY=j((dx,kY)=>{var xA=F4(),vA=(Z,X)=>new xA(Z,X).set.map((Q)=>Q.map((W)=>W.value).join(" ").trim().split(" "));kY.exports=vA});var xY=j((cx,_Y)=>{var yA=v0(),gA=F4(),fA=(Z,X,Q)=>{let W=null,J=null,G=null;try{G=new gA(X,Q)}catch(Y){return null}return Z.forEach((Y)=>{if(G.test(Y)){if(!W||J.compare(Y)===-1)W=Y,J=new yA(W,Q)}}),W};_Y.exports=fA});var yY=j((px,vY)=>{var hA=v0(),uA=F4(),mA=(Z,X,Q)=>{let W=null,J=null,G=null;try{G=new uA(X,Q)}catch(Y){return null}return Z.forEach((Y)=>{if(G.test(Y)){if(!W||J.compare(Y)===1)W=Y,J=new hA(W,Q)}}),W};vY.exports=mA});var hY=j((nx,fY)=>{var M7=v0(),lA=F4(),gY=Y9(),dA=(Z,X)=>{Z=new lA(Z,X);let Q=new M7("0.0.0");if(Z.test(Q))return Q;if(Q=new M7("0.0.0-0"),Z.test(Q))return Q;Q=null;for(let W=0;W<Z.set.length;++W){let J=Z.set[W],G=null;if(J.forEach((Y)=>{let z=new M7(Y.semver.version);switch(Y.operator){case">":if(z.prerelease.length===0)z.patch++;else z.prerelease.push(0);z.raw=z.format();case"":case">=":if(!G||gY(z,G))G=z;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${Y.operator}`)}}),G&&(!Q||gY(Q,G)))Q=G}if(Q&&Z.test(Q))return Q;return null};fY.exports=dA});var mY=j((ix,uY)=>{var cA=F4(),pA=(Z,X)=>{try{return new cA(Z,X).range||"*"}catch(Q){return null}};uY.exports=pA});var d8=j((rx,pY)=>{var nA=v0(),cY=$9(),{ANY:iA}=cY,rA=F4(),aA=K9(),lY=Y9(),dY=g8(),sA=h8(),oA=f8(),tA=(Z,X,Q,W)=>{Z=new nA(Z,W),X=new rA(X,W);let J,G,Y,z,q;switch(Q){case">":J=lY,G=sA,Y=dY,z=">",q=">=";break;case"<":J=dY,G=oA,Y=lY,z="<",q="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(aA(Z,X,W))return!1;for(let K=0;K<X.set.length;++K){let V=X.set[K],B=null,H=null;if(V.forEach((F)=>{if(F.semver===iA)F=new cY(">=0.0.0");if(B=B||F,H=H||F,J(F.semver,B.semver,W))B=F;else if(Y(F.semver,H.semver,W))H=F}),B.operator===z||B.operator===q)return!1;if((!H.operator||H.operator===z)&&G(Z,H.semver))return!1;else if(H.operator===q&&Y(Z,H.semver))return!1}return!0};pY.exports=tA});var iY=j((ax,nY)=>{var eA=d8(),ZM=(Z,X,Q)=>eA(Z,X,">",Q);nY.exports=ZM});var aY=j((sx,rY)=>{var XM=d8(),QM=(Z,X,Q)=>XM(Z,X,"<",Q);rY.exports=QM});var tY=j((ox,oY)=>{var sY=F4(),WM=(Z,X,Q)=>{return Z=new sY(Z,Q),X=new sY(X,Q),Z.intersects(X,Q)};oY.exports=WM});var Zz=j((tx,eY)=>{var JM=K9(),GM=H4();eY.exports=(Z,X,Q)=>{let W=[],J=null,G=null,Y=Z.sort((V,B)=>GM(V,B,Q));for(let V of Y)if(JM(V,X,Q)){if(G=V,!J)J=V}else{if(G)W.push([J,G]);G=null,J=null}if(J)W.push([J,null]);let z=[];for(let[V,B]of W)if(V===B)z.push(V);else if(!B&&V===Y[0])z.push("*");else if(!B)z.push(`>=${V}`);else if(V===Y[0])z.push(`<=${B}`);else z.push(`${V} - ${B}`);let q=z.join(" || "),K=typeof X.raw==="string"?X.raw:String(X);return q.length<K.length?q:X}});var Yz=j((ex,Gz)=>{var Xz=F4(),D7=$9(),{ANY:I7}=D7,N7=K9(),T7=H4(),YM=(Z,X,Q={})=>{if(Z===X)return!0;Z=new Xz(Z,Q),X=new Xz(X,Q);let W=!1;Z:for(let J of Z.set){for(let G of X.set){let Y=$M(J,G,Q);if(W=W||Y!==null,Y)continue Z}if(W)return!1}return!0},zM=[new D7(">=0.0.0-0")],Qz=[new D7(">=0.0.0")],$M=(Z,X,Q)=>{if(Z===X)return!0;if(Z.length===1&&Z[0].semver===I7)if(X.length===1&&X[0].semver===I7)return!0;else if(Q.includePrerelease)Z=zM;else Z=Qz;if(X.length===1&&X[0].semver===I7)if(Q.includePrerelease)return!0;else X=Qz;let W=new Set,J,G;for(let F of Z)if(F.operator===">"||F.operator===">=")J=Wz(J,F,Q);else if(F.operator==="<"||F.operator==="<=")G=Jz(G,F,Q);else W.add(F.semver);if(W.size>1)return null;let Y;if(J&&G){if(Y=T7(J.semver,G.semver,Q),Y>0)return null;else if(Y===0&&(J.operator!==">="||G.operator!=="<="))return null}for(let F of W){if(J&&!N7(F,String(J),Q))return null;if(G&&!N7(F,String(G),Q))return null;for(let A of X)if(!N7(F,String(A),Q))return!1;return!0}let z,q,K,V,B=G&&!Q.includePrerelease&&G.semver.prerelease.length?G.semver:!1,H=J&&!Q.includePrerelease&&J.semver.prerelease.length?J.semver:!1;if(B&&B.prerelease.length===1&&G.operator==="<"&&B.prerelease[0]===0)B=!1;for(let F of X){if(V=V||F.operator===">"||F.operator===">=",K=K||F.operator==="<"||F.operator==="<=",J){if(H){if(F.semver.prerelease&&F.semver.prerelease.length&&F.semver.major===H.major&&F.semver.minor===H.minor&&F.semver.patch===H.patch)H=!1}if(F.operator===">"||F.operator===">="){if(z=Wz(J,F,Q),z===F&&z!==J)return!1}else if(J.operator===">="&&!F.test(J.semver))return!1}if(G){if(B){if(F.semver.prerelease&&F.semver.prerelease.length&&F.semver.major===B.major&&F.semver.minor===B.minor&&F.semver.patch===B.patch)B=!1}if(F.operator==="<"||F.operator==="<="){if(q=Jz(G,F,Q),q===F&&q!==G)return!1}else if(G.operator==="<="&&!F.test(G.semver))return!1}if(!F.operator&&(G||J)&&Y!==0)return!1}if(J&&K&&!G&&Y!==0)return!1;if(G&&V&&!J&&Y!==0)return!1;if(H||B)return!1;return!0},Wz=(Z,X,Q)=>{if(!Z)return X;let W=T7(Z.semver,X.semver,Q);return W>0?Z:W<0?X:X.operator===">"&&Z.operator===">="?X:Z},Jz=(Z,X,Q)=>{if(!Z)return X;let W=T7(Z.semver,X.semver,Q);return W<0?Z:W>0?X:X.operator==="<"&&Z.operator==="<="?X:Z};Gz.exports=YM});var Kz=j((Zv,qz)=>{var w7=D1(),zz=N1(),qM=v0(),$z=K7(),KM=T6(),UM=kG(),VM=_G(),BM=yG(),HM=hG(),FM=mG(),LM=dG(),AM=pG(),MM=iG(),IM=H4(),NM=oG(),DM=eG(),TM=y8(),wM=WY(),jM=GY(),OM=Y9(),EM=g8(),RM=V7(),PM=B7(),CM=f8(),SM=h8(),kM=H7(),bM=HY(),_M=LY(),xM=$9(),vM=F4(),yM=K9(),gM=bY(),fM=xY(),hM=yY(),uM=hY(),mM=mY(),lM=d8(),dM=iY(),cM=aY(),pM=tY(),nM=Zz(),iM=Yz();qz.exports={parse:KM,valid:UM,clean:VM,inc:BM,diff:HM,major:FM,minor:LM,patch:AM,prerelease:MM,compare:IM,rcompare:NM,compareLoose:DM,compareBuild:TM,sort:wM,rsort:jM,gt:OM,lt:EM,eq:RM,neq:PM,gte:CM,lte:SM,cmp:kM,coerce:bM,truncate:_M,Comparator:xM,Range:vM,satisfies:yM,toComparators:gM,maxSatisfying:fM,minSatisfying:hM,minVersion:uM,validRange:mM,outside:lM,gtr:dM,ltr:cM,intersects:pM,simplifyRange:nM,subset:iM,SemVer:qM,re:w7.re,src:w7.src,tokens:w7.t,SEMVER_SPEC_VERSION:zz.SEMVER_SPEC_VERSION,RELEASE_TYPES:zz.RELEASE_TYPES,compareIdentifiers:$z.compareIdentifiers,rcompareIdentifiers:$z.rcompareIdentifiers}});var Z6;var c8=c(()=>{Z6={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 U9}from"node:child_process";import{createHash as aM}from"node:crypto";var V9,O7,sM,Vz,oM,E7,tM=(Z)=>{if(Z instanceof Error)console.error(`sharp: Installation error: ${Z.message}`);else console.log(`sharp: ${Z}`)},Bz=()=>O7.default.isNonGlibcLinuxSync()?O7.default.familySync():"",eM=()=>`${process.platform}${Bz()}-${process.arch}`,T1=()=>{if(Hz())return"wasm32";let{npm_config_arch:Z,npm_config_platform:X,npm_config_libc:Q}=process.env,W=typeof Q==="string"?Q:Bz();return`${X||process.platform}${W}-${Z||process.arch}`},ZI=()=>{try{return _0(`@img/sharp-libvips-dev-${T1()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},XI=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},QI=()=>{try{return _0(`@img/sharp-libvips-dev-${T1()}/lib`)}catch{try{return _0(`@img/sharp-libvips-${T1()}/lib`)}catch{}}return""},WI=()=>{if(process.release?.name==="node"&&process.versions){if(!V9.default.satisfies(process.versions.node,Z6.engines.node))return{found:process.versions.node,expected:Z6.engines.node}}},Hz=()=>{let{CC:Z}=process.env;return Boolean(Z?.endsWith("/emcc"))},JI=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(U9("sysctl sysctl.proc_translated",E7).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},Uz=(Z)=>aM("sha512").update(Z).digest("hex"),GI=()=>{try{let Z=Uz(`imgsharp-libvips-${T1()}`),X=V9.default.coerce(Z6.optionalDependencies[`@img/sharp-libvips-${T1()}`],{includePrerelease:!0}).version;return Uz(`${Z}npm:${X}`).slice(0,10)}catch{}return""},YI=()=>U9(`node-gyp rebuild --directory=src ${Hz()?"--nodedir=emscripten":""}`,{...E7,stdio:"inherit"}).status,Fz=()=>{if(process.platform!=="win32")return(U9("pkg-config --modversion vips-cpp",{...E7,env:{...process.env,PKG_CONFIG_PATH:Lz()}}).stdout||"").trim();else return""},zI=()=>{try{let Z=(U9("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(Z)return`${Z}/lib/pkgconfig`}catch(Z){}return},$I=()=>{try{let Z=(U9("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(Z)return Z}catch(Z){}return},Lz=()=>{if(process.platform!=="win32")return[zI(),$I(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},j7=(Z,X,Q)=>{if(Q)Q(`Detected ${X}, skipping search for globally-installed libvips`);return Z},qI=(Z)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return j7(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",Z);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return j7(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",Z);if(JI())return j7(!1,"Rosetta",Z);let X=Fz();return!!X&&V9.default.gte(X,Vz)},p8;var R7=c(()=>{c8();V9=W1(Kz(),1),O7=W1(S8(),1);/*!
|
|
287
|
+
*/K={defined:oY,object:RA,plainObject:PA,fn:CA,bool:SA,buffer:_A,typedArray:kA,arrayBuffer:xA,string:bA,number:vA,integer:yA,inRange:gA,inArray:fA,invalidParameterError:hA,nativeError:uA}});var eY=C((pg,tY)=>{var sY=()=>process.platform==="linux",_5=null,mA=()=>{if(!_5)if(sY()&&process.report){let Z=process.report.excludeNetwork;process.report.excludeNetwork=!0,_5=process.report.getReport(),process.report.excludeNetwork=Z}else _5={};return _5};tY.exports={isLinux:sY,getReport:mA}});var X$=C((ig,Z$)=>{var G9=w0("fs"),dA=(Z)=>{let X=G9.openSync(Z,"r"),Q=Buffer.alloc(2048),J=G9.readSync(X,Q,0,2048,0);return G9.close(X,()=>{}),Q.subarray(0,J)},lA=(Z)=>new Promise((X,Q)=>{G9.open(Z,"r",(J,W)=>{if(J)Q(J);else{let G=Buffer.alloc(2048);G9.read(W,G,0,2048,0,(Y,$)=>{X(G.subarray(0,$)),G9.close(W,()=>{})})}})});Z$.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:dA,readFile:lA}});var J$=C((ng,Q$)=>{var cA=(Z)=>{if(Z.length<64)return null;if(Z.readUInt32BE(0)!==2135247942)return null;if(Z.readUInt8(4)!==2)return null;if(Z.readUInt8(5)!==1)return null;let X=Z.readUInt32LE(32),Q=Z.readUInt16LE(54),J=Z.readUInt16LE(56);for(let W=0;W<J;W++){let G=X+W*Q;if(Z.readUInt32LE(G)===3){let $=Z.readUInt32LE(G+8),z=Z.readUInt32LE(G+32);return Z.subarray($,$+z).toString().replace(/\0.*$/g,"")}}return null};Q$.exports={interpreterPath:cA}});var x5=C((rg,N$)=>{var G$=w0("child_process"),{isLinux:Y9,getReport:Y$}=eY(),{LDD_PATH:k5,SELF_PATH:$$,readFile:TX,readFileSync:wX}=X$(),{interpreterPath:z$}=J$(),H1,q1,B1,Q4="",U$=()=>{if(!Q4)return new Promise((Z)=>{G$.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(X,Q)=>{Q4=X?" ":Q,Z(Q4)})});return Q4},K$=()=>{if(!Q4)try{Q4=G$.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(Z){Q4=" "}return Q4},k1="glibc",V$=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,R4="musl",pA=(Z)=>Z.includes("libc.musl-")||Z.includes("ld-musl-"),H$=()=>{let Z=Y$();if(Z.header&&Z.header.glibcVersionRuntime)return k1;if(Array.isArray(Z.sharedObjects)){if(Z.sharedObjects.some(pA))return R4}return null},q$=(Z)=>{let[X,Q]=Z.split(/[\r\n]+/);if(X&&X.includes(k1))return k1;if(Q&&Q.includes(R4))return R4;return null},B$=(Z)=>{if(Z){if(Z.includes("/ld-musl-"))return R4;else if(Z.includes("/ld-linux-"))return k1}return null},F$=(Z)=>{if(Z=Z.toString(),Z.includes("musl"))return R4;if(Z.includes("GNU C Library"))return k1;return null},iA=async()=>{if(q1!==void 0)return q1;q1=null;try{let Z=await TX(k5);q1=F$(Z)}catch(Z){}return q1},nA=()=>{if(q1!==void 0)return q1;q1=null;try{let Z=wX(k5);q1=F$(Z)}catch(Z){}return q1},rA=async()=>{if(H1!==void 0)return H1;H1=null;try{let Z=await TX($$),X=z$(Z);H1=B$(X)}catch(Z){}return H1},aA=()=>{if(H1!==void 0)return H1;H1=null;try{let Z=wX($$),X=z$(Z);H1=B$(X)}catch(Z){}return H1},L$=async()=>{let Z=null;if(Y9()){if(Z=await rA(),!Z){if(Z=await iA(),!Z)Z=H$();if(!Z){let X=await U$();Z=q$(X)}}}return Z},M$=()=>{let Z=null;if(Y9()){if(Z=aA(),!Z){if(Z=nA(),!Z)Z=H$();if(!Z){let X=K$();Z=q$(X)}}}return Z},oA=async()=>Y9()&&await L$()!==k1,sA=()=>Y9()&&M$()!==k1,tA=async()=>{if(B1!==void 0)return B1;B1=null;try{let X=(await TX(k5)).match(V$);if(X)B1=X[1]}catch(Z){}return B1},eA=()=>{if(B1!==void 0)return B1;B1=null;try{let X=wX(k5).match(V$);if(X)B1=X[1]}catch(Z){}return B1},A$=()=>{let Z=Y$();if(Z.header&&Z.header.glibcVersionRuntime)return Z.header.glibcVersionRuntime;return null},W$=(Z)=>Z.trim().split(/\s+/)[1],I$=(Z)=>{let[X,Q,J]=Z.split(/[\r\n]+/);if(X&&X.includes(k1))return W$(X);if(Q&&J&&Q.includes(R4))return W$(J);return null},Z2=async()=>{let Z=null;if(Y9()){if(Z=await tA(),!Z)Z=A$();if(!Z){let X=await U$();Z=I$(X)}}return Z},X2=()=>{let Z=null;if(Y9()){if(Z=eA(),!Z)Z=A$();if(!Z){let X=K$();Z=I$(X)}}return Z};N$.exports={GLIBC:k1,MUSL:R4,family:L$,familySync:M$,isNonGlibcLinux:oA,isNonGlibcLinuxSync:sA,version:Z2,versionSync:X2}});var $9=C((ag,D$)=>{var Q2=Number.MAX_SAFE_INTEGER||9007199254740991,J2=["major","premajor","minor","preminor","patch","prepatch","prerelease"];D$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Q2,RELEASE_TYPES:J2,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var t9=C((og,T$)=>{var W2=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...Z)=>console.error("SEMVER",...Z):()=>{};T$.exports=W2});var z9=C((F1,w$)=>{var{MAX_SAFE_COMPONENT_LENGTH:jX,MAX_SAFE_BUILD_LENGTH:G2,MAX_LENGTH:Y2}=$9(),$2=t9();F1=w$.exports={};var z2=F1.re=[],U2=F1.safeRe=[],e=F1.src=[],K2=F1.safeSrc=[],Z0=F1.t={},V2=0,OX="[a-zA-Z0-9-]",H2=[["\\s",1],["\\d",Y2],[OX,G2]],q2=(Z)=>{for(let[X,Q]of H2)Z=Z.split(`${X}*`).join(`${X}{0,${Q}}`).split(`${X}+`).join(`${X}{1,${Q}}`);return Z},B0=(Z,X,Q)=>{let J=q2(X),W=V2++;$2(Z,W,X),Z0[Z]=W,e[W]=X,K2[W]=J,z2[W]=new RegExp(X,Q?"g":void 0),U2[W]=new RegExp(J,Q?"g":void 0)};B0("NUMERICIDENTIFIER","0|[1-9]\\d*");B0("NUMERICIDENTIFIERLOOSE","\\d+");B0("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${OX}*`);B0("MAINVERSION",`(${e[Z0.NUMERICIDENTIFIER]})\\.(${e[Z0.NUMERICIDENTIFIER]})\\.(${e[Z0.NUMERICIDENTIFIER]})`);B0("MAINVERSIONLOOSE",`(${e[Z0.NUMERICIDENTIFIERLOOSE]})\\.(${e[Z0.NUMERICIDENTIFIERLOOSE]})\\.(${e[Z0.NUMERICIDENTIFIERLOOSE]})`);B0("PRERELEASEIDENTIFIER",`(?:${e[Z0.NONNUMERICIDENTIFIER]}|${e[Z0.NUMERICIDENTIFIER]})`);B0("PRERELEASEIDENTIFIERLOOSE",`(?:${e[Z0.NONNUMERICIDENTIFIER]}|${e[Z0.NUMERICIDENTIFIERLOOSE]})`);B0("PRERELEASE",`(?:-(${e[Z0.PRERELEASEIDENTIFIER]}(?:\\.${e[Z0.PRERELEASEIDENTIFIER]})*))`);B0("PRERELEASELOOSE",`(?:-?(${e[Z0.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${e[Z0.PRERELEASEIDENTIFIERLOOSE]})*))`);B0("BUILDIDENTIFIER",`${OX}+`);B0("BUILD",`(?:\\+(${e[Z0.BUILDIDENTIFIER]}(?:\\.${e[Z0.BUILDIDENTIFIER]})*))`);B0("FULLPLAIN",`v?${e[Z0.MAINVERSION]}${e[Z0.PRERELEASE]}?${e[Z0.BUILD]}?`);B0("FULL",`^${e[Z0.FULLPLAIN]}$`);B0("LOOSEPLAIN",`[v=\\s]*${e[Z0.MAINVERSIONLOOSE]}${e[Z0.PRERELEASELOOSE]}?${e[Z0.BUILD]}?`);B0("LOOSE",`^${e[Z0.LOOSEPLAIN]}$`);B0("GTLT","((?:<|>)?=?)");B0("XRANGEIDENTIFIERLOOSE",`${e[Z0.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);B0("XRANGEIDENTIFIER",`${e[Z0.NUMERICIDENTIFIER]}|x|X|\\*`);B0("XRANGEPLAIN",`[v=\\s]*(${e[Z0.XRANGEIDENTIFIER]})(?:\\.(${e[Z0.XRANGEIDENTIFIER]})(?:\\.(${e[Z0.XRANGEIDENTIFIER]})(?:${e[Z0.PRERELEASE]})?${e[Z0.BUILD]}?)?)?`);B0("XRANGEPLAINLOOSE",`[v=\\s]*(${e[Z0.XRANGEIDENTIFIERLOOSE]})(?:\\.(${e[Z0.XRANGEIDENTIFIERLOOSE]})(?:\\.(${e[Z0.XRANGEIDENTIFIERLOOSE]})(?:${e[Z0.PRERELEASELOOSE]})?${e[Z0.BUILD]}?)?)?`);B0("XRANGE",`^${e[Z0.GTLT]}\\s*${e[Z0.XRANGEPLAIN]}$`);B0("XRANGELOOSE",`^${e[Z0.GTLT]}\\s*${e[Z0.XRANGEPLAINLOOSE]}$`);B0("COERCEPLAIN",`(^|[^\\d])(\\d{1,${jX}})(?:\\.(\\d{1,${jX}}))?(?:\\.(\\d{1,${jX}}))?`);B0("COERCE",`${e[Z0.COERCEPLAIN]}(?:$|[^\\d])`);B0("COERCEFULL",e[Z0.COERCEPLAIN]+`(?:${e[Z0.PRERELEASE]})?(?:${e[Z0.BUILD]})?(?:$|[^\\d])`);B0("COERCERTL",e[Z0.COERCE],!0);B0("COERCERTLFULL",e[Z0.COERCEFULL],!0);B0("LONETILDE","(?:~>?)");B0("TILDETRIM",`(\\s*)${e[Z0.LONETILDE]}\\s+`,!0);F1.tildeTrimReplace="$1~";B0("TILDE",`^${e[Z0.LONETILDE]}${e[Z0.XRANGEPLAIN]}$`);B0("TILDELOOSE",`^${e[Z0.LONETILDE]}${e[Z0.XRANGEPLAINLOOSE]}$`);B0("LONECARET","(?:\\^)");B0("CARETTRIM",`(\\s*)${e[Z0.LONECARET]}\\s+`,!0);F1.caretTrimReplace="$1^";B0("CARET",`^${e[Z0.LONECARET]}${e[Z0.XRANGEPLAIN]}$`);B0("CARETLOOSE",`^${e[Z0.LONECARET]}${e[Z0.XRANGEPLAINLOOSE]}$`);B0("COMPARATORLOOSE",`^${e[Z0.GTLT]}\\s*(${e[Z0.LOOSEPLAIN]})$|^$`);B0("COMPARATOR",`^${e[Z0.GTLT]}\\s*(${e[Z0.FULLPLAIN]})$|^$`);B0("COMPARATORTRIM",`(\\s*)${e[Z0.GTLT]}\\s*(${e[Z0.LOOSEPLAIN]}|${e[Z0.XRANGEPLAIN]})`,!0);F1.comparatorTrimReplace="$1$2$3";B0("HYPHENRANGE",`^\\s*(${e[Z0.XRANGEPLAIN]})\\s+-\\s+(${e[Z0.XRANGEPLAIN]})\\s*$`);B0("HYPHENRANGELOOSE",`^\\s*(${e[Z0.XRANGEPLAINLOOSE]})\\s+-\\s+(${e[Z0.XRANGEPLAINLOOSE]})\\s*$`);B0("STAR","(<|>)?=?\\s*\\*");B0("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");B0("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var b5=C((sg,j$)=>{var B2=Object.freeze({loose:!0}),F2=Object.freeze({}),L2=(Z)=>{if(!Z)return F2;if(typeof Z!=="object")return B2;return Z};j$.exports=L2});var EX=C((tg,R$)=>{var O$=/^[0-9]+$/,E$=(Z,X)=>{if(typeof Z==="number"&&typeof X==="number")return Z===X?0:Z<X?-1:1;let Q=O$.test(Z),J=O$.test(X);if(Q&&J)Z=+Z,X=+X;return Z===X?0:Q&&!J?-1:J&&!Q?1:Z<X?-1:1},M2=(Z,X)=>E$(X,Z);R$.exports={compareIdentifiers:E$,rcompareIdentifiers:M2}});var X6=C((eg,C$)=>{var v5=t9(),{MAX_LENGTH:P$,MAX_SAFE_INTEGER:y5}=$9(),{safeRe:g5,t:f5}=z9(),A2=b5(),{compareIdentifiers:RX}=EX(),I2=(Z,X)=>{let Q=X.split(".");if(Q.length>Z.length)return!1;for(let J=0;J<Q.length;J++)if(RX(Z[J],Q[J])!==0)return!1;return!0};class o6{constructor(Z,X){if(X=A2(X),Z instanceof o6)if(Z.loose===!!X.loose&&Z.includePrerelease===!!X.includePrerelease)return Z;else Z=Z.version;else if(typeof Z!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof Z}".`);if(Z.length>P$)throw TypeError(`version is longer than ${P$} characters`);v5("SemVer",Z,X),this.options=X,this.loose=!!X.loose,this.includePrerelease=!!X.includePrerelease;let Q=Z.trim().match(X.loose?g5[f5.LOOSE]:g5[f5.FULL]);if(!Q)throw TypeError(`Invalid Version: ${Z}`);if(this.raw=Z,this.major=+Q[1],this.minor=+Q[2],this.patch=+Q[3],this.major>y5||this.major<0)throw TypeError("Invalid major version");if(this.minor>y5||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>y5||this.patch<0)throw TypeError("Invalid patch version");if(!Q[4])this.prerelease=[];else this.prerelease=Q[4].split(".").map((J)=>{if(/^[0-9]+$/.test(J)){let W=+J;if(W>=0&&W<y5)return W}return J});this.build=Q[5]?Q[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(Z){if(v5("SemVer.compare",this.version,this.options,Z),!(Z instanceof o6)){if(typeof Z==="string"&&Z===this.version)return 0;Z=new o6(Z,this.options)}if(Z.version===this.version)return 0;return this.compareMain(Z)||this.comparePre(Z)}compareMain(Z){if(!(Z instanceof o6))Z=new o6(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 o6))Z=new o6(Z,this.options);if(this.prerelease.length&&!Z.prerelease.length)return-1;else if(!this.prerelease.length&&Z.prerelease.length)return 1;else if(!this.prerelease.length&&!Z.prerelease.length)return 0;let X=0;do{let Q=this.prerelease[X],J=Z.prerelease[X];if(v5("prerelease compare",X,Q,J),Q===void 0&&J===void 0)return 0;else if(J===void 0)return 1;else if(Q===void 0)return-1;else if(Q===J)continue;else return RX(Q,J)}while(++X)}compareBuild(Z){if(!(Z instanceof o6))Z=new o6(Z,this.options);let X=0;do{let Q=this.build[X],J=Z.build[X];if(v5("build compare",X,Q,J),Q===void 0&&J===void 0)return 0;else if(J===void 0)return 1;else if(Q===void 0)return-1;else if(Q===J)continue;else return RX(Q,J)}while(++X)}inc(Z,X,Q){if(Z.startsWith("pre")){if(!X&&Q===!1)throw Error("invalid increment argument: identifier is empty");if(X){let J=`-${X}`.match(this.options.loose?g5[f5.PRERELEASELOOSE]:g5[f5.PRERELEASE]);if(!J||J[1]!==X)throw Error(`invalid identifier: ${X}`)}}switch(Z){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",X,Q);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",X,Q);break;case"prepatch":this.prerelease.length=0,this.inc("patch",X,Q),this.inc("pre",X,Q);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",X,Q);this.inc("pre",X,Q);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let J=Number(Q)?1:0;if(this.prerelease.length===0)this.prerelease=[J];else{let W=this.prerelease.length;while(--W>=0)if(typeof this.prerelease[W]==="number")this.prerelease[W]++,W=-2;if(W===-1){if(X===this.prerelease.join(".")&&Q===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(J)}}if(X){let W=[X,J];if(Q===!1)W=[X];if(I2(this.prerelease,X)){let G=this.prerelease[X.split(".").length];if(isNaN(G))this.prerelease=W}else this.prerelease=W}break}default:throw Error(`invalid increment argument: ${Z}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}C$.exports=o6});var J4=C((Zf,_$)=>{var S$=X6(),N2=(Z,X,Q=!1)=>{if(Z instanceof S$)return Z;try{return new S$(Z,X)}catch(J){if(!Q)return null;throw J}};_$.exports=N2});var x$=C((Xf,k$)=>{var D2=J4(),T2=(Z,X)=>{let Q=D2(Z,X);return Q?Q.version:null};k$.exports=T2});var v$=C((Qf,b$)=>{var w2=J4(),j2=(Z,X)=>{let Q=w2(Z.trim().replace(/^[=v]+/,""),X);return Q?Q.version:null};b$.exports=j2});var f$=C((Jf,g$)=>{var y$=X6(),O2=(Z,X,Q,J,W)=>{if(typeof Q==="string")W=J,J=Q,Q=void 0;try{return new y$(Z instanceof y$?Z.version:Z,Q).inc(X,J,W).version}catch(G){return null}};g$.exports=O2});var m$=C((Wf,u$)=>{var h$=J4(),E2=(Z,X)=>{let Q=h$(Z,null,!0),J=h$(X,null,!0),W=Q.compare(J);if(W===0)return null;let G=W>0,Y=G?Q:J,$=G?J:Q,z=!!Y.prerelease.length;if(!!$.prerelease.length&&!z){if(!$.patch&&!$.minor)return"major";if($.compareMain(Y)===0){if($.minor&&!$.patch)return"minor";return"patch"}}let V=z?"pre":"";if(Q.major!==J.major)return V+"major";if(Q.minor!==J.minor)return V+"minor";if(Q.patch!==J.patch)return V+"patch";return"prerelease"};u$.exports=E2});var l$=C((Gf,d$)=>{var R2=X6(),P2=(Z,X)=>new R2(Z,X).major;d$.exports=P2});var p$=C((Yf,c$)=>{var C2=X6(),S2=(Z,X)=>new C2(Z,X).minor;c$.exports=S2});var n$=C(($f,i$)=>{var _2=X6(),k2=(Z,X)=>new _2(Z,X).patch;i$.exports=k2});var a$=C((zf,r$)=>{var x2=J4(),b2=(Z,X)=>{let Q=x2(Z,X);return Q&&Q.prerelease.length?Q.prerelease:null};r$.exports=b2});var m6=C((Uf,s$)=>{var o$=X6(),v2=(Z,X,Q)=>new o$(Z,Q).compare(new o$(X,Q));s$.exports=v2});var e$=C((Kf,t$)=>{var y2=m6(),g2=(Z,X,Q)=>y2(X,Z,Q);t$.exports=g2});var Xz=C((Vf,Zz)=>{var f2=m6(),h2=(Z,X)=>f2(Z,X,!0);Zz.exports=h2});var h5=C((Hf,Jz)=>{var Qz=X6(),u2=(Z,X,Q)=>{let J=new Qz(Z,Q),W=new Qz(X,Q);return J.compare(W)||J.compareBuild(W)};Jz.exports=u2});var Gz=C((qf,Wz)=>{var m2=h5(),d2=(Z,X)=>Z.sort((Q,J)=>m2(Q,J,X));Wz.exports=d2});var $z=C((Bf,Yz)=>{var l2=h5(),c2=(Z,X)=>Z.sort((Q,J)=>l2(J,Q,X));Yz.exports=c2});var e9=C((Ff,zz)=>{var p2=m6(),i2=(Z,X,Q)=>p2(Z,X,Q)>0;zz.exports=i2});var u5=C((Lf,Uz)=>{var n2=m6(),r2=(Z,X,Q)=>n2(Z,X,Q)<0;Uz.exports=r2});var PX=C((Mf,Kz)=>{var a2=m6(),o2=(Z,X,Q)=>a2(Z,X,Q)===0;Kz.exports=o2});var CX=C((Af,Vz)=>{var s2=m6(),t2=(Z,X,Q)=>s2(Z,X,Q)!==0;Vz.exports=t2});var m5=C((If,Hz)=>{var e2=m6(),ZI=(Z,X,Q)=>e2(Z,X,Q)>=0;Hz.exports=ZI});var d5=C((Nf,qz)=>{var XI=m6(),QI=(Z,X,Q)=>XI(Z,X,Q)<=0;qz.exports=QI});var SX=C((Df,Bz)=>{var JI=PX(),WI=CX(),GI=e9(),YI=m5(),$I=u5(),zI=d5(),UI=(Z,X,Q,J)=>{switch(X){case"===":if(typeof Z==="object")Z=Z.version;if(typeof Q==="object")Q=Q.version;return Z===Q;case"!==":if(typeof Z==="object")Z=Z.version;if(typeof Q==="object")Q=Q.version;return Z!==Q;case"":case"=":case"==":return JI(Z,Q,J);case"!=":return WI(Z,Q,J);case">":return GI(Z,Q,J);case">=":return YI(Z,Q,J);case"<":return $I(Z,Q,J);case"<=":return zI(Z,Q,J);default:throw TypeError(`Invalid operator: ${X}`)}};Bz.exports=UI});var Lz=C((Tf,Fz)=>{var KI=X6(),VI=J4(),{safeRe:l5,t:c5}=z9(),HI=(Z,X)=>{if(Z instanceof KI)return Z;if(typeof Z==="number")Z=String(Z);if(typeof Z!=="string")return null;X=X||{};let Q=null;if(!X.rtl)Q=Z.match(X.includePrerelease?l5[c5.COERCEFULL]:l5[c5.COERCE]);else{let z=X.includePrerelease?l5[c5.COERCERTLFULL]:l5[c5.COERCERTL],U;while((U=z.exec(Z))&&(!Q||Q.index+Q[0].length!==Z.length)){if(!Q||U.index+U[0].length!==Q.index+Q[0].length)Q=U;z.lastIndex=U.index+U[1].length+U[2].length}z.lastIndex=-1}if(Q===null)return null;let J=Q[2],W=Q[3]||"0",G=Q[4]||"0",Y=X.includePrerelease&&Q[5]?`-${Q[5]}`:"",$=X.includePrerelease&&Q[6]?`+${Q[6]}`:"";return VI(`${J}.${W}.${G}${Y}${$}`,X)};Fz.exports=HI});var Az=C((wf,Mz)=>{var qI=J4(),BI=$9(),FI=X6(),LI=(Z,X,Q)=>{if(!BI.RELEASE_TYPES.includes(X))return null;let J=MI(Z,Q);return J&&AI(J,X)},MI=(Z,X)=>{let Q=Z instanceof FI?Z.version:Z;return qI(Q,X)},AI=(Z,X)=>{if(II(X))return Z.version;switch(Z.prerelease=[],X){case"major":Z.minor=0,Z.patch=0;break;case"minor":Z.patch=0;break}return Z.format()},II=(Z)=>{return Z.startsWith("pre")};Mz.exports=LI});var Dz=C((jf,Nz)=>{class Iz{constructor(){this.max=1000,this.map=new Map}get(Z){let X=this.map.get(Z);if(X===void 0)return;else return this.map.delete(Z),this.map.set(Z,X),X}delete(Z){return this.map.delete(Z)}set(Z,X){if(!this.delete(Z)&&X!==void 0){if(this.map.size>=this.max){let J=this.map.keys().next().value;this.delete(J)}this.map.set(Z,X)}return this}}Nz.exports=Iz});var d6=C((Of,Oz)=>{var NI=/\s+/g;class Z8{constructor(Z,X){if(X=TI(X),Z instanceof Z8)if(Z.loose===!!X.loose&&Z.includePrerelease===!!X.includePrerelease)return Z;else return new Z8(Z.raw,X);if(Z instanceof _X)return this.raw=Z.value,this.set=[[Z]],this.formatted=void 0,this;if(this.options=X,this.loose=!!X.loose,this.includePrerelease=!!X.includePrerelease,this.raw=Z.trim().replace(NI," "),this.set=this.raw.split("||").map((Q)=>this.parseRange(Q.trim())).filter((Q)=>Q.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let Q=this.set[0];if(this.set=this.set.filter((J)=>!wz(J[0])),this.set.length===0)this.set=[Q];else if(this.set.length>1){for(let J of this.set)if(J.length===1&&_I(J[0])){this.set=[J];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let Z=0;Z<this.set.length;Z++){if(Z>0)this.formatted+="||";let X=this.set[Z];for(let Q=0;Q<X.length;Q++){if(Q>0)this.formatted+=" ";this.formatted+=X[Q].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(Z){Z=Z.replace(SI,"");let Q=((this.options.includePrerelease&&PI)|(this.options.loose&&CI))+":"+Z,J=Tz.get(Q);if(J)return J;let W=this.options.loose,G=W?q6[Q6.HYPHENRANGELOOSE]:q6[Q6.HYPHENRANGE];Z=Z.replace(G,dI(this.options.includePrerelease)),k0("hyphen replace",Z),Z=Z.replace(q6[Q6.COMPARATORTRIM],OI),k0("comparator trim",Z),Z=Z.replace(q6[Q6.TILDETRIM],EI),k0("tilde trim",Z),Z=Z.replace(q6[Q6.CARETTRIM],RI),k0("caret trim",Z);let Y=Z.split(" ").map((V)=>kI(V,this.options)).join(" ").split(/\s+/).map((V)=>mI(V,this.options));if(W)Y=Y.filter((V)=>{return k0("loose invalid filter",V,this.options),!!V.match(q6[Q6.COMPARATORLOOSE])});k0("range list",Y);let $=new Map,z=Y.map((V)=>new _X(V,this.options));for(let V of z){if(wz(V))return[V];$.set(V.value,V)}if($.size>1&&$.has(""))$.delete("");let U=[...$.values()];return Tz.set(Q,U),U}intersects(Z,X){if(!(Z instanceof Z8))throw TypeError("a Range is required");return this.set.some((Q)=>{return jz(Q,X)&&Z.set.some((J)=>{return jz(J,X)&&Q.every((W)=>{return J.every((G)=>{return W.intersects(G,X)})})})})}test(Z){if(!Z)return!1;if(typeof Z==="string")try{Z=new wI(Z,this.options)}catch(X){return!1}for(let X=0;X<this.set.length;X++)if(lI(this.set[X],Z,this.options))return!0;return!1}}Oz.exports=Z8;var DI=Dz(),Tz=new DI,TI=b5(),_X=X8(),k0=t9(),wI=X6(),{safeRe:q6,src:jI,t:Q6,comparatorTrimReplace:OI,tildeTrimReplace:EI,caretTrimReplace:RI}=z9(),{FLAG_INCLUDE_PRERELEASE:PI,FLAG_LOOSE:CI}=$9(),SI=new RegExp(jI[Q6.BUILD],"g"),wz=(Z)=>Z.value==="<0.0.0-0",_I=(Z)=>Z.value==="",jz=(Z,X)=>{let Q=!0,J=Z.slice(),W=J.pop();while(Q&&J.length)Q=J.every((G)=>{return W.intersects(G,X)}),W=J.pop();return Q},kI=(Z,X)=>{return Z=Z.replace(q6[Q6.BUILD],""),k0("comp",Z,X),Z=yI(Z,X),k0("caret",Z),Z=bI(Z,X),k0("tildes",Z),Z=fI(Z,X),k0("xrange",Z),Z=uI(Z,X),k0("stars",Z),Z},i0=(Z)=>!Z||Z.toLowerCase()==="x"||Z==="*",xI=(Z,X,Q)=>i0(Z)&&!i0(X)||i0(X)&&Q&&!i0(Q),bI=(Z,X)=>{return Z.trim().split(/\s+/).map((Q)=>vI(Q,X)).join(" ")},vI=(Z,X)=>{let Q=X.loose?q6[Q6.TILDELOOSE]:q6[Q6.TILDE],J=X.includePrerelease?"-0":"";return Z.replace(Q,(W,G,Y,$,z)=>{k0("tilde",Z,W,G,Y,$,z);let U;if(i0(G))U="";else if(i0(Y))U=`>=${G}.0.0${J} <${+G+1}.0.0-0`;else if(i0($))U=`>=${G}.${Y}.0${J} <${G}.${+Y+1}.0-0`;else if(z)k0("replaceTilde pr",z),U=`>=${G}.${Y}.${$}-${z} <${G}.${+Y+1}.0-0`;else U=`>=${G}.${Y}.${$} <${G}.${+Y+1}.0-0`;return k0("tilde return",U),U})},yI=(Z,X)=>{return Z.trim().split(/\s+/).map((Q)=>gI(Q,X)).join(" ")},gI=(Z,X)=>{k0("caret",Z,X);let Q=X.loose?q6[Q6.CARETLOOSE]:q6[Q6.CARET],J=X.includePrerelease?"-0":"";return Z.replace(Q,(W,G,Y,$,z)=>{k0("caret",Z,W,G,Y,$,z);let U;if(i0(G))U="";else if(i0(Y))U=`>=${G}.0.0${J} <${+G+1}.0.0-0`;else if(i0($))if(G==="0")U=`>=${G}.${Y}.0${J} <${G}.${+Y+1}.0-0`;else U=`>=${G}.${Y}.0${J} <${+G+1}.0.0-0`;else if(z)if(k0("replaceCaret pr",z),G==="0")if(Y==="0")U=`>=${G}.${Y}.${$}-${z} <${G}.${Y}.${+$+1}-0`;else U=`>=${G}.${Y}.${$}-${z} <${G}.${+Y+1}.0-0`;else U=`>=${G}.${Y}.${$}-${z} <${+G+1}.0.0-0`;else if(k0("no pr"),G==="0")if(Y==="0")U=`>=${G}.${Y}.${$} <${G}.${Y}.${+$+1}-0`;else U=`>=${G}.${Y}.${$} <${G}.${+Y+1}.0-0`;else U=`>=${G}.${Y}.${$} <${+G+1}.0.0-0`;return k0("caret return",U),U})},fI=(Z,X)=>{return k0("replaceXRanges",Z,X),Z.split(/\s+/).map((Q)=>hI(Q,X)).join(" ")},hI=(Z,X)=>{Z=Z.trim();let Q=X.loose?q6[Q6.XRANGELOOSE]:q6[Q6.XRANGE];return Z.replace(Q,(J,W,G,Y,$,z)=>{if(k0("xRange",Z,J,W,G,Y,$,z),xI(G,Y,$))return Z;let U=i0(G),V=U||i0(Y),q=V||i0($),B=q;if(W==="="&&B)W="";if(z=X.includePrerelease?"-0":"",U)if(W===">"||W==="<")J="<0.0.0-0";else J="*";else if(W&&B){if(V)Y=0;if($=0,W===">")if(W=">=",V)G=+G+1,Y=0,$=0;else Y=+Y+1,$=0;else if(W==="<=")if(W="<",V)G=+G+1;else Y=+Y+1;if(W==="<")z="-0";J=`${W+G}.${Y}.${$}${z}`}else if(V)J=`>=${G}.0.0${z} <${+G+1}.0.0-0`;else if(q)J=`>=${G}.${Y}.0${z} <${G}.${+Y+1}.0-0`;return k0("xRange return",J),J})},uI=(Z,X)=>{return k0("replaceStars",Z,X),Z.trim().replace(q6[Q6.STAR],"")},mI=(Z,X)=>{return k0("replaceGTE0",Z,X),Z.trim().replace(q6[X.includePrerelease?Q6.GTE0PRE:Q6.GTE0],"")},dI=(Z)=>(X,Q,J,W,G,Y,$,z,U,V,q,B)=>{if(i0(J))Q="";else if(i0(W))Q=`>=${J}.0.0${Z?"-0":""}`;else if(i0(G))Q=`>=${J}.${W}.0${Z?"-0":""}`;else if(Y)Q=`>=${Q}`;else Q=`>=${Q}${Z?"-0":""}`;if(i0(U))z="";else if(i0(V))z=`<${+U+1}.0.0-0`;else if(i0(q))z=`<${U}.${+V+1}.0-0`;else if(B)z=`<=${U}.${V}.${q}-${B}`;else if(Z)z=`<${U}.${V}.${+q+1}-0`;else z=`<=${z}`;return`${Q} ${z}`.trim()},lI=(Z,X,Q)=>{for(let J=0;J<Z.length;J++)if(!Z[J].test(X))return!1;if(X.prerelease.length&&!Q.includePrerelease){for(let J=0;J<Z.length;J++){if(k0(Z[J].semver),Z[J].semver===_X.ANY)continue;if(Z[J].semver.prerelease.length>0){let W=Z[J].semver;if(W.major===X.major&&W.minor===X.minor&&W.patch===X.patch)return!0}}return!1}return!0}});var X8=C((Ef,_z)=>{var Q8=Symbol("SemVer ANY");class p5{static get ANY(){return Q8}constructor(Z,X){if(X=Ez(X),Z instanceof p5)if(Z.loose===!!X.loose)return Z;else Z=Z.value;if(Z=Z.trim().split(/\s+/).join(" "),xX("comparator",Z,X),this.options=X,this.loose=!!X.loose,this.parse(Z),this.semver===Q8)this.value="";else this.value=this.operator+this.semver.version;xX("comp",this)}parse(Z){let X=this.options.loose?Rz[Pz.COMPARATORLOOSE]:Rz[Pz.COMPARATOR],Q=Z.match(X);if(!Q)throw TypeError(`Invalid comparator: ${Z}`);if(this.operator=Q[1]!==void 0?Q[1]:"",this.operator==="=")this.operator="";if(!Q[2])this.semver=Q8;else this.semver=new Cz(Q[2],this.options.loose)}toString(){return this.value}test(Z){if(xX("Comparator.test",Z,this.options.loose),this.semver===Q8||Z===Q8)return!0;if(typeof Z==="string")try{Z=new Cz(Z,this.options)}catch(X){return!1}return kX(Z,this.operator,this.semver,this.options)}intersects(Z,X){if(!(Z instanceof p5))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Sz(Z.value,X).test(this.value)}else if(Z.operator===""){if(Z.value==="")return!0;return new Sz(this.value,X).test(Z.semver)}if(X=Ez(X),X.includePrerelease&&(this.value==="<0.0.0-0"||Z.value==="<0.0.0-0"))return!1;if(!X.includePrerelease&&(this.value.startsWith("<0.0.0")||Z.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&Z.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&Z.operator.startsWith("<"))return!0;if(this.semver.version===Z.semver.version&&this.operator.includes("=")&&Z.operator.includes("="))return!0;if(kX(this.semver,"<",Z.semver,X)&&this.operator.startsWith(">")&&Z.operator.startsWith("<"))return!0;if(kX(this.semver,">",Z.semver,X)&&this.operator.startsWith("<")&&Z.operator.startsWith(">"))return!0;return!1}}_z.exports=p5;var Ez=b5(),{safeRe:Rz,t:Pz}=z9(),kX=SX(),xX=t9(),Cz=X6(),Sz=d6()});var J8=C((Rf,kz)=>{var cI=d6(),pI=(Z,X,Q)=>{try{X=new cI(X,Q)}catch(J){return!1}return X.test(Z)};kz.exports=pI});var bz=C((Pf,xz)=>{var iI=d6(),nI=(Z,X)=>new iI(Z,X).set.map((Q)=>Q.map((J)=>J.value).join(" ").trim().split(" "));xz.exports=nI});var yz=C((Cf,vz)=>{var rI=X6(),aI=d6(),oI=(Z,X,Q)=>{let J=null,W=null,G=null;try{G=new aI(X,Q)}catch(Y){return null}return Z.forEach((Y)=>{if(G.test(Y)){if(!J||W.compare(Y)===-1)J=Y,W=new rI(J,Q)}}),J};vz.exports=oI});var fz=C((Sf,gz)=>{var sI=X6(),tI=d6(),eI=(Z,X,Q)=>{let J=null,W=null,G=null;try{G=new tI(X,Q)}catch(Y){return null}return Z.forEach((Y)=>{if(G.test(Y)){if(!J||W.compare(Y)===1)J=Y,W=new sI(J,Q)}}),J};gz.exports=eI});var mz=C((_f,uz)=>{var bX=X6(),ZN=d6(),hz=e9(),XN=(Z,X)=>{Z=new ZN(Z,X);let Q=new bX("0.0.0");if(Z.test(Q))return Q;if(Q=new bX("0.0.0-0"),Z.test(Q))return Q;Q=null;for(let J=0;J<Z.set.length;++J){let W=Z.set[J],G=null;if(W.forEach((Y)=>{let $=new bX(Y.semver.version);switch(Y.operator){case">":if($.prerelease.length===0)$.patch++;else $.prerelease.push(0);$.raw=$.format();case"":case">=":if(!G||hz($,G))G=$;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${Y.operator}`)}}),G&&(!Q||hz(Q,G)))Q=G}if(Q&&Z.test(Q))return Q;return null};uz.exports=XN});var lz=C((kf,dz)=>{var QN=d6(),JN=(Z,X)=>{try{return new QN(Z,X).range||"*"}catch(Q){return null}};dz.exports=JN});var i5=C((xf,nz)=>{var WN=X6(),iz=X8(),{ANY:GN}=iz,YN=d6(),$N=J8(),cz=e9(),pz=u5(),zN=d5(),UN=m5(),KN=(Z,X,Q,J)=>{Z=new WN(Z,J),X=new YN(X,J);let W,G,Y,$,z;switch(Q){case">":W=cz,G=zN,Y=pz,$=">",z=">=";break;case"<":W=pz,G=UN,Y=cz,$="<",z="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if($N(Z,X,J))return!1;for(let U=0;U<X.set.length;++U){let V=X.set[U],q=null,B=null;if(V.forEach((F)=>{if(F.semver===GN)F=new iz(">=0.0.0");if(q=q||F,B=B||F,W(F.semver,q.semver,J))q=F;else if(Y(F.semver,B.semver,J))B=F}),q.operator===$||q.operator===z)return!1;if((!B.operator||B.operator===$)&&G(Z,B.semver))return!1;else if(B.operator===z&&Y(Z,B.semver))return!1}return!0};nz.exports=KN});var az=C((bf,rz)=>{var VN=i5(),HN=(Z,X,Q)=>VN(Z,X,">",Q);rz.exports=HN});var sz=C((vf,oz)=>{var qN=i5(),BN=(Z,X,Q)=>qN(Z,X,"<",Q);oz.exports=BN});var ZU=C((yf,ez)=>{var tz=d6(),FN=(Z,X,Q)=>{return Z=new tz(Z,Q),X=new tz(X,Q),Z.intersects(X,Q)};ez.exports=FN});var QU=C((gf,XU)=>{var LN=J8(),MN=m6();XU.exports=(Z,X,Q)=>{let J=[],W=null,G=null,Y=Z.sort((V,q)=>MN(V,q,Q));for(let V of Y)if(LN(V,X,Q)){if(G=V,!W)W=V}else{if(G)J.push([W,G]);G=null,W=null}if(W)J.push([W,null]);let $=[];for(let[V,q]of J)if(V===q)$.push(V);else if(!q&&V===Y[0])$.push("*");else if(!q)$.push(`>=${V}`);else if(V===Y[0])$.push(`<=${q}`);else $.push(`${V} - ${q}`);let z=$.join(" || "),U=typeof X.raw==="string"?X.raw:String(X);return z.length<U.length?z:X}});var zU=C((ff,$U)=>{var JU=d6(),gX=X8(),{ANY:vX}=gX,yX=J8(),fX=m6(),AN=(Z,X,Q={})=>{if(Z===X)return!0;Z=new JU(Z,Q),X=new JU(X,Q);let J=!1;Z:for(let W of Z.set){for(let G of X.set){let Y=NN(W,G,Q);if(J=J||Y!==null,Y)continue Z}if(J)return!1}return!0},IN=[new gX(">=0.0.0-0")],WU=[new gX(">=0.0.0")],NN=(Z,X,Q)=>{if(Z===X)return!0;if(Z.length===1&&Z[0].semver===vX)if(X.length===1&&X[0].semver===vX)return!0;else if(Q.includePrerelease)Z=IN;else Z=WU;if(X.length===1&&X[0].semver===vX)if(Q.includePrerelease)return!0;else X=WU;let J=new Set,W,G;for(let F of Z)if(F.operator===">"||F.operator===">=")W=GU(W,F,Q);else if(F.operator==="<"||F.operator==="<=")G=YU(G,F,Q);else J.add(F.semver);if(J.size>1)return null;let Y;if(W&&G){if(Y=fX(W.semver,G.semver,Q),Y>0)return null;else if(Y===0&&(W.operator!==">="||G.operator!=="<="))return null}for(let F of J){if(W&&!yX(F,String(W),Q))return null;if(G&&!yX(F,String(G),Q))return null;for(let L of X)if(!yX(F,String(L),Q))return!1;return!0}let $,z,U,V,q=G&&!Q.includePrerelease&&G.semver.prerelease.length?G.semver:!1,B=W&&!Q.includePrerelease&&W.semver.prerelease.length?W.semver:!1;if(q&&q.prerelease.length===1&&G.operator==="<"&&q.prerelease[0]===0)q=!1;for(let F of X){if(V=V||F.operator===">"||F.operator===">=",U=U||F.operator==="<"||F.operator==="<=",W){if(B){if(F.semver.prerelease&&F.semver.prerelease.length&&F.semver.major===B.major&&F.semver.minor===B.minor&&F.semver.patch===B.patch)B=!1}if(F.operator===">"||F.operator===">="){if($=GU(W,F,Q),$===F&&$!==W)return!1}else if(W.operator===">="&&!F.test(W.semver))return!1}if(G){if(q){if(F.semver.prerelease&&F.semver.prerelease.length&&F.semver.major===q.major&&F.semver.minor===q.minor&&F.semver.patch===q.patch)q=!1}if(F.operator==="<"||F.operator==="<="){if(z=YU(G,F,Q),z===F&&z!==G)return!1}else if(G.operator==="<="&&!F.test(G.semver))return!1}if(!F.operator&&(G||W)&&Y!==0)return!1}if(W&&U&&!G&&Y!==0)return!1;if(G&&V&&!W&&Y!==0)return!1;if(B||q)return!1;return!0},GU=(Z,X,Q)=>{if(!Z)return X;let J=fX(Z.semver,X.semver,Q);return J>0?Z:J<0?X:X.operator===">"&&Z.operator===">="?X:Z},YU=(Z,X,Q)=>{if(!Z)return X;let J=fX(Z.semver,X.semver,Q);return J<0?Z:J>0?X:X.operator==="<"&&Z.operator==="<="?X:Z};$U.exports=AN});var HU=C((hf,VU)=>{var hX=z9(),UU=$9(),DN=X6(),KU=EX(),TN=J4(),wN=x$(),jN=v$(),ON=f$(),EN=m$(),RN=l$(),PN=p$(),CN=n$(),SN=a$(),_N=m6(),kN=e$(),xN=Xz(),bN=h5(),vN=Gz(),yN=$z(),gN=e9(),fN=u5(),hN=PX(),uN=CX(),mN=m5(),dN=d5(),lN=SX(),cN=Lz(),pN=Az(),iN=X8(),nN=d6(),rN=J8(),aN=bz(),oN=yz(),sN=fz(),tN=mz(),eN=lz(),ZD=i5(),XD=az(),QD=sz(),JD=ZU(),WD=QU(),GD=zU();VU.exports={parse:TN,valid:wN,clean:jN,inc:ON,diff:EN,major:RN,minor:PN,patch:CN,prerelease:SN,compare:_N,rcompare:kN,compareLoose:xN,compareBuild:bN,sort:vN,rsort:yN,gt:gN,lt:fN,eq:hN,neq:uN,gte:mN,lte:dN,cmp:lN,coerce:cN,truncate:pN,Comparator:iN,Range:nN,satisfies:rN,toComparators:aN,maxSatisfying:oN,minSatisfying:sN,minVersion:tN,validRange:eN,outside:ZD,gtr:XD,ltr:QD,intersects:JD,simplifyRange:WD,subset:GD,SemVer:DN,re:hX.re,src:hX.src,tokens:hX.t,SEMVER_SPEC_VERSION:UU.SEMVER_SPEC_VERSION,RELEASE_TYPES:UU.RELEASE_TYPES,compareIdentifiers:KU.compareIdentifiers,rcompareIdentifiers:KU.rcompareIdentifiers}});var x1;var n5=s(()=>{x1={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 W8}from"node:child_process";import{createHash as $D}from"node:crypto";var G8,mX,zD,BU,UD,dX,KD=(Z)=>{if(Z instanceof Error)console.error(`sharp: Installation error: ${Z.message}`);else console.log(`sharp: ${Z}`)},FU=()=>mX.default.isNonGlibcLinuxSync()?mX.default.familySync():"",VD=()=>`${process.platform}${FU()}-${process.arch}`,U9=()=>{if(LU())return"wasm32";let{npm_config_arch:Z,npm_config_platform:X,npm_config_libc:Q}=process.env,J=typeof Q==="string"?Q:FU();return`${X||process.platform}${J}-${Z||process.arch}`},HD=()=>{try{return w0(`@img/sharp-libvips-dev-${U9()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},qD=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},BD=()=>{try{return w0(`@img/sharp-libvips-dev-${U9()}/lib`)}catch{try{return w0(`@img/sharp-libvips-${U9()}/lib`)}catch{}}return""},FD=()=>{if(process.release?.name==="node"&&process.versions){if(!G8.default.satisfies(process.versions.node,x1.engines.node))return{found:process.versions.node,expected:x1.engines.node}}},LU=()=>{let{CC:Z}=process.env;return Boolean(Z?.endsWith("/emcc"))},LD=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(W8("sysctl sysctl.proc_translated",dX).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},qU=(Z)=>$D("sha512").update(Z).digest("hex"),MD=()=>{try{let Z=qU(`imgsharp-libvips-${U9()}`),X=G8.default.coerce(x1.optionalDependencies[`@img/sharp-libvips-${U9()}`],{includePrerelease:!0}).version;return qU(`${Z}npm:${X}`).slice(0,10)}catch{}return""},AD=()=>W8(`node-gyp rebuild --directory=src ${LU()?"--nodedir=emscripten":""}`,{...dX,stdio:"inherit"}).status,MU=()=>{if(process.platform!=="win32")return(W8("pkg-config --modversion vips-cpp",{...dX,env:{...process.env,PKG_CONFIG_PATH:AU()}}).stdout||"").trim();else return""},ID=()=>{try{let Z=(W8("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(Z)return`${Z}/lib/pkgconfig`}catch(Z){}return},ND=()=>{try{let Z=(W8("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(Z)return Z}catch(Z){}return},AU=()=>{if(process.platform!=="win32")return[ID(),ND(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},uX=(Z,X,Q)=>{if(Q)Q(`Detected ${X}, skipping search for globally-installed libvips`);return Z},DD=(Z)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return uX(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",Z);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return uX(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",Z);if(LD())return uX(!1,"Rosetta",Z);let X=MU();return!!X&&G8.default.gte(X,BU)},r5;var lX=s(()=>{n5();G8=J1(HU(),1),mX=J1(x5(),1);/*!
|
|
216
288
|
Copyright 2013 Lovell Fuller and others.
|
|
217
289
|
SPDX-License-Identifier: Apache-2.0
|
|
218
|
-
*/
|
|
290
|
+
*/zD=process.env.npm_package_config_libvips||x1.config.libvips,BU=G8.default.coerce(zD).version,UD=["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"],dX={encoding:"utf8",shell:!0},r5={minimumLibvipsVersion:BU,prebuiltPlatforms:UD,buildPlatformArch:U9,buildSharpLibvipsIncludeDir:HD,buildSharpLibvipsCPlusPlusDir:qD,buildSharpLibvipsLibDir:BD,isUnsupportedNodeRuntime:FD,runtimePlatformArch:VD,log:KD,yarnLocator:MD,spawnRebuild:AD,globalLibvipsVersion:MU,pkgConfigPath:AU,useGlobalLibvips:DD}});import{createRequire as TD}from"node:module";var a5,n0,NU,wD,IU,jD,OD,b1,R0,W4,E0;var Y8=s(()=>{lX();n5();a5=J1(x5(),1);/*!
|
|
219
291
|
Copyright 2013 Lovell Fuller and others.
|
|
220
292
|
SPDX-License-Identifier: Apache-2.0
|
|
221
|
-
*/
|
|
222
|
-
`))}
|
|
293
|
+
*/n0=TD(import.meta.url),{version:NU}=x1,{runtimePlatformArch:wD,isUnsupportedNodeRuntime:IU,prebuiltPlatforms:jD,minimumLibvipsVersion:OD}=r5,b1=wD(),W4=[];try{R0=n0(`../src/build/Release/sharp-${b1}-${NU}.node`)}catch(Z){W4.push(Z)}if(!R0)try{R0=n0(`../src/build/Release/sharp-wasm32-${NU}.node`)}catch(Z){W4.push(Z)}if(!R0)try{switch(b1){case"darwin-arm64":R0=n0("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":R0=n0("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":R0=n0("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":R0=n0("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":R0=n0("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":R0=n0("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":R0=n0("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":R0=n0("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":R0=n0("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":R0=n0("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":R0=n0("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":R0=n0("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":R0=n0("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":R0=n0("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":R0=n0("@img/sharp-webcontainers-wasm32/sharp.node");break}if(R0&&["linux-x64","linuxmusl-x64"].includes(b1)&&!R0._isUsingX64V2()){let Z=Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");Z.code="Unsupported CPU",W4.push(Z),R0=null}if(R0&&process.versions.electron&&b1.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){W4.push(Z)}if(!R0)try{R0=n0("@img/sharp-wasm32/sharp.node")}catch(Z){W4.push(Z)}if(!R0){let[Z,X,Q]=["linux","darwin","win32"].map((G)=>b1.startsWith(G)),J=[`Could not load the "sharp" module using the ${b1} runtime`];W4.forEach((G)=>{if(!G.code.endsWith("MODULE_NOT_FOUND"))J.push(`${G.code}: ${G.message}`)});let W=W4.map((G)=>G.message).join(" ");if(J.push("Possible solutions:"),IU()){let{found:G,expected:Y}=IU();J.push("- Please upgrade Node.js:",` Found ${G}`,` Requires ${Y}`)}else if(jD.includes(b1)){let[G,Y]=b1.split("-"),$=G.endsWith("musl")?" --libc=musl":"";J.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","")}${$} --cpu=${Y} sharp`)}else J.push(`- Manually install libvips >= ${OD}`," 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(W))try{let{config:G}=n0(`@img/sharp-libvips-${b1}/package`),Y=`${a5.familySync()} ${a5.versionSync()}`,$=`${G.musl?"musl":"glibc"} ${G.musl||G.glibc}`;J.push("- Update your OS:",` Found ${Y}`,` Requires ${$}`)}catch(G){}if(Z&&/\/snap\/core[0-9]{2}/.test(W))J.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(X&&/Incompatible library version/.test(W))J.push("- Update Homebrew:"," brew update && brew upgrade vips");if(W4.some((G)=>G.code==="ERR_DLOPEN_DISABLED"))J.push("- Run Node.js without using the --no-addons flag");if(Q&&/The specified procedure could not be found/.test(W))J.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 J.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),Error(J.join(`
|
|
294
|
+
`))}E0=R0});import ED from"node:util";import cX from"node:stream";function CD(){let Z=this.constructor.call(),{debuglog:X,queueListener:Q,...J}=this.options;if(Z.options=structuredClone(J),Z.options.debuglog=X,Z.options.queueListener=Q,this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),Z.options.input.buffer=this.options.input.buffer,Z.emit("finish")});return Z}var RD,PD=(Z)=>{P4.queue.emit("change",Z)},P4=function(Z,X){if(arguments.length===1&&!K.defined(Z))throw Error("Invalid input");if(!(this instanceof P4))return new P4(Z,X);return cX.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:0.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:(Q)=>{this.emit("warning",Q),RD(Q)},queueListener:PD},this.options.input=this._createInputDescriptor(Z,X,{allowStream:!0}),this},L1;var DU=s(()=>{V1();Y8();/*!
|
|
223
295
|
Copyright 2013 Lovell Fuller and others.
|
|
224
296
|
SPDX-License-Identifier: Apache-2.0
|
|
225
|
-
*/FI=HI.debuglog("sharp");Object.setPrototypeOf(d6.prototype,P7.Duplex.prototype);Object.setPrototypeOf(d6,P7.Duplex);Object.assign(d6.prototype,{clone:AI});u4=d6});function Nz(Z){let X=II.filter((Q)=>$.defined(Z[Q])).map((Q)=>[Q,Z[Q]]);return X.length?Object.fromEntries(X):void 0}function NI(Z,X,Q){let W={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if($.string(Z))W.file=Z;else if($.buffer(Z)){if(Z.length===0)throw Error("Input Buffer is empty");W.buffer=Z}else if($.arrayBuffer(Z)){if(Z.byteLength===0)throw Error("Input bit Array is empty");W.buffer=Buffer.from(Z,0,Z.byteLength)}else if($.typedArray(Z)){if(Z.length===0)throw Error("Input Bit Array is empty");W.buffer=Buffer.from(Z.buffer,Z.byteOffset,Z.byteLength)}else if($.plainObject(Z)&&!$.defined(X)){if(X=Z,Nz(X))W.buffer=[]}else if(!$.defined(Z)&&!$.defined(X)&&$.object(Q)&&Q.allowStream)W.buffer=[];else if(Array.isArray(Z))if(Z.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=Z.map((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}${$.defined(X)?` when also providing options of type ${typeof X}`:""}`);if($.object(X)){if($.defined(X.failOn))if($.string(X.failOn)&&$.inArray(X.failOn,["none","truncated","error","warning"]))W.failOn=X.failOn;else throw $.invalidParameterError("failOn","one of: none, truncated, error, warning",X.failOn);if($.defined(X.autoOrient))if($.bool(X.autoOrient))W.autoOrient=X.autoOrient;else throw $.invalidParameterError("autoOrient","boolean",X.autoOrient);if($.defined(X.density))if($.number(X.density)&&$.inRange(X.density,1,1e5))W.density=X.density;else throw $.invalidParameterError("density","number between 1 and 100000",X.density);if($.defined(X.ignoreIcc))if($.bool(X.ignoreIcc))W.ignoreIcc=X.ignoreIcc;else throw $.invalidParameterError("ignoreIcc","boolean",X.ignoreIcc);if($.defined(X.limitInputPixels))if($.bool(X.limitInputPixels))W.limitInputPixels=X.limitInputPixels?268402689:0;else if($.integer(X.limitInputPixels)&&$.inRange(X.limitInputPixels,0,Number.MAX_SAFE_INTEGER))W.limitInputPixels=X.limitInputPixels;else throw $.invalidParameterError("limitInputPixels","positive integer",X.limitInputPixels);if($.defined(X.limitInputChannels))if($.bool(X.limitInputChannels))W.limitInputChannels=X.limitInputChannels?5:0;else if($.integer(X.limitInputChannels)&&$.inRange(X.limitInputChannels,0,Number.MAX_SAFE_INTEGER))W.limitInputChannels=X.limitInputChannels;else throw $.invalidParameterError("limitInputChannels","positive integer",X.limitInputChannels);if($.defined(X.unlimited))if($.bool(X.unlimited))W.unlimited=X.unlimited;else throw $.invalidParameterError("unlimited","boolean",X.unlimited);if($.defined(X.sequentialRead))if($.bool(X.sequentialRead))W.sequentialRead=X.sequentialRead;else throw $.invalidParameterError("sequentialRead","boolean",X.sequentialRead);if($.defined(X.raw)){if($.object(X.raw)&&$.integer(X.raw.width)&&$.inRange(X.raw.width,1,1e8)&&$.integer(X.raw.height)&&$.inRange(X.raw.height,1,1e8)&&$.integer(X.raw.channels)&&$.inRange(X.raw.channels,1,4))switch(W.rawWidth=X.raw.width,W.rawHeight=X.raw.height,W.rawChannels=X.raw.channels,Z.constructor){case Uint8Array:case Uint8ClampedArray:W.rawDepth="uchar";break;case Int8Array:W.rawDepth="char";break;case Uint16Array:W.rawDepth="ushort";break;case Int16Array:W.rawDepth="short";break;case Uint32Array:W.rawDepth="uint";break;case Int32Array:W.rawDepth="int";break;case Float32Array:W.rawDepth="float";break;case Float64Array:W.rawDepth="double";break;default:W.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(W.rawPremultiplied=!1,$.defined(X.raw.premultiplied))if($.bool(X.raw.premultiplied))W.rawPremultiplied=X.raw.premultiplied;else throw $.invalidParameterError("raw.premultiplied","boolean",X.raw.premultiplied);if(W.rawPageHeight=0,$.defined(X.raw.pageHeight))if($.integer(X.raw.pageHeight)&&X.raw.pageHeight>0&&X.raw.pageHeight<=X.raw.height){if(X.raw.height%X.raw.pageHeight!==0)throw Error(`Expected raw.height ${X.raw.height} to be a multiple of raw.pageHeight ${X.raw.pageHeight}`);W.rawPageHeight=X.raw.pageHeight}else throw $.invalidParameterError("raw.pageHeight","positive integer",X.raw.pageHeight)}if($.defined(X.animated))if($.bool(X.animated))W.pages=X.animated?-1:1;else throw $.invalidParameterError("animated","boolean",X.animated);if($.defined(X.pages))if($.integer(X.pages)&&$.inRange(X.pages,-1,1e5))W.pages=X.pages;else throw $.invalidParameterError("pages","integer between -1 and 100000",X.pages);if($.defined(X.page))if($.integer(X.page)&&$.inRange(X.page,0,1e5))W.page=X.page;else throw $.invalidParameterError("page","integer between 0 and 100000",X.page);if($.object(X.openSlide)&&$.defined(X.openSlide.level))if($.integer(X.openSlide.level)&&$.inRange(X.openSlide.level,0,256))W.openSlideLevel=X.openSlide.level;else throw $.invalidParameterError("openSlide.level","integer between 0 and 256",X.openSlide.level);else if($.defined(X.level))if($.integer(X.level)&&$.inRange(X.level,0,256))W.openSlideLevel=X.level;else throw $.invalidParameterError("level","integer between 0 and 256",X.level);if($.object(X.tiff)&&$.defined(X.tiff.subifd))if($.integer(X.tiff.subifd)&&$.inRange(X.tiff.subifd,-1,1e5))W.tiffSubifd=X.tiff.subifd;else throw $.invalidParameterError("tiff.subifd","integer between -1 and 100000",X.tiff.subifd);else if($.defined(X.subifd))if($.integer(X.subifd)&&$.inRange(X.subifd,-1,1e5))W.tiffSubifd=X.subifd;else throw $.invalidParameterError("subifd","integer between -1 and 100000",X.subifd);if($.object(X.svg)){if($.defined(X.svg.stylesheet))if($.string(X.svg.stylesheet))W.svgStylesheet=X.svg.stylesheet;else throw $.invalidParameterError("svg.stylesheet","string",X.svg.stylesheet);if($.defined(X.svg.highBitdepth))if($.bool(X.svg.highBitdepth))W.svgHighBitdepth=X.svg.highBitdepth;else throw $.invalidParameterError("svg.highBitdepth","boolean",X.svg.highBitdepth)}if($.object(X.pdf)&&$.defined(X.pdf.background))W.pdfBackground=this._getBackgroundColourOption(X.pdf.background);else if($.defined(X.pdfBackground))W.pdfBackground=this._getBackgroundColourOption(X.pdfBackground);if($.object(X.jp2)&&$.defined(X.jp2.oneshot))if($.bool(X.jp2.oneshot))W.jp2Oneshot=X.jp2.oneshot;else throw $.invalidParameterError("jp2.oneshot","boolean",X.jp2.oneshot);if($.defined(X.create))if($.object(X.create)&&$.integer(X.create.width)&&$.inRange(X.create.width,1,1e8)&&$.integer(X.create.height)&&$.inRange(X.create.height,1,1e8)&&$.integer(X.create.channels)){if(W.createWidth=X.create.width,W.createHeight=X.create.height,W.createChannels=X.create.channels,W.createPageHeight=0,$.defined(X.create.pageHeight))if($.integer(X.create.pageHeight)&&X.create.pageHeight>0&&X.create.pageHeight<=X.create.height){if(X.create.height%X.create.pageHeight!==0)throw Error(`Expected create.height ${X.create.height} to be a multiple of create.pageHeight ${X.create.pageHeight}`);W.createPageHeight=X.create.pageHeight}else throw $.invalidParameterError("create.pageHeight","positive integer",X.create.pageHeight);if($.defined(X.create.noise)){if(!$.object(X.create.noise))throw Error("Expected noise to be an object");if(X.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(W.createNoiseType=X.create.noise.type,!$.inRange(X.create.channels,1,4))throw $.invalidParameterError("create.channels","number between 1 and 4",X.create.channels);if(W.createNoiseMean=128,$.defined(X.create.noise.mean))if($.number(X.create.noise.mean)&&$.inRange(X.create.noise.mean,0,1e4))W.createNoiseMean=X.create.noise.mean;else throw $.invalidParameterError("create.noise.mean","number between 0 and 10000",X.create.noise.mean);if(W.createNoiseSigma=30,$.defined(X.create.noise.sigma))if($.number(X.create.noise.sigma)&&$.inRange(X.create.noise.sigma,0,1e4))W.createNoiseSigma=X.create.noise.sigma;else throw $.invalidParameterError("create.noise.sigma","number between 0 and 10000",X.create.noise.sigma)}else if($.defined(X.create.background)){if(!$.inRange(X.create.channels,3,4))throw $.invalidParameterError("create.channels","number between 3 and 4",X.create.channels);W.createBackground=this._getBackgroundColourOption(X.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete W.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if($.defined(X.text))if($.object(X.text)&&$.string(X.text.text)){if(W.textValue=X.text.text,$.defined(X.text.height)&&$.defined(X.text.dpi))throw Error("Expected only one of dpi or height");if($.defined(X.text.font))if($.string(X.text.font))W.textFont=X.text.font;else throw $.invalidParameterError("text.font","string",X.text.font);if($.defined(X.text.fontfile))if($.string(X.text.fontfile))W.textFontfile=X.text.fontfile;else throw $.invalidParameterError("text.fontfile","string",X.text.fontfile);if($.defined(X.text.width))if($.integer(X.text.width)&&$.inRange(X.text.width,1,1e6))W.textWidth=X.text.width;else throw $.invalidParameterError("text.width","integer between 1 and 1000000",X.text.width);if($.defined(X.text.height))if($.integer(X.text.height)&&$.inRange(X.text.height,1,1e6))W.textHeight=X.text.height;else throw $.invalidParameterError("text.height","integer between 1 and 1000000",X.text.height);if($.defined(X.text.align))if($.string(X.text.align)&&$.string(this.constructor.align[X.text.align]))W.textAlign=this.constructor.align[X.text.align];else throw $.invalidParameterError("text.align","valid alignment",X.text.align);if($.defined(X.text.justify))if($.bool(X.text.justify))W.textJustify=X.text.justify;else throw $.invalidParameterError("text.justify","boolean",X.text.justify);if($.defined(X.text.dpi))if($.integer(X.text.dpi)&&$.inRange(X.text.dpi,1,1e6))W.textDpi=X.text.dpi;else throw $.invalidParameterError("text.dpi","integer between 1 and 1000000",X.text.dpi);if($.defined(X.text.rgba))if($.bool(X.text.rgba))W.textRgba=X.text.rgba;else throw $.invalidParameterError("text.rgba","bool",X.text.rgba);if($.defined(X.text.spacing))if($.integer(X.text.spacing)&&$.inRange(X.text.spacing,-1e6,1e6))W.textSpacing=X.text.spacing;else throw $.invalidParameterError("text.spacing","integer between -1000000 and 1000000",X.text.spacing);if($.defined(X.text.wrap))if($.string(X.text.wrap)&&$.inArray(X.text.wrap,["word","char","word-char","none"]))W.textWrap=X.text.wrap;else throw $.invalidParameterError("text.wrap","one of: word, char, word-char, none",X.text.wrap);delete W.buffer}else throw Error("Expected a valid string to create an image with text.");if($.defined(X.join))if($.defined(this.options.join)){if($.defined(X.join.animated))if($.bool(X.join.animated))W.joinAnimated=X.join.animated;else throw $.invalidParameterError("join.animated","boolean",X.join.animated);if($.defined(X.join.across))if($.integer(X.join.across)&&$.inRange(X.join.across,1,1e6))W.joinAcross=X.join.across;else throw $.invalidParameterError("join.across","integer between 1 and 100000",X.join.across);if($.defined(X.join.shim))if($.integer(X.join.shim)&&$.inRange(X.join.shim,0,1e6))W.joinShim=X.join.shim;else throw $.invalidParameterError("join.shim","integer between 0 and 100000",X.join.shim);if($.defined(X.join.background))W.joinBackground=this._getBackgroundColourOption(X.join.background);if($.defined(X.join.halign))if($.string(X.join.halign)&&$.string(this.constructor.align[X.join.halign]))W.joinHalign=this.constructor.align[X.join.halign];else throw $.invalidParameterError("join.halign","valid alignment",X.join.halign);if($.defined(X.join.valign))if($.string(X.join.valign)&&$.string(this.constructor.align[X.join.valign]))W.joinValign=this.constructor.align[X.join.valign];else throw $.invalidParameterError("join.valign","valid alignment",X.join.valign)}else throw Error("Expected input to be an array of images to join")}else if($.defined(X))throw Error(`Invalid input options ${X}`);return W}function DI(Z,X,Q){if(Array.isArray(this.options.input.buffer))if($.buffer(Z)){if(this.options.input.buffer.length===0)this.on("finish",()=>{this.streamInFinished=!0});this.options.input.buffer.push(Z),Q()}else Q(Error("Non-Buffer data on Writable Stream"));else Q(Error("Unexpected data on Writable Stream"))}function TI(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function wI(){return Array.isArray(this.options.input.buffer)}function jI(Z){let X=Error();if($.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),q0.metadata(this.options,(Q,W)=>{if(Q)Z($.nativeError(Q,X));else Z(null,W)})});else q0.metadata(this.options,(Q,W)=>{if(Q)Z($.nativeError(Q,X));else Z(null,W)});return this}else if(this._isStreamInput())return new Promise((Q,W)=>{let J=()=>{this._flattenBufferIn(),q0.metadata(this.options,(G,Y)=>{if(G)W($.nativeError(G,X));else Q(Y)})};if(this.writableFinished)J();else this.once("finish",J)});else return new Promise((Q,W)=>{q0.metadata(this.options,(J,G)=>{if(J)W($.nativeError(J,X));else Q(G)})})}function OI(Z){let X=Error();if($.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),q0.stats(this.options,(Q,W)=>{if(Q)Z($.nativeError(Q,X));else Z(null,W)})});else q0.stats(this.options,(Q,W)=>{if(Q)Z($.nativeError(Q,X));else Z(null,W)});return this}else if(this._isStreamInput())return new Promise((Q,W)=>{this.on("finish",function(){this._flattenBufferIn(),q0.stats(this.options,(J,G)=>{if(J)W($.nativeError(J,X));else Q(G)})})});else return new Promise((Q,W)=>{q0.stats(this.options,(J,G)=>{if(J)W($.nativeError(J,X));else Q(G)})})}var MI,II,Dz=(Z)=>{Object.assign(Z.prototype,{_inputOptionsFromObject:Nz,_createInputDescriptor:NI,_write:DI,_flattenBufferIn:TI,_isStreamInput:wI,metadata:jI,stats:OI}),Z.align=MI};var Tz=c(()=>{v4();B9();/*!
|
|
297
|
+
*/RD=ED.debuglog("sharp");Object.setPrototypeOf(P4.prototype,cX.Duplex.prototype);Object.setPrototypeOf(P4,cX.Duplex);Object.assign(P4.prototype,{clone:CD});L1=P4});function TU(Z){let X=_D.filter((Q)=>K.defined(Z[Q])).map((Q)=>[Q,Z[Q]]);return X.length?Object.fromEntries(X):void 0}function kD(Z,X,Q){let J={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(K.string(Z))J.file=Z;else if(K.buffer(Z)){if(Z.length===0)throw Error("Input Buffer is empty");J.buffer=Z}else if(K.arrayBuffer(Z)){if(Z.byteLength===0)throw Error("Input bit Array is empty");J.buffer=Buffer.from(Z,0,Z.byteLength)}else if(K.typedArray(Z)){if(Z.length===0)throw Error("Input Bit Array is empty");J.buffer=Buffer.from(Z.buffer,Z.byteOffset,Z.byteLength)}else if(K.plainObject(Z)&&!K.defined(X)){if(X=Z,TU(X))J.buffer=[]}else if(!K.defined(Z)&&!K.defined(X)&&K.object(Q)&&Q.allowStream)J.buffer=[];else if(Array.isArray(Z))if(Z.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=Z.map((W)=>this._createInputDescriptor(W));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}${K.defined(X)?` when also providing options of type ${typeof X}`:""}`);if(K.object(X)){if(K.defined(X.failOn))if(K.string(X.failOn)&&K.inArray(X.failOn,["none","truncated","error","warning"]))J.failOn=X.failOn;else throw K.invalidParameterError("failOn","one of: none, truncated, error, warning",X.failOn);if(K.defined(X.autoOrient))if(K.bool(X.autoOrient))J.autoOrient=X.autoOrient;else throw K.invalidParameterError("autoOrient","boolean",X.autoOrient);if(K.defined(X.density))if(K.number(X.density)&&K.inRange(X.density,1,1e5))J.density=X.density;else throw K.invalidParameterError("density","number between 1 and 100000",X.density);if(K.defined(X.ignoreIcc))if(K.bool(X.ignoreIcc))J.ignoreIcc=X.ignoreIcc;else throw K.invalidParameterError("ignoreIcc","boolean",X.ignoreIcc);if(K.defined(X.limitInputPixels))if(K.bool(X.limitInputPixels))J.limitInputPixels=X.limitInputPixels?268402689:0;else if(K.integer(X.limitInputPixels)&&K.inRange(X.limitInputPixels,0,Number.MAX_SAFE_INTEGER))J.limitInputPixels=X.limitInputPixels;else throw K.invalidParameterError("limitInputPixels","positive integer",X.limitInputPixels);if(K.defined(X.limitInputChannels))if(K.bool(X.limitInputChannels))J.limitInputChannels=X.limitInputChannels?5:0;else if(K.integer(X.limitInputChannels)&&K.inRange(X.limitInputChannels,0,Number.MAX_SAFE_INTEGER))J.limitInputChannels=X.limitInputChannels;else throw K.invalidParameterError("limitInputChannels","positive integer",X.limitInputChannels);if(K.defined(X.unlimited))if(K.bool(X.unlimited))J.unlimited=X.unlimited;else throw K.invalidParameterError("unlimited","boolean",X.unlimited);if(K.defined(X.sequentialRead))if(K.bool(X.sequentialRead))J.sequentialRead=X.sequentialRead;else throw K.invalidParameterError("sequentialRead","boolean",X.sequentialRead);if(K.defined(X.raw)){if(K.object(X.raw)&&K.integer(X.raw.width)&&K.inRange(X.raw.width,1,1e8)&&K.integer(X.raw.height)&&K.inRange(X.raw.height,1,1e8)&&K.integer(X.raw.channels)&&K.inRange(X.raw.channels,1,4))switch(J.rawWidth=X.raw.width,J.rawHeight=X.raw.height,J.rawChannels=X.raw.channels,Z.constructor){case Uint8Array:case Uint8ClampedArray:J.rawDepth="uchar";break;case Int8Array:J.rawDepth="char";break;case Uint16Array:J.rawDepth="ushort";break;case Int16Array:J.rawDepth="short";break;case Uint32Array:J.rawDepth="uint";break;case Int32Array:J.rawDepth="int";break;case Float32Array:J.rawDepth="float";break;case Float64Array:J.rawDepth="double";break;default:J.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(J.rawPremultiplied=!1,K.defined(X.raw.premultiplied))if(K.bool(X.raw.premultiplied))J.rawPremultiplied=X.raw.premultiplied;else throw K.invalidParameterError("raw.premultiplied","boolean",X.raw.premultiplied);if(J.rawPageHeight=0,K.defined(X.raw.pageHeight))if(K.integer(X.raw.pageHeight)&&X.raw.pageHeight>0&&X.raw.pageHeight<=X.raw.height){if(X.raw.height%X.raw.pageHeight!==0)throw Error(`Expected raw.height ${X.raw.height} to be a multiple of raw.pageHeight ${X.raw.pageHeight}`);J.rawPageHeight=X.raw.pageHeight}else throw K.invalidParameterError("raw.pageHeight","positive integer",X.raw.pageHeight)}if(K.defined(X.animated))if(K.bool(X.animated))J.pages=X.animated?-1:1;else throw K.invalidParameterError("animated","boolean",X.animated);if(K.defined(X.pages))if(K.integer(X.pages)&&K.inRange(X.pages,-1,1e5))J.pages=X.pages;else throw K.invalidParameterError("pages","integer between -1 and 100000",X.pages);if(K.defined(X.page))if(K.integer(X.page)&&K.inRange(X.page,0,1e5))J.page=X.page;else throw K.invalidParameterError("page","integer between 0 and 100000",X.page);if(K.object(X.openSlide)&&K.defined(X.openSlide.level))if(K.integer(X.openSlide.level)&&K.inRange(X.openSlide.level,0,256))J.openSlideLevel=X.openSlide.level;else throw K.invalidParameterError("openSlide.level","integer between 0 and 256",X.openSlide.level);else if(K.defined(X.level))if(K.integer(X.level)&&K.inRange(X.level,0,256))J.openSlideLevel=X.level;else throw K.invalidParameterError("level","integer between 0 and 256",X.level);if(K.object(X.tiff)&&K.defined(X.tiff.subifd))if(K.integer(X.tiff.subifd)&&K.inRange(X.tiff.subifd,-1,1e5))J.tiffSubifd=X.tiff.subifd;else throw K.invalidParameterError("tiff.subifd","integer between -1 and 100000",X.tiff.subifd);else if(K.defined(X.subifd))if(K.integer(X.subifd)&&K.inRange(X.subifd,-1,1e5))J.tiffSubifd=X.subifd;else throw K.invalidParameterError("subifd","integer between -1 and 100000",X.subifd);if(K.object(X.svg)){if(K.defined(X.svg.stylesheet))if(K.string(X.svg.stylesheet))J.svgStylesheet=X.svg.stylesheet;else throw K.invalidParameterError("svg.stylesheet","string",X.svg.stylesheet);if(K.defined(X.svg.highBitdepth))if(K.bool(X.svg.highBitdepth))J.svgHighBitdepth=X.svg.highBitdepth;else throw K.invalidParameterError("svg.highBitdepth","boolean",X.svg.highBitdepth)}if(K.object(X.pdf)&&K.defined(X.pdf.background))J.pdfBackground=this._getBackgroundColourOption(X.pdf.background);else if(K.defined(X.pdfBackground))J.pdfBackground=this._getBackgroundColourOption(X.pdfBackground);if(K.object(X.jp2)&&K.defined(X.jp2.oneshot))if(K.bool(X.jp2.oneshot))J.jp2Oneshot=X.jp2.oneshot;else throw K.invalidParameterError("jp2.oneshot","boolean",X.jp2.oneshot);if(K.defined(X.create))if(K.object(X.create)&&K.integer(X.create.width)&&K.inRange(X.create.width,1,1e8)&&K.integer(X.create.height)&&K.inRange(X.create.height,1,1e8)&&K.integer(X.create.channels)){if(J.createWidth=X.create.width,J.createHeight=X.create.height,J.createChannels=X.create.channels,J.createPageHeight=0,K.defined(X.create.pageHeight))if(K.integer(X.create.pageHeight)&&X.create.pageHeight>0&&X.create.pageHeight<=X.create.height){if(X.create.height%X.create.pageHeight!==0)throw Error(`Expected create.height ${X.create.height} to be a multiple of create.pageHeight ${X.create.pageHeight}`);J.createPageHeight=X.create.pageHeight}else throw K.invalidParameterError("create.pageHeight","positive integer",X.create.pageHeight);if(K.defined(X.create.noise)){if(!K.object(X.create.noise))throw Error("Expected noise to be an object");if(X.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(J.createNoiseType=X.create.noise.type,!K.inRange(X.create.channels,1,4))throw K.invalidParameterError("create.channels","number between 1 and 4",X.create.channels);if(J.createNoiseMean=128,K.defined(X.create.noise.mean))if(K.number(X.create.noise.mean)&&K.inRange(X.create.noise.mean,0,1e4))J.createNoiseMean=X.create.noise.mean;else throw K.invalidParameterError("create.noise.mean","number between 0 and 10000",X.create.noise.mean);if(J.createNoiseSigma=30,K.defined(X.create.noise.sigma))if(K.number(X.create.noise.sigma)&&K.inRange(X.create.noise.sigma,0,1e4))J.createNoiseSigma=X.create.noise.sigma;else throw K.invalidParameterError("create.noise.sigma","number between 0 and 10000",X.create.noise.sigma)}else if(K.defined(X.create.background)){if(!K.inRange(X.create.channels,3,4))throw K.invalidParameterError("create.channels","number between 3 and 4",X.create.channels);J.createBackground=this._getBackgroundColourOption(X.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete J.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(K.defined(X.text))if(K.object(X.text)&&K.string(X.text.text)){if(J.textValue=X.text.text,K.defined(X.text.height)&&K.defined(X.text.dpi))throw Error("Expected only one of dpi or height");if(K.defined(X.text.font))if(K.string(X.text.font))J.textFont=X.text.font;else throw K.invalidParameterError("text.font","string",X.text.font);if(K.defined(X.text.fontfile))if(K.string(X.text.fontfile))J.textFontfile=X.text.fontfile;else throw K.invalidParameterError("text.fontfile","string",X.text.fontfile);if(K.defined(X.text.width))if(K.integer(X.text.width)&&K.inRange(X.text.width,1,1e6))J.textWidth=X.text.width;else throw K.invalidParameterError("text.width","integer between 1 and 1000000",X.text.width);if(K.defined(X.text.height))if(K.integer(X.text.height)&&K.inRange(X.text.height,1,1e6))J.textHeight=X.text.height;else throw K.invalidParameterError("text.height","integer between 1 and 1000000",X.text.height);if(K.defined(X.text.align))if(K.string(X.text.align)&&K.string(this.constructor.align[X.text.align]))J.textAlign=this.constructor.align[X.text.align];else throw K.invalidParameterError("text.align","valid alignment",X.text.align);if(K.defined(X.text.justify))if(K.bool(X.text.justify))J.textJustify=X.text.justify;else throw K.invalidParameterError("text.justify","boolean",X.text.justify);if(K.defined(X.text.dpi))if(K.integer(X.text.dpi)&&K.inRange(X.text.dpi,1,1e6))J.textDpi=X.text.dpi;else throw K.invalidParameterError("text.dpi","integer between 1 and 1000000",X.text.dpi);if(K.defined(X.text.rgba))if(K.bool(X.text.rgba))J.textRgba=X.text.rgba;else throw K.invalidParameterError("text.rgba","bool",X.text.rgba);if(K.defined(X.text.spacing))if(K.integer(X.text.spacing)&&K.inRange(X.text.spacing,-1e6,1e6))J.textSpacing=X.text.spacing;else throw K.invalidParameterError("text.spacing","integer between -1000000 and 1000000",X.text.spacing);if(K.defined(X.text.wrap))if(K.string(X.text.wrap)&&K.inArray(X.text.wrap,["word","char","word-char","none"]))J.textWrap=X.text.wrap;else throw K.invalidParameterError("text.wrap","one of: word, char, word-char, none",X.text.wrap);delete J.buffer}else throw Error("Expected a valid string to create an image with text.");if(K.defined(X.join))if(K.defined(this.options.join)){if(K.defined(X.join.animated))if(K.bool(X.join.animated))J.joinAnimated=X.join.animated;else throw K.invalidParameterError("join.animated","boolean",X.join.animated);if(K.defined(X.join.across))if(K.integer(X.join.across)&&K.inRange(X.join.across,1,1e6))J.joinAcross=X.join.across;else throw K.invalidParameterError("join.across","integer between 1 and 100000",X.join.across);if(K.defined(X.join.shim))if(K.integer(X.join.shim)&&K.inRange(X.join.shim,0,1e6))J.joinShim=X.join.shim;else throw K.invalidParameterError("join.shim","integer between 0 and 100000",X.join.shim);if(K.defined(X.join.background))J.joinBackground=this._getBackgroundColourOption(X.join.background);if(K.defined(X.join.halign))if(K.string(X.join.halign)&&K.string(this.constructor.align[X.join.halign]))J.joinHalign=this.constructor.align[X.join.halign];else throw K.invalidParameterError("join.halign","valid alignment",X.join.halign);if(K.defined(X.join.valign))if(K.string(X.join.valign)&&K.string(this.constructor.align[X.join.valign]))J.joinValign=this.constructor.align[X.join.valign];else throw K.invalidParameterError("join.valign","valid alignment",X.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(K.defined(X))throw Error(`Invalid input options ${X}`);return J}function xD(Z,X,Q){if(Array.isArray(this.options.input.buffer))if(K.buffer(Z)){if(this.options.input.buffer.length===0)this.on("finish",()=>{this.streamInFinished=!0});this.options.input.buffer.push(Z),Q()}else Q(Error("Non-Buffer data on Writable Stream"));else Q(Error("Unexpected data on Writable Stream"))}function bD(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function vD(){return Array.isArray(this.options.input.buffer)}function yD(Z){let X=Error();if(K.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),E0.metadata(this.options,(Q,J)=>{if(Q)Z(K.nativeError(Q,X));else Z(null,J)})});else E0.metadata(this.options,(Q,J)=>{if(Q)Z(K.nativeError(Q,X));else Z(null,J)});return this}else if(this._isStreamInput())return new Promise((Q,J)=>{let W=()=>{this._flattenBufferIn(),E0.metadata(this.options,(G,Y)=>{if(G)J(K.nativeError(G,X));else Q(Y)})};if(this.writableFinished)W();else this.once("finish",W)});else return new Promise((Q,J)=>{E0.metadata(this.options,(W,G)=>{if(W)J(K.nativeError(W,X));else Q(G)})})}function gD(Z){let X=Error();if(K.fn(Z)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),E0.stats(this.options,(Q,J)=>{if(Q)Z(K.nativeError(Q,X));else Z(null,J)})});else E0.stats(this.options,(Q,J)=>{if(Q)Z(K.nativeError(Q,X));else Z(null,J)});return this}else if(this._isStreamInput())return new Promise((Q,J)=>{this.on("finish",function(){this._flattenBufferIn(),E0.stats(this.options,(W,G)=>{if(W)J(K.nativeError(W,X));else Q(G)})})});else return new Promise((Q,J)=>{E0.stats(this.options,(W,G)=>{if(W)J(K.nativeError(W,X));else Q(G)})})}var SD,_D,wU=(Z)=>{Object.assign(Z.prototype,{_inputOptionsFromObject:TU,_createInputDescriptor:kD,_write:xD,_flattenBufferIn:bD,_isStreamInput:vD,metadata:yD,stats:gD}),Z.align=SD};var jU=s(()=>{V1();Y8();/*!
|
|
226
298
|
Copyright 2013 Lovell Fuller and others.
|
|
227
299
|
SPDX-License-Identifier: Apache-2.0
|
|
228
|
-
*/
|
|
300
|
+
*/SD={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},_D=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"]});function iX(Z){return Z.angle%360!==0||Z.rotationAngle!==0}function o5(Z){return Z.width!==-1||Z.height!==-1}function uD(Z,X,Q){if(o5(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(K.defined(Z))if(K.object(Z)&&!K.defined(Q))Q=Z;else if(K.integer(Z)&&Z>0)this.options.width=Z;else throw K.invalidParameterError("width","positive integer",Z);else this.options.width=-1;if(K.defined(X))if(K.integer(X)&&X>0)this.options.height=X;else throw K.invalidParameterError("height","positive integer",X);else this.options.height=-1;if(K.object(Q)){if(K.defined(Q.width))if(K.integer(Q.width)&&Q.width>0)this.options.width=Q.width;else throw K.invalidParameterError("width","positive integer",Q.width);if(K.defined(Q.height))if(K.integer(Q.height)&&Q.height>0)this.options.height=Q.height;else throw K.invalidParameterError("height","positive integer",Q.height);if(K.defined(Q.fit)){let J=hD[Q.fit];if(K.string(J))this.options.canvas=J;else throw K.invalidParameterError("fit","valid fit",Q.fit)}if(K.defined(Q.position)){let J=K.integer(Q.position)?Q.position:PU[Q.position]||RU[Q.position]||EU[Q.position];if(K.integer(J)&&(K.inRange(J,0,8)||K.inRange(J,16,17)))this.options.position=J;else throw K.invalidParameterError("position","valid position/gravity/strategy",Q.position)}if(this._setBackgroundColourOption("resizeBackground",Q.background),K.defined(Q.kernel))if(K.string(pX[Q.kernel]))this.options.kernel=pX[Q.kernel];else throw K.invalidParameterError("kernel","valid kernel name",Q.kernel);if(K.defined(Q.withoutEnlargement))this._setBooleanOption("withoutEnlargement",Q.withoutEnlargement);if(K.defined(Q.withoutReduction))this._setBooleanOption("withoutReduction",Q.withoutReduction);if(K.defined(Q.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",Q.fastShrinkOnLoad)}if(iX(this.options)&&o5(this.options))this.options.rotateBefore=!0;return this}function mD(Z){if(K.integer(Z))if(K.inRange(Z,1,1e4))this.options.extendTop=Z,this.options.extendBottom=Z,this.options.extendLeft=Z,this.options.extendRight=Z;else throw K.invalidParameterError("extend","integer between 1 and 10000",Z);else if(K.object(Z)){if(K.defined(Z.top))if(K.integer(Z.top)&&K.inRange(Z.top,0,1e4))this.options.extendTop=Z.top;else throw K.invalidParameterError("top","integer between 0 and 10000",Z.top);if(K.defined(Z.bottom))if(K.integer(Z.bottom)&&K.inRange(Z.bottom,0,1e4))this.options.extendBottom=Z.bottom;else throw K.invalidParameterError("bottom","integer between 0 and 10000",Z.bottom);if(K.defined(Z.left))if(K.integer(Z.left)&&K.inRange(Z.left,0,1e4))this.options.extendLeft=Z.left;else throw K.invalidParameterError("left","integer between 0 and 10000",Z.left);if(K.defined(Z.right))if(K.integer(Z.right)&&K.inRange(Z.right,0,1e4))this.options.extendRight=Z.right;else throw K.invalidParameterError("right","integer between 0 and 10000",Z.right);if(this._setBackgroundColourOption("extendBackground",Z.background),K.defined(Z.extendWith))if(K.string(OU[Z.extendWith]))this.options.extendWith=OU[Z.extendWith];else throw K.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",Z.extendWith)}else throw K.invalidParameterError("extend","integer or object",Z);return this}function dD(Z){let X=o5(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${X}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function(Q){let J=Z[Q];if(K.integer(J)&&K.inRange(J,0,1e8))this.options[Q+(Q==="left"||Q==="top"?"Offset":"")+X]=J;else throw K.invalidParameterError(Q,"integer between 0 and 100000000",J)},this),iX(this.options)&&!o5(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 lD(Z){if(this.options.trimThreshold=10,K.defined(Z))if(K.object(Z)){if(K.defined(Z.background))this._setBackgroundColourOption("trimBackground",Z.background);if(K.defined(Z.threshold))if(K.number(Z.threshold)&&Z.threshold>=0)this.options.trimThreshold=Z.threshold;else throw K.invalidParameterError("threshold","positive number",Z.threshold);if(K.defined(Z.lineArt))this._setBooleanOption("trimLineArt",Z.lineArt);if(K.defined(Z.margin))if(K.integer(Z.margin)&&K.inRange(Z.margin,0,1e7))this.options.trimMargin=Z.margin;else throw K.invalidParameterError("margin","integer between 0 and 10000000",Z.margin)}else throw K.invalidParameterError("trim","object",Z);if(iX(this.options))this.options.rotateBefore=!0;return this}var EU,RU,OU,PU,pX,fD,hD,CU=(Z)=>{Object.assign(Z.prototype,{resize:uD,extend:mD,extract:dD,trim:lD}),Z.gravity=EU,Z.strategy=PU,Z.kernel=pX,Z.fit=fD,Z.position=RU};var SU=s(()=>{V1();/*!
|
|
229
301
|
Copyright 2013 Lovell Fuller and others.
|
|
230
302
|
SPDX-License-Identifier: Apache-2.0
|
|
231
|
-
*/
|
|
303
|
+
*/EU={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},RU={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},OU={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},PU={entropy:16,attention:17},pX={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},fD={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},hD={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"}});function cD(Z){if(!Array.isArray(Z))throw K.invalidParameterError("images to composite","array",Z);return this.options.composite=Z.map((X)=>{if(!K.object(X))throw K.invalidParameterError("image to composite","object",X);let Q=this._inputOptionsFromObject(X),J={input:this._createInputDescriptor(X.input,Q,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(K.defined(X.blend))if(K.string(nX[X.blend]))J.blend=nX[X.blend];else throw K.invalidParameterError("blend","valid blend name",X.blend);if(K.defined(X.tile))if(K.bool(X.tile))J.tile=X.tile;else throw K.invalidParameterError("tile","boolean",X.tile);if(K.defined(X.left))if(K.integer(X.left))J.left=X.left;else throw K.invalidParameterError("left","integer",X.left);if(K.defined(X.top))if(K.integer(X.top))J.top=X.top;else throw K.invalidParameterError("top","integer",X.top);if(K.defined(X.top)!==K.defined(X.left))throw Error("Expected both left and top to be set");else J.hasOffset=K.integer(X.top)&&K.integer(X.left);if(K.defined(X.gravity))if(K.integer(X.gravity)&&K.inRange(X.gravity,0,8))J.gravity=X.gravity;else if(K.string(X.gravity)&&K.integer(this.constructor.gravity[X.gravity]))J.gravity=this.constructor.gravity[X.gravity];else throw K.invalidParameterError("gravity","valid gravity",X.gravity);if(K.defined(X.premultiplied))if(K.bool(X.premultiplied))J.premultiplied=X.premultiplied;else throw K.invalidParameterError("premultiplied","boolean",X.premultiplied);return J}),this}var nX,_U=(Z)=>{Z.prototype.composite=cD,Z.blend=nX};var kU=s(()=>{V1();/*!
|
|
232
304
|
Copyright 2013 Lovell Fuller and others.
|
|
233
305
|
SPDX-License-Identifier: Apache-2.0
|
|
234
|
-
*/k7={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 _I(Z,X){if(!$.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($.integer(Z)&&!(Z%90))this.options.angle=Z;else if($.number(Z)){if(this.options.rotationAngle=Z,$.object(X)&&X.background)this._setBackgroundColourOption("rotationBackground",X.background)}else throw $.invalidParameterError("angle","numeric",Z);return this}function xI(){return this.options.input.autoOrient=!0,this}function vI(Z){return this.options.flip=$.bool(Z)?Z:!0,this}function yI(Z){return this.options.flop=$.bool(Z)?Z:!0,this}function gI(Z,X){let W=Array.isArray(Z)&&(Z.length===4&&Z.every($.number)||Z.length===2&&Z.every((J)=>Array.isArray(J)&&J.length===2))?Z.flat():[];if(W.length===4&&W.every($.number))this.options.affineMatrix=W;else throw $.invalidParameterError("matrix","1x4 or 2x2 array",Z);if($.defined(X))if($.object(X)){if(this._setBackgroundColourOption("affineBackground",X.background),$.defined(X.idx))if($.number(X.idx))this.options.affineIdx=X.idx;else throw $.invalidParameterError("options.idx","number",X.idx);if($.defined(X.idy))if($.number(X.idy))this.options.affineIdy=X.idy;else throw $.invalidParameterError("options.idy","number",X.idy);if($.defined(X.odx))if($.number(X.odx))this.options.affineOdx=X.odx;else throw $.invalidParameterError("options.odx","number",X.odx);if($.defined(X.ody))if($.number(X.ody))this.options.affineOdy=X.ody;else throw $.invalidParameterError("options.ody","number",X.ody);if($.defined(X.interpolator))if($.inArray(X.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=X.interpolator;else throw $.invalidParameterError("options.interpolator","valid interpolator name",X.interpolator)}else throw $.invalidParameterError("options","object",X);return this}function fI(Z){if($.plainObject(Z)){if($.number(Z.sigma)&&$.inRange(Z.sigma,0.000001,10))this.options.sharpenSigma=Z.sigma;else throw $.invalidParameterError("options.sigma","number between 0.000001 and 10",Z.sigma);if($.defined(Z.m1))if($.number(Z.m1)&&$.inRange(Z.m1,0,1e6))this.options.sharpenM1=Z.m1;else throw $.invalidParameterError("options.m1","number between 0 and 1000000",Z.m1);if($.defined(Z.m2))if($.number(Z.m2)&&$.inRange(Z.m2,0,1e6))this.options.sharpenM2=Z.m2;else throw $.invalidParameterError("options.m2","number between 0 and 1000000",Z.m2);if($.defined(Z.x1))if($.number(Z.x1)&&$.inRange(Z.x1,0,1e6))this.options.sharpenX1=Z.x1;else throw $.invalidParameterError("options.x1","number between 0 and 1000000",Z.x1);if($.defined(Z.y2))if($.number(Z.y2)&&$.inRange(Z.y2,0,1e6))this.options.sharpenY2=Z.y2;else throw $.invalidParameterError("options.y2","number between 0 and 1000000",Z.y2);if($.defined(Z.y3))if($.number(Z.y3)&&$.inRange(Z.y3,0,1e6))this.options.sharpenY3=Z.y3;else throw $.invalidParameterError("options.y3","number between 0 and 1000000",Z.y3)}else this.options.sharpenSigma=-1;return this}function hI(Z){if(!$.defined(Z))this.options.medianSize=3;else if($.integer(Z)&&$.inRange(Z,1,1000))this.options.medianSize=Z;else throw $.invalidParameterError("size","integer between 1 and 1000",Z);return this}function uI(Z){let X;if($.number(Z))X=Z;else if($.plainObject(Z)){if(!$.number(Z.sigma))throw $.invalidParameterError("options.sigma","number between 0.3 and 1000",X);if(X=Z.sigma,"precision"in Z)if($.string(kz[Z.precision]))this.options.precision=kz[Z.precision];else throw $.invalidParameterError("precision","one of: integer, float, approximate",Z.precision);if("minAmplitude"in Z)if($.number(Z.minAmplitude)&&$.inRange(Z.minAmplitude,0.001,1))this.options.minAmpl=Z.minAmplitude;else throw $.invalidParameterError("minAmplitude","number between 0.001 and 1",Z.minAmplitude)}if(!$.defined(Z))this.options.blurSigma=-1;else if($.bool(Z))this.options.blurSigma=Z?-1:0;else if($.number(X)&&$.inRange(X,0.3,1000))this.options.blurSigma=X;else throw $.invalidParameterError("sigma","number between 0.3 and 1000",X);return this}function mI(Z){if(!$.defined(Z))this.options.dilateWidth=1;else if($.integer(Z)&&$.inRange(Z,1,65536))this.options.dilateWidth=Z;else throw $.invalidParameterError("width","integer between 1 and 65536",Z);return this}function lI(Z){if(!$.defined(Z))this.options.erodeWidth=1;else if($.integer(Z)&&$.inRange(Z,1,65536))this.options.erodeWidth=Z;else throw $.invalidParameterError("width","integer between 1 and 65536",Z);return this}function dI(Z){if(this.options.flatten=$.bool(Z)?Z:!0,$.object(Z))this._setBackgroundColourOption("flattenBackground",Z.background);return this}function cI(){return this.options.unflatten=!0,this}function pI(Z,X){if(!$.defined(Z))this.options.gamma=2.2;else if($.number(Z)&&$.inRange(Z,1,3))this.options.gamma=Z;else throw $.invalidParameterError("gamma","number between 1.0 and 3.0",Z);if(!$.defined(X))this.options.gammaOut=this.options.gamma;else if($.number(X)&&$.inRange(X,1,3))this.options.gammaOut=X;else throw $.invalidParameterError("gammaOut","number between 1.0 and 3.0",X);return this}function nI(Z){if(this.options.negate=$.bool(Z)?Z:!0,$.plainObject(Z)&&"alpha"in Z)if(!$.bool(Z.alpha))throw $.invalidParameterError("alpha","should be boolean value",Z.alpha);else this.options.negateAlpha=Z.alpha;return this}function iI(Z){if($.plainObject(Z)){if($.defined(Z.lower))if($.number(Z.lower)&&$.inRange(Z.lower,0,99))this.options.normaliseLower=Z.lower;else throw $.invalidParameterError("lower","number between 0 and 99",Z.lower);if($.defined(Z.upper))if($.number(Z.upper)&&$.inRange(Z.upper,1,100))this.options.normaliseUpper=Z.upper;else throw $.invalidParameterError("upper","number between 1 and 100",Z.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw $.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function rI(Z){return this.normalise(Z)}function aI(Z){if($.plainObject(Z)){if($.integer(Z.width)&&$.inRange(Z.width,1,65536))this.options.claheWidth=Z.width;else throw $.invalidParameterError("width","integer between 1 and 65536",Z.width);if($.integer(Z.height)&&$.inRange(Z.height,1,65536))this.options.claheHeight=Z.height;else throw $.invalidParameterError("height","integer between 1 and 65536",Z.height);if($.defined(Z.maxSlope))if($.integer(Z.maxSlope)&&$.inRange(Z.maxSlope,0,100))this.options.claheMaxSlope=Z.maxSlope;else throw $.invalidParameterError("maxSlope","integer between 0 and 100",Z.maxSlope)}else throw $.invalidParameterError("options","plain object",Z);return this}function sI(Z){if(!$.object(Z)||!Array.isArray(Z.kernel)||!$.integer(Z.width)||!$.integer(Z.height)||!$.inRange(Z.width,3,1001)||!$.inRange(Z.height,3,1001)||Z.height*Z.width!==Z.kernel.length||!Z.kernel.every($.number))throw Error("Invalid convolution kernel");if(!$.integer(Z.scale))Z.scale=Z.kernel.reduce((X,Q)=>X+Q,0);if(Z.scale<1)Z.scale=1;if(!$.integer(Z.offset))Z.offset=0;return this.options.convKernel=Z,this}function oI(Z,X){if(!$.defined(Z))this.options.threshold=128;else if($.bool(Z))this.options.threshold=Z?128:0;else if($.integer(Z)&&$.inRange(Z,0,255))this.options.threshold=Z;else throw $.invalidParameterError("threshold","integer between 0 and 255",Z);if(!$.object(X)||X.greyscale===!0||X.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function tI(Z,X,Q){if(this.options.boolean=this._createInputDescriptor(Z,Q),$.string(X)&&$.inArray(X,["and","or","eor"]))this.options.booleanOp=X;else throw $.invalidParameterError("operator","one of: and, or, eor",X);return this}function eI(Z,X){if(!$.defined(Z)&&$.number(X))Z=1;else if($.number(Z)&&!$.defined(X))X=0;if(!$.defined(Z))this.options.linearA=[];else if($.number(Z))this.options.linearA=[Z];else if(Array.isArray(Z)&&Z.length&&Z.every($.number))this.options.linearA=Z;else throw $.invalidParameterError("a","number or array of numbers",Z);if(!$.defined(X))this.options.linearB=[];else if($.number(X))this.options.linearB=[X];else if(Array.isArray(X)&&X.length&&X.every($.number))this.options.linearB=X;else throw $.invalidParameterError("b","number or array of numbers",X);if(this.options.linearA.length!==this.options.linearB.length)throw Error("Expected a and b to be arrays of the same length");return this}function Z2(Z){if(!Array.isArray(Z))throw $.invalidParameterError("inputMatrix","array",Z);let X=Z.length;if(X!==3&&X!==4)throw $.invalidParameterError("inputMatrix","3x3 or 4x4 array",X);if(!Z.every((W)=>Array.isArray(W)&&W.length===X))throw $.invalidParameterError("inputMatrix",`array of ${X} arrays of length ${X}`,Z);let Q=Z.flat();if(!Q.every($.number))throw $.invalidParameterError("inputMatrix","array of numbers",Q);return this.options.recombMatrix=Q,this}function X2(Z){if(!$.plainObject(Z))throw $.invalidParameterError("options","plain object",Z);if("brightness"in Z)if($.number(Z.brightness)&&Z.brightness>=0)this.options.brightness=Z.brightness;else throw $.invalidParameterError("brightness","number above zero",Z.brightness);if("saturation"in Z)if($.number(Z.saturation)&&Z.saturation>=0)this.options.saturation=Z.saturation;else throw $.invalidParameterError("saturation","number above zero",Z.saturation);if("hue"in Z)if($.integer(Z.hue))this.options.hue=Z.hue%360;else throw $.invalidParameterError("hue","number",Z.hue);if("lightness"in Z)if($.number(Z.lightness))this.options.lightness=Z.lightness;else throw $.invalidParameterError("lightness","number",Z.lightness);return this}var kz,bz=(Z)=>{Object.assign(Z.prototype,{autoOrient:xI,rotate:_I,flip:vI,flop:yI,affine:gI,sharpen:fI,erode:lI,dilate:mI,median:hI,blur:uI,flatten:dI,unflatten:cI,gamma:pI,negate:nI,normalise:iI,normalize:rI,clahe:aI,convolve:sI,threshold:oI,boolean:tI,linear:eI,recomb:Z2,modulate:X2})};var _z=c(()=>{v4();/*!
|
|
306
|
+
*/nX={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 pD(Z,X){if(!K.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(K.integer(Z)&&!(Z%90))this.options.angle=Z;else if(K.number(Z)){if(this.options.rotationAngle=Z,K.object(X)&&X.background)this._setBackgroundColourOption("rotationBackground",X.background)}else throw K.invalidParameterError("angle","numeric",Z);return this}function iD(){return this.options.input.autoOrient=!0,this}function nD(Z){return this.options.flip=K.bool(Z)?Z:!0,this}function rD(Z){return this.options.flop=K.bool(Z)?Z:!0,this}function aD(Z,X){let J=Array.isArray(Z)&&(Z.length===4&&Z.every(K.number)||Z.length===2&&Z.every((W)=>Array.isArray(W)&&W.length===2))?Z.flat():[];if(J.length===4&&J.every(K.number))this.options.affineMatrix=J;else throw K.invalidParameterError("matrix","1x4 or 2x2 array",Z);if(K.defined(X))if(K.object(X)){if(this._setBackgroundColourOption("affineBackground",X.background),K.defined(X.idx))if(K.number(X.idx))this.options.affineIdx=X.idx;else throw K.invalidParameterError("options.idx","number",X.idx);if(K.defined(X.idy))if(K.number(X.idy))this.options.affineIdy=X.idy;else throw K.invalidParameterError("options.idy","number",X.idy);if(K.defined(X.odx))if(K.number(X.odx))this.options.affineOdx=X.odx;else throw K.invalidParameterError("options.odx","number",X.odx);if(K.defined(X.ody))if(K.number(X.ody))this.options.affineOdy=X.ody;else throw K.invalidParameterError("options.ody","number",X.ody);if(K.defined(X.interpolator))if(K.inArray(X.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=X.interpolator;else throw K.invalidParameterError("options.interpolator","valid interpolator name",X.interpolator)}else throw K.invalidParameterError("options","object",X);return this}function oD(Z){if(K.plainObject(Z)){if(K.number(Z.sigma)&&K.inRange(Z.sigma,0.000001,10))this.options.sharpenSigma=Z.sigma;else throw K.invalidParameterError("options.sigma","number between 0.000001 and 10",Z.sigma);if(K.defined(Z.m1))if(K.number(Z.m1)&&K.inRange(Z.m1,0,1e6))this.options.sharpenM1=Z.m1;else throw K.invalidParameterError("options.m1","number between 0 and 1000000",Z.m1);if(K.defined(Z.m2))if(K.number(Z.m2)&&K.inRange(Z.m2,0,1e6))this.options.sharpenM2=Z.m2;else throw K.invalidParameterError("options.m2","number between 0 and 1000000",Z.m2);if(K.defined(Z.x1))if(K.number(Z.x1)&&K.inRange(Z.x1,0,1e6))this.options.sharpenX1=Z.x1;else throw K.invalidParameterError("options.x1","number between 0 and 1000000",Z.x1);if(K.defined(Z.y2))if(K.number(Z.y2)&&K.inRange(Z.y2,0,1e6))this.options.sharpenY2=Z.y2;else throw K.invalidParameterError("options.y2","number between 0 and 1000000",Z.y2);if(K.defined(Z.y3))if(K.number(Z.y3)&&K.inRange(Z.y3,0,1e6))this.options.sharpenY3=Z.y3;else throw K.invalidParameterError("options.y3","number between 0 and 1000000",Z.y3)}else this.options.sharpenSigma=-1;return this}function sD(Z){if(!K.defined(Z))this.options.medianSize=3;else if(K.integer(Z)&&K.inRange(Z,1,1000))this.options.medianSize=Z;else throw K.invalidParameterError("size","integer between 1 and 1000",Z);return this}function tD(Z){let X;if(K.number(Z))X=Z;else if(K.plainObject(Z)){if(!K.number(Z.sigma))throw K.invalidParameterError("options.sigma","number between 0.3 and 1000",X);if(X=Z.sigma,"precision"in Z)if(K.string(xU[Z.precision]))this.options.precision=xU[Z.precision];else throw K.invalidParameterError("precision","one of: integer, float, approximate",Z.precision);if("minAmplitude"in Z)if(K.number(Z.minAmplitude)&&K.inRange(Z.minAmplitude,0.001,1))this.options.minAmpl=Z.minAmplitude;else throw K.invalidParameterError("minAmplitude","number between 0.001 and 1",Z.minAmplitude)}if(!K.defined(Z))this.options.blurSigma=-1;else if(K.bool(Z))this.options.blurSigma=Z?-1:0;else if(K.number(X)&&K.inRange(X,0.3,1000))this.options.blurSigma=X;else throw K.invalidParameterError("sigma","number between 0.3 and 1000",X);return this}function eD(Z){if(!K.defined(Z))this.options.dilateWidth=1;else if(K.integer(Z)&&K.inRange(Z,1,65536))this.options.dilateWidth=Z;else throw K.invalidParameterError("width","integer between 1 and 65536",Z);return this}function ZT(Z){if(!K.defined(Z))this.options.erodeWidth=1;else if(K.integer(Z)&&K.inRange(Z,1,65536))this.options.erodeWidth=Z;else throw K.invalidParameterError("width","integer between 1 and 65536",Z);return this}function XT(Z){if(this.options.flatten=K.bool(Z)?Z:!0,K.object(Z))this._setBackgroundColourOption("flattenBackground",Z.background);return this}function QT(){return this.options.unflatten=!0,this}function JT(Z,X){if(!K.defined(Z))this.options.gamma=2.2;else if(K.number(Z)&&K.inRange(Z,1,3))this.options.gamma=Z;else throw K.invalidParameterError("gamma","number between 1.0 and 3.0",Z);if(!K.defined(X))this.options.gammaOut=this.options.gamma;else if(K.number(X)&&K.inRange(X,1,3))this.options.gammaOut=X;else throw K.invalidParameterError("gammaOut","number between 1.0 and 3.0",X);return this}function WT(Z){if(this.options.negate=K.bool(Z)?Z:!0,K.plainObject(Z)&&"alpha"in Z)if(!K.bool(Z.alpha))throw K.invalidParameterError("alpha","should be boolean value",Z.alpha);else this.options.negateAlpha=Z.alpha;return this}function GT(Z){if(K.plainObject(Z)){if(K.defined(Z.lower))if(K.number(Z.lower)&&K.inRange(Z.lower,0,99))this.options.normaliseLower=Z.lower;else throw K.invalidParameterError("lower","number between 0 and 99",Z.lower);if(K.defined(Z.upper))if(K.number(Z.upper)&&K.inRange(Z.upper,1,100))this.options.normaliseUpper=Z.upper;else throw K.invalidParameterError("upper","number between 1 and 100",Z.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw K.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function YT(Z){return this.normalise(Z)}function $T(Z){if(K.plainObject(Z)){if(K.integer(Z.width)&&K.inRange(Z.width,1,65536))this.options.claheWidth=Z.width;else throw K.invalidParameterError("width","integer between 1 and 65536",Z.width);if(K.integer(Z.height)&&K.inRange(Z.height,1,65536))this.options.claheHeight=Z.height;else throw K.invalidParameterError("height","integer between 1 and 65536",Z.height);if(K.defined(Z.maxSlope))if(K.integer(Z.maxSlope)&&K.inRange(Z.maxSlope,0,100))this.options.claheMaxSlope=Z.maxSlope;else throw K.invalidParameterError("maxSlope","integer between 0 and 100",Z.maxSlope)}else throw K.invalidParameterError("options","plain object",Z);return this}function zT(Z){if(!K.object(Z)||!Array.isArray(Z.kernel)||!K.integer(Z.width)||!K.integer(Z.height)||!K.inRange(Z.width,3,1001)||!K.inRange(Z.height,3,1001)||Z.height*Z.width!==Z.kernel.length||!Z.kernel.every(K.number))throw Error("Invalid convolution kernel");if(!K.integer(Z.scale))Z.scale=Z.kernel.reduce((X,Q)=>X+Q,0);if(Z.scale<1)Z.scale=1;if(!K.integer(Z.offset))Z.offset=0;return this.options.convKernel=Z,this}function UT(Z,X){if(!K.defined(Z))this.options.threshold=128;else if(K.bool(Z))this.options.threshold=Z?128:0;else if(K.integer(Z)&&K.inRange(Z,0,255))this.options.threshold=Z;else throw K.invalidParameterError("threshold","integer between 0 and 255",Z);if(!K.object(X)||X.greyscale===!0||X.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function KT(Z,X,Q){if(this.options.boolean=this._createInputDescriptor(Z,Q),K.string(X)&&K.inArray(X,["and","or","eor"]))this.options.booleanOp=X;else throw K.invalidParameterError("operator","one of: and, or, eor",X);return this}function VT(Z,X){if(!K.defined(Z)&&K.number(X))Z=1;else if(K.number(Z)&&!K.defined(X))X=0;if(!K.defined(Z))this.options.linearA=[];else if(K.number(Z))this.options.linearA=[Z];else if(Array.isArray(Z)&&Z.length&&Z.every(K.number))this.options.linearA=Z;else throw K.invalidParameterError("a","number or array of numbers",Z);if(!K.defined(X))this.options.linearB=[];else if(K.number(X))this.options.linearB=[X];else if(Array.isArray(X)&&X.length&&X.every(K.number))this.options.linearB=X;else throw K.invalidParameterError("b","number or array of numbers",X);if(this.options.linearA.length!==this.options.linearB.length)throw Error("Expected a and b to be arrays of the same length");return this}function HT(Z){if(!Array.isArray(Z))throw K.invalidParameterError("inputMatrix","array",Z);let X=Z.length;if(X!==3&&X!==4)throw K.invalidParameterError("inputMatrix","3x3 or 4x4 array",X);if(!Z.every((J)=>Array.isArray(J)&&J.length===X))throw K.invalidParameterError("inputMatrix",`array of ${X} arrays of length ${X}`,Z);let Q=Z.flat();if(!Q.every(K.number))throw K.invalidParameterError("inputMatrix","array of numbers",Q);return this.options.recombMatrix=Q,this}function qT(Z){if(!K.plainObject(Z))throw K.invalidParameterError("options","plain object",Z);if("brightness"in Z)if(K.number(Z.brightness)&&Z.brightness>=0)this.options.brightness=Z.brightness;else throw K.invalidParameterError("brightness","number above zero",Z.brightness);if("saturation"in Z)if(K.number(Z.saturation)&&Z.saturation>=0)this.options.saturation=Z.saturation;else throw K.invalidParameterError("saturation","number above zero",Z.saturation);if("hue"in Z)if(K.integer(Z.hue))this.options.hue=Z.hue%360;else throw K.invalidParameterError("hue","number",Z.hue);if("lightness"in Z)if(K.number(Z.lightness))this.options.lightness=Z.lightness;else throw K.invalidParameterError("lightness","number",Z.lightness);return this}var xU,bU=(Z)=>{Object.assign(Z.prototype,{autoOrient:iD,rotate:pD,flip:nD,flop:rD,affine:aD,sharpen:oD,erode:ZT,dilate:eD,median:sD,blur:tD,flatten:XT,unflatten:QT,gamma:JT,negate:WT,normalise:GT,normalize:YT,clahe:$T,convolve:zT,threshold:UT,boolean:KT,linear:VT,recomb:HT,modulate:qT})};var vU=s(()=>{V1();/*!
|
|
235
307
|
Copyright 2013 Lovell Fuller and others.
|
|
236
308
|
SPDX-License-Identifier: Apache-2.0
|
|
237
|
-
*/kz={integer:"integer",float:"float",approximate:"approximate"}});var hz=j((Ov,fz)=>{var{defineProperty:y7,getOwnPropertyDescriptor:Q2,getOwnPropertyNames:W2}=Object,J2=Object.prototype.hasOwnProperty,G2=(Z,X)=>{for(var Q in X)y7(Z,Q,{get:X[Q],enumerable:!0})},Y2=(Z,X,Q,W)=>{if(X&&typeof X==="object"||typeof X==="function"){for(let J of W2(X))if(!J2.call(Z,J)&&J!==Q)y7(Z,J,{get:()=>X[J],enumerable:!(W=Q2(X,J))||W.enumerable})}return Z},z2=(Z)=>Y2(y7({},"__esModule",{value:!0}),Z),xz={};G2(xz,{default:()=>D2});fz.exports=z2(xz);var b7={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 b7)Object.freeze(b7[Z]);var m4=Object.freeze(b7),vz=Object.create(null);for(let Z in m4)if(Object.hasOwn(m4,Z))vz[m4[Z]]=Z;var o0={to:{},get:{}};o0.get=function(Z){let X=Z.slice(0,3).toLowerCase(),Q,W;switch(X){case"hsl":{Q=o0.get.hsl(Z),W="hsl";break}case"hwb":{Q=o0.get.hwb(Z),W="hwb";break}default:{Q=o0.get.rgb(Z),W="rgb";break}}if(!Q)return null;return{model:W,value:Q}};o0.get.rgb=function(Z){if(!Z)return null;let X=/^#([a-f\d]{3,4})$/i,Q=/^#([a-f\d]{6})([a-f\d]{2})?$/i,W=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,J=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,G=/^(\w+)$/,Y=[0,0,0,1],z,q,K;if(z=Z.match(Q)){K=z[2],z=z[1];for(q=0;q<3;q++){let V=q*2;Y[q]=Number.parseInt(z.slice(V,V+2),16)}if(K)Y[3]=Number.parseInt(K,16)/255}else if(z=Z.match(X)){z=z[1],K=z[3];for(q=0;q<3;q++)Y[q]=Number.parseInt(z[q]+z[q],16);if(K)Y[3]=Number.parseInt(K+K,16)/255}else if(z=Z.match(W)){for(q=0;q<3;q++)Y[q]=Number.parseFloat(z[q+1]);if(z[4])Y[3]=z[5]?Number.parseFloat(z[4])*0.01:Number.parseFloat(z[4])}else if(z=Z.match(J)){for(q=0;q<3;q++)Y[q]=Math.round(Number.parseFloat(z[q+1])*2.55);if(z[4])Y[3]=z[5]?Number.parseFloat(z[4])*0.01:Number.parseFloat(z[4])}else if(z=Z.toLowerCase().match(G)){if(z[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(m4,z[1]))return null;return Y=m4[z[1]].slice(),Y[3]=1,Y}else return null;for(q=0;q<3;q++)Y[q]=j6(Y[q],0,255);return Y[3]=j6(Y[3],0,1),Y};o0.get.hsl=function(Z){if(!Z)return null;let X=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,Q=Z.match(X);if(Q){let W=Number.parseFloat(Q[4]),J=(Number.parseFloat(Q[1])%360+360)%360,G=j6(Number.parseFloat(Q[2]),0,100),Y=j6(Number.parseFloat(Q[3]),0,100),z=j6(Number.isNaN(W)?1:W,0,1);return[J,G,Y,z]}return null};o0.get.hwb=function(Z){if(!Z)return null;let X=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,Q=Z.match(X);if(Q){let W=Number.parseFloat(Q[4]),J=(Number.parseFloat(Q[1])%360+360)%360,G=j6(Number.parseFloat(Q[2]),0,100),Y=j6(Number.parseFloat(Q[3]),0,100),z=j6(Number.isNaN(W)?1:W,0,1);return[J,G,Y,z]}return null};o0.to.hex=function(...Z){return"#"+r8(Z[0])+r8(Z[1])+r8(Z[2])+(Z[3]<1?r8(Math.round(Z[3]*255)):"")};o0.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]+")"};o0.to.rgb.percent=function(...Z){let X=Math.round(Z[0]/255*100),Q=Math.round(Z[1]/255*100),W=Math.round(Z[2]/255*100);return Z.length<4||Z[3]===1?"rgb("+X+"%, "+Q+"%, "+W+"%)":"rgba("+X+"%, "+Q+"%, "+W+"%, "+Z[3]+")"};o0.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]+")"};o0.to.hwb=function(...Z){let X="";if(Z.length>=4&&Z[3]!==1)X=", "+Z[3];return"hwb("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%"+X+")"};o0.to.keyword=function(...Z){return vz[Z.slice(0,3)]};function j6(Z,X,Q){return Math.min(Math.max(X,Z),Q)}function r8(Z){let X=Math.round(Z).toString(16).toUpperCase();return X.length<2?"0"+X:X}var w1=o0,yz={};for(let Z of Object.keys(m4))yz[m4[Z]]=Z;var u={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"]}},c6=u,Q6=0.008856451679035631;function O1(Z){let X=Z>0.0031308?1.055*Z**0.4166666666666667-0.055:Z*12.92;return Math.min(Math.max(0,X),1)}function E1(Z){return Z>0.04045?((Z+0.055)/1.055)**2.4:Z/12.92}for(let Z of Object.keys(u)){if(!("channels"in u[Z]))throw Error("missing channels property: "+Z);if(!("labels"in u[Z]))throw Error("missing channel labels property: "+Z);if(u[Z].labels.length!==u[Z].channels)throw Error("channel and label counts mismatch: "+Z);let{channels:X,labels:Q}=u[Z];delete u[Z].channels,delete u[Z].labels,Object.defineProperty(u[Z],"channels",{value:X}),Object.defineProperty(u[Z],"labels",{value:Q})}u.rgb.hsl=function(Z){let X=Z[0]/255,Q=Z[1]/255,W=Z[2]/255,J=Math.min(X,Q,W),G=Math.max(X,Q,W),Y=G-J,z,q;switch(G){case J:{z=0;break}case X:{z=(Q-W)/Y;break}case Q:{z=2+(W-X)/Y;break}case W:{z=4+(X-Q)/Y;break}}if(z=Math.min(z*60,360),z<0)z+=360;let K=(J+G)/2;if(G===J)q=0;else if(K<=0.5)q=Y/(G+J);else q=Y/(2-G-J);return[z,q*100,K*100]};u.rgb.hsv=function(Z){let X,Q,W,J,G,Y=Z[0]/255,z=Z[1]/255,q=Z[2]/255,K=Math.max(Y,z,q),V=K-Math.min(Y,z,q),B=function(H){return(K-H)/6/V+0.5};if(V===0)J=0,G=0;else{switch(G=V/K,X=B(Y),Q=B(z),W=B(q),K){case Y:{J=W-Q;break}case z:{J=0.3333333333333333+X-W;break}case q:{J=0.6666666666666666+Q-X;break}}if(J<0)J+=1;else if(J>1)J-=1}return[J*360,G*100,K*100]};u.rgb.hwb=function(Z){let X=Z[0],Q=Z[1],W=Z[2],J=u.rgb.hsl(Z)[0],G=0.00392156862745098*Math.min(X,Math.min(Q,W));return W=1-0.00392156862745098*Math.max(X,Math.max(Q,W)),[J,G*100,W*100]};u.rgb.oklab=function(Z){let X=E1(Z[0]/255),Q=E1(Z[1]/255),W=E1(Z[2]/255),J=Math.cbrt(0.4122214708*X+0.5363325363*Q+0.0514459929*W),G=Math.cbrt(0.2119034982*X+0.6806995451*Q+0.1073969566*W),Y=Math.cbrt(0.0883024619*X+0.2817188376*Q+0.6299787005*W),z=0.2104542553*J+0.793617785*G-0.0040720468*Y,q=1.9779984951*J-2.428592205*G+0.4505937099*Y,K=0.0259040371*J+0.7827717662*G-0.808675766*Y;return[z*100,q*100,K*100]};u.rgb.cmyk=function(Z){let X=Z[0]/255,Q=Z[1]/255,W=Z[2]/255,J=Math.min(1-X,1-Q,1-W),G=(1-X-J)/(1-J)||0,Y=(1-Q-J)/(1-J)||0,z=(1-W-J)/(1-J)||0;return[G*100,Y*100,z*100,J*100]};function $2(Z,X){return(Z[0]-X[0])**2+(Z[1]-X[1])**2+(Z[2]-X[2])**2}u.rgb.keyword=function(Z){let X=yz[Z];if(X)return X;let Q=Number.POSITIVE_INFINITY,W;for(let J of Object.keys(m4)){let G=m4[J],Y=$2(Z,G);if(Y<Q)Q=Y,W=J}return W};u.keyword.rgb=function(Z){return[...m4[Z]]};u.rgb.xyz=function(Z){let X=E1(Z[0]/255),Q=E1(Z[1]/255),W=E1(Z[2]/255),J=X*0.4124564+Q*0.3575761+W*0.1804375,G=X*0.2126729+Q*0.7151522+W*0.072175,Y=X*0.0193339+Q*0.119192+W*0.9503041;return[J*100,G*100,Y*100]};u.rgb.lab=function(Z){let X=u.rgb.xyz(Z),Q=X[0],W=X[1],J=X[2];Q/=95.047,W/=100,J/=108.883,Q=Q>Q6?Q**0.3333333333333333:7.787*Q+0.13793103448275862,W=W>Q6?W**0.3333333333333333:7.787*W+0.13793103448275862,J=J>Q6?J**0.3333333333333333:7.787*J+0.13793103448275862;let G=116*W-16,Y=500*(Q-W),z=200*(W-J);return[G,Y,z]};u.hsl.rgb=function(Z){let X=Z[0]/360,Q=Z[1]/100,W=Z[2]/100,J,G;if(Q===0)return G=W*255,[G,G,G];let Y=W<0.5?W*(1+Q):W+Q-W*Q,z=2*W-Y,q=[0,0,0];for(let K=0;K<3;K++){if(J=X+0.3333333333333333*-(K-1),J<0)J++;if(J>1)J--;if(6*J<1)G=z+(Y-z)*6*J;else if(2*J<1)G=Y;else if(3*J<2)G=z+(Y-z)*(0.6666666666666666-J)*6;else G=z;q[K]=G*255}return q};u.hsl.hsv=function(Z){let X=Z[0],Q=Z[1]/100,W=Z[2]/100,J=Q,G=Math.max(W,0.01);W*=2,Q*=W<=1?W:2-W,J*=G<=1?G:2-G;let Y=(W+Q)/2,z=W===0?2*J/(G+J):2*Q/(W+Q);return[X,z*100,Y*100]};u.hsv.rgb=function(Z){let X=Z[0]/60,Q=Z[1]/100,W=Z[2]/100,J=Math.floor(X)%6,G=X-Math.floor(X),Y=255*W*(1-Q),z=255*W*(1-Q*G),q=255*W*(1-Q*(1-G));switch(W*=255,J){case 0:return[W,q,Y];case 1:return[z,W,Y];case 2:return[Y,W,q];case 3:return[Y,z,W];case 4:return[q,Y,W];case 5:return[W,Y,z]}};u.hsv.hsl=function(Z){let X=Z[0],Q=Z[1]/100,W=Z[2]/100,J=Math.max(W,0.01),G,Y;Y=(2-Q)*W;let z=(2-Q)*J;return G=Q*J,G/=z<=1?z:2-z,G=G||0,Y/=2,[X,G*100,Y*100]};u.hwb.rgb=function(Z){let X=Z[0]/360,Q=Z[1]/100,W=Z[2]/100,J=Q+W,G;if(J>1)Q/=J,W/=J;let Y=Math.floor(6*X),z=1-W;if(G=6*X-Y,(Y&1)!==0)G=1-G;let q=Q+G*(z-Q),K,V,B;switch(Y){default:case 6:case 0:{K=z,V=q,B=Q;break}case 1:{K=q,V=z,B=Q;break}case 2:{K=Q,V=z,B=q;break}case 3:{K=Q,V=q,B=z;break}case 4:{K=q,V=Q,B=z;break}case 5:{K=z,V=Q,B=q;break}}return[K*255,V*255,B*255]};u.cmyk.rgb=function(Z){let X=Z[0]/100,Q=Z[1]/100,W=Z[2]/100,J=Z[3]/100,G=1-Math.min(1,X*(1-J)+J),Y=1-Math.min(1,Q*(1-J)+J),z=1-Math.min(1,W*(1-J)+J);return[G*255,Y*255,z*255]};u.xyz.rgb=function(Z){let X=Z[0]/100,Q=Z[1]/100,W=Z[2]/100,J,G,Y;return J=X*3.2404542+Q*-1.5371385+W*-0.4985314,G=X*-0.969266+Q*1.8760108+W*0.041556,Y=X*0.0556434+Q*-0.2040259+W*1.0572252,J=O1(J),G=O1(G),Y=O1(Y),[J*255,G*255,Y*255]};u.xyz.lab=function(Z){let X=Z[0],Q=Z[1],W=Z[2];X/=95.047,Q/=100,W/=108.883,X=X>Q6?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>Q6?Q**0.3333333333333333:7.787*Q+0.13793103448275862,W=W>Q6?W**0.3333333333333333:7.787*W+0.13793103448275862;let J=116*Q-16,G=500*(X-Q),Y=200*(Q-W);return[J,G,Y]};u.xyz.oklab=function(Z){let X=Z[0]/100,Q=Z[1]/100,W=Z[2]/100,J=Math.cbrt(0.8189330101*X+0.3618667424*Q-0.1288597137*W),G=Math.cbrt(0.0329845436*X+0.9293118715*Q+0.0361456387*W),Y=Math.cbrt(0.0482003018*X+0.2643662691*Q+0.633851707*W),z=0.2104542553*J+0.793617785*G-0.0040720468*Y,q=1.9779984951*J-2.428592205*G+0.4505937099*Y,K=0.0259040371*J+0.7827717662*G-0.808675766*Y;return[z*100,q*100,K*100]};u.oklab.oklch=function(Z){return u.lab.lch(Z)};u.oklab.xyz=function(Z){let X=Z[0]/100,Q=Z[1]/100,W=Z[2]/100,J=(0.999999998*X+0.396337792*Q+0.215803758*W)**3,G=(1.000000008*X-0.105561342*Q-0.063854175*W)**3,Y=(1.000000055*X-0.089484182*Q-1.291485538*W)**3,z=1.227013851*J-0.55779998*G+0.281256149*Y,q=-0.040580178*J+1.11225687*G-0.071676679*Y,K=-0.076381285*J-0.421481978*G+1.58616322*Y;return[z*100,q*100,K*100]};u.oklab.rgb=function(Z){let X=Z[0]/100,Q=Z[1]/100,W=Z[2]/100,J=(X+0.3963377774*Q+0.2158037573*W)**3,G=(X-0.1055613458*Q-0.0638541728*W)**3,Y=(X-0.0894841775*Q-1.291485548*W)**3,z=O1(4.0767416621*J-3.3077115913*G+0.2309699292*Y),q=O1(-1.2684380046*J+2.6097574011*G-0.3413193965*Y),K=O1(-0.0041960863*J-0.7034186147*G+1.707614701*Y);return[z*255,q*255,K*255]};u.oklch.oklab=function(Z){return u.lch.lab(Z)};u.lab.xyz=function(Z){let X=Z[0],Q=Z[1],W=Z[2],J,G,Y;G=(X+16)/116,J=Q/500+G,Y=G-W/200;let z=G**3,q=J**3,K=Y**3;return G=z>Q6?z:(G-0.13793103448275862)/7.787,J=q>Q6?q:(J-0.13793103448275862)/7.787,Y=K>Q6?K:(Y-0.13793103448275862)/7.787,J*=95.047,G*=100,Y*=108.883,[J,G,Y]};u.lab.lch=function(Z){let X=Z[0],Q=Z[1],W=Z[2],J;if(J=Math.atan2(W,Q)*360/2/Math.PI,J<0)J+=360;let Y=Math.sqrt(Q*Q+W*W);return[X,Y,J]};u.lch.lab=function(Z){let X=Z[0],Q=Z[1],J=Z[2]/360*2*Math.PI,G=Q*Math.cos(J),Y=Q*Math.sin(J);return[X,G,Y]};u.rgb.ansi16=function(Z,X=null){let[Q,W,J]=Z,G=X===null?u.rgb.hsv(Z)[2]:X;if(G=Math.round(G/50),G===0)return 30;let Y=30+(Math.round(J/255)<<2|Math.round(W/255)<<1|Math.round(Q/255));if(G===2)Y+=60;return Y};u.hsv.ansi16=function(Z){return u.rgb.ansi16(u.hsv.rgb(Z),Z[2])};u.rgb.ansi256=function(Z){let X=Z[0],Q=Z[1],W=Z[2];if(X>>4===Q>>4&&Q>>4===W>>4){if(X<8)return 16;if(X>248)return 231;return Math.round((X-8)/247*24)+232}return 16+36*Math.round(X/255*5)+6*Math.round(Q/255*5)+Math.round(W/255*5)};u.ansi16.rgb=function(Z){Z=Z[0];let X=Z%10;if(X===0||X===7){if(Z>50)X+=3.5;return X=X/10.5*255,[X,X,X]}let Q=(Math.trunc(Z>50)+1)*0.5,W=(X&1)*Q*255,J=(X>>1&1)*Q*255,G=(X>>2&1)*Q*255;return[W,J,G]};u.ansi256.rgb=function(Z){if(Z=Z[0],Z>=232){let G=(Z-232)*10+8;return[G,G,G]}Z-=16;let X,Q=Math.floor(Z/36)/5*255,W=Math.floor((X=Z%36)/6)/5*255,J=X%6/5*255;return[Q,W,J]};u.rgb.hex=function(Z){let Q=(((Math.round(Z[0])&255)<<16)+((Math.round(Z[1])&255)<<8)+(Math.round(Z[2])&255)).toString(16).toUpperCase();return"000000".slice(Q.length)+Q};u.hex.rgb=function(Z){let X=Z.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!X)return[0,0,0];let Q=X[0];if(X[0].length===3)Q=[...Q].map((z)=>z+z).join("");let W=Number.parseInt(Q,16),J=W>>16&255,G=W>>8&255,Y=W&255;return[J,G,Y]};u.rgb.hcg=function(Z){let X=Z[0]/255,Q=Z[1]/255,W=Z[2]/255,J=Math.max(Math.max(X,Q),W),G=Math.min(Math.min(X,Q),W),Y=J-G,z,q=Y<1?G/(1-Y):0;if(Y<=0)z=0;else if(J===X)z=(Q-W)/Y%6;else if(J===Q)z=2+(W-X)/Y;else z=4+(X-Q)/Y;return z/=6,z%=1,[z*360,Y*100,q*100]};u.hsl.hcg=function(Z){let X=Z[1]/100,Q=Z[2]/100,W=Q<0.5?2*X*Q:2*X*(1-Q),J=0;if(W<1)J=(Q-0.5*W)/(1-W);return[Z[0],W*100,J*100]};u.hsv.hcg=function(Z){let X=Z[1]/100,Q=Z[2]/100,W=X*Q,J=0;if(W<1)J=(Q-W)/(1-W);return[Z[0],W*100,J*100]};u.hcg.rgb=function(Z){let X=Z[0]/360,Q=Z[1]/100,W=Z[2]/100;if(Q===0)return[W*255,W*255,W*255];let J=[0,0,0],G=X%1*6,Y=G%1,z=1-Y,q=0;switch(Math.floor(G)){case 0:{J[0]=1,J[1]=Y,J[2]=0;break}case 1:{J[0]=z,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]=z,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]=z}return q=(1-Q)*W,[(Q*J[0]+q)*255,(Q*J[1]+q)*255,(Q*J[2]+q)*255]};u.hcg.hsv=function(Z){let X=Z[1]/100,Q=Z[2]/100,W=X+Q*(1-X),J=0;if(W>0)J=X/W;return[Z[0],J*100,W*100]};u.hcg.hsl=function(Z){let X=Z[1]/100,W=Z[2]/100*(1-X)+0.5*X,J=0;if(W>0&&W<0.5)J=X/(2*W);else if(W>=0.5&&W<1)J=X/(2*(1-W));return[Z[0],J*100,W*100]};u.hcg.hwb=function(Z){let X=Z[1]/100,Q=Z[2]/100,W=X+Q*(1-X);return[Z[0],(W-X)*100,(1-W)*100]};u.hwb.hcg=function(Z){let X=Z[1]/100,W=1-Z[2]/100,J=W-X,G=0;if(J<1)G=(W-J)/(1-J);return[Z[0],J*100,G*100]};u.apple.rgb=function(Z){return[Z[0]/65535*255,Z[1]/65535*255,Z[2]/65535*255]};u.rgb.apple=function(Z){return[Z[0]/255*65535,Z[1]/255*65535,Z[2]/255*65535]};u.gray.rgb=function(Z){return[Z[0]/100*255,Z[0]/100*255,Z[0]/100*255]};u.gray.hsl=function(Z){return[0,0,Z[0]]};u.gray.hsv=u.gray.hsl;u.gray.hwb=function(Z){return[0,100,Z[0]]};u.gray.cmyk=function(Z){return[0,0,0,Z[0]]};u.gray.lab=function(Z){return[Z[0],0,0]};u.gray.hex=function(Z){let X=Math.round(Z[0]/100*255)&255,W=((X<<16)+(X<<8)+X).toString(16).toUpperCase();return"000000".slice(W.length)+W};u.rgb.gray=function(Z){return[(Z[0]+Z[1]+Z[2])/3/255*100]};function q2(){let Z={},X=Object.keys(c6);for(let{length:Q}=X,W=0;W<Q;W++)Z[X[W]]={distance:-1,parent:null};return Z}function K2(Z){let X=q2(),Q=[Z];X[Z].distance=0;while(Q.length>0){let W=Q.pop(),J=Object.keys(c6[W]);for(let{length:G}=J,Y=0;Y<G;Y++){let z=J[Y],q=X[z];if(q.distance===-1)q.distance=X[W].distance+1,q.parent=W,Q.unshift(z)}}return X}function U2(Z,X){return function(Q){return X(Z(Q))}}function V2(Z,X){let Q=[X[Z].parent,Z],W=c6[X[Z].parent][Z],J=X[Z].parent;while(X[J].parent)Q.unshift(X[J].parent),W=U2(c6[X[J].parent][J],W),J=X[J].parent;return W.conversion=Q,W}function B2(Z){let X=K2(Z),Q={},W=Object.keys(X);for(let{length:J}=W,G=0;G<J;G++){let Y=W[G];if(X[Y].parent===null)continue;Q[Y]=V2(Y,X)}return Q}var H2=B2,j1={},F2=Object.keys(c6);function L2(Z){let X=function(...Q){let W=Q[0];if(W===void 0||W===null)return W;if(W.length>1)Q=W;return Z(Q)};if("conversion"in Z)X.conversion=Z.conversion;return X}function A2(Z){let X=function(...Q){let W=Q[0];if(W===void 0||W===null)return W;if(W.length>1)Q=W;let J=Z(Q);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)X.conversion=Z.conversion;return X}for(let Z of F2){j1[Z]={},Object.defineProperty(j1[Z],"channels",{value:c6[Z].channels}),Object.defineProperty(j1[Z],"labels",{value:c6[Z].labels});let X=H2(Z),Q=Object.keys(X);for(let W of Q){let J=X[W];j1[Z][W]=A2(J),j1[Z][W].raw=L2(J)}}var z4=j1,gz=["keyword","gray","hex"],_7={};for(let Z of Object.keys(z4))_7[[...z4[Z].labels].sort().join("")]=Z;var x7={};function b0(Z,X){if(!(this instanceof b0))return new b0(Z,X);if(X&&X in gz)X=null;if(X&&!(X in z4))throw Error("Unknown model: "+X);let Q,W;if(Z==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(Z instanceof b0)this.model=Z.model,this.color=[...Z.color],this.valpha=Z.valpha;else if(typeof Z==="string"){let J=w1.get(Z);if(J===null)throw Error("Unable to parse color from string: "+Z);this.model=J.model,W=z4[this.model].channels,this.color=J.value.slice(0,W),this.valpha=typeof J.value[W]==="number"?J.value[W]:1}else if(Z.length>0){this.model=X||"rgb",W=z4[this.model].channels;let J=Array.prototype.slice.call(Z,0,W);this.color=v7(J,W),this.valpha=typeof Z[W]==="number"?Z[W]:1}else if(typeof Z==="number")this.model="rgb",this.color=[Z>>16&255,Z>>8&255,Z&255],this.valpha=1;else{this.valpha=1;let 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 _7))throw Error("Unable to parse color from object: "+JSON.stringify(Z));this.model=_7[G];let{labels:Y}=z4[this.model],z=[];for(Q=0;Q<Y.length;Q++)z.push(Z[Y[Q]]);this.color=v7(z)}if(x7[this.model]){W=z4[this.model].channels;for(Q=0;Q<W;Q++){let J=x7[this.model][Q];if(J)this.color[Q]=J(this.color[Q])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}b0.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(Z){let X=this.model in w1.to?this:this.rgb();X=X.round(typeof Z==="number"?Z:1);let Q=X.valpha===1?X.color:[...X.color,this.valpha];return w1.to[X.model](...Q)},percentString(Z){let X=this.rgb().round(typeof Z==="number"?Z:1),Q=X.valpha===1?X.color:[...X.color,this.valpha];return w1.to.rgb.percent(...Q)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let Z={},{channels:X}=z4[this.model],{labels:Q}=z4[this.model];for(let W=0;W<X;W++)Z[Q[W]]=this.color[W];if(this.valpha!==1)Z.alpha=this.valpha;return Z},unitArray(){let Z=this.rgb().color;if(Z[0]/=255,Z[1]/=255,Z[2]/=255,this.valpha!==1)Z.push(this.valpha);return Z},unitObject(){let Z=this.rgb().object();if(Z.r/=255,Z.g/=255,Z.b/=255,this.valpha!==1)Z.alpha=this.valpha;return Z},round(Z){return Z=Math.max(Z||0,0),new b0([...this.color.map(I2(Z)),this.valpha],this.model)},alpha(Z){if(Z!==void 0)return new b0([...this.color,Math.max(0,Math.min(1,Z))],this.model);return this.valpha},red:D0("rgb",0,S0(255)),green:D0("rgb",1,S0(255)),blue:D0("rgb",2,S0(255)),hue:D0(["hsl","hsv","hsl","hwb","hcg"],0,(Z)=>(Z%360+360)%360),saturationl:D0("hsl",1,S0(100)),lightness:D0("hsl",2,S0(100)),saturationv:D0("hsv",1,S0(100)),value:D0("hsv",2,S0(100)),chroma:D0("hcg",1,S0(100)),gray:D0("hcg",2,S0(100)),white:D0("hwb",1,S0(100)),wblack:D0("hwb",2,S0(100)),cyan:D0("cmyk",0,S0(100)),magenta:D0("cmyk",1,S0(100)),yellow:D0("cmyk",2,S0(100)),black:D0("cmyk",3,S0(100)),x:D0("xyz",0,S0(95.047)),y:D0("xyz",1,S0(100)),z:D0("xyz",2,S0(108.833)),l:D0("lab",0,S0(100)),a:D0("lab",1),b:D0("lab",2),keyword(Z){if(Z!==void 0)return new b0(Z);return z4[this.model].keyword(this.color)},hex(Z){if(Z!==void 0)return new b0(Z);return w1.to.hex(...this.rgb().round().color)},hexa(Z){if(Z!==void 0)return new b0(Z);let X=this.rgb().round().color,Q=Math.round(this.valpha*255).toString(16).toUpperCase();if(Q.length===1)Q="0"+Q;return w1.to.hex(...X)+Q},rgbNumber(){let Z=this.rgb().color;return(Z[0]&255)<<16|(Z[1]&255)<<8|Z[2]&255},luminosity(){let Z=this.rgb().color,X=[];for(let[Q,W]of Z.entries()){let J=W/255;X[Q]=J<=0.04045?J/12.92:((J+0.055)/1.055)**2.4}return 0.2126*X[0]+0.7152*X[1]+0.0722*X[2]},contrast(Z){let X=this.luminosity(),Q=Z.luminosity();if(X>Q)return(X+0.05)/(Q+0.05);return(Q+0.05)/(X+0.05)},level(Z){let X=this.contrast(Z);if(X>=7)return"AAA";return X>=4.5?"AA":""},isDark(){let Z=this.rgb().color;return(Z[0]*2126+Z[1]*7152+Z[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let Z=this.rgb();for(let X=0;X<3;X++)Z.color[X]=255-Z.color[X];return Z},lighten(Z){let X=this.hsl();return X.color[2]+=X.color[2]*Z,X},darken(Z){let X=this.hsl();return X.color[2]-=X.color[2]*Z,X},saturate(Z){let X=this.hsl();return X.color[1]+=X.color[1]*Z,X},desaturate(Z){let X=this.hsl();return X.color[1]-=X.color[1]*Z,X},whiten(Z){let X=this.hwb();return X.color[1]+=X.color[1]*Z,X},blacken(Z){let X=this.hwb();return X.color[2]+=X.color[2]*Z,X},grayscale(){let Z=this.rgb().color,X=Z[0]*0.3+Z[1]*0.59+Z[2]*0.11;return b0.rgb(X,X,X)},fade(Z){return this.alpha(this.valpha-this.valpha*Z)},opaquer(Z){return this.alpha(this.valpha+this.valpha*Z)},rotate(Z){let X=this.hsl(),Q=X.color[0];return Q=(Q+Z)%360,Q=Q<0?360+Q:Q,X.color[0]=Q,X},mix(Z,X){if(!Z||!Z.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof Z);let Q=Z.rgb(),W=this.rgb(),J=X===void 0?0.5:X,G=2*J-1,Y=Q.alpha()-W.alpha(),z=((G*Y===-1?G:(G+Y)/(1+G*Y))+1)/2,q=1-z;return b0.rgb(z*Q.red()+q*W.red(),z*Q.green()+q*W.green(),z*Q.blue()+q*W.blue(),Q.alpha()*J+W.alpha()*(1-J))}};for(let Z of Object.keys(z4)){if(gz.includes(Z))continue;let{channels:X}=z4[Z];b0.prototype[Z]=function(...Q){if(this.model===Z)return new b0(this);if(Q.length>0)return new b0(Q,Z);return new b0([...N2(z4[this.model][Z].raw(this.color)),this.valpha],Z)},b0[Z]=function(...Q){let W=Q[0];if(typeof W==="number")W=v7(Q,X);return new b0(W,Z)}}function M2(Z,X){return Number(Z.toFixed(X))}function I2(Z){return function(X){return M2(X,Z)}}function D0(Z,X,Q){Z=Array.isArray(Z)?Z:[Z];for(let W of Z)(x7[W]||=[])[X]=Q;return Z=Z[0],function(W){let J;if(W!==void 0){if(Q)W=Q(W);return J=this[Z](),J.color[X]=W,J}if(J=this[Z]().color[X],Q)J=Q(J);return J}}function S0(Z){return function(X){return Math.max(0,Math.min(Z,X))}}function N2(Z){return Array.isArray(Z)?Z:[Z]}function v7(Z,X){for(let Q=0;Q<X;Q++)if(typeof Z[Q]!=="number")Z[Q]=0;return Z}var D2=b0});var mz=j((Ev,uz)=>{uz.exports=hz().default});function T2(Z){return this._setBackgroundColourOption("tint",Z),this}function w2(Z){return this.options.greyscale=$.bool(Z)?Z:!0,this}function j2(Z){return this.greyscale(Z)}function O2(Z){if(!$.string(Z))throw $.invalidParameterError("colourspace","string",Z);return this.options.colourspacePipeline=Z,this}function E2(Z){return this.pipelineColourspace(Z)}function R2(Z){if(!$.string(Z))throw $.invalidParameterError("colourspace","string",Z);return this.options.colourspace=Z,this}function P2(Z){return this.toColourspace(Z)}function cz(Z){if($.object(Z)||$.string(Z)&&Z.length>=3&&Z.length<=200){let X=dz.default(Z),Q=X.red(),W=X.green(),J=X.blue(),G=Math.round(X.alpha()*255);for(let[Y,z]of[["red",Q],["green",W],["blue",J],["alpha",G]])if(!$.number(z))throw $.invalidParameterError(`background.${Y}`,"number",z);return[Q,W,J,G]}else throw $.invalidParameterError("background","object or string",Z)}function C2(Z,X){if($.defined(X))this.options[Z]=cz(X)}var dz,lz,pz=(Z)=>{Object.assign(Z.prototype,{tint:T2,greyscale:w2,grayscale:j2,pipelineColourspace:O2,pipelineColorspace:E2,toColourspace:R2,toColorspace:P2,_getBackgroundColourOption:cz,_setBackgroundColourOption:C2}),Z.colourspace=lz,Z.colorspace=lz};var nz=c(()=>{v4();dz=W1(mz(),1);/*!
|
|
309
|
+
*/xU={integer:"integer",float:"float",approximate:"approximate"}});var mU=C((Vh,uU)=>{var{defineProperty:tX,getOwnPropertyDescriptor:BT,getOwnPropertyNames:FT}=Object,LT=Object.prototype.hasOwnProperty,MT=(Z,X)=>{for(var Q in X)tX(Z,Q,{get:X[Q],enumerable:!0})},AT=(Z,X,Q,J)=>{if(X&&typeof X==="object"||typeof X==="function"){for(let W of FT(X))if(!LT.call(Z,W)&&W!==Q)tX(Z,W,{get:()=>X[W],enumerable:!(J=BT(X,W))||J.enumerable})}return Z},IT=(Z)=>AT(tX({},"__esModule",{value:!0}),Z),yU={};MT(yU,{default:()=>xT});uU.exports=IT(yU);var rX={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 rX)Object.freeze(rX[Z]);var M1=Object.freeze(rX),gU=Object.create(null);for(let Z in M1)if(Object.hasOwn(M1,Z))gU[M1[Z]]=Z;var D6={to:{},get:{}};D6.get=function(Z){let X=Z.slice(0,3).toLowerCase(),Q,J;switch(X){case"hsl":{Q=D6.get.hsl(Z),J="hsl";break}case"hwb":{Q=D6.get.hwb(Z),J="hwb";break}default:{Q=D6.get.rgb(Z),J="rgb";break}}if(!Q)return null;return{model:J,value:Q}};D6.get.rgb=function(Z){if(!Z)return null;let X=/^#([a-f\d]{3,4})$/i,Q=/^#([a-f\d]{6})([a-f\d]{2})?$/i,J=/^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,W=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,G=/^(\w+)$/,Y=[0,0,0,1],$,z,U;if($=Z.match(Q)){U=$[2],$=$[1];for(z=0;z<3;z++){let V=z*2;Y[z]=Number.parseInt($.slice(V,V+2),16)}if(U)Y[3]=Number.parseInt(U,16)/255}else if($=Z.match(X)){$=$[1],U=$[3];for(z=0;z<3;z++)Y[z]=Number.parseInt($[z]+$[z],16);if(U)Y[3]=Number.parseInt(U+U,16)/255}else if($=Z.match(J)){for(z=0;z<3;z++)Y[z]=Number.parseFloat($[z+1]);if($[4])Y[3]=$[5]?Number.parseFloat($[4])*0.01:Number.parseFloat($[4])}else if($=Z.match(W)){for(z=0;z<3;z++)Y[z]=Math.round(Number.parseFloat($[z+1])*2.55);if($[4])Y[3]=$[5]?Number.parseFloat($[4])*0.01:Number.parseFloat($[4])}else if($=Z.toLowerCase().match(G)){if($[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(M1,$[1]))return null;return Y=M1[$[1]].slice(),Y[3]=1,Y}else return null;for(z=0;z<3;z++)Y[z]=G4(Y[z],0,255);return Y[3]=G4(Y[3],0,1),Y};D6.get.hsl=function(Z){if(!Z)return null;let X=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,Q=Z.match(X);if(Q){let J=Number.parseFloat(Q[4]),W=(Number.parseFloat(Q[1])%360+360)%360,G=G4(Number.parseFloat(Q[2]),0,100),Y=G4(Number.parseFloat(Q[3]),0,100),$=G4(Number.isNaN(J)?1:J,0,1);return[W,G,Y,$]}return null};D6.get.hwb=function(Z){if(!Z)return null;let X=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,Q=Z.match(X);if(Q){let J=Number.parseFloat(Q[4]),W=(Number.parseFloat(Q[1])%360+360)%360,G=G4(Number.parseFloat(Q[2]),0,100),Y=G4(Number.parseFloat(Q[3]),0,100),$=G4(Number.isNaN(J)?1:J,0,1);return[W,G,Y,$]}return null};D6.to.hex=function(...Z){return"#"+s5(Z[0])+s5(Z[1])+s5(Z[2])+(Z[3]<1?s5(Math.round(Z[3]*255)):"")};D6.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]+")"};D6.to.rgb.percent=function(...Z){let X=Math.round(Z[0]/255*100),Q=Math.round(Z[1]/255*100),J=Math.round(Z[2]/255*100);return Z.length<4||Z[3]===1?"rgb("+X+"%, "+Q+"%, "+J+"%)":"rgba("+X+"%, "+Q+"%, "+J+"%, "+Z[3]+")"};D6.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]+")"};D6.to.hwb=function(...Z){let X="";if(Z.length>=4&&Z[3]!==1)X=", "+Z[3];return"hwb("+Z[0]+", "+Z[1]+"%, "+Z[2]+"%"+X+")"};D6.to.keyword=function(...Z){return gU[Z.slice(0,3)]};function G4(Z,X,Q){return Math.min(Math.max(X,Z),Q)}function s5(Z){let X=Math.round(Z).toString(16).toUpperCase();return X.length<2?"0"+X:X}var K9=D6,fU={};for(let Z of Object.keys(M1))fU[M1[Z]]=Z;var t={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"]}},C4=t,v1=0.008856451679035631;function H9(Z){let X=Z>0.0031308?1.055*Z**0.4166666666666667-0.055:Z*12.92;return Math.min(Math.max(0,X),1)}function q9(Z){return Z>0.04045?((Z+0.055)/1.055)**2.4:Z/12.92}for(let Z of Object.keys(t)){if(!("channels"in t[Z]))throw Error("missing channels property: "+Z);if(!("labels"in t[Z]))throw Error("missing channel labels property: "+Z);if(t[Z].labels.length!==t[Z].channels)throw Error("channel and label counts mismatch: "+Z);let{channels:X,labels:Q}=t[Z];delete t[Z].channels,delete t[Z].labels,Object.defineProperty(t[Z],"channels",{value:X}),Object.defineProperty(t[Z],"labels",{value:Q})}t.rgb.hsl=function(Z){let X=Z[0]/255,Q=Z[1]/255,J=Z[2]/255,W=Math.min(X,Q,J),G=Math.max(X,Q,J),Y=G-W,$,z;switch(G){case W:{$=0;break}case X:{$=(Q-J)/Y;break}case Q:{$=2+(J-X)/Y;break}case J:{$=4+(X-Q)/Y;break}}if($=Math.min($*60,360),$<0)$+=360;let U=(W+G)/2;if(G===W)z=0;else if(U<=0.5)z=Y/(G+W);else z=Y/(2-G-W);return[$,z*100,U*100]};t.rgb.hsv=function(Z){let X,Q,J,W,G,Y=Z[0]/255,$=Z[1]/255,z=Z[2]/255,U=Math.max(Y,$,z),V=U-Math.min(Y,$,z),q=function(B){return(U-B)/6/V+0.5};if(V===0)W=0,G=0;else{switch(G=V/U,X=q(Y),Q=q($),J=q(z),U){case Y:{W=J-Q;break}case $:{W=0.3333333333333333+X-J;break}case z:{W=0.6666666666666666+Q-X;break}}if(W<0)W+=1;else if(W>1)W-=1}return[W*360,G*100,U*100]};t.rgb.hwb=function(Z){let X=Z[0],Q=Z[1],J=Z[2],W=t.rgb.hsl(Z)[0],G=0.00392156862745098*Math.min(X,Math.min(Q,J));return J=1-0.00392156862745098*Math.max(X,Math.max(Q,J)),[W,G*100,J*100]};t.rgb.oklab=function(Z){let X=q9(Z[0]/255),Q=q9(Z[1]/255),J=q9(Z[2]/255),W=Math.cbrt(0.4122214708*X+0.5363325363*Q+0.0514459929*J),G=Math.cbrt(0.2119034982*X+0.6806995451*Q+0.1073969566*J),Y=Math.cbrt(0.0883024619*X+0.2817188376*Q+0.6299787005*J),$=0.2104542553*W+0.793617785*G-0.0040720468*Y,z=1.9779984951*W-2.428592205*G+0.4505937099*Y,U=0.0259040371*W+0.7827717662*G-0.808675766*Y;return[$*100,z*100,U*100]};t.rgb.cmyk=function(Z){let X=Z[0]/255,Q=Z[1]/255,J=Z[2]/255,W=Math.min(1-X,1-Q,1-J),G=(1-X-W)/(1-W)||0,Y=(1-Q-W)/(1-W)||0,$=(1-J-W)/(1-W)||0;return[G*100,Y*100,$*100,W*100]};function NT(Z,X){return(Z[0]-X[0])**2+(Z[1]-X[1])**2+(Z[2]-X[2])**2}t.rgb.keyword=function(Z){let X=fU[Z];if(X)return X;let Q=Number.POSITIVE_INFINITY,J;for(let W of Object.keys(M1)){let G=M1[W],Y=NT(Z,G);if(Y<Q)Q=Y,J=W}return J};t.keyword.rgb=function(Z){return[...M1[Z]]};t.rgb.xyz=function(Z){let X=q9(Z[0]/255),Q=q9(Z[1]/255),J=q9(Z[2]/255),W=X*0.4124564+Q*0.3575761+J*0.1804375,G=X*0.2126729+Q*0.7151522+J*0.072175,Y=X*0.0193339+Q*0.119192+J*0.9503041;return[W*100,G*100,Y*100]};t.rgb.lab=function(Z){let X=t.rgb.xyz(Z),Q=X[0],J=X[1],W=X[2];Q/=95.047,J/=100,W/=108.883,Q=Q>v1?Q**0.3333333333333333:7.787*Q+0.13793103448275862,J=J>v1?J**0.3333333333333333:7.787*J+0.13793103448275862,W=W>v1?W**0.3333333333333333:7.787*W+0.13793103448275862;let G=116*J-16,Y=500*(Q-J),$=200*(J-W);return[G,Y,$]};t.hsl.rgb=function(Z){let X=Z[0]/360,Q=Z[1]/100,J=Z[2]/100,W,G;if(Q===0)return G=J*255,[G,G,G];let Y=J<0.5?J*(1+Q):J+Q-J*Q,$=2*J-Y,z=[0,0,0];for(let U=0;U<3;U++){if(W=X+0.3333333333333333*-(U-1),W<0)W++;if(W>1)W--;if(6*W<1)G=$+(Y-$)*6*W;else if(2*W<1)G=Y;else if(3*W<2)G=$+(Y-$)*(0.6666666666666666-W)*6;else G=$;z[U]=G*255}return z};t.hsl.hsv=function(Z){let X=Z[0],Q=Z[1]/100,J=Z[2]/100,W=Q,G=Math.max(J,0.01);J*=2,Q*=J<=1?J:2-J,W*=G<=1?G:2-G;let Y=(J+Q)/2,$=J===0?2*W/(G+W):2*Q/(J+Q);return[X,$*100,Y*100]};t.hsv.rgb=function(Z){let X=Z[0]/60,Q=Z[1]/100,J=Z[2]/100,W=Math.floor(X)%6,G=X-Math.floor(X),Y=255*J*(1-Q),$=255*J*(1-Q*G),z=255*J*(1-Q*(1-G));switch(J*=255,W){case 0:return[J,z,Y];case 1:return[$,J,Y];case 2:return[Y,J,z];case 3:return[Y,$,J];case 4:return[z,Y,J];case 5:return[J,Y,$]}};t.hsv.hsl=function(Z){let X=Z[0],Q=Z[1]/100,J=Z[2]/100,W=Math.max(J,0.01),G,Y;Y=(2-Q)*J;let $=(2-Q)*W;return G=Q*W,G/=$<=1?$:2-$,G=G||0,Y/=2,[X,G*100,Y*100]};t.hwb.rgb=function(Z){let X=Z[0]/360,Q=Z[1]/100,J=Z[2]/100,W=Q+J,G;if(W>1)Q/=W,J/=W;let Y=Math.floor(6*X),$=1-J;if(G=6*X-Y,(Y&1)!==0)G=1-G;let z=Q+G*($-Q),U,V,q;switch(Y){default:case 6:case 0:{U=$,V=z,q=Q;break}case 1:{U=z,V=$,q=Q;break}case 2:{U=Q,V=$,q=z;break}case 3:{U=Q,V=z,q=$;break}case 4:{U=z,V=Q,q=$;break}case 5:{U=$,V=Q,q=z;break}}return[U*255,V*255,q*255]};t.cmyk.rgb=function(Z){let X=Z[0]/100,Q=Z[1]/100,J=Z[2]/100,W=Z[3]/100,G=1-Math.min(1,X*(1-W)+W),Y=1-Math.min(1,Q*(1-W)+W),$=1-Math.min(1,J*(1-W)+W);return[G*255,Y*255,$*255]};t.xyz.rgb=function(Z){let X=Z[0]/100,Q=Z[1]/100,J=Z[2]/100,W,G,Y;return W=X*3.2404542+Q*-1.5371385+J*-0.4985314,G=X*-0.969266+Q*1.8760108+J*0.041556,Y=X*0.0556434+Q*-0.2040259+J*1.0572252,W=H9(W),G=H9(G),Y=H9(Y),[W*255,G*255,Y*255]};t.xyz.lab=function(Z){let X=Z[0],Q=Z[1],J=Z[2];X/=95.047,Q/=100,J/=108.883,X=X>v1?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>v1?Q**0.3333333333333333:7.787*Q+0.13793103448275862,J=J>v1?J**0.3333333333333333:7.787*J+0.13793103448275862;let W=116*Q-16,G=500*(X-Q),Y=200*(Q-J);return[W,G,Y]};t.xyz.oklab=function(Z){let X=Z[0]/100,Q=Z[1]/100,J=Z[2]/100,W=Math.cbrt(0.8189330101*X+0.3618667424*Q-0.1288597137*J),G=Math.cbrt(0.0329845436*X+0.9293118715*Q+0.0361456387*J),Y=Math.cbrt(0.0482003018*X+0.2643662691*Q+0.633851707*J),$=0.2104542553*W+0.793617785*G-0.0040720468*Y,z=1.9779984951*W-2.428592205*G+0.4505937099*Y,U=0.0259040371*W+0.7827717662*G-0.808675766*Y;return[$*100,z*100,U*100]};t.oklab.oklch=function(Z){return t.lab.lch(Z)};t.oklab.xyz=function(Z){let X=Z[0]/100,Q=Z[1]/100,J=Z[2]/100,W=(0.999999998*X+0.396337792*Q+0.215803758*J)**3,G=(1.000000008*X-0.105561342*Q-0.063854175*J)**3,Y=(1.000000055*X-0.089484182*Q-1.291485538*J)**3,$=1.227013851*W-0.55779998*G+0.281256149*Y,z=-0.040580178*W+1.11225687*G-0.071676679*Y,U=-0.076381285*W-0.421481978*G+1.58616322*Y;return[$*100,z*100,U*100]};t.oklab.rgb=function(Z){let X=Z[0]/100,Q=Z[1]/100,J=Z[2]/100,W=(X+0.3963377774*Q+0.2158037573*J)**3,G=(X-0.1055613458*Q-0.0638541728*J)**3,Y=(X-0.0894841775*Q-1.291485548*J)**3,$=H9(4.0767416621*W-3.3077115913*G+0.2309699292*Y),z=H9(-1.2684380046*W+2.6097574011*G-0.3413193965*Y),U=H9(-0.0041960863*W-0.7034186147*G+1.707614701*Y);return[$*255,z*255,U*255]};t.oklch.oklab=function(Z){return t.lch.lab(Z)};t.lab.xyz=function(Z){let X=Z[0],Q=Z[1],J=Z[2],W,G,Y;G=(X+16)/116,W=Q/500+G,Y=G-J/200;let $=G**3,z=W**3,U=Y**3;return G=$>v1?$:(G-0.13793103448275862)/7.787,W=z>v1?z:(W-0.13793103448275862)/7.787,Y=U>v1?U:(Y-0.13793103448275862)/7.787,W*=95.047,G*=100,Y*=108.883,[W,G,Y]};t.lab.lch=function(Z){let X=Z[0],Q=Z[1],J=Z[2],W;if(W=Math.atan2(J,Q)*360/2/Math.PI,W<0)W+=360;let Y=Math.sqrt(Q*Q+J*J);return[X,Y,W]};t.lch.lab=function(Z){let X=Z[0],Q=Z[1],W=Z[2]/360*2*Math.PI,G=Q*Math.cos(W),Y=Q*Math.sin(W);return[X,G,Y]};t.rgb.ansi16=function(Z,X=null){let[Q,J,W]=Z,G=X===null?t.rgb.hsv(Z)[2]:X;if(G=Math.round(G/50),G===0)return 30;let Y=30+(Math.round(W/255)<<2|Math.round(J/255)<<1|Math.round(Q/255));if(G===2)Y+=60;return Y};t.hsv.ansi16=function(Z){return t.rgb.ansi16(t.hsv.rgb(Z),Z[2])};t.rgb.ansi256=function(Z){let X=Z[0],Q=Z[1],J=Z[2];if(X>>4===Q>>4&&Q>>4===J>>4){if(X<8)return 16;if(X>248)return 231;return Math.round((X-8)/247*24)+232}return 16+36*Math.round(X/255*5)+6*Math.round(Q/255*5)+Math.round(J/255*5)};t.ansi16.rgb=function(Z){Z=Z[0];let X=Z%10;if(X===0||X===7){if(Z>50)X+=3.5;return X=X/10.5*255,[X,X,X]}let Q=(Math.trunc(Z>50)+1)*0.5,J=(X&1)*Q*255,W=(X>>1&1)*Q*255,G=(X>>2&1)*Q*255;return[J,W,G]};t.ansi256.rgb=function(Z){if(Z=Z[0],Z>=232){let G=(Z-232)*10+8;return[G,G,G]}Z-=16;let X,Q=Math.floor(Z/36)/5*255,J=Math.floor((X=Z%36)/6)/5*255,W=X%6/5*255;return[Q,J,W]};t.rgb.hex=function(Z){let Q=(((Math.round(Z[0])&255)<<16)+((Math.round(Z[1])&255)<<8)+(Math.round(Z[2])&255)).toString(16).toUpperCase();return"000000".slice(Q.length)+Q};t.hex.rgb=function(Z){let X=Z.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!X)return[0,0,0];let Q=X[0];if(X[0].length===3)Q=[...Q].map(($)=>$+$).join("");let J=Number.parseInt(Q,16),W=J>>16&255,G=J>>8&255,Y=J&255;return[W,G,Y]};t.rgb.hcg=function(Z){let X=Z[0]/255,Q=Z[1]/255,J=Z[2]/255,W=Math.max(Math.max(X,Q),J),G=Math.min(Math.min(X,Q),J),Y=W-G,$,z=Y<1?G/(1-Y):0;if(Y<=0)$=0;else if(W===X)$=(Q-J)/Y%6;else if(W===Q)$=2+(J-X)/Y;else $=4+(X-Q)/Y;return $/=6,$%=1,[$*360,Y*100,z*100]};t.hsl.hcg=function(Z){let X=Z[1]/100,Q=Z[2]/100,J=Q<0.5?2*X*Q:2*X*(1-Q),W=0;if(J<1)W=(Q-0.5*J)/(1-J);return[Z[0],J*100,W*100]};t.hsv.hcg=function(Z){let X=Z[1]/100,Q=Z[2]/100,J=X*Q,W=0;if(J<1)W=(Q-J)/(1-J);return[Z[0],J*100,W*100]};t.hcg.rgb=function(Z){let X=Z[0]/360,Q=Z[1]/100,J=Z[2]/100;if(Q===0)return[J*255,J*255,J*255];let W=[0,0,0],G=X%1*6,Y=G%1,$=1-Y,z=0;switch(Math.floor(G)){case 0:{W[0]=1,W[1]=Y,W[2]=0;break}case 1:{W[0]=$,W[1]=1,W[2]=0;break}case 2:{W[0]=0,W[1]=1,W[2]=Y;break}case 3:{W[0]=0,W[1]=$,W[2]=1;break}case 4:{W[0]=Y,W[1]=0,W[2]=1;break}default:W[0]=1,W[1]=0,W[2]=$}return z=(1-Q)*J,[(Q*W[0]+z)*255,(Q*W[1]+z)*255,(Q*W[2]+z)*255]};t.hcg.hsv=function(Z){let X=Z[1]/100,Q=Z[2]/100,J=X+Q*(1-X),W=0;if(J>0)W=X/J;return[Z[0],W*100,J*100]};t.hcg.hsl=function(Z){let X=Z[1]/100,J=Z[2]/100*(1-X)+0.5*X,W=0;if(J>0&&J<0.5)W=X/(2*J);else if(J>=0.5&&J<1)W=X/(2*(1-J));return[Z[0],W*100,J*100]};t.hcg.hwb=function(Z){let X=Z[1]/100,Q=Z[2]/100,J=X+Q*(1-X);return[Z[0],(J-X)*100,(1-J)*100]};t.hwb.hcg=function(Z){let X=Z[1]/100,J=1-Z[2]/100,W=J-X,G=0;if(W<1)G=(J-W)/(1-W);return[Z[0],W*100,G*100]};t.apple.rgb=function(Z){return[Z[0]/65535*255,Z[1]/65535*255,Z[2]/65535*255]};t.rgb.apple=function(Z){return[Z[0]/255*65535,Z[1]/255*65535,Z[2]/255*65535]};t.gray.rgb=function(Z){return[Z[0]/100*255,Z[0]/100*255,Z[0]/100*255]};t.gray.hsl=function(Z){return[0,0,Z[0]]};t.gray.hsv=t.gray.hsl;t.gray.hwb=function(Z){return[0,100,Z[0]]};t.gray.cmyk=function(Z){return[0,0,0,Z[0]]};t.gray.lab=function(Z){return[Z[0],0,0]};t.gray.hex=function(Z){let X=Math.round(Z[0]/100*255)&255,J=((X<<16)+(X<<8)+X).toString(16).toUpperCase();return"000000".slice(J.length)+J};t.rgb.gray=function(Z){return[(Z[0]+Z[1]+Z[2])/3/255*100]};function DT(){let Z={},X=Object.keys(C4);for(let{length:Q}=X,J=0;J<Q;J++)Z[X[J]]={distance:-1,parent:null};return Z}function TT(Z){let X=DT(),Q=[Z];X[Z].distance=0;while(Q.length>0){let J=Q.pop(),W=Object.keys(C4[J]);for(let{length:G}=W,Y=0;Y<G;Y++){let $=W[Y],z=X[$];if(z.distance===-1)z.distance=X[J].distance+1,z.parent=J,Q.unshift($)}}return X}function wT(Z,X){return function(Q){return X(Z(Q))}}function jT(Z,X){let Q=[X[Z].parent,Z],J=C4[X[Z].parent][Z],W=X[Z].parent;while(X[W].parent)Q.unshift(X[W].parent),J=wT(C4[X[W].parent][W],J),W=X[W].parent;return J.conversion=Q,J}function OT(Z){let X=TT(Z),Q={},J=Object.keys(X);for(let{length:W}=J,G=0;G<W;G++){let Y=J[G];if(X[Y].parent===null)continue;Q[Y]=jT(Y,X)}return Q}var ET=OT,V9={},RT=Object.keys(C4);function PT(Z){let X=function(...Q){let J=Q[0];if(J===void 0||J===null)return J;if(J.length>1)Q=J;return Z(Q)};if("conversion"in Z)X.conversion=Z.conversion;return X}function CT(Z){let X=function(...Q){let J=Q[0];if(J===void 0||J===null)return J;if(J.length>1)Q=J;let W=Z(Q);if(typeof W==="object")for(let{length:G}=W,Y=0;Y<G;Y++)W[Y]=Math.round(W[Y]);return W};if("conversion"in Z)X.conversion=Z.conversion;return X}for(let Z of RT){V9[Z]={},Object.defineProperty(V9[Z],"channels",{value:C4[Z].channels}),Object.defineProperty(V9[Z],"labels",{value:C4[Z].labels});let X=ET(Z),Q=Object.keys(X);for(let J of Q){let W=X[J];V9[Z][J]=CT(W),V9[Z][J].raw=PT(W)}}var k6=V9,hU=["keyword","gray","hex"],aX={};for(let Z of Object.keys(k6))aX[[...k6[Z].labels].sort().join("")]=Z;var oX={};function o0(Z,X){if(!(this instanceof o0))return new o0(Z,X);if(X&&X in hU)X=null;if(X&&!(X in k6))throw Error("Unknown model: "+X);let Q,J;if(Z==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(Z instanceof o0)this.model=Z.model,this.color=[...Z.color],this.valpha=Z.valpha;else if(typeof Z==="string"){let W=K9.get(Z);if(W===null)throw Error("Unable to parse color from string: "+Z);this.model=W.model,J=k6[this.model].channels,this.color=W.value.slice(0,J),this.valpha=typeof W.value[J]==="number"?W.value[J]:1}else if(Z.length>0){this.model=X||"rgb",J=k6[this.model].channels;let W=Array.prototype.slice.call(Z,0,J);this.color=sX(W,J),this.valpha=typeof Z[J]==="number"?Z[J]: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 W=Object.keys(Z);if("alpha"in Z)W.splice(W.indexOf("alpha"),1),this.valpha=typeof Z.alpha==="number"?Z.alpha:0;let G=W.sort().join("");if(!(G in aX))throw Error("Unable to parse color from object: "+JSON.stringify(Z));this.model=aX[G];let{labels:Y}=k6[this.model],$=[];for(Q=0;Q<Y.length;Q++)$.push(Z[Y[Q]]);this.color=sX($)}if(oX[this.model]){J=k6[this.model].channels;for(Q=0;Q<J;Q++){let W=oX[this.model][Q];if(W)this.color[Q]=W(this.color[Q])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}o0.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(Z){let X=this.model in K9.to?this:this.rgb();X=X.round(typeof Z==="number"?Z:1);let Q=X.valpha===1?X.color:[...X.color,this.valpha];return K9.to[X.model](...Q)},percentString(Z){let X=this.rgb().round(typeof Z==="number"?Z:1),Q=X.valpha===1?X.color:[...X.color,this.valpha];return K9.to.rgb.percent(...Q)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let Z={},{channels:X}=k6[this.model],{labels:Q}=k6[this.model];for(let J=0;J<X;J++)Z[Q[J]]=this.color[J];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 o0([...this.color.map(_T(Z)),this.valpha],this.model)},alpha(Z){if(Z!==void 0)return new o0([...this.color,Math.max(0,Math.min(1,Z))],this.model);return this.valpha},red:f0("rgb",0,r0(255)),green:f0("rgb",1,r0(255)),blue:f0("rgb",2,r0(255)),hue:f0(["hsl","hsv","hsl","hwb","hcg"],0,(Z)=>(Z%360+360)%360),saturationl:f0("hsl",1,r0(100)),lightness:f0("hsl",2,r0(100)),saturationv:f0("hsv",1,r0(100)),value:f0("hsv",2,r0(100)),chroma:f0("hcg",1,r0(100)),gray:f0("hcg",2,r0(100)),white:f0("hwb",1,r0(100)),wblack:f0("hwb",2,r0(100)),cyan:f0("cmyk",0,r0(100)),magenta:f0("cmyk",1,r0(100)),yellow:f0("cmyk",2,r0(100)),black:f0("cmyk",3,r0(100)),x:f0("xyz",0,r0(95.047)),y:f0("xyz",1,r0(100)),z:f0("xyz",2,r0(108.833)),l:f0("lab",0,r0(100)),a:f0("lab",1),b:f0("lab",2),keyword(Z){if(Z!==void 0)return new o0(Z);return k6[this.model].keyword(this.color)},hex(Z){if(Z!==void 0)return new o0(Z);return K9.to.hex(...this.rgb().round().color)},hexa(Z){if(Z!==void 0)return new o0(Z);let X=this.rgb().round().color,Q=Math.round(this.valpha*255).toString(16).toUpperCase();if(Q.length===1)Q="0"+Q;return K9.to.hex(...X)+Q},rgbNumber(){let Z=this.rgb().color;return(Z[0]&255)<<16|(Z[1]&255)<<8|Z[2]&255},luminosity(){let Z=this.rgb().color,X=[];for(let[Q,J]of Z.entries()){let W=J/255;X[Q]=W<=0.04045?W/12.92:((W+0.055)/1.055)**2.4}return 0.2126*X[0]+0.7152*X[1]+0.0722*X[2]},contrast(Z){let X=this.luminosity(),Q=Z.luminosity();if(X>Q)return(X+0.05)/(Q+0.05);return(Q+0.05)/(X+0.05)},level(Z){let X=this.contrast(Z);if(X>=7)return"AAA";return X>=4.5?"AA":""},isDark(){let Z=this.rgb().color;return(Z[0]*2126+Z[1]*7152+Z[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let Z=this.rgb();for(let X=0;X<3;X++)Z.color[X]=255-Z.color[X];return Z},lighten(Z){let X=this.hsl();return X.color[2]+=X.color[2]*Z,X},darken(Z){let X=this.hsl();return X.color[2]-=X.color[2]*Z,X},saturate(Z){let X=this.hsl();return X.color[1]+=X.color[1]*Z,X},desaturate(Z){let X=this.hsl();return X.color[1]-=X.color[1]*Z,X},whiten(Z){let X=this.hwb();return X.color[1]+=X.color[1]*Z,X},blacken(Z){let X=this.hwb();return X.color[2]+=X.color[2]*Z,X},grayscale(){let Z=this.rgb().color,X=Z[0]*0.3+Z[1]*0.59+Z[2]*0.11;return o0.rgb(X,X,X)},fade(Z){return this.alpha(this.valpha-this.valpha*Z)},opaquer(Z){return this.alpha(this.valpha+this.valpha*Z)},rotate(Z){let X=this.hsl(),Q=X.color[0];return Q=(Q+Z)%360,Q=Q<0?360+Q:Q,X.color[0]=Q,X},mix(Z,X){if(!Z||!Z.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof Z);let Q=Z.rgb(),J=this.rgb(),W=X===void 0?0.5:X,G=2*W-1,Y=Q.alpha()-J.alpha(),$=((G*Y===-1?G:(G+Y)/(1+G*Y))+1)/2,z=1-$;return o0.rgb($*Q.red()+z*J.red(),$*Q.green()+z*J.green(),$*Q.blue()+z*J.blue(),Q.alpha()*W+J.alpha()*(1-W))}};for(let Z of Object.keys(k6)){if(hU.includes(Z))continue;let{channels:X}=k6[Z];o0.prototype[Z]=function(...Q){if(this.model===Z)return new o0(this);if(Q.length>0)return new o0(Q,Z);return new o0([...kT(k6[this.model][Z].raw(this.color)),this.valpha],Z)},o0[Z]=function(...Q){let J=Q[0];if(typeof J==="number")J=sX(Q,X);return new o0(J,Z)}}function ST(Z,X){return Number(Z.toFixed(X))}function _T(Z){return function(X){return ST(X,Z)}}function f0(Z,X,Q){Z=Array.isArray(Z)?Z:[Z];for(let J of Z)(oX[J]||=[])[X]=Q;return Z=Z[0],function(J){let W;if(J!==void 0){if(Q)J=Q(J);return W=this[Z](),W.color[X]=J,W}if(W=this[Z]().color[X],Q)W=Q(W);return W}}function r0(Z){return function(X){return Math.max(0,Math.min(Z,X))}}function kT(Z){return Array.isArray(Z)?Z:[Z]}function sX(Z,X){for(let Q=0;Q<X;Q++)if(typeof Z[Q]!=="number")Z[Q]=0;return Z}var xT=o0});var lU=C((Hh,dU)=>{dU.exports=mU().default});function bT(Z){return this._setBackgroundColourOption("tint",Z),this}function vT(Z){return this.options.greyscale=K.bool(Z)?Z:!0,this}function yT(Z){return this.greyscale(Z)}function gT(Z){if(!K.string(Z))throw K.invalidParameterError("colourspace","string",Z);return this.options.colourspacePipeline=Z,this}function fT(Z){return this.pipelineColourspace(Z)}function hT(Z){if(!K.string(Z))throw K.invalidParameterError("colourspace","string",Z);return this.options.colourspace=Z,this}function uT(Z){return this.toColourspace(Z)}function iU(Z){if(K.object(Z)||K.string(Z)&&Z.length>=3&&Z.length<=200){let X=pU.default(Z),Q=X.red(),J=X.green(),W=X.blue(),G=Math.round(X.alpha()*255);for(let[Y,$]of[["red",Q],["green",J],["blue",W],["alpha",G]])if(!K.number($))throw K.invalidParameterError(`background.${Y}`,"number",$);return[Q,J,W,G]}else throw K.invalidParameterError("background","object or string",Z)}function mT(Z,X){if(K.defined(X))this.options[Z]=iU(X)}var pU,cU,nU=(Z)=>{Object.assign(Z.prototype,{tint:bT,greyscale:vT,grayscale:yT,pipelineColourspace:gT,pipelineColorspace:fT,toColourspace:hT,toColorspace:uT,_getBackgroundColourOption:iU,_setBackgroundColourOption:mT}),Z.colourspace=cU,Z.colorspace=cU};var rU=s(()=>{V1();pU=J1(lU(),1);/*!
|
|
238
310
|
Copyright 2013 Lovell Fuller and others.
|
|
239
311
|
SPDX-License-Identifier: Apache-2.0
|
|
240
|
-
*/
|
|
312
|
+
*/cU={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"}});function lT(){return this.options.removeAlpha=!0,this}function cT(Z){if(K.defined(Z))if(K.number(Z)&&K.inRange(Z,0,1))this.options.ensureAlpha=Z;else throw K.invalidParameterError("alpha","number between 0 and 1",Z);else this.options.ensureAlpha=1;return this}function pT(Z){let X={red:0,green:1,blue:2,alpha:3};if(Object.keys(X).includes(Z))Z=X[Z];if(K.integer(Z)&&K.inRange(Z,0,4))this.options.extractChannel=Z;else throw K.invalidParameterError("channel","integer or one of: red, green, blue, alpha",Z);return this}function iT(Z,X){if(Array.isArray(Z))Z.forEach(function(Q){this.options.joinChannelIn.push(this._createInputDescriptor(Q,X))},this);else this.options.joinChannelIn.push(this._createInputDescriptor(Z,X));return this}function nT(Z){if(K.string(Z)&&K.inArray(Z,["and","or","eor"]))this.options.bandBoolOp=Z;else throw K.invalidParameterError("boolOp","one of: and, or, eor",Z);return this}var dT,aU=(Z)=>{Object.assign(Z.prototype,{removeAlpha:lT,ensureAlpha:cT,extractChannel:pT,joinChannel:iT,bandbool:nT}),Z.bool=dT};var oU=s(()=>{V1();/*!
|
|
241
313
|
Copyright 2013 Lovell Fuller and others.
|
|
242
314
|
SPDX-License-Identifier: Apache-2.0
|
|
243
|
-
*/S2={and:"and",or:"or",eor:"eor"}});import g7 from"node:path";function g2(Z,X){let Q;if(!$.string(Z))Q=Error("Missing output file path");else if($.string(this.options.input.file)&&g7.resolve(this.options.input.file)===g7.resolve(Z))Q=Error("Cannot use same file for input and output");else if(y2.test(g7.extname(Z))&&!this.constructor.format.jp2.output.file)Q=sz();if(Q)if($.fn(X))X(Q);else return Promise.reject(Q);else{this.options.fileOut=Z;let W=Error();return this._pipeline(X,W)}return this}function f2(Z,X){if($.object(Z))this._setBooleanOption("resolveWithObject",Z.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let Q=Error();return this._pipeline($.fn(Z)?Z:X,Q)}function h2(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let Z=Error();return this._pipeline(null,Z)}function u2(Z){if($.number(Z)&&Z>0)this.options.withMetadataDensity=Z;else throw $.invalidParameterError("density","positive number",Z);return this.keepExif()}function m2(){return this.options.keepMetadata|=1,this}function l2(Z){if($.object(Z))for(let[X,Q]of Object.entries(Z))if($.object(Q))for(let[W,J]of Object.entries(Q))if($.string(J))this.options.withExif[`exif-${X.toLowerCase()}-${W}`]=J;else throw $.invalidParameterError(`${X}.${W}`,"string",J);else throw $.invalidParameterError(X,"object",Q);else throw $.invalidParameterError("exif","object",Z);return this.options.withExifMerge=!1,this.keepExif()}function d2(Z){return this.withExif(Z),this.options.withExifMerge=!0,this}function c2(){return this.options.keepMetadata|=8,this}function p2(Z,X){if($.string(Z))this.options.withIccProfile=Z;else throw $.invalidParameterError("icc","string",Z);if(this.keepIccProfile(),$.object(X)){if($.defined(X.attach))if($.bool(X.attach)){if(!X.attach)this.options.keepMetadata&=-9}else throw $.invalidParameterError("attach","boolean",X.attach)}return this}function n2(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function i2(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function r2(){return this.options.keepMetadata|=2,this}function a2(Z){if($.string(Z)&&Z.length>0)this.options.withXmp=Z,this.options.keepMetadata|=2;else throw $.invalidParameterError("xmp","non-empty string",Z);return this}function s2(){return this.options.keepMetadata|=31,this}function o2(Z){if(this.keepMetadata(),this.withIccProfile("srgb"),$.object(Z)){if($.defined(Z.orientation))if($.integer(Z.orientation)&&$.inRange(Z.orientation,1,8))this.options.withMetadataOrientation=Z.orientation;else throw $.invalidParameterError("orientation","integer between 1 and 8",Z.orientation);if($.defined(Z.density))if($.number(Z.density)&&Z.density>0)this.options.withMetadataDensity=Z.density;else throw $.invalidParameterError("density","positive number",Z.density);if($.defined(Z.icc))this.withIccProfile(Z.icc);if($.defined(Z.exif))this.withExifMerge(Z.exif)}return this}function t2(Z,X){let Q=az.get(($.object(Z)&&$.string(Z.id)?Z.id:Z).toLowerCase());if(!Q)throw $.invalidParameterError("format",`one of: ${[...az.keys()].join(", ")}`,Z);return this[Q](X)}function e2(Z){if($.object(Z)){if($.defined(Z.quality))if($.integer(Z.quality)&&$.inRange(Z.quality,1,100))this.options.jpegQuality=Z.quality;else throw $.invalidParameterError("quality","integer between 1 and 100",Z.quality);if($.defined(Z.progressive))this._setBooleanOption("jpegProgressive",Z.progressive);if($.defined(Z.chromaSubsampling))if($.string(Z.chromaSubsampling)&&$.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=Z.chromaSubsampling;else throw $.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);let X=$.bool(Z.optimizeCoding)?Z.optimizeCoding:Z.optimiseCoding;if($.defined(X))this._setBooleanOption("jpegOptimiseCoding",X);if($.defined(Z.mozjpeg))if($.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 $.invalidParameterError("mozjpeg","boolean",Z.mozjpeg);let Q=$.bool(Z.trellisQuantization)?Z.trellisQuantization:Z.trellisQuantisation;if($.defined(Q))this._setBooleanOption("jpegTrellisQuantisation",Q);if($.defined(Z.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",Z.overshootDeringing);let W=$.bool(Z.optimizeScans)?Z.optimizeScans:Z.optimiseScans;if($.defined(W)){if(this._setBooleanOption("jpegOptimiseScans",W),W)this.options.jpegProgressive=!0}let J=$.number(Z.quantizationTable)?Z.quantizationTable:Z.quantisationTable;if($.defined(J))if($.integer(J)&&$.inRange(J,0,8))this.options.jpegQuantisationTable=J;else throw $.invalidParameterError("quantisationTable","integer between 0 and 8",J)}return this._updateFormatOut("jpeg",Z)}function ZN(Z){if($.object(Z)){if($.defined(Z.progressive))this._setBooleanOption("pngProgressive",Z.progressive);if($.defined(Z.compressionLevel))if($.integer(Z.compressionLevel)&&$.inRange(Z.compressionLevel,0,9))this.options.pngCompressionLevel=Z.compressionLevel;else throw $.invalidParameterError("compressionLevel","integer between 0 and 9",Z.compressionLevel);if($.defined(Z.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",Z.adaptiveFiltering);let X=Z.colours||Z.colors;if($.defined(X))if($.integer(X)&&$.inRange(X,2,256))this.options.pngBitdepth=oz(X);else throw $.invalidParameterError("colours","integer between 2 and 256",X);if($.defined(Z.palette))this._setBooleanOption("pngPalette",Z.palette);else if([Z.quality,Z.effort,Z.colours,Z.colors,Z.dither].some($.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if($.defined(Z.quality))if($.integer(Z.quality)&&$.inRange(Z.quality,0,100))this.options.pngQuality=Z.quality;else throw $.invalidParameterError("quality","integer between 0 and 100",Z.quality);if($.defined(Z.effort))if($.integer(Z.effort)&&$.inRange(Z.effort,1,10))this.options.pngEffort=Z.effort;else throw $.invalidParameterError("effort","integer between 1 and 10",Z.effort);if($.defined(Z.dither))if($.number(Z.dither)&&$.inRange(Z.dither,0,1))this.options.pngDither=Z.dither;else throw $.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither)}}return this._updateFormatOut("png",Z)}function XN(Z){if($.object(Z)){if($.defined(Z.quality))if($.integer(Z.quality)&&$.inRange(Z.quality,1,100))this.options.webpQuality=Z.quality;else throw $.invalidParameterError("quality","integer between 1 and 100",Z.quality);if($.defined(Z.alphaQuality))if($.integer(Z.alphaQuality)&&$.inRange(Z.alphaQuality,0,100))this.options.webpAlphaQuality=Z.alphaQuality;else throw $.invalidParameterError("alphaQuality","integer between 0 and 100",Z.alphaQuality);if($.defined(Z.lossless))this._setBooleanOption("webpLossless",Z.lossless);if($.defined(Z.nearLossless))this._setBooleanOption("webpNearLossless",Z.nearLossless);if($.defined(Z.smartSubsample))this._setBooleanOption("webpSmartSubsample",Z.smartSubsample);if($.defined(Z.smartDeblock))this._setBooleanOption("webpSmartDeblock",Z.smartDeblock);if($.defined(Z.preset))if($.string(Z.preset)&&$.inArray(Z.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=Z.preset;else throw $.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",Z.preset);if($.defined(Z.effort))if($.integer(Z.effort)&&$.inRange(Z.effort,0,6))this.options.webpEffort=Z.effort;else throw $.invalidParameterError("effort","integer between 0 and 6",Z.effort);if($.defined(Z.minSize))this._setBooleanOption("webpMinSize",Z.minSize);if($.defined(Z.mixed))this._setBooleanOption("webpMixed",Z.mixed);if($.defined(Z.exact))this._setBooleanOption("webpExact",Z.exact)}return f7(Z,this.options),this._updateFormatOut("webp",Z)}function QN(Z){if($.object(Z)){if($.defined(Z.reuse))this._setBooleanOption("gifReuse",Z.reuse);if($.defined(Z.progressive))this._setBooleanOption("gifProgressive",Z.progressive);let X=Z.colours||Z.colors;if($.defined(X))if($.integer(X)&&$.inRange(X,2,256))this.options.gifBitdepth=oz(X);else throw $.invalidParameterError("colours","integer between 2 and 256",X);if($.defined(Z.effort))if($.integer(Z.effort)&&$.inRange(Z.effort,1,10))this.options.gifEffort=Z.effort;else throw $.invalidParameterError("effort","integer between 1 and 10",Z.effort);if($.defined(Z.dither))if($.number(Z.dither)&&$.inRange(Z.dither,0,1))this.options.gifDither=Z.dither;else throw $.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither);if($.defined(Z.interFrameMaxError))if($.number(Z.interFrameMaxError)&&$.inRange(Z.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=Z.interFrameMaxError;else throw $.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",Z.interFrameMaxError);if($.defined(Z.interPaletteMaxError))if($.number(Z.interPaletteMaxError)&&$.inRange(Z.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=Z.interPaletteMaxError;else throw $.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",Z.interPaletteMaxError);if($.defined(Z.keepDuplicateFrames))if($.bool(Z.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",Z.keepDuplicateFrames);else throw $.invalidParameterError("keepDuplicateFrames","boolean",Z.keepDuplicateFrames)}return f7(Z,this.options),this._updateFormatOut("gif",Z)}function WN(Z){if(!this.constructor.format.jp2.output.buffer)throw sz();if($.object(Z)){if($.defined(Z.quality))if($.integer(Z.quality)&&$.inRange(Z.quality,1,100))this.options.jp2Quality=Z.quality;else throw $.invalidParameterError("quality","integer between 1 and 100",Z.quality);if($.defined(Z.lossless))if($.bool(Z.lossless))this.options.jp2Lossless=Z.lossless;else throw $.invalidParameterError("lossless","boolean",Z.lossless);if($.defined(Z.tileWidth))if($.integer(Z.tileWidth)&&$.inRange(Z.tileWidth,1,32768))this.options.jp2TileWidth=Z.tileWidth;else throw $.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if($.defined(Z.tileHeight))if($.integer(Z.tileHeight)&&$.inRange(Z.tileHeight,1,32768))this.options.jp2TileHeight=Z.tileHeight;else throw $.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if($.defined(Z.chromaSubsampling))if($.string(Z.chromaSubsampling)&&$.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=Z.chromaSubsampling;else throw $.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling)}return this._updateFormatOut("jp2",Z)}function f7(Z,X){if($.object(Z)&&$.defined(Z.loop))if($.integer(Z.loop)&&$.inRange(Z.loop,0,65535))X.loop=Z.loop;else throw $.invalidParameterError("loop","integer between 0 and 65535",Z.loop);if($.object(Z)&&$.defined(Z.delay))if($.integer(Z.delay)&&$.inRange(Z.delay,0,65535))X.delay=[Z.delay];else if(Array.isArray(Z.delay)&&Z.delay.every($.integer)&&Z.delay.every((Q)=>$.inRange(Q,0,65535)))X.delay=Z.delay;else throw $.invalidParameterError("delay","integer or an array of integers between 0 and 65535",Z.delay)}function JN(Z){if($.object(Z)){if($.defined(Z.quality))if($.integer(Z.quality)&&$.inRange(Z.quality,1,100))this.options.tiffQuality=Z.quality;else throw $.invalidParameterError("quality","integer between 1 and 100",Z.quality);if($.defined(Z.bitdepth))if($.integer(Z.bitdepth)&&$.inArray(Z.bitdepth,[1,2,4]))this.options.tiffBitdepth=Z.bitdepth;else throw $.invalidParameterError("bitdepth","1, 2 or 4",Z.bitdepth);if($.defined(Z.tile))this._setBooleanOption("tiffTile",Z.tile);if($.defined(Z.tileWidth))if($.integer(Z.tileWidth)&&$.inRange(Z.tileWidth,1,32768))this.options.tiffTileWidth=Z.tileWidth;else throw $.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if($.defined(Z.tileHeight))if($.integer(Z.tileHeight)&&$.inRange(Z.tileHeight,1,32768))this.options.tiffTileHeight=Z.tileHeight;else throw $.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if($.defined(Z.miniswhite))this._setBooleanOption("tiffMiniswhite",Z.miniswhite);if($.defined(Z.pyramid))this._setBooleanOption("tiffPyramid",Z.pyramid);if($.defined(Z.xres))if($.number(Z.xres)&&$.inRange(Z.xres,0.001,1e6))this.options.tiffXres=Z.xres;else throw $.invalidParameterError("xres","number between 0.001 and 1000000",Z.xres);if($.defined(Z.yres))if($.number(Z.yres)&&$.inRange(Z.yres,0.001,1e6))this.options.tiffYres=Z.yres;else throw $.invalidParameterError("yres","number between 0.001 and 1000000",Z.yres);if($.defined(Z.compression))if($.string(Z.compression)&&$.inArray(Z.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=Z.compression;else throw $.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",Z.compression);if($.defined(Z.bigtiff))this._setBooleanOption("tiffBigtiff",Z.bigtiff);if($.defined(Z.predictor))if($.string(Z.predictor)&&$.inArray(Z.predictor,["none","horizontal","float"]))this.options.tiffPredictor=Z.predictor;else throw $.invalidParameterError("predictor","one of: none, horizontal, float",Z.predictor);if($.defined(Z.resolutionUnit))if($.string(Z.resolutionUnit)&&$.inArray(Z.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=Z.resolutionUnit;else throw $.invalidParameterError("resolutionUnit","one of: inch, cm",Z.resolutionUnit)}return this._updateFormatOut("tiff",Z)}function GN(Z){return this.heif({...Z,compression:"av1"})}function YN(Z){if($.object(Z)){if($.string(Z.compression)&&$.inArray(Z.compression,["av1","hevc"]))this.options.heifCompression=Z.compression;else throw $.invalidParameterError("compression","one of: av1, hevc",Z.compression);if($.defined(Z.quality))if($.integer(Z.quality)&&$.inRange(Z.quality,1,100))this.options.heifQuality=Z.quality;else throw $.invalidParameterError("quality","integer between 1 and 100",Z.quality);if($.defined(Z.lossless))if($.bool(Z.lossless))this.options.heifLossless=Z.lossless;else throw $.invalidParameterError("lossless","boolean",Z.lossless);if($.defined(Z.effort))if($.integer(Z.effort)&&$.inRange(Z.effort,0,9))this.options.heifEffort=Z.effort;else throw $.invalidParameterError("effort","integer between 0 and 9",Z.effort);if($.defined(Z.chromaSubsampling))if($.string(Z.chromaSubsampling)&&$.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=Z.chromaSubsampling;else throw $.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);if($.defined(Z.bitdepth))if($.integer(Z.bitdepth)&&$.inArray(Z.bitdepth,[8,10,12]))this.options.heifBitdepth=Z.bitdepth;else throw $.invalidParameterError("bitdepth","8, 10 or 12",Z.bitdepth);if($.defined(Z.tune))if($.string(Z.tune)&&$.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 $.invalidParameterError("tune","one of: auto, iq, psnr, ssim",Z.tune)}else throw $.invalidParameterError("options","Object",Z);return this._updateFormatOut("heif",Z)}function zN(Z){if($.object(Z)){if($.defined(Z.quality))if($.integer(Z.quality)&&$.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 $.invalidParameterError("quality","integer between 1 and 100",Z.quality);else if($.defined(Z.distance))if($.number(Z.distance)&&$.inRange(Z.distance,0,15))this.options.jxlDistance=Z.distance;else throw $.invalidParameterError("distance","number between 0.0 and 15.0",Z.distance);if($.defined(Z.decodingTier))if($.integer(Z.decodingTier)&&$.inRange(Z.decodingTier,0,4))this.options.jxlDecodingTier=Z.decodingTier;else throw $.invalidParameterError("decodingTier","integer between 0 and 4",Z.decodingTier);if($.defined(Z.lossless))if($.bool(Z.lossless))this.options.jxlLossless=Z.lossless;else throw $.invalidParameterError("lossless","boolean",Z.lossless);if($.defined(Z.effort))if($.integer(Z.effort)&&$.inRange(Z.effort,1,9))this.options.jxlEffort=Z.effort;else throw $.invalidParameterError("effort","integer between 1 and 9",Z.effort)}return f7(Z,this.options),this._updateFormatOut("jxl",Z)}function $N(Z){if($.object(Z)){if($.defined(Z.depth))if($.string(Z.depth)&&$.inArray(Z.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=Z.depth;else throw $.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",Z.depth)}return this._updateFormatOut("raw")}function qN(Z){if($.object(Z)){if($.defined(Z.size))if($.integer(Z.size)&&$.inRange(Z.size,1,8192))this.options.tileSize=Z.size;else throw $.invalidParameterError("size","integer between 1 and 8192",Z.size);if($.defined(Z.overlap))if($.integer(Z.overlap)&&$.inRange(Z.overlap,0,8192)){if(Z.overlap>this.options.tileSize)throw $.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,Z.overlap);this.options.tileOverlap=Z.overlap}else throw $.invalidParameterError("overlap","integer between 0 and 8192",Z.overlap);if($.defined(Z.container))if($.string(Z.container)&&$.inArray(Z.container,["fs","zip"]))this.options.tileContainer=Z.container;else throw $.invalidParameterError("container","one of: fs, zip",Z.container);if($.defined(Z.layout))if($.string(Z.layout)&&$.inArray(Z.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=Z.layout;else throw $.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",Z.layout);if($.defined(Z.angle))if($.integer(Z.angle)&&!(Z.angle%90))this.options.tileAngle=Z.angle;else throw $.invalidParameterError("angle","positive/negative multiple of 90",Z.angle);if(this._setBackgroundColourOption("tileBackground",Z.background),$.defined(Z.depth))if($.string(Z.depth)&&$.inArray(Z.depth,["onepixel","onetile","one"]))this.options.tileDepth=Z.depth;else throw $.invalidParameterError("depth","one of: onepixel, onetile, one",Z.depth);if($.defined(Z.skipBlanks))if($.integer(Z.skipBlanks)&&$.inRange(Z.skipBlanks,-1,65535))this.options.tileSkipBlanks=Z.skipBlanks;else throw $.invalidParameterError("skipBlanks","integer between -1 and 255/65535",Z.skipBlanks);else if($.defined(Z.layout)&&Z.layout==="google")this.options.tileSkipBlanks=5;let X=$.bool(Z.center)?Z.center:Z.centre;if($.defined(X))this._setBooleanOption("tileCentre",X);if($.defined(Z.id))if($.string(Z.id))this.options.tileId=Z.id;else throw $.invalidParameterError("id","string",Z.id);if($.defined(Z.basename))if($.string(Z.basename))this.options.tileBasename=Z.basename;else throw $.invalidParameterError("basename","string",Z.basename)}if($.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw $.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function KN(Z){if(!$.plainObject(Z))throw $.invalidParameterError("options","object",Z);if($.integer(Z.seconds)&&$.inRange(Z.seconds,0,3600))this.options.timeoutSeconds=Z.seconds;else throw $.invalidParameterError("seconds","integer between 0 and 3600",Z.seconds);return this}function UN(Z,X){if(!($.object(X)&&X.force===!1))this.options.formatOut=Z;return this}function VN(Z,X){if($.bool(X))this.options[Z]=X;else throw $.invalidParameterError(Z,"boolean",X)}function BN(){if(!this.options.streamOut){this.options.streamOut=!0;let Z=Error();this._pipeline(void 0,Z)}}function HN(Z,X){if(typeof Z==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),q0.pipeline(this.options,(Q,W,J)=>{if(Q)Z($.nativeError(Q,X));else Z(null,W,J)})});else q0.pipeline(this.options,(Q,W,J)=>{if(Q)Z($.nativeError(Q,X));else Z(null,W,J)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),q0.pipeline(this.options,(Q,W,J)=>{if(Q)this.emit("error",$.nativeError(Q,X));else this.emit("info",J),this.push(W);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else q0.pipeline(this.options,(Q,W,J)=>{if(Q)this.emit("error",$.nativeError(Q,X));else this.emit("info",J),this.push(W);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((Q,W)=>{this.once("finish",()=>{this._flattenBufferIn(),q0.pipeline(this.options,(J,G,Y)=>{if(J)W($.nativeError(J,X));else if(this.options.resolveWithObject)Q({data:G,info:Y});else Q(G)})})});else return new Promise((Q,W)=>{q0.pipeline(this.options,(J,G,Y)=>{if(J)W($.nativeError(J,X));else if(this.options.resolveWithObject)Q({data:G,info:Y});else Q(G)})})}var az,y2,sz=()=>Error("JP2 output requires libvips with support for OpenJPEG"),oz=(Z)=>1<<31-Math.clz32(Math.ceil(Math.log2(Z))),tz=(Z)=>{Object.assign(Z.prototype,{toFile:g2,toBuffer:f2,toUint8Array:h2,withDensity:u2,keepExif:m2,withExif:l2,withExifMerge:d2,keepIccProfile:c2,withIccProfile:p2,keepGainMap:n2,withGainMap:i2,keepXmp:r2,withXmp:a2,keepMetadata:s2,withMetadata:o2,toFormat:t2,jpeg:e2,jp2:WN,png:ZN,webp:XN,tiff:JN,avif:GN,heif:YN,jxl:zN,gif:QN,raw:$N,tile:qN,timeout:KN,_updateFormatOut:UN,_setBooleanOption:VN,_read:BN,_pipeline:HN})};var ez=c(()=>{v4();B9();/*!
|
|
315
|
+
*/dT={and:"and",or:"or",eor:"eor"}});import eX from"node:path";function aT(Z,X){let Q;if(!K.string(Z))Q=Error("Missing output file path");else if(K.string(this.options.input.file)&&eX.resolve(this.options.input.file)===eX.resolve(Z))Q=Error("Cannot use same file for input and output");else if(rT.test(eX.extname(Z))&&!this.constructor.format.jp2.output.file)Q=tU();if(Q)if(K.fn(X))X(Q);else return Promise.reject(Q);else{this.options.fileOut=Z;let J=Error();return this._pipeline(X,J)}return this}function oT(Z,X){if(K.object(Z))this._setBooleanOption("resolveWithObject",Z.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let Q=Error();return this._pipeline(K.fn(Z)?Z:X,Q)}function sT(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let Z=Error();return this._pipeline(null,Z)}function tT(Z){if(K.number(Z)&&Z>0)this.options.withMetadataDensity=Z;else throw K.invalidParameterError("density","positive number",Z);return this.keepExif()}function eT(){return this.options.keepMetadata|=1,this}function Zw(Z){if(K.object(Z))for(let[X,Q]of Object.entries(Z))if(K.object(Q))for(let[J,W]of Object.entries(Q))if(K.string(W))this.options.withExif[`exif-${X.toLowerCase()}-${J}`]=W;else throw K.invalidParameterError(`${X}.${J}`,"string",W);else throw K.invalidParameterError(X,"object",Q);else throw K.invalidParameterError("exif","object",Z);return this.options.withExifMerge=!1,this.keepExif()}function Xw(Z){return this.withExif(Z),this.options.withExifMerge=!0,this}function Qw(){return this.options.keepMetadata|=8,this}function Jw(Z,X){if(K.string(Z))this.options.withIccProfile=Z;else throw K.invalidParameterError("icc","string",Z);if(this.keepIccProfile(),K.object(X)){if(K.defined(X.attach))if(K.bool(X.attach)){if(!X.attach)this.options.keepMetadata&=-9}else throw K.invalidParameterError("attach","boolean",X.attach)}return this}function Ww(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function Gw(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function Yw(){return this.options.keepMetadata|=2,this}function $w(Z){if(K.string(Z)&&Z.length>0)this.options.withXmp=Z,this.options.keepMetadata|=2;else throw K.invalidParameterError("xmp","non-empty string",Z);return this}function zw(){return this.options.keepMetadata|=31,this}function Uw(Z){if(this.keepMetadata(),this.withIccProfile("srgb"),K.object(Z)){if(K.defined(Z.orientation))if(K.integer(Z.orientation)&&K.inRange(Z.orientation,1,8))this.options.withMetadataOrientation=Z.orientation;else throw K.invalidParameterError("orientation","integer between 1 and 8",Z.orientation);if(K.defined(Z.density))if(K.number(Z.density)&&Z.density>0)this.options.withMetadataDensity=Z.density;else throw K.invalidParameterError("density","positive number",Z.density);if(K.defined(Z.icc))this.withIccProfile(Z.icc);if(K.defined(Z.exif))this.withExifMerge(Z.exif)}return this}function Kw(Z,X){let Q=sU.get((K.object(Z)&&K.string(Z.id)?Z.id:Z).toLowerCase());if(!Q)throw K.invalidParameterError("format",`one of: ${[...sU.keys()].join(", ")}`,Z);return this[Q](X)}function Vw(Z){if(K.object(Z)){if(K.defined(Z.quality))if(K.integer(Z.quality)&&K.inRange(Z.quality,1,100))this.options.jpegQuality=Z.quality;else throw K.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(K.defined(Z.progressive))this._setBooleanOption("jpegProgressive",Z.progressive);if(K.defined(Z.chromaSubsampling))if(K.string(Z.chromaSubsampling)&&K.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=Z.chromaSubsampling;else throw K.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);let X=K.bool(Z.optimizeCoding)?Z.optimizeCoding:Z.optimiseCoding;if(K.defined(X))this._setBooleanOption("jpegOptimiseCoding",X);if(K.defined(Z.mozjpeg))if(K.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 K.invalidParameterError("mozjpeg","boolean",Z.mozjpeg);let Q=K.bool(Z.trellisQuantization)?Z.trellisQuantization:Z.trellisQuantisation;if(K.defined(Q))this._setBooleanOption("jpegTrellisQuantisation",Q);if(K.defined(Z.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",Z.overshootDeringing);let J=K.bool(Z.optimizeScans)?Z.optimizeScans:Z.optimiseScans;if(K.defined(J)){if(this._setBooleanOption("jpegOptimiseScans",J),J)this.options.jpegProgressive=!0}let W=K.number(Z.quantizationTable)?Z.quantizationTable:Z.quantisationTable;if(K.defined(W))if(K.integer(W)&&K.inRange(W,0,8))this.options.jpegQuantisationTable=W;else throw K.invalidParameterError("quantisationTable","integer between 0 and 8",W)}return this._updateFormatOut("jpeg",Z)}function Hw(Z){if(K.object(Z)){if(K.defined(Z.progressive))this._setBooleanOption("pngProgressive",Z.progressive);if(K.defined(Z.compressionLevel))if(K.integer(Z.compressionLevel)&&K.inRange(Z.compressionLevel,0,9))this.options.pngCompressionLevel=Z.compressionLevel;else throw K.invalidParameterError("compressionLevel","integer between 0 and 9",Z.compressionLevel);if(K.defined(Z.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",Z.adaptiveFiltering);let X=Z.colours||Z.colors;if(K.defined(X))if(K.integer(X)&&K.inRange(X,2,256))this.options.pngBitdepth=eU(X);else throw K.invalidParameterError("colours","integer between 2 and 256",X);if(K.defined(Z.palette))this._setBooleanOption("pngPalette",Z.palette);else if([Z.quality,Z.effort,Z.colours,Z.colors,Z.dither].some(K.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(K.defined(Z.quality))if(K.integer(Z.quality)&&K.inRange(Z.quality,0,100))this.options.pngQuality=Z.quality;else throw K.invalidParameterError("quality","integer between 0 and 100",Z.quality);if(K.defined(Z.effort))if(K.integer(Z.effort)&&K.inRange(Z.effort,1,10))this.options.pngEffort=Z.effort;else throw K.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(K.defined(Z.dither))if(K.number(Z.dither)&&K.inRange(Z.dither,0,1))this.options.pngDither=Z.dither;else throw K.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither)}}return this._updateFormatOut("png",Z)}function qw(Z){if(K.object(Z)){if(K.defined(Z.quality))if(K.integer(Z.quality)&&K.inRange(Z.quality,1,100))this.options.webpQuality=Z.quality;else throw K.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(K.defined(Z.alphaQuality))if(K.integer(Z.alphaQuality)&&K.inRange(Z.alphaQuality,0,100))this.options.webpAlphaQuality=Z.alphaQuality;else throw K.invalidParameterError("alphaQuality","integer between 0 and 100",Z.alphaQuality);if(K.defined(Z.lossless))this._setBooleanOption("webpLossless",Z.lossless);if(K.defined(Z.nearLossless))this._setBooleanOption("webpNearLossless",Z.nearLossless);if(K.defined(Z.smartSubsample))this._setBooleanOption("webpSmartSubsample",Z.smartSubsample);if(K.defined(Z.smartDeblock))this._setBooleanOption("webpSmartDeblock",Z.smartDeblock);if(K.defined(Z.preset))if(K.string(Z.preset)&&K.inArray(Z.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=Z.preset;else throw K.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",Z.preset);if(K.defined(Z.effort))if(K.integer(Z.effort)&&K.inRange(Z.effort,0,6))this.options.webpEffort=Z.effort;else throw K.invalidParameterError("effort","integer between 0 and 6",Z.effort);if(K.defined(Z.minSize))this._setBooleanOption("webpMinSize",Z.minSize);if(K.defined(Z.mixed))this._setBooleanOption("webpMixed",Z.mixed);if(K.defined(Z.exact))this._setBooleanOption("webpExact",Z.exact)}return ZQ(Z,this.options),this._updateFormatOut("webp",Z)}function Bw(Z){if(K.object(Z)){if(K.defined(Z.reuse))this._setBooleanOption("gifReuse",Z.reuse);if(K.defined(Z.progressive))this._setBooleanOption("gifProgressive",Z.progressive);let X=Z.colours||Z.colors;if(K.defined(X))if(K.integer(X)&&K.inRange(X,2,256))this.options.gifBitdepth=eU(X);else throw K.invalidParameterError("colours","integer between 2 and 256",X);if(K.defined(Z.effort))if(K.integer(Z.effort)&&K.inRange(Z.effort,1,10))this.options.gifEffort=Z.effort;else throw K.invalidParameterError("effort","integer between 1 and 10",Z.effort);if(K.defined(Z.dither))if(K.number(Z.dither)&&K.inRange(Z.dither,0,1))this.options.gifDither=Z.dither;else throw K.invalidParameterError("dither","number between 0.0 and 1.0",Z.dither);if(K.defined(Z.interFrameMaxError))if(K.number(Z.interFrameMaxError)&&K.inRange(Z.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=Z.interFrameMaxError;else throw K.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",Z.interFrameMaxError);if(K.defined(Z.interPaletteMaxError))if(K.number(Z.interPaletteMaxError)&&K.inRange(Z.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=Z.interPaletteMaxError;else throw K.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",Z.interPaletteMaxError);if(K.defined(Z.keepDuplicateFrames))if(K.bool(Z.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",Z.keepDuplicateFrames);else throw K.invalidParameterError("keepDuplicateFrames","boolean",Z.keepDuplicateFrames)}return ZQ(Z,this.options),this._updateFormatOut("gif",Z)}function Fw(Z){if(!this.constructor.format.jp2.output.buffer)throw tU();if(K.object(Z)){if(K.defined(Z.quality))if(K.integer(Z.quality)&&K.inRange(Z.quality,1,100))this.options.jp2Quality=Z.quality;else throw K.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(K.defined(Z.lossless))if(K.bool(Z.lossless))this.options.jp2Lossless=Z.lossless;else throw K.invalidParameterError("lossless","boolean",Z.lossless);if(K.defined(Z.tileWidth))if(K.integer(Z.tileWidth)&&K.inRange(Z.tileWidth,1,32768))this.options.jp2TileWidth=Z.tileWidth;else throw K.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if(K.defined(Z.tileHeight))if(K.integer(Z.tileHeight)&&K.inRange(Z.tileHeight,1,32768))this.options.jp2TileHeight=Z.tileHeight;else throw K.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if(K.defined(Z.chromaSubsampling))if(K.string(Z.chromaSubsampling)&&K.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=Z.chromaSubsampling;else throw K.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling)}return this._updateFormatOut("jp2",Z)}function ZQ(Z,X){if(K.object(Z)&&K.defined(Z.loop))if(K.integer(Z.loop)&&K.inRange(Z.loop,0,65535))X.loop=Z.loop;else throw K.invalidParameterError("loop","integer between 0 and 65535",Z.loop);if(K.object(Z)&&K.defined(Z.delay))if(K.integer(Z.delay)&&K.inRange(Z.delay,0,65535))X.delay=[Z.delay];else if(Array.isArray(Z.delay)&&Z.delay.every(K.integer)&&Z.delay.every((Q)=>K.inRange(Q,0,65535)))X.delay=Z.delay;else throw K.invalidParameterError("delay","integer or an array of integers between 0 and 65535",Z.delay)}function Lw(Z){if(K.object(Z)){if(K.defined(Z.quality))if(K.integer(Z.quality)&&K.inRange(Z.quality,1,100))this.options.tiffQuality=Z.quality;else throw K.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(K.defined(Z.bitdepth))if(K.integer(Z.bitdepth)&&K.inArray(Z.bitdepth,[1,2,4]))this.options.tiffBitdepth=Z.bitdepth;else throw K.invalidParameterError("bitdepth","1, 2 or 4",Z.bitdepth);if(K.defined(Z.tile))this._setBooleanOption("tiffTile",Z.tile);if(K.defined(Z.tileWidth))if(K.integer(Z.tileWidth)&&K.inRange(Z.tileWidth,1,32768))this.options.tiffTileWidth=Z.tileWidth;else throw K.invalidParameterError("tileWidth","integer between 1 and 32768",Z.tileWidth);if(K.defined(Z.tileHeight))if(K.integer(Z.tileHeight)&&K.inRange(Z.tileHeight,1,32768))this.options.tiffTileHeight=Z.tileHeight;else throw K.invalidParameterError("tileHeight","integer between 1 and 32768",Z.tileHeight);if(K.defined(Z.miniswhite))this._setBooleanOption("tiffMiniswhite",Z.miniswhite);if(K.defined(Z.pyramid))this._setBooleanOption("tiffPyramid",Z.pyramid);if(K.defined(Z.xres))if(K.number(Z.xres)&&K.inRange(Z.xres,0.001,1e6))this.options.tiffXres=Z.xres;else throw K.invalidParameterError("xres","number between 0.001 and 1000000",Z.xres);if(K.defined(Z.yres))if(K.number(Z.yres)&&K.inRange(Z.yres,0.001,1e6))this.options.tiffYres=Z.yres;else throw K.invalidParameterError("yres","number between 0.001 and 1000000",Z.yres);if(K.defined(Z.compression))if(K.string(Z.compression)&&K.inArray(Z.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=Z.compression;else throw K.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",Z.compression);if(K.defined(Z.bigtiff))this._setBooleanOption("tiffBigtiff",Z.bigtiff);if(K.defined(Z.predictor))if(K.string(Z.predictor)&&K.inArray(Z.predictor,["none","horizontal","float"]))this.options.tiffPredictor=Z.predictor;else throw K.invalidParameterError("predictor","one of: none, horizontal, float",Z.predictor);if(K.defined(Z.resolutionUnit))if(K.string(Z.resolutionUnit)&&K.inArray(Z.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=Z.resolutionUnit;else throw K.invalidParameterError("resolutionUnit","one of: inch, cm",Z.resolutionUnit)}return this._updateFormatOut("tiff",Z)}function Mw(Z){return this.heif({...Z,compression:"av1"})}function Aw(Z){if(K.object(Z)){if(K.string(Z.compression)&&K.inArray(Z.compression,["av1","hevc"]))this.options.heifCompression=Z.compression;else throw K.invalidParameterError("compression","one of: av1, hevc",Z.compression);if(K.defined(Z.quality))if(K.integer(Z.quality)&&K.inRange(Z.quality,1,100))this.options.heifQuality=Z.quality;else throw K.invalidParameterError("quality","integer between 1 and 100",Z.quality);if(K.defined(Z.lossless))if(K.bool(Z.lossless))this.options.heifLossless=Z.lossless;else throw K.invalidParameterError("lossless","boolean",Z.lossless);if(K.defined(Z.effort))if(K.integer(Z.effort)&&K.inRange(Z.effort,0,9))this.options.heifEffort=Z.effort;else throw K.invalidParameterError("effort","integer between 0 and 9",Z.effort);if(K.defined(Z.chromaSubsampling))if(K.string(Z.chromaSubsampling)&&K.inArray(Z.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=Z.chromaSubsampling;else throw K.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",Z.chromaSubsampling);if(K.defined(Z.bitdepth))if(K.integer(Z.bitdepth)&&K.inArray(Z.bitdepth,[8,10,12]))this.options.heifBitdepth=Z.bitdepth;else throw K.invalidParameterError("bitdepth","8, 10 or 12",Z.bitdepth);if(K.defined(Z.tune))if(K.string(Z.tune)&&K.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 K.invalidParameterError("tune","one of: auto, iq, psnr, ssim",Z.tune)}else throw K.invalidParameterError("options","Object",Z);return this._updateFormatOut("heif",Z)}function Iw(Z){if(K.object(Z)){if(K.defined(Z.quality))if(K.integer(Z.quality)&&K.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 K.invalidParameterError("quality","integer between 1 and 100",Z.quality);else if(K.defined(Z.distance))if(K.number(Z.distance)&&K.inRange(Z.distance,0,15))this.options.jxlDistance=Z.distance;else throw K.invalidParameterError("distance","number between 0.0 and 15.0",Z.distance);if(K.defined(Z.decodingTier))if(K.integer(Z.decodingTier)&&K.inRange(Z.decodingTier,0,4))this.options.jxlDecodingTier=Z.decodingTier;else throw K.invalidParameterError("decodingTier","integer between 0 and 4",Z.decodingTier);if(K.defined(Z.lossless))if(K.bool(Z.lossless))this.options.jxlLossless=Z.lossless;else throw K.invalidParameterError("lossless","boolean",Z.lossless);if(K.defined(Z.effort))if(K.integer(Z.effort)&&K.inRange(Z.effort,1,9))this.options.jxlEffort=Z.effort;else throw K.invalidParameterError("effort","integer between 1 and 9",Z.effort)}return ZQ(Z,this.options),this._updateFormatOut("jxl",Z)}function Nw(Z){if(K.object(Z)){if(K.defined(Z.depth))if(K.string(Z.depth)&&K.inArray(Z.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=Z.depth;else throw K.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",Z.depth)}return this._updateFormatOut("raw")}function Dw(Z){if(K.object(Z)){if(K.defined(Z.size))if(K.integer(Z.size)&&K.inRange(Z.size,1,8192))this.options.tileSize=Z.size;else throw K.invalidParameterError("size","integer between 1 and 8192",Z.size);if(K.defined(Z.overlap))if(K.integer(Z.overlap)&&K.inRange(Z.overlap,0,8192)){if(Z.overlap>this.options.tileSize)throw K.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,Z.overlap);this.options.tileOverlap=Z.overlap}else throw K.invalidParameterError("overlap","integer between 0 and 8192",Z.overlap);if(K.defined(Z.container))if(K.string(Z.container)&&K.inArray(Z.container,["fs","zip"]))this.options.tileContainer=Z.container;else throw K.invalidParameterError("container","one of: fs, zip",Z.container);if(K.defined(Z.layout))if(K.string(Z.layout)&&K.inArray(Z.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=Z.layout;else throw K.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",Z.layout);if(K.defined(Z.angle))if(K.integer(Z.angle)&&!(Z.angle%90))this.options.tileAngle=Z.angle;else throw K.invalidParameterError("angle","positive/negative multiple of 90",Z.angle);if(this._setBackgroundColourOption("tileBackground",Z.background),K.defined(Z.depth))if(K.string(Z.depth)&&K.inArray(Z.depth,["onepixel","onetile","one"]))this.options.tileDepth=Z.depth;else throw K.invalidParameterError("depth","one of: onepixel, onetile, one",Z.depth);if(K.defined(Z.skipBlanks))if(K.integer(Z.skipBlanks)&&K.inRange(Z.skipBlanks,-1,65535))this.options.tileSkipBlanks=Z.skipBlanks;else throw K.invalidParameterError("skipBlanks","integer between -1 and 255/65535",Z.skipBlanks);else if(K.defined(Z.layout)&&Z.layout==="google")this.options.tileSkipBlanks=5;let X=K.bool(Z.center)?Z.center:Z.centre;if(K.defined(X))this._setBooleanOption("tileCentre",X);if(K.defined(Z.id))if(K.string(Z.id))this.options.tileId=Z.id;else throw K.invalidParameterError("id","string",Z.id);if(K.defined(Z.basename))if(K.string(Z.basename))this.options.tileBasename=Z.basename;else throw K.invalidParameterError("basename","string",Z.basename)}if(K.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw K.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function Tw(Z){if(!K.plainObject(Z))throw K.invalidParameterError("options","object",Z);if(K.integer(Z.seconds)&&K.inRange(Z.seconds,0,3600))this.options.timeoutSeconds=Z.seconds;else throw K.invalidParameterError("seconds","integer between 0 and 3600",Z.seconds);return this}function ww(Z,X){if(!(K.object(X)&&X.force===!1))this.options.formatOut=Z;return this}function jw(Z,X){if(K.bool(X))this.options[Z]=X;else throw K.invalidParameterError(Z,"boolean",X)}function Ow(){if(!this.options.streamOut){this.options.streamOut=!0;let Z=Error();this._pipeline(void 0,Z)}}function Ew(Z,X){if(typeof Z==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),E0.pipeline(this.options,(Q,J,W)=>{if(Q)Z(K.nativeError(Q,X));else Z(null,J,W)})});else E0.pipeline(this.options,(Q,J,W)=>{if(Q)Z(K.nativeError(Q,X));else Z(null,J,W)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),E0.pipeline(this.options,(Q,J,W)=>{if(Q)this.emit("error",K.nativeError(Q,X));else this.emit("info",W),this.push(J);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else E0.pipeline(this.options,(Q,J,W)=>{if(Q)this.emit("error",K.nativeError(Q,X));else this.emit("info",W),this.push(J);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((Q,J)=>{this.once("finish",()=>{this._flattenBufferIn(),E0.pipeline(this.options,(W,G,Y)=>{if(W)J(K.nativeError(W,X));else if(this.options.resolveWithObject)Q({data:G,info:Y});else Q(G)})})});else return new Promise((Q,J)=>{E0.pipeline(this.options,(W,G,Y)=>{if(W)J(K.nativeError(W,X));else if(this.options.resolveWithObject)Q({data:G,info:Y});else Q(G)})})}var sU,rT,tU=()=>Error("JP2 output requires libvips with support for OpenJPEG"),eU=(Z)=>1<<31-Math.clz32(Math.ceil(Math.log2(Z))),ZK=(Z)=>{Object.assign(Z.prototype,{toFile:aT,toBuffer:oT,toUint8Array:sT,withDensity:tT,keepExif:eT,withExif:Zw,withExifMerge:Xw,keepIccProfile:Qw,withIccProfile:Jw,keepGainMap:Ww,withGainMap:Gw,keepXmp:Yw,withXmp:$w,keepMetadata:zw,withMetadata:Uw,toFormat:Kw,jpeg:Vw,jp2:Fw,png:Hw,webp:qw,tiff:Lw,avif:Mw,heif:Aw,jxl:Iw,gif:Bw,raw:Nw,tile:Dw,timeout:Tw,_updateFormatOut:ww,_setBooleanOption:jw,_read:Ow,_pipeline:Ew})};var XK=s(()=>{V1();Y8();/*!
|
|
244
316
|
Copyright 2013 Lovell Fuller and others.
|
|
245
317
|
SPDX-License-Identifier: Apache-2.0
|
|
246
|
-
*/
|
|
318
|
+
*/sU=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"]]),rT=/\.(jp[2x]|j2[kc])$/i});import Rw from"node:events";import{createRequire as Pw}from"node:module";import{availableParallelism as Cw}from"node:os";function JK(Z){if(K.bool(Z))if(Z)return E0.cache(50,20,100);else return E0.cache(0,0,0);else if(K.object(Z)){for(let X of["memory","files","items"]){let Q=Z[X];if(K.defined(Q)&&!(K.integer(Q)&&Q>=0))throw K.invalidParameterError(X,"a positive integer",Q)}return E0.cache(Z.memory,Z.files,Z.items)}else return E0.cache()}function _w(Z){return E0.concurrency(K.integer(Z)?Z:null)}function xw(){return E0.counters()}function bw(Z){return E0.simd(K.bool(Z)?Z:null)}function vw(Z){if(K.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(K.string))E0.block(Z.operation,!0);else throw K.invalidParameterError("operation","Array<string>",Z.operation);else throw K.invalidParameterError("options","object",Z)}function yw(Z){if(K.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(K.string))E0.block(Z.operation,!1);else throw K.invalidParameterError("operation","Array<string>",Z.operation);else throw K.invalidParameterError("options","object",Z)}var $8,XQ,QK,QQ,Y4,Sw,B9,kw,WK=(Z)=>{Z.cache=JK,Z.concurrency=_w,Z.counters=xw,Z.simd=bw,Z.format=Y4,Z.interpolators=Sw,Z.versions=B9,Z.queue=kw,Z.block=vw,Z.unblock=yw};var GK=s(()=>{V1();lX();Y8();n5();$8=J1(x5(),1);/*!
|
|
247
319
|
Copyright 2013 Lovell Fuller and others.
|
|
248
320
|
SPDX-License-Identifier: Apache-2.0
|
|
249
|
-
*/
|
|
321
|
+
*/XQ=Pw(import.meta.url),QK=r5.runtimePlatformArch(),QQ=E0.libvipsVersion(),Y4=E0.format();Y4.heif.output.alias=["avif","heic"];Y4.jpeg.output.alias=["jpe","jpg"];Y4.tiff.output.alias=["tif"];Y4.jp2.output.alias=["j2c","j2k","jp2","jpx"];Sw={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},B9={vips:QQ.semver};if(!QQ.isGlobal)if(!QQ.isWasm)try{B9=XQ(`@img/sharp-${QK}/versions`)}catch(Z){try{B9=XQ(`@img/sharp-libvips-${QK}/versions`)}catch(X){}}else try{B9=XQ("@img/sharp-wasm32/versions")}catch(Z){}B9.sharp=x1.version;if(B9.heif&&Y4.heif)Y4.heif.input.fileSuffix=[".avif"],Y4.heif.output.alias=["avif"];JK(!0);if(!process.env.MALLOC_ARENA_MAX&&$8.default.familySync()===$8.default.GLIBC&&!E0._isUsingJemalloc())E0.concurrency(1);else if($8.default.familySync()===$8.default.MUSL&&E0.concurrency()===1024)E0.concurrency(Cw());kw=new Rw.EventEmitter});var JQ={};D1(JQ,{default:()=>gw});var gw;var WQ=s(()=>{DU();jU();SU();kU();vU();rU();oU();XK();GK();/*!
|
|
250
322
|
Copyright 2013 Lovell Fuller and others.
|
|
251
323
|
SPDX-License-Identifier: Apache-2.0
|
|
252
|
-
*/Dz(u4);Rz(u4);Cz(u4);bz(u4);pz(u4);iz(u4);tz(u4);Q$(u4);ON=u4});import{createHash as J$}from"node:crypto";import{existsSync as EN,mkdirSync as RN,readFileSync as PN}from"node:fs";import{basename as CN,extname as SN,resolve as d7}from"node:path";import{createRequire as kN}from"node:module";async function G$(){if(P1)return P1;try{return P1=(await Promise.resolve().then(() => (l7(),m7))).default,P1}catch{}try{return P1=kN(d7(process.cwd(),"package.json"))("sharp"),P1}catch(Z){throw Error(`Sharp is required for image optimization but failed to load: ${F6(Z)}`,{cause:Z})}}async function c7(Z){let Q=await(await G$())(Z).metadata();return{format:Q.format??"unknown",height:Q.height??0,width:Q.width??0}}function F9(Z){let X=PN(Z);return J$("md5").update(X).digest("hex").slice(0,8)}function p7(Z){let X=JSON.stringify({formats:Z.formats,quality:Z.quality,widths:Z.widths});return J$("md5").update(X).digest("hex").slice(0,8)}function _N(Z,X,Q,W){return`${Z}-${X}-${Q}.${W}`}async function Y$(Z,X,Q){let W=await G$(),J=await c7(Z),G=F9(Z),Y=CN(Z,SN(Z)),z=d7(X,"_optimized");RN(z,{recursive:!0});let q=[],K=Q.widths.filter((H)=>H<=J.width);if(K.length===0||!K.includes(J.width))K.push(J.width);K.sort((H,F)=>H-F);let V=[];for(let H of K)for(let F of Q.formats){let A=_N(Y,H,G,F),M=`/${bN}/${A}`,I=d7(z,A);if(q.push({absolutePath:I,format:F,outputPath:M,width:H}),EN(I))continue;let N=Q.quality[F]??80,T=W(Z).resize(H).toFormat(F,{quality:N}).toFile(I).then(()=>{});V.push(T)}let B=4;for(let H=0;H<V.length;H+=B)await Promise.all(V.slice(H,H+B));return{contentHash:G,original:{format:J.format,height:J.height,width:J.width},variants:q}}function n7(Z,X){return Z.filter((Q)=>Q.format===X).map((Q)=>`${Q.outputPath} ${Q.width}w`).join(", ")}var P1=null,bN="images/_optimized";var i7=c(()=>{A6()});import{existsSync as xN,mkdirSync as vN,readFileSync as yN,writeFileSync as gN}from"node:fs";import{basename as fN,resolve as a8}from"node:path";import{execSync as hN}from"node:child_process";import{tmpdir as uN}from"node:os";function C1(Z){if(L9===void 0)try{let X=hN("npm config get cache",{cwd:uN(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();L9=X&&X!=="undefined"?X:null}catch{L9=null}if(L9)return a8(L9,"jxsuite-images",fN(Z));return a8(Z,".cache/images")}function z$(Z){let X=a8(C1(Z),"manifest.json");if(!xN(X))return{entries:{},version:1};try{return JSON.parse(yN(X,"utf8"))}catch{return{entries:{},version:1}}}function $$(Z,X){let Q=C1(Z);vN(Q,{recursive:!0}),gN(a8(Q,"manifest.json"),JSON.stringify(X,null,2),"utf8")}function q$(Z,X){let Q=Z.entries[X];if(!Q)return null;return Q.manifest}function K$(Z,X,Q,W){Z.entries[X]={manifest:W,source:Q,timestamp:Date.now()}}var L9;var r7=c(()=>{i7()});import{existsSync as a7}from"node:fs";import{basename as mN,extname as B$,resolve as U$}from"node:path";async function F$(Z,X){let Q=X.get(Z);if(!Q){let W=F9(Z);try{let J=await c7(Z);Q={width:J.width,height:J.height,hash:W}}catch(J){if(!V$)V$=!0,console.warn(`Could not read image dimensions (${J.message}) — `+"emitting srcsets without width/height attributes.");Q={width:null,height:null,hash:W}}X.set(Z,Q)}return Q}function s8(Z,X,Q,W){let J=X.quality?.webp??80,G=Z.startsWith("/")?"":"/",Y=W?`?v=${W}`:"";return X.widths.filter((z)=>z<=Q).toSorted((z,q)=>z-q).map((z)=>`/cdn-cgi/image/width=${z},quality=${J},fit=scale-down,format=auto${G}${Z}${Y} ${z}w`).join(", ")}async function L$(Z,X,Q,W,J){let G=`${F9(Z)}:${p7(Q)}`,Y=q$(J,G);if(Y){if(Y.variants.every((K)=>a7(K.absolutePath)))return Y}if(!Y)console.log(` Optimizing ${mN(Z)}...`);let z=await Y$(Z,C1(W),Q);return K$(J,G,X,z),z}function A$(Z){if(typeof Z!=="string")return!0;if(!Z)return!0;if(Z.includes("${"))return!0;if(lN.some((X)=>Z.startsWith(X)))return!0;if(H$.has(B$(Z).toLowerCase()))return!0;return!1}function M$(Z,X){if(X.service!=="cloudflare")return!1;if(!X.remoteDomains?.length)return!1;if(typeof Z!=="string"||!Z.startsWith("https://"))return!1;if(Z.includes("${"))return!1;try{let Q=new URL(Z);if(H$.has(B$(Q.pathname).toLowerCase()))return!1;return X.remoteDomains.includes(Q.hostname)}catch{return!1}}function I$(Z,X){if(Z.startsWith("/"))return U$(X,"public",Z.slice(1));return U$(X,Z)}async function N$(Z,X,Q,W,J){let G=new Map;if(!X.optimize)return{imageRefs:G};return await D$(Z,X,Q,W,J??new Map,G),{imageRefs:G}}async function D$(Z,X,Q,W,J,G){if(!Z||typeof Z!=="object")return;if(Z.tagName==="img")await dN(Z,X,Q,W,J,G);if(typeof Z.innerHTML==="string"&&Z.innerHTML.includes("<img"))Z.innerHTML=await rN(Z.innerHTML,X,Q,W,J,G);if(Array.isArray(Z.children))for(let Y of Z.children){if(typeof Y==="string")continue;await D$(Y,X,Q,W,J,G)}}async function dN(Z,X,Q,W,J,G){if(!Z.attributes)Z.attributes={};let Y=Z.attributes.src??Z.src;if(typeof Y!=="string")return;let z=M$(Y,X);if(!z&&A$(Y))return;if(Z.attributes["data-no-optimize"]!==void 0)return;let q;if(z)q=s8(Y,X,1/0,null);else{let K=I$(Y,Q);if(!a7(K))return;if(X.service==="cloudflare"){let V=await F$(K,J);q=s8(Y,X,V.width??1/0,V.hash)}else{let V=G.get(K);if(!V)V=await L$(K,Y,X,Q,W),G.set(K,V);let B=X.formats.includes("avif")?"avif":X.formats[0];q=n7(V.variants,B)}}if(q)Z.attributes.srcset=q,Z.attributes.sizes??=X.sizes;if(X.lazyLoad&&Z.attributes.loading!=="eager")Z.attributes.loading="lazy",Z.attributes.decoding="async"}async function rN(Z,X,Q,W,J,G){let Y=[];for(let q of Z.matchAll(cN)){let K=q[0],V=q[1];if(nN.test(V))continue;if(iN.test(V))continue;let B=V.match(pN);if(!B)continue;let H=B[1].replaceAll("&","&"),F=M$(H,X);if(!F&&A$(H))continue;let A=F?null:I$(H,Q);if(A&&!a7(A))continue;let M;if(F)M=s8(H,X,1/0,null);else if(X.service==="cloudflare"){let N=await F$(A,J);M=s8(H,X,N.width??1/0,N.hash)}else{let N=G.get(A);if(!N)N=await L$(A,H,X,Q,W),G.set(A,N);let T=X.formats.includes("avif")?"avif":X.formats[0];M=n7(N.variants,T)}if(!M)continue;let I=` srcset="${M}" sizes="${X.sizes}"`;if(X.lazyLoad&&!/\bloading="eager"/.test(V)){if(!/\bloading=/.test(V))I+=' loading="lazy"';if(!/\bdecoding=/.test(V))I+=' decoding="async"'}Y.push({match:K,replacement:`<img${V}${I}>`})}let z=Z;for(let{match:q,replacement:K}of Y)z=z.replace(q,K);return z}var H$,lN,V$=!1,cN,pN,nN,iN;var T$=c(()=>{i7();r7();H$=new Set([".svg",".gif"]),lN=["http://","https://","data:","//"];cN=/<img\b([^>]*)>/gi,pN=/\bsrc="([^"]*)"/,nN=/\bsrcset="/,iN=/\bdata-no-optimize\b/});var R$={};x6(R$,{buildSite:()=>XD});import{copyFileSync as aN,cpSync as s7,existsSync as p6,mkdirSync as E6,readFileSync as sN,readdirSync as oN,rmSync as tN,statSync as eN,writeFileSync as L4}from"node:fs";import{basename as ZD,dirname as S1,join as k1,resolve as k0}from"node:path";async function XD(Z,X={}){let{clean:Q=!0,verbose:W=!1}=X,J=[],G=W?console.log.bind(console):()=>{};G("Loading project.json...");let{config:Y}=A1(Z);if("contentTypes"in Y)throw Error('project.json declares "contentTypes", which is no longer supported. Run `bun scripts/migrate-project-extensions.ts <project>` to migrate to "extensions" + "content", then `jx schema`.');let z=k0(Z,Y.build.outDir),q=k0(Z,"pages"),K=k0(Z,"public"),V=Y.build.trailingSlash??"always",B=await M6(Z,Y),H=B.formats;if(H.entries.length>0)G(` Registered ${H.entries.length} format(s): ${H.entries.map((r)=>r.name).join(", ")}`);let F=B.serverMounts().filter((r)=>{if(!r.project)return!0;let Q0=Y[r.project.key];return Q0!==void 0&&typeof Q0==="object"&&Object.keys(Q0).length>0});if(F.length>0&&!Y.build.adapter){let r=F.map((Q0)=>Q0.project?`"${Q0.project.key}"`:`"${Q0.server.basePath}"`).join(", ");throw Error(`project.json declares dynamic section(s) ${r} served by extension mounts, but `+'build.adapter is "static". Dynamic tables need a server-capable adapter — set '+'build.adapter to "cloudflare-workers", "cloudflare-pages", "node", or "bun".')}if(Q&&p6(z))tN(z,{force:!0,recursive:!0});if(E6(z,{recursive:!0}),!p6(q))throw Error(`pages/ directory not found in ${Z}`);G("Discovering pages...");let A=await xJ(q,H);G(` Found ${A.length} page(s)`),G("Loading project sections...");let M=await fJ(Z,Y,B),I=Object.keys(M);if(I.length>0)G(` Loaded ${I.length} section(s): ${I.join(", ")}`);let N=await yJ(A,Z,M,B,Y);G(` ${N.length} route(s) after expansion`);let T=0,S=k0(Z,"components"),v=[],x=new Map,p=new Map;if(p6(S)){G("Compiling components...");let r=[".json",...H.documentExtensions("component")],Q0=oN(S).filter((U0)=>r.some((R0)=>U0.endsWith(R0))),g=k0(z,"components");E6(g,{recursive:!0});for(let U0 of Q0)try{let R0=k0(S,U0),M0=await w8(R0,{...Y.$media?{$media:Y.$media}:{},formats:H});for(let H0 of M0.files){let q4=ZD(H0.path);if(L4(k0(g,q4),H0.content,"utf8"),H0.tagName)v.push(H0.tagName);T+=1}let J0=await J9(R0,H);if(J0.tagName){p.set(J0.tagName,J0);let H0=IQ(J0.tagName,J0.style,J0,Y.$media??{});if(H0)x.set(J0.tagName,H0),L4(k0(g,`${J0.tagName}.css`),H0,"utf8"),T+=1}}catch(R0){let M0=R0;J.push(`Error compiling component ${U0}: ${M0.message}`),console.error(`Error compiling component ${U0}: ${M0.message}`)}G(` Compiled ${v.length} component(s): ${v.join(", ")}`)}let f=[];if(Y.build.adapter)for(let[,r]of p){let Q0=X8(r);for(let g of Q0){let U0=`./components/${g.src.replace(/^\.\//,"")}`;f.push({exportName:g.exportName,src:U0})}}let s=Y.images.optimize&&Y.images.service==="cloudflare",K0=Y.images.optimize&&!s?z$(Z):null,E0=s?new Map:null;if(s)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 f0=Y.url,N4=Boolean(f0)&&Y.build.sitemap!==!1,$4=[];for(let r of N)try{G(` Compiling ${r.urlPattern} ...`);let Q0=await QD(r,Y,Z,M,K0,p,E0,H,B),g=new Set;for(let[M0,J0]of p)if(e5(J0))g.add(M0);if(v.length>0)Q0.html=YD(Q0.html,v,x,g);let U0=E$(r.urlPattern,z,V);E6(S1(U0),{recursive:!0}),L4(U0,Q0.html,"utf8"),T+=1;let R0=!r.urlPattern.includes(":")&&!r.urlPattern.includes("*");if(N4&&!Q0.excludeFromSitemap&&R0)$4.push({lastmod:eN(r.sourcePath).mtime,loc:new URL(r.urlPattern,f0).href});for(let M0 of H.withCapability("serialize")){if(!M0.exportTarget)continue;try{let J0=await M0.call("serialize",Q0.doc,{buildScope:(H0)=>K1(H0,null),componentDefs:p,evaluateTemplate:(H0,q4)=>{if(!e(H0))return;return l0(H0,q4)??H0},mode:"export"});if(J0){let H0=U0.replace(/\.html$/,M0.extensions[0]);L4(H0,J0,"utf8"),T+=1}}catch(J0){let H0=J0;J.push(`Error exporting ${M0.name} for ${r.urlPattern}: ${H0.message}`)}}for(let M0 of Q0.files){let J0=k0(S1(U0),M0.path);E6(S1(J0),{recursive:!0}),L4(J0,M0.content,"utf8"),T+=1}if(Q0.serverHandler){let M0=k0(S1(U0),"_server.js");L4(M0,Q0.serverHandler,"utf8"),T+=1}}catch(Q0){let g=Q0,U0=`Error compiling ${r.urlPattern}: ${g.message}`;J.push(U0),console.error(U0)}if(K0&&Y.images.optimize){$$(Z,K0);let r=k0(C1(Z),"_optimized");if(p6(r)){let g=k0(z,"images/_optimized");E6(g,{recursive:!0}),s7(r,g,{recursive:!0})}let Q0=Object.keys(K0.entries).length;if(Q0>0)G(` Optimized ${Q0} image(s)`)}if(Y.build.adapter){let{adapter:r}=Y.build;G("Generating site-wide server worker...");let Q0=new Map;for(let J0 of f)if(!Q0.has(J0.exportName))Q0.set(J0.exportName,J0);let{mounts:g,connectors:U0}=WD(F,B,Y);if(g.length>0)G(` Mounting ${g.length} extension route(s): ${g.map((J0)=>J0.basePath).join(", ")}`);let M0=r==="cloudflare-pages"&&Q0.size===0&&g.length===0?null:lZ([...Q0.values()],{adapter:r,connectors:U0,mounts:g});if(M0){let J0=r==="cloudflare-pages"?"_worker.js":"worker.js";if(L4(k0(z,J0),M0,"utf8"),T+=1,G(` Generated dist/${J0} (${Q0.size} server function(s))`),r==="cloudflare-pages")L4(k0(z,"_routes.json"),`${JSON.stringify({exclude:[],include:["/_jx/*"],version:1},null,2)}
|
|
253
|
-
`,"utf8"),T+=1;let
|
|
254
|
-
Build complete: ${
|
|
255
|
-
${
|
|
324
|
+
*/wU(L1);CU(L1);_U(L1);bU(L1);nU(L1);aU(L1);ZK(L1);WK(L1);gw=L1});import{createHash as YK}from"node:crypto";import{existsSync as fw,mkdirSync as hw,readFileSync as uw}from"node:fs";import{basename as mw,extname as dw,resolve as GQ}from"node:path";import{createRequire as lw}from"node:module";async function $K(){if(F9)return F9;try{return F9=(await Promise.resolve().then(() => (WQ(),JQ))).default,F9}catch{}try{return F9=lw(GQ(process.cwd(),"package.json"))("sharp"),F9}catch(Z){throw Error(`Sharp is required for image optimization but failed to load: ${a1(Z)}`,{cause:Z})}}async function YQ(Z){let Q=await(await $K())(Z).metadata();return{format:Q.format??"unknown",height:Q.height??0,width:Q.width??0}}function z8(Z){let X=uw(Z);return YK("md5").update(X).digest("hex").slice(0,8)}function $Q(Z){let X=JSON.stringify({formats:Z.formats,quality:Z.quality,widths:Z.widths});return YK("md5").update(X).digest("hex").slice(0,8)}function pw(Z,X,Q,J){return`${Z}-${X}-${Q}.${J}`}async function zK(Z,X,Q){let J=await $K(),W=await YQ(Z),G=z8(Z),Y=mw(Z,dw(Z)),$=GQ(X,"_optimized");hw($,{recursive:!0});let z=[],U=Q.widths.filter((B)=>B<=W.width);if(U.length===0||!U.includes(W.width))U.push(W.width);U.sort((B,F)=>B-F);let V=[];for(let B of U)for(let F of Q.formats){let L=pw(Y,B,G,F),I=`/${cw}/${L}`,A=GQ($,L);if(z.push({absolutePath:A,format:F,outputPath:I,width:B}),fw(A))continue;let N=Q.quality[F]??80,D=J(Z).resize(B).toFormat(F,{quality:N}).toFile(A).then(()=>{});V.push(D)}let q=4;for(let B=0;B<V.length;B+=q)await Promise.all(V.slice(B,B+q));return{contentHash:G,original:{format:W.format,height:W.height,width:W.width},variants:z}}function zQ(Z,X){return Z.filter((Q)=>Q.format===X).map((Q)=>`${Q.outputPath} ${Q.width}w`).join(", ")}var F9=null,cw="images/_optimized";var UQ=s(()=>{s1()});import{existsSync as iw,mkdirSync as nw,readFileSync as rw,rmSync as aw,writeFileSync as ow}from"node:fs";import{basename as sw,resolve as t5}from"node:path";import{execSync as tw}from"node:child_process";import{tmpdir as ew}from"node:os";function L9(Z){if(U8===void 0)try{let X=tw("npm config get cache",{cwd:ew(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();U8=X&&X!=="undefined"?X:null}catch{U8=null}if(U8)return t5(U8,"jxsuite-images",sw(Z));return t5(Z,".cache/images")}function UK(Z){let X=t5(L9(Z),"manifest.json");if(!iw(X))return{entries:{},touched:new Set,version:1};try{let Q=JSON.parse(rw(X,"utf8"));return Q.touched=new Set,Q}catch{return{entries:{},touched:new Set,version:1}}}function KK(Z,X,Q={}){if(Q.prune&&X.touched)Zj(X,X.touched);let J=L9(Z);nw(J,{recursive:!0}),ow(t5(J,"manifest.json"),JSON.stringify({entries:X.entries,version:X.version},null,2),"utf8")}function Zj(Z,X){let Q=new Set;for(let[J,W]of Object.entries(Z.entries))if(X.has(J))for(let G of W.manifest.variants??[])Q.add(G.absolutePath);for(let[J,W]of Object.entries(Z.entries)){if(X.has(J))continue;for(let G of W.manifest.variants??[])if(!Q.has(G.absolutePath))aw(G.absolutePath,{force:!0});delete Z.entries[J]}}function VK(Z,X){Z.touched?.add(X);let Q=Z.entries[X];if(!Q)return null;return Q.manifest}function HK(Z,X,Q,J){Z.touched?.add(X),Z.entries[X]={manifest:J,source:Q,timestamp:Date.now()}}var U8;var KQ=s(()=>{UQ()});import{existsSync as VQ}from"node:fs";import{basename as Xj,extname as FK,resolve as qK}from"node:path";async function MK(Z,X){let Q=X.get(Z);if(!Q){let J=z8(Z);try{let W=await YQ(Z);Q={width:W.width,height:W.height,hash:J}}catch(W){if(!BK)BK=!0,console.warn(`Could not read image dimensions (${W.message}) — `+"emitting srcsets without width/height attributes.");Q={width:null,height:null,hash:J}}X.set(Z,Q)}return Q}function e5(Z,X,Q,J){let W=X.quality?.webp??80,G=Z.startsWith("/")?"":"/",Y=J?`?v=${J}`:"";return X.widths.filter(($)=>$<=Q).toSorted(($,z)=>$-z).map(($)=>`/cdn-cgi/image/width=${$},quality=${W},fit=scale-down,format=auto${G}${Z}${Y} ${$}w`).join(", ")}async function AK(Z,X,Q,J,W){let G=`${z8(Z)}:${$Q(Q)}`,Y=VK(W,G);if(Y){if(Y.variants.every((U)=>VQ(U.absolutePath)))return Y}if(!Y)console.log(` Optimizing ${Xj(Z)}...`);let $=await zK(Z,L9(J),Q);return HK(W,G,X,$),$}function IK(Z){if(typeof Z!=="string")return!0;if(!Z)return!0;if(Z.includes("${"))return!0;if(Qj.some((X)=>Z.startsWith(X)))return!0;if(LK.has(FK(Z).toLowerCase()))return!0;return!1}function NK(Z,X){if(X.service!=="cloudflare")return!1;if(!X.remoteDomains?.length)return!1;if(typeof Z!=="string"||!Z.startsWith("https://"))return!1;if(Z.includes("${"))return!1;try{let Q=new URL(Z);if(LK.has(FK(Q.pathname).toLowerCase()))return!1;return X.remoteDomains.includes(Q.hostname)}catch{return!1}}function DK(Z,X){if(Z.startsWith("/"))return qK(X,"public",Z.slice(1));return qK(X,Z)}async function TK(Z,X,Q,J,W){let G=new Map;if(!X.optimize)return{imageRefs:G};return await wK(Z,X,Q,J,W??new Map,G),{imageRefs:G}}async function wK(Z,X,Q,J,W,G){if(!Z||typeof Z!=="object")return;if(Z.tagName==="img")await Jj(Z,X,Q,J,W,G);if(typeof Z.innerHTML==="string"&&Z.innerHTML.includes("<img"))Z.innerHTML=await zj(Z.innerHTML,X,Q,J,W,G);if(Array.isArray(Z.children))for(let Y of Z.children){if(typeof Y==="string")continue;await wK(Y,X,Q,J,W,G)}}async function Jj(Z,X,Q,J,W,G){if(!Z.attributes)Z.attributes={};let Y=Z.attributes.src??Z.src;if(typeof Y!=="string")return;let $=NK(Y,X);if(!$&&IK(Y))return;if(Z.attributes["data-no-optimize"]!==void 0)return;let z,U=null;if($)z=e5(Y,X,1/0,null);else{let V=DK(Y,Q);if(!VQ(V))return;if(X.service==="cloudflare"){let q=await MK(V,W);z=e5(Y,X,q.width??1/0,q.hash),U=q.width&&q.height?{height:q.height,width:q.width}:null}else{let q=G.get(V);if(!q)q=await AK(V,Y,X,Q,J),G.set(V,q);let B=X.formats.includes("avif")?"avif":X.formats[0];z=zQ(q.variants,B),U=q.original?.width&&q.original.height?{height:q.original.height,width:q.original.width}:null}}if(z)Z.attributes.srcset=z,Z.attributes.sizes??=X.sizes;if(U&&Z.attributes.width===void 0&&Z.attributes.height===void 0)Z.attributes.width=String(U.width),Z.attributes.height=String(U.height);if(X.lazyLoad&&Z.attributes.loading!=="eager")Z.attributes.loading="lazy",Z.attributes.decoding="async"}async function zj(Z,X,Q,J,W,G){let Y=[];for(let z of Z.matchAll(Wj)){let U=z[0],V=z[1];if(Yj.test(V))continue;if($j.test(V))continue;let q=V.match(Gj);if(!q)continue;let B=q[1].replaceAll("&","&"),F=NK(B,X);if(!F&&IK(B))continue;let L=F?null:DK(B,Q);if(L&&!VQ(L))continue;let I,A=null;if(F)I=e5(B,X,1/0,null);else if(X.service==="cloudflare"){let D=await MK(L,W);I=e5(B,X,D.width??1/0,D.hash),A=D.width&&D.height?{height:D.height,width:D.width}:null}else{let D=G.get(L);if(!D)D=await AK(L,B,X,Q,J),G.set(L,D);let O=X.formats.includes("avif")?"avif":X.formats[0];I=zQ(D.variants,O),A=D.original?.width&&D.original.height?{height:D.original.height,width:D.original.width}:null}if(!I)continue;let N=` srcset="${I}" sizes="${X.sizes}"`;if(A&&!/\bwidth=/.test(V)&&!/\bheight=/.test(V))N+=` width="${A.width}" height="${A.height}"`;if(X.lazyLoad&&!/\bloading="eager"/.test(V)){if(!/\bloading=/.test(V))N+=' loading="lazy"';if(!/\bdecoding=/.test(V))N+=' decoding="async"'}Y.push({match:U,replacement:`<img${V}${N}>`})}let $=Z;for(let{match:z,replacement:U}of Y)$=$.replace(z,U);return $}var LK,Qj,BK=!1,Wj,Gj,Yj,$j;var jK=s(()=>{UQ();KQ();LK=new Set([".svg",".gif"]),Qj=["http://","https://","data:","//"];Wj=/<img\b([^>]*)>/gi,Gj=/\bsrc="([^"]*)"/,Yj=/\bsrcset="/,$j=/\bdata-no-optimize\b/});var CK={};D1(CK,{buildSite:()=>Lj});import{cpSync as HQ,existsSync as S4,mkdirSync as y1,readFileSync as Uj,readdirSync as Kj,rmSync as Vj,statSync as Hj,writeFileSync as l6}from"node:fs";import{basename as qj,dirname as g1,join as M9,relative as Bj,resolve as s0,sep as Fj}from"node:path";async function Lj(Z,X={}){let{clean:Q=!0,verbose:J=!1}=X,W=[],G=J?console.log.bind(console):()=>{};G("Loading project.json...");let{config:Y}=X9(Z);if("contentTypes"in Y)throw Error('project.json declares "contentTypes", which is no longer supported. Run `bun scripts/migrate-project-extensions.ts <project>` to migrate to "extensions" + "content", then `jx schema`.');let $=s0(Z,Y.build.outDir),z=s0(Z,"pages"),U=s0(Z,"public"),V=Y.build.trailingSlash??"always",q=new Map,B=(E,l)=>{if(!SY(E))return E;try{let c=_Y(E,l??Z,Z);if(!N4(E)&&!S4(c))return console.warn(`Sidecar "${E}" not found at ${c} — emitting unbundled`),E;let $0=N4(E)?E:`./${Bj(Z,c)}`,m=XY($0),X0=q.get(m);if(X0&&X0.entryPath!==c)throw Error(`"${E}" and "${X0.specifier}" both bundle to ${m} — rename one`);return q.set(m,{entryPath:c,specifier:E}),m}catch(c){return W.push(`Sidecar "${E}": ${c.message}`),E}},F=await t1(Z,Y),L=F.formats;if(L.entries.length>0)G(` Registered ${L.entries.length} format(s): ${L.entries.map((E)=>E.name).join(", ")}`);let I=F.serverMounts().filter((E)=>{if(!E.project)return!0;let l=Y[E.project.key];return l!==void 0&&typeof l==="object"&&Object.keys(l).length>0});if(I.length>0&&!Y.build.adapter){let E=I.map((l)=>l.project?`"${l.project.key}"`:`"${l.server.basePath}"`).join(", ");throw Error(`project.json declares dynamic section(s) ${E} served by extension mounts, but `+'build.adapter is "static". Dynamic tables need a server-capable adapter — set '+'build.adapter to "cloudflare-workers", "cloudflare-pages", "node", or "bun".')}if(Q&&S4($))Vj($,{force:!0,recursive:!0});if(y1($,{recursive:!0}),!S4(z))throw Error(`pages/ directory not found in ${Z}`);G("Discovering pages...");let A=await yY(z,L);G(` Found ${A.length} page(s)`),G("Loading project sections...");let N=await uY(Z,Y,F),D=Object.keys(N);if(D.length>0)G(` Loaded ${D.length} section(s): ${D.join(", ")}`);let O=await fY(A,Z,N,F,Y);G(` ${O.length} route(s) after expansion`);let T=0,w=s0(Z,"components"),S=[],y=new Map,x=new Map;if(S4(w)){G("Compiling components...");let E=[".json",...L.documentExtensions("component")],l=Kj(w).filter(($0)=>E.some((m)=>$0.endsWith(m))),c=s0($,"components");y1(c,{recursive:!0});for(let $0 of l)try{let m=s0(w,$0),X0=await F5(m,{...Y.$media?{$media:Y.$media}:{},formats:L,rewriteSrc:B});for(let Y0 of X0.files){let C0=qj(Y0.path);if(l6(s0(c,C0),Y0.content,"utf8"),Y0.tagName)S.push(Y0.tagName);T+=1}let a=await s9(m,L);if(a.tagName){x.set(a.tagName,a);let Y0=uJ(a.tagName,a.style,a,Y.$media??{});if(Y0)y.set(a.tagName,Y0),l6(s0(c,`${a.tagName}.css`),Y0,"utf8"),T+=1}}catch(m){let X0=m;W.push(`Error compiling component ${$0}: ${X0.message}`),console.error(`Error compiling component ${$0}: ${X0.message}`)}G(` Compiled ${S.length} component(s): ${S.join(", ")}`)}let i=[];if(Y.build.adapter)for(let[,E]of x){let l=n8(E);for(let c of l){let $0=`./components/${c.src.replace(/^\.\//,"")}`;i.push({exportName:c.exportName,src:$0})}}let r=Y.images.optimize&&Y.images.service==="cloudflare",h=Y.images.optimize&&!r?UK(Z):null,n=r?new Map:null;if(r)console.log('images.service is "cloudflare" — srcsets use /cdn-cgi/image transform URLs. '+"Ensure Image Transformations are enabled for your zone (Cloudflare dashboard → "+"Images → Transformations); these URLs do not work on *.pages.dev / *.workers.dev previews.");let W0=Y.url,G0=Boolean(W0)&&Y.build.sitemap!==!1,H0=[];for(let E of O)try{G(` Compiling ${E.urlPattern} ...`);let l=await Mj(E,Y,Z,N,h,x,n,L,F,B),c=new Set;for(let[X0,a]of x)if(z7(a))c.add(X0);if(S.length>0)l.html=Dj(l.html,S,y,c);let $0=PK(E.urlPattern,$,V);y1(g1($0),{recursive:!0}),l6($0,l.html,"utf8"),T+=1;let m=!E.urlPattern.includes(":")&&!E.urlPattern.includes("*");if(G0&&!l.excludeFromSitemap&&m)H0.push({lastmod:Hj(E.sourcePath).mtime,loc:new URL(E.urlPattern,W0).href});for(let X0 of L.withCapability("serialize")){if(!X0.exportTarget)continue;try{let a=await X0.call("serialize",l.doc,{buildScope:(Y0)=>n4(Y0,null),componentDefs:x,evaluateTemplate:(Y0,C0)=>{if(!F0(Y0))return;return z6(Y0,C0)??Y0},mode:"export"});if(a){let Y0=$0.replace(/\.html$/,X0.extensions[0]);l6(Y0,a,"utf8"),T+=1}}catch(a){let Y0=a;W.push(`Error exporting ${X0.name} for ${E.urlPattern}: ${Y0.message}`)}}for(let X0 of l.files){let a=s0(g1($0),X0.path);y1(g1(a),{recursive:!0}),l6(a,X0.content,"utf8"),T+=1}if(l.serverHandler){let X0=s0(g1($0),"_server.js");l6(X0,l.serverHandler,"utf8"),T+=1}}catch(l){let c=l,$0=`Error compiling ${E.urlPattern}: ${c.message}`;W.push($0),console.error($0)}if(h&&Y.images.optimize){KK(Z,h,{prune:W.length===0});let E=s0(L9(Z),"_optimized");if(S4(E)){let c=s0($,"images/_optimized");y1(c,{recursive:!0}),HQ(E,c,{recursive:!0})}let l=Object.keys(h.entries).length;if(l>0)G(` Optimized ${l} image(s)`)}if(Y.build.adapter){let{adapter:E}=Y.build;G("Generating site-wide server worker...");let l=new Map;for(let a of i)if(!l.has(a.exportName))l.set(a.exportName,a);let{mounts:c,connectors:$0}=Aj(I,F,Y);if(c.length>0)G(` Mounting ${c.length} extension route(s): ${c.map((a)=>a.basePath).join(", ")}`);let X0=E==="cloudflare-pages"&&l.size===0&&c.length===0?null:s7([...l.values()],{adapter:E,connectors:$0,mounts:c});if(X0){let a=E==="cloudflare-pages"?"_worker.js":"worker.js";try{await xY(X0,{adapter:E,outfile:s0($,a),projectRoot:Z}),T+=1,G(` Generated dist/${a} (bundled, ${l.size} server function(s))`)}catch(Y0){let C0=`Error bundling dist/${a}: ${Y0.message}`;W.push(C0),console.error(C0)}if(E==="cloudflare-pages")l6(s0($,"_routes.json"),`${JSON.stringify({exclude:[],include:["/_jx/*"],version:1},null,2)}
|
|
325
|
+
`,"utf8"),T+=1}}if(q.size>0){G(`Bundling ${q.size} client sidecar module(s)...`);for(let[E,l]of q)try{let c=s0($,E.replace(/^\//,""));y1(g1(c),{recursive:!0}),await AX({entryPath:l.entryPath,outfile:c},{external:CY,target:"browser"}),T+=1,G(` ${l.specifier} → ${E}`)}catch(c){let $0=`Error bundling sidecar "${l.specifier}": ${c.message}`;W.push($0),console.error($0)}}for(let E of F.emitters()){let l=E.project?.key,c=l?Y[l]:void 0;if(l&&(c==null||typeof c==="object"&&Object.keys(c).length===0))continue;try{let $0=await E.call("emit",c??null,{projectConfig:Y,root:Z,routes:O,sections:N});for(let m of $0??[]){let X0=s0($,m.path.replace(/^\//,""));if(!X0.startsWith($+Fj))throw Error(`emit path escapes outDir: ${m.path}`);y1(g1(X0),{recursive:!0}),l6(X0,m.content),T+=1,G(` ${E.name} emitted ${m.path}`)}}catch($0){let m=`Error in ${E.name}.emit: ${$0.message}`;W.push(m),console.error(m)}}if(Y.redirects&&Object.keys(Y.redirects).length>0){G("Generating redirects...");let E=new Set(O.map((c)=>c.urlPattern)),l=jj(Y.redirects,$,E);T+=l}if(G0)G(`Generating sitemap (${H0.length} URL(s))...`),T+=Rj(H0,$);else if(!W0&&Y.build.sitemap!==!1)console.warn("sitemap.xml skipped — set `url` in project.json to enable sitemap generation.");if(S4(U))G("Copying public/ assets..."),HQ(U,$,{recursive:!0});if(G0)T+=Pj($,W0);if(Y.copy){G("Copying mapped files...");for(let[E,l]of Object.entries(Y.copy)){let c=s0(Z,E),$0=s0($,l);y1(g1($0),{recursive:!0}),HQ(c,$0)}}if(G(`
|
|
326
|
+
Build complete: ${O.length} routes, ${T} files`),W.length>0)G(` ${W.length} error(s)`);return{errors:W,files:T,routes:O.length}}async function Mj(Z,X,Q,J={},W=null,G=new Map,Y=null,$,z,U){let V=await s9(Z.sourcePath,$),q=NX(V,X,Q),B=V.$head??q._pageHead??[],F=q.$head??[],L=V.title??q._pageTitle??null;delete q._pageHead,delete q._pageTitle,iY(q,X,Z,Q),await rY(q,Z,Q,{config:X,sections:J,...z===void 0?{}:{registry:z},...U===void 0?{}:{registerBundle:(i)=>{U(i,null)}}});let I=n4(q.state??{}),A=L??X.name??"Jx Site";if(typeof A==="string"&&F0(A))A=z6(A,I)??A;let N=OK(B,I),D=OK(F,I);K8(q,I);let O={counter:{n:0},media:{...X.$media,...q.$media},rules:[]};if(BQ(q,G,O),q.state)for(let[i,r]of Object.entries(q.state)){if(i==="$site"||i==="$page")continue;if(r&&typeof r==="object"&&!Array.isArray(r)&&r.timing==="compiler")delete q.state[i];else if(Array.isArray(r))delete q.state[i]}let T=Ij(X.$head??[]),w=cY(T,D,N,{title:A,charset:X.defaults?.charset??"utf8",...X.name!=null&&{siteName:X.name},...X.url!=null&&{siteUrl:X.url},pageUrl:Z.urlPattern});if(X.$media)q.$media={...X.$media,...q.$media};if(Object.values(q.$media??{}).some((i)=>$1(String(i))!==null))w.splice(2,0,{tagName:"script",textContent:r4()});if(X.images?.optimize&&(W||Y))await TK(q,X.images,Q,W,Y??void 0);let S=await KX(q,{lang:X.defaults?.lang??"en",prePaintScheme:!1,projectStyle:X.style??null,...U===void 0?{}:{rewriteSrc:(i)=>U(i,g1(Z.sourcePath))},title:A});if(O.rules.length>0)S.html=S.html.replace("</head>",`<style>
|
|
327
|
+
${O.rules.join(`
|
|
256
328
|
`)}
|
|
257
329
|
</style>
|
|
258
|
-
</head>`);
|
|
259
|
-
`):null,G=
|
|
330
|
+
</head>`);S.html=wj(S.html,w,X.defaults?.lang??"en");let y=(q.$elements??[]).filter((i)=>typeof i==="string"&&!i.startsWith("./")&&!i.startsWith("../"));if(y.length>0)S.html=Tj(S.html,y);let x=null;if(!X.build?.adapter)try{let i=await d9(Z.sourcePath);if(i)x=i}catch{}return{doc:q,excludeFromSitemap:V.$sitemap===!1,files:S.files,html:S.html,serverHandler:x}}function Aj(Z,X,Q){if(Z.length===0)return{connectors:[],mounts:[]};let J={};for(let $ of X.projectContributions()){let{key:z}=$.project;if(z in Q)J[z]=Q[z]}let W=Z.map(($)=>{let z=$.server,{module:U}=z;if(typeof U!=="string"||U==="")throw Error(`Extension class "${$.name}": server.module (a bare import specifier) is required to generate a deployable worker`);return{basePath:z.basePath,className:$.classDef.title??$.name,module:U,options:{basePath:z.basePath,sections:J},order:z.order??100}}),G=new Set;for(let $ of Object.values(J)){if(!$||typeof $!=="object"||Array.isArray($))continue;for(let z of Object.values($)){let U=z?.provider;if(typeof U==="string")G.add(U)}}let Y=[];for(let $ of X.connectors()){let z=String($.connector.provider);if(!G.has(z))continue;let{module:U}=$.connector;if(typeof U!=="string"||U==="")throw Error(`Connector class "${$.name}": connector.module (a bare import specifier) is required to generate a deployable worker`);Y.push({className:$.classDef.title??$.name,module:U,provider:z})}return{connectors:Y,mounts:W}}function OK(Z,X){return Z.map((Q)=>{if(!Q||typeof Q!=="object")return Q;let J={...Q};if(J.attributes){J.attributes={...J.attributes};for(let[W,G]of Object.entries(J.attributes))if(typeof G==="string"&&F0(G))J.attributes[W]=z6(G,X)??G}if(typeof J.textContent==="string"&&F0(J.textContent))J.textContent=z6(J.textContent,X)??J.textContent;return J})}function Ij(Z){return Z.map((X)=>{if(!X||typeof X!=="object"||!X.attributes)return X;let Q={...X,attributes:{...X.attributes}};for(let J of["href","src"]){let W=Q.attributes[J];if(typeof W==="string"&&Nj(W))Q.attributes[J]=`/node_modules/${W}`}return Q})}function Nj(Z){return!Z.startsWith("/")&&!Z.startsWith("./")&&!Z.startsWith("../")&&!Z.startsWith("http")&&!Z.startsWith("data:")}function RK(Z,X){if(!Z||typeof Z!=="object")return Z;let Q={};for(let[J,W]of Object.entries(Z))if(J==="children"&&Array.isArray(W))Q.children=W.map((G)=>{if(typeof G==="string")return G;return RK(G,X)});else if(J==="style"&&W&&typeof W==="object"){let G={...W};for(let[Y,$]of Object.entries(G))if(F0($))G[Y]=ZZ($,X)??$;Q.style=G}else if(J==="attributes"&&W&&typeof W==="object"){let G={...W};for(let[Y,$]of Object.entries(G))if(F0($))G[Y]=ZZ($,X)??$;Q.attributes=G}else if(J==="$props"&&W&&typeof W==="object"){let G={...W};for(let[Y,$]of Object.entries(G))if(F0($)){let z=ZZ($,X);G[Y]=z!==null?z??null:$}Q.$props=G}else if(typeof W==="string"&&F0(W))Q[J]=ZZ(W,X)??W;else Q[J]=W;return Q}function ZZ(Z,X){try{let Q=X.$map?.item,J=X.$map?.index,W=Z.match(/^\$\{(.+)\}$/s);if(W)return Function("state","$map","item","index",`return (${W[1]})`)(X,X.$map,Q,J);return Function("state","$map","item","index",`return \`${Z}\``)(X,X.$map,Q,J)}catch{return null}}function K8(Z,X){if(!Z||typeof Z!=="object")return;if(typeof Z.innerHTML==="string"&&F0(Z.innerHTML)){let J=z6(Z.innerHTML,X);if(J!=null)Z.innerHTML=String(J).replaceAll("${","${")}if(typeof Z.textContent==="string"&&F0(Z.textContent))Z.textContent=z6(Z.textContent,X)??Z.textContent;if(Z.style&&typeof Z.style==="object"){for(let[J,W]of Object.entries(Z.style))if(typeof W==="string"&&F0(W))Z.style[J]=z6(W,X)??W}if(Z.attributes&&typeof Z.attributes==="object"){for(let[J,W]of Object.entries(Z.attributes))if(typeof W==="string"&&F0(W))Z.attributes[J]=z6(W,X)??W}if(Z.$props&&typeof Z.$props==="object"){for(let[J,W]of Object.entries(Z.$props))if(typeof W==="string"&&F0(W))Z.$props[J]=z6(W,X)??W}let Q=Z.children;if(Z6(Q)){let J=EK(Q,X);if(J){Z.children=J;return}}if(typeof Q==="string"&&F0(Q)){let J=z6(Q,X);if(Array.isArray(J)){let W=J;Z.children=W;for(let G of W)K8(G,X)}}else if(Array.isArray(Z.children)){let J=0;while(J<Z.children.length){let W=Z.children[J];if(typeof W==="string"&&F0(W)){let G=z6(W,X);if(Array.isArray(G)){let Y=G;Z.children.splice(J,1,...Y);for(let $ of Y)K8($,X);J+=Y.length;continue}}if(Z6(W)){let G=EK(W,X);if(G){Z.children.splice(J,1,...G),J+=G.length;continue}}K8(W,X),J+=1}}}function EK(Z,X){let Q=Z.items,J=null;if(P6(Q))J=Y7(Q.$ref,X);else if(Array.isArray(Q))J=Q;let W=Z.map;if(!Array.isArray(J)||!W)return null;return J.map((G,Y)=>{let $=Object.create(X);$.$map={index:Y,item:G},$["$map/item"]=G,$["$map/index"]=Y;let z=RK(W,$);return K8(z,$),z})}function BQ(Z,X,Q){if(!Z||typeof Z!=="object")return;if(Array.isArray(Z)){for(let W of Z)BQ(W,X,Q);return}if(Array.isArray(Z.children))for(let W of Z.children)BQ(W,X,Q);let J=X.get(Z.tagName);if(J){if(Z.attributes){let $=null;for(let[z,U]of Object.entries(Z.attributes))if(z.startsWith("props.")&&z.length>6)$??={},$[z.slice(6)]=U,delete Z.attributes[z];if($)Z.$props={...$,...Z.$props}}let W=Array.isArray(Z.children)&&Z.children.length>0?Z.children.map(($)=>{if(Q&&$&&typeof $==="object")i1($,Q.rules,Q.media,"",Q.counter,"jxs");return d4($,{},null)}).join(`
|
|
331
|
+
`):null,G=hJ(J,Z.$props||null,W),Y=z7(J);if(Z.innerHTML=G,delete Z.children,J.style&&Z.$props){let $={...J.state};for(let[V,q]of Object.entries(Z.$props))$[V]=V in $?q:q;let z=n4($,null),U={};for(let[V,q]of Object.entries(J.style))if(typeof q==="string"&&F0(q)){let B=h0(q,z);if(B!=null)U[V]=B}if(Object.keys(U).length>0)Z.style={...Z.style,...U}}if(delete Z.$props,Y)Z.$static=!0;else Z.$prerendered=!0}}function Dj(Z,X,Q=new Map,J=new Set){let W=X.filter((B)=>Z.includes(`<${B}`));if(W.length===0)return Z;let G=W.filter((B)=>Q.has(B)).map((B)=>`<link rel="stylesheet" href="/components/${B}.css">`).join(`
|
|
260
332
|
`),Y=Z;if(G)Y=Y.replace("</head>",` ${G}
|
|
261
|
-
</head>`);let
|
|
333
|
+
</head>`);let $=W.filter((B)=>!J.has(B));if($.length===0)return Y;let z=`<script type="importmap">
|
|
262
334
|
{
|
|
263
335
|
"imports": {
|
|
264
|
-
"@vue/reactivity": "${
|
|
265
|
-
"lit-html": "${
|
|
336
|
+
"@vue/reactivity": "${c4}",
|
|
337
|
+
"lit-html": "${p4}"
|
|
266
338
|
}
|
|
267
339
|
}
|
|
268
|
-
</script>`,
|
|
269
|
-
`),
|
|
270
|
-
`)+
|
|
271
|
-
</body>`)}function
|
|
340
|
+
</script>`,U=$.map((B)=>`<script type="module" src="/components/${B}.js"></script>`).join(`
|
|
341
|
+
`),q=(Y.includes('<script type="importmap">')?"":`${z}
|
|
342
|
+
`)+U;return Y.replace("</body>",` ${q}
|
|
343
|
+
</body>`)}function Tj(Z,X){let Q=X.map((J)=>`<script type="module" src="/node_modules/${J}"></script>`).join(`
|
|
272
344
|
`);return Z.replace("</body>",` ${Q}
|
|
273
|
-
</body>`)}function
|
|
274
|
-
${
|
|
275
|
-
`)}`;let
|
|
276
|
-
${
|
|
277
|
-
`)}`}let
|
|
278
|
-
${
|
|
279
|
-
</head>`);return
|
|
345
|
+
</body>`)}function wj(Z,X,Q){let J=pY(X),W=/<head>([\s\S]*?)<\/head>/i,G=Z.match(W),Y="";if(G){let z=G[1].match(/<style>[\s\S]*?<\/style>/gi);if(z)Y+=`
|
|
346
|
+
${z.join(`
|
|
347
|
+
`)}`;let U=G[1].match(/<script[\s\S]*?<\/script>/gi);if(U)Y+=`
|
|
348
|
+
${U.join(`
|
|
349
|
+
`)}`}let $=Z;if(W.test($))$=$.replace(W,`<head>
|
|
350
|
+
${J}${Y}
|
|
351
|
+
</head>`);return $=$.replace(/<html\s[^>]*>/i,(z)=>{if(/lang=/.test(z))return z.replace(/lang="[^"]*"/,`lang="${Q}"`);return z.replace("<html",`<html lang="${Q}"`)}),$}function PK(Z,X,Q){if(Z==="/")return M9(X,"index.html");let J=Z.replace(/^\//,"");if(Q==="always")return M9(X,J,"index.html");return M9(X,`${J}.html`)}function jj(Z,X,Q=new Set){let J=0,W=[],G=($)=>$.length>1&&$.endsWith("/")?$.slice(0,-1):$,Y=new Set([...Q].map(($)=>G($)));for(let[$,z]of Object.entries(Z)){let U=typeof z==="object"?z.destination:z,V=typeof z==="object"?z.status??301:301;if($.includes(":")||$.includes("*")){W.push(`${$} ${U} ${V}`);continue}if(Y.has(G($)))console.warn(`Redirect "${$}" overwrites a compiled page at the same route — `+"remove the redirect or the page.");let q=PK($,X,"always"),B=`<!DOCTYPE html>
|
|
280
352
|
<html>
|
|
281
353
|
<head>
|
|
282
354
|
<meta charset="utf-8">
|
|
283
|
-
<meta http-equiv="refresh" content="0;url=${
|
|
284
|
-
<link rel="canonical" href="${
|
|
355
|
+
<meta http-equiv="refresh" content="0;url=${qQ(U)}">
|
|
356
|
+
<link rel="canonical" href="${qQ(U)}">
|
|
285
357
|
<title>Redirecting...</title>
|
|
286
358
|
</head>
|
|
287
359
|
<body>
|
|
288
|
-
<p>Redirecting to <a href="${
|
|
360
|
+
<p>Redirecting to <a href="${qQ(U)}">${Oj(U)}</a>...</p>
|
|
289
361
|
</body>
|
|
290
|
-
</html>`;
|
|
362
|
+
</html>`;y1(g1(q),{recursive:!0}),l6(q,B,"utf8"),J+=1,W.push(`${$} ${U} ${V}`)}if(W.length>0)l6(M9(X,"_redirects"),`${W.join(`
|
|
291
363
|
`)}
|
|
292
|
-
`,"utf8"),
|
|
364
|
+
`,"utf8"),J+=1;return J}function Oj(Z){return String(Z).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}function qQ(Z){return String(Z).replaceAll("&","&").replaceAll('"',""").replaceAll("<","<")}function Ej(Z){return String(Z).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Rj(Z,X){if(Z.length===0)return 0;let J=`<?xml version="1.0" encoding="UTF-8"?>
|
|
293
365
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
294
|
-
${Z.map((
|
|
295
|
-
<loc>${
|
|
296
|
-
<lastmod>${
|
|
366
|
+
${Z.map((W)=>` <url>
|
|
367
|
+
<loc>${Ej(W.loc)}</loc>
|
|
368
|
+
<lastmod>${W.lastmod.toISOString().slice(0,10)}</lastmod>
|
|
297
369
|
</url>`).join(`
|
|
298
370
|
`)}
|
|
299
371
|
</urlset>
|
|
300
|
-
`;return
|
|
372
|
+
`;return l6(M9(X,"sitemap.xml"),J,"utf8"),1}function Pj(Z,X){let Q=M9(Z,"robots.txt"),J=S4(Q),W=J?Uj(Q,"utf8"):`User-agent: *
|
|
301
373
|
Allow: /
|
|
302
|
-
`;if(/^Sitemap:/im.test(
|
|
303
|
-
`))
|
|
304
|
-
`;return
|
|
374
|
+
`;if(/^Sitemap:/im.test(W))return 0;if(!W.endsWith(`
|
|
375
|
+
`))W+=`
|
|
376
|
+
`;return W+=`
|
|
305
377
|
Sitemap: ${new URL("/sitemap.xml",X).href}
|
|
306
|
-
`,
|
|
307
|
-
`,"utf8"),
|
|
308
|
-
`,"utf8"),{documentSchemaPath:V,projectSchemaPath:K}}async function ND(Z){let X=W6(Z),Q=W6(X,"project.json"),W=W6(X,"project.schema.json"),J=W6(X,"document.schema.json"),G=(K)=>{if(!u$(K))return!0;try{return v$(Q).mtimeMs>v$(K).mtimeMs}catch{return!1}};if(G(W)||G(J))await m$(X);let Y=DD(X),z=await QX(JSON.parse(M9(W,"utf8")),Y,X);return{document:await QX(JSON.parse(M9(J,"utf8")),Y,X),project:z}}function DD(Z){return async(X)=>{let Q=W6(X),W=WX(Z,Q);if(W.startsWith("..")||AD(W))throw Error(`Schema ref "${X}" escapes the project root ${Z}`);if(u$(Q))return JSON.parse(M9(Q,"utf8"));let J=W.split(JX).join("/"),G="node_modules/",Y=J.lastIndexOf(G);if(Y===-1)throw Error(`Schema ref "${X}" does not exist`);let z=J.slice(Y+G.length),q;try{q=Z5(W6(Z,"package.json")).resolve(z)}catch{try{q=Z5(import.meta.url).resolve(z)}catch(K){throw Error(`Schema ref "${X}" does not exist and "${z}" is not resolvable from the project or the host`,{cause:K})}}return JSON.parse(M9(q,"utf8"))}}function g$(Z,X){let Q=null;try{Q=Z5(W6(Z,"package.json")).resolve(X)}catch{try{Q=Z5(import.meta.url).resolve(X)}catch{Q=null}}let W=`./node_modules/${X}`;return Q?l$(Z,Q,W):W}function f$(Z,X,Q){let W=WX(LD(X.manifestPath),Q).split(JX).join("/"),J=`./node_modules/${X.specifier}/${W}`;return l$(Z,Q,J)}function l$(Z,X,Q){let W=WX(Z,X).split(JX).join("/");if(W.startsWith(".."))return Q;return W.startsWith("./")?W:`./${W}`}function h$(Z){let X;try{X=JSON.parse(M9(Z,"utf8"))}catch{return[]}let{$id:Q}=X;if(typeof Q!=="string"||!X.$defs)return[];return Object.keys(X.$defs).map((W)=>`${Q}#/$defs/${W}`)}var MD="@jxsuite/schema/schemas/project.core.schema.json",ID="@jxsuite/schema/schema.json";var c$=c(()=>{x$();I6();E8()});var N9=j((i$)=>{Object.defineProperty(i$,"__esModule",{value:!0});i$.regexpCode=i$.getEsmExportName=i$.getProperty=i$.safeStringify=i$.stringify=i$.strConcat=i$.addCodeArg=i$.str=i$._=i$.nil=i$._Code=i$.Name=i$.IDENTIFIER=i$._CodeOrName=void 0;class X5{}i$._CodeOrName=X5;i$.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class b1 extends X5{constructor(Z){super();if(!i$.IDENTIFIER.test(Z))throw Error("CodeGen: name must be a valid identifier");this.str=Z}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}i$.Name=b1;class E4 extends X5{constructor(Z){super();this._items=typeof Z==="string"?[Z]:Z}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let Z=this._items[0];return Z===""||Z==='""'}get str(){var Z;return(Z=this._str)!==null&&Z!==void 0?Z:this._str=this._items.reduce((X,Q)=>`${X}${Q}`,"")}get names(){var Z;return(Z=this._names)!==null&&Z!==void 0?Z:this._names=this._items.reduce((X,Q)=>{if(Q instanceof b1)X[Q.str]=(X[Q.str]||0)+1;return X},{})}}i$._Code=E4;i$.nil=new E4("");function p$(Z,...X){let Q=[Z[0]],W=0;while(W<X.length)YX(Q,X[W]),Q.push(Z[++W]);return new E4(Q)}i$._=p$;var GX=new E4("+");function n$(Z,...X){let Q=[I9(Z[0])],W=0;while(W<X.length)Q.push(GX),YX(Q,X[W]),Q.push(GX,I9(Z[++W]));return TD(Q),new E4(Q)}i$.str=n$;function YX(Z,X){if(X instanceof E4)Z.push(...X._items);else if(X instanceof b1)Z.push(X);else Z.push(OD(X))}i$.addCodeArg=YX;function TD(Z){let X=1;while(X<Z.length-1){if(Z[X]===GX){let Q=wD(Z[X-1],Z[X+1]);if(Q!==void 0){Z.splice(X-1,3,Q);continue}Z[X++]="+"}X++}}function wD(Z,X){if(X==='""')return Z;if(Z==='""')return X;if(typeof Z=="string"){if(X instanceof b1||Z[Z.length-1]!=='"')return;if(typeof X!="string")return`${Z.slice(0,-1)}${X}"`;if(X[0]==='"')return Z.slice(0,-1)+X.slice(1);return}if(typeof X=="string"&&X[0]==='"'&&!(Z instanceof b1))return`"${Z}${X.slice(1)}`;return}function jD(Z,X){return X.emptyStr()?Z:Z.emptyStr()?X:n$`${Z}${X}`}i$.strConcat=jD;function OD(Z){return typeof Z=="number"||typeof Z=="boolean"||Z===null?Z:I9(Array.isArray(Z)?Z.join(","):Z)}function ED(Z){return new E4(I9(Z))}i$.stringify=ED;function I9(Z){return JSON.stringify(Z).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}i$.safeStringify=I9;function RD(Z){return typeof Z=="string"&&i$.IDENTIFIER.test(Z)?new E4(`.${Z}`):p$`[${Z}]`}i$.getProperty=RD;function PD(Z){if(typeof Z=="string"&&i$.IDENTIFIER.test(Z))return new E4(`${Z}`);throw Error(`CodeGen: invalid export name: ${Z}, use explicit $id name mapping`)}i$.getEsmExportName=PD;function CD(Z){return new E4(Z.toString())}i$.regexpCode=CD});var KX=j((o$)=>{Object.defineProperty(o$,"__esModule",{value:!0});o$.ValueScope=o$.ValueScopeName=o$.Scope=o$.varKinds=o$.UsedValueState=void 0;var t0=N9();class a$ extends Error{constructor(Z){super(`CodeGen: "code" for ${Z} not defined`);this.value=Z.value}}var W5;(function(Z){Z[Z.Started=0]="Started",Z[Z.Completed=1]="Completed"})(W5||(o$.UsedValueState=W5={}));o$.varKinds={const:new t0.Name("const"),let:new t0.Name("let"),var:new t0.Name("var")};class $X{constructor({prefixes:Z,parent:X}={}){this._names={},this._prefixes=Z,this._parent=X}toName(Z){return Z instanceof t0.Name?Z:this.name(Z)}name(Z){return new t0.Name(this._newName(Z))}_newName(Z){let X=this._names[Z]||this._nameGroup(Z);return`${Z}${X.index++}`}_nameGroup(Z){var X,Q;if(((Q=(X=this._parent)===null||X===void 0?void 0:X._prefixes)===null||Q===void 0?void 0:Q.has(Z))||this._prefixes&&!this._prefixes.has(Z))throw Error(`CodeGen: prefix "${Z}" is not allowed in this scope`);return this._names[Z]={prefix:Z,index:0}}}o$.Scope=$X;class qX extends t0.Name{constructor(Z,X){super(X);this.prefix=Z}setValue(Z,{property:X,itemIndex:Q}){this.value=Z,this.scopePath=t0._`.${new t0.Name(X)}[${Q}]`}}o$.ValueScopeName=qX;var lD=t0._`\n`;class s$ extends $X{constructor(Z){super(Z);this._values={},this._scope=Z.scope,this.opts={...Z,_n:Z.lines?lD:t0.nil}}get(){return this._scope}name(Z){return new qX(Z,this._newName(Z))}value(Z,X){var Q;if(X.ref===void 0)throw Error("CodeGen: ref must be passed in value");let W=this.toName(Z),{prefix:J}=W,G=(Q=X.key)!==null&&Q!==void 0?Q:X.ref,Y=this._values[J];if(Y){let K=Y.get(G);if(K)return K}else Y=this._values[J]=new Map;Y.set(G,W);let z=this._scope[J]||(this._scope[J]=[]),q=z.length;return z[q]=X.ref,W.setValue(X,{property:J,itemIndex:q}),W}getValue(Z,X){let Q=this._values[Z];if(!Q)return;return Q.get(X)}scopeRefs(Z,X=this._values){return this._reduceValues(X,(Q)=>{if(Q.scopePath===void 0)throw Error(`CodeGen: name "${Q}" has no value`);return t0._`${Z}${Q.scopePath}`})}scopeCode(Z=this._values,X,Q){return this._reduceValues(Z,(W)=>{if(W.value===void 0)throw Error(`CodeGen: name "${W}" has no value`);return W.value.code},X,Q)}_reduceValues(Z,X,Q={},W){let J=t0.nil;for(let G in Z){let Y=Z[G];if(!Y)continue;let z=Q[G]=Q[G]||new Map;Y.forEach((q)=>{if(z.has(q))return;z.set(q,W5.Started);let K=X(q);if(K){let V=this.opts.es5?o$.varKinds.var:o$.varKinds.const;J=t0._`${J}${V} ${q} = ${K};${this.opts._n}`}else if(K=W===null||W===void 0?void 0:W(q))J=t0._`${J}${K}${this.opts._n}`;else throw new a$(q);z.set(q,W5.Completed)})}return J}}o$.ValueScope=s$});var Z0=j((e0)=>{Object.defineProperty(e0,"__esModule",{value:!0});e0.or=e0.and=e0.not=e0.CodeGen=e0.operators=e0.varKinds=e0.ValueScopeName=e0.ValueScope=e0.Scope=e0.Name=e0.regexpCode=e0.stringify=e0.getProperty=e0.nil=e0.strConcat=e0.str=e0._=void 0;var Y0=N9(),R4=KX(),R6=N9();Object.defineProperty(e0,"_",{enumerable:!0,get:function(){return R6._}});Object.defineProperty(e0,"str",{enumerable:!0,get:function(){return R6.str}});Object.defineProperty(e0,"strConcat",{enumerable:!0,get:function(){return R6.strConcat}});Object.defineProperty(e0,"nil",{enumerable:!0,get:function(){return R6.nil}});Object.defineProperty(e0,"getProperty",{enumerable:!0,get:function(){return R6.getProperty}});Object.defineProperty(e0,"stringify",{enumerable:!0,get:function(){return R6.stringify}});Object.defineProperty(e0,"regexpCode",{enumerable:!0,get:function(){return R6.regexpCode}});Object.defineProperty(e0,"Name",{enumerable:!0,get:function(){return R6.Name}});var q5=KX();Object.defineProperty(e0,"Scope",{enumerable:!0,get:function(){return q5.Scope}});Object.defineProperty(e0,"ValueScope",{enumerable:!0,get:function(){return q5.ValueScope}});Object.defineProperty(e0,"ValueScopeName",{enumerable:!0,get:function(){return q5.ValueScopeName}});Object.defineProperty(e0,"varKinds",{enumerable:!0,get:function(){return q5.varKinds}});e0.operators={GT:new Y0._Code(">"),GTE:new Y0._Code(">="),LT:new Y0._Code("<"),LTE:new Y0._Code("<="),EQ:new Y0._Code("==="),NEQ:new Y0._Code("!=="),NOT:new Y0._Code("!"),OR:new Y0._Code("||"),AND:new Y0._Code("&&"),ADD:new Y0._Code("+")};class P6{optimizeNodes(){return this}optimizeNames(Z,X){return this}}class e$ extends P6{constructor(Z,X,Q){super();this.varKind=Z,this.name=X,this.rhs=Q}render({es5:Z,_n:X}){let Q=Z?R4.varKinds.var:this.varKind,W=this.rhs===void 0?"":` = ${this.rhs}`;return`${Q} ${this.name}${W};`+X}optimizeNames(Z,X){if(!Z[this.name.str])return;if(this.rhs)this.rhs=x1(this.rhs,Z,X);return this}get names(){return this.rhs instanceof Y0._CodeOrName?this.rhs.names:{}}}class BX extends P6{constructor(Z,X,Q){super();this.lhs=Z,this.rhs=X,this.sideEffects=Q}render({_n:Z}){return`${this.lhs} = ${this.rhs};`+Z}optimizeNames(Z,X){if(this.lhs instanceof Y0.Name&&!Z[this.lhs.str]&&!this.sideEffects)return;return this.rhs=x1(this.rhs,Z,X),this}get names(){let Z=this.lhs instanceof Y0.Name?{}:{...this.lhs.names};return $5(Z,this.rhs)}}class Zq extends BX{constructor(Z,X,Q,W){super(Z,Q,W);this.op=X}render({_n:Z}){return`${this.lhs} ${this.op}= ${this.rhs};`+Z}}class Xq extends P6{constructor(Z){super();this.label=Z,this.names={}}render({_n:Z}){return`${this.label}:`+Z}}class Qq extends P6{constructor(Z){super();this.label=Z,this.names={}}render({_n:Z}){return`break${this.label?` ${this.label}`:""};`+Z}}class Wq extends P6{constructor(Z){super();this.error=Z}render({_n:Z}){return`throw ${this.error};`+Z}get names(){return this.error.names}}class Jq extends P6{constructor(Z){super();this.code=Z}render({_n:Z}){return`${this.code};`+Z}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(Z,X){return this.code=x1(this.code,Z,X),this}get names(){return this.code instanceof Y0._CodeOrName?this.code.names:{}}}class K5 extends P6{constructor(Z=[]){super();this.nodes=Z}render(Z){return this.nodes.reduce((X,Q)=>X+Q.render(Z),"")}optimizeNodes(){let{nodes:Z}=this,X=Z.length;while(X--){let Q=Z[X].optimizeNodes();if(Array.isArray(Q))Z.splice(X,1,...Q);else if(Q)Z[X]=Q;else Z.splice(X,1)}return Z.length>0?this:void 0}optimizeNames(Z,X){let{nodes:Q}=this,W=Q.length;while(W--){let J=Q[W];if(J.optimizeNames(Z,X))continue;nD(Z,J.names),Q.splice(W,1)}return Q.length>0?this:void 0}get names(){return this.nodes.reduce((Z,X)=>n6(Z,X.names),{})}}class C6 extends K5{render(Z){return"{"+Z._n+super.render(Z)+"}"+Z._n}}class Gq extends K5{}class D9 extends C6{}D9.kind="else";class J6 extends C6{constructor(Z,X){super(X);this.condition=Z}render(Z){let X=`if(${this.condition})`+super.render(Z);if(this.else)X+="else "+this.else.render(Z);return X}optimizeNodes(){super.optimizeNodes();let Z=this.condition;if(Z===!0)return this.nodes;let X=this.else;if(X){let Q=X.optimizeNodes();X=this.else=Array.isArray(Q)?new D9(Q):Q}if(X){if(Z===!1)return X instanceof J6?X:X.nodes;if(this.nodes.length)return this;return new J6(Kq(Z),X instanceof J6?[X]:X.nodes)}if(Z===!1||!this.nodes.length)return;return this}optimizeNames(Z,X){var Q;if(this.else=(Q=this.else)===null||Q===void 0?void 0:Q.optimizeNames(Z,X),!(super.optimizeNames(Z,X)||this.else))return;return this.condition=x1(this.condition,Z,X),this}get names(){let Z=super.names;if($5(Z,this.condition),this.else)n6(Z,this.else.names);return Z}}J6.kind="if";class _1 extends C6{}_1.kind="for";class Yq extends _1{constructor(Z){super();this.iteration=Z}render(Z){return`for(${this.iteration})`+super.render(Z)}optimizeNames(Z,X){if(!super.optimizeNames(Z,X))return;return this.iteration=x1(this.iteration,Z,X),this}get names(){return n6(super.names,this.iteration.names)}}class zq extends _1{constructor(Z,X,Q,W){super();this.varKind=Z,this.name=X,this.from=Q,this.to=W}render(Z){let X=Z.es5?R4.varKinds.var:this.varKind,{name:Q,from:W,to:J}=this;return`for(${X} ${Q}=${W}; ${Q}<${J}; ${Q}++)`+super.render(Z)}get names(){let Z=$5(super.names,this.from);return $5(Z,this.to)}}class UX extends _1{constructor(Z,X,Q,W){super();this.loop=Z,this.varKind=X,this.name=Q,this.iterable=W}render(Z){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(Z)}optimizeNames(Z,X){if(!super.optimizeNames(Z,X))return;return this.iterable=x1(this.iterable,Z,X),this}get names(){return n6(super.names,this.iterable.names)}}class J5 extends C6{constructor(Z,X,Q){super();this.name=Z,this.args=X,this.async=Q}render(Z){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(Z)}}J5.kind="func";class G5 extends K5{render(Z){return"return "+super.render(Z)}}G5.kind="return";class $q extends C6{render(Z){let X="try"+super.render(Z);if(this.catch)X+=this.catch.render(Z);if(this.finally)X+=this.finally.render(Z);return X}optimizeNodes(){var Z,X;return super.optimizeNodes(),(Z=this.catch)===null||Z===void 0||Z.optimizeNodes(),(X=this.finally)===null||X===void 0||X.optimizeNodes(),this}optimizeNames(Z,X){var Q,W;return super.optimizeNames(Z,X),(Q=this.catch)===null||Q===void 0||Q.optimizeNames(Z,X),(W=this.finally)===null||W===void 0||W.optimizeNames(Z,X),this}get names(){let Z=super.names;if(this.catch)n6(Z,this.catch.names);if(this.finally)n6(Z,this.finally.names);return Z}}class Y5 extends C6{constructor(Z){super();this.error=Z}render(Z){return`catch(${this.error})`+super.render(Z)}}Y5.kind="catch";class z5 extends C6{render(Z){return"finally"+super.render(Z)}}z5.kind="finally";class qq{constructor(Z,X={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...X,_n:X.lines?`
|
|
309
|
-
`:""},this._extScope=Z,this._scope=new R4.Scope({parent:Z}),this._nodes=[new Gq]}toString(){return this._root.render(this.opts)}name(Z){return this._scope.name(Z)}scopeName(Z){return this._extScope.name(Z)}scopeValue(Z,X){let Q=this._extScope.value(Z,X);return(this._values[Q.prefix]||(this._values[Q.prefix]=new Set)).add(Q),Q}getScopeValue(Z,X){return this._extScope.getValue(Z,X)}scopeRefs(Z){return this._extScope.scopeRefs(Z,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(Z,X,Q,W){let J=this._scope.toName(X);if(Q!==void 0&&W)this._constants[J.str]=Q;return this._leafNode(new e$(Z,J,Q)),J}const(Z,X,Q){return this._def(R4.varKinds.const,Z,X,Q)}let(Z,X,Q){return this._def(R4.varKinds.let,Z,X,Q)}var(Z,X,Q){return this._def(R4.varKinds.var,Z,X,Q)}assign(Z,X,Q){return this._leafNode(new BX(Z,X,Q))}add(Z,X){return this._leafNode(new Zq(Z,e0.operators.ADD,X))}code(Z){if(typeof Z=="function")Z();else if(Z!==Y0.nil)this._leafNode(new Jq(Z));return this}object(...Z){let X=["{"];for(let[Q,W]of Z){if(X.length>1)X.push(",");if(X.push(Q),Q!==W||this.opts.es5)X.push(":"),(0,Y0.addCodeArg)(X,W)}return X.push("}"),new Y0._Code(X)}if(Z,X,Q){if(this._blockNode(new J6(Z)),X&&Q)this.code(X).else().code(Q).endIf();else if(X)this.code(X).endIf();else if(Q)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(Z){return this._elseNode(new J6(Z))}else(){return this._elseNode(new D9)}endIf(){return this._endBlockNode(J6,D9)}_for(Z,X){if(this._blockNode(Z),X)this.code(X).endFor();return this}for(Z,X){return this._for(new Yq(Z),X)}forRange(Z,X,Q,W,J=this.opts.es5?R4.varKinds.var:R4.varKinds.let){let G=this._scope.toName(Z);return this._for(new zq(J,G,X,Q),()=>W(G))}forOf(Z,X,Q,W=R4.varKinds.const){let J=this._scope.toName(Z);if(this.opts.es5){let G=X instanceof Y0.Name?X:this.var("_arr",X);return this.forRange("_i",0,Y0._`${G}.length`,(Y)=>{this.var(J,Y0._`${G}[${Y}]`),Q(J)})}return this._for(new UX("of",W,J,X),()=>Q(J))}forIn(Z,X,Q,W=this.opts.es5?R4.varKinds.var:R4.varKinds.const){if(this.opts.ownProperties)return this.forOf(Z,Y0._`Object.keys(${X})`,Q);let J=this._scope.toName(Z);return this._for(new UX("in",W,J,X),()=>Q(J))}endFor(){return this._endBlockNode(_1)}label(Z){return this._leafNode(new Xq(Z))}break(Z){return this._leafNode(new Qq(Z))}return(Z){let X=new G5;if(this._blockNode(X),this.code(Z),X.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(G5)}try(Z,X,Q){if(!X&&!Q)throw Error('CodeGen: "try" without "catch" and "finally"');let W=new $q;if(this._blockNode(W),this.code(Z),X){let J=this.name("e");this._currNode=W.catch=new Y5(J),X(J)}if(Q)this._currNode=W.finally=new z5,this.code(Q);return this._endBlockNode(Y5,z5)}throw(Z){return this._leafNode(new Wq(Z))}block(Z,X){if(this._blockStarts.push(this._nodes.length),Z)this.code(Z).endBlock(X);return this}endBlock(Z){let X=this._blockStarts.pop();if(X===void 0)throw Error("CodeGen: not in self-balancing block");let Q=this._nodes.length-X;if(Q<0||Z!==void 0&&Q!==Z)throw Error(`CodeGen: wrong number of nodes: ${Q} vs ${Z} expected`);return this._nodes.length=X,this}func(Z,X=Y0.nil,Q,W){if(this._blockNode(new J5(Z,X,Q)),W)this.code(W).endFunc();return this}endFunc(){return this._endBlockNode(J5)}optimize(Z=1){while(Z-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(Z){return this._currNode.nodes.push(Z),this}_blockNode(Z){this._currNode.nodes.push(Z),this._nodes.push(Z)}_endBlockNode(Z,X){let Q=this._currNode;if(Q instanceof Z||X&&Q instanceof X)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${X?`${Z.kind}/${X.kind}`:Z.kind}"`)}_elseNode(Z){let X=this._currNode;if(!(X instanceof J6))throw Error('CodeGen: "else" without "if"');return this._currNode=X.else=Z,this}get _root(){return this._nodes[0]}get _currNode(){let Z=this._nodes;return Z[Z.length-1]}set _currNode(Z){let X=this._nodes;X[X.length-1]=Z}}e0.CodeGen=qq;function n6(Z,X){for(let Q in X)Z[Q]=(Z[Q]||0)+(X[Q]||0);return Z}function $5(Z,X){return X instanceof Y0._CodeOrName?n6(Z,X.names):Z}function x1(Z,X,Q){if(Z instanceof Y0.Name)return W(Z);if(!J(Z))return Z;return new Y0._Code(Z._items.reduce((G,Y)=>{if(Y instanceof Y0.Name)Y=W(Y);if(Y instanceof Y0._Code)G.push(...Y._items);else G.push(Y);return G},[]));function W(G){let Y=Q[G.str];if(Y===void 0||X[G.str]!==1)return G;return delete X[G.str],Y}function J(G){return G instanceof Y0._Code&&G._items.some((Y)=>Y instanceof Y0.Name&&X[Y.str]===1&&Q[Y.str]!==void 0)}}function nD(Z,X){for(let Q in X)Z[Q]=(Z[Q]||0)-(X[Q]||0)}function Kq(Z){return typeof Z=="boolean"||typeof Z=="number"||Z===null?!Z:Y0._`!${VX(Z)}`}e0.not=Kq;var iD=Uq(e0.operators.AND);function rD(...Z){return Z.reduce(iD)}e0.and=rD;var aD=Uq(e0.operators.OR);function sD(...Z){return Z.reduce(aD)}e0.or=sD;function Uq(Z){return(X,Q)=>X===Y0.nil?Q:Q===Y0.nil?X:Y0._`${VX(X)} ${Z} ${VX(Q)}`}function VX(Z){return Z instanceof Y0.Name?Z:Y0._`(${Z})`}});var W0=j((Nq)=>{Object.defineProperty(Nq,"__esModule",{value:!0});Nq.checkStrictMode=Nq.getErrorPath=Nq.Type=Nq.useFunc=Nq.setEvaluated=Nq.evaluatedPropsToName=Nq.mergeEvaluated=Nq.eachItem=Nq.unescapeJsonPointer=Nq.escapeJsonPointer=Nq.escapeFragment=Nq.unescapeFragment=Nq.schemaRefOrVal=Nq.schemaHasRulesButRef=Nq.schemaHasRules=Nq.checkUnknownRules=Nq.alwaysValidSchema=Nq.toHash=void 0;var B0=Z0(),ZT=N9();function XT(Z){let X={};for(let Q of Z)X[Q]=!0;return X}Nq.toHash=XT;function QT(Z,X){if(typeof X=="boolean")return X;if(Object.keys(X).length===0)return!0;return Fq(Z,X),!Lq(X,Z.self.RULES.all)}Nq.alwaysValidSchema=QT;function Fq(Z,X=Z.schema){let{opts:Q,self:W}=Z;if(!Q.strictSchema)return;if(typeof X==="boolean")return;let J=W.RULES.keywords;for(let G in X)if(!J[G])Iq(Z,`unknown keyword: "${G}"`)}Nq.checkUnknownRules=Fq;function Lq(Z,X){if(typeof Z=="boolean")return!Z;for(let Q in Z)if(X[Q])return!0;return!1}Nq.schemaHasRules=Lq;function WT(Z,X){if(typeof Z=="boolean")return!Z;for(let Q in Z)if(Q!=="$ref"&&X.all[Q])return!0;return!1}Nq.schemaHasRulesButRef=WT;function JT({topSchemaRef:Z,schemaPath:X},Q,W,J){if(!J){if(typeof Q=="number"||typeof Q=="boolean")return Q;if(typeof Q=="string")return B0._`${Q}`}return B0._`${Z}${X}${(0,B0.getProperty)(W)}`}Nq.schemaRefOrVal=JT;function GT(Z){return Aq(decodeURIComponent(Z))}Nq.unescapeFragment=GT;function YT(Z){return encodeURIComponent(FX(Z))}Nq.escapeFragment=YT;function FX(Z){if(typeof Z=="number")return`${Z}`;return Z.replace(/~/g,"~0").replace(/\//g,"~1")}Nq.escapeJsonPointer=FX;function Aq(Z){return Z.replace(/~1/g,"/").replace(/~0/g,"~")}Nq.unescapeJsonPointer=Aq;function zT(Z,X){if(Array.isArray(Z))for(let Q of Z)X(Q);else X(Z)}Nq.eachItem=zT;function Bq({mergeNames:Z,mergeToName:X,mergeValues:Q,resultToName:W}){return(J,G,Y,z)=>{let q=Y===void 0?G:Y instanceof B0.Name?(G instanceof B0.Name?Z(J,G,Y):X(J,G,Y),Y):G instanceof B0.Name?(X(J,Y,G),G):Q(G,Y);return z===B0.Name&&!(q instanceof B0.Name)?W(J,q):q}}Nq.mergeEvaluated={props:Bq({mergeNames:(Z,X,Q)=>Z.if(B0._`${Q} !== true && ${X} !== undefined`,()=>{Z.if(B0._`${X} === true`,()=>Z.assign(Q,!0),()=>Z.assign(Q,B0._`${Q} || {}`).code(B0._`Object.assign(${Q}, ${X})`))}),mergeToName:(Z,X,Q)=>Z.if(B0._`${Q} !== true`,()=>{if(X===!0)Z.assign(Q,!0);else Z.assign(Q,B0._`${Q} || {}`),LX(Z,Q,X)}),mergeValues:(Z,X)=>Z===!0?!0:{...Z,...X},resultToName:Mq}),items:Bq({mergeNames:(Z,X,Q)=>Z.if(B0._`${Q} !== true && ${X} !== undefined`,()=>Z.assign(Q,B0._`${X} === true ? true : ${Q} > ${X} ? ${Q} : ${X}`)),mergeToName:(Z,X,Q)=>Z.if(B0._`${Q} !== true`,()=>Z.assign(Q,X===!0?!0:B0._`${Q} > ${X} ? ${Q} : ${X}`)),mergeValues:(Z,X)=>Z===!0?!0:Math.max(Z,X),resultToName:(Z,X)=>Z.var("items",X)})};function Mq(Z,X){if(X===!0)return Z.var("props",!0);let Q=Z.var("props",B0._`{}`);if(X!==void 0)LX(Z,Q,X);return Q}Nq.evaluatedPropsToName=Mq;function LX(Z,X,Q){Object.keys(Q).forEach((W)=>Z.assign(B0._`${X}${(0,B0.getProperty)(W)}`,!0))}Nq.setEvaluated=LX;var Hq={};function $T(Z,X){return Z.scopeValue("func",{ref:X,code:Hq[X.code]||(Hq[X.code]=new ZT._Code(X.code))})}Nq.useFunc=$T;var HX;(function(Z){Z[Z.Num=0]="Num",Z[Z.Str=1]="Str"})(HX||(Nq.Type=HX={}));function qT(Z,X,Q){if(Z instanceof B0.Name){let W=X===HX.Num;return Q?W?B0._`"[" + ${Z} + "]"`:B0._`"['" + ${Z} + "']"`:W?B0._`"/" + ${Z}`:B0._`"/" + ${Z}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return Q?(0,B0.getProperty)(Z).toString():"/"+FX(Z)}Nq.getErrorPath=qT;function Iq(Z,X,Q=Z.opts.strictSchema){if(!Q)return;if(X=`strict mode: ${X}`,Q===!0)throw Error(X);Z.self.logger.warn(X)}Nq.checkStrictMode=Iq});var A4=j((Tq)=>{Object.defineProperty(Tq,"__esModule",{value:!0});var u0=Z0(),RT={data:new u0.Name("data"),valCxt:new u0.Name("valCxt"),instancePath:new u0.Name("instancePath"),parentData:new u0.Name("parentData"),parentDataProperty:new u0.Name("parentDataProperty"),rootData:new u0.Name("rootData"),dynamicAnchors:new u0.Name("dynamicAnchors"),vErrors:new u0.Name("vErrors"),errors:new u0.Name("errors"),this:new u0.Name("this"),self:new u0.Name("self"),scope:new u0.Name("scope"),json:new u0.Name("json"),jsonPos:new u0.Name("jsonPos"),jsonLen:new u0.Name("jsonLen"),jsonPart:new u0.Name("jsonPart")};Tq.default=RT});var T9=j((Eq)=>{Object.defineProperty(Eq,"__esModule",{value:!0});Eq.extendErrors=Eq.resetErrorsCount=Eq.reportExtraError=Eq.reportError=Eq.keyword$DataError=Eq.keywordError=void 0;var z0=Z0(),V5=W0(),n0=A4();Eq.keywordError={message:({keyword:Z})=>z0.str`must pass "${Z}" keyword validation`};Eq.keyword$DataError={message:({keyword:Z,schemaType:X})=>X?z0.str`"${Z}" keyword must be ${X} ($data)`:z0.str`"${Z}" keyword is invalid ($data)`};function CT(Z,X=Eq.keywordError,Q,W){let{it:J}=Z,{gen:G,compositeRule:Y,allErrors:z}=J,q=Oq(Z,X,Q);if(W!==null&&W!==void 0?W:Y||z)wq(G,q);else jq(J,z0._`[${q}]`)}Eq.reportError=CT;function ST(Z,X=Eq.keywordError,Q){let{it:W}=Z,{gen:J,compositeRule:G,allErrors:Y}=W,z=Oq(Z,X,Q);if(wq(J,z),!(G||Y))jq(W,n0.default.vErrors)}Eq.reportExtraError=ST;function kT(Z,X){Z.assign(n0.default.errors,X),Z.if(z0._`${n0.default.vErrors} !== null`,()=>Z.if(X,()=>Z.assign(z0._`${n0.default.vErrors}.length`,X),()=>Z.assign(n0.default.vErrors,null)))}Eq.resetErrorsCount=kT;function bT({gen:Z,keyword:X,schemaValue:Q,data:W,errsCount:J,it:G}){if(J===void 0)throw Error("ajv implementation error");let Y=Z.name("err");Z.forRange("i",J,n0.default.errors,(z)=>{if(Z.const(Y,z0._`${n0.default.vErrors}[${z}]`),Z.if(z0._`${Y}.instancePath === undefined`,()=>Z.assign(z0._`${Y}.instancePath`,(0,z0.strConcat)(n0.default.instancePath,G.errorPath))),Z.assign(z0._`${Y}.schemaPath`,z0.str`${G.errSchemaPath}/${X}`),G.opts.verbose)Z.assign(z0._`${Y}.schema`,Q),Z.assign(z0._`${Y}.data`,W)})}Eq.extendErrors=bT;function wq(Z,X){let Q=Z.const("err",X);Z.if(z0._`${n0.default.vErrors} === null`,()=>Z.assign(n0.default.vErrors,z0._`[${Q}]`),z0._`${n0.default.vErrors}.push(${Q})`),Z.code(z0._`${n0.default.errors}++`)}function jq(Z,X){let{gen:Q,validateName:W,schemaEnv:J}=Z;if(J.$async)Q.throw(z0._`new ${Z.ValidationError}(${X})`);else Q.assign(z0._`${W}.errors`,X),Q.return(!1)}var i6={keyword:new z0.Name("keyword"),schemaPath:new z0.Name("schemaPath"),params:new z0.Name("params"),propertyName:new z0.Name("propertyName"),message:new z0.Name("message"),schema:new z0.Name("schema"),parentSchema:new z0.Name("parentSchema")};function Oq(Z,X,Q){let{createErrors:W}=Z.it;if(W===!1)return z0._`{}`;return _T(Z,X,Q)}function _T(Z,X,Q={}){let{gen:W,it:J}=Z,G=[xT(J,Q),vT(Z,Q)];return yT(Z,X,G),W.object(...G)}function xT({errorPath:Z},{instancePath:X}){let Q=X?z0.str`${Z}${(0,V5.getErrorPath)(X,V5.Type.Str)}`:Z;return[n0.default.instancePath,(0,z0.strConcat)(n0.default.instancePath,Q)]}function vT({keyword:Z,it:{errSchemaPath:X}},{schemaPath:Q,parentSchema:W}){let J=W?X:z0.str`${X}/${Z}`;if(Q)J=z0.str`${J}${(0,V5.getErrorPath)(Q,V5.Type.Str)}`;return[i6.schemaPath,J]}function yT(Z,{params:X,message:Q},W){let{keyword:J,data:G,schemaValue:Y,it:z}=Z,{opts:q,propertyName:K,topSchemaRef:V,schemaPath:B}=z;if(W.push([i6.keyword,J],[i6.params,typeof X=="function"?X(Z):X||z0._`{}`]),q.messages)W.push([i6.message,typeof Q=="function"?Q(Z):Q]);if(q.verbose)W.push([i6.schema,Y],[i6.parentSchema,z0._`${V}${B}`],[n0.default.data,G]);if(K)W.push([i6.propertyName,K])}});var kq=j((Cq)=>{Object.defineProperty(Cq,"__esModule",{value:!0});Cq.boolOrEmptySchema=Cq.topBoolOrEmptySchema=void 0;var mT=T9(),lT=Z0(),dT=A4(),cT={message:"boolean schema is false"};function pT(Z){let{gen:X,schema:Q,validateName:W}=Z;if(Q===!1)Pq(Z,!1);else if(typeof Q=="object"&&Q.$async===!0)X.return(dT.default.data);else X.assign(lT._`${W}.errors`,null),X.return(!0)}Cq.topBoolOrEmptySchema=pT;function nT(Z,X){let{gen:Q,schema:W}=Z;if(W===!1)Q.var(X,!1),Pq(Z);else Q.var(X,!0)}Cq.boolOrEmptySchema=nT;function Pq(Z,X){let{gen:Q,data:W}=Z,J={gen:Q,keyword:"false schema",data:W,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:Z};(0,mT.reportError)(J,cT,void 0,X)}});var MX=j((bq)=>{Object.defineProperty(bq,"__esModule",{value:!0});bq.getRules=bq.isJSONType=void 0;var rT=["string","number","integer","boolean","null","object","array"],aT=new Set(rT);function sT(Z){return typeof Z=="string"&&aT.has(Z)}bq.isJSONType=sT;function oT(){let Z={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...Z,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},Z.number,Z.string,Z.array,Z.object],post:{rules:[]},all:{},keywords:{}}}bq.getRules=oT});var IX=j((yq)=>{Object.defineProperty(yq,"__esModule",{value:!0});yq.shouldUseRule=yq.shouldUseGroup=yq.schemaHasRulesForType=void 0;function eT({schema:Z,self:X},Q){let W=X.RULES.types[Q];return W&&W!==!0&&xq(Z,W)}yq.schemaHasRulesForType=eT;function xq(Z,X){return X.rules.some((Q)=>vq(Z,Q))}yq.shouldUseGroup=xq;function vq(Z,X){var Q;return Z[X.keyword]!==void 0||((Q=X.definition.implements)===null||Q===void 0?void 0:Q.some((W)=>Z[W]!==void 0))}yq.shouldUseRule=vq});var w9=j((mq)=>{Object.defineProperty(mq,"__esModule",{value:!0});mq.reportTypeError=mq.checkDataTypes=mq.checkDataType=mq.coerceAndCheckDataType=mq.getJSONTypes=mq.getSchemaTypes=mq.DataType=void 0;var Qw=MX(),Ww=IX(),Jw=T9(),X0=Z0(),fq=W0(),v1;(function(Z){Z[Z.Correct=0]="Correct",Z[Z.Wrong=1]="Wrong"})(v1||(mq.DataType=v1={}));function Gw(Z){let X=hq(Z.type);if(X.includes("null")){if(Z.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!X.length&&Z.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(Z.nullable===!0)X.push("null")}return X}mq.getSchemaTypes=Gw;function hq(Z){let X=Array.isArray(Z)?Z:Z?[Z]:[];if(X.every(Qw.isJSONType))return X;throw Error("type must be JSONType or JSONType[]: "+X.join(","))}mq.getJSONTypes=hq;function Yw(Z,X){let{gen:Q,data:W,opts:J}=Z,G=zw(X,J.coerceTypes),Y=X.length>0&&!(G.length===0&&X.length===1&&(0,Ww.schemaHasRulesForType)(Z,X[0]));if(Y){let z=DX(X,W,J.strictNumbers,v1.Wrong);Q.if(z,()=>{if(G.length)$w(Z,X,G);else TX(Z)})}return Y}mq.coerceAndCheckDataType=Yw;var uq=new Set(["string","number","integer","boolean","null"]);function zw(Z,X){return X?Z.filter((Q)=>uq.has(Q)||X==="array"&&Q==="array"):[]}function $w(Z,X,Q){let{gen:W,data:J,opts:G}=Z,Y=W.let("dataType",X0._`typeof ${J}`),z=W.let("coerced",X0._`undefined`);if(G.coerceTypes==="array")W.if(X0._`${Y} == 'object' && Array.isArray(${J}) && ${J}.length == 1`,()=>W.assign(J,X0._`${J}[0]`).assign(Y,X0._`typeof ${J}`).if(DX(X,J,G.strictNumbers),()=>W.assign(z,J)));W.if(X0._`${z} !== undefined`);for(let K of Q)if(uq.has(K)||K==="array"&&G.coerceTypes==="array")q(K);W.else(),TX(Z),W.endIf(),W.if(X0._`${z} !== undefined`,()=>{W.assign(J,z),qw(Z,z)});function q(K){switch(K){case"string":W.elseIf(X0._`${Y} == "number" || ${Y} == "boolean"`).assign(z,X0._`"" + ${J}`).elseIf(X0._`${J} === null`).assign(z,X0._`""`);return;case"number":W.elseIf(X0._`${Y} == "boolean" || ${J} === null
|
|
310
|
-
|| (${Y} == "string" && ${
|
|
311
|
-
|| (${Y} === "string" && ${
|
|
312
|
-
|| ${Y} === "boolean" || ${J} === null`).assign(z,X0._`[${J}]`)}}}function qw({gen:Z,parentData:X,parentDataProperty:Q},W){Z.if(X0._`${X} !== undefined`,()=>Z.assign(X0._`${X}[${Q}]`,W))}function NX(Z,X,Q,W=v1.Correct){let J=W===v1.Correct?X0.operators.EQ:X0.operators.NEQ,G;switch(Z){case"null":return X0._`${X} ${J} null`;case"array":G=X0._`Array.isArray(${X})`;break;case"object":G=X0._`${X} && typeof ${X} == "object" && !Array.isArray(${X})`;break;case"integer":G=Y(X0._`!(${X} % 1) && !isNaN(${X})`);break;case"number":G=Y();break;default:return X0._`typeof ${X} ${J} ${Z}`}return W===v1.Correct?G:(0,X0.not)(G);function Y(z=X0.nil){return(0,X0.and)(X0._`typeof ${X} == "number"`,z,Q?X0._`isFinite(${X})`:X0.nil)}}mq.checkDataType=NX;function DX(Z,X,Q,W){if(Z.length===1)return NX(Z[0],X,Q,W);let J,G=(0,fq.toHash)(Z);if(G.array&&G.object){let Y=X0._`typeof ${X} != "object"`;J=G.null?Y:X0._`!${X} || ${Y}`,delete G.null,delete G.array,delete G.object}else J=X0.nil;if(G.number)delete G.integer;for(let Y in G)J=(0,X0.and)(J,NX(Y,X,Q,W));return J}mq.checkDataTypes=DX;var Kw={message:({schema:Z})=>`must be ${Z}`,params:({schema:Z,schemaValue:X})=>typeof Z=="string"?X0._`{type: ${Z}}`:X0._`{type: ${X}}`};function TX(Z){let X=Uw(Z);(0,Jw.reportError)(X,Kw)}mq.reportTypeError=TX;function Uw(Z){let{gen:X,data:Q,schema:W}=Z,J=(0,fq.schemaRefOrVal)(Z,W,"type");return{gen:X,keyword:"type",data:Q,schema:W.type,schemaCode:J,schemaValue:J,parentSchema:W,params:{},it:Z}}});var nq=j((cq)=>{Object.defineProperty(cq,"__esModule",{value:!0});cq.assignDefaults=void 0;var y1=Z0(),Mw=W0();function Iw(Z,X){let{properties:Q,items:W}=Z.schema;if(X==="object"&&Q)for(let J in Q)dq(Z,J,Q[J].default);else if(X==="array"&&Array.isArray(W))W.forEach((J,G)=>dq(Z,G,J.default))}cq.assignDefaults=Iw;function dq(Z,X,Q){let{gen:W,compositeRule:J,data:G,opts:Y}=Z;if(Q===void 0)return;let z=y1._`${G}${(0,y1.getProperty)(X)}`;if(J){(0,Mw.checkStrictMode)(Z,`default is ignored for: ${z}`);return}let q=y1._`${z} === undefined`;if(Y.useDefaults==="empty")q=y1._`${q} || ${z} === null || ${z} === ""`;W.if(q,y1._`${z} = ${(0,y1.stringify)(Q)}`)}});var M4=j((aq)=>{Object.defineProperty(aq,"__esModule",{value:!0});aq.validateUnion=aq.validateArray=aq.usePattern=aq.callValidateCode=aq.schemaProperties=aq.allSchemaProperties=aq.noPropertyInData=aq.propertyInData=aq.isOwnProperty=aq.hasPropFunc=aq.reportMissingProp=aq.checkMissingProp=aq.checkReportMissingProp=void 0;var A0=Z0(),wX=W0(),S6=A4(),Nw=W0();function Dw(Z,X){let{gen:Q,data:W,it:J}=Z;Q.if(OX(Q,W,X,J.opts.ownProperties),()=>{Z.setParams({missingProperty:A0._`${X}`},!0),Z.error()})}aq.checkReportMissingProp=Dw;function Tw({gen:Z,data:X,it:{opts:Q}},W,J){return(0,A0.or)(...W.map((G)=>(0,A0.and)(OX(Z,X,G,Q.ownProperties),A0._`${J} = ${G}`)))}aq.checkMissingProp=Tw;function ww(Z,X){Z.setParams({missingProperty:X},!0),Z.error()}aq.reportMissingProp=ww;function iq(Z){return Z.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:A0._`Object.prototype.hasOwnProperty`})}aq.hasPropFunc=iq;function jX(Z,X,Q){return A0._`${iq(Z)}.call(${X}, ${Q})`}aq.isOwnProperty=jX;function jw(Z,X,Q,W){let J=A0._`${X}${(0,A0.getProperty)(Q)} !== undefined`;return W?A0._`${J} && ${jX(Z,X,Q)}`:J}aq.propertyInData=jw;function OX(Z,X,Q,W){let J=A0._`${X}${(0,A0.getProperty)(Q)} === undefined`;return W?(0,A0.or)(J,(0,A0.not)(jX(Z,X,Q))):J}aq.noPropertyInData=OX;function rq(Z){return Z?Object.keys(Z).filter((X)=>X!=="__proto__"):[]}aq.allSchemaProperties=rq;function Ow(Z,X){return rq(X).filter((Q)=>!(0,wX.alwaysValidSchema)(Z,X[Q]))}aq.schemaProperties=Ow;function Ew({schemaCode:Z,data:X,it:{gen:Q,topSchemaRef:W,schemaPath:J,errorPath:G},it:Y},z,q,K){let V=K?A0._`${Z}, ${X}, ${W}${J}`:X,B=[[S6.default.instancePath,(0,A0.strConcat)(S6.default.instancePath,G)],[S6.default.parentData,Y.parentData],[S6.default.parentDataProperty,Y.parentDataProperty],[S6.default.rootData,S6.default.rootData]];if(Y.opts.dynamicRef)B.push([S6.default.dynamicAnchors,S6.default.dynamicAnchors]);let H=A0._`${V}, ${Q.object(...B)}`;return q!==A0.nil?A0._`${z}.call(${q}, ${H})`:A0._`${z}(${H})`}aq.callValidateCode=Ew;var Rw=A0._`new RegExp`;function Pw({gen:Z,it:{opts:X}},Q){let W=X.unicodeRegExp?"u":"",{regExp:J}=X.code,G=J(Q,W);return Z.scopeValue("pattern",{key:G.toString(),ref:G,code:A0._`${J.code==="new RegExp"?Rw:(0,Nw.useFunc)(Z,J)}(${Q}, ${W})`})}aq.usePattern=Pw;function Cw(Z){let{gen:X,data:Q,keyword:W,it:J}=Z,G=X.name("valid");if(J.allErrors){let z=X.let("valid",!0);return Y(()=>X.assign(z,!1)),z}return X.var(G,!0),Y(()=>X.break()),G;function Y(z){let q=X.const("len",A0._`${Q}.length`);X.forRange("i",0,q,(K)=>{Z.subschema({keyword:W,dataProp:K,dataPropType:wX.Type.Num},G),X.if((0,A0.not)(G),z)})}}aq.validateArray=Cw;function Sw(Z){let{gen:X,schema:Q,keyword:W,it:J}=Z;if(!Array.isArray(Q))throw Error("ajv implementation error");if(Q.some((q)=>(0,wX.alwaysValidSchema)(J,q))&&!J.opts.unevaluated)return;let Y=X.let("valid",!1),z=X.name("_valid");X.block(()=>Q.forEach((q,K)=>{let V=Z.subschema({keyword:W,schemaProp:K,compositeRule:!0},z);if(X.assign(Y,A0._`${Y} || ${z}`),!Z.mergeValidEvaluated(V,z))X.if((0,A0.not)(Y))})),Z.result(Y,()=>Z.reset(),()=>Z.error(!0))}aq.validateUnion=Sw});var XK=j((eq)=>{Object.defineProperty(eq,"__esModule",{value:!0});eq.validateKeywordUsage=eq.validSchemaType=eq.funcKeywordCode=eq.macroKeywordCode=void 0;var i0=Z0(),r6=A4(),dw=M4(),cw=T9();function pw(Z,X){let{gen:Q,keyword:W,schema:J,parentSchema:G,it:Y}=Z,z=X.macro.call(Y.self,J,G,Y),q=tq(Q,W,z);if(Y.opts.validateSchema!==!1)Y.self.validateSchema(z,!0);let K=Q.name("valid");Z.subschema({schema:z,schemaPath:i0.nil,errSchemaPath:`${Y.errSchemaPath}/${W}`,topSchemaRef:q,compositeRule:!0},K),Z.pass(K,()=>Z.error(!0))}eq.macroKeywordCode=pw;function nw(Z,X){var Q;let{gen:W,keyword:J,schema:G,parentSchema:Y,$data:z,it:q}=Z;rw(q,X);let K=!z&&X.compile?X.compile.call(q.self,G,Y,q):X.validate,V=tq(W,J,K),B=W.let("valid");Z.block$data(B,H),Z.ok((Q=X.valid)!==null&&Q!==void 0?Q:B);function H(){if(X.errors===!1){if(M(),X.modifying)oq(Z);I(()=>Z.error())}else{let N=X.async?F():A();if(X.modifying)oq(Z);I(()=>iw(Z,N))}}function F(){let N=W.let("ruleErrs",null);return W.try(()=>M(i0._`await `),(T)=>W.assign(B,!1).if(i0._`${T} instanceof ${q.ValidationError}`,()=>W.assign(N,i0._`${T}.errors`),()=>W.throw(T))),N}function A(){let N=i0._`${V}.errors`;return W.assign(N,null),M(i0.nil),N}function M(N=X.async?i0._`await `:i0.nil){let T=q.opts.passContext?r6.default.this:r6.default.self,S=!(("compile"in X)&&!z||X.schema===!1);W.assign(B,i0._`${N}${(0,dw.callValidateCode)(Z,V,T,S)}`,X.modifying)}function I(N){var T;W.if((0,i0.not)((T=X.valid)!==null&&T!==void 0?T:B),N)}}eq.funcKeywordCode=nw;function oq(Z){let{gen:X,data:Q,it:W}=Z;X.if(W.parentData,()=>X.assign(Q,i0._`${W.parentData}[${W.parentDataProperty}]`))}function iw(Z,X){let{gen:Q}=Z;Q.if(i0._`Array.isArray(${X})`,()=>{Q.assign(r6.default.vErrors,i0._`${r6.default.vErrors} === null ? ${X} : ${r6.default.vErrors}.concat(${X})`).assign(r6.default.errors,i0._`${r6.default.vErrors}.length`),(0,cw.extendErrors)(Z)},()=>Z.error())}function rw({schemaEnv:Z},X){if(X.async&&!Z.$async)throw Error("async keyword in sync schema")}function tq(Z,X,Q){if(Q===void 0)throw Error(`keyword "${X}" failed to compile`);return Z.scopeValue("keyword",typeof Q=="function"?{ref:Q}:{ref:Q,code:(0,i0.stringify)(Q)})}function aw(Z,X,Q=!1){return!X.length||X.some((W)=>W==="array"?Array.isArray(Z):W==="object"?Z&&typeof Z=="object"&&!Array.isArray(Z):typeof Z==W||Q&&typeof Z>"u")}eq.validSchemaType=aw;function sw({schema:Z,opts:X,self:Q,errSchemaPath:W},J,G){if(Array.isArray(J.keyword)?!J.keyword.includes(G):J.keyword!==G)throw Error("ajv implementation error");let Y=J.dependencies;if(Y===null||Y===void 0?void 0:Y.some((z)=>!Object.prototype.hasOwnProperty.call(Z,z)))throw Error(`parent schema must have dependencies of ${G}: ${Y.join(",")}`);if(J.validateSchema){if(!J.validateSchema(Z[G])){let q=`keyword "${G}" value is invalid at path "${W}": `+Q.errorsText(J.validateSchema.errors);if(X.validateSchema==="log")Q.logger.error(q);else throw Error(q)}}}eq.validateKeywordUsage=sw});var GK=j((WK)=>{Object.defineProperty(WK,"__esModule",{value:!0});WK.extendSubschemaMode=WK.extendSubschemaData=WK.getSubschema=void 0;var l4=Z0(),QK=W0();function Zj(Z,{keyword:X,schemaProp:Q,schema:W,schemaPath:J,errSchemaPath:G,topSchemaRef:Y}){if(X!==void 0&&W!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(X!==void 0){let z=Z.schema[X];return Q===void 0?{schema:z,schemaPath:l4._`${Z.schemaPath}${(0,l4.getProperty)(X)}`,errSchemaPath:`${Z.errSchemaPath}/${X}`}:{schema:z[Q],schemaPath:l4._`${Z.schemaPath}${(0,l4.getProperty)(X)}${(0,l4.getProperty)(Q)}`,errSchemaPath:`${Z.errSchemaPath}/${X}/${(0,QK.escapeFragment)(Q)}`}}if(W!==void 0){if(J===void 0||G===void 0||Y===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:W,schemaPath:J,topSchemaRef:Y,errSchemaPath:G}}throw Error('either "keyword" or "schema" must be passed')}WK.getSubschema=Zj;function Xj(Z,X,{dataProp:Q,dataPropType:W,data:J,dataTypes:G,propertyName:Y}){if(J!==void 0&&Q!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:z}=X;if(Q!==void 0){let{errorPath:K,dataPathArr:V,opts:B}=X,H=z.let("data",l4._`${X.data}${(0,l4.getProperty)(Q)}`,!0);q(H),Z.errorPath=l4.str`${K}${(0,QK.getErrorPath)(Q,W,B.jsPropertySyntax)}`,Z.parentDataProperty=l4._`${Q}`,Z.dataPathArr=[...V,Z.parentDataProperty]}if(J!==void 0){let K=J instanceof l4.Name?J:z.let("data",J,!0);if(q(K),Y!==void 0)Z.propertyName=Y}if(G)Z.dataTypes=G;function q(K){Z.data=K,Z.dataLevel=X.dataLevel+1,Z.dataTypes=[],X.definedProperties=new Set,Z.parentData=X.data,Z.dataNames=[...X.dataNames,K]}}WK.extendSubschemaData=Xj;function Qj(Z,{jtdDiscriminator:X,jtdMetadata:Q,compositeRule:W,createErrors:J,allErrors:G}){if(W!==void 0)Z.compositeRule=W;if(J!==void 0)Z.createErrors=J;if(G!==void 0)Z.allErrors=G;Z.jtdDiscriminator=X,Z.jtdMetadata=Q}WK.extendSubschemaMode=Qj});var EX=j((Hg,YK)=>{YK.exports=function Z(X,Q){if(X===Q)return!0;if(X&&Q&&typeof X=="object"&&typeof Q=="object"){if(X.constructor!==Q.constructor)return!1;var W,J,G;if(Array.isArray(X)){if(W=X.length,W!=Q.length)return!1;for(J=W;J--!==0;)if(!Z(X[J],Q[J]))return!1;return!0}if(X.constructor===RegExp)return X.source===Q.source&&X.flags===Q.flags;if(X.valueOf!==Object.prototype.valueOf)return X.valueOf()===Q.valueOf();if(X.toString!==Object.prototype.toString)return X.toString()===Q.toString();if(G=Object.keys(X),W=G.length,W!==Object.keys(Q).length)return!1;for(J=W;J--!==0;)if(!Object.prototype.hasOwnProperty.call(Q,G[J]))return!1;for(J=W;J--!==0;){var Y=G[J];if(!Z(X[Y],Q[Y]))return!1}return!0}return X!==X&&Q!==Q}});var $K=j((Fg,zK)=>{var k6=zK.exports=function(Z,X,Q){if(typeof X=="function")Q=X,X={};Q=X.cb||Q;var W=typeof Q=="function"?Q:Q.pre||function(){},J=Q.post||function(){};B5(X,W,J,Z,"",Z)};k6.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};k6.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};k6.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};k6.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function B5(Z,X,Q,W,J,G,Y,z,q,K){if(W&&typeof W=="object"&&!Array.isArray(W)){X(W,J,G,Y,z,q,K);for(var V in W){var B=W[V];if(Array.isArray(B)){if(V in k6.arrayKeywords)for(var H=0;H<B.length;H++)B5(Z,X,Q,B[H],J+"/"+V+"/"+H,G,J,V,W,H)}else if(V in k6.propsKeywords){if(B&&typeof B=="object")for(var F in B)B5(Z,X,Q,B[F],J+"/"+V+"/"+Gj(F),G,J,V,W,F)}else if(V in k6.keywords||Z.allKeys&&!(V in k6.skipKeywords))B5(Z,X,Q,B,J+"/"+V,G,J,V,W)}Q(W,J,G,Y,z,q,K)}}function Gj(Z){return Z.replace(/~/g,"~0").replace(/\//g,"~1")}});var j9=j((VK)=>{Object.defineProperty(VK,"__esModule",{value:!0});VK.getSchemaRefs=VK.resolveUrl=VK.normalizeId=VK._getFullPath=VK.getFullPath=VK.inlineRef=void 0;var Yj=W0(),zj=EX(),$j=$K(),qj=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Kj(Z,X=!0){if(typeof Z=="boolean")return!0;if(X===!0)return!RX(Z);if(!X)return!1;return qK(Z)<=X}VK.inlineRef=Kj;var Uj=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function RX(Z){for(let X in Z){if(Uj.has(X))return!0;let Q=Z[X];if(Array.isArray(Q)&&Q.some(RX))return!0;if(typeof Q=="object"&&RX(Q))return!0}return!1}function qK(Z){let X=0;for(let Q in Z){if(Q==="$ref")return 1/0;if(X++,qj.has(Q))continue;if(typeof Z[Q]=="object")(0,Yj.eachItem)(Z[Q],(W)=>X+=qK(W));if(X===1/0)return 1/0}return X}function KK(Z,X="",Q){if(Q!==!1)X=g1(X);let W=Z.parse(X);return UK(Z,W)}VK.getFullPath=KK;function UK(Z,X){return Z.serialize(X).split("#")[0]+"#"}VK._getFullPath=UK;var Vj=/#\/?$/;function g1(Z){return Z?Z.replace(Vj,""):""}VK.normalizeId=g1;function Bj(Z,X,Q){return Q=g1(Q),Z.resolve(X,Q)}VK.resolveUrl=Bj;var Hj=/^[a-z_][-a-z0-9._]*$/i;function Fj(Z,X){if(typeof Z=="boolean")return{};let{schemaId:Q,uriResolver:W}=this.opts,J=g1(Z[Q]||X),G={"":J},Y=KK(W,J,!1),z={},q=new Set;return $j(Z,{allKeys:!0},(B,H,F,A)=>{if(A===void 0)return;let M=Y+H,I=G[A];if(typeof B[Q]=="string")I=N.call(this,B[Q]);T.call(this,B.$anchor),T.call(this,B.$dynamicAnchor),G[H]=I;function N(S){let v=this.opts.uriResolver.resolve;if(S=g1(I?v(I,S):S),q.has(S))throw V(S);q.add(S);let x=this.refs[S];if(typeof x=="string")x=this.refs[x];if(typeof x=="object")K(B,x.schema,S);else if(S!==g1(M))if(S[0]==="#")K(B,z[S],S),z[S]=B;else this.refs[S]=M;return S}function T(S){if(typeof S=="string"){if(!Hj.test(S))throw Error(`invalid anchor "${S}"`);N.call(this,`#${S}`)}}}),z;function K(B,H,F){if(H!==void 0&&!zj(B,H))throw V(F)}function V(B){return Error(`reference "${B}" resolves to more than one schema`)}}VK.getSchemaRefs=Fj});var R9=j((PK)=>{Object.defineProperty(PK,"__esModule",{value:!0});PK.getData=PK.KeywordCxt=PK.validateFunctionCode=void 0;var MK=kq(),HK=w9(),CX=IX(),H5=w9(),Dj=nq(),E9=XK(),PX=GK(),n=Z0(),o=A4(),Tj=j9(),G6=W0(),O9=T9();function wj(Z){if(DK(Z)){if(TK(Z),NK(Z)){Ej(Z);return}}IK(Z,()=>(0,MK.topBoolOrEmptySchema)(Z))}PK.validateFunctionCode=wj;function IK({gen:Z,validateName:X,schema:Q,schemaEnv:W,opts:J},G){if(J.code.es5)Z.func(X,n._`${o.default.data}, ${o.default.valCxt}`,W.$async,()=>{Z.code(n._`"use strict"; ${FK(Q,J)}`),Oj(Z,J),Z.code(G)});else Z.func(X,n._`${o.default.data}, ${jj(J)}`,W.$async,()=>Z.code(FK(Q,J)).code(G))}function jj(Z){return n._`{${o.default.instancePath}="", ${o.default.parentData}, ${o.default.parentDataProperty}, ${o.default.rootData}=${o.default.data}${Z.dynamicRef?n._`, ${o.default.dynamicAnchors}={}`:n.nil}}={}`}function Oj(Z,X){Z.if(o.default.valCxt,()=>{if(Z.var(o.default.instancePath,n._`${o.default.valCxt}.${o.default.instancePath}`),Z.var(o.default.parentData,n._`${o.default.valCxt}.${o.default.parentData}`),Z.var(o.default.parentDataProperty,n._`${o.default.valCxt}.${o.default.parentDataProperty}`),Z.var(o.default.rootData,n._`${o.default.valCxt}.${o.default.rootData}`),X.dynamicRef)Z.var(o.default.dynamicAnchors,n._`${o.default.valCxt}.${o.default.dynamicAnchors}`)},()=>{if(Z.var(o.default.instancePath,n._`""`),Z.var(o.default.parentData,n._`undefined`),Z.var(o.default.parentDataProperty,n._`undefined`),Z.var(o.default.rootData,o.default.data),X.dynamicRef)Z.var(o.default.dynamicAnchors,n._`{}`)})}function Ej(Z){let{schema:X,opts:Q,gen:W}=Z;IK(Z,()=>{if(Q.$comment&&X.$comment)jK(Z);if(kj(Z),W.let(o.default.vErrors,null),W.let(o.default.errors,0),Q.unevaluated)Rj(Z);wK(Z),xj(Z)});return}function Rj(Z){let{gen:X,validateName:Q}=Z;Z.evaluated=X.const("evaluated",n._`${Q}.evaluated`),X.if(n._`${Z.evaluated}.dynamicProps`,()=>X.assign(n._`${Z.evaluated}.props`,n._`undefined`)),X.if(n._`${Z.evaluated}.dynamicItems`,()=>X.assign(n._`${Z.evaluated}.items`,n._`undefined`))}function FK(Z,X){let Q=typeof Z=="object"&&Z[X.schemaId];return Q&&(X.code.source||X.code.process)?n._`/*# sourceURL=${Q} */`:n.nil}function Pj(Z,X){if(DK(Z)){if(TK(Z),NK(Z)){Cj(Z,X);return}}(0,MK.boolOrEmptySchema)(Z,X)}function NK({schema:Z,self:X}){if(typeof Z=="boolean")return!Z;for(let Q in Z)if(X.RULES.all[Q])return!0;return!1}function DK(Z){return typeof Z.schema!="boolean"}function Cj(Z,X){let{schema:Q,gen:W,opts:J}=Z;if(J.$comment&&Q.$comment)jK(Z);bj(Z),_j(Z);let G=W.const("_errs",o.default.errors);wK(Z,G),W.var(X,n._`${G} === ${o.default.errors}`)}function TK(Z){(0,G6.checkUnknownRules)(Z),Sj(Z)}function wK(Z,X){if(Z.opts.jtd)return LK(Z,[],!1,X);let Q=(0,HK.getSchemaTypes)(Z.schema),W=(0,HK.coerceAndCheckDataType)(Z,Q);LK(Z,Q,!W,X)}function Sj(Z){let{schema:X,errSchemaPath:Q,opts:W,self:J}=Z;if(X.$ref&&W.ignoreKeywordsWithRef&&(0,G6.schemaHasRulesButRef)(X,J.RULES))J.logger.warn(`$ref: keywords ignored in schema at path "${Q}"`)}function kj(Z){let{schema:X,opts:Q}=Z;if(X.default!==void 0&&Q.useDefaults&&Q.strictSchema)(0,G6.checkStrictMode)(Z,"default is ignored in the schema root")}function bj(Z){let X=Z.schema[Z.opts.schemaId];if(X)Z.baseId=(0,Tj.resolveUrl)(Z.opts.uriResolver,Z.baseId,X)}function _j(Z){if(Z.schema.$async&&!Z.schemaEnv.$async)throw Error("async schema in sync schema")}function jK({gen:Z,schemaEnv:X,schema:Q,errSchemaPath:W,opts:J}){let G=Q.$comment;if(J.$comment===!0)Z.code(n._`${o.default.self}.logger.log(${G})`);else if(typeof J.$comment=="function"){let Y=n.str`${W}/$comment`,z=Z.scopeValue("root",{ref:X.root});Z.code(n._`${o.default.self}.opts.$comment(${G}, ${Y}, ${z}.schema)`)}}function xj(Z){let{gen:X,schemaEnv:Q,validateName:W,ValidationError:J,opts:G}=Z;if(Q.$async)X.if(n._`${o.default.errors} === 0`,()=>X.return(o.default.data),()=>X.throw(n._`new ${J}(${o.default.vErrors})`));else{if(X.assign(n._`${W}.errors`,o.default.vErrors),G.unevaluated)vj(Z);X.return(n._`${o.default.errors} === 0`)}}function vj({gen:Z,evaluated:X,props:Q,items:W}){if(Q instanceof n.Name)Z.assign(n._`${X}.props`,Q);if(W instanceof n.Name)Z.assign(n._`${X}.items`,W)}function LK(Z,X,Q,W){let{gen:J,schema:G,data:Y,allErrors:z,opts:q,self:K}=Z,{RULES:V}=K;if(G.$ref&&(q.ignoreKeywordsWithRef||!(0,G6.schemaHasRulesButRef)(G,V))){J.block(()=>EK(Z,"$ref",V.all.$ref.definition));return}if(!q.jtd)yj(Z,X);J.block(()=>{for(let H of V.rules)B(H);B(V.post)});function B(H){if(!(0,CX.shouldUseGroup)(G,H))return;if(H.type){if(J.if((0,H5.checkDataType)(H.type,Y,q.strictNumbers)),AK(Z,H),X.length===1&&X[0]===H.type&&Q)J.else(),(0,H5.reportTypeError)(Z);J.endIf()}else AK(Z,H);if(!z)J.if(n._`${o.default.errors} === ${W||0}`)}}function AK(Z,X){let{gen:Q,schema:W,opts:{useDefaults:J}}=Z;if(J)(0,Dj.assignDefaults)(Z,X.type);Q.block(()=>{for(let G of X.rules)if((0,CX.shouldUseRule)(W,G))EK(Z,G.keyword,G.definition,X.type)})}function yj(Z,X){if(Z.schemaEnv.meta||!Z.opts.strictTypes)return;if(gj(Z,X),!Z.opts.allowUnionTypes)fj(Z,X);hj(Z,Z.dataTypes)}function gj(Z,X){if(!X.length)return;if(!Z.dataTypes.length){Z.dataTypes=X;return}X.forEach((Q)=>{if(!OK(Z.dataTypes,Q))SX(Z,`type "${Q}" not allowed by context "${Z.dataTypes.join(",")}"`)}),mj(Z,X)}function fj(Z,X){if(X.length>1&&!(X.length===2&&X.includes("null")))SX(Z,"use allowUnionTypes to allow union type keyword")}function hj(Z,X){let Q=Z.self.RULES.all;for(let W in Q){let J=Q[W];if(typeof J=="object"&&(0,CX.shouldUseRule)(Z.schema,J)){let{type:G}=J.definition;if(G.length&&!G.some((Y)=>uj(X,Y)))SX(Z,`missing type "${G.join(",")}" for keyword "${W}"`)}}}function uj(Z,X){return Z.includes(X)||X==="number"&&Z.includes("integer")}function OK(Z,X){return Z.includes(X)||X==="integer"&&Z.includes("number")}function mj(Z,X){let Q=[];for(let W of Z.dataTypes)if(OK(X,W))Q.push(W);else if(X.includes("integer")&&W==="number")Q.push("integer");Z.dataTypes=Q}function SX(Z,X){let Q=Z.schemaEnv.baseId+Z.errSchemaPath;X+=` at "${Q}" (strictTypes)`,(0,G6.checkStrictMode)(Z,X,Z.opts.strictTypes)}class kX{constructor(Z,X,Q){if((0,E9.validateKeywordUsage)(Z,X,Q),this.gen=Z.gen,this.allErrors=Z.allErrors,this.keyword=Q,this.data=Z.data,this.schema=Z.schema[Q],this.$data=X.$data&&Z.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,G6.schemaRefOrVal)(Z,this.schema,Q,this.$data),this.schemaType=X.schemaType,this.parentSchema=Z.schema,this.params={},this.it=Z,this.def=X,this.$data)this.schemaCode=Z.gen.const("vSchema",RK(this.$data,Z));else if(this.schemaCode=this.schemaValue,!(0,E9.validSchemaType)(this.schema,X.schemaType,X.allowUndefined))throw Error(`${Q} value must be ${JSON.stringify(X.schemaType)}`);if("code"in X?X.trackErrors:X.errors!==!1)this.errsCount=Z.gen.const("_errs",o.default.errors)}result(Z,X,Q){this.failResult((0,n.not)(Z),X,Q)}failResult(Z,X,Q){if(this.gen.if(Z),Q)Q();else this.error();if(X){if(this.gen.else(),X(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(Z,X){this.failResult((0,n.not)(Z),void 0,X)}fail(Z){if(Z===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(Z),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(Z){if(!this.$data)return this.fail(Z);let{schemaCode:X}=this;this.fail(n._`${X} !== undefined && (${(0,n.or)(this.invalid$data(),Z)})`)}error(Z,X,Q){if(X){this.setParams(X),this._error(Z,Q),this.setParams({});return}this._error(Z,Q)}_error(Z,X){(Z?O9.reportExtraError:O9.reportError)(this,this.def.error,X)}$dataError(){(0,O9.reportError)(this,this.def.$dataError||O9.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,O9.resetErrorsCount)(this.gen,this.errsCount)}ok(Z){if(!this.allErrors)this.gen.if(Z)}setParams(Z,X){if(X)Object.assign(this.params,Z);else this.params=Z}block$data(Z,X,Q=n.nil){this.gen.block(()=>{this.check$data(Z,Q),X()})}check$data(Z=n.nil,X=n.nil){if(!this.$data)return;let{gen:Q,schemaCode:W,schemaType:J,def:G}=this;if(Q.if((0,n.or)(n._`${W} === undefined`,X)),Z!==n.nil)Q.assign(Z,!0);if(J.length||G.validateSchema){if(Q.elseIf(this.invalid$data()),this.$dataError(),Z!==n.nil)Q.assign(Z,!1)}Q.else()}invalid$data(){let{gen:Z,schemaCode:X,schemaType:Q,def:W,it:J}=this;return(0,n.or)(G(),Y());function G(){if(Q.length){if(!(X instanceof n.Name))throw Error("ajv implementation error");let z=Array.isArray(Q)?Q:[Q];return n._`${(0,H5.checkDataTypes)(z,X,J.opts.strictNumbers,H5.DataType.Wrong)}`}return n.nil}function Y(){if(W.validateSchema){let z=Z.scopeValue("validate$data",{ref:W.validateSchema});return n._`!${z}(${X})`}return n.nil}}subschema(Z,X){let Q=(0,PX.getSubschema)(this.it,Z);(0,PX.extendSubschemaData)(Q,this.it,Z),(0,PX.extendSubschemaMode)(Q,Z);let W={...this.it,...Q,items:void 0,props:void 0};return Pj(W,X),W}mergeEvaluated(Z,X){let{it:Q,gen:W}=this;if(!Q.opts.unevaluated)return;if(Q.props!==!0&&Z.props!==void 0)Q.props=G6.mergeEvaluated.props(W,Z.props,Q.props,X);if(Q.items!==!0&&Z.items!==void 0)Q.items=G6.mergeEvaluated.items(W,Z.items,Q.items,X)}mergeValidEvaluated(Z,X){let{it:Q,gen:W}=this;if(Q.opts.unevaluated&&(Q.props!==!0||Q.items!==!0))return W.if(X,()=>this.mergeEvaluated(Z,n.Name)),!0}}PK.KeywordCxt=kX;function EK(Z,X,Q,W){let J=new kX(Z,Q,X);if("code"in Q)Q.code(J,W);else if(J.$data&&Q.validate)(0,E9.funcKeywordCode)(J,Q);else if("macro"in Q)(0,E9.macroKeywordCode)(J,Q);else if(Q.compile||Q.validate)(0,E9.funcKeywordCode)(J,Q)}var lj=/^\/(?:[^~]|~0|~1)*$/,dj=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function RK(Z,{dataLevel:X,dataNames:Q,dataPathArr:W}){let J,G;if(Z==="")return o.default.rootData;if(Z[0]==="/"){if(!lj.test(Z))throw Error(`Invalid JSON-pointer: ${Z}`);J=Z,G=o.default.rootData}else{let K=dj.exec(Z);if(!K)throw Error(`Invalid JSON-pointer: ${Z}`);let V=+K[1];if(J=K[2],J==="#"){if(V>=X)throw Error(q("property/index",V));return W[X-V]}if(V>X)throw Error(q("data",V));if(G=Q[X-V],!J)return G}let Y=G,z=J.split("/");for(let K of z)if(K)G=n._`${G}${(0,n.getProperty)((0,G6.unescapeJsonPointer)(K))}`,Y=n._`${Y} && ${G}`;return Y;function q(K,V){return`Cannot access ${K} ${V} levels up, current level is ${X}`}}PK.getData=RK});var F5=j((kK)=>{Object.defineProperty(kK,"__esModule",{value:!0});class SK extends Error{constructor(Z){super("validation failed");this.errors=Z,this.ajv=this.validation=!0}}kK.default=SK});var P9=j((_K)=>{Object.defineProperty(_K,"__esModule",{value:!0});var bX=j9();class bK extends Error{constructor(Z,X,Q,W){super(W||`can't resolve reference ${Q} from id ${X}`);this.missingRef=(0,bX.resolveUrl)(Z,X,Q),this.missingSchema=(0,bX.normalizeId)((0,bX.getFullPath)(Z,this.missingRef))}}_K.default=bK});var S9=j((yK)=>{Object.defineProperty(yK,"__esModule",{value:!0});yK.resolveSchema=yK.getCompilingSchema=yK.resolveRef=yK.compileSchema=yK.SchemaEnv=void 0;var P4=Z0(),rj=F5(),a6=A4(),C4=j9(),xK=W0(),aj=R9();class C9{constructor(Z){var X;this.refs={},this.dynamicAnchors={};let Q;if(typeof Z.schema=="object")Q=Z.schema;this.schema=Z.schema,this.schemaId=Z.schemaId,this.root=Z.root||this,this.baseId=(X=Z.baseId)!==null&&X!==void 0?X:(0,C4.normalizeId)(Q===null||Q===void 0?void 0:Q[Z.schemaId||"$id"]),this.schemaPath=Z.schemaPath,this.localRefs=Z.localRefs,this.meta=Z.meta,this.$async=Q===null||Q===void 0?void 0:Q.$async,this.refs={}}}yK.SchemaEnv=C9;function xX(Z){let X=vK.call(this,Z);if(X)return X;let Q=(0,C4.getFullPath)(this.opts.uriResolver,Z.root.baseId),{es5:W,lines:J}=this.opts.code,{ownProperties:G}=this.opts,Y=new P4.CodeGen(this.scope,{es5:W,lines:J,ownProperties:G}),z;if(Z.$async)z=Y.scopeValue("Error",{ref:rj.default,code:P4._`require("ajv/dist/runtime/validation_error").default`});let q=Y.scopeName("validate");Z.validateName=q;let K={gen:Y,allErrors:this.opts.allErrors,data:a6.default.data,parentData:a6.default.parentData,parentDataProperty:a6.default.parentDataProperty,dataNames:[a6.default.data],dataPathArr:[P4.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:Y.scopeValue("schema",this.opts.code.source===!0?{ref:Z.schema,code:(0,P4.stringify)(Z.schema)}:{ref:Z.schema}),validateName:q,ValidationError:z,schema:Z.schema,schemaEnv:Z,rootId:Q,baseId:Z.baseId||Q,schemaPath:P4.nil,errSchemaPath:Z.schemaPath||(this.opts.jtd?"":"#"),errorPath:P4._`""`,opts:this.opts,self:this},V;try{this._compilations.add(Z),(0,aj.validateFunctionCode)(K),Y.optimize(this.opts.code.optimize);let B=Y.toString();if(V=`${Y.scopeRefs(a6.default.scope)}return ${B}`,this.opts.code.process)V=this.opts.code.process(V,Z);let F=Function(`${a6.default.self}`,`${a6.default.scope}`,V)(this,this.scope.get());if(this.scope.value(q,{ref:F}),F.errors=null,F.schema=Z.schema,F.schemaEnv=Z,Z.$async)F.$async=!0;if(this.opts.code.source===!0)F.source={validateName:q,validateCode:B,scopeValues:Y._values};if(this.opts.unevaluated){let{props:A,items:M}=K;if(F.evaluated={props:A instanceof P4.Name?void 0:A,items:M instanceof P4.Name?void 0:M,dynamicProps:A instanceof P4.Name,dynamicItems:M instanceof P4.Name},F.source)F.source.evaluated=(0,P4.stringify)(F.evaluated)}return Z.validate=F,Z}catch(B){if(delete Z.validate,delete Z.validateName,V)this.logger.error("Error compiling schema, function code:",V);throw B}finally{this._compilations.delete(Z)}}yK.compileSchema=xX;function sj(Z,X,Q){var W;Q=(0,C4.resolveUrl)(this.opts.uriResolver,X,Q);let J=Z.refs[Q];if(J)return J;let G=ej.call(this,Z,Q);if(G===void 0){let Y=(W=Z.localRefs)===null||W===void 0?void 0:W[Q],{schemaId:z}=this.opts;if(Y)G=new C9({schema:Y,schemaId:z,root:Z,baseId:X})}if(G===void 0)return;return Z.refs[Q]=oj.call(this,G)}yK.resolveRef=sj;function oj(Z){if((0,C4.inlineRef)(Z.schema,this.opts.inlineRefs))return Z.schema;return Z.validate?Z:xX.call(this,Z)}function vK(Z){for(let X of this._compilations)if(tj(X,Z))return X}yK.getCompilingSchema=vK;function tj(Z,X){return Z.schema===X.schema&&Z.root===X.root&&Z.baseId===X.baseId}function ej(Z,X){let Q;while(typeof(Q=this.refs[X])=="string")X=Q;return Q||this.schemas[X]||L5.call(this,Z,X)}function L5(Z,X){let Q=this.opts.uriResolver.parse(X),W=(0,C4._getFullPath)(this.opts.uriResolver,Q),J=(0,C4.getFullPath)(this.opts.uriResolver,Z.baseId,void 0);if(Object.keys(Z.schema).length>0&&W===J)return _X.call(this,Q,Z);let G=(0,C4.normalizeId)(W),Y=this.refs[G]||this.schemas[G];if(typeof Y=="string"){let z=L5.call(this,Z,Y);if(typeof(z===null||z===void 0?void 0:z.schema)!=="object")return;return _X.call(this,Q,z)}if(typeof(Y===null||Y===void 0?void 0:Y.schema)!=="object")return;if(!Y.validate)xX.call(this,Y);if(G===(0,C4.normalizeId)(X)){let{schema:z}=Y,{schemaId:q}=this.opts,K=z[q];if(K)J=(0,C4.resolveUrl)(this.opts.uriResolver,J,K);return new C9({schema:z,schemaId:q,root:Z,baseId:J})}return _X.call(this,Q,Y)}yK.resolveSchema=L5;var ZO=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function _X(Z,{baseId:X,schema:Q,root:W}){var J;if(((J=Z.fragment)===null||J===void 0?void 0:J[0])!=="/")return;for(let z of Z.fragment.slice(1).split("/")){if(typeof Q==="boolean")return;let q=Q[(0,xK.unescapeFragment)(z)];if(q===void 0)return;Q=q;let K=typeof Q==="object"&&Q[this.opts.schemaId];if(!ZO.has(z)&&K)X=(0,C4.resolveUrl)(this.opts.uriResolver,X,K)}let G;if(typeof Q!="boolean"&&Q.$ref&&!(0,xK.schemaHasRulesButRef)(Q,this.RULES)){let z=(0,C4.resolveUrl)(this.opts.uriResolver,X,Q.$ref);G=L5.call(this,W,z)}let{schemaId:Y}=this.opts;if(G=G||new C9({schema:Q,schemaId:Y,root:W,baseId:X}),G.schema!==G.root.schema)return G;return}});var fK=j((Dg,GO)=>{GO.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var gX=j((Tg,cK)=>{var YO=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),uK=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),vX=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),mK=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),zO=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function yX(Z){let X="",Q=0,W=0;for(W=0;W<Z.length;W++){if(Q=Z[W].charCodeAt(0),Q===48)continue;if(!(Q>=48&&Q<=57||Q>=65&&Q<=70||Q>=97&&Q<=102))return"";X+=Z[W];break}for(W+=1;W<Z.length;W++){if(Q=Z[W].charCodeAt(0),!(Q>=48&&Q<=57||Q>=65&&Q<=70||Q>=97&&Q<=102))return"";X+=Z[W]}return X}var $O=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function hK(Z){return Z.length=0,!0}function qO(Z,X,Q){if(Z.length){let W=yX(Z);if(W!=="")X.push(W);else return Q.error=!0,!1;Z.length=0}return!0}function KO(Z){let X=0,Q={error:!1,address:"",zone:""},W=[],J=[],G=!1,Y=!1,z=qO;for(let q=0;q<Z.length;q++){let K=Z[q];if(K==="["||K==="]")continue;if(K===":"){if(G===!0)Y=!0;if(!z(J,W,Q))break;if(++X>7){Q.error=!0;break}if(q>0&&Z[q-1]===":")G=!0;W.push(":");continue}else if(K==="%"){if(!z(J,W,Q))break;z=hK}else{J.push(K);continue}}if(J.length)if(z===hK)Q.zone=J.join("");else if(Y)W.push(J.join(""));else W.push(yX(J));return Q.address=W.join(""),Q}function lK(Z){if(UO(Z,":")<2)return{host:Z,isIPV6:!1};let X=KO(Z);if(!X.error){let{address:Q,address:W}=X;if(X.zone)Q+="%"+X.zone,W+="%25"+X.zone;return{host:Q,isIPV6:!0,escapedHost:W}}else return{host:Z,isIPV6:!1}}function UO(Z,X){let Q=0;for(let W=0;W<Z.length;W++)if(Z[W]===X)Q++;return Q}function VO(Z){let X=Z,Q=[],W=-1,J=0;while(J=X.length){if(J===1)if(X===".")break;else if(X==="/"){Q.push("/");break}else{Q.push(X);break}else if(J===2){if(X[0]==="."){if(X[1]===".")break;else if(X[1]==="/"){X=X.slice(2);continue}}else if(X[0]==="/"){if(X[1]==="."||X[1]==="/"){Q.push("/");break}}}else if(J===3){if(X==="/.."){if(Q.length!==0)Q.pop();Q.push("/");break}}if(X[0]==="."){if(X[1]==="."){if(X[2]==="/"){X=X.slice(3);continue}}else if(X[1]==="/"){X=X.slice(2);continue}}else if(X[0]==="/"){if(X[1]==="."){if(X[2]==="/"){X=X.slice(2);continue}else if(X[2]==="."){if(X[3]==="/"){if(X=X.slice(3),Q.length!==0)Q.pop();continue}}}}if((W=X.indexOf("/",1))===-1){Q.push(X);break}else Q.push(X.slice(0,W)),X=X.slice(W)}return Q.join("")}var BO={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},HO=/[@/?#:]/g,FO=/[@/?#]/g;function dK(Z,X){let Q=X?FO:HO;return Q.lastIndex=0,Z.replace(Q,(W)=>BO[W])}function LO(Z,X=!1){if(Z.indexOf("%")===-1)return Z;let Q="";for(let W=0;W<Z.length;W++){if(Z[W]==="%"&&W+2<Z.length){let J=Z.slice(W+1,W+3);if(vX(J)){let G=J.toUpperCase(),Y=String.fromCharCode(parseInt(G,16));if(X&&mK(Y))Q+=Y;else Q+="%"+G;W+=2;continue}}Q+=Z[W]}return Q}function AO(Z){let X="";for(let Q=0;Q<Z.length;Q++){if(Z[Q]==="%"&&Q+2<Z.length){let W=Z.slice(Q+1,Q+3);if(vX(W)){let J=W.toUpperCase(),G=String.fromCharCode(parseInt(J,16));if(G!=="."&&mK(G))X+=G;else X+="%"+J;Q+=2;continue}}if(zO(Z[Q]))X+=Z[Q];else X+=escape(Z[Q])}return X}function MO(Z){let X="";for(let Q=0;Q<Z.length;Q++){if(Z[Q]==="%"&&Q+2<Z.length){let W=Z.slice(Q+1,Q+3);if(vX(W)){X+="%"+W.toUpperCase(),Q+=2;continue}}X+=escape(Z[Q])}return X}function IO(Z){let X=[];if(Z.userinfo!==void 0)X.push(Z.userinfo),X.push("@");if(Z.host!==void 0){let Q=unescape(Z.host);if(!uK(Q)){let W=lK(Q);if(W.isIPV6===!0)Q=`[${W.escapedHost}]`;else Q=dK(Q,!1)}X.push(Q)}if(typeof Z.port==="number"||typeof Z.port==="string")X.push(":"),X.push(String(Z.port));return X.length?X.join(""):void 0}cK.exports={nonSimpleDomain:$O,recomposeAuthority:IO,reescapeHostDelimiters:dK,normalizePercentEncoding:LO,normalizePathEncoding:AO,escapePreservingEscapes:MO,removeDotSegments:VO,isIPv4:uK,isUUID:YO,normalizeIPv6:lK,stringArrayToHexStripped:yX}});var aK=j((wg,rK)=>{var{isUUID:NO}=gX(),DO=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,TO=["http","https","ws","wss","urn","urn:uuid"];function wO(Z){return TO.indexOf(Z)!==-1}function fX(Z){if(Z.secure===!0)return!0;else if(Z.secure===!1)return!1;else if(Z.scheme)return Z.scheme.length===3&&(Z.scheme[0]==="w"||Z.scheme[0]==="W")&&(Z.scheme[1]==="s"||Z.scheme[1]==="S")&&(Z.scheme[2]==="s"||Z.scheme[2]==="S");else return!1}function pK(Z){if(!Z.host)Z.error=Z.error||"HTTP URIs must have a host.";return Z}function nK(Z){let X=String(Z.scheme).toLowerCase()==="https";if(Z.port===(X?443:80)||Z.port==="")Z.port=void 0;if(!Z.path)Z.path="/";return Z}function jO(Z){return Z.secure=fX(Z),Z.resourceName=(Z.path||"/")+(Z.query?"?"+Z.query:""),Z.path=void 0,Z.query=void 0,Z}function OO(Z){if(Z.port===(fX(Z)?443:80)||Z.port==="")Z.port=void 0;if(typeof Z.secure==="boolean")Z.scheme=Z.secure?"wss":"ws",Z.secure=void 0;if(Z.resourceName){let[X,Q]=Z.resourceName.split("?");Z.path=X&&X!=="/"?X:void 0,Z.query=Q,Z.resourceName=void 0}return Z.fragment=void 0,Z}function EO(Z,X){if(!Z.path)return Z.error="URN can not be parsed",Z;let Q=Z.path.match(DO);if(Q){let W=X.scheme||Z.scheme||"urn";Z.nid=Q[1].toLowerCase(),Z.nss=Q[2];let J=`${W}:${X.nid||Z.nid}`,G=hX(J);if(Z.path=void 0,G)Z=G.parse(Z,X)}else Z.error=Z.error||"URN can not be parsed.";return Z}function RO(Z,X){if(Z.nid===void 0)throw Error("URN without nid cannot be serialized");let Q=X.scheme||Z.scheme||"urn",W=Z.nid.toLowerCase(),J=`${Q}:${X.nid||W}`,G=hX(J);if(G)Z=G.serialize(Z,X);let Y=Z,z=Z.nss;return Y.path=`${W||X.nid}:${z}`,X.skipEscape=!0,Y}function PO(Z,X){let Q=Z;if(Q.uuid=Q.nss,Q.nss=void 0,!X.tolerant&&(!Q.uuid||!NO(Q.uuid)))Q.error=Q.error||"UUID is not valid.";return Q}function CO(Z){let X=Z;return X.nss=(Z.uuid||"").toLowerCase(),X}var iK={scheme:"http",domainHost:!0,parse:pK,serialize:nK},SO={scheme:"https",domainHost:iK.domainHost,parse:pK,serialize:nK},A5={scheme:"ws",domainHost:!0,parse:jO,serialize:OO},kO={scheme:"wss",domainHost:A5.domainHost,parse:A5.parse,serialize:A5.serialize},bO={scheme:"urn",parse:EO,serialize:RO,skipNormalize:!0},_O={scheme:"urn:uuid",parse:PO,serialize:CO,skipNormalize:!0},M5={http:iK,https:SO,ws:A5,wss:kO,urn:bO,"urn:uuid":_O};Object.setPrototypeOf(M5,null);function hX(Z){return Z&&(M5[Z]||M5[Z.toLowerCase()])||void 0}rK.exports={wsIsSecure:fX,SCHEMES:M5,isValidSchemeName:wO,getSchemeHandler:hX}});var X3=j((jg,I5)=>{var{normalizeIPv6:xO,removeDotSegments:k9,recomposeAuthority:vO,normalizePercentEncoding:yO,normalizePathEncoding:gO,escapePreservingEscapes:fO,reescapeHostDelimiters:hO,isIPv4:uO,nonSimpleDomain:mO}=gX(),{SCHEMES:lO,getSchemeHandler:oK}=aK();function dO(Z,X){if(typeof Z==="string")Z=rO(Z,X);else if(typeof Z==="object")Z=f1(s6(Z,X),X);return Z}function cO(Z,X,Q){let W=Q?Object.assign({scheme:"null"},Q):{scheme:"null"},J=tK(f1(Z,W),f1(X,W),W,!0);return W.skipEscape=!0,s6(J,W)}function tK(Z,X,Q,W){let J={};if(!W)Z=f1(s6(Z,Q),Q),X=f1(s6(X,Q),Q);if(Q=Q||{},!Q.tolerant&&X.scheme)J.scheme=X.scheme,J.userinfo=X.userinfo,J.host=X.host,J.port=X.port,J.path=k9(X.path||""),J.query=X.query;else{if(X.userinfo!==void 0||X.host!==void 0||X.port!==void 0)J.userinfo=X.userinfo,J.host=X.host,J.port=X.port,J.path=k9(X.path||""),J.query=X.query;else{if(!X.path)if(J.path=Z.path,X.query!==void 0)J.query=X.query;else J.query=Z.query;else{if(X.path[0]==="/")J.path=k9(X.path);else{if((Z.userinfo!==void 0||Z.host!==void 0||Z.port!==void 0)&&!Z.path)J.path="/"+X.path;else if(!Z.path)J.path=X.path;else J.path=Z.path.slice(0,Z.path.lastIndexOf("/")+1)+X.path;J.path=k9(J.path)}J.query=X.query}J.userinfo=Z.userinfo,J.host=Z.host,J.port=Z.port}J.scheme=Z.scheme}return J.fragment=X.fragment,J}function pO(Z,X,Q){let W=sK(Z,Q),J=sK(X,Q);return W!==void 0&&J!==void 0&&W.toLowerCase()===J.toLowerCase()}function s6(Z,X){let Q={host:Z.host,scheme:Z.scheme,userinfo:Z.userinfo,port:Z.port,path:Z.path,query:Z.query,nid:Z.nid,nss:Z.nss,uuid:Z.uuid,fragment:Z.fragment,reference:Z.reference,resourceName:Z.resourceName,secure:Z.secure,error:""},W=Object.assign({},X),J=[],G=oK(W.scheme||Q.scheme);if(G&&G.serialize)G.serialize(Q,W);if(Q.path!==void 0)if(!W.skipEscape){if(Q.path=fO(Q.path),Q.scheme!==void 0)Q.path=Q.path.split("%3A").join(":")}else Q.path=yO(Q.path);if(W.reference!=="suffix"&&Q.scheme)J.push(Q.scheme,":");let Y=vO(Q);if(Y!==void 0){if(W.reference!=="suffix")J.push("//");if(J.push(Y),Q.path&&Q.path[0]!=="/")J.push("/")}if(Q.path!==void 0){let z=Q.path;if(!W.absolutePath&&(!G||!G.absolutePath))z=k9(z);if(Y===void 0&&z[0]==="/"&&z[1]==="/")z="/%2F"+z.slice(2);J.push(z)}if(Q.query!==void 0)J.push("?",Q.query);if(Q.fragment!==void 0)J.push("#",Q.fragment);return J.join("")}var nO=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function iO(Z,X){if(X[2]!==void 0&&Z.path&&Z.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof Z.port==="number"&&(Z.port<0||Z.port>65535))return"URI port is malformed.";return}function eK(Z,X){let Q=Object.assign({},X),W={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},J=!1,G=!1;if(Q.reference==="suffix")if(Q.scheme)Z=Q.scheme+":"+Z;else Z="//"+Z;let Y=Z.match(nO);if(Y){if(W.scheme=Y[1],W.userinfo=Y[3],W.host=Y[4],W.port=parseInt(Y[5],10),W.path=Y[6]||"",W.query=Y[7],W.fragment=Y[8],isNaN(W.port))W.port=Y[5];let z=iO(W,Y);if(z!==void 0)W.error=W.error||z,J=!0;if(W.host)if(uO(W.host)===!1){let V=xO(W.host);W.host=V.host.toLowerCase(),G=V.isIPV6}else G=!0;if(W.scheme===void 0&&W.userinfo===void 0&&W.host===void 0&&W.port===void 0&&W.query===void 0&&!W.path)W.reference="same-document";else if(W.scheme===void 0)W.reference="relative";else if(W.fragment===void 0)W.reference="absolute";else W.reference="uri";if(Q.reference&&Q.reference!=="suffix"&&Q.reference!==W.reference)W.error=W.error||"URI is not a "+Q.reference+" reference.";let q=oK(Q.scheme||W.scheme);if(!Q.unicodeSupport&&(!q||!q.unicodeSupport)){if(W.host&&(Q.domainHost||q&&q.domainHost)&&G===!1&&mO(W.host))try{W.host=URL.domainToASCII(W.host.toLowerCase())}catch(K){W.error=W.error||"Host's domain name can not be converted to ASCII: "+K}}if(!q||q&&!q.skipNormalize){if(Z.indexOf("%")!==-1){if(W.scheme!==void 0)W.scheme=unescape(W.scheme);if(W.host!==void 0)W.host=hO(unescape(W.host),G)}if(W.path)W.path=gO(W.path);if(W.fragment)try{W.fragment=encodeURI(decodeURIComponent(W.fragment))}catch{W.error=W.error||"URI malformed"}}if(q&&q.parse)q.parse(W,Q)}else W.error=W.error||"URI can not be parsed.";return{parsed:W,malformedAuthorityOrPort:J}}function f1(Z,X){return eK(Z,X).parsed}function rO(Z,X){return Z3(Z,X).normalized}function Z3(Z,X){let{parsed:Q,malformedAuthorityOrPort:W}=eK(Z,X);return{normalized:W?Z:s6(Q,X),malformedAuthorityOrPort:W}}function sK(Z,X){if(typeof Z==="string"){let{normalized:Q,malformedAuthorityOrPort:W}=Z3(Z,X);return W?void 0:Q}if(typeof Z==="object")return s6(Z,X)}var uX={SCHEMES:lO,normalize:dO,resolve:cO,resolveComponent:tK,equal:pO,serialize:s6,parse:f1};I5.exports=uX;I5.exports.default=uX;I5.exports.fastUri=uX});var J3=j((W3)=>{Object.defineProperty(W3,"__esModule",{value:!0});var Q3=X3();Q3.code='require("ajv/dist/runtime/uri").default';W3.default=Q3});var V3=j((Y6)=>{Object.defineProperty(Y6,"__esModule",{value:!0});Y6.CodeGen=Y6.Name=Y6.nil=Y6.stringify=Y6.str=Y6._=Y6.KeywordCxt=void 0;var sO=R9();Object.defineProperty(Y6,"KeywordCxt",{enumerable:!0,get:function(){return sO.KeywordCxt}});var h1=Z0();Object.defineProperty(Y6,"_",{enumerable:!0,get:function(){return h1._}});Object.defineProperty(Y6,"str",{enumerable:!0,get:function(){return h1.str}});Object.defineProperty(Y6,"stringify",{enumerable:!0,get:function(){return h1.stringify}});Object.defineProperty(Y6,"nil",{enumerable:!0,get:function(){return h1.nil}});Object.defineProperty(Y6,"Name",{enumerable:!0,get:function(){return h1.Name}});Object.defineProperty(Y6,"CodeGen",{enumerable:!0,get:function(){return h1.CodeGen}});var oO=F5(),q3=P9(),tO=MX(),b9=S9(),eO=Z0(),_9=j9(),N5=w9(),lX=W0(),G3=fK(),ZE=J3(),K3=(Z,X)=>new RegExp(Z,X);K3.code="new RegExp";var XE=["removeAdditional","useDefaults","coerceTypes"],QE=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),WE={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},JE={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Y3=200;function GE(Z){var X,Q,W,J,G,Y,z,q,K,V,B,H,F,A,M,I,N,T,S,v,x,p,f,s,K0;let E0=Z.strict,f0=(X=Z.code)===null||X===void 0?void 0:X.optimize,N4=f0===!0||f0===void 0?1:f0||0,$4=(W=(Q=Z.code)===null||Q===void 0?void 0:Q.regExp)!==null&&W!==void 0?W:K3,r=(J=Z.uriResolver)!==null&&J!==void 0?J:ZE.default;return{strictSchema:(Y=(G=Z.strictSchema)!==null&&G!==void 0?G:E0)!==null&&Y!==void 0?Y:!0,strictNumbers:(q=(z=Z.strictNumbers)!==null&&z!==void 0?z:E0)!==null&&q!==void 0?q:!0,strictTypes:(V=(K=Z.strictTypes)!==null&&K!==void 0?K:E0)!==null&&V!==void 0?V:"log",strictTuples:(H=(B=Z.strictTuples)!==null&&B!==void 0?B:E0)!==null&&H!==void 0?H:"log",strictRequired:(A=(F=Z.strictRequired)!==null&&F!==void 0?F:E0)!==null&&A!==void 0?A:!1,code:Z.code?{...Z.code,optimize:N4,regExp:$4}:{optimize:N4,regExp:$4},loopRequired:(M=Z.loopRequired)!==null&&M!==void 0?M:Y3,loopEnum:(I=Z.loopEnum)!==null&&I!==void 0?I:Y3,meta:(N=Z.meta)!==null&&N!==void 0?N:!0,messages:(T=Z.messages)!==null&&T!==void 0?T:!0,inlineRefs:(S=Z.inlineRefs)!==null&&S!==void 0?S:!0,schemaId:(v=Z.schemaId)!==null&&v!==void 0?v:"$id",addUsedSchema:(x=Z.addUsedSchema)!==null&&x!==void 0?x:!0,validateSchema:(p=Z.validateSchema)!==null&&p!==void 0?p:!0,validateFormats:(f=Z.validateFormats)!==null&&f!==void 0?f:!0,unicodeRegExp:(s=Z.unicodeRegExp)!==null&&s!==void 0?s:!0,int32range:(K0=Z.int32range)!==null&&K0!==void 0?K0:!0,uriResolver:r}}class D5{constructor(Z={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,Z=this.opts={...Z,...GE(Z)};let{es5:X,lines:Q}=this.opts.code;this.scope=new eO.ValueScope({scope:{},prefixes:QE,es5:X,lines:Q}),this.logger=UE(Z.logger);let W=Z.validateFormats;if(Z.validateFormats=!1,this.RULES=(0,tO.getRules)(),z3.call(this,WE,Z,"NOT SUPPORTED"),z3.call(this,JE,Z,"DEPRECATED","warn"),this._metaOpts=qE.call(this),Z.formats)zE.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),Z.keywords)$E.call(this,Z.keywords);if(typeof Z.meta=="object")this.addMetaSchema(Z.meta);YE.call(this),Z.validateFormats=W}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:Z,meta:X,schemaId:Q}=this.opts,W=G3;if(Q==="id")W={...G3},W.id=W.$id,delete W.$id;if(X&&Z)this.addMetaSchema(W,W[Q],!1)}defaultMeta(){let{meta:Z,schemaId:X}=this.opts;return this.opts.defaultMeta=typeof Z=="object"?Z[X]||Z:void 0}validate(Z,X){let Q;if(typeof Z=="string"){if(Q=this.getSchema(Z),!Q)throw Error(`no schema with key or ref "${Z}"`)}else Q=this.compile(Z);let W=Q(X);if(!("$async"in Q))this.errors=Q.errors;return W}compile(Z,X){let Q=this._addSchema(Z,X);return Q.validate||this._compileSchemaEnv(Q)}compileAsync(Z,X){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:Q}=this.opts;return W.call(this,Z,X);async function W(K,V){await J.call(this,K.$schema);let B=this._addSchema(K,V);return B.validate||G.call(this,B)}async function J(K){if(K&&!this.getSchema(K))await W.call(this,{$ref:K},!0)}async function G(K){try{return this._compileSchemaEnv(K)}catch(V){if(!(V instanceof q3.default))throw V;return Y.call(this,V),await z.call(this,V.missingSchema),G.call(this,K)}}function Y({missingSchema:K,missingRef:V}){if(this.refs[K])throw Error(`AnySchema ${K} is loaded but ${V} cannot be resolved`)}async function z(K){let V=await q.call(this,K);if(!this.refs[K])await J.call(this,V.$schema);if(!this.refs[K])this.addSchema(V,K,X)}async function q(K){let V=this._loading[K];if(V)return V;try{return await(this._loading[K]=Q(K))}finally{delete this._loading[K]}}}addSchema(Z,X,Q,W=this.opts.validateSchema){if(Array.isArray(Z)){for(let G of Z)this.addSchema(G,void 0,Q,W);return this}let J;if(typeof Z==="object"){let{schemaId:G}=this.opts;if(J=Z[G],J!==void 0&&typeof J!="string")throw Error(`schema ${G} must be string`)}return X=(0,_9.normalizeId)(X||J),this._checkUnique(X),this.schemas[X]=this._addSchema(Z,Q,X,W,!0),this}addMetaSchema(Z,X,Q=this.opts.validateSchema){return this.addSchema(Z,X,!0,Q),this}validateSchema(Z,X){if(typeof Z=="boolean")return!0;let Q;if(Q=Z.$schema,Q!==void 0&&typeof Q!="string")throw Error("$schema must be a string");if(Q=Q||this.opts.defaultMeta||this.defaultMeta(),!Q)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let W=this.validate(Q,Z);if(!W&&X){let J="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(J);else throw Error(J)}return W}getSchema(Z){let X;while(typeof(X=$3.call(this,Z))=="string")Z=X;if(X===void 0){let{schemaId:Q}=this.opts,W=new b9.SchemaEnv({schema:{},schemaId:Q});if(X=b9.resolveSchema.call(this,W,Z),!X)return;this.refs[Z]=X}return X.validate||this._compileSchemaEnv(X)}removeSchema(Z){if(Z instanceof RegExp)return this._removeAllSchemas(this.schemas,Z),this._removeAllSchemas(this.refs,Z),this;switch(typeof Z){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let X=$3.call(this,Z);if(typeof X=="object")this._cache.delete(X.schema);return delete this.schemas[Z],delete this.refs[Z],this}case"object":{let X=Z;this._cache.delete(X);let Q=Z[this.opts.schemaId];if(Q)Q=(0,_9.normalizeId)(Q),delete this.schemas[Q],delete this.refs[Q];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(Z){for(let X of Z)this.addKeyword(X);return this}addKeyword(Z,X){let Q;if(typeof Z=="string"){if(Q=Z,typeof X=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),X.keyword=Q}else if(typeof Z=="object"&&X===void 0){if(X=Z,Q=X.keyword,Array.isArray(Q)&&!Q.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(BE.call(this,Q,X),!X)return(0,lX.eachItem)(Q,(J)=>mX.call(this,J)),this;FE.call(this,X);let W={...X,type:(0,N5.getJSONTypes)(X.type),schemaType:(0,N5.getJSONTypes)(X.schemaType)};return(0,lX.eachItem)(Q,W.type.length===0?(J)=>mX.call(this,J,W):(J)=>W.type.forEach((G)=>mX.call(this,J,W,G))),this}getKeyword(Z){let X=this.RULES.all[Z];return typeof X=="object"?X.definition:!!X}removeKeyword(Z){let{RULES:X}=this;delete X.keywords[Z],delete X.all[Z];for(let Q of X.rules){let W=Q.rules.findIndex((J)=>J.keyword===Z);if(W>=0)Q.rules.splice(W,1)}return this}addFormat(Z,X){if(typeof X=="string")X=new RegExp(X);return this.formats[Z]=X,this}errorsText(Z=this.errors,{separator:X=", ",dataVar:Q="data"}={}){if(!Z||Z.length===0)return"No errors";return Z.map((W)=>`${Q}${W.instancePath} ${W.message}`).reduce((W,J)=>W+X+J)}$dataMetaSchema(Z,X){let Q=this.RULES.all;Z=JSON.parse(JSON.stringify(Z));for(let W of X){let J=W.split("/").slice(1),G=Z;for(let Y of J)G=G[Y];for(let Y in Q){let z=Q[Y];if(typeof z!="object")continue;let{$data:q}=z.definition,K=G[Y];if(q&&K)G[Y]=U3(K)}}return Z}_removeAllSchemas(Z,X){for(let Q in Z){let W=Z[Q];if(!X||X.test(Q)){if(typeof W=="string")delete Z[Q];else if(W&&!W.meta)this._cache.delete(W.schema),delete Z[Q]}}}_addSchema(Z,X,Q,W=this.opts.validateSchema,J=this.opts.addUsedSchema){let G,{schemaId:Y}=this.opts;if(typeof Z=="object")G=Z[Y];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof Z!="boolean")throw Error("schema must be object or boolean");let z=this._cache.get(Z);if(z!==void 0)return z;Q=(0,_9.normalizeId)(G||Q);let q=_9.getSchemaRefs.call(this,Z,Q);if(z=new b9.SchemaEnv({schema:Z,schemaId:Y,meta:X,baseId:Q,localRefs:q}),this._cache.set(z.schema,z),J&&!Q.startsWith("#")){if(Q)this._checkUnique(Q);this.refs[Q]=z}if(W)this.validateSchema(Z,!0);return z}_checkUnique(Z){if(this.schemas[Z]||this.refs[Z])throw Error(`schema with key or id "${Z}" already exists`)}_compileSchemaEnv(Z){if(Z.meta)this._compileMetaSchema(Z);else b9.compileSchema.call(this,Z);if(!Z.validate)throw Error("ajv implementation error");return Z.validate}_compileMetaSchema(Z){let X=this.opts;this.opts=this._metaOpts;try{b9.compileSchema.call(this,Z)}finally{this.opts=X}}}D5.ValidationError=oO.default;D5.MissingRefError=q3.default;Y6.default=D5;function z3(Z,X,Q,W="error"){for(let J in Z){let G=J;if(G in X)this.logger[W](`${Q}: option ${J}. ${Z[G]}`)}}function $3(Z){return Z=(0,_9.normalizeId)(Z),this.schemas[Z]||this.refs[Z]}function YE(){let Z=this.opts.schemas;if(!Z)return;if(Array.isArray(Z))this.addSchema(Z);else for(let X in Z)this.addSchema(Z[X],X)}function zE(){for(let Z in this.opts.formats){let X=this.opts.formats[Z];if(X)this.addFormat(Z,X)}}function $E(Z){if(Array.isArray(Z)){this.addVocabulary(Z);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let X in Z){let Q=Z[X];if(!Q.keyword)Q.keyword=X;this.addKeyword(Q)}}function qE(){let Z={...this.opts};for(let X of XE)delete Z[X];return Z}var KE={log(){},warn(){},error(){}};function UE(Z){if(Z===!1)return KE;if(Z===void 0)return console;if(Z.log&&Z.warn&&Z.error)return Z;throw Error("logger must implement log, warn and error methods")}var VE=/^[a-z_$][a-z0-9_$:-]*$/i;function BE(Z,X){let{RULES:Q}=this;if((0,lX.eachItem)(Z,(W)=>{if(Q.keywords[W])throw Error(`Keyword ${W} is already defined`);if(!VE.test(W))throw Error(`Keyword ${W} has invalid name`)}),!X)return;if(X.$data&&!(("code"in X)||("validate"in X)))throw Error('$data keyword must have "code" or "validate" function')}function mX(Z,X,Q){var W;let J=X===null||X===void 0?void 0:X.post;if(Q&&J)throw Error('keyword with "post" flag cannot have "type"');let{RULES:G}=this,Y=J?G.post:G.rules.find(({type:q})=>q===Q);if(!Y)Y={type:Q,rules:[]},G.rules.push(Y);if(G.keywords[Z]=!0,!X)return;let z={keyword:Z,definition:{...X,type:(0,N5.getJSONTypes)(X.type),schemaType:(0,N5.getJSONTypes)(X.schemaType)}};if(X.before)HE.call(this,Y,z,X.before);else Y.rules.push(z);G.all[Z]=z,(W=X.implements)===null||W===void 0||W.forEach((q)=>this.addKeyword(q))}function HE(Z,X,Q){let W=Z.rules.findIndex((J)=>J.keyword===Q);if(W>=0)Z.rules.splice(W,0,X);else Z.rules.push(X),this.logger.warn(`rule ${Q} is not defined`)}function FE(Z){let{metaSchema:X}=Z;if(X===void 0)return;if(Z.$data&&this.opts.$data)X=U3(X);Z.validateSchema=this.compile(X,!0)}var LE={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function U3(Z){return{anyOf:[Z,LE]}}});var H3=j((B3)=>{Object.defineProperty(B3,"__esModule",{value:!0});var IE={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};B3.default=IE});var j5=j((M3)=>{Object.defineProperty(M3,"__esModule",{value:!0});M3.callRef=M3.getValidate=void 0;var DE=P9(),F3=M4(),Z4=Z0(),u1=A4(),L3=S9(),T5=W0(),TE={keyword:"$ref",schemaType:"string",code(Z){let{gen:X,schema:Q,it:W}=Z,{baseId:J,schemaEnv:G,validateName:Y,opts:z,self:q}=W,{root:K}=G;if((Q==="#"||Q==="#/")&&J===K.baseId)return B();let V=L3.resolveRef.call(q,K,J,Q);if(V===void 0)throw new DE.default(W.opts.uriResolver,J,Q);if(V instanceof L3.SchemaEnv)return H(V);return F(V);function B(){if(G===K)return w5(Z,Y,G,G.$async);let A=X.scopeValue("root",{ref:K});return w5(Z,Z4._`${A}.validate`,K,K.$async)}function H(A){let M=A3(Z,A);w5(Z,M,A,A.$async)}function F(A){let M=X.scopeValue("schema",z.code.source===!0?{ref:A,code:(0,Z4.stringify)(A)}:{ref:A}),I=X.name("valid"),N=Z.subschema({schema:A,dataTypes:[],schemaPath:Z4.nil,topSchemaRef:M,errSchemaPath:Q},I);Z.mergeEvaluated(N),Z.ok(I)}}};function A3(Z,X){let{gen:Q}=Z;return X.validate?Q.scopeValue("validate",{ref:X.validate}):Z4._`${Q.scopeValue("wrapper",{ref:X})}.validate`}M3.getValidate=A3;function w5(Z,X,Q,W){let{gen:J,it:G}=Z,{allErrors:Y,schemaEnv:z,opts:q}=G,K=q.passContext?u1.default.this:Z4.nil;if(W)V();else B();function V(){if(!z.$async)throw Error("async schema referenced by sync schema");let A=J.let("valid");J.try(()=>{if(J.code(Z4._`await ${(0,F3.callValidateCode)(Z,X,K)}`),F(X),!Y)J.assign(A,!0)},(M)=>{if(J.if(Z4._`!(${M} instanceof ${G.ValidationError})`,()=>J.throw(M)),H(M),!Y)J.assign(A,!1)}),Z.ok(A)}function B(){Z.result((0,F3.callValidateCode)(Z,X,K),()=>F(X),()=>H(X))}function H(A){let M=Z4._`${A}.errors`;J.assign(u1.default.vErrors,Z4._`${u1.default.vErrors} === null ? ${M} : ${u1.default.vErrors}.concat(${M})`),J.assign(u1.default.errors,Z4._`${u1.default.vErrors}.length`)}function F(A){var M;if(!G.opts.unevaluated)return;let I=(M=Q===null||Q===void 0?void 0:Q.validate)===null||M===void 0?void 0:M.evaluated;if(G.props!==!0)if(I&&!I.dynamicProps){if(I.props!==void 0)G.props=T5.mergeEvaluated.props(J,I.props,G.props)}else{let N=J.var("props",Z4._`${A}.evaluated.props`);G.props=T5.mergeEvaluated.props(J,N,G.props,Z4.Name)}if(G.items!==!0)if(I&&!I.dynamicItems){if(I.items!==void 0)G.items=T5.mergeEvaluated.items(J,I.items,G.items)}else{let N=J.var("items",Z4._`${A}.evaluated.items`);G.items=T5.mergeEvaluated.items(J,N,G.items,Z4.Name)}}}M3.callRef=w5;M3.default=TE});var D3=j((N3)=>{Object.defineProperty(N3,"__esModule",{value:!0});var OE=H3(),EE=j5(),RE=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",OE.default,EE.default];N3.default=RE});var w3=j((T3)=>{Object.defineProperty(T3,"__esModule",{value:!0});var O5=Z0(),b6=O5.operators,E5={maximum:{okStr:"<=",ok:b6.LTE,fail:b6.GT},minimum:{okStr:">=",ok:b6.GTE,fail:b6.LT},exclusiveMaximum:{okStr:"<",ok:b6.LT,fail:b6.GTE},exclusiveMinimum:{okStr:">",ok:b6.GT,fail:b6.LTE}},CE={message:({keyword:Z,schemaCode:X})=>O5.str`must be ${E5[Z].okStr} ${X}`,params:({keyword:Z,schemaCode:X})=>O5._`{comparison: ${E5[Z].okStr}, limit: ${X}}`},SE={keyword:Object.keys(E5),type:"number",schemaType:"number",$data:!0,error:CE,code(Z){let{keyword:X,data:Q,schemaCode:W}=Z;Z.fail$data(O5._`${Q} ${E5[X].fail} ${W} || isNaN(${Q})`)}};T3.default=SE});var O3=j((j3)=>{Object.defineProperty(j3,"__esModule",{value:!0});var x9=Z0(),bE={message:({schemaCode:Z})=>x9.str`must be multiple of ${Z}`,params:({schemaCode:Z})=>x9._`{multipleOf: ${Z}}`},_E={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:bE,code(Z){let{gen:X,data:Q,schemaCode:W,it:J}=Z,G=J.opts.multipleOfPrecision,Y=X.let("res"),z=G?x9._`Math.abs(Math.round(${Y}) - ${Y}) > 1e-${G}`:x9._`${Y} !== parseInt(${Y})`;Z.fail$data(x9._`(${W} === 0 || (${Y} = ${Q}/${W}, ${z}))`)}};j3.default=_E});var P3=j((R3)=>{Object.defineProperty(R3,"__esModule",{value:!0});function E3(Z){let X=Z.length,Q=0,W=0,J;while(W<X)if(Q++,J=Z.charCodeAt(W++),J>=55296&&J<=56319&&W<X){if(J=Z.charCodeAt(W),(J&64512)===56320)W++}return Q}R3.default=E3;E3.code='require("ajv/dist/runtime/ucs2length").default'});var S3=j((C3)=>{Object.defineProperty(C3,"__esModule",{value:!0});var o6=Z0(),yE=W0(),gE=P3(),fE={message({keyword:Z,schemaCode:X}){let Q=Z==="maxLength"?"more":"fewer";return o6.str`must NOT have ${Q} than ${X} characters`},params:({schemaCode:Z})=>o6._`{limit: ${Z}}`},hE={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:fE,code(Z){let{keyword:X,data:Q,schemaCode:W,it:J}=Z,G=X==="maxLength"?o6.operators.GT:o6.operators.LT,Y=J.opts.unicode===!1?o6._`${Q}.length`:o6._`${(0,yE.useFunc)(Z.gen,gE.default)}(${Q})`;Z.fail$data(o6._`${Y} ${G} ${W}`)}};C3.default=hE});var b3=j((k3)=>{Object.defineProperty(k3,"__esModule",{value:!0});var mE=M4(),lE=W0(),m1=Z0(),dE={message:({schemaCode:Z})=>m1.str`must match pattern "${Z}"`,params:({schemaCode:Z})=>m1._`{pattern: ${Z}}`},cE={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:dE,code(Z){let{gen:X,data:Q,$data:W,schema:J,schemaCode:G,it:Y}=Z,z=Y.opts.unicodeRegExp?"u":"";if(W){let{regExp:q}=Y.opts.code,K=q.code==="new RegExp"?m1._`new RegExp`:(0,lE.useFunc)(X,q),V=X.let("valid");X.try(()=>X.assign(V,m1._`${K}(${G}, ${z}).test(${Q})`),()=>X.assign(V,!1)),Z.fail$data(m1._`!${V}`)}else{let q=(0,mE.usePattern)(Z,J);Z.fail$data(m1._`!${q}.test(${Q})`)}}};k3.default=cE});var x3=j((_3)=>{Object.defineProperty(_3,"__esModule",{value:!0});var v9=Z0(),nE={message({keyword:Z,schemaCode:X}){let Q=Z==="maxProperties"?"more":"fewer";return v9.str`must NOT have ${Q} than ${X} properties`},params:({schemaCode:Z})=>v9._`{limit: ${Z}}`},iE={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:nE,code(Z){let{keyword:X,data:Q,schemaCode:W}=Z,J=X==="maxProperties"?v9.operators.GT:v9.operators.LT;Z.fail$data(v9._`Object.keys(${Q}).length ${J} ${W}`)}};_3.default=iE});var y3=j((v3)=>{Object.defineProperty(v3,"__esModule",{value:!0});var y9=M4(),g9=Z0(),aE=W0(),sE={message:({params:{missingProperty:Z}})=>g9.str`must have required property '${Z}'`,params:({params:{missingProperty:Z}})=>g9._`{missingProperty: ${Z}}`},oE={keyword:"required",type:"object",schemaType:"array",$data:!0,error:sE,code(Z){let{gen:X,schema:Q,schemaCode:W,data:J,$data:G,it:Y}=Z,{opts:z}=Y;if(!G&&Q.length===0)return;let q=Q.length>=z.loopRequired;if(Y.allErrors)K();else V();if(z.strictRequired){let F=Z.parentSchema.properties,{definedProperties:A}=Z.it;for(let M of Q)if((F===null||F===void 0?void 0:F[M])===void 0&&!A.has(M)){let I=Y.schemaEnv.baseId+Y.errSchemaPath,N=`required property "${M}" is not defined at "${I}" (strictRequired)`;(0,aE.checkStrictMode)(Y,N,Y.opts.strictRequired)}}function K(){if(q||G)Z.block$data(g9.nil,B);else for(let F of Q)(0,y9.checkReportMissingProp)(Z,F)}function V(){let F=X.let("missing");if(q||G){let A=X.let("valid",!0);Z.block$data(A,()=>H(F,A)),Z.ok(A)}else X.if((0,y9.checkMissingProp)(Z,Q,F)),(0,y9.reportMissingProp)(Z,F),X.else()}function B(){X.forOf("prop",W,(F)=>{Z.setParams({missingProperty:F}),X.if((0,y9.noPropertyInData)(X,J,F,z.ownProperties),()=>Z.error())})}function H(F,A){Z.setParams({missingProperty:F}),X.forOf(F,W,()=>{X.assign(A,(0,y9.propertyInData)(X,J,F,z.ownProperties)),X.if((0,g9.not)(A),()=>{Z.error(),X.break()})},g9.nil)}}};v3.default=oE});var f3=j((g3)=>{Object.defineProperty(g3,"__esModule",{value:!0});var f9=Z0(),eE={message({keyword:Z,schemaCode:X}){let Q=Z==="maxItems"?"more":"fewer";return f9.str`must NOT have ${Q} than ${X} items`},params:({schemaCode:Z})=>f9._`{limit: ${Z}}`},ZR={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:eE,code(Z){let{keyword:X,data:Q,schemaCode:W}=Z,J=X==="maxItems"?f9.operators.GT:f9.operators.LT;Z.fail$data(f9._`${Q}.length ${J} ${W}`)}};g3.default=ZR});var R5=j((u3)=>{Object.defineProperty(u3,"__esModule",{value:!0});var h3=EX();h3.code='require("ajv/dist/runtime/equal").default';u3.default=h3});var l3=j((m3)=>{Object.defineProperty(m3,"__esModule",{value:!0});var dX=w9(),g0=Z0(),WR=W0(),JR=R5(),GR={message:({params:{i:Z,j:X}})=>g0.str`must NOT have duplicate items (items ## ${X} and ${Z} are identical)`,params:({params:{i:Z,j:X}})=>g0._`{i: ${Z}, j: ${X}}`},YR={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:GR,code(Z){let{gen:X,data:Q,$data:W,schema:J,parentSchema:G,schemaCode:Y,it:z}=Z;if(!W&&!J)return;let q=X.let("valid"),K=G.items?(0,dX.getSchemaTypes)(G.items):[];Z.block$data(q,V,g0._`${Y} === false`),Z.ok(q);function V(){let A=X.let("i",g0._`${Q}.length`),M=X.let("j");Z.setParams({i:A,j:M}),X.assign(q,!0),X.if(g0._`${A} > 1`,()=>(B()?H:F)(A,M))}function B(){return K.length>0&&!K.some((A)=>A==="object"||A==="array")}function H(A,M){let I=X.name("item"),N=(0,dX.checkDataTypes)(K,I,z.opts.strictNumbers,dX.DataType.Wrong),T=X.const("indices",g0._`{}`);X.for(g0._`;${A}--;`,()=>{if(X.let(I,g0._`${Q}[${A}]`),X.if(N,g0._`continue`),K.length>1)X.if(g0._`typeof ${I} == "string"`,g0._`${I} += "_"`);X.if(g0._`typeof ${T}[${I}] == "number"`,()=>{X.assign(M,g0._`${T}[${I}]`),Z.error(),X.assign(q,!1).break()}).code(g0._`${T}[${I}] = ${A}`)})}function F(A,M){let I=(0,WR.useFunc)(X,JR.default),N=X.name("outer");X.label(N).for(g0._`;${A}--;`,()=>X.for(g0._`${M} = ${A}; ${M}--;`,()=>X.if(g0._`${I}(${Q}[${A}], ${Q}[${M}])`,()=>{Z.error(),X.assign(q,!1).break(N)})))}}};m3.default=YR});var c3=j((d3)=>{Object.defineProperty(d3,"__esModule",{value:!0});var cX=Z0(),$R=W0(),qR=R5(),KR={message:"must be equal to constant",params:({schemaCode:Z})=>cX._`{allowedValue: ${Z}}`},UR={keyword:"const",$data:!0,error:KR,code(Z){let{gen:X,data:Q,$data:W,schemaCode:J,schema:G}=Z;if(W||G&&typeof G=="object")Z.fail$data(cX._`!${(0,$R.useFunc)(X,qR.default)}(${Q}, ${J})`);else Z.fail(cX._`${G} !== ${Q}`)}};d3.default=UR});var n3=j((p3)=>{Object.defineProperty(p3,"__esModule",{value:!0});var h9=Z0(),BR=W0(),HR=R5(),FR={message:"must be equal to one of the allowed values",params:({schemaCode:Z})=>h9._`{allowedValues: ${Z}}`},LR={keyword:"enum",schemaType:"array",$data:!0,error:FR,code(Z){let{gen:X,data:Q,$data:W,schema:J,schemaCode:G,it:Y}=Z;if(!W&&J.length===0)throw Error("enum must have non-empty array");let z=J.length>=Y.opts.loopEnum,q,K=()=>q!==null&&q!==void 0?q:q=(0,BR.useFunc)(X,HR.default),V;if(z||W)V=X.let("valid"),Z.block$data(V,B);else{if(!Array.isArray(J))throw Error("ajv implementation error");let F=X.const("vSchema",G);V=(0,h9.or)(...J.map((A,M)=>H(F,M)))}Z.pass(V);function B(){X.assign(V,!1),X.forOf("v",G,(F)=>X.if(h9._`${K()}(${Q}, ${F})`,()=>X.assign(V,!0).break()))}function H(F,A){let M=J[A];return typeof M==="object"&&M!==null?h9._`${K()}(${Q}, ${F}[${A}])`:h9._`${Q} === ${M}`}}};p3.default=LR});var r3=j((i3)=>{Object.defineProperty(i3,"__esModule",{value:!0});var MR=w3(),IR=O3(),NR=S3(),DR=b3(),TR=x3(),wR=y3(),jR=f3(),OR=l3(),ER=c3(),RR=n3(),PR=[MR.default,IR.default,NR.default,DR.default,TR.default,wR.default,jR.default,OR.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},ER.default,RR.default];i3.default=PR});var nX=j((s3)=>{Object.defineProperty(s3,"__esModule",{value:!0});s3.validateAdditionalItems=void 0;var t6=Z0(),pX=W0(),SR={message:({params:{len:Z}})=>t6.str`must NOT have more than ${Z} items`,params:({params:{len:Z}})=>t6._`{limit: ${Z}}`},kR={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:SR,code(Z){let{parentSchema:X,it:Q}=Z,{items:W}=X;if(!Array.isArray(W)){(0,pX.checkStrictMode)(Q,'"additionalItems" is ignored when "items" is not an array of schemas');return}a3(Z,W)}};function a3(Z,X){let{gen:Q,schema:W,data:J,keyword:G,it:Y}=Z;Y.items=!0;let z=Q.const("len",t6._`${J}.length`);if(W===!1)Z.setParams({len:X.length}),Z.pass(t6._`${z} <= ${X.length}`);else if(typeof W=="object"&&!(0,pX.alwaysValidSchema)(Y,W)){let K=Q.var("valid",t6._`${z} <= ${X.length}`);Q.if((0,t6.not)(K),()=>q(K)),Z.ok(K)}function q(K){Q.forRange("i",X.length,z,(V)=>{if(Z.subschema({keyword:G,dataProp:V,dataPropType:pX.Type.Num},K),!Y.allErrors)Q.if((0,t6.not)(K),()=>Q.break())})}}s3.validateAdditionalItems=a3;s3.default=kR});var iX=j((ZU)=>{Object.defineProperty(ZU,"__esModule",{value:!0});ZU.validateTuple=void 0;var t3=Z0(),P5=W0(),_R=M4(),xR={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(Z){let{schema:X,it:Q}=Z;if(Array.isArray(X))return e3(Z,"additionalItems",X);if(Q.items=!0,(0,P5.alwaysValidSchema)(Q,X))return;Z.ok((0,_R.validateArray)(Z))}};function e3(Z,X,Q=Z.schema){let{gen:W,parentSchema:J,data:G,keyword:Y,it:z}=Z;if(V(J),z.opts.unevaluated&&Q.length&&z.items!==!0)z.items=P5.mergeEvaluated.items(W,Q.length,z.items);let q=W.name("valid"),K=W.const("len",t3._`${G}.length`);Q.forEach((B,H)=>{if((0,P5.alwaysValidSchema)(z,B))return;W.if(t3._`${K} > ${H}`,()=>Z.subschema({keyword:Y,schemaProp:H,dataProp:H},q)),Z.ok(q)});function V(B){let{opts:H,errSchemaPath:F}=z,A=Q.length,M=A===B.minItems&&(A===B.maxItems||B[X]===!1);if(H.strictTuples&&!M){let I=`"${Y}" is ${A}-tuple, but minItems or maxItems/${X} are not specified or different at path "${F}"`;(0,P5.checkStrictMode)(z,I,H.strictTuples)}}}ZU.validateTuple=e3;ZU.default=xR});var WU=j((QU)=>{Object.defineProperty(QU,"__esModule",{value:!0});var yR=iX(),gR={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(Z)=>(0,yR.validateTuple)(Z,"items")};QU.default=gR});var YU=j((GU)=>{Object.defineProperty(GU,"__esModule",{value:!0});var JU=Z0(),hR=W0(),uR=M4(),mR=nX(),lR={message:({params:{len:Z}})=>JU.str`must NOT have more than ${Z} items`,params:({params:{len:Z}})=>JU._`{limit: ${Z}}`},dR={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:lR,code(Z){let{schema:X,parentSchema:Q,it:W}=Z,{prefixItems:J}=Q;if(W.items=!0,(0,hR.alwaysValidSchema)(W,X))return;if(J)(0,mR.validateAdditionalItems)(Z,J);else Z.ok((0,uR.validateArray)(Z))}};GU.default=dR});var $U=j((zU)=>{Object.defineProperty(zU,"__esModule",{value:!0});var I4=Z0(),C5=W0(),pR={message:({params:{min:Z,max:X}})=>X===void 0?I4.str`must contain at least ${Z} valid item(s)`:I4.str`must contain at least ${Z} and no more than ${X} valid item(s)`,params:({params:{min:Z,max:X}})=>X===void 0?I4._`{minContains: ${Z}}`:I4._`{minContains: ${Z}, maxContains: ${X}}`},nR={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:pR,code(Z){let{gen:X,schema:Q,parentSchema:W,data:J,it:G}=Z,Y,z,{minContains:q,maxContains:K}=W;if(G.opts.next)Y=q===void 0?1:q,z=K;else Y=1;let V=X.const("len",I4._`${J}.length`);if(Z.setParams({min:Y,max:z}),z===void 0&&Y===0){(0,C5.checkStrictMode)(G,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(z!==void 0&&Y>z){(0,C5.checkStrictMode)(G,'"minContains" > "maxContains" is always invalid'),Z.fail();return}if((0,C5.alwaysValidSchema)(G,Q)){let M=I4._`${V} >= ${Y}`;if(z!==void 0)M=I4._`${M} && ${V} <= ${z}`;Z.pass(M);return}G.items=!0;let B=X.name("valid");if(z===void 0&&Y===1)F(B,()=>X.if(B,()=>X.break()));else if(Y===0){if(X.let(B,!0),z!==void 0)X.if(I4._`${J}.length > 0`,H)}else X.let(B,!1),H();Z.result(B,()=>Z.reset());function H(){let M=X.name("_valid"),I=X.let("count",0);F(M,()=>X.if(M,()=>A(I)))}function F(M,I){X.forRange("i",0,V,(N)=>{Z.subschema({keyword:"contains",dataProp:N,dataPropType:C5.Type.Num,compositeRule:!0},M),I()})}function A(M){if(X.code(I4._`${M}++`),z===void 0)X.if(I4._`${M} >= ${Y}`,()=>X.assign(B,!0).break());else if(X.if(I4._`${M} > ${z}`,()=>X.assign(B,!1).break()),Y===1)X.assign(B,!0);else X.if(I4._`${M} >= ${Y}`,()=>X.assign(B,!0))}}};zU.default=nR});var S5=j((UU)=>{Object.defineProperty(UU,"__esModule",{value:!0});UU.validateSchemaDeps=UU.validatePropertyDeps=UU.error=void 0;var rX=Z0(),rR=W0(),u9=M4();UU.error={message:({params:{property:Z,depsCount:X,deps:Q}})=>{let W=X===1?"property":"properties";return rX.str`must have ${W} ${Q} when property ${Z} is present`},params:({params:{property:Z,depsCount:X,deps:Q,missingProperty:W}})=>rX._`{property: ${Z},
|
|
313
|
-
missingProperty: ${
|
|
378
|
+
`,l6(Q,W,"utf8"),J?0:1}var SK=s(()=>{Y1();bY();A5();hY();e1();mY();lY();nY();cG();c9();n1();aY();jK();KQ()});var kK={};D1(kK,{runDev:()=>kj,resolveDevEntry:()=>_K});import{createRequire as Cj}from"node:module";import{join as Sj}from"node:path";import{spawn as _j}from"node:child_process";function _K(Z){try{return Cj(Sj(Z,"package.json")).resolve("@jxsuite/server/dev")}catch{throw Error(`@jxsuite/server is not installed in ${Z}. Add it to devDependencies (e.g. \`bun add -d @jxsuite/server\`) and retry.`)}}function kj(Z,X,Q=_j,J=process){let G=[_K(Z),"--root",Z];if(X!==void 0)G.push("--port",String(X));let Y=Q("bun",G,{stdio:"inherit"});return Y.on("error",($)=>{if($.code==="ENOENT")console.error("The Jx dev server runs on Bun, which was not found on your PATH. Install it from https://bun.sh and retry.");else console.error(`Failed to start the dev server: ${$.message}`);J.exitCode=1}),J.on("SIGINT",()=>{Y.kill("SIGINT")}),J.on("SIGTERM",()=>{Y.kill("SIGTERM")}),Y.on("exit",($)=>{J.exitCode=$??0}),Y}var xK=()=>{};var gK={};D1(gK,{startPreviewServer:()=>hj,resolvePreviewFile:()=>yK});import{createServer as xj}from"node:http";import{existsSync as XZ,readFileSync as bK,statSync as bj}from"node:fs";import{extname as vj,join as FQ,normalize as yj,resolve as vK,sep as gj}from"node:path";function yK(Z,X){let Q=yj(X).replaceAll("\\","/"),J=vK(Z,`.${Q.startsWith("/")?Q:`/${Q}`}`);if(J!==Z&&!J.startsWith(Z+gj))return null;if(XZ(J)){if(bj(J).isDirectory()){let G=FQ(J,"index.html");return XZ(G)?G:null}return J}let W=FQ(J,"index.html");return XZ(W)?W:null}function hj(Z,X){let Q=vK(Z),J=xj((W,G)=>{let Y=new URL(W.url??"/","http://localhost"),$=yK(Q,decodeURIComponent(Y.pathname));if($){G.writeHead(200,{"Content-Type":fj[vj($).toLowerCase()]??"application/octet-stream"}),G.end(bK($));return}let z=FQ(Q,"404.html");if(XZ(z)){G.writeHead(404,{"Content-Type":"text/html; charset=utf-8"}),G.end(bK(z));return}G.writeHead(404,{"Content-Type":"text/plain; charset=utf-8"}),G.end("Not found")});return J.listen(X),J}var fj;var fK=s(()=>{fj={".avif":"image/avif",".css":"text/css; charset=utf-8",".gif":"image/gif",".html":"text/html; charset=utf-8",".ico":"image/x-icon",".jpeg":"image/jpeg",".jpg":"image/jpeg",".js":"text/javascript; charset=utf-8",".json":"application/json; charset=utf-8",".md":"text/markdown; charset=utf-8",".png":"image/png",".svg":"image/svg+xml",".txt":"text/plain; charset=utf-8",".webp":"image/webp",".woff2":"font/woff2",".xml":"application/xml; charset=utf-8"}});var LQ="https://jxsuite.com/schema/project/fields/v2",QZ="https://jxsuite.com/schema/document/paths/v2",Ou;var MQ=s(()=>{Ou={description:"A single field definition inside a section entry schema — a small, recursive subset of "+"JSON Schema. Recursive positions reference the effective field union via the well-known fields resource $id.",properties:{default:{},description:{type:"string"},enum:{type:"array"},format:{type:"string"},items:{$ref:"https://jxsuite.com/schema/project/fields/v2"},properties:{additionalProperties:{$ref:"https://jxsuite.com/schema/project/fields/v2"},type:"object"},required:{items:{type:"string"},type:"array"},type:{enum:["string","number","integer","boolean","array","object"],type:"string"}},required:["type"],type:"object"}});function dK(Z){let{corePath:X,fragments:Q,fieldSchemaRefs:J=[]}=Z;return{$comment:mK,$defs:{Fields:{$id:LQ,anyOf:[{$ref:`${hK}#/$defs/JxFieldSchema`},{$ref:`${hK}#/$defs/RelationshipRef`},...J.map((W)=>({$ref:W}))]}},$schema:"https://json-schema.org/draft/2020-12/schema",allOf:[{$ref:X},...Q.map((W)=>({$ref:W}))],type:"object",unevaluatedProperties:!1}}async function IQ(Z,X,Q){let J=structuredClone(Z),W=new Map,G=new Set;AQ(J,G);let Y=0,$=async(U)=>{let V=uK(U),q=W.get(V);if(q!==void 0)return q;let B;try{B=structuredClone(await X(V))}catch(A){throw Error(`bundleSchema: cannot load $ref target "${V}": ${mj(A)}`,{cause:A})}let F=typeof B.$id==="string"&&JZ(B.$id)?B.$id:null;Y+=F===null?1:0;let L=F??`urn:jx:bundled:${Y}`;if(W.set(V,L),G.has(L))return L;G.add(L),B.$id=L,await z(B,uj(V),!0);let I=J.$defs??={};return I[L]=B,L},z=async(U,V,q=!1)=>{if(Array.isArray(U)){for(let I of U)await z(I,V);return}if(U===null||typeof U!=="object")return;let B=U,F=V;if(!q&&typeof B.$id==="string"&&JZ(B.$id))F=null;let L=B.$ref;if(typeof L==="string"&&F!==null&&!L.startsWith("#")&&!JZ(L)){let I=L.indexOf("#"),A=I===-1?L:L.slice(0,I),N=I===-1?"":L.slice(I);if(A){let D=await $(`${F}/${A}`);B.$ref=`${D}${N}`}}for(let I of Object.values(B))await z(I,F)};return await z(J,uK(Q),!0),J}function AQ(Z,X){if(Array.isArray(Z)){for(let J of Z)AQ(J,X);return}if(Z===null||typeof Z!=="object")return;let Q=Z;if(typeof Q.$id==="string"&&JZ(Q.$id))X.add(Q.$id);for(let J of Object.values(Q))AQ(J,X)}function JZ(Z){return/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(Z)}function uK(Z){let X=Z.replaceAll("\\","/"),Q=X.startsWith("/"),J=[];for(let W of X.split("/")){if(W===""||W===".")continue;if(W===".."){if(J.length>0&&J.at(-1)!=="..")J.pop();else if(!Q)J.push("..");continue}J.push(W)}return(Q?"/":"")+J.join("/")}function uj(Z){let X=Z.lastIndexOf("/");if(X===-1)return".";return X===0?"/":Z.slice(0,X)}function mj(Z){return Z instanceof Error?Z.message:String(Z)}function lK(Z){let{corePath:X,pathsValueRefs:Q}=Z;return{$comment:mK,$defs:{PathsValue:Q.length>0?{$id:QZ,anyOf:Q.map((J)=>({$ref:J}))}:{$id:QZ}},$ref:X,$schema:"https://json-schema.org/draft/2020-12/schema"}}var hK="https://jxsuite.com/schema/project/core/v2",mK="Generated by `jx schema` from project.json#/extensions — do not edit.";var cK=s(()=>{MQ();MQ()});var eK={};D1(eK,{writeProjectSchemas:()=>sK,readBundledProjectSchemas:()=>ij});import{existsSync as oK,readFileSync as V8,statSync as pK,writeFileSync as iK}from"node:fs";import{createRequire as WZ}from"node:module";import{dirname as dj,isAbsolute as lj,relative as NQ,resolve as f1,sep as DQ}from"node:path";async function sK(Z){let{config:X}=X9(Z),Q=await t1(Z,X),J=nK(Z,cj),W=[],G=[],Y=[];for(let q of Q.extensions){let B=q.schemas.project;if(B)W.push(rK(Z,q,B));let F=q.schemas.document;if(F)G.push(...aK(F));let L=q.schemas.fields;if(L)Y.push(...aK(L)),W.push(rK(Z,q,L))}let $=dK({corePath:J,fieldSchemaRefs:Y,fragments:W}),z=lK({corePath:nK(Z,pj),pathsValueRefs:G}),U=f1(Z,"project.schema.json"),V=f1(Z,"document.schema.json");return iK(U,`${JSON.stringify($,null,2)}
|
|
379
|
+
`,"utf8"),iK(V,`${JSON.stringify(z,null,2)}
|
|
380
|
+
`,"utf8"),{documentSchemaPath:V,projectSchemaPath:U}}async function ij(Z){let X=f1(Z),Q=f1(X,"project.json"),J=f1(X,"project.schema.json"),W=f1(X,"document.schema.json"),G=(U)=>{if(!oK(U))return!0;try{return pK(Q).mtimeMs>pK(U).mtimeMs}catch{return!1}};if(G(J)||G(W))await sK(X);let Y=nj(X),$=await IQ(JSON.parse(V8(J,"utf8")),Y,X);return{document:await IQ(JSON.parse(V8(W,"utf8")),Y,X),project:$}}function nj(Z){return async(X)=>{let Q=f1(X),J=NQ(Z,Q);if(J.startsWith("..")||lj(J))throw Error(`Schema ref "${X}" escapes the project root ${Z}`);if(oK(Q))return JSON.parse(V8(Q,"utf8"));let W=J.split(DQ).join("/"),G="node_modules/",Y=W.lastIndexOf(G);if(Y===-1)throw Error(`Schema ref "${X}" does not exist`);let $=W.slice(Y+G.length),z;try{z=WZ(f1(Z,"package.json")).resolve($)}catch{try{z=WZ(import.meta.url).resolve($)}catch(U){throw Error(`Schema ref "${X}" does not exist and "${$}" is not resolvable from the project or the host`,{cause:U})}}return JSON.parse(V8(z,"utf8"))}}function nK(Z,X){let Q=null;try{Q=WZ(f1(Z,"package.json")).resolve(X)}catch{try{Q=WZ(import.meta.url).resolve(X)}catch{Q=null}}let J=`./node_modules/${X}`;return Q?tK(Z,Q,J):J}function rK(Z,X,Q){let J=NQ(dj(X.manifestPath),Q).split(DQ).join("/"),W=`./node_modules/${X.specifier}/${J}`;return tK(Z,Q,W)}function tK(Z,X,Q){let J=NQ(Z,X).split(DQ).join("/");if(J.startsWith(".."))return Q;return J.startsWith("./")?J:`./${J}`}function aK(Z){let X;try{X=JSON.parse(V8(Z,"utf8"))}catch{return[]}let{$id:Q}=X;if(typeof Q!=="string"||!X.$defs)return[];return Object.keys(X.$defs).map((J)=>`${Q}#/$defs/${J}`)}var cj="@jxsuite/schema/schemas/project.core.schema.json",pj="@jxsuite/schema/schema.json";var ZV=s(()=>{cK();e1();A5()});var q8=C((JV)=>{Object.defineProperty(JV,"__esModule",{value:!0});JV.regexpCode=JV.getEsmExportName=JV.getProperty=JV.safeStringify=JV.stringify=JV.strConcat=JV.addCodeArg=JV.str=JV._=JV.nil=JV._Code=JV.Name=JV.IDENTIFIER=JV._CodeOrName=void 0;class GZ{}JV._CodeOrName=GZ;JV.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class A9 extends GZ{constructor(Z){super();if(!JV.IDENTIFIER.test(Z))throw Error("CodeGen: name must be a valid identifier");this.str=Z}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}JV.Name=A9;class s6 extends GZ{constructor(Z){super();this._items=typeof Z==="string"?[Z]:Z}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let Z=this._items[0];return Z===""||Z==='""'}get str(){var Z;return(Z=this._str)!==null&&Z!==void 0?Z:this._str=this._items.reduce((X,Q)=>`${X}${Q}`,"")}get names(){var Z;return(Z=this._names)!==null&&Z!==void 0?Z:this._names=this._items.reduce((X,Q)=>{if(Q instanceof A9)X[Q.str]=(X[Q.str]||0)+1;return X},{})}}JV._Code=s6;JV.nil=new s6("");function XV(Z,...X){let Q=[Z[0]],J=0;while(J<X.length)wQ(Q,X[J]),Q.push(Z[++J]);return new s6(Q)}JV._=XV;var TQ=new s6("+");function QV(Z,...X){let Q=[H8(Z[0])],J=0;while(J<X.length)Q.push(TQ),wQ(Q,X[J]),Q.push(TQ,H8(Z[++J]));return rj(Q),new s6(Q)}JV.str=QV;function wQ(Z,X){if(X instanceof s6)Z.push(...X._items);else if(X instanceof A9)Z.push(X);else Z.push(sj(X))}JV.addCodeArg=wQ;function rj(Z){let X=1;while(X<Z.length-1){if(Z[X]===TQ){let Q=aj(Z[X-1],Z[X+1]);if(Q!==void 0){Z.splice(X-1,3,Q);continue}Z[X++]="+"}X++}}function aj(Z,X){if(X==='""')return Z;if(Z==='""')return X;if(typeof Z=="string"){if(X instanceof A9||Z[Z.length-1]!=='"')return;if(typeof X!="string")return`${Z.slice(0,-1)}${X}"`;if(X[0]==='"')return Z.slice(0,-1)+X.slice(1);return}if(typeof X=="string"&&X[0]==='"'&&!(Z instanceof A9))return`"${Z}${X.slice(1)}`;return}function oj(Z,X){return X.emptyStr()?Z:Z.emptyStr()?X:QV`${Z}${X}`}JV.strConcat=oj;function sj(Z){return typeof Z=="number"||typeof Z=="boolean"||Z===null?Z:H8(Array.isArray(Z)?Z.join(","):Z)}function tj(Z){return new s6(H8(Z))}JV.stringify=tj;function H8(Z){return JSON.stringify(Z).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}JV.safeStringify=H8;function ej(Z){return typeof Z=="string"&&JV.IDENTIFIER.test(Z)?new s6(`.${Z}`):XV`[${Z}]`}JV.getProperty=ej;function ZO(Z){if(typeof Z=="string"&&JV.IDENTIFIER.test(Z))return new s6(`${Z}`);throw Error(`CodeGen: invalid export name: ${Z}, use explicit $id name mapping`)}JV.getEsmExportName=ZO;function XO(Z){return new s6(Z.toString())}JV.regexpCode=XO});var RQ=C(($V)=>{Object.defineProperty($V,"__esModule",{value:!0});$V.ValueScope=$V.ValueScopeName=$V.Scope=$V.varKinds=$V.UsedValueState=void 0;var T6=q8();class GV extends Error{constructor(Z){super(`CodeGen: "code" for ${Z} not defined`);this.value=Z.value}}var $Z;(function(Z){Z[Z.Started=0]="Started",Z[Z.Completed=1]="Completed"})($Z||($V.UsedValueState=$Z={}));$V.varKinds={const:new T6.Name("const"),let:new T6.Name("let"),var:new T6.Name("var")};class OQ{constructor({prefixes:Z,parent:X}={}){this._names={},this._prefixes=Z,this._parent=X}toName(Z){return Z instanceof T6.Name?Z:this.name(Z)}name(Z){return new T6.Name(this._newName(Z))}_newName(Z){let X=this._names[Z]||this._nameGroup(Z);return`${Z}${X.index++}`}_nameGroup(Z){var X,Q;if(((Q=(X=this._parent)===null||X===void 0?void 0:X._prefixes)===null||Q===void 0?void 0:Q.has(Z))||this._prefixes&&!this._prefixes.has(Z))throw Error(`CodeGen: prefix "${Z}" is not allowed in this scope`);return this._names[Z]={prefix:Z,index:0}}}$V.Scope=OQ;class EQ extends T6.Name{constructor(Z,X){super(X);this.prefix=Z}setValue(Z,{property:X,itemIndex:Q}){this.value=Z,this.scopePath=T6._`.${new T6.Name(X)}[${Q}]`}}$V.ValueScopeName=EQ;var BO=T6._`\n`;class YV extends OQ{constructor(Z){super(Z);this._values={},this._scope=Z.scope,this.opts={...Z,_n:Z.lines?BO:T6.nil}}get(){return this._scope}name(Z){return new EQ(Z,this._newName(Z))}value(Z,X){var Q;if(X.ref===void 0)throw Error("CodeGen: ref must be passed in value");let J=this.toName(Z),{prefix:W}=J,G=(Q=X.key)!==null&&Q!==void 0?Q:X.ref,Y=this._values[W];if(Y){let U=Y.get(G);if(U)return U}else Y=this._values[W]=new Map;Y.set(G,J);let $=this._scope[W]||(this._scope[W]=[]),z=$.length;return $[z]=X.ref,J.setValue(X,{property:W,itemIndex:z}),J}getValue(Z,X){let Q=this._values[Z];if(!Q)return;return Q.get(X)}scopeRefs(Z,X=this._values){return this._reduceValues(X,(Q)=>{if(Q.scopePath===void 0)throw Error(`CodeGen: name "${Q}" has no value`);return T6._`${Z}${Q.scopePath}`})}scopeCode(Z=this._values,X,Q){return this._reduceValues(Z,(J)=>{if(J.value===void 0)throw Error(`CodeGen: name "${J}" has no value`);return J.value.code},X,Q)}_reduceValues(Z,X,Q={},J){let W=T6.nil;for(let G in Z){let Y=Z[G];if(!Y)continue;let $=Q[G]=Q[G]||new Map;Y.forEach((z)=>{if($.has(z))return;$.set(z,$Z.Started);let U=X(z);if(U){let V=this.opts.es5?$V.varKinds.var:$V.varKinds.const;W=T6._`${W}${V} ${z} = ${U};${this.opts._n}`}else if(U=J===null||J===void 0?void 0:J(z))W=T6._`${W}${U}${this.opts._n}`;else throw new GV(z);$.set(z,$Z.Completed)})}return W}}$V.ValueScope=YV});var L0=C((w6)=>{Object.defineProperty(w6,"__esModule",{value:!0});w6.or=w6.and=w6.not=w6.CodeGen=w6.operators=w6.varKinds=w6.ValueScopeName=w6.ValueScope=w6.Scope=w6.Name=w6.regexpCode=w6.stringify=w6.getProperty=w6.nil=w6.strConcat=w6.str=w6._=void 0;var T0=q8(),t6=RQ(),$4=q8();Object.defineProperty(w6,"_",{enumerable:!0,get:function(){return $4._}});Object.defineProperty(w6,"str",{enumerable:!0,get:function(){return $4.str}});Object.defineProperty(w6,"strConcat",{enumerable:!0,get:function(){return $4.strConcat}});Object.defineProperty(w6,"nil",{enumerable:!0,get:function(){return $4.nil}});Object.defineProperty(w6,"getProperty",{enumerable:!0,get:function(){return $4.getProperty}});Object.defineProperty(w6,"stringify",{enumerable:!0,get:function(){return $4.stringify}});Object.defineProperty(w6,"regexpCode",{enumerable:!0,get:function(){return $4.regexpCode}});Object.defineProperty(w6,"Name",{enumerable:!0,get:function(){return $4.Name}});var qZ=RQ();Object.defineProperty(w6,"Scope",{enumerable:!0,get:function(){return qZ.Scope}});Object.defineProperty(w6,"ValueScope",{enumerable:!0,get:function(){return qZ.ValueScope}});Object.defineProperty(w6,"ValueScopeName",{enumerable:!0,get:function(){return qZ.ValueScopeName}});Object.defineProperty(w6,"varKinds",{enumerable:!0,get:function(){return qZ.varKinds}});w6.operators={GT:new T0._Code(">"),GTE:new T0._Code(">="),LT:new T0._Code("<"),LTE:new T0._Code("<="),EQ:new T0._Code("==="),NEQ:new T0._Code("!=="),NOT:new T0._Code("!"),OR:new T0._Code("||"),AND:new T0._Code("&&"),ADD:new T0._Code("+")};class z4{optimizeNodes(){return this}optimizeNames(Z,X){return this}}class UV extends z4{constructor(Z,X,Q){super();this.varKind=Z,this.name=X,this.rhs=Q}render({es5:Z,_n:X}){let Q=Z?t6.varKinds.var:this.varKind,J=this.rhs===void 0?"":` = ${this.rhs}`;return`${Q} ${this.name}${J};`+X}optimizeNames(Z,X){if(!Z[this.name.str])return;if(this.rhs)this.rhs=N9(this.rhs,Z,X);return this}get names(){return this.rhs instanceof T0._CodeOrName?this.rhs.names:{}}}class SQ extends z4{constructor(Z,X,Q){super();this.lhs=Z,this.rhs=X,this.sideEffects=Q}render({_n:Z}){return`${this.lhs} = ${this.rhs};`+Z}optimizeNames(Z,X){if(this.lhs instanceof T0.Name&&!Z[this.lhs.str]&&!this.sideEffects)return;return this.rhs=N9(this.rhs,Z,X),this}get names(){let Z=this.lhs instanceof T0.Name?{}:{...this.lhs.names};return HZ(Z,this.rhs)}}class KV extends SQ{constructor(Z,X,Q,J){super(Z,Q,J);this.op=X}render({_n:Z}){return`${this.lhs} ${this.op}= ${this.rhs};`+Z}}class VV extends z4{constructor(Z){super();this.label=Z,this.names={}}render({_n:Z}){return`${this.label}:`+Z}}class HV extends z4{constructor(Z){super();this.label=Z,this.names={}}render({_n:Z}){return`break${this.label?` ${this.label}`:""};`+Z}}class qV extends z4{constructor(Z){super();this.error=Z}render({_n:Z}){return`throw ${this.error};`+Z}get names(){return this.error.names}}class BV extends z4{constructor(Z){super();this.code=Z}render({_n:Z}){return`${this.code};`+Z}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(Z,X){return this.code=N9(this.code,Z,X),this}get names(){return this.code instanceof T0._CodeOrName?this.code.names:{}}}class BZ extends z4{constructor(Z=[]){super();this.nodes=Z}render(Z){return this.nodes.reduce((X,Q)=>X+Q.render(Z),"")}optimizeNodes(){let{nodes:Z}=this,X=Z.length;while(X--){let Q=Z[X].optimizeNodes();if(Array.isArray(Q))Z.splice(X,1,...Q);else if(Q)Z[X]=Q;else Z.splice(X,1)}return Z.length>0?this:void 0}optimizeNames(Z,X){let{nodes:Q}=this,J=Q.length;while(J--){let W=Q[J];if(W.optimizeNames(Z,X))continue;AO(Z,W.names),Q.splice(J,1)}return Q.length>0?this:void 0}get names(){return this.nodes.reduce((Z,X)=>_4(Z,X.names),{})}}class U4 extends BZ{render(Z){return"{"+Z._n+super.render(Z)+"}"+Z._n}}class FV extends BZ{}class B8 extends U4{}B8.kind="else";class h1 extends U4{constructor(Z,X){super(X);this.condition=Z}render(Z){let X=`if(${this.condition})`+super.render(Z);if(this.else)X+="else "+this.else.render(Z);return X}optimizeNodes(){super.optimizeNodes();let Z=this.condition;if(Z===!0)return this.nodes;let X=this.else;if(X){let Q=X.optimizeNodes();X=this.else=Array.isArray(Q)?new B8(Q):Q}if(X){if(Z===!1)return X instanceof h1?X:X.nodes;if(this.nodes.length)return this;return new h1(NV(Z),X instanceof h1?[X]:X.nodes)}if(Z===!1||!this.nodes.length)return;return this}optimizeNames(Z,X){var Q;if(this.else=(Q=this.else)===null||Q===void 0?void 0:Q.optimizeNames(Z,X),!(super.optimizeNames(Z,X)||this.else))return;return this.condition=N9(this.condition,Z,X),this}get names(){let Z=super.names;if(HZ(Z,this.condition),this.else)_4(Z,this.else.names);return Z}}h1.kind="if";class I9 extends U4{}I9.kind="for";class LV extends I9{constructor(Z){super();this.iteration=Z}render(Z){return`for(${this.iteration})`+super.render(Z)}optimizeNames(Z,X){if(!super.optimizeNames(Z,X))return;return this.iteration=N9(this.iteration,Z,X),this}get names(){return _4(super.names,this.iteration.names)}}class MV extends I9{constructor(Z,X,Q,J){super();this.varKind=Z,this.name=X,this.from=Q,this.to=J}render(Z){let X=Z.es5?t6.varKinds.var:this.varKind,{name:Q,from:J,to:W}=this;return`for(${X} ${Q}=${J}; ${Q}<${W}; ${Q}++)`+super.render(Z)}get names(){let Z=HZ(super.names,this.from);return HZ(Z,this.to)}}class PQ extends I9{constructor(Z,X,Q,J){super();this.loop=Z,this.varKind=X,this.name=Q,this.iterable=J}render(Z){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(Z)}optimizeNames(Z,X){if(!super.optimizeNames(Z,X))return;return this.iterable=N9(this.iterable,Z,X),this}get names(){return _4(super.names,this.iterable.names)}}class zZ extends U4{constructor(Z,X,Q){super();this.name=Z,this.args=X,this.async=Q}render(Z){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(Z)}}zZ.kind="func";class UZ extends BZ{render(Z){return"return "+super.render(Z)}}UZ.kind="return";class AV extends U4{render(Z){let X="try"+super.render(Z);if(this.catch)X+=this.catch.render(Z);if(this.finally)X+=this.finally.render(Z);return X}optimizeNodes(){var Z,X;return super.optimizeNodes(),(Z=this.catch)===null||Z===void 0||Z.optimizeNodes(),(X=this.finally)===null||X===void 0||X.optimizeNodes(),this}optimizeNames(Z,X){var Q,J;return super.optimizeNames(Z,X),(Q=this.catch)===null||Q===void 0||Q.optimizeNames(Z,X),(J=this.finally)===null||J===void 0||J.optimizeNames(Z,X),this}get names(){let Z=super.names;if(this.catch)_4(Z,this.catch.names);if(this.finally)_4(Z,this.finally.names);return Z}}class KZ extends U4{constructor(Z){super();this.error=Z}render(Z){return`catch(${this.error})`+super.render(Z)}}KZ.kind="catch";class VZ extends U4{render(Z){return"finally"+super.render(Z)}}VZ.kind="finally";class IV{constructor(Z,X={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...X,_n:X.lines?`
|
|
381
|
+
`:""},this._extScope=Z,this._scope=new t6.Scope({parent:Z}),this._nodes=[new FV]}toString(){return this._root.render(this.opts)}name(Z){return this._scope.name(Z)}scopeName(Z){return this._extScope.name(Z)}scopeValue(Z,X){let Q=this._extScope.value(Z,X);return(this._values[Q.prefix]||(this._values[Q.prefix]=new Set)).add(Q),Q}getScopeValue(Z,X){return this._extScope.getValue(Z,X)}scopeRefs(Z){return this._extScope.scopeRefs(Z,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(Z,X,Q,J){let W=this._scope.toName(X);if(Q!==void 0&&J)this._constants[W.str]=Q;return this._leafNode(new UV(Z,W,Q)),W}const(Z,X,Q){return this._def(t6.varKinds.const,Z,X,Q)}let(Z,X,Q){return this._def(t6.varKinds.let,Z,X,Q)}var(Z,X,Q){return this._def(t6.varKinds.var,Z,X,Q)}assign(Z,X,Q){return this._leafNode(new SQ(Z,X,Q))}add(Z,X){return this._leafNode(new KV(Z,w6.operators.ADD,X))}code(Z){if(typeof Z=="function")Z();else if(Z!==T0.nil)this._leafNode(new BV(Z));return this}object(...Z){let X=["{"];for(let[Q,J]of Z){if(X.length>1)X.push(",");if(X.push(Q),Q!==J||this.opts.es5)X.push(":"),(0,T0.addCodeArg)(X,J)}return X.push("}"),new T0._Code(X)}if(Z,X,Q){if(this._blockNode(new h1(Z)),X&&Q)this.code(X).else().code(Q).endIf();else if(X)this.code(X).endIf();else if(Q)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(Z){return this._elseNode(new h1(Z))}else(){return this._elseNode(new B8)}endIf(){return this._endBlockNode(h1,B8)}_for(Z,X){if(this._blockNode(Z),X)this.code(X).endFor();return this}for(Z,X){return this._for(new LV(Z),X)}forRange(Z,X,Q,J,W=this.opts.es5?t6.varKinds.var:t6.varKinds.let){let G=this._scope.toName(Z);return this._for(new MV(W,G,X,Q),()=>J(G))}forOf(Z,X,Q,J=t6.varKinds.const){let W=this._scope.toName(Z);if(this.opts.es5){let G=X instanceof T0.Name?X:this.var("_arr",X);return this.forRange("_i",0,T0._`${G}.length`,(Y)=>{this.var(W,T0._`${G}[${Y}]`),Q(W)})}return this._for(new PQ("of",J,W,X),()=>Q(W))}forIn(Z,X,Q,J=this.opts.es5?t6.varKinds.var:t6.varKinds.const){if(this.opts.ownProperties)return this.forOf(Z,T0._`Object.keys(${X})`,Q);let W=this._scope.toName(Z);return this._for(new PQ("in",J,W,X),()=>Q(W))}endFor(){return this._endBlockNode(I9)}label(Z){return this._leafNode(new VV(Z))}break(Z){return this._leafNode(new HV(Z))}return(Z){let X=new UZ;if(this._blockNode(X),this.code(Z),X.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(UZ)}try(Z,X,Q){if(!X&&!Q)throw Error('CodeGen: "try" without "catch" and "finally"');let J=new AV;if(this._blockNode(J),this.code(Z),X){let W=this.name("e");this._currNode=J.catch=new KZ(W),X(W)}if(Q)this._currNode=J.finally=new VZ,this.code(Q);return this._endBlockNode(KZ,VZ)}throw(Z){return this._leafNode(new qV(Z))}block(Z,X){if(this._blockStarts.push(this._nodes.length),Z)this.code(Z).endBlock(X);return this}endBlock(Z){let X=this._blockStarts.pop();if(X===void 0)throw Error("CodeGen: not in self-balancing block");let Q=this._nodes.length-X;if(Q<0||Z!==void 0&&Q!==Z)throw Error(`CodeGen: wrong number of nodes: ${Q} vs ${Z} expected`);return this._nodes.length=X,this}func(Z,X=T0.nil,Q,J){if(this._blockNode(new zZ(Z,X,Q)),J)this.code(J).endFunc();return this}endFunc(){return this._endBlockNode(zZ)}optimize(Z=1){while(Z-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(Z){return this._currNode.nodes.push(Z),this}_blockNode(Z){this._currNode.nodes.push(Z),this._nodes.push(Z)}_endBlockNode(Z,X){let Q=this._currNode;if(Q instanceof Z||X&&Q instanceof X)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${X?`${Z.kind}/${X.kind}`:Z.kind}"`)}_elseNode(Z){let X=this._currNode;if(!(X instanceof h1))throw Error('CodeGen: "else" without "if"');return this._currNode=X.else=Z,this}get _root(){return this._nodes[0]}get _currNode(){let Z=this._nodes;return Z[Z.length-1]}set _currNode(Z){let X=this._nodes;X[X.length-1]=Z}}w6.CodeGen=IV;function _4(Z,X){for(let Q in X)Z[Q]=(Z[Q]||0)+(X[Q]||0);return Z}function HZ(Z,X){return X instanceof T0._CodeOrName?_4(Z,X.names):Z}function N9(Z,X,Q){if(Z instanceof T0.Name)return J(Z);if(!W(Z))return Z;return new T0._Code(Z._items.reduce((G,Y)=>{if(Y instanceof T0.Name)Y=J(Y);if(Y instanceof T0._Code)G.push(...Y._items);else G.push(Y);return G},[]));function J(G){let Y=Q[G.str];if(Y===void 0||X[G.str]!==1)return G;return delete X[G.str],Y}function W(G){return G instanceof T0._Code&&G._items.some((Y)=>Y instanceof T0.Name&&X[Y.str]===1&&Q[Y.str]!==void 0)}}function AO(Z,X){for(let Q in X)Z[Q]=(Z[Q]||0)-(X[Q]||0)}function NV(Z){return typeof Z=="boolean"||typeof Z=="number"||Z===null?!Z:T0._`!${CQ(Z)}`}w6.not=NV;var IO=DV(w6.operators.AND);function NO(...Z){return Z.reduce(IO)}w6.and=NO;var DO=DV(w6.operators.OR);function TO(...Z){return Z.reduce(DO)}w6.or=TO;function DV(Z){return(X,Q)=>X===T0.nil?Q:Q===T0.nil?X:T0._`${CQ(X)} ${Z} ${CQ(Q)}`}function CQ(Z){return Z instanceof T0.Name?Z:T0._`(${Z})`}});var A0=C((SV)=>{Object.defineProperty(SV,"__esModule",{value:!0});SV.checkStrictMode=SV.getErrorPath=SV.Type=SV.useFunc=SV.setEvaluated=SV.evaluatedPropsToName=SV.mergeEvaluated=SV.eachItem=SV.unescapeJsonPointer=SV.escapeJsonPointer=SV.escapeFragment=SV.unescapeFragment=SV.schemaRefOrVal=SV.schemaHasRulesButRef=SV.schemaHasRules=SV.checkUnknownRules=SV.alwaysValidSchema=SV.toHash=void 0;var P0=L0(),EO=q8();function RO(Z){let X={};for(let Q of Z)X[Q]=!0;return X}SV.toHash=RO;function PO(Z,X){if(typeof X=="boolean")return X;if(Object.keys(X).length===0)return!0;return OV(Z,X),!EV(X,Z.self.RULES.all)}SV.alwaysValidSchema=PO;function OV(Z,X=Z.schema){let{opts:Q,self:J}=Z;if(!Q.strictSchema)return;if(typeof X==="boolean")return;let W=J.RULES.keywords;for(let G in X)if(!W[G])CV(Z,`unknown keyword: "${G}"`)}SV.checkUnknownRules=OV;function EV(Z,X){if(typeof Z=="boolean")return!Z;for(let Q in Z)if(X[Q])return!0;return!1}SV.schemaHasRules=EV;function CO(Z,X){if(typeof Z=="boolean")return!Z;for(let Q in Z)if(Q!=="$ref"&&X.all[Q])return!0;return!1}SV.schemaHasRulesButRef=CO;function SO({topSchemaRef:Z,schemaPath:X},Q,J,W){if(!W){if(typeof Q=="number"||typeof Q=="boolean")return Q;if(typeof Q=="string")return P0._`${Q}`}return P0._`${Z}${X}${(0,P0.getProperty)(J)}`}SV.schemaRefOrVal=SO;function _O(Z){return RV(decodeURIComponent(Z))}SV.unescapeFragment=_O;function kO(Z){return encodeURIComponent(kQ(Z))}SV.escapeFragment=kO;function kQ(Z){if(typeof Z=="number")return`${Z}`;return Z.replace(/~/g,"~0").replace(/\//g,"~1")}SV.escapeJsonPointer=kQ;function RV(Z){return Z.replace(/~1/g,"/").replace(/~0/g,"~")}SV.unescapeJsonPointer=RV;function xO(Z,X){if(Array.isArray(Z))for(let Q of Z)X(Q);else X(Z)}SV.eachItem=xO;function wV({mergeNames:Z,mergeToName:X,mergeValues:Q,resultToName:J}){return(W,G,Y,$)=>{let z=Y===void 0?G:Y instanceof P0.Name?(G instanceof P0.Name?Z(W,G,Y):X(W,G,Y),Y):G instanceof P0.Name?(X(W,Y,G),G):Q(G,Y);return $===P0.Name&&!(z instanceof P0.Name)?J(W,z):z}}SV.mergeEvaluated={props:wV({mergeNames:(Z,X,Q)=>Z.if(P0._`${Q} !== true && ${X} !== undefined`,()=>{Z.if(P0._`${X} === true`,()=>Z.assign(Q,!0),()=>Z.assign(Q,P0._`${Q} || {}`).code(P0._`Object.assign(${Q}, ${X})`))}),mergeToName:(Z,X,Q)=>Z.if(P0._`${Q} !== true`,()=>{if(X===!0)Z.assign(Q,!0);else Z.assign(Q,P0._`${Q} || {}`),xQ(Z,Q,X)}),mergeValues:(Z,X)=>Z===!0?!0:{...Z,...X},resultToName:PV}),items:wV({mergeNames:(Z,X,Q)=>Z.if(P0._`${Q} !== true && ${X} !== undefined`,()=>Z.assign(Q,P0._`${X} === true ? true : ${Q} > ${X} ? ${Q} : ${X}`)),mergeToName:(Z,X,Q)=>Z.if(P0._`${Q} !== true`,()=>Z.assign(Q,X===!0?!0:P0._`${Q} > ${X} ? ${Q} : ${X}`)),mergeValues:(Z,X)=>Z===!0?!0:Math.max(Z,X),resultToName:(Z,X)=>Z.var("items",X)})};function PV(Z,X){if(X===!0)return Z.var("props",!0);let Q=Z.var("props",P0._`{}`);if(X!==void 0)xQ(Z,Q,X);return Q}SV.evaluatedPropsToName=PV;function xQ(Z,X,Q){Object.keys(Q).forEach((J)=>Z.assign(P0._`${X}${(0,P0.getProperty)(J)}`,!0))}SV.setEvaluated=xQ;var jV={};function bO(Z,X){return Z.scopeValue("func",{ref:X,code:jV[X.code]||(jV[X.code]=new EO._Code(X.code))})}SV.useFunc=bO;var _Q;(function(Z){Z[Z.Num=0]="Num",Z[Z.Str=1]="Str"})(_Q||(SV.Type=_Q={}));function vO(Z,X,Q){if(Z instanceof P0.Name){let J=X===_Q.Num;return Q?J?P0._`"[" + ${Z} + "]"`:P0._`"['" + ${Z} + "']"`:J?P0._`"/" + ${Z}`:P0._`"/" + ${Z}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return Q?(0,P0.getProperty)(Z).toString():"/"+kQ(Z)}SV.getErrorPath=vO;function CV(Z,X,Q=Z.opts.strictSchema){if(!Q)return;if(X=`strict mode: ${X}`,Q===!0)throw Error(X);Z.self.logger.warn(X)}SV.checkStrictMode=CV});var c6=C((kV)=>{Object.defineProperty(kV,"__esModule",{value:!0});var Y6=L0(),eO={data:new Y6.Name("data"),valCxt:new Y6.Name("valCxt"),instancePath:new Y6.Name("instancePath"),parentData:new Y6.Name("parentData"),parentDataProperty:new Y6.Name("parentDataProperty"),rootData:new Y6.Name("rootData"),dynamicAnchors:new Y6.Name("dynamicAnchors"),vErrors:new Y6.Name("vErrors"),errors:new Y6.Name("errors"),this:new Y6.Name("this"),self:new Y6.Name("self"),scope:new Y6.Name("scope"),json:new Y6.Name("json"),jsonPos:new Y6.Name("jsonPos"),jsonLen:new Y6.Name("jsonLen"),jsonPart:new Y6.Name("jsonPart")};kV.default=eO});var F8=C((yV)=>{Object.defineProperty(yV,"__esModule",{value:!0});yV.extendErrors=yV.resetErrorsCount=yV.reportExtraError=yV.reportError=yV.keyword$DataError=yV.keywordError=void 0;var j0=L0(),LZ=A0(),B6=c6();yV.keywordError={message:({keyword:Z})=>j0.str`must pass "${Z}" keyword validation`};yV.keyword$DataError={message:({keyword:Z,schemaType:X})=>X?j0.str`"${Z}" keyword must be ${X} ($data)`:j0.str`"${Z}" keyword is invalid ($data)`};function XE(Z,X=yV.keywordError,Q,J){let{it:W}=Z,{gen:G,compositeRule:Y,allErrors:$}=W,z=vV(Z,X,Q);if(J!==null&&J!==void 0?J:Y||$)xV(G,z);else bV(W,j0._`[${z}]`)}yV.reportError=XE;function QE(Z,X=yV.keywordError,Q){let{it:J}=Z,{gen:W,compositeRule:G,allErrors:Y}=J,$=vV(Z,X,Q);if(xV(W,$),!(G||Y))bV(J,B6.default.vErrors)}yV.reportExtraError=QE;function JE(Z,X){Z.assign(B6.default.errors,X),Z.if(j0._`${B6.default.vErrors} !== null`,()=>Z.if(X,()=>Z.assign(j0._`${B6.default.vErrors}.length`,X),()=>Z.assign(B6.default.vErrors,null)))}yV.resetErrorsCount=JE;function WE({gen:Z,keyword:X,schemaValue:Q,data:J,errsCount:W,it:G}){if(W===void 0)throw Error("ajv implementation error");let Y=Z.name("err");Z.forRange("i",W,B6.default.errors,($)=>{if(Z.const(Y,j0._`${B6.default.vErrors}[${$}]`),Z.if(j0._`${Y}.instancePath === undefined`,()=>Z.assign(j0._`${Y}.instancePath`,(0,j0.strConcat)(B6.default.instancePath,G.errorPath))),Z.assign(j0._`${Y}.schemaPath`,j0.str`${G.errSchemaPath}/${X}`),G.opts.verbose)Z.assign(j0._`${Y}.schema`,Q),Z.assign(j0._`${Y}.data`,J)})}yV.extendErrors=WE;function xV(Z,X){let Q=Z.const("err",X);Z.if(j0._`${B6.default.vErrors} === null`,()=>Z.assign(B6.default.vErrors,j0._`[${Q}]`),j0._`${B6.default.vErrors}.push(${Q})`),Z.code(j0._`${B6.default.errors}++`)}function bV(Z,X){let{gen:Q,validateName:J,schemaEnv:W}=Z;if(W.$async)Q.throw(j0._`new ${Z.ValidationError}(${X})`);else Q.assign(j0._`${J}.errors`,X),Q.return(!1)}var k4={keyword:new j0.Name("keyword"),schemaPath:new j0.Name("schemaPath"),params:new j0.Name("params"),propertyName:new j0.Name("propertyName"),message:new j0.Name("message"),schema:new j0.Name("schema"),parentSchema:new j0.Name("parentSchema")};function vV(Z,X,Q){let{createErrors:J}=Z.it;if(J===!1)return j0._`{}`;return GE(Z,X,Q)}function GE(Z,X,Q={}){let{gen:J,it:W}=Z,G=[YE(W,Q),$E(Z,Q)];return zE(Z,X,G),J.object(...G)}function YE({errorPath:Z},{instancePath:X}){let Q=X?j0.str`${Z}${(0,LZ.getErrorPath)(X,LZ.Type.Str)}`:Z;return[B6.default.instancePath,(0,j0.strConcat)(B6.default.instancePath,Q)]}function $E({keyword:Z,it:{errSchemaPath:X}},{schemaPath:Q,parentSchema:J}){let W=J?X:j0.str`${X}/${Z}`;if(Q)W=j0.str`${W}${(0,LZ.getErrorPath)(Q,LZ.Type.Str)}`;return[k4.schemaPath,W]}function zE(Z,{params:X,message:Q},J){let{keyword:W,data:G,schemaValue:Y,it:$}=Z,{opts:z,propertyName:U,topSchemaRef:V,schemaPath:q}=$;if(J.push([k4.keyword,W],[k4.params,typeof X=="function"?X(Z):X||j0._`{}`]),z.messages)J.push([k4.message,typeof Q=="function"?Q(Z):Q]);if(z.verbose)J.push([k4.schema,Y],[k4.parentSchema,j0._`${V}${q}`],[B6.default.data,G]);if(U)J.push([k4.propertyName,U])}});var mV=C((hV)=>{Object.defineProperty(hV,"__esModule",{value:!0});hV.boolOrEmptySchema=hV.topBoolOrEmptySchema=void 0;var qE=F8(),BE=L0(),FE=c6(),LE={message:"boolean schema is false"};function ME(Z){let{gen:X,schema:Q,validateName:J}=Z;if(Q===!1)fV(Z,!1);else if(typeof Q=="object"&&Q.$async===!0)X.return(FE.default.data);else X.assign(BE._`${J}.errors`,null),X.return(!0)}hV.topBoolOrEmptySchema=ME;function AE(Z,X){let{gen:Q,schema:J}=Z;if(J===!1)Q.var(X,!1),fV(Z);else Q.var(X,!0)}hV.boolOrEmptySchema=AE;function fV(Z,X){let{gen:Q,data:J}=Z,W={gen:Q,keyword:"false schema",data:J,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:Z};(0,qE.reportError)(W,LE,void 0,X)}});var vQ=C((dV)=>{Object.defineProperty(dV,"__esModule",{value:!0});dV.getRules=dV.isJSONType=void 0;var NE=["string","number","integer","boolean","null","object","array"],DE=new Set(NE);function TE(Z){return typeof Z=="string"&&DE.has(Z)}dV.isJSONType=TE;function wE(){let Z={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...Z,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},Z.number,Z.string,Z.array,Z.object],post:{rules:[]},all:{},keywords:{}}}dV.getRules=wE});var yQ=C((iV)=>{Object.defineProperty(iV,"__esModule",{value:!0});iV.shouldUseRule=iV.shouldUseGroup=iV.schemaHasRulesForType=void 0;function OE({schema:Z,self:X},Q){let J=X.RULES.types[Q];return J&&J!==!0&&cV(Z,J)}iV.schemaHasRulesForType=OE;function cV(Z,X){return X.rules.some((Q)=>pV(Z,Q))}iV.shouldUseGroup=cV;function pV(Z,X){var Q;return Z[X.keyword]!==void 0||((Q=X.definition.implements)===null||Q===void 0?void 0:Q.some((J)=>Z[J]!==void 0))}iV.shouldUseRule=pV});var L8=C((sV)=>{Object.defineProperty(sV,"__esModule",{value:!0});sV.reportTypeError=sV.checkDataTypes=sV.checkDataType=sV.coerceAndCheckDataType=sV.getJSONTypes=sV.getSchemaTypes=sV.DataType=void 0;var PE=vQ(),CE=yQ(),SE=F8(),M0=L0(),rV=A0(),D9;(function(Z){Z[Z.Correct=0]="Correct",Z[Z.Wrong=1]="Wrong"})(D9||(sV.DataType=D9={}));function _E(Z){let X=aV(Z.type);if(X.includes("null")){if(Z.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!X.length&&Z.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(Z.nullable===!0)X.push("null")}return X}sV.getSchemaTypes=_E;function aV(Z){let X=Array.isArray(Z)?Z:Z?[Z]:[];if(X.every(PE.isJSONType))return X;throw Error("type must be JSONType or JSONType[]: "+X.join(","))}sV.getJSONTypes=aV;function kE(Z,X){let{gen:Q,data:J,opts:W}=Z,G=xE(X,W.coerceTypes),Y=X.length>0&&!(G.length===0&&X.length===1&&(0,CE.schemaHasRulesForType)(Z,X[0]));if(Y){let $=fQ(X,J,W.strictNumbers,D9.Wrong);Q.if($,()=>{if(G.length)bE(Z,X,G);else hQ(Z)})}return Y}sV.coerceAndCheckDataType=kE;var oV=new Set(["string","number","integer","boolean","null"]);function xE(Z,X){return X?Z.filter((Q)=>oV.has(Q)||X==="array"&&Q==="array"):[]}function bE(Z,X,Q){let{gen:J,data:W,opts:G}=Z,Y=J.let("dataType",M0._`typeof ${W}`),$=J.let("coerced",M0._`undefined`);if(G.coerceTypes==="array")J.if(M0._`${Y} == 'object' && Array.isArray(${W}) && ${W}.length == 1`,()=>J.assign(W,M0._`${W}[0]`).assign(Y,M0._`typeof ${W}`).if(fQ(X,W,G.strictNumbers),()=>J.assign($,W)));J.if(M0._`${$} !== undefined`);for(let U of Q)if(oV.has(U)||U==="array"&&G.coerceTypes==="array")z(U);J.else(),hQ(Z),J.endIf(),J.if(M0._`${$} !== undefined`,()=>{J.assign(W,$),vE(Z,$)});function z(U){switch(U){case"string":J.elseIf(M0._`${Y} == "number" || ${Y} == "boolean"`).assign($,M0._`"" + ${W}`).elseIf(M0._`${W} === null`).assign($,M0._`""`);return;case"number":J.elseIf(M0._`${Y} == "boolean" || ${W} === null
|
|
382
|
+
|| (${Y} == "string" && ${W} && ${W} == +${W})`).assign($,M0._`+${W}`);return;case"integer":J.elseIf(M0._`${Y} === "boolean" || ${W} === null
|
|
383
|
+
|| (${Y} === "string" && ${W} && ${W} == +${W} && !(${W} % 1))`).assign($,M0._`+${W}`);return;case"boolean":J.elseIf(M0._`${W} === "false" || ${W} === 0 || ${W} === null`).assign($,!1).elseIf(M0._`${W} === "true" || ${W} === 1`).assign($,!0);return;case"null":J.elseIf(M0._`${W} === "" || ${W} === 0 || ${W} === false`),J.assign($,null);return;case"array":J.elseIf(M0._`${Y} === "string" || ${Y} === "number"
|
|
384
|
+
|| ${Y} === "boolean" || ${W} === null`).assign($,M0._`[${W}]`)}}}function vE({gen:Z,parentData:X,parentDataProperty:Q},J){Z.if(M0._`${X} !== undefined`,()=>Z.assign(M0._`${X}[${Q}]`,J))}function gQ(Z,X,Q,J=D9.Correct){let W=J===D9.Correct?M0.operators.EQ:M0.operators.NEQ,G;switch(Z){case"null":return M0._`${X} ${W} null`;case"array":G=M0._`Array.isArray(${X})`;break;case"object":G=M0._`${X} && typeof ${X} == "object" && !Array.isArray(${X})`;break;case"integer":G=Y(M0._`!(${X} % 1) && !isNaN(${X})`);break;case"number":G=Y();break;default:return M0._`typeof ${X} ${W} ${Z}`}return J===D9.Correct?G:(0,M0.not)(G);function Y($=M0.nil){return(0,M0.and)(M0._`typeof ${X} == "number"`,$,Q?M0._`isFinite(${X})`:M0.nil)}}sV.checkDataType=gQ;function fQ(Z,X,Q,J){if(Z.length===1)return gQ(Z[0],X,Q,J);let W,G=(0,rV.toHash)(Z);if(G.array&&G.object){let Y=M0._`typeof ${X} != "object"`;W=G.null?Y:M0._`!${X} || ${Y}`,delete G.null,delete G.array,delete G.object}else W=M0.nil;if(G.number)delete G.integer;for(let Y in G)W=(0,M0.and)(W,gQ(Y,X,Q,J));return W}sV.checkDataTypes=fQ;var yE={message:({schema:Z})=>`must be ${Z}`,params:({schema:Z,schemaValue:X})=>typeof Z=="string"?M0._`{type: ${Z}}`:M0._`{type: ${X}}`};function hQ(Z){let X=gE(Z);(0,SE.reportError)(X,yE)}sV.reportTypeError=hQ;function gE(Z){let{gen:X,data:Q,schema:J}=Z,W=(0,rV.schemaRefOrVal)(Z,J,"type");return{gen:X,keyword:"type",data:Q,schema:J.type,schemaCode:W,schemaValue:W,parentSchema:J,params:{},it:Z}}});var QH=C((ZH)=>{Object.defineProperty(ZH,"__esModule",{value:!0});ZH.assignDefaults=void 0;var T9=L0(),cE=A0();function pE(Z,X){let{properties:Q,items:J}=Z.schema;if(X==="object"&&Q)for(let W in Q)eV(Z,W,Q[W].default);else if(X==="array"&&Array.isArray(J))J.forEach((W,G)=>eV(Z,G,W.default))}ZH.assignDefaults=pE;function eV(Z,X,Q){let{gen:J,compositeRule:W,data:G,opts:Y}=Z;if(Q===void 0)return;let $=T9._`${G}${(0,T9.getProperty)(X)}`;if(W){(0,cE.checkStrictMode)(Z,`default is ignored for: ${$}`);return}let z=T9._`${$} === undefined`;if(Y.useDefaults==="empty")z=T9._`${z} || ${$} === null || ${$} === ""`;J.if(z,T9._`${$} = ${(0,T9.stringify)(Q)}`)}});var p6=C((GH)=>{Object.defineProperty(GH,"__esModule",{value:!0});GH.validateUnion=GH.validateArray=GH.usePattern=GH.callValidateCode=GH.schemaProperties=GH.allSchemaProperties=GH.noPropertyInData=GH.propertyInData=GH.isOwnProperty=GH.hasPropFunc=GH.reportMissingProp=GH.checkMissingProp=GH.checkReportMissingProp=void 0;var x0=L0(),uQ=A0(),K4=c6(),iE=A0();function nE(Z,X){let{gen:Q,data:J,it:W}=Z;Q.if(dQ(Q,J,X,W.opts.ownProperties),()=>{Z.setParams({missingProperty:x0._`${X}`},!0),Z.error()})}GH.checkReportMissingProp=nE;function rE({gen:Z,data:X,it:{opts:Q}},J,W){return(0,x0.or)(...J.map((G)=>(0,x0.and)(dQ(Z,X,G,Q.ownProperties),x0._`${W} = ${G}`)))}GH.checkMissingProp=rE;function aE(Z,X){Z.setParams({missingProperty:X},!0),Z.error()}GH.reportMissingProp=aE;function JH(Z){return Z.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:x0._`Object.prototype.hasOwnProperty`})}GH.hasPropFunc=JH;function mQ(Z,X,Q){return x0._`${JH(Z)}.call(${X}, ${Q})`}GH.isOwnProperty=mQ;function oE(Z,X,Q,J){let W=x0._`${X}${(0,x0.getProperty)(Q)} !== undefined`;return J?x0._`${W} && ${mQ(Z,X,Q)}`:W}GH.propertyInData=oE;function dQ(Z,X,Q,J){let W=x0._`${X}${(0,x0.getProperty)(Q)} === undefined`;return J?(0,x0.or)(W,(0,x0.not)(mQ(Z,X,Q))):W}GH.noPropertyInData=dQ;function WH(Z){return Z?Object.keys(Z).filter((X)=>X!=="__proto__"):[]}GH.allSchemaProperties=WH;function sE(Z,X){return WH(X).filter((Q)=>!(0,uQ.alwaysValidSchema)(Z,X[Q]))}GH.schemaProperties=sE;function tE({schemaCode:Z,data:X,it:{gen:Q,topSchemaRef:J,schemaPath:W,errorPath:G},it:Y},$,z,U){let V=U?x0._`${Z}, ${X}, ${J}${W}`:X,q=[[K4.default.instancePath,(0,x0.strConcat)(K4.default.instancePath,G)],[K4.default.parentData,Y.parentData],[K4.default.parentDataProperty,Y.parentDataProperty],[K4.default.rootData,K4.default.rootData]];if(Y.opts.dynamicRef)q.push([K4.default.dynamicAnchors,K4.default.dynamicAnchors]);let B=x0._`${V}, ${Q.object(...q)}`;return z!==x0.nil?x0._`${$}.call(${z}, ${B})`:x0._`${$}(${B})`}GH.callValidateCode=tE;var eE=x0._`new RegExp`;function ZR({gen:Z,it:{opts:X}},Q){let J=X.unicodeRegExp?"u":"",{regExp:W}=X.code,G=W(Q,J);return Z.scopeValue("pattern",{key:G.toString(),ref:G,code:x0._`${W.code==="new RegExp"?eE:(0,iE.useFunc)(Z,W)}(${Q}, ${J})`})}GH.usePattern=ZR;function XR(Z){let{gen:X,data:Q,keyword:J,it:W}=Z,G=X.name("valid");if(W.allErrors){let $=X.let("valid",!0);return Y(()=>X.assign($,!1)),$}return X.var(G,!0),Y(()=>X.break()),G;function Y($){let z=X.const("len",x0._`${Q}.length`);X.forRange("i",0,z,(U)=>{Z.subschema({keyword:J,dataProp:U,dataPropType:uQ.Type.Num},G),X.if((0,x0.not)(G),$)})}}GH.validateArray=XR;function QR(Z){let{gen:X,schema:Q,keyword:J,it:W}=Z;if(!Array.isArray(Q))throw Error("ajv implementation error");if(Q.some((z)=>(0,uQ.alwaysValidSchema)(W,z))&&!W.opts.unevaluated)return;let Y=X.let("valid",!1),$=X.name("_valid");X.block(()=>Q.forEach((z,U)=>{let V=Z.subschema({keyword:J,schemaProp:U,compositeRule:!0},$);if(X.assign(Y,x0._`${Y} || ${$}`),!Z.mergeValidEvaluated(V,$))X.if((0,x0.not)(Y))})),Z.result(Y,()=>Z.reset(),()=>Z.error(!0))}GH.validateUnion=QR});var VH=C((UH)=>{Object.defineProperty(UH,"__esModule",{value:!0});UH.validateKeywordUsage=UH.validSchemaType=UH.funcKeywordCode=UH.macroKeywordCode=void 0;var F6=L0(),x4=c6(),FR=p6(),LR=F8();function MR(Z,X){let{gen:Q,keyword:J,schema:W,parentSchema:G,it:Y}=Z,$=X.macro.call(Y.self,W,G,Y),z=zH(Q,J,$);if(Y.opts.validateSchema!==!1)Y.self.validateSchema($,!0);let U=Q.name("valid");Z.subschema({schema:$,schemaPath:F6.nil,errSchemaPath:`${Y.errSchemaPath}/${J}`,topSchemaRef:z,compositeRule:!0},U),Z.pass(U,()=>Z.error(!0))}UH.macroKeywordCode=MR;function AR(Z,X){var Q;let{gen:J,keyword:W,schema:G,parentSchema:Y,$data:$,it:z}=Z;NR(z,X);let U=!$&&X.compile?X.compile.call(z.self,G,Y,z):X.validate,V=zH(J,W,U),q=J.let("valid");Z.block$data(q,B),Z.ok((Q=X.valid)!==null&&Q!==void 0?Q:q);function B(){if(X.errors===!1){if(I(),X.modifying)$H(Z);A(()=>Z.error())}else{let N=X.async?F():L();if(X.modifying)$H(Z);A(()=>IR(Z,N))}}function F(){let N=J.let("ruleErrs",null);return J.try(()=>I(F6._`await `),(D)=>J.assign(q,!1).if(F6._`${D} instanceof ${z.ValidationError}`,()=>J.assign(N,F6._`${D}.errors`),()=>J.throw(D))),N}function L(){let N=F6._`${V}.errors`;return J.assign(N,null),I(F6.nil),N}function I(N=X.async?F6._`await `:F6.nil){let D=z.opts.passContext?x4.default.this:x4.default.self,O=!(("compile"in X)&&!$||X.schema===!1);J.assign(q,F6._`${N}${(0,FR.callValidateCode)(Z,V,D,O)}`,X.modifying)}function A(N){var D;J.if((0,F6.not)((D=X.valid)!==null&&D!==void 0?D:q),N)}}UH.funcKeywordCode=AR;function $H(Z){let{gen:X,data:Q,it:J}=Z;X.if(J.parentData,()=>X.assign(Q,F6._`${J.parentData}[${J.parentDataProperty}]`))}function IR(Z,X){let{gen:Q}=Z;Q.if(F6._`Array.isArray(${X})`,()=>{Q.assign(x4.default.vErrors,F6._`${x4.default.vErrors} === null ? ${X} : ${x4.default.vErrors}.concat(${X})`).assign(x4.default.errors,F6._`${x4.default.vErrors}.length`),(0,LR.extendErrors)(Z)},()=>Z.error())}function NR({schemaEnv:Z},X){if(X.async&&!Z.$async)throw Error("async keyword in sync schema")}function zH(Z,X,Q){if(Q===void 0)throw Error(`keyword "${X}" failed to compile`);return Z.scopeValue("keyword",typeof Q=="function"?{ref:Q}:{ref:Q,code:(0,F6.stringify)(Q)})}function DR(Z,X,Q=!1){return!X.length||X.some((J)=>J==="array"?Array.isArray(Z):J==="object"?Z&&typeof Z=="object"&&!Array.isArray(Z):typeof Z==J||Q&&typeof Z>"u")}UH.validSchemaType=DR;function TR({schema:Z,opts:X,self:Q,errSchemaPath:J},W,G){if(Array.isArray(W.keyword)?!W.keyword.includes(G):W.keyword!==G)throw Error("ajv implementation error");let Y=W.dependencies;if(Y===null||Y===void 0?void 0:Y.some(($)=>!Object.prototype.hasOwnProperty.call(Z,$)))throw Error(`parent schema must have dependencies of ${G}: ${Y.join(",")}`);if(W.validateSchema){if(!W.validateSchema(Z[G])){let z=`keyword "${G}" value is invalid at path "${J}": `+Q.errorsText(W.validateSchema.errors);if(X.validateSchema==="log")Q.logger.error(z);else throw Error(z)}}}UH.validateKeywordUsage=TR});var FH=C((qH)=>{Object.defineProperty(qH,"__esModule",{value:!0});qH.extendSubschemaMode=qH.extendSubschemaData=qH.getSubschema=void 0;var A1=L0(),HH=A0();function ER(Z,{keyword:X,schemaProp:Q,schema:J,schemaPath:W,errSchemaPath:G,topSchemaRef:Y}){if(X!==void 0&&J!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(X!==void 0){let $=Z.schema[X];return Q===void 0?{schema:$,schemaPath:A1._`${Z.schemaPath}${(0,A1.getProperty)(X)}`,errSchemaPath:`${Z.errSchemaPath}/${X}`}:{schema:$[Q],schemaPath:A1._`${Z.schemaPath}${(0,A1.getProperty)(X)}${(0,A1.getProperty)(Q)}`,errSchemaPath:`${Z.errSchemaPath}/${X}/${(0,HH.escapeFragment)(Q)}`}}if(J!==void 0){if(W===void 0||G===void 0||Y===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:J,schemaPath:W,topSchemaRef:Y,errSchemaPath:G}}throw Error('either "keyword" or "schema" must be passed')}qH.getSubschema=ER;function RR(Z,X,{dataProp:Q,dataPropType:J,data:W,dataTypes:G,propertyName:Y}){if(W!==void 0&&Q!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:$}=X;if(Q!==void 0){let{errorPath:U,dataPathArr:V,opts:q}=X,B=$.let("data",A1._`${X.data}${(0,A1.getProperty)(Q)}`,!0);z(B),Z.errorPath=A1.str`${U}${(0,HH.getErrorPath)(Q,J,q.jsPropertySyntax)}`,Z.parentDataProperty=A1._`${Q}`,Z.dataPathArr=[...V,Z.parentDataProperty]}if(W!==void 0){let U=W instanceof A1.Name?W:$.let("data",W,!0);if(z(U),Y!==void 0)Z.propertyName=Y}if(G)Z.dataTypes=G;function z(U){Z.data=U,Z.dataLevel=X.dataLevel+1,Z.dataTypes=[],X.definedProperties=new Set,Z.parentData=X.data,Z.dataNames=[...X.dataNames,U]}}qH.extendSubschemaData=RR;function PR(Z,{jtdDiscriminator:X,jtdMetadata:Q,compositeRule:J,createErrors:W,allErrors:G}){if(J!==void 0)Z.compositeRule=J;if(W!==void 0)Z.createErrors=W;if(G!==void 0)Z.allErrors=G;Z.jtdDiscriminator=X,Z.jtdMetadata=Q}qH.extendSubschemaMode=PR});var lQ=C((zm,LH)=>{LH.exports=function Z(X,Q){if(X===Q)return!0;if(X&&Q&&typeof X=="object"&&typeof Q=="object"){if(X.constructor!==Q.constructor)return!1;var J,W,G;if(Array.isArray(X)){if(J=X.length,J!=Q.length)return!1;for(W=J;W--!==0;)if(!Z(X[W],Q[W]))return!1;return!0}if(X.constructor===RegExp)return X.source===Q.source&&X.flags===Q.flags;if(X.valueOf!==Object.prototype.valueOf)return X.valueOf()===Q.valueOf();if(X.toString!==Object.prototype.toString)return X.toString()===Q.toString();if(G=Object.keys(X),J=G.length,J!==Object.keys(Q).length)return!1;for(W=J;W--!==0;)if(!Object.prototype.hasOwnProperty.call(Q,G[W]))return!1;for(W=J;W--!==0;){var Y=G[W];if(!Z(X[Y],Q[Y]))return!1}return!0}return X!==X&&Q!==Q}});var AH=C((Um,MH)=>{var V4=MH.exports=function(Z,X,Q){if(typeof X=="function")Q=X,X={};Q=X.cb||Q;var J=typeof Q=="function"?Q:Q.pre||function(){},W=Q.post||function(){};MZ(X,J,W,Z,"",Z)};V4.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};V4.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};V4.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};V4.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function MZ(Z,X,Q,J,W,G,Y,$,z,U){if(J&&typeof J=="object"&&!Array.isArray(J)){X(J,W,G,Y,$,z,U);for(var V in J){var q=J[V];if(Array.isArray(q)){if(V in V4.arrayKeywords)for(var B=0;B<q.length;B++)MZ(Z,X,Q,q[B],W+"/"+V+"/"+B,G,W,V,J,B)}else if(V in V4.propsKeywords){if(q&&typeof q=="object")for(var F in q)MZ(Z,X,Q,q[F],W+"/"+V+"/"+_R(F),G,W,V,J,F)}else if(V in V4.keywords||Z.allKeys&&!(V in V4.skipKeywords))MZ(Z,X,Q,q,W+"/"+V,G,W,V,J)}Q(J,W,G,Y,$,z,U)}}function _R(Z){return Z.replace(/~/g,"~0").replace(/\//g,"~1")}});var M8=C((TH)=>{Object.defineProperty(TH,"__esModule",{value:!0});TH.getSchemaRefs=TH.resolveUrl=TH.normalizeId=TH._getFullPath=TH.getFullPath=TH.inlineRef=void 0;var kR=A0(),xR=lQ(),bR=AH(),vR=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function yR(Z,X=!0){if(typeof Z=="boolean")return!0;if(X===!0)return!cQ(Z);if(!X)return!1;return IH(Z)<=X}TH.inlineRef=yR;var gR=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function cQ(Z){for(let X in Z){if(gR.has(X))return!0;let Q=Z[X];if(Array.isArray(Q)&&Q.some(cQ))return!0;if(typeof Q=="object"&&cQ(Q))return!0}return!1}function IH(Z){let X=0;for(let Q in Z){if(Q==="$ref")return 1/0;if(X++,vR.has(Q))continue;if(typeof Z[Q]=="object")(0,kR.eachItem)(Z[Q],(J)=>X+=IH(J));if(X===1/0)return 1/0}return X}function NH(Z,X="",Q){if(Q!==!1)X=w9(X);let J=Z.parse(X);return DH(Z,J)}TH.getFullPath=NH;function DH(Z,X){return Z.serialize(X).split("#")[0]+"#"}TH._getFullPath=DH;var fR=/#\/?$/;function w9(Z){return Z?Z.replace(fR,""):""}TH.normalizeId=w9;function hR(Z,X,Q){return Q=w9(Q),Z.resolve(X,Q)}TH.resolveUrl=hR;var uR=/^[a-z_][-a-z0-9._]*$/i;function mR(Z,X){if(typeof Z=="boolean")return{};let{schemaId:Q,uriResolver:J}=this.opts,W=w9(Z[Q]||X),G={"":W},Y=NH(J,W,!1),$={},z=new Set;return bR(Z,{allKeys:!0},(q,B,F,L)=>{if(L===void 0)return;let I=Y+B,A=G[L];if(typeof q[Q]=="string")A=N.call(this,q[Q]);D.call(this,q.$anchor),D.call(this,q.$dynamicAnchor),G[B]=A;function N(O){let T=this.opts.uriResolver.resolve;if(O=w9(A?T(A,O):O),z.has(O))throw V(O);z.add(O);let w=this.refs[O];if(typeof w=="string")w=this.refs[w];if(typeof w=="object")U(q,w.schema,O);else if(O!==w9(I))if(O[0]==="#")U(q,$[O],O),$[O]=q;else this.refs[O]=I;return O}function D(O){if(typeof O=="string"){if(!uR.test(O))throw Error(`invalid anchor "${O}"`);N.call(this,`#${O}`)}}}),$;function U(q,B,F){if(B!==void 0&&!xR(q,B))throw V(F)}function V(q){return Error(`reference "${q}" resolves to more than one schema`)}}TH.getSchemaRefs=mR});var N8=C((fH)=>{Object.defineProperty(fH,"__esModule",{value:!0});fH.getData=fH.KeywordCxt=fH.validateFunctionCode=void 0;var PH=mV(),jH=L8(),iQ=yQ(),AZ=L8(),nR=QH(),I8=VH(),pQ=FH(),U0=L0(),q0=c6(),rR=M8(),u1=A0(),A8=F8();function aR(Z){if(_H(Z)){if(kH(Z),SH(Z)){tR(Z);return}}CH(Z,()=>(0,PH.topBoolOrEmptySchema)(Z))}fH.validateFunctionCode=aR;function CH({gen:Z,validateName:X,schema:Q,schemaEnv:J,opts:W},G){if(W.code.es5)Z.func(X,U0._`${q0.default.data}, ${q0.default.valCxt}`,J.$async,()=>{Z.code(U0._`"use strict"; ${OH(Q,W)}`),sR(Z,W),Z.code(G)});else Z.func(X,U0._`${q0.default.data}, ${oR(W)}`,J.$async,()=>Z.code(OH(Q,W)).code(G))}function oR(Z){return U0._`{${q0.default.instancePath}="", ${q0.default.parentData}, ${q0.default.parentDataProperty}, ${q0.default.rootData}=${q0.default.data}${Z.dynamicRef?U0._`, ${q0.default.dynamicAnchors}={}`:U0.nil}}={}`}function sR(Z,X){Z.if(q0.default.valCxt,()=>{if(Z.var(q0.default.instancePath,U0._`${q0.default.valCxt}.${q0.default.instancePath}`),Z.var(q0.default.parentData,U0._`${q0.default.valCxt}.${q0.default.parentData}`),Z.var(q0.default.parentDataProperty,U0._`${q0.default.valCxt}.${q0.default.parentDataProperty}`),Z.var(q0.default.rootData,U0._`${q0.default.valCxt}.${q0.default.rootData}`),X.dynamicRef)Z.var(q0.default.dynamicAnchors,U0._`${q0.default.valCxt}.${q0.default.dynamicAnchors}`)},()=>{if(Z.var(q0.default.instancePath,U0._`""`),Z.var(q0.default.parentData,U0._`undefined`),Z.var(q0.default.parentDataProperty,U0._`undefined`),Z.var(q0.default.rootData,q0.default.data),X.dynamicRef)Z.var(q0.default.dynamicAnchors,U0._`{}`)})}function tR(Z){let{schema:X,opts:Q,gen:J}=Z;CH(Z,()=>{if(Q.$comment&&X.$comment)bH(Z);if(JP(Z),J.let(q0.default.vErrors,null),J.let(q0.default.errors,0),Q.unevaluated)eR(Z);xH(Z),YP(Z)});return}function eR(Z){let{gen:X,validateName:Q}=Z;Z.evaluated=X.const("evaluated",U0._`${Q}.evaluated`),X.if(U0._`${Z.evaluated}.dynamicProps`,()=>X.assign(U0._`${Z.evaluated}.props`,U0._`undefined`)),X.if(U0._`${Z.evaluated}.dynamicItems`,()=>X.assign(U0._`${Z.evaluated}.items`,U0._`undefined`))}function OH(Z,X){let Q=typeof Z=="object"&&Z[X.schemaId];return Q&&(X.code.source||X.code.process)?U0._`/*# sourceURL=${Q} */`:U0.nil}function ZP(Z,X){if(_H(Z)){if(kH(Z),SH(Z)){XP(Z,X);return}}(0,PH.boolOrEmptySchema)(Z,X)}function SH({schema:Z,self:X}){if(typeof Z=="boolean")return!Z;for(let Q in Z)if(X.RULES.all[Q])return!0;return!1}function _H(Z){return typeof Z.schema!="boolean"}function XP(Z,X){let{schema:Q,gen:J,opts:W}=Z;if(W.$comment&&Q.$comment)bH(Z);WP(Z),GP(Z);let G=J.const("_errs",q0.default.errors);xH(Z,G),J.var(X,U0._`${G} === ${q0.default.errors}`)}function kH(Z){(0,u1.checkUnknownRules)(Z),QP(Z)}function xH(Z,X){if(Z.opts.jtd)return EH(Z,[],!1,X);let Q=(0,jH.getSchemaTypes)(Z.schema),J=(0,jH.coerceAndCheckDataType)(Z,Q);EH(Z,Q,!J,X)}function QP(Z){let{schema:X,errSchemaPath:Q,opts:J,self:W}=Z;if(X.$ref&&J.ignoreKeywordsWithRef&&(0,u1.schemaHasRulesButRef)(X,W.RULES))W.logger.warn(`$ref: keywords ignored in schema at path "${Q}"`)}function JP(Z){let{schema:X,opts:Q}=Z;if(X.default!==void 0&&Q.useDefaults&&Q.strictSchema)(0,u1.checkStrictMode)(Z,"default is ignored in the schema root")}function WP(Z){let X=Z.schema[Z.opts.schemaId];if(X)Z.baseId=(0,rR.resolveUrl)(Z.opts.uriResolver,Z.baseId,X)}function GP(Z){if(Z.schema.$async&&!Z.schemaEnv.$async)throw Error("async schema in sync schema")}function bH({gen:Z,schemaEnv:X,schema:Q,errSchemaPath:J,opts:W}){let G=Q.$comment;if(W.$comment===!0)Z.code(U0._`${q0.default.self}.logger.log(${G})`);else if(typeof W.$comment=="function"){let Y=U0.str`${J}/$comment`,$=Z.scopeValue("root",{ref:X.root});Z.code(U0._`${q0.default.self}.opts.$comment(${G}, ${Y}, ${$}.schema)`)}}function YP(Z){let{gen:X,schemaEnv:Q,validateName:J,ValidationError:W,opts:G}=Z;if(Q.$async)X.if(U0._`${q0.default.errors} === 0`,()=>X.return(q0.default.data),()=>X.throw(U0._`new ${W}(${q0.default.vErrors})`));else{if(X.assign(U0._`${J}.errors`,q0.default.vErrors),G.unevaluated)$P(Z);X.return(U0._`${q0.default.errors} === 0`)}}function $P({gen:Z,evaluated:X,props:Q,items:J}){if(Q instanceof U0.Name)Z.assign(U0._`${X}.props`,Q);if(J instanceof U0.Name)Z.assign(U0._`${X}.items`,J)}function EH(Z,X,Q,J){let{gen:W,schema:G,data:Y,allErrors:$,opts:z,self:U}=Z,{RULES:V}=U;if(G.$ref&&(z.ignoreKeywordsWithRef||!(0,u1.schemaHasRulesButRef)(G,V))){W.block(()=>yH(Z,"$ref",V.all.$ref.definition));return}if(!z.jtd)zP(Z,X);W.block(()=>{for(let B of V.rules)q(B);q(V.post)});function q(B){if(!(0,iQ.shouldUseGroup)(G,B))return;if(B.type){if(W.if((0,AZ.checkDataType)(B.type,Y,z.strictNumbers)),RH(Z,B),X.length===1&&X[0]===B.type&&Q)W.else(),(0,AZ.reportTypeError)(Z);W.endIf()}else RH(Z,B);if(!$)W.if(U0._`${q0.default.errors} === ${J||0}`)}}function RH(Z,X){let{gen:Q,schema:J,opts:{useDefaults:W}}=Z;if(W)(0,nR.assignDefaults)(Z,X.type);Q.block(()=>{for(let G of X.rules)if((0,iQ.shouldUseRule)(J,G))yH(Z,G.keyword,G.definition,X.type)})}function zP(Z,X){if(Z.schemaEnv.meta||!Z.opts.strictTypes)return;if(UP(Z,X),!Z.opts.allowUnionTypes)KP(Z,X);VP(Z,Z.dataTypes)}function UP(Z,X){if(!X.length)return;if(!Z.dataTypes.length){Z.dataTypes=X;return}X.forEach((Q)=>{if(!vH(Z.dataTypes,Q))nQ(Z,`type "${Q}" not allowed by context "${Z.dataTypes.join(",")}"`)}),qP(Z,X)}function KP(Z,X){if(X.length>1&&!(X.length===2&&X.includes("null")))nQ(Z,"use allowUnionTypes to allow union type keyword")}function VP(Z,X){let Q=Z.self.RULES.all;for(let J in Q){let W=Q[J];if(typeof W=="object"&&(0,iQ.shouldUseRule)(Z.schema,W)){let{type:G}=W.definition;if(G.length&&!G.some((Y)=>HP(X,Y)))nQ(Z,`missing type "${G.join(",")}" for keyword "${J}"`)}}}function HP(Z,X){return Z.includes(X)||X==="number"&&Z.includes("integer")}function vH(Z,X){return Z.includes(X)||X==="integer"&&Z.includes("number")}function qP(Z,X){let Q=[];for(let J of Z.dataTypes)if(vH(X,J))Q.push(J);else if(X.includes("integer")&&J==="number")Q.push("integer");Z.dataTypes=Q}function nQ(Z,X){let Q=Z.schemaEnv.baseId+Z.errSchemaPath;X+=` at "${Q}" (strictTypes)`,(0,u1.checkStrictMode)(Z,X,Z.opts.strictTypes)}class rQ{constructor(Z,X,Q){if((0,I8.validateKeywordUsage)(Z,X,Q),this.gen=Z.gen,this.allErrors=Z.allErrors,this.keyword=Q,this.data=Z.data,this.schema=Z.schema[Q],this.$data=X.$data&&Z.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,u1.schemaRefOrVal)(Z,this.schema,Q,this.$data),this.schemaType=X.schemaType,this.parentSchema=Z.schema,this.params={},this.it=Z,this.def=X,this.$data)this.schemaCode=Z.gen.const("vSchema",gH(this.$data,Z));else if(this.schemaCode=this.schemaValue,!(0,I8.validSchemaType)(this.schema,X.schemaType,X.allowUndefined))throw Error(`${Q} value must be ${JSON.stringify(X.schemaType)}`);if("code"in X?X.trackErrors:X.errors!==!1)this.errsCount=Z.gen.const("_errs",q0.default.errors)}result(Z,X,Q){this.failResult((0,U0.not)(Z),X,Q)}failResult(Z,X,Q){if(this.gen.if(Z),Q)Q();else this.error();if(X){if(this.gen.else(),X(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(Z,X){this.failResult((0,U0.not)(Z),void 0,X)}fail(Z){if(Z===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(Z),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(Z){if(!this.$data)return this.fail(Z);let{schemaCode:X}=this;this.fail(U0._`${X} !== undefined && (${(0,U0.or)(this.invalid$data(),Z)})`)}error(Z,X,Q){if(X){this.setParams(X),this._error(Z,Q),this.setParams({});return}this._error(Z,Q)}_error(Z,X){(Z?A8.reportExtraError:A8.reportError)(this,this.def.error,X)}$dataError(){(0,A8.reportError)(this,this.def.$dataError||A8.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,A8.resetErrorsCount)(this.gen,this.errsCount)}ok(Z){if(!this.allErrors)this.gen.if(Z)}setParams(Z,X){if(X)Object.assign(this.params,Z);else this.params=Z}block$data(Z,X,Q=U0.nil){this.gen.block(()=>{this.check$data(Z,Q),X()})}check$data(Z=U0.nil,X=U0.nil){if(!this.$data)return;let{gen:Q,schemaCode:J,schemaType:W,def:G}=this;if(Q.if((0,U0.or)(U0._`${J} === undefined`,X)),Z!==U0.nil)Q.assign(Z,!0);if(W.length||G.validateSchema){if(Q.elseIf(this.invalid$data()),this.$dataError(),Z!==U0.nil)Q.assign(Z,!1)}Q.else()}invalid$data(){let{gen:Z,schemaCode:X,schemaType:Q,def:J,it:W}=this;return(0,U0.or)(G(),Y());function G(){if(Q.length){if(!(X instanceof U0.Name))throw Error("ajv implementation error");let $=Array.isArray(Q)?Q:[Q];return U0._`${(0,AZ.checkDataTypes)($,X,W.opts.strictNumbers,AZ.DataType.Wrong)}`}return U0.nil}function Y(){if(J.validateSchema){let $=Z.scopeValue("validate$data",{ref:J.validateSchema});return U0._`!${$}(${X})`}return U0.nil}}subschema(Z,X){let Q=(0,pQ.getSubschema)(this.it,Z);(0,pQ.extendSubschemaData)(Q,this.it,Z),(0,pQ.extendSubschemaMode)(Q,Z);let J={...this.it,...Q,items:void 0,props:void 0};return ZP(J,X),J}mergeEvaluated(Z,X){let{it:Q,gen:J}=this;if(!Q.opts.unevaluated)return;if(Q.props!==!0&&Z.props!==void 0)Q.props=u1.mergeEvaluated.props(J,Z.props,Q.props,X);if(Q.items!==!0&&Z.items!==void 0)Q.items=u1.mergeEvaluated.items(J,Z.items,Q.items,X)}mergeValidEvaluated(Z,X){let{it:Q,gen:J}=this;if(Q.opts.unevaluated&&(Q.props!==!0||Q.items!==!0))return J.if(X,()=>this.mergeEvaluated(Z,U0.Name)),!0}}fH.KeywordCxt=rQ;function yH(Z,X,Q,J){let W=new rQ(Z,Q,X);if("code"in Q)Q.code(W,J);else if(W.$data&&Q.validate)(0,I8.funcKeywordCode)(W,Q);else if("macro"in Q)(0,I8.macroKeywordCode)(W,Q);else if(Q.compile||Q.validate)(0,I8.funcKeywordCode)(W,Q)}var BP=/^\/(?:[^~]|~0|~1)*$/,FP=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function gH(Z,{dataLevel:X,dataNames:Q,dataPathArr:J}){let W,G;if(Z==="")return q0.default.rootData;if(Z[0]==="/"){if(!BP.test(Z))throw Error(`Invalid JSON-pointer: ${Z}`);W=Z,G=q0.default.rootData}else{let U=FP.exec(Z);if(!U)throw Error(`Invalid JSON-pointer: ${Z}`);let V=+U[1];if(W=U[2],W==="#"){if(V>=X)throw Error(z("property/index",V));return J[X-V]}if(V>X)throw Error(z("data",V));if(G=Q[X-V],!W)return G}let Y=G,$=W.split("/");for(let U of $)if(U)G=U0._`${G}${(0,U0.getProperty)((0,u1.unescapeJsonPointer)(U))}`,Y=U0._`${Y} && ${G}`;return Y;function z(U,V){return`Cannot access ${U} ${V} levels up, current level is ${X}`}}fH.getData=gH});var IZ=C((mH)=>{Object.defineProperty(mH,"__esModule",{value:!0});class uH extends Error{constructor(Z){super("validation failed");this.errors=Z,this.ajv=this.validation=!0}}mH.default=uH});var D8=C((lH)=>{Object.defineProperty(lH,"__esModule",{value:!0});var aQ=M8();class dH extends Error{constructor(Z,X,Q,J){super(J||`can't resolve reference ${Q} from id ${X}`);this.missingRef=(0,aQ.resolveUrl)(Z,X,Q),this.missingSchema=(0,aQ.normalizeId)((0,aQ.getFullPath)(Z,this.missingRef))}}lH.default=dH});var w8=C((iH)=>{Object.defineProperty(iH,"__esModule",{value:!0});iH.resolveSchema=iH.getCompilingSchema=iH.resolveRef=iH.compileSchema=iH.SchemaEnv=void 0;var e6=L0(),NP=IZ(),b4=c6(),Z1=M8(),cH=A0(),DP=N8();class T8{constructor(Z){var X;this.refs={},this.dynamicAnchors={};let Q;if(typeof Z.schema=="object")Q=Z.schema;this.schema=Z.schema,this.schemaId=Z.schemaId,this.root=Z.root||this,this.baseId=(X=Z.baseId)!==null&&X!==void 0?X:(0,Z1.normalizeId)(Q===null||Q===void 0?void 0:Q[Z.schemaId||"$id"]),this.schemaPath=Z.schemaPath,this.localRefs=Z.localRefs,this.meta=Z.meta,this.$async=Q===null||Q===void 0?void 0:Q.$async,this.refs={}}}iH.SchemaEnv=T8;function sQ(Z){let X=pH.call(this,Z);if(X)return X;let Q=(0,Z1.getFullPath)(this.opts.uriResolver,Z.root.baseId),{es5:J,lines:W}=this.opts.code,{ownProperties:G}=this.opts,Y=new e6.CodeGen(this.scope,{es5:J,lines:W,ownProperties:G}),$;if(Z.$async)$=Y.scopeValue("Error",{ref:NP.default,code:e6._`require("ajv/dist/runtime/validation_error").default`});let z=Y.scopeName("validate");Z.validateName=z;let U={gen:Y,allErrors:this.opts.allErrors,data:b4.default.data,parentData:b4.default.parentData,parentDataProperty:b4.default.parentDataProperty,dataNames:[b4.default.data],dataPathArr:[e6.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:Y.scopeValue("schema",this.opts.code.source===!0?{ref:Z.schema,code:(0,e6.stringify)(Z.schema)}:{ref:Z.schema}),validateName:z,ValidationError:$,schema:Z.schema,schemaEnv:Z,rootId:Q,baseId:Z.baseId||Q,schemaPath:e6.nil,errSchemaPath:Z.schemaPath||(this.opts.jtd?"":"#"),errorPath:e6._`""`,opts:this.opts,self:this},V;try{this._compilations.add(Z),(0,DP.validateFunctionCode)(U),Y.optimize(this.opts.code.optimize);let q=Y.toString();if(V=`${Y.scopeRefs(b4.default.scope)}return ${q}`,this.opts.code.process)V=this.opts.code.process(V,Z);let F=Function(`${b4.default.self}`,`${b4.default.scope}`,V)(this,this.scope.get());if(this.scope.value(z,{ref:F}),F.errors=null,F.schema=Z.schema,F.schemaEnv=Z,Z.$async)F.$async=!0;if(this.opts.code.source===!0)F.source={validateName:z,validateCode:q,scopeValues:Y._values};if(this.opts.unevaluated){let{props:L,items:I}=U;if(F.evaluated={props:L instanceof e6.Name?void 0:L,items:I instanceof e6.Name?void 0:I,dynamicProps:L instanceof e6.Name,dynamicItems:I instanceof e6.Name},F.source)F.source.evaluated=(0,e6.stringify)(F.evaluated)}return Z.validate=F,Z}catch(q){if(delete Z.validate,delete Z.validateName,V)this.logger.error("Error compiling schema, function code:",V);throw q}finally{this._compilations.delete(Z)}}iH.compileSchema=sQ;function TP(Z,X,Q){var J;Q=(0,Z1.resolveUrl)(this.opts.uriResolver,X,Q);let W=Z.refs[Q];if(W)return W;let G=OP.call(this,Z,Q);if(G===void 0){let Y=(J=Z.localRefs)===null||J===void 0?void 0:J[Q],{schemaId:$}=this.opts;if(Y)G=new T8({schema:Y,schemaId:$,root:Z,baseId:X})}if(G===void 0)return;return Z.refs[Q]=wP.call(this,G)}iH.resolveRef=TP;function wP(Z){if((0,Z1.inlineRef)(Z.schema,this.opts.inlineRefs))return Z.schema;return Z.validate?Z:sQ.call(this,Z)}function pH(Z){for(let X of this._compilations)if(jP(X,Z))return X}iH.getCompilingSchema=pH;function jP(Z,X){return Z.schema===X.schema&&Z.root===X.root&&Z.baseId===X.baseId}function OP(Z,X){let Q;while(typeof(Q=this.refs[X])=="string")X=Q;return Q||this.schemas[X]||NZ.call(this,Z,X)}function NZ(Z,X){let Q=this.opts.uriResolver.parse(X),J=(0,Z1._getFullPath)(this.opts.uriResolver,Q),W=(0,Z1.getFullPath)(this.opts.uriResolver,Z.baseId,void 0);if(Object.keys(Z.schema).length>0&&J===W)return oQ.call(this,Q,Z);let G=(0,Z1.normalizeId)(J),Y=this.refs[G]||this.schemas[G];if(typeof Y=="string"){let $=NZ.call(this,Z,Y);if(typeof($===null||$===void 0?void 0:$.schema)!=="object")return;return oQ.call(this,Q,$)}if(typeof(Y===null||Y===void 0?void 0:Y.schema)!=="object")return;if(!Y.validate)sQ.call(this,Y);if(G===(0,Z1.normalizeId)(X)){let{schema:$}=Y,{schemaId:z}=this.opts,U=$[z];if(U)W=(0,Z1.resolveUrl)(this.opts.uriResolver,W,U);return new T8({schema:$,schemaId:z,root:Z,baseId:W})}return oQ.call(this,Q,Y)}iH.resolveSchema=NZ;var EP=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function oQ(Z,{baseId:X,schema:Q,root:J}){var W;if(((W=Z.fragment)===null||W===void 0?void 0:W[0])!=="/")return;for(let $ of Z.fragment.slice(1).split("/")){if(typeof Q==="boolean")return;let z=Q[(0,cH.unescapeFragment)($)];if(z===void 0)return;Q=z;let U=typeof Q==="object"&&Q[this.opts.schemaId];if(!EP.has($)&&U)X=(0,Z1.resolveUrl)(this.opts.uriResolver,X,U)}let G;if(typeof Q!="boolean"&&Q.$ref&&!(0,cH.schemaHasRulesButRef)(Q,this.RULES)){let $=(0,Z1.resolveUrl)(this.opts.uriResolver,X,Q.$ref);G=NZ.call(this,J,$)}let{schemaId:Y}=this.opts;if(G=G||new T8({schema:Q,schemaId:Y,root:J,baseId:X}),G.schema!==G.root.schema)return G;return}});var rH=C((Fm,_P)=>{_P.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var ZJ=C((Lm,Z3)=>{var kP=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),oH=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),tQ=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),sH=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),xP=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function eQ(Z){let X="",Q=0,J=0;for(J=0;J<Z.length;J++){if(Q=Z[J].charCodeAt(0),Q===48)continue;if(!(Q>=48&&Q<=57||Q>=65&&Q<=70||Q>=97&&Q<=102))return"";X+=Z[J];break}for(J+=1;J<Z.length;J++){if(Q=Z[J].charCodeAt(0),!(Q>=48&&Q<=57||Q>=65&&Q<=70||Q>=97&&Q<=102))return"";X+=Z[J]}return X}var bP=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function aH(Z){return Z.length=0,!0}function vP(Z,X,Q){if(Z.length){let J=eQ(Z);if(J!=="")X.push(J);else return Q.error=!0,!1;Z.length=0}return!0}function yP(Z){let X=0,Q={error:!1,address:"",zone:""},J=[],W=[],G=!1,Y=!1,$=vP;for(let z=0;z<Z.length;z++){let U=Z[z];if(U==="["||U==="]")continue;if(U===":"){if(G===!0)Y=!0;if(!$(W,J,Q))break;if(++X>7){Q.error=!0;break}if(z>0&&Z[z-1]===":")G=!0;J.push(":");continue}else if(U==="%"){if(!$(W,J,Q))break;$=aH}else{W.push(U);continue}}if(W.length)if($===aH)Q.zone=W.join("");else if(Y)J.push(W.join(""));else J.push(eQ(W));return Q.address=J.join(""),Q}function tH(Z){if(gP(Z,":")<2)return{host:Z,isIPV6:!1};let X=yP(Z);if(!X.error){let{address:Q,address:J}=X;if(X.zone)Q+="%"+X.zone,J+="%25"+X.zone;return{host:Q,isIPV6:!0,escapedHost:J}}else return{host:Z,isIPV6:!1}}function gP(Z,X){let Q=0;for(let J=0;J<Z.length;J++)if(Z[J]===X)Q++;return Q}function fP(Z){let X=Z,Q=[],J=-1,W=0;while(W=X.length){if(W===1)if(X===".")break;else if(X==="/"){Q.push("/");break}else{Q.push(X);break}else if(W===2){if(X[0]==="."){if(X[1]===".")break;else if(X[1]==="/"){X=X.slice(2);continue}}else if(X[0]==="/"){if(X[1]==="."||X[1]==="/"){Q.push("/");break}}}else if(W===3){if(X==="/.."){if(Q.length!==0)Q.pop();Q.push("/");break}}if(X[0]==="."){if(X[1]==="."){if(X[2]==="/"){X=X.slice(3);continue}}else if(X[1]==="/"){X=X.slice(2);continue}}else if(X[0]==="/"){if(X[1]==="."){if(X[2]==="/"){X=X.slice(2);continue}else if(X[2]==="."){if(X[3]==="/"){if(X=X.slice(3),Q.length!==0)Q.pop();continue}}}}if((J=X.indexOf("/",1))===-1){Q.push(X);break}else Q.push(X.slice(0,J)),X=X.slice(J)}return Q.join("")}var hP={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},uP=/[@/?#:]/g,mP=/[@/?#]/g;function eH(Z,X){let Q=X?mP:uP;return Q.lastIndex=0,Z.replace(Q,(J)=>hP[J])}function dP(Z,X=!1){if(Z.indexOf("%")===-1)return Z;let Q="";for(let J=0;J<Z.length;J++){if(Z[J]==="%"&&J+2<Z.length){let W=Z.slice(J+1,J+3);if(tQ(W)){let G=W.toUpperCase(),Y=String.fromCharCode(parseInt(G,16));if(X&&sH(Y))Q+=Y;else Q+="%"+G;J+=2;continue}}Q+=Z[J]}return Q}function lP(Z){let X="";for(let Q=0;Q<Z.length;Q++){if(Z[Q]==="%"&&Q+2<Z.length){let J=Z.slice(Q+1,Q+3);if(tQ(J)){let W=J.toUpperCase(),G=String.fromCharCode(parseInt(W,16));if(G!=="."&&sH(G))X+=G;else X+="%"+W;Q+=2;continue}}if(xP(Z[Q]))X+=Z[Q];else X+=escape(Z[Q])}return X}function cP(Z){let X="";for(let Q=0;Q<Z.length;Q++){if(Z[Q]==="%"&&Q+2<Z.length){let J=Z.slice(Q+1,Q+3);if(tQ(J)){X+="%"+J.toUpperCase(),Q+=2;continue}}X+=escape(Z[Q])}return X}function pP(Z){let X=[];if(Z.userinfo!==void 0)X.push(Z.userinfo),X.push("@");if(Z.host!==void 0){let Q=unescape(Z.host);if(!oH(Q)){let J=tH(Q);if(J.isIPV6===!0)Q=`[${J.escapedHost}]`;else Q=eH(Q,!1)}X.push(Q)}if(typeof Z.port==="number"||typeof Z.port==="string")X.push(":"),X.push(String(Z.port));return X.length?X.join(""):void 0}Z3.exports={nonSimpleDomain:bP,recomposeAuthority:pP,reescapeHostDelimiters:eH,normalizePercentEncoding:dP,normalizePathEncoding:lP,escapePreservingEscapes:cP,removeDotSegments:fP,isIPv4:oH,isUUID:kP,normalizeIPv6:tH,stringArrayToHexStripped:eQ}});var G3=C((Mm,W3)=>{var{isUUID:iP}=ZJ(),nP=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,rP=["http","https","ws","wss","urn","urn:uuid"];function aP(Z){return rP.indexOf(Z)!==-1}function XJ(Z){if(Z.secure===!0)return!0;else if(Z.secure===!1)return!1;else if(Z.scheme)return Z.scheme.length===3&&(Z.scheme[0]==="w"||Z.scheme[0]==="W")&&(Z.scheme[1]==="s"||Z.scheme[1]==="S")&&(Z.scheme[2]==="s"||Z.scheme[2]==="S");else return!1}function X3(Z){if(!Z.host)Z.error=Z.error||"HTTP URIs must have a host.";return Z}function Q3(Z){let X=String(Z.scheme).toLowerCase()==="https";if(Z.port===(X?443:80)||Z.port==="")Z.port=void 0;if(!Z.path)Z.path="/";return Z}function oP(Z){return Z.secure=XJ(Z),Z.resourceName=(Z.path||"/")+(Z.query?"?"+Z.query:""),Z.path=void 0,Z.query=void 0,Z}function sP(Z){if(Z.port===(XJ(Z)?443:80)||Z.port==="")Z.port=void 0;if(typeof Z.secure==="boolean")Z.scheme=Z.secure?"wss":"ws",Z.secure=void 0;if(Z.resourceName){let[X,Q]=Z.resourceName.split("?");Z.path=X&&X!=="/"?X:void 0,Z.query=Q,Z.resourceName=void 0}return Z.fragment=void 0,Z}function tP(Z,X){if(!Z.path)return Z.error="URN can not be parsed",Z;let Q=Z.path.match(nP);if(Q){let J=X.scheme||Z.scheme||"urn";Z.nid=Q[1].toLowerCase(),Z.nss=Q[2];let W=`${J}:${X.nid||Z.nid}`,G=QJ(W);if(Z.path=void 0,G)Z=G.parse(Z,X)}else Z.error=Z.error||"URN can not be parsed.";return Z}function eP(Z,X){if(Z.nid===void 0)throw Error("URN without nid cannot be serialized");let Q=X.scheme||Z.scheme||"urn",J=Z.nid.toLowerCase(),W=`${Q}:${X.nid||J}`,G=QJ(W);if(G)Z=G.serialize(Z,X);let Y=Z,$=Z.nss;return Y.path=`${J||X.nid}:${$}`,X.skipEscape=!0,Y}function ZC(Z,X){let Q=Z;if(Q.uuid=Q.nss,Q.nss=void 0,!X.tolerant&&(!Q.uuid||!iP(Q.uuid)))Q.error=Q.error||"UUID is not valid.";return Q}function XC(Z){let X=Z;return X.nss=(Z.uuid||"").toLowerCase(),X}var J3={scheme:"http",domainHost:!0,parse:X3,serialize:Q3},QC={scheme:"https",domainHost:J3.domainHost,parse:X3,serialize:Q3},DZ={scheme:"ws",domainHost:!0,parse:oP,serialize:sP},JC={scheme:"wss",domainHost:DZ.domainHost,parse:DZ.parse,serialize:DZ.serialize},WC={scheme:"urn",parse:tP,serialize:eP,skipNormalize:!0},GC={scheme:"urn:uuid",parse:ZC,serialize:XC,skipNormalize:!0},TZ={http:J3,https:QC,ws:DZ,wss:JC,urn:WC,"urn:uuid":GC};Object.setPrototypeOf(TZ,null);function QJ(Z){return Z&&(TZ[Z]||TZ[Z.toLowerCase()])||void 0}W3.exports={wsIsSecure:XJ,SCHEMES:TZ,isValidSchemeName:aP,getSchemeHandler:QJ}});var V3=C((Am,wZ)=>{var{normalizeIPv6:YC,removeDotSegments:j8,recomposeAuthority:$C,normalizePercentEncoding:zC,normalizePathEncoding:UC,escapePreservingEscapes:KC,reescapeHostDelimiters:VC,isIPv4:HC,nonSimpleDomain:qC}=ZJ(),{SCHEMES:BC,getSchemeHandler:$3}=G3();function FC(Z,X){if(typeof Z==="string")Z=NC(Z,X);else if(typeof Z==="object")Z=j9(v4(Z,X),X);return Z}function LC(Z,X,Q){let J=Q?Object.assign({scheme:"null"},Q):{scheme:"null"},W=z3(j9(Z,J),j9(X,J),J,!0);return J.skipEscape=!0,v4(W,J)}function z3(Z,X,Q,J){let W={};if(!J)Z=j9(v4(Z,Q),Q),X=j9(v4(X,Q),Q);if(Q=Q||{},!Q.tolerant&&X.scheme)W.scheme=X.scheme,W.userinfo=X.userinfo,W.host=X.host,W.port=X.port,W.path=j8(X.path||""),W.query=X.query;else{if(X.userinfo!==void 0||X.host!==void 0||X.port!==void 0)W.userinfo=X.userinfo,W.host=X.host,W.port=X.port,W.path=j8(X.path||""),W.query=X.query;else{if(!X.path)if(W.path=Z.path,X.query!==void 0)W.query=X.query;else W.query=Z.query;else{if(X.path[0]==="/")W.path=j8(X.path);else{if((Z.userinfo!==void 0||Z.host!==void 0||Z.port!==void 0)&&!Z.path)W.path="/"+X.path;else if(!Z.path)W.path=X.path;else W.path=Z.path.slice(0,Z.path.lastIndexOf("/")+1)+X.path;W.path=j8(W.path)}W.query=X.query}W.userinfo=Z.userinfo,W.host=Z.host,W.port=Z.port}W.scheme=Z.scheme}return W.fragment=X.fragment,W}function MC(Z,X,Q){let J=Y3(Z,Q),W=Y3(X,Q);return J!==void 0&&W!==void 0&&J.toLowerCase()===W.toLowerCase()}function v4(Z,X){let Q={host:Z.host,scheme:Z.scheme,userinfo:Z.userinfo,port:Z.port,path:Z.path,query:Z.query,nid:Z.nid,nss:Z.nss,uuid:Z.uuid,fragment:Z.fragment,reference:Z.reference,resourceName:Z.resourceName,secure:Z.secure,error:""},J=Object.assign({},X),W=[],G=$3(J.scheme||Q.scheme);if(G&&G.serialize)G.serialize(Q,J);if(Q.path!==void 0)if(!J.skipEscape){if(Q.path=KC(Q.path),Q.scheme!==void 0)Q.path=Q.path.split("%3A").join(":")}else Q.path=zC(Q.path);if(J.reference!=="suffix"&&Q.scheme)W.push(Q.scheme,":");let Y=$C(Q);if(Y!==void 0){if(J.reference!=="suffix")W.push("//");if(W.push(Y),Q.path&&Q.path[0]!=="/")W.push("/")}if(Q.path!==void 0){let $=Q.path;if(!J.absolutePath&&(!G||!G.absolutePath))$=j8($);if(Y===void 0&&$[0]==="/"&&$[1]==="/")$="/%2F"+$.slice(2);W.push($)}if(Q.query!==void 0)W.push("?",Q.query);if(Q.fragment!==void 0)W.push("#",Q.fragment);return W.join("")}var AC=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function IC(Z,X){if(X[2]!==void 0&&Z.path&&Z.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof Z.port==="number"&&(Z.port<0||Z.port>65535))return"URI port is malformed.";return}function U3(Z,X){let Q=Object.assign({},X),J={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},W=!1,G=!1;if(Q.reference==="suffix")if(Q.scheme)Z=Q.scheme+":"+Z;else Z="//"+Z;let Y=Z.match(AC);if(Y){if(J.scheme=Y[1],J.userinfo=Y[3],J.host=Y[4],J.port=parseInt(Y[5],10),J.path=Y[6]||"",J.query=Y[7],J.fragment=Y[8],isNaN(J.port))J.port=Y[5];let $=IC(J,Y);if($!==void 0)J.error=J.error||$,W=!0;if(J.host)if(HC(J.host)===!1){let V=YC(J.host);J.host=V.host.toLowerCase(),G=V.isIPV6}else G=!0;if(J.scheme===void 0&&J.userinfo===void 0&&J.host===void 0&&J.port===void 0&&J.query===void 0&&!J.path)J.reference="same-document";else if(J.scheme===void 0)J.reference="relative";else if(J.fragment===void 0)J.reference="absolute";else J.reference="uri";if(Q.reference&&Q.reference!=="suffix"&&Q.reference!==J.reference)J.error=J.error||"URI is not a "+Q.reference+" reference.";let z=$3(Q.scheme||J.scheme);if(!Q.unicodeSupport&&(!z||!z.unicodeSupport)){if(J.host&&(Q.domainHost||z&&z.domainHost)&&G===!1&&qC(J.host))try{J.host=URL.domainToASCII(J.host.toLowerCase())}catch(U){J.error=J.error||"Host's domain name can not be converted to ASCII: "+U}}if(!z||z&&!z.skipNormalize){if(Z.indexOf("%")!==-1){if(J.scheme!==void 0)J.scheme=unescape(J.scheme);if(J.host!==void 0)J.host=VC(unescape(J.host),G)}if(J.path)J.path=UC(J.path);if(J.fragment)try{J.fragment=encodeURI(decodeURIComponent(J.fragment))}catch{J.error=J.error||"URI malformed"}}if(z&&z.parse)z.parse(J,Q)}else J.error=J.error||"URI can not be parsed.";return{parsed:J,malformedAuthorityOrPort:W}}function j9(Z,X){return U3(Z,X).parsed}function NC(Z,X){return K3(Z,X).normalized}function K3(Z,X){let{parsed:Q,malformedAuthorityOrPort:J}=U3(Z,X);return{normalized:J?Z:v4(Q,X),malformedAuthorityOrPort:J}}function Y3(Z,X){if(typeof Z==="string"){let{normalized:Q,malformedAuthorityOrPort:J}=K3(Z,X);return J?void 0:Q}if(typeof Z==="object")return v4(Z,X)}var JJ={SCHEMES:BC,normalize:FC,resolve:LC,resolveComponent:z3,equal:MC,serialize:v4,parse:j9};wZ.exports=JJ;wZ.exports.default=JJ;wZ.exports.fastUri=JJ});var B3=C((q3)=>{Object.defineProperty(q3,"__esModule",{value:!0});var H3=V3();H3.code='require("ajv/dist/runtime/uri").default';q3.default=H3});var T3=C((m1)=>{Object.defineProperty(m1,"__esModule",{value:!0});m1.CodeGen=m1.Name=m1.nil=m1.stringify=m1.str=m1._=m1.KeywordCxt=void 0;var TC=N8();Object.defineProperty(m1,"KeywordCxt",{enumerable:!0,get:function(){return TC.KeywordCxt}});var O9=L0();Object.defineProperty(m1,"_",{enumerable:!0,get:function(){return O9._}});Object.defineProperty(m1,"str",{enumerable:!0,get:function(){return O9.str}});Object.defineProperty(m1,"stringify",{enumerable:!0,get:function(){return O9.stringify}});Object.defineProperty(m1,"nil",{enumerable:!0,get:function(){return O9.nil}});Object.defineProperty(m1,"Name",{enumerable:!0,get:function(){return O9.Name}});Object.defineProperty(m1,"CodeGen",{enumerable:!0,get:function(){return O9.CodeGen}});var wC=IZ(),I3=D8(),jC=vQ(),O8=w8(),OC=L0(),E8=M8(),jZ=L8(),GJ=A0(),F3=rH(),EC=B3(),N3=(Z,X)=>new RegExp(Z,X);N3.code="new RegExp";var RC=["removeAdditional","useDefaults","coerceTypes"],PC=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),CC={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},SC={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},L3=200;function _C(Z){var X,Q,J,W,G,Y,$,z,U,V,q,B,F,L,I,A,N,D,O,T,w,S,y,x,i;let r=Z.strict,h=(X=Z.code)===null||X===void 0?void 0:X.optimize,n=h===!0||h===void 0?1:h||0,W0=(J=(Q=Z.code)===null||Q===void 0?void 0:Q.regExp)!==null&&J!==void 0?J:N3,G0=(W=Z.uriResolver)!==null&&W!==void 0?W:EC.default;return{strictSchema:(Y=(G=Z.strictSchema)!==null&&G!==void 0?G:r)!==null&&Y!==void 0?Y:!0,strictNumbers:(z=($=Z.strictNumbers)!==null&&$!==void 0?$:r)!==null&&z!==void 0?z:!0,strictTypes:(V=(U=Z.strictTypes)!==null&&U!==void 0?U:r)!==null&&V!==void 0?V:"log",strictTuples:(B=(q=Z.strictTuples)!==null&&q!==void 0?q:r)!==null&&B!==void 0?B:"log",strictRequired:(L=(F=Z.strictRequired)!==null&&F!==void 0?F:r)!==null&&L!==void 0?L:!1,code:Z.code?{...Z.code,optimize:n,regExp:W0}:{optimize:n,regExp:W0},loopRequired:(I=Z.loopRequired)!==null&&I!==void 0?I:L3,loopEnum:(A=Z.loopEnum)!==null&&A!==void 0?A:L3,meta:(N=Z.meta)!==null&&N!==void 0?N:!0,messages:(D=Z.messages)!==null&&D!==void 0?D:!0,inlineRefs:(O=Z.inlineRefs)!==null&&O!==void 0?O:!0,schemaId:(T=Z.schemaId)!==null&&T!==void 0?T:"$id",addUsedSchema:(w=Z.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(S=Z.validateSchema)!==null&&S!==void 0?S:!0,validateFormats:(y=Z.validateFormats)!==null&&y!==void 0?y:!0,unicodeRegExp:(x=Z.unicodeRegExp)!==null&&x!==void 0?x:!0,int32range:(i=Z.int32range)!==null&&i!==void 0?i:!0,uriResolver:G0}}class OZ{constructor(Z={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,Z=this.opts={...Z,..._C(Z)};let{es5:X,lines:Q}=this.opts.code;this.scope=new OC.ValueScope({scope:{},prefixes:PC,es5:X,lines:Q}),this.logger=gC(Z.logger);let J=Z.validateFormats;if(Z.validateFormats=!1,this.RULES=(0,jC.getRules)(),M3.call(this,CC,Z,"NOT SUPPORTED"),M3.call(this,SC,Z,"DEPRECATED","warn"),this._metaOpts=vC.call(this),Z.formats)xC.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),Z.keywords)bC.call(this,Z.keywords);if(typeof Z.meta=="object")this.addMetaSchema(Z.meta);kC.call(this),Z.validateFormats=J}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:Z,meta:X,schemaId:Q}=this.opts,J=F3;if(Q==="id")J={...F3},J.id=J.$id,delete J.$id;if(X&&Z)this.addMetaSchema(J,J[Q],!1)}defaultMeta(){let{meta:Z,schemaId:X}=this.opts;return this.opts.defaultMeta=typeof Z=="object"?Z[X]||Z:void 0}validate(Z,X){let Q;if(typeof Z=="string"){if(Q=this.getSchema(Z),!Q)throw Error(`no schema with key or ref "${Z}"`)}else Q=this.compile(Z);let J=Q(X);if(!("$async"in Q))this.errors=Q.errors;return J}compile(Z,X){let Q=this._addSchema(Z,X);return Q.validate||this._compileSchemaEnv(Q)}compileAsync(Z,X){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:Q}=this.opts;return J.call(this,Z,X);async function J(U,V){await W.call(this,U.$schema);let q=this._addSchema(U,V);return q.validate||G.call(this,q)}async function W(U){if(U&&!this.getSchema(U))await J.call(this,{$ref:U},!0)}async function G(U){try{return this._compileSchemaEnv(U)}catch(V){if(!(V instanceof I3.default))throw V;return Y.call(this,V),await $.call(this,V.missingSchema),G.call(this,U)}}function Y({missingSchema:U,missingRef:V}){if(this.refs[U])throw Error(`AnySchema ${U} is loaded but ${V} cannot be resolved`)}async function $(U){let V=await z.call(this,U);if(!this.refs[U])await W.call(this,V.$schema);if(!this.refs[U])this.addSchema(V,U,X)}async function z(U){let V=this._loading[U];if(V)return V;try{return await(this._loading[U]=Q(U))}finally{delete this._loading[U]}}}addSchema(Z,X,Q,J=this.opts.validateSchema){if(Array.isArray(Z)){for(let G of Z)this.addSchema(G,void 0,Q,J);return this}let W;if(typeof Z==="object"){let{schemaId:G}=this.opts;if(W=Z[G],W!==void 0&&typeof W!="string")throw Error(`schema ${G} must be string`)}return X=(0,E8.normalizeId)(X||W),this._checkUnique(X),this.schemas[X]=this._addSchema(Z,Q,X,J,!0),this}addMetaSchema(Z,X,Q=this.opts.validateSchema){return this.addSchema(Z,X,!0,Q),this}validateSchema(Z,X){if(typeof Z=="boolean")return!0;let Q;if(Q=Z.$schema,Q!==void 0&&typeof Q!="string")throw Error("$schema must be a string");if(Q=Q||this.opts.defaultMeta||this.defaultMeta(),!Q)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let J=this.validate(Q,Z);if(!J&&X){let W="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(W);else throw Error(W)}return J}getSchema(Z){let X;while(typeof(X=A3.call(this,Z))=="string")Z=X;if(X===void 0){let{schemaId:Q}=this.opts,J=new O8.SchemaEnv({schema:{},schemaId:Q});if(X=O8.resolveSchema.call(this,J,Z),!X)return;this.refs[Z]=X}return X.validate||this._compileSchemaEnv(X)}removeSchema(Z){if(Z instanceof RegExp)return this._removeAllSchemas(this.schemas,Z),this._removeAllSchemas(this.refs,Z),this;switch(typeof Z){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let X=A3.call(this,Z);if(typeof X=="object")this._cache.delete(X.schema);return delete this.schemas[Z],delete this.refs[Z],this}case"object":{let X=Z;this._cache.delete(X);let Q=Z[this.opts.schemaId];if(Q)Q=(0,E8.normalizeId)(Q),delete this.schemas[Q],delete this.refs[Q];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(Z){for(let X of Z)this.addKeyword(X);return this}addKeyword(Z,X){let Q;if(typeof Z=="string"){if(Q=Z,typeof X=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),X.keyword=Q}else if(typeof Z=="object"&&X===void 0){if(X=Z,Q=X.keyword,Array.isArray(Q)&&!Q.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(hC.call(this,Q,X),!X)return(0,GJ.eachItem)(Q,(W)=>WJ.call(this,W)),this;mC.call(this,X);let J={...X,type:(0,jZ.getJSONTypes)(X.type),schemaType:(0,jZ.getJSONTypes)(X.schemaType)};return(0,GJ.eachItem)(Q,J.type.length===0?(W)=>WJ.call(this,W,J):(W)=>J.type.forEach((G)=>WJ.call(this,W,J,G))),this}getKeyword(Z){let X=this.RULES.all[Z];return typeof X=="object"?X.definition:!!X}removeKeyword(Z){let{RULES:X}=this;delete X.keywords[Z],delete X.all[Z];for(let Q of X.rules){let J=Q.rules.findIndex((W)=>W.keyword===Z);if(J>=0)Q.rules.splice(J,1)}return this}addFormat(Z,X){if(typeof X=="string")X=new RegExp(X);return this.formats[Z]=X,this}errorsText(Z=this.errors,{separator:X=", ",dataVar:Q="data"}={}){if(!Z||Z.length===0)return"No errors";return Z.map((J)=>`${Q}${J.instancePath} ${J.message}`).reduce((J,W)=>J+X+W)}$dataMetaSchema(Z,X){let Q=this.RULES.all;Z=JSON.parse(JSON.stringify(Z));for(let J of X){let W=J.split("/").slice(1),G=Z;for(let Y of W)G=G[Y];for(let Y in Q){let $=Q[Y];if(typeof $!="object")continue;let{$data:z}=$.definition,U=G[Y];if(z&&U)G[Y]=D3(U)}}return Z}_removeAllSchemas(Z,X){for(let Q in Z){let J=Z[Q];if(!X||X.test(Q)){if(typeof J=="string")delete Z[Q];else if(J&&!J.meta)this._cache.delete(J.schema),delete Z[Q]}}}_addSchema(Z,X,Q,J=this.opts.validateSchema,W=this.opts.addUsedSchema){let G,{schemaId:Y}=this.opts;if(typeof Z=="object")G=Z[Y];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof Z!="boolean")throw Error("schema must be object or boolean");let $=this._cache.get(Z);if($!==void 0)return $;Q=(0,E8.normalizeId)(G||Q);let z=E8.getSchemaRefs.call(this,Z,Q);if($=new O8.SchemaEnv({schema:Z,schemaId:Y,meta:X,baseId:Q,localRefs:z}),this._cache.set($.schema,$),W&&!Q.startsWith("#")){if(Q)this._checkUnique(Q);this.refs[Q]=$}if(J)this.validateSchema(Z,!0);return $}_checkUnique(Z){if(this.schemas[Z]||this.refs[Z])throw Error(`schema with key or id "${Z}" already exists`)}_compileSchemaEnv(Z){if(Z.meta)this._compileMetaSchema(Z);else O8.compileSchema.call(this,Z);if(!Z.validate)throw Error("ajv implementation error");return Z.validate}_compileMetaSchema(Z){let X=this.opts;this.opts=this._metaOpts;try{O8.compileSchema.call(this,Z)}finally{this.opts=X}}}OZ.ValidationError=wC.default;OZ.MissingRefError=I3.default;m1.default=OZ;function M3(Z,X,Q,J="error"){for(let W in Z){let G=W;if(G in X)this.logger[J](`${Q}: option ${W}. ${Z[G]}`)}}function A3(Z){return Z=(0,E8.normalizeId)(Z),this.schemas[Z]||this.refs[Z]}function kC(){let Z=this.opts.schemas;if(!Z)return;if(Array.isArray(Z))this.addSchema(Z);else for(let X in Z)this.addSchema(Z[X],X)}function xC(){for(let Z in this.opts.formats){let X=this.opts.formats[Z];if(X)this.addFormat(Z,X)}}function bC(Z){if(Array.isArray(Z)){this.addVocabulary(Z);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let X in Z){let Q=Z[X];if(!Q.keyword)Q.keyword=X;this.addKeyword(Q)}}function vC(){let Z={...this.opts};for(let X of RC)delete Z[X];return Z}var yC={log(){},warn(){},error(){}};function gC(Z){if(Z===!1)return yC;if(Z===void 0)return console;if(Z.log&&Z.warn&&Z.error)return Z;throw Error("logger must implement log, warn and error methods")}var fC=/^[a-z_$][a-z0-9_$:-]*$/i;function hC(Z,X){let{RULES:Q}=this;if((0,GJ.eachItem)(Z,(J)=>{if(Q.keywords[J])throw Error(`Keyword ${J} is already defined`);if(!fC.test(J))throw Error(`Keyword ${J} has invalid name`)}),!X)return;if(X.$data&&!(("code"in X)||("validate"in X)))throw Error('$data keyword must have "code" or "validate" function')}function WJ(Z,X,Q){var J;let W=X===null||X===void 0?void 0:X.post;if(Q&&W)throw Error('keyword with "post" flag cannot have "type"');let{RULES:G}=this,Y=W?G.post:G.rules.find(({type:z})=>z===Q);if(!Y)Y={type:Q,rules:[]},G.rules.push(Y);if(G.keywords[Z]=!0,!X)return;let $={keyword:Z,definition:{...X,type:(0,jZ.getJSONTypes)(X.type),schemaType:(0,jZ.getJSONTypes)(X.schemaType)}};if(X.before)uC.call(this,Y,$,X.before);else Y.rules.push($);G.all[Z]=$,(J=X.implements)===null||J===void 0||J.forEach((z)=>this.addKeyword(z))}function uC(Z,X,Q){let J=Z.rules.findIndex((W)=>W.keyword===Q);if(J>=0)Z.rules.splice(J,0,X);else Z.rules.push(X),this.logger.warn(`rule ${Q} is not defined`)}function mC(Z){let{metaSchema:X}=Z;if(X===void 0)return;if(Z.$data&&this.opts.$data)X=D3(X);Z.validateSchema=this.compile(X,!0)}var dC={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function D3(Z){return{anyOf:[Z,dC]}}});var j3=C((w3)=>{Object.defineProperty(w3,"__esModule",{value:!0});var pC={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};w3.default=pC});var PZ=C((P3)=>{Object.defineProperty(P3,"__esModule",{value:!0});P3.callRef=P3.getValidate=void 0;var nC=D8(),O3=p6(),j6=L0(),E9=c6(),E3=w8(),EZ=A0(),rC={keyword:"$ref",schemaType:"string",code(Z){let{gen:X,schema:Q,it:J}=Z,{baseId:W,schemaEnv:G,validateName:Y,opts:$,self:z}=J,{root:U}=G;if((Q==="#"||Q==="#/")&&W===U.baseId)return q();let V=E3.resolveRef.call(z,U,W,Q);if(V===void 0)throw new nC.default(J.opts.uriResolver,W,Q);if(V instanceof E3.SchemaEnv)return B(V);return F(V);function q(){if(G===U)return RZ(Z,Y,G,G.$async);let L=X.scopeValue("root",{ref:U});return RZ(Z,j6._`${L}.validate`,U,U.$async)}function B(L){let I=R3(Z,L);RZ(Z,I,L,L.$async)}function F(L){let I=X.scopeValue("schema",$.code.source===!0?{ref:L,code:(0,j6.stringify)(L)}:{ref:L}),A=X.name("valid"),N=Z.subschema({schema:L,dataTypes:[],schemaPath:j6.nil,topSchemaRef:I,errSchemaPath:Q},A);Z.mergeEvaluated(N),Z.ok(A)}}};function R3(Z,X){let{gen:Q}=Z;return X.validate?Q.scopeValue("validate",{ref:X.validate}):j6._`${Q.scopeValue("wrapper",{ref:X})}.validate`}P3.getValidate=R3;function RZ(Z,X,Q,J){let{gen:W,it:G}=Z,{allErrors:Y,schemaEnv:$,opts:z}=G,U=z.passContext?E9.default.this:j6.nil;if(J)V();else q();function V(){if(!$.$async)throw Error("async schema referenced by sync schema");let L=W.let("valid");W.try(()=>{if(W.code(j6._`await ${(0,O3.callValidateCode)(Z,X,U)}`),F(X),!Y)W.assign(L,!0)},(I)=>{if(W.if(j6._`!(${I} instanceof ${G.ValidationError})`,()=>W.throw(I)),B(I),!Y)W.assign(L,!1)}),Z.ok(L)}function q(){Z.result((0,O3.callValidateCode)(Z,X,U),()=>F(X),()=>B(X))}function B(L){let I=j6._`${L}.errors`;W.assign(E9.default.vErrors,j6._`${E9.default.vErrors} === null ? ${I} : ${E9.default.vErrors}.concat(${I})`),W.assign(E9.default.errors,j6._`${E9.default.vErrors}.length`)}function F(L){var I;if(!G.opts.unevaluated)return;let A=(I=Q===null||Q===void 0?void 0:Q.validate)===null||I===void 0?void 0:I.evaluated;if(G.props!==!0)if(A&&!A.dynamicProps){if(A.props!==void 0)G.props=EZ.mergeEvaluated.props(W,A.props,G.props)}else{let N=W.var("props",j6._`${L}.evaluated.props`);G.props=EZ.mergeEvaluated.props(W,N,G.props,j6.Name)}if(G.items!==!0)if(A&&!A.dynamicItems){if(A.items!==void 0)G.items=EZ.mergeEvaluated.items(W,A.items,G.items)}else{let N=W.var("items",j6._`${L}.evaluated.items`);G.items=EZ.mergeEvaluated.items(W,N,G.items,j6.Name)}}}P3.callRef=RZ;P3.default=rC});var _3=C((S3)=>{Object.defineProperty(S3,"__esModule",{value:!0});var sC=j3(),tC=PZ(),eC=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",sC.default,tC.default];S3.default=eC});var x3=C((k3)=>{Object.defineProperty(k3,"__esModule",{value:!0});var CZ=L0(),H4=CZ.operators,SZ={maximum:{okStr:"<=",ok:H4.LTE,fail:H4.GT},minimum:{okStr:">=",ok:H4.GTE,fail:H4.LT},exclusiveMaximum:{okStr:"<",ok:H4.LT,fail:H4.GTE},exclusiveMinimum:{okStr:">",ok:H4.GT,fail:H4.LTE}},XS={message:({keyword:Z,schemaCode:X})=>CZ.str`must be ${SZ[Z].okStr} ${X}`,params:({keyword:Z,schemaCode:X})=>CZ._`{comparison: ${SZ[Z].okStr}, limit: ${X}}`},QS={keyword:Object.keys(SZ),type:"number",schemaType:"number",$data:!0,error:XS,code(Z){let{keyword:X,data:Q,schemaCode:J}=Z;Z.fail$data(CZ._`${Q} ${SZ[X].fail} ${J} || isNaN(${Q})`)}};k3.default=QS});var v3=C((b3)=>{Object.defineProperty(b3,"__esModule",{value:!0});var R8=L0(),WS={message:({schemaCode:Z})=>R8.str`must be multiple of ${Z}`,params:({schemaCode:Z})=>R8._`{multipleOf: ${Z}}`},GS={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:WS,code(Z){let{gen:X,data:Q,schemaCode:J,it:W}=Z,G=W.opts.multipleOfPrecision,Y=X.let("res"),$=G?R8._`Math.abs(Math.round(${Y}) - ${Y}) > 1e-${G}`:R8._`${Y} !== parseInt(${Y})`;Z.fail$data(R8._`(${J} === 0 || (${Y} = ${Q}/${J}, ${$}))`)}};b3.default=GS});var f3=C((g3)=>{Object.defineProperty(g3,"__esModule",{value:!0});function y3(Z){let X=Z.length,Q=0,J=0,W;while(J<X)if(Q++,W=Z.charCodeAt(J++),W>=55296&&W<=56319&&J<X){if(W=Z.charCodeAt(J),(W&64512)===56320)J++}return Q}g3.default=y3;y3.code='require("ajv/dist/runtime/ucs2length").default'});var u3=C((h3)=>{Object.defineProperty(h3,"__esModule",{value:!0});var y4=L0(),zS=A0(),US=f3(),KS={message({keyword:Z,schemaCode:X}){let Q=Z==="maxLength"?"more":"fewer";return y4.str`must NOT have ${Q} than ${X} characters`},params:({schemaCode:Z})=>y4._`{limit: ${Z}}`},VS={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:KS,code(Z){let{keyword:X,data:Q,schemaCode:J,it:W}=Z,G=X==="maxLength"?y4.operators.GT:y4.operators.LT,Y=W.opts.unicode===!1?y4._`${Q}.length`:y4._`${(0,zS.useFunc)(Z.gen,US.default)}(${Q})`;Z.fail$data(y4._`${Y} ${G} ${J}`)}};h3.default=VS});var d3=C((m3)=>{Object.defineProperty(m3,"__esModule",{value:!0});var qS=p6(),BS=A0(),R9=L0(),FS={message:({schemaCode:Z})=>R9.str`must match pattern "${Z}"`,params:({schemaCode:Z})=>R9._`{pattern: ${Z}}`},LS={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:FS,code(Z){let{gen:X,data:Q,$data:J,schema:W,schemaCode:G,it:Y}=Z,$=Y.opts.unicodeRegExp?"u":"";if(J){let{regExp:z}=Y.opts.code,U=z.code==="new RegExp"?R9._`new RegExp`:(0,BS.useFunc)(X,z),V=X.let("valid");X.try(()=>X.assign(V,R9._`${U}(${G}, ${$}).test(${Q})`),()=>X.assign(V,!1)),Z.fail$data(R9._`!${V}`)}else{let z=(0,qS.usePattern)(Z,W);Z.fail$data(R9._`!${z}.test(${Q})`)}}};m3.default=LS});var c3=C((l3)=>{Object.defineProperty(l3,"__esModule",{value:!0});var P8=L0(),AS={message({keyword:Z,schemaCode:X}){let Q=Z==="maxProperties"?"more":"fewer";return P8.str`must NOT have ${Q} than ${X} properties`},params:({schemaCode:Z})=>P8._`{limit: ${Z}}`},IS={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:AS,code(Z){let{keyword:X,data:Q,schemaCode:J}=Z,W=X==="maxProperties"?P8.operators.GT:P8.operators.LT;Z.fail$data(P8._`Object.keys(${Q}).length ${W} ${J}`)}};l3.default=IS});var i3=C((p3)=>{Object.defineProperty(p3,"__esModule",{value:!0});var C8=p6(),S8=L0(),DS=A0(),TS={message:({params:{missingProperty:Z}})=>S8.str`must have required property '${Z}'`,params:({params:{missingProperty:Z}})=>S8._`{missingProperty: ${Z}}`},wS={keyword:"required",type:"object",schemaType:"array",$data:!0,error:TS,code(Z){let{gen:X,schema:Q,schemaCode:J,data:W,$data:G,it:Y}=Z,{opts:$}=Y;if(!G&&Q.length===0)return;let z=Q.length>=$.loopRequired;if(Y.allErrors)U();else V();if($.strictRequired){let F=Z.parentSchema.properties,{definedProperties:L}=Z.it;for(let I of Q)if((F===null||F===void 0?void 0:F[I])===void 0&&!L.has(I)){let A=Y.schemaEnv.baseId+Y.errSchemaPath,N=`required property "${I}" is not defined at "${A}" (strictRequired)`;(0,DS.checkStrictMode)(Y,N,Y.opts.strictRequired)}}function U(){if(z||G)Z.block$data(S8.nil,q);else for(let F of Q)(0,C8.checkReportMissingProp)(Z,F)}function V(){let F=X.let("missing");if(z||G){let L=X.let("valid",!0);Z.block$data(L,()=>B(F,L)),Z.ok(L)}else X.if((0,C8.checkMissingProp)(Z,Q,F)),(0,C8.reportMissingProp)(Z,F),X.else()}function q(){X.forOf("prop",J,(F)=>{Z.setParams({missingProperty:F}),X.if((0,C8.noPropertyInData)(X,W,F,$.ownProperties),()=>Z.error())})}function B(F,L){Z.setParams({missingProperty:F}),X.forOf(F,J,()=>{X.assign(L,(0,C8.propertyInData)(X,W,F,$.ownProperties)),X.if((0,S8.not)(L),()=>{Z.error(),X.break()})},S8.nil)}}};p3.default=wS});var r3=C((n3)=>{Object.defineProperty(n3,"__esModule",{value:!0});var _8=L0(),OS={message({keyword:Z,schemaCode:X}){let Q=Z==="maxItems"?"more":"fewer";return _8.str`must NOT have ${Q} than ${X} items`},params:({schemaCode:Z})=>_8._`{limit: ${Z}}`},ES={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:OS,code(Z){let{keyword:X,data:Q,schemaCode:J}=Z,W=X==="maxItems"?_8.operators.GT:_8.operators.LT;Z.fail$data(_8._`${Q}.length ${W} ${J}`)}};n3.default=ES});var _Z=C((o3)=>{Object.defineProperty(o3,"__esModule",{value:!0});var a3=lQ();a3.code='require("ajv/dist/runtime/equal").default';o3.default=a3});var t3=C((s3)=>{Object.defineProperty(s3,"__esModule",{value:!0});var YJ=L8(),J6=L0(),CS=A0(),SS=_Z(),_S={message:({params:{i:Z,j:X}})=>J6.str`must NOT have duplicate items (items ## ${X} and ${Z} are identical)`,params:({params:{i:Z,j:X}})=>J6._`{i: ${Z}, j: ${X}}`},kS={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:_S,code(Z){let{gen:X,data:Q,$data:J,schema:W,parentSchema:G,schemaCode:Y,it:$}=Z;if(!J&&!W)return;let z=X.let("valid"),U=G.items?(0,YJ.getSchemaTypes)(G.items):[];Z.block$data(z,V,J6._`${Y} === false`),Z.ok(z);function V(){let L=X.let("i",J6._`${Q}.length`),I=X.let("j");Z.setParams({i:L,j:I}),X.assign(z,!0),X.if(J6._`${L} > 1`,()=>(q()?B:F)(L,I))}function q(){return U.length>0&&!U.some((L)=>L==="object"||L==="array")}function B(L,I){let A=X.name("item"),N=(0,YJ.checkDataTypes)(U,A,$.opts.strictNumbers,YJ.DataType.Wrong),D=X.const("indices",J6._`{}`);X.for(J6._`;${L}--;`,()=>{if(X.let(A,J6._`${Q}[${L}]`),X.if(N,J6._`continue`),U.length>1)X.if(J6._`typeof ${A} == "string"`,J6._`${A} += "_"`);X.if(J6._`typeof ${D}[${A}] == "number"`,()=>{X.assign(I,J6._`${D}[${A}]`),Z.error(),X.assign(z,!1).break()}).code(J6._`${D}[${A}] = ${L}`)})}function F(L,I){let A=(0,CS.useFunc)(X,SS.default),N=X.name("outer");X.label(N).for(J6._`;${L}--;`,()=>X.for(J6._`${I} = ${L}; ${I}--;`,()=>X.if(J6._`${A}(${Q}[${L}], ${Q}[${I}])`,()=>{Z.error(),X.assign(z,!1).break(N)})))}}};s3.default=kS});var Zq=C((e3)=>{Object.defineProperty(e3,"__esModule",{value:!0});var $J=L0(),bS=A0(),vS=_Z(),yS={message:"must be equal to constant",params:({schemaCode:Z})=>$J._`{allowedValue: ${Z}}`},gS={keyword:"const",$data:!0,error:yS,code(Z){let{gen:X,data:Q,$data:J,schemaCode:W,schema:G}=Z;if(J||G&&typeof G=="object")Z.fail$data($J._`!${(0,bS.useFunc)(X,vS.default)}(${Q}, ${W})`);else Z.fail($J._`${G} !== ${Q}`)}};e3.default=gS});var Qq=C((Xq)=>{Object.defineProperty(Xq,"__esModule",{value:!0});var k8=L0(),hS=A0(),uS=_Z(),mS={message:"must be equal to one of the allowed values",params:({schemaCode:Z})=>k8._`{allowedValues: ${Z}}`},dS={keyword:"enum",schemaType:"array",$data:!0,error:mS,code(Z){let{gen:X,data:Q,$data:J,schema:W,schemaCode:G,it:Y}=Z;if(!J&&W.length===0)throw Error("enum must have non-empty array");let $=W.length>=Y.opts.loopEnum,z,U=()=>z!==null&&z!==void 0?z:z=(0,hS.useFunc)(X,uS.default),V;if($||J)V=X.let("valid"),Z.block$data(V,q);else{if(!Array.isArray(W))throw Error("ajv implementation error");let F=X.const("vSchema",G);V=(0,k8.or)(...W.map((L,I)=>B(F,I)))}Z.pass(V);function q(){X.assign(V,!1),X.forOf("v",G,(F)=>X.if(k8._`${U()}(${Q}, ${F})`,()=>X.assign(V,!0).break()))}function B(F,L){let I=W[L];return typeof I==="object"&&I!==null?k8._`${U()}(${Q}, ${F}[${L}])`:k8._`${Q} === ${I}`}}};Xq.default=dS});var Wq=C((Jq)=>{Object.defineProperty(Jq,"__esModule",{value:!0});var cS=x3(),pS=v3(),iS=u3(),nS=d3(),rS=c3(),aS=i3(),oS=r3(),sS=t3(),tS=Zq(),eS=Qq(),Z_=[cS.default,pS.default,iS.default,nS.default,rS.default,aS.default,oS.default,sS.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},tS.default,eS.default];Jq.default=Z_});var UJ=C((Yq)=>{Object.defineProperty(Yq,"__esModule",{value:!0});Yq.validateAdditionalItems=void 0;var g4=L0(),zJ=A0(),Q_={message:({params:{len:Z}})=>g4.str`must NOT have more than ${Z} items`,params:({params:{len:Z}})=>g4._`{limit: ${Z}}`},J_={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Q_,code(Z){let{parentSchema:X,it:Q}=Z,{items:J}=X;if(!Array.isArray(J)){(0,zJ.checkStrictMode)(Q,'"additionalItems" is ignored when "items" is not an array of schemas');return}Gq(Z,J)}};function Gq(Z,X){let{gen:Q,schema:J,data:W,keyword:G,it:Y}=Z;Y.items=!0;let $=Q.const("len",g4._`${W}.length`);if(J===!1)Z.setParams({len:X.length}),Z.pass(g4._`${$} <= ${X.length}`);else if(typeof J=="object"&&!(0,zJ.alwaysValidSchema)(Y,J)){let U=Q.var("valid",g4._`${$} <= ${X.length}`);Q.if((0,g4.not)(U),()=>z(U)),Z.ok(U)}function z(U){Q.forRange("i",X.length,$,(V)=>{if(Z.subschema({keyword:G,dataProp:V,dataPropType:zJ.Type.Num},U),!Y.allErrors)Q.if((0,g4.not)(U),()=>Q.break())})}}Yq.validateAdditionalItems=Gq;Yq.default=J_});var KJ=C((Kq)=>{Object.defineProperty(Kq,"__esModule",{value:!0});Kq.validateTuple=void 0;var zq=L0(),kZ=A0(),G_=p6(),Y_={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(Z){let{schema:X,it:Q}=Z;if(Array.isArray(X))return Uq(Z,"additionalItems",X);if(Q.items=!0,(0,kZ.alwaysValidSchema)(Q,X))return;Z.ok((0,G_.validateArray)(Z))}};function Uq(Z,X,Q=Z.schema){let{gen:J,parentSchema:W,data:G,keyword:Y,it:$}=Z;if(V(W),$.opts.unevaluated&&Q.length&&$.items!==!0)$.items=kZ.mergeEvaluated.items(J,Q.length,$.items);let z=J.name("valid"),U=J.const("len",zq._`${G}.length`);Q.forEach((q,B)=>{if((0,kZ.alwaysValidSchema)($,q))return;J.if(zq._`${U} > ${B}`,()=>Z.subschema({keyword:Y,schemaProp:B,dataProp:B},z)),Z.ok(z)});function V(q){let{opts:B,errSchemaPath:F}=$,L=Q.length,I=L===q.minItems&&(L===q.maxItems||q[X]===!1);if(B.strictTuples&&!I){let A=`"${Y}" is ${L}-tuple, but minItems or maxItems/${X} are not specified or different at path "${F}"`;(0,kZ.checkStrictMode)($,A,B.strictTuples)}}}Kq.validateTuple=Uq;Kq.default=Y_});var qq=C((Hq)=>{Object.defineProperty(Hq,"__esModule",{value:!0});var z_=KJ(),U_={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(Z)=>(0,z_.validateTuple)(Z,"items")};Hq.default=U_});var Lq=C((Fq)=>{Object.defineProperty(Fq,"__esModule",{value:!0});var Bq=L0(),V_=A0(),H_=p6(),q_=UJ(),B_={message:({params:{len:Z}})=>Bq.str`must NOT have more than ${Z} items`,params:({params:{len:Z}})=>Bq._`{limit: ${Z}}`},F_={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:B_,code(Z){let{schema:X,parentSchema:Q,it:J}=Z,{prefixItems:W}=Q;if(J.items=!0,(0,V_.alwaysValidSchema)(J,X))return;if(W)(0,q_.validateAdditionalItems)(Z,W);else Z.ok((0,H_.validateArray)(Z))}};Fq.default=F_});var Aq=C((Mq)=>{Object.defineProperty(Mq,"__esModule",{value:!0});var i6=L0(),xZ=A0(),M_={message:({params:{min:Z,max:X}})=>X===void 0?i6.str`must contain at least ${Z} valid item(s)`:i6.str`must contain at least ${Z} and no more than ${X} valid item(s)`,params:({params:{min:Z,max:X}})=>X===void 0?i6._`{minContains: ${Z}}`:i6._`{minContains: ${Z}, maxContains: ${X}}`},A_={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:M_,code(Z){let{gen:X,schema:Q,parentSchema:J,data:W,it:G}=Z,Y,$,{minContains:z,maxContains:U}=J;if(G.opts.next)Y=z===void 0?1:z,$=U;else Y=1;let V=X.const("len",i6._`${W}.length`);if(Z.setParams({min:Y,max:$}),$===void 0&&Y===0){(0,xZ.checkStrictMode)(G,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if($!==void 0&&Y>$){(0,xZ.checkStrictMode)(G,'"minContains" > "maxContains" is always invalid'),Z.fail();return}if((0,xZ.alwaysValidSchema)(G,Q)){let I=i6._`${V} >= ${Y}`;if($!==void 0)I=i6._`${I} && ${V} <= ${$}`;Z.pass(I);return}G.items=!0;let q=X.name("valid");if($===void 0&&Y===1)F(q,()=>X.if(q,()=>X.break()));else if(Y===0){if(X.let(q,!0),$!==void 0)X.if(i6._`${W}.length > 0`,B)}else X.let(q,!1),B();Z.result(q,()=>Z.reset());function B(){let I=X.name("_valid"),A=X.let("count",0);F(I,()=>X.if(I,()=>L(A)))}function F(I,A){X.forRange("i",0,V,(N)=>{Z.subschema({keyword:"contains",dataProp:N,dataPropType:xZ.Type.Num,compositeRule:!0},I),A()})}function L(I){if(X.code(i6._`${I}++`),$===void 0)X.if(i6._`${I} >= ${Y}`,()=>X.assign(q,!0).break());else if(X.if(i6._`${I} > ${$}`,()=>X.assign(q,!1).break()),Y===1)X.assign(q,!0);else X.if(i6._`${I} >= ${Y}`,()=>X.assign(q,!0))}}};Mq.default=A_});var bZ=C((Dq)=>{Object.defineProperty(Dq,"__esModule",{value:!0});Dq.validateSchemaDeps=Dq.validatePropertyDeps=Dq.error=void 0;var VJ=L0(),N_=A0(),x8=p6();Dq.error={message:({params:{property:Z,depsCount:X,deps:Q}})=>{let J=X===1?"property":"properties";return VJ.str`must have ${J} ${Q} when property ${Z} is present`},params:({params:{property:Z,depsCount:X,deps:Q,missingProperty:J}})=>VJ._`{property: ${Z},
|
|
385
|
+
missingProperty: ${J},
|
|
314
386
|
depsCount: ${X},
|
|
315
|
-
deps: ${Q}}`};var aR={keyword:"dependencies",type:"object",schemaType:"object",error:UU.error,code(Z){let[X,Q]=sR(Z);qU(Z,X),KU(Z,Q)}};function sR({schema:Z}){let X={},Q={};for(let W in Z){if(W==="__proto__")continue;let J=Array.isArray(Z[W])?X:Q;J[W]=Z[W]}return[X,Q]}function qU(Z,X=Z.schema){let{gen:Q,data:W,it:J}=Z;if(Object.keys(X).length===0)return;let G=Q.let("missing");for(let Y in X){let z=X[Y];if(z.length===0)continue;let q=(0,u9.propertyInData)(Q,W,Y,J.opts.ownProperties);if(Z.setParams({property:Y,depsCount:z.length,deps:z.join(", ")}),J.allErrors)Q.if(q,()=>{for(let K of z)(0,u9.checkReportMissingProp)(Z,K)});else Q.if(rX._`${q} && (${(0,u9.checkMissingProp)(Z,z,G)})`),(0,u9.reportMissingProp)(Z,G),Q.else()}}UU.validatePropertyDeps=qU;function KU(Z,X=Z.schema){let{gen:Q,data:W,keyword:J,it:G}=Z,Y=Q.name("valid");for(let z in X){if((0,rR.alwaysValidSchema)(G,X[z]))continue;Q.if((0,u9.propertyInData)(Q,W,z,G.opts.ownProperties),()=>{let q=Z.subschema({keyword:J,schemaProp:z},Y);Z.mergeValidEvaluated(q,Y)},()=>Q.var(Y,!0)),Z.ok(Y)}}UU.validateSchemaDeps=KU;UU.default=aR});var LU=j((FU)=>{Object.defineProperty(FU,"__esModule",{value:!0});var HU=Z0(),eR=W0(),ZP={message:"property name must be valid",params:({params:Z})=>HU._`{propertyName: ${Z.propertyName}}`},XP={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:ZP,code(Z){let{gen:X,schema:Q,data:W,it:J}=Z;if((0,eR.alwaysValidSchema)(J,Q))return;let G=X.name("valid");X.forIn("key",W,(Y)=>{Z.setParams({propertyName:Y}),Z.subschema({keyword:"propertyNames",data:Y,dataTypes:["string"],propertyName:Y,compositeRule:!0},G),X.if((0,HU.not)(G),()=>{if(Z.error(!0),!J.allErrors)X.break()})}),Z.ok(G)}};FU.default=XP});var aX=j((AU)=>{Object.defineProperty(AU,"__esModule",{value:!0});var k5=M4(),S4=Z0(),WP=A4(),b5=W0(),JP={message:"must NOT have additional properties",params:({params:Z})=>S4._`{additionalProperty: ${Z.additionalProperty}}`},GP={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:JP,code(Z){let{gen:X,schema:Q,parentSchema:W,data:J,errsCount:G,it:Y}=Z;if(!G)throw Error("ajv implementation error");let{allErrors:z,opts:q}=Y;if(Y.props=!0,q.removeAdditional!=="all"&&(0,b5.alwaysValidSchema)(Y,Q))return;let K=(0,k5.allSchemaProperties)(W.properties),V=(0,k5.allSchemaProperties)(W.patternProperties);B(),Z.ok(S4._`${G} === ${WP.default.errors}`);function B(){X.forIn("key",J,(I)=>{if(!K.length&&!V.length)A(I);else X.if(H(I),()=>A(I))})}function H(I){let N;if(K.length>8){let T=(0,b5.schemaRefOrVal)(Y,W.properties,"properties");N=(0,k5.isOwnProperty)(X,T,I)}else if(K.length)N=(0,S4.or)(...K.map((T)=>S4._`${I} === ${T}`));else N=S4.nil;if(V.length)N=(0,S4.or)(N,...V.map((T)=>S4._`${(0,k5.usePattern)(Z,T)}.test(${I})`));return(0,S4.not)(N)}function F(I){X.code(S4._`delete ${J}[${I}]`)}function A(I){if(q.removeAdditional==="all"||q.removeAdditional&&Q===!1){F(I);return}if(Q===!1){if(Z.setParams({additionalProperty:I}),Z.error(),!z)X.break();return}if(typeof Q=="object"&&!(0,b5.alwaysValidSchema)(Y,Q)){let N=X.name("valid");if(q.removeAdditional==="failing")M(I,N,!1),X.if((0,S4.not)(N),()=>{Z.reset(),F(I)});else if(M(I,N),!z)X.if((0,S4.not)(N),()=>X.break())}}function M(I,N,T){let S={keyword:"additionalProperties",dataProp:I,dataPropType:b5.Type.Str};if(T===!1)Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1});Z.subschema(S,N)}}};AU.default=GP});var DU=j((NU)=>{Object.defineProperty(NU,"__esModule",{value:!0});var zP=R9(),MU=M4(),sX=W0(),IU=aX(),$P={keyword:"properties",type:"object",schemaType:"object",code(Z){let{gen:X,schema:Q,parentSchema:W,data:J,it:G}=Z;if(G.opts.removeAdditional==="all"&&W.additionalProperties===void 0)IU.default.code(new zP.KeywordCxt(G,IU.default,"additionalProperties"));let Y=(0,MU.allSchemaProperties)(Q);for(let B of Y)G.definedProperties.add(B);if(G.opts.unevaluated&&Y.length&&G.props!==!0)G.props=sX.mergeEvaluated.props(X,(0,sX.toHash)(Y),G.props);let z=Y.filter((B)=>!(0,sX.alwaysValidSchema)(G,Q[B]));if(z.length===0)return;let q=X.name("valid");for(let B of z){if(K(B))V(B);else{if(X.if((0,MU.propertyInData)(X,J,B,G.opts.ownProperties)),V(B),!G.allErrors)X.else().var(q,!0);X.endIf()}Z.it.definedProperties.add(B),Z.ok(q)}function K(B){return G.opts.useDefaults&&!G.compositeRule&&Q[B].default!==void 0}function V(B){Z.subschema({keyword:"properties",schemaProp:B,dataProp:B},q)}}};NU.default=$P});var EU=j((OU)=>{Object.defineProperty(OU,"__esModule",{value:!0});var TU=M4(),_5=Z0(),wU=W0(),jU=W0(),KP={keyword:"patternProperties",type:"object",schemaType:"object",code(Z){let{gen:X,schema:Q,data:W,parentSchema:J,it:G}=Z,{opts:Y}=G,z=(0,TU.allSchemaProperties)(Q),q=z.filter((M)=>(0,wU.alwaysValidSchema)(G,Q[M]));if(z.length===0||q.length===z.length&&(!G.opts.unevaluated||G.props===!0))return;let K=Y.strictSchema&&!Y.allowMatchingProperties&&J.properties,V=X.name("valid");if(G.props!==!0&&!(G.props instanceof _5.Name))G.props=(0,jU.evaluatedPropsToName)(X,G.props);let{props:B}=G;H();function H(){for(let M of z){if(K)F(M);if(G.allErrors)A(M);else X.var(V,!0),A(M),X.if(V)}}function F(M){for(let I in K)if(new RegExp(M).test(I))(0,wU.checkStrictMode)(G,`property ${I} matches pattern ${M} (use allowMatchingProperties)`)}function A(M){X.forIn("key",W,(I)=>{X.if(_5._`${(0,TU.usePattern)(Z,M)}.test(${I})`,()=>{let N=q.includes(M);if(!N)Z.subschema({keyword:"patternProperties",schemaProp:M,dataProp:I,dataPropType:jU.Type.Str},V);if(G.opts.unevaluated&&B!==!0)X.assign(_5._`${B}[${I}]`,!0);else if(!N&&!G.allErrors)X.if((0,_5.not)(V),()=>X.break())})})}}};OU.default=KP});var PU=j((RU)=>{Object.defineProperty(RU,"__esModule",{value:!0});var VP=W0(),BP={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(Z){let{gen:X,schema:Q,it:W}=Z;if((0,VP.alwaysValidSchema)(W,Q)){Z.fail();return}let J=X.name("valid");Z.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},J),Z.failResult(J,()=>Z.reset(),()=>Z.error())},error:{message:"must NOT be valid"}};RU.default=BP});var SU=j((CU)=>{Object.defineProperty(CU,"__esModule",{value:!0});var FP=M4(),LP={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:FP.validateUnion,error:{message:"must match a schema in anyOf"}};CU.default=LP});var bU=j((kU)=>{Object.defineProperty(kU,"__esModule",{value:!0});var x5=Z0(),MP=W0(),IP={message:"must match exactly one schema in oneOf",params:({params:Z})=>x5._`{passingSchemas: ${Z.passing}}`},NP={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:IP,code(Z){let{gen:X,schema:Q,parentSchema:W,it:J}=Z;if(!Array.isArray(Q))throw Error("ajv implementation error");if(J.opts.discriminator&&W.discriminator)return;let G=Q,Y=X.let("valid",!1),z=X.let("passing",null),q=X.name("_valid");Z.setParams({passing:z}),X.block(K),Z.result(Y,()=>Z.reset(),()=>Z.error(!0));function K(){G.forEach((V,B)=>{let H;if((0,MP.alwaysValidSchema)(J,V))X.var(q,!0);else H=Z.subschema({keyword:"oneOf",schemaProp:B,compositeRule:!0},q);if(B>0)X.if(x5._`${q} && ${Y}`).assign(Y,!1).assign(z,x5._`[${z}, ${B}]`).else();X.if(q,()=>{if(X.assign(Y,!0),X.assign(z,B),H)Z.mergeEvaluated(H,x5.Name)})})}}};kU.default=NP});var xU=j((_U)=>{Object.defineProperty(_U,"__esModule",{value:!0});var TP=W0(),wP={keyword:"allOf",schemaType:"array",code(Z){let{gen:X,schema:Q,it:W}=Z;if(!Array.isArray(Q))throw Error("ajv implementation error");let J=X.name("valid");Q.forEach((G,Y)=>{if((0,TP.alwaysValidSchema)(W,G))return;let z=Z.subschema({keyword:"allOf",schemaProp:Y},J);Z.ok(J),Z.mergeEvaluated(z)})}};_U.default=wP});var fU=j((gU)=>{Object.defineProperty(gU,"__esModule",{value:!0});var v5=Z0(),yU=W0(),OP={message:({params:Z})=>v5.str`must match "${Z.ifClause}" schema`,params:({params:Z})=>v5._`{failingKeyword: ${Z.ifClause}}`},EP={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:OP,code(Z){let{gen:X,parentSchema:Q,it:W}=Z;if(Q.then===void 0&&Q.else===void 0)(0,yU.checkStrictMode)(W,'"if" without "then" and "else" is ignored');let J=vU(W,"then"),G=vU(W,"else");if(!J&&!G)return;let Y=X.let("valid",!0),z=X.name("_valid");if(q(),Z.reset(),J&&G){let V=X.let("ifClause");Z.setParams({ifClause:V}),X.if(z,K("then",V),K("else",V))}else if(J)X.if(z,K("then"));else X.if((0,v5.not)(z),K("else"));Z.pass(Y,()=>Z.error(!0));function q(){let V=Z.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},z);Z.mergeEvaluated(V)}function K(V,B){return()=>{let H=Z.subschema({keyword:V},z);if(X.assign(Y,z),Z.mergeValidEvaluated(H,Y),B)X.assign(B,v5._`${V}`);else Z.setParams({ifClause:V})}}}};function vU(Z,X){let Q=Z.schema[X];return Q!==void 0&&!(0,yU.alwaysValidSchema)(Z,Q)}gU.default=EP});var uU=j((hU)=>{Object.defineProperty(hU,"__esModule",{value:!0});var PP=W0(),CP={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:Z,parentSchema:X,it:Q}){if(X.if===void 0)(0,PP.checkStrictMode)(Q,`"${Z}" without "if" is ignored`)}};hU.default=CP});var lU=j((mU)=>{Object.defineProperty(mU,"__esModule",{value:!0});var kP=nX(),bP=WU(),_P=iX(),xP=YU(),vP=$U(),yP=S5(),gP=LU(),fP=aX(),hP=DU(),uP=EU(),mP=PU(),lP=SU(),dP=bU(),cP=xU(),pP=fU(),nP=uU();function iP(Z=!1){let X=[mP.default,lP.default,dP.default,cP.default,pP.default,nP.default,gP.default,fP.default,yP.default,hP.default,uP.default];if(Z)X.push(bP.default,xP.default);else X.push(kP.default,_P.default);return X.push(vP.default),X}mU.default=iP});var tX=j((pU)=>{Object.defineProperty(pU,"__esModule",{value:!0});pU.dynamicAnchor=void 0;var oX=Z0(),aP=A4(),dU=S9(),sP=j5(),oP={keyword:"$dynamicAnchor",schemaType:"string",code:(Z)=>cU(Z,Z.schema)};function cU(Z,X){let{gen:Q,it:W}=Z;W.schemaEnv.root.dynamicAnchors[X]=!0;let J=oX._`${aP.default.dynamicAnchors}${(0,oX.getProperty)(X)}`,G=W.errSchemaPath==="#"?W.validateName:tP(Z);Q.if(oX._`!${J}`,()=>Q.assign(J,G))}pU.dynamicAnchor=cU;function tP(Z){let{schemaEnv:X,schema:Q,self:W}=Z.it,{root:J,baseId:G,localRefs:Y,meta:z}=X.root,{schemaId:q}=W.opts,K=new dU.SchemaEnv({schema:Q,schemaId:q,root:J,baseId:G,localRefs:Y,meta:z});return dU.compileSchema.call(W,K),(0,sP.getValidate)(Z,K)}pU.default=oP});var eX=j((sU)=>{Object.defineProperty(sU,"__esModule",{value:!0});sU.dynamicRef=void 0;var iU=Z0(),ZC=A4(),rU=j5(),XC={keyword:"$dynamicRef",schemaType:"string",code:(Z)=>aU(Z,Z.schema)};function aU(Z,X){let{gen:Q,keyword:W,it:J}=Z;if(X[0]!=="#")throw Error(`"${W}" only supports hash fragment reference`);let G=X.slice(1);if(J.allErrors)Y();else{let q=Q.let("valid",!1);Y(q),Z.ok(q)}function Y(q){if(J.schemaEnv.root.dynamicAnchors[G]){let K=Q.let("_v",iU._`${ZC.default.dynamicAnchors}${(0,iU.getProperty)(G)}`);Q.if(K,z(K,q),z(J.validateName,q))}else z(J.validateName,q)()}function z(q,K){return K?()=>Q.block(()=>{(0,rU.callRef)(Z,q),Q.let(K,!0)}):()=>(0,rU.callRef)(Z,q)}}sU.dynamicRef=aU;sU.default=XC});var eU=j((tU)=>{Object.defineProperty(tU,"__esModule",{value:!0});var WC=tX(),JC=W0(),GC={keyword:"$recursiveAnchor",schemaType:"boolean",code(Z){if(Z.schema)(0,WC.dynamicAnchor)(Z,"");else(0,JC.checkStrictMode)(Z.it,"$recursiveAnchor: false is ignored")}};tU.default=GC});var XV=j((ZV)=>{Object.defineProperty(ZV,"__esModule",{value:!0});var zC=eX(),$C={keyword:"$recursiveRef",schemaType:"string",code:(Z)=>(0,zC.dynamicRef)(Z,Z.schema)};ZV.default=$C});var WV=j((QV)=>{Object.defineProperty(QV,"__esModule",{value:!0});var KC=tX(),UC=eX(),VC=eU(),BC=XV(),HC=[KC.default,UC.default,VC.default,BC.default];QV.default=HC});var YV=j((GV)=>{Object.defineProperty(GV,"__esModule",{value:!0});var JV=S5(),LC={keyword:"dependentRequired",type:"object",schemaType:"object",error:JV.error,code:(Z)=>(0,JV.validatePropertyDeps)(Z)};GV.default=LC});var $V=j((zV)=>{Object.defineProperty(zV,"__esModule",{value:!0});var MC=S5(),IC={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(Z)=>(0,MC.validateSchemaDeps)(Z)};zV.default=IC});var KV=j((qV)=>{Object.defineProperty(qV,"__esModule",{value:!0});var DC=W0(),TC={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:Z,parentSchema:X,it:Q}){if(X.contains===void 0)(0,DC.checkStrictMode)(Q,`"${Z}" without "contains" is ignored`)}};qV.default=TC});var VV=j((UV)=>{Object.defineProperty(UV,"__esModule",{value:!0});var jC=YV(),OC=$V(),EC=KV(),RC=[jC.default,OC.default,EC.default];UV.default=RC});var FV=j((HV)=>{Object.defineProperty(HV,"__esModule",{value:!0});var _6=Z0(),BV=W0(),CC=A4(),SC={message:"must NOT have unevaluated properties",params:({params:Z})=>_6._`{unevaluatedProperty: ${Z.unevaluatedProperty}}`},kC={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:SC,code(Z){let{gen:X,schema:Q,data:W,errsCount:J,it:G}=Z;if(!J)throw Error("ajv implementation error");let{allErrors:Y,props:z}=G;if(z instanceof _6.Name)X.if(_6._`${z} !== true`,()=>X.forIn("key",W,(B)=>X.if(K(z,B),()=>q(B))));else if(z!==!0)X.forIn("key",W,(B)=>z===void 0?q(B):X.if(V(z,B),()=>q(B)));G.props=!0,Z.ok(_6._`${J} === ${CC.default.errors}`);function q(B){if(Q===!1){if(Z.setParams({unevaluatedProperty:B}),Z.error(),!Y)X.break();return}if(!(0,BV.alwaysValidSchema)(G,Q)){let H=X.name("valid");if(Z.subschema({keyword:"unevaluatedProperties",dataProp:B,dataPropType:BV.Type.Str},H),!Y)X.if((0,_6.not)(H),()=>X.break())}}function K(B,H){return _6._`!${B} || !${B}[${H}]`}function V(B,H){let F=[];for(let A in B)if(B[A]===!0)F.push(_6._`${H} !== ${A}`);return(0,_6.and)(...F)}}};HV.default=kC});var MV=j((AV)=>{Object.defineProperty(AV,"__esModule",{value:!0});var e6=Z0(),LV=W0(),_C={message:({params:{len:Z}})=>e6.str`must NOT have more than ${Z} items`,params:({params:{len:Z}})=>e6._`{limit: ${Z}}`},xC={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:_C,code(Z){let{gen:X,schema:Q,data:W,it:J}=Z,G=J.items||0;if(G===!0)return;let Y=X.const("len",e6._`${W}.length`);if(Q===!1)Z.setParams({len:G}),Z.fail(e6._`${Y} > ${G}`);else if(typeof Q=="object"&&!(0,LV.alwaysValidSchema)(J,Q)){let q=X.var("valid",e6._`${Y} <= ${G}`);X.if((0,e6.not)(q),()=>z(q,G)),Z.ok(q)}J.items=!0;function z(q,K){X.forRange("i",K,Y,(V)=>{if(Z.subschema({keyword:"unevaluatedItems",dataProp:V,dataPropType:LV.Type.Num},q),!J.allErrors)X.if((0,e6.not)(q),()=>X.break())})}}};AV.default=xC});var NV=j((IV)=>{Object.defineProperty(IV,"__esModule",{value:!0});var yC=FV(),gC=MV(),fC=[yC.default,gC.default];IV.default=fC});var TV=j((DV)=>{Object.defineProperty(DV,"__esModule",{value:!0});var O0=Z0(),uC={message:({schemaCode:Z})=>O0.str`must match format "${Z}"`,params:({schemaCode:Z})=>O0._`{format: ${Z}}`},mC={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:uC,code(Z,X){let{gen:Q,data:W,$data:J,schema:G,schemaCode:Y,it:z}=Z,{opts:q,errSchemaPath:K,schemaEnv:V,self:B}=z;if(!q.validateFormats)return;if(J)H();else F();function H(){let A=Q.scopeValue("formats",{ref:B.formats,code:q.code.formats}),M=Q.const("fDef",O0._`${A}[${Y}]`),I=Q.let("fType"),N=Q.let("format");Q.if(O0._`typeof ${M} == "object" && !(${M} instanceof RegExp)`,()=>Q.assign(I,O0._`${M}.type || "string"`).assign(N,O0._`${M}.validate`),()=>Q.assign(I,O0._`"string"`).assign(N,M)),Z.fail$data((0,O0.or)(T(),S()));function T(){if(q.strictSchema===!1)return O0.nil;return O0._`${Y} && !${N}`}function S(){let v=V.$async?O0._`(${M}.async ? await ${N}(${W}) : ${N}(${W}))`:O0._`${N}(${W})`,x=O0._`(typeof ${N} == "function" ? ${v} : ${N}.test(${W}))`;return O0._`${N} && ${N} !== true && ${I} === ${X} && !${x}`}}function F(){let A=B.formats[G];if(!A){T();return}if(A===!0)return;let[M,I,N]=S(A);if(M===X)Z.pass(v());function T(){if(q.strictSchema===!1){B.logger.warn(x());return}throw Error(x());function x(){return`unknown format "${G}" ignored in schema at path "${K}"`}}function S(x){let p=x instanceof RegExp?(0,O0.regexpCode)(x):q.code.formats?O0._`${q.code.formats}${(0,O0.getProperty)(G)}`:void 0,f=Q.scopeValue("formats",{key:G,ref:x,code:p});if(typeof x=="object"&&!(x instanceof RegExp))return[x.type||"string",x.validate,O0._`${f}.validate`];return["string",x,f]}function v(){if(typeof A=="object"&&!(A instanceof RegExp)&&A.async){if(!V.$async)throw Error("async format in sync schema");return O0._`await ${N}(${W})`}return typeof I=="function"?O0._`${N}(${W})`:O0._`${N}.test(${W})`}}}};DV.default=mC});var jV=j((wV)=>{Object.defineProperty(wV,"__esModule",{value:!0});var dC=TV(),cC=[dC.default];wV.default=cC});var RV=j((OV)=>{Object.defineProperty(OV,"__esModule",{value:!0});OV.contentVocabulary=OV.metadataVocabulary=void 0;OV.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];OV.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var SV=j((CV)=>{Object.defineProperty(CV,"__esModule",{value:!0});var iC=D3(),rC=r3(),aC=lU(),sC=WV(),oC=VV(),tC=NV(),eC=jV(),PV=RV(),ZS=[sC.default,iC.default,rC.default,(0,aC.default)(!0),eC.default,PV.metadataVocabulary,PV.contentVocabulary,oC.default,tC.default];CV.default=ZS});var xV=j((bV)=>{Object.defineProperty(bV,"__esModule",{value:!0});bV.DiscrError=void 0;var kV;(function(Z){Z.Tag="tag",Z.Mapping="mapping"})(kV||(bV.DiscrError=kV={}))});var gV=j((yV)=>{Object.defineProperty(yV,"__esModule",{value:!0});var l1=Z0(),ZQ=xV(),vV=S9(),QS=P9(),WS=W0(),JS={message:({params:{discrError:Z,tagName:X}})=>Z===ZQ.DiscrError.Tag?`tag "${X}" must be string`:`value of tag "${X}" must be in oneOf`,params:({params:{discrError:Z,tag:X,tagName:Q}})=>l1._`{error: ${Z}, tag: ${Q}, tagValue: ${X}}`},GS={keyword:"discriminator",type:"object",schemaType:"object",error:JS,code(Z){let{gen:X,data:Q,schema:W,parentSchema:J,it:G}=Z,{oneOf:Y}=J;if(!G.opts.discriminator)throw Error("discriminator: requires discriminator option");let z=W.propertyName;if(typeof z!="string")throw Error("discriminator: requires propertyName");if(W.mapping)throw Error("discriminator: mapping is not supported");if(!Y)throw Error("discriminator: requires oneOf keyword");let q=X.let("valid",!1),K=X.const("tag",l1._`${Q}${(0,l1.getProperty)(z)}`);X.if(l1._`typeof ${K} == "string"`,()=>V(),()=>Z.error(!1,{discrError:ZQ.DiscrError.Tag,tag:K,tagName:z})),Z.ok(q);function V(){let F=H();X.if(!1);for(let A in F)X.elseIf(l1._`${K} === ${A}`),X.assign(q,B(F[A]));X.else(),Z.error(!1,{discrError:ZQ.DiscrError.Mapping,tag:K,tagName:z}),X.endIf()}function B(F){let A=X.name("valid"),M=Z.subschema({keyword:"oneOf",schemaProp:F},A);return Z.mergeEvaluated(M,l1.Name),A}function H(){var F;let A={},M=N(J),I=!0;for(let v=0;v<Y.length;v++){let x=Y[v];if((x===null||x===void 0?void 0:x.$ref)&&!(0,WS.schemaHasRulesButRef)(x,G.self.RULES)){let f=x.$ref;if(x=vV.resolveRef.call(G.self,G.schemaEnv.root,G.baseId,f),x instanceof vV.SchemaEnv)x=x.schema;if(x===void 0)throw new QS.default(G.opts.uriResolver,G.baseId,f)}let p=(F=x===null||x===void 0?void 0:x.properties)===null||F===void 0?void 0:F[z];if(typeof p!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${z}"`);I=I&&(M||N(x)),T(p,v)}if(!I)throw Error(`discriminator: "${z}" must be required`);return A;function N({required:v}){return Array.isArray(v)&&v.includes(z)}function T(v,x){if(v.const)S(v.const,x);else if(v.enum)for(let p of v.enum)S(p,x);else throw Error(`discriminator: "properties/${z}" must have "const" or "enum"`)}function S(v,x){if(typeof v!="string"||v in A)throw Error(`discriminator: "${z}" values must be unique strings`);A[v]=x}}}};yV.default=GS});var fV=j((Sf,zS)=>{zS.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var hV=j((kf,$S)=>{$S.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var uV=j((bf,qS)=>{qS.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var mV=j((_f,KS)=>{KS.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var lV=j((xf,US)=>{US.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var dV=j((vf,VS)=>{VS.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var cV=j((yf,BS)=>{BS.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var pV=j((gf,HS)=>{HS.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var iV=j((nV)=>{Object.defineProperty(nV,"__esModule",{value:!0});var FS=fV(),LS=hV(),AS=uV(),MS=mV(),IS=lV(),NS=dV(),DS=cV(),TS=pV(),wS=["/properties"];function jS(Z){return[FS,LS,AS,MS,IS,X(this,NS),DS,X(this,TS)].forEach((Q)=>this.addMetaSchema(Q,void 0,!1)),this;function X(Q,W){return Z?Q.$dataMetaSchema(W,wS):W}}nV.default=jS});var rV=j((X4,QQ)=>{Object.defineProperty(X4,"__esModule",{value:!0});X4.MissingRefError=X4.ValidationError=X4.CodeGen=X4.Name=X4.nil=X4.stringify=X4.str=X4._=X4.KeywordCxt=X4.Ajv2020=void 0;var ES=V3(),RS=SV(),PS=gV(),CS=iV(),XQ="https://json-schema.org/draft/2020-12/schema";class m9 extends ES.default{constructor(Z={}){super({...Z,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),RS.default.forEach((Z)=>this.addVocabulary(Z)),this.opts.discriminator)this.addKeyword(PS.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:Z,meta:X}=this.opts;if(!X)return;CS.default.call(this,Z),this.refs["http://json-schema.org/schema"]=XQ}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(XQ)?XQ:void 0)}}X4.Ajv2020=m9;QQ.exports=X4=m9;QQ.exports.Ajv2020=m9;Object.defineProperty(X4,"__esModule",{value:!0});X4.default=m9;var SS=R9();Object.defineProperty(X4,"KeywordCxt",{enumerable:!0,get:function(){return SS.KeywordCxt}});var d1=Z0();Object.defineProperty(X4,"_",{enumerable:!0,get:function(){return d1._}});Object.defineProperty(X4,"str",{enumerable:!0,get:function(){return d1.str}});Object.defineProperty(X4,"stringify",{enumerable:!0,get:function(){return d1.stringify}});Object.defineProperty(X4,"nil",{enumerable:!0,get:function(){return d1.nil}});Object.defineProperty(X4,"Name",{enumerable:!0,get:function(){return d1.Name}});Object.defineProperty(X4,"CodeGen",{enumerable:!0,get:function(){return d1.CodeGen}});var kS=F5();Object.defineProperty(X4,"ValidationError",{enumerable:!0,get:function(){return kS.default}});var bS=P9();Object.defineProperty(X4,"MissingRefError",{enumerable:!0,get:function(){return bS.default}})});var sV={};x6(sV,{validateProjectFile:()=>hS});import{existsSync as WQ,readFileSync as g5}from"node:fs";import{createRequire as aV}from"node:module";import{isAbsolute as vS,relative as yS,resolve as y5}from"node:path";import{fileURLToPath as gS,pathToFileURL as fS}from"node:url";async function hS(Z){let X=y5(Z),Q=y5(X,"project.json"),W=y5(X,"project.schema.json");if(!WQ(Q))throw Error(`project.json not found in ${X}`);if(!WQ(W))throw Error(`project.schema.json not found in ${X} — run \`jx schema\` to generate it from `+"project.json#/extensions");let J=JSON.parse(g5(Q,"utf8")),G=JSON.parse(g5(W,"utf8"));G.$id=fS(W).href;let Y;try{({default:Y}=await Promise.resolve().then(() => W1(rV(),1)))}catch(V){throw Error("Project validation requires ajv: bun add ajv",{cause:V})}let q=await new Y({allErrors:!0,loadSchema:(V)=>uS(V,X),strict:!1}).compileAsync(G),K=q(J);return{errors:q.errors??null,valid:K}}async function uS(Z,X){if(!Z.startsWith("file:"))throw Error(`Cannot resolve schema ref "${Z}": only project-relative file refs are loadable (canonical URIs must resolve from already-loaded fragments)`);let Q=gS(Z),W=yS(X,Q);if(W.startsWith("..")||vS(W))throw Error(`Schema ref "${Z}" escapes the project root ${X}`);if(WQ(Q))return JSON.parse(g5(Q,"utf8"));let J=W.split("\\").join("/"),G="node_modules/",Y=J.lastIndexOf(G);if(Y===-1)throw Error(`Schema ref "${Z}" does not exist`);let z=J.slice(Y+G.length),q;try{q=aV(y5(X,"package.json")).resolve(z)}catch{try{q=aV(import.meta.url).resolve(z)}catch(K){throw Error(`Schema ref "${Z}" does not exist and "${z}" is not resolvable from the project or the host`,{cause:K})}}return JSON.parse(g5(q,"utf8"))}var oV=()=>{};import{relative as JQ,resolve as mS}from"node:path";async function lS(){let Z=process.argv.slice(2),[X]=Z;if(!X||X==="--help"||X==="-h")console.log(`Usage: jx <command> [options]
|
|
387
|
+
deps: ${Q}}`};var D_={keyword:"dependencies",type:"object",schemaType:"object",error:Dq.error,code(Z){let[X,Q]=T_(Z);Iq(Z,X),Nq(Z,Q)}};function T_({schema:Z}){let X={},Q={};for(let J in Z){if(J==="__proto__")continue;let W=Array.isArray(Z[J])?X:Q;W[J]=Z[J]}return[X,Q]}function Iq(Z,X=Z.schema){let{gen:Q,data:J,it:W}=Z;if(Object.keys(X).length===0)return;let G=Q.let("missing");for(let Y in X){let $=X[Y];if($.length===0)continue;let z=(0,x8.propertyInData)(Q,J,Y,W.opts.ownProperties);if(Z.setParams({property:Y,depsCount:$.length,deps:$.join(", ")}),W.allErrors)Q.if(z,()=>{for(let U of $)(0,x8.checkReportMissingProp)(Z,U)});else Q.if(VJ._`${z} && (${(0,x8.checkMissingProp)(Z,$,G)})`),(0,x8.reportMissingProp)(Z,G),Q.else()}}Dq.validatePropertyDeps=Iq;function Nq(Z,X=Z.schema){let{gen:Q,data:J,keyword:W,it:G}=Z,Y=Q.name("valid");for(let $ in X){if((0,N_.alwaysValidSchema)(G,X[$]))continue;Q.if((0,x8.propertyInData)(Q,J,$,G.opts.ownProperties),()=>{let z=Z.subschema({keyword:W,schemaProp:$},Y);Z.mergeValidEvaluated(z,Y)},()=>Q.var(Y,!0)),Z.ok(Y)}}Dq.validateSchemaDeps=Nq;Dq.default=D_});var Eq=C((Oq)=>{Object.defineProperty(Oq,"__esModule",{value:!0});var jq=L0(),O_=A0(),E_={message:"property name must be valid",params:({params:Z})=>jq._`{propertyName: ${Z.propertyName}}`},R_={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:E_,code(Z){let{gen:X,schema:Q,data:J,it:W}=Z;if((0,O_.alwaysValidSchema)(W,Q))return;let G=X.name("valid");X.forIn("key",J,(Y)=>{Z.setParams({propertyName:Y}),Z.subschema({keyword:"propertyNames",data:Y,dataTypes:["string"],propertyName:Y,compositeRule:!0},G),X.if((0,jq.not)(G),()=>{if(Z.error(!0),!W.allErrors)X.break()})}),Z.ok(G)}};Oq.default=R_});var HJ=C((Rq)=>{Object.defineProperty(Rq,"__esModule",{value:!0});var vZ=p6(),X1=L0(),C_=c6(),yZ=A0(),S_={message:"must NOT have additional properties",params:({params:Z})=>X1._`{additionalProperty: ${Z.additionalProperty}}`},__={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:S_,code(Z){let{gen:X,schema:Q,parentSchema:J,data:W,errsCount:G,it:Y}=Z;if(!G)throw Error("ajv implementation error");let{allErrors:$,opts:z}=Y;if(Y.props=!0,z.removeAdditional!=="all"&&(0,yZ.alwaysValidSchema)(Y,Q))return;let U=(0,vZ.allSchemaProperties)(J.properties),V=(0,vZ.allSchemaProperties)(J.patternProperties);q(),Z.ok(X1._`${G} === ${C_.default.errors}`);function q(){X.forIn("key",W,(A)=>{if(!U.length&&!V.length)L(A);else X.if(B(A),()=>L(A))})}function B(A){let N;if(U.length>8){let D=(0,yZ.schemaRefOrVal)(Y,J.properties,"properties");N=(0,vZ.isOwnProperty)(X,D,A)}else if(U.length)N=(0,X1.or)(...U.map((D)=>X1._`${A} === ${D}`));else N=X1.nil;if(V.length)N=(0,X1.or)(N,...V.map((D)=>X1._`${(0,vZ.usePattern)(Z,D)}.test(${A})`));return(0,X1.not)(N)}function F(A){X.code(X1._`delete ${W}[${A}]`)}function L(A){if(z.removeAdditional==="all"||z.removeAdditional&&Q===!1){F(A);return}if(Q===!1){if(Z.setParams({additionalProperty:A}),Z.error(),!$)X.break();return}if(typeof Q=="object"&&!(0,yZ.alwaysValidSchema)(Y,Q)){let N=X.name("valid");if(z.removeAdditional==="failing")I(A,N,!1),X.if((0,X1.not)(N),()=>{Z.reset(),F(A)});else if(I(A,N),!$)X.if((0,X1.not)(N),()=>X.break())}}function I(A,N,D){let O={keyword:"additionalProperties",dataProp:A,dataPropType:yZ.Type.Str};if(D===!1)Object.assign(O,{compositeRule:!0,createErrors:!1,allErrors:!1});Z.subschema(O,N)}}};Rq.default=__});var _q=C((Sq)=>{Object.defineProperty(Sq,"__esModule",{value:!0});var x_=N8(),Pq=p6(),qJ=A0(),Cq=HJ(),b_={keyword:"properties",type:"object",schemaType:"object",code(Z){let{gen:X,schema:Q,parentSchema:J,data:W,it:G}=Z;if(G.opts.removeAdditional==="all"&&J.additionalProperties===void 0)Cq.default.code(new x_.KeywordCxt(G,Cq.default,"additionalProperties"));let Y=(0,Pq.allSchemaProperties)(Q);for(let q of Y)G.definedProperties.add(q);if(G.opts.unevaluated&&Y.length&&G.props!==!0)G.props=qJ.mergeEvaluated.props(X,(0,qJ.toHash)(Y),G.props);let $=Y.filter((q)=>!(0,qJ.alwaysValidSchema)(G,Q[q]));if($.length===0)return;let z=X.name("valid");for(let q of $){if(U(q))V(q);else{if(X.if((0,Pq.propertyInData)(X,W,q,G.opts.ownProperties)),V(q),!G.allErrors)X.else().var(z,!0);X.endIf()}Z.it.definedProperties.add(q),Z.ok(z)}function U(q){return G.opts.useDefaults&&!G.compositeRule&&Q[q].default!==void 0}function V(q){Z.subschema({keyword:"properties",schemaProp:q,dataProp:q},z)}}};Sq.default=b_});var yq=C((vq)=>{Object.defineProperty(vq,"__esModule",{value:!0});var kq=p6(),gZ=L0(),xq=A0(),bq=A0(),y_={keyword:"patternProperties",type:"object",schemaType:"object",code(Z){let{gen:X,schema:Q,data:J,parentSchema:W,it:G}=Z,{opts:Y}=G,$=(0,kq.allSchemaProperties)(Q),z=$.filter((I)=>(0,xq.alwaysValidSchema)(G,Q[I]));if($.length===0||z.length===$.length&&(!G.opts.unevaluated||G.props===!0))return;let U=Y.strictSchema&&!Y.allowMatchingProperties&&W.properties,V=X.name("valid");if(G.props!==!0&&!(G.props instanceof gZ.Name))G.props=(0,bq.evaluatedPropsToName)(X,G.props);let{props:q}=G;B();function B(){for(let I of $){if(U)F(I);if(G.allErrors)L(I);else X.var(V,!0),L(I),X.if(V)}}function F(I){for(let A in U)if(new RegExp(I).test(A))(0,xq.checkStrictMode)(G,`property ${A} matches pattern ${I} (use allowMatchingProperties)`)}function L(I){X.forIn("key",J,(A)=>{X.if(gZ._`${(0,kq.usePattern)(Z,I)}.test(${A})`,()=>{let N=z.includes(I);if(!N)Z.subschema({keyword:"patternProperties",schemaProp:I,dataProp:A,dataPropType:bq.Type.Str},V);if(G.opts.unevaluated&&q!==!0)X.assign(gZ._`${q}[${A}]`,!0);else if(!N&&!G.allErrors)X.if((0,gZ.not)(V),()=>X.break())})})}}};vq.default=y_});var fq=C((gq)=>{Object.defineProperty(gq,"__esModule",{value:!0});var f_=A0(),h_={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(Z){let{gen:X,schema:Q,it:J}=Z;if((0,f_.alwaysValidSchema)(J,Q)){Z.fail();return}let W=X.name("valid");Z.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},W),Z.failResult(W,()=>Z.reset(),()=>Z.error())},error:{message:"must NOT be valid"}};gq.default=h_});var uq=C((hq)=>{Object.defineProperty(hq,"__esModule",{value:!0});var m_=p6(),d_={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:m_.validateUnion,error:{message:"must match a schema in anyOf"}};hq.default=d_});var dq=C((mq)=>{Object.defineProperty(mq,"__esModule",{value:!0});var fZ=L0(),c_=A0(),p_={message:"must match exactly one schema in oneOf",params:({params:Z})=>fZ._`{passingSchemas: ${Z.passing}}`},i_={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:p_,code(Z){let{gen:X,schema:Q,parentSchema:J,it:W}=Z;if(!Array.isArray(Q))throw Error("ajv implementation error");if(W.opts.discriminator&&J.discriminator)return;let G=Q,Y=X.let("valid",!1),$=X.let("passing",null),z=X.name("_valid");Z.setParams({passing:$}),X.block(U),Z.result(Y,()=>Z.reset(),()=>Z.error(!0));function U(){G.forEach((V,q)=>{let B;if((0,c_.alwaysValidSchema)(W,V))X.var(z,!0);else B=Z.subschema({keyword:"oneOf",schemaProp:q,compositeRule:!0},z);if(q>0)X.if(fZ._`${z} && ${Y}`).assign(Y,!1).assign($,fZ._`[${$}, ${q}]`).else();X.if(z,()=>{if(X.assign(Y,!0),X.assign($,q),B)Z.mergeEvaluated(B,fZ.Name)})})}}};mq.default=i_});var cq=C((lq)=>{Object.defineProperty(lq,"__esModule",{value:!0});var r_=A0(),a_={keyword:"allOf",schemaType:"array",code(Z){let{gen:X,schema:Q,it:J}=Z;if(!Array.isArray(Q))throw Error("ajv implementation error");let W=X.name("valid");Q.forEach((G,Y)=>{if((0,r_.alwaysValidSchema)(J,G))return;let $=Z.subschema({keyword:"allOf",schemaProp:Y},W);Z.ok(W),Z.mergeEvaluated($)})}};lq.default=a_});var rq=C((nq)=>{Object.defineProperty(nq,"__esModule",{value:!0});var hZ=L0(),iq=A0(),s_={message:({params:Z})=>hZ.str`must match "${Z.ifClause}" schema`,params:({params:Z})=>hZ._`{failingKeyword: ${Z.ifClause}}`},t_={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:s_,code(Z){let{gen:X,parentSchema:Q,it:J}=Z;if(Q.then===void 0&&Q.else===void 0)(0,iq.checkStrictMode)(J,'"if" without "then" and "else" is ignored');let W=pq(J,"then"),G=pq(J,"else");if(!W&&!G)return;let Y=X.let("valid",!0),$=X.name("_valid");if(z(),Z.reset(),W&&G){let V=X.let("ifClause");Z.setParams({ifClause:V}),X.if($,U("then",V),U("else",V))}else if(W)X.if($,U("then"));else X.if((0,hZ.not)($),U("else"));Z.pass(Y,()=>Z.error(!0));function z(){let V=Z.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},$);Z.mergeEvaluated(V)}function U(V,q){return()=>{let B=Z.subschema({keyword:V},$);if(X.assign(Y,$),Z.mergeValidEvaluated(B,Y),q)X.assign(q,hZ._`${V}`);else Z.setParams({ifClause:V})}}}};function pq(Z,X){let Q=Z.schema[X];return Q!==void 0&&!(0,iq.alwaysValidSchema)(Z,Q)}nq.default=t_});var oq=C((aq)=>{Object.defineProperty(aq,"__esModule",{value:!0});var Zk=A0(),Xk={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:Z,parentSchema:X,it:Q}){if(X.if===void 0)(0,Zk.checkStrictMode)(Q,`"${Z}" without "if" is ignored`)}};aq.default=Xk});var tq=C((sq)=>{Object.defineProperty(sq,"__esModule",{value:!0});var Jk=UJ(),Wk=qq(),Gk=KJ(),Yk=Lq(),$k=Aq(),zk=bZ(),Uk=Eq(),Kk=HJ(),Vk=_q(),Hk=yq(),qk=fq(),Bk=uq(),Fk=dq(),Lk=cq(),Mk=rq(),Ak=oq();function Ik(Z=!1){let X=[qk.default,Bk.default,Fk.default,Lk.default,Mk.default,Ak.default,Uk.default,Kk.default,zk.default,Vk.default,Hk.default];if(Z)X.push(Wk.default,Yk.default);else X.push(Jk.default,Gk.default);return X.push($k.default),X}sq.default=Ik});var FJ=C((XB)=>{Object.defineProperty(XB,"__esModule",{value:!0});XB.dynamicAnchor=void 0;var BJ=L0(),Dk=c6(),eq=w8(),Tk=PZ(),wk={keyword:"$dynamicAnchor",schemaType:"string",code:(Z)=>ZB(Z,Z.schema)};function ZB(Z,X){let{gen:Q,it:J}=Z;J.schemaEnv.root.dynamicAnchors[X]=!0;let W=BJ._`${Dk.default.dynamicAnchors}${(0,BJ.getProperty)(X)}`,G=J.errSchemaPath==="#"?J.validateName:jk(Z);Q.if(BJ._`!${W}`,()=>Q.assign(W,G))}XB.dynamicAnchor=ZB;function jk(Z){let{schemaEnv:X,schema:Q,self:J}=Z.it,{root:W,baseId:G,localRefs:Y,meta:$}=X.root,{schemaId:z}=J.opts,U=new eq.SchemaEnv({schema:Q,schemaId:z,root:W,baseId:G,localRefs:Y,meta:$});return eq.compileSchema.call(J,U),(0,Tk.getValidate)(Z,U)}XB.default=wk});var LJ=C((YB)=>{Object.defineProperty(YB,"__esModule",{value:!0});YB.dynamicRef=void 0;var JB=L0(),Ek=c6(),WB=PZ(),Rk={keyword:"$dynamicRef",schemaType:"string",code:(Z)=>GB(Z,Z.schema)};function GB(Z,X){let{gen:Q,keyword:J,it:W}=Z;if(X[0]!=="#")throw Error(`"${J}" only supports hash fragment reference`);let G=X.slice(1);if(W.allErrors)Y();else{let z=Q.let("valid",!1);Y(z),Z.ok(z)}function Y(z){if(W.schemaEnv.root.dynamicAnchors[G]){let U=Q.let("_v",JB._`${Ek.default.dynamicAnchors}${(0,JB.getProperty)(G)}`);Q.if(U,$(U,z),$(W.validateName,z))}else $(W.validateName,z)()}function $(z,U){return U?()=>Q.block(()=>{(0,WB.callRef)(Z,z),Q.let(U,!0)}):()=>(0,WB.callRef)(Z,z)}}YB.dynamicRef=GB;YB.default=Rk});var UB=C((zB)=>{Object.defineProperty(zB,"__esModule",{value:!0});var Ck=FJ(),Sk=A0(),_k={keyword:"$recursiveAnchor",schemaType:"boolean",code(Z){if(Z.schema)(0,Ck.dynamicAnchor)(Z,"");else(0,Sk.checkStrictMode)(Z.it,"$recursiveAnchor: false is ignored")}};zB.default=_k});var VB=C((KB)=>{Object.defineProperty(KB,"__esModule",{value:!0});var xk=LJ(),bk={keyword:"$recursiveRef",schemaType:"string",code:(Z)=>(0,xk.dynamicRef)(Z,Z.schema)};KB.default=bk});var qB=C((HB)=>{Object.defineProperty(HB,"__esModule",{value:!0});var yk=FJ(),gk=LJ(),fk=UB(),hk=VB(),uk=[yk.default,gk.default,fk.default,hk.default];HB.default=uk});var LB=C((FB)=>{Object.defineProperty(FB,"__esModule",{value:!0});var BB=bZ(),dk={keyword:"dependentRequired",type:"object",schemaType:"object",error:BB.error,code:(Z)=>(0,BB.validatePropertyDeps)(Z)};FB.default=dk});var AB=C((MB)=>{Object.defineProperty(MB,"__esModule",{value:!0});var ck=bZ(),pk={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(Z)=>(0,ck.validateSchemaDeps)(Z)};MB.default=pk});var NB=C((IB)=>{Object.defineProperty(IB,"__esModule",{value:!0});var nk=A0(),rk={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:Z,parentSchema:X,it:Q}){if(X.contains===void 0)(0,nk.checkStrictMode)(Q,`"${Z}" without "contains" is ignored`)}};IB.default=rk});var TB=C((DB)=>{Object.defineProperty(DB,"__esModule",{value:!0});var ok=LB(),sk=AB(),tk=NB(),ek=[ok.default,sk.default,tk.default];DB.default=ek});var OB=C((jB)=>{Object.defineProperty(jB,"__esModule",{value:!0});var q4=L0(),wB=A0(),Xx=c6(),Qx={message:"must NOT have unevaluated properties",params:({params:Z})=>q4._`{unevaluatedProperty: ${Z.unevaluatedProperty}}`},Jx={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:Qx,code(Z){let{gen:X,schema:Q,data:J,errsCount:W,it:G}=Z;if(!W)throw Error("ajv implementation error");let{allErrors:Y,props:$}=G;if($ instanceof q4.Name)X.if(q4._`${$} !== true`,()=>X.forIn("key",J,(q)=>X.if(U($,q),()=>z(q))));else if($!==!0)X.forIn("key",J,(q)=>$===void 0?z(q):X.if(V($,q),()=>z(q)));G.props=!0,Z.ok(q4._`${W} === ${Xx.default.errors}`);function z(q){if(Q===!1){if(Z.setParams({unevaluatedProperty:q}),Z.error(),!Y)X.break();return}if(!(0,wB.alwaysValidSchema)(G,Q)){let B=X.name("valid");if(Z.subschema({keyword:"unevaluatedProperties",dataProp:q,dataPropType:wB.Type.Str},B),!Y)X.if((0,q4.not)(B),()=>X.break())}}function U(q,B){return q4._`!${q} || !${q}[${B}]`}function V(q,B){let F=[];for(let L in q)if(q[L]===!0)F.push(q4._`${B} !== ${L}`);return(0,q4.and)(...F)}}};jB.default=Jx});var PB=C((RB)=>{Object.defineProperty(RB,"__esModule",{value:!0});var f4=L0(),EB=A0(),Gx={message:({params:{len:Z}})=>f4.str`must NOT have more than ${Z} items`,params:({params:{len:Z}})=>f4._`{limit: ${Z}}`},Yx={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:Gx,code(Z){let{gen:X,schema:Q,data:J,it:W}=Z,G=W.items||0;if(G===!0)return;let Y=X.const("len",f4._`${J}.length`);if(Q===!1)Z.setParams({len:G}),Z.fail(f4._`${Y} > ${G}`);else if(typeof Q=="object"&&!(0,EB.alwaysValidSchema)(W,Q)){let z=X.var("valid",f4._`${Y} <= ${G}`);X.if((0,f4.not)(z),()=>$(z,G)),Z.ok(z)}W.items=!0;function $(z,U){X.forRange("i",U,Y,(V)=>{if(Z.subschema({keyword:"unevaluatedItems",dataProp:V,dataPropType:EB.Type.Num},z),!W.allErrors)X.if((0,f4.not)(z),()=>X.break())})}}};RB.default=Yx});var SB=C((CB)=>{Object.defineProperty(CB,"__esModule",{value:!0});var zx=OB(),Ux=PB(),Kx=[zx.default,Ux.default];CB.default=Kx});var kB=C((_B)=>{Object.defineProperty(_B,"__esModule",{value:!0});var l0=L0(),Hx={message:({schemaCode:Z})=>l0.str`must match format "${Z}"`,params:({schemaCode:Z})=>l0._`{format: ${Z}}`},qx={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Hx,code(Z,X){let{gen:Q,data:J,$data:W,schema:G,schemaCode:Y,it:$}=Z,{opts:z,errSchemaPath:U,schemaEnv:V,self:q}=$;if(!z.validateFormats)return;if(W)B();else F();function B(){let L=Q.scopeValue("formats",{ref:q.formats,code:z.code.formats}),I=Q.const("fDef",l0._`${L}[${Y}]`),A=Q.let("fType"),N=Q.let("format");Q.if(l0._`typeof ${I} == "object" && !(${I} instanceof RegExp)`,()=>Q.assign(A,l0._`${I}.type || "string"`).assign(N,l0._`${I}.validate`),()=>Q.assign(A,l0._`"string"`).assign(N,I)),Z.fail$data((0,l0.or)(D(),O()));function D(){if(z.strictSchema===!1)return l0.nil;return l0._`${Y} && !${N}`}function O(){let T=V.$async?l0._`(${I}.async ? await ${N}(${J}) : ${N}(${J}))`:l0._`${N}(${J})`,w=l0._`(typeof ${N} == "function" ? ${T} : ${N}.test(${J}))`;return l0._`${N} && ${N} !== true && ${A} === ${X} && !${w}`}}function F(){let L=q.formats[G];if(!L){D();return}if(L===!0)return;let[I,A,N]=O(L);if(I===X)Z.pass(T());function D(){if(z.strictSchema===!1){q.logger.warn(w());return}throw Error(w());function w(){return`unknown format "${G}" ignored in schema at path "${U}"`}}function O(w){let S=w instanceof RegExp?(0,l0.regexpCode)(w):z.code.formats?l0._`${z.code.formats}${(0,l0.getProperty)(G)}`:void 0,y=Q.scopeValue("formats",{key:G,ref:w,code:S});if(typeof w=="object"&&!(w instanceof RegExp))return[w.type||"string",w.validate,l0._`${y}.validate`];return["string",w,y]}function T(){if(typeof L=="object"&&!(L instanceof RegExp)&&L.async){if(!V.$async)throw Error("async format in sync schema");return l0._`await ${N}(${J})`}return typeof A=="function"?l0._`${N}(${J})`:l0._`${N}.test(${J})`}}}};_B.default=qx});var bB=C((xB)=>{Object.defineProperty(xB,"__esModule",{value:!0});var Fx=kB(),Lx=[Fx.default];xB.default=Lx});var gB=C((vB)=>{Object.defineProperty(vB,"__esModule",{value:!0});vB.contentVocabulary=vB.metadataVocabulary=void 0;vB.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];vB.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var uB=C((hB)=>{Object.defineProperty(hB,"__esModule",{value:!0});var Ix=_3(),Nx=Wq(),Dx=tq(),Tx=qB(),wx=TB(),jx=SB(),Ox=bB(),fB=gB(),Ex=[Tx.default,Ix.default,Nx.default,(0,Dx.default)(!0),Ox.default,fB.metadataVocabulary,fB.contentVocabulary,wx.default,jx.default];hB.default=Ex});var cB=C((dB)=>{Object.defineProperty(dB,"__esModule",{value:!0});dB.DiscrError=void 0;var mB;(function(Z){Z.Tag="tag",Z.Mapping="mapping"})(mB||(dB.DiscrError=mB={}))});var nB=C((iB)=>{Object.defineProperty(iB,"__esModule",{value:!0});var P9=L0(),MJ=cB(),pB=w8(),Px=D8(),Cx=A0(),Sx={message:({params:{discrError:Z,tagName:X}})=>Z===MJ.DiscrError.Tag?`tag "${X}" must be string`:`value of tag "${X}" must be in oneOf`,params:({params:{discrError:Z,tag:X,tagName:Q}})=>P9._`{error: ${Z}, tag: ${Q}, tagValue: ${X}}`},_x={keyword:"discriminator",type:"object",schemaType:"object",error:Sx,code(Z){let{gen:X,data:Q,schema:J,parentSchema:W,it:G}=Z,{oneOf:Y}=W;if(!G.opts.discriminator)throw Error("discriminator: requires discriminator option");let $=J.propertyName;if(typeof $!="string")throw Error("discriminator: requires propertyName");if(J.mapping)throw Error("discriminator: mapping is not supported");if(!Y)throw Error("discriminator: requires oneOf keyword");let z=X.let("valid",!1),U=X.const("tag",P9._`${Q}${(0,P9.getProperty)($)}`);X.if(P9._`typeof ${U} == "string"`,()=>V(),()=>Z.error(!1,{discrError:MJ.DiscrError.Tag,tag:U,tagName:$})),Z.ok(z);function V(){let F=B();X.if(!1);for(let L in F)X.elseIf(P9._`${U} === ${L}`),X.assign(z,q(F[L]));X.else(),Z.error(!1,{discrError:MJ.DiscrError.Mapping,tag:U,tagName:$}),X.endIf()}function q(F){let L=X.name("valid"),I=Z.subschema({keyword:"oneOf",schemaProp:F},L);return Z.mergeEvaluated(I,P9.Name),L}function B(){var F;let L={},I=N(W),A=!0;for(let T=0;T<Y.length;T++){let w=Y[T];if((w===null||w===void 0?void 0:w.$ref)&&!(0,Cx.schemaHasRulesButRef)(w,G.self.RULES)){let y=w.$ref;if(w=pB.resolveRef.call(G.self,G.schemaEnv.root,G.baseId,y),w instanceof pB.SchemaEnv)w=w.schema;if(w===void 0)throw new Px.default(G.opts.uriResolver,G.baseId,y)}let S=(F=w===null||w===void 0?void 0:w.properties)===null||F===void 0?void 0:F[$];if(typeof S!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${$}"`);A=A&&(I||N(w)),D(S,T)}if(!A)throw Error(`discriminator: "${$}" must be required`);return L;function N({required:T}){return Array.isArray(T)&&T.includes($)}function D(T,w){if(T.const)O(T.const,w);else if(T.enum)for(let S of T.enum)O(S,w);else throw Error(`discriminator: "properties/${$}" must have "const" or "enum"`)}function O(T,w){if(typeof T!="string"||T in L)throw Error(`discriminator: "${$}" values must be unique strings`);L[T]=w}}}};iB.default=_x});var rB=C((jd,xx)=>{xx.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var aB=C((Od,bx)=>{bx.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var oB=C((Ed,vx)=>{vx.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var sB=C((Rd,yx)=>{yx.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var tB=C((Pd,gx)=>{gx.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var eB=C((Cd,fx)=>{fx.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var ZF=C((Sd,hx)=>{hx.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var XF=C((_d,ux)=>{ux.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var JF=C((QF)=>{Object.defineProperty(QF,"__esModule",{value:!0});var mx=rB(),dx=aB(),lx=oB(),cx=sB(),px=tB(),ix=eB(),nx=ZF(),rx=XF(),ax=["/properties"];function ox(Z){return[mx,dx,lx,cx,px,X(this,ix),nx,X(this,rx)].forEach((Q)=>this.addMetaSchema(Q,void 0,!1)),this;function X(Q,J){return Z?Q.$dataMetaSchema(J,ax):J}}QF.default=ox});var WF=C((O6,IJ)=>{Object.defineProperty(O6,"__esModule",{value:!0});O6.MissingRefError=O6.ValidationError=O6.CodeGen=O6.Name=O6.nil=O6.stringify=O6.str=O6._=O6.KeywordCxt=O6.Ajv2020=void 0;var tx=T3(),ex=uB(),Zb=nB(),Xb=JF(),AJ="https://json-schema.org/draft/2020-12/schema";class b8 extends tx.default{constructor(Z={}){super({...Z,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),ex.default.forEach((Z)=>this.addVocabulary(Z)),this.opts.discriminator)this.addKeyword(Zb.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:Z,meta:X}=this.opts;if(!X)return;Xb.default.call(this,Z),this.refs["http://json-schema.org/schema"]=AJ}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(AJ)?AJ:void 0)}}O6.Ajv2020=b8;IJ.exports=O6=b8;IJ.exports.Ajv2020=b8;Object.defineProperty(O6,"__esModule",{value:!0});O6.default=b8;var Qb=N8();Object.defineProperty(O6,"KeywordCxt",{enumerable:!0,get:function(){return Qb.KeywordCxt}});var C9=L0();Object.defineProperty(O6,"_",{enumerable:!0,get:function(){return C9._}});Object.defineProperty(O6,"str",{enumerable:!0,get:function(){return C9.str}});Object.defineProperty(O6,"stringify",{enumerable:!0,get:function(){return C9.stringify}});Object.defineProperty(O6,"nil",{enumerable:!0,get:function(){return C9.nil}});Object.defineProperty(O6,"Name",{enumerable:!0,get:function(){return C9.Name}});Object.defineProperty(O6,"CodeGen",{enumerable:!0,get:function(){return C9.CodeGen}});var Jb=IZ();Object.defineProperty(O6,"ValidationError",{enumerable:!0,get:function(){return Jb.default}});var Wb=D8();Object.defineProperty(O6,"MissingRefError",{enumerable:!0,get:function(){return Wb.default}})});var YF={};D1(YF,{validateProjectFile:()=>Vb});import{existsSync as NJ,readFileSync as mZ}from"node:fs";import{createRequire as GF}from"node:module";import{isAbsolute as $b,relative as zb,resolve as uZ}from"node:path";import{fileURLToPath as Ub,pathToFileURL as Kb}from"node:url";async function Vb(Z){let X=uZ(Z),Q=uZ(X,"project.json"),J=uZ(X,"project.schema.json");if(!NJ(Q))throw Error(`project.json not found in ${X}`);if(!NJ(J))throw Error(`project.schema.json not found in ${X} — run \`jx schema\` to generate it from `+"project.json#/extensions");let W=JSON.parse(mZ(Q,"utf8")),G=JSON.parse(mZ(J,"utf8"));G.$id=Kb(J).href;let Y;try{({default:Y}=await Promise.resolve().then(() => J1(WF(),1)))}catch(V){throw Error("Project validation requires ajv: bun add ajv",{cause:V})}let z=await new Y({allErrors:!0,loadSchema:(V)=>Hb(V,X),strict:!1}).compileAsync(G),U=z(W);return{errors:z.errors??null,valid:U}}async function Hb(Z,X){if(!Z.startsWith("file:"))throw Error(`Cannot resolve schema ref "${Z}": only project-relative file refs are loadable (canonical URIs must resolve from already-loaded fragments)`);let Q=Ub(Z),J=zb(X,Q);if(J.startsWith("..")||$b(J))throw Error(`Schema ref "${Z}" escapes the project root ${X}`);if(NJ(Q))return JSON.parse(mZ(Q,"utf8"));let W=J.split("\\").join("/"),G="node_modules/",Y=W.lastIndexOf(G);if(Y===-1)throw Error(`Schema ref "${Z}" does not exist`);let $=W.slice(Y+G.length),z;try{z=GF(uZ(X,"package.json")).resolve($)}catch{try{z=GF(import.meta.url).resolve($)}catch(U){throw Error(`Schema ref "${Z}" does not exist and "${$}" is not resolvable from the project or the host`,{cause:U})}}return JSON.parse(mZ(z,"utf8"))}var $F=()=>{};import{relative as DJ,resolve as zF}from"node:path";async function qb(){let Z=process.argv.slice(2),[X]=Z;if(!X||X==="--help"||X==="-h")console.log(`Usage: jx <command> [options]
|
|
316
388
|
|
|
317
389
|
Commands:
|
|
318
390
|
build [root] Build a Jx site to dist/
|
|
391
|
+
dev [root] Start the dev server (requires @jxsuite/server and Bun)
|
|
392
|
+
preview [root] Serve an already-built dist/ directory
|
|
319
393
|
schema [root] Generate project.schema.json + document.schema.json from project.json#/extensions
|
|
320
394
|
validate [root] Validate project.json against its generated project.schema.json
|
|
321
395
|
db push [root] Sync the data section's tables to their connections (additive-only)
|
|
@@ -323,9 +397,10 @@ Commands:
|
|
|
323
397
|
Options:
|
|
324
398
|
--verbose Print detailed build progress
|
|
325
399
|
--no-clean Don't clean outDir before building
|
|
400
|
+
--port <n> dev/preview: port to listen on (default 3000 / 4173)
|
|
326
401
|
--dry-run db push: print the statements without executing them
|
|
327
|
-
--connection db push: restrict to one connection name`),process.exit(0);let Q=X==="db",
|
|
328
|
-
Usage: jx db push [root] [--dry-run] [--connection <name>]`),process.exit(1);let
|
|
329
|
-
Build completed with ${
|
|
330
|
-
Done: ${
|
|
331
|
-
Run "jx --help" for usage.`),process.exit(1)}var
|
|
402
|
+
--connection db push: restrict to one connection name`),process.exit(0);let Q=X==="db",J=Q?Z[1]:null,W=Z.slice(Q?2:1),G=new Set,Y=[],$,z;for(let q=0;q<W.length;q+=1){let B=W[q];if(B==="--connection")q+=1,$=W[q];else if(B==="--port"){q+=1;let F=Math.trunc(Number(W[q]??""));if(Number.isFinite(F)&&F>=0)z=F}else if(B.startsWith("--"))G.add(B);else Y.push(B)}let[U]=Y,V=zF(U??".");if(Q){if(J!=="push")console.error(`Unknown db subcommand: ${J??"(none)"}
|
|
403
|
+
Usage: jx db push [root] [--dry-run] [--connection <name>]`),process.exit(1);let q=G.has("--dry-run");try{let{dbPush:B}=await Promise.resolve().then(() => (eG(),tG)),{results:F,bindingsPatched:L,wranglerPath:I}=await B(V,{dryRun:q,...$===void 0?{}:{connection:$}});for(let A of F){let N=A.applied?"applied":"dry-run";console.log(`${A.connection} (${A.provider}) — ${A.tables.length} table(s), ${A.statements.length} statement(s) [${N}]`);for(let D of A.statements)console.log(` ${D}`);for(let D of A.warnings)console.warn(` warning: ${D}`)}if(L&&I)console.log(`Updated bindings in ${DJ(V,I)}`)}catch(B){console.error(`db push failed: ${B.message}`),process.exit(1)}return}if(X==="build"){let q=G.has("--verbose"),B=!G.has("--no-clean");console.log(`Building site from ${V}...`);try{let{buildSite:F}=await Promise.resolve().then(() => (SK(),CK)),L=await F(V,{clean:B,verbose:q});if(L.errors.length>0){console.error(`
|
|
404
|
+
Build completed with ${L.errors.length} error(s):`);for(let I of L.errors)console.error(` - ${I}`);process.exit(1)}console.log(`
|
|
405
|
+
Done: ${L.routes} routes → ${L.files} files`)}catch(F){console.error(`Build failed: ${F.message}`),process.exit(1)}}else if(X==="dev")try{let{runDev:q}=await Promise.resolve().then(() => (xK(),kK));q(V,z)}catch(q){console.error(q.message),process.exit(1)}else if(X==="preview"){let{existsSync:q}=await import("node:fs"),B=zF(V,"dist");if(!q(B))console.error(`No build output at ${B} — run \`jx build\` first.`),process.exit(1);let{startPreviewServer:F}=await Promise.resolve().then(() => (fK(),gK)),L=z??4173;F(B,L),console.log(`Previewing ${B} at http://localhost:${L}`)}else if(X==="schema")try{let{writeProjectSchemas:q}=await Promise.resolve().then(() => (ZV(),eK)),{projectSchemaPath:B,documentSchemaPath:F}=await q(V);console.log(`Wrote ${DJ(V,B)}`),console.log(`Wrote ${DJ(V,F)}`)}catch(q){console.error(`Schema generation failed: ${q.message}`),process.exit(1)}else if(X==="validate")try{let{validateProjectFile:q}=await Promise.resolve().then(() => ($F(),YF)),{valid:B,errors:F}=await q(V);if(B)console.log(`project.json is valid (${V})`);else{console.error(`project.json is INVALID (${V}):`);for(let L of F??[]){let{instancePath:I,message:A}=L??{};console.error(` - ${I||"/"}: ${A??JSON.stringify(L)}`)}process.exit(1)}}catch(q){console.error(`Validation failed: ${q.message}`),process.exit(1)}else console.error(`Unknown command: ${X}
|
|
406
|
+
Run "jx --help" for usage.`),process.exit(1)}var id=qb();export{id as ready};
|