@jxsuite/compiler 1.4.0 → 1.5.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 +155 -156
- package/dist/compiler.js +105 -107
- package/package.json +6 -6
- package/src/shared.ts +236 -8
- package/src/site/schema-command.ts +37 -77
- package/src/site/site-build.ts +53 -14
- package/src/site/validate-command.ts +133 -37
- package/src/targets/compile-client.ts +63 -67
- package/src/targets/compile-element.ts +246 -31
- package/src/targets/compile-static.ts +8 -2
package/dist/cli.js
CHANGED
|
@@ -1,60 +1,62 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as cA}from"node:module";var yA=Object.create;var{getPrototypeOf:vA,defineProperty:jZ,getOwnPropertyNames:gA}=Object;var fA=Object.prototype.hasOwnProperty;function hA($){return this[$]}var uA,mA,B$=($,Z,X)=>{var Q=$!=null&&typeof $==="object";if(Q){var J=Z?uA??=new WeakMap:mA??=new WeakMap,G=J.get($);if(G)return G}X=$!=null?yA(vA($)):{};let W=Z||!$||!$.__esModule?jZ(X,"default",{value:$,enumerable:!0}):X;for(let Y of gA($))if(!fA.call(W,Y))jZ(W,Y,{get:hA.bind($,Y),enumerable:!0});if(Q)J.set($,W);return W};var x=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var dA=($)=>$;function lA($,Z){this[$]=dA.bind(null,Z)}var h6=($,Z)=>{for(var X in Z)jZ($,X,{get:Z[X],enumerable:!0,configurable:!0,set:lA.bind(Z,X)})};var s=($,Z)=>()=>($&&(Z=$($=0)),Z);var O0=cA(import.meta.url);function OZ($){let Z=$.$map;return Z&&typeof Z==="object"?Z:void 0}function uJ($){return $.startsWith("window#/")&&iA.has($.slice(8))}function q1($){return gJ.has($)}function u0($,Z){if(!$)return;let X=($.depth??0)+1;if(X>rA)return;return{depth:X,path:[...$.path??[],...Array.isArray(Z)?Z:[Z]],report:$.report}}function g0($,Z,X,Q,J){if($===null||$===void 0)return $;if(typeof $==="object"&&!Array.isArray($)&&"operator"in $)return u$($,Z,X,Q,J);if(typeof $==="object"&&!Array.isArray($)&&"$ref"in $){let G=mJ($.$ref,Z,X,Q);return J?.report(J.path??[],G),G}if(Array.isArray($))return $.map((G,W)=>g0(G,Z,X,Q,u0(J,W)));return J?.report(J.path??[],$),$}function mJ($,Z,X,Q){if($==="$reduce/acc")return Q?.acc;if($.startsWith("$reduce/"))return Q?.acc;if($.startsWith("$args/")){let J=$.slice(6).split("/"),G=Q?.args?.[J[0]];return J.length>1?u6(G,J.slice(1).join("/")):G}if($.startsWith("event#/")){let J=$.slice(7);return u6(X,J)}if($.startsWith("$map/")){let J=$.split("/"),[,G]=J,W,Y=OZ(Z);if(G==="item")W=Q?.item??Y?.item??Z["$map/item"];else if(G==="index")W=Q?.index??Y?.index??Z["$map/index"];else W=Y?.[G]??Z[`$map/${G}`];return J.length>2?u6(W,J.slice(2).join("/")):W}if($.startsWith("#/state/")){let J=$.slice(8),G=J.indexOf("/");if(G===-1)return Z[J];return u6(Z[J.slice(0,G)],J.slice(G+1))}if($.startsWith("parent#/"))return Z[$.slice(8)];if($.startsWith("window#/"))return u6(globalThis.window,$.slice(8));if($.startsWith("document#/"))return u6(globalThis.document,$.slice(10));return Z[$]??null}function aA($,Z,X,Q){if($.startsWith("$map/")){let J=$.split("/"),[,G]=J,W,Y=OZ(Z);if(G==="item")W=Q?.item??Y?.item??Z["$map/item"];else if(G==="index")W=Q?.index??Y?.index??Z["$map/index"];else W=Y?.[G]??Z[`$map/${G}`];if(J.length>2){let z=J.slice(2),q=z.pop(),H=z.length>0?u6(W,z.join("/")):W;return{key:q,obj:H}}return{key:G==="item"?"$map/item":"$map/index",obj:OZ(Z)??Z}}if($.startsWith("#/state/")){let J=$.slice(8);if(J.indexOf("/")===-1)return{key:J,obj:Z};let W=J.split("/"),Y=W.pop(),z=Z;for(let q of W)z=z[q];return{key:Y,obj:z}}return{key:$,obj:Z}}function u$($,Z,X,Q,J){let G=oA($,Z,X,Q,J);return J?.report(J.path??[],G),G}function oA($,Z,X,Q,J){let{operator:G,target:W,value:Y,initial:z}=$;if(!pA.has(G))throw Error(`$expression: unknown operator "${G}"`);if(EZ.has(G)&&!("value"in $)){let q=g0(W,Z,X,Q,u0(J,"target"));if(G==="!")return!q;if(G==="-")return-q}if(G==="call"){let q=W?.$ref;if(typeof q!=="string")throw TypeError("$expression: call target must be a $ref pointer");let H=(Q?.callDepth??0)+1;if(H>yJ)throw Error(`$expression: call depth exceeded (${yJ})`);let B=Array.isArray(Y)?Y.map((M,A)=>g0(M,Z,X,Q,u0(J,["value",A]))):[];if(q.startsWith("window#/")){if(!uJ(q))throw Error(`$expression: "${q}" is not a blessed pure global`);let M=q.slice(8),A=nA[M];if(A)return A(...B);let w=u6(globalThis.window,M),D=M.lastIndexOf("/"),j=D===-1?globalThis.window:u6(globalThis.window,M.slice(0,D));return w.apply(j,B)}let F=mJ(q,Z,X,Q);if(typeof F==="function")return F(...B);if(F&&typeof F==="object"&&"$expression"in F){let M=F,A={};for(let[w,D]of(M.parameters??[]).entries()){let j=typeof D==="string"?D:D?.name??"";if(!j)continue;A[j]=B[w]===void 0&&typeof D==="object"&&D!==null&&"default"in D?D.default:B[w]}return u$(M.$expression,Z,X,{args:A,callDepth:H})}throw TypeError(`$expression: call target "${q}" is not callable`)}if(CZ.has(G)){if(G==="?:"){let M=g0(W,Z,X,Q,u0(J,"target"));if(J){let A=g0(Y,Z,X,Q,u0(J,"value")),w=g0(z,Z,X,Q,u0(J,"initial"));return M?A:w}return M?g0(Y,Z,X,Q):g0(z,Z,X,Q)}let q=g0(W,Z,X,Q,u0(J,"target")),H=String(q),B=$.cases??{},F=Object.hasOwn(B,H);if(J){let M;for(let[w,D]of Object.entries(B)){let j=g0(D,Z,X,Q,u0(J,["cases",w]));if(w===H)M=j}let A=g0($.default,Z,X,Q,u0(J,"default"));return F?M:A}return F?g0(B[H],Z,X,Q):g0($.default,Z,X,Q)}if(RZ.has(G)){let q=g0(W,Z,X,Q,u0(J,"target")),H=g0(Y,Z,X,Q,u0(J,"value"));switch(G){case"+":return q+H;case"-":return q-H;case"*":return q*H;case"/":return q/H;case"%":return q%H;case"===":return q===H;case"!==":return q!==H;case"<":return q<H;case"<=":return q<=H;case">":return q>H;case">=":return q>=H;case"&&":return q&&H;case"||":return q||H;case"??":return q??H;default:break}}if(fJ.has(G)){let q=g0(Y,Z,X,Q,u0(J,"value")),{obj:H,key:B}=aA(W.$ref,Z,X,Q);switch(G){case"=":{H[B]=q;break}case"+=":{let F=H[B];H[B]=F+q;break}case"-=":{let F=H[B];H[B]=F-q;break}case"*=":{let F=H[B];H[B]=F*q;break}case"/=":{let F=H[B];H[B]=F/q;break}default:break}return}if(hJ.has(G)){let q=g0(W,Z,X,Q,u0(J,"target"));switch(G){case"push":return q.push(g0(Y,Z,X,Q,u0(J,"value")));case"unshift":return q.unshift(g0(Y,Z,X,Q,u0(J,"value")));case"pop":return q.pop();case"shift":return q.shift();case"splice":{let H=g0(Y,Z,X,Q,u0(J,"value"));return q.splice(...H)}default:break}}if(SZ.has(G)){let q=g0(W,Z,X,Q,u0(J,"target")),H=Y===void 0?[]:Array.isArray(Y)?g0(Y,Z,X,Q,u0(J,"value")):[g0(Y,Z,X,Q,u0(J,"value"))],B=q?.[G];if(typeof B!=="function")return;return B.apply(q,H)}if(PZ.has(G)){let q=g0(W,Z,X,Q,u0(J,"target"));if(G==="reduce"){let H=g0(z,Z,X,Q,u0(J,"initial"));for(let[B,F]of q.entries())H=u$(Y,Z,X,{acc:H,index:B,item:F},B===0?u0(J,"value"):void 0);return H}if(G==="map")return q.map((H,B)=>u$(Y,Z,X,{...Q,index:B,item:H},B===0?u0(J,"value"):void 0));if(G==="filter")return q.filter((H,B)=>u$(Y,Z,X,{...Q,index:B,item:H},B===0?u0(J,"value"):void 0))}return}function d0($,Z){if($===null)return"null";if($===void 0)return"undefined";if(typeof $==="object"&&!Array.isArray($)&&"operator"in $)return F$($,Z);if(typeof $==="object"&&!Array.isArray($)&&"$ref"in $)return _Z($.$ref,Z);if(Array.isArray($))return $.map((X)=>d0(X,Z)).join(", ");return JSON.stringify($)}function sA($){return`_fx_${$.replaceAll(/[^A-Za-z0-9_$]/g,"_")}`}function _Z($,Z){let X=Z.statePrefix??"state",Q=Z.eventParam??"event";if($==="$reduce/acc")return"_acc";if($.startsWith("$reduce/"))return"_acc";if($.startsWith("$args/"))return`_args${$.slice(6).split("/").map((G)=>`[${JSON.stringify(G)}]`).join("")}`;if($.startsWith("event#/")){let J=$.slice(7);return`${Q}.${J.replaceAll("/",".")}`}if($.startsWith("$map/")){let J=$.split("/"),[,G]=J;if(G==="item")return J.length>2?`_item.${J.slice(2).join(".")}`:"_item";if(G==="index")return"_index";return`_${G}`}if($.startsWith("#/state/")){let J=$.slice(8);return`${X}.${J.replaceAll("/",".")}`}if($.startsWith("parent#/"))return`${X}.${$.slice(8)}`;if($.startsWith("window#/"))return`window.${$.slice(8).replaceAll("/",".")}`;if($.startsWith("document#/"))return`document.${$.slice(10).replaceAll("/",".")}`;return`${X}.${$}`}function vJ($,Z){if(typeof $==="object"&&$!==null&&"$ref"in $)return _Z($.$ref,Z);return d0($,Z)}function tA($,Z){let X=(Q)=>Z[Q]??"undefined";switch($){case"Intl/formatNumber":return`new Intl.NumberFormat(${X(1)}, ${X(2)}).format(${X(0)})`;case"Intl/formatDate":return`new Intl.DateTimeFormat(${X(1)}, ${X(2)}).format(new Date(${X(0)}))`;case"Intl/formatRelativeTime":return`new Intl.RelativeTimeFormat(${X(2)}, ${X(3)}).format(${X(0)}, ${X(1)})`;default:return null}}function F$($,Z={}){let{operator:X,target:Q,value:J,initial:G}=$;if(EZ.has(X)&&!("value"in $)){let W=d0(Q,Z);if(X==="!")return`!(${W})`;if(X==="-")return`-(${W})`}if(X==="call"){let W=Q?.$ref??"",Y=Array.isArray(J)?J.map((z)=>d0(z,Z)):[];if(W.startsWith("window#/")){if(!uJ(W))throw Error(`$expression: "${W}" is not a blessed pure global`);let z=tA(W.slice(8),Y);if(z)return z;return`window.${W.slice(8).replaceAll("/",".")}(${Y.join(", ")})`}if(W.startsWith("#/state/")){let z=W.slice(8),q=Z.formulaParams?.[z];if(q){let H=q.map((B,F)=>`${JSON.stringify(B)}: ${Y[F]??"undefined"}`).join(", ");return`${sA(z)}(${Z.statePrefix??"state"}, { ${H} })`}}return`${_Z(W,Z)}(${Y.join(", ")})`}if(CZ.has(X)){if(X==="?:"){let q=d0(Q,Z),H=d0(J,Z),B=d0(G,Z);return`(${q} ? ${H} : ${B})`}let W=d0(Q,Z),Y=Object.entries($.cases??{}).map(([q,H])=>`_d === ${JSON.stringify(q)} ? ${d0(H,Z)} : `).join(""),z="default"in $?d0($.default,Z):"undefined";return`((_d) => ${Y}${z})(String(${W}))`}if(RZ.has(X)){let W=d0(Q,Z),Y=d0(J,Z);return`(${W} ${X} ${Y})`}if(fJ.has(X)){let W=vJ(Q,Z),Y=d0(J,Z);return`${W} ${X} ${Y}`}if(hJ.has(X)){let W=vJ(Q,Z);switch(X){case"push":return`${W}.push(${d0(J,Z)})`;case"unshift":return`${W}.unshift(${d0(J,Z)})`;case"pop":return`${W}.pop()`;case"shift":return`${W}.shift()`;case"splice":{let Y=Array.isArray(J)?J.map((z)=>d0(z,Z)).join(", "):d0(J,Z);return`${W}.splice(${Y})`}default:break}}if(SZ.has(X)){let W=d0(Q,Z),Y=J===void 0?"":Array.isArray(J)?J.map((z)=>d0(z,Z)).join(", "):d0(J,Z);return`(${W})?.${X}?.(${Y})`}if(PZ.has(X)){let W=d0(Q,Z),Y=F$(J,Z);if(X==="reduce"){let z=d0(G,Z);return`${W}.reduce((_acc, _item, _index) => ${Y}, ${z})`}if(X==="map")return`${W}.map((_item, _index) => ${Y})`;if(X==="filter")return`${W}.filter((_item, _index) => ${Y})`}return"undefined"}function u6($,Z){let X=$;for(let Q of Z.split(/[./]/))X=X?.[Q];return X}function L5($,Z,X,Q){return g0($,Z,X,Q)}function M5($,Z={}){return d0($,Z)}var gJ,EZ,RZ,fJ,hJ,PZ,CZ,SZ,pA,iA,nA,yJ=64,rA=64;var W9=s(()=>{gJ=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),EZ=new Set(["!","-"]),RZ=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),fJ=new Set(["=","+=","-=","*=","/="]),hJ=new Set(["push","pop","shift","unshift","splice"]),PZ=new Set(["reduce","map","filter"]),CZ=new Set(["?:","switch"]),SZ=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"]),pA=new Set([...gJ,...EZ,...RZ,...PZ,...CZ,...SZ,"call"]),iA=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"]),nA={"Intl/formatDate":($,Z,X)=>new Intl.DateTimeFormat(Z,X).format(new Date($)),"Intl/formatNumber":($,Z,X)=>new Intl.NumberFormat(Z,X).format($),"Intl/formatRelativeTime":($,Z,X,Q)=>new Intl.RelativeTimeFormat(X,Q).format($,Z)}});function m$($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function d$($){return m$($)&&typeof $.$ref==="string"}function I6($){return m$($)&&$.$prototype==="Function"}function n$($){return m$($)&&m$($.$expression)}function v1($){return n$($)&&Array.isArray($.parameters)&&$.parameters.length>0}function N6($){return I6($)&&Array.isArray($.body)}function g1($){return m$($)&&typeof $.$prototype==="string"&&$.$prototype!=="Function"}function xZ($){return m$($)&&$.timing==="server"&&typeof $.$src==="string"&&typeof $.$export==="string"&&!$.$prototype}function dJ($){return m$($)&&!$.$prototype&&!$.$expression&&"default"in $}function U1($){if(!m$($))return!1;for(let Z of Object.keys($))if(!lJ.has(Z))return!1;return!0}function G$($){return m$($)&&$.$prototype==="Array"}function bZ($){if(G$($))return!0;return Array.isArray($)&&$.some((Z)=>G$(Z))}function cJ($){return m$($)&&$.$prototype==="Class"}function w0($){return typeof $==="string"&&$.includes("${")}function kZ($){return/\breturn\b/.test($)}function K1($){if(!$)return[];return $.map((Z)=>typeof Z==="string"?Z:Z.name)}var lJ;var D6=s(()=>{lJ=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function pJ($){if("operator"in $)return"expression";if("if"in $)return"if";if("$switch"in $)return"switch";return"dispatch"}async function z4($,Z,X,Q={}){let J=Q.args?{args:Q.args}:void 0;for(let G of $)switch(pJ(G)){case"expression":{let W=u$(G,Z,X,J);if(W&&typeof W.then==="function")await W;break}case"if":{let W=G,Y=L5(W.if,Z,X,J)?W.then:W.else;if(Array.isArray(Y))await z4(Y,Z,X,Q);break}case"switch":{let W=G,Y=String(L5(W.$switch,Z,X,J)),z=W.cases??{},q=Object.hasOwn(z,Y)?z[Y]:W.default;if(Array.isArray(q))await z4(q,Z,X,Q);break}case"dispatch":{let W=G,Y=Q.target??X?.currentTarget;if(!Y)break;let z={};if("detail"in W)z.detail=L5(W.detail,Z,X,J);if(W.bubbles!==void 0)z.bubbles=W.bubbles;if(W.composed!==void 0)z.composed=W.composed;Y.dispatchEvent(new CustomEvent(W.dispatchEvent,z));break}default:break}}function r$($,Z={}){let X=Z.indent??"",Q=[];for(let J of $)switch(pJ(J)){case"expression":{Q.push(`${X}${F$(J,Z)};`);break}case"if":{let G=J,W=M5(G.if,Z),Y={...Z,indent:`${X} `};if(Q.push(`${X}if (${W}) {`,r$(G.then??[],Y)),G.else)Q.push(`${X}} else {`,r$(G.else,Y));Q.push(`${X}}`);break}case"switch":{let G=J,W=M5(G.$switch,Z),Y={...Z,indent:`${X} `};Q.push(`${X}switch (String(${W})) {`);for(let[z,q]of Object.entries(G.cases??{}))Q.push(`${X} case ${JSON.stringify(z)}: {`,r$(q,Y),`${X} break;`,`${X} }`);if(G.default)Q.push(`${X} default: {`,r$(G.default,Y),`${X} }`);Q.push(`${X}}`);break}case"dispatch":{let G=J,W=Z.eventParam??"event",Y=Z.dispatchTarget??`(${W} && ${W}.currentTarget)`,z=[];if("detail"in G)z.push(`detail: ${M5(G.detail,Z)}`);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 q=z.length>0?`, { ${z.join(", ")} }`:"";Q.push(`${X}${Y}?.dispatchEvent(new CustomEvent(${JSON.stringify(G.dispatchEvent)}${q}));`);break}default:break}return Q.join(`
|
|
3
|
-
`)}var
|
|
2
|
+
import{createRequire as X2}from"node:module";var nA=Object.create;var{getPrototypeOf:rA,defineProperty:kZ,getOwnPropertyNames:aA}=Object;var oA=Object.prototype.hasOwnProperty;function sA($){return this[$]}var tA,eA,F$=($,Z,X)=>{var Q=$!=null&&typeof $==="object";if(Q){var J=Z?tA??=new WeakMap:eA??=new WeakMap,G=J.get($);if(G)return G}X=$!=null?nA(rA($)):{};let W=Z||!$||!$.__esModule?kZ(X,"default",{value:$,enumerable:!0}):X;for(let Y of aA($))if(!oA.call(W,Y))kZ(W,Y,{get:sA.bind($,Y),enumerable:!0});if(Q)J.set($,W);return W};var b=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var $2=($)=>$;function Z2($,Z){this[$]=$2.bind(null,Z)}var m1=($,Z)=>{for(var X in Z)kZ($,X,{get:Z[X],enumerable:!0,configurable:!0,set:Z2.bind(Z,X)})};var s=($,Z)=>()=>($&&(Z=$($=0)),Z);var O0=X2(import.meta.url);function yZ($){let Z=$.$map;return Z&&typeof Z==="object"?Z:void 0}function oJ($){return $.startsWith("window#/")&&J2.has($.slice(8))}function U6($){return nJ.has($)}function u0($,Z){if(!$)return;let X=($.depth??0)+1;if(X>W2)return;return{depth:X,path:[...$.path??[],...Array.isArray(Z)?Z:[Z]],report:$.report}}function g0($,Z,X,Q,J){if($===null||$===void 0)return $;if(typeof $==="object"&&!Array.isArray($)&&"operator"in $)return m$($,Z,X,Q,J);if(typeof $==="object"&&!Array.isArray($)&&"$ref"in $){let G=sJ($.$ref,Z,X,Q);return J?.report(J.path??[],G),G}if(Array.isArray($))return $.map((G,W)=>g0(G,Z,X,Q,u0(J,W)));return J?.report(J.path??[],$),$}function sJ($,Z,X,Q){if($==="$reduce/acc")return Q?.acc;if($.startsWith("$reduce/"))return Q?.acc;if($.startsWith("$args/")){let J=$.slice(6).split("/"),G=Q?.args?.[J[0]];return J.length>1?d1(G,J.slice(1).join("/")):G}if($.startsWith("event#/")){let J=$.slice(7);return d1(X,J)}if($.startsWith("$map/")){let J=$.split("/"),[,G]=J,W,Y=yZ(Z);if(G==="item")W=Q?.item??Y?.item??Z["$map/item"];else if(G==="index")W=Q?.index??Y?.index??Z["$map/index"];else W=Y?.[G]??Z[`$map/${G}`];return J.length>2?d1(W,J.slice(2).join("/")):W}if($.startsWith("#/state/")){let J=$.slice(8),G=J.indexOf("/");if(G===-1)return Z[J];return d1(Z[J.slice(0,G)],J.slice(G+1))}if($.startsWith("parent#/"))return Z[$.slice(8)];if($.startsWith("window#/"))return d1(globalThis.window,$.slice(8));if($.startsWith("document#/"))return d1(globalThis.document,$.slice(10));return Z[$]??null}function Y2($,Z,X,Q){if($.startsWith("$map/")){let J=$.split("/"),[,G]=J,W,Y=yZ(Z);if(G==="item")W=Q?.item??Y?.item??Z["$map/item"];else if(G==="index")W=Q?.index??Y?.index??Z["$map/index"];else W=Y?.[G]??Z[`$map/${G}`];if(J.length>2){let z=J.slice(2),q=z.pop(),H=z.length>0?d1(W,z.join("/")):W;return{key:q,obj:H}}return{key:G==="item"?"$map/item":"$map/index",obj:yZ(Z)??Z}}if($.startsWith("#/state/")){let J=$.slice(8);if(J.indexOf("/")===-1)return{key:J,obj:Z};let W=J.split("/"),Y=W.pop(),z=Z;for(let q of W)z=z[q];return{key:Y,obj:z}}return{key:$,obj:Z}}function m$($,Z,X,Q,J){let G=z2($,Z,X,Q,J);return J?.report(J.path??[],G),G}function z2($,Z,X,Q,J){let{operator:G,target:W,value:Y,initial:z}=$;if(!Q2.has(G))throw Error(`$expression: unknown operator "${G}"`);if(vZ.has(G)&&!("value"in $)){let q=g0(W,Z,X,Q,u0(J,"target"));if(G==="!")return!q;if(G==="-")return-q}if(G==="call"){let q=W?.$ref;if(typeof q!=="string")throw TypeError("$expression: call target must be a $ref pointer");let H=(Q?.callDepth??0)+1;if(H>pJ)throw Error(`$expression: call depth exceeded (${pJ})`);let B=Array.isArray(Y)?Y.map((L,w)=>g0(L,Z,X,Q,u0(J,["value",w]))):[];if(q.startsWith("window#/")){if(!oJ(q))throw Error(`$expression: "${q}" is not a blessed pure global`);let L=q.slice(8),w=G2[L];if(w)return w(...B);let N=d1(globalThis.window,L),I=L.lastIndexOf("/"),T=I===-1?globalThis.window:d1(globalThis.window,L.slice(0,I));return N.apply(T,B)}let F=sJ(q,Z,X,Q);if(typeof F==="function")return F(...B);if(F&&typeof F==="object"&&"$expression"in F){let L=F,w={};for(let[N,I]of(L.parameters??[]).entries()){let T=typeof I==="string"?I:I?.name??"";if(!T)continue;w[T]=B[N]===void 0&&typeof I==="object"&&I!==null&&"default"in I?I.default:B[N]}return m$(L.$expression,Z,X,{args:w,callDepth:H})}throw TypeError(`$expression: call target "${q}" is not callable`)}if(hZ.has(G)){if(G==="?:"){let L=g0(W,Z,X,Q,u0(J,"target"));if(J){let w=g0(Y,Z,X,Q,u0(J,"value")),N=g0(z,Z,X,Q,u0(J,"initial"));return L?w:N}return L?g0(Y,Z,X,Q):g0(z,Z,X,Q)}let q=g0(W,Z,X,Q,u0(J,"target")),H=String(q),B=$.cases??{},F=Object.hasOwn(B,H);if(J){let L;for(let[N,I]of Object.entries(B)){let T=g0(I,Z,X,Q,u0(J,["cases",N]));if(N===H)L=T}let w=g0($.default,Z,X,Q,u0(J,"default"));return F?L:w}return F?g0(B[H],Z,X,Q):g0($.default,Z,X,Q)}if(gZ.has(G)){let q=g0(W,Z,X,Q,u0(J,"target")),H=g0(Y,Z,X,Q,u0(J,"value"));switch(G){case"+":return q+H;case"-":return q-H;case"*":return q*H;case"/":return q/H;case"%":return q%H;case"===":return q===H;case"!==":return q!==H;case"<":return q<H;case"<=":return q<=H;case">":return q>H;case">=":return q>=H;case"&&":return q&&H;case"||":return q||H;case"??":return q??H;default:break}}if(rJ.has(G)){let q=g0(Y,Z,X,Q,u0(J,"value")),{obj:H,key:B}=Y2(W.$ref,Z,X,Q);switch(G){case"=":{H[B]=q;break}case"+=":{let F=H[B];H[B]=F+q;break}case"-=":{let F=H[B];H[B]=F-q;break}case"*=":{let F=H[B];H[B]=F*q;break}case"/=":{let F=H[B];H[B]=F/q;break}default:break}return}if(aJ.has(G)){let q=g0(W,Z,X,Q,u0(J,"target"));switch(G){case"push":return q.push(g0(Y,Z,X,Q,u0(J,"value")));case"unshift":return q.unshift(g0(Y,Z,X,Q,u0(J,"value")));case"pop":return q.pop();case"shift":return q.shift();case"splice":{let H=g0(Y,Z,X,Q,u0(J,"value"));return q.splice(...H)}default:break}}if(uZ.has(G)){let q=g0(W,Z,X,Q,u0(J,"target")),H=Y===void 0?[]:Array.isArray(Y)?g0(Y,Z,X,Q,u0(J,"value")):[g0(Y,Z,X,Q,u0(J,"value"))],B=q?.[G];if(typeof B!=="function")return;return B.apply(q,H)}if(fZ.has(G)){let q=g0(W,Z,X,Q,u0(J,"target"));if(G==="reduce"){let H=g0(z,Z,X,Q,u0(J,"initial"));for(let[B,F]of q.entries())H=m$(Y,Z,X,{acc:H,index:B,item:F},B===0?u0(J,"value"):void 0);return H}if(G==="map")return q.map((H,B)=>m$(Y,Z,X,{...Q,index:B,item:H},B===0?u0(J,"value"):void 0));if(G==="filter")return q.filter((H,B)=>m$(Y,Z,X,{...Q,index:B,item:H},B===0?u0(J,"value"):void 0))}return}function l0($,Z){if($===null)return"null";if($===void 0)return"undefined";if(typeof $==="object"&&!Array.isArray($)&&"operator"in $)return L$($,Z);if(typeof $==="object"&&!Array.isArray($)&&"$ref"in $)return mZ($.$ref,Z);if(Array.isArray($))return $.map((X)=>l0(X,Z)).join(", ");return JSON.stringify($)}function q2($){return`_fx_${$.replaceAll(/[^A-Za-z0-9_$]/g,"_")}`}function mZ($,Z){let X=Z.statePrefix??"state",Q=Z.eventParam??"event";if($==="$reduce/acc")return"_acc";if($.startsWith("$reduce/"))return"_acc";if($.startsWith("$args/"))return`_args${$.slice(6).split("/").map((G)=>`[${JSON.stringify(G)}]`).join("")}`;if($.startsWith("event#/")){let J=$.slice(7);return`${Q}.${J.replaceAll("/",".")}`}if($.startsWith("$map/")){let J=$.split("/"),[,G]=J;if(G==="item")return J.length>2?`_item.${J.slice(2).join(".")}`:"_item";if(G==="index")return"_index";return`_${G}`}if($.startsWith("#/state/")){let J=$.slice(8);return`${X}.${J.replaceAll("/",".")}`}if($.startsWith("parent#/"))return`${X}.${$.slice(8)}`;if($.startsWith("window#/"))return`window.${$.slice(8).replaceAll("/",".")}`;if($.startsWith("document#/"))return`document.${$.slice(10).replaceAll("/",".")}`;return`${X}.${$}`}function iJ($,Z){if(typeof $==="object"&&$!==null&&"$ref"in $)return mZ($.$ref,Z);return l0($,Z)}function K2($,Z){let X=(Q)=>Z[Q]??"undefined";switch($){case"Intl/formatNumber":return`new Intl.NumberFormat(${X(1)}, ${X(2)}).format(${X(0)})`;case"Intl/formatDate":return`new Intl.DateTimeFormat(${X(1)}, ${X(2)}).format(new Date(${X(0)}))`;case"Intl/formatRelativeTime":return`new Intl.RelativeTimeFormat(${X(2)}, ${X(3)}).format(${X(0)}, ${X(1)})`;default:return null}}function L$($,Z={}){let{operator:X,target:Q,value:J,initial:G}=$;if(vZ.has(X)&&!("value"in $)){let W=l0(Q,Z);if(X==="!")return`!(${W})`;if(X==="-")return`-(${W})`}if(X==="call"){let W=Q?.$ref??"",Y=Array.isArray(J)?J.map((z)=>l0(z,Z)):[];if(W.startsWith("window#/")){if(!oJ(W))throw Error(`$expression: "${W}" is not a blessed pure global`);let z=K2(W.slice(8),Y);if(z)return z;return`window.${W.slice(8).replaceAll("/",".")}(${Y.join(", ")})`}if(W.startsWith("#/state/")){let z=W.slice(8),q=Z.formulaParams?.[z];if(q){let H=q.map((B,F)=>`${JSON.stringify(B)}: ${Y[F]??"undefined"}`).join(", ");return`${q2(z)}(${Z.statePrefix??"state"}, { ${H} })`}}return`${mZ(W,Z)}(${Y.join(", ")})`}if(hZ.has(X)){if(X==="?:"){let q=l0(Q,Z),H=l0(J,Z),B=l0(G,Z);return`(${q} ? ${H} : ${B})`}let W=l0(Q,Z),Y=Object.entries($.cases??{}).map(([q,H])=>`_d === ${JSON.stringify(q)} ? ${l0(H,Z)} : `).join(""),z="default"in $?l0($.default,Z):"undefined";return`((_d) => ${Y}${z})(String(${W}))`}if(gZ.has(X)){let W=l0(Q,Z),Y=l0(J,Z);return`(${W} ${X} ${Y})`}if(rJ.has(X)){let W=iJ(Q,Z),Y=l0(J,Z);return`${W} ${X} ${Y}`}if(aJ.has(X)){let W=iJ(Q,Z);switch(X){case"push":return`${W}.push(${l0(J,Z)})`;case"unshift":return`${W}.unshift(${l0(J,Z)})`;case"pop":return`${W}.pop()`;case"shift":return`${W}.shift()`;case"splice":{let Y=Array.isArray(J)?J.map((z)=>l0(z,Z)).join(", "):l0(J,Z);return`${W}.splice(${Y})`}default:break}}if(uZ.has(X)){let W=l0(Q,Z),Y=J===void 0?"":Array.isArray(J)?J.map((z)=>l0(z,Z)).join(", "):l0(J,Z);return`(${W})?.${X}?.(${Y})`}if(fZ.has(X)){let W=l0(Q,Z),Y=L$(J,Z);if(X==="reduce"){let z=l0(G,Z);return`${W}.reduce((_acc, _item, _index) => ${Y}, ${z})`}if(X==="map")return`${W}.map((_item, _index) => ${Y})`;if(X==="filter")return`${W}.filter((_item, _index) => ${Y})`}return"undefined"}function d1($,Z){let X=$;for(let Q of Z.split(/[./]/))X=X?.[Q];return X}function j8($,Z,X,Q){return g0($,Z,X,Q)}function O8($,Z={}){return l0($,Z)}var nJ,vZ,gZ,rJ,aJ,fZ,hZ,uZ,Q2,J2,G2,pJ=64,W2=64;var H9=s(()=>{nJ=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),vZ=new Set(["!","-"]),gZ=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),rJ=new Set(["=","+=","-=","*=","/="]),aJ=new Set(["push","pop","shift","unshift","splice"]),fZ=new Set(["reduce","map","filter"]),hZ=new Set(["?:","switch"]),uZ=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"]),Q2=new Set([...nJ,...vZ,...gZ,...fZ,...hZ,...uZ,"call"]),J2=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"]),G2={"Intl/formatDate":($,Z,X)=>new Intl.DateTimeFormat(Z,X).format(new Date($)),"Intl/formatNumber":($,Z,X)=>new Intl.NumberFormat(Z,X).format($),"Intl/formatRelativeTime":($,Z,X,Q)=>new Intl.RelativeTimeFormat(X,Q).format($,Z)}});function d$($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function U$($){return d$($)&&typeof $.$ref==="string"}function N1($){return d$($)&&$.$prototype==="Function"}function n$($){return d$($)&&d$($.$expression)}function u6($){return n$($)&&Array.isArray($.parameters)&&$.parameters.length>0}function D1($){return N1($)&&Array.isArray($.body)}function H6($){return d$($)&&typeof $.$prototype==="string"&&$.$prototype!=="Function"}function dZ($){return d$($)&&$.timing==="server"&&typeof $.$src==="string"&&typeof $.$export==="string"&&!$.$prototype}function tJ($){return d$($)&&!$.$prototype&&!$.$expression&&"default"in $}function V6($){if(!d$($))return!1;for(let Z of Object.keys($))if(!eJ.has(Z))return!1;return!0}function G$($){return d$($)&&$.$prototype==="Array"}function lZ($){if(G$($))return!0;return Array.isArray($)&&$.some((Z)=>G$(Z))}function $G($){return d$($)&&$.$prototype==="Class"}function w0($){return typeof $==="string"&&$.includes("${")}function m6($){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test($)}function l1($){if(!$)return[];return $.map((Z)=>typeof Z==="string"?Z:Z.name)}var eJ;var w1=s(()=>{eJ=new Set(["type","enum","minimum","maximum","minLength","maxLength","pattern","format","items","properties","required","description","title","$comment"])});function ZG($){if("operator"in $)return"expression";if("if"in $)return"if";if("$switch"in $)return"switch";return"dispatch"}async function B4($,Z,X,Q={}){let J=Q.args?{args:Q.args}:void 0;for(let G of $)switch(ZG(G)){case"expression":{let W=m$(G,Z,X,J);if(W&&typeof W.then==="function")await W;break}case"if":{let W=G,Y=j8(W.if,Z,X,J)?W.then:W.else;if(Array.isArray(Y))await B4(Y,Z,X,Q);break}case"switch":{let W=G,Y=String(j8(W.$switch,Z,X,J)),z=W.cases??{},q=Object.hasOwn(z,Y)?z[Y]:W.default;if(Array.isArray(q))await B4(q,Z,X,Q);break}case"dispatch":{let W=G,Y=Q.target??X?.currentTarget;if(!Y)break;let z={};if("detail"in W)z.detail=j8(W.detail,Z,X,J);if(W.bubbles!==void 0)z.bubbles=W.bubbles;if(W.composed!==void 0)z.composed=W.composed;Y.dispatchEvent(new CustomEvent(W.dispatchEvent,z));break}default:break}}function r$($,Z={}){let X=Z.indent??"",Q=[];for(let J of $)switch(ZG(J)){case"expression":{Q.push(`${X}${L$(J,Z)};`);break}case"if":{let G=J,W=O8(G.if,Z),Y={...Z,indent:`${X} `};if(Q.push(`${X}if (${W}) {`,r$(G.then??[],Y)),G.else)Q.push(`${X}} else {`,r$(G.else,Y));Q.push(`${X}}`);break}case"switch":{let G=J,W=O8(G.$switch,Z),Y={...Z,indent:`${X} `};Q.push(`${X}switch (String(${W})) {`);for(let[z,q]of Object.entries(G.cases??{}))Q.push(`${X} case ${JSON.stringify(z)}: {`,r$(q,Y),`${X} break;`,`${X} }`);if(G.default)Q.push(`${X} default: {`,r$(G.default,Y),`${X} }`);Q.push(`${X}}`);break}case"dispatch":{let G=J,W=Z.eventParam??"event",Y=Z.dispatchTarget??`(${W} && ${W}.currentTarget)`,z=[];if("detail"in G)z.push(`detail: ${O8(G.detail,Z)}`);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 q=z.length>0?`, { ${z.join(", ")} }`:"";Q.push(`${X}${Y}?.dispatchEvent(new CustomEvent(${JSON.stringify(G.dispatchEvent)}${q}));`);break}default:break}return Q.join(`
|
|
3
|
+
`)}var E8=s(()=>{H9()});function B2($){if(!U2||!$.includes("v"))return $;return $.replace(H2,(Z,X,Q)=>`${X}${V2[Q.toLowerCase()]??`cq${Q}`}`)}function F2($){return $.startsWith(":")||$.startsWith(".")||$.startsWith("&")||$.startsWith("[")}function R$($){return $.replaceAll(/[A-Z]/g,(Z)=>`-${Z.toLowerCase()}`)}function a$($){return Object.entries($).filter(([Z,X])=>!F2(Z)&&(X===null||typeof X!=="object")).map(([Z,X])=>`${R$(Z)}: ${B2(String(X))}`).join("; ")}function T1($){return/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec($.trim())?.[1]??null}function pZ($,Z){if($===":root"||$==="html")return{auto:`${$}:where(:not([${c1}]))`,forced:`${$}:where([${c1}="${Z}"])`};return{auto:`:where(:root:not([${c1}])) ${$}`,forced:`:where(:root[${c1}="${Z}"]) ${$}`}}var U2=!1,H2,V2,B6,c1="data-color-scheme",cZ="jx-color-scheme";var V9=s(()=>{H9();w1();E8();H2=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,V2={b:"cqb",h:"cqh",i:"cqi",max:"cqmax",min:"cqmin",w:"cqw"};B6=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"])});function B9($,Z){let X=[];for(let[Q,J]of($.parameters??[]).entries()){let G=typeof J==="string"?J:J?.name??"";if(!G)continue;let Y=typeof J==="object"&&J!==null&&"default"in J?`_a[${Q}] === undefined ? ${JSON.stringify(J.default)} : _a[${Q}]`:`_a[${Q}]`;X.push(`${JSON.stringify(G)}: ${Y}`)}return`(..._a) => { const _args = { ${X.join(", ")} }; return ${Z}; }`}function P8($,Z){let X=Z?.$export,Q=typeof X==="string"&&X!==""?X:$;return Q===$?$:`${Q} as ${$}`}function C8($,Z,X={}){let{statePrefix:Q="state",indent:J="",collect:G}=X,{url:W}=Z,Y=w0(W),z=Z.method??"GET";if(Z.manual)return`${J}// ${$}: manual Request — fetch triggered by user action`;let q=[`// ${$}: auto-fetch from ${Y?"(dynamic URL)":W}`,G?`${G}.push(effect(() => {`:"effect(() => {"];if(Y)q.push(` const url = \`${L2(W,Q)}\`;`,' if (!url || url === "undefined" || url.includes("undefined")) return;');else q.push(` const url = ${JSON.stringify(W)};`);let H=[];if(z!=="GET")H.push(`method: ${JSON.stringify(z)}`);if(Z.headers)H.push(`headers: ${JSON.stringify(Z.headers)}`);if(Z.body){let F=typeof Z.body==="object"?JSON.stringify(JSON.stringify(Z.body)):JSON.stringify(Z.body);H.push(`body: ${F}`)}let B=H.length>0?`, { ${H.join(", ")} }`:"";return q.push(` fetch(url${B})`," .then(r => r.ok ? r.json() : Promise.reject(r.statusText))",` .then(d => { ${Q}.${$} = d; })`,` .catch(e => { ${Q}.${$} = { error: String(e) }; });`,G?"}));":"});"),q.map((F)=>`${J}${F}`).join(`
|
|
4
|
+
`)}function L2($,Z){if(Z==="state")return $;return $.replaceAll(/\$\{([^}]*)\}/g,(X,Q)=>`\${${Q.replaceAll(/(?<!this\.)\bstate\./g,`${Z}.`)}}`)}function S8($){if(!$||typeof $!=="object")return!1;if($.state)for(let[Z,X]of Object.entries($.state)){if(Z==="$site"||Z==="$page")continue;if(X&&typeof X==="object"&&!Array.isArray(X)&&X.timing==="compiler")continue;if(typeof X!=="object"||X===null||Array.isArray(X))return!0;if(X.$prototype)return!0;if("default"in X)return!0;if(V6(X))continue;return!0}if($.$switch)return!0;if(G$($)||lZ($.children))return!0;if(Array.isArray($.children)&&$.children.some((Z)=>S8(Z)))return!0;for(let[Z,X]of Object.entries($)){if(B6.has(Z))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(w0(X))return!0}if($.style&&typeof $.style==="object"){for(let Z of Object.values($.style))if(w0(Z))return!0}if($.attributes&&typeof $.attributes==="object"){for(let Z of Object.values($.attributes))if(w0(Z))return!0}return!1}function QG($){if(!$||typeof $!=="object")return!1;if($.$switch)return!0;if(G$($)||lZ($.children))return!0;for(let[Z,X]of Object.entries($)){if(B6.has(Z))continue;if(X!==null&&typeof X==="object"&&typeof X.$ref==="string")return!0;if(w0(X))return!0}if($.style&&typeof $.style==="object"){for(let Z of Object.values($.style))if(w0(Z))return!0}if($.attributes&&typeof $.attributes==="object"){for(let Z of Object.values($.attributes))if(w0(Z))return!0}return!1}function I4($,Z=null,X={},Q={}){let J=$?.state?N4($.state,Z):Z??Object.create(null);return{media:Q,scope:J,scopeDefs:X}}function N4($={},Z=null){let X=Object.create(Z??null),Q=Z?.[nZ],J=new Set(Q instanceof Set?Q:[]);Object.defineProperty(X,nZ,{configurable:!0,enumerable:!1,value:J,writable:!0});for(let[W,Y]of Object.entries($)){if(typeof Y!=="object"||Y===null||Array.isArray(Y)){p1(X,W,R8(Y));continue}let z=Y;if("default"in z){p1(X,W,R8(z.default));continue}if(!z.$prototype&&!("$expression"in z)&&!V6(z))p1(X,W,R8(z))}let G=[];for(let[W,Y]of Object.entries($)){if(typeof Y==="string"&&w0(Y)){G.push([W,Y]);continue}if(!Y||typeof Y!=="object")continue;if(n$(Y)){let z=Y.$expression;if(u6(Y)){let q=Y.parameters;p1(X,W,(...H)=>{let B={};for(let[F,L]of q.entries()){let w=typeof L==="string"?L:L?.name??"";if(!w)continue;B[w]=H[F]===void 0&&typeof L==="object"&&L!==null&&"default"in L?L.default:H[F]}return m$(z,X,null,{args:B})})}else if(U6(z.operator))p1(X,W,(q,H)=>m$(z,q,H));else iZ(X,W,()=>m$(z,X,null));continue}if(N1(Y)){if(D1(Y)){let{body:z}=Y;p1(X,W,(q,H)=>{B4(z,q??X,H??null)})}else if(typeof Y.body==="string"){let z=Y.parameters?l1(Y.parameters):Y.arguments??[],{body:q}=Y,H=z.includes("state")?z:["state",...z],B=Function(...H,q),F=(L,w)=>B(...H.map((N)=>N==="state"?L:w));if(m6(q))iZ(X,W,()=>F(X));else p1(X,W,F)}else p1(X,W,()=>{}),J.add(W);continue}if(H6(Y)&&(Y.$prototype==="LocalStorage"||Y.$prototype==="SessionStorage")){p1(X,W,R8(Y.default??null));continue}if(H6(Y)&&Y.$prototype==="Request")J.add(W)}for(let[W,Y]of G){if(JG(Y,X))J.add(W);iZ(X,W,()=>M$(Y,X))}return X}function p1($,Z,X){Object.defineProperty($,Z,{configurable:!0,enumerable:!0,value:X,writable:!0})}function iZ($,Z,X){Object.defineProperty($,Z,{configurable:!0,enumerable:!0,get:X})}function r0($,Z){if(o$($))return aZ($.$ref,Z);if(w0($))return M$($,Z);return $}function o$($){return U$($)}function aZ($,Z){if(typeof $!=="string")return $;if($.startsWith("$map/")){let X=$.split("/"),Q=X[1],J=Z.$map?.[Q]??Z[`$map/${Q}`];return X.length>2?XG(J,X.slice(2).join("/")):J}if($.startsWith("#/state/")){let X=$.slice(8),Q=X.indexOf("/");if(Q===-1)return Z[X];return XG(Z[X.slice(0,Q)],X.slice(Q+1))}return Z[$]??null}function JG($,Z){if(!Z)return!1;let X=Z[nZ];for(let Q of $.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*(\()?/g)){if(Q[2])continue;let J=Q[1];if(X instanceof Set&&X.has(J))return!0;if(typeof Z[J]==="function")return!0}return!1}function M$($,Z){if(JG($,Z))return null;try{let X=$.match(/^\$\{(.+)\}$/s);if(X)return Function("state","$map",`return (${X[1]})`)(Z,Z?.$map);return Function("state","$map",`return \`${$}\``)(Z,Z?.$map)}catch{return null}}function XG($,Z){if(!Z)return $;let X=$;for(let Q of Z.split("/"))X=X==null?void 0:X[Q];return X}function R8($){if($===null||typeof $!=="object")return $;return structuredClone($)}function L4($,Z){let X="",Q=r0($.id,Z),J=r0($.className,Z),G=r0($.hidden,Z),W=r0($.tabIndex,Z),Y=r0($.title,Z),z=r0($.lang,Z),q=r0($.dir,Z);if(Q)X+=` id="${_0(String(Q))}"`;if(J)X+=` class="${_0(String(J))}"`;if(G)X+=" hidden";if(W!==void 0&&W!==null)X+=` tabindex="${_0(String(W))}"`;if(Y)X+=` title="${_0(String(Y))}"`;if(z)X+=` lang="${_0(String(z))}"`;if(q)X+=` dir="${_0(String(q))}"`;if($.style&&Z){let H=Object.entries($.style).filter(([B,F])=>!B.startsWith(":")&&!B.startsWith(".")&&!B.startsWith("&")&&!B.startsWith("[")&&!B.startsWith("@")&&F!==null&&typeof F!=="object"&&typeof F==="string"&&w0(F)).map(([B,F])=>{let L=r0(F,Z);return L==null?null:`${R$(B)}: ${L}`}).filter(Boolean).join("; ");if(H)X+=` style="${H}"`}if($.attributes)for(let[H,B]of Object.entries($.attributes)){let F=r0(B,Z);if(F!==null&&F!==void 0&&(typeof F==="string"||typeof F==="number"||typeof F==="boolean"))X+=` ${H}="${_0(String(F))}"`}if($.tagName==="img"){if(!$.attributes?.loading)X+=' loading="lazy"';if(!$.attributes?.decoding)X+=' decoding="async"'}if($.$static)X+=" data-jx-static";else if($.$prerendered)X+=" data-jx-prerendered";return X}function F9($,Z=" "){return $?"":`
|
|
5
|
+
${Z}`}function D4(){let $=JSON.stringify(cZ),Z=JSON.stringify(c1);return`(function(){try{var s=localStorage.getItem(${$});if(s==="light"||s==="dark"){document.documentElement.setAttribute(${Z},s)}}catch(e){}})()`}function GG($,Z,X){let Q=$.startsWith("@--")?Z[$.slice(1)]??$.slice(1):$.startsWith("@(")?$.slice(1):null,J=Q===null?$:`@media ${Q}`,G=Q===null?null:T1(Q);return(W,Y)=>{if(!Y)return;if(G){let{auto:z,forced:q}=pZ(W,G);X.push(`${J} { ${z} { ${Y} } }`,`${q} { ${Y} }`)}else X.push(`${J} { ${W} { ${Y} } }`)}}function _8($,Z,X,Q,J){if(J===null||typeof J!=="object"||Array.isArray(J))return;let G=GG(Z,X,$);G(Q,a$(J));for(let[W,Y]of Object.entries(J)){if(Y===null||typeof Y!=="object"||Array.isArray(Y))continue;if(W.startsWith("@"))continue;let z=W.startsWith("&")?W.replace("&",Q):W.startsWith(":")||W.startsWith(".")||W.startsWith("[")?`${Q}${W}`:`${Q} ${W}`;G(z,a$(Y))}}function w4($,Z={},X=null){let Q=[];if(X&&typeof X==="object"){let G=(H,B)=>{let F=a$(B);if(F)Q.push(`${H} { ${F} }`);for(let[L,w]of Object.entries(B)){if(w===null||typeof w!=="object"||Array.isArray(w))continue;if(L.startsWith("@")){_8(Q,L,Z,H,w);continue}let N=L.startsWith("&")?L.replace("&",H):L.startsWith(":")||L.startsWith(".")||L.startsWith("[")?`${H}${L}`:`${H} ${L}`;G(N,w)}},W={},Y={};for(let[H,B]of Object.entries(X)){if(H.startsWith(":")||H.startsWith(".")||H.startsWith("[")||H.startsWith("@"))continue;if(B!==null&&typeof B==="object"&&!Array.isArray(B))continue;if(H.startsWith("--"))W[H]=B;else Y[H]=B}let z=a$(W);if(z)Q.push(`:root { ${z} }`);let q=a$(Y);if(q)Q.push(`body { ${q} }`);for(let[H,B]of Object.entries(X))if(H.startsWith(":")||H.startsWith(".")||H.startsWith("["))G(H,B);else if(B!==null&&typeof B==="object"&&!Array.isArray(B)&&!H.startsWith("@")&&!H.startsWith("--"))G(H,B);else if(H.startsWith("@")&&B!==null&&typeof B==="object"&&!Array.isArray(B)){let F=GG(H,Z,Q),L={},w={},N=[];for(let[I,T]of Object.entries(B)){if(T!==null&&typeof T==="object"&&!Array.isArray(T)){if(!I.startsWith("@"))N.push([I,T]);continue}if(I.startsWith("--"))L[I]=T;else w[I]=T}F(":root",a$(L)),F("body",a$(w));for(let[I,T]of N)F(I,a$(T))}}if(Object.values(Z).some((G)=>T1(G)!==null)&&!(X&&typeof X==="object"&&("colorScheme"in X)))Q.push(":root { color-scheme: light dark }",`:root:where([${c1}="light"]) { color-scheme: light }`,`:root:where([${c1}="dark"]) { color-scheme: dark }`);if(F6($,Q,Z,"",{n:0}),Q.length===0)return"";return`<style>
|
|
4
6
|
${Q.join(`
|
|
5
7
|
`)}
|
|
6
|
-
</style>`}function
|
|
8
|
+
</style>`}function WG($,Z,X,Q){let J=a$(Z);if(J)X.push(`${$} { ${J} }`);for(let[G,W]of Object.entries(Z)){if(W===null||typeof W!=="object"||Array.isArray(W))continue;if(G.startsWith("@")){_8(X,G,Q,$,W);continue}let Y=G.startsWith("&")?G.replace("&",$):G.startsWith(":")||G.startsWith(".")||G.startsWith("[")?`${$}${G}`:`${$} ${G}`;WG(Y,W,X,Q)}}function F6($,Z,X,Q="",J,G="jx"){let W=J??{n:0};if(!$||typeof $!=="object")return;if($.style&&!$.id&&!$.className)$.className=`${G}-${W.n}`,W.n+=1;let Y=$.id?`#${$.id}`:$.className?`.${$.className.split(" ")[0]}`:$.tagName??"*";if($.style){let z=[];for(let[q,H]of Object.entries($.style)){if(q.startsWith(":")||q.startsWith(".")||q.startsWith("&")||q.startsWith("[")||q.startsWith("@"))continue;if(H===null||typeof H==="object")continue;if(typeof H==="string"&&w0(H))continue;z.push(` ${R$(q)}: ${H};`)}if(z.length>0)Z.push(`${Y} {
|
|
7
9
|
${z.join(`
|
|
8
10
|
`)}
|
|
9
|
-
}`);for(let[q,H]of Object.entries($.style)){if(H===null||typeof H!=="object"||Array.isArray(H))continue;if(q.startsWith("@"))
|
|
10
|
-
`);if(!$||typeof $!=="object")return"";if($.$prototype==="Array")return"";if($.$switch){let W=$.tagName??"div",Y=
|
|
11
|
-
`);return`<${Q}${J}>${G}</${Q}>`}function
|
|
12
|
-
`)}function
|
|
11
|
+
}`);for(let[q,H]of Object.entries($.style)){if(H===null||typeof H!=="object"||Array.isArray(H))continue;if(q.startsWith("@"))_8(Z,q,X,Y,H);else{let B=q.startsWith("&")?q.replace("&",Y):q.startsWith(":")||q.startsWith(".")||q.startsWith("[")?`${Y}${q}`:`${Y} ${q}`;WG(B,H,Z,X)}}}if(Array.isArray($.children))for(let z of $.children)F6(z,Z,X,Y,W,G);if($.cases&&typeof $.cases==="object")for(let z of Object.values($.cases))F6(z,Z,X,Y,W,G)}function _0($){return String($).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function b8($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function x8($){let Z=new Map;return YG($,Z),[...Z.values()]}function YG($,Z){if(!$||typeof $!=="object")return;if($.state){for(let[X,Q]of Object.entries($.state))if(dZ(Q))Z.set(Q.$export,{exportName:Q.$export,key:X,src:Q.$src})}if(Array.isArray($.children))for(let X of $.children)YG(X,Z)}function F4($,Z,X=null){if(typeof $==="string"){if(w0($)&&Z){let W=M$($,Z);return W!=null?_0(String(W)):_0($)}return _0($)}if(typeof $==="number"||typeof $==="boolean")return _0(String($));if(Array.isArray($))return $.map((W)=>F4(W,Z,X)).join(`
|
|
12
|
+
`);if(!$||typeof $!=="object")return"";if($.$prototype==="Array")return"";if($.$switch){let W=$.tagName??"div",Y=L4($,Z),z=r0($.$switch,Z),q=z==null?void 0:$.cases?.[String(z)],H=q!==void 0&&!o$(q)?F4(q,Z,X):"";return`<${W}${Y}>${H}</${W}>`}let Q=$.tagName??"div";if(Q==="slot"&&X!=null)return X;let J=L4($,Z);if(oZ.has(Q))return`<${Q}${J}>`;let G="";if($.textContent!==void 0){let W=r0($.textContent,Z);G=W!=null?_0(String(W)):""}else if($.innerHTML){let W=r0($.innerHTML,Z);G=W!=null?String(W):$.innerHTML}else if(Array.isArray($.children))G=$.children.map((W)=>F4(W,Z,X)).join(`
|
|
13
|
+
`);return`<${Q}${J}>${G}</${Q}>`}function zG($,Z=null,X=null){let Q=$.state??{};if(Z){Q={...Q};for(let[G,W]of Object.entries(Z))if(G in Q){let Y=Q[G];Q[G]=Y&&typeof Y==="object"&&!Array.isArray(Y)&&"default"in Y?{...Y,default:W}:W}else Q[G]=W}let J=N4(Q,null);if(!Array.isArray($.children))return"";return $.children.map((G)=>F4(G,J,X)).join(`
|
|
14
|
+
`)}function sZ($){return rZ($)}function rZ($){if(!$||typeof $!=="object")return!0;if(Array.isArray($))return $.every((Z)=>rZ(Z));if($.$prototype)return!1;if($.$ref)return!1;if($.state)for(let Z of Object.values($.state)){if(!Z||typeof Z!=="object")continue;let X=Z;if(X.$prototype)return!1;if(X.$ref)return!1}for(let Z of Object.keys($))if(Z.startsWith("on")&&Z!=="observedAttributes")return!1;if(Array.isArray($.children))return $.children.every((Z)=>rZ(Z));if($.children&&typeof $.children==="object"&&$.children.$prototype)return!1;return!0}function qG($,Z,X=null,Q={}){let J=[];if(Z&&typeof Z==="object"){let G=[];for(let[W,Y]of Object.entries(Z)){if(W.startsWith(":")||W.startsWith(".")||W.startsWith("&")||W.startsWith("[")||W.startsWith("@"))continue;if(Y===null||typeof Y==="object")continue;if(typeof Y==="string"&&w0(Y))continue;G.push(` ${R$(W)}: ${Y};`)}if(G.length>0)J.push(`${$} {
|
|
13
15
|
${G.join(`
|
|
14
16
|
`)}
|
|
15
|
-
}`);for(let[W,Y]of Object.entries(Z))if(W.startsWith("@"))
|
|
17
|
+
}`);for(let[W,Y]of Object.entries(Z))if(W.startsWith("@"))_8(J,W,Q,$,Y);else if(W.startsWith(":")||W.startsWith(".")||W.startsWith("&")||W.startsWith("[")){let z=W.startsWith("&")?W.replace("&",$):`${$}${W}`;J.push(`${z} { ${a$(Y)} }`)}}if(X&&Array.isArray(X.children)){let G={n:0};for(let W of X.children)F6(W,J,Q,"",G,$)}return J.length>0?`${J.join(`
|
|
16
18
|
`)}
|
|
17
|
-
`:""}var K4="https://esm.sh/@vue/reactivity@3.5.40",H4="https://esm.sh/lit-html@3.3.0",uZ;var B1=s(()=>{Y9();W9();A5();D6();Y9();W9();A5();D6();uZ=new Set(["input","br","hr","img","meta","link","area","col","source"])});function l6($){if($.startsWith("\\\\?\\"))return $;return $.split("\\").join("/")}var J2,q9=()=>J2;var eJ=s(()=>{J2=/^win/.test(globalThis.process?globalThis.process.platform:"")});function n0($,Z){let X=new URL(l6($),"https://aaa.nonexistanturl.com"),Q=new URL(l6(Z),X),J=Z.match(/(\s*)$/)?.[1]||"";if(Q.hostname==="aaa.nonexistanturl.com"){let{pathname:W,search:Y,hash:z}=Q;return W+Y+decodeURIComponent(z)+J}let G=Q.toString()+J;if(G.includes("#")){let[W,Y]=G.split("#",2);return W+"#"+decodeURIComponent(Y||"")}return G}function h1(){if(typeof window<"u"&&window.location&&window.location.href){let $=window.location.href;if(!$||!$.startsWith("http"))try{return new URL($),$}catch{return"/"}return $}if(typeof process<"u"&&process.cwd){let $=process.cwd(),Z=$.slice(-1);if(Z==="/"||Z==="\\")return $;else return $+"/"}return"/"}function ZG($){let Z=W2.exec($||"");if(Z)return Z[1].toLowerCase();return}function XG($){let Z=$.lastIndexOf(".");if(Z>=0)return H2($.substring(Z).toLowerCase());return""}function H2($){let Z=$.indexOf("?");if(Z>=0)$=$.substring(0,Z);return $}function T6($){if(!$)return"#";let Z=$.indexOf("#");if(Z>=0)return $.substring(Z);return"#"}function r0($){if(!$)return"";let Z=$.indexOf("#");if(Z>=0)$=$.substring(0,Z);return $}function QG($){let Z=ZG($);if(Z==="http"||Z==="https")return!0;else if(Z===void 0)return typeof window<"u";else return!1}function j5($){if(!$||typeof $!=="string")return!0;let Z=$.trim().toLowerCase();if(!Z)return!0;if(Z.startsWith("javascript:")||Z.startsWith("vbscript:")||Z.startsWith("data:"))return!0;if(Z.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;try{let X=new URL(Z.startsWith("//")?"http:"+Z:Z);if(JG(X.hostname))return!0;let Q=X.port;if(Q&&A2(parseInt(Q)))return!0}catch{if(Z.startsWith("/")&&!Z.startsWith("//"))return!1;if(M2(Z))return!0}return!1}function JG($){let Z=V2($);if(!Z)return!0;if(Z==="localhost"||K2.some((J)=>Z.endsWith(J)))return!0;let X=GG(Z);if(X)return WG(X);let Q=B2(Z);if(Q)return F2(Q);return!1}function V2($){let Z=$.trim().toLowerCase();if(Z.startsWith("[")&&Z.endsWith("]"))Z=Z.slice(1,-1);while(Z.endsWith("."))Z=Z.slice(0,-1);return Z}function GG($){let Z=$.split(".");if(Z.length!==4)return;let X=Z.map((Q)=>{if(!/^\d+$/.test(Q))return Number.NaN;return Number(Q)});if(X.some((Q)=>!Number.isInteger(Q)||Q<0||Q>255))return;return X}function WG([$,Z,X,Q]){return $===0||$===10||$===127||$===100&&Z>=64&&Z<=127||$===169&&Z===254||$===172&&Z>=16&&Z<=31||$===192&&Z===0&&X===0||$===192&&Z===168||$===198&&(Z===18||Z===19)||$>=224||$===255&&Z===255&&X===255&&Q===255}function B2($){if(!$.includes(":"))return;let Z=$,X=Z.lastIndexOf(":"),Q=Z.slice(X+1);if(Q.includes(".")){let z=GG(Q);if(!z)return;let q=z[0]*256+z[1],H=z[2]*256+z[3];Z=`${Z.slice(0,X+1)}${q.toString(16)}:${H.toString(16)}`}let J=Z.split("::");if(J.length>2)return;let G=$G(J[0]),W=J.length===2?$G(J[1]):[];if(!G||!W)return;if(J.length===1)return G.length===8?G:void 0;let Y=8-G.length-W.length;if(Y<1)return;return[...G,...Array(Y).fill(0),...W]}function $G($){if(!$)return[];let Z=$.split(":").map((X)=>{if(!/^[\da-f]{1,4}$/i.test(X))return Number.NaN;return Number.parseInt(X,16)});if(Z.some((X)=>!Number.isInteger(X)||X<0||X>65535))return;return Z}function F2($){if($.length!==8)return!1;let Z=$.every((Y)=>Y===0),X=$.slice(0,7).every((Y)=>Y===0)&&$[7]===1,Q=($[0]&65024)===64512,J=($[0]&65472)===65152,G=($[0]&65280)===65280;if(Z||X||Q||J||G)return!0;let W=L2($);return W?WG(W):!1}function L2($){let Z=$.slice(0,5).every((J)=>J===0),X=Z&&$[5]===0,Q=Z&&$[5]===65535;if(!X&&!Q)return;return[Math.floor($[6]/256),$[6]%256,Math.floor($[7]/256),$[7]%256]}function M2($){return $.split(/[\s/?#]+/).map((X)=>X.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((X)=>JG(X))}function A2($){return[22,23,25,53,135,139,445,993,995,1433,1521,3306,3389,5432,5900,6379,8080,8443,9200,27017].includes($)}function O5($){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let Z=ZG($);return Z===void 0||Z==="file"}function YG($){if(q9()){let Z=h1(),X=$.toUpperCase(),J=l6(Z).toUpperCase(),G=X.includes(J),W=X.includes(J),Y=q2.test($)||$.startsWith("http://")||$.startsWith("https://")||$.startsWith("file://");if(!(G||W||Y)&&!Z.startsWith("http"))$=((q,H)=>{if(q.endsWith("/")||q.endsWith("\\"))return q+H;else return q+"/"+H})(Z,$);$=l6($)}$=encodeURI($);for(let Z of U2)$=$.replace(Z[0],Z[1]);return $}function A4($,Z){$=$.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),$=decodeURI($);for(let Q=0;Q<dZ.length;Q+=2)$=$.replace(dZ[Q],dZ[Q+1]);let X=$.toLowerCase().startsWith("file://");if(X){if($=$.replace(/^file:\/\//,"").replace(/^\//,""),q9()&&$[1]==="/")$=`${$[0]}:${$.substring(1)}`;if(Z)$="file:///"+$;else X=!1,$=q9()?$:"/"+$}if(q9()&&!X){if($=$.replace(G2,"\\"),$.match(/^[a-z]:\\/i))$=$[0].toUpperCase()+$.substring(1)}return $}function E5($){if($.length<=1||$[0]!=="#"||$[1]!=="/")return[];return $.slice(2).split("/").map((Z)=>{return Z.replace(Y2,"/").replace(z2,"~")})}var G2,W2,Y2,z2,q2,U2,dZ,K2,M4=($)=>new URL($);var R$=s(()=>{eJ();G2=/\//g,W2=/^(\w{2,}):\/\//i,Y2=/~1/g,z2=/~0/g,q2=/^[a-zA-Z]:[\\/]/,U2=[[/\?/g,"%3F"],[/#/g,"%23"]],dZ=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],K2=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function zG(){let $={},Z=this;for(let X of w2(Z))if(typeof X==="string"){let Q=Z[X],J=typeof Q;if(!I2.includes(J))$[X]=Q}return $}function w2($,Z=[]){let X=[];while($&&$!==D2)X=X.concat(Object.getOwnPropertyNames($),Object.getOwnPropertySymbols($)),$=Object.getPrototypeOf($);let Q=new Set(X);for(let J of Z.concat(N2))Q.delete(J);return Q}function O6($){return $ instanceof l$||$ instanceof I4}function cZ($){if($.path===null)$.path=[];return $}var I2,N2,D2,l$,I4,o$,R5,Y6,P5,C5,lZ,N4;var s$=s(()=>{R$();I2=["function","symbol","undefined"],N2=["constructor","prototype","__proto__"],D2=Object.getPrototypeOf({});l$=class l$ extends Error{name;message;source;path;code;constructor($,Z){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=$,this.source=Z,this.path=null}toJSON=zG.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};I4=class I4 extends Error{files;constructor($){super();this.files=$,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${A4($.$refs._root$Ref.path)}'`}toJSON=zG.bind(this);static getParserErrors($){let Z=[];for(let X of Object.values($.$refs._$refs))if(X.errors)Z.push(...X.errors);return Z}get errors(){return I4.getParserErrors(this.files)}};o$=class o$ extends l${code="EPARSER";name="ParserError";constructor($,Z){super(`Error parsing ${Z}: ${$}`,Z)}};R5=class R5 extends l${code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor($){super(`Could not find parser for "${$}"`,$)}};Y6=class Y6 extends l${code="ERESOLVER";name="ResolverError";ioErrorCode;constructor($,Z){super($.message||`Error reading file "${Z}"`,Z);if("code"in $)this.ioErrorCode=String($.code)}};P5=class P5 extends l${code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor($){super(`Could not find resolver for "${$}"`,$)}};C5=class C5 extends l${code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor($,Z,X,Q,J){super(`Missing $ref pointer "${T6(Z)}". Token "${$}" does not exist.`,r0(Z));this.targetToken=$,this.targetRef=X,this.targetFound=Q,this.parentPath=J}};lZ=class lZ extends l${code="ETIMEOUT";name="TimeoutError";constructor($){super(`Dereferencing timeout reached: ${$}ms`)}};N4=class N4 extends l${code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor($,Z){super(`Invalid $ref pointer "${$}". Pointers must begin with "#/"`,r0(Z))}}});function M$($,Z){let X=T2(Z);return X?n0($,X):$}function S5($){if(!$||typeof $!=="object"||ArrayBuffer.isView($))return!1;let Z=$.$schema;if(typeof Z==="string"&&(Z.includes("draft/2019-09/")||Z.includes("draft/2020-12/")||Z.includes("oas/3.1/")))return!0;let X=$.openapi;return typeof X==="string"&&/^3\.1(?:\.|$)/.test(X)}function _5($,Z,X,Q,J=!1){if(!J)return;let G=new Set,W=(Y,z)=>{if(!Y||typeof Y!=="object"||ArrayBuffer.isView(Y)||G.has(Y))return;G.add(Y);let q=M$(z,Y);if(q!==z)$._addAlias(q,Y,Q,J);for(let H of Object.keys(Y))W(Y[H],q)};W(X,Z)}function T2($){if($&&typeof $==="object"&&"$id"in $&&typeof $.$id==="string"&&$.$id.length>0)return $.$id;return}var u1=s(()=>{R$()});class m1{$ref;path;originalPath;scopeBase;value;circular;chainCircular;indirections;constructor($,Z,X){this.$ref=$,this.path=Z,this.originalPath=X||Z,this.scopeBase=$.path||r0(Z),this.value=void 0,this.circular=!1,this.chainCircular=!1,this.indirections=0}resolve($,Z,X,Q=new Set,J=!0){let G=m1.parse(this.path,this.originalPath),W=[];if(this.value=UG($),this.$ref.dynamicIdScope&&!KG(this.$ref))this.scopeBase=M$(this.scopeBase,this.value);for(let z=0;z<G.length;z++){let q=this.circular,H=this.chainCircular,B=l0.isExtended$Ref(this.value);if(x5(this,Z,X,Q))this.path=m1.join(this.path,G.slice(z));else if(B)this.circular=q,this.chainCircular=H;let F=G[z];if(this.value[F]===void 0||this.value[F]===null&&z===G.length-1){let M=!1;for(let R=G.length-1;R>z;R--){let P=G.slice(z,R+1).join("/");if(this.value[P]!==void 0){this.value=this.value[P],z=R,M=!0;break}}if(M){this.chainCircular=H;continue}if(F in this.value&&this.value[F]===null){this.value=b5,this.chainCircular=H;continue}this.value=null;let A=this.$ref.path||"",w=this.path.replace(A,""),D=m1.join("",W),j=X?.replace(A,"");throw new C5(F,decodeURI(this.originalPath),w,D,j)}else this.value=this.value[F];if(this.chainCircular=H,W.push(F),this.$ref.dynamicIdScope)this.scopeBase=M$(this.scopeBase,this.value)}let Y=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(J){let z=this.value?.$ref?n0(Y,this.value.$ref):void 0,q=typeof X==="string"?n0(this.$ref.$refs._root$Ref.path,X):X;if(l0.isAllowed$Ref(this.value,Z)&&z===q&&z!==this.path)this.chainCircular=!0;else if(!this.value||z)x5(this,Z,X,Q)}return this}set($,Z,X){let Q=m1.parse(this.path),J;if(Q.length===0)return this.value=Z,Z;if(C2(this.path,Q),this.value=UG($),this.$ref.dynamicIdScope&&!KG(this.$ref))this.scopeBase=M$(this.scopeBase,this.value);for(let G=0;G<Q.length-1;G++){if(x5(this,X),J=Q[G],this.value&&this.value[J]!==void 0)this.value=this.value[J];else this.value=qG(this,J,{});if(this.$ref.dynamicIdScope)this.scopeBase=M$(this.scopeBase,this.value)}return x5(this,X),J=Q[Q.length-1],qG(this,J,Z),$}static parse($,Z){let X=T6($).substring(1);if(!X)return[];let Q=X.split("/");for(let J=0;J<Q.length;J++)Q[J]=Q[J].replace(E2,"/").replace(R2,"~");if(Q[0]!=="")throw new N4(X,Z===void 0?$:Z);return Q.slice(1)}static join($,Z){if($.indexOf("#")===-1)$+="#";Z=Array.isArray(Z)?Z:[Z];for(let X=0;X<Z.length;X++){let Q=Z[X];$+="/"+Q.replace(O2,"~0").replace(j2,"~1")}return $}}function x5($,Z,X,Q=new Set){let J=!1,G=X,W=[];try{while(l0.isAllowed$Ref($.value,Z)){let Y=l0.isExtended$Ref($.value),z=$.value,q=$.path,H=$.$ref.dynamicIdScope?$.scopeBase:$.path,B=n0(H,$.value.$ref);if(B===$.path&&!S2(G))return $.circular=!0,$.chainCircular=!0,J;let F=typeof G==="string"?n0($.$ref.$refs._root$Ref.path,G):G;if(B===F&&B!==$.path)return $.chainCircular=!0,J;if(Q.has(B))return $.chainCircular=!0,J;let M=Z?.dereference?.maxDepth??500;if(Q.size>=M)throw RangeError(`Maximum dereference depth (${M}) exceeded at ${$.path}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);Q.add(B),W.push(B);let A=$.$ref.$refs._resolve(B,q,Z,Q,Y);if(A===null)return J;if($.indirections+=A.indirections+1,$.chainCircular||=A.circular||A.chainCircular,Y){if($.chainCircular)return J;return $.value=l0.dereference(z,A.value,Z),J}else $.$ref=A.$ref,$.path=A.path,$.value=A.value,$.scopeBase=A.scopeBase,G=q,J=!0}return J}finally{for(let Y of W)Q.delete(Y)}}function qG($,Z,X){if($.value&&typeof $.value==="object")if(Z==="-"&&Array.isArray($.value))$.value.push(X);else $.value[Z]=X;else throw new l$(`Error assigning $ref pointer "${$.path}".
|
|
18
|
-
Cannot set "${Z}" of a non-object.`);return X}function
|
|
19
|
-
Unsafe JSON Pointer token "${X}" cannot be used for assignment.`)}function
|
|
20
|
-
"${
|
|
21
|
-
"${
|
|
22
|
-
Parsed value is empty`);else return W}catch(W){if(!W&&Z.continueOnError)throw new
|
|
19
|
+
`:""}var nZ,M4="https://esm.sh/@vue/reactivity@3.5.40",A4="https://esm.sh/lit-html@3.3.0",d6,oZ;var L6=s(()=>{V9();H9();E8();w1();V9();H9();E8();w1();nZ=Symbol("jx.runtimeOnlyStateKeys");d6=new Set(["pre","textarea","listing","plaintext","xmp"]);oZ=new Set(["input","br","hr","img","meta","link","area","col","source"])});function i1($){if($.startsWith("\\\\?\\"))return $;return $.split("\\").join("/")}var M2,L9=()=>M2;var KG=s(()=>{M2=/^win/.test(globalThis.process?globalThis.process.platform:"")});function a0($,Z){let X=new URL(i1($),"https://aaa.nonexistanturl.com"),Q=new URL(i1(Z),X),J=Z.match(/(\s*)$/)?.[1]||"";if(Q.hostname==="aaa.nonexistanturl.com"){let{pathname:W,search:Y,hash:z}=Q;return W+Y+decodeURIComponent(z)+J}let G=Q.toString()+J;if(G.includes("#")){let[W,Y]=G.split("#",2);return W+"#"+decodeURIComponent(Y||"")}return G}function c6(){if(typeof window<"u"&&window.location&&window.location.href){let $=window.location.href;if(!$||!$.startsWith("http"))try{return new URL($),$}catch{return"/"}return $}if(typeof process<"u"&&process.cwd){let $=process.cwd(),Z=$.slice(-1);if(Z==="/"||Z==="\\")return $;else return $+"/"}return"/"}function HG($){let Z=I2.exec($||"");if(Z)return Z[1].toLowerCase();return}function VG($){let Z=$.lastIndexOf(".");if(Z>=0)return O2($.substring(Z).toLowerCase());return""}function O2($){let Z=$.indexOf("?");if(Z>=0)$=$.substring(0,Z);return $}function j1($){if(!$)return"#";let Z=$.indexOf("#");if(Z>=0)return $.substring(Z);return"#"}function o0($){if(!$)return"";let Z=$.indexOf("#");if(Z>=0)$=$.substring(0,Z);return $}function BG($){let Z=HG($);if(Z==="http"||Z==="https")return!0;else if(Z===void 0)return typeof window<"u";else return!1}function k8($){if(!$||typeof $!=="string")return!0;let Z=$.trim().toLowerCase();if(!Z)return!0;if(Z.startsWith("javascript:")||Z.startsWith("vbscript:")||Z.startsWith("data:"))return!0;if(Z.startsWith("file:"))return!0;if(typeof window<"u"&&window.location&&window.location.href)return!1;try{let X=new URL(Z.startsWith("//")?"http:"+Z:Z);if(FG(X.hostname))return!0;let Q=X.port;if(Q&&_2(parseInt(Q)))return!0}catch{if(Z.startsWith("/")&&!Z.startsWith("//"))return!1;if(S2(Z))return!0}return!1}function FG($){let Z=E2($);if(!Z)return!0;if(Z==="localhost"||j2.some((J)=>Z.endsWith(J)))return!0;let X=LG(Z);if(X)return MG(X);let Q=R2(Z);if(Q)return P2(Q);return!1}function E2($){let Z=$.trim().toLowerCase();if(Z.startsWith("[")&&Z.endsWith("]"))Z=Z.slice(1,-1);while(Z.endsWith("."))Z=Z.slice(0,-1);return Z}function LG($){let Z=$.split(".");if(Z.length!==4)return;let X=Z.map((Q)=>{if(!/^\d+$/.test(Q))return Number.NaN;return Number(Q)});if(X.some((Q)=>!Number.isInteger(Q)||Q<0||Q>255))return;return X}function MG([$,Z,X,Q]){return $===0||$===10||$===127||$===100&&Z>=64&&Z<=127||$===169&&Z===254||$===172&&Z>=16&&Z<=31||$===192&&Z===0&&X===0||$===192&&Z===168||$===198&&(Z===18||Z===19)||$>=224||$===255&&Z===255&&X===255&&Q===255}function R2($){if(!$.includes(":"))return;let Z=$,X=Z.lastIndexOf(":"),Q=Z.slice(X+1);if(Q.includes(".")){let z=LG(Q);if(!z)return;let q=z[0]*256+z[1],H=z[2]*256+z[3];Z=`${Z.slice(0,X+1)}${q.toString(16)}:${H.toString(16)}`}let J=Z.split("::");if(J.length>2)return;let G=UG(J[0]),W=J.length===2?UG(J[1]):[];if(!G||!W)return;if(J.length===1)return G.length===8?G:void 0;let Y=8-G.length-W.length;if(Y<1)return;return[...G,...Array(Y).fill(0),...W]}function UG($){if(!$)return[];let Z=$.split(":").map((X)=>{if(!/^[\da-f]{1,4}$/i.test(X))return Number.NaN;return Number.parseInt(X,16)});if(Z.some((X)=>!Number.isInteger(X)||X<0||X>65535))return;return Z}function P2($){if($.length!==8)return!1;let Z=$.every((Y)=>Y===0),X=$.slice(0,7).every((Y)=>Y===0)&&$[7]===1,Q=($[0]&65024)===64512,J=($[0]&65472)===65152,G=($[0]&65280)===65280;if(Z||X||Q||J||G)return!0;let W=C2($);return W?MG(W):!1}function C2($){let Z=$.slice(0,5).every((J)=>J===0),X=Z&&$[5]===0,Q=Z&&$[5]===65535;if(!X&&!Q)return;return[Math.floor($[6]/256),$[6]%256,Math.floor($[7]/256),$[7]%256]}function S2($){return $.split(/[\s/?#]+/).map((X)=>X.replace(/^[a-z][\d+.a-z-]*:\/\//i,"").replace(/:\d+$/,"")).filter(Boolean).some((X)=>FG(X))}function _2($){return[22,23,25,53,135,139,445,993,995,1433,1521,3306,3389,5432,5900,6379,8080,8443,9200,27017].includes($)}function y8($){if(typeof window<"u"||typeof process<"u"&&!1)return!1;let Z=HG($);return Z===void 0||Z==="file"}function AG($){if(L9()){let Z=c6(),X=$.toUpperCase(),J=i1(Z).toUpperCase(),G=X.includes(J),W=X.includes(J),Y=w2.test($)||$.startsWith("http://")||$.startsWith("https://")||$.startsWith("file://");if(!(G||W||Y)&&!Z.startsWith("http"))$=((q,H)=>{if(q.endsWith("/")||q.endsWith("\\"))return q+H;else return q+"/"+H})(Z,$);$=i1($)}$=encodeURI($);for(let Z of T2)$=$.replace(Z[0],Z[1]);return $}function j4($,Z){$=$.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"),$=decodeURI($);for(let Q=0;Q<tZ.length;Q+=2)$=$.replace(tZ[Q],tZ[Q+1]);let X=$.toLowerCase().startsWith("file://");if(X){if($=$.replace(/^file:\/\//,"").replace(/^\//,""),L9()&&$[1]==="/")$=`${$[0]}:${$.substring(1)}`;if(Z)$="file:///"+$;else X=!1,$=L9()?$:"/"+$}if(L9()&&!X){if($=$.replace(A2,"\\"),$.match(/^[a-z]:\\/i))$=$[0].toUpperCase()+$.substring(1)}return $}function v8($){if($.length<=1||$[0]!=="#"||$[1]!=="/")return[];return $.slice(2).split("/").map((Z)=>{return Z.replace(N2,"/").replace(D2,"~")})}var A2,I2,N2,D2,w2,T2,tZ,j2,T4=($)=>new URL($);var P$=s(()=>{KG();A2=/\//g,I2=/^(\w{2,}):\/\//i,N2=/~1/g,D2=/~0/g,w2=/^[a-zA-Z]:[\\/]/,T2=[[/\?/g,"%3F"],[/#/g,"%23"]],tZ=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],j2=[".localhost",".local",".internal",".intranet",".corp",".home",".lan"]});function IG(){let $={},Z=this;for(let X of y2(Z))if(typeof X==="string"){let Q=Z[X],J=typeof Q;if(!b2.includes(J))$[X]=Q}return $}function y2($,Z=[]){let X=[];while($&&$!==k2)X=X.concat(Object.getOwnPropertyNames($),Object.getOwnPropertySymbols($)),$=Object.getPrototypeOf($);let Q=new Set(X);for(let J of Z.concat(x2))Q.delete(J);return Q}function E1($){return $ instanceof l$||$ instanceof O4}function $7($){if($.path===null)$.path=[];return $}var b2,x2,k2,l$,O4,s$,g8,Y1,f8,h8,eZ,E4;var t$=s(()=>{P$();b2=["function","symbol","undefined"],x2=["constructor","prototype","__proto__"],k2=Object.getPrototypeOf({});l$=class l$ extends Error{name;message;source;path;code;constructor($,Z){super();this.code="EUNKNOWN",this.name="JSONParserError",this.message=$,this.source=Z,this.path=null}toJSON=IG.bind(this);get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};O4=class O4 extends Error{files;constructor($){super();this.files=$,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${j4($.$refs._root$Ref.path)}'`}toJSON=IG.bind(this);static getParserErrors($){let Z=[];for(let X of Object.values($.$refs._$refs))if(X.errors)Z.push(...X.errors);return Z}get errors(){return O4.getParserErrors(this.files)}};s$=class s$ extends l${code="EPARSER";name="ParserError";constructor($,Z){super(`Error parsing ${Z}: ${$}`,Z)}};g8=class g8 extends l${code="EUNMATCHEDPARSER";name="UnmatchedParserError";constructor($){super(`Could not find parser for "${$}"`,$)}};Y1=class Y1 extends l${code="ERESOLVER";name="ResolverError";ioErrorCode;constructor($,Z){super($.message||`Error reading file "${Z}"`,Z);if("code"in $)this.ioErrorCode=String($.code)}};f8=class f8 extends l${code="EUNMATCHEDRESOLVER";name="UnmatchedResolverError";constructor($){super(`Could not find resolver for "${$}"`,$)}};h8=class h8 extends l${code="EMISSINGPOINTER";name="MissingPointerError";targetToken;targetRef;targetFound;parentPath;constructor($,Z,X,Q,J){super(`Missing $ref pointer "${j1(Z)}". Token "${$}" does not exist.`,o0(Z));this.targetToken=$,this.targetRef=X,this.targetFound=Q,this.parentPath=J}};eZ=class eZ extends l${code="ETIMEOUT";name="TimeoutError";constructor($){super(`Dereferencing timeout reached: ${$}ms`)}};E4=class E4 extends l${code="EUNMATCHEDRESOLVER";name="InvalidPointerError";constructor($,Z){super(`Invalid $ref pointer "${$}". Pointers must begin with "#/"`,o0(Z))}}});function A$($,Z){let X=v2(Z);return X?a0($,X):$}function u8($){if(!$||typeof $!=="object"||ArrayBuffer.isView($))return!1;let Z=$.$schema;if(typeof Z==="string"&&(Z.includes("draft/2019-09/")||Z.includes("draft/2020-12/")||Z.includes("oas/3.1/")))return!0;let X=$.openapi;return typeof X==="string"&&/^3\.1(?:\.|$)/.test(X)}function m8($,Z,X,Q,J=!1){if(!J)return;let G=new Set,W=(Y,z)=>{if(!Y||typeof Y!=="object"||ArrayBuffer.isView(Y)||G.has(Y))return;G.add(Y);let q=A$(z,Y);if(q!==z)$._addAlias(q,Y,Q,J);for(let H of Object.keys(Y))W(Y[H],q)};W(X,Z)}function v2($){if($&&typeof $==="object"&&"$id"in $&&typeof $.$id==="string"&&$.$id.length>0)return $.$id;return}var p6=s(()=>{P$()});class i6{$ref;path;originalPath;scopeBase;value;circular;chainCircular;indirections;constructor($,Z,X){this.$ref=$,this.path=Z,this.originalPath=X||Z,this.scopeBase=$.path||o0(Z),this.value=void 0,this.circular=!1,this.chainCircular=!1,this.indirections=0}resolve($,Z,X,Q=new Set,J=!0){let G=i6.parse(this.path,this.originalPath),W=[];if(this.value=DG($),this.$ref.dynamicIdScope&&!wG(this.$ref))this.scopeBase=A$(this.scopeBase,this.value);for(let z=0;z<G.length;z++){let q=this.circular,H=this.chainCircular,B=c0.isExtended$Ref(this.value);if(d8(this,Z,X,Q))this.path=i6.join(this.path,G.slice(z));else if(B)this.circular=q,this.chainCircular=H;let F=G[z];if(this.value[F]===void 0||this.value[F]===null&&z===G.length-1){let L=!1;for(let E=G.length-1;E>z;E--){let P=G.slice(z,E+1).join("/");if(this.value[P]!==void 0){this.value=this.value[P],z=E,L=!0;break}}if(L){this.chainCircular=H;continue}if(F in this.value&&this.value[F]===null){this.value=l8,this.chainCircular=H;continue}this.value=null;let w=this.$ref.path||"",N=this.path.replace(w,""),I=i6.join("",W),T=X?.replace(w,"");throw new h8(F,decodeURI(this.originalPath),N,I,T)}else this.value=this.value[F];if(this.chainCircular=H,W.push(F),this.$ref.dynamicIdScope)this.scopeBase=A$(this.scopeBase,this.value)}let Y=this.$ref.dynamicIdScope?this.scopeBase:this.path;if(J){let z=this.value?.$ref?a0(Y,this.value.$ref):void 0,q=typeof X==="string"?a0(this.$ref.$refs._root$Ref.path,X):X;if(c0.isAllowed$Ref(this.value,Z)&&z===q&&z!==this.path)this.chainCircular=!0;else if(!this.value||z)d8(this,Z,X,Q)}return this}set($,Z,X){let Q=i6.parse(this.path),J;if(Q.length===0)return this.value=Z,Z;if(d2(this.path,Q),this.value=DG($),this.$ref.dynamicIdScope&&!wG(this.$ref))this.scopeBase=A$(this.scopeBase,this.value);for(let G=0;G<Q.length-1;G++){if(d8(this,X),J=Q[G],this.value&&this.value[J]!==void 0)this.value=this.value[J];else this.value=NG(this,J,{});if(this.$ref.dynamicIdScope)this.scopeBase=A$(this.scopeBase,this.value)}return d8(this,X),J=Q[Q.length-1],NG(this,J,Z),$}static parse($,Z){let X=j1($).substring(1);if(!X)return[];let Q=X.split("/");for(let J=0;J<Q.length;J++)Q[J]=Q[J].replace(h2,"/").replace(u2,"~");if(Q[0]!=="")throw new E4(X,Z===void 0?$:Z);return Q.slice(1)}static join($,Z){if($.indexOf("#")===-1)$+="#";Z=Array.isArray(Z)?Z:[Z];for(let X=0;X<Z.length;X++){let Q=Z[X];$+="/"+Q.replace(f2,"~0").replace(g2,"~1")}return $}}function d8($,Z,X,Q=new Set){let J=!1,G=X,W=[];try{while(c0.isAllowed$Ref($.value,Z)){let Y=c0.isExtended$Ref($.value),z=$.value,q=$.path,H=$.$ref.dynamicIdScope?$.scopeBase:$.path,B=a0(H,$.value.$ref);if(B===$.path&&!l2(G))return $.circular=!0,$.chainCircular=!0,J;let F=typeof G==="string"?a0($.$ref.$refs._root$Ref.path,G):G;if(B===F&&B!==$.path)return $.chainCircular=!0,J;if(Q.has(B))return $.chainCircular=!0,J;let L=Z?.dereference?.maxDepth??500;if(Q.size>=L)throw RangeError(`Maximum dereference depth (${L}) exceeded at ${$.path}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);Q.add(B),W.push(B);let w=$.$ref.$refs._resolve(B,q,Z,Q,Y);if(w===null)return J;if($.indirections+=w.indirections+1,$.chainCircular||=w.circular||w.chainCircular,Y){if($.chainCircular)return J;return $.value=c0.dereference(z,w.value,Z),J}else $.$ref=w.$ref,$.path=w.path,$.value=w.value,$.scopeBase=w.scopeBase,G=q,J=!0}return J}finally{for(let Y of W)Q.delete(Y)}}function NG($,Z,X){if($.value&&typeof $.value==="object")if(Z==="-"&&Array.isArray($.value))$.value.push(X);else $.value[Z]=X;else throw new l$(`Error assigning $ref pointer "${$.path}".
|
|
20
|
+
Cannot set "${Z}" of a non-object.`);return X}function d2($,Z){for(let X of Z)if(m2.has(X))throw new l$(`Error assigning $ref pointer "${$}".
|
|
21
|
+
Unsafe JSON Pointer token "${X}" cannot be used for assignment.`)}function DG($){if(E1($))throw $;return $}function l2($){return typeof $=="string"&&i6.parse($).length==0}function wG($){return Boolean($.path&&$.path in $.$refs._aliases)}var l8,g2,f2,h2,u2,m2,C$;var M9=s(()=>{R4();P$();t$();p6();l8=Symbol("null"),g2=/\//g,f2=/~/g,h2=/~1/g,u2=/~0/g,m2=new Set(["__proto__","constructor","prototype"]);C$=i6});class A9{path;value;$refs;pathType;dynamicIdScope=!1;errors=[];constructor($){this.$refs=$}addError($){if(this.errors===void 0)this.errors=[];let Z=this.errors.map(({footprint:X})=>X);if("errors"in $&&Array.isArray($.errors))this.errors.push(...$.errors.map($7).filter(({footprint:X})=>!Z.includes(X)));else if(!("footprint"in $)||!Z.includes($.footprint))this.errors.push($7($))}exists($,Z){try{return this.resolve($,Z),!0}catch{return!1}}get($,Z){return this.resolve($,Z)?.value}resolve($,Z,X,Q,J,G=!0){let W=new C$(this,$,X);try{let Y=W.resolve(this.value,Z,Q,J,G);if(Y.value===l8)Y.value=null;return Y}catch(Y){if(!Z||!Z.continueOnError||!E1(Y))throw Y;if(Y.path===null)Y.path=v8(j1(Q));if(Y instanceof E4)Y.source=decodeURI(o0(Q));return this.addError(Y),null}}set($,Z){let X=new C$(this,$);if(this.value=X.set(this.value,Z),this.value===l8)this.value=null}static is$Ref($){return Boolean($)&&typeof $==="object"&&$!==null&&"$ref"in $&&typeof $.$ref==="string"&&$.$ref.length>0}static isExternal$Ref($){return A9.is$Ref($)&&$.$ref[0]!=="#"}static isAllowed$Ref($,Z){if(this.is$Ref($)){if($.$ref.substring(0,2)==="#/"||$.$ref==="#")return!0;else if($.$ref[0]!=="#"&&(!Z||Z.resolve?.external))return!0}return}static isExtended$Ref($){return A9.is$Ref($)&&Object.keys($).length>1}static dereference($,Z,X){if(Z&&typeof Z==="object"&&A9.isExtended$Ref($)){let Q={};for(let G of Object.keys($))if(G!=="$ref")Q[G]=$[G];let J=X?.dereference?.mergeKeys??!0;for(let G of Object.keys(Z)){let W=G;if(!(W in Q))Q[W]=Z[W];else if(J&&typeof Q[W]==="object"&&Q[W]!==null&&typeof Z[W]==="object"&&Z[W]!==null)Q[W]=TG(Z[W],Q[W])}return Q}else return Z}}function TG($,Z){if(typeof $!=="object"||$===null)return Z;if(typeof Z!=="object"||Z===null)return Z;let X=Array.isArray($)?[...$]:{...$};for(let Q of Object.keys(Z))if(Array.isArray(Z[Q]))X[Q]=[...Z[Q]];else if(typeof Z[Q]==="object"&&Z[Q]!==null)X[Q]=TG($[Q],Z[Q]);else X[Q]=Z[Q];return X}var c0;var R4=s(()=>{M9();t$();P$();c0=A9});class I9{circular;paths(...$){return jG(this._$refs,$.flat()).map((X)=>{return i1(X.decoded)})}values(...$){let Z=this._$refs;return jG(Z,$.flat()).reduce((Q,J)=>{return Q[i1(J.decoded)]=Z[J.encoded].value,Q},{})}exists($,Z){try{return this._resolve($,"",Z),!0}catch{return!1}}get($,Z){return this._resolve($,"",Z).value}set($,Z){let X=a0(this._root$Ref.path,$),Q=this._getRef(X);if(!Q)throw Error(`Error resolving $ref pointer "${$}".
|
|
22
|
+
"${o0(X)}" not found.`);Q.set(X,Z)}_get$Ref($){return $=a0(this._root$Ref.path,$),this._getRef($)}_add($){let Z=o0($),X=new c0(this);return X.path=Z,this._$refs[Z]=X,this._root$Ref=this._root$Ref||X,X}_addAlias($,Z,X,Q=!1){let J=o0($);if(!J||this._$refs[J]||this._aliases[J])return this._$refs[J]||this._aliases[J];let G=new c0(this);return G.path=J,G.pathType=X,G.value=Z,G.dynamicIdScope=Q,this._aliases[J]=G,G}_resolve($,Z,X,Q,J=!0){let G=a0(this._root$Ref.path,$),W=this._getRef(G);if(!W)throw Error(`Error resolving $ref pointer "${$}".
|
|
23
|
+
"${o0(G)}" not found.`);return W.resolve(G,X,$,Z,Q,J)}_$refs={};_aliases={};_root$Ref;constructor(){this.circular=!1,this._$refs={},this._aliases={},this._root$Ref=null}toJSON=this.values;_getRef($){let Z=o0($);return this._$refs[Z]||this._aliases[Z]}}function jG($,Z){let X=Object.keys($);if(Z=Array.isArray(Z[0])?Z[0]:Array.prototype.slice.call(Z),Z.length>0&&Z[0])X=X.filter((Q)=>{return Z.includes($[Q].pathType)});return X.map((Q)=>{return{encoded:Q,decoded:$[Q].pathType==="file"?j4(Q,!0):Q}})}var OG=s(()=>{R4();P$()});function Z7($){return Object.keys($||{}).filter((Z)=>{return typeof $[Z]==="object"}).map((Z)=>{return $[Z].name=Z,$[Z]})}function X7($,Z,X,Q,J){return $.filter((G)=>{return!!EG(G,Z,X,Q,J)})}function Q7($){for(let Z of $)Z.order=Z.order||Number.MAX_SAFE_INTEGER;return $.sort((Z,X)=>{return Z.order-X.order})}async function J7($,Z,X,Q){let J,G,W=0;return new Promise((Y,z)=>{q();function q(){if(J=$[W++],!J)return z(G);try{let L=EG(J,Z,X,H,Q);if(L&&typeof L.then==="function")L.then(B,F);else if(L!==void 0)B(L);else if(W===$.length)throw Error("No promise has been returned or callback has been called.")}catch(L){F(L)}}function H(L,w){if(L)F(L);else B(w)}function B(L){Y({plugin:J,result:L})}function F(L){G={plugin:J,error:L},q()}})}function EG($,Z,X,Q,J){let G=$[Z];if(typeof G==="function")return G.apply($,[X,Q,J]);if(!Q){if(G instanceof RegExp)return G.test(X.url);else if(typeof G==="string")return G===X.extension;else if(Array.isArray(G))return G.indexOf(X.extension)!==-1}return G}async function c2($,Z,X){let Q=typeof $==="string"?$:$.url,J=typeof $==="string"?void 0:$.baseUrl,G=typeof $==="string"?void 0:$.reference,W=Q.indexOf("#"),Y="";if(W>=0)Y=Q.substring(W),Q=Q.substring(0,W);if(G){let H=G.indexOf("#");if(H>=0)G=G.substring(0,H)}let z=Z._add(Q),q={url:Q,hash:Y,extension:VG(Q),...G!==void 0?{reference:G}:{},...J!==void 0?{baseUrl:J}:{}};try{let H=await p2(q,X,Z);z.pathType=H.plugin.name,q.data=H.result;let B=await i2(q,X,Z);return z.value=B.result,z.dynamicIdScope=u8(z.value),m8(Z,z.path,z.value,z.pathType,z.dynamicIdScope),B.result}catch(H){if(E1(H))z.value=H;throw H}}async function p2($,Z,X){let Q=Z7(Z.resolve);Q=X7(Q,"canRead",$,void 0,X),Q7(Q);try{return await J7(Q,"read",$,X)}catch(J){if(!J&&Z.continueOnError)throw new f8($.url);else if(!J||!("error"in J))throw SyntaxError(`Unable to resolve $ref pointer "${$.url}"`,{cause:J});else if(J.error instanceof Y1)throw J.error;else throw new Y1(J,$.url)}}async function i2($,Z,X){let Q=Z7(Z.parse),J=X7(Q,"canParse",$),G=J.length>0?J:Q;Q7(G);try{let W=await J7(G,"parse",$,X);if(!W.plugin.allowEmpty&&n2(W.result))throw SyntaxError(`Error parsing "${$.url}" as ${W.plugin.name}.
|
|
24
|
+
Parsed value is empty`);else return W}catch(W){if(!W&&Z.continueOnError)throw new g8($.url);else if(W&&W.message&&W.message.startsWith("Error parsing"))throw W;else if(!W||!("error"in W))throw SyntaxError(`Unable to parse ${$.url}`,{cause:W});else if(W.error instanceof s$)throw W.error;else throw new s$(W.error.message,$.url)}}function n2($){return $===void 0||typeof $==="object"&&Object.keys($).length===0||typeof $==="string"&&$.trim().length===0||Buffer.isBuffer($)&&$.length===0}var c8;var G7=s(()=>{P$();p6();t$();c8=c2});var RG;var PG=s(()=>{t$();RG={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse($){let Z=$.data;if(Buffer.isBuffer(Z))Z=Z.toString();if(typeof Z==="string")if(Z.trim().length===0)return;else try{return JSON.parse(Z)}catch(X){if(this.allowBOM)try{let Q=Z.indexOf("{");return Z=Z.slice(Q),JSON.parse(Z)}catch(Q){throw new s$(Q.message,$.url)}throw new s$(X.message,$.url)}else return Z}}});function r2($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}function N9(){if(CG)return M6;CG=1;function $(W){return typeof W>"u"||W===null}function Z(W){return typeof W==="object"&&W!==null}function X(W){if(Array.isArray(W))return W;else if($(W))return[];return[W]}function Q(W,Y){if(Y){let z=Object.keys(Y);for(let q=0,H=z.length;q<H;q+=1){let B=z[q];W[B]=Y[B]}}return W}function J(W,Y){let z="";for(let q=0;q<Y;q+=1)z+=W;return z}function G(W){return W===0&&Number.NEGATIVE_INFINITY===1/W}return M6.isNothing=$,M6.isObject=Z,M6.toArray=X,M6.repeat=J,M6.isNegativeZero=G,M6.extend=Q,M6}function D9(){if(SG)return W7;SG=1;function $(X,Q){let J="",G=X.reason||"(unknown reason)";if(!X.mark)return G;if(X.mark.name)J+='in "'+X.mark.name+'" ';if(J+="("+(X.mark.line+1)+":"+(X.mark.column+1)+")",!Q&&X.mark.snippet)J+=`
|
|
23
25
|
|
|
24
|
-
`+X.mark.snippet;return G+" "+J}function Z(X,Q){if(Error.call(this),this.name="YAMLException",this.reason=X,this.mark=Q,this.message=$(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}return Z.prototype=Object.create(Error.prototype),Z.prototype.constructor=Z,Z.prototype.toString=function(Q){return this.name+": "+$(this,Q)},
|
|
25
|
-
`+B}let
|
|
26
|
-
`,B+=$.repeat("-",G.indent+F+3+
|
|
27
|
-
`;for(let
|
|
28
|
-
`}return B.replace(/\n$/,"")}return
|
|
29
|
-
\r`;function X(W){if(W===null)return!1;let Y=0,z=W.length,q=Z;for(let H=0;H<z;H++){let B=q.indexOf(W.charAt(H));if(B>64)continue;if(B<0)return!1;Y+=6}return Y%8===0}function Q(W){let Y=W.replace(/[\r\n=]/g,""),z=Y.length,q=Z,H=0,B=[];for(let
|
|
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(V){if(V<=65535)return String.fromCharCode(V);return String.fromCharCode((V-65536>>10)+55296,(V-65536&1023)+56320)}function
|
|
31
|
-
`,S-1)}function
|
|
26
|
+
`+X.mark.snippet;return G+" "+J}function Z(X,Q){if(Error.call(this),this.name="YAMLException",this.reason=X,this.mark=Q,this.message=$(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}return Z.prototype=Object.create(Error.prototype),Z.prototype.constructor=Z,Z.prototype.toString=function(Q){return this.name+": "+$(this,Q)},W7=Z,W7}function a2(){if(_G)return Y7;_G=1;let $=N9();function Z(J,G,W,Y,z){let q="",H="",B=Math.floor(z/2)-1;if(Y-G>B)q=" ... ",G=Y-B+q.length;if(W-Y>B)H=" ...",W=Y+B-H.length;return{str:q+J.slice(G,W).replace(/\t/g,"→")+H,pos:Y-G+q.length}}function X(J,G){return $.repeat(" ",G-J.length)+J}function Q(J,G){if(G=Object.create(G||null),!J.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 W=/\r?\n|\r|\0/g,Y=[0],z=[],q,H=-1;while(q=W.exec(J.buffer))if(z.push(q.index),Y.push(q.index+q[0].length),J.position<=q.index&&H<0)H=Y.length-2;if(H<0)H=Y.length-1;let B="",F=Math.min(J.line+G.linesAfter,z.length).toString().length,L=G.maxLength-(G.indent+F+3);for(let N=1;N<=G.linesBefore;N++){if(H-N<0)break;let I=Z(J.buffer,Y[H-N],z[H-N],J.position-(Y[H]-Y[H-N]),L);B=$.repeat(" ",G.indent)+X((J.line-N+1).toString(),F)+" | "+I.str+`
|
|
27
|
+
`+B}let w=Z(J.buffer,Y[H],z[H],J.position,L);B+=$.repeat(" ",G.indent)+X((J.line+1).toString(),F)+" | "+w.str+`
|
|
28
|
+
`,B+=$.repeat("-",G.indent+F+3+w.pos)+`^
|
|
29
|
+
`;for(let N=1;N<=G.linesAfter;N++){if(H+N>=z.length)break;let I=Z(J.buffer,Y[H+N],z[H+N],J.position-(Y[H]-Y[H+N]),L);B+=$.repeat(" ",G.indent)+X((J.line+N+1).toString(),F)+" | "+I.str+`
|
|
30
|
+
`}return B.replace(/\n$/,"")}return Y7=Q,Y7}function I$(){if(bG)return z7;bG=1;let $=D9(),Z=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],X=["scalar","sequence","mapping"];function Q(G){let W={};if(G!==null)Object.keys(G).forEach(function(Y){G[Y].forEach(function(z){W[String(z)]=Y})});return W}function J(G,W){if(W=W||{},Object.keys(W).forEach(function(Y){if(Z.indexOf(Y)===-1)throw new $('Unknown option "'+Y+'" is met in definition of "'+G+'" YAML type.')}),this.options=W,this.tag=G,this.kind=W.kind||null,this.resolve=W.resolve||function(){return!0},this.construct=W.construct||function(Y){return Y},this.instanceOf=W.instanceOf||null,this.predicate=W.predicate||null,this.represent=W.represent||null,this.representName=W.representName||null,this.defaultStyle=W.defaultStyle||null,this.multi=W.multi||!1,this.styleAliases=Q(W.styleAliases||null),X.indexOf(this.kind)===-1)throw new $('Unknown kind "'+this.kind+'" is specified for "'+G+'" YAML type.')}return z7=J,z7}function $W(){if(xG)return q7;xG=1;let $=D9(),Z=I$();function X(G,W){let Y=[];return G[W].forEach(function(z){let q=Y.length;Y.forEach(function(H,B){if(H.tag===z.tag&&H.kind===z.kind&&H.multi===z.multi)q=B}),Y[q]=z}),Y}function Q(){let G={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function W(Y){if(Y.multi)G.multi[Y.kind].push(Y),G.multi.fallback.push(Y);else G[Y.kind][Y.tag]=G.fallback[Y.tag]=Y}for(let Y=0,z=arguments.length;Y<z;Y+=1)arguments[Y].forEach(W);return G}function J(G){return this.extend(G)}return J.prototype.extend=function(W){let Y=[],z=[];if(W instanceof Z)z.push(W);else if(Array.isArray(W))z=z.concat(W);else if(W&&(Array.isArray(W.implicit)||Array.isArray(W.explicit))){if(W.implicit)Y=Y.concat(W.implicit);if(W.explicit)z=z.concat(W.explicit)}else throw new $("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");Y.forEach(function(H){if(!(H instanceof Z))throw new $("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(H.loadKind&&H.loadKind!=="scalar")throw new $("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(H.multi)throw new $("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),z.forEach(function(H){if(!(H instanceof Z))throw new $("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let q=Object.create(J.prototype);return q.implicit=(this.implicit||[]).concat(Y),q.explicit=(this.explicit||[]).concat(z),q.compiledImplicit=X(q,"implicit"),q.compiledExplicit=X(q,"explicit"),q.compiledTypeMap=Q(q.compiledImplicit,q.compiledExplicit),q},q7=J,q7}function ZW(){if(kG)return K7;return kG=1,K7=new(I$())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(Z){return Z!==null?Z:""}}),K7}function XW(){if(yG)return U7;return yG=1,U7=new(I$())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(Z){return Z!==null?Z:[]}}),U7}function QW(){if(vG)return H7;return vG=1,H7=new(I$())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(Z){return Z!==null?Z:{}}}),H7}function JW(){if(gG)return V7;return gG=1,V7=new($W())({explicit:[ZW(),XW(),QW()]}),V7}function GW(){if(fG)return B7;fG=1;let $=I$();function Z(J){if(J===null)return!0;let G=J.length;return G===1&&J==="~"||G===4&&(J==="null"||J==="Null"||J==="NULL")}function X(){return null}function Q(J){return J===null}return B7=new $("tag:yaml.org,2002:null",{kind:"scalar",resolve:Z,construct:X,predicate:Q,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),B7}function WW(){if(hG)return F7;hG=1;let $=I$();function Z(J){if(J===null)return!1;let G=J.length;return G===4&&(J==="true"||J==="True"||J==="TRUE")||G===5&&(J==="false"||J==="False"||J==="FALSE")}function X(J){return J==="true"||J==="True"||J==="TRUE"}function Q(J){return Object.prototype.toString.call(J)==="[object Boolean]"}return F7=new $("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Z,construct:X,predicate:Q,represent:{lowercase:function(J){return J?"true":"false"},uppercase:function(J){return J?"TRUE":"FALSE"},camelcase:function(J){return J?"True":"False"}},defaultStyle:"lowercase"}),F7}function YW(){if(uG)return L7;uG=1;let $=N9(),Z=I$();function X(q){return q>=48&&q<=57||q>=65&&q<=70||q>=97&&q<=102}function Q(q){return q>=48&&q<=55}function J(q){return q>=48&&q<=57}function G(q){if(q===null)return!1;let H=q.length,B=0,F=!1;if(!H)return!1;let L=q[B];if(L==="-"||L==="+")L=q[++B];if(L==="0"){if(B+1===H)return!0;if(L=q[++B],L==="b"){B++;for(;B<H;B++){if(L=q[B],L!=="0"&&L!=="1")return!1;F=!0}return F&&isFinite(W(q))}if(L==="x"){B++;for(;B<H;B++){if(!X(q.charCodeAt(B)))return!1;F=!0}return F&&isFinite(W(q))}if(L==="o"){B++;for(;B<H;B++){if(!Q(q.charCodeAt(B)))return!1;F=!0}return F&&isFinite(W(q))}}for(;B<H;B++){if(!J(q.charCodeAt(B)))return!1;F=!0}if(!F)return!1;return isFinite(W(q))}function W(q){let H=q,B=1,F=H[0];if(F==="-"||F==="+"){if(F==="-")B=-1;H=H.slice(1),F=H[0]}if(H==="0")return 0;if(F==="0"){if(H[1]==="b")return B*parseInt(H.slice(2),2);if(H[1]==="x")return B*parseInt(H.slice(2),16);if(H[1]==="o")return B*parseInt(H.slice(2),8)}return B*parseInt(H,10)}function Y(q){return W(q)}function z(q){return Object.prototype.toString.call(q)==="[object Number]"&&(q%1===0&&!$.isNegativeZero(q))}return L7=new Z("tag:yaml.org,2002:int",{kind:"scalar",resolve:G,construct:Y,predicate:z,represent:{binary:function(q){return q>=0?"0b"+q.toString(2):"-0b"+q.toString(2).slice(1)},octal:function(q){return q>=0?"0o"+q.toString(8):"-0o"+q.toString(8).slice(1)},decimal:function(q){return q.toString(10)},hexadecimal:function(q){return q>=0?"0x"+q.toString(16).toUpperCase():"-0x"+q.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),L7}function zW(){if(mG)return M7;mG=1;let $=N9(),Z=I$(),X=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Q=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function J(q){if(q===null)return!1;if(!X.test(q))return!1;if(isFinite(parseFloat(q,10)))return!0;return Q.test(q)}function G(q){let H=q.toLowerCase(),B=H[0]==="-"?-1:1;if("+-".indexOf(H[0])>=0)H=H.slice(1);if(H===".inf")return B===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(H===".nan")return NaN;return B*parseFloat(H,10)}let W=/^[-+]?[0-9]+e/;function Y(q,H){if(isNaN(q))switch(H){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===q)switch(H){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===q)switch(H){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if($.isNegativeZero(q))return"-0.0";let B=q.toString(10);return W.test(B)?B.replace("e",".e"):B}function z(q){return Object.prototype.toString.call(q)==="[object Number]"&&(q%1!==0||$.isNegativeZero(q))}return M7=new Z("tag:yaml.org,2002:float",{kind:"scalar",resolve:J,construct:G,predicate:z,represent:Y,defaultStyle:"lowercase"}),M7}function qW(){if(dG)return A7;return dG=1,A7=JW().extend({implicit:[GW(),WW(),YW(),zW()]}),A7}function KW(){if(lG)return I7;return lG=1,I7=qW(),I7}function UW(){if(cG)return N7;cG=1;let $=I$(),Z=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),X=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 Q(W){if(W===null)return!1;if(Z.exec(W)!==null)return!0;if(X.exec(W)!==null)return!0;return!1}function J(W){let Y=0,z=null,q=Z.exec(W);if(q===null)q=X.exec(W);if(q===null)throw Error("Date resolve error");let H=+q[1],B=+q[2]-1,F=+q[3];if(!q[4])return new Date(Date.UTC(H,B,F));let L=+q[4],w=+q[5],N=+q[6];if(q[7]){Y=q[7].slice(0,3);while(Y.length<3)Y+="0";Y=+Y}if(q[9]){let T=+q[10],E=+(q[11]||0);if(z=(T*60+E)*60000,q[9]==="-")z=-z}let I=new Date(Date.UTC(H,B,F,L,w,N,Y));if(z)I.setTime(I.getTime()-z);return I}function G(W){return W.toISOString()}return N7=new $("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Q,construct:J,instanceOf:Date,represent:G}),N7}function HW(){if(pG)return D7;pG=1;let $=I$();function Z(X){return X==="<<"||X===null}return D7=new $("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Z}),D7}function VW(){if(iG)return w7;iG=1;let $=I$(),Z=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
31
|
+
\r`;function X(W){if(W===null)return!1;let Y=0,z=W.length,q=Z;for(let H=0;H<z;H++){let B=q.indexOf(W.charAt(H));if(B>64)continue;if(B<0)return!1;Y+=6}return Y%8===0}function Q(W){let Y=W.replace(/[\r\n=]/g,""),z=Y.length,q=Z,H=0,B=[];for(let L=0;L<z;L++){if(L%4===0&&L)B.push(H>>16&255),B.push(H>>8&255),B.push(H&255);H=H<<6|q.indexOf(Y.charAt(L))}let F=z%4*6;if(F===0)B.push(H>>16&255),B.push(H>>8&255),B.push(H&255);else if(F===18)B.push(H>>10&255),B.push(H>>2&255);else if(F===12)B.push(H>>4&255);return new Uint8Array(B)}function J(W){let Y="",z=0,q=W.length,H=Z;for(let F=0;F<q;F++){if(F%3===0&&F)Y+=H[z>>18&63],Y+=H[z>>12&63],Y+=H[z>>6&63],Y+=H[z&63];z=(z<<8)+W[F]}let B=q%3;if(B===0)Y+=H[z>>18&63],Y+=H[z>>12&63],Y+=H[z>>6&63],Y+=H[z&63];else if(B===2)Y+=H[z>>10&63],Y+=H[z>>4&63],Y+=H[z<<2&63],Y+=H[64];else if(B===1)Y+=H[z>>2&63],Y+=H[z<<4&63],Y+=H[64],Y+=H[64];return Y}function G(W){return Object.prototype.toString.call(W)==="[object Uint8Array]"}return w7=new $("tag:yaml.org,2002:binary",{kind:"scalar",resolve:X,construct:Q,predicate:G,represent:J}),w7}function BW(){if(nG)return T7;nG=1;let $=I$(),Z=Object.prototype.hasOwnProperty,X=Object.prototype.toString;function Q(G){if(G===null)return!0;let W=[],Y=G;for(let z=0,q=Y.length;z<q;z+=1){let H=Y[z],B=!1;if(X.call(H)!=="[object Object]")return!1;let F;for(F in H)if(Z.call(H,F))if(!B)B=!0;else return!1;if(!B)return!1;if(W.indexOf(F)===-1)W.push(F);else return!1}return!0}function J(G){return G!==null?G:[]}return T7=new $("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Q,construct:J}),T7}function FW(){if(rG)return j7;rG=1;let $=I$(),Z=Object.prototype.toString;function X(J){if(J===null)return!0;let G=J,W=Array(G.length);for(let Y=0,z=G.length;Y<z;Y+=1){let q=G[Y];if(Z.call(q)!=="[object Object]")return!1;let H=Object.keys(q);if(H.length!==1)return!1;W[Y]=[H[0],q[H[0]]]}return!0}function Q(J){if(J===null)return[];let G=J,W=Array(G.length);for(let Y=0,z=G.length;Y<z;Y+=1){let q=G[Y],H=Object.keys(q);W[Y]=[H[0],q[H[0]]]}return W}return j7=new $("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:X,construct:Q}),j7}function LW(){if(aG)return O7;aG=1;let $=I$(),Z=Object.prototype.hasOwnProperty;function X(J){if(J===null)return!0;let G=J;for(let W in G)if(Z.call(G,W)){if(G[W]!==null)return!1}return!0}function Q(J){return J!==null?J:{}}return O7=new $("tag:yaml.org,2002:set",{kind:"mapping",resolve:X,construct:Q}),O7}function P7(){if(oG)return E7;return oG=1,E7=KW().extend({implicit:[UW(),HW()],explicit:[VW(),BW(),FW(),LW()]}),E7}function o2(){if(sG)return p8;sG=1;let $=N9(),Z=D9(),X=a2(),Q=P7(),J=Object.prototype.hasOwnProperty,G=1,W=2,Y=3,z=4,q=1,H=2,B=3,F=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,L=/[\x85\u2028\u2029]/,w=/[,\[\]{}]/,N=/^(?:!|!!|![0-9A-Za-z-]+!)$/,I=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function T(V){return Object.prototype.toString.call(V)}function E(V){return V===10||V===13}function P(V){return V===9||V===32}function R(V){return V===9||V===32||V===10||V===13}function C(V){return V===44||V===91||V===93||V===123||V===125}function y(V){if(V>=48&&V<=57)return V-48;let S=V|32;if(S>=97&&S<=102)return S-97+10;return-1}function v(V){if(V===120)return 2;if(V===117)return 4;if(V===85)return 8;return 0}function h(V){if(V>=48&&V<=57)return V-48;return-1}function X0(V){switch(V){case 48:return"\x00";case 97:return"\x07";case 98:return"\b";case 116:return"\t";case 9:return"\t";case 110:return`
|
|
32
|
+
`;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(V){if(V<=65535)return String.fromCharCode(V);return String.fromCharCode((V-65536>>10)+55296,(V-65536&1023)+56320)}function u(V,S,m){if(S==="__proto__")Object.defineProperty(V,S,{configurable:!0,enumerable:!0,writable:!0,value:m});else V[S]=m}let t=Array(256),Y0=Array(256);for(let V=0;V<256;V++)t[V]=X0(V)?1:0,Y0[V]=X0(V);function G0(V,S){this.input=V,this.filename=S.filename||null,this.schema=S.schema||Q,this.onWarning=S.onWarning||null,this.legacy=S.legacy||!1,this.json=S.json||!1,this.listener=S.listener||null,this.maxDepth=typeof S.maxDepth==="number"?S.maxDepth:100,this.maxTotalMergeKeys=typeof S.maxTotalMergeKeys==="number"?S.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=V.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 A0(V,S){let m={name:V.filename,buffer:V.input.slice(0,-1),position:V.position,line:V.line,column:V.position-V.lineStart};return m.snippet=X(m),new Z(S,m)}function l(V,S){throw A0(V,S)}function K0(V,S){if(V.onWarning)V.onWarning.call(null,A0(V,S))}function V0(V,S,m){let p=V.anchorMapTransactions;if(p.length!==0){let k=p[p.length-1];if(!J.call(k,S))k[S]={existed:J.call(V.anchorMap,S),value:V.anchorMap[S]}}V.anchorMap[S]=m}function o(V){V.anchorMapTransactions.push(Object.create(null))}function f(V){let S=V.anchorMapTransactions.pop(),m=V.anchorMapTransactions;if(m.length===0)return;let p=m[m.length-1],k=Object.keys(S);for(let a=0,A=k.length;a<A;a+=1){let _=k[a];if(!J.call(p,_))p[_]=S[_]}}function Z0(V){let S=V.anchorMapTransactions.pop(),m=Object.keys(S);for(let p=m.length-1;p>=0;p-=1){let k=S[m[p]];if(k.existed)V.anchorMap[m[p]]=k.value;else delete V.anchorMap[m[p]]}}function J0(V){return{position:V.position,line:V.line,lineStart:V.lineStart,lineIndent:V.lineIndent,firstTabInLine:V.firstTabInLine,tag:V.tag,anchor:V.anchor,kind:V.kind,result:V.result}}function $0(V,S){V.position=S.position,V.line=S.line,V.lineStart=S.lineStart,V.lineIndent=S.lineIndent,V.firstTabInLine=S.firstTabInLine,V.tag=S.tag,V.anchor=S.anchor,V.kind=S.kind,V.result=S.result}let F0={YAML:function(S,m,p){if(S.version!==null)l(S,"duplication of %YAML directive");if(p.length!==1)l(S,"YAML directive accepts exactly one argument");let k=/^([0-9]+)\.([0-9]+)$/.exec(p[0]);if(k===null)l(S,"ill-formed argument of the YAML directive");let a=parseInt(k[1],10),A=parseInt(k[2],10);if(a!==1)l(S,"unacceptable YAML version of the document");if(S.version=p[0],S.checkLineBreaks=A<2,A!==1&&A!==2)K0(S,"unsupported YAML version of the document")},TAG:function(S,m,p){let k;if(p.length!==2)l(S,"TAG directive accepts exactly two arguments");let a=p[0];if(k=p[1],!N.test(a))l(S,"ill-formed tag handle (first argument) of the TAG directive");if(J.call(S.tagMap,a))l(S,'there is a previously declared suffix for "'+a+'" tag handle');if(!I.test(k))l(S,"ill-formed tag prefix (second argument) of the TAG directive");try{k=decodeURIComponent(k)}catch(A){l(S,"tag prefix is malformed: "+k)}S.tagMap[a]=k}};function U0(V,S,m,p){if(S<m){let k=V.input.slice(S,m);if(p)for(let a=0,A=k.length;a<A;a+=1){let _=k.charCodeAt(a);if(!(_===9||_>=32&&_<=1114111))l(V,"expected valid JSON character")}else if(F.test(k))l(V,"the stream contains non-printable characters");V.result+=k}}function D0(V,S,m,p){if(!$.isObject(m))l(V,"cannot merge mappings; the provided source object is unacceptable");let k=Object.keys(m);for(let a=0,A=k.length;a<A;a+=1){let _=k[a];if(V.maxTotalMergeKeys!==-1&&++V.totalMergeKeys>V.maxTotalMergeKeys)l(V,"merge keys exceeded maxTotalMergeKeys ("+V.maxTotalMergeKeys+")");if(!J.call(S,_))u(S,_,m[_]),p[_]=!0}}function e(V,S,m,p,k,a,A,_,n){if(Array.isArray(k)){k=Array.prototype.slice.call(k);for(let d=0,c=k.length;d<c;d+=1){if(Array.isArray(k[d]))l(V,"nested arrays are not supported inside keys");if(typeof k==="object"&&T(k[d])==="[object Object]")k[d]="[object Object]"}}if(typeof k==="object"&&T(k)==="[object Object]")k="[object Object]";if(k=String(k),S===null)S={};if(p==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(let d=0,c=a.length;d<c;d+=1)D0(V,S,a[d],m);else D0(V,S,a,m);else{if(!V.json&&!J.call(m,k)&&J.call(S,k))V.line=A||V.line,V.lineStart=_||V.lineStart,V.position=n||V.position,l(V,"duplicated mapping key");u(S,k,a),delete m[k]}return S}function d0(V){let S=V.input.charCodeAt(V.position);if(S===10)V.position++;else if(S===13){if(V.position++,V.input.charCodeAt(V.position)===10)V.position++}else l(V,"a line break is expected");V.line+=1,V.lineStart=V.position,V.firstTabInLine=-1}function R0(V,S,m){let p=0,k=V.input.charCodeAt(V.position);while(k!==0){while(P(k)){if(k===9&&V.firstTabInLine===-1)V.firstTabInLine=V.position;k=V.input.charCodeAt(++V.position)}if(S&&k===35)do k=V.input.charCodeAt(++V.position);while(k!==10&&k!==13&&k!==0);if(E(k)){d0(V),k=V.input.charCodeAt(V.position),p++,V.lineIndent=0;while(k===32)V.lineIndent++,k=V.input.charCodeAt(++V.position)}else break}if(m!==-1&&p!==0&&V.lineIndent<m)K0(V,"deficient indentation");return p}function p0(V){let S=V.position,m=V.input.charCodeAt(S);if((m===45||m===46)&&m===V.input.charCodeAt(S+1)&&m===V.input.charCodeAt(S+2)){if(S+=3,m=V.input.charCodeAt(S),m===0||R(m))return!0}return!1}function v0(V,S){if(S===1)V.result+=" ";else if(S>1)V.result+=$.repeat(`
|
|
33
|
+
`,S-1)}function i0(V,S,m){let p,k,a,A,_,n,d=V.kind,c=V.result,K=V.input.charCodeAt(V.position);if(R(K)||C(K)||K===35||K===38||K===42||K===33||K===124||K===62||K===39||K===34||K===37||K===64||K===96)return!1;if(K===63||K===45){let M=V.input.charCodeAt(V.position+1);if(R(M)||m&&C(M))return!1}V.kind="scalar",V.result="",p=k=V.position,a=!1;while(K!==0){if(K===58){let M=V.input.charCodeAt(V.position+1);if(R(M)||m&&C(M))break}else if(K===35){let M=V.input.charCodeAt(V.position-1);if(R(M))break}else if(V.position===V.lineStart&&p0(V)||m&&C(K))break;else if(E(K))if(A=V.line,_=V.lineStart,n=V.lineIndent,R0(V,!1,-1),V.lineIndent>=S){a=!0,K=V.input.charCodeAt(V.position);continue}else{V.position=k,V.line=A,V.lineStart=_,V.lineIndent=n;break}if(a)U0(V,p,k,!1),v0(V,V.line-A),p=k=V.position,a=!1;if(!P(K))k=V.position+1;K=V.input.charCodeAt(++V.position)}if(U0(V,p,k,!1),V.result)return!0;return V.kind=d,V.result=c,!1}function O$(V,S){let m,p,k=V.input.charCodeAt(V.position);if(k!==39)return!1;V.kind="scalar",V.result="",V.position++,m=p=V.position;while((k=V.input.charCodeAt(V.position))!==0)if(k===39)if(U0(V,m,V.position,!0),k=V.input.charCodeAt(++V.position),k===39)m=V.position,V.position++,p=V.position;else return!0;else if(E(k))U0(V,m,p,!0),v0(V,R0(V,!1,S)),m=p=V.position;else if(V.position===V.lineStart&&p0(V))l(V,"unexpected end of the document within a single quoted scalar");else if(V.position++,!P(k))p=V.position;l(V,"unexpected end of the stream within a single quoted scalar")}function q$(V,S){let m,p,k,a=V.input.charCodeAt(V.position);if(a!==34)return!1;V.kind="scalar",V.result="",V.position++,m=p=V.position;while((a=V.input.charCodeAt(V.position))!==0)if(a===34)return U0(V,m,V.position,!0),V.position++,!0;else if(a===92){if(U0(V,m,V.position,!0),a=V.input.charCodeAt(++V.position),E(a))R0(V,!1,S);else if(a<256&&t[a])V.result+=Y0[a],V.position++;else if((k=v(a))>0){let A=k,_=0;for(;A>0;A--)if(a=V.input.charCodeAt(++V.position),(k=y(a))>=0)_=(_<<4)+k;else l(V,"expected hexadecimal character");V.result+=r(_),V.position++}else l(V,"unknown escape sequence");m=p=V.position}else if(E(a))U0(V,m,p,!0),v0(V,R0(V,!1,S)),m=p=V.position;else if(V.position===V.lineStart&&p0(V))l(V,"unexpected end of the document within a double quoted scalar");else if(V.position++,!P(a))p=V.position;l(V,"unexpected end of the stream within a double quoted scalar")}function M1(V,S){let m=!0,p,k,a,A=V.tag,_,n=V.anchor,d,c,K,M,D=Object.create(null),j,O,g,i=V.input.charCodeAt(V.position);if(i===91)d=93,M=!1,_=[];else if(i===123)d=125,M=!0,_={};else return!1;if(V.anchor!==null)V0(V,V.anchor,_);i=V.input.charCodeAt(++V.position);while(i!==0){if(R0(V,!0,S),i=V.input.charCodeAt(V.position),i===d)return V.position++,V.tag=A,V.anchor=n,V.kind=M?"mapping":"sequence",V.result=_,!0;else if(!m)l(V,"missed comma between flow collection entries");else if(i===44)l(V,"expected the node content, but found ','");if(O=j=g=null,c=K=!1,i===63){let Q0=V.input.charCodeAt(V.position+1);if(R(Q0))c=K=!0,V.position++,R0(V,!0,S)}if(p=V.line,k=V.lineStart,a=V.position,h$(V,S,G,!1,!0),O=V.tag,j=V.result,R0(V,!0,S),i=V.input.charCodeAt(V.position),(K||V.line===p)&&i===58)c=!0,i=V.input.charCodeAt(++V.position),R0(V,!0,S),h$(V,S,G,!1,!0),g=V.result;if(M)e(V,_,D,O,j,g,p,k,a);else if(c)_.push(e(V,null,D,O,j,g,p,k,a));else _.push(j);if(R0(V,!0,S),i=V.input.charCodeAt(V.position),i===44)m=!0,i=V.input.charCodeAt(++V.position);else m=!1}l(V,"unexpected end of the stream within a flow collection")}function A1(V,S){let m,p=q,k=!1,a=!1,A=S,_=0,n=!1,d,c=V.input.charCodeAt(V.position);if(c===124)m=!1;else if(c===62)m=!0;else return!1;V.kind="scalar",V.result="";while(c!==0)if(c=V.input.charCodeAt(++V.position),c===43||c===45)if(q===p)p=c===43?B:H;else l(V,"repeat of a chomping mode identifier");else if((d=h(c))>=0)if(d===0)l(V,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!a)A=S+d-1,a=!0;else l(V,"repeat of an indentation width identifier");else break;if(P(c)){do c=V.input.charCodeAt(++V.position);while(P(c));if(c===35)do c=V.input.charCodeAt(++V.position);while(!E(c)&&c!==0)}while(c!==0){d0(V),V.lineIndent=0,c=V.input.charCodeAt(V.position);while((!a||V.lineIndent<A)&&c===32)V.lineIndent++,c=V.input.charCodeAt(++V.position);if(!a&&V.lineIndent>A)A=V.lineIndent;if(E(c)){_++;continue}if(!a&&A===0)l(V,"missing indentation for block scalar");if(V.lineIndent<A){if(p===B)V.result+=$.repeat(`
|
|
32
34
|
`,k?1+_:_);else if(p===q){if(k)V.result+=`
|
|
33
|
-
`}break}if(
|
|
35
|
+
`}break}if(m)if(P(c))n=!0,V.result+=$.repeat(`
|
|
34
36
|
`,k?1+_:_);else if(n)n=!1,V.result+=$.repeat(`
|
|
35
37
|
`,_+1);else if(_===0){if(k)V.result+=" "}else V.result+=$.repeat(`
|
|
36
38
|
`,_);else V.result+=$.repeat(`
|
|
37
|
-
`,k?1+_:_);k=!0,a=!0,_=0;let
|
|
38
|
-
`;if(V.charCodeAt(0)===65279)V=V.slice(1)}let
|
|
39
|
-
`,d);if(
|
|
40
|
-
`)c+=n;c+=
|
|
41
|
-
`+$.repeat(" ",
|
|
42
|
-
`,
|
|
43
|
-
`||
|
|
44
|
-
`)?"+":d?"":"-";return n+
|
|
45
|
-
`}function
|
|
46
|
-
`?
|
|
47
|
-
`);return
|
|
48
|
-
`||
|
|
49
|
-
`:"")+
|
|
50
|
-
`+
|
|
51
|
-
`,
|
|
52
|
-
`+
|
|
53
|
-
`;return""}return
|
|
39
|
+
`,k?1+_:_);k=!0,a=!0,_=0;let K=V.position;while(!E(c)&&c!==0)c=V.input.charCodeAt(++V.position);U0(V,K,V.position,!1)}return!0}function f$(V,S){let{tag:m,anchor:p}=V,k=[],a=!1;if(V.firstTabInLine!==-1)return!1;if(V.anchor!==null)V0(V,V.anchor,k);let A=V.input.charCodeAt(V.position);while(A!==0){if(V.firstTabInLine!==-1)V.position=V.firstTabInLine,l(V,"tab characters must not be used in indentation");if(A!==45)break;let _=V.input.charCodeAt(V.position+1);if(!R(_))break;if(a=!0,V.position++,R0(V,!0,-1)){if(V.lineIndent<=S){k.push(null),A=V.input.charCodeAt(V.position);continue}}let n=V.line;if(h$(V,S,Y,!1,!0),k.push(V.result),R0(V,!0,-1),A=V.input.charCodeAt(V.position),(V.line===n||V.lineIndent>S)&&A!==0)l(V,"bad indentation of a sequence entry");else if(V.lineIndent<S)break}if(a)return V.tag=m,V.anchor=p,V.kind="sequence",V.result=k,!0;return!1}function K$(V,S,m){let p,k,a,A,_=V.tag,n=V.anchor,d={},c=Object.create(null),K=null,M=null,D=null,j=!1,O=!1;if(V.firstTabInLine!==-1)return!1;if(V.anchor!==null)V0(V,V.anchor,d);let g=V.input.charCodeAt(V.position);while(g!==0){if(!j&&V.firstTabInLine!==-1)V.position=V.firstTabInLine,l(V,"tab characters must not be used in indentation");let i=V.input.charCodeAt(V.position+1),Q0=V.line;if((g===63||g===58)&&R(i)){if(g===63){if(j)e(V,d,c,K,M,null,k,a,A),K=M=D=null;O=!0,j=!0,p=!0}else if(j)j=!1,p=!0;else l(V,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");V.position+=1,g=i}else{if(k=V.line,a=V.lineStart,A=V.position,!h$(V,m,W,!1,!0))break;if(V.line===Q0){g=V.input.charCodeAt(V.position);while(P(g))g=V.input.charCodeAt(++V.position);if(g===58){if(g=V.input.charCodeAt(++V.position),!R(g))l(V,"a whitespace character is expected after the key-value separator within a block mapping");if(j)e(V,d,c,K,M,null,k,a,A),K=M=D=null;O=!0,j=!1,p=!1,K=V.tag,M=V.result}else if(O)l(V,"can not read an implicit mapping pair; a colon is missed");else return V.tag=_,V.anchor=n,!0}else if(O)l(V,"can not read a block mapping entry; a multiline key may not be an implicit key");else return V.tag=_,V.anchor=n,!0}if(V.line===Q0||V.lineIndent>S){if(j)k=V.line,a=V.lineStart,A=V.position;if(h$(V,S,z,!0,p))if(j)M=V.result;else D=V.result;if(!j)e(V,d,c,K,M,D,k,a,A),K=M=D=null;R0(V,!0,-1),g=V.input.charCodeAt(V.position)}if((V.line===Q0||V.lineIndent>S)&&g!==0)l(V,"bad indentation of a mapping entry");else if(V.lineIndent<S)break}if(j)e(V,d,c,K,M,null,k,a,A);if(O)V.tag=_,V.anchor=n,V.kind="mapping",V.result=d;return O}function I1(V){let S=!1,m=!1,p,k,a=V.input.charCodeAt(V.position);if(a!==33)return!1;if(V.tag!==null)l(V,"duplication of a tag property");if(a=V.input.charCodeAt(++V.position),a===60)S=!0,a=V.input.charCodeAt(++V.position);else if(a===33)m=!0,p="!!",a=V.input.charCodeAt(++V.position);else p="!";let A=V.position;if(S){do a=V.input.charCodeAt(++V.position);while(a!==0&&a!==62);if(V.position<V.length)k=V.input.slice(A,V.position),a=V.input.charCodeAt(++V.position);else l(V,"unexpected end of the stream within a verbatim tag")}else{while(a!==0&&!R(a)){if(a===33)if(!m){if(p=V.input.slice(A-1,V.position+1),!N.test(p))l(V,"named tag handle cannot contain such characters");m=!0,A=V.position+1}else l(V,"tag suffix cannot contain exclamation marks");a=V.input.charCodeAt(++V.position)}if(k=V.input.slice(A,V.position),w.test(k))l(V,"tag suffix cannot contain flow indicator characters")}if(k&&!I.test(k))l(V,"tag name cannot contain such characters: "+k);try{k=decodeURIComponent(k)}catch(_){l(V,"tag name is malformed: "+k)}if(S)V.tag=k;else if(J.call(V.tagMap,p))V.tag=V.tagMap[p]+k;else if(p==="!")V.tag="!"+k;else if(p==="!!")V.tag="tag:yaml.org,2002:"+k;else l(V,'undeclared tag handle "'+p+'"');return!0}function Y6(V){let S=V.input.charCodeAt(V.position);if(S!==38)return!1;if(V.anchor!==null)l(V,"duplication of an anchor property");S=V.input.charCodeAt(++V.position);let m=V.position;while(S!==0&&!R(S)&&!C(S))S=V.input.charCodeAt(++V.position);if(V.position===m)l(V,"name of an anchor node must contain at least one character");return V.anchor=V.input.slice(m,V.position),!0}function h1(V){let S=V.input.charCodeAt(V.position);if(S!==42)return!1;S=V.input.charCodeAt(++V.position);let m=V.position;while(S!==0&&!R(S)&&!C(S))S=V.input.charCodeAt(++V.position);if(V.position===m)l(V,"name of an alias node must contain at least one character");let p=V.input.slice(m,V.position);if(!J.call(V.anchorMap,p))l(V,'unidentified alias "'+p+'"');return V.result=V.anchorMap[p],R0(V,!0,-1),!0}function Y9(V,S,m,p){let k=J0(V);if(o(V),$0(V,S),V.tag=null,V.anchor=null,V.kind=null,V.result=null,K$(V,m,p)&&V.kind==="mapping")return f(V),!0;return Z0(V),$0(V,k),!1}function h$(V,S,m,p,k){let a,A,_=1,n=!1,d=!1,c=null,K,M,D;if(V.depth>=V.maxDepth)l(V,"nesting exceeded maxDepth ("+V.maxDepth+")");if(V.depth+=1,V.listener!==null)V.listener("open",V);V.tag=null,V.anchor=null,V.kind=null,V.result=null;let j=a=A=z===m||Y===m;if(p){if(R0(V,!0,-1)){if(n=!0,V.lineIndent>S)_=1;else if(V.lineIndent===S)_=0;else if(V.lineIndent<S)_=-1}}if(_===1)while(!0){let O=V.input.charCodeAt(V.position),g=J0(V);if(n&&(O===33&&V.tag!==null||O===38&&V.anchor!==null))break;if(!I1(V)&&!Y6(V))break;if(c===null)c=g;if(R0(V,!0,-1)){if(n=!0,A=j,V.lineIndent>S)_=1;else if(V.lineIndent===S)_=0;else if(V.lineIndent<S)_=-1}else A=!1}if(A)A=n||k;if(_===1||z===m){if(G===m||W===m)M=S;else M=S+1;if(D=V.position-V.lineStart,_===1)if(A&&(f$(V,D)||K$(V,D,M))||M1(V,M))d=!0;else{let O=V.input.charCodeAt(V.position);if(c!==null&&j&&!A&&O!==124&&O!==62&&Y9(V,c,c.position-c.lineStart,M))d=!0;else if(a&&A1(V,M)||O$(V,M)||q$(V,M))d=!0;else if(h1(V)){if(d=!0,V.tag!==null||V.anchor!==null)l(V,"alias node should not have any properties")}else if(i0(V,M,G===m)){if(d=!0,V.tag===null)V.tag="?"}if(V.anchor!==null)V0(V,V.anchor,V.result)}else if(_===0)d=A&&f$(V,D)}if(V.tag===null){if(V.anchor!==null)V0(V,V.anchor,V.result)}else if(V.tag==="?"){if(V.result!==null&&V.kind!=="scalar")l(V,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+V.kind+'"');for(let O=0,g=V.implicitTypes.length;O<g;O+=1)if(K=V.implicitTypes[O],K.resolve(V.result)){if(V.result=K.construct(V.result),V.tag=K.tag,V.anchor!==null)V0(V,V.anchor,V.result);break}}else if(V.tag!=="!"){if(J.call(V.typeMap[V.kind||"fallback"],V.tag))K=V.typeMap[V.kind||"fallback"][V.tag];else{K=null;let O=V.typeMap.multi[V.kind||"fallback"];for(let g=0,i=O.length;g<i;g+=1)if(V.tag.slice(0,O[g].tag.length)===O[g].tag){K=O[g];break}}if(!K)l(V,"unknown tag !<"+V.tag+">");if(V.result!==null&&K.kind!==V.kind)l(V,"unacceptable node kind for !<"+V.tag+'> tag; it should be "'+K.kind+'", not "'+V.kind+'"');if(!K.resolve(V.result,V.tag))l(V,"cannot resolve a node with !<"+V.tag+"> explicit tag");else if(V.result=K.construct(V.result,V.tag),V.anchor!==null)V0(V,V.anchor,V.result)}if(V.listener!==null)V.listener("close",V);return V.depth-=1,V.tag!==null||V.anchor!==null||d}function z9(V){let S=V.position,m=!1,p;V.version=null,V.checkLineBreaks=V.legacy,V.tagMap=Object.create(null),V.anchorMap=Object.create(null);while((p=V.input.charCodeAt(V.position))!==0){if(R0(V,!0,-1),p=V.input.charCodeAt(V.position),V.lineIndent>0||p!==37)break;m=!0,p=V.input.charCodeAt(++V.position);let k=V.position;while(p!==0&&!R(p))p=V.input.charCodeAt(++V.position);let a=V.input.slice(k,V.position),A=[];if(a.length<1)l(V,"directive name must not be less than one character in length");while(p!==0){while(P(p))p=V.input.charCodeAt(++V.position);if(p===35){do p=V.input.charCodeAt(++V.position);while(p!==0&&!E(p));break}if(E(p))break;k=V.position;while(p!==0&&!R(p))p=V.input.charCodeAt(++V.position);A.push(V.input.slice(k,V.position))}if(p!==0)d0(V);if(J.call(F0,a))F0[a](V,a,A);else K0(V,'unknown document directive "'+a+'"')}if(R0(V,!0,-1),V.lineIndent===0&&V.input.charCodeAt(V.position)===45&&V.input.charCodeAt(V.position+1)===45&&V.input.charCodeAt(V.position+2)===45)V.position+=3,R0(V,!0,-1);else if(m)l(V,"directives end mark is expected");if(h$(V,V.lineIndent-1,z,!1,!0),R0(V,!0,-1),V.checkLineBreaks&&L.test(V.input.slice(S,V.position)))K0(V,"non-ASCII line breaks are interpreted as content");if(V.documents.push(V.result),V.position===V.lineStart&&p0(V)){if(V.input.charCodeAt(V.position)===46)V.position+=3,R0(V,!0,-1);return}if(V.position<V.length-1)l(V,"end of the stream or a document separator is expected")}function z6(V,S){if(V=String(V),S=S||{},V.length!==0){if(V.charCodeAt(V.length-1)!==10&&V.charCodeAt(V.length-1)!==13)V+=`
|
|
40
|
+
`;if(V.charCodeAt(0)===65279)V=V.slice(1)}let m=new G0(V,S),p=V.indexOf("\x00");if(p!==-1)m.position=p,l(m,"null byte is not allowed in input");m.input+="\x00";while(m.input.charCodeAt(m.position)===32)m.lineIndent+=1,m.position+=1;while(m.position<m.length-1)z9(m);return m.documents}function q6(V,S,m){if(S!==null&&typeof S==="object"&&typeof m>"u")m=S,S=null;let p=z6(V,m);if(typeof S!=="function")return p;for(let k=0,a=p.length;k<a;k+=1)S(p[k])}function K6(V,S){let m=z6(V,S);if(m.length===0)return;else if(m.length===1)return m[0];throw new Z("expected a single document in the stream, but found more")}return p8.loadAll=q6,p8.load=K6,p8}function s2(){if(tG)return R7;tG=1;let $=N9(),Z=D9(),X=P7(),Q=Object.prototype.toString,J=Object.prototype.hasOwnProperty,G=65279,W=9,Y=10,z=13,q=32,H=33,B=34,F=35,L=37,w=38,N=39,I=42,T=44,E=45,P=58,R=61,C=62,y=63,v=64,h=91,X0=93,r=96,u=123,t=124,Y0=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 A0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],l=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function K0(A,_){if(_===null)return{};let n={},d=Object.keys(_);for(let c=0,K=d.length;c<K;c+=1){let M=d[c],D=String(_[M]);if(M.slice(0,2)==="!!")M="tag:yaml.org,2002:"+M.slice(2);let j=A.compiledTypeMap.fallback[M];if(j&&J.call(j.styleAliases,D))D=j.styleAliases[D];n[M]=D}return n}function V0(A){let _,n,d=A.toString(16).toUpperCase();if(A<=255)_="x",n=2;else if(A<=65535)_="u",n=4;else if(A<=4294967295)_="U",n=8;else throw new Z("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+_+$.repeat("0",n-d.length)+d}let o=1,f=2;function Z0(A){this.schema=A.schema||X,this.indent=Math.max(1,A.indent||2),this.noArrayIndent=A.noArrayIndent||!1,this.skipInvalid=A.skipInvalid||!1,this.flowLevel=$.isNothing(A.flowLevel)?-1:A.flowLevel,this.styleMap=K0(this.schema,A.styles||null),this.sortKeys=A.sortKeys||!1,this.lineWidth=A.lineWidth||80,this.noRefs=A.noRefs||!1,this.noCompatMode=A.noCompatMode||!1,this.condenseFlow=A.condenseFlow||!1,this.quotingType=A.quotingType==='"'?f:o,this.forceQuotes=A.forceQuotes||!1,this.replacer=typeof A.replacer==="function"?A.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function J0(A,_){let n=$.repeat(" ",_),d=0,c="",K=A.length;while(d<K){let M,D=A.indexOf(`
|
|
41
|
+
`,d);if(D===-1)M=A.slice(d),d=K;else M=A.slice(d,D+1),d=D+1;if(M.length&&M!==`
|
|
42
|
+
`)c+=n;c+=M}return c}function $0(A,_){return`
|
|
43
|
+
`+$.repeat(" ",A.indent*_)}function F0(A,_){for(let n=0,d=A.implicitTypes.length;n<d;n+=1)if(A.implicitTypes[n].resolve(_))return!0;return!1}function U0(A){return A===q||A===W}function D0(A){return A>=32&&A<=126||A>=161&&A<=55295&&A!==8232&&A!==8233||A>=57344&&A<=65533&&A!==G||A>=65536&&A<=1114111}function e(A){return D0(A)&&A!==G&&A!==z&&A!==Y}function d0(A,_,n){let d=e(A),c=d&&!U0(A);return(n?d:d&&A!==T&&A!==h&&A!==X0&&A!==u&&A!==Y0)&&A!==F&&!(_===P&&!c)||e(_)&&!U0(_)&&A===F||_===P&&c}function R0(A){return D0(A)&&A!==G&&!U0(A)&&A!==E&&A!==y&&A!==P&&A!==T&&A!==h&&A!==X0&&A!==u&&A!==Y0&&A!==F&&A!==w&&A!==I&&A!==H&&A!==t&&A!==R&&A!==C&&A!==N&&A!==B&&A!==L&&A!==v&&A!==r}function p0(A){return!U0(A)&&A!==P}function v0(A,_){let n=A.charCodeAt(_),d;if(n>=55296&&n<=56319&&_+1<A.length){if(d=A.charCodeAt(_+1),d>=56320&&d<=57343)return(n-55296)*1024+d-56320+65536}return n}function i0(A){return/^\n* /.test(A)}let O$=1,q$=2,M1=3,A1=4,f$=5;function K$(A,_,n,d,c,K,M,D){let j,O=0,g=null,i=!1,Q0=!1,L0=d!==-1,M0=-1,j0=R0(v0(A,0))&&p0(v0(A,A.length-1));if(_||M)for(j=0;j<A.length;O>=65536?j+=2:j++){if(O=v0(A,j),!D0(O))return f$;j0=j0&&d0(O,g,D),g=O}else{for(j=0;j<A.length;O>=65536?j+=2:j++){if(O=v0(A,j),O===Y){if(i=!0,L0)Q0=Q0||j-M0-1>d&&A[M0+1]!==" ",M0=j}else if(!D0(O))return f$;j0=j0&&d0(O,g,D),g=O}Q0=Q0||L0&&(j-M0-1>d&&A[M0+1]!==" ")}if(!i&&!Q0){if(j0&&!M&&!c(A))return O$;return K===f?f$:q$}if(n>9&&i0(A))return f$;if(!M)return Q0?A1:M1;return K===f?f$:q$}function I1(A,_,n,d,c){A.dump=function(){if(_.length===0)return A.quotingType===f?'""':"''";if(!A.noCompatMode){if(A0.indexOf(_)!==-1||l.test(_))return A.quotingType===f?'"'+_+'"':"'"+_+"'"}let K=A.indent*Math.max(1,n),M=A.lineWidth===-1?-1:Math.max(Math.min(A.lineWidth,40),A.lineWidth-K),D=d||A.flowLevel>-1&&n>=A.flowLevel;function j(O){return F0(A,O)}switch(K$(_,D,A.indent,M,j,A.quotingType,A.forceQuotes&&!d,c)){case O$:return _;case q$:return"'"+_.replace(/'/g,"''")+"'";case M1:return"|"+Y6(_,A.indent)+h1(J0(_,K));case A1:return">"+Y6(_,A.indent)+h1(J0(Y9(_,M),K));case f$:return'"'+z9(_)+'"';default:throw new Z("impossible error: invalid scalar style")}}()}function Y6(A,_){let n=i0(A)?String(_):"",d=A[A.length-1]===`
|
|
44
|
+
`,K=d&&(A[A.length-2]===`
|
|
45
|
+
`||A===`
|
|
46
|
+
`)?"+":d?"":"-";return n+K+`
|
|
47
|
+
`}function h1(A){return A[A.length-1]===`
|
|
48
|
+
`?A.slice(0,-1):A}function Y9(A,_){let n=/(\n+)([^\n]*)/g,d=function(){let D=A.indexOf(`
|
|
49
|
+
`);return D=D!==-1?D:A.length,n.lastIndex=D,h$(A.slice(0,D),_)}(),c=A[0]===`
|
|
50
|
+
`||A[0]===" ",K,M;while(M=n.exec(A)){let D=M[1],j=M[2];K=j[0]===" ",d+=D+(!c&&!K&&j!==""?`
|
|
51
|
+
`:"")+h$(j,_),c=K}return d}function h$(A,_){if(A===""||A[0]===" ")return A;let n=/ [^ ]/g,d,c=0,K,M=0,D=0,j="";while(d=n.exec(A)){if(D=d.index,D-c>_)K=M>c?M:D,j+=`
|
|
52
|
+
`+A.slice(c,K),c=K+1;M=D}if(j+=`
|
|
53
|
+
`,A.length-c>_&&M>c)j+=A.slice(c,M)+`
|
|
54
|
+
`+A.slice(M+1);else j+=A.slice(c);return j.slice(1)}function z9(A){let _="",n=0;for(let d=0;d<A.length;n>=65536?d+=2:d++){n=v0(A,d);let c=G0[n];if(!c&&D0(n)){if(_+=A[d],n>=65536)_+=A[d+1]}else _+=c||V0(n)}return _}function z6(A,_,n){let d="",c=A.tag;for(let K=0,M=n.length;K<M;K+=1){let D=n[K];if(A.replacer)D=A.replacer.call(n,String(K),D);if(m(A,_,D,!1,!1)||typeof D>"u"&&m(A,_,null,!1,!1)){if(d!=="")d+=","+(!A.condenseFlow?" ":"");d+=A.dump}}A.tag=c,A.dump="["+d+"]"}function q6(A,_,n,d){let c="",K=A.tag;for(let M=0,D=n.length;M<D;M+=1){let j=n[M];if(A.replacer)j=A.replacer.call(n,String(M),j);if(m(A,_+1,j,!0,!0,!1,!0)||typeof j>"u"&&m(A,_+1,null,!0,!0,!1,!0)){if(!d||c!=="")c+=$0(A,_);if(A.dump&&Y===A.dump.charCodeAt(0))c+="-";else c+="- ";c+=A.dump}}A.tag=K,A.dump=c||"[]"}function K6(A,_,n){let d="",c=A.tag,K=Object.keys(n);for(let M=0,D=K.length;M<D;M+=1){let j="";if(d!=="")j+=", ";if(A.condenseFlow)j+='"';let O=K[M],g=n[O];if(A.replacer)g=A.replacer.call(n,O,g);if(!m(A,_,O,!1,!1))continue;if(A.dump.length>1024)j+="? ";if(j+=A.dump+(A.condenseFlow?'"':"")+":"+(A.condenseFlow?"":" "),!m(A,_,g,!1,!1))continue;j+=A.dump,d+=j}A.tag=c,A.dump="{"+d+"}"}function V(A,_,n,d){let c="",K=A.tag,M=Object.keys(n);if(A.sortKeys===!0)M.sort();else if(typeof A.sortKeys==="function")M.sort(A.sortKeys);else if(A.sortKeys)throw new Z("sortKeys must be a boolean or a function");for(let D=0,j=M.length;D<j;D+=1){let O="";if(!d||c!=="")O+=$0(A,_);let g=M[D],i=n[g];if(A.replacer)i=A.replacer.call(n,g,i);if(!m(A,_+1,g,!0,!0,!0))continue;let Q0=A.tag!==null&&A.tag!=="?"||A.dump&&A.dump.length>1024;if(Q0)if(A.dump&&Y===A.dump.charCodeAt(0))O+="?";else O+="? ";if(O+=A.dump,Q0)O+=$0(A,_);if(!m(A,_+1,i,!0,Q0))continue;if(A.dump&&Y===A.dump.charCodeAt(0))O+=":";else O+=": ";O+=A.dump,c+=O}A.tag=K,A.dump=c||"{}"}function S(A,_,n){let d=n?A.explicitTypes:A.implicitTypes;for(let c=0,K=d.length;c<K;c+=1){let M=d[c];if((M.instanceOf||M.predicate)&&(!M.instanceOf||typeof _==="object"&&_ instanceof M.instanceOf)&&(!M.predicate||M.predicate(_))){if(n)if(M.multi&&M.representName)A.tag=M.representName(_);else A.tag=M.tag;else A.tag="?";if(M.represent){let D=A.styleMap[M.tag]||M.defaultStyle,j;if(Q.call(M.represent)==="[object Function]")j=M.represent(_,D);else if(J.call(M.represent,D))j=M.represent[D](_,D);else throw new Z("!<"+M.tag+'> tag resolver accepts not "'+D+'" style');A.dump=j}return!0}}return!1}function m(A,_,n,d,c,K,M){if(A.tag=null,A.dump=n,!S(A,n,!1))S(A,n,!0);let D=Q.call(A.dump),j=d;if(d)d=A.flowLevel<0||A.flowLevel>_;let O=D==="[object Object]"||D==="[object Array]",g,i;if(O)g=A.duplicates.indexOf(n),i=g!==-1;if(A.tag!==null&&A.tag!=="?"||i||A.indent!==2&&_>0)c=!1;if(i&&A.usedDuplicates[g])A.dump="*ref_"+g;else{if(O&&i&&!A.usedDuplicates[g])A.usedDuplicates[g]=!0;if(D==="[object Object]"){if(d&&Object.keys(A.dump).length!==0){if(V(A,_,A.dump,c),i)A.dump="&ref_"+g+A.dump}else if(K6(A,_,A.dump),i)A.dump="&ref_"+g+" "+A.dump}else if(D==="[object Array]"){if(d&&A.dump.length!==0){if(A.noArrayIndent&&!M&&_>0)q6(A,_-1,A.dump,c);else q6(A,_,A.dump,c);if(i)A.dump="&ref_"+g+A.dump}else if(z6(A,_,A.dump),i)A.dump="&ref_"+g+" "+A.dump}else if(D==="[object String]"){if(A.tag!=="?")I1(A,A.dump,_,K,j)}else if(D==="[object Undefined]")return!1;else{if(A.skipInvalid)return!1;throw new Z("unacceptable kind of an object to dump "+D)}if(A.tag!==null&&A.tag!=="?"){let Q0=encodeURI(A.tag[0]==="!"?A.tag.slice(1):A.tag).replace(/!/g,"%21");if(A.tag[0]==="!")Q0="!"+Q0;else if(Q0.slice(0,18)==="tag:yaml.org,2002:")Q0="!!"+Q0.slice(18);else Q0="!<"+Q0+">";A.dump=Q0+" "+A.dump}}return!0}function p(A,_){let n=[],d=[];k(A,n,d);let c=d.length;for(let K=0;K<c;K+=1)_.duplicates.push(n[d[K]]);_.usedDuplicates=Array(c)}function k(A,_,n){if(A!==null&&typeof A==="object"){let d=_.indexOf(A);if(d!==-1){if(n.indexOf(d)===-1)n.push(d)}else if(_.push(A),Array.isArray(A))for(let c=0,K=A.length;c<K;c+=1)k(A[c],_,n);else{let c=Object.keys(A);for(let K=0,M=c.length;K<M;K+=1)k(A[c[K]],_,n)}}}function a(A,_){_=_||{};let n=new Z0(_);if(!n.noRefs)p(A,n);let d=A;if(n.replacer)d=n.replacer.call({"":d},"",d);if(m(n,0,d,!0,!0))return n.dump+`
|
|
55
|
+
`;return""}return R7.dump=a,R7}function t2(){if(eG)return H$;eG=1;let $=o2(),Z=s2();function X(Q,J){return function(){throw Error("Function yaml."+Q+" is removed in js-yaml 4. Use yaml."+J+" instead, which is now safe by default.")}}return H$.Type=I$(),H$.Schema=$W(),H$.FAILSAFE_SCHEMA=JW(),H$.JSON_SCHEMA=qW(),H$.CORE_SCHEMA=KW(),H$.DEFAULT_SCHEMA=P7(),H$.load=$.load,H$.loadAll=$.loadAll,H$.dump=Z.dump,H$.YAMLException=D9(),H$.types={binary:VW(),float:zW(),map:QW(),null:GW(),pairs:FW(),set:LW(),timestamp:UW(),bool:WW(),int:YW(),merge:HW(),omap:BW(),seq:XW(),str:ZW()},H$.safeLoad=X("safeLoad","load"),H$.safeLoadAll=X("safeLoadAll","loadAll"),H$.safeDump=X("safeDump","dump"),H$}var H$,p8,M6,CG,W7,SG,Y7,_G,z7,bG,q7,xG,K7,kG,U7,yG,H7,vG,V7,gG,B7,fG,F7,hG,L7,uG,M7,mG,A7,dG,I7,lG,N7,cG,D7,pG,w7,iG,T7,nG,j7,rG,O7,aG,E7,oG,sG,R7,tG,eG,e2,i8,Uu,Hu,Vu,MW,Bu,Fu,Lu,Mu,Au,Iu,Nu,Du,wu,Tu;var C7=s(()=>{H$={},p8={},M6={};R7={};e2=t2(),i8=r2(e2),{Type:Uu,Schema:Hu,FAILSAFE_SCHEMA:Vu,JSON_SCHEMA:MW,CORE_SCHEMA:Bu,DEFAULT_SCHEMA:Fu,load:Lu,loadAll:Mu,dump:Au,YAMLException:Iu,types:Nu,safeLoad:Du,safeLoadAll:wu,safeDump:Tu}=i8});var AW;var IW=s(()=>{t$();C7();C7();AW={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse($){let Z=$.data;if(Buffer.isBuffer(Z))Z=Z.toString();if(typeof Z==="string")try{return i8.load(Z,{schema:MW})}catch{try{return i8.load(Z)}catch(X){throw new s$(X?.message||"Parser Error",$.url)}}else return Z}}});var $I,NW;var DW=s(()=>{t$();$I=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i,NW={order:300,allowEmpty:!0,encoding:"utf8",canParse($){return(typeof $.data==="string"||Buffer.isBuffer($.data))&&$I.test($.url)},parse($){if(typeof $.data==="string")return $.data;else if(Buffer.isBuffer($.data))return $.data.toString(this.encoding);else throw new s$("data is not text",$.url)}}});var ZI,wW;var TW=s(()=>{ZI=/\.(jpeg|jpg|gif|png|bmp|ico)$/i,wW={order:400,allowEmpty:!0,canParse($){return Buffer.isBuffer($.data)&&ZI.test($.url)},parse($){if(Buffer.isBuffer($.data))return $.data;else return Buffer.from($.data)}}});var S7;var _7=s(()=>{P$();t$();S7={order:100,canRead($){return y8($.url)},async read($){let Z,X=await import("fs");try{Z=j4($.url)}catch(Q){let J=Q;throw J.message=`Malformed URI: ${$.url}: ${J.message}`,new Y1(J,$.url)}if(Z.endsWith("/")||Z.endsWith("\\"))Z=Z.slice(0,-1);try{return await X.promises.readFile(Z)}catch(Q){let J=Q;throw J.message=`Error opening file ${Z}: ${J.message}`,new Y1(J,Z)}}}});async function jW($,Z,X){$=T4($);let Q=X||[];Q.push($.href);try{if(Z.safeUrlResolver&&k8($.href))throw Error(`Unsafe URL blocked by safeUrlResolver: ${$.href}`);let J=await XI($,Z);if(J.status>=400){let G=Error(`HTTP ERROR ${J.status}`);throw G.status=J.status,G}else if(J.status>=300)if(!Number.isNaN(Z.redirects)&&Q.length>Z.redirects){let G=Error(`Error downloading ${Q[0]}.
|
|
54
56
|
Too many redirects:
|
|
55
57
|
${Q.join(`
|
|
56
|
-
`)}`);throw G.status=J.status,new Y6(G)}else{let G=c2(J,"location");if(!G){let Y=Error(`HTTP ${J.status} redirect with no location header`);throw Y.status=J.status,Y}let W=n0($.href,G);return VW(W,Z,Q)}else{if(J.body){let G=await J.arrayBuffer();return Buffer.from(G)}return Buffer.alloc(0)}}catch(J){let G=J;throw G.message=`Error downloading ${$.href}: ${G.message}`,new Y6(G,$.href)}}async function l2($,Z){let X,Q;if(Z.timeout&&typeof AbortController<"u")X=new AbortController,Q=setTimeout(()=>X.abort(),Z.timeout);let J=await fetch($,{method:"GET",headers:Z.headers||{},credentials:Z.withCredentials?"include":"same-origin",redirect:"manual",signal:X?X.signal:null});if(Q)clearTimeout(Q);return J}function c2($,Z){return $.headers.get(Z)}var w7;var T7=s(()=>{R$();s$();w7={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead($){return QG($.url)&&(!this.safeUrlResolver||!j5($.url))},read($){let Z=M4($.url);if(typeof window<"u"&&!Z.protocol)Z.protocol=M4(location.href).protocol;return VW(Z,this)}}});function MW($,Z){if(BW(Z)){let X=Object.keys(Z).filter((Q)=>!["__proto__","constructor","prototype"].includes(Q));for(let Q=0;Q<X.length;Q++){let J=X[Q],G=Z[J],W=$[J];if(BW(G))$[J]=MW(W||{},G);else if(G!==void 0)$[J]=G}}return $}function BW($){return $&&typeof $==="object"&&!Array.isArray($)&&!($ instanceof RegExp)&&!($ instanceof Date)}var FW=()=>{return{parse:{json:{...LG},yaml:{...YW},text:{...qW},binary:{...KW}},resolve:{file:{...N7},http:{...w7},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},LW=($)=>{let Z=FW();if($)MW(Z,$);return Z};var j7=s(()=>{MG();zW();UW();HW();D7();T7()});function p2($){let Z,X,Q,J,G=Array.prototype.slice.call($);if(typeof G[G.length-1]==="function")J=G.pop();if(typeof G[0]==="string")if(Z=G[0],typeof G[2]==="object")X=G[1],Q=G[2];else X=void 0,Q=G[1];else Z="",X=G[0],Q=G[1];try{Q=LW(Q)}catch(W){console.error(`JSON Schema Ref Parser: Error normalizing options: ${W}`)}if(!Q.mutateInputSchema&&typeof X==="object")X=JSON.parse(JSON.stringify(X));return{path:Z,schema:X,options:Q,callback:J}}var F9;var AW=s(()=>{j7();F9=p2});function i2($,Z){if(!Z.resolve?.external)return Promise.resolve();try{let X=$.$refs._root$Ref.dynamicIdScope?M$($.$refs._root$Ref.path,$.schema):$.$refs._root$Ref.path,Q=O7($.schema,$.$refs._root$Ref.path+"#",X,$.$refs._root$Ref.dynamicIdScope,$.$refs,Z);return Promise.all(Q)}catch(X){return Promise.reject(X)}}function O7($,Z,X,Q,J,G,W,Y){W||=new Set;let z=[];if($&&typeof $==="object"&&!ArrayBuffer.isView($)&&!W.has($)){W.add($);let q=X;if(l0.isExternal$Ref($))z.push(n2($,Z,q,Q,J,G));let H=Object.keys($);for(let B of H){let F=P$.join(Z,B),M=$[B],A=Q&&M&&typeof M==="object"&&!ArrayBuffer.isView(M)?M$(q,M):q;z=z.concat(O7(M,F,A,Q,J,G,W,Y))}}return z}async function n2($,Z,X,Q,J,G){let Y=G.dereference?.externalReferenceResolution==="root"?h1():Q?X:Z,z=n0(Y,$.$ref),q=r0(z),H=J._get$Ref(q);if(H)return Promise.resolve(H.value);try{let B=$.$ref,F={url:z,baseUrl:Y};if(typeof B==="string")F.reference=B;let M=await k5(F,J,G),A=J._get$Ref(q),w=O7(M,q+"#",q,A?.dynamicIdScope??!1,J,G,new Set,!0);return Promise.all(w)}catch(B){if(!G?.continueOnError||!O6(B))throw B;if(J._$refs[q])B.source=decodeURI(r0(Z)),B.path=E5(T6(Z));return[]}}var IW;var NW=s(()=>{D4();U9();aZ();R$();s$();u1();IW=i2});function r2($,Z){let X=$.$refs._root$Ref.dynamicIdScope?M$($.$refs._root$Ref.path,$.schema):$.$refs._root$Ref.path,Q=[];E7($,"schema",$.$refs._root$Ref.path+"#",X,$.$refs._root$Ref.dynamicIdScope,"#",0,Q,$.$refs,Z);let J=$.schema&&typeof $.schema==="object"&&"$id"in $.schema?$.schema.$id:void 0;if(a2(Q,Z,J),(Z.bundle||{}).optimizeInternalRefs!==!1)t2(Q,$.schema)}function E7($,Z,X,Q,J,G,W,Y,z,q){let H=Z===null?$:$[Z],B=q.bundle||{},F=B.excludedPathMatcher||(()=>!1);if(H&&typeof H==="object"&&!ArrayBuffer.isView(H)&&!F(G)){let M=Q;if(l0.isAllowed$Ref(H))DW($,Z,X,M,J,G,W,Y,z,q);else{let A=Object.keys(H).sort((w,D)=>{if(w==="definitions"||w==="$defs")return-1;else if(D==="definitions"||D==="$defs")return 1;else return w.length-D.length});for(let w of A){let D=P$.join(X,w),j=P$.join(G,w),R=H[w],P=J&&R&&typeof R==="object"&&!ArrayBuffer.isView(R)?M$(M,R):M;if(l0.isAllowed$Ref(R))DW(H,w,D,P,J,j,W,Y,z,q);else E7(H,w,D,P,J,j,W,Y,z,q);if(R&&typeof R==="object"&&!Array.isArray(R)){if("$ref"in R)B?.onBundle?.(R.$ref,H[w],H,w)}}}}}function DW($,Z,X,Q,J,G,W,Y,z,q){let H=Z===null?$:$[Z],B=n0(J?Q:X,H.$ref),F=z._resolve(B,G,q);if(F===null)return;let A=P$.parse(G).length,w=r0(F.path),D=T6(F.path),j=w!==z._root$Ref.path&&!z._aliases[w],R=Boolean(z._aliases[w])&&F.$ref.value!==z._root$Ref.value,P=l0.isExtended$Ref(H);W+=F.indirections;let E=o2(Y,$,Z);if(E)if(A<E.depth||W<E.indirections)s2(Y,E);else return;if(Y.push({$ref:H,parent:$,key:Z,pathFromRoot:G,depth:A,file:w,hash:D,value:F.value,circular:F.circular,extended:P,external:j,nestedResource:R,indirections:W}),!E||j)E7(F.value,null,F.path,F.$ref.path,F.$ref.dynamicIdScope,G,W+1,Y,z,q)}function a2($,Z,X){$.sort((W,Y)=>{if(W.file!==Y.file)return W.file<Y.file?-1:1;else if(W.hash!==Y.hash)return W.hash<Y.hash?-1:1;else if(W.circular!==Y.circular)return W.circular?-1:1;else if(W.extended!==Y.extended)return W.extended?1:-1;else if(W.indirections!==Y.indirections)return W.indirections-Y.indirections;else if(W.depth!==Y.depth)return W.depth-Y.depth;else{let z=Math.max(W.pathFromRoot.lastIndexOf("/definitions"),W.pathFromRoot.lastIndexOf("/$defs")),q=Math.max(Y.pathFromRoot.lastIndexOf("/definitions"),Y.pathFromRoot.lastIndexOf("/$defs"));if(z!==q)return q-z;else return W.pathFromRoot.length-Y.pathFromRoot.length}});let Q,J,G;for(let W of $){let Y=Z.bundle||{};if(!W.external){if(Y.optimizeInternalRefs!==!1&&!W.nestedResource)W.$ref.$ref=W.hash}else if(W.file===Q&&W.hash===J)if(X&&wW($,W))W.$ref.$ref=X+G;else W.$ref.$ref=G;else if(W.file===Q&&W.hash.indexOf(J+"/")===0){let z=P$.join(G,P$.parse(W.hash.replace(J,"#")));if(X&&wW($,W))W.$ref.$ref=X+z;else W.$ref.$ref=z}else if(Q=W.file,J=W.hash,G=W.pathFromRoot,W.$ref=W.parent[W.key]=l0.dereference(W.$ref,W.value,Z),W.circular)W.$ref.$ref=W.pathFromRoot}}function o2($,Z,X){for(let Q of $)if(Q&&Q.parent===Z&&Q.key===X)return Q;return}function s2($,Z){let X=$.indexOf(Z);$.splice(X,1)}function t2($,Z){for(let X of $){if(!X.$ref||typeof X.$ref!=="object"||!("$ref"in X.$ref))continue;let Q=X.$ref.$ref;if(typeof Q!=="string"||!Q.startsWith("#/"))continue;let J=e2(Z,Q);if(J!==Q)X.$ref.$ref=J}}function e2($,Z){if(!Z.startsWith("#/"))return Z;let X=Z.slice(2).split("/"),Q=$,J=[];for(let W of X){if(Q===null||Q===void 0||typeof Q!=="object")return Z;if("$ref"in Q&&typeof Q.$ref==="string"&&Q.$ref.startsWith("#/")){let q=Q.$ref.slice(2).split("/");if(J.length=0,J.push(...q),Q=$I($,Q.$ref),Q===null||Q===void 0||typeof Q!=="object")return Z}let Y=W.replace(/~1/g,"/").replace(/~0/g,"~"),z=Array.isArray(Q)?parseInt(Y):Y;Q=Q[z],J.push(W)}return"#/"+J.join("/")}function $I($,Z){if(!Z.startsWith("#/"))return;let X=Z.slice(2).split("/"),Q=$;for(let J of X){if(Q===null||Q===void 0||typeof Q!=="object")return;let G=J.replace(/~1/g,"/").replace(/~0/g,"~"),W=Array.isArray(Q)?parseInt(G):G;Q=Q[W]}return Q}function wW($,Z){for(let X of $){if(X.pathFromRoot==="#"||X.pathFromRoot==="#/")continue;if(Z.pathFromRoot.startsWith(X.pathFromRoot+"/")){if(X.value&&typeof X.value==="object"&&"$id"in X.value)return!0}}return!1}var TW;var jW=s(()=>{D4();U9();R$();u1();TW=r2});function ZI($,Z){let X=Date.now(),Q=$.$refs._root$Ref.dynamicIdScope?M$($.$refs._root$Ref.path,$.schema):$.$refs._root$Ref.path,J=R7($.schema,$.$refs._root$Ref.path,Q,$.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,$.$refs,Z,X,0);$.$refs.circular=J.circular,$.schema=J.value}function R7($,Z,X,Q,J,G,W,Y,z,q,H,B){let F,M={value:$,circular:!1};EW(H,q);let A=q.dereference||{},w=A.maxDepth??500;if(B>w)throw RangeError(`Maximum dereference depth (${w}) exceeded at ${J}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let D=A.excludedPathMatcher||(()=>!1);if(A?.circular==="ignore"||!W.has($)){if($&&typeof $==="object"&&!ArrayBuffer.isView($)&&!D(J)){G.add($),W.add($);let j=X;if(l0.isAllowed$Ref($,q))F=OW($,Z,j,Q,J,G,W,Y,z,q,H,B),M.circular=F.circular,M.value=F.value;else for(let R of Object.keys($)){EW(H,q);let P=P$.join(Z,R),E=P$.join(J,R);if(D(E))continue;let C=$[R],y=Q&&C&&typeof C==="object"&&!ArrayBuffer.isView(C)?M$(j,C):j,v;if(l0.isAllowed$Ref(C,q)){if(F=OW(C,P,y,Q,E,G,W,Y,z,q,H,B),v=F.circular,$[R]!==F.value){let m=new Map;if(A?.preservedProperties){if(typeof $[R]==="object"&&!Array.isArray($[R]))A?.preservedProperties.forEach((r)=>{if(r in $[R])m.set(r,$[R][r])})}let Z0=F.value;if(A?.cloneReferences&&!v&&Z0&&typeof Z0==="object")Z0=structuredClone(Z0);if($[R]=Z0,A?.preservedProperties){if(m.size&&typeof $[R]==="object"&&!Array.isArray($[R]))m.forEach((r,h)=>{$[R][h]=r})}A?.onDereference?.(C.$ref,$[R],$,R)}}else if(!G.has(C)){if(F=R7(C,P,y,Q,E,G,W,Y,z,q,H,B+1),v=F.circular,$[R]!==F.value)$[R]=F.value}else v=g5(P,z,q);M.circular=M.circular||v}G.delete($)}}return M}function OW($,Z,X,Q,J,G,W,Y,z,q,H,B){let A=l0.isExternal$Ref($)&&q?.dereference?.externalReferenceResolution==="root"?h1():Q?X:Z,w=n0(A,$.$ref),D=Y.get(w);if(D){if(!D.circular){let y=Object.keys($);if(y.length>1){let v={};for(let m of y)if(m!=="$ref"&&!(m in D.value))v[m]=$[m];return{circular:D.circular,value:Object.assign({},D.value,v)}}return D}if(typeof D.value==="object"&&"$ref"in D.value&&"$ref"in $){if(D.value.$ref===$.$ref)return g5(Z,z,q),D}else return g5(Z,z,q),D}let j=z._resolve(w,Z,q);if(j===null)return{circular:!1,value:null};let R=j.circular,P=R||j.chainCircular||G.has(j.value);if(P)g5(Z,z,q);let E=l0.dereference($,j.value,q);if(!P){let y=R7(E,j.path,j.$ref.path,j.$ref.dynamicIdScope,J,G,W,Y,z,q,H,B+1);P=y.circular,E=y.value}if(P&&!R&&q.dereference?.circular==="ignore")E=$;if(R&&E!==$)E.$ref=J;let C={circular:P,value:E};if(Object.keys($).length===1)Y.set(w,C);return C}function EW($,Z){if(Z&&Z.timeoutMs){if(Date.now()-$>Z.timeoutMs)throw new lZ(Z.timeoutMs)}}function g5($,Z,X){if(Z.circular=!0,X?.dereference?.onCircular?.($),!X.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${$}`);return!0}var RW;var PW=s(()=>{D4();U9();R$();u1();s$();RW=ZI});function XI(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(Z){setTimeout(Z,0)}}var P7;var CW=s(()=>{P7=XI()});function c$($,Z){if($){Z.then(function(X){P7(function(){$(null,X)})},function(X){P7(function(){$(X)})});return}else return Z}var SW=s(()=>{CW()});class c6{schema=null;$refs=new H9;async parse(){let $=F9(arguments),Z;if(!$.path&&!$.schema){let Q=Error(`Expected a file path, URL, or object. Got ${$.path||$.schema}`);return c$($.callback,Promise.reject(Q))}this.schema=null,this.$refs=new H9;let X="http";if(O5($.path))$.path=YG($.path),X="file";else if(!$.path&&$.schema&&"$id"in $.schema&&$.schema.$id){let Q=M4($.schema.$id),J=Q.port??(Q.protocol==="https:"?443:80);$.path=`${Q.protocol}//${Q.hostname}:${J}`}if($.path=n0(h1(),$.path),$.schema&&typeof $.schema==="object"){let Q=this.$refs._add($.path);Q.value=$.schema,Q.pathType=X,Q.dynamicIdScope=S5(Q.value),_5(this.$refs,Q.path,Q.value,Q.pathType,Q.dynamicIdScope),Z=Promise.resolve($.schema)}else Z=k5($.path,this.$refs,$.options);try{let Q=await Z;if(Q!==null&&typeof Q==="object"&&!Buffer.isBuffer(Q))return this.schema=Q,c$($.callback,Promise.resolve(this.schema));else if($.options.continueOnError)return this.schema=null,c$($.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||Q}" is not a valid JSON Schema`)}catch(Q){if(!$.options.continueOnError||!O6(Q))return c$($.callback,Promise.reject(Q));if(this.$refs._$refs[r0($.path)])this.$refs._$refs[r0($.path)].addError(Q);return c$($.callback,Promise.resolve(null))}}static parse(){let $=new c6;return $.parse.apply($,arguments)}async resolve(){let $=F9(arguments);try{return await this.parse($.path,$.schema,$.options),await IW(this,$.options),C7(this),c$($.callback,Promise.resolve(this.$refs))}catch(Z){return c$($.callback,Promise.reject(Z))}}static resolve(){let $=new c6;return $.resolve.apply($,arguments)}static bundle(){let $=new c6;return $.bundle.apply($,arguments)}async bundle(){let $=F9(arguments);try{return await this.resolve($.path,$.schema,$.options),TW(this,$.options),C7(this),c$($.callback,Promise.resolve(this.schema))}catch(Z){return c$($.callback,Promise.reject(Z))}}static dereference(){let $=new c6;return $.dereference.apply($,arguments)}async dereference(){let $=F9(arguments);try{return await this.resolve($.path,$.schema,$.options),RW(this,$.options),C7(this),c$($.callback,Promise.resolve(this.schema))}catch(Z){return c$($.callback,Promise.reject(Z))}}}function C7($){if(I4.getParserErrors($).length>0)throw new I4($)}var eu,$m,Zm,_W;var xW=s(()=>{BG();aZ();AW();NW();jW();PW();R$();D7();T7();s$();SW();u1();j7();R$();eu=c6.parse,$m=c6.resolve,Zm=c6.bundle,_W=c6.dereference});async function L9($,Z={}){let{baseUrl:X="/_jx/server"}=Z,Q=await _W($),J=T5(Q);if(J.length===0)return null;let G=J.map(({exportName:Y,src:z})=>`import { ${Y} } from '${z}'`).join(`
|
|
57
|
-
`),W=J.map(({exportName:Y})=>
|
|
58
|
+
`)}`);throw G.status=J.status,new Y1(G)}else{let G=QI(J,"location");if(!G){let Y=Error(`HTTP ${J.status} redirect with no location header`);throw Y.status=J.status,Y}let W=a0($.href,G);return jW(W,Z,Q)}else{if(J.body){let G=await J.arrayBuffer();return Buffer.from(G)}return Buffer.alloc(0)}}catch(J){let G=J;throw G.message=`Error downloading ${$.href}: ${G.message}`,new Y1(G,$.href)}}async function XI($,Z){let X,Q;if(Z.timeout&&typeof AbortController<"u")X=new AbortController,Q=setTimeout(()=>X.abort(),Z.timeout);let J=await fetch($,{method:"GET",headers:Z.headers||{},credentials:Z.withCredentials?"include":"same-origin",redirect:"manual",signal:X?X.signal:null});if(Q)clearTimeout(Q);return J}function QI($,Z){return $.headers.get(Z)}var b7;var x7=s(()=>{P$();t$();b7={order:200,headers:null,timeout:60000,redirects:5,withCredentials:!1,safeUrlResolver:!0,canRead($){return BG($.url)&&(!this.safeUrlResolver||!k8($.url))},read($){let Z=T4($.url);if(typeof window<"u"&&!Z.protocol)Z.protocol=T4(location.href).protocol;return jW(Z,this)}}});function PW($,Z){if(OW(Z)){let X=Object.keys(Z).filter((Q)=>!["__proto__","constructor","prototype"].includes(Q));for(let Q=0;Q<X.length;Q++){let J=X[Q],G=Z[J],W=$[J];if(OW(G))$[J]=PW(W||{},G);else if(G!==void 0)$[J]=G}}return $}function OW($){return $&&typeof $==="object"&&!Array.isArray($)&&!($ instanceof RegExp)&&!($ instanceof Date)}var EW=()=>{return{parse:{json:{...RG},yaml:{...AW},text:{...NW},binary:{...wW}},resolve:{file:{...S7},http:{...b7},external:!0},continueOnError:!1,bundle:{excludedPathMatcher:()=>!1},dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative",mergeKeys:!0},mutateInputSchema:!0}},RW=($)=>{let Z=EW();if($)PW(Z,$);return Z};var k7=s(()=>{PG();IW();DW();TW();_7();x7()});function JI($){let Z,X,Q,J,G=Array.prototype.slice.call($);if(typeof G[G.length-1]==="function")J=G.pop();if(typeof G[0]==="string")if(Z=G[0],typeof G[2]==="object")X=G[1],Q=G[2];else X=void 0,Q=G[1];else Z="",X=G[0],Q=G[1];try{Q=RW(Q)}catch(W){console.error(`JSON Schema Ref Parser: Error normalizing options: ${W}`)}if(!Q.mutateInputSchema&&typeof X==="object")X=JSON.parse(JSON.stringify(X));return{path:Z,schema:X,options:Q,callback:J}}var w9;var CW=s(()=>{k7();w9=JI});function GI($,Z){if(!Z.resolve?.external)return Promise.resolve();try{let X=$.$refs._root$Ref.dynamicIdScope?A$($.$refs._root$Ref.path,$.schema):$.$refs._root$Ref.path,Q=y7($.schema,$.$refs._root$Ref.path+"#",X,$.$refs._root$Ref.dynamicIdScope,$.$refs,Z);return Promise.all(Q)}catch(X){return Promise.reject(X)}}function y7($,Z,X,Q,J,G,W,Y){W||=new Set;let z=[];if($&&typeof $==="object"&&!ArrayBuffer.isView($)&&!W.has($)){W.add($);let q=X;if(c0.isExternal$Ref($))z.push(WI($,Z,q,Q,J,G));let H=Object.keys($);for(let B of H){let F=C$.join(Z,B),L=$[B],w=Q&&L&&typeof L==="object"&&!ArrayBuffer.isView(L)?A$(q,L):q;z=z.concat(y7(L,F,w,Q,J,G,W,Y))}}return z}async function WI($,Z,X,Q,J,G){let Y=G.dereference?.externalReferenceResolution==="root"?c6():Q?X:Z,z=a0(Y,$.$ref),q=o0(z),H=J._get$Ref(q);if(H)return Promise.resolve(H.value);try{let B=$.$ref,F={url:z,baseUrl:Y};if(typeof B==="string")F.reference=B;let L=await c8(F,J,G),w=J._get$Ref(q),N=y7(L,q+"#",q,w?.dynamicIdScope??!1,J,G,new Set,!0);return Promise.all(N)}catch(B){if(!G?.continueOnError||!E1(B))throw B;if(J._$refs[q])B.source=decodeURI(o0(Z)),B.path=v8(j1(Z));return[]}}var SW;var _W=s(()=>{R4();M9();G7();P$();t$();p6();SW=GI});function YI($,Z){let X=$.$refs._root$Ref.dynamicIdScope?A$($.$refs._root$Ref.path,$.schema):$.$refs._root$Ref.path,Q=[];v7($,"schema",$.$refs._root$Ref.path+"#",X,$.$refs._root$Ref.dynamicIdScope,"#",0,Q,$.$refs,Z);let J=$.schema&&typeof $.schema==="object"&&"$id"in $.schema?$.schema.$id:void 0;if(zI(Q,Z,J),(Z.bundle||{}).optimizeInternalRefs!==!1)UI(Q,$.schema)}function v7($,Z,X,Q,J,G,W,Y,z,q){let H=Z===null?$:$[Z],B=q.bundle||{},F=B.excludedPathMatcher||(()=>!1);if(H&&typeof H==="object"&&!ArrayBuffer.isView(H)&&!F(G)){let L=Q;if(c0.isAllowed$Ref(H))bW($,Z,X,L,J,G,W,Y,z,q);else{let w=Object.keys(H).sort((N,I)=>{if(N==="definitions"||N==="$defs")return-1;else if(I==="definitions"||I==="$defs")return 1;else return N.length-I.length});for(let N of w){let I=C$.join(X,N),T=C$.join(G,N),E=H[N],P=J&&E&&typeof E==="object"&&!ArrayBuffer.isView(E)?A$(L,E):L;if(c0.isAllowed$Ref(E))bW(H,N,I,P,J,T,W,Y,z,q);else v7(H,N,I,P,J,T,W,Y,z,q);if(E&&typeof E==="object"&&!Array.isArray(E)){if("$ref"in E)B?.onBundle?.(E.$ref,H[N],H,N)}}}}}function bW($,Z,X,Q,J,G,W,Y,z,q){let H=Z===null?$:$[Z],B=a0(J?Q:X,H.$ref),F=z._resolve(B,G,q);if(F===null)return;let w=C$.parse(G).length,N=o0(F.path),I=j1(F.path),T=N!==z._root$Ref.path&&!z._aliases[N],E=Boolean(z._aliases[N])&&F.$ref.value!==z._root$Ref.value,P=c0.isExtended$Ref(H);W+=F.indirections;let R=qI(Y,$,Z);if(R)if(w<R.depth||W<R.indirections)KI(Y,R);else return;if(Y.push({$ref:H,parent:$,key:Z,pathFromRoot:G,depth:w,file:N,hash:I,value:F.value,circular:F.circular,extended:P,external:T,nestedResource:E,indirections:W}),!R||T)v7(F.value,null,F.path,F.$ref.path,F.$ref.dynamicIdScope,G,W+1,Y,z,q)}function zI($,Z,X){$.sort((W,Y)=>{if(W.file!==Y.file)return W.file<Y.file?-1:1;else if(W.hash!==Y.hash)return W.hash<Y.hash?-1:1;else if(W.circular!==Y.circular)return W.circular?-1:1;else if(W.extended!==Y.extended)return W.extended?1:-1;else if(W.indirections!==Y.indirections)return W.indirections-Y.indirections;else if(W.depth!==Y.depth)return W.depth-Y.depth;else{let z=Math.max(W.pathFromRoot.lastIndexOf("/definitions"),W.pathFromRoot.lastIndexOf("/$defs")),q=Math.max(Y.pathFromRoot.lastIndexOf("/definitions"),Y.pathFromRoot.lastIndexOf("/$defs"));if(z!==q)return q-z;else return W.pathFromRoot.length-Y.pathFromRoot.length}});let Q,J,G;for(let W of $){let Y=Z.bundle||{};if(!W.external){if(Y.optimizeInternalRefs!==!1&&!W.nestedResource)W.$ref.$ref=W.hash}else if(W.file===Q&&W.hash===J)if(X&&xW($,W))W.$ref.$ref=X+G;else W.$ref.$ref=G;else if(W.file===Q&&W.hash.indexOf(J+"/")===0){let z=C$.join(G,C$.parse(W.hash.replace(J,"#")));if(X&&xW($,W))W.$ref.$ref=X+z;else W.$ref.$ref=z}else if(Q=W.file,J=W.hash,G=W.pathFromRoot,W.$ref=W.parent[W.key]=c0.dereference(W.$ref,W.value,Z),W.circular)W.$ref.$ref=W.pathFromRoot}}function qI($,Z,X){for(let Q of $)if(Q&&Q.parent===Z&&Q.key===X)return Q;return}function KI($,Z){let X=$.indexOf(Z);$.splice(X,1)}function UI($,Z){for(let X of $){if(!X.$ref||typeof X.$ref!=="object"||!("$ref"in X.$ref))continue;let Q=X.$ref.$ref;if(typeof Q!=="string"||!Q.startsWith("#/"))continue;let J=HI(Z,Q);if(J!==Q)X.$ref.$ref=J}}function HI($,Z){if(!Z.startsWith("#/"))return Z;let X=Z.slice(2).split("/"),Q=$,J=[];for(let W of X){if(Q===null||Q===void 0||typeof Q!=="object")return Z;if("$ref"in Q&&typeof Q.$ref==="string"&&Q.$ref.startsWith("#/")){let q=Q.$ref.slice(2).split("/");if(J.length=0,J.push(...q),Q=VI($,Q.$ref),Q===null||Q===void 0||typeof Q!=="object")return Z}let Y=W.replace(/~1/g,"/").replace(/~0/g,"~"),z=Array.isArray(Q)?parseInt(Y):Y;Q=Q[z],J.push(W)}return"#/"+J.join("/")}function VI($,Z){if(!Z.startsWith("#/"))return;let X=Z.slice(2).split("/"),Q=$;for(let J of X){if(Q===null||Q===void 0||typeof Q!=="object")return;let G=J.replace(/~1/g,"/").replace(/~0/g,"~"),W=Array.isArray(Q)?parseInt(G):G;Q=Q[W]}return Q}function xW($,Z){for(let X of $){if(X.pathFromRoot==="#"||X.pathFromRoot==="#/")continue;if(Z.pathFromRoot.startsWith(X.pathFromRoot+"/")){if(X.value&&typeof X.value==="object"&&"$id"in X.value)return!0}}return!1}var kW;var yW=s(()=>{R4();M9();P$();p6();kW=YI});function BI($,Z){let X=Date.now(),Q=$.$refs._root$Ref.dynamicIdScope?A$($.$refs._root$Ref.path,$.schema):$.$refs._root$Ref.path,J=g7($.schema,$.$refs._root$Ref.path,Q,$.$refs._root$Ref.dynamicIdScope,"#",new Set,new Set,new Map,$.$refs,Z,X,0);$.$refs.circular=J.circular,$.schema=J.value}function g7($,Z,X,Q,J,G,W,Y,z,q,H,B){let F,L={value:$,circular:!1};gW(H,q);let w=q.dereference||{},N=w.maxDepth??500;if(B>N)throw RangeError(`Maximum dereference depth (${N}) exceeded at ${J}. This likely indicates an extremely deep or recursive schema. You can increase this limit with the dereference.maxDepth option.`);let I=w.excludedPathMatcher||(()=>!1);if(w?.circular==="ignore"||!W.has($)){if($&&typeof $==="object"&&!ArrayBuffer.isView($)&&!I(J)){G.add($),W.add($);let T=X;if(c0.isAllowed$Ref($,q))F=vW($,Z,T,Q,J,G,W,Y,z,q,H,B),L.circular=F.circular,L.value=F.value;else for(let E of Object.keys($)){gW(H,q);let P=C$.join(Z,E),R=C$.join(J,E);if(I(R))continue;let C=$[E],y=Q&&C&&typeof C==="object"&&!ArrayBuffer.isView(C)?A$(T,C):T,v;if(c0.isAllowed$Ref(C,q)){if(F=vW(C,P,y,Q,R,G,W,Y,z,q,H,B),v=F.circular,$[E]!==F.value){let h=new Map;if(w?.preservedProperties){if(typeof $[E]==="object"&&!Array.isArray($[E]))w?.preservedProperties.forEach((r)=>{if(r in $[E])h.set(r,$[E][r])})}let X0=F.value;if(w?.cloneReferences&&!v&&X0&&typeof X0==="object")X0=structuredClone(X0);if($[E]=X0,w?.preservedProperties){if(h.size&&typeof $[E]==="object"&&!Array.isArray($[E]))h.forEach((r,u)=>{$[E][u]=r})}w?.onDereference?.(C.$ref,$[E],$,E)}}else if(!G.has(C)){if(F=g7(C,P,y,Q,R,G,W,Y,z,q,H,B+1),v=F.circular,$[E]!==F.value)$[E]=F.value}else v=n8(P,z,q);L.circular=L.circular||v}G.delete($)}}return L}function vW($,Z,X,Q,J,G,W,Y,z,q,H,B){let w=c0.isExternal$Ref($)&&q?.dereference?.externalReferenceResolution==="root"?c6():Q?X:Z,N=a0(w,$.$ref),I=Y.get(N);if(I){if(!I.circular){let y=Object.keys($);if(y.length>1){let v={};for(let h of y)if(h!=="$ref"&&!(h in I.value))v[h]=$[h];return{circular:I.circular,value:Object.assign({},I.value,v)}}return I}if(typeof I.value==="object"&&"$ref"in I.value&&"$ref"in $){if(I.value.$ref===$.$ref)return n8(Z,z,q),I}else return n8(Z,z,q),I}let T=z._resolve(N,Z,q);if(T===null)return{circular:!1,value:null};let E=T.circular,P=E||T.chainCircular||G.has(T.value);if(P)n8(Z,z,q);let R=c0.dereference($,T.value,q);if(!P){let y=g7(R,T.path,T.$ref.path,T.$ref.dynamicIdScope,J,G,W,Y,z,q,H,B+1);P=y.circular,R=y.value}if(P&&!E&&q.dereference?.circular==="ignore")R=$;if(E&&R!==$)R.$ref=J;let C={circular:P,value:R};if(Object.keys($).length===1)Y.set(N,C);return C}function gW($,Z){if(Z&&Z.timeoutMs){if(Date.now()-$>Z.timeoutMs)throw new eZ(Z.timeoutMs)}}function n8($,Z,X){if(Z.circular=!0,X?.dereference?.onCircular?.($),!X.dereference.circular)throw ReferenceError(`Circular $ref pointer found at ${$}`);return!0}var fW;var hW=s(()=>{R4();M9();P$();p6();t$();fW=BI});function FI(){if(typeof process==="object"&&typeof process.nextTick==="function")return process.nextTick;else if(typeof setImmediate==="function")return setImmediate;else return function(Z){setTimeout(Z,0)}}var f7;var uW=s(()=>{f7=FI()});function c$($,Z){if($){Z.then(function(X){f7(function(){$(null,X)})},function(X){f7(function(){$(X)})});return}else return Z}var mW=s(()=>{uW()});class n1{schema=null;$refs=new I9;async parse(){let $=w9(arguments),Z;if(!$.path&&!$.schema){let Q=Error(`Expected a file path, URL, or object. Got ${$.path||$.schema}`);return c$($.callback,Promise.reject(Q))}this.schema=null,this.$refs=new I9;let X="http";if(y8($.path))$.path=AG($.path),X="file";else if(!$.path&&$.schema&&"$id"in $.schema&&$.schema.$id){let Q=T4($.schema.$id),J=Q.port??(Q.protocol==="https:"?443:80);$.path=`${Q.protocol}//${Q.hostname}:${J}`}if($.path=a0(c6(),$.path),$.schema&&typeof $.schema==="object"){let Q=this.$refs._add($.path);Q.value=$.schema,Q.pathType=X,Q.dynamicIdScope=u8(Q.value),m8(this.$refs,Q.path,Q.value,Q.pathType,Q.dynamicIdScope),Z=Promise.resolve($.schema)}else Z=c8($.path,this.$refs,$.options);try{let Q=await Z;if(Q!==null&&typeof Q==="object"&&!Buffer.isBuffer(Q))return this.schema=Q,c$($.callback,Promise.resolve(this.schema));else if($.options.continueOnError)return this.schema=null,c$($.callback,Promise.resolve(this.schema));else throw SyntaxError(`"${this.$refs._root$Ref.path||Q}" is not a valid JSON Schema`)}catch(Q){if(!$.options.continueOnError||!E1(Q))return c$($.callback,Promise.reject(Q));if(this.$refs._$refs[o0($.path)])this.$refs._$refs[o0($.path)].addError(Q);return c$($.callback,Promise.resolve(null))}}static parse(){let $=new n1;return $.parse.apply($,arguments)}async resolve(){let $=w9(arguments);try{return await this.parse($.path,$.schema,$.options),await SW(this,$.options),h7(this),c$($.callback,Promise.resolve(this.$refs))}catch(Z){return c$($.callback,Promise.reject(Z))}}static resolve(){let $=new n1;return $.resolve.apply($,arguments)}static bundle(){let $=new n1;return $.bundle.apply($,arguments)}async bundle(){let $=w9(arguments);try{return await this.resolve($.path,$.schema,$.options),kW(this,$.options),h7(this),c$($.callback,Promise.resolve(this.schema))}catch(Z){return c$($.callback,Promise.reject(Z))}}static dereference(){let $=new n1;return $.dereference.apply($,arguments)}async dereference(){let $=w9(arguments);try{return await this.resolve($.path,$.schema,$.options),fW(this,$.options),h7(this),c$($.callback,Promise.resolve(this.schema))}catch(Z){return c$($.callback,Promise.reject(Z))}}}function h7($){if(O4.getParserErrors($).length>0)throw new O4($)}var wm,Tm,jm,dW;var lW=s(()=>{OG();G7();CW();_W();yW();hW();P$();_7();x7();t$();mW();p6();k7();P$();wm=n1.parse,Tm=n1.resolve,jm=n1.bundle,dW=n1.dereference});async function T9($,Z={}){let{baseUrl:X="/_jx/server"}=Z,Q=await dW($),J=x8(Q);if(J.length===0)return null;let G=J.map(({exportName:Y,src:z})=>`import { ${Y} } from '${z}'`).join(`
|
|
59
|
+
`),W=J.map(({exportName:Y})=>cW(Y,X)).join(`
|
|
58
60
|
`);return`// Generated by @jxsuite/compiler — do not edit manually
|
|
59
61
|
// Deploy as a Cloudflare Worker, Node server, or Bun process.
|
|
60
62
|
// Requires: npm install hono
|
|
@@ -66,8 +68,8 @@ const app = new Hono()
|
|
|
66
68
|
${W}
|
|
67
69
|
|
|
68
70
|
export default app
|
|
69
|
-
`}function
|
|
70
|
-
`),Y=
|
|
71
|
+
`}function u7($,Z={}){let{baseUrl:X="/_jx/server",adapter:Q=null,mounts:J=[],connectors:G=[]}=Z;if($.length===0&&J.length===0&&!Q)return null;let W=$.map(({exportName:H,src:B})=>`import { ${H} } from '${B}'`).join(`
|
|
72
|
+
`),Y=LI(J,G),z=$.map(({exportName:H})=>cW(H,X)).join(`
|
|
71
73
|
`),q=Q==="cloudflare-workers"||Q==="cloudflare-pages"?`
|
|
72
74
|
app.all('*', (c) => c.env.ASSETS.fetch(c.req.raw))
|
|
73
75
|
`:`
|
|
@@ -79,11 +81,11 @@ const app = new Hono()
|
|
|
79
81
|
${Y.routes}${z}
|
|
80
82
|
${q}
|
|
81
83
|
export default app
|
|
82
|
-
`}function
|
|
84
|
+
`}function LI($,Z){if($.length===0)return{imports:"",routes:""};let X=$.toSorted((G,W)=>G.order-W.order),Q=[];for(let G of X)Q.push(`import { ${G.className} } from '${G.module}'`);for(let G of Z)Q.push(`import { ${G.className} } from '${G.module}'`);let J=["// Extension server mounts (specs/extensions.md §11): one shared ctx, mounted in order.","const jxCtx = {}",`const jxConnectors = { ${Z.map((G)=>`${JSON.stringify(G.provider)}: ${G.className}`).join(", ")} }`];for(let[G,W]of X.entries()){let Y=JSON.stringify(W.options);J.push(`const jxMount${G} = await ${W.className}.mount({ ...${Y}, connectors: jxConnectors }, jxCtx)`,`app.all('${W.basePath}/*', (c) => jxMount${G}(c.req.raw, c.env))`,`app.all('${W.basePath}', (c) => jxMount${G}(c.req.raw, c.env))`)}return{imports:`
|
|
83
85
|
${Q.join(`
|
|
84
86
|
`)}`,routes:`${J.join(`
|
|
85
87
|
`)}
|
|
86
|
-
`}}function
|
|
88
|
+
`}}function cW($,Z){return`
|
|
87
89
|
app.post('${Z}/${$}', async (c) => {
|
|
88
90
|
const args = await c.req.json().catch(() => ({}))
|
|
89
91
|
try {
|
|
@@ -91,7 +93,7 @@ app.post('${Z}/${$}', async (c) => {
|
|
|
91
93
|
} catch (e) {
|
|
92
94
|
return c.json({ ok: false, error: e?.message ?? 'Server error' }, 500)
|
|
93
95
|
}
|
|
94
|
-
})`}var
|
|
96
|
+
})`}var m7=s(()=>{lW();L6()});function A6($){return $ instanceof Error?$.message:String($)}function d7($,Z,X){let Q;try{Q=JSON.parse($)}catch(J){throw Error(`Failed to parse ${X} at ${Z}: ${A6(J)}`,{cause:J})}if(!d$(Q))throw Error(`Invalid ${X} at ${Z}: expected a JSON object`);return Q}function I6($,Z){return d7($,Z,"Jx document")}function pW($,Z){return d7($,Z,"project config")}function iW($,Z){return d7($,Z,"class definition")}var N6=s(()=>{w1()});class r8{name;classPath;classDef;extensions;mediaType;documentKinds;exportTarget;remote;studio;project;server;connector;capabilities;#Z;#$=null;constructor($,Z,X,Q){this.name=$,this.classPath=Z,this.classDef=X,this.#Z=Q;let{format:J}=X;this.extensions=(J?.extensions??[]).map((G)=>G.toLowerCase()),this.mediaType=J?.mediaType??null,this.documentKinds=J?.documentKinds??[],this.exportTarget=J?.exportTarget===!0,this.remote=J?.remote===!0,this.studio=X.$studio??null,this.project=X.project??null,this.server=X.server??null,this.connector=X.connector??null,this.capabilities=AI(X)}implementation(){if(!this.#$){let $=this.classDef.$implementation;if(!$)return Promise.reject(Error(`Format class "${this.name}" has no $implementation to import`));this.#$=this.#Z.importModule(this.#Z.resolvePath(this.classPath,$))}return this.#$}async call($,...Z){let X=this.capabilities[$];if(!X)throw Error(`Format class "${this.name}" does not declare a "${$}" capability`);let Q=await this.implementation(),J=this.classDef.title??this.name,G=Q[J]??Q.default?.[J]??Q.default,W=G?.[X.identifier];if(typeof W!=="function")throw TypeError(`Format class "${this.name}": implementation export "${J}" has no static "${X.identifier}" method`);return await W.call(G,...Z)}}class a8{#Z;constructor($){this.#Z=$;for(let Z of rW){let X=new Map;for(let Q of $){if(!Q.capabilities[Z])continue;for(let J of Q.extensions){let G=X.get(J);if(G)throw Error(`Format conflict: "${G.name}" and "${Q.name}" both claim "${J}" with the "${Z}" capability`);X.set(J,Q)}}}}get entries(){return this.#Z}byExtension($,Z){let X=nW($);return this.#Z.find((Q)=>Q.extensions.includes(X)&&(!Z||Q.capabilities[Z]))}byName($){return this.#Z.find((Z)=>Z.name===$)}withCapability($){return this.#Z.filter((Z)=>Z.capabilities[$])}documentExtensions($){let Z=new Set;for(let X of this.#Z){if($&&!X.documentKinds.includes($))continue;for(let Q of X.extensions)Z.add(Q)}return Z.delete(".json"),[...Z]}has($){let Z=nW($);return this.#Z.some((X)=>X.extensions.includes(Z))}}function AI($){let Z={},X=$.$defs?.methods??{};for(let[Q,J]of Object.entries(X)){let G=J.role;if(!G||!aW.includes(G))continue;let W={identifier:J.identifier??Q,timing:J.timing??MI};if(typeof J.discriminator==="string")W.discriminator=J.discriminator;Z[G]=W}return Z}function nW($){let Z=$.toLowerCase();return Z.startsWith(".")?Z:`.${Z}`}var rW,aW,MI;var l7=s(()=>{rW=["parse","serialize","discover","load"],aW=[...rW,"projectData","resolvePaths","lower","emit","assets","mount","dialect","deploySchema","bindings","testConnection"],MI=["compiler","server"]});class oW{#Z;#$;#X;constructor($){this.#Z=$,this.#$=$.flatMap((J)=>J.classes);let Z=new Map;for(let J of $)for(let G of J.classes){let W=Z.get(G.name);if(W&&W!==J.specifier)throw Error(`Extension conflict: "${W}" and "${J.specifier}" both provide a class named "${G.name}"`);Z.set(G.name,J.specifier)}let X=new Map;for(let J of this.#$){if(!J.project)continue;let G=X.get(J.project.key);if(G)throw Error(`Extension conflict: "${G.name}" and "${J.name}" both claim the project section "${J.project.key}"`);X.set(J.project.key,J)}let Q=new Map;for(let J of this.#$){if(!J.server)continue;let{basePath:G}=J.server;if(!G.startsWith("/_jx/"))throw Error(`Extension "${J.name}": server basePath "${G}" must be under /_jx/`);let W=Q.get(G);if(W)throw Error(`Extension conflict: "${W.name}" and "${J.name}" both mount "${G}"`);Q.set(G,J)}this.#X=new a8(this.#$.filter((J)=>J.extensions.length>0))}get extensions(){return this.#Z}get classes(){return this.#$}get formats(){return this.#X}byName($){return this.#$.find((Z)=>Z.name===$)}projectContributions(){return this.#$.filter(($)=>$.project!==null)}byProjectKey($){return this.#$.find((Z)=>Z.project?.key===$)}byPathsDiscriminator($){return this.#$.find((Z)=>Z.capabilities.resolvePaths?.discriminator===$)}emitters(){return this.#$.filter(($)=>$.capabilities.emit!==void 0)}assetProviders(){return this.#$.filter(($)=>$.capabilities.assets!==void 0)}serverMounts(){return this.#$.filter(($)=>$.server!==null).toSorted(($,Z)=>($.server?.order??100)-(Z.server?.order??100)||$.name.localeCompare(Z.name))}connectors(){return this.#$.filter(($)=>$.connector!==null)}schemaFragments($){return this.#Z.map((Z)=>Z.schemas[$]).filter((Z)=>typeof Z==="string")}}async function sW($,Z,X){let Q=[];for(let J of $??[])Q.push(await II(J,Z,X));return new oW(Q)}async function II($,Z,X){let Q;if($.startsWith("./")||$.startsWith("../")){let Y=Z.resolvePath(X,$);Q=Z.resolvePath(`${Y}/package.json`,`./${o8}`)}else try{Q=Z.resolvePath(X,`${$}/${o8}`)}catch(Y){throw Error(`Extension "${$}" is not resolvable: it must export ${o8} (is the package installed, and does its exports map include it?): ${c7(Y)}`,{cause:Y})}let J;try{J=await Z.loadJson(Q)}catch(Y){throw Error(`Extension "${$}": cannot read manifest ${Q}: ${c7(Y)}`,{cause:Y})}if(!J||typeof J!=="object"||typeof J.name!=="string")throw Error(`Extension "${$}": ${o8} must declare a "name"`);if(!$.startsWith(".")&&J.name!==$)throw Error(`Extension "${$}": manifest name "${J.name}" does not match the specifier`);let G=[];for(let[Y,z]of Object.entries(J.classes??{})){let q=Z.resolvePath(Q,z),H;try{H=await Z.loadJson(q)}catch(B){throw Error(`Extension "${$}": cannot read class "${Y}" at ${q}: ${c7(B)}`,{cause:B})}G.push(new r8(Y,q,H,Z))}let W={};if(J.schemas?.project)W.project=Z.resolvePath(Q,J.schemas.project);if(J.schemas?.document)W.document=Z.resolvePath(Q,J.schemas.document);if(J.schemas?.fields)W.fields=Z.resolvePath(Q,J.schemas.fields);return{specifier:$,manifestPath:Q,manifest:J,classes:G,schemas:W}}function c7($){return $ instanceof Error?$.message:String($)}var o8="jx-extension.json";var tW=s(()=>{l7();l7()});var i7={};m1(i7,{unknownFormatError:()=>OI,importImplementation:()=>t8,createNodeFormatIO:()=>e8,buildProjectFormatRegistry:()=>TI,buildProjectExtensionRegistry:()=>R1,buildExtensionsPayload:()=>jI});import{readFileSync as $Y}from"node:fs";import{dirname as NI,isAbsolute as DI,resolve as p7,sep as s8}from"node:path";import{pathToFileURL as wI}from"node:url";import{createRequire as eW}from"node:module";async function t8($){let Z=[$],X=`${s8}src${s8}`,Q=`${s8}dist${s8}`;if($.includes(X))Z.push($.replace(X,Q));if($.endsWith(".js"))Z.push(`${$.slice(0,-3)}.ts`);let J;for(let G of Z)try{return await import(wI(G).href)}catch(W){J=W}throw J instanceof Error?J:Error(String(J))}function e8($){return{importModule:(Z)=>t8(Z),loadJson:async(Z)=>JSON.parse($Y(Z,"utf8")),resolvePath:(Z,X)=>{if(X.startsWith("./")||X.startsWith("../"))return p7(NI(Z),X);if(DI(X))return X;let Q=eW(p7($,"package.json"));try{return Q.resolve(X)}catch{return eW(import.meta.url).resolve(X)}}}}async function R1($,Z){return sW(Z?.extensions,e8($),p7($,"project.json"))}async function TI($,Z){return(await R1($,Z)).formats}function jI($){let Z=[];for(let X of $.extensions){let Q={};if(X.schemas.project)try{Q=JSON.parse($Y(X.schemas.project,"utf8")).properties??{}}catch{Q={}}let J=[];for(let G of X.classes){if(!G.project)continue;J.push({className:G.name,entrySchema:Q[G.project.key]??null,project:G.project,studio:G.studio})}Z.push({classes:X.classes.map((G)=>{let W=G.studio?.stateDefaults,Y=G.project===null&&G.server===null&&G.connector===null&&G.extensions.length===0;return{name:G.name,path:G.classPath,...Y?{state:!0}:{},...W&&typeof W==="object"?{stateDefaults:W}:{}}}),contributions:J,name:X.manifest.name,specifier:X.specifier,...X.manifest.title===void 0?{}:{title:X.manifest.title},...X.manifest.description===void 0?{}:{description:X.manifest.description}})}return Z}function OI($,Z){return Error(`No format class registered for "${Z}" (${$}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`)}var r1=s(()=>{tW()});async function Z5($,Z={}){let{resolveElementPath:X,$media:Q,formats:J}=Z,G=[],W=new Set;async function Y(z,q){let H,B;if(typeof z==="string"){let{readFileSync:R}=await import("node:fs"),{resolve:C}=await import("node:path");if(B=q?C(q,z):C(z),W.has(B))return;if(W.add(B),B.endsWith(".json"))H=I6(R(B,"utf8"),B);else{let{extname:y}=await import("node:path"),v=y(B).toLowerCase(),h=J?.byExtension?.(v,"parse");if(!h){let{unknownFormatError:X0}=await Promise.resolve().then(() => (r1(),i7));throw X0(B,v)}H=await h.call("parse",R(B,"utf8"))}}else{if(H=z,B=null,H.tagName&&W.has(H.tagName))return;if(H.tagName)W.add(H.tagName)}let{tagName:F}=H;if(!F||!F.includes("-"))throw Error(`compileElement: tagName "${F}" must contain a hyphen`);let{dirname:L}=await import("node:path"),w=B?L(B):null,N=[];if(Array.isArray(H.$elements))for(let R of H.$elements){let C=U$(R)?R.$ref:R;if(typeof C!=="string")continue;if(w)await Y(C,w);let y=X?X(C,w):C.replace(/\.json$/,".js");N.push(y)}let I=b8(F);if(Q)H.$media={...Q,...H.$media};let{rewriteSrc:T}=Z,E=j9(H,I,N,T?(R)=>T(R,w):void 0),P=B?B.replace(/\.json$/,".js"):`${F}.js`;G.push({content:E,path:P,tagName:F})}return await Y($,Z.basePath??null),{files:G}}async function EI($,Z={}){let{title:X="Jx App",reactivitySrc:Q="https://esm.sh/@vue/reactivity@3.5.13",litHtmlSrc:J="https://esm.sh/lit-html@3.3.0"}=Z,G=await Z5($,Z),W=G.files.at(-1);if(!W)throw Error("compileElementPage: no element modules were produced");let{basename:Y}=await import("node:path"),z=Y(W.path),q=`<!DOCTYPE html>
|
|
95
97
|
<html lang="en">
|
|
96
98
|
<head>
|
|
97
99
|
<meta charset="utf-8">
|
|
@@ -110,36 +112,36 @@ app.post('${Z}/${$}', async (c) => {
|
|
|
110
112
|
<${W.tagName}></${W.tagName}>
|
|
111
113
|
<script type="module" src="./${z}"></script>
|
|
112
114
|
</body>
|
|
113
|
-
</html>`;return{files:G.files,html:q}}function
|
|
114
|
-
`)}function
|
|
115
|
-
`)}function
|
|
116
|
-
${Z} ${
|
|
117
|
-
${Z} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(
|
|
118
|
-
${Z}>`;let
|
|
119
|
-
${
|
|
120
|
-
\``)}
|
|
121
|
-
${
|
|
115
|
+
</html>`;return{files:G.files,html:q}}function RI($){if($===null||typeof $!=="object"||Array.isArray($))return JSON.stringify($);if("default"in $)return JSON.stringify($.default);if(V6($))return;if($.$prototype==="LocalStorage"||$.$prototype==="SessionStorage")return JSON.stringify($.default??null);if($.$prototype==="Request")return"null";return JSON.stringify($)}function CI($){let Z=new Set,X=new Set,Q=(G)=>{if(typeof G==="string"&&G.startsWith("#/state/"))Z.add(G.slice(8).split("/")[0])},J=(G)=>{if(typeof G==="string"){for(let Y of G.matchAll(/\bstate\.([A-Za-z_$][\w$]*)\s*\(/g))Z.add(Y[1]);return}if(!G||typeof G!=="object"||X.has(G))return;if(X.add(G),Array.isArray(G)){for(let Y of G)J(Y);return}let W=G;if(W.operator==="call"&&U$(W.target))Q(W.target.$ref);for(let[Y,z]of Object.entries(W)){if(Y.startsWith("on")&&Y!=="observedAttributes"&&U$(z))Q(z.$ref);J(z)}};return J($.children),J($.state),Z}function j9($,Z,X,Q){let J=["// Generated by @jxsuite/compiler — do not edit manually"];if($.$id)J.push(`// Source: ${$.$id}`);for(let N of X)J.push(`import '${N}';`);let G=new Map,W=$.state??{};for(let[N,I]of Object.entries(W)){let T=I;if(T&&typeof T==="object"&&!Array.isArray(T)&&T.$prototype==="Function"&&T.$src){let E=T.$src;if(!G.has(E))G.set(E,[]);G.get(E).push(P8(N,T))}}for(let[N,I]of G){let T=Q?Q(N):N;J.push(`import { ${I.join(", ")} } from '${T}';`)}let Y=Object.entries(W).filter(([,N])=>{let I=N;return Boolean(I)&&typeof I==="object"&&!Array.isArray(I)&&I.$prototype==="Request"});J.push("import { reactive, computed, effect, stop } from '@vue/reactivity';","import { render, html } from 'lit-html';","",`class ${Z} extends HTMLElement {`," #effects = [];",""," constructor() {"," super();");let z=[],q=[],H=[],B=[],F=CI($);for(let[N,I]of Object.entries(W)){let T=I;if(n$(T)){let E=T.$expression;if(u6(T))B.push([N,T]);else if(U6(E.operator))H.push([N,T]);else q.push([N,T])}else if(N1(T))if(T.$src&&typeof T.body!=="string")if(F.has(N)||PI.has(N))H.push([N,T]);else q.push([N,T]);else if(typeof T.body==="string"&&m6(T.body))q.push([N,T]);else H.push([N,T]);else{let E=RI(T);if(E!==void 0)z.push([N,E])}}J.push(" this.state = reactive({");for(let[N,I]of z)J.push(` ${N}: ${I},`);J.push(" });");for(let[N,I]of H)if(J.push(""),n$(I)){let T=L$(I.$expression,{eventParam:"e",statePrefix:"s"});J.push(` this.state.${N} = (s, e) => { ${T}; };`)}else if(D1(I)){let T=r$(I.body,{dispatchTarget:"this",eventParam:"e",indent:" ",statePrefix:"this.state"});J.push(` this.state.${N} = (s, e) => {`,T," };")}else{let T=I.parameters?l1(I.parameters):I.arguments??["state"],E=T.join(", "),P=typeof I.body==="string"?I.body:"";if(T[0]==="state")if(I.$src)J.push(` this.state.${N} = (${E}) => ${N}(${E});`);else J.push(` this.state.${N} = (${E}) => {`,` ${P}`," };");else{let R=T.map((C)=>C==="state"?"state":"e").join(", ");if(I.$src)J.push(` this.state.${N} = (state, e) => ${N}(${R});`);else J.push(` this.state.${N} = (state, e) => {`,` const _fn = (${E}) => {`,` ${P}`," };",` return _fn(${R});`," };")}}for(let[N,I]of B){J.push("");let T=L$(I.$expression,{eventParam:"e",statePrefix:"this.state"});J.push(` this.state.${N} = ${B9(I,T)};`)}for(let[N,I]of q)if(J.push(""),n$(I)){let T=L$(I.$expression,{eventParam:"e",statePrefix:"this.state"});J.push(` this.state.${N} = computed(() => ${T});`)}else if(I.$src)J.push(` this.state.${N} = computed(() => ${N}(this.state));`);else{J.push(` this.state.${N} = computed(() => {`);let T=(typeof I.body==="string"?I.body:"").replaceAll("state.","this.state.");J.push(` ${T}`," });")}J.push(" }","");let L=[];if(Array.isArray($.children)){let N={n:0};for(let I of $.children)F6(I,L,$.$media??{},"",N,$.tagName)}J.push(" template() {"," const s = this.state;"," return html`",$5($.children,$.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');"," }"," const _pn = this.getAttributeNames().filter(n => n.startsWith('props.') && n.length > 6);"," for (const _n of _pn) {"," const _k = _n.slice(6);"," if (_k in this.state) {"," this.state[_k] = this.getAttribute(_n);"," this.removeAttribute(_n);"," }"," }"," for (const key of Object.keys(this.state)) {"," if (this.hasOwnProperty(key) && this[key] !== undefined) {"," this.state[key] = this[key];"," }"," }");for(let[N,I]of Y)J.push(C8(N,I,{collect:"this.#effects",indent:" ",statePrefix:"this.state"}));if($.style&&typeof $.style==="object"){let N=[];for(let[I,T]of Object.entries($.style)){if(I.startsWith(":")||I.startsWith(".")||I.startsWith("&")||I.startsWith("[")||I.startsWith("@"))continue;if(T===null||typeof T==="object")continue;let E=R$(I);if(typeof T==="string"&&T.includes("${"))N.push([E,T])}if(N.length>0){J.push(" this.#effects.push(effect(() => {");for(let[I,T]of N){let E=T.replaceAll(/\$\{([^}]+)\}/g,(P,R)=>`\${${R.replaceAll("state.","this.state.")}}`);J.push(` this.style['${I}'] = \`${E}\`;`)}J.push(" }));")}}let w=GY($.children);if(w)J.push(" const _slotted = Array.from(this.childNodes).filter(n => n.nodeType === 1 || (n.nodeType === 3 && n.textContent.trim()));");if(J.push(" if (this.hasAttribute('data-jx-prerendered')) {"," this.removeAttribute('data-jx-prerendered');"," }"," this.innerHTML = '';"," this.#effects.push(effect(() => render(this.template(), this)));"),w)J.push(" const _slot = this.querySelector('slot');"," if (_slot && _slotted.length > 0) {"," for (const n of _slotted) _slot.before(n);"," _slot.remove();"," }");return J.push(" if (typeof this.state.onMount === 'function') {"," queueMicrotask(() => this.state.onMount(this.state));"," }"," }",""," disconnectedCallback() {"," for (const _e of this.#effects) { stop(_e); }"," this.#effects.length = 0;"," if (typeof this.state.onUnmount === 'function') { this.state.onUnmount(this.state); }"," }","}","",`customElements.define('${$.tagName}', ${Z});`,""),J.join(`
|
|
116
|
+
`)}function $5($,Z,X,Q=!1,J=!1){if(!$)return"";if(G$($))return ZY($,X);if(!Array.isArray($))return"";return $.map((G)=>G$(G)?ZY(G,X):QY(G,Q?"":X,Q,J)).join(Q?"":`
|
|
117
|
+
`)}function QY($,Z,X=!1,Q=!1){if(typeof $==="string"){if($.includes("${"))return`${Z}${n7($)}`;return`${Z}${_0($)}`}if(typeof $==="number"||typeof $==="boolean")return`${Z}${_0(String($))}`;if(!$||typeof $!=="object")return"";let J=$.tagName??"div",G=X||d6.has(J),W=[];if($.attributes)for(let[F,L]of Object.entries($.attributes))if(L&&typeof L==="object"&&U$(L))W.push(`${F}="\${${P1(L.$ref)}}"`);else if(typeof L==="string"&&L.includes("${"))W.push(`${F}="${z1(L)}"`);else W.push(`${F}="${L}"`);if($.id)W.push(`id="${z1(String($.id))}"`);if($.className)W.push(`class="${z1(String($.className))}"`);for(let[F,L]of Object.entries($)){if(B6.has(F)||F.startsWith("$")||F.startsWith("on")||F==="tagName"||F==="id"||F==="className"||F==="style"||F==="children"||F==="textContent"||F==="innerHTML"||F==="attributes")continue;if(L&&typeof L==="object"&&L.$ref)W.push(`.${F}="\${${P1(L.$ref)}}"`);else if(typeof L==="string"&&L.includes("${"))W.push(`.${F}="${z1(L)}"`)}if($.$props)for(let[F,L]of Object.entries($.$props))if(L&&typeof L==="object"&&L.$ref)W.push(`.${F}="\${${P1(L.$ref)}}"`);else if(typeof L==="string"&&L.includes("${"))W.push(`.${F}="${z1(L)}"`);else W.push(`.${F}="\${${JSON.stringify(L)}}"`);let Y=Q?"s.$map = $map; ":"";for(let[F,L]of Object.entries($)){if(!F.startsWith("on")||F==="observedAttributes")continue;let w=F.slice(2).toLowerCase();if(L&&typeof L==="object"&&L.$ref)W.push(Y?`@${w}="\${(e) => { ${Y}${P1(L.$ref)}(s, e); }}"`:`@${w}="\${(e) => ${P1(L.$ref)}(s, e)}"`);else if(L&&typeof L==="object"&&"$expression"in L){let N=L$(L.$expression,{eventParam:"e",statePrefix:"s"});W.push(`@${w}="\${(e) => { ${Y}${N}; }}"`)}else if(N1(L))W.push(`@${w}="\${(e) => { ${Y}${SI(L)} }}"`)}let z=JY($.style);if(z)W.push(`style="${z}"`);let q=W.length>0?`
|
|
118
|
+
${Z} ${W.join(`
|
|
119
|
+
${Z} `)}`:"";if(new Set(["input","br","hr","img","meta","link"]).has(J))return`${Z}<${J}${q}
|
|
120
|
+
${Z}>`;let B="";if($.$switch){let F=U$($.$switch)?$.$switch.$ref:$.$switch,L=P1(F),w=$.cases??{},N=[];for(let[I,T]of Object.entries(w)){if(!T||U$(T))continue;let E=QY(T,`${Z} `,!1,Q);N.push(` ${JSON.stringify(I)}: html\`
|
|
121
|
+
${E}
|
|
122
|
+
\``)}B=`\${{
|
|
123
|
+
${N.join(`,
|
|
122
124
|
`)}
|
|
123
|
-
}[${
|
|
124
|
-
${
|
|
125
|
-
${Z}`;return
|
|
126
|
-
${Z}>${
|
|
125
|
+
}[${L}]}`}else if($.textContent!==void 0)B=n7($.textContent);else if($.innerHTML!==void 0)B=$.innerHTML;else if($.children)B=G?$5($.children,$.style,"",!0,Q):`
|
|
126
|
+
${$5($.children,$.style,`${Z} `,!1,Q)}
|
|
127
|
+
${Z}`;return G?`<${J}${q}>${B}</${J}>`:`${Z}<${J}${q}
|
|
128
|
+
${Z}>${B}</${J}>`}function ZY($,Z){let X=U$($.items)?P1($.items.$ref):"ITEMS",Q=$.map;if(!Q)return"";let J=Q.tagName??"div",G=[];if(Q.attributes)for(let[B,F]of Object.entries(Q.attributes))if(F&&typeof F==="object"&&U$(F))G.push(`${B}="\${${XY(F.$ref)}}"`);else if(typeof F==="string"&&F.includes("${"))G.push(`${B}="${z1(F)}"`);else G.push(`${B}="${F}"`);if(Q.id)G.push(`id="${z1(String(Q.id))}"`);if(Q.className)G.push(`class="${z1(String(Q.className))}"`);if(Q.$props)for(let[B,F]of Object.entries(Q.$props))if(U$(F))G.push(`.${B}="\${${XY(F.$ref)}}"`);else if(typeof F==="string"&&F.includes("${"))G.push(`.${B}="${z1(F)}"`);else G.push(`.${B}="\${${JSON.stringify(F)}}"`);let W=JY(Q.style);if(W)G.push(`style="${W}"`);for(let[B,F]of Object.entries(Q)){if(!B.startsWith("on"))continue;let L=B.slice(2).toLowerCase();if(U$(F))G.push(`@${L}="\${(e) => { s.$map = $map; ${P1(F.$ref)}(s, e); }}"`);else if(n$(F)){let w=L$(F.$expression,{eventParam:"e",statePrefix:"s"});G.push(`@${L}="\${(e) => { s.$map = $map; ${w}; }}"`)}}let Y=G.length>0?`
|
|
127
129
|
${Z} ${G.join(`
|
|
128
|
-
${Z} `)}`:"",z="";if(Q.textContent!==void 0)z=
|
|
129
|
-
${
|
|
130
|
-
${Z} `;
|
|
130
|
+
${Z} `)}`:"",z="";if(Q.textContent!==void 0)z=n7(Q.textContent);else if(Q.children)z=`
|
|
131
|
+
${$5(Q.children,null,`${Z} `,!1,!0)}
|
|
132
|
+
${Z} `;let q=`html\`
|
|
131
133
|
${Z} <${J}${Y}
|
|
132
134
|
${Z} >${z}</${J}>
|
|
133
|
-
${Z}
|
|
135
|
+
${Z}\``,H=q.includes("$map")?`(item, index) => { const $map = { item, index }; return ${q}; }`:`(item, index) => ${q}`;return`${Z}\${${X}.map(${H})}`}function P1($){if($.startsWith("#/state/"))return`s.${$.slice(8).replaceAll("/",".")}`;if($.startsWith("$map/"))return $.slice(5).replaceAll("/",".");return`s.${$}`}function XY($){if($.startsWith("$map/"))return $.slice(5).replaceAll("/",".");return P1($)}function z1($){return $.replaceAll("state.","s.")}function n7($){if($!==null&&typeof $==="object"&&typeof $.$ref==="string")return`\${${P1($.$ref)}}`;if(typeof $==="string"&&$.includes("${"))return z1($);return String($)}function SI($){if(D1($))return r$($.body,{dispatchTarget:"e.currentTarget",eventParam:"e",statePrefix:"s"});let Z=typeof $.body==="string"?$.body:"",X=$.parameters?l1($.parameters):$.arguments??[];if(X.length>0){let Q=X.map((J)=>J==="state"?"s":"e").join(", ");return`((${X.join(", ")}) => { ${Z} })(${Q});`}return Z.replaceAll(/(?<!this\.)state\./g,"s.").replaceAll(/(?<!this\.)state(?!\.)/g,"s")}function JY($){if(!$||typeof $!=="object")return"";let Z=[];for(let[X,Q]of Object.entries($)){if(X.startsWith(":")||X.startsWith(".")||X.startsWith("&")||X.startsWith("[")||X.startsWith("@"))continue;if(Q===null||typeof Q==="object")continue;if(typeof Q==="string"&&Q.includes("${")){let J=R$(X);Z.push(`${J}: ${z1(Q)}`)}}return Z.join("; ")}function GY($){if(!Array.isArray($))return!1;for(let Z of $){if(!Z||typeof Z!=="object")continue;if(Z.tagName==="slot")return!0;if(GY(Z.children))return!0}return!1}var PI;var O9=s(()=>{V9();L6();w1();N6();PI=new Set(["onMount","onUnmount","onAdopted"])});function WY($,Z){let{title:X="Jx App",reactivitySrc:Q,litHtmlSrc:J}=Z,G=I4($,null,$.state??{},$.$media??{}),W=w4($,$.$media??{},Z.projectStyle??null),Y=[],z=YY($,!1,$,G,Y),q=[],H="",B="";if(Y.length>0){for(let w of Y){let N=j9(w.def,w.className,[],Z.rewriteSrc);q.push({content:N,path:`_islands/${w.tagName}.js`,tagName:w.tagName})}H=`<script type="importmap">
|
|
134
136
|
{
|
|
135
137
|
"imports": {
|
|
136
138
|
"@vue/reactivity": "${Q}",
|
|
137
139
|
"lit-html": "${J}"
|
|
138
140
|
}
|
|
139
141
|
}
|
|
140
|
-
</script>`,B=q.map((
|
|
141
|
-
`)}let F=Z.prePaintScheme!==!1&&Object.values($.$media??{}).some((
|
|
142
|
-
`:"",
|
|
142
|
+
</script>`,B=q.map((w)=>`<script type="module" src="./${w.path}"></script>`).join(`
|
|
143
|
+
`)}let F=Z.prePaintScheme!==!1&&Object.values($.$media??{}).some((w)=>T1(String(w))!==null)?`<script>${D4()}</script>
|
|
144
|
+
`:"",L=`<!DOCTYPE html>
|
|
143
145
|
<html lang="en">
|
|
144
146
|
<head>
|
|
145
147
|
<meta charset="utf-8">
|
|
@@ -152,10 +154,9 @@ ${Z}\`)}`}function i6($){if($.startsWith("#/state/"))return`s.${$.slice(8).repla
|
|
|
152
154
|
${z}
|
|
153
155
|
${B}
|
|
154
156
|
</body>
|
|
155
|
-
</html>`;return{files:q,html:
|
|
156
|
-
`)}return""}var oW=s(()=>{B1();A9()});function u7($,Z){let{title:X="Jx App",reactivitySrc:Q=K4,litHtmlSrc:J=H4,modulePath:G="app.js"}=Z,W=V4($,null,$.state??{},$.$media??{}),Y=L4($,$.$media??{},Z.projectStyle??null),z={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},q=new Map,H=new Map,B=[],F=[],M=[],A=[],w=[],D=new Map,j=$.state??{};for(let[v,m]of Object.entries(j)){if(m===null||typeof m!=="object"||Array.isArray(m)){if(typeof m==="string"&&w0(m))F.push([v,`() => \`${m}\``]);else B.push([v,m]);continue}if(n$(m)){let Z0=m.$expression,r=F$(Z0,{eventParam:"e",statePrefix:"state"});if(v1(m))w.push(`state[${JSON.stringify(v)}] = ${z9(m,r)};`);else if(q1(Z0.operator))A.push([v,{args:["state","e"],body:r}]);else F.push([v,`() => ${r}`]);continue}if(I6(m)){let Z0=m.parameters?K1(m.parameters):m.arguments;if(N6(m)){let r=r$(m.body,{eventParam:"e",statePrefix:"state"});if(m.parameters&&m.parameters.length>0)w.push(`state[${JSON.stringify(v)}] = ${z9(m,`(() => {
|
|
157
|
+
</html>`;return{files:q,html:L}}function YY($,Z,X,Q,J){if(typeof $==="string")return _0($);if(typeof $==="number"||typeof $==="boolean")return _0(String($));if(!$||typeof $!=="object")return"";let G=I4(X,Q.scope,X?.state??Q.scopeDefs,X?.$media??Q.media);if(Z){let H=J.length,B=`jx-island-${H}`,F=`JxIsland${H}`,L={...X??$,tagName:B};return J.push({className:F,def:L,tagName:B}),`<${B}></${B}>`}let W=$.tagName??"div",Y=L4($,G.scope);if(oZ.has(W))return`<${W}${Y}>`;let z=Q.preformatted===!0||d6.has(W),q=_I($,X,{...G,preformatted:z},J);return`<${W}${Y}>${q}</${W}>`}function _I($,Z,X,Q){let J=Z??$;if(J.textContent!==void 0){let G=r0(J.textContent,X.scope);return G==null?"":_0(String(G))}if(J.innerHTML)return r0(J.innerHTML,X.scope)??J.innerHTML;if(Array.isArray(J.children)){let G=Array.isArray(Z?.children)?Z.children:void 0;return J.children.map((W,Y)=>{let z=W,q=QG(z),H=G?.[Y]??W;return YY(z,q,H,X,Q)}).join(F9(X.preformatted))}return""}var zY=s(()=>{L6();O9()});function a7($,Z){let{title:X="Jx App",reactivitySrc:Q=M4,litHtmlSrc:J=A4,modulePath:G="app.js"}=Z,W=I4($,null,$.state??{},$.$media??{}),Y=w4($,$.$media??{},Z.projectStyle??null),z={h:0,l:0,m:0,needsLit:!1,s:0,sw:0,t:0},q=new Map,H=new Map,B=[],F=[],L=[],w=[],N=[],I=new Map,T=$.state??{};for(let[v,h]of Object.entries(T)){if(h===null||typeof h!=="object"||Array.isArray(h)){if(typeof h==="string"&&w0(h))F.push([v,`() => \`${h}\``]);else B.push([v,h]);continue}if(n$(h)){let X0=h.$expression,r=L$(X0,{eventParam:"e",statePrefix:"state"});if(u6(h))N.push(`state[${JSON.stringify(v)}] = ${B9(h,r)};`);else if(U6(X0.operator))w.push([v,{args:["state","e"],body:r}]);else F.push([v,`() => ${r}`]);continue}if(N1(h)){let X0=h.parameters?l1(h.parameters):h.arguments;if(D1(h)){let r=r$(h.body,{eventParam:"e",statePrefix:"state"});if(h.parameters&&h.parameters.length>0)N.push(`state[${JSON.stringify(v)}] = ${B9(h,`(() => {
|
|
157
158
|
${r}
|
|
158
|
-
})()`)};`);else
|
|
159
|
+
})()`)};`);else w.push([v,{args:["state","e"],body:r}])}else if(h.$src){if(!I.has(h.$src))I.set(h.$src,new Set);I.get(h.$src).add(P8(v,h)),F.push([v,`() => { return ${v}(state); }`])}else if(typeof h.body==="string"&&m6(h.body))F.push([v,`() => { ${h.body} }`]);else w.push([v,{args:X0??["state"],body:h.body}]);continue}if(V6(h))continue;if(tJ(h)){B.push([v,h.default]);continue}if(H6(h)){if(h.$prototype==="LocalStorage"||h.$prototype==="SessionStorage"){let X0=h.$prototype==="LocalStorage"?"localStorage":"sessionStorage",r=h.key??v,u=h.default??null;B.push([v,null]),N.push(xI(v,X0,r,u));continue}if(h.$prototype==="Request"){B.push([v,null]),N.push(C8(v,h));continue}if(h.$prototype==="Cookie"){B.push([v,null]),N.push(kI(v,h.name??v,h.default??null));continue}}B.push([v,h])}let E=qY($,$,W,q,H,z);for(let[v,h]of q)if(!L.some(([X0])=>X0===v))L.push([v,h]);for(let[v,h]of H)if(!w.some(([X0])=>X0===v))w.push([v,h]);let P=bI(B,F,L,w,N,I,z,Q,Z.rewriteSrc),R=[` "@vue/reactivity": "${Q}"`,` "lit-html": "${J}"`],C=Z.prePaintScheme!==!1&&Object.values($.$media??{}).some((v)=>T1(String(v))!==null)?`<script>${D4()}</script>
|
|
159
160
|
`:"",y=`<!DOCTYPE html>
|
|
160
161
|
<html lang="en">
|
|
161
162
|
<head>
|
|
@@ -165,7 +166,7 @@ ${r}
|
|
|
165
166
|
${C}<script type="importmap">
|
|
166
167
|
{
|
|
167
168
|
"imports": {
|
|
168
|
-
${
|
|
169
|
+
${R.join(`,
|
|
169
170
|
`)}
|
|
170
171
|
}
|
|
171
172
|
}
|
|
@@ -174,24 +175,21 @@ ${E.join(`,
|
|
|
174
175
|
<script type="module" src="./${G}"></script>
|
|
175
176
|
</head>
|
|
176
177
|
<body>
|
|
177
|
-
${
|
|
178
|
+
${E}
|
|
178
179
|
</body>
|
|
179
|
-
</html>`;return{files:[{content:P,path:G}],html:y}}function
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
${
|
|
185
|
-
`;else if(Array.isArray($.children))Q=`
|
|
186
|
-
${$.children.map((G)=>tW(G)).join(`
|
|
180
|
+
</html>`;return{files:[{content:P,path:G}],html:y}}function qY($,Z,X,Q,J,G){if(typeof $==="string")return _0($);if(typeof $==="number"||typeof $==="boolean")return _0(String($));if(!$||typeof $!=="object")return"";let W=I4(Z,X.scope,Z?.state??X.scopeDefs,Z?.$media??X.media),Y=$.tagName??"div";W.preformatted=X.preformatted===!0||d6.has(Y);let z=[],q=!1;if($.textContent!==void 0){let I=Z?.textContent??$.textContent;if(o$(I)){let T=w6(I.$ref);z.push(`:text-content="${T}"`),r7(Q,T,I.$ref),q=!0}else if(w0(I)){let T=`_t${G.t}`;G.t+=1,z.push(`:text-content="${T}"`),Q.set(T,`() => \`${I}\``),q=!0}}for(let[I,T]of Object.entries($)){if(!I.startsWith("on")||I==="observedAttributes")continue;let E=I.slice(2).toLowerCase();if(o$(T)){let P=w6(T.$ref);z.push(`@${E}="${P}"`),q=!0}else if(D1(T)){let P=`_h${G.h}`;G.h+=1,z.push(`@${E}="${P}"`),J.set(P,{args:["state","e"],body:r$(T.body,{eventParam:"e",statePrefix:"state"})}),q=!0}else if(N1(T)){let P=`_h${G.h}`;G.h+=1,z.push(`@${E}="${P}"`),J.set(P,{args:T.parameters?l1(T.parameters):T.arguments??["state","event"],body:T.body}),q=!0}else if(n$(T)){let P=`_h${G.h}`;G.h+=1,z.push(`@${E}="${P}"`);let R=L$(T.$expression,{eventParam:"e",statePrefix:"state"});J.set(P,{args:["state","e"],body:R}),q=!0}}if($.style&&typeof $.style==="object")for(let[I,T]of Object.entries($.style)){if(I.startsWith(":")||I.startsWith(".")||I.startsWith("&")||I.startsWith("[")||I.startsWith("@"))continue;if(T===null||typeof T==="object")continue;if(w0(T)){let E=`_s${G.s}`;G.s+=1,z.push(`:style.${R$(I)}="${E}"`),Q.set(E,`() => \`${T}\``),q=!0}}if($.attributes&&typeof $.attributes==="object"){for(let[I,T]of Object.entries($.attributes))if(o$(T)){let E=w6(T.$ref);z.push(`:attr.${I}="${E}"`),r7(Q,E,T.$ref),q=!0}else if(w0(T)){let E=`_t${G.t}`;G.t+=1,z.push(`:attr.${I}="${E}"`),Q.set(E,`() => \`${T}\``),q=!0}}for(let[I,T]of Object.entries($)){if(B6.has(I)||I.startsWith("on")||I.startsWith("$")||I==="tagName"||I==="id"||I==="className"||I==="style"||I==="children"||I==="textContent"||I==="innerHTML"||I==="attributes")continue;if(o$(T)){let E=w6(T.$ref);z.push(`:${R$(I)}="${E}"`),r7(Q,E,T.$ref),q=!0}else if(w0(T)){let E=`_t${G.t}`;G.t+=1,z.push(`:${R$(I)}="${E}"`),Q.set(E,`() => \`${T}\``),q=!0}}let H=L4($,W.scope),B=q?" data-bind":"",F=z.length>0?` ${z.join(" ")}`:"",L="",w=Z??$;if(w.textContent!==void 0&&!q){let I=r0(w.textContent,W.scope);L=I==null?"":_0(String(I))}else if(w.textContent!==void 0&&q){let I=r0(w.textContent,W.scope);L=I==null?"":_0(String(I))}else if(w.innerHTML)L=r0(w.innerHTML,W.scope)??w.innerHTML;else if(G$(w.children)){G.needsLit=!0;let I=`_list${G.l}`;G.l+=1;let T=w.children,E;if(o$(T.items))E=`state.${w6(T.items.$ref)}`;else E=JSON.stringify(T.items);let P=o7(T.map);Q.set(I,`() => (${E} ?? []).map((item, index) => html\`${P}\`)`),z.push(`:render="${I}"`),q=!0;let R=" data-bind",C=` ${z.join(" ")}`;if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${H}${R}${C}>`;return`<${Y}${H}${R}${C}></${Y}>`}else if(Array.isArray(w.children)&&w.children.some((I)=>G$(I))){G.needsLit=!0;let I=`_children${G.l}`;G.l+=1;let T=w.children.map((P)=>KY(P,W.preformatted)).join(F9(W.preformatted," "));Q.set(I,W.preformatted?`() => html\`${T}\``:`() => html\`
|
|
181
|
+
${T}
|
|
182
|
+
\``),z.push(`:render="${I}"`),q=!0;let E=` ${z.join(" ")}`;return`<${Y}${H} data-bind${E}></${Y}>`}else if(Array.isArray(w.children)){let I=Array.isArray(Z?.children)?Z.children:void 0;L=w.children.map((T,E)=>{let P=I?.[E]??T;return qY(T,P,W,Q,J,G)}).join(F9(W.preformatted))}if(new Set(["input","br","hr","img","meta","link"]).has(Y))return`<${Y}${H}${B}${F}>`;return`<${Y}${H}${B}${F}>${L}</${Y}>`}function o7($,Z=!1){if(!$)return"";let X=$.tagName??"div",Q=Z||d6.has(X),J="";if($.id)J+=` id="${$.id}"`;if($.className)J+=` class="${D6($.className)}"`;if($.$props&&typeof $.$props==="object")for(let[Y,z]of Object.entries($.$props))if(o$(z))J+=` .${Y}="\${${yI(z.$ref)}}"`;else if(typeof z==="string"&&w0(z))J+=` .${Y}="${D6(z)}"`;else J+=` .${Y}="\${${JSON.stringify(z)}}"`;if($.attributes&&typeof $.attributes==="object")for(let[Y,z]of Object.entries($.attributes))J+=typeof z==="string"&&w0(z)?` ${Y}="${D6(z)}"`:` ${Y}="${_0(String(z))}"`;if($.style&&typeof $.style==="object"){let Y=[];for(let[z,q]of Object.entries($.style)){if(z.startsWith(":")||z.startsWith(".")||z.startsWith("&")||z.startsWith("[")||z.startsWith("@"))continue;if(q===null||typeof q==="object")continue;let H=R$(z);if(w0(String(q)))Y.push(`${H}: ${D6(String(q))}`);else Y.push(`${H}: ${q}`)}if(Y.length>0)J+=` style="${Y.join("; ")}"`}for(let[Y,z]of Object.entries($)){if(!Y.startsWith("on")||Y==="observedAttributes")continue;let q=Y.slice(2).toLowerCase();if(o$(z)){let H=w6(z.$ref);J+=` @${q}=\${(e) => { state.$map = { item, index }; on.${H}(e); }}`}else if(D1(z)){let H=r$(z.body,{eventParam:"e",statePrefix:"state"});J+=` @${q}=\${(e) => { state.$map = { item, index }; ${H} }}`}else if(z&&typeof z==="object"&&z.$prototype==="Function"){let H=D6(z.body);J+=` @${q}=\${(e) => { ${H} }}`}else if(z&&typeof z==="object"&&"$expression"in z){let H=L$(z.$expression,{eventParam:"e",statePrefix:"state"});J+=` @${q}=\${(e) => { state.$map = { item, index }; ${H}; }}`}}if($.contentEditable)J+=` contenteditable="${$.contentEditable}"`;let G="";if($.textContent!==void 0){let Y=String($.textContent);if(w0(Y))G=D6(Y);else if(o$($.textContent))G=`\${state.${w6($.textContent.$ref)}}`;else G=_0(Y)}else if($.innerHTML)G=D6(String($.innerHTML));else if(G$($.children))G=`
|
|
183
|
+
${UY($.children)}
|
|
184
|
+
`;else if(Array.isArray($.children)){let Y=$.children.map((z)=>KY(z,Q));G=Q?Y.join(""):`
|
|
185
|
+
${Y.join(`
|
|
187
186
|
`)}
|
|
188
|
-
|
|
189
|
-
`)}function
|
|
190
|
-
`)}function
|
|
191
|
-
`)}function
|
|
192
|
-
`)}function
|
|
193
|
-
`)}function
|
|
194
|
-
`):$.body??"").includes("await ")}import{readFileSync as EI}from"node:fs";async function l7($,Z={}){let{title:X="Jx App",reactivitySrc:Q=K4,litHtmlSrc:J=H4,projectStyle:G=null}=Z,W;if(typeof $==="string"){let Y=EI($,"utf8");if($.endsWith(".json"))W=M1(Y,$);else{let{extname:z}=await import("node:path"),q=z($).toLowerCase(),H=Z.formats?.byExtension?.(q,"parse");if(!H){let{unknownFormatError:B}=await Promise.resolve().then(() => (p6(),v7));throw B($,q)}W=await H.call("parse",Y)}}else W=$;if(cJ(W)){let{compileClassJson:Y}=await Promise.resolve().then(() => ZY),z=Y(W,Z),q=typeof $==="string"?$.replace(/\.class\.json$/,".js"):`${W.title}.js`;return{files:[{content:z,path:q}],html:""}}if(!N5(W))return rW(W,{litHtmlSrc:J,projectStyle:G,reactivitySrc:Q,...Z.prePaintScheme===!1?{prePaintScheme:!1}:{},...Z.rewriteSrc?{rewriteSrc:Z.rewriteSrc}:{},title:X});if(W.tagName&&W.tagName.includes("-")){let{tagName:Y}=W,z=w5(Y),H={content:M9(W,z,[],Z.rewriteSrc),path:`${Y}.js`,tagName:Y},B=L4(W,W.$media??{}),F=`<!DOCTYPE html>
|
|
187
|
+
`}if(new Set(["input","br","hr","img","meta","link"]).has(X))return`<${X}${J}>`;return`<${X}${J}>${G}</${X}>`}function KY($,Z=!1){if(typeof $==="string")return w0($)?D6($):_0($);if(typeof $==="number"||typeof $==="boolean")return _0(String($));if(G$($))return UY($);return o7($,Z)}function UY($){let{items:Z}=$,X=o$(Z)?`state.${w6(Z.$ref)}`:JSON.stringify(Z??[]),Q=o7($.map);return`\${(${X} ?? []).map((item, index) => html\`${Q}\`)}`}function D6($){return $.replaceAll("$map.","")}function bI($,Z,X,Q,J,G,W,Y,z){let q=[],{needsLit:H}=W,B=Z.length>0;q.push("// Generated by @jxsuite/compiler — do not edit manually");let F=["reactive","effect"];if(B)F.push("computed");if(q.push(`import { ${F.join(", ")} } from '@vue/reactivity';`),H)q.push("import { html, render } from 'lit-html';");for(let[L,w]of G){let N=z?z(L):L;q.push(`import { ${[...w].join(", ")} } from '${N}';`)}q.push("","const state = reactive({");for(let[L,w]of $)q.push(` ${L}: ${JSON.stringify(w)},`);if(q.push("});",""),J.length>0){for(let L of J)q.push(L);q.push("")}if(Z.length>0){for(let[L,w]of Z)q.push(`state.${L} = computed(${w});`);q.push("")}if(X.length>0){q.push("const bind = {");for(let[L,w]of X)q.push(` ${L}: ${w},`);q.push("};")}else q.push("const bind = {};");if(q.push(""),Q.length>0){q.push("const on = {");for(let[L,w]of Q){let N=w.args??["state"],I=N.map((T)=>T==="state"?"state":"e").join(", ");q.push(` ${L}: (e) => { const fn = (${N.join(", ")}) => { ${w.body} }; fn(${I}); },`)}q.push("};")}else q.push("const on = {};");if(q.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;"),H)q.push(" if (parts[0] === 'render') {"," effect(() => { render(bind[key](), el); });"," } else if (parts[0] === 'style' && parts.length > 1) {");else q.push(" if (parts[0] === 'style' && parts.length > 1) {");return q.push(" effect(() => { el.style[parts[1]] = bind[key](); });"," } 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);",""),q.join(`
|
|
188
|
+
`)}function xI($,Z,X,Q){return[`// ${$}: ${Z} (key: "${X}")`,"try {",` const _s = ${Z}.getItem(${JSON.stringify(X)});`,` state.${$} = _s !== null ? JSON.parse(_s) : ${JSON.stringify(Q)};`,`} catch { state.${$} = ${JSON.stringify(Q)}; }`,"effect(() => {",` const v = state.${$};`," try {",` if (v === null) ${Z}.removeItem(${JSON.stringify(X)});`,` else ${Z}.setItem(${JSON.stringify(X)}, JSON.stringify(v));`," } catch {}","});"].join(`
|
|
189
|
+
`)}function kI($,Z,X){return[`// ${$}: Cookie (name: "${Z}")`,"{",` const _m = document.cookie.match(new RegExp("(?:^|; )${Z}=([^;]*)"));`,` try { state.${$} = _m ? JSON.parse(decodeURIComponent(_m[1])) : ${JSON.stringify(X)}; }`,` catch { state.${$} = _m ? _m[1] : ${JSON.stringify(X)}; }`,"}"].join(`
|
|
190
|
+
`)}function yI($){if($.startsWith("$map/"))return $.slice(5).replaceAll("/",".");if($.startsWith("#/state/"))return`state.${$.slice(8).replaceAll("/",".")}`;return`state.${$.replaceAll("/",".")}`}function w6($){if($.startsWith("#/state/"))return $.slice(8).replaceAll("/","_");return $.replaceAll("/","_")}function r7($,Z,X){if($.has(Z))return;if(X.startsWith("#/state/")){let J=X.slice(8).split("/");$.set(Z,`() => state.${J.join(".")}`)}else $.set(Z,`() => state.${X}`)}var s7=s(()=>{V9();L6();w1()});var VY={};m1(VY,{compileClassJson:()=>vI});function vI($,Z={}){let X=$.title;if(!X)throw Error("compileClassJson: missing title (class name)");let Q=gI($.extends),J=$.$defs,G=J?.fields??{},W=J?.constructor,Y=typeof W==="object"?W:void 0,z=J?.methods??{},q=["// Generated by @jxsuite/compiler from .class.json — do not edit manually"];if($.$id)q.push(`// Source: ${$.$id}`);q.push("");let H=Q!=="Object"?` extends ${Q}`:"";q.push(`class ${X}${H} {`);for(let[B,F]of Object.entries(G)){if(F.scope!=="static")continue;let L=F.identifier??B,w=F.access==="private"?"#":"",N=F.initializer!==void 0?JSON.stringify(F.initializer):F.default!==void 0?JSON.stringify(F.default):"null";q.push(` static ${w}${L} = ${N};`)}for(let[B,F]of Object.entries(G)){if(F.scope==="static")continue;if(F.access!=="private")continue;let L=F.identifier??B;q.push(` #${L};`)}if(Object.keys(G).length>0)q.push("");if(q.push(" constructor(config = {}) {"),Y?.superCall||Q!=="Object"){let B=Y?.superCall?.arguments?Y.superCall.arguments.join(", "):"";q.push(` super(${B});`)}for(let[B,F]of Object.entries(G)){if(F.scope==="static")continue;let L=F.identifier??B,w=F.access==="private"?"#":"",N=F.initializer!==void 0?JSON.stringify(F.initializer):F.default!==void 0?JSON.stringify(F.default):"null";q.push(` this.${w}${L} = config.${L} !== undefined ? config.${L} : ${N};`)}if(Y?.body){let B=Array.isArray(Y.body)?Y.body:[Y.body];for(let F of B)q.push(` ${F}`)}q.push(" }");for(let[B,F]of Object.entries(z)){let L=F.identifier??B,w=F.scope==="static",I=F.access==="private"?"#":"",T=w?"static ":"",E=F.returnType?.$ref?.includes("Promise")||hI(F)?"async ":"",P=HY(F.parameters??[]),R=fI(F.body);if(q.push(""),F.role==="accessor"){if(F.getter)q.push(` ${T}get ${I}${L}() {`,` ${F.getter.body}`," }");if(F.setter){let C=HY(F.setter.parameters??[]);q.push(` ${T}set ${I}${L}(${C}) {`,` ${F.setter.body}`," }")}}else{q.push(` ${T}${E}${I}${L}(${P}) {`);for(let C of R)q.push(` ${C}`);q.push(" }")}}return q.push("}","",`export { ${X} };`,`export default ${X};`,""),q.join(`
|
|
191
|
+
`)}function gI($){if(!$)return"Object";if(typeof $==="string")return $;if($.$ref){let Z=$.$ref.match(/([A-Za-z0-9_]+)\.class\.json/);return Z?Z[1]:"Object"}return"Object"}function HY($){return $.map((Z)=>{if(Z.$ref)return Z.$ref.split("/").pop();let X=Z.identifier??Z.name;return typeof X==="string"?X:"arg"}).join(", ")}function fI($){if(!$)return[""];return Array.isArray($)?$:[$]}function hI($){return(Array.isArray($.body)?$.body.join(`
|
|
192
|
+
`):$.body??"").includes("await ")}import{readFileSync as uI}from"node:fs";async function t7($,Z={}){let{title:X="Jx App",reactivitySrc:Q=M4,litHtmlSrc:J=A4,projectStyle:G=null}=Z,W;if(typeof $==="string"){let Y=uI($,"utf8");if($.endsWith(".json"))W=I6(Y,$);else{let{extname:z}=await import("node:path"),q=z($).toLowerCase(),H=Z.formats?.byExtension?.(q,"parse");if(!H){let{unknownFormatError:B}=await Promise.resolve().then(() => (r1(),i7));throw B($,q)}W=await H.call("parse",Y)}}else W=$;if($G(W)){let{compileClassJson:Y}=await Promise.resolve().then(() => VY),z=Y(W,Z),q=typeof $==="string"?$.replace(/\.class\.json$/,".js"):`${W.title}.js`;return{files:[{content:z,path:q}],html:""}}if(!S8(W))return WY(W,{litHtmlSrc:J,projectStyle:G,reactivitySrc:Q,...Z.prePaintScheme===!1?{prePaintScheme:!1}:{},...Z.rewriteSrc?{rewriteSrc:Z.rewriteSrc}:{},title:X});if(W.tagName&&W.tagName.includes("-")){let{tagName:Y}=W,z=b8(Y),H={content:j9(W,z,[],Z.rewriteSrc),path:`${Y}.js`,tagName:Y},B=w4(W,W.$media??{}),F=`<!DOCTYPE html>
|
|
195
193
|
<html lang="en">
|
|
196
194
|
<head>
|
|
197
195
|
<meta charset="utf-8">
|
|
@@ -211,22 +209,22 @@ ${E.join(`,
|
|
|
211
209
|
<${Y}></${Y}>
|
|
212
210
|
<script type="module" src="./${Y}.js"></script>
|
|
213
211
|
</body>
|
|
214
|
-
</html>`;return{files:[H],html:F}}return
|
|
215
|
-
`,patched:!0}}function
|
|
216
|
-
`)){let J=Q.trim();if(J===""||J.startsWith("#"))continue;let G=J.indexOf("=");if(G===-1)continue;let W=J.slice(0,G).trim(),Y=J.slice(G+1).trim();if(Y.startsWith('"')&&Y.endsWith('"')||Y.startsWith("'")&&Y.endsWith("'"))Y=Y.slice(1,-1);if(W!=="")X[W]=Y}return X}var
|
|
212
|
+
</html>`;return{files:[H],html:F}}return a7(W,{litHtmlSrc:J,projectStyle:G,reactivitySrc:Q,...Z.prePaintScheme===!1?{prePaintScheme:!1}:{},...Z.rewriteSrc?{rewriteSrc:Z.rewriteSrc}:{},title:X})}async function Wd($,Z){let[X,Q]=await Promise.all([t7($),T9($)]),{writeFileSync:J,mkdirSync:G}=await import("node:fs"),{dirname:W,join:Y}=await import("node:path");if(Z){J(Z,X.html,"utf8"),console.error(`Written to ${Z}`);let z=W(Z);for(let q of X.files){let H=Y(z,q.path);G(W(H),{recursive:!0}),J(H,q.content,"utf8"),console.error(`Written to ${H}`)}}else process.stdout.write(X.html);if(Q&&Z){let z=Z.replace(/(\.[^.]+)?$/,"-server.js");J(z,Q,"utf8"),console.error(`Server handler written to ${z}`)}}var BY=s(()=>{L6();m7();O9();zY();s7();w1();N6();L6();m7();O9();s7()});function FY($,Z){if(Z.length===0)return{content:$??"",patched:!1};let X={};if($)try{X=JSON.parse($)}catch{return{content:$,patched:!1}}for(let Q of Z)LY(X,Q);return{content:`${JSON.stringify(X,null,"\t")}
|
|
213
|
+
`,patched:!0}}function LY($,Z){for(let[X,Q]of Object.entries(Z)){let J=$[X];if(Array.isArray(Q)){$[X]=mI(Array.isArray(J)?J:[],Q);continue}if(X5(Q)){if(X5(J))LY(J,Q);else if(J===void 0)$[X]=structuredClone(Q);continue}if(J===void 0)$[X]=Q}}function mI($,Z){let X=[...$];for(let Q of Z){if(!X5(Q)||typeof Q.binding!=="string"){if(!X.some((W)=>JSON.stringify(W)===JSON.stringify(Q)))X.push(structuredClone(Q));continue}let J=X.findIndex((G)=>X5(G)&&G.binding===Q.binding);if(J===-1)X.push(structuredClone(Q));else X[J]={...X[J],...Q}}return X}function X5($){return $!==null&&typeof $==="object"&&!Array.isArray($)}var MY=()=>{};import{existsSync as dI,readFileSync as lI}from"node:fs";import{resolve as AY}from"node:path";function T6($){let Z=AY($,"project.json");if(!dI(Z))throw Error(`project.json not found in ${$}`);let X;try{X=pW(lI(Z,"utf8"),Z)}catch(W){throw Error(`Invalid project.json: ${A6(W)}`,{cause:W})}let Q={...Q5,...X,build:{...Q5.build,...X.build},defaults:{...Q5.defaults,...X.defaults},images:{...Q5.images,...X.images}};if(X.$head)Q.$head=X.$head;if(X.$media)Q.$media=X.$media;if(X.style)Q.style=X.style;if(X.state)Q.state=X.state;if(X.redirects)Q.redirects=X.redirects;if(X.imports)Q.imports=X.imports;let J=["cloudflare-workers","cloudflare-pages","node","bun"];if(Q.build.adapter==="static")delete Q.build.adapter;if(Q.build.adapter&&!J.includes(Q.build.adapter))throw Error(`Unknown build adapter "${Q.build.adapter}" in project.json. Valid adapters: ${J.join(", ")}`);let G=["build","cloudflare"];if(!G.includes(Q.images.service))throw Error(`Unknown images.service "${Q.images.service}" in project.json. Valid services: ${G.join(", ")}`);return{config:Q,configPath:Z,projectRoot:AY($)}}var Q5;var E9=s(()=>{N6();Q5={$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 wY={};m1(wY,{readDevVars:()=>DY,dbPush:()=>pI});import{existsSync as e7,readFileSync as IY,writeFileSync as cI}from"node:fs";import{resolve as NY}from"node:path";async function pI($,Z={}){let{dryRun:X=!1,connection:Q}=Z,{config:J}=T6($),G=await R1($,J),W=J.connections??{},Y=J.data??{},z=Object.keys(W).filter((w)=>!Q||w===Q);if(Q&&z.length===0)throw Error(`Unknown connection "${Q}" (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 q={...process.env,...DY($),JX_PROJECT_ROOT:$},H=[],B=[];for(let w of z){let N={...W[w],$name:w},I=String(N.provider??""),T=iI(G.connectors(),I);if(!T)throw Error(`Connection "${w}" names provider "${I}", but no enabled extension provides it (enable the extension in project.json "extensions")`);let E={};for(let[R,C]of Object.entries(Y))if(C.connection===w)E[R]=C;let P=await T.call("deploySchema",E,N,{dryRun:X,env:q});if(H.push({applied:P.applied??!X,connection:w,provider:I,statements:P.statements??[],tables:Object.keys(E),warnings:P.warnings??[]}),T.capabilities.bindings){let R=await T.call("bindings",N);if(R&&Object.keys(R).length>0)B.push(R)}}let F=NY($,"wrangler.jsonc"),L=!1;if(!X&&B.length>0&&e7(F)){let w=IY(F,"utf8"),{content:N,patched:I}=FY(w,B);if(I&&N!==w)cI(F,N,"utf8"),L=!0}return{bindingsPatched:L,results:H,wranglerPath:e7(F)?F:null}}function iI($,Z){return $.find((X)=>X.connector?.provider===Z)}function DY($){let Z=NY($,".dev.vars");if(!e7(Z))return{};let X={};for(let Q of IY(Z,"utf8").split(`
|
|
214
|
+
`)){let J=Q.trim();if(J===""||J.startsWith("#"))continue;let G=J.indexOf("=");if(G===-1)continue;let W=J.slice(0,G).trim(),Y=J.slice(G+1).trim();if(Y.startsWith('"')&&Y.endsWith('"')||Y.startsWith("'")&&Y.endsWith("'"))Y=Y.slice(1,-1);if(W!=="")X[W]=Y}return X}var TY=s(()=>{MY();r1();E9()});function n6($){return $.startsWith("npm:")}function OY($){let Z=$;if(n6(Z))Z=Z.slice(4);return Z=Z.replace(/^\.\//,"").replace(/\.(js|ts|mjs|mts)$/,"").replaceAll("@","").replaceAll(/[/\\]+/g,"-").replaceAll(/[^\w.-]/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,""),`/assets/${Z}.js`}function EY($){let Z=$.replaceAll("\\","/");return Z.length>1&&Z.endsWith("/")?Z.slice(0,-1):Z}function J5($){let Z=EY($);return Z.startsWith("/")?Z:`/${Z}`}function nI($,Z){return[...$].toSorted((X,Q)=>Q[Z].length-X[Z].length)}function G5($,Z){let X=Z.split("#")[0].split("?")[0];if(!X.startsWith("/"))return null;let Q;try{Q=decodeURIComponent(X)}catch{return null}if(/%2e|%2f/i.test(Q))return null;for(let J of nI($,"urlPrefix")){let G=J5(J.urlPrefix);if(!Q.startsWith(`${G}/`))continue;let Y=Q.slice(G.length+1).split("/");if(Y.some((z)=>z===""||z==="."||z===".."))return null;return`${EY(J.dir)}/${Y.join("/")}`}return null}function RY($,Z){let X=new Set;for(let Q of Z){let J=J5(Q.urlPrefix),G=new RegExp(`${J.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}/[^${rI}]+`,"g");for(let W of $.matchAll(G)){let Y=W[0].split("#")[0].split("?")[0];if(!Y.endsWith("/"))X.add(Y)}}return[...X].filter(Boolean)}var jY="npm:",rI;var R9=s(()=>{rI=String.raw`"'\s<>()\\`});var x9=b((Td,tY)=>{var __dirname="/home/runner/work/jx/jx/node_modules/esbuild/lib",__filename="/home/runner/work/jx/jx/node_modules/esbuild/lib/main.js",JX=Object.defineProperty,aI=Object.getOwnPropertyDescriptor,oI=Object.getOwnPropertyNames,sI=Object.prototype.hasOwnProperty,tI=($,Z)=>{for(var X in Z)JX($,X,{get:Z[X],enumerable:!0})},eI=($,Z,X,Q)=>{if(Z&&typeof Z==="object"||typeof Z==="function"){for(let J of oI(Z))if(!sI.call($,J)&&J!==X)JX($,J,{get:()=>Z[J],enumerable:!(Q=aI(Z,J))||Q.enumerable})}return $},$N=($)=>eI(JX({},"__esModule",{value:!0}),$),_9={};tI(_9,{analyzeMetafile:()=>_N,analyzeMetafileSync:()=>yN,build:()=>RN,buildSync:()=>bN,context:()=>PN,default:()=>hN,formatMessages:()=>SN,formatMessagesSync:()=>kN,initialize:()=>gN,stop:()=>vN,transform:()=>CN,transformSync:()=>xN,version:()=>EN});tY.exports=$N(_9);function PY($){let Z=(Q)=>{if(Q===null)X.write8(0);else if(typeof Q==="boolean")X.write8(1),X.write8(+Q);else if(typeof Q==="number")X.write8(2),X.write32(Q|0);else if(typeof Q==="string")X.write8(3),X.write(q1(Q));else if(Q instanceof Uint8Array)X.write8(4),X.write(Q);else if(Q instanceof Array){X.write8(5),X.write32(Q.length);for(let J of Q)Z(J)}else{let J=Object.keys(Q);X.write8(6),X.write32(J.length);for(let G of J)X.write(q1(G)),Z(Q[G])}},X=new fY;return X.write32(0),X.write32($.id<<1|+!$.isRequest),Z($.value),ZX(X.buf,X.len-4,0),X.buf.subarray(0,X.len)}function ZN($){let Z=()=>{switch(X.read8()){case 0:return null;case 1:return!!X.read8();case 2:return X.read32();case 3:return t6(X.read());case 4:return X.read();case 5:{let W=X.read32(),Y=[];for(let z=0;z<W;z++)Y.push(Z());return Y}case 6:{let W=X.read32(),Y={};for(let z=0;z<W;z++)Y[t6(X.read())]=Z();return Y}default:throw Error("Invalid packet")}},X=new fY($),Q=X.read32(),J=(Q&1)===0;Q>>>=1;let G=Z();if(X.ptr!==$.length)throw Error("Invalid packet");return{id:Q,isRequest:J,value:G}}var fY=class{constructor($=new Uint8Array(1024)){this.buf=$,this.len=0,this.ptr=0}_write($){if(this.len+$>this.buf.length){let Z=new Uint8Array((this.len+$)*2);Z.set(this.buf),this.buf=Z}return this.len+=$,this.len-$}write8($){let Z=this._write(1);this.buf[Z]=$}write32($){let Z=this._write(4);ZX(this.buf,$,Z)}write($){let Z=this._write(4+$.length);ZX(this.buf,$.length,Z),this.buf.set($,Z+4)}_read($){if(this.ptr+$>this.buf.length)throw Error("Invalid packet");return this.ptr+=$,this.ptr-$}read8(){return this.buf[this._read(1)]}read32(){return hY(this.buf,this._read(4))}read(){let $=this.read32(),Z=new Uint8Array($),X=this._read(Z.length);return Z.set(this.buf.subarray(X,X+$)),Z}},q1,t6,$X;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let $=new TextEncoder,Z=new TextDecoder;q1=(X)=>$.encode(X),t6=(X)=>Z.decode(X),$X='new TextEncoder().encode("")'}else if(typeof Buffer<"u")q1=($)=>Buffer.from($),t6=($)=>{let{buffer:Z,byteOffset:X,byteLength:Q}=$;return Buffer.from(Z,X,Q).toString()},$X='Buffer.from("")';else throw Error("No UTF-8 codec found");if(!(q1("")instanceof Uint8Array))throw Error(`Invariant violation: "${$X} instanceof Uint8Array" is incorrectly false
|
|
217
215
|
|
|
218
216
|
This indicates that your JavaScript environment is broken. You cannot use
|
|
219
217
|
esbuild in this environment because esbuild relies on this invariant. This
|
|
220
218
|
is not a problem with esbuild. You need to fix your environment instead.
|
|
221
|
-
`);function
|
|
222
|
-
`;break;case 114:H+="\r";break;case 116:H+="\t";break;case 117:{let B=0;for(let F=0;F<4;F++)if(q=$[z++],B<<=4,q>=48&&q<=57)B|=q-48;else if(q>=97&&q<=102)B|=q+-87;else if(q>=65&&q<=70)B|=q+-55;else t$($,--z);H+=n6(B);break}default:t$($,--z);break}else if(q<=127)H+=n6(q);else if((q&224)===192)H+=n6((q&31)<<6|$[z++]&63);else if((q&240)===224)H+=n6((q&15)<<12|($[z++]&63)<<6|$[z++]&63);else if((q&248)==240){let B=(q&7)<<18|($[z++]&63)<<12|($[z++]&63)<<6|$[z++]&63;if(B>65535)B-=65536,H+=n6(B>>10&1023|55296),B=56320|B&1023;H+=n6(B)}}H[0];break}case 91:{H=[],Z.push(G),X.push(Y),Q.push(W),G=null,Y=H,W=1;continue}case 123:{H={},Z.push(G),X.push(Y),Q.push(W),G=null,Y=H,W=2;continue}case 93:{if(W!==1)t$($,--z);H=Y,G=Z.pop(),Y=X.pop(),W=Q.pop();break}case 125:{if(W!==2)t$($,--z);H=Y,G=Z.pop(),Y=X.pop(),W=Q.pop();break}default:t$($,--z)}q=$[z];while(q<=32)q=$[++z];switch(W){case 0:{if(z===J)return H;break}case 1:{if(Y.push(H),q===44){z++;continue}if(q===93)continue;break}case 2:{if(G===null){if(G=H,q===58){z++;continue}}else{if(Y[G]=H,G=null,q===44){z++;continue}if(q===125)continue}break}}break}t$($,z)}var s0=JSON.stringify,MY="warning",AY="silent";function T4($,Z){let X=[];for(let Q of $){if(C$(Q,Z),Q.indexOf(",")>=0)throw Error(`Invalid ${Z}: ${Q}`);X.push(Q)}return X.join(",")}var t5=()=>null,m0=($)=>typeof $==="boolean"?null:"a boolean",H0=($)=>typeof $==="string"?null:"a string",e5=($)=>$ instanceof RegExp?null:"a RegExp object",p1=($)=>typeof $==="number"&&$===($|0)?null:"an integer",lI=($)=>typeof $==="number"&&$===($|0)&&$>=0&&$<=65535?null:"a valid port number",PY=($)=>typeof $==="function"?null:"a function",r6=($)=>Array.isArray($)?null:"an array",S$=($)=>Array.isArray($)&&$.every((Z)=>typeof Z==="string")?null:"an array of strings",p$=($)=>typeof $==="object"&&$!==null&&!Array.isArray($)?null:"an object",cI=($)=>typeof $==="object"&&$!==null?null:"an array or an object",pI=($)=>$ instanceof WebAssembly.Module?null:"a WebAssembly.Module",IY=($)=>typeof $==="object"&&!Array.isArray($)?null:"an object or null",CY=($)=>typeof $==="string"||typeof $==="boolean"?null:"a string or a boolean",iI=($)=>typeof $==="string"||typeof $==="object"&&$!==null&&!Array.isArray($)?null:"a string or an object",SY=($)=>typeof $==="string"||Array.isArray($)&&$.every((Z)=>typeof Z==="string")?null:"a string or an array of strings",_Y=($)=>typeof $==="string"||$ instanceof Uint8Array?null:"a string or a Uint8Array",nI=($)=>typeof $==="string"||$ instanceof URL?null:"a string or a URL";function b($,Z,X,Q){let J=$[X];if(Z[X+""]=!0,J===void 0)return;let G=Q(J);if(G!==null)throw Error(`${s0(X)} must be ${G}`);return J}function a0($,Z,X){for(let Q in $)if(!(Q in Z))throw Error(`Invalid option ${X}: ${s0(Q)}`)}function rI($){let Z=Object.create(null),X=b($,Z,"wasmURL",nI),Q=b($,Z,"wasmModule",pI),J=b($,Z,"worker",m0);return a0($,Z,"in initialize() call"),{wasmURL:X,wasmModule:Q,worker:J}}function xY($){let Z;if($!==void 0){Z=Object.create(null);for(let X in $){let Q=$[X];if(typeof Q==="string"||Q===!1)Z[X]=Q;else throw Error(`Expected ${s0(X)} in mangle cache to map to either a string or false`)}}return Z}function J8($,Z,X,Q,J){let G=b(Z,X,"color",m0),W=b(Z,X,"logLevel",H0),Y=b(Z,X,"logLimit",p1);if(G!==void 0)$.push(`--color=${G}`);else if(Q)$.push("--color=true");$.push(`--log-level=${W||J}`),$.push(`--log-limit=${Y||0}`)}function C$($,Z,X){if(typeof $!=="string")throw Error(`Expected value for ${Z}${X!==void 0?" "+s0(X):""} to be a string, got ${typeof $} instead`);return $}function bY($,Z,X){let Q=b(Z,X,"legalComments",H0),J=b(Z,X,"sourceRoot",H0),G=b(Z,X,"sourcesContent",m0),W=b(Z,X,"target",SY),Y=b(Z,X,"format",H0),z=b(Z,X,"globalName",H0),q=b(Z,X,"mangleProps",e5),H=b(Z,X,"reserveProps",e5),B=b(Z,X,"mangleQuoted",m0),F=b(Z,X,"minify",m0),M=b(Z,X,"minifySyntax",m0),A=b(Z,X,"minifyWhitespace",m0),w=b(Z,X,"minifyIdentifiers",m0),D=b(Z,X,"lineLimit",p1),j=b(Z,X,"drop",S$),R=b(Z,X,"dropLabels",S$),P=b(Z,X,"charset",H0),E=b(Z,X,"treeShaking",m0),C=b(Z,X,"ignoreAnnotations",m0),y=b(Z,X,"jsx",H0),v=b(Z,X,"jsxFactory",H0),m=b(Z,X,"jsxFragment",H0),Z0=b(Z,X,"jsxImportSource",H0),r=b(Z,X,"jsxDev",m0),h=b(Z,X,"jsxSideEffects",m0),t=b(Z,X,"define",p$),Y0=b(Z,X,"logOverride",p$),G0=b(Z,X,"supported",p$),A0=b(Z,X,"pure",S$),l=b(Z,X,"keepNames",m0),K0=b(Z,X,"platform",H0),V0=b(Z,X,"tsconfigRaw",iI),o=b(Z,X,"absPaths",S$);if(Q)$.push(`--legal-comments=${Q}`);if(J!==void 0)$.push(`--source-root=${J}`);if(G!==void 0)$.push(`--sources-content=${G}`);if(W)$.push(`--target=${T4(Array.isArray(W)?W:[W],"target")}`);if(Y)$.push(`--format=${Y}`);if(z)$.push(`--global-name=${z}`);if(K0)$.push(`--platform=${K0}`);if(V0)$.push(`--tsconfig-raw=${typeof V0==="string"?V0:JSON.stringify(V0)}`);if(F)$.push("--minify");if(M)$.push("--minify-syntax");if(A)$.push("--minify-whitespace");if(w)$.push("--minify-identifiers");if(D)$.push(`--line-limit=${D}`);if(P)$.push(`--charset=${P}`);if(E!==void 0)$.push(`--tree-shaking=${E}`);if(C)$.push("--ignore-annotations");if(j)for(let f of j)$.push(`--drop:${C$(f,"drop")}`);if(R)$.push(`--drop-labels=${T4(R,"drop label")}`);if(o)$.push(`--abs-paths=${T4(o,"abs paths")}`);if(q)$.push(`--mangle-props=${$8(q)}`);if(H)$.push(`--reserve-props=${$8(H)}`);if(B!==void 0)$.push(`--mangle-quoted=${B}`);if(y)$.push(`--jsx=${y}`);if(v)$.push(`--jsx-factory=${v}`);if(m)$.push(`--jsx-fragment=${m}`);if(Z0)$.push(`--jsx-import-source=${Z0}`);if(r)$.push("--jsx-dev");if(h)$.push("--jsx-side-effects");if(t)for(let f in t){if(f.indexOf("=")>=0)throw Error(`Invalid define: ${f}`);$.push(`--define:${f}=${C$(t[f],"define",f)}`)}if(Y0)for(let f in Y0){if(f.indexOf("=")>=0)throw Error(`Invalid log override: ${f}`);$.push(`--log-override:${f}=${C$(Y0[f],"log override",f)}`)}if(G0)for(let f in G0){if(f.indexOf("=")>=0)throw Error(`Invalid supported: ${f}`);let $0=G0[f];if(typeof $0!=="boolean")throw Error(`Expected value for supported ${s0(f)} to be a boolean, got ${typeof $0} instead`);$.push(`--supported:${f}=${$0}`)}if(A0)for(let f of A0)$.push(`--pure:${C$(f,"pure")}`);if(l)$.push("--keep-names")}function aI($,Z,X,Q,J){var G;let W=[],Y=[],z=Object.create(null),q=null,H=null;J8(W,Z,z,X,Q),bY(W,Z,z);let B=b(Z,z,"sourcemap",CY),F=b(Z,z,"bundle",m0),M=b(Z,z,"splitting",m0),A=b(Z,z,"preserveSymlinks",m0),w=b(Z,z,"metafile",m0),D=b(Z,z,"outfile",H0),j=b(Z,z,"outdir",H0),R=b(Z,z,"outbase",H0),P=b(Z,z,"tsconfig",H0),E=b(Z,z,"resolveExtensions",S$),C=b(Z,z,"nodePaths",S$),y=b(Z,z,"mainFields",S$),v=b(Z,z,"conditions",S$),m=b(Z,z,"external",S$),Z0=b(Z,z,"packages",H0),r=b(Z,z,"alias",p$),h=b(Z,z,"loader",p$),t=b(Z,z,"outExtension",p$),Y0=b(Z,z,"publicPath",H0),G0=b(Z,z,"entryNames",H0),A0=b(Z,z,"chunkNames",H0),l=b(Z,z,"assetNames",H0),K0=b(Z,z,"inject",S$),V0=b(Z,z,"banner",p$),o=b(Z,z,"footer",p$),f=b(Z,z,"entryPoints",cI),$0=b(Z,z,"absWorkingDir",H0),X0=b(Z,z,"stdin",p$),e=(G=b(Z,z,"write",m0))!=null?G:J,M0=b(Z,z,"allowOverwrite",m0),U0=b(Z,z,"mangleCache",p$);if(z.plugins=!0,a0(Z,z,`in ${$}() call`),B)W.push(`--sourcemap${B===!0?"":`=${B}`}`);if(F)W.push("--bundle");if(M0)W.push("--allow-overwrite");if(M)W.push("--splitting");if(A)W.push("--preserve-symlinks");if(w)W.push("--metafile");if(D)W.push(`--outfile=${D}`);if(j)W.push(`--outdir=${j}`);if(R)W.push(`--outbase=${R}`);if(P)W.push(`--tsconfig=${P}`);if(Z0)W.push(`--packages=${Z0}`);if(E)W.push(`--resolve-extensions=${T4(E,"resolve extension")}`);if(Y0)W.push(`--public-path=${Y0}`);if(G0)W.push(`--entry-names=${G0}`);if(A0)W.push(`--chunk-names=${A0}`);if(l)W.push(`--asset-names=${l}`);if(y)W.push(`--main-fields=${T4(y,"main field")}`);if(v)W.push(`--conditions=${T4(v,"condition")}`);if(m)for(let Q0 of m)W.push(`--external:${C$(Q0,"external")}`);if(r)for(let Q0 in r){if(Q0.indexOf("=")>=0)throw Error(`Invalid package name in alias: ${Q0}`);W.push(`--alias:${Q0}=${C$(r[Q0],"alias",Q0)}`)}if(V0)for(let Q0 in V0){if(Q0.indexOf("=")>=0)throw Error(`Invalid banner file type: ${Q0}`);W.push(`--banner:${Q0}=${C$(V0[Q0],"banner",Q0)}`)}if(o)for(let Q0 in o){if(Q0.indexOf("=")>=0)throw Error(`Invalid footer file type: ${Q0}`);W.push(`--footer:${Q0}=${C$(o[Q0],"footer",Q0)}`)}if(K0)for(let Q0 of K0)W.push(`--inject:${C$(Q0,"inject")}`);if(h)for(let Q0 in h){if(Q0.indexOf("=")>=0)throw Error(`Invalid loader extension: ${Q0}`);W.push(`--loader:${Q0}=${C$(h[Q0],"loader",Q0)}`)}if(t)for(let Q0 in t){if(Q0.indexOf("=")>=0)throw Error(`Invalid out extension: ${Q0}`);W.push(`--out-extension:${Q0}=${C$(t[Q0],"out extension",Q0)}`)}if(f)if(Array.isArray(f))for(let Q0=0,X$=f.length;Q0<X$;Q0++){let P0=f[Q0];if(typeof P0==="object"&&P0!==null){let t0=Object.create(null),v0=b(P0,t0,"in",H0),c0=b(P0,t0,"out",H0);if(a0(P0,t0,"in entry point at index "+Q0),v0===void 0)throw Error('Missing property "in" for entry point at index '+Q0);if(c0===void 0)throw Error('Missing property "out" for entry point at index '+Q0);Y.push([c0,v0])}else Y.push(["",C$(P0,"entry point at index "+Q0)])}else for(let Q0 in f)Y.push([Q0,C$(f[Q0],"entry point",Q0)]);if(X0){let Q0=Object.create(null),X$=b(X0,Q0,"contents",_Y),P0=b(X0,Q0,"resolveDir",H0),t0=b(X0,Q0,"sourcefile",H0),v0=b(X0,Q0,"loader",H0);if(a0(X0,Q0,'in "stdin" object'),t0)W.push(`--sourcefile=${t0}`);if(v0)W.push(`--loader=${v0}`);if(P0)H=P0;if(typeof X$==="string")q=z6(X$);else if(X$ instanceof Uint8Array)q=X$}let N0=[];if(C)for(let Q0 of C)Q0+="",N0.push(Q0);return{entries:Y,flags:W,write:e,stdinContents:q,stdinResolveDir:H,absWorkingDir:$0,nodePaths:N0,mangleCache:xY(U0)}}function oI($,Z,X,Q){let J=[],G=Object.create(null);J8(J,Z,G,X,Q),bY(J,Z,G);let W=b(Z,G,"sourcemap",CY),Y=b(Z,G,"sourcefile",H0),z=b(Z,G,"loader",H0),q=b(Z,G,"banner",H0),H=b(Z,G,"footer",H0),B=b(Z,G,"mangleCache",p$);if(a0(Z,G,`in ${$}() call`),W)J.push(`--sourcemap=${W===!0?"external":W}`);if(Y)J.push(`--sourcefile=${Y}`);if(z)J.push(`--loader=${z}`);if(q)J.push(`--banner=${q}`);if(H)J.push(`--footer=${H}`);return{flags:J,mangleCache:xY(B)}}function kY($){let Z={},X={didClose:!1,reason:""},Q={},J=0,G=0,W=new Uint8Array(16384),Y=0,z=(P)=>{let E=Y+P.length;if(E>W.length){let y=new Uint8Array(E*2);y.set(W),W=y}W.set(P,Y),Y+=P.length;let C=0;while(C+4<=Y){let y=RY(W,C);if(C+4+y>Y)break;C+=4,A(W.subarray(C,C+y)),C+=y}if(C>0)W.copyWithin(0,C,Y),Y-=C},q=(P)=>{if(X.didClose=!0,P)X.reason=": "+(P.message||P);let E="The service was stopped"+X.reason;for(let C in Q)Q[C](E,null);Q={}},H=(P,E,C)=>{if(X.didClose)return C("The service is no longer running"+X.reason,null);let y=J++;if(Q[y]=(v,m)=>{try{C(v,m)}finally{if(P)P.unref()}},P)P.ref();$.writeToStdin(LY({id:y,isRequest:!0,value:E}))},B=(P,E)=>{if(X.didClose)throw Error("The service is no longer running"+X.reason);$.writeToStdin(LY({id:P,isRequest:!1,value:E}))},F=async(P,E)=>{try{if(E.command==="ping"){B(P,{});return}if(typeof E.key==="number"){let C=Z[E.key];if(!C)return;let y=C[E.command];if(y){await y(P,E);return}}throw Error("Invalid command: "+E.command)}catch(C){let y=[c1(C,$,null,void 0,"")];try{B(P,{errors:y})}catch{}}},M=!0,A=(P)=>{if(M){M=!1;let C=String.fromCharCode(...P);if(C!=="0.28.1")throw Error(`Cannot start service: Host version "0.28.1" does not match binary version ${s0(C)}`);return}let E=mI(P);if(E.isRequest)F(E.id,E.value);else{let C=Q[E.id];if(delete Q[E.id],E.value.error)C(E.value.error,{});else C(null,E.value)}};return{readFromStdout:z,afterClose:q,service:{buildOrContext:({callName:P,refs:E,options:C,isTTY:y,defaultWD:v,callback:m})=>{let Z0=0,r=G++,h={},t={ref(){if(++Z0===1){if(E)E.ref()}},unref(){if(--Z0===0){if(delete Z[r],E)E.unref()}}};Z[r]=h,t.ref(),sI(P,r,H,B,t,$,h,C,y,v,(Y0,G0)=>{try{m(Y0,G0)}finally{t.unref()}})},transform:({callName:P,refs:E,input:C,options:y,isTTY:v,fs:m,callback:Z0})=>{let r=yY(),h=(t)=>{try{if(typeof C!=="string"&&!(C instanceof Uint8Array))throw Error('The input to "transform" must be a string or a Uint8Array');let{flags:Y0,mangleCache:G0}=oI(P,y,v,AY),A0={command:"transform",flags:Y0,inputFS:t!==null,input:t!==null?z6(t):typeof C==="string"?z6(C):C};if(G0)A0.mangleCache=G0;H(E,A0,(l,K0)=>{if(l)return Z0(Error(l),null);let V0=j4(K0.errors,r),o=j4(K0.warnings,r),f=1,$0=()=>{if(--f===0){let X0={warnings:o,code:K0.code,map:K0.map,mangleCache:void 0,legalComments:void 0};if("legalComments"in K0)X0.legalComments=K0==null?void 0:K0.legalComments;if(K0.mangleCache)X0.mangleCache=K0==null?void 0:K0.mangleCache;Z0(null,X0)}};if(V0.length>0)return Z0(w9("Transform failed",V0,o),null);if(K0.codeFS)f++,m.readFile(K0.code,(X0,e)=>{if(X0!==null)Z0(X0,null);else K0.code=e,$0()});if(K0.mapFS)f++,m.readFile(K0.map,(X0,e)=>{if(X0!==null)Z0(X0,null);else K0.map=e,$0()});$0()})}catch(Y0){let G0=[];try{J8(G0,y,{},v,AY)}catch{}let A0=c1(Y0,$,r,void 0,"");H(E,{command:"error",flags:G0,error:A0},()=>{A0.detail=r.load(A0.detail),Z0(w9("Transform failed",[A0],[]),null)})}};if((typeof C==="string"||C instanceof Uint8Array)&&C.length>1048576){let t=h;h=()=>m.writeFile(C,t)}h(null)},formatMessages:({callName:P,refs:E,messages:C,options:y,callback:v})=>{if(!y)throw Error(`Missing second argument in ${P}() call`);let m={},Z0=b(y,m,"kind",H0),r=b(y,m,"color",m0),h=b(y,m,"terminalWidth",p1);if(a0(y,m,`in ${P}() call`),Z0===void 0)throw Error(`Missing "kind" in ${P}() call`);if(Z0!=="error"&&Z0!=="warning")throw Error(`Expected "kind" to be "error" or "warning" in ${P}() call`);let t={command:"format-msgs",messages:a6(C,"messages",null,"",h),isWarning:Z0==="warning"};if(r!==void 0)t.color=r;if(h!==void 0)t.terminalWidth=h;H(E,t,(Y0,G0)=>{if(Y0)return v(Error(Y0),null);v(null,G0.messages)})},analyzeMetafile:({callName:P,refs:E,metafile:C,options:y,callback:v})=>{if(y===void 0)y={};let m={},Z0=b(y,m,"color",m0),r=b(y,m,"verbose",m0);a0(y,m,`in ${P}() call`);let h={command:"analyze-metafile",metafile:C};if(Z0!==void 0)h.color=Z0;if(r!==void 0)h.verbose=r;H(E,h,(t,Y0)=>{if(t)return v(Error(t),null);v(null,Y0.result)})}}}}function sI($,Z,X,Q,J,G,W,Y,z,q,H){let B=yY(),F=$==="context",M=(D,j)=>{let R=[];try{J8(R,Y,{},z,MY)}catch{}let P=c1(D,G,B,void 0,j);X(J,{command:"error",flags:R,error:P},()=>{P.detail=B.load(P.detail),H(w9(F?"Context failed":"Build failed",[P],[]),null)})},A;if(typeof Y==="object"){let D=Y.plugins;if(D!==void 0){if(!Array.isArray(D))return M(Error('"plugins" must be an array'),"");A=D}}if(A&&A.length>0){if(G.isSync)return M(Error("Cannot use plugins in synchronous API calls"),"");tI(Z,X,Q,J,G,W,Y,A,B).then((D)=>{if(!D.ok)return M(D.error,D.pluginName);try{w(D.requestPlugins,D.runOnEndCallbacks,D.scheduleOnDisposeCallbacks)}catch(j){M(j,"")}},(D)=>M(D,""));return}try{w(null,(D,j)=>j([],[]),()=>{})}catch(D){M(D,"")}function w(D,j,R){let P=G.hasFS,{entries:E,flags:C,write:y,stdinContents:v,stdinResolveDir:m,absWorkingDir:Z0,nodePaths:r,mangleCache:h}=aI($,Y,z,MY,P);if(y&&!G.hasFS)throw Error('The "write" option is unavailable in this environment');let t={command:"build",key:Z,entries:E,flags:C,write:y,stdinContents:v,stdinResolveDir:m,absWorkingDir:Z0||q,nodePaths:r,context:F};if(D)t.plugins=D;if(h)t.mangleCache=h;let Y0=(l,K0)=>{let V0={errors:j4(l.errors,B),warnings:j4(l.warnings,B),outputFiles:void 0,metafile:void 0,mangleCache:void 0},o=V0.errors.slice(),f=V0.warnings.slice();if(l.outputFiles)V0.outputFiles=l.outputFiles.map($N);if(l.metafile&&l.metafile.length)V0.metafile=ZN(l.metafile);if(l.mangleCache)V0.mangleCache=l.mangleCache;if(l.writeToStdout!==void 0)console.log(r1(l.writeToStdout).replace(/\n$/,""));j(V0,($0,X0)=>{if(o.length>0||$0.length>0){let e=w9("Build failed",o.concat($0),f.concat(X0));return K0(e,null,$0,X0)}K0(null,V0,$0,X0)})},G0,A0;if(F)W["on-end"]=(l,K0)=>new Promise((V0)=>{Y0(K0,(o,f,$0,X0)=>{let e={errors:$0,warnings:X0};if(A0)A0(o,f);G0=void 0,A0=void 0,Q(l,e),V0()})});X(J,t,(l,K0)=>{if(l)return H(Error(l),null);if(!F)return Y0(K0,(f,$0)=>{return R(),H(f,$0)});if(K0.errors.length>0)return H(w9("Context failed",K0.errors,K0.warnings),null);let V0=!1,o={rebuild:()=>{if(!G0)G0=new Promise((f,$0)=>{let X0;A0=(M0,U0)=>{if(!X0)X0=()=>M0?$0(M0):f(U0)};let e=()=>{X(J,{command:"rebuild",key:Z},(U0,N0)=>{if(U0)$0(Error(U0));else if(X0)X0();else e()})};e()});return G0},watch:(f={})=>new Promise(($0,X0)=>{if(!G.hasFS)throw Error('Cannot use the "watch" API in this environment');let e={},M0=b(f,e,"delay",p1);a0(f,e,"in watch() call");let U0={command:"watch",key:Z};if(M0)U0.delay=M0;X(J,U0,(N0)=>{if(N0)X0(Error(N0));else $0(void 0)})}),serve:(f={})=>new Promise(($0,X0)=>{if(!G.hasFS)throw Error('Cannot use the "serve" API in this environment');let e={},M0=b(f,e,"port",lI),U0=b(f,e,"host",H0),N0=b(f,e,"servedir",H0),Q0=b(f,e,"keyfile",H0),X$=b(f,e,"certfile",H0),P0=b(f,e,"fallback",H0),t0=b(f,e,"cors",p$),v0=b(f,e,"onRequest",PY);a0(f,e,"in serve() call");let c0={command:"serve",key:Z,onRequest:!!v0};if(M0!==void 0)c0.port=M0;if(U0!==void 0)c0.host=U0;if(N0!==void 0)c0.servedir=N0;if(Q0!==void 0)c0.keyfile=Q0;if(X$!==void 0)c0.certfile=X$;if(P0!==void 0)c0.fallback=P0;if(t0){let j$={},q$=b(t0,j$,"origin",SY);if(a0(t0,j$,'on "cors" object'),Array.isArray(q$))c0.corsOrigin=q$;else if(q$!==void 0)c0.corsOrigin=[q$]}X(J,c0,(j$,q$)=>{if(j$)return X0(Error(j$));if(v0)W["serve-request"]=(L6,M6)=>{v0(M6.args),Q(L6,{})};$0(q$)})}),cancel:()=>new Promise((f)=>{if(V0)return f();X(J,{command:"cancel",key:Z},()=>{f()})}),dispose:()=>new Promise((f)=>{if(V0)return f();V0=!0,X(J,{command:"dispose",key:Z},()=>{f(),R(),J.unref()})})};J.ref(),H(null,o)})}}var tI=async($,Z,X,Q,J,G,W,Y,z)=>{let q=[],H=[],B={},F={},M=[],A=0,w=0,D=[],j=!1;Y=[...Y];for(let E of Y){let C={};if(typeof E!=="object")throw Error(`Plugin at index ${w} must be an object`);let y=b(E,C,"name",H0);if(typeof y!=="string"||y==="")throw Error(`Plugin at index ${w} is missing a name`);try{let v=b(E,C,"setup",PY);if(typeof v!=="function")throw Error("Plugin is missing a setup function");a0(E,C,`on plugin ${s0(y)}`);let m={name:y,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};w++;let r=v({initialOptions:W,resolve:(h,t={})=>{if(!j)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 Y0=Object.create(null),G0=b(t,Y0,"pluginName",H0),A0=b(t,Y0,"importer",H0),l=b(t,Y0,"namespace",H0),K0=b(t,Y0,"resolveDir",H0),V0=b(t,Y0,"kind",H0),o=b(t,Y0,"pluginData",t5),f=b(t,Y0,"with",p$);return a0(t,Y0,"in resolve() call"),new Promise(($0,X0)=>{let e={command:"resolve",path:h,key:$,pluginName:y};if(G0!=null)e.pluginName=G0;if(A0!=null)e.importer=A0;if(l!=null)e.namespace=l;if(K0!=null)e.resolveDir=K0;if(V0!=null)e.kind=V0;else throw Error('Must specify "kind" when calling "resolve"');if(o!=null)e.pluginData=z.store(o);if(f!=null)e.with=eI(f,"with");Z(Q,e,(M0,U0)=>{if(M0!==null)X0(Error(M0));else $0({errors:j4(U0.errors,z),warnings:j4(U0.warnings,z),path:U0.path,external:U0.external,sideEffects:U0.sideEffects,namespace:U0.namespace,suffix:U0.suffix,pluginData:z.load(U0.pluginData)})})})},onStart(h){let Y0=o5(Error('This error came from the "onStart" callback registered here:'),J,"onStart");q.push({name:y,callback:h,note:Y0}),m.onStart=!0},onEnd(h){let Y0=o5(Error('This error came from the "onEnd" callback registered here:'),J,"onEnd");H.push({name:y,callback:h,note:Y0}),m.onEnd=!0},onResolve(h,t){let G0=o5(Error('This error came from the "onResolve" callback registered here:'),J,"onResolve"),A0={},l=b(h,A0,"filter",e5),K0=b(h,A0,"namespace",H0);if(a0(h,A0,`in onResolve() call for plugin ${s0(y)}`),l==null)throw Error("onResolve() call is missing a filter");let V0=A++;B[V0]={name:y,callback:t,note:G0},m.onResolve.push({id:V0,filter:$8(l),namespace:K0||""})},onLoad(h,t){let G0=o5(Error('This error came from the "onLoad" callback registered here:'),J,"onLoad"),A0={},l=b(h,A0,"filter",e5),K0=b(h,A0,"namespace",H0);if(a0(h,A0,`in onLoad() call for plugin ${s0(y)}`),l==null)throw Error("onLoad() call is missing a filter");let V0=A++;F[V0]={name:y,callback:t,note:G0},m.onLoad.push({id:V0,filter:$8(l),namespace:K0||""})},onDispose(h){M.push(h)},esbuild:J.esbuild});if(r)await r;D.push(m)}catch(v){return{ok:!1,error:v,pluginName:y}}}G["on-start"]=async(E,C)=>{z.clear();let y={errors:[],warnings:[]};await Promise.all(q.map(async({name:v,callback:m,note:Z0})=>{try{let r=await m();if(r!=null){if(typeof r!=="object")throw Error(`Expected onStart() callback in plugin ${s0(v)} to return an object`);let h={},t=b(r,h,"errors",r6),Y0=b(r,h,"warnings",r6);if(a0(r,h,`from onStart() callback in plugin ${s0(v)}`),t!=null)y.errors.push(...a6(t,"errors",z,v,void 0));if(Y0!=null)y.warnings.push(...a6(Y0,"warnings",z,v,void 0))}}catch(r){y.errors.push(c1(r,J,z,Z0&&Z0(),v))}})),X(E,y)},G["on-resolve"]=async(E,C)=>{let y={},v="",m,Z0;for(let r of C.ids)try{({name:v,callback:m,note:Z0}=B[r]);let h=await m({path:C.path,importer:C.importer,namespace:C.namespace,resolveDir:C.resolveDir,kind:C.kind,pluginData:z.load(C.pluginData),with:C.with});if(h!=null){if(typeof h!=="object")throw Error(`Expected onResolve() callback in plugin ${s0(v)} to return an object`);let t={},Y0=b(h,t,"pluginName",H0),G0=b(h,t,"path",H0),A0=b(h,t,"namespace",H0),l=b(h,t,"suffix",H0),K0=b(h,t,"external",m0),V0=b(h,t,"sideEffects",m0),o=b(h,t,"pluginData",t5),f=b(h,t,"errors",r6),$0=b(h,t,"warnings",r6),X0=b(h,t,"watchFiles",S$),e=b(h,t,"watchDirs",S$);if(a0(h,t,`from onResolve() callback in plugin ${s0(v)}`),y.id=r,Y0!=null)y.pluginName=Y0;if(G0!=null)y.path=G0;if(A0!=null)y.namespace=A0;if(l!=null)y.suffix=l;if(K0!=null)y.external=K0;if(V0!=null)y.sideEffects=V0;if(o!=null)y.pluginData=z.store(o);if(f!=null)y.errors=a6(f,"errors",z,v,void 0);if($0!=null)y.warnings=a6($0,"warnings",z,v,void 0);if(X0!=null)y.watchFiles=s5(X0,"watchFiles");if(e!=null)y.watchDirs=s5(e,"watchDirs");break}}catch(h){y={id:r,errors:[c1(h,J,z,Z0&&Z0(),v)]};break}X(E,y)},G["on-load"]=async(E,C)=>{let y={},v="",m,Z0;for(let r of C.ids)try{({name:v,callback:m,note:Z0}=F[r]);let h=await m({path:C.path,namespace:C.namespace,suffix:C.suffix,pluginData:z.load(C.pluginData),with:C.with});if(h!=null){if(typeof h!=="object")throw Error(`Expected onLoad() callback in plugin ${s0(v)} to return an object`);let t={},Y0=b(h,t,"pluginName",H0),G0=b(h,t,"contents",_Y),A0=b(h,t,"resolveDir",H0),l=b(h,t,"pluginData",t5),K0=b(h,t,"loader",H0),V0=b(h,t,"errors",r6),o=b(h,t,"warnings",r6),f=b(h,t,"watchFiles",S$),$0=b(h,t,"watchDirs",S$);if(a0(h,t,`from onLoad() callback in plugin ${s0(v)}`),y.id=r,Y0!=null)y.pluginName=Y0;if(G0 instanceof Uint8Array)y.contents=G0;else if(G0!=null)y.contents=z6(G0);if(A0!=null)y.resolveDir=A0;if(l!=null)y.pluginData=z.store(l);if(K0!=null)y.loader=K0;if(V0!=null)y.errors=a6(V0,"errors",z,v,void 0);if(o!=null)y.warnings=a6(o,"warnings",z,v,void 0);if(f!=null)y.watchFiles=s5(f,"watchFiles");if($0!=null)y.watchDirs=s5($0,"watchDirs");break}}catch(h){y={id:r,errors:[c1(h,J,z,Z0&&Z0(),v)]};break}X(E,y)};let R=(E,C)=>C([],[]);if(H.length>0)R=(E,C)=>{(async()=>{let y=[],v=[];for(let{name:m,callback:Z0,note:r}of H){let h,t;try{let Y0=await Z0(E);if(Y0!=null){if(typeof Y0!=="object")throw Error(`Expected onEnd() callback in plugin ${s0(m)} to return an object`);let G0={},A0=b(Y0,G0,"errors",r6),l=b(Y0,G0,"warnings",r6);if(a0(Y0,G0,`from onEnd() callback in plugin ${s0(m)}`),A0!=null)h=a6(A0,"errors",z,m,void 0);if(l!=null)t=a6(l,"warnings",z,m,void 0)}}catch(Y0){h=[c1(Y0,J,z,r&&r(),m)]}if(h){y.push(...h);try{E.errors.push(...h)}catch{}}if(t){v.push(...t);try{E.warnings.push(...t)}catch{}}}C(y,v)})()};let P=()=>{for(let E of M)setTimeout(()=>E(),0)};return j=!0,{ok:!0,requestPlugins:D,runOnEndCallbacks:R,scheduleOnDisposeCallbacks:P}};function yY(){let $=new Map,Z=0;return{clear(){$.clear()},load(X){return $.get(X)},store(X){if(X===void 0)return-1;let Q=Z++;return $.set(Q,X),Q}}}function o5($,Z,X){let Q,J=!1;return()=>{if(J)return Q;J=!0;try{let G=($.stack+"").split(`
|
|
223
|
-
`);G.splice(1,1);let W=
|
|
224
|
-
`),"")}catch{}return{id:"",pluginName:J,text:G,location:W,notes:Q?[Q]:[],detail:X?X.store($):-1}}function
|
|
219
|
+
`);function hY($,Z){return($[Z++]|$[Z++]<<8|$[Z++]<<16|$[Z++]<<24)>>>0}function ZX($,Z,X){$[X++]=Z,$[X++]=Z>>8,$[X++]=Z>>16,$[X++]=Z>>24}var a1=String.fromCharCode;function e$($,Z,X){let Q=$[Z],J=1,G=0;for(let W=0;W<Z;W++)if($[W]===10)J++,G=0;else G++;throw SyntaxError(X?X:Z===$.length?"Unexpected end of input while parsing JSON":Q>=32&&Q<=126?`Unexpected character ${a1(Q)} in JSON at position ${Z} (line ${J}, column ${G})`:`Unexpected byte 0x${Q.toString(16)} in JSON at position ${Z} (line ${J}, column ${G})`)}function XN($){if(!($ instanceof Uint8Array))throw Error("JSON input must be a Uint8Array");let Z=[],X=[],Q=[],J=$.length,G=null,W=0,Y,z=0;while(z<J){let q=$[z++];if(q<=32)continue;let H;if(W===2&&G===null&&q!==34&&q!==125)e$($,--z);switch(q){case 116:{if($[z++]!==114||$[z++]!==117||$[z++]!==101)e$($,--z);H=!0;break}case 102:{if($[z++]!==97||$[z++]!==108||$[z++]!==115||$[z++]!==101)e$($,--z);H=!1;break}case 110:{if($[z++]!==117||$[z++]!==108||$[z++]!==108)e$($,--z);H=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 B=z;H=a1(q),q=$[z];while(!0){switch(q){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:{H+=a1(q),q=$[++z];continue}}break}if(H=+H,isNaN(H))e$($,--B,"Invalid number");break}case 34:{H="";while(!0){if(z>=J)e$($,J);if(q=$[z++],q===34)break;else if(q===92)switch($[z++]){case 34:H+='"';break;case 47:H+="/";break;case 92:H+="\\";break;case 98:H+="\b";break;case 102:H+="\f";break;case 110:H+=`
|
|
220
|
+
`;break;case 114:H+="\r";break;case 116:H+="\t";break;case 117:{let B=0;for(let F=0;F<4;F++)if(q=$[z++],B<<=4,q>=48&&q<=57)B|=q-48;else if(q>=97&&q<=102)B|=q+-87;else if(q>=65&&q<=70)B|=q+-55;else e$($,--z);H+=a1(B);break}default:e$($,--z);break}else if(q<=127)H+=a1(q);else if((q&224)===192)H+=a1((q&31)<<6|$[z++]&63);else if((q&240)===224)H+=a1((q&15)<<12|($[z++]&63)<<6|$[z++]&63);else if((q&248)==240){let B=(q&7)<<18|($[z++]&63)<<12|($[z++]&63)<<6|$[z++]&63;if(B>65535)B-=65536,H+=a1(B>>10&1023|55296),B=56320|B&1023;H+=a1(B)}}H[0];break}case 91:{H=[],Z.push(G),X.push(Y),Q.push(W),G=null,Y=H,W=1;continue}case 123:{H={},Z.push(G),X.push(Y),Q.push(W),G=null,Y=H,W=2;continue}case 93:{if(W!==1)e$($,--z);H=Y,G=Z.pop(),Y=X.pop(),W=Q.pop();break}case 125:{if(W!==2)e$($,--z);H=Y,G=Z.pop(),Y=X.pop(),W=Q.pop();break}default:e$($,--z)}q=$[z];while(q<=32)q=$[++z];switch(W){case 0:{if(z===J)return H;break}case 1:{if(Y.push(H),q===44){z++;continue}if(q===93)continue;break}case 2:{if(G===null){if(G=H,q===58){z++;continue}}else{if(Y[G]=H,G=null,q===44){z++;continue}if(q===125)continue}break}}break}e$($,z)}var $$=JSON.stringify,CY="warning",SY="silent";function C4($,Z){let X=[];for(let Q of $){if(S$(Q,Z),Q.indexOf(",")>=0)throw Error(`Invalid ${Z}: ${Q}`);X.push(Q)}return X.join(",")}var z5=()=>null,m0=($)=>typeof $==="boolean"?null:"a boolean",H0=($)=>typeof $==="string"?null:"a string",q5=($)=>$ instanceof RegExp?null:"a RegExp object",a6=($)=>typeof $==="number"&&$===($|0)?null:"an integer",QN=($)=>typeof $==="number"&&$===($|0)&&$>=0&&$<=65535?null:"a valid port number",uY=($)=>typeof $==="function"?null:"a function",o1=($)=>Array.isArray($)?null:"an array",_$=($)=>Array.isArray($)&&$.every((Z)=>typeof Z==="string")?null:"an array of strings",p$=($)=>typeof $==="object"&&$!==null&&!Array.isArray($)?null:"an object",JN=($)=>typeof $==="object"&&$!==null?null:"an array or an object",GN=($)=>$ instanceof WebAssembly.Module?null:"a WebAssembly.Module",_Y=($)=>typeof $==="object"&&!Array.isArray($)?null:"an object or null",mY=($)=>typeof $==="string"||typeof $==="boolean"?null:"a string or a boolean",WN=($)=>typeof $==="string"||typeof $==="object"&&$!==null&&!Array.isArray($)?null:"a string or an object",dY=($)=>typeof $==="string"||Array.isArray($)&&$.every((Z)=>typeof Z==="string")?null:"a string or an array of strings",lY=($)=>typeof $==="string"||$ instanceof Uint8Array?null:"a string or a Uint8Array",YN=($)=>typeof $==="string"||$ instanceof URL?null:"a string or a URL";function x($,Z,X,Q){let J=$[X];if(Z[X+""]=!0,J===void 0)return;let G=Q(J);if(G!==null)throw Error(`${$$(X)} must be ${G}`);return J}function s0($,Z,X){for(let Q in $)if(!(Q in Z))throw Error(`Invalid option ${X}: ${$$(Q)}`)}function zN($){let Z=Object.create(null),X=x($,Z,"wasmURL",YN),Q=x($,Z,"wasmModule",GN),J=x($,Z,"worker",m0);return s0($,Z,"in initialize() call"),{wasmURL:X,wasmModule:Q,worker:J}}function cY($){let Z;if($!==void 0){Z=Object.create(null);for(let X in $){let Q=$[X];if(typeof Q==="string"||Q===!1)Z[X]=Q;else throw Error(`Expected ${$$(X)} in mangle cache to map to either a string or false`)}}return Z}function B5($,Z,X,Q,J){let G=x(Z,X,"color",m0),W=x(Z,X,"logLevel",H0),Y=x(Z,X,"logLimit",a6);if(G!==void 0)$.push(`--color=${G}`);else if(Q)$.push("--color=true");$.push(`--log-level=${W||J}`),$.push(`--log-limit=${Y||0}`)}function S$($,Z,X){if(typeof $!=="string")throw Error(`Expected value for ${Z}${X!==void 0?" "+$$(X):""} to be a string, got ${typeof $} instead`);return $}function pY($,Z,X){let Q=x(Z,X,"legalComments",H0),J=x(Z,X,"sourceRoot",H0),G=x(Z,X,"sourcesContent",m0),W=x(Z,X,"target",dY),Y=x(Z,X,"format",H0),z=x(Z,X,"globalName",H0),q=x(Z,X,"mangleProps",q5),H=x(Z,X,"reserveProps",q5),B=x(Z,X,"mangleQuoted",m0),F=x(Z,X,"minify",m0),L=x(Z,X,"minifySyntax",m0),w=x(Z,X,"minifyWhitespace",m0),N=x(Z,X,"minifyIdentifiers",m0),I=x(Z,X,"lineLimit",a6),T=x(Z,X,"drop",_$),E=x(Z,X,"dropLabels",_$),P=x(Z,X,"charset",H0),R=x(Z,X,"treeShaking",m0),C=x(Z,X,"ignoreAnnotations",m0),y=x(Z,X,"jsx",H0),v=x(Z,X,"jsxFactory",H0),h=x(Z,X,"jsxFragment",H0),X0=x(Z,X,"jsxImportSource",H0),r=x(Z,X,"jsxDev",m0),u=x(Z,X,"jsxSideEffects",m0),t=x(Z,X,"define",p$),Y0=x(Z,X,"logOverride",p$),G0=x(Z,X,"supported",p$),A0=x(Z,X,"pure",_$),l=x(Z,X,"keepNames",m0),K0=x(Z,X,"platform",H0),V0=x(Z,X,"tsconfigRaw",WN),o=x(Z,X,"absPaths",_$);if(Q)$.push(`--legal-comments=${Q}`);if(J!==void 0)$.push(`--source-root=${J}`);if(G!==void 0)$.push(`--sources-content=${G}`);if(W)$.push(`--target=${C4(Array.isArray(W)?W:[W],"target")}`);if(Y)$.push(`--format=${Y}`);if(z)$.push(`--global-name=${z}`);if(K0)$.push(`--platform=${K0}`);if(V0)$.push(`--tsconfig-raw=${typeof V0==="string"?V0:JSON.stringify(V0)}`);if(F)$.push("--minify");if(L)$.push("--minify-syntax");if(w)$.push("--minify-whitespace");if(N)$.push("--minify-identifiers");if(I)$.push(`--line-limit=${I}`);if(P)$.push(`--charset=${P}`);if(R!==void 0)$.push(`--tree-shaking=${R}`);if(C)$.push("--ignore-annotations");if(T)for(let f of T)$.push(`--drop:${S$(f,"drop")}`);if(E)$.push(`--drop-labels=${C4(E,"drop label")}`);if(o)$.push(`--abs-paths=${C4(o,"abs paths")}`);if(q)$.push(`--mangle-props=${K5(q)}`);if(H)$.push(`--reserve-props=${K5(H)}`);if(B!==void 0)$.push(`--mangle-quoted=${B}`);if(y)$.push(`--jsx=${y}`);if(v)$.push(`--jsx-factory=${v}`);if(h)$.push(`--jsx-fragment=${h}`);if(X0)$.push(`--jsx-import-source=${X0}`);if(r)$.push("--jsx-dev");if(u)$.push("--jsx-side-effects");if(t)for(let f in t){if(f.indexOf("=")>=0)throw Error(`Invalid define: ${f}`);$.push(`--define:${f}=${S$(t[f],"define",f)}`)}if(Y0)for(let f in Y0){if(f.indexOf("=")>=0)throw Error(`Invalid log override: ${f}`);$.push(`--log-override:${f}=${S$(Y0[f],"log override",f)}`)}if(G0)for(let f in G0){if(f.indexOf("=")>=0)throw Error(`Invalid supported: ${f}`);let Z0=G0[f];if(typeof Z0!=="boolean")throw Error(`Expected value for supported ${$$(f)} to be a boolean, got ${typeof Z0} instead`);$.push(`--supported:${f}=${Z0}`)}if(A0)for(let f of A0)$.push(`--pure:${S$(f,"pure")}`);if(l)$.push("--keep-names")}function qN($,Z,X,Q,J){var G;let W=[],Y=[],z=Object.create(null),q=null,H=null;B5(W,Z,z,X,Q),pY(W,Z,z);let B=x(Z,z,"sourcemap",mY),F=x(Z,z,"bundle",m0),L=x(Z,z,"splitting",m0),w=x(Z,z,"preserveSymlinks",m0),N=x(Z,z,"metafile",m0),I=x(Z,z,"outfile",H0),T=x(Z,z,"outdir",H0),E=x(Z,z,"outbase",H0),P=x(Z,z,"tsconfig",H0),R=x(Z,z,"resolveExtensions",_$),C=x(Z,z,"nodePaths",_$),y=x(Z,z,"mainFields",_$),v=x(Z,z,"conditions",_$),h=x(Z,z,"external",_$),X0=x(Z,z,"packages",H0),r=x(Z,z,"alias",p$),u=x(Z,z,"loader",p$),t=x(Z,z,"outExtension",p$),Y0=x(Z,z,"publicPath",H0),G0=x(Z,z,"entryNames",H0),A0=x(Z,z,"chunkNames",H0),l=x(Z,z,"assetNames",H0),K0=x(Z,z,"inject",_$),V0=x(Z,z,"banner",p$),o=x(Z,z,"footer",p$),f=x(Z,z,"entryPoints",JN),Z0=x(Z,z,"absWorkingDir",H0),J0=x(Z,z,"stdin",p$),$0=(G=x(Z,z,"write",m0))!=null?G:J,F0=x(Z,z,"allowOverwrite",m0),U0=x(Z,z,"mangleCache",p$);if(z.plugins=!0,s0(Z,z,`in ${$}() call`),B)W.push(`--sourcemap${B===!0?"":`=${B}`}`);if(F)W.push("--bundle");if(F0)W.push("--allow-overwrite");if(L)W.push("--splitting");if(w)W.push("--preserve-symlinks");if(N)W.push("--metafile");if(I)W.push(`--outfile=${I}`);if(T)W.push(`--outdir=${T}`);if(E)W.push(`--outbase=${E}`);if(P)W.push(`--tsconfig=${P}`);if(X0)W.push(`--packages=${X0}`);if(R)W.push(`--resolve-extensions=${C4(R,"resolve extension")}`);if(Y0)W.push(`--public-path=${Y0}`);if(G0)W.push(`--entry-names=${G0}`);if(A0)W.push(`--chunk-names=${A0}`);if(l)W.push(`--asset-names=${l}`);if(y)W.push(`--main-fields=${C4(y,"main field")}`);if(v)W.push(`--conditions=${C4(v,"condition")}`);if(h)for(let e of h)W.push(`--external:${S$(e,"external")}`);if(r)for(let e in r){if(e.indexOf("=")>=0)throw Error(`Invalid package name in alias: ${e}`);W.push(`--alias:${e}=${S$(r[e],"alias",e)}`)}if(V0)for(let e in V0){if(e.indexOf("=")>=0)throw Error(`Invalid banner file type: ${e}`);W.push(`--banner:${e}=${S$(V0[e],"banner",e)}`)}if(o)for(let e in o){if(e.indexOf("=")>=0)throw Error(`Invalid footer file type: ${e}`);W.push(`--footer:${e}=${S$(o[e],"footer",e)}`)}if(K0)for(let e of K0)W.push(`--inject:${S$(e,"inject")}`);if(u)for(let e in u){if(e.indexOf("=")>=0)throw Error(`Invalid loader extension: ${e}`);W.push(`--loader:${e}=${S$(u[e],"loader",e)}`)}if(t)for(let e in t){if(e.indexOf("=")>=0)throw Error(`Invalid out extension: ${e}`);W.push(`--out-extension:${e}=${S$(t[e],"out extension",e)}`)}if(f)if(Array.isArray(f))for(let e=0,d0=f.length;e<d0;e++){let R0=f[e];if(typeof R0==="object"&&R0!==null){let p0=Object.create(null),v0=x(R0,p0,"in",H0),i0=x(R0,p0,"out",H0);if(s0(R0,p0,"in entry point at index "+e),v0===void 0)throw Error('Missing property "in" for entry point at index '+e);if(i0===void 0)throw Error('Missing property "out" for entry point at index '+e);Y.push([i0,v0])}else Y.push(["",S$(R0,"entry point at index "+e)])}else for(let e in f)Y.push([e,S$(f[e],"entry point",e)]);if(J0){let e=Object.create(null),d0=x(J0,e,"contents",lY),R0=x(J0,e,"resolveDir",H0),p0=x(J0,e,"sourcefile",H0),v0=x(J0,e,"loader",H0);if(s0(J0,e,'in "stdin" object'),p0)W.push(`--sourcefile=${p0}`);if(v0)W.push(`--loader=${v0}`);if(R0)H=R0;if(typeof d0==="string")q=q1(d0);else if(d0 instanceof Uint8Array)q=d0}let D0=[];if(C)for(let e of C)e+="",D0.push(e);return{entries:Y,flags:W,write:$0,stdinContents:q,stdinResolveDir:H,absWorkingDir:Z0,nodePaths:D0,mangleCache:cY(U0)}}function KN($,Z,X,Q){let J=[],G=Object.create(null);B5(J,Z,G,X,Q),pY(J,Z,G);let W=x(Z,G,"sourcemap",mY),Y=x(Z,G,"sourcefile",H0),z=x(Z,G,"loader",H0),q=x(Z,G,"banner",H0),H=x(Z,G,"footer",H0),B=x(Z,G,"mangleCache",p$);if(s0(Z,G,`in ${$}() call`),W)J.push(`--sourcemap=${W===!0?"external":W}`);if(Y)J.push(`--sourcefile=${Y}`);if(z)J.push(`--loader=${z}`);if(q)J.push(`--banner=${q}`);if(H)J.push(`--footer=${H}`);return{flags:J,mangleCache:cY(B)}}function iY($){let Z={},X={didClose:!1,reason:""},Q={},J=0,G=0,W=new Uint8Array(16384),Y=0,z=(P)=>{let R=Y+P.length;if(R>W.length){let y=new Uint8Array(R*2);y.set(W),W=y}W.set(P,Y),Y+=P.length;let C=0;while(C+4<=Y){let y=hY(W,C);if(C+4+y>Y)break;C+=4,w(W.subarray(C,C+y)),C+=y}if(C>0)W.copyWithin(0,C,Y),Y-=C},q=(P)=>{if(X.didClose=!0,P)X.reason=": "+(P.message||P);let R="The service was stopped"+X.reason;for(let C in Q)Q[C](R,null);Q={}},H=(P,R,C)=>{if(X.didClose)return C("The service is no longer running"+X.reason,null);let y=J++;if(Q[y]=(v,h)=>{try{C(v,h)}finally{if(P)P.unref()}},P)P.ref();$.writeToStdin(PY({id:y,isRequest:!0,value:R}))},B=(P,R)=>{if(X.didClose)throw Error("The service is no longer running"+X.reason);$.writeToStdin(PY({id:P,isRequest:!1,value:R}))},F=async(P,R)=>{try{if(R.command==="ping"){B(P,{});return}if(typeof R.key==="number"){let C=Z[R.key];if(!C)return;let y=C[R.command];if(y){await y(P,R);return}}throw Error("Invalid command: "+R.command)}catch(C){let y=[r6(C,$,null,void 0,"")];try{B(P,{errors:y})}catch{}}},L=!0,w=(P)=>{if(L){L=!1;let C=String.fromCharCode(...P);if(C!=="0.28.1")throw Error(`Cannot start service: Host version "0.28.1" does not match binary version ${$$(C)}`);return}let R=ZN(P);if(R.isRequest)F(R.id,R.value);else{let C=Q[R.id];if(delete Q[R.id],R.value.error)C(R.value.error,{});else C(null,R.value)}};return{readFromStdout:z,afterClose:q,service:{buildOrContext:({callName:P,refs:R,options:C,isTTY:y,defaultWD:v,callback:h})=>{let X0=0,r=G++,u={},t={ref(){if(++X0===1){if(R)R.ref()}},unref(){if(--X0===0){if(delete Z[r],R)R.unref()}}};Z[r]=u,t.ref(),UN(P,r,H,B,t,$,u,C,y,v,(Y0,G0)=>{try{h(Y0,G0)}finally{t.unref()}})},transform:({callName:P,refs:R,input:C,options:y,isTTY:v,fs:h,callback:X0})=>{let r=nY(),u=(t)=>{try{if(typeof C!=="string"&&!(C instanceof Uint8Array))throw Error('The input to "transform" must be a string or a Uint8Array');let{flags:Y0,mangleCache:G0}=KN(P,y,v,SY),A0={command:"transform",flags:Y0,inputFS:t!==null,input:t!==null?q1(t):typeof C==="string"?q1(C):C};if(G0)A0.mangleCache=G0;H(R,A0,(l,K0)=>{if(l)return X0(Error(l),null);let V0=S4(K0.errors,r),o=S4(K0.warnings,r),f=1,Z0=()=>{if(--f===0){let J0={warnings:o,code:K0.code,map:K0.map,mangleCache:void 0,legalComments:void 0};if("legalComments"in K0)J0.legalComments=K0==null?void 0:K0.legalComments;if(K0.mangleCache)J0.mangleCache=K0==null?void 0:K0.mangleCache;X0(null,J0)}};if(V0.length>0)return X0(C9("Transform failed",V0,o),null);if(K0.codeFS)f++,h.readFile(K0.code,(J0,$0)=>{if(J0!==null)X0(J0,null);else K0.code=$0,Z0()});if(K0.mapFS)f++,h.readFile(K0.map,(J0,$0)=>{if(J0!==null)X0(J0,null);else K0.map=$0,Z0()});Z0()})}catch(Y0){let G0=[];try{B5(G0,y,{},v,SY)}catch{}let A0=r6(Y0,$,r,void 0,"");H(R,{command:"error",flags:G0,error:A0},()=>{A0.detail=r.load(A0.detail),X0(C9("Transform failed",[A0],[]),null)})}};if((typeof C==="string"||C instanceof Uint8Array)&&C.length>1048576){let t=u;u=()=>h.writeFile(C,t)}u(null)},formatMessages:({callName:P,refs:R,messages:C,options:y,callback:v})=>{if(!y)throw Error(`Missing second argument in ${P}() call`);let h={},X0=x(y,h,"kind",H0),r=x(y,h,"color",m0),u=x(y,h,"terminalWidth",a6);if(s0(y,h,`in ${P}() call`),X0===void 0)throw Error(`Missing "kind" in ${P}() call`);if(X0!=="error"&&X0!=="warning")throw Error(`Expected "kind" to be "error" or "warning" in ${P}() call`);let t={command:"format-msgs",messages:s1(C,"messages",null,"",u),isWarning:X0==="warning"};if(r!==void 0)t.color=r;if(u!==void 0)t.terminalWidth=u;H(R,t,(Y0,G0)=>{if(Y0)return v(Error(Y0),null);v(null,G0.messages)})},analyzeMetafile:({callName:P,refs:R,metafile:C,options:y,callback:v})=>{if(y===void 0)y={};let h={},X0=x(y,h,"color",m0),r=x(y,h,"verbose",m0);s0(y,h,`in ${P}() call`);let u={command:"analyze-metafile",metafile:C};if(X0!==void 0)u.color=X0;if(r!==void 0)u.verbose=r;H(R,u,(t,Y0)=>{if(t)return v(Error(t),null);v(null,Y0.result)})}}}}function UN($,Z,X,Q,J,G,W,Y,z,q,H){let B=nY(),F=$==="context",L=(I,T)=>{let E=[];try{B5(E,Y,{},z,CY)}catch{}let P=r6(I,G,B,void 0,T);X(J,{command:"error",flags:E,error:P},()=>{P.detail=B.load(P.detail),H(C9(F?"Context failed":"Build failed",[P],[]),null)})},w;if(typeof Y==="object"){let I=Y.plugins;if(I!==void 0){if(!Array.isArray(I))return L(Error('"plugins" must be an array'),"");w=I}}if(w&&w.length>0){if(G.isSync)return L(Error("Cannot use plugins in synchronous API calls"),"");HN(Z,X,Q,J,G,W,Y,w,B).then((I)=>{if(!I.ok)return L(I.error,I.pluginName);try{N(I.requestPlugins,I.runOnEndCallbacks,I.scheduleOnDisposeCallbacks)}catch(T){L(T,"")}},(I)=>L(I,""));return}try{N(null,(I,T)=>T([],[]),()=>{})}catch(I){L(I,"")}function N(I,T,E){let P=G.hasFS,{entries:R,flags:C,write:y,stdinContents:v,stdinResolveDir:h,absWorkingDir:X0,nodePaths:r,mangleCache:u}=qN($,Y,z,CY,P);if(y&&!G.hasFS)throw Error('The "write" option is unavailable in this environment');let t={command:"build",key:Z,entries:R,flags:C,write:y,stdinContents:v,stdinResolveDir:h,absWorkingDir:X0||q,nodePaths:r,context:F};if(I)t.plugins=I;if(u)t.mangleCache=u;let Y0=(l,K0)=>{let V0={errors:S4(l.errors,B),warnings:S4(l.warnings,B),outputFiles:void 0,metafile:void 0,mangleCache:void 0},o=V0.errors.slice(),f=V0.warnings.slice();if(l.outputFiles)V0.outputFiles=l.outputFiles.map(BN);if(l.metafile&&l.metafile.length)V0.metafile=FN(l.metafile);if(l.mangleCache)V0.mangleCache=l.mangleCache;if(l.writeToStdout!==void 0)console.log(t6(l.writeToStdout).replace(/\n$/,""));T(V0,(Z0,J0)=>{if(o.length>0||Z0.length>0){let $0=C9("Build failed",o.concat(Z0),f.concat(J0));return K0($0,null,Z0,J0)}K0(null,V0,Z0,J0)})},G0,A0;if(F)W["on-end"]=(l,K0)=>new Promise((V0)=>{Y0(K0,(o,f,Z0,J0)=>{let $0={errors:Z0,warnings:J0};if(A0)A0(o,f);G0=void 0,A0=void 0,Q(l,$0),V0()})});X(J,t,(l,K0)=>{if(l)return H(Error(l),null);if(!F)return Y0(K0,(f,Z0)=>{return E(),H(f,Z0)});if(K0.errors.length>0)return H(C9("Context failed",K0.errors,K0.warnings),null);let V0=!1,o={rebuild:()=>{if(!G0)G0=new Promise((f,Z0)=>{let J0;A0=(F0,U0)=>{if(!J0)J0=()=>F0?Z0(F0):f(U0)};let $0=()=>{X(J,{command:"rebuild",key:Z},(U0,D0)=>{if(U0)Z0(Error(U0));else if(J0)J0();else $0()})};$0()});return G0},watch:(f={})=>new Promise((Z0,J0)=>{if(!G.hasFS)throw Error('Cannot use the "watch" API in this environment');let $0={},F0=x(f,$0,"delay",a6);s0(f,$0,"in watch() call");let U0={command:"watch",key:Z};if(F0)U0.delay=F0;X(J,U0,(D0)=>{if(D0)J0(Error(D0));else Z0(void 0)})}),serve:(f={})=>new Promise((Z0,J0)=>{if(!G.hasFS)throw Error('Cannot use the "serve" API in this environment');let $0={},F0=x(f,$0,"port",QN),U0=x(f,$0,"host",H0),D0=x(f,$0,"servedir",H0),e=x(f,$0,"keyfile",H0),d0=x(f,$0,"certfile",H0),R0=x(f,$0,"fallback",H0),p0=x(f,$0,"cors",p$),v0=x(f,$0,"onRequest",uY);s0(f,$0,"in serve() call");let i0={command:"serve",key:Z,onRequest:!!v0};if(F0!==void 0)i0.port=F0;if(U0!==void 0)i0.host=U0;if(D0!==void 0)i0.servedir=D0;if(e!==void 0)i0.keyfile=e;if(d0!==void 0)i0.certfile=d0;if(R0!==void 0)i0.fallback=R0;if(p0){let O$={},q$=x(p0,O$,"origin",dY);if(s0(p0,O$,'on "cors" object'),Array.isArray(q$))i0.corsOrigin=q$;else if(q$!==void 0)i0.corsOrigin=[q$]}X(J,i0,(O$,q$)=>{if(O$)return J0(Error(O$));if(v0)W["serve-request"]=(M1,A1)=>{v0(A1.args),Q(M1,{})};Z0(q$)})}),cancel:()=>new Promise((f)=>{if(V0)return f();X(J,{command:"cancel",key:Z},()=>{f()})}),dispose:()=>new Promise((f)=>{if(V0)return f();V0=!0,X(J,{command:"dispose",key:Z},()=>{f(),E(),J.unref()})})};J.ref(),H(null,o)})}}var HN=async($,Z,X,Q,J,G,W,Y,z)=>{let q=[],H=[],B={},F={},L=[],w=0,N=0,I=[],T=!1;Y=[...Y];for(let R of Y){let C={};if(typeof R!=="object")throw Error(`Plugin at index ${N} must be an object`);let y=x(R,C,"name",H0);if(typeof y!=="string"||y==="")throw Error(`Plugin at index ${N} is missing a name`);try{let v=x(R,C,"setup",uY);if(typeof v!=="function")throw Error("Plugin is missing a setup function");s0(R,C,`on plugin ${$$(y)}`);let h={name:y,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};N++;let r=v({initialOptions:W,resolve:(u,t={})=>{if(!T)throw Error('Cannot call "resolve" before plugin setup has completed');if(typeof u!=="string")throw Error("The path to resolve must be a string");let Y0=Object.create(null),G0=x(t,Y0,"pluginName",H0),A0=x(t,Y0,"importer",H0),l=x(t,Y0,"namespace",H0),K0=x(t,Y0,"resolveDir",H0),V0=x(t,Y0,"kind",H0),o=x(t,Y0,"pluginData",z5),f=x(t,Y0,"with",p$);return s0(t,Y0,"in resolve() call"),new Promise((Z0,J0)=>{let $0={command:"resolve",path:u,key:$,pluginName:y};if(G0!=null)$0.pluginName=G0;if(A0!=null)$0.importer=A0;if(l!=null)$0.namespace=l;if(K0!=null)$0.resolveDir=K0;if(V0!=null)$0.kind=V0;else throw Error('Must specify "kind" when calling "resolve"');if(o!=null)$0.pluginData=z.store(o);if(f!=null)$0.with=VN(f,"with");Z(Q,$0,(F0,U0)=>{if(F0!==null)J0(Error(F0));else Z0({errors:S4(U0.errors,z),warnings:S4(U0.warnings,z),path:U0.path,external:U0.external,sideEffects:U0.sideEffects,namespace:U0.namespace,suffix:U0.suffix,pluginData:z.load(U0.pluginData)})})})},onStart(u){let Y0=W5(Error('This error came from the "onStart" callback registered here:'),J,"onStart");q.push({name:y,callback:u,note:Y0}),h.onStart=!0},onEnd(u){let Y0=W5(Error('This error came from the "onEnd" callback registered here:'),J,"onEnd");H.push({name:y,callback:u,note:Y0}),h.onEnd=!0},onResolve(u,t){let G0=W5(Error('This error came from the "onResolve" callback registered here:'),J,"onResolve"),A0={},l=x(u,A0,"filter",q5),K0=x(u,A0,"namespace",H0);if(s0(u,A0,`in onResolve() call for plugin ${$$(y)}`),l==null)throw Error("onResolve() call is missing a filter");let V0=w++;B[V0]={name:y,callback:t,note:G0},h.onResolve.push({id:V0,filter:K5(l),namespace:K0||""})},onLoad(u,t){let G0=W5(Error('This error came from the "onLoad" callback registered here:'),J,"onLoad"),A0={},l=x(u,A0,"filter",q5),K0=x(u,A0,"namespace",H0);if(s0(u,A0,`in onLoad() call for plugin ${$$(y)}`),l==null)throw Error("onLoad() call is missing a filter");let V0=w++;F[V0]={name:y,callback:t,note:G0},h.onLoad.push({id:V0,filter:K5(l),namespace:K0||""})},onDispose(u){L.push(u)},esbuild:J.esbuild});if(r)await r;I.push(h)}catch(v){return{ok:!1,error:v,pluginName:y}}}G["on-start"]=async(R,C)=>{z.clear();let y={errors:[],warnings:[]};await Promise.all(q.map(async({name:v,callback:h,note:X0})=>{try{let r=await h();if(r!=null){if(typeof r!=="object")throw Error(`Expected onStart() callback in plugin ${$$(v)} to return an object`);let u={},t=x(r,u,"errors",o1),Y0=x(r,u,"warnings",o1);if(s0(r,u,`from onStart() callback in plugin ${$$(v)}`),t!=null)y.errors.push(...s1(t,"errors",z,v,void 0));if(Y0!=null)y.warnings.push(...s1(Y0,"warnings",z,v,void 0))}}catch(r){y.errors.push(r6(r,J,z,X0&&X0(),v))}})),X(R,y)},G["on-resolve"]=async(R,C)=>{let y={},v="",h,X0;for(let r of C.ids)try{({name:v,callback:h,note:X0}=B[r]);let u=await h({path:C.path,importer:C.importer,namespace:C.namespace,resolveDir:C.resolveDir,kind:C.kind,pluginData:z.load(C.pluginData),with:C.with});if(u!=null){if(typeof u!=="object")throw Error(`Expected onResolve() callback in plugin ${$$(v)} to return an object`);let t={},Y0=x(u,t,"pluginName",H0),G0=x(u,t,"path",H0),A0=x(u,t,"namespace",H0),l=x(u,t,"suffix",H0),K0=x(u,t,"external",m0),V0=x(u,t,"sideEffects",m0),o=x(u,t,"pluginData",z5),f=x(u,t,"errors",o1),Z0=x(u,t,"warnings",o1),J0=x(u,t,"watchFiles",_$),$0=x(u,t,"watchDirs",_$);if(s0(u,t,`from onResolve() callback in plugin ${$$(v)}`),y.id=r,Y0!=null)y.pluginName=Y0;if(G0!=null)y.path=G0;if(A0!=null)y.namespace=A0;if(l!=null)y.suffix=l;if(K0!=null)y.external=K0;if(V0!=null)y.sideEffects=V0;if(o!=null)y.pluginData=z.store(o);if(f!=null)y.errors=s1(f,"errors",z,v,void 0);if(Z0!=null)y.warnings=s1(Z0,"warnings",z,v,void 0);if(J0!=null)y.watchFiles=Y5(J0,"watchFiles");if($0!=null)y.watchDirs=Y5($0,"watchDirs");break}}catch(u){y={id:r,errors:[r6(u,J,z,X0&&X0(),v)]};break}X(R,y)},G["on-load"]=async(R,C)=>{let y={},v="",h,X0;for(let r of C.ids)try{({name:v,callback:h,note:X0}=F[r]);let u=await h({path:C.path,namespace:C.namespace,suffix:C.suffix,pluginData:z.load(C.pluginData),with:C.with});if(u!=null){if(typeof u!=="object")throw Error(`Expected onLoad() callback in plugin ${$$(v)} to return an object`);let t={},Y0=x(u,t,"pluginName",H0),G0=x(u,t,"contents",lY),A0=x(u,t,"resolveDir",H0),l=x(u,t,"pluginData",z5),K0=x(u,t,"loader",H0),V0=x(u,t,"errors",o1),o=x(u,t,"warnings",o1),f=x(u,t,"watchFiles",_$),Z0=x(u,t,"watchDirs",_$);if(s0(u,t,`from onLoad() callback in plugin ${$$(v)}`),y.id=r,Y0!=null)y.pluginName=Y0;if(G0 instanceof Uint8Array)y.contents=G0;else if(G0!=null)y.contents=q1(G0);if(A0!=null)y.resolveDir=A0;if(l!=null)y.pluginData=z.store(l);if(K0!=null)y.loader=K0;if(V0!=null)y.errors=s1(V0,"errors",z,v,void 0);if(o!=null)y.warnings=s1(o,"warnings",z,v,void 0);if(f!=null)y.watchFiles=Y5(f,"watchFiles");if(Z0!=null)y.watchDirs=Y5(Z0,"watchDirs");break}}catch(u){y={id:r,errors:[r6(u,J,z,X0&&X0(),v)]};break}X(R,y)};let E=(R,C)=>C([],[]);if(H.length>0)E=(R,C)=>{(async()=>{let y=[],v=[];for(let{name:h,callback:X0,note:r}of H){let u,t;try{let Y0=await X0(R);if(Y0!=null){if(typeof Y0!=="object")throw Error(`Expected onEnd() callback in plugin ${$$(h)} to return an object`);let G0={},A0=x(Y0,G0,"errors",o1),l=x(Y0,G0,"warnings",o1);if(s0(Y0,G0,`from onEnd() callback in plugin ${$$(h)}`),A0!=null)u=s1(A0,"errors",z,h,void 0);if(l!=null)t=s1(l,"warnings",z,h,void 0)}}catch(Y0){u=[r6(Y0,J,z,r&&r(),h)]}if(u){y.push(...u);try{R.errors.push(...u)}catch{}}if(t){v.push(...t);try{R.warnings.push(...t)}catch{}}}C(y,v)})()};let P=()=>{for(let R of L)setTimeout(()=>R(),0)};return T=!0,{ok:!0,requestPlugins:I,runOnEndCallbacks:E,scheduleOnDisposeCallbacks:P}};function nY(){let $=new Map,Z=0;return{clear(){$.clear()},load(X){return $.get(X)},store(X){if(X===void 0)return-1;let Q=Z++;return $.set(Q,X),Q}}}function W5($,Z,X){let Q,J=!1;return()=>{if(J)return Q;J=!0;try{let G=($.stack+"").split(`
|
|
221
|
+
`);G.splice(1,1);let W=rY(Z,G,X);if(W)return Q={text:$.message,location:W},Q}catch{}}}function r6($,Z,X,Q,J){let G="Internal error",W=null;try{G=($&&$.message||$)+""}catch{}try{W=rY(Z,($.stack+"").split(`
|
|
222
|
+
`),"")}catch{}return{id:"",pluginName:J,text:G,location:W,notes:Q?[Q]:[],detail:X?X.store($):-1}}function rY($,Z,X){let Q=" at ";if($.readFileSync&&!Z[0].startsWith(Q)&&Z[1].startsWith(Q))for(let J=1;J<Z.length;J++){let G=Z[J];if(!G.startsWith(Q))continue;G=G.slice(Q.length);while(!0){let W=/^(?:new |async )?\S+ \((.*)\)$/.exec(G);if(W){G=W[1];continue}if(W=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(G),W){G=W[1];continue}if(W=/^(\S+):(\d+):(\d+)$/.exec(G),W){let Y;try{Y=$.readFileSync(W[1],"utf8")}catch{break}let z=Y.split(/\r\n|\r|\n|\u2028|\u2029/)[+W[2]-1]||"",q=+W[3]-1,H=z.slice(q,q+X.length)===X?X.length:0;return{file:W[1],namespace:"file",line:+W[2],column:q1(z.slice(0,q)).length,length:q1(z.slice(q,q+H)).length,lineText:z+`
|
|
225
223
|
`+Z.slice(1).join(`
|
|
226
|
-
`),suggestion:""}}break}}return null}function
|
|
224
|
+
`),suggestion:""}}break}}return null}function C9($,Z,X){let Q=5;$+=Z.length<1?"":` with ${Z.length} error${Z.length<2?"":"s"}:`+Z.slice(0,Q+1).map((G,W)=>{if(W===Q)return`
|
|
227
225
|
...`;if(!G.location)return`
|
|
228
226
|
error: ${G.text}`;let{file:Y,line:z,column:q}=G.location,H=G.pluginName?`[plugin: ${G.pluginName}] `:"";return`
|
|
229
|
-
${Y}:${z}:${q}: ERROR: ${H}${G.text}`}).join("");let J=Error($);for(let[G,W]of[["errors",Z],["warnings",X]])Object.defineProperty(J,G,{configurable:!0,enumerable:!0,get:()=>W,set:(Y)=>Object.defineProperty(J,G,{configurable:!0,enumerable:!0,value:Y})});return J}function
|
|
227
|
+
${Y}:${z}:${q}: ERROR: ${H}${G.text}`}).join("");let J=Error($);for(let[G,W]of[["errors",Z],["warnings",X]])Object.defineProperty(J,G,{configurable:!0,enumerable:!0,get:()=>W,set:(Y)=>Object.defineProperty(J,G,{configurable:!0,enumerable:!0,value:Y})});return J}function S4($,Z){for(let X of $)X.detail=Z.load(X.detail);return $}function bY($,Z,X){if($==null)return null;let Q={},J=x($,Q,"file",H0),G=x($,Q,"namespace",H0),W=x($,Q,"line",a6),Y=x($,Q,"column",a6),z=x($,Q,"length",a6),q=x($,Q,"lineText",H0),H=x($,Q,"suggestion",H0);if(s0($,Q,Z),q){let B=q.slice(0,(Y&&Y>0?Y:0)+(z&&z>0?z:0)+(X&&X>0?X:80));if(!/[\x7F-\uFFFF]/.test(B)&&!/\n/.test(q))q=B}return{file:J||"",namespace:G||"",line:W||0,column:Y||0,length:z||0,lineText:q||"",suggestion:H||""}}function s1($,Z,X,Q,J){let G=[],W=0;for(let Y of $){let z={},q=x(Y,z,"id",H0),H=x(Y,z,"pluginName",H0),B=x(Y,z,"text",H0),F=x(Y,z,"location",_Y),L=x(Y,z,"notes",o1),w=x(Y,z,"detail",z5),N=`in element ${W} of "${Z}"`;s0(Y,z,N);let I=[];if(L)for(let T of L){let E={},P=x(T,E,"text",H0),R=x(T,E,"location",_Y);s0(T,E,N),I.push({text:P||"",location:bY(R,N,J)})}G.push({id:q||"",pluginName:H||Q,text:B||"",location:bY(F,N,J),notes:I,detail:X?X.store(w):-1}),W++}return G}function Y5($,Z){let X=[];for(let Q of $){if(typeof Q!=="string")throw Error(`${$$(Z)} must be an array of strings`);X.push(Q)}return X}function VN($,Z){let X=Object.create(null);for(let Q in $){let J=$[Q];if(typeof J!=="string")throw Error(`key ${$$(Q)} in object ${$$(Z)} must be a string`);X[Q]=J}return X}function BN({path:$,contents:Z,hash:X}){let Q=null;return{path:$,contents:Z,hash:X,get text(){let J=this.contents;if(Q===null||J!==Z)Z=J,Q=t6(J);return Q}}}function K5($){let Z=$.source;if($.flags)Z=`(?${$.flags})${Z}`;return Z}function FN($){let Z;try{Z=t6($)}catch{return XN($)}return JSON.parse(Z)}var j6=O0("fs"),xY=O0("os"),$1=O0("path"),P4=process.env.ESBUILD_BINARY_PATH||P4,LN=($)=>!!$&&$!=="/usr/bin/esbuild",kY="@esbuild/darwin-arm64",yY="@esbuild/darwin-x64",U5={"win32 arm64 LE":"@esbuild/win32-arm64","win32 ia32 LE":"@esbuild/win32-ia32","win32 x64 LE":"@esbuild/win32-x64"},H5={"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"},vY={"android arm LE":"@esbuild/android-arm","android x64 LE":"@esbuild/android-x64","openharmony arm64 LE":"@esbuild/openharmony-arm64"};function MN(){let $,Z,X=!1,Q=`${process.platform} ${xY.arch()} ${xY.endianness()}`;if(Q in U5)$=U5[Q],Z="esbuild.exe";else if(Q in H5)$=H5[Q],Z="bin/esbuild";else if(Q in vY)$=vY[Q],Z="bin/esbuild",X=!0;else throw Error(`Unsupported platform: ${Q}`);return{pkg:$,subpath:Z,isWASM:X}}function AN(){let $=O0.resolve("esbuild"),Z=$1.dirname($1.dirname($1.dirname($)));if($1.basename(Z)==="node_modules"){for(let X in H5)try{let Q=H5[X];if(j6.existsSync($1.join(Z,Q)))return Q}catch{}for(let X in U5)try{let Q=U5[X];if(j6.existsSync($1.join(Z,Q)))return Q}catch{}}return null}function IN($,Z){let X=$1.dirname(O0.resolve("esbuild"));return $1.join(X,`downloaded-${$.replace("/","-")}-${$1.basename(Z)}`)}function NN(){if(LN(P4))if(!j6.existsSync(P4))console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${P4}`);else return{binPath:P4,isWASM:!1};let{pkg:$,subpath:Z,isWASM:X}=MN(),Q;try{Q=O0.resolve(`${$}/${Z}`)}catch(J){if(Q=IN($,Z),!j6.existsSync(Q)){try{O0.resolve($)}catch{let G=AN();if(G){let W=`
|
|
230
228
|
Specifically the "${G}" package is present but this platform
|
|
231
229
|
needs the "${$}" package instead. People often get into this
|
|
232
230
|
situation by installing esbuild on Windows or macOS and copying "node_modules"
|
|
@@ -243,7 +241,7 @@ If you are installing with yarn, you can try listing both this platform and the
|
|
|
243
241
|
other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
|
|
244
242
|
feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
|
|
245
243
|
Keep in mind that this means multiple copies of esbuild will be present.
|
|
246
|
-
`;if($===
|
|
244
|
+
`;if($===yY&&G===kY||$===kY&&G===yY)W=`
|
|
247
245
|
Specifically the "${G}" package is present but this platform
|
|
248
246
|
needs the "${$}" package instead. People often get into this
|
|
249
247
|
situation by installing esbuild with npm running inside of Rosetta 2 and then
|
|
@@ -275,125 +273,126 @@ want to do that.
|
|
|
275
273
|
If you are installing esbuild with npm, make sure that you don't specify the
|
|
276
274
|
"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
|
|
277
275
|
of "package.json" is used by esbuild to install the correct binary executable
|
|
278
|
-
for your current platform.`)}throw J}}if(/\.zip\//.test(Q)){let J;try{J=(()=>{throw new Error("Cannot require module "+"pnpapi");})()}catch(G){}if(J){let G=J.getPackageInformation(J.topLevel).packageLocation,W
|
|
276
|
+
for your current platform.`)}throw J}}if(/\.zip\//.test(Q)){let J;try{J=(()=>{throw new Error("Cannot require module "+"pnpapi");})()}catch(G){}if(J){let G=J.getPackageInformation(J.topLevel).packageLocation,W=$1.join(G,"node_modules",".cache","esbuild",`pnpapi-${$.replace("/","-")}-0.28.1-${$1.basename(Z)}`);if(!j6.existsSync(W))j6.mkdirSync($1.dirname(W),{recursive:!0}),j6.copyFileSync(Q,W),j6.chmodSync(W,493);return{binPath:W,isWASM:X}}}return{binPath:Q,isWASM:X}}var aY=O0("child_process"),DN=O0("crypto"),XX=O0("path"),o6=O0("fs"),wN=O0("os"),TN=O0("tty"),N$;if(process.env.ESBUILD_WORKER_THREADS!=="0"){try{N$=O0("worker_threads")}catch{}let[$,Z]=process.versions.node.split(".");if(+$<12||+$===12&&+Z<17||+$===13&&+Z<13)N$=void 0}var gY,b9=((gY=N$==null?void 0:N$.workerData)==null?void 0:gY.esbuildVersion)==="0.28.1",oY=()=>{if((!P4||!1)&&(XX.basename(__filename)!=="main.js"||XX.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
277
|
|
|
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:$,isWASM:Z}=
|
|
281
|
-
error: ${q}`),B=[{id:"",pluginName:"",text:q,location:null,notes:[],detail:void 0}];return H.errors=B,H.warnings=[],H},W=(q)=>{if(!q)return;let H=q.plugins;if(H&&H.length>0)throw G("Cannot use plugins in synchronous API calls")},Y=(q,H)=>{for(let B in H)q[B]=H[B]},z=(q,H)=>{let B=J++,F=new SharedArrayBuffer(8),
|
|
278
|
+
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:$,isWASM:Z}=NN();if(Z)return["node",[$]];else return[$,[]]}},S9=()=>TN.isatty(2),jN={readFile($,Z){try{let X=o6.readFileSync($,"utf8");try{o6.unlinkSync($)}catch{}Z(null,X)}catch(X){Z(X,null)}},writeFile($,Z){try{let X=sY();o6.writeFileSync(X,$),Z(X)}catch{Z(null)}}},ON={readFile($,Z){try{o6.readFile($,"utf8",(X,Q)=>{try{o6.unlink($,()=>Z(X,Q))}catch{Z(X,Q)}})}catch(X){Z(X,null)}},writeFile($,Z){try{let X=sY();o6.writeFile(X,$,(Q)=>Q!==null?Z(null):Z(X))}catch{Z(null)}}},EN="0.28.1",RN=($)=>e6().build($),PN=($)=>e6().context($),CN=($,Z)=>e6().transform($,Z),SN=($,Z)=>e6().formatMessages($,Z),_N=($,Z)=>e6().analyzeMetafile($,Z),bN=($)=>{if(N$&&!b9){if(!D$)D$=L5(N$);return D$.buildSync($)}let Z;return F5((X)=>X.buildOrContext({callName:"buildSync",refs:null,options:$,isTTY:S9(),defaultWD:s6,callback:(Q,J)=>{if(Q)throw Q;Z=J}})),Z},xN=($,Z)=>{if(N$&&!b9){if(!D$)D$=L5(N$);return D$.transformSync($,Z)}let X;return F5((Q)=>Q.transform({callName:"transformSync",refs:null,input:$,options:Z||{},isTTY:S9(),fs:jN,callback:(J,G)=>{if(J)throw J;X=G}})),X},kN=($,Z)=>{if(N$&&!b9){if(!D$)D$=L5(N$);return D$.formatMessagesSync($,Z)}let X;return F5((Q)=>Q.formatMessages({callName:"formatMessagesSync",refs:null,messages:$,options:Z,callback:(J,G)=>{if(J)throw J;X=G}})),X},yN=($,Z)=>{if(N$&&!b9){if(!D$)D$=L5(N$);return D$.analyzeMetafileSync($,Z)}let X;return F5((Q)=>Q.analyzeMetafile({callName:"analyzeMetafileSync",refs:null,metafile:typeof $==="string"?$:JSON.stringify($),options:Z,callback:(J,G)=>{if(J)throw J;X=G}})),X},vN=()=>{if(V5)V5();if(D$)D$.stop();return Promise.resolve()},QX=!1,gN=($)=>{if($=zN($||{}),$.wasmURL)throw Error('The "wasmURL" option only works in the browser');if($.wasmModule)throw Error('The "wasmModule" option only works in the browser');if($.worker)throw Error('The "worker" option only works in the browser');if(QX)throw Error('Cannot call "initialize" more than once');return e6(),QX=!0,Promise.resolve()},s6=process.cwd(),P9,V5,e6=()=>{if(P9)return P9;let[$,Z]=oY(),X=aY.spawn($,Z.concat("--service=0.28.1","--ping"),{windowsHide:!0,stdio:["pipe","pipe","inherit"],cwd:s6}),{readFromStdout:Q,afterClose:J,service:G}=iY({writeToStdin(H){X.stdin.write(H,(B)=>{if(B)J(B)})},readFileSync:o6.readFileSync,isSync:!1,hasFS:!0,esbuild:_9});X.stdin.on("error",J),X.on("error",J);let{stdin:W,stdout:Y}=X;Y.on("data",Q),Y.on("end",J),V5=()=>{W.destroy(),Y.destroy(),X.kill(),QX=!1,P9=void 0,V5=void 0};let z=0;if(X.unref(),W.unref)W.unref();if(Y.unref)Y.unref();let q={ref(){if(++z===1)X.ref()},unref(){if(--z===0)X.unref()}};return P9={build:(H)=>new Promise((B,F)=>{G.buildOrContext({callName:"build",refs:q,options:H,isTTY:S9(),defaultWD:s6,callback:(L,w)=>L?F(L):B(w)})}),context:(H)=>new Promise((B,F)=>G.buildOrContext({callName:"context",refs:q,options:H,isTTY:S9(),defaultWD:s6,callback:(L,w)=>L?F(L):B(w)})),transform:(H,B)=>new Promise((F,L)=>G.transform({callName:"transform",refs:q,input:H,options:B||{},isTTY:S9(),fs:ON,callback:(w,N)=>w?L(w):F(N)})),formatMessages:(H,B)=>new Promise((F,L)=>G.formatMessages({callName:"formatMessages",refs:q,messages:H,options:B,callback:(w,N)=>w?L(w):F(N)})),analyzeMetafile:(H,B)=>new Promise((F,L)=>G.analyzeMetafile({callName:"analyzeMetafile",refs:q,metafile:typeof H==="string"?H:JSON.stringify(H),options:B,callback:(w,N)=>w?L(w):F(N)}))},P9},F5=($)=>{let[Z,X]=oY(),Q=new Uint8Array,{readFromStdout:J,afterClose:G,service:W}=iY({writeToStdin(z){if(Q.length!==0)throw Error("Must run at most one command");Q=z},isSync:!0,hasFS:!0,esbuild:_9});$(W);let Y=aY.execFileSync(Z,X.concat("--service=0.28.1"),{cwd:s6,windowsHide:!0,input:Q,maxBuffer:+process.env.ESBUILD_MAX_BUFFER||16777216});J(Y),G(null)},sY=()=>{return XX.join(wN.tmpdir(),`esbuild-${DN.randomBytes(32).toString("hex")}`)},D$=null,L5=($)=>{let{port1:Z,port2:X}=new $.MessageChannel,Q=new $.Worker(__filename,{workerData:{workerPort:X,defaultWD:s6,esbuildVersion:"0.28.1"},transferList:[X],execArgv:[]}),J=0,G=(q)=>{let H=Error(`Build failed with 1 error:
|
|
279
|
+
error: ${q}`),B=[{id:"",pluginName:"",text:q,location:null,notes:[],detail:void 0}];return H.errors=B,H.warnings=[],H},W=(q)=>{if(!q)return;let H=q.plugins;if(H&&H.length>0)throw G("Cannot use plugins in synchronous API calls")},Y=(q,H)=>{for(let B in H)q[B]=H[B]},z=(q,H)=>{let B=J++,F=new SharedArrayBuffer(8),L=new Int32Array(F),w={sharedBuffer:F,id:B,command:q,args:H};Q.postMessage(w);let N=Atomics.wait(L,0,0);if(N!=="ok"&&N!=="not-equal")throw Error("Internal error: Atomics.wait() failed: "+N);let{message:{id:I,resolve:T,reject:E,properties:P}}=$.receiveMessageOnPort(Z);if(B!==I)throw Error(`Internal error: Expected id ${B} but got id ${I}`);if(E)throw Y(E,P),E;return T};return Q.unref(),{buildSync(q){return W(q),z("build",[q])},transformSync(q,H){return z("transform",[q,H])},formatMessagesSync(q,H){return z("formatMessages",[q,H])},analyzeMetafileSync(q,H){return z("analyzeMetafile",[q,H])},stop(){Q.terminate(),D$=null}}},fN=()=>{let $=N$.workerData.workerPort,Z=N$.parentPort,X=(Q)=>{let J={};if(Q&&typeof Q==="object")for(let G in Q)J[G]=Q[G];return J};try{let Q=e6();s6=N$.workerData.defaultWD,Z.on("message",(J)=>{(async()=>{let{sharedBuffer:G,id:W,command:Y,args:z}=J,q=new Int32Array(G);try{switch(Y){case"build":$.postMessage({id:W,resolve:await Q.build(z[0])});break;case"transform":$.postMessage({id:W,resolve:await Q.transform(z[0],z[1])});break;case"formatMessages":$.postMessage({id:W,resolve:await Q.formatMessages(z[0],z[1])});break;case"analyzeMetafile":$.postMessage({id:W,resolve:await Q.analyzeMetafile(z[0],z[1])});break;default:throw Error(`Invalid command: ${Y}`)}}catch(H){$.postMessage({id:W,reject:H,properties:X(H)})}Atomics.add(q,0,1),Atomics.notify(q,0,1/0)})()})}catch(Q){Z.on("message",(J)=>{let{sharedBuffer:G,id:W}=J,Y=new Int32Array(G);$.postMessage({id:W,reject:Q,properties:X(Q)}),Atomics.add(Y,0,1),Atomics.notify(Y,0,1/0)})}};if(b9)fN();var hN=_9});import{rmSync as uN,writeFileSync as eY}from"node:fs";import{createRequire as mN}from"node:module";import{join as $z,resolve as dN}from"node:path";function Xz($){return n6($)||$.startsWith("./")||$.startsWith("../")}function GX(){return typeof Bun>"u"||process.env.JX_BUNDLER==="esbuild"}function Qz($,Z,X){if(n6($)){let Q=$.slice(jY.length);if(GX())return mN($z(X,"package.json")).resolve(Q);return Bun.resolveSync(Q,X)}return dN(Z,$)}function lN($){if($==="cloudflare-workers"||$==="cloudflare-pages")return{conditions:["workerd","worker"],external:["cloudflare:*","node:*"],target:"workerd"};return{target:$==="bun"?"bun":"node"}}function Jz($){return $==="node"||$==="bun"?"node":"browser"}function cN($){if($==="workerd")return"browser";return $}async function WX($,Z){let X=Z.external??[];if(GX()){await(await Promise.resolve().then(() => F$(x9(),1))).build({bundle:!0,...Z.conditions?{conditions:Z.conditions}:{},entryPoints:[$.entryPath],external:X,format:"esm",logLevel:"silent",minify:!1,outfile:$.outfile,platform:Jz(Z.target)});return}let Q=await Bun.build({...Z.conditions?{conditions:Z.conditions}:{},entrypoints:[$.entryPath],external:X,format:"esm",minify:!1,target:cN(Z.target),throw:!1});if(!Q.success||Q.outputs.length===0){let J=Q.logs.map(String).join(`
|
|
282
280
|
`);throw Error(`Bun.build failed for ${$.entryPath}:
|
|
283
|
-
${J}`)}
|
|
284
|
-
`)}function
|
|
281
|
+
${J}`)}eY($.outfile,await Q.outputs[0].text(),"utf8")}async function Gz($,{projectRoot:Z,outfile:X,adapter:Q}){let J=lN(Q);if(GX()){await(await Promise.resolve().then(() => F$(x9(),1))).build({bundle:!0,...J.conditions?{conditions:J.conditions}:{},external:J.external??[],format:"esm",logLevel:"silent",minify:!1,outfile:X,platform:Jz(J.target),stdin:{contents:$,loader:"js",resolveDir:Z,sourcefile:"jx-worker-entry.js"}});return}let G=$z(Z,".jx-worker-entry.mjs");eY(G,$,"utf8");try{await WX({entryPath:G,outfile:X},J)}finally{uN(G,{force:!0})}}var Zz;var Wz=s(()=>{R9();Zz=["@vue/reactivity","lit-html"]});import{readFileSync as Yz,readdirSync as pN}from"node:fs";import{extname as YX,join as iN,relative as nN,resolve as rN}from"node:path";async function _4($,Z){let X=Yz($,"utf8");if($.endsWith(".json"))return I6(X,$);let Q=YX($).toLowerCase(),J=Z?.byExtension(Q,"parse");if(!J)throw Error(`No format class registered for "${Q}" (${$}). Enable an extension providing this format in project.json "extensions", e.g. "@jxsuite/parser".`);return await J.call("parse",X)}async function zz($,Z){let X=[],Q=new Set([".json",...Z?.documentExtensions("page")??[]]);return await qz($,$,X,Q,Z),X.sort((J,G)=>{if(J.isDynamic!==G.isDynamic)return J.isDynamic?1:-1;if(J.isCatchAll!==G.isCatchAll)return J.isCatchAll?1:-1;return J.urlPattern.localeCompare(G.urlPattern)}),X}async function qz($,Z,X,Q,J){let G=pN($,{withFileTypes:!0});for(let W of G){let Y=iN($,W.name);if(W.isDirectory()){if(W.name.startsWith("_"))continue;await qz(Y,Z,X,Q,J);continue}let z=YX(W.name).toLowerCase();if(!Q.has(z))continue;if(W.name.startsWith("_"))continue;let q=nN(Z,Y),H=await aN(q,Y,J);if(H)X.push(H)}}async function aN($,Z,X){let Q=YX($),J=Q?$.slice(0,-Q.length):$;if(J=J.split("\\").join("/"),J.endsWith("/index"))J=J.slice(0,-6)||"/";else if(J==="index")J="/";if(!J.startsWith("/"))J=`/${J}`;let G=[],W=!1,Y=!1,z=J.replaceAll(/\[\.\.\.(\w+)\]|\[(\w+)\]/g,(H,B,F)=>{if(B)return Y=!0,W=!0,G.push(B),"*";return W=!0,G.push(F),`:${F}`}),q=null;try{let B=(await _4(Z,X)).$layout;if(typeof B==="string")q=B}catch{}return{$layout:q,isCatchAll:Y,isDynamic:W,params:G,relativePath:$,sourcePath:Z,urlPattern:z}}async function Kz($,Z,X={},Q,J){let G=[];for(let W of $){if(!W.isDynamic){G.push(W);continue}let Y;try{Y=await _4(W.sourcePath,Q?.formats)}catch{G.push(W);continue}if(!Y.$paths){console.warn(`Warning: dynamic route ${W.urlPattern} has no $paths — skipping`);continue}let z=await oN(Y.$paths,Z,X,Q,J);for(let q of z){let H=W.urlPattern,B={};for(let[F,L]of Object.entries(q))B[F]=String(L),H=H.replace(`:${F}`,B[F]),H=H.replace("*",B[F]);G.push({...W,_pathParams:B,isCatchAll:!1,isDynamic:!1,params:[],urlPattern:H})}}return G}async function oN($,Z,X,Q,J){if(Array.isArray($))return $;if("values"in $&&Array.isArray($.values)){let G=typeof $.param==="string"?$.param:"value";return $.values.map((W)=>({[G]:W}))}if("$ref"in $&&typeof $.$ref==="string"&&$.$ref){let G=$.$ref,W=rN(Z,G),Y;try{Y=JSON.parse(Yz(W,"utf8"))}catch(H){return console.warn(`Warning: $paths.$ref could not load "${G}": ${H.message}`),[]}if(!Array.isArray(Y))return console.warn(`Warning: $paths.$ref "${G}" must be a JSON array`),[];let z=typeof $.param==="string"?$.param:"id",q=typeof $.field==="string"?$.field:"id";return Y.map((H)=>({[z]:H[q]??H.id??String(H)}))}for(let G of Object.keys($)){let W=Q?.byPathsDiscriminator(G);if(!W?.project)continue;return await W.call("resolvePaths",$,{data:X[W.project.key],projectConfig:J,root:Z})}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var Uz=s(()=>{N6()});async function Hz($,Z,X){let Q={},J=e8($);for(let G of X.projectContributions()){let W=G.project?.key;if(!W||!G.capabilities.projectData)continue;if(!Z||!(W in Z))continue;Q[W]=await G.call("projectData",Z[W],{io:J,projectConfig:Z,registry:X,root:$})}return Q}var Vz=s(()=>{r1()});import{cpSync as sN,existsSync as tN,mkdirSync as eN}from"node:fs";import{dirname as $D,resolve as ZD}from"node:path";async function Bz($,Z,X){let Q=[],J=[],G=new Map;for(let W of $.assetProviders()){let Y=W.project?.key,z=Y?Z[Y]:void 0;if(Y&&(z==null||typeof z==="object"&&Object.keys(z).length===0))continue;try{let q=await W.call("assets",z??null,{projectConfig:Z,root:X});for(let H of q??[]){if(!H?.urlPrefix||!H.dir)continue;let B={dir:H.dir,urlPrefix:J5(H.urlPrefix)},F=G.get(B.urlPrefix);if(F){if(F.dir!==B.dir)J.push(`Asset mount conflict: "${B.urlPrefix}" is claimed by both "${F.dir}" and "${B.dir}"`);continue}G.set(B.urlPrefix,B),Q.push(B)}}catch(q){J.push(`Error in ${W.name}.assets: ${q.message}`)}}return{errors:J,mounts:Q}}function zX($,Z,X){if(Z.length===0||!$)return;for(let Q of RY($,Z))X.add(Q)}function Fz($,Z,X){let Q=0,J=[];for(let G of $){let W=G5(Z,G);if(!W||!tN(W)){J.push(G);continue}let Y=ZD(X,decodeURIComponent(G).replace(/^\//,""));eN($D(Y),{recursive:!0}),sN(W,Y),Q+=1}return{copied:Q,missing:J}}var Lz=s(()=>{R9()});import{existsSync as XD,readFileSync as QD}from"node:fs";import{resolve as JD}from"node:path";function qX($,Z,X){let Q=$.$layout??Z.defaults?.layout??null;if(!Q)return $;let J=JD(X,Q);if(!XD(J))throw Error(`Layout not found: ${Q} (resolved to ${J})`);let G;try{G=I6(QD(J,"utf8"),J)}catch(q){throw Error(`Invalid layout JSON at ${J}: ${q.message}`,{cause:q})}if(G.$layout)G=qX(G,Z,X);let W=$.children??[],Y=typeof W==="string"?[W]:Array.isArray(W)?W:[],z=WD(G);if(GD(z,Y),$.state)z.state={...z.state,...$.state};if($.$media)z.$media={...z.$media,...$.$media};if($.style)z.style={...z.style,...$.style};if($.attributes)z.attributes={...z.attributes,...$.attributes};if($.$head)z._pageHead=$.$head;if($.title)z._pageTitle=$.title;return delete z.$layout,z}function GD($,Z){if(!$||typeof $!=="object")return;if(!Array.isArray($.children))return;let X=new Map,Q=[];for(let J of Z)if(J&&typeof J==="object"&&J.attributes?.slot){let G=J.attributes.slot;if(!X.has(G))X.set(G,[]);X.get(G).push(J)}else Q.push(J);Mz($,X,Q)}function Mz($,Z,X){if(!$||typeof $!=="object")return;if(!Array.isArray($.children))return;let Q=[];for(let J of $.children)if(J&&typeof J==="object"&&J.tagName==="slot"){let G=J.attributes?.name;if(G&&Z.has(G))Q.push(...Z.get(G)),Z.delete(G);else if(!G&&X.length>0)Q.push(...X);else if(Array.isArray(J.children))Q.push(...J.children)}else Mz(J,Z,X),Q.push(J);$.children=Q}function WD($){return structuredClone($)}var Az=s(()=>{N6()});function Iz($=[],Z=[],X=[],Q={}){let J=[{attributes:{charset:Q.charset??"utf8"},tagName:"meta"},{attributes:{content:"width=device-width, initial-scale=1",name:"viewport"},tagName:"meta"}],G=new Map;for(let Y of[...J,...$,...Z,...X]){let z=YD(Y);G.set(z,Y)}let W=Q.title??Q.siteName??"Jx Site";if(G.set("title",{children:[W],tagName:"title"}),Q.pageUrl&&Q.siteUrl){let Y=new URL(Q.pageUrl,Q.siteUrl).href;if(G.set("link:canonical",{attributes:{href:Y,rel:"canonical"},tagName:"link"}),!G.has("meta:og:url"))G.set("meta:og:url",{attributes:{content:Y,property:"og:url"},tagName:"meta"})}if(Q.siteName&&!G.has("meta:og:site_name"))G.set("meta:og:site_name",{attributes:{content:Q.siteName,property:"og:site_name"},tagName:"meta"});return[...G.values()]}function YD($){if(!$||typeof $!=="object")return String($);let Z=$.tagName??"unknown",X=$.attributes??{};if(Z==="title")return"title";if(X.charset)return"meta:charset";if(Z==="meta"&&X.name)return`meta:${X.name}`;if(Z==="meta"&&X.property)return`meta:${X.property}`;if(Z==="link"&&X.rel)return`link:${X.rel}:${X.href??""}`;if(Z==="script"&&X.src)return`script:${X.src}`;if(Z==="style"){let Q=Array.isArray($.children)?$.children.join(""):$.textContent??"";return`style:${zD(Q)}`}return`${Z}:${JSON.stringify($)}`}function zD($){let Z=0;for(let X=0;X<$.length;X++)Z=Math.trunc((Z<<5)-Z+($.codePointAt(X)??0));return Z.toString(36)}function Nz($){return $.map((Z)=>qD(Z)).join(`
|
|
282
|
+
`)}function qD($){if(typeof $==="string")return $;if(!$||typeof $!=="object")return"";let Z=$.tagName,X=$.attributes??{},Q=Object.entries(X).map(([Y,z])=>z===!0?Y:`${Y}="${KD(z)}"`).join(" "),J=Q?`<${Z} ${Q}>`:`<${Z}>`;if(new Set(["meta","link","base","br","hr","img","input"]).has(Z))return J;let W=Array.isArray($.children)?$.children.join(""):$.textContent??"";return`${J}${W}</${Z}>`}function KD($){return String($).replaceAll("&","&").replaceAll('"',""").replaceAll("<","<")}import{dirname as UD,relative as HD,resolve as VD}from"node:path";function Dz($,Z,X,Q=null){if(!$.state)$.state={};if($.state.$site={name:Z.name??"Jx Site",url:Z.url??"",...Z.state},$.state.$page={params:X._pathParams??{},title:$.title??$._pageTitle??Z.name??"",url:X.urlPattern},Z.state){for(let[J,G]of Object.entries(Z.state))if(J!=="$site"&&J!=="$page"&&!(J in $.state))$.state[J]=G}if(Z.$media)$.$media={...Z.$media,...$.$media};if(Z.imports&&Object.keys(Z.imports).length>0){if(!$.imports)$.imports={};for(let[J,G]of Object.entries(Z.imports))if(!(J in $.imports)){let W=G;if(Q&&X.sourcePath&&(W.startsWith("./")||W.startsWith("../"))){let Y=VD(Q,W);$.imports[J]=`./${HD(UD(X.sourcePath),Y)}`}else $.imports[J]=W}}if(Z.$elements?.length)if(!$.$elements?.length)$.$elements=[...Z.$elements];else{let J=new Set,G=[];for(let W of[...Z.$elements,...$.$elements]){let Y=typeof W==="string"?W:W?.$ref;if(Y&&!J.has(Y))J.add(Y),G.push(W)}$.$elements=G}return $}var wz=()=>{};import{readFileSync as BD}from"node:fs";import{dirname as KX,resolve as M5}from"node:path";import{createRequire as FD}from"node:module";async function Tz($,Z,X,Q={}){let J=$.imports??{},{state:G}=$;if(!G)return;for(let[W,Y]of Object.entries(G)){if(!H6(Y))continue;if(LD.has(Y.$prototype))continue;if(Y.timing&&Y.timing!=="compiler"){let z=Q.registry?.byName(Y.$prototype);if(z?.capabilities.lower)try{let q=await z.call("lower",Y,{projectConfig:Q.config,root:X,route:Z});if(q&&typeof q==="object"&&!Array.isArray(q)){let H=q.$bundle;if(Array.isArray(H)){for(let B of H)if(typeof B==="string")Q.registerBundle?.(B)}delete q.$bundle}G[W]=q}catch(q){console.warn(`prototype-resolver: failed to lower "${W}" ($prototype: "${Y.$prototype}"):`,A6(q))}continue}if(!Y.$src){let z=J[Y.$prototype]??AD(Q,Y.$prototype);if(!z)continue;Y.$src=z}try{let z=await ID(Y,Z,X,G,Q);if(Y.timing&&z&&typeof z==="object"&&!Array.isArray(z))z.timing=Y.timing;G[W]=z}catch(z){console.warn(`prototype-resolver: failed to resolve "${W}" ($prototype: "${Y.$prototype}"):`,A6(z))}}}function AD($,Z){return $.registry?.byName(Z)?.classPath}async function ID($,Z,X,Q,J){let G=$.$src;if(!G)throw Error(`$prototype "${$.$prototype}" has no $src to resolve`);let W;if(G.startsWith("./")||G.startsWith("../"))W=Z.sourcePath?M5(KX(Z.sourcePath),G):M5(X,G);else W=FD(M5(X,"package.json")).resolve(G);let Y=BD(W,"utf8"),z=iW(Y,W);if(!z.$implementation)throw Error(`${G} has no $implementation field`);let q=M5(KX(W),z.$implementation),H=await t8(q),B=$.$export??z.title??$.$prototype,F=H[B]??H.default?.[B];if(!F)throw Error(`Module ${z.$implementation} does not export "${B}"`);let L={};for(let[N,I]of Object.entries($))if(!MD.has(N))L[N]=I;if(L.src&&!L.basePath&&Z.sourcePath)L.basePath=KX(Z.sourcePath);L._project={config:J.config??null,root:X,...J.sections},L._document={route:Z,state:Q};let w=new F(L);if(typeof w.resolve==="function")return await w.resolve();return w}var LD,MD;var jz=s(()=>{r1();w1();N6();LD=new Set(["Function","LocalStorage","SessionStorage","Array"]),MD=new Set(["$prototype","$src","$export","timing","default","description"])});var Oz=($)=>typeof $<"u"&&$!==null,ND=($)=>typeof $==="object",DD=($)=>Object.prototype.toString.call($)==="[object Object]",wD=($)=>typeof $==="function",TD=($)=>typeof $==="boolean",jD=($)=>$ instanceof Buffer,OD=($)=>{if(Oz($))switch($.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},ED=($)=>$ instanceof ArrayBuffer,RD=($)=>typeof $==="string"&&$.length>0,PD=($)=>typeof $==="number"&&Number.isFinite($),CD=($)=>Number.isInteger($),SD=($,Z,X)=>$>=Z&&$<=X,_D=($,Z)=>Z.includes($),bD=($,Z,X)=>Error(`Expected ${Z} for ${$} but received ${X} of type ${typeof X}`),xD=($,Z)=>{return Z.message=$.message,Z},U;var C1=s(()=>{/*!
|
|
285
283
|
Copyright 2013 Lovell Fuller and others.
|
|
286
284
|
SPDX-License-Identifier: Apache-2.0
|
|
287
|
-
*/K={defined:Vz,object:WD,plainObject:YD,fn:zD,bool:qD,buffer:UD,typedArray:KD,arrayBuffer:HD,string:VD,number:BD,integer:FD,inRange:LD,inArray:MD,invalidParameterError:AD,nativeError:ID}});var Lz=x((bd,Fz)=>{var Bz=()=>process.platform==="linux",z8=null,ND=()=>{if(!z8)if(Bz()&&process.report){let $=process.report.excludeNetwork;process.report.excludeNetwork=!0,z8=process.report.getReport(),process.report.excludeNetwork=$}else z8={};return z8};Fz.exports={isLinux:Bz,getReport:ND}});var Az=x((kd,Mz)=>{var O4=O0("fs"),DD=($)=>{let Z=O4.openSync($,"r"),X=Buffer.alloc(2048),Q=O4.readSync(Z,X,0,2048,0);return O4.close(Z,()=>{}),X.subarray(0,Q)},wD=($)=>new Promise((Z,X)=>{O4.open($,"r",(Q,J)=>{if(Q)X(Q);else{let G=Buffer.alloc(2048);O4.read(J,G,0,2048,0,(W,Y)=>{Z(G.subarray(0,Y)),O4.close(J,()=>{})})}})});Mz.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:DD,readFile:wD}});var Nz=x((yd,Iz)=>{var TD=($)=>{if($.length<64)return null;if($.readUInt32BE(0)!==2135247942)return null;if($.readUInt8(4)!==2)return null;if($.readUInt8(5)!==1)return null;let Z=$.readUInt32LE(32),X=$.readUInt16LE(54),Q=$.readUInt16LE(56);for(let J=0;J<Q;J++){let G=Z+J*X;if($.readUInt32LE(G)===3){let Y=$.readUInt32LE(G+8),z=$.readUInt32LE(G+32);return $.subarray(Y,Y+z).toString().replace(/\0.*$/g,"")}}return null};Iz.exports={interpreterPath:TD}});var U8=x((vd,gz)=>{var wz=O0("child_process"),{isLinux:E4,getReport:Tz}=Lz(),{LDD_PATH:q8,SELF_PATH:jz,readFile:XX,readFileSync:QX}=Az(),{interpreterPath:Oz}=Nz(),P6,C6,S6,w1="",Ez=()=>{if(!w1)return new Promise(($)=>{wz.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(Z,X)=>{w1=Z?" ":X,$(w1)})});return w1},Rz=()=>{if(!w1)try{w1=wz.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch($){w1=" "}return w1},o6="glibc",Pz=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,o1="musl",jD=($)=>$.includes("libc.musl-")||$.includes("ld-musl-"),Cz=()=>{let $=Tz();if($.header&&$.header.glibcVersionRuntime)return o6;if(Array.isArray($.sharedObjects)){if($.sharedObjects.some(jD))return o1}return null},Sz=($)=>{let[Z,X]=$.split(/[\r\n]+/);if(Z&&Z.includes(o6))return o6;if(X&&X.includes(o1))return o1;return null},_z=($)=>{if($){if($.includes("/ld-musl-"))return o1;else if($.includes("/ld-linux-"))return o6}return null},xz=($)=>{if($=$.toString(),$.includes("musl"))return o1;if($.includes("GNU C Library"))return o6;return null},OD=async()=>{if(C6!==void 0)return C6;C6=null;try{let $=await XX(q8);C6=xz($)}catch($){}return C6},ED=()=>{if(C6!==void 0)return C6;C6=null;try{let $=QX(q8);C6=xz($)}catch($){}return C6},RD=async()=>{if(P6!==void 0)return P6;P6=null;try{let $=await XX(jz),Z=Oz($);P6=_z(Z)}catch($){}return P6},PD=()=>{if(P6!==void 0)return P6;P6=null;try{let $=QX(jz),Z=Oz($);P6=_z(Z)}catch($){}return P6},bz=async()=>{let $=null;if(E4()){if($=await RD(),!$){if($=await OD(),!$)$=Cz();if(!$){let Z=await Ez();$=Sz(Z)}}}return $},kz=()=>{let $=null;if(E4()){if($=PD(),!$){if($=ED(),!$)$=Cz();if(!$){let Z=Rz();$=Sz(Z)}}}return $},CD=async()=>E4()&&await bz()!==o6,SD=()=>E4()&&kz()!==o6,_D=async()=>{if(S6!==void 0)return S6;S6=null;try{let Z=(await XX(q8)).match(Pz);if(Z)S6=Z[1]}catch($){}return S6},xD=()=>{if(S6!==void 0)return S6;S6=null;try{let Z=QX(q8).match(Pz);if(Z)S6=Z[1]}catch($){}return S6},yz=()=>{let $=Tz();if($.header&&$.header.glibcVersionRuntime)return $.header.glibcVersionRuntime;return null},Dz=($)=>$.trim().split(/\s+/)[1],vz=($)=>{let[Z,X,Q]=$.split(/[\r\n]+/);if(Z&&Z.includes(o6))return Dz(Z);if(X&&Q&&X.includes(o1))return Dz(Q);return null},bD=async()=>{let $=null;if(E4()){if($=await _D(),!$)$=yz();if(!$){let Z=await Ez();$=vz(Z)}}return $},kD=()=>{let $=null;if(E4()){if($=xD(),!$)$=yz();if(!$){let Z=Rz();$=vz(Z)}}return $};gz.exports={GLIBC:o6,MUSL:o1,family:bz,familySync:kz,isNonGlibcLinux:CD,isNonGlibcLinuxSync:SD,version:bD,versionSync:kD}});var R4=x((gd,fz)=>{var yD=Number.MAX_SAFE_INTEGER||9007199254740991,vD=["major","premajor","minor","preminor","patch","prepatch","prerelease"];fz.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:yD,RELEASE_TYPES:vD,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var P9=x((fd,hz)=>{var gD=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...$)=>console.error("SEMVER",...$):()=>{};hz.exports=gD});var P4=x((_6,uz)=>{var{MAX_SAFE_COMPONENT_LENGTH:JX,MAX_SAFE_BUILD_LENGTH:fD,MAX_LENGTH:hD}=R4(),uD=P9();_6=uz.exports={};var mD=_6.re=[],dD=_6.safeRe=[],z0=_6.src=[],lD=_6.safeSrc=[],q0=_6.t={},cD=0,GX="[a-zA-Z0-9-]",pD=[["\\s",1],["\\d",hD],[GX,fD]],iD=($)=>{for(let[Z,X]of pD)$=$.split(`${Z}*`).join(`${Z}{0,${X}}`).split(`${Z}+`).join(`${Z}{1,${X}}`);return $},T0=($,Z,X)=>{let Q=iD(Z),J=cD++;uD($,J,Z),q0[$]=J,z0[J]=Z,lD[J]=Q,mD[J]=new RegExp(Z,X?"g":void 0),dD[J]=new RegExp(Q,X?"g":void 0)};T0("NUMERICIDENTIFIER","0|[1-9]\\d*");T0("NUMERICIDENTIFIERLOOSE","\\d+");T0("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${GX}*`);T0("MAINVERSION",`(${z0[q0.NUMERICIDENTIFIER]})\\.(${z0[q0.NUMERICIDENTIFIER]})\\.(${z0[q0.NUMERICIDENTIFIER]})`);T0("MAINVERSIONLOOSE",`(${z0[q0.NUMERICIDENTIFIERLOOSE]})\\.(${z0[q0.NUMERICIDENTIFIERLOOSE]})\\.(${z0[q0.NUMERICIDENTIFIERLOOSE]})`);T0("PRERELEASEIDENTIFIER",`(?:${z0[q0.NONNUMERICIDENTIFIER]}|${z0[q0.NUMERICIDENTIFIER]})`);T0("PRERELEASEIDENTIFIERLOOSE",`(?:${z0[q0.NONNUMERICIDENTIFIER]}|${z0[q0.NUMERICIDENTIFIERLOOSE]})`);T0("PRERELEASE",`(?:-(${z0[q0.PRERELEASEIDENTIFIER]}(?:\\.${z0[q0.PRERELEASEIDENTIFIER]})*))`);T0("PRERELEASELOOSE",`(?:-?(${z0[q0.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z0[q0.PRERELEASEIDENTIFIERLOOSE]})*))`);T0("BUILDIDENTIFIER",`${GX}+`);T0("BUILD",`(?:\\+(${z0[q0.BUILDIDENTIFIER]}(?:\\.${z0[q0.BUILDIDENTIFIER]})*))`);T0("FULLPLAIN",`v?${z0[q0.MAINVERSION]}${z0[q0.PRERELEASE]}?${z0[q0.BUILD]}?`);T0("FULL",`^${z0[q0.FULLPLAIN]}$`);T0("LOOSEPLAIN",`[v=\\s]*${z0[q0.MAINVERSIONLOOSE]}${z0[q0.PRERELEASELOOSE]}?${z0[q0.BUILD]}?`);T0("LOOSE",`^${z0[q0.LOOSEPLAIN]}$`);T0("GTLT","((?:<|>)?=?)");T0("XRANGEIDENTIFIERLOOSE",`${z0[q0.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);T0("XRANGEIDENTIFIER",`${z0[q0.NUMERICIDENTIFIER]}|x|X|\\*`);T0("XRANGEPLAIN",`[v=\\s]*(${z0[q0.XRANGEIDENTIFIER]})(?:\\.(${z0[q0.XRANGEIDENTIFIER]})(?:\\.(${z0[q0.XRANGEIDENTIFIER]})(?:${z0[q0.PRERELEASE]})?${z0[q0.BUILD]}?)?)?`);T0("XRANGEPLAINLOOSE",`[v=\\s]*(${z0[q0.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z0[q0.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z0[q0.XRANGEIDENTIFIERLOOSE]})(?:${z0[q0.PRERELEASELOOSE]})?${z0[q0.BUILD]}?)?)?`);T0("XRANGE",`^${z0[q0.GTLT]}\\s*${z0[q0.XRANGEPLAIN]}$`);T0("XRANGELOOSE",`^${z0[q0.GTLT]}\\s*${z0[q0.XRANGEPLAINLOOSE]}$`);T0("COERCEPLAIN",`(^|[^\\d])(\\d{1,${JX}})(?:\\.(\\d{1,${JX}}))?(?:\\.(\\d{1,${JX}}))?`);T0("COERCE",`${z0[q0.COERCEPLAIN]}(?:$|[^\\d])`);T0("COERCEFULL",z0[q0.COERCEPLAIN]+`(?:${z0[q0.PRERELEASE]})?(?:${z0[q0.BUILD]})?(?:$|[^\\d])`);T0("COERCERTL",z0[q0.COERCE],!0);T0("COERCERTLFULL",z0[q0.COERCEFULL],!0);T0("LONETILDE","(?:~>?)");T0("TILDETRIM",`(\\s*)${z0[q0.LONETILDE]}\\s+`,!0);_6.tildeTrimReplace="$1~";T0("TILDE",`^${z0[q0.LONETILDE]}${z0[q0.XRANGEPLAIN]}$`);T0("TILDELOOSE",`^${z0[q0.LONETILDE]}${z0[q0.XRANGEPLAINLOOSE]}$`);T0("LONECARET","(?:\\^)");T0("CARETTRIM",`(\\s*)${z0[q0.LONECARET]}\\s+`,!0);_6.caretTrimReplace="$1^";T0("CARET",`^${z0[q0.LONECARET]}${z0[q0.XRANGEPLAIN]}$`);T0("CARETLOOSE",`^${z0[q0.LONECARET]}${z0[q0.XRANGEPLAINLOOSE]}$`);T0("COMPARATORLOOSE",`^${z0[q0.GTLT]}\\s*(${z0[q0.LOOSEPLAIN]})$|^$`);T0("COMPARATOR",`^${z0[q0.GTLT]}\\s*(${z0[q0.FULLPLAIN]})$|^$`);T0("COMPARATORTRIM",`(\\s*)${z0[q0.GTLT]}\\s*(${z0[q0.LOOSEPLAIN]}|${z0[q0.XRANGEPLAIN]})`,!0);_6.comparatorTrimReplace="$1$2$3";T0("HYPHENRANGE",`^\\s*(${z0[q0.XRANGEPLAIN]})\\s+-\\s+(${z0[q0.XRANGEPLAIN]})\\s*$`);T0("HYPHENRANGELOOSE",`^\\s*(${z0[q0.XRANGEPLAINLOOSE]})\\s+-\\s+(${z0[q0.XRANGEPLAINLOOSE]})\\s*$`);T0("STAR","(<|>)?=?\\s*\\*");T0("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");T0("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var K8=x((hd,mz)=>{var nD=Object.freeze({loose:!0}),rD=Object.freeze({}),aD=($)=>{if(!$)return rD;if(typeof $!=="object")return nD;return $};mz.exports=aD});var WX=x((ud,cz)=>{var dz=/^[0-9]+$/,lz=($,Z)=>{if(typeof $==="number"&&typeof Z==="number")return $===Z?0:$<Z?-1:1;let X=dz.test($),Q=dz.test(Z);if(X&&Q)$=+$,Z=+Z;return $===Z?0:X&&!Q?-1:Q&&!X?1:$<Z?-1:1},oD=($,Z)=>lz(Z,$);cz.exports={compareIdentifiers:lz,rcompareIdentifiers:oD}});var W$=x((md,iz)=>{var H8=P9(),{MAX_LENGTH:pz,MAX_SAFE_INTEGER:V8}=R4(),{safeRe:B8,t:F8}=P4(),sD=K8(),{compareIdentifiers:YX}=WX(),tD=($,Z)=>{let X=Z.split(".");if(X.length>$.length)return!1;for(let Q=0;Q<X.length;Q++)if(YX($[Q],X[Q])!==0)return!1;return!0};class q6{constructor($,Z){if(Z=sD(Z),$ instanceof q6)if($.loose===!!Z.loose&&$.includePrerelease===!!Z.includePrerelease)return $;else $=$.version;else if(typeof $!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof $}".`);if($.length>pz)throw TypeError(`version is longer than ${pz} characters`);H8("SemVer",$,Z),this.options=Z,this.loose=!!Z.loose,this.includePrerelease=!!Z.includePrerelease;let X=$.trim().match(Z.loose?B8[F8.LOOSE]:B8[F8.FULL]);if(!X)throw TypeError(`Invalid Version: ${$}`);if(this.raw=$,this.major=+X[1],this.minor=+X[2],this.patch=+X[3],this.major>V8||this.major<0)throw TypeError("Invalid major version");if(this.minor>V8||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>V8||this.patch<0)throw TypeError("Invalid patch version");if(!X[4])this.prerelease=[];else this.prerelease=X[4].split(".").map((Q)=>{if(/^[0-9]+$/.test(Q)){let J=+Q;if(J>=0&&J<V8)return J}return Q});this.build=X[5]?X[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare($){if(H8("SemVer.compare",this.version,this.options,$),!($ instanceof q6)){if(typeof $==="string"&&$===this.version)return 0;$=new q6($,this.options)}if($.version===this.version)return 0;return this.compareMain($)||this.comparePre($)}compareMain($){if(!($ instanceof q6))$=new q6($,this.options);if(this.major<$.major)return-1;if(this.major>$.major)return 1;if(this.minor<$.minor)return-1;if(this.minor>$.minor)return 1;if(this.patch<$.patch)return-1;if(this.patch>$.patch)return 1;return 0}comparePre($){if(!($ instanceof q6))$=new q6($,this.options);if(this.prerelease.length&&!$.prerelease.length)return-1;else if(!this.prerelease.length&&$.prerelease.length)return 1;else if(!this.prerelease.length&&!$.prerelease.length)return 0;let Z=0;do{let X=this.prerelease[Z],Q=$.prerelease[Z];if(H8("prerelease compare",Z,X,Q),X===void 0&&Q===void 0)return 0;else if(Q===void 0)return 1;else if(X===void 0)return-1;else if(X===Q)continue;else return YX(X,Q)}while(++Z)}compareBuild($){if(!($ instanceof q6))$=new q6($,this.options);let Z=0;do{let X=this.build[Z],Q=$.build[Z];if(H8("build compare",Z,X,Q),X===void 0&&Q===void 0)return 0;else if(Q===void 0)return 1;else if(X===void 0)return-1;else if(X===Q)continue;else return YX(X,Q)}while(++Z)}inc($,Z,X){if($.startsWith("pre")){if(!Z&&X===!1)throw Error("invalid increment argument: identifier is empty");if(Z){let Q=`-${Z}`.match(this.options.loose?B8[F8.PRERELEASELOOSE]:B8[F8.PRERELEASE]);if(!Q||Q[1]!==Z)throw Error(`invalid identifier: ${Z}`)}}switch($){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",Z,X);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",Z,X);break;case"prepatch":this.prerelease.length=0,this.inc("patch",Z,X),this.inc("pre",Z,X);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",Z,X);this.inc("pre",Z,X);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let Q=Number(X)?1:0;if(this.prerelease.length===0)this.prerelease=[Q];else{let J=this.prerelease.length;while(--J>=0)if(typeof this.prerelease[J]==="number")this.prerelease[J]++,J=-2;if(J===-1){if(Z===this.prerelease.join(".")&&X===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(Q)}}if(Z){let J=[Z,Q];if(X===!1)J=[Z];if(tD(this.prerelease,Z)){let G=this.prerelease[Z.split(".").length];if(isNaN(G))this.prerelease=J}else this.prerelease=J}break}default:throw Error(`invalid increment argument: ${$}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}iz.exports=q6});var T1=x((dd,rz)=>{var nz=W$(),eD=($,Z,X=!1)=>{if($ instanceof nz)return $;try{return new nz($,Z)}catch(Q){if(!X)return null;throw Q}};rz.exports=eD});var oz=x((ld,az)=>{var $w=T1(),Zw=($,Z)=>{let X=$w($,Z);return X?X.version:null};az.exports=Zw});var tz=x((cd,sz)=>{var Xw=T1(),Qw=($,Z)=>{let X=Xw($.trim().replace(/^[=v]+/,""),Z);return X?X.version:null};sz.exports=Qw});var Zq=x((pd,$q)=>{var ez=W$(),Jw=($,Z,X,Q,J)=>{if(typeof X==="string")J=Q,Q=X,X=void 0;try{return new ez($ instanceof ez?$.version:$,X).inc(Z,Q,J).version}catch(G){return null}};$q.exports=Jw});var Jq=x((id,Qq)=>{var Xq=T1(),Gw=($,Z)=>{let X=Xq($,null,!0),Q=Xq(Z,null,!0),J=X.compare(Q);if(J===0)return null;let G=J>0,W=G?X:Q,Y=G?Q:X,z=!!W.prerelease.length;if(!!Y.prerelease.length&&!z){if(!Y.patch&&!Y.minor)return"major";if(Y.compareMain(W)===0){if(Y.minor&&!Y.patch)return"minor";return"patch"}}let H=z?"pre":"";if(X.major!==Q.major)return H+"major";if(X.minor!==Q.minor)return H+"minor";if(X.patch!==Q.patch)return H+"patch";return"prerelease"};Qq.exports=Gw});var Wq=x((nd,Gq)=>{var Ww=W$(),Yw=($,Z)=>new Ww($,Z).major;Gq.exports=Yw});var zq=x((rd,Yq)=>{var zw=W$(),qw=($,Z)=>new zw($,Z).minor;Yq.exports=qw});var Uq=x((ad,qq)=>{var Uw=W$(),Kw=($,Z)=>new Uw($,Z).patch;qq.exports=Kw});var Hq=x((od,Kq)=>{var Hw=T1(),Vw=($,Z)=>{let X=Hw($,Z);return X&&X.prerelease.length?X.prerelease:null};Kq.exports=Vw});var $6=x((sd,Bq)=>{var Vq=W$(),Bw=($,Z,X)=>new Vq($,X).compare(new Vq(Z,X));Bq.exports=Bw});var Lq=x((td,Fq)=>{var Fw=$6(),Lw=($,Z,X)=>Fw(Z,$,X);Fq.exports=Lw});var Aq=x((ed,Mq)=>{var Mw=$6(),Aw=($,Z)=>Mw($,Z,!0);Mq.exports=Aw});var L8=x(($l,Nq)=>{var Iq=W$(),Iw=($,Z,X)=>{let Q=new Iq($,X),J=new Iq(Z,X);return Q.compare(J)||Q.compareBuild(J)};Nq.exports=Iw});var wq=x((Zl,Dq)=>{var Nw=L8(),Dw=($,Z)=>$.sort((X,Q)=>Nw(X,Q,Z));Dq.exports=Dw});var jq=x((Xl,Tq)=>{var ww=L8(),Tw=($,Z)=>$.sort((X,Q)=>ww(Q,X,Z));Tq.exports=Tw});var C9=x((Ql,Oq)=>{var jw=$6(),Ow=($,Z,X)=>jw($,Z,X)>0;Oq.exports=Ow});var M8=x((Jl,Eq)=>{var Ew=$6(),Rw=($,Z,X)=>Ew($,Z,X)<0;Eq.exports=Rw});var zX=x((Gl,Rq)=>{var Pw=$6(),Cw=($,Z,X)=>Pw($,Z,X)===0;Rq.exports=Cw});var qX=x((Wl,Pq)=>{var Sw=$6(),_w=($,Z,X)=>Sw($,Z,X)!==0;Pq.exports=_w});var A8=x((Yl,Cq)=>{var xw=$6(),bw=($,Z,X)=>xw($,Z,X)>=0;Cq.exports=bw});var I8=x((zl,Sq)=>{var kw=$6(),yw=($,Z,X)=>kw($,Z,X)<=0;Sq.exports=yw});var UX=x((ql,_q)=>{var vw=zX(),gw=qX(),fw=C9(),hw=A8(),uw=M8(),mw=I8(),dw=($,Z,X,Q)=>{switch(Z){case"===":if(typeof $==="object")$=$.version;if(typeof X==="object")X=X.version;return $===X;case"!==":if(typeof $==="object")$=$.version;if(typeof X==="object")X=X.version;return $!==X;case"":case"=":case"==":return vw($,X,Q);case"!=":return gw($,X,Q);case">":return fw($,X,Q);case">=":return hw($,X,Q);case"<":return uw($,X,Q);case"<=":return mw($,X,Q);default:throw TypeError(`Invalid operator: ${Z}`)}};_q.exports=dw});var bq=x((Ul,xq)=>{var lw=W$(),cw=T1(),{safeRe:N8,t:D8}=P4(),pw=($,Z)=>{if($ instanceof lw)return $;if(typeof $==="number")$=String($);if(typeof $!=="string")return null;Z=Z||{};let X=null;if(!Z.rtl)X=$.match(Z.includePrerelease?N8[D8.COERCEFULL]:N8[D8.COERCE]);else{let z=Z.includePrerelease?N8[D8.COERCERTLFULL]:N8[D8.COERCERTL],q;while((q=z.exec($))&&(!X||X.index+X[0].length!==$.length)){if(!X||q.index+q[0].length!==X.index+X[0].length)X=q;z.lastIndex=q.index+q[1].length+q[2].length}z.lastIndex=-1}if(X===null)return null;let Q=X[2],J=X[3]||"0",G=X[4]||"0",W=Z.includePrerelease&&X[5]?`-${X[5]}`:"",Y=Z.includePrerelease&&X[6]?`+${X[6]}`:"";return cw(`${Q}.${J}.${G}${W}${Y}`,Z)};xq.exports=pw});var yq=x((Kl,kq)=>{var iw=T1(),nw=R4(),rw=W$(),aw=($,Z,X)=>{if(!nw.RELEASE_TYPES.includes(Z))return null;let Q=ow($,X);return Q&&sw(Q,Z)},ow=($,Z)=>{let X=$ instanceof rw?$.version:$;return iw(X,Z)},sw=($,Z)=>{if(tw(Z))return $.version;switch($.prerelease=[],Z){case"major":$.minor=0,$.patch=0;break;case"minor":$.patch=0;break}return $.format()},tw=($)=>{return $.startsWith("pre")};kq.exports=aw});var fq=x((Hl,gq)=>{class vq{constructor(){this.max=1000,this.map=new Map}get($){let Z=this.map.get($);if(Z===void 0)return;else return this.map.delete($),this.map.set($,Z),Z}delete($){return this.map.delete($)}set($,Z){if(!this.delete($)&&Z!==void 0){if(this.map.size>=this.max){let Q=this.map.keys().next().value;this.delete(Q)}this.map.set($,Z)}return this}}gq.exports=vq});var Z6=x((Vl,dq)=>{var ew=/\s+/g;class S9{constructor($,Z){if(Z=ZT(Z),$ instanceof S9)if($.loose===!!Z.loose&&$.includePrerelease===!!Z.includePrerelease)return $;else return new S9($.raw,Z);if($ instanceof KX)return this.raw=$.value,this.set=[[$]],this.formatted=void 0,this;if(this.options=Z,this.loose=!!Z.loose,this.includePrerelease=!!Z.includePrerelease,this.raw=$.trim().replace(ew," "),this.set=this.raw.split("||").map((X)=>this.parseRange(X.trim())).filter((X)=>X.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let X=this.set[0];if(this.set=this.set.filter((Q)=>!uq(Q[0])),this.set.length===0)this.set=[X];else if(this.set.length>1){for(let Q of this.set)if(Q.length===1&&UT(Q[0])){this.set=[Q];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let $=0;$<this.set.length;$++){if($>0)this.formatted+="||";let Z=this.set[$];for(let X=0;X<Z.length;X++){if(X>0)this.formatted+=" ";this.formatted+=Z[X].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange($){$=$.replace(qT,"");let X=((this.options.includePrerelease&&YT)|(this.options.loose&&zT))+":"+$,Q=hq.get(X);if(Q)return Q;let J=this.options.loose,G=J?D$[Y$.HYPHENRANGELOOSE]:D$[Y$.HYPHENRANGE];$=$.replace(G,DT(this.options.includePrerelease)),f0("hyphen replace",$),$=$.replace(D$[Y$.COMPARATORTRIM],JT),f0("comparator trim",$),$=$.replace(D$[Y$.TILDETRIM],GT),f0("tilde trim",$),$=$.replace(D$[Y$.CARETTRIM],WT),f0("caret trim",$);let W=$.split(" ").map((H)=>KT(H,this.options)).join(" ").split(/\s+/).map((H)=>NT(H,this.options));if(J)W=W.filter((H)=>{return f0("loose invalid filter",H,this.options),!!H.match(D$[Y$.COMPARATORLOOSE])});f0("range list",W);let Y=new Map,z=W.map((H)=>new KX(H,this.options));for(let H of z){if(uq(H))return[H];Y.set(H.value,H)}if(Y.size>1&&Y.has(""))Y.delete("");let q=[...Y.values()];return hq.set(X,q),q}intersects($,Z){if(!($ instanceof S9))throw TypeError("a Range is required");return this.set.some((X)=>{return mq(X,Z)&&$.set.some((Q)=>{return mq(Q,Z)&&X.every((J)=>{return Q.every((G)=>{return J.intersects(G,Z)})})})})}test($){if(!$)return!1;if(typeof $==="string")try{$=new XT($,this.options)}catch(Z){return!1}for(let Z=0;Z<this.set.length;Z++)if(wT(this.set[Z],$,this.options))return!0;return!1}}dq.exports=S9;var $T=fq(),hq=new $T,ZT=K8(),KX=_9(),f0=P9(),XT=W$(),{safeRe:D$,src:QT,t:Y$,comparatorTrimReplace:JT,tildeTrimReplace:GT,caretTrimReplace:WT}=P4(),{FLAG_INCLUDE_PRERELEASE:YT,FLAG_LOOSE:zT}=R4(),qT=new RegExp(QT[Y$.BUILD],"g"),uq=($)=>$.value==="<0.0.0-0",UT=($)=>$.value==="",mq=($,Z)=>{let X=!0,Q=$.slice(),J=Q.pop();while(X&&Q.length)X=Q.every((G)=>{return J.intersects(G,Z)}),J=Q.pop();return X},KT=($,Z)=>{return $=$.replace(D$[Y$.BUILD],""),f0("comp",$,Z),$=FT($,Z),f0("caret",$),$=VT($,Z),f0("tildes",$),$=MT($,Z),f0("xrange",$),$=IT($,Z),f0("stars",$),$},e0=($)=>!$||$.toLowerCase()==="x"||$==="*",HT=($,Z,X)=>e0($)&&!e0(Z)||e0(Z)&&X&&!e0(X),VT=($,Z)=>{return $.trim().split(/\s+/).map((X)=>BT(X,Z)).join(" ")},BT=($,Z)=>{let X=Z.loose?D$[Y$.TILDELOOSE]:D$[Y$.TILDE],Q=Z.includePrerelease?"-0":"";return $.replace(X,(J,G,W,Y,z)=>{f0("tilde",$,J,G,W,Y,z);let q;if(e0(G))q="";else if(e0(W))q=`>=${G}.0.0${Q} <${+G+1}.0.0-0`;else if(e0(Y))q=`>=${G}.${W}.0${Q} <${G}.${+W+1}.0-0`;else if(z)f0("replaceTilde pr",z),q=`>=${G}.${W}.${Y}-${z} <${G}.${+W+1}.0-0`;else q=`>=${G}.${W}.${Y} <${G}.${+W+1}.0-0`;return f0("tilde return",q),q})},FT=($,Z)=>{return $.trim().split(/\s+/).map((X)=>LT(X,Z)).join(" ")},LT=($,Z)=>{f0("caret",$,Z);let X=Z.loose?D$[Y$.CARETLOOSE]:D$[Y$.CARET],Q=Z.includePrerelease?"-0":"";return $.replace(X,(J,G,W,Y,z)=>{f0("caret",$,J,G,W,Y,z);let q;if(e0(G))q="";else if(e0(W))q=`>=${G}.0.0${Q} <${+G+1}.0.0-0`;else if(e0(Y))if(G==="0")q=`>=${G}.${W}.0${Q} <${G}.${+W+1}.0-0`;else q=`>=${G}.${W}.0${Q} <${+G+1}.0.0-0`;else if(z)if(f0("replaceCaret pr",z),G==="0")if(W==="0")q=`>=${G}.${W}.${Y}-${z} <${G}.${W}.${+Y+1}-0`;else q=`>=${G}.${W}.${Y}-${z} <${G}.${+W+1}.0-0`;else q=`>=${G}.${W}.${Y}-${z} <${+G+1}.0.0-0`;else if(f0("no pr"),G==="0")if(W==="0")q=`>=${G}.${W}.${Y} <${G}.${W}.${+Y+1}-0`;else q=`>=${G}.${W}.${Y} <${G}.${+W+1}.0-0`;else q=`>=${G}.${W}.${Y} <${+G+1}.0.0-0`;return f0("caret return",q),q})},MT=($,Z)=>{return f0("replaceXRanges",$,Z),$.split(/\s+/).map((X)=>AT(X,Z)).join(" ")},AT=($,Z)=>{$=$.trim();let X=Z.loose?D$[Y$.XRANGELOOSE]:D$[Y$.XRANGE];return $.replace(X,(Q,J,G,W,Y,z)=>{if(f0("xRange",$,Q,J,G,W,Y,z),HT(G,W,Y))return $;let q=e0(G),H=q||e0(W),B=H||e0(Y),F=B;if(J==="="&&F)J="";if(z=Z.includePrerelease?"-0":"",q)if(J===">"||J==="<")Q="<0.0.0-0";else Q="*";else if(J&&F){if(H)W=0;if(Y=0,J===">")if(J=">=",H)G=+G+1,W=0,Y=0;else W=+W+1,Y=0;else if(J==="<=")if(J="<",H)G=+G+1;else W=+W+1;if(J==="<")z="-0";Q=`${J+G}.${W}.${Y}${z}`}else if(H)Q=`>=${G}.0.0${z} <${+G+1}.0.0-0`;else if(B)Q=`>=${G}.${W}.0${z} <${G}.${+W+1}.0-0`;return f0("xRange return",Q),Q})},IT=($,Z)=>{return f0("replaceStars",$,Z),$.trim().replace(D$[Y$.STAR],"")},NT=($,Z)=>{return f0("replaceGTE0",$,Z),$.trim().replace(D$[Z.includePrerelease?Y$.GTE0PRE:Y$.GTE0],"")},DT=($)=>(Z,X,Q,J,G,W,Y,z,q,H,B,F)=>{if(e0(Q))X="";else if(e0(J))X=`>=${Q}.0.0${$?"-0":""}`;else if(e0(G))X=`>=${Q}.${J}.0${$?"-0":""}`;else if(W)X=`>=${X}`;else X=`>=${X}${$?"-0":""}`;if(e0(q))z="";else if(e0(H))z=`<${+q+1}.0.0-0`;else if(e0(B))z=`<${q}.${+H+1}.0-0`;else if(F)z=`<=${q}.${H}.${B}-${F}`;else if($)z=`<${q}.${H}.${+B+1}-0`;else z=`<=${z}`;return`${X} ${z}`.trim()},wT=($,Z,X)=>{for(let Q=0;Q<$.length;Q++)if(!$[Q].test(Z))return!1;if(Z.prerelease.length&&!X.includePrerelease){for(let Q=0;Q<$.length;Q++){if(f0($[Q].semver),$[Q].semver===KX.ANY)continue;if($[Q].semver.prerelease.length>0){let J=$[Q].semver;if(J.major===Z.major&&J.minor===Z.minor&&J.patch===Z.patch)return!0}}return!1}return!0}});var _9=x((Bl,rq)=>{var x9=Symbol("SemVer ANY");class w8{static get ANY(){return x9}constructor($,Z){if(Z=lq(Z),$ instanceof w8)if($.loose===!!Z.loose)return $;else $=$.value;if($=$.trim().split(/\s+/).join(" "),VX("comparator",$,Z),this.options=Z,this.loose=!!Z.loose,this.parse($),this.semver===x9)this.value="";else this.value=this.operator+this.semver.version;VX("comp",this)}parse($){let Z=this.options.loose?cq[pq.COMPARATORLOOSE]:cq[pq.COMPARATOR],X=$.match(Z);if(!X)throw TypeError(`Invalid comparator: ${$}`);if(this.operator=X[1]!==void 0?X[1]:"",this.operator==="=")this.operator="";if(!X[2])this.semver=x9;else this.semver=new iq(X[2],this.options.loose)}toString(){return this.value}test($){if(VX("Comparator.test",$,this.options.loose),this.semver===x9||$===x9)return!0;if(typeof $==="string")try{$=new iq($,this.options)}catch(Z){return!1}return HX($,this.operator,this.semver,this.options)}intersects($,Z){if(!($ instanceof w8))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new nq($.value,Z).test(this.value)}else if($.operator===""){if($.value==="")return!0;return new nq(this.value,Z).test($.semver)}if(Z=lq(Z),Z.includePrerelease&&(this.value==="<0.0.0-0"||$.value==="<0.0.0-0"))return!1;if(!Z.includePrerelease&&(this.value.startsWith("<0.0.0")||$.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&$.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&$.operator.startsWith("<"))return!0;if(this.semver.version===$.semver.version&&this.operator.includes("=")&&$.operator.includes("="))return!0;if(HX(this.semver,"<",$.semver,Z)&&this.operator.startsWith(">")&&$.operator.startsWith("<"))return!0;if(HX(this.semver,">",$.semver,Z)&&this.operator.startsWith("<")&&$.operator.startsWith(">"))return!0;return!1}}rq.exports=w8;var lq=K8(),{safeRe:cq,t:pq}=P4(),HX=UX(),VX=P9(),iq=W$(),nq=Z6()});var b9=x((Fl,aq)=>{var TT=Z6(),jT=($,Z,X)=>{try{Z=new TT(Z,X)}catch(Q){return!1}return Z.test($)};aq.exports=jT});var sq=x((Ll,oq)=>{var OT=Z6(),ET=($,Z)=>new OT($,Z).set.map((X)=>X.map((Q)=>Q.value).join(" ").trim().split(" "));oq.exports=ET});var eq=x((Ml,tq)=>{var RT=W$(),PT=Z6(),CT=($,Z,X)=>{let Q=null,J=null,G=null;try{G=new PT(Z,X)}catch(W){return null}return $.forEach((W)=>{if(G.test(W)){if(!Q||J.compare(W)===-1)Q=W,J=new RT(Q,X)}}),Q};tq.exports=CT});var ZU=x((Al,$U)=>{var ST=W$(),_T=Z6(),xT=($,Z,X)=>{let Q=null,J=null,G=null;try{G=new _T(Z,X)}catch(W){return null}return $.forEach((W)=>{if(G.test(W)){if(!Q||J.compare(W)===1)Q=W,J=new ST(Q,X)}}),Q};$U.exports=xT});var JU=x((Il,QU)=>{var BX=W$(),bT=Z6(),XU=C9(),kT=($,Z)=>{$=new bT($,Z);let X=new BX("0.0.0");if($.test(X))return X;if(X=new BX("0.0.0-0"),$.test(X))return X;X=null;for(let Q=0;Q<$.set.length;++Q){let J=$.set[Q],G=null;if(J.forEach((W)=>{let Y=new BX(W.semver.version);switch(W.operator){case">":if(Y.prerelease.length===0)Y.patch++;else Y.prerelease.push(0);Y.raw=Y.format();case"":case">=":if(!G||XU(Y,G))G=Y;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${W.operator}`)}}),G&&(!X||XU(X,G)))X=G}if(X&&$.test(X))return X;return null};QU.exports=kT});var WU=x((Nl,GU)=>{var yT=Z6(),vT=($,Z)=>{try{return new yT($,Z).range||"*"}catch(X){return null}};GU.exports=vT});var T8=x((Dl,UU)=>{var gT=W$(),qU=_9(),{ANY:fT}=qU,hT=Z6(),uT=b9(),YU=C9(),zU=M8(),mT=I8(),dT=A8(),lT=($,Z,X,Q)=>{$=new gT($,Q),Z=new hT(Z,Q);let J,G,W,Y,z;switch(X){case">":J=YU,G=mT,W=zU,Y=">",z=">=";break;case"<":J=zU,G=dT,W=YU,Y="<",z="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(uT($,Z,Q))return!1;for(let q=0;q<Z.set.length;++q){let H=Z.set[q],B=null,F=null;if(H.forEach((M)=>{if(M.semver===fT)M=new qU(">=0.0.0");if(B=B||M,F=F||M,J(M.semver,B.semver,Q))B=M;else if(W(M.semver,F.semver,Q))F=M}),B.operator===Y||B.operator===z)return!1;if((!F.operator||F.operator===Y)&&G($,F.semver))return!1;else if(F.operator===z&&W($,F.semver))return!1}return!0};UU.exports=lT});var HU=x((wl,KU)=>{var cT=T8(),pT=($,Z,X)=>cT($,Z,">",X);KU.exports=pT});var BU=x((Tl,VU)=>{var iT=T8(),nT=($,Z,X)=>iT($,Z,"<",X);VU.exports=nT});var MU=x((jl,LU)=>{var FU=Z6(),rT=($,Z,X)=>{return $=new FU($,X),Z=new FU(Z,X),$.intersects(Z,X)};LU.exports=rT});var IU=x((Ol,AU)=>{var aT=b9(),oT=$6();AU.exports=($,Z,X)=>{let Q=[],J=null,G=null,W=$.sort((H,B)=>oT(H,B,X));for(let H of W)if(aT(H,Z,X)){if(G=H,!J)J=H}else{if(G)Q.push([J,G]);G=null,J=null}if(J)Q.push([J,null]);let Y=[];for(let[H,B]of Q)if(H===B)Y.push(H);else if(!B&&H===W[0])Y.push("*");else if(!B)Y.push(`>=${H}`);else if(H===W[0])Y.push(`<=${B}`);else Y.push(`${H} - ${B}`);let z=Y.join(" || "),q=typeof Z.raw==="string"?Z.raw:String(Z);return z.length<q.length?z:Z}});var OU=x((El,jU)=>{var NU=Z6(),MX=_9(),{ANY:FX}=MX,LX=b9(),AX=$6(),sT=($,Z,X={})=>{if($===Z)return!0;$=new NU($,X),Z=new NU(Z,X);let Q=!1;$:for(let J of $.set){for(let G of Z.set){let W=eT(J,G,X);if(Q=Q||W!==null,W)continue $}if(Q)return!1}return!0},tT=[new MX(">=0.0.0-0")],DU=[new MX(">=0.0.0")],eT=($,Z,X)=>{if($===Z)return!0;if($.length===1&&$[0].semver===FX)if(Z.length===1&&Z[0].semver===FX)return!0;else if(X.includePrerelease)$=tT;else $=DU;if(Z.length===1&&Z[0].semver===FX)if(X.includePrerelease)return!0;else Z=DU;let Q=new Set,J,G;for(let M of $)if(M.operator===">"||M.operator===">=")J=wU(J,M,X);else if(M.operator==="<"||M.operator==="<=")G=TU(G,M,X);else Q.add(M.semver);if(Q.size>1)return null;let W;if(J&&G){if(W=AX(J.semver,G.semver,X),W>0)return null;else if(W===0&&(J.operator!==">="||G.operator!=="<="))return null}for(let M of Q){if(J&&!LX(M,String(J),X))return null;if(G&&!LX(M,String(G),X))return null;for(let A of Z)if(!LX(M,String(A),X))return!1;return!0}let Y,z,q,H,B=G&&!X.includePrerelease&&G.semver.prerelease.length?G.semver:!1,F=J&&!X.includePrerelease&&J.semver.prerelease.length?J.semver:!1;if(B&&B.prerelease.length===1&&G.operator==="<"&&B.prerelease[0]===0)B=!1;for(let M of Z){if(H=H||M.operator===">"||M.operator===">=",q=q||M.operator==="<"||M.operator==="<=",J){if(F){if(M.semver.prerelease&&M.semver.prerelease.length&&M.semver.major===F.major&&M.semver.minor===F.minor&&M.semver.patch===F.patch)F=!1}if(M.operator===">"||M.operator===">="){if(Y=wU(J,M,X),Y===M&&Y!==J)return!1}else if(J.operator===">="&&!M.test(J.semver))return!1}if(G){if(B){if(M.semver.prerelease&&M.semver.prerelease.length&&M.semver.major===B.major&&M.semver.minor===B.minor&&M.semver.patch===B.patch)B=!1}if(M.operator==="<"||M.operator==="<="){if(z=TU(G,M,X),z===M&&z!==G)return!1}else if(G.operator==="<="&&!M.test(G.semver))return!1}if(!M.operator&&(G||J)&&W!==0)return!1}if(J&&q&&!G&&W!==0)return!1;if(G&&H&&!J&&W!==0)return!1;if(F||B)return!1;return!0},wU=($,Z,X)=>{if(!$)return Z;let Q=AX($.semver,Z.semver,X);return Q>0?$:Q<0?Z:Z.operator===">"&&$.operator===">="?Z:$},TU=($,Z,X)=>{if(!$)return Z;let Q=AX($.semver,Z.semver,X);return Q<0?$:Q>0?Z:Z.operator==="<"&&$.operator==="<="?Z:$};jU.exports=sT});var CU=x((Rl,PU)=>{var IX=P4(),EU=R4(),$j=W$(),RU=WX(),Zj=T1(),Xj=oz(),Qj=tz(),Jj=Zq(),Gj=Jq(),Wj=Wq(),Yj=zq(),zj=Uq(),qj=Hq(),Uj=$6(),Kj=Lq(),Hj=Aq(),Vj=L8(),Bj=wq(),Fj=jq(),Lj=C9(),Mj=M8(),Aj=zX(),Ij=qX(),Nj=A8(),Dj=I8(),wj=UX(),Tj=bq(),jj=yq(),Oj=_9(),Ej=Z6(),Rj=b9(),Pj=sq(),Cj=eq(),Sj=ZU(),_j=JU(),xj=WU(),bj=T8(),kj=HU(),yj=BU(),vj=MU(),gj=IU(),fj=OU();PU.exports={parse:Zj,valid:Xj,clean:Qj,inc:Jj,diff:Gj,major:Wj,minor:Yj,patch:zj,prerelease:qj,compare:Uj,rcompare:Kj,compareLoose:Hj,compareBuild:Vj,sort:Bj,rsort:Fj,gt:Lj,lt:Mj,eq:Aj,neq:Ij,gte:Nj,lte:Dj,cmp:wj,coerce:Tj,truncate:jj,Comparator:Oj,Range:Ej,satisfies:Rj,toComparators:Pj,maxSatisfying:Cj,minSatisfying:Sj,minVersion:_j,validRange:xj,outside:bj,gtr:kj,ltr:yj,intersects:vj,simplifyRange:gj,subset:fj,SemVer:$j,re:IX.re,src:IX.src,tokens:IX.t,SEMVER_SPEC_VERSION:EU.SEMVER_SPEC_VERSION,RELEASE_TYPES:EU.RELEASE_TYPES,compareIdentifiers:RU.compareIdentifiers,rcompareIdentifiers:RU.rcompareIdentifiers}});var s6;var j8=s(()=>{s6={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 k9}from"node:child_process";import{createHash as uj}from"node:crypto";var y9,DX,mj,_U,dj,wX,lj=($)=>{if($ instanceof Error)console.error(`sharp: Installation error: ${$.message}`);else console.log(`sharp: ${$}`)},xU=()=>DX.default.isNonGlibcLinuxSync()?DX.default.familySync():"",cj=()=>`${process.platform}${xU()}-${process.arch}`,C4=()=>{if(bU())return"wasm32";let{npm_config_arch:$,npm_config_platform:Z,npm_config_libc:X}=process.env,Q=typeof X==="string"?X:xU();return`${Z||process.platform}${Q}-${$||process.arch}`},pj=()=>{try{return O0(`@img/sharp-libvips-dev-${C4()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},ij=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},nj=()=>{try{return O0(`@img/sharp-libvips-dev-${C4()}/lib`)}catch{try{return O0(`@img/sharp-libvips-${C4()}/lib`)}catch{}}return""},rj=()=>{if(process.release?.name==="node"&&process.versions){if(!y9.default.satisfies(process.versions.node,s6.engines.node))return{found:process.versions.node,expected:s6.engines.node}}},bU=()=>{let{CC:$}=process.env;return Boolean($?.endsWith("/emcc"))},aj=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(k9("sysctl sysctl.proc_translated",wX).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},SU=($)=>uj("sha512").update($).digest("hex"),oj=()=>{try{let $=SU(`imgsharp-libvips-${C4()}`),Z=y9.default.coerce(s6.optionalDependencies[`@img/sharp-libvips-${C4()}`],{includePrerelease:!0}).version;return SU(`${$}npm:${Z}`).slice(0,10)}catch{}return""},sj=()=>k9(`node-gyp rebuild --directory=src ${bU()?"--nodedir=emscripten":""}`,{...wX,stdio:"inherit"}).status,kU=()=>{if(process.platform!=="win32")return(k9("pkg-config --modversion vips-cpp",{...wX,env:{...process.env,PKG_CONFIG_PATH:yU()}}).stdout||"").trim();else return""},tj=()=>{try{let $=(k9("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if($)return`${$}/lib/pkgconfig`}catch($){}return},ej=()=>{try{let $=(k9("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if($)return $}catch($){}return},yU=()=>{if(process.platform!=="win32")return[tj(),ej(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},NX=($,Z,X)=>{if(X)X(`Detected ${Z}, skipping search for globally-installed libvips`);return $},$O=($)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return NX(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",$);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return NX(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",$);if(aj())return NX(!1,"Rosetta",$);let Z=kU();return!!Z&&y9.default.gte(Z,_U)},O8;var TX=s(()=>{j8();y9=B$(CU(),1),DX=B$(U8(),1);/*!
|
|
285
|
+
*/U={defined:Oz,object:ND,plainObject:DD,fn:wD,bool:TD,buffer:jD,typedArray:OD,arrayBuffer:ED,string:RD,number:PD,integer:CD,inRange:SD,inArray:_D,invalidParameterError:bD,nativeError:xD}});var Pz=b((Xl,Rz)=>{var Ez=()=>process.platform==="linux",A5=null,kD=()=>{if(!A5)if(Ez()&&process.report){let $=process.report.excludeNetwork;process.report.excludeNetwork=!0,A5=process.report.getReport(),process.report.excludeNetwork=$}else A5={};return A5};Rz.exports={isLinux:Ez,getReport:kD}});var Sz=b((Ql,Cz)=>{var b4=O0("fs"),yD=($)=>{let Z=b4.openSync($,"r"),X=Buffer.alloc(2048),Q=b4.readSync(Z,X,0,2048,0);return b4.close(Z,()=>{}),X.subarray(0,Q)},vD=($)=>new Promise((Z,X)=>{b4.open($,"r",(Q,J)=>{if(Q)X(Q);else{let G=Buffer.alloc(2048);b4.read(J,G,0,2048,0,(W,Y)=>{Z(G.subarray(0,Y)),b4.close(J,()=>{})})}})});Cz.exports={LDD_PATH:"/usr/bin/ldd",SELF_PATH:"/proc/self/exe",readFileSync:yD,readFile:vD}});var bz=b((Jl,_z)=>{var gD=($)=>{if($.length<64)return null;if($.readUInt32BE(0)!==2135247942)return null;if($.readUInt8(4)!==2)return null;if($.readUInt8(5)!==1)return null;let Z=$.readUInt32LE(32),X=$.readUInt16LE(54),Q=$.readUInt16LE(56);for(let J=0;J<Q;J++){let G=Z+J*X;if($.readUInt32LE(G)===3){let Y=$.readUInt32LE(G+8),z=$.readUInt32LE(G+32);return $.subarray(Y,Y+z).toString().replace(/\0.*$/g,"")}}return null};_z.exports={interpreterPath:gD}});var N5=b((Gl,az)=>{var kz=O0("child_process"),{isLinux:x4,getReport:yz}=Pz(),{LDD_PATH:I5,SELF_PATH:vz,readFile:UX,readFileSync:HX}=Sz(),{interpreterPath:gz}=bz(),S1,_1,b1,O6="",fz=()=>{if(!O6)return new Promise(($)=>{kz.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(Z,X)=>{O6=Z?" ":X,$(O6)})});return O6},hz=()=>{if(!O6)try{O6=kz.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch($){O6=" "}return O6},t1="glibc",uz=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,$4="musl",fD=($)=>$.includes("libc.musl-")||$.includes("ld-musl-"),mz=()=>{let $=yz();if($.header&&$.header.glibcVersionRuntime)return t1;if(Array.isArray($.sharedObjects)){if($.sharedObjects.some(fD))return $4}return null},dz=($)=>{let[Z,X]=$.split(/[\r\n]+/);if(Z&&Z.includes(t1))return t1;if(X&&X.includes($4))return $4;return null},lz=($)=>{if($){if($.includes("/ld-musl-"))return $4;else if($.includes("/ld-linux-"))return t1}return null},cz=($)=>{if($=$.toString(),$.includes("musl"))return $4;if($.includes("GNU C Library"))return t1;return null},hD=async()=>{if(_1!==void 0)return _1;_1=null;try{let $=await UX(I5);_1=cz($)}catch($){}return _1},uD=()=>{if(_1!==void 0)return _1;_1=null;try{let $=HX(I5);_1=cz($)}catch($){}return _1},mD=async()=>{if(S1!==void 0)return S1;S1=null;try{let $=await UX(vz),Z=gz($);S1=lz(Z)}catch($){}return S1},dD=()=>{if(S1!==void 0)return S1;S1=null;try{let $=HX(vz),Z=gz($);S1=lz(Z)}catch($){}return S1},pz=async()=>{let $=null;if(x4()){if($=await mD(),!$){if($=await hD(),!$)$=mz();if(!$){let Z=await fz();$=dz(Z)}}}return $},iz=()=>{let $=null;if(x4()){if($=dD(),!$){if($=uD(),!$)$=mz();if(!$){let Z=hz();$=dz(Z)}}}return $},lD=async()=>x4()&&await pz()!==t1,cD=()=>x4()&&iz()!==t1,pD=async()=>{if(b1!==void 0)return b1;b1=null;try{let Z=(await UX(I5)).match(uz);if(Z)b1=Z[1]}catch($){}return b1},iD=()=>{if(b1!==void 0)return b1;b1=null;try{let Z=HX(I5).match(uz);if(Z)b1=Z[1]}catch($){}return b1},nz=()=>{let $=yz();if($.header&&$.header.glibcVersionRuntime)return $.header.glibcVersionRuntime;return null},xz=($)=>$.trim().split(/\s+/)[1],rz=($)=>{let[Z,X,Q]=$.split(/[\r\n]+/);if(Z&&Z.includes(t1))return xz(Z);if(X&&Q&&X.includes($4))return xz(Q);return null},nD=async()=>{let $=null;if(x4()){if($=await pD(),!$)$=nz();if(!$){let Z=await fz();$=rz(Z)}}return $},rD=()=>{let $=null;if(x4()){if($=iD(),!$)$=nz();if(!$){let Z=hz();$=rz(Z)}}return $};az.exports={GLIBC:t1,MUSL:$4,family:pz,familySync:iz,isNonGlibcLinux:lD,isNonGlibcLinuxSync:cD,version:nD,versionSync:rD}});var k4=b((Wl,oz)=>{var aD=Number.MAX_SAFE_INTEGER||9007199254740991,oD=["major","premajor","minor","preminor","patch","prepatch","prerelease"];oz.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:aD,RELEASE_TYPES:oD,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var k9=b((Yl,sz)=>{var sD=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...$)=>console.error("SEMVER",...$):()=>{};sz.exports=sD});var y4=b((x1,tz)=>{var{MAX_SAFE_COMPONENT_LENGTH:VX,MAX_SAFE_BUILD_LENGTH:tD,MAX_LENGTH:eD}=k4(),$w=k9();x1=tz.exports={};var Zw=x1.re=[],Xw=x1.safeRe=[],z0=x1.src=[],Qw=x1.safeSrc=[],q0=x1.t={},Jw=0,BX="[a-zA-Z0-9-]",Gw=[["\\s",1],["\\d",eD],[BX,tD]],Ww=($)=>{for(let[Z,X]of Gw)$=$.split(`${Z}*`).join(`${Z}{0,${X}}`).split(`${Z}+`).join(`${Z}{1,${X}}`);return $},T0=($,Z,X)=>{let Q=Ww(Z),J=Jw++;$w($,J,Z),q0[$]=J,z0[J]=Z,Qw[J]=Q,Zw[J]=new RegExp(Z,X?"g":void 0),Xw[J]=new RegExp(Q,X?"g":void 0)};T0("NUMERICIDENTIFIER","0|[1-9]\\d*");T0("NUMERICIDENTIFIERLOOSE","\\d+");T0("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${BX}*`);T0("MAINVERSION",`(${z0[q0.NUMERICIDENTIFIER]})\\.(${z0[q0.NUMERICIDENTIFIER]})\\.(${z0[q0.NUMERICIDENTIFIER]})`);T0("MAINVERSIONLOOSE",`(${z0[q0.NUMERICIDENTIFIERLOOSE]})\\.(${z0[q0.NUMERICIDENTIFIERLOOSE]})\\.(${z0[q0.NUMERICIDENTIFIERLOOSE]})`);T0("PRERELEASEIDENTIFIER",`(?:${z0[q0.NONNUMERICIDENTIFIER]}|${z0[q0.NUMERICIDENTIFIER]})`);T0("PRERELEASEIDENTIFIERLOOSE",`(?:${z0[q0.NONNUMERICIDENTIFIER]}|${z0[q0.NUMERICIDENTIFIERLOOSE]})`);T0("PRERELEASE",`(?:-(${z0[q0.PRERELEASEIDENTIFIER]}(?:\\.${z0[q0.PRERELEASEIDENTIFIER]})*))`);T0("PRERELEASELOOSE",`(?:-?(${z0[q0.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z0[q0.PRERELEASEIDENTIFIERLOOSE]})*))`);T0("BUILDIDENTIFIER",`${BX}+`);T0("BUILD",`(?:\\+(${z0[q0.BUILDIDENTIFIER]}(?:\\.${z0[q0.BUILDIDENTIFIER]})*))`);T0("FULLPLAIN",`v?${z0[q0.MAINVERSION]}${z0[q0.PRERELEASE]}?${z0[q0.BUILD]}?`);T0("FULL",`^${z0[q0.FULLPLAIN]}$`);T0("LOOSEPLAIN",`[v=\\s]*${z0[q0.MAINVERSIONLOOSE]}${z0[q0.PRERELEASELOOSE]}?${z0[q0.BUILD]}?`);T0("LOOSE",`^${z0[q0.LOOSEPLAIN]}$`);T0("GTLT","((?:<|>)?=?)");T0("XRANGEIDENTIFIERLOOSE",`${z0[q0.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);T0("XRANGEIDENTIFIER",`${z0[q0.NUMERICIDENTIFIER]}|x|X|\\*`);T0("XRANGEPLAIN",`[v=\\s]*(${z0[q0.XRANGEIDENTIFIER]})(?:\\.(${z0[q0.XRANGEIDENTIFIER]})(?:\\.(${z0[q0.XRANGEIDENTIFIER]})(?:${z0[q0.PRERELEASE]})?${z0[q0.BUILD]}?)?)?`);T0("XRANGEPLAINLOOSE",`[v=\\s]*(${z0[q0.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z0[q0.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z0[q0.XRANGEIDENTIFIERLOOSE]})(?:${z0[q0.PRERELEASELOOSE]})?${z0[q0.BUILD]}?)?)?`);T0("XRANGE",`^${z0[q0.GTLT]}\\s*${z0[q0.XRANGEPLAIN]}$`);T0("XRANGELOOSE",`^${z0[q0.GTLT]}\\s*${z0[q0.XRANGEPLAINLOOSE]}$`);T0("COERCEPLAIN",`(^|[^\\d])(\\d{1,${VX}})(?:\\.(\\d{1,${VX}}))?(?:\\.(\\d{1,${VX}}))?`);T0("COERCE",`${z0[q0.COERCEPLAIN]}(?:$|[^\\d])`);T0("COERCEFULL",z0[q0.COERCEPLAIN]+`(?:${z0[q0.PRERELEASE]})?(?:${z0[q0.BUILD]})?(?:$|[^\\d])`);T0("COERCERTL",z0[q0.COERCE],!0);T0("COERCERTLFULL",z0[q0.COERCEFULL],!0);T0("LONETILDE","(?:~>?)");T0("TILDETRIM",`(\\s*)${z0[q0.LONETILDE]}\\s+`,!0);x1.tildeTrimReplace="$1~";T0("TILDE",`^${z0[q0.LONETILDE]}${z0[q0.XRANGEPLAIN]}$`);T0("TILDELOOSE",`^${z0[q0.LONETILDE]}${z0[q0.XRANGEPLAINLOOSE]}$`);T0("LONECARET","(?:\\^)");T0("CARETTRIM",`(\\s*)${z0[q0.LONECARET]}\\s+`,!0);x1.caretTrimReplace="$1^";T0("CARET",`^${z0[q0.LONECARET]}${z0[q0.XRANGEPLAIN]}$`);T0("CARETLOOSE",`^${z0[q0.LONECARET]}${z0[q0.XRANGEPLAINLOOSE]}$`);T0("COMPARATORLOOSE",`^${z0[q0.GTLT]}\\s*(${z0[q0.LOOSEPLAIN]})$|^$`);T0("COMPARATOR",`^${z0[q0.GTLT]}\\s*(${z0[q0.FULLPLAIN]})$|^$`);T0("COMPARATORTRIM",`(\\s*)${z0[q0.GTLT]}\\s*(${z0[q0.LOOSEPLAIN]}|${z0[q0.XRANGEPLAIN]})`,!0);x1.comparatorTrimReplace="$1$2$3";T0("HYPHENRANGE",`^\\s*(${z0[q0.XRANGEPLAIN]})\\s+-\\s+(${z0[q0.XRANGEPLAIN]})\\s*$`);T0("HYPHENRANGELOOSE",`^\\s*(${z0[q0.XRANGEPLAINLOOSE]})\\s+-\\s+(${z0[q0.XRANGEPLAINLOOSE]})\\s*$`);T0("STAR","(<|>)?=?\\s*\\*");T0("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");T0("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var D5=b((zl,ez)=>{var Yw=Object.freeze({loose:!0}),zw=Object.freeze({}),qw=($)=>{if(!$)return zw;if(typeof $!=="object")return Yw;return $};ez.exports=qw});var FX=b((ql,Xq)=>{var $q=/^[0-9]+$/,Zq=($,Z)=>{if(typeof $==="number"&&typeof Z==="number")return $===Z?0:$<Z?-1:1;let X=$q.test($),Q=$q.test(Z);if(X&&Q)$=+$,Z=+Z;return $===Z?0:X&&!Q?-1:Q&&!X?1:$<Z?-1:1},Kw=($,Z)=>Zq(Z,$);Xq.exports={compareIdentifiers:Zq,rcompareIdentifiers:Kw}});var W$=b((Kl,Jq)=>{var w5=k9(),{MAX_LENGTH:Qq,MAX_SAFE_INTEGER:T5}=k4(),{safeRe:j5,t:O5}=y4(),Uw=D5(),{compareIdentifiers:LX}=FX(),Hw=($,Z)=>{let X=Z.split(".");if(X.length>$.length)return!1;for(let Q=0;Q<X.length;Q++)if(LX($[Q],X[Q])!==0)return!1;return!0};class K1{constructor($,Z){if(Z=Uw(Z),$ instanceof K1)if($.loose===!!Z.loose&&$.includePrerelease===!!Z.includePrerelease)return $;else $=$.version;else if(typeof $!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof $}".`);if($.length>Qq)throw TypeError(`version is longer than ${Qq} characters`);w5("SemVer",$,Z),this.options=Z,this.loose=!!Z.loose,this.includePrerelease=!!Z.includePrerelease;let X=$.trim().match(Z.loose?j5[O5.LOOSE]:j5[O5.FULL]);if(!X)throw TypeError(`Invalid Version: ${$}`);if(this.raw=$,this.major=+X[1],this.minor=+X[2],this.patch=+X[3],this.major>T5||this.major<0)throw TypeError("Invalid major version");if(this.minor>T5||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>T5||this.patch<0)throw TypeError("Invalid patch version");if(!X[4])this.prerelease=[];else this.prerelease=X[4].split(".").map((Q)=>{if(/^[0-9]+$/.test(Q)){let J=+Q;if(J>=0&&J<T5)return J}return Q});this.build=X[5]?X[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare($){if(w5("SemVer.compare",this.version,this.options,$),!($ instanceof K1)){if(typeof $==="string"&&$===this.version)return 0;$=new K1($,this.options)}if($.version===this.version)return 0;return this.compareMain($)||this.comparePre($)}compareMain($){if(!($ instanceof K1))$=new K1($,this.options);if(this.major<$.major)return-1;if(this.major>$.major)return 1;if(this.minor<$.minor)return-1;if(this.minor>$.minor)return 1;if(this.patch<$.patch)return-1;if(this.patch>$.patch)return 1;return 0}comparePre($){if(!($ instanceof K1))$=new K1($,this.options);if(this.prerelease.length&&!$.prerelease.length)return-1;else if(!this.prerelease.length&&$.prerelease.length)return 1;else if(!this.prerelease.length&&!$.prerelease.length)return 0;let Z=0;do{let X=this.prerelease[Z],Q=$.prerelease[Z];if(w5("prerelease compare",Z,X,Q),X===void 0&&Q===void 0)return 0;else if(Q===void 0)return 1;else if(X===void 0)return-1;else if(X===Q)continue;else return LX(X,Q)}while(++Z)}compareBuild($){if(!($ instanceof K1))$=new K1($,this.options);let Z=0;do{let X=this.build[Z],Q=$.build[Z];if(w5("build compare",Z,X,Q),X===void 0&&Q===void 0)return 0;else if(Q===void 0)return 1;else if(X===void 0)return-1;else if(X===Q)continue;else return LX(X,Q)}while(++Z)}inc($,Z,X){if($.startsWith("pre")){if(!Z&&X===!1)throw Error("invalid increment argument: identifier is empty");if(Z){let Q=`-${Z}`.match(this.options.loose?j5[O5.PRERELEASELOOSE]:j5[O5.PRERELEASE]);if(!Q||Q[1]!==Z)throw Error(`invalid identifier: ${Z}`)}}switch($){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",Z,X);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",Z,X);break;case"prepatch":this.prerelease.length=0,this.inc("patch",Z,X),this.inc("pre",Z,X);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",Z,X);this.inc("pre",Z,X);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let Q=Number(X)?1:0;if(this.prerelease.length===0)this.prerelease=[Q];else{let J=this.prerelease.length;while(--J>=0)if(typeof this.prerelease[J]==="number")this.prerelease[J]++,J=-2;if(J===-1){if(Z===this.prerelease.join(".")&&X===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(Q)}}if(Z){let J=[Z,Q];if(X===!1)J=[Z];if(Hw(this.prerelease,Z)){let G=this.prerelease[Z.split(".").length];if(isNaN(G))this.prerelease=J}else this.prerelease=J}break}default:throw Error(`invalid increment argument: ${$}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}Jq.exports=K1});var E6=b((Ul,Wq)=>{var Gq=W$(),Vw=($,Z,X=!1)=>{if($ instanceof Gq)return $;try{return new Gq($,Z)}catch(Q){if(!X)return null;throw Q}};Wq.exports=Vw});var zq=b((Hl,Yq)=>{var Bw=E6(),Fw=($,Z)=>{let X=Bw($,Z);return X?X.version:null};Yq.exports=Fw});var Kq=b((Vl,qq)=>{var Lw=E6(),Mw=($,Z)=>{let X=Lw($.trim().replace(/^[=v]+/,""),Z);return X?X.version:null};qq.exports=Mw});var Vq=b((Bl,Hq)=>{var Uq=W$(),Aw=($,Z,X,Q,J)=>{if(typeof X==="string")J=Q,Q=X,X=void 0;try{return new Uq($ instanceof Uq?$.version:$,X).inc(Z,Q,J).version}catch(G){return null}};Hq.exports=Aw});var Lq=b((Fl,Fq)=>{var Bq=E6(),Iw=($,Z)=>{let X=Bq($,null,!0),Q=Bq(Z,null,!0),J=X.compare(Q);if(J===0)return null;let G=J>0,W=G?X:Q,Y=G?Q:X,z=!!W.prerelease.length;if(!!Y.prerelease.length&&!z){if(!Y.patch&&!Y.minor)return"major";if(Y.compareMain(W)===0){if(Y.minor&&!Y.patch)return"minor";return"patch"}}let H=z?"pre":"";if(X.major!==Q.major)return H+"major";if(X.minor!==Q.minor)return H+"minor";if(X.patch!==Q.patch)return H+"patch";return"prerelease"};Fq.exports=Iw});var Aq=b((Ll,Mq)=>{var Nw=W$(),Dw=($,Z)=>new Nw($,Z).major;Mq.exports=Dw});var Nq=b((Ml,Iq)=>{var ww=W$(),Tw=($,Z)=>new ww($,Z).minor;Iq.exports=Tw});var wq=b((Al,Dq)=>{var jw=W$(),Ow=($,Z)=>new jw($,Z).patch;Dq.exports=Ow});var jq=b((Il,Tq)=>{var Ew=E6(),Rw=($,Z)=>{let X=Ew($,Z);return X&&X.prerelease.length?X.prerelease:null};Tq.exports=Rw});var Z1=b((Nl,Eq)=>{var Oq=W$(),Pw=($,Z,X)=>new Oq($,X).compare(new Oq(Z,X));Eq.exports=Pw});var Pq=b((Dl,Rq)=>{var Cw=Z1(),Sw=($,Z,X)=>Cw(Z,$,X);Rq.exports=Sw});var Sq=b((wl,Cq)=>{var _w=Z1(),bw=($,Z)=>_w($,Z,!0);Cq.exports=bw});var E5=b((Tl,bq)=>{var _q=W$(),xw=($,Z,X)=>{let Q=new _q($,X),J=new _q(Z,X);return Q.compare(J)||Q.compareBuild(J)};bq.exports=xw});var kq=b((jl,xq)=>{var kw=E5(),yw=($,Z)=>$.sort((X,Q)=>kw(X,Q,Z));xq.exports=yw});var vq=b((Ol,yq)=>{var vw=E5(),gw=($,Z)=>$.sort((X,Q)=>vw(Q,X,Z));yq.exports=gw});var y9=b((El,gq)=>{var fw=Z1(),hw=($,Z,X)=>fw($,Z,X)>0;gq.exports=hw});var R5=b((Rl,fq)=>{var uw=Z1(),mw=($,Z,X)=>uw($,Z,X)<0;fq.exports=mw});var MX=b((Pl,hq)=>{var dw=Z1(),lw=($,Z,X)=>dw($,Z,X)===0;hq.exports=lw});var AX=b((Cl,uq)=>{var cw=Z1(),pw=($,Z,X)=>cw($,Z,X)!==0;uq.exports=pw});var P5=b((Sl,mq)=>{var iw=Z1(),nw=($,Z,X)=>iw($,Z,X)>=0;mq.exports=nw});var C5=b((_l,dq)=>{var rw=Z1(),aw=($,Z,X)=>rw($,Z,X)<=0;dq.exports=aw});var IX=b((bl,lq)=>{var ow=MX(),sw=AX(),tw=y9(),ew=P5(),$T=R5(),ZT=C5(),XT=($,Z,X,Q)=>{switch(Z){case"===":if(typeof $==="object")$=$.version;if(typeof X==="object")X=X.version;return $===X;case"!==":if(typeof $==="object")$=$.version;if(typeof X==="object")X=X.version;return $!==X;case"":case"=":case"==":return ow($,X,Q);case"!=":return sw($,X,Q);case">":return tw($,X,Q);case">=":return ew($,X,Q);case"<":return $T($,X,Q);case"<=":return ZT($,X,Q);default:throw TypeError(`Invalid operator: ${Z}`)}};lq.exports=XT});var pq=b((xl,cq)=>{var QT=W$(),JT=E6(),{safeRe:S5,t:_5}=y4(),GT=($,Z)=>{if($ instanceof QT)return $;if(typeof $==="number")$=String($);if(typeof $!=="string")return null;Z=Z||{};let X=null;if(!Z.rtl)X=$.match(Z.includePrerelease?S5[_5.COERCEFULL]:S5[_5.COERCE]);else{let z=Z.includePrerelease?S5[_5.COERCERTLFULL]:S5[_5.COERCERTL],q;while((q=z.exec($))&&(!X||X.index+X[0].length!==$.length)){if(!X||q.index+q[0].length!==X.index+X[0].length)X=q;z.lastIndex=q.index+q[1].length+q[2].length}z.lastIndex=-1}if(X===null)return null;let Q=X[2],J=X[3]||"0",G=X[4]||"0",W=Z.includePrerelease&&X[5]?`-${X[5]}`:"",Y=Z.includePrerelease&&X[6]?`+${X[6]}`:"";return JT(`${Q}.${J}.${G}${W}${Y}`,Z)};cq.exports=GT});var nq=b((kl,iq)=>{var WT=E6(),YT=k4(),zT=W$(),qT=($,Z,X)=>{if(!YT.RELEASE_TYPES.includes(Z))return null;let Q=KT($,X);return Q&&UT(Q,Z)},KT=($,Z)=>{let X=$ instanceof zT?$.version:$;return WT(X,Z)},UT=($,Z)=>{if(HT(Z))return $.version;switch($.prerelease=[],Z){case"major":$.minor=0,$.patch=0;break;case"minor":$.patch=0;break}return $.format()},HT=($)=>{return $.startsWith("pre")};iq.exports=qT});var oq=b((yl,aq)=>{class rq{constructor(){this.max=1000,this.map=new Map}get($){let Z=this.map.get($);if(Z===void 0)return;else return this.map.delete($),this.map.set($,Z),Z}delete($){return this.map.delete($)}set($,Z){if(!this.delete($)&&Z!==void 0){if(this.map.size>=this.max){let Q=this.map.keys().next().value;this.delete(Q)}this.map.set($,Z)}return this}}aq.exports=rq});var X1=b((vl,$K)=>{var VT=/\s+/g;class v9{constructor($,Z){if(Z=FT(Z),$ instanceof v9)if($.loose===!!Z.loose&&$.includePrerelease===!!Z.includePrerelease)return $;else return new v9($.raw,Z);if($ instanceof NX)return this.raw=$.value,this.set=[[$]],this.formatted=void 0,this;if(this.options=Z,this.loose=!!Z.loose,this.includePrerelease=!!Z.includePrerelease,this.raw=$.trim().replace(VT," "),this.set=this.raw.split("||").map((X)=>this.parseRange(X.trim())).filter((X)=>X.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let X=this.set[0];if(this.set=this.set.filter((Q)=>!tq(Q[0])),this.set.length===0)this.set=[X];else if(this.set.length>1){for(let Q of this.set)if(Q.length===1&&jT(Q[0])){this.set=[Q];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let $=0;$<this.set.length;$++){if($>0)this.formatted+="||";let Z=this.set[$];for(let X=0;X<Z.length;X++){if(X>0)this.formatted+=" ";this.formatted+=Z[X].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange($){$=$.replace(TT,"");let X=((this.options.includePrerelease&&DT)|(this.options.loose&&wT))+":"+$,Q=sq.get(X);if(Q)return Q;let J=this.options.loose,G=J?w$[Y$.HYPHENRANGELOOSE]:w$[Y$.HYPHENRANGE];$=$.replace(G,yT(this.options.includePrerelease)),f0("hyphen replace",$),$=$.replace(w$[Y$.COMPARATORTRIM],AT),f0("comparator trim",$),$=$.replace(w$[Y$.TILDETRIM],IT),f0("tilde trim",$),$=$.replace(w$[Y$.CARETTRIM],NT),f0("caret trim",$);let W=$.split(" ").map((H)=>OT(H,this.options)).join(" ").split(/\s+/).map((H)=>kT(H,this.options));if(J)W=W.filter((H)=>{return f0("loose invalid filter",H,this.options),!!H.match(w$[Y$.COMPARATORLOOSE])});f0("range list",W);let Y=new Map,z=W.map((H)=>new NX(H,this.options));for(let H of z){if(tq(H))return[H];Y.set(H.value,H)}if(Y.size>1&&Y.has(""))Y.delete("");let q=[...Y.values()];return sq.set(X,q),q}intersects($,Z){if(!($ instanceof v9))throw TypeError("a Range is required");return this.set.some((X)=>{return eq(X,Z)&&$.set.some((Q)=>{return eq(Q,Z)&&X.every((J)=>{return Q.every((G)=>{return J.intersects(G,Z)})})})})}test($){if(!$)return!1;if(typeof $==="string")try{$=new LT($,this.options)}catch(Z){return!1}for(let Z=0;Z<this.set.length;Z++)if(vT(this.set[Z],$,this.options))return!0;return!1}}$K.exports=v9;var BT=oq(),sq=new BT,FT=D5(),NX=g9(),f0=k9(),LT=W$(),{safeRe:w$,src:MT,t:Y$,comparatorTrimReplace:AT,tildeTrimReplace:IT,caretTrimReplace:NT}=y4(),{FLAG_INCLUDE_PRERELEASE:DT,FLAG_LOOSE:wT}=k4(),TT=new RegExp(MT[Y$.BUILD],"g"),tq=($)=>$.value==="<0.0.0-0",jT=($)=>$.value==="",eq=($,Z)=>{let X=!0,Q=$.slice(),J=Q.pop();while(X&&Q.length)X=Q.every((G)=>{return J.intersects(G,Z)}),J=Q.pop();return X},OT=($,Z)=>{return $=$.replace(w$[Y$.BUILD],""),f0("comp",$,Z),$=CT($,Z),f0("caret",$),$=RT($,Z),f0("tildes",$),$=_T($,Z),f0("xrange",$),$=xT($,Z),f0("stars",$),$},Z$=($)=>!$||$.toLowerCase()==="x"||$==="*",ET=($,Z,X)=>Z$($)&&!Z$(Z)||Z$(Z)&&X&&!Z$(X),RT=($,Z)=>{return $.trim().split(/\s+/).map((X)=>PT(X,Z)).join(" ")},PT=($,Z)=>{let X=Z.loose?w$[Y$.TILDELOOSE]:w$[Y$.TILDE],Q=Z.includePrerelease?"-0":"";return $.replace(X,(J,G,W,Y,z)=>{f0("tilde",$,J,G,W,Y,z);let q;if(Z$(G))q="";else if(Z$(W))q=`>=${G}.0.0${Q} <${+G+1}.0.0-0`;else if(Z$(Y))q=`>=${G}.${W}.0${Q} <${G}.${+W+1}.0-0`;else if(z)f0("replaceTilde pr",z),q=`>=${G}.${W}.${Y}-${z} <${G}.${+W+1}.0-0`;else q=`>=${G}.${W}.${Y} <${G}.${+W+1}.0-0`;return f0("tilde return",q),q})},CT=($,Z)=>{return $.trim().split(/\s+/).map((X)=>ST(X,Z)).join(" ")},ST=($,Z)=>{f0("caret",$,Z);let X=Z.loose?w$[Y$.CARETLOOSE]:w$[Y$.CARET],Q=Z.includePrerelease?"-0":"";return $.replace(X,(J,G,W,Y,z)=>{f0("caret",$,J,G,W,Y,z);let q;if(Z$(G))q="";else if(Z$(W))q=`>=${G}.0.0${Q} <${+G+1}.0.0-0`;else if(Z$(Y))if(G==="0")q=`>=${G}.${W}.0${Q} <${G}.${+W+1}.0-0`;else q=`>=${G}.${W}.0${Q} <${+G+1}.0.0-0`;else if(z)if(f0("replaceCaret pr",z),G==="0")if(W==="0")q=`>=${G}.${W}.${Y}-${z} <${G}.${W}.${+Y+1}-0`;else q=`>=${G}.${W}.${Y}-${z} <${G}.${+W+1}.0-0`;else q=`>=${G}.${W}.${Y}-${z} <${+G+1}.0.0-0`;else if(f0("no pr"),G==="0")if(W==="0")q=`>=${G}.${W}.${Y} <${G}.${W}.${+Y+1}-0`;else q=`>=${G}.${W}.${Y} <${G}.${+W+1}.0-0`;else q=`>=${G}.${W}.${Y} <${+G+1}.0.0-0`;return f0("caret return",q),q})},_T=($,Z)=>{return f0("replaceXRanges",$,Z),$.split(/\s+/).map((X)=>bT(X,Z)).join(" ")},bT=($,Z)=>{$=$.trim();let X=Z.loose?w$[Y$.XRANGELOOSE]:w$[Y$.XRANGE];return $.replace(X,(Q,J,G,W,Y,z)=>{if(f0("xRange",$,Q,J,G,W,Y,z),ET(G,W,Y))return $;let q=Z$(G),H=q||Z$(W),B=H||Z$(Y),F=B;if(J==="="&&F)J="";if(z=Z.includePrerelease?"-0":"",q)if(J===">"||J==="<")Q="<0.0.0-0";else Q="*";else if(J&&F){if(H)W=0;if(Y=0,J===">")if(J=">=",H)G=+G+1,W=0,Y=0;else W=+W+1,Y=0;else if(J==="<=")if(J="<",H)G=+G+1;else W=+W+1;if(J==="<")z="-0";Q=`${J+G}.${W}.${Y}${z}`}else if(H)Q=`>=${G}.0.0${z} <${+G+1}.0.0-0`;else if(B)Q=`>=${G}.${W}.0${z} <${G}.${+W+1}.0-0`;return f0("xRange return",Q),Q})},xT=($,Z)=>{return f0("replaceStars",$,Z),$.trim().replace(w$[Y$.STAR],"")},kT=($,Z)=>{return f0("replaceGTE0",$,Z),$.trim().replace(w$[Z.includePrerelease?Y$.GTE0PRE:Y$.GTE0],"")},yT=($)=>(Z,X,Q,J,G,W,Y,z,q,H,B,F)=>{if(Z$(Q))X="";else if(Z$(J))X=`>=${Q}.0.0${$?"-0":""}`;else if(Z$(G))X=`>=${Q}.${J}.0${$?"-0":""}`;else if(W)X=`>=${X}`;else X=`>=${X}${$?"-0":""}`;if(Z$(q))z="";else if(Z$(H))z=`<${+q+1}.0.0-0`;else if(Z$(B))z=`<${q}.${+H+1}.0-0`;else if(F)z=`<=${q}.${H}.${B}-${F}`;else if($)z=`<${q}.${H}.${+B+1}-0`;else z=`<=${z}`;return`${X} ${z}`.trim()},vT=($,Z,X)=>{for(let Q=0;Q<$.length;Q++)if(!$[Q].test(Z))return!1;if(Z.prerelease.length&&!X.includePrerelease){for(let Q=0;Q<$.length;Q++){if(f0($[Q].semver),$[Q].semver===NX.ANY)continue;if($[Q].semver.prerelease.length>0){let J=$[Q].semver;if(J.major===Z.major&&J.minor===Z.minor&&J.patch===Z.patch)return!0}}return!1}return!0}});var g9=b((gl,WK)=>{var f9=Symbol("SemVer ANY");class b5{static get ANY(){return f9}constructor($,Z){if(Z=ZK(Z),$ instanceof b5)if($.loose===!!Z.loose)return $;else $=$.value;if($=$.trim().split(/\s+/).join(" "),wX("comparator",$,Z),this.options=Z,this.loose=!!Z.loose,this.parse($),this.semver===f9)this.value="";else this.value=this.operator+this.semver.version;wX("comp",this)}parse($){let Z=this.options.loose?XK[QK.COMPARATORLOOSE]:XK[QK.COMPARATOR],X=$.match(Z);if(!X)throw TypeError(`Invalid comparator: ${$}`);if(this.operator=X[1]!==void 0?X[1]:"",this.operator==="=")this.operator="";if(!X[2])this.semver=f9;else this.semver=new JK(X[2],this.options.loose)}toString(){return this.value}test($){if(wX("Comparator.test",$,this.options.loose),this.semver===f9||$===f9)return!0;if(typeof $==="string")try{$=new JK($,this.options)}catch(Z){return!1}return DX($,this.operator,this.semver,this.options)}intersects($,Z){if(!($ instanceof b5))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new GK($.value,Z).test(this.value)}else if($.operator===""){if($.value==="")return!0;return new GK(this.value,Z).test($.semver)}if(Z=ZK(Z),Z.includePrerelease&&(this.value==="<0.0.0-0"||$.value==="<0.0.0-0"))return!1;if(!Z.includePrerelease&&(this.value.startsWith("<0.0.0")||$.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&$.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&$.operator.startsWith("<"))return!0;if(this.semver.version===$.semver.version&&this.operator.includes("=")&&$.operator.includes("="))return!0;if(DX(this.semver,"<",$.semver,Z)&&this.operator.startsWith(">")&&$.operator.startsWith("<"))return!0;if(DX(this.semver,">",$.semver,Z)&&this.operator.startsWith("<")&&$.operator.startsWith(">"))return!0;return!1}}WK.exports=b5;var ZK=D5(),{safeRe:XK,t:QK}=y4(),DX=IX(),wX=k9(),JK=W$(),GK=X1()});var h9=b((fl,YK)=>{var gT=X1(),fT=($,Z,X)=>{try{Z=new gT(Z,X)}catch(Q){return!1}return Z.test($)};YK.exports=fT});var qK=b((hl,zK)=>{var hT=X1(),uT=($,Z)=>new hT($,Z).set.map((X)=>X.map((Q)=>Q.value).join(" ").trim().split(" "));zK.exports=uT});var UK=b((ul,KK)=>{var mT=W$(),dT=X1(),lT=($,Z,X)=>{let Q=null,J=null,G=null;try{G=new dT(Z,X)}catch(W){return null}return $.forEach((W)=>{if(G.test(W)){if(!Q||J.compare(W)===-1)Q=W,J=new mT(Q,X)}}),Q};KK.exports=lT});var VK=b((ml,HK)=>{var cT=W$(),pT=X1(),iT=($,Z,X)=>{let Q=null,J=null,G=null;try{G=new pT(Z,X)}catch(W){return null}return $.forEach((W)=>{if(G.test(W)){if(!Q||J.compare(W)===1)Q=W,J=new cT(Q,X)}}),Q};HK.exports=iT});var LK=b((dl,FK)=>{var TX=W$(),nT=X1(),BK=y9(),rT=($,Z)=>{$=new nT($,Z);let X=new TX("0.0.0");if($.test(X))return X;if(X=new TX("0.0.0-0"),$.test(X))return X;X=null;for(let Q=0;Q<$.set.length;++Q){let J=$.set[Q],G=null;if(J.forEach((W)=>{let Y=new TX(W.semver.version);switch(W.operator){case">":if(Y.prerelease.length===0)Y.patch++;else Y.prerelease.push(0);Y.raw=Y.format();case"":case">=":if(!G||BK(Y,G))G=Y;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${W.operator}`)}}),G&&(!X||BK(X,G)))X=G}if(X&&$.test(X))return X;return null};FK.exports=rT});var AK=b((ll,MK)=>{var aT=X1(),oT=($,Z)=>{try{return new aT($,Z).range||"*"}catch(X){return null}};MK.exports=oT});var x5=b((cl,wK)=>{var sT=W$(),DK=g9(),{ANY:tT}=DK,eT=X1(),$j=h9(),IK=y9(),NK=R5(),Zj=C5(),Xj=P5(),Qj=($,Z,X,Q)=>{$=new sT($,Q),Z=new eT(Z,Q);let J,G,W,Y,z;switch(X){case">":J=IK,G=Zj,W=NK,Y=">",z=">=";break;case"<":J=NK,G=Xj,W=IK,Y="<",z="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if($j($,Z,Q))return!1;for(let q=0;q<Z.set.length;++q){let H=Z.set[q],B=null,F=null;if(H.forEach((L)=>{if(L.semver===tT)L=new DK(">=0.0.0");if(B=B||L,F=F||L,J(L.semver,B.semver,Q))B=L;else if(W(L.semver,F.semver,Q))F=L}),B.operator===Y||B.operator===z)return!1;if((!F.operator||F.operator===Y)&&G($,F.semver))return!1;else if(F.operator===z&&W($,F.semver))return!1}return!0};wK.exports=Qj});var jK=b((pl,TK)=>{var Jj=x5(),Gj=($,Z,X)=>Jj($,Z,">",X);TK.exports=Gj});var EK=b((il,OK)=>{var Wj=x5(),Yj=($,Z,X)=>Wj($,Z,"<",X);OK.exports=Yj});var CK=b((nl,PK)=>{var RK=X1(),zj=($,Z,X)=>{return $=new RK($,X),Z=new RK(Z,X),$.intersects(Z,X)};PK.exports=zj});var _K=b((rl,SK)=>{var qj=h9(),Kj=Z1();SK.exports=($,Z,X)=>{let Q=[],J=null,G=null,W=$.sort((H,B)=>Kj(H,B,X));for(let H of W)if(qj(H,Z,X)){if(G=H,!J)J=H}else{if(G)Q.push([J,G]);G=null,J=null}if(J)Q.push([J,null]);let Y=[];for(let[H,B]of Q)if(H===B)Y.push(H);else if(!B&&H===W[0])Y.push("*");else if(!B)Y.push(`>=${H}`);else if(H===W[0])Y.push(`<=${B}`);else Y.push(`${H} - ${B}`);let z=Y.join(" || "),q=typeof Z.raw==="string"?Z.raw:String(Z);return z.length<q.length?z:Z}});var gK=b((al,vK)=>{var bK=X1(),EX=g9(),{ANY:jX}=EX,OX=h9(),RX=Z1(),Uj=($,Z,X={})=>{if($===Z)return!0;$=new bK($,X),Z=new bK(Z,X);let Q=!1;$:for(let J of $.set){for(let G of Z.set){let W=Vj(J,G,X);if(Q=Q||W!==null,W)continue $}if(Q)return!1}return!0},Hj=[new EX(">=0.0.0-0")],xK=[new EX(">=0.0.0")],Vj=($,Z,X)=>{if($===Z)return!0;if($.length===1&&$[0].semver===jX)if(Z.length===1&&Z[0].semver===jX)return!0;else if(X.includePrerelease)$=Hj;else $=xK;if(Z.length===1&&Z[0].semver===jX)if(X.includePrerelease)return!0;else Z=xK;let Q=new Set,J,G;for(let L of $)if(L.operator===">"||L.operator===">=")J=kK(J,L,X);else if(L.operator==="<"||L.operator==="<=")G=yK(G,L,X);else Q.add(L.semver);if(Q.size>1)return null;let W;if(J&&G){if(W=RX(J.semver,G.semver,X),W>0)return null;else if(W===0&&(J.operator!==">="||G.operator!=="<="))return null}for(let L of Q){if(J&&!OX(L,String(J),X))return null;if(G&&!OX(L,String(G),X))return null;for(let w of Z)if(!OX(L,String(w),X))return!1;return!0}let Y,z,q,H,B=G&&!X.includePrerelease&&G.semver.prerelease.length?G.semver:!1,F=J&&!X.includePrerelease&&J.semver.prerelease.length?J.semver:!1;if(B&&B.prerelease.length===1&&G.operator==="<"&&B.prerelease[0]===0)B=!1;for(let L of Z){if(H=H||L.operator===">"||L.operator===">=",q=q||L.operator==="<"||L.operator==="<=",J){if(F){if(L.semver.prerelease&&L.semver.prerelease.length&&L.semver.major===F.major&&L.semver.minor===F.minor&&L.semver.patch===F.patch)F=!1}if(L.operator===">"||L.operator===">="){if(Y=kK(J,L,X),Y===L&&Y!==J)return!1}else if(J.operator===">="&&!L.test(J.semver))return!1}if(G){if(B){if(L.semver.prerelease&&L.semver.prerelease.length&&L.semver.major===B.major&&L.semver.minor===B.minor&&L.semver.patch===B.patch)B=!1}if(L.operator==="<"||L.operator==="<="){if(z=yK(G,L,X),z===L&&z!==G)return!1}else if(G.operator==="<="&&!L.test(G.semver))return!1}if(!L.operator&&(G||J)&&W!==0)return!1}if(J&&q&&!G&&W!==0)return!1;if(G&&H&&!J&&W!==0)return!1;if(F||B)return!1;return!0},kK=($,Z,X)=>{if(!$)return Z;let Q=RX($.semver,Z.semver,X);return Q>0?$:Q<0?Z:Z.operator===">"&&$.operator===">="?Z:$},yK=($,Z,X)=>{if(!$)return Z;let Q=RX($.semver,Z.semver,X);return Q<0?$:Q>0?Z:Z.operator==="<"&&$.operator==="<="?Z:$};vK.exports=Uj});var mK=b((ol,uK)=>{var PX=y4(),fK=k4(),Bj=W$(),hK=FX(),Fj=E6(),Lj=zq(),Mj=Kq(),Aj=Vq(),Ij=Lq(),Nj=Aq(),Dj=Nq(),wj=wq(),Tj=jq(),jj=Z1(),Oj=Pq(),Ej=Sq(),Rj=E5(),Pj=kq(),Cj=vq(),Sj=y9(),_j=R5(),bj=MX(),xj=AX(),kj=P5(),yj=C5(),vj=IX(),gj=pq(),fj=nq(),hj=g9(),uj=X1(),mj=h9(),dj=qK(),lj=UK(),cj=VK(),pj=LK(),ij=AK(),nj=x5(),rj=jK(),aj=EK(),oj=CK(),sj=_K(),tj=gK();uK.exports={parse:Fj,valid:Lj,clean:Mj,inc:Aj,diff:Ij,major:Nj,minor:Dj,patch:wj,prerelease:Tj,compare:jj,rcompare:Oj,compareLoose:Ej,compareBuild:Rj,sort:Pj,rsort:Cj,gt:Sj,lt:_j,eq:bj,neq:xj,gte:kj,lte:yj,cmp:vj,coerce:gj,truncate:fj,Comparator:hj,Range:uj,satisfies:mj,toComparators:dj,maxSatisfying:lj,minSatisfying:cj,minVersion:pj,validRange:ij,outside:nj,gtr:rj,ltr:aj,intersects:oj,simplifyRange:sj,subset:tj,SemVer:Bj,re:PX.re,src:PX.src,tokens:PX.t,SEMVER_SPEC_VERSION:fK.SEMVER_SPEC_VERSION,RELEASE_TYPES:fK.RELEASE_TYPES,compareIdentifiers:hK.compareIdentifiers,rcompareIdentifiers:hK.rcompareIdentifiers}});var e1;var k5=s(()=>{e1={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 $O}from"node:crypto";var m9,SX,ZO,lK,XO,_X,QO=($)=>{if($ instanceof Error)console.error(`sharp: Installation error: ${$.message}`);else console.log(`sharp: ${$}`)},cK=()=>SX.default.isNonGlibcLinuxSync()?SX.default.familySync():"",JO=()=>`${process.platform}${cK()}-${process.arch}`,v4=()=>{if(pK())return"wasm32";let{npm_config_arch:$,npm_config_platform:Z,npm_config_libc:X}=process.env,Q=typeof X==="string"?X:cK();return`${Z||process.platform}${Q}-${$||process.arch}`},GO=()=>{try{return O0(`@img/sharp-libvips-dev-${v4()}/include`)}catch{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})()}catch{}}return""},WO=()=>{try{return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})()}catch{}return""},YO=()=>{try{return O0(`@img/sharp-libvips-dev-${v4()}/lib`)}catch{try{return O0(`@img/sharp-libvips-${v4()}/lib`)}catch{}}return""},zO=()=>{if(process.release?.name==="node"&&process.versions){if(!m9.default.satisfies(process.versions.node,e1.engines.node))return{found:process.versions.node,expected:e1.engines.node}}},pK=()=>{let{CC:$}=process.env;return Boolean($?.endsWith("/emcc"))},qO=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(u9("sysctl sysctl.proc_translated",_X).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},dK=($)=>$O("sha512").update($).digest("hex"),KO=()=>{try{let $=dK(`imgsharp-libvips-${v4()}`),Z=m9.default.coerce(e1.optionalDependencies[`@img/sharp-libvips-${v4()}`],{includePrerelease:!0}).version;return dK(`${$}npm:${Z}`).slice(0,10)}catch{}return""},UO=()=>u9(`node-gyp rebuild --directory=src ${pK()?"--nodedir=emscripten":""}`,{..._X,stdio:"inherit"}).status,iK=()=>{if(process.platform!=="win32")return(u9("pkg-config --modversion vips-cpp",{..._X,env:{...process.env,PKG_CONFIG_PATH:nK()}}).stdout||"").trim();else return""},HO=()=>{try{let $=(u9("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if($)return`${$}/lib/pkgconfig`}catch($){}return},VO=()=>{try{let $=(u9("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if($)return $}catch($){}return},nK=()=>{if(process.platform!=="win32")return[HO(),VO(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":");else return""},CX=($,Z,X)=>{if(X)X(`Detected ${Z}, skipping search for globally-installed libvips`);return $},BO=($)=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return CX(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",$);if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return CX(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",$);if(qO())return CX(!1,"Rosetta",$);let Z=iK();return!!Z&&m9.default.gte(Z,lK)},y5;var bX=s(()=>{k5();m9=F$(mK(),1),SX=F$(N5(),1);/*!
|
|
288
286
|
Copyright 2013 Lovell Fuller and others.
|
|
289
287
|
SPDX-License-Identifier: Apache-2.0
|
|
290
|
-
*/
|
|
288
|
+
*/ZO=process.env.npm_package_config_libvips||e1.config.libvips,lK=m9.default.coerce(ZO).version,XO=["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"],_X={encoding:"utf8",shell:!0},y5={minimumLibvipsVersion:lK,prebuiltPlatforms:XO,buildPlatformArch:v4,buildSharpLibvipsIncludeDir:GO,buildSharpLibvipsCPlusPlusDir:WO,buildSharpLibvipsLibDir:YO,isUnsupportedNodeRuntime:zO,runtimePlatformArch:JO,log:QO,yarnLocator:KO,spawnRebuild:UO,globalLibvipsVersion:iK,pkgConfigPath:nK,useGlobalLibvips:BO}});import{createRequire as FO}from"node:module";var v5,X$,aK,LO,rK,MO,AO,$6,k0,R6,x0;var d9=s(()=>{bX();k5();v5=F$(N5(),1);/*!
|
|
291
289
|
Copyright 2013 Lovell Fuller and others.
|
|
292
290
|
SPDX-License-Identifier: Apache-2.0
|
|
293
|
-
|
|
294
|
-
`))}
|
|
291
|
+
*/X$=FO(import.meta.url),{version:aK}=e1,{runtimePlatformArch:LO,isUnsupportedNodeRuntime:rK,prebuiltPlatforms:MO,minimumLibvipsVersion:AO}=y5,$6=LO(),R6=[];try{k0=X$(`../src/build/Release/sharp-${$6}-${aK}.node`)}catch($){R6.push($)}if(!k0)try{k0=X$(`../src/build/Release/sharp-wasm32-${aK}.node`)}catch($){R6.push($)}if(!k0)try{switch($6){case"darwin-arm64":k0=X$("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":k0=X$("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":k0=X$("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":k0=X$("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":k0=X$("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":k0=X$("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":k0=X$("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":k0=X$("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":k0=X$("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":k0=X$("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":k0=X$("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":k0=X$("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":k0=X$("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":k0=X$("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":k0=X$("@img/sharp-webcontainers-wasm32/sharp.node");break}if(k0&&["linux-x64","linuxmusl-x64"].includes($6)&&!k0._isUsingX64V2()){let $=Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");$.code="Unsupported CPU",R6.push($),k0=null}if(k0&&process.versions.electron&&$6.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($){R6.push($)}if(!k0)try{k0=X$("@img/sharp-wasm32/sharp.node")}catch($){R6.push($)}if(!k0){let[$,Z,X]=["linux","darwin","win32"].map((G)=>$6.startsWith(G)),Q=[`Could not load the "sharp" module using the ${$6} runtime`];R6.forEach((G)=>{if(!G.code.endsWith("MODULE_NOT_FOUND"))Q.push(`${G.code}: ${G.message}`)});let J=R6.map((G)=>G.message).join(" ");if(Q.push("Possible solutions:"),rK()){let{found:G,expected:W}=rK();Q.push("- Please upgrade Node.js:",` Found ${G}`,` Requires ${W}`)}else if(MO.includes($6)){let[G,W]=$6.split("-"),Y=G.endsWith("musl")?" --libc=musl":"";Q.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${G.replace("musl","")}${Y} --cpu=${W} sharp`)}else Q.push(`- Manually install libvips >= ${AO}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if($&&/(symbol not found|CXXABI_)/i.test(J))try{let{config:G}=X$(`@img/sharp-libvips-${$6}/package`),W=`${v5.familySync()} ${v5.versionSync()}`,Y=`${G.musl?"musl":"glibc"} ${G.musl||G.glibc}`;Q.push("- Update your OS:",` Found ${W}`,` Requires ${Y}`)}catch(G){}if($&&/\/snap\/core[0-9]{2}/.test(J))Q.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(Z&&/Incompatible library version/.test(J))Q.push("- Update Homebrew:"," brew update && brew upgrade vips");if(R6.some((G)=>G.code==="ERR_DLOPEN_DISABLED"))Q.push("- Run Node.js without using the --no-addons flag");if(X&&/The specified procedure could not be found/.test(J))Q.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp");throw Q.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),Error(Q.join(`
|
|
292
|
+
`))}x0=k0});import IO from"node:util";import xX from"node:stream";function wO(){let $=this.constructor.call(),{debuglog:Z,queueListener:X,...Q}=this.options;if($.options=structuredClone(Q),$.options.debuglog=Z,$.options.queueListener=X,this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),$.options.input.buffer=this.options.input.buffer,$.emit("finish")});return $}var NO,DO=($)=>{Z4.queue.emit("change",$)},Z4=function($,Z){if(arguments.length===1&&!U.defined($))throw Error("Invalid input");if(!(this instanceof Z4))return new Z4($,Z);return xX.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:0.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:(X)=>{this.emit("warning",X),NO(X)},queueListener:DO},this.options.input=this._createInputDescriptor($,Z,{allowStream:!0}),this},k1;var oK=s(()=>{C1();d9();/*!
|
|
295
293
|
Copyright 2013 Lovell Fuller and others.
|
|
296
294
|
SPDX-License-Identifier: Apache-2.0
|
|
297
|
-
*/WO=GO.debuglog("sharp");Object.setPrototypeOf(s1.prototype,jX.Duplex.prototype);Object.setPrototypeOf(s1,jX.Duplex);Object.assign(s1.prototype,{clone:zO});x6=s1});function hU($){let Z=UO.filter((X)=>K.defined($[X])).map((X)=>[X,$[X]]);return Z.length?Object.fromEntries(Z):void 0}function KO($,Z,X){let Q={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(K.string($))Q.file=$;else if(K.buffer($)){if($.length===0)throw Error("Input Buffer is empty");Q.buffer=$}else if(K.arrayBuffer($)){if($.byteLength===0)throw Error("Input bit Array is empty");Q.buffer=Buffer.from($,0,$.byteLength)}else if(K.typedArray($)){if($.length===0)throw Error("Input Bit Array is empty");Q.buffer=Buffer.from($.buffer,$.byteOffset,$.byteLength)}else if(K.plainObject($)&&!K.defined(Z)){if(Z=$,hU(Z))Q.buffer=[]}else if(!K.defined($)&&!K.defined(Z)&&K.object(X)&&X.allowStream)Q.buffer=[];else if(Array.isArray($))if($.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=$.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 '${$}' of type ${typeof $}${K.defined(Z)?` when also providing options of type ${typeof Z}`:""}`);if(K.object(Z)){if(K.defined(Z.failOn))if(K.string(Z.failOn)&&K.inArray(Z.failOn,["none","truncated","error","warning"]))Q.failOn=Z.failOn;else throw K.invalidParameterError("failOn","one of: none, truncated, error, warning",Z.failOn);if(K.defined(Z.autoOrient))if(K.bool(Z.autoOrient))Q.autoOrient=Z.autoOrient;else throw K.invalidParameterError("autoOrient","boolean",Z.autoOrient);if(K.defined(Z.density))if(K.number(Z.density)&&K.inRange(Z.density,1,1e5))Q.density=Z.density;else throw K.invalidParameterError("density","number between 1 and 100000",Z.density);if(K.defined(Z.ignoreIcc))if(K.bool(Z.ignoreIcc))Q.ignoreIcc=Z.ignoreIcc;else throw K.invalidParameterError("ignoreIcc","boolean",Z.ignoreIcc);if(K.defined(Z.limitInputPixels))if(K.bool(Z.limitInputPixels))Q.limitInputPixels=Z.limitInputPixels?268402689:0;else if(K.integer(Z.limitInputPixels)&&K.inRange(Z.limitInputPixels,0,Number.MAX_SAFE_INTEGER))Q.limitInputPixels=Z.limitInputPixels;else throw K.invalidParameterError("limitInputPixels","positive integer",Z.limitInputPixels);if(K.defined(Z.limitInputChannels))if(K.bool(Z.limitInputChannels))Q.limitInputChannels=Z.limitInputChannels?5:0;else if(K.integer(Z.limitInputChannels)&&K.inRange(Z.limitInputChannels,0,Number.MAX_SAFE_INTEGER))Q.limitInputChannels=Z.limitInputChannels;else throw K.invalidParameterError("limitInputChannels","positive integer",Z.limitInputChannels);if(K.defined(Z.unlimited))if(K.bool(Z.unlimited))Q.unlimited=Z.unlimited;else throw K.invalidParameterError("unlimited","boolean",Z.unlimited);if(K.defined(Z.sequentialRead))if(K.bool(Z.sequentialRead))Q.sequentialRead=Z.sequentialRead;else throw K.invalidParameterError("sequentialRead","boolean",Z.sequentialRead);if(K.defined(Z.raw)){if(K.object(Z.raw)&&K.integer(Z.raw.width)&&K.inRange(Z.raw.width,1,1e8)&&K.integer(Z.raw.height)&&K.inRange(Z.raw.height,1,1e8)&&K.integer(Z.raw.channels)&&K.inRange(Z.raw.channels,1,4))switch(Q.rawWidth=Z.raw.width,Q.rawHeight=Z.raw.height,Q.rawChannels=Z.raw.channels,$.constructor){case Uint8Array:case Uint8ClampedArray:Q.rawDepth="uchar";break;case Int8Array:Q.rawDepth="char";break;case Uint16Array:Q.rawDepth="ushort";break;case Int16Array:Q.rawDepth="short";break;case Uint32Array:Q.rawDepth="uint";break;case Int32Array:Q.rawDepth="int";break;case Float32Array:Q.rawDepth="float";break;case Float64Array:Q.rawDepth="double";break;default:Q.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(Q.rawPremultiplied=!1,K.defined(Z.raw.premultiplied))if(K.bool(Z.raw.premultiplied))Q.rawPremultiplied=Z.raw.premultiplied;else throw K.invalidParameterError("raw.premultiplied","boolean",Z.raw.premultiplied);if(Q.rawPageHeight=0,K.defined(Z.raw.pageHeight))if(K.integer(Z.raw.pageHeight)&&Z.raw.pageHeight>0&&Z.raw.pageHeight<=Z.raw.height){if(Z.raw.height%Z.raw.pageHeight!==0)throw Error(`Expected raw.height ${Z.raw.height} to be a multiple of raw.pageHeight ${Z.raw.pageHeight}`);Q.rawPageHeight=Z.raw.pageHeight}else throw K.invalidParameterError("raw.pageHeight","positive integer",Z.raw.pageHeight)}if(K.defined(Z.animated))if(K.bool(Z.animated))Q.pages=Z.animated?-1:1;else throw K.invalidParameterError("animated","boolean",Z.animated);if(K.defined(Z.pages))if(K.integer(Z.pages)&&K.inRange(Z.pages,-1,1e5))Q.pages=Z.pages;else throw K.invalidParameterError("pages","integer between -1 and 100000",Z.pages);if(K.defined(Z.page))if(K.integer(Z.page)&&K.inRange(Z.page,0,1e5))Q.page=Z.page;else throw K.invalidParameterError("page","integer between 0 and 100000",Z.page);if(K.object(Z.openSlide)&&K.defined(Z.openSlide.level))if(K.integer(Z.openSlide.level)&&K.inRange(Z.openSlide.level,0,256))Q.openSlideLevel=Z.openSlide.level;else throw K.invalidParameterError("openSlide.level","integer between 0 and 256",Z.openSlide.level);else if(K.defined(Z.level))if(K.integer(Z.level)&&K.inRange(Z.level,0,256))Q.openSlideLevel=Z.level;else throw K.invalidParameterError("level","integer between 0 and 256",Z.level);if(K.object(Z.tiff)&&K.defined(Z.tiff.subifd))if(K.integer(Z.tiff.subifd)&&K.inRange(Z.tiff.subifd,-1,1e5))Q.tiffSubifd=Z.tiff.subifd;else throw K.invalidParameterError("tiff.subifd","integer between -1 and 100000",Z.tiff.subifd);else if(K.defined(Z.subifd))if(K.integer(Z.subifd)&&K.inRange(Z.subifd,-1,1e5))Q.tiffSubifd=Z.subifd;else throw K.invalidParameterError("subifd","integer between -1 and 100000",Z.subifd);if(K.object(Z.svg)){if(K.defined(Z.svg.stylesheet))if(K.string(Z.svg.stylesheet))Q.svgStylesheet=Z.svg.stylesheet;else throw K.invalidParameterError("svg.stylesheet","string",Z.svg.stylesheet);if(K.defined(Z.svg.highBitdepth))if(K.bool(Z.svg.highBitdepth))Q.svgHighBitdepth=Z.svg.highBitdepth;else throw K.invalidParameterError("svg.highBitdepth","boolean",Z.svg.highBitdepth)}if(K.object(Z.pdf)&&K.defined(Z.pdf.background))Q.pdfBackground=this._getBackgroundColourOption(Z.pdf.background);else if(K.defined(Z.pdfBackground))Q.pdfBackground=this._getBackgroundColourOption(Z.pdfBackground);if(K.object(Z.jp2)&&K.defined(Z.jp2.oneshot))if(K.bool(Z.jp2.oneshot))Q.jp2Oneshot=Z.jp2.oneshot;else throw K.invalidParameterError("jp2.oneshot","boolean",Z.jp2.oneshot);if(K.defined(Z.create))if(K.object(Z.create)&&K.integer(Z.create.width)&&K.inRange(Z.create.width,1,1e8)&&K.integer(Z.create.height)&&K.inRange(Z.create.height,1,1e8)&&K.integer(Z.create.channels)){if(Q.createWidth=Z.create.width,Q.createHeight=Z.create.height,Q.createChannels=Z.create.channels,Q.createPageHeight=0,K.defined(Z.create.pageHeight))if(K.integer(Z.create.pageHeight)&&Z.create.pageHeight>0&&Z.create.pageHeight<=Z.create.height){if(Z.create.height%Z.create.pageHeight!==0)throw Error(`Expected create.height ${Z.create.height} to be a multiple of create.pageHeight ${Z.create.pageHeight}`);Q.createPageHeight=Z.create.pageHeight}else throw K.invalidParameterError("create.pageHeight","positive integer",Z.create.pageHeight);if(K.defined(Z.create.noise)){if(!K.object(Z.create.noise))throw Error("Expected noise to be an object");if(Z.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(Q.createNoiseType=Z.create.noise.type,!K.inRange(Z.create.channels,1,4))throw K.invalidParameterError("create.channels","number between 1 and 4",Z.create.channels);if(Q.createNoiseMean=128,K.defined(Z.create.noise.mean))if(K.number(Z.create.noise.mean)&&K.inRange(Z.create.noise.mean,0,1e4))Q.createNoiseMean=Z.create.noise.mean;else throw K.invalidParameterError("create.noise.mean","number between 0 and 10000",Z.create.noise.mean);if(Q.createNoiseSigma=30,K.defined(Z.create.noise.sigma))if(K.number(Z.create.noise.sigma)&&K.inRange(Z.create.noise.sigma,0,1e4))Q.createNoiseSigma=Z.create.noise.sigma;else throw K.invalidParameterError("create.noise.sigma","number between 0 and 10000",Z.create.noise.sigma)}else if(K.defined(Z.create.background)){if(!K.inRange(Z.create.channels,3,4))throw K.invalidParameterError("create.channels","number between 3 and 4",Z.create.channels);Q.createBackground=this._getBackgroundColourOption(Z.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete Q.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(K.defined(Z.text))if(K.object(Z.text)&&K.string(Z.text.text)){if(Q.textValue=Z.text.text,K.defined(Z.text.height)&&K.defined(Z.text.dpi))throw Error("Expected only one of dpi or height");if(K.defined(Z.text.font))if(K.string(Z.text.font))Q.textFont=Z.text.font;else throw K.invalidParameterError("text.font","string",Z.text.font);if(K.defined(Z.text.fontfile))if(K.string(Z.text.fontfile))Q.textFontfile=Z.text.fontfile;else throw K.invalidParameterError("text.fontfile","string",Z.text.fontfile);if(K.defined(Z.text.width))if(K.integer(Z.text.width)&&K.inRange(Z.text.width,1,1e6))Q.textWidth=Z.text.width;else throw K.invalidParameterError("text.width","integer between 1 and 1000000",Z.text.width);if(K.defined(Z.text.height))if(K.integer(Z.text.height)&&K.inRange(Z.text.height,1,1e6))Q.textHeight=Z.text.height;else throw K.invalidParameterError("text.height","integer between 1 and 1000000",Z.text.height);if(K.defined(Z.text.align))if(K.string(Z.text.align)&&K.string(this.constructor.align[Z.text.align]))Q.textAlign=this.constructor.align[Z.text.align];else throw K.invalidParameterError("text.align","valid alignment",Z.text.align);if(K.defined(Z.text.justify))if(K.bool(Z.text.justify))Q.textJustify=Z.text.justify;else throw K.invalidParameterError("text.justify","boolean",Z.text.justify);if(K.defined(Z.text.dpi))if(K.integer(Z.text.dpi)&&K.inRange(Z.text.dpi,1,1e6))Q.textDpi=Z.text.dpi;else throw K.invalidParameterError("text.dpi","integer between 1 and 1000000",Z.text.dpi);if(K.defined(Z.text.rgba))if(K.bool(Z.text.rgba))Q.textRgba=Z.text.rgba;else throw K.invalidParameterError("text.rgba","bool",Z.text.rgba);if(K.defined(Z.text.spacing))if(K.integer(Z.text.spacing)&&K.inRange(Z.text.spacing,-1e6,1e6))Q.textSpacing=Z.text.spacing;else throw K.invalidParameterError("text.spacing","integer between -1000000 and 1000000",Z.text.spacing);if(K.defined(Z.text.wrap))if(K.string(Z.text.wrap)&&K.inArray(Z.text.wrap,["word","char","word-char","none"]))Q.textWrap=Z.text.wrap;else throw K.invalidParameterError("text.wrap","one of: word, char, word-char, none",Z.text.wrap);delete Q.buffer}else throw Error("Expected a valid string to create an image with text.");if(K.defined(Z.join))if(K.defined(this.options.join)){if(K.defined(Z.join.animated))if(K.bool(Z.join.animated))Q.joinAnimated=Z.join.animated;else throw K.invalidParameterError("join.animated","boolean",Z.join.animated);if(K.defined(Z.join.across))if(K.integer(Z.join.across)&&K.inRange(Z.join.across,1,1e6))Q.joinAcross=Z.join.across;else throw K.invalidParameterError("join.across","integer between 1 and 100000",Z.join.across);if(K.defined(Z.join.shim))if(K.integer(Z.join.shim)&&K.inRange(Z.join.shim,0,1e6))Q.joinShim=Z.join.shim;else throw K.invalidParameterError("join.shim","integer between 0 and 100000",Z.join.shim);if(K.defined(Z.join.background))Q.joinBackground=this._getBackgroundColourOption(Z.join.background);if(K.defined(Z.join.halign))if(K.string(Z.join.halign)&&K.string(this.constructor.align[Z.join.halign]))Q.joinHalign=this.constructor.align[Z.join.halign];else throw K.invalidParameterError("join.halign","valid alignment",Z.join.halign);if(K.defined(Z.join.valign))if(K.string(Z.join.valign)&&K.string(this.constructor.align[Z.join.valign]))Q.joinValign=this.constructor.align[Z.join.valign];else throw K.invalidParameterError("join.valign","valid alignment",Z.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(K.defined(Z))throw Error(`Invalid input options ${Z}`);return Q}function HO($,Z,X){if(Array.isArray(this.options.input.buffer))if(K.buffer($)){if(this.options.input.buffer.length===0)this.on("finish",()=>{this.streamInFinished=!0});this.options.input.buffer.push($),X()}else X(Error("Non-Buffer data on Writable Stream"));else X(Error("Unexpected data on Writable Stream"))}function VO(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function BO(){return Array.isArray(this.options.input.buffer)}function FO($){let Z=Error();if(K.fn($)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),b0.metadata(this.options,(X,Q)=>{if(X)$(K.nativeError(X,Z));else $(null,Q)})});else b0.metadata(this.options,(X,Q)=>{if(X)$(K.nativeError(X,Z));else $(null,Q)});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{let J=()=>{this._flattenBufferIn(),b0.metadata(this.options,(G,W)=>{if(G)Q(K.nativeError(G,Z));else X(W)})};if(this.writableFinished)J();else this.once("finish",J)});else return new Promise((X,Q)=>{b0.metadata(this.options,(J,G)=>{if(J)Q(K.nativeError(J,Z));else X(G)})})}function LO($){let Z=Error();if(K.fn($)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),b0.stats(this.options,(X,Q)=>{if(X)$(K.nativeError(X,Z));else $(null,Q)})});else b0.stats(this.options,(X,Q)=>{if(X)$(K.nativeError(X,Z));else $(null,Q)});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{this.on("finish",function(){this._flattenBufferIn(),b0.stats(this.options,(J,G)=>{if(J)Q(K.nativeError(J,Z));else X(G)})})});else return new Promise((X,Q)=>{b0.stats(this.options,(J,G)=>{if(J)Q(K.nativeError(J,Z));else X(G)})})}var qO,UO,uU=($)=>{Object.assign($.prototype,{_inputOptionsFromObject:hU,_createInputDescriptor:KO,_write:HO,_flattenBufferIn:VO,_isStreamInput:BO,metadata:FO,stats:LO}),$.align=qO};var mU=s(()=>{R6();v9();/*!
|
|
295
|
+
*/NO=IO.debuglog("sharp");Object.setPrototypeOf(Z4.prototype,xX.Duplex.prototype);Object.setPrototypeOf(Z4,xX.Duplex);Object.assign(Z4.prototype,{clone:wO});k1=Z4});function sK($){let Z=jO.filter((X)=>U.defined($[X])).map((X)=>[X,$[X]]);return Z.length?Object.fromEntries(Z):void 0}function OO($,Z,X){let Q={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(U.string($))Q.file=$;else if(U.buffer($)){if($.length===0)throw Error("Input Buffer is empty");Q.buffer=$}else if(U.arrayBuffer($)){if($.byteLength===0)throw Error("Input bit Array is empty");Q.buffer=Buffer.from($,0,$.byteLength)}else if(U.typedArray($)){if($.length===0)throw Error("Input Bit Array is empty");Q.buffer=Buffer.from($.buffer,$.byteOffset,$.byteLength)}else if(U.plainObject($)&&!U.defined(Z)){if(Z=$,sK(Z))Q.buffer=[]}else if(!U.defined($)&&!U.defined(Z)&&U.object(X)&&X.allowStream)Q.buffer=[];else if(Array.isArray($))if($.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=$.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 '${$}' of type ${typeof $}${U.defined(Z)?` when also providing options of type ${typeof Z}`:""}`);if(U.object(Z)){if(U.defined(Z.failOn))if(U.string(Z.failOn)&&U.inArray(Z.failOn,["none","truncated","error","warning"]))Q.failOn=Z.failOn;else throw U.invalidParameterError("failOn","one of: none, truncated, error, warning",Z.failOn);if(U.defined(Z.autoOrient))if(U.bool(Z.autoOrient))Q.autoOrient=Z.autoOrient;else throw U.invalidParameterError("autoOrient","boolean",Z.autoOrient);if(U.defined(Z.density))if(U.number(Z.density)&&U.inRange(Z.density,1,1e5))Q.density=Z.density;else throw U.invalidParameterError("density","number between 1 and 100000",Z.density);if(U.defined(Z.ignoreIcc))if(U.bool(Z.ignoreIcc))Q.ignoreIcc=Z.ignoreIcc;else throw U.invalidParameterError("ignoreIcc","boolean",Z.ignoreIcc);if(U.defined(Z.limitInputPixels))if(U.bool(Z.limitInputPixels))Q.limitInputPixels=Z.limitInputPixels?268402689:0;else if(U.integer(Z.limitInputPixels)&&U.inRange(Z.limitInputPixels,0,Number.MAX_SAFE_INTEGER))Q.limitInputPixels=Z.limitInputPixels;else throw U.invalidParameterError("limitInputPixels","positive integer",Z.limitInputPixels);if(U.defined(Z.limitInputChannels))if(U.bool(Z.limitInputChannels))Q.limitInputChannels=Z.limitInputChannels?5:0;else if(U.integer(Z.limitInputChannels)&&U.inRange(Z.limitInputChannels,0,Number.MAX_SAFE_INTEGER))Q.limitInputChannels=Z.limitInputChannels;else throw U.invalidParameterError("limitInputChannels","positive integer",Z.limitInputChannels);if(U.defined(Z.unlimited))if(U.bool(Z.unlimited))Q.unlimited=Z.unlimited;else throw U.invalidParameterError("unlimited","boolean",Z.unlimited);if(U.defined(Z.sequentialRead))if(U.bool(Z.sequentialRead))Q.sequentialRead=Z.sequentialRead;else throw U.invalidParameterError("sequentialRead","boolean",Z.sequentialRead);if(U.defined(Z.raw)){if(U.object(Z.raw)&&U.integer(Z.raw.width)&&U.inRange(Z.raw.width,1,1e8)&&U.integer(Z.raw.height)&&U.inRange(Z.raw.height,1,1e8)&&U.integer(Z.raw.channels)&&U.inRange(Z.raw.channels,1,4))switch(Q.rawWidth=Z.raw.width,Q.rawHeight=Z.raw.height,Q.rawChannels=Z.raw.channels,$.constructor){case Uint8Array:case Uint8ClampedArray:Q.rawDepth="uchar";break;case Int8Array:Q.rawDepth="char";break;case Uint16Array:Q.rawDepth="ushort";break;case Int16Array:Q.rawDepth="short";break;case Uint32Array:Q.rawDepth="uint";break;case Int32Array:Q.rawDepth="int";break;case Float32Array:Q.rawDepth="float";break;case Float64Array:Q.rawDepth="double";break;default:Q.rawDepth="uchar";break}else throw Error("Expected width, height and channels for raw pixel input");if(Q.rawPremultiplied=!1,U.defined(Z.raw.premultiplied))if(U.bool(Z.raw.premultiplied))Q.rawPremultiplied=Z.raw.premultiplied;else throw U.invalidParameterError("raw.premultiplied","boolean",Z.raw.premultiplied);if(Q.rawPageHeight=0,U.defined(Z.raw.pageHeight))if(U.integer(Z.raw.pageHeight)&&Z.raw.pageHeight>0&&Z.raw.pageHeight<=Z.raw.height){if(Z.raw.height%Z.raw.pageHeight!==0)throw Error(`Expected raw.height ${Z.raw.height} to be a multiple of raw.pageHeight ${Z.raw.pageHeight}`);Q.rawPageHeight=Z.raw.pageHeight}else throw U.invalidParameterError("raw.pageHeight","positive integer",Z.raw.pageHeight)}if(U.defined(Z.animated))if(U.bool(Z.animated))Q.pages=Z.animated?-1:1;else throw U.invalidParameterError("animated","boolean",Z.animated);if(U.defined(Z.pages))if(U.integer(Z.pages)&&U.inRange(Z.pages,-1,1e5))Q.pages=Z.pages;else throw U.invalidParameterError("pages","integer between -1 and 100000",Z.pages);if(U.defined(Z.page))if(U.integer(Z.page)&&U.inRange(Z.page,0,1e5))Q.page=Z.page;else throw U.invalidParameterError("page","integer between 0 and 100000",Z.page);if(U.object(Z.openSlide)&&U.defined(Z.openSlide.level))if(U.integer(Z.openSlide.level)&&U.inRange(Z.openSlide.level,0,256))Q.openSlideLevel=Z.openSlide.level;else throw U.invalidParameterError("openSlide.level","integer between 0 and 256",Z.openSlide.level);else if(U.defined(Z.level))if(U.integer(Z.level)&&U.inRange(Z.level,0,256))Q.openSlideLevel=Z.level;else throw U.invalidParameterError("level","integer between 0 and 256",Z.level);if(U.object(Z.tiff)&&U.defined(Z.tiff.subifd))if(U.integer(Z.tiff.subifd)&&U.inRange(Z.tiff.subifd,-1,1e5))Q.tiffSubifd=Z.tiff.subifd;else throw U.invalidParameterError("tiff.subifd","integer between -1 and 100000",Z.tiff.subifd);else if(U.defined(Z.subifd))if(U.integer(Z.subifd)&&U.inRange(Z.subifd,-1,1e5))Q.tiffSubifd=Z.subifd;else throw U.invalidParameterError("subifd","integer between -1 and 100000",Z.subifd);if(U.object(Z.svg)){if(U.defined(Z.svg.stylesheet))if(U.string(Z.svg.stylesheet))Q.svgStylesheet=Z.svg.stylesheet;else throw U.invalidParameterError("svg.stylesheet","string",Z.svg.stylesheet);if(U.defined(Z.svg.highBitdepth))if(U.bool(Z.svg.highBitdepth))Q.svgHighBitdepth=Z.svg.highBitdepth;else throw U.invalidParameterError("svg.highBitdepth","boolean",Z.svg.highBitdepth)}if(U.object(Z.pdf)&&U.defined(Z.pdf.background))Q.pdfBackground=this._getBackgroundColourOption(Z.pdf.background);else if(U.defined(Z.pdfBackground))Q.pdfBackground=this._getBackgroundColourOption(Z.pdfBackground);if(U.object(Z.jp2)&&U.defined(Z.jp2.oneshot))if(U.bool(Z.jp2.oneshot))Q.jp2Oneshot=Z.jp2.oneshot;else throw U.invalidParameterError("jp2.oneshot","boolean",Z.jp2.oneshot);if(U.defined(Z.create))if(U.object(Z.create)&&U.integer(Z.create.width)&&U.inRange(Z.create.width,1,1e8)&&U.integer(Z.create.height)&&U.inRange(Z.create.height,1,1e8)&&U.integer(Z.create.channels)){if(Q.createWidth=Z.create.width,Q.createHeight=Z.create.height,Q.createChannels=Z.create.channels,Q.createPageHeight=0,U.defined(Z.create.pageHeight))if(U.integer(Z.create.pageHeight)&&Z.create.pageHeight>0&&Z.create.pageHeight<=Z.create.height){if(Z.create.height%Z.create.pageHeight!==0)throw Error(`Expected create.height ${Z.create.height} to be a multiple of create.pageHeight ${Z.create.pageHeight}`);Q.createPageHeight=Z.create.pageHeight}else throw U.invalidParameterError("create.pageHeight","positive integer",Z.create.pageHeight);if(U.defined(Z.create.noise)){if(!U.object(Z.create.noise))throw Error("Expected noise to be an object");if(Z.create.noise.type!=="gaussian")throw Error("Only gaussian noise is supported at the moment");if(Q.createNoiseType=Z.create.noise.type,!U.inRange(Z.create.channels,1,4))throw U.invalidParameterError("create.channels","number between 1 and 4",Z.create.channels);if(Q.createNoiseMean=128,U.defined(Z.create.noise.mean))if(U.number(Z.create.noise.mean)&&U.inRange(Z.create.noise.mean,0,1e4))Q.createNoiseMean=Z.create.noise.mean;else throw U.invalidParameterError("create.noise.mean","number between 0 and 10000",Z.create.noise.mean);if(Q.createNoiseSigma=30,U.defined(Z.create.noise.sigma))if(U.number(Z.create.noise.sigma)&&U.inRange(Z.create.noise.sigma,0,1e4))Q.createNoiseSigma=Z.create.noise.sigma;else throw U.invalidParameterError("create.noise.sigma","number between 0 and 10000",Z.create.noise.sigma)}else if(U.defined(Z.create.background)){if(!U.inRange(Z.create.channels,3,4))throw U.invalidParameterError("create.channels","number between 3 and 4",Z.create.channels);Q.createBackground=this._getBackgroundColourOption(Z.create.background)}else throw Error("Expected valid noise or background to create a new input image");delete Q.buffer}else throw Error("Expected valid width, height and channels to create a new input image");if(U.defined(Z.text))if(U.object(Z.text)&&U.string(Z.text.text)){if(Q.textValue=Z.text.text,U.defined(Z.text.height)&&U.defined(Z.text.dpi))throw Error("Expected only one of dpi or height");if(U.defined(Z.text.font))if(U.string(Z.text.font))Q.textFont=Z.text.font;else throw U.invalidParameterError("text.font","string",Z.text.font);if(U.defined(Z.text.fontfile))if(U.string(Z.text.fontfile))Q.textFontfile=Z.text.fontfile;else throw U.invalidParameterError("text.fontfile","string",Z.text.fontfile);if(U.defined(Z.text.width))if(U.integer(Z.text.width)&&U.inRange(Z.text.width,1,1e6))Q.textWidth=Z.text.width;else throw U.invalidParameterError("text.width","integer between 1 and 1000000",Z.text.width);if(U.defined(Z.text.height))if(U.integer(Z.text.height)&&U.inRange(Z.text.height,1,1e6))Q.textHeight=Z.text.height;else throw U.invalidParameterError("text.height","integer between 1 and 1000000",Z.text.height);if(U.defined(Z.text.align))if(U.string(Z.text.align)&&U.string(this.constructor.align[Z.text.align]))Q.textAlign=this.constructor.align[Z.text.align];else throw U.invalidParameterError("text.align","valid alignment",Z.text.align);if(U.defined(Z.text.justify))if(U.bool(Z.text.justify))Q.textJustify=Z.text.justify;else throw U.invalidParameterError("text.justify","boolean",Z.text.justify);if(U.defined(Z.text.dpi))if(U.integer(Z.text.dpi)&&U.inRange(Z.text.dpi,1,1e6))Q.textDpi=Z.text.dpi;else throw U.invalidParameterError("text.dpi","integer between 1 and 1000000",Z.text.dpi);if(U.defined(Z.text.rgba))if(U.bool(Z.text.rgba))Q.textRgba=Z.text.rgba;else throw U.invalidParameterError("text.rgba","bool",Z.text.rgba);if(U.defined(Z.text.spacing))if(U.integer(Z.text.spacing)&&U.inRange(Z.text.spacing,-1e6,1e6))Q.textSpacing=Z.text.spacing;else throw U.invalidParameterError("text.spacing","integer between -1000000 and 1000000",Z.text.spacing);if(U.defined(Z.text.wrap))if(U.string(Z.text.wrap)&&U.inArray(Z.text.wrap,["word","char","word-char","none"]))Q.textWrap=Z.text.wrap;else throw U.invalidParameterError("text.wrap","one of: word, char, word-char, none",Z.text.wrap);delete Q.buffer}else throw Error("Expected a valid string to create an image with text.");if(U.defined(Z.join))if(U.defined(this.options.join)){if(U.defined(Z.join.animated))if(U.bool(Z.join.animated))Q.joinAnimated=Z.join.animated;else throw U.invalidParameterError("join.animated","boolean",Z.join.animated);if(U.defined(Z.join.across))if(U.integer(Z.join.across)&&U.inRange(Z.join.across,1,1e6))Q.joinAcross=Z.join.across;else throw U.invalidParameterError("join.across","integer between 1 and 100000",Z.join.across);if(U.defined(Z.join.shim))if(U.integer(Z.join.shim)&&U.inRange(Z.join.shim,0,1e6))Q.joinShim=Z.join.shim;else throw U.invalidParameterError("join.shim","integer between 0 and 100000",Z.join.shim);if(U.defined(Z.join.background))Q.joinBackground=this._getBackgroundColourOption(Z.join.background);if(U.defined(Z.join.halign))if(U.string(Z.join.halign)&&U.string(this.constructor.align[Z.join.halign]))Q.joinHalign=this.constructor.align[Z.join.halign];else throw U.invalidParameterError("join.halign","valid alignment",Z.join.halign);if(U.defined(Z.join.valign))if(U.string(Z.join.valign)&&U.string(this.constructor.align[Z.join.valign]))Q.joinValign=this.constructor.align[Z.join.valign];else throw U.invalidParameterError("join.valign","valid alignment",Z.join.valign)}else throw Error("Expected input to be an array of images to join")}else if(U.defined(Z))throw Error(`Invalid input options ${Z}`);return Q}function EO($,Z,X){if(Array.isArray(this.options.input.buffer))if(U.buffer($)){if(this.options.input.buffer.length===0)this.on("finish",()=>{this.streamInFinished=!0});this.options.input.buffer.push($),X()}else X(Error("Non-Buffer data on Writable Stream"));else X(Error("Unexpected data on Writable Stream"))}function RO(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)}function PO(){return Array.isArray(this.options.input.buffer)}function CO($){let Z=Error();if(U.fn($)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),x0.metadata(this.options,(X,Q)=>{if(X)$(U.nativeError(X,Z));else $(null,Q)})});else x0.metadata(this.options,(X,Q)=>{if(X)$(U.nativeError(X,Z));else $(null,Q)});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{let J=()=>{this._flattenBufferIn(),x0.metadata(this.options,(G,W)=>{if(G)Q(U.nativeError(G,Z));else X(W)})};if(this.writableFinished)J();else this.once("finish",J)});else return new Promise((X,Q)=>{x0.metadata(this.options,(J,G)=>{if(J)Q(U.nativeError(J,Z));else X(G)})})}function SO($){let Z=Error();if(U.fn($)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),x0.stats(this.options,(X,Q)=>{if(X)$(U.nativeError(X,Z));else $(null,Q)})});else x0.stats(this.options,(X,Q)=>{if(X)$(U.nativeError(X,Z));else $(null,Q)});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{this.on("finish",function(){this._flattenBufferIn(),x0.stats(this.options,(J,G)=>{if(J)Q(U.nativeError(J,Z));else X(G)})})});else return new Promise((X,Q)=>{x0.stats(this.options,(J,G)=>{if(J)Q(U.nativeError(J,Z));else X(G)})})}var TO,jO,tK=($)=>{Object.assign($.prototype,{_inputOptionsFromObject:sK,_createInputDescriptor:OO,_write:EO,_flattenBufferIn:RO,_isStreamInput:PO,metadata:CO,stats:SO}),$.align=TO};var eK=s(()=>{C1();d9();/*!
|
|
298
296
|
Copyright 2013 Lovell Fuller and others.
|
|
299
297
|
SPDX-License-Identifier: Apache-2.0
|
|
300
|
-
*/
|
|
298
|
+
*/TO={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},jO=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"]});function yX($){return $.angle%360!==0||$.rotationAngle!==0}function g5($){return $.width!==-1||$.height!==-1}function xO($,Z,X){if(g5(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(U.defined($))if(U.object($)&&!U.defined(X))X=$;else if(U.integer($)&&$>0)this.options.width=$;else throw U.invalidParameterError("width","positive integer",$);else this.options.width=-1;if(U.defined(Z))if(U.integer(Z)&&Z>0)this.options.height=Z;else throw U.invalidParameterError("height","positive integer",Z);else this.options.height=-1;if(U.object(X)){if(U.defined(X.width))if(U.integer(X.width)&&X.width>0)this.options.width=X.width;else throw U.invalidParameterError("width","positive integer",X.width);if(U.defined(X.height))if(U.integer(X.height)&&X.height>0)this.options.height=X.height;else throw U.invalidParameterError("height","positive integer",X.height);if(U.defined(X.fit)){let Q=bO[X.fit];if(U.string(Q))this.options.canvas=Q;else throw U.invalidParameterError("fit","valid fit",X.fit)}if(U.defined(X.position)){let Q=U.integer(X.position)?X.position:QU[X.position]||XU[X.position]||ZU[X.position];if(U.integer(Q)&&(U.inRange(Q,0,8)||U.inRange(Q,16,17)))this.options.position=Q;else throw U.invalidParameterError("position","valid position/gravity/strategy",X.position)}if(this._setBackgroundColourOption("resizeBackground",X.background),U.defined(X.kernel))if(U.string(kX[X.kernel]))this.options.kernel=kX[X.kernel];else throw U.invalidParameterError("kernel","valid kernel name",X.kernel);if(U.defined(X.withoutEnlargement))this._setBooleanOption("withoutEnlargement",X.withoutEnlargement);if(U.defined(X.withoutReduction))this._setBooleanOption("withoutReduction",X.withoutReduction);if(U.defined(X.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",X.fastShrinkOnLoad)}if(yX(this.options)&&g5(this.options))this.options.rotateBefore=!0;return this}function kO($){if(U.integer($))if(U.inRange($,1,1e4))this.options.extendTop=$,this.options.extendBottom=$,this.options.extendLeft=$,this.options.extendRight=$;else throw U.invalidParameterError("extend","integer between 1 and 10000",$);else if(U.object($)){if(U.defined($.top))if(U.integer($.top)&&U.inRange($.top,0,1e4))this.options.extendTop=$.top;else throw U.invalidParameterError("top","integer between 0 and 10000",$.top);if(U.defined($.bottom))if(U.integer($.bottom)&&U.inRange($.bottom,0,1e4))this.options.extendBottom=$.bottom;else throw U.invalidParameterError("bottom","integer between 0 and 10000",$.bottom);if(U.defined($.left))if(U.integer($.left)&&U.inRange($.left,0,1e4))this.options.extendLeft=$.left;else throw U.invalidParameterError("left","integer between 0 and 10000",$.left);if(U.defined($.right))if(U.integer($.right)&&U.inRange($.right,0,1e4))this.options.extendRight=$.right;else throw U.invalidParameterError("right","integer between 0 and 10000",$.right);if(this._setBackgroundColourOption("extendBackground",$.background),U.defined($.extendWith))if(U.string($U[$.extendWith]))this.options.extendWith=$U[$.extendWith];else throw U.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",$.extendWith)}else throw U.invalidParameterError("extend","integer or object",$);return this}function yO($){let Z=g5(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${Z}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function(X){let Q=$[X];if(U.integer(Q)&&U.inRange(Q,0,1e8))this.options[X+(X==="left"||X==="top"?"Offset":"")+Z]=Q;else throw U.invalidParameterError(X,"integer between 0 and 100000000",Q)},this),yX(this.options)&&!g5(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 vO($){if(this.options.trimThreshold=10,U.defined($))if(U.object($)){if(U.defined($.background))this._setBackgroundColourOption("trimBackground",$.background);if(U.defined($.threshold))if(U.number($.threshold)&&$.threshold>=0)this.options.trimThreshold=$.threshold;else throw U.invalidParameterError("threshold","positive number",$.threshold);if(U.defined($.lineArt))this._setBooleanOption("trimLineArt",$.lineArt);if(U.defined($.margin))if(U.integer($.margin)&&U.inRange($.margin,0,1e7))this.options.trimMargin=$.margin;else throw U.invalidParameterError("margin","integer between 0 and 10000000",$.margin)}else throw U.invalidParameterError("trim","object",$);if(yX(this.options))this.options.rotateBefore=!0;return this}var ZU,XU,$U,QU,kX,_O,bO,JU=($)=>{Object.assign($.prototype,{resize:xO,extend:kO,extract:yO,trim:vO}),$.gravity=ZU,$.strategy=QU,$.kernel=kX,$.fit=_O,$.position=XU};var GU=s(()=>{C1();/*!
|
|
301
299
|
Copyright 2013 Lovell Fuller and others.
|
|
302
300
|
SPDX-License-Identifier: Apache-2.0
|
|
303
|
-
*/
|
|
301
|
+
*/ZU={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},XU={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},$U={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},QU={entropy:16,attention:17},kX={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},_O={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},bO={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"}});function gO($){if(!Array.isArray($))throw U.invalidParameterError("images to composite","array",$);return this.options.composite=$.map((Z)=>{if(!U.object(Z))throw U.invalidParameterError("image to composite","object",Z);let X=this._inputOptionsFromObject(Z),Q={input:this._createInputDescriptor(Z.input,X,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(U.defined(Z.blend))if(U.string(vX[Z.blend]))Q.blend=vX[Z.blend];else throw U.invalidParameterError("blend","valid blend name",Z.blend);if(U.defined(Z.tile))if(U.bool(Z.tile))Q.tile=Z.tile;else throw U.invalidParameterError("tile","boolean",Z.tile);if(U.defined(Z.left))if(U.integer(Z.left))Q.left=Z.left;else throw U.invalidParameterError("left","integer",Z.left);if(U.defined(Z.top))if(U.integer(Z.top))Q.top=Z.top;else throw U.invalidParameterError("top","integer",Z.top);if(U.defined(Z.top)!==U.defined(Z.left))throw Error("Expected both left and top to be set");else Q.hasOffset=U.integer(Z.top)&&U.integer(Z.left);if(U.defined(Z.gravity))if(U.integer(Z.gravity)&&U.inRange(Z.gravity,0,8))Q.gravity=Z.gravity;else if(U.string(Z.gravity)&&U.integer(this.constructor.gravity[Z.gravity]))Q.gravity=this.constructor.gravity[Z.gravity];else throw U.invalidParameterError("gravity","valid gravity",Z.gravity);if(U.defined(Z.premultiplied))if(U.bool(Z.premultiplied))Q.premultiplied=Z.premultiplied;else throw U.invalidParameterError("premultiplied","boolean",Z.premultiplied);return Q}),this}var vX,WU=($)=>{$.prototype.composite=gO,$.blend=vX};var YU=s(()=>{C1();/*!
|
|
304
302
|
Copyright 2013 Lovell Fuller and others.
|
|
305
303
|
SPDX-License-Identifier: Apache-2.0
|
|
306
|
-
*/RX={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 jO($,Z){if(!K.defined($))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($)&&!($%90))this.options.angle=$;else if(K.number($)){if(this.options.rotationAngle=$,K.object(Z)&&Z.background)this._setBackgroundColourOption("rotationBackground",Z.background)}else throw K.invalidParameterError("angle","numeric",$);return this}function OO(){return this.options.input.autoOrient=!0,this}function EO($){return this.options.flip=K.bool($)?$:!0,this}function RO($){return this.options.flop=K.bool($)?$:!0,this}function PO($,Z){let Q=Array.isArray($)&&($.length===4&&$.every(K.number)||$.length===2&&$.every((J)=>Array.isArray(J)&&J.length===2))?$.flat():[];if(Q.length===4&&Q.every(K.number))this.options.affineMatrix=Q;else throw K.invalidParameterError("matrix","1x4 or 2x2 array",$);if(K.defined(Z))if(K.object(Z)){if(this._setBackgroundColourOption("affineBackground",Z.background),K.defined(Z.idx))if(K.number(Z.idx))this.options.affineIdx=Z.idx;else throw K.invalidParameterError("options.idx","number",Z.idx);if(K.defined(Z.idy))if(K.number(Z.idy))this.options.affineIdy=Z.idy;else throw K.invalidParameterError("options.idy","number",Z.idy);if(K.defined(Z.odx))if(K.number(Z.odx))this.options.affineOdx=Z.odx;else throw K.invalidParameterError("options.odx","number",Z.odx);if(K.defined(Z.ody))if(K.number(Z.ody))this.options.affineOdy=Z.ody;else throw K.invalidParameterError("options.ody","number",Z.ody);if(K.defined(Z.interpolator))if(K.inArray(Z.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=Z.interpolator;else throw K.invalidParameterError("options.interpolator","valid interpolator name",Z.interpolator)}else throw K.invalidParameterError("options","object",Z);return this}function CO($){if(K.plainObject($)){if(K.number($.sigma)&&K.inRange($.sigma,0.000001,10))this.options.sharpenSigma=$.sigma;else throw K.invalidParameterError("options.sigma","number between 0.000001 and 10",$.sigma);if(K.defined($.m1))if(K.number($.m1)&&K.inRange($.m1,0,1e6))this.options.sharpenM1=$.m1;else throw K.invalidParameterError("options.m1","number between 0 and 1000000",$.m1);if(K.defined($.m2))if(K.number($.m2)&&K.inRange($.m2,0,1e6))this.options.sharpenM2=$.m2;else throw K.invalidParameterError("options.m2","number between 0 and 1000000",$.m2);if(K.defined($.x1))if(K.number($.x1)&&K.inRange($.x1,0,1e6))this.options.sharpenX1=$.x1;else throw K.invalidParameterError("options.x1","number between 0 and 1000000",$.x1);if(K.defined($.y2))if(K.number($.y2)&&K.inRange($.y2,0,1e6))this.options.sharpenY2=$.y2;else throw K.invalidParameterError("options.y2","number between 0 and 1000000",$.y2);if(K.defined($.y3))if(K.number($.y3)&&K.inRange($.y3,0,1e6))this.options.sharpenY3=$.y3;else throw K.invalidParameterError("options.y3","number between 0 and 1000000",$.y3)}else this.options.sharpenSigma=-1;return this}function SO($){if(!K.defined($))this.options.medianSize=3;else if(K.integer($)&&K.inRange($,1,1000))this.options.medianSize=$;else throw K.invalidParameterError("size","integer between 1 and 1000",$);return this}function _O($){let Z;if(K.number($))Z=$;else if(K.plainObject($)){if(!K.number($.sigma))throw K.invalidParameterError("options.sigma","number between 0.3 and 1000",Z);if(Z=$.sigma,"precision"in $)if(K.string(oU[$.precision]))this.options.precision=oU[$.precision];else throw K.invalidParameterError("precision","one of: integer, float, approximate",$.precision);if("minAmplitude"in $)if(K.number($.minAmplitude)&&K.inRange($.minAmplitude,0.001,1))this.options.minAmpl=$.minAmplitude;else throw K.invalidParameterError("minAmplitude","number between 0.001 and 1",$.minAmplitude)}if(!K.defined($))this.options.blurSigma=-1;else if(K.bool($))this.options.blurSigma=$?-1:0;else if(K.number(Z)&&K.inRange(Z,0.3,1000))this.options.blurSigma=Z;else throw K.invalidParameterError("sigma","number between 0.3 and 1000",Z);return this}function xO($){if(!K.defined($))this.options.dilateWidth=1;else if(K.integer($)&&K.inRange($,1,65536))this.options.dilateWidth=$;else throw K.invalidParameterError("width","integer between 1 and 65536",$);return this}function bO($){if(!K.defined($))this.options.erodeWidth=1;else if(K.integer($)&&K.inRange($,1,65536))this.options.erodeWidth=$;else throw K.invalidParameterError("width","integer between 1 and 65536",$);return this}function kO($){if(this.options.flatten=K.bool($)?$:!0,K.object($))this._setBackgroundColourOption("flattenBackground",$.background);return this}function yO(){return this.options.unflatten=!0,this}function vO($,Z){if(!K.defined($))this.options.gamma=2.2;else if(K.number($)&&K.inRange($,1,3))this.options.gamma=$;else throw K.invalidParameterError("gamma","number between 1.0 and 3.0",$);if(!K.defined(Z))this.options.gammaOut=this.options.gamma;else if(K.number(Z)&&K.inRange(Z,1,3))this.options.gammaOut=Z;else throw K.invalidParameterError("gammaOut","number between 1.0 and 3.0",Z);return this}function gO($){if(this.options.negate=K.bool($)?$:!0,K.plainObject($)&&"alpha"in $)if(!K.bool($.alpha))throw K.invalidParameterError("alpha","should be boolean value",$.alpha);else this.options.negateAlpha=$.alpha;return this}function fO($){if(K.plainObject($)){if(K.defined($.lower))if(K.number($.lower)&&K.inRange($.lower,0,99))this.options.normaliseLower=$.lower;else throw K.invalidParameterError("lower","number between 0 and 99",$.lower);if(K.defined($.upper))if(K.number($.upper)&&K.inRange($.upper,1,100))this.options.normaliseUpper=$.upper;else throw K.invalidParameterError("upper","number between 1 and 100",$.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 hO($){return this.normalise($)}function uO($){if(K.plainObject($)){if(K.integer($.width)&&K.inRange($.width,1,65536))this.options.claheWidth=$.width;else throw K.invalidParameterError("width","integer between 1 and 65536",$.width);if(K.integer($.height)&&K.inRange($.height,1,65536))this.options.claheHeight=$.height;else throw K.invalidParameterError("height","integer between 1 and 65536",$.height);if(K.defined($.maxSlope))if(K.integer($.maxSlope)&&K.inRange($.maxSlope,0,100))this.options.claheMaxSlope=$.maxSlope;else throw K.invalidParameterError("maxSlope","integer between 0 and 100",$.maxSlope)}else throw K.invalidParameterError("options","plain object",$);return this}function mO($){if(!K.object($)||!Array.isArray($.kernel)||!K.integer($.width)||!K.integer($.height)||!K.inRange($.width,3,1001)||!K.inRange($.height,3,1001)||$.height*$.width!==$.kernel.length||!$.kernel.every(K.number))throw Error("Invalid convolution kernel");if(!K.integer($.scale))$.scale=$.kernel.reduce((Z,X)=>Z+X,0);if($.scale<1)$.scale=1;if(!K.integer($.offset))$.offset=0;return this.options.convKernel=$,this}function dO($,Z){if(!K.defined($))this.options.threshold=128;else if(K.bool($))this.options.threshold=$?128:0;else if(K.integer($)&&K.inRange($,0,255))this.options.threshold=$;else throw K.invalidParameterError("threshold","integer between 0 and 255",$);if(!K.object(Z)||Z.greyscale===!0||Z.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function lO($,Z,X){if(this.options.boolean=this._createInputDescriptor($,X),K.string(Z)&&K.inArray(Z,["and","or","eor"]))this.options.booleanOp=Z;else throw K.invalidParameterError("operator","one of: and, or, eor",Z);return this}function cO($,Z){if(!K.defined($)&&K.number(Z))$=1;else if(K.number($)&&!K.defined(Z))Z=0;if(!K.defined($))this.options.linearA=[];else if(K.number($))this.options.linearA=[$];else if(Array.isArray($)&&$.length&&$.every(K.number))this.options.linearA=$;else throw K.invalidParameterError("a","number or array of numbers",$);if(!K.defined(Z))this.options.linearB=[];else if(K.number(Z))this.options.linearB=[Z];else if(Array.isArray(Z)&&Z.length&&Z.every(K.number))this.options.linearB=Z;else throw K.invalidParameterError("b","number or array of numbers",Z);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 pO($){if(!Array.isArray($))throw K.invalidParameterError("inputMatrix","array",$);let Z=$.length;if(Z!==3&&Z!==4)throw K.invalidParameterError("inputMatrix","3x3 or 4x4 array",Z);if(!$.every((Q)=>Array.isArray(Q)&&Q.length===Z))throw K.invalidParameterError("inputMatrix",`array of ${Z} arrays of length ${Z}`,$);let X=$.flat();if(!X.every(K.number))throw K.invalidParameterError("inputMatrix","array of numbers",X);return this.options.recombMatrix=X,this}function iO($){if(!K.plainObject($))throw K.invalidParameterError("options","plain object",$);if("brightness"in $)if(K.number($.brightness)&&$.brightness>=0)this.options.brightness=$.brightness;else throw K.invalidParameterError("brightness","number above zero",$.brightness);if("saturation"in $)if(K.number($.saturation)&&$.saturation>=0)this.options.saturation=$.saturation;else throw K.invalidParameterError("saturation","number above zero",$.saturation);if("hue"in $)if(K.integer($.hue))this.options.hue=$.hue%360;else throw K.invalidParameterError("hue","number",$.hue);if("lightness"in $)if(K.number($.lightness))this.options.lightness=$.lightness;else throw K.invalidParameterError("lightness","number",$.lightness);return this}var oU,sU=($)=>{Object.assign($.prototype,{autoOrient:OO,rotate:jO,flip:EO,flop:RO,affine:PO,sharpen:CO,erode:bO,dilate:xO,median:SO,blur:_O,flatten:kO,unflatten:yO,gamma:vO,negate:gO,normalise:fO,normalize:hO,clahe:uO,convolve:mO,threshold:dO,boolean:lO,linear:cO,recomb:pO,modulate:iO})};var tU=s(()=>{R6();/*!
|
|
304
|
+
*/vX={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 fO($,Z){if(!U.defined($))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(U.integer($)&&!($%90))this.options.angle=$;else if(U.number($)){if(this.options.rotationAngle=$,U.object(Z)&&Z.background)this._setBackgroundColourOption("rotationBackground",Z.background)}else throw U.invalidParameterError("angle","numeric",$);return this}function hO(){return this.options.input.autoOrient=!0,this}function uO($){return this.options.flip=U.bool($)?$:!0,this}function mO($){return this.options.flop=U.bool($)?$:!0,this}function dO($,Z){let Q=Array.isArray($)&&($.length===4&&$.every(U.number)||$.length===2&&$.every((J)=>Array.isArray(J)&&J.length===2))?$.flat():[];if(Q.length===4&&Q.every(U.number))this.options.affineMatrix=Q;else throw U.invalidParameterError("matrix","1x4 or 2x2 array",$);if(U.defined(Z))if(U.object(Z)){if(this._setBackgroundColourOption("affineBackground",Z.background),U.defined(Z.idx))if(U.number(Z.idx))this.options.affineIdx=Z.idx;else throw U.invalidParameterError("options.idx","number",Z.idx);if(U.defined(Z.idy))if(U.number(Z.idy))this.options.affineIdy=Z.idy;else throw U.invalidParameterError("options.idy","number",Z.idy);if(U.defined(Z.odx))if(U.number(Z.odx))this.options.affineOdx=Z.odx;else throw U.invalidParameterError("options.odx","number",Z.odx);if(U.defined(Z.ody))if(U.number(Z.ody))this.options.affineOdy=Z.ody;else throw U.invalidParameterError("options.ody","number",Z.ody);if(U.defined(Z.interpolator))if(U.inArray(Z.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=Z.interpolator;else throw U.invalidParameterError("options.interpolator","valid interpolator name",Z.interpolator)}else throw U.invalidParameterError("options","object",Z);return this}function lO($){if(U.plainObject($)){if(U.number($.sigma)&&U.inRange($.sigma,0.000001,10))this.options.sharpenSigma=$.sigma;else throw U.invalidParameterError("options.sigma","number between 0.000001 and 10",$.sigma);if(U.defined($.m1))if(U.number($.m1)&&U.inRange($.m1,0,1e6))this.options.sharpenM1=$.m1;else throw U.invalidParameterError("options.m1","number between 0 and 1000000",$.m1);if(U.defined($.m2))if(U.number($.m2)&&U.inRange($.m2,0,1e6))this.options.sharpenM2=$.m2;else throw U.invalidParameterError("options.m2","number between 0 and 1000000",$.m2);if(U.defined($.x1))if(U.number($.x1)&&U.inRange($.x1,0,1e6))this.options.sharpenX1=$.x1;else throw U.invalidParameterError("options.x1","number between 0 and 1000000",$.x1);if(U.defined($.y2))if(U.number($.y2)&&U.inRange($.y2,0,1e6))this.options.sharpenY2=$.y2;else throw U.invalidParameterError("options.y2","number between 0 and 1000000",$.y2);if(U.defined($.y3))if(U.number($.y3)&&U.inRange($.y3,0,1e6))this.options.sharpenY3=$.y3;else throw U.invalidParameterError("options.y3","number between 0 and 1000000",$.y3)}else this.options.sharpenSigma=-1;return this}function cO($){if(!U.defined($))this.options.medianSize=3;else if(U.integer($)&&U.inRange($,1,1000))this.options.medianSize=$;else throw U.invalidParameterError("size","integer between 1 and 1000",$);return this}function pO($){let Z;if(U.number($))Z=$;else if(U.plainObject($)){if(!U.number($.sigma))throw U.invalidParameterError("options.sigma","number between 0.3 and 1000",Z);if(Z=$.sigma,"precision"in $)if(U.string(zU[$.precision]))this.options.precision=zU[$.precision];else throw U.invalidParameterError("precision","one of: integer, float, approximate",$.precision);if("minAmplitude"in $)if(U.number($.minAmplitude)&&U.inRange($.minAmplitude,0.001,1))this.options.minAmpl=$.minAmplitude;else throw U.invalidParameterError("minAmplitude","number between 0.001 and 1",$.minAmplitude)}if(!U.defined($))this.options.blurSigma=-1;else if(U.bool($))this.options.blurSigma=$?-1:0;else if(U.number(Z)&&U.inRange(Z,0.3,1000))this.options.blurSigma=Z;else throw U.invalidParameterError("sigma","number between 0.3 and 1000",Z);return this}function iO($){if(!U.defined($))this.options.dilateWidth=1;else if(U.integer($)&&U.inRange($,1,65536))this.options.dilateWidth=$;else throw U.invalidParameterError("width","integer between 1 and 65536",$);return this}function nO($){if(!U.defined($))this.options.erodeWidth=1;else if(U.integer($)&&U.inRange($,1,65536))this.options.erodeWidth=$;else throw U.invalidParameterError("width","integer between 1 and 65536",$);return this}function rO($){if(this.options.flatten=U.bool($)?$:!0,U.object($))this._setBackgroundColourOption("flattenBackground",$.background);return this}function aO(){return this.options.unflatten=!0,this}function oO($,Z){if(!U.defined($))this.options.gamma=2.2;else if(U.number($)&&U.inRange($,1,3))this.options.gamma=$;else throw U.invalidParameterError("gamma","number between 1.0 and 3.0",$);if(!U.defined(Z))this.options.gammaOut=this.options.gamma;else if(U.number(Z)&&U.inRange(Z,1,3))this.options.gammaOut=Z;else throw U.invalidParameterError("gammaOut","number between 1.0 and 3.0",Z);return this}function sO($){if(this.options.negate=U.bool($)?$:!0,U.plainObject($)&&"alpha"in $)if(!U.bool($.alpha))throw U.invalidParameterError("alpha","should be boolean value",$.alpha);else this.options.negateAlpha=$.alpha;return this}function tO($){if(U.plainObject($)){if(U.defined($.lower))if(U.number($.lower)&&U.inRange($.lower,0,99))this.options.normaliseLower=$.lower;else throw U.invalidParameterError("lower","number between 0 and 99",$.lower);if(U.defined($.upper))if(U.number($.upper)&&U.inRange($.upper,1,100))this.options.normaliseUpper=$.upper;else throw U.invalidParameterError("upper","number between 1 and 100",$.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw U.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function eO($){return this.normalise($)}function $E($){if(U.plainObject($)){if(U.integer($.width)&&U.inRange($.width,1,65536))this.options.claheWidth=$.width;else throw U.invalidParameterError("width","integer between 1 and 65536",$.width);if(U.integer($.height)&&U.inRange($.height,1,65536))this.options.claheHeight=$.height;else throw U.invalidParameterError("height","integer between 1 and 65536",$.height);if(U.defined($.maxSlope))if(U.integer($.maxSlope)&&U.inRange($.maxSlope,0,100))this.options.claheMaxSlope=$.maxSlope;else throw U.invalidParameterError("maxSlope","integer between 0 and 100",$.maxSlope)}else throw U.invalidParameterError("options","plain object",$);return this}function ZE($){if(!U.object($)||!Array.isArray($.kernel)||!U.integer($.width)||!U.integer($.height)||!U.inRange($.width,3,1001)||!U.inRange($.height,3,1001)||$.height*$.width!==$.kernel.length||!$.kernel.every(U.number))throw Error("Invalid convolution kernel");if(!U.integer($.scale))$.scale=$.kernel.reduce((Z,X)=>Z+X,0);if($.scale<1)$.scale=1;if(!U.integer($.offset))$.offset=0;return this.options.convKernel=$,this}function XE($,Z){if(!U.defined($))this.options.threshold=128;else if(U.bool($))this.options.threshold=$?128:0;else if(U.integer($)&&U.inRange($,0,255))this.options.threshold=$;else throw U.invalidParameterError("threshold","integer between 0 and 255",$);if(!U.object(Z)||Z.greyscale===!0||Z.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this}function QE($,Z,X){if(this.options.boolean=this._createInputDescriptor($,X),U.string(Z)&&U.inArray(Z,["and","or","eor"]))this.options.booleanOp=Z;else throw U.invalidParameterError("operator","one of: and, or, eor",Z);return this}function JE($,Z){if(!U.defined($)&&U.number(Z))$=1;else if(U.number($)&&!U.defined(Z))Z=0;if(!U.defined($))this.options.linearA=[];else if(U.number($))this.options.linearA=[$];else if(Array.isArray($)&&$.length&&$.every(U.number))this.options.linearA=$;else throw U.invalidParameterError("a","number or array of numbers",$);if(!U.defined(Z))this.options.linearB=[];else if(U.number(Z))this.options.linearB=[Z];else if(Array.isArray(Z)&&Z.length&&Z.every(U.number))this.options.linearB=Z;else throw U.invalidParameterError("b","number or array of numbers",Z);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 GE($){if(!Array.isArray($))throw U.invalidParameterError("inputMatrix","array",$);let Z=$.length;if(Z!==3&&Z!==4)throw U.invalidParameterError("inputMatrix","3x3 or 4x4 array",Z);if(!$.every((Q)=>Array.isArray(Q)&&Q.length===Z))throw U.invalidParameterError("inputMatrix",`array of ${Z} arrays of length ${Z}`,$);let X=$.flat();if(!X.every(U.number))throw U.invalidParameterError("inputMatrix","array of numbers",X);return this.options.recombMatrix=X,this}function WE($){if(!U.plainObject($))throw U.invalidParameterError("options","plain object",$);if("brightness"in $)if(U.number($.brightness)&&$.brightness>=0)this.options.brightness=$.brightness;else throw U.invalidParameterError("brightness","number above zero",$.brightness);if("saturation"in $)if(U.number($.saturation)&&$.saturation>=0)this.options.saturation=$.saturation;else throw U.invalidParameterError("saturation","number above zero",$.saturation);if("hue"in $)if(U.integer($.hue))this.options.hue=$.hue%360;else throw U.invalidParameterError("hue","number",$.hue);if("lightness"in $)if(U.number($.lightness))this.options.lightness=$.lightness;else throw U.invalidParameterError("lightness","number",$.lightness);return this}var zU,qU=($)=>{Object.assign($.prototype,{autoOrient:hO,rotate:fO,flip:uO,flop:mO,affine:dO,sharpen:lO,erode:nO,dilate:iO,median:cO,blur:pO,flatten:rO,unflatten:aO,gamma:oO,negate:sO,normalise:tO,normalize:eO,clahe:$E,convolve:ZE,threshold:XE,boolean:QE,linear:JE,recomb:GE,modulate:WE})};var KU=s(()=>{C1();/*!
|
|
307
305
|
Copyright 2013 Lovell Fuller and others.
|
|
308
306
|
SPDX-License-Identifier: Apache-2.0
|
|
309
|
-
*/oU={integer:"integer",float:"float",approximate:"approximate"}});var JK=x((tl,QK)=>{var{defineProperty:xX,getOwnPropertyDescriptor:nO,getOwnPropertyNames:rO}=Object,aO=Object.prototype.hasOwnProperty,oO=($,Z)=>{for(var X in Z)xX($,X,{get:Z[X],enumerable:!0})},sO=($,Z,X,Q)=>{if(Z&&typeof Z==="object"||typeof Z==="function"){for(let J of rO(Z))if(!aO.call($,J)&&J!==X)xX($,J,{get:()=>Z[J],enumerable:!(Q=nO(Z,J))||Q.enumerable})}return $},tO=($)=>sO(xX({},"__esModule",{value:!0}),$),eU={};oO(eU,{default:()=>HE});QK.exports=tO(eU);var PX={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 $ in PX)Object.freeze(PX[$]);var b6=Object.freeze(PX),$K=Object.create(null);for(let $ in b6)if(Object.hasOwn(b6,$))$K[b6[$]]=$;var _$={to:{},get:{}};_$.get=function($){let Z=$.slice(0,3).toLowerCase(),X,Q;switch(Z){case"hsl":{X=_$.get.hsl($),Q="hsl";break}case"hwb":{X=_$.get.hwb($),Q="hwb";break}default:{X=_$.get.rgb($),Q="rgb";break}}if(!X)return null;return{model:Q,value:X}};_$.get.rgb=function($){if(!$)return null;let Z=/^#([a-f\d]{3,4})$/i,X=/^#([a-f\d]{6})([a-f\d]{2})?$/i,Q=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,J=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,G=/^(\w+)$/,W=[0,0,0,1],Y,z,q;if(Y=$.match(X)){q=Y[2],Y=Y[1];for(z=0;z<3;z++){let H=z*2;W[z]=Number.parseInt(Y.slice(H,H+2),16)}if(q)W[3]=Number.parseInt(q,16)/255}else if(Y=$.match(Z)){Y=Y[1],q=Y[3];for(z=0;z<3;z++)W[z]=Number.parseInt(Y[z]+Y[z],16);if(q)W[3]=Number.parseInt(q+q,16)/255}else if(Y=$.match(Q)){for(z=0;z<3;z++)W[z]=Number.parseFloat(Y[z+1]);if(Y[4])W[3]=Y[5]?Number.parseFloat(Y[4])*0.01:Number.parseFloat(Y[4])}else if(Y=$.match(J)){for(z=0;z<3;z++)W[z]=Math.round(Number.parseFloat(Y[z+1])*2.55);if(Y[4])W[3]=Y[5]?Number.parseFloat(Y[4])*0.01:Number.parseFloat(Y[4])}else if(Y=$.toLowerCase().match(G)){if(Y[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(b6,Y[1]))return null;return W=b6[Y[1]].slice(),W[3]=1,W}else return null;for(z=0;z<3;z++)W[z]=O1(W[z],0,255);return W[3]=O1(W[3],0,1),W};_$.get.hsl=function($){if(!$)return null;let Z=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,X=$.match(Z);if(X){let Q=Number.parseFloat(X[4]),J=(Number.parseFloat(X[1])%360+360)%360,G=O1(Number.parseFloat(X[2]),0,100),W=O1(Number.parseFloat(X[3]),0,100),Y=O1(Number.isNaN(Q)?1:Q,0,1);return[J,G,W,Y]}return null};_$.get.hwb=function($){if(!$)return null;let Z=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,X=$.match(Z);if(X){let Q=Number.parseFloat(X[4]),J=(Number.parseFloat(X[1])%360+360)%360,G=O1(Number.parseFloat(X[2]),0,100),W=O1(Number.parseFloat(X[3]),0,100),Y=O1(Number.isNaN(Q)?1:Q,0,1);return[J,G,W,Y]}return null};_$.to.hex=function(...$){return"#"+P8($[0])+P8($[1])+P8($[2])+($[3]<1?P8(Math.round($[3]*255)):"")};_$.to.rgb=function(...$){return $.length<4||$[3]===1?"rgb("+Math.round($[0])+", "+Math.round($[1])+", "+Math.round($[2])+")":"rgba("+Math.round($[0])+", "+Math.round($[1])+", "+Math.round($[2])+", "+$[3]+")"};_$.to.rgb.percent=function(...$){let Z=Math.round($[0]/255*100),X=Math.round($[1]/255*100),Q=Math.round($[2]/255*100);return $.length<4||$[3]===1?"rgb("+Z+"%, "+X+"%, "+Q+"%)":"rgba("+Z+"%, "+X+"%, "+Q+"%, "+$[3]+")"};_$.to.hsl=function(...$){return $.length<4||$[3]===1?"hsl("+$[0]+", "+$[1]+"%, "+$[2]+"%)":"hsla("+$[0]+", "+$[1]+"%, "+$[2]+"%, "+$[3]+")"};_$.to.hwb=function(...$){let Z="";if($.length>=4&&$[3]!==1)Z=", "+$[3];return"hwb("+$[0]+", "+$[1]+"%, "+$[2]+"%"+Z+")"};_$.to.keyword=function(...$){return $K[$.slice(0,3)]};function O1($,Z,X){return Math.min(Math.max(Z,$),X)}function P8($){let Z=Math.round($).toString(16).toUpperCase();return Z.length<2?"0"+Z:Z}var S4=_$,ZK={};for(let $ of Object.keys(b6))ZK[b6[$]]=$;var W0={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},t1=W0,e6=0.008856451679035631;function x4($){let Z=$>0.0031308?1.055*$**0.4166666666666667-0.055:$*12.92;return Math.min(Math.max(0,Z),1)}function b4($){return $>0.04045?(($+0.055)/1.055)**2.4:$/12.92}for(let $ of Object.keys(W0)){if(!("channels"in W0[$]))throw Error("missing channels property: "+$);if(!("labels"in W0[$]))throw Error("missing channel labels property: "+$);if(W0[$].labels.length!==W0[$].channels)throw Error("channel and label counts mismatch: "+$);let{channels:Z,labels:X}=W0[$];delete W0[$].channels,delete W0[$].labels,Object.defineProperty(W0[$],"channels",{value:Z}),Object.defineProperty(W0[$],"labels",{value:X})}W0.rgb.hsl=function($){let Z=$[0]/255,X=$[1]/255,Q=$[2]/255,J=Math.min(Z,X,Q),G=Math.max(Z,X,Q),W=G-J,Y,z;switch(G){case J:{Y=0;break}case Z:{Y=(X-Q)/W;break}case X:{Y=2+(Q-Z)/W;break}case Q:{Y=4+(Z-X)/W;break}}if(Y=Math.min(Y*60,360),Y<0)Y+=360;let q=(J+G)/2;if(G===J)z=0;else if(q<=0.5)z=W/(G+J);else z=W/(2-G-J);return[Y,z*100,q*100]};W0.rgb.hsv=function($){let Z,X,Q,J,G,W=$[0]/255,Y=$[1]/255,z=$[2]/255,q=Math.max(W,Y,z),H=q-Math.min(W,Y,z),B=function(F){return(q-F)/6/H+0.5};if(H===0)J=0,G=0;else{switch(G=H/q,Z=B(W),X=B(Y),Q=B(z),q){case W:{J=Q-X;break}case Y:{J=0.3333333333333333+Z-Q;break}case z:{J=0.6666666666666666+X-Z;break}}if(J<0)J+=1;else if(J>1)J-=1}return[J*360,G*100,q*100]};W0.rgb.hwb=function($){let Z=$[0],X=$[1],Q=$[2],J=W0.rgb.hsl($)[0],G=0.00392156862745098*Math.min(Z,Math.min(X,Q));return Q=1-0.00392156862745098*Math.max(Z,Math.max(X,Q)),[J,G*100,Q*100]};W0.rgb.oklab=function($){let Z=b4($[0]/255),X=b4($[1]/255),Q=b4($[2]/255),J=Math.cbrt(0.4122214708*Z+0.5363325363*X+0.0514459929*Q),G=Math.cbrt(0.2119034982*Z+0.6806995451*X+0.1073969566*Q),W=Math.cbrt(0.0883024619*Z+0.2817188376*X+0.6299787005*Q),Y=0.2104542553*J+0.793617785*G-0.0040720468*W,z=1.9779984951*J-2.428592205*G+0.4505937099*W,q=0.0259040371*J+0.7827717662*G-0.808675766*W;return[Y*100,z*100,q*100]};W0.rgb.cmyk=function($){let Z=$[0]/255,X=$[1]/255,Q=$[2]/255,J=Math.min(1-Z,1-X,1-Q),G=(1-Z-J)/(1-J)||0,W=(1-X-J)/(1-J)||0,Y=(1-Q-J)/(1-J)||0;return[G*100,W*100,Y*100,J*100]};function eO($,Z){return($[0]-Z[0])**2+($[1]-Z[1])**2+($[2]-Z[2])**2}W0.rgb.keyword=function($){let Z=ZK[$];if(Z)return Z;let X=Number.POSITIVE_INFINITY,Q;for(let J of Object.keys(b6)){let G=b6[J],W=eO($,G);if(W<X)X=W,Q=J}return Q};W0.keyword.rgb=function($){return[...b6[$]]};W0.rgb.xyz=function($){let Z=b4($[0]/255),X=b4($[1]/255),Q=b4($[2]/255),J=Z*0.4124564+X*0.3575761+Q*0.1804375,G=Z*0.2126729+X*0.7151522+Q*0.072175,W=Z*0.0193339+X*0.119192+Q*0.9503041;return[J*100,G*100,W*100]};W0.rgb.lab=function($){let Z=W0.rgb.xyz($),X=Z[0],Q=Z[1],J=Z[2];X/=95.047,Q/=100,J/=108.883,X=X>e6?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>e6?Q**0.3333333333333333:7.787*Q+0.13793103448275862,J=J>e6?J**0.3333333333333333:7.787*J+0.13793103448275862;let G=116*Q-16,W=500*(X-Q),Y=200*(Q-J);return[G,W,Y]};W0.hsl.rgb=function($){let Z=$[0]/360,X=$[1]/100,Q=$[2]/100,J,G;if(X===0)return G=Q*255,[G,G,G];let W=Q<0.5?Q*(1+X):Q+X-Q*X,Y=2*Q-W,z=[0,0,0];for(let q=0;q<3;q++){if(J=Z+0.3333333333333333*-(q-1),J<0)J++;if(J>1)J--;if(6*J<1)G=Y+(W-Y)*6*J;else if(2*J<1)G=W;else if(3*J<2)G=Y+(W-Y)*(0.6666666666666666-J)*6;else G=Y;z[q]=G*255}return z};W0.hsl.hsv=function($){let Z=$[0],X=$[1]/100,Q=$[2]/100,J=X,G=Math.max(Q,0.01);Q*=2,X*=Q<=1?Q:2-Q,J*=G<=1?G:2-G;let W=(Q+X)/2,Y=Q===0?2*J/(G+J):2*X/(Q+X);return[Z,Y*100,W*100]};W0.hsv.rgb=function($){let Z=$[0]/60,X=$[1]/100,Q=$[2]/100,J=Math.floor(Z)%6,G=Z-Math.floor(Z),W=255*Q*(1-X),Y=255*Q*(1-X*G),z=255*Q*(1-X*(1-G));switch(Q*=255,J){case 0:return[Q,z,W];case 1:return[Y,Q,W];case 2:return[W,Q,z];case 3:return[W,Y,Q];case 4:return[z,W,Q];case 5:return[Q,W,Y]}};W0.hsv.hsl=function($){let Z=$[0],X=$[1]/100,Q=$[2]/100,J=Math.max(Q,0.01),G,W;W=(2-X)*Q;let Y=(2-X)*J;return G=X*J,G/=Y<=1?Y:2-Y,G=G||0,W/=2,[Z,G*100,W*100]};W0.hwb.rgb=function($){let Z=$[0]/360,X=$[1]/100,Q=$[2]/100,J=X+Q,G;if(J>1)X/=J,Q/=J;let W=Math.floor(6*Z),Y=1-Q;if(G=6*Z-W,(W&1)!==0)G=1-G;let z=X+G*(Y-X),q,H,B;switch(W){default:case 6:case 0:{q=Y,H=z,B=X;break}case 1:{q=z,H=Y,B=X;break}case 2:{q=X,H=Y,B=z;break}case 3:{q=X,H=z,B=Y;break}case 4:{q=z,H=X,B=Y;break}case 5:{q=Y,H=X,B=z;break}}return[q*255,H*255,B*255]};W0.cmyk.rgb=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J=$[3]/100,G=1-Math.min(1,Z*(1-J)+J),W=1-Math.min(1,X*(1-J)+J),Y=1-Math.min(1,Q*(1-J)+J);return[G*255,W*255,Y*255]};W0.xyz.rgb=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J,G,W;return J=Z*3.2404542+X*-1.5371385+Q*-0.4985314,G=Z*-0.969266+X*1.8760108+Q*0.041556,W=Z*0.0556434+X*-0.2040259+Q*1.0572252,J=x4(J),G=x4(G),W=x4(W),[J*255,G*255,W*255]};W0.xyz.lab=function($){let Z=$[0],X=$[1],Q=$[2];Z/=95.047,X/=100,Q/=108.883,Z=Z>e6?Z**0.3333333333333333:7.787*Z+0.13793103448275862,X=X>e6?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>e6?Q**0.3333333333333333:7.787*Q+0.13793103448275862;let J=116*X-16,G=500*(Z-X),W=200*(X-Q);return[J,G,W]};W0.xyz.oklab=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J=Math.cbrt(0.8189330101*Z+0.3618667424*X-0.1288597137*Q),G=Math.cbrt(0.0329845436*Z+0.9293118715*X+0.0361456387*Q),W=Math.cbrt(0.0482003018*Z+0.2643662691*X+0.633851707*Q),Y=0.2104542553*J+0.793617785*G-0.0040720468*W,z=1.9779984951*J-2.428592205*G+0.4505937099*W,q=0.0259040371*J+0.7827717662*G-0.808675766*W;return[Y*100,z*100,q*100]};W0.oklab.oklch=function($){return W0.lab.lch($)};W0.oklab.xyz=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J=(0.999999998*Z+0.396337792*X+0.215803758*Q)**3,G=(1.000000008*Z-0.105561342*X-0.063854175*Q)**3,W=(1.000000055*Z-0.089484182*X-1.291485538*Q)**3,Y=1.227013851*J-0.55779998*G+0.281256149*W,z=-0.040580178*J+1.11225687*G-0.071676679*W,q=-0.076381285*J-0.421481978*G+1.58616322*W;return[Y*100,z*100,q*100]};W0.oklab.rgb=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J=(Z+0.3963377774*X+0.2158037573*Q)**3,G=(Z-0.1055613458*X-0.0638541728*Q)**3,W=(Z-0.0894841775*X-1.291485548*Q)**3,Y=x4(4.0767416621*J-3.3077115913*G+0.2309699292*W),z=x4(-1.2684380046*J+2.6097574011*G-0.3413193965*W),q=x4(-0.0041960863*J-0.7034186147*G+1.707614701*W);return[Y*255,z*255,q*255]};W0.oklch.oklab=function($){return W0.lch.lab($)};W0.lab.xyz=function($){let Z=$[0],X=$[1],Q=$[2],J,G,W;G=(Z+16)/116,J=X/500+G,W=G-Q/200;let Y=G**3,z=J**3,q=W**3;return G=Y>e6?Y:(G-0.13793103448275862)/7.787,J=z>e6?z:(J-0.13793103448275862)/7.787,W=q>e6?q:(W-0.13793103448275862)/7.787,J*=95.047,G*=100,W*=108.883,[J,G,W]};W0.lab.lch=function($){let Z=$[0],X=$[1],Q=$[2],J;if(J=Math.atan2(Q,X)*360/2/Math.PI,J<0)J+=360;let W=Math.sqrt(X*X+Q*Q);return[Z,W,J]};W0.lch.lab=function($){let Z=$[0],X=$[1],J=$[2]/360*2*Math.PI,G=X*Math.cos(J),W=X*Math.sin(J);return[Z,G,W]};W0.rgb.ansi16=function($,Z=null){let[X,Q,J]=$,G=Z===null?W0.rgb.hsv($)[2]:Z;if(G=Math.round(G/50),G===0)return 30;let W=30+(Math.round(J/255)<<2|Math.round(Q/255)<<1|Math.round(X/255));if(G===2)W+=60;return W};W0.hsv.ansi16=function($){return W0.rgb.ansi16(W0.hsv.rgb($),$[2])};W0.rgb.ansi256=function($){let Z=$[0],X=$[1],Q=$[2];if(Z>>4===X>>4&&X>>4===Q>>4){if(Z<8)return 16;if(Z>248)return 231;return Math.round((Z-8)/247*24)+232}return 16+36*Math.round(Z/255*5)+6*Math.round(X/255*5)+Math.round(Q/255*5)};W0.ansi16.rgb=function($){$=$[0];let Z=$%10;if(Z===0||Z===7){if($>50)Z+=3.5;return Z=Z/10.5*255,[Z,Z,Z]}let X=(Math.trunc($>50)+1)*0.5,Q=(Z&1)*X*255,J=(Z>>1&1)*X*255,G=(Z>>2&1)*X*255;return[Q,J,G]};W0.ansi256.rgb=function($){if($=$[0],$>=232){let G=($-232)*10+8;return[G,G,G]}$-=16;let Z,X=Math.floor($/36)/5*255,Q=Math.floor((Z=$%36)/6)/5*255,J=Z%6/5*255;return[X,Q,J]};W0.rgb.hex=function($){let X=(((Math.round($[0])&255)<<16)+((Math.round($[1])&255)<<8)+(Math.round($[2])&255)).toString(16).toUpperCase();return"000000".slice(X.length)+X};W0.hex.rgb=function($){let Z=$.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!Z)return[0,0,0];let X=Z[0];if(Z[0].length===3)X=[...X].map((Y)=>Y+Y).join("");let Q=Number.parseInt(X,16),J=Q>>16&255,G=Q>>8&255,W=Q&255;return[J,G,W]};W0.rgb.hcg=function($){let Z=$[0]/255,X=$[1]/255,Q=$[2]/255,J=Math.max(Math.max(Z,X),Q),G=Math.min(Math.min(Z,X),Q),W=J-G,Y,z=W<1?G/(1-W):0;if(W<=0)Y=0;else if(J===Z)Y=(X-Q)/W%6;else if(J===X)Y=2+(Q-Z)/W;else Y=4+(Z-X)/W;return Y/=6,Y%=1,[Y*360,W*100,z*100]};W0.hsl.hcg=function($){let Z=$[1]/100,X=$[2]/100,Q=X<0.5?2*Z*X:2*Z*(1-X),J=0;if(Q<1)J=(X-0.5*Q)/(1-Q);return[$[0],Q*100,J*100]};W0.hsv.hcg=function($){let Z=$[1]/100,X=$[2]/100,Q=Z*X,J=0;if(Q<1)J=(X-Q)/(1-Q);return[$[0],Q*100,J*100]};W0.hcg.rgb=function($){let Z=$[0]/360,X=$[1]/100,Q=$[2]/100;if(X===0)return[Q*255,Q*255,Q*255];let J=[0,0,0],G=Z%1*6,W=G%1,Y=1-W,z=0;switch(Math.floor(G)){case 0:{J[0]=1,J[1]=W,J[2]=0;break}case 1:{J[0]=Y,J[1]=1,J[2]=0;break}case 2:{J[0]=0,J[1]=1,J[2]=W;break}case 3:{J[0]=0,J[1]=Y,J[2]=1;break}case 4:{J[0]=W,J[1]=0,J[2]=1;break}default:J[0]=1,J[1]=0,J[2]=Y}return z=(1-X)*Q,[(X*J[0]+z)*255,(X*J[1]+z)*255,(X*J[2]+z)*255]};W0.hcg.hsv=function($){let Z=$[1]/100,X=$[2]/100,Q=Z+X*(1-Z),J=0;if(Q>0)J=Z/Q;return[$[0],J*100,Q*100]};W0.hcg.hsl=function($){let Z=$[1]/100,Q=$[2]/100*(1-Z)+0.5*Z,J=0;if(Q>0&&Q<0.5)J=Z/(2*Q);else if(Q>=0.5&&Q<1)J=Z/(2*(1-Q));return[$[0],J*100,Q*100]};W0.hcg.hwb=function($){let Z=$[1]/100,X=$[2]/100,Q=Z+X*(1-Z);return[$[0],(Q-Z)*100,(1-Q)*100]};W0.hwb.hcg=function($){let Z=$[1]/100,Q=1-$[2]/100,J=Q-Z,G=0;if(J<1)G=(Q-J)/(1-J);return[$[0],J*100,G*100]};W0.apple.rgb=function($){return[$[0]/65535*255,$[1]/65535*255,$[2]/65535*255]};W0.rgb.apple=function($){return[$[0]/255*65535,$[1]/255*65535,$[2]/255*65535]};W0.gray.rgb=function($){return[$[0]/100*255,$[0]/100*255,$[0]/100*255]};W0.gray.hsl=function($){return[0,0,$[0]]};W0.gray.hsv=W0.gray.hsl;W0.gray.hwb=function($){return[0,100,$[0]]};W0.gray.cmyk=function($){return[0,0,0,$[0]]};W0.gray.lab=function($){return[$[0],0,0]};W0.gray.hex=function($){let Z=Math.round($[0]/100*255)&255,Q=((Z<<16)+(Z<<8)+Z).toString(16).toUpperCase();return"000000".slice(Q.length)+Q};W0.rgb.gray=function($){return[($[0]+$[1]+$[2])/3/255*100]};function $E(){let $={},Z=Object.keys(t1);for(let{length:X}=Z,Q=0;Q<X;Q++)$[Z[Q]]={distance:-1,parent:null};return $}function ZE($){let Z=$E(),X=[$];Z[$].distance=0;while(X.length>0){let Q=X.pop(),J=Object.keys(t1[Q]);for(let{length:G}=J,W=0;W<G;W++){let Y=J[W],z=Z[Y];if(z.distance===-1)z.distance=Z[Q].distance+1,z.parent=Q,X.unshift(Y)}}return Z}function XE($,Z){return function(X){return Z($(X))}}function QE($,Z){let X=[Z[$].parent,$],Q=t1[Z[$].parent][$],J=Z[$].parent;while(Z[J].parent)X.unshift(Z[J].parent),Q=XE(t1[Z[J].parent][J],Q),J=Z[J].parent;return Q.conversion=X,Q}function JE($){let Z=ZE($),X={},Q=Object.keys(Z);for(let{length:J}=Q,G=0;G<J;G++){let W=Q[G];if(Z[W].parent===null)continue;X[W]=QE(W,Z)}return X}var GE=JE,_4={},WE=Object.keys(t1);function YE($){let Z=function(...X){let Q=X[0];if(Q===void 0||Q===null)return Q;if(Q.length>1)X=Q;return $(X)};if("conversion"in $)Z.conversion=$.conversion;return Z}function zE($){let Z=function(...X){let Q=X[0];if(Q===void 0||Q===null)return Q;if(Q.length>1)X=Q;let J=$(X);if(typeof J==="object")for(let{length:G}=J,W=0;W<G;W++)J[W]=Math.round(J[W]);return J};if("conversion"in $)Z.conversion=$.conversion;return Z}for(let $ of WE){_4[$]={},Object.defineProperty(_4[$],"channels",{value:t1[$].channels}),Object.defineProperty(_4[$],"labels",{value:t1[$].labels});let Z=GE($),X=Object.keys(Z);for(let Q of X){let J=Z[Q];_4[$][Q]=zE(J),_4[$][Q].raw=YE(J)}}var i$=_4,XK=["keyword","gray","hex"],CX={};for(let $ of Object.keys(i$))CX[[...i$[$].labels].sort().join("")]=$;var SX={};function Q$($,Z){if(!(this instanceof Q$))return new Q$($,Z);if(Z&&Z in XK)Z=null;if(Z&&!(Z in i$))throw Error("Unknown model: "+Z);let X,Q;if($==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if($ instanceof Q$)this.model=$.model,this.color=[...$.color],this.valpha=$.valpha;else if(typeof $==="string"){let J=S4.get($);if(J===null)throw Error("Unable to parse color from string: "+$);this.model=J.model,Q=i$[this.model].channels,this.color=J.value.slice(0,Q),this.valpha=typeof J.value[Q]==="number"?J.value[Q]:1}else if($.length>0){this.model=Z||"rgb",Q=i$[this.model].channels;let J=Array.prototype.slice.call($,0,Q);this.color=_X(J,Q),this.valpha=typeof $[Q]==="number"?$[Q]:1}else if(typeof $==="number")this.model="rgb",this.color=[$>>16&255,$>>8&255,$&255],this.valpha=1;else{this.valpha=1;let J=Object.keys($);if("alpha"in $)J.splice(J.indexOf("alpha"),1),this.valpha=typeof $.alpha==="number"?$.alpha:0;let G=J.sort().join("");if(!(G in CX))throw Error("Unable to parse color from object: "+JSON.stringify($));this.model=CX[G];let{labels:W}=i$[this.model],Y=[];for(X=0;X<W.length;X++)Y.push($[W[X]]);this.color=_X(Y)}if(SX[this.model]){Q=i$[this.model].channels;for(X=0;X<Q;X++){let J=SX[this.model][X];if(J)this.color[X]=J(this.color[X])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}Q$.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string($){let Z=this.model in S4.to?this:this.rgb();Z=Z.round(typeof $==="number"?$:1);let X=Z.valpha===1?Z.color:[...Z.color,this.valpha];return S4.to[Z.model](...X)},percentString($){let Z=this.rgb().round(typeof $==="number"?$:1),X=Z.valpha===1?Z.color:[...Z.color,this.valpha];return S4.to.rgb.percent(...X)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let $={},{channels:Z}=i$[this.model],{labels:X}=i$[this.model];for(let Q=0;Q<Z;Q++)$[X[Q]]=this.color[Q];if(this.valpha!==1)$.alpha=this.valpha;return $},unitArray(){let $=this.rgb().color;if($[0]/=255,$[1]/=255,$[2]/=255,this.valpha!==1)$.push(this.valpha);return $},unitObject(){let $=this.rgb().object();if($.r/=255,$.g/=255,$.b/=255,this.valpha!==1)$.alpha=this.valpha;return $},round($){return $=Math.max($||0,0),new Q$([...this.color.map(UE($)),this.valpha],this.model)},alpha($){if($!==void 0)return new Q$([...this.color,Math.max(0,Math.min(1,$))],this.model);return this.valpha},red:p0("rgb",0,Z$(255)),green:p0("rgb",1,Z$(255)),blue:p0("rgb",2,Z$(255)),hue:p0(["hsl","hsv","hsl","hwb","hcg"],0,($)=>($%360+360)%360),saturationl:p0("hsl",1,Z$(100)),lightness:p0("hsl",2,Z$(100)),saturationv:p0("hsv",1,Z$(100)),value:p0("hsv",2,Z$(100)),chroma:p0("hcg",1,Z$(100)),gray:p0("hcg",2,Z$(100)),white:p0("hwb",1,Z$(100)),wblack:p0("hwb",2,Z$(100)),cyan:p0("cmyk",0,Z$(100)),magenta:p0("cmyk",1,Z$(100)),yellow:p0("cmyk",2,Z$(100)),black:p0("cmyk",3,Z$(100)),x:p0("xyz",0,Z$(95.047)),y:p0("xyz",1,Z$(100)),z:p0("xyz",2,Z$(108.833)),l:p0("lab",0,Z$(100)),a:p0("lab",1),b:p0("lab",2),keyword($){if($!==void 0)return new Q$($);return i$[this.model].keyword(this.color)},hex($){if($!==void 0)return new Q$($);return S4.to.hex(...this.rgb().round().color)},hexa($){if($!==void 0)return new Q$($);let Z=this.rgb().round().color,X=Math.round(this.valpha*255).toString(16).toUpperCase();if(X.length===1)X="0"+X;return S4.to.hex(...Z)+X},rgbNumber(){let $=this.rgb().color;return($[0]&255)<<16|($[1]&255)<<8|$[2]&255},luminosity(){let $=this.rgb().color,Z=[];for(let[X,Q]of $.entries()){let J=Q/255;Z[X]=J<=0.04045?J/12.92:((J+0.055)/1.055)**2.4}return 0.2126*Z[0]+0.7152*Z[1]+0.0722*Z[2]},contrast($){let Z=this.luminosity(),X=$.luminosity();if(Z>X)return(Z+0.05)/(X+0.05);return(X+0.05)/(Z+0.05)},level($){let Z=this.contrast($);if(Z>=7)return"AAA";return Z>=4.5?"AA":""},isDark(){let $=this.rgb().color;return($[0]*2126+$[1]*7152+$[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let $=this.rgb();for(let Z=0;Z<3;Z++)$.color[Z]=255-$.color[Z];return $},lighten($){let Z=this.hsl();return Z.color[2]+=Z.color[2]*$,Z},darken($){let Z=this.hsl();return Z.color[2]-=Z.color[2]*$,Z},saturate($){let Z=this.hsl();return Z.color[1]+=Z.color[1]*$,Z},desaturate($){let Z=this.hsl();return Z.color[1]-=Z.color[1]*$,Z},whiten($){let Z=this.hwb();return Z.color[1]+=Z.color[1]*$,Z},blacken($){let Z=this.hwb();return Z.color[2]+=Z.color[2]*$,Z},grayscale(){let $=this.rgb().color,Z=$[0]*0.3+$[1]*0.59+$[2]*0.11;return Q$.rgb(Z,Z,Z)},fade($){return this.alpha(this.valpha-this.valpha*$)},opaquer($){return this.alpha(this.valpha+this.valpha*$)},rotate($){let Z=this.hsl(),X=Z.color[0];return X=(X+$)%360,X=X<0?360+X:X,Z.color[0]=X,Z},mix($,Z){if(!$||!$.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof $);let X=$.rgb(),Q=this.rgb(),J=Z===void 0?0.5:Z,G=2*J-1,W=X.alpha()-Q.alpha(),Y=((G*W===-1?G:(G+W)/(1+G*W))+1)/2,z=1-Y;return Q$.rgb(Y*X.red()+z*Q.red(),Y*X.green()+z*Q.green(),Y*X.blue()+z*Q.blue(),X.alpha()*J+Q.alpha()*(1-J))}};for(let $ of Object.keys(i$)){if(XK.includes($))continue;let{channels:Z}=i$[$];Q$.prototype[$]=function(...X){if(this.model===$)return new Q$(this);if(X.length>0)return new Q$(X,$);return new Q$([...KE(i$[this.model][$].raw(this.color)),this.valpha],$)},Q$[$]=function(...X){let Q=X[0];if(typeof Q==="number")Q=_X(X,Z);return new Q$(Q,$)}}function qE($,Z){return Number($.toFixed(Z))}function UE($){return function(Z){return qE(Z,$)}}function p0($,Z,X){$=Array.isArray($)?$:[$];for(let Q of $)(SX[Q]||=[])[Z]=X;return $=$[0],function(Q){let J;if(Q!==void 0){if(X)Q=X(Q);return J=this[$](),J.color[Z]=Q,J}if(J=this[$]().color[Z],X)J=X(J);return J}}function Z$($){return function(Z){return Math.max(0,Math.min($,Z))}}function KE($){return Array.isArray($)?$:[$]}function _X($,Z){for(let X=0;X<Z;X++)if(typeof $[X]!=="number")$[X]=0;return $}var HE=Q$});var WK=x((el,GK)=>{GK.exports=JK().default});function VE($){return this._setBackgroundColourOption("tint",$),this}function BE($){return this.options.greyscale=K.bool($)?$:!0,this}function FE($){return this.greyscale($)}function LE($){if(!K.string($))throw K.invalidParameterError("colourspace","string",$);return this.options.colourspacePipeline=$,this}function ME($){return this.pipelineColourspace($)}function AE($){if(!K.string($))throw K.invalidParameterError("colourspace","string",$);return this.options.colourspace=$,this}function IE($){return this.toColourspace($)}function qK($){if(K.object($)||K.string($)&&$.length>=3&&$.length<=200){let Z=zK.default($),X=Z.red(),Q=Z.green(),J=Z.blue(),G=Math.round(Z.alpha()*255);for(let[W,Y]of[["red",X],["green",Q],["blue",J],["alpha",G]])if(!K.number(Y))throw K.invalidParameterError(`background.${W}`,"number",Y);return[X,Q,J,G]}else throw K.invalidParameterError("background","object or string",$)}function NE($,Z){if(K.defined(Z))this.options[$]=qK(Z)}var zK,YK,UK=($)=>{Object.assign($.prototype,{tint:VE,greyscale:BE,grayscale:FE,pipelineColourspace:LE,pipelineColorspace:ME,toColourspace:AE,toColorspace:IE,_getBackgroundColourOption:qK,_setBackgroundColourOption:NE}),$.colourspace=YK,$.colorspace=YK};var KK=s(()=>{R6();zK=B$(WK(),1);/*!
|
|
307
|
+
*/zU={integer:"integer",float:"float",approximate:"approximate"}});var LU=b((Dc,FU)=>{var{defineProperty:mX,getOwnPropertyDescriptor:YE,getOwnPropertyNames:zE}=Object,qE=Object.prototype.hasOwnProperty,KE=($,Z)=>{for(var X in Z)mX($,X,{get:Z[X],enumerable:!0})},UE=($,Z,X,Q)=>{if(Z&&typeof Z==="object"||typeof Z==="function"){for(let J of zE(Z))if(!qE.call($,J)&&J!==X)mX($,J,{get:()=>Z[J],enumerable:!(Q=YE(Z,J))||Q.enumerable})}return $},HE=($)=>UE(mX({},"__esModule",{value:!0}),$),UU={};KE(UU,{default:()=>EE});FU.exports=HE(UU);var gX={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 $ in gX)Object.freeze(gX[$]);var y1=Object.freeze(gX),HU=Object.create(null);for(let $ in y1)if(Object.hasOwn(y1,$))HU[y1[$]]=$;var b$={to:{},get:{}};b$.get=function($){let Z=$.slice(0,3).toLowerCase(),X,Q;switch(Z){case"hsl":{X=b$.get.hsl($),Q="hsl";break}case"hwb":{X=b$.get.hwb($),Q="hwb";break}default:{X=b$.get.rgb($),Q="rgb";break}}if(!X)return null;return{model:Q,value:X}};b$.get.rgb=function($){if(!$)return null;let Z=/^#([a-f\d]{3,4})$/i,X=/^#([a-f\d]{6})([a-f\d]{2})?$/i,Q=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,J=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,G=/^(\w+)$/,W=[0,0,0,1],Y,z,q;if(Y=$.match(X)){q=Y[2],Y=Y[1];for(z=0;z<3;z++){let H=z*2;W[z]=Number.parseInt(Y.slice(H,H+2),16)}if(q)W[3]=Number.parseInt(q,16)/255}else if(Y=$.match(Z)){Y=Y[1],q=Y[3];for(z=0;z<3;z++)W[z]=Number.parseInt(Y[z]+Y[z],16);if(q)W[3]=Number.parseInt(q+q,16)/255}else if(Y=$.match(Q)){for(z=0;z<3;z++)W[z]=Number.parseFloat(Y[z+1]);if(Y[4])W[3]=Y[5]?Number.parseFloat(Y[4])*0.01:Number.parseFloat(Y[4])}else if(Y=$.match(J)){for(z=0;z<3;z++)W[z]=Math.round(Number.parseFloat(Y[z+1])*2.55);if(Y[4])W[3]=Y[5]?Number.parseFloat(Y[4])*0.01:Number.parseFloat(Y[4])}else if(Y=$.toLowerCase().match(G)){if(Y[1]==="transparent")return[0,0,0,0];if(!Object.hasOwn(y1,Y[1]))return null;return W=y1[Y[1]].slice(),W[3]=1,W}else return null;for(z=0;z<3;z++)W[z]=P6(W[z],0,255);return W[3]=P6(W[3],0,1),W};b$.get.hsl=function($){if(!$)return null;let Z=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,X=$.match(Z);if(X){let Q=Number.parseFloat(X[4]),J=(Number.parseFloat(X[1])%360+360)%360,G=P6(Number.parseFloat(X[2]),0,100),W=P6(Number.parseFloat(X[3]),0,100),Y=P6(Number.isNaN(Q)?1:Q,0,1);return[J,G,W,Y]}return null};b$.get.hwb=function($){if(!$)return null;let Z=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,X=$.match(Z);if(X){let Q=Number.parseFloat(X[4]),J=(Number.parseFloat(X[1])%360+360)%360,G=P6(Number.parseFloat(X[2]),0,100),W=P6(Number.parseFloat(X[3]),0,100),Y=P6(Number.isNaN(Q)?1:Q,0,1);return[J,G,W,Y]}return null};b$.to.hex=function(...$){return"#"+f5($[0])+f5($[1])+f5($[2])+($[3]<1?f5(Math.round($[3]*255)):"")};b$.to.rgb=function(...$){return $.length<4||$[3]===1?"rgb("+Math.round($[0])+", "+Math.round($[1])+", "+Math.round($[2])+")":"rgba("+Math.round($[0])+", "+Math.round($[1])+", "+Math.round($[2])+", "+$[3]+")"};b$.to.rgb.percent=function(...$){let Z=Math.round($[0]/255*100),X=Math.round($[1]/255*100),Q=Math.round($[2]/255*100);return $.length<4||$[3]===1?"rgb("+Z+"%, "+X+"%, "+Q+"%)":"rgba("+Z+"%, "+X+"%, "+Q+"%, "+$[3]+")"};b$.to.hsl=function(...$){return $.length<4||$[3]===1?"hsl("+$[0]+", "+$[1]+"%, "+$[2]+"%)":"hsla("+$[0]+", "+$[1]+"%, "+$[2]+"%, "+$[3]+")"};b$.to.hwb=function(...$){let Z="";if($.length>=4&&$[3]!==1)Z=", "+$[3];return"hwb("+$[0]+", "+$[1]+"%, "+$[2]+"%"+Z+")"};b$.to.keyword=function(...$){return HU[$.slice(0,3)]};function P6($,Z,X){return Math.min(Math.max(Z,$),X)}function f5($){let Z=Math.round($).toString(16).toUpperCase();return Z.length<2?"0"+Z:Z}var g4=b$,VU={};for(let $ of Object.keys(y1))VU[y1[$]]=$;var W0={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"]}},X4=W0,Z6=0.008856451679035631;function h4($){let Z=$>0.0031308?1.055*$**0.4166666666666667-0.055:$*12.92;return Math.min(Math.max(0,Z),1)}function u4($){return $>0.04045?(($+0.055)/1.055)**2.4:$/12.92}for(let $ of Object.keys(W0)){if(!("channels"in W0[$]))throw Error("missing channels property: "+$);if(!("labels"in W0[$]))throw Error("missing channel labels property: "+$);if(W0[$].labels.length!==W0[$].channels)throw Error("channel and label counts mismatch: "+$);let{channels:Z,labels:X}=W0[$];delete W0[$].channels,delete W0[$].labels,Object.defineProperty(W0[$],"channels",{value:Z}),Object.defineProperty(W0[$],"labels",{value:X})}W0.rgb.hsl=function($){let Z=$[0]/255,X=$[1]/255,Q=$[2]/255,J=Math.min(Z,X,Q),G=Math.max(Z,X,Q),W=G-J,Y,z;switch(G){case J:{Y=0;break}case Z:{Y=(X-Q)/W;break}case X:{Y=2+(Q-Z)/W;break}case Q:{Y=4+(Z-X)/W;break}}if(Y=Math.min(Y*60,360),Y<0)Y+=360;let q=(J+G)/2;if(G===J)z=0;else if(q<=0.5)z=W/(G+J);else z=W/(2-G-J);return[Y,z*100,q*100]};W0.rgb.hsv=function($){let Z,X,Q,J,G,W=$[0]/255,Y=$[1]/255,z=$[2]/255,q=Math.max(W,Y,z),H=q-Math.min(W,Y,z),B=function(F){return(q-F)/6/H+0.5};if(H===0)J=0,G=0;else{switch(G=H/q,Z=B(W),X=B(Y),Q=B(z),q){case W:{J=Q-X;break}case Y:{J=0.3333333333333333+Z-Q;break}case z:{J=0.6666666666666666+X-Z;break}}if(J<0)J+=1;else if(J>1)J-=1}return[J*360,G*100,q*100]};W0.rgb.hwb=function($){let Z=$[0],X=$[1],Q=$[2],J=W0.rgb.hsl($)[0],G=0.00392156862745098*Math.min(Z,Math.min(X,Q));return Q=1-0.00392156862745098*Math.max(Z,Math.max(X,Q)),[J,G*100,Q*100]};W0.rgb.oklab=function($){let Z=u4($[0]/255),X=u4($[1]/255),Q=u4($[2]/255),J=Math.cbrt(0.4122214708*Z+0.5363325363*X+0.0514459929*Q),G=Math.cbrt(0.2119034982*Z+0.6806995451*X+0.1073969566*Q),W=Math.cbrt(0.0883024619*Z+0.2817188376*X+0.6299787005*Q),Y=0.2104542553*J+0.793617785*G-0.0040720468*W,z=1.9779984951*J-2.428592205*G+0.4505937099*W,q=0.0259040371*J+0.7827717662*G-0.808675766*W;return[Y*100,z*100,q*100]};W0.rgb.cmyk=function($){let Z=$[0]/255,X=$[1]/255,Q=$[2]/255,J=Math.min(1-Z,1-X,1-Q),G=(1-Z-J)/(1-J)||0,W=(1-X-J)/(1-J)||0,Y=(1-Q-J)/(1-J)||0;return[G*100,W*100,Y*100,J*100]};function VE($,Z){return($[0]-Z[0])**2+($[1]-Z[1])**2+($[2]-Z[2])**2}W0.rgb.keyword=function($){let Z=VU[$];if(Z)return Z;let X=Number.POSITIVE_INFINITY,Q;for(let J of Object.keys(y1)){let G=y1[J],W=VE($,G);if(W<X)X=W,Q=J}return Q};W0.keyword.rgb=function($){return[...y1[$]]};W0.rgb.xyz=function($){let Z=u4($[0]/255),X=u4($[1]/255),Q=u4($[2]/255),J=Z*0.4124564+X*0.3575761+Q*0.1804375,G=Z*0.2126729+X*0.7151522+Q*0.072175,W=Z*0.0193339+X*0.119192+Q*0.9503041;return[J*100,G*100,W*100]};W0.rgb.lab=function($){let Z=W0.rgb.xyz($),X=Z[0],Q=Z[1],J=Z[2];X/=95.047,Q/=100,J/=108.883,X=X>Z6?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>Z6?Q**0.3333333333333333:7.787*Q+0.13793103448275862,J=J>Z6?J**0.3333333333333333:7.787*J+0.13793103448275862;let G=116*Q-16,W=500*(X-Q),Y=200*(Q-J);return[G,W,Y]};W0.hsl.rgb=function($){let Z=$[0]/360,X=$[1]/100,Q=$[2]/100,J,G;if(X===0)return G=Q*255,[G,G,G];let W=Q<0.5?Q*(1+X):Q+X-Q*X,Y=2*Q-W,z=[0,0,0];for(let q=0;q<3;q++){if(J=Z+0.3333333333333333*-(q-1),J<0)J++;if(J>1)J--;if(6*J<1)G=Y+(W-Y)*6*J;else if(2*J<1)G=W;else if(3*J<2)G=Y+(W-Y)*(0.6666666666666666-J)*6;else G=Y;z[q]=G*255}return z};W0.hsl.hsv=function($){let Z=$[0],X=$[1]/100,Q=$[2]/100,J=X,G=Math.max(Q,0.01);Q*=2,X*=Q<=1?Q:2-Q,J*=G<=1?G:2-G;let W=(Q+X)/2,Y=Q===0?2*J/(G+J):2*X/(Q+X);return[Z,Y*100,W*100]};W0.hsv.rgb=function($){let Z=$[0]/60,X=$[1]/100,Q=$[2]/100,J=Math.floor(Z)%6,G=Z-Math.floor(Z),W=255*Q*(1-X),Y=255*Q*(1-X*G),z=255*Q*(1-X*(1-G));switch(Q*=255,J){case 0:return[Q,z,W];case 1:return[Y,Q,W];case 2:return[W,Q,z];case 3:return[W,Y,Q];case 4:return[z,W,Q];case 5:return[Q,W,Y]}};W0.hsv.hsl=function($){let Z=$[0],X=$[1]/100,Q=$[2]/100,J=Math.max(Q,0.01),G,W;W=(2-X)*Q;let Y=(2-X)*J;return G=X*J,G/=Y<=1?Y:2-Y,G=G||0,W/=2,[Z,G*100,W*100]};W0.hwb.rgb=function($){let Z=$[0]/360,X=$[1]/100,Q=$[2]/100,J=X+Q,G;if(J>1)X/=J,Q/=J;let W=Math.floor(6*Z),Y=1-Q;if(G=6*Z-W,(W&1)!==0)G=1-G;let z=X+G*(Y-X),q,H,B;switch(W){default:case 6:case 0:{q=Y,H=z,B=X;break}case 1:{q=z,H=Y,B=X;break}case 2:{q=X,H=Y,B=z;break}case 3:{q=X,H=z,B=Y;break}case 4:{q=z,H=X,B=Y;break}case 5:{q=Y,H=X,B=z;break}}return[q*255,H*255,B*255]};W0.cmyk.rgb=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J=$[3]/100,G=1-Math.min(1,Z*(1-J)+J),W=1-Math.min(1,X*(1-J)+J),Y=1-Math.min(1,Q*(1-J)+J);return[G*255,W*255,Y*255]};W0.xyz.rgb=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J,G,W;return J=Z*3.2404542+X*-1.5371385+Q*-0.4985314,G=Z*-0.969266+X*1.8760108+Q*0.041556,W=Z*0.0556434+X*-0.2040259+Q*1.0572252,J=h4(J),G=h4(G),W=h4(W),[J*255,G*255,W*255]};W0.xyz.lab=function($){let Z=$[0],X=$[1],Q=$[2];Z/=95.047,X/=100,Q/=108.883,Z=Z>Z6?Z**0.3333333333333333:7.787*Z+0.13793103448275862,X=X>Z6?X**0.3333333333333333:7.787*X+0.13793103448275862,Q=Q>Z6?Q**0.3333333333333333:7.787*Q+0.13793103448275862;let J=116*X-16,G=500*(Z-X),W=200*(X-Q);return[J,G,W]};W0.xyz.oklab=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J=Math.cbrt(0.8189330101*Z+0.3618667424*X-0.1288597137*Q),G=Math.cbrt(0.0329845436*Z+0.9293118715*X+0.0361456387*Q),W=Math.cbrt(0.0482003018*Z+0.2643662691*X+0.633851707*Q),Y=0.2104542553*J+0.793617785*G-0.0040720468*W,z=1.9779984951*J-2.428592205*G+0.4505937099*W,q=0.0259040371*J+0.7827717662*G-0.808675766*W;return[Y*100,z*100,q*100]};W0.oklab.oklch=function($){return W0.lab.lch($)};W0.oklab.xyz=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J=(0.999999998*Z+0.396337792*X+0.215803758*Q)**3,G=(1.000000008*Z-0.105561342*X-0.063854175*Q)**3,W=(1.000000055*Z-0.089484182*X-1.291485538*Q)**3,Y=1.227013851*J-0.55779998*G+0.281256149*W,z=-0.040580178*J+1.11225687*G-0.071676679*W,q=-0.076381285*J-0.421481978*G+1.58616322*W;return[Y*100,z*100,q*100]};W0.oklab.rgb=function($){let Z=$[0]/100,X=$[1]/100,Q=$[2]/100,J=(Z+0.3963377774*X+0.2158037573*Q)**3,G=(Z-0.1055613458*X-0.0638541728*Q)**3,W=(Z-0.0894841775*X-1.291485548*Q)**3,Y=h4(4.0767416621*J-3.3077115913*G+0.2309699292*W),z=h4(-1.2684380046*J+2.6097574011*G-0.3413193965*W),q=h4(-0.0041960863*J-0.7034186147*G+1.707614701*W);return[Y*255,z*255,q*255]};W0.oklch.oklab=function($){return W0.lch.lab($)};W0.lab.xyz=function($){let Z=$[0],X=$[1],Q=$[2],J,G,W;G=(Z+16)/116,J=X/500+G,W=G-Q/200;let Y=G**3,z=J**3,q=W**3;return G=Y>Z6?Y:(G-0.13793103448275862)/7.787,J=z>Z6?z:(J-0.13793103448275862)/7.787,W=q>Z6?q:(W-0.13793103448275862)/7.787,J*=95.047,G*=100,W*=108.883,[J,G,W]};W0.lab.lch=function($){let Z=$[0],X=$[1],Q=$[2],J;if(J=Math.atan2(Q,X)*360/2/Math.PI,J<0)J+=360;let W=Math.sqrt(X*X+Q*Q);return[Z,W,J]};W0.lch.lab=function($){let Z=$[0],X=$[1],J=$[2]/360*2*Math.PI,G=X*Math.cos(J),W=X*Math.sin(J);return[Z,G,W]};W0.rgb.ansi16=function($,Z=null){let[X,Q,J]=$,G=Z===null?W0.rgb.hsv($)[2]:Z;if(G=Math.round(G/50),G===0)return 30;let W=30+(Math.round(J/255)<<2|Math.round(Q/255)<<1|Math.round(X/255));if(G===2)W+=60;return W};W0.hsv.ansi16=function($){return W0.rgb.ansi16(W0.hsv.rgb($),$[2])};W0.rgb.ansi256=function($){let Z=$[0],X=$[1],Q=$[2];if(Z>>4===X>>4&&X>>4===Q>>4){if(Z<8)return 16;if(Z>248)return 231;return Math.round((Z-8)/247*24)+232}return 16+36*Math.round(Z/255*5)+6*Math.round(X/255*5)+Math.round(Q/255*5)};W0.ansi16.rgb=function($){$=$[0];let Z=$%10;if(Z===0||Z===7){if($>50)Z+=3.5;return Z=Z/10.5*255,[Z,Z,Z]}let X=(Math.trunc($>50)+1)*0.5,Q=(Z&1)*X*255,J=(Z>>1&1)*X*255,G=(Z>>2&1)*X*255;return[Q,J,G]};W0.ansi256.rgb=function($){if($=$[0],$>=232){let G=($-232)*10+8;return[G,G,G]}$-=16;let Z,X=Math.floor($/36)/5*255,Q=Math.floor((Z=$%36)/6)/5*255,J=Z%6/5*255;return[X,Q,J]};W0.rgb.hex=function($){let X=(((Math.round($[0])&255)<<16)+((Math.round($[1])&255)<<8)+(Math.round($[2])&255)).toString(16).toUpperCase();return"000000".slice(X.length)+X};W0.hex.rgb=function($){let Z=$.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!Z)return[0,0,0];let X=Z[0];if(Z[0].length===3)X=[...X].map((Y)=>Y+Y).join("");let Q=Number.parseInt(X,16),J=Q>>16&255,G=Q>>8&255,W=Q&255;return[J,G,W]};W0.rgb.hcg=function($){let Z=$[0]/255,X=$[1]/255,Q=$[2]/255,J=Math.max(Math.max(Z,X),Q),G=Math.min(Math.min(Z,X),Q),W=J-G,Y,z=W<1?G/(1-W):0;if(W<=0)Y=0;else if(J===Z)Y=(X-Q)/W%6;else if(J===X)Y=2+(Q-Z)/W;else Y=4+(Z-X)/W;return Y/=6,Y%=1,[Y*360,W*100,z*100]};W0.hsl.hcg=function($){let Z=$[1]/100,X=$[2]/100,Q=X<0.5?2*Z*X:2*Z*(1-X),J=0;if(Q<1)J=(X-0.5*Q)/(1-Q);return[$[0],Q*100,J*100]};W0.hsv.hcg=function($){let Z=$[1]/100,X=$[2]/100,Q=Z*X,J=0;if(Q<1)J=(X-Q)/(1-Q);return[$[0],Q*100,J*100]};W0.hcg.rgb=function($){let Z=$[0]/360,X=$[1]/100,Q=$[2]/100;if(X===0)return[Q*255,Q*255,Q*255];let J=[0,0,0],G=Z%1*6,W=G%1,Y=1-W,z=0;switch(Math.floor(G)){case 0:{J[0]=1,J[1]=W,J[2]=0;break}case 1:{J[0]=Y,J[1]=1,J[2]=0;break}case 2:{J[0]=0,J[1]=1,J[2]=W;break}case 3:{J[0]=0,J[1]=Y,J[2]=1;break}case 4:{J[0]=W,J[1]=0,J[2]=1;break}default:J[0]=1,J[1]=0,J[2]=Y}return z=(1-X)*Q,[(X*J[0]+z)*255,(X*J[1]+z)*255,(X*J[2]+z)*255]};W0.hcg.hsv=function($){let Z=$[1]/100,X=$[2]/100,Q=Z+X*(1-Z),J=0;if(Q>0)J=Z/Q;return[$[0],J*100,Q*100]};W0.hcg.hsl=function($){let Z=$[1]/100,Q=$[2]/100*(1-Z)+0.5*Z,J=0;if(Q>0&&Q<0.5)J=Z/(2*Q);else if(Q>=0.5&&Q<1)J=Z/(2*(1-Q));return[$[0],J*100,Q*100]};W0.hcg.hwb=function($){let Z=$[1]/100,X=$[2]/100,Q=Z+X*(1-Z);return[$[0],(Q-Z)*100,(1-Q)*100]};W0.hwb.hcg=function($){let Z=$[1]/100,Q=1-$[2]/100,J=Q-Z,G=0;if(J<1)G=(Q-J)/(1-J);return[$[0],J*100,G*100]};W0.apple.rgb=function($){return[$[0]/65535*255,$[1]/65535*255,$[2]/65535*255]};W0.rgb.apple=function($){return[$[0]/255*65535,$[1]/255*65535,$[2]/255*65535]};W0.gray.rgb=function($){return[$[0]/100*255,$[0]/100*255,$[0]/100*255]};W0.gray.hsl=function($){return[0,0,$[0]]};W0.gray.hsv=W0.gray.hsl;W0.gray.hwb=function($){return[0,100,$[0]]};W0.gray.cmyk=function($){return[0,0,0,$[0]]};W0.gray.lab=function($){return[$[0],0,0]};W0.gray.hex=function($){let Z=Math.round($[0]/100*255)&255,Q=((Z<<16)+(Z<<8)+Z).toString(16).toUpperCase();return"000000".slice(Q.length)+Q};W0.rgb.gray=function($){return[($[0]+$[1]+$[2])/3/255*100]};function BE(){let $={},Z=Object.keys(X4);for(let{length:X}=Z,Q=0;Q<X;Q++)$[Z[Q]]={distance:-1,parent:null};return $}function FE($){let Z=BE(),X=[$];Z[$].distance=0;while(X.length>0){let Q=X.pop(),J=Object.keys(X4[Q]);for(let{length:G}=J,W=0;W<G;W++){let Y=J[W],z=Z[Y];if(z.distance===-1)z.distance=Z[Q].distance+1,z.parent=Q,X.unshift(Y)}}return Z}function LE($,Z){return function(X){return Z($(X))}}function ME($,Z){let X=[Z[$].parent,$],Q=X4[Z[$].parent][$],J=Z[$].parent;while(Z[J].parent)X.unshift(Z[J].parent),Q=LE(X4[Z[J].parent][J],Q),J=Z[J].parent;return Q.conversion=X,Q}function AE($){let Z=FE($),X={},Q=Object.keys(Z);for(let{length:J}=Q,G=0;G<J;G++){let W=Q[G];if(Z[W].parent===null)continue;X[W]=ME(W,Z)}return X}var IE=AE,f4={},NE=Object.keys(X4);function DE($){let Z=function(...X){let Q=X[0];if(Q===void 0||Q===null)return Q;if(Q.length>1)X=Q;return $(X)};if("conversion"in $)Z.conversion=$.conversion;return Z}function wE($){let Z=function(...X){let Q=X[0];if(Q===void 0||Q===null)return Q;if(Q.length>1)X=Q;let J=$(X);if(typeof J==="object")for(let{length:G}=J,W=0;W<G;W++)J[W]=Math.round(J[W]);return J};if("conversion"in $)Z.conversion=$.conversion;return Z}for(let $ of NE){f4[$]={},Object.defineProperty(f4[$],"channels",{value:X4[$].channels}),Object.defineProperty(f4[$],"labels",{value:X4[$].labels});let Z=IE($),X=Object.keys(Z);for(let Q of X){let J=Z[Q];f4[$][Q]=wE(J),f4[$][Q].raw=DE(J)}}var i$=f4,BU=["keyword","gray","hex"],fX={};for(let $ of Object.keys(i$))fX[[...i$[$].labels].sort().join("")]=$;var hX={};function J$($,Z){if(!(this instanceof J$))return new J$($,Z);if(Z&&Z in BU)Z=null;if(Z&&!(Z in i$))throw Error("Unknown model: "+Z);let X,Q;if($==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if($ instanceof J$)this.model=$.model,this.color=[...$.color],this.valpha=$.valpha;else if(typeof $==="string"){let J=g4.get($);if(J===null)throw Error("Unable to parse color from string: "+$);this.model=J.model,Q=i$[this.model].channels,this.color=J.value.slice(0,Q),this.valpha=typeof J.value[Q]==="number"?J.value[Q]:1}else if($.length>0){this.model=Z||"rgb",Q=i$[this.model].channels;let J=Array.prototype.slice.call($,0,Q);this.color=uX(J,Q),this.valpha=typeof $[Q]==="number"?$[Q]:1}else if(typeof $==="number")this.model="rgb",this.color=[$>>16&255,$>>8&255,$&255],this.valpha=1;else{this.valpha=1;let J=Object.keys($);if("alpha"in $)J.splice(J.indexOf("alpha"),1),this.valpha=typeof $.alpha==="number"?$.alpha:0;let G=J.sort().join("");if(!(G in fX))throw Error("Unable to parse color from object: "+JSON.stringify($));this.model=fX[G];let{labels:W}=i$[this.model],Y=[];for(X=0;X<W.length;X++)Y.push($[W[X]]);this.color=uX(Y)}if(hX[this.model]){Q=i$[this.model].channels;for(X=0;X<Q;X++){let J=hX[this.model][X];if(J)this.color[X]=J(this.color[X])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)}J$.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string($){let Z=this.model in g4.to?this:this.rgb();Z=Z.round(typeof $==="number"?$:1);let X=Z.valpha===1?Z.color:[...Z.color,this.valpha];return g4.to[Z.model](...X)},percentString($){let Z=this.rgb().round(typeof $==="number"?$:1),X=Z.valpha===1?Z.color:[...Z.color,this.valpha];return g4.to.rgb.percent(...X)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let $={},{channels:Z}=i$[this.model],{labels:X}=i$[this.model];for(let Q=0;Q<Z;Q++)$[X[Q]]=this.color[Q];if(this.valpha!==1)$.alpha=this.valpha;return $},unitArray(){let $=this.rgb().color;if($[0]/=255,$[1]/=255,$[2]/=255,this.valpha!==1)$.push(this.valpha);return $},unitObject(){let $=this.rgb().object();if($.r/=255,$.g/=255,$.b/=255,this.valpha!==1)$.alpha=this.valpha;return $},round($){return $=Math.max($||0,0),new J$([...this.color.map(jE($)),this.valpha],this.model)},alpha($){if($!==void 0)return new J$([...this.color,Math.max(0,Math.min(1,$))],this.model);return this.valpha},red:n0("rgb",0,Q$(255)),green:n0("rgb",1,Q$(255)),blue:n0("rgb",2,Q$(255)),hue:n0(["hsl","hsv","hsl","hwb","hcg"],0,($)=>($%360+360)%360),saturationl:n0("hsl",1,Q$(100)),lightness:n0("hsl",2,Q$(100)),saturationv:n0("hsv",1,Q$(100)),value:n0("hsv",2,Q$(100)),chroma:n0("hcg",1,Q$(100)),gray:n0("hcg",2,Q$(100)),white:n0("hwb",1,Q$(100)),wblack:n0("hwb",2,Q$(100)),cyan:n0("cmyk",0,Q$(100)),magenta:n0("cmyk",1,Q$(100)),yellow:n0("cmyk",2,Q$(100)),black:n0("cmyk",3,Q$(100)),x:n0("xyz",0,Q$(95.047)),y:n0("xyz",1,Q$(100)),z:n0("xyz",2,Q$(108.833)),l:n0("lab",0,Q$(100)),a:n0("lab",1),b:n0("lab",2),keyword($){if($!==void 0)return new J$($);return i$[this.model].keyword(this.color)},hex($){if($!==void 0)return new J$($);return g4.to.hex(...this.rgb().round().color)},hexa($){if($!==void 0)return new J$($);let Z=this.rgb().round().color,X=Math.round(this.valpha*255).toString(16).toUpperCase();if(X.length===1)X="0"+X;return g4.to.hex(...Z)+X},rgbNumber(){let $=this.rgb().color;return($[0]&255)<<16|($[1]&255)<<8|$[2]&255},luminosity(){let $=this.rgb().color,Z=[];for(let[X,Q]of $.entries()){let J=Q/255;Z[X]=J<=0.04045?J/12.92:((J+0.055)/1.055)**2.4}return 0.2126*Z[0]+0.7152*Z[1]+0.0722*Z[2]},contrast($){let Z=this.luminosity(),X=$.luminosity();if(Z>X)return(Z+0.05)/(X+0.05);return(X+0.05)/(Z+0.05)},level($){let Z=this.contrast($);if(Z>=7)return"AAA";return Z>=4.5?"AA":""},isDark(){let $=this.rgb().color;return($[0]*2126+$[1]*7152+$[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let $=this.rgb();for(let Z=0;Z<3;Z++)$.color[Z]=255-$.color[Z];return $},lighten($){let Z=this.hsl();return Z.color[2]+=Z.color[2]*$,Z},darken($){let Z=this.hsl();return Z.color[2]-=Z.color[2]*$,Z},saturate($){let Z=this.hsl();return Z.color[1]+=Z.color[1]*$,Z},desaturate($){let Z=this.hsl();return Z.color[1]-=Z.color[1]*$,Z},whiten($){let Z=this.hwb();return Z.color[1]+=Z.color[1]*$,Z},blacken($){let Z=this.hwb();return Z.color[2]+=Z.color[2]*$,Z},grayscale(){let $=this.rgb().color,Z=$[0]*0.3+$[1]*0.59+$[2]*0.11;return J$.rgb(Z,Z,Z)},fade($){return this.alpha(this.valpha-this.valpha*$)},opaquer($){return this.alpha(this.valpha+this.valpha*$)},rotate($){let Z=this.hsl(),X=Z.color[0];return X=(X+$)%360,X=X<0?360+X:X,Z.color[0]=X,Z},mix($,Z){if(!$||!$.rgb)throw Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof $);let X=$.rgb(),Q=this.rgb(),J=Z===void 0?0.5:Z,G=2*J-1,W=X.alpha()-Q.alpha(),Y=((G*W===-1?G:(G+W)/(1+G*W))+1)/2,z=1-Y;return J$.rgb(Y*X.red()+z*Q.red(),Y*X.green()+z*Q.green(),Y*X.blue()+z*Q.blue(),X.alpha()*J+Q.alpha()*(1-J))}};for(let $ of Object.keys(i$)){if(BU.includes($))continue;let{channels:Z}=i$[$];J$.prototype[$]=function(...X){if(this.model===$)return new J$(this);if(X.length>0)return new J$(X,$);return new J$([...OE(i$[this.model][$].raw(this.color)),this.valpha],$)},J$[$]=function(...X){let Q=X[0];if(typeof Q==="number")Q=uX(X,Z);return new J$(Q,$)}}function TE($,Z){return Number($.toFixed(Z))}function jE($){return function(Z){return TE(Z,$)}}function n0($,Z,X){$=Array.isArray($)?$:[$];for(let Q of $)(hX[Q]||=[])[Z]=X;return $=$[0],function(Q){let J;if(Q!==void 0){if(X)Q=X(Q);return J=this[$](),J.color[Z]=Q,J}if(J=this[$]().color[Z],X)J=X(J);return J}}function Q$($){return function(Z){return Math.max(0,Math.min($,Z))}}function OE($){return Array.isArray($)?$:[$]}function uX($,Z){for(let X=0;X<Z;X++)if(typeof $[X]!=="number")$[X]=0;return $}var EE=J$});var AU=b((wc,MU)=>{MU.exports=LU().default});function RE($){return this._setBackgroundColourOption("tint",$),this}function PE($){return this.options.greyscale=U.bool($)?$:!0,this}function CE($){return this.greyscale($)}function SE($){if(!U.string($))throw U.invalidParameterError("colourspace","string",$);return this.options.colourspacePipeline=$,this}function _E($){return this.pipelineColourspace($)}function bE($){if(!U.string($))throw U.invalidParameterError("colourspace","string",$);return this.options.colourspace=$,this}function xE($){return this.toColourspace($)}function DU($){if(U.object($)||U.string($)&&$.length>=3&&$.length<=200){let Z=NU.default($),X=Z.red(),Q=Z.green(),J=Z.blue(),G=Math.round(Z.alpha()*255);for(let[W,Y]of[["red",X],["green",Q],["blue",J],["alpha",G]])if(!U.number(Y))throw U.invalidParameterError(`background.${W}`,"number",Y);return[X,Q,J,G]}else throw U.invalidParameterError("background","object or string",$)}function kE($,Z){if(U.defined(Z))this.options[$]=DU(Z)}var NU,IU,wU=($)=>{Object.assign($.prototype,{tint:RE,greyscale:PE,grayscale:CE,pipelineColourspace:SE,pipelineColorspace:_E,toColourspace:bE,toColorspace:xE,_getBackgroundColourOption:DU,_setBackgroundColourOption:kE}),$.colourspace=IU,$.colorspace=IU};var TU=s(()=>{C1();NU=F$(AU(),1);/*!
|
|
310
308
|
Copyright 2013 Lovell Fuller and others.
|
|
311
309
|
SPDX-License-Identifier: Apache-2.0
|
|
312
|
-
*/
|
|
310
|
+
*/IU={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"}});function vE(){return this.options.removeAlpha=!0,this}function gE($){if(U.defined($))if(U.number($)&&U.inRange($,0,1))this.options.ensureAlpha=$;else throw U.invalidParameterError("alpha","number between 0 and 1",$);else this.options.ensureAlpha=1;return this}function fE($){let Z={red:0,green:1,blue:2,alpha:3};if(Object.keys(Z).includes($))$=Z[$];if(U.integer($)&&U.inRange($,0,4))this.options.extractChannel=$;else throw U.invalidParameterError("channel","integer or one of: red, green, blue, alpha",$);return this}function hE($,Z){if(Array.isArray($))$.forEach(function(X){this.options.joinChannelIn.push(this._createInputDescriptor(X,Z))},this);else this.options.joinChannelIn.push(this._createInputDescriptor($,Z));return this}function uE($){if(U.string($)&&U.inArray($,["and","or","eor"]))this.options.bandBoolOp=$;else throw U.invalidParameterError("boolOp","one of: and, or, eor",$);return this}var yE,jU=($)=>{Object.assign($.prototype,{removeAlpha:vE,ensureAlpha:gE,extractChannel:fE,joinChannel:hE,bandbool:uE}),$.bool=yE};var OU=s(()=>{C1();/*!
|
|
313
311
|
Copyright 2013 Lovell Fuller and others.
|
|
314
312
|
SPDX-License-Identifier: Apache-2.0
|
|
315
|
-
*/DE={and:"and",or:"or",eor:"eor"}});import bX from"node:path";function PE($,Z){let X;if(!K.string($))X=Error("Missing output file path");else if(K.string(this.options.input.file)&&bX.resolve(this.options.input.file)===bX.resolve($))X=Error("Cannot use same file for input and output");else if(RE.test(bX.extname($))&&!this.constructor.format.jp2.output.file)X=FK();if(X)if(K.fn(Z))Z(X);else return Promise.reject(X);else{this.options.fileOut=$;let Q=Error();return this._pipeline(Z,Q)}return this}function CE($,Z){if(K.object($))this._setBooleanOption("resolveWithObject",$.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let X=Error();return this._pipeline(K.fn($)?$:Z,X)}function SE(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let $=Error();return this._pipeline(null,$)}function _E($){if(K.number($)&&$>0)this.options.withMetadataDensity=$;else throw K.invalidParameterError("density","positive number",$);return this.keepExif()}function xE(){return this.options.keepMetadata|=1,this}function bE($){if(K.object($))for(let[Z,X]of Object.entries($))if(K.object(X))for(let[Q,J]of Object.entries(X))if(K.string(J))this.options.withExif[`exif-${Z.toLowerCase()}-${Q}`]=J;else throw K.invalidParameterError(`${Z}.${Q}`,"string",J);else throw K.invalidParameterError(Z,"object",X);else throw K.invalidParameterError("exif","object",$);return this.options.withExifMerge=!1,this.keepExif()}function kE($){return this.withExif($),this.options.withExifMerge=!0,this}function yE(){return this.options.keepMetadata|=8,this}function vE($,Z){if(K.string($))this.options.withIccProfile=$;else throw K.invalidParameterError("icc","string",$);if(this.keepIccProfile(),K.object(Z)){if(K.defined(Z.attach))if(K.bool(Z.attach)){if(!Z.attach)this.options.keepMetadata&=-9}else throw K.invalidParameterError("attach","boolean",Z.attach)}return this}function gE(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function fE(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function hE(){return this.options.keepMetadata|=2,this}function uE($){if(K.string($)&&$.length>0)this.options.withXmp=$,this.options.keepMetadata|=2;else throw K.invalidParameterError("xmp","non-empty string",$);return this}function mE(){return this.options.keepMetadata|=31,this}function dE($){if(this.keepMetadata(),this.withIccProfile("srgb"),K.object($)){if(K.defined($.orientation))if(K.integer($.orientation)&&K.inRange($.orientation,1,8))this.options.withMetadataOrientation=$.orientation;else throw K.invalidParameterError("orientation","integer between 1 and 8",$.orientation);if(K.defined($.density))if(K.number($.density)&&$.density>0)this.options.withMetadataDensity=$.density;else throw K.invalidParameterError("density","positive number",$.density);if(K.defined($.icc))this.withIccProfile($.icc);if(K.defined($.exif))this.withExifMerge($.exif)}return this}function lE($,Z){let X=BK.get((K.object($)&&K.string($.id)?$.id:$).toLowerCase());if(!X)throw K.invalidParameterError("format",`one of: ${[...BK.keys()].join(", ")}`,$);return this[X](Z)}function cE($){if(K.object($)){if(K.defined($.quality))if(K.integer($.quality)&&K.inRange($.quality,1,100))this.options.jpegQuality=$.quality;else throw K.invalidParameterError("quality","integer between 1 and 100",$.quality);if(K.defined($.progressive))this._setBooleanOption("jpegProgressive",$.progressive);if(K.defined($.chromaSubsampling))if(K.string($.chromaSubsampling)&&K.inArray($.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=$.chromaSubsampling;else throw K.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",$.chromaSubsampling);let Z=K.bool($.optimizeCoding)?$.optimizeCoding:$.optimiseCoding;if(K.defined(Z))this._setBooleanOption("jpegOptimiseCoding",Z);if(K.defined($.mozjpeg))if(K.bool($.mozjpeg)){if($.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",$.mozjpeg);let X=K.bool($.trellisQuantization)?$.trellisQuantization:$.trellisQuantisation;if(K.defined(X))this._setBooleanOption("jpegTrellisQuantisation",X);if(K.defined($.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",$.overshootDeringing);let Q=K.bool($.optimizeScans)?$.optimizeScans:$.optimiseScans;if(K.defined(Q)){if(this._setBooleanOption("jpegOptimiseScans",Q),Q)this.options.jpegProgressive=!0}let J=K.number($.quantizationTable)?$.quantizationTable:$.quantisationTable;if(K.defined(J))if(K.integer(J)&&K.inRange(J,0,8))this.options.jpegQuantisationTable=J;else throw K.invalidParameterError("quantisationTable","integer between 0 and 8",J)}return this._updateFormatOut("jpeg",$)}function pE($){if(K.object($)){if(K.defined($.progressive))this._setBooleanOption("pngProgressive",$.progressive);if(K.defined($.compressionLevel))if(K.integer($.compressionLevel)&&K.inRange($.compressionLevel,0,9))this.options.pngCompressionLevel=$.compressionLevel;else throw K.invalidParameterError("compressionLevel","integer between 0 and 9",$.compressionLevel);if(K.defined($.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",$.adaptiveFiltering);let Z=$.colours||$.colors;if(K.defined(Z))if(K.integer(Z)&&K.inRange(Z,2,256))this.options.pngBitdepth=LK(Z);else throw K.invalidParameterError("colours","integer between 2 and 256",Z);if(K.defined($.palette))this._setBooleanOption("pngPalette",$.palette);else if([$.quality,$.effort,$.colours,$.colors,$.dither].some(K.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(K.defined($.quality))if(K.integer($.quality)&&K.inRange($.quality,0,100))this.options.pngQuality=$.quality;else throw K.invalidParameterError("quality","integer between 0 and 100",$.quality);if(K.defined($.effort))if(K.integer($.effort)&&K.inRange($.effort,1,10))this.options.pngEffort=$.effort;else throw K.invalidParameterError("effort","integer between 1 and 10",$.effort);if(K.defined($.dither))if(K.number($.dither)&&K.inRange($.dither,0,1))this.options.pngDither=$.dither;else throw K.invalidParameterError("dither","number between 0.0 and 1.0",$.dither)}}return this._updateFormatOut("png",$)}function iE($){if(K.object($)){if(K.defined($.quality))if(K.integer($.quality)&&K.inRange($.quality,1,100))this.options.webpQuality=$.quality;else throw K.invalidParameterError("quality","integer between 1 and 100",$.quality);if(K.defined($.alphaQuality))if(K.integer($.alphaQuality)&&K.inRange($.alphaQuality,0,100))this.options.webpAlphaQuality=$.alphaQuality;else throw K.invalidParameterError("alphaQuality","integer between 0 and 100",$.alphaQuality);if(K.defined($.lossless))this._setBooleanOption("webpLossless",$.lossless);if(K.defined($.nearLossless))this._setBooleanOption("webpNearLossless",$.nearLossless);if(K.defined($.smartSubsample))this._setBooleanOption("webpSmartSubsample",$.smartSubsample);if(K.defined($.smartDeblock))this._setBooleanOption("webpSmartDeblock",$.smartDeblock);if(K.defined($.preset))if(K.string($.preset)&&K.inArray($.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=$.preset;else throw K.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",$.preset);if(K.defined($.effort))if(K.integer($.effort)&&K.inRange($.effort,0,6))this.options.webpEffort=$.effort;else throw K.invalidParameterError("effort","integer between 0 and 6",$.effort);if(K.defined($.minSize))this._setBooleanOption("webpMinSize",$.minSize);if(K.defined($.mixed))this._setBooleanOption("webpMixed",$.mixed);if(K.defined($.exact))this._setBooleanOption("webpExact",$.exact)}return kX($,this.options),this._updateFormatOut("webp",$)}function nE($){if(K.object($)){if(K.defined($.reuse))this._setBooleanOption("gifReuse",$.reuse);if(K.defined($.progressive))this._setBooleanOption("gifProgressive",$.progressive);let Z=$.colours||$.colors;if(K.defined(Z))if(K.integer(Z)&&K.inRange(Z,2,256))this.options.gifBitdepth=LK(Z);else throw K.invalidParameterError("colours","integer between 2 and 256",Z);if(K.defined($.effort))if(K.integer($.effort)&&K.inRange($.effort,1,10))this.options.gifEffort=$.effort;else throw K.invalidParameterError("effort","integer between 1 and 10",$.effort);if(K.defined($.dither))if(K.number($.dither)&&K.inRange($.dither,0,1))this.options.gifDither=$.dither;else throw K.invalidParameterError("dither","number between 0.0 and 1.0",$.dither);if(K.defined($.interFrameMaxError))if(K.number($.interFrameMaxError)&&K.inRange($.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=$.interFrameMaxError;else throw K.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",$.interFrameMaxError);if(K.defined($.interPaletteMaxError))if(K.number($.interPaletteMaxError)&&K.inRange($.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=$.interPaletteMaxError;else throw K.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",$.interPaletteMaxError);if(K.defined($.keepDuplicateFrames))if(K.bool($.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",$.keepDuplicateFrames);else throw K.invalidParameterError("keepDuplicateFrames","boolean",$.keepDuplicateFrames)}return kX($,this.options),this._updateFormatOut("gif",$)}function rE($){if(!this.constructor.format.jp2.output.buffer)throw FK();if(K.object($)){if(K.defined($.quality))if(K.integer($.quality)&&K.inRange($.quality,1,100))this.options.jp2Quality=$.quality;else throw K.invalidParameterError("quality","integer between 1 and 100",$.quality);if(K.defined($.lossless))if(K.bool($.lossless))this.options.jp2Lossless=$.lossless;else throw K.invalidParameterError("lossless","boolean",$.lossless);if(K.defined($.tileWidth))if(K.integer($.tileWidth)&&K.inRange($.tileWidth,1,32768))this.options.jp2TileWidth=$.tileWidth;else throw K.invalidParameterError("tileWidth","integer between 1 and 32768",$.tileWidth);if(K.defined($.tileHeight))if(K.integer($.tileHeight)&&K.inRange($.tileHeight,1,32768))this.options.jp2TileHeight=$.tileHeight;else throw K.invalidParameterError("tileHeight","integer between 1 and 32768",$.tileHeight);if(K.defined($.chromaSubsampling))if(K.string($.chromaSubsampling)&&K.inArray($.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=$.chromaSubsampling;else throw K.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",$.chromaSubsampling)}return this._updateFormatOut("jp2",$)}function kX($,Z){if(K.object($)&&K.defined($.loop))if(K.integer($.loop)&&K.inRange($.loop,0,65535))Z.loop=$.loop;else throw K.invalidParameterError("loop","integer between 0 and 65535",$.loop);if(K.object($)&&K.defined($.delay))if(K.integer($.delay)&&K.inRange($.delay,0,65535))Z.delay=[$.delay];else if(Array.isArray($.delay)&&$.delay.every(K.integer)&&$.delay.every((X)=>K.inRange(X,0,65535)))Z.delay=$.delay;else throw K.invalidParameterError("delay","integer or an array of integers between 0 and 65535",$.delay)}function aE($){if(K.object($)){if(K.defined($.quality))if(K.integer($.quality)&&K.inRange($.quality,1,100))this.options.tiffQuality=$.quality;else throw K.invalidParameterError("quality","integer between 1 and 100",$.quality);if(K.defined($.bitdepth))if(K.integer($.bitdepth)&&K.inArray($.bitdepth,[1,2,4]))this.options.tiffBitdepth=$.bitdepth;else throw K.invalidParameterError("bitdepth","1, 2 or 4",$.bitdepth);if(K.defined($.tile))this._setBooleanOption("tiffTile",$.tile);if(K.defined($.tileWidth))if(K.integer($.tileWidth)&&K.inRange($.tileWidth,1,32768))this.options.tiffTileWidth=$.tileWidth;else throw K.invalidParameterError("tileWidth","integer between 1 and 32768",$.tileWidth);if(K.defined($.tileHeight))if(K.integer($.tileHeight)&&K.inRange($.tileHeight,1,32768))this.options.tiffTileHeight=$.tileHeight;else throw K.invalidParameterError("tileHeight","integer between 1 and 32768",$.tileHeight);if(K.defined($.miniswhite))this._setBooleanOption("tiffMiniswhite",$.miniswhite);if(K.defined($.pyramid))this._setBooleanOption("tiffPyramid",$.pyramid);if(K.defined($.xres))if(K.number($.xres)&&K.inRange($.xres,0.001,1e6))this.options.tiffXres=$.xres;else throw K.invalidParameterError("xres","number between 0.001 and 1000000",$.xres);if(K.defined($.yres))if(K.number($.yres)&&K.inRange($.yres,0.001,1e6))this.options.tiffYres=$.yres;else throw K.invalidParameterError("yres","number between 0.001 and 1000000",$.yres);if(K.defined($.compression))if(K.string($.compression)&&K.inArray($.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=$.compression;else throw K.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",$.compression);if(K.defined($.bigtiff))this._setBooleanOption("tiffBigtiff",$.bigtiff);if(K.defined($.predictor))if(K.string($.predictor)&&K.inArray($.predictor,["none","horizontal","float"]))this.options.tiffPredictor=$.predictor;else throw K.invalidParameterError("predictor","one of: none, horizontal, float",$.predictor);if(K.defined($.resolutionUnit))if(K.string($.resolutionUnit)&&K.inArray($.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=$.resolutionUnit;else throw K.invalidParameterError("resolutionUnit","one of: inch, cm",$.resolutionUnit)}return this._updateFormatOut("tiff",$)}function oE($){return this.heif({...$,compression:"av1"})}function sE($){if(K.object($)){if(K.string($.compression)&&K.inArray($.compression,["av1","hevc"]))this.options.heifCompression=$.compression;else throw K.invalidParameterError("compression","one of: av1, hevc",$.compression);if(K.defined($.quality))if(K.integer($.quality)&&K.inRange($.quality,1,100))this.options.heifQuality=$.quality;else throw K.invalidParameterError("quality","integer between 1 and 100",$.quality);if(K.defined($.lossless))if(K.bool($.lossless))this.options.heifLossless=$.lossless;else throw K.invalidParameterError("lossless","boolean",$.lossless);if(K.defined($.effort))if(K.integer($.effort)&&K.inRange($.effort,0,9))this.options.heifEffort=$.effort;else throw K.invalidParameterError("effort","integer between 0 and 9",$.effort);if(K.defined($.chromaSubsampling))if(K.string($.chromaSubsampling)&&K.inArray($.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=$.chromaSubsampling;else throw K.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",$.chromaSubsampling);if(K.defined($.bitdepth))if(K.integer($.bitdepth)&&K.inArray($.bitdepth,[8,10,12]))this.options.heifBitdepth=$.bitdepth;else throw K.invalidParameterError("bitdepth","8, 10 or 12",$.bitdepth);if(K.defined($.tune))if(K.string($.tune)&&K.inArray($.tune,["auto","iq","psnr","ssim"]))if(this.options.heifLossless&&$.tune==="iq")this.options.heifTune="ssim";else this.options.heifTune=$.tune;else throw K.invalidParameterError("tune","one of: auto, iq, psnr, ssim",$.tune)}else throw K.invalidParameterError("options","Object",$);return this._updateFormatOut("heif",$)}function tE($){if(K.object($)){if(K.defined($.quality))if(K.integer($.quality)&&K.inRange($.quality,1,100))this.options.jxlDistance=$.quality>=30?0.1+(100-$.quality)*0.09:0.017666666666666667*$.quality*$.quality-1.15*$.quality+25;else throw K.invalidParameterError("quality","integer between 1 and 100",$.quality);else if(K.defined($.distance))if(K.number($.distance)&&K.inRange($.distance,0,15))this.options.jxlDistance=$.distance;else throw K.invalidParameterError("distance","number between 0.0 and 15.0",$.distance);if(K.defined($.decodingTier))if(K.integer($.decodingTier)&&K.inRange($.decodingTier,0,4))this.options.jxlDecodingTier=$.decodingTier;else throw K.invalidParameterError("decodingTier","integer between 0 and 4",$.decodingTier);if(K.defined($.lossless))if(K.bool($.lossless))this.options.jxlLossless=$.lossless;else throw K.invalidParameterError("lossless","boolean",$.lossless);if(K.defined($.effort))if(K.integer($.effort)&&K.inRange($.effort,1,9))this.options.jxlEffort=$.effort;else throw K.invalidParameterError("effort","integer between 1 and 9",$.effort)}return kX($,this.options),this._updateFormatOut("jxl",$)}function eE($){if(K.object($)){if(K.defined($.depth))if(K.string($.depth)&&K.inArray($.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=$.depth;else throw K.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",$.depth)}return this._updateFormatOut("raw")}function $R($){if(K.object($)){if(K.defined($.size))if(K.integer($.size)&&K.inRange($.size,1,8192))this.options.tileSize=$.size;else throw K.invalidParameterError("size","integer between 1 and 8192",$.size);if(K.defined($.overlap))if(K.integer($.overlap)&&K.inRange($.overlap,0,8192)){if($.overlap>this.options.tileSize)throw K.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,$.overlap);this.options.tileOverlap=$.overlap}else throw K.invalidParameterError("overlap","integer between 0 and 8192",$.overlap);if(K.defined($.container))if(K.string($.container)&&K.inArray($.container,["fs","zip"]))this.options.tileContainer=$.container;else throw K.invalidParameterError("container","one of: fs, zip",$.container);if(K.defined($.layout))if(K.string($.layout)&&K.inArray($.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=$.layout;else throw K.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",$.layout);if(K.defined($.angle))if(K.integer($.angle)&&!($.angle%90))this.options.tileAngle=$.angle;else throw K.invalidParameterError("angle","positive/negative multiple of 90",$.angle);if(this._setBackgroundColourOption("tileBackground",$.background),K.defined($.depth))if(K.string($.depth)&&K.inArray($.depth,["onepixel","onetile","one"]))this.options.tileDepth=$.depth;else throw K.invalidParameterError("depth","one of: onepixel, onetile, one",$.depth);if(K.defined($.skipBlanks))if(K.integer($.skipBlanks)&&K.inRange($.skipBlanks,-1,65535))this.options.tileSkipBlanks=$.skipBlanks;else throw K.invalidParameterError("skipBlanks","integer between -1 and 255/65535",$.skipBlanks);else if(K.defined($.layout)&&$.layout==="google")this.options.tileSkipBlanks=5;let Z=K.bool($.center)?$.center:$.centre;if(K.defined(Z))this._setBooleanOption("tileCentre",Z);if(K.defined($.id))if(K.string($.id))this.options.tileId=$.id;else throw K.invalidParameterError("id","string",$.id);if(K.defined($.basename))if(K.string($.basename))this.options.tileBasename=$.basename;else throw K.invalidParameterError("basename","string",$.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 ZR($){if(!K.plainObject($))throw K.invalidParameterError("options","object",$);if(K.integer($.seconds)&&K.inRange($.seconds,0,3600))this.options.timeoutSeconds=$.seconds;else throw K.invalidParameterError("seconds","integer between 0 and 3600",$.seconds);return this}function XR($,Z){if(!(K.object(Z)&&Z.force===!1))this.options.formatOut=$;return this}function QR($,Z){if(K.bool(Z))this.options[$]=Z;else throw K.invalidParameterError($,"boolean",Z)}function JR(){if(!this.options.streamOut){this.options.streamOut=!0;let $=Error();this._pipeline(void 0,$)}}function GR($,Z){if(typeof $==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),b0.pipeline(this.options,(X,Q,J)=>{if(X)$(K.nativeError(X,Z));else $(null,Q,J)})});else b0.pipeline(this.options,(X,Q,J)=>{if(X)$(K.nativeError(X,Z));else $(null,Q,J)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),b0.pipeline(this.options,(X,Q,J)=>{if(X)this.emit("error",K.nativeError(X,Z));else this.emit("info",J),this.push(Q);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else b0.pipeline(this.options,(X,Q,J)=>{if(X)this.emit("error",K.nativeError(X,Z));else this.emit("info",J),this.push(Q);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{this.once("finish",()=>{this._flattenBufferIn(),b0.pipeline(this.options,(J,G,W)=>{if(J)Q(K.nativeError(J,Z));else if(this.options.resolveWithObject)X({data:G,info:W});else X(G)})})});else return new Promise((X,Q)=>{b0.pipeline(this.options,(J,G,W)=>{if(J)Q(K.nativeError(J,Z));else if(this.options.resolveWithObject)X({data:G,info:W});else X(G)})})}var BK,RE,FK=()=>Error("JP2 output requires libvips with support for OpenJPEG"),LK=($)=>1<<31-Math.clz32(Math.ceil(Math.log2($))),MK=($)=>{Object.assign($.prototype,{toFile:PE,toBuffer:CE,toUint8Array:SE,withDensity:_E,keepExif:xE,withExif:bE,withExifMerge:kE,keepIccProfile:yE,withIccProfile:vE,keepGainMap:gE,withGainMap:fE,keepXmp:hE,withXmp:uE,keepMetadata:mE,withMetadata:dE,toFormat:lE,jpeg:cE,jp2:rE,png:pE,webp:iE,tiff:aE,avif:oE,heif:sE,jxl:tE,gif:nE,raw:eE,tile:$R,timeout:ZR,_updateFormatOut:XR,_setBooleanOption:QR,_read:JR,_pipeline:GR})};var AK=s(()=>{R6();v9();/*!
|
|
313
|
+
*/yE={and:"and",or:"or",eor:"eor"}});import dX from"node:path";function dE($,Z){let X;if(!U.string($))X=Error("Missing output file path");else if(U.string(this.options.input.file)&&dX.resolve(this.options.input.file)===dX.resolve($))X=Error("Cannot use same file for input and output");else if(mE.test(dX.extname($))&&!this.constructor.format.jp2.output.file)X=RU();if(X)if(U.fn(Z))Z(X);else return Promise.reject(X);else{this.options.fileOut=$;let Q=Error();return this._pipeline(Z,Q)}return this}function lE($,Z){if(U.object($))this._setBooleanOption("resolveWithObject",$.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";let X=Error();return this._pipeline(U.fn($)?$:Z,X)}function cE(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let $=Error();return this._pipeline(null,$)}function pE($){if(U.number($)&&$>0)this.options.withMetadataDensity=$;else throw U.invalidParameterError("density","positive number",$);return this.keepExif()}function iE(){return this.options.keepMetadata|=1,this}function nE($){if(U.object($))for(let[Z,X]of Object.entries($))if(U.object(X))for(let[Q,J]of Object.entries(X))if(U.string(J))this.options.withExif[`exif-${Z.toLowerCase()}-${Q}`]=J;else throw U.invalidParameterError(`${Z}.${Q}`,"string",J);else throw U.invalidParameterError(Z,"object",X);else throw U.invalidParameterError("exif","object",$);return this.options.withExifMerge=!1,this.keepExif()}function rE($){return this.withExif($),this.options.withExifMerge=!0,this}function aE(){return this.options.keepMetadata|=8,this}function oE($,Z){if(U.string($))this.options.withIccProfile=$;else throw U.invalidParameterError("icc","string",$);if(this.keepIccProfile(),U.object(Z)){if(U.defined(Z.attach))if(U.bool(Z.attach)){if(!Z.attach)this.options.keepMetadata&=-9}else throw U.invalidParameterError("attach","boolean",Z.attach)}return this}function sE(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function tE(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function eE(){return this.options.keepMetadata|=2,this}function $R($){if(U.string($)&&$.length>0)this.options.withXmp=$,this.options.keepMetadata|=2;else throw U.invalidParameterError("xmp","non-empty string",$);return this}function ZR(){return this.options.keepMetadata|=31,this}function XR($){if(this.keepMetadata(),this.withIccProfile("srgb"),U.object($)){if(U.defined($.orientation))if(U.integer($.orientation)&&U.inRange($.orientation,1,8))this.options.withMetadataOrientation=$.orientation;else throw U.invalidParameterError("orientation","integer between 1 and 8",$.orientation);if(U.defined($.density))if(U.number($.density)&&$.density>0)this.options.withMetadataDensity=$.density;else throw U.invalidParameterError("density","positive number",$.density);if(U.defined($.icc))this.withIccProfile($.icc);if(U.defined($.exif))this.withExifMerge($.exif)}return this}function QR($,Z){let X=EU.get((U.object($)&&U.string($.id)?$.id:$).toLowerCase());if(!X)throw U.invalidParameterError("format",`one of: ${[...EU.keys()].join(", ")}`,$);return this[X](Z)}function JR($){if(U.object($)){if(U.defined($.quality))if(U.integer($.quality)&&U.inRange($.quality,1,100))this.options.jpegQuality=$.quality;else throw U.invalidParameterError("quality","integer between 1 and 100",$.quality);if(U.defined($.progressive))this._setBooleanOption("jpegProgressive",$.progressive);if(U.defined($.chromaSubsampling))if(U.string($.chromaSubsampling)&&U.inArray($.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=$.chromaSubsampling;else throw U.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",$.chromaSubsampling);let Z=U.bool($.optimizeCoding)?$.optimizeCoding:$.optimiseCoding;if(U.defined(Z))this._setBooleanOption("jpegOptimiseCoding",Z);if(U.defined($.mozjpeg))if(U.bool($.mozjpeg)){if($.mozjpeg)this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3}else throw U.invalidParameterError("mozjpeg","boolean",$.mozjpeg);let X=U.bool($.trellisQuantization)?$.trellisQuantization:$.trellisQuantisation;if(U.defined(X))this._setBooleanOption("jpegTrellisQuantisation",X);if(U.defined($.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",$.overshootDeringing);let Q=U.bool($.optimizeScans)?$.optimizeScans:$.optimiseScans;if(U.defined(Q)){if(this._setBooleanOption("jpegOptimiseScans",Q),Q)this.options.jpegProgressive=!0}let J=U.number($.quantizationTable)?$.quantizationTable:$.quantisationTable;if(U.defined(J))if(U.integer(J)&&U.inRange(J,0,8))this.options.jpegQuantisationTable=J;else throw U.invalidParameterError("quantisationTable","integer between 0 and 8",J)}return this._updateFormatOut("jpeg",$)}function GR($){if(U.object($)){if(U.defined($.progressive))this._setBooleanOption("pngProgressive",$.progressive);if(U.defined($.compressionLevel))if(U.integer($.compressionLevel)&&U.inRange($.compressionLevel,0,9))this.options.pngCompressionLevel=$.compressionLevel;else throw U.invalidParameterError("compressionLevel","integer between 0 and 9",$.compressionLevel);if(U.defined($.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",$.adaptiveFiltering);let Z=$.colours||$.colors;if(U.defined(Z))if(U.integer(Z)&&U.inRange(Z,2,256))this.options.pngBitdepth=PU(Z);else throw U.invalidParameterError("colours","integer between 2 and 256",Z);if(U.defined($.palette))this._setBooleanOption("pngPalette",$.palette);else if([$.quality,$.effort,$.colours,$.colors,$.dither].some(U.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(U.defined($.quality))if(U.integer($.quality)&&U.inRange($.quality,0,100))this.options.pngQuality=$.quality;else throw U.invalidParameterError("quality","integer between 0 and 100",$.quality);if(U.defined($.effort))if(U.integer($.effort)&&U.inRange($.effort,1,10))this.options.pngEffort=$.effort;else throw U.invalidParameterError("effort","integer between 1 and 10",$.effort);if(U.defined($.dither))if(U.number($.dither)&&U.inRange($.dither,0,1))this.options.pngDither=$.dither;else throw U.invalidParameterError("dither","number between 0.0 and 1.0",$.dither)}}return this._updateFormatOut("png",$)}function WR($){if(U.object($)){if(U.defined($.quality))if(U.integer($.quality)&&U.inRange($.quality,1,100))this.options.webpQuality=$.quality;else throw U.invalidParameterError("quality","integer between 1 and 100",$.quality);if(U.defined($.alphaQuality))if(U.integer($.alphaQuality)&&U.inRange($.alphaQuality,0,100))this.options.webpAlphaQuality=$.alphaQuality;else throw U.invalidParameterError("alphaQuality","integer between 0 and 100",$.alphaQuality);if(U.defined($.lossless))this._setBooleanOption("webpLossless",$.lossless);if(U.defined($.nearLossless))this._setBooleanOption("webpNearLossless",$.nearLossless);if(U.defined($.smartSubsample))this._setBooleanOption("webpSmartSubsample",$.smartSubsample);if(U.defined($.smartDeblock))this._setBooleanOption("webpSmartDeblock",$.smartDeblock);if(U.defined($.preset))if(U.string($.preset)&&U.inArray($.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=$.preset;else throw U.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",$.preset);if(U.defined($.effort))if(U.integer($.effort)&&U.inRange($.effort,0,6))this.options.webpEffort=$.effort;else throw U.invalidParameterError("effort","integer between 0 and 6",$.effort);if(U.defined($.minSize))this._setBooleanOption("webpMinSize",$.minSize);if(U.defined($.mixed))this._setBooleanOption("webpMixed",$.mixed);if(U.defined($.exact))this._setBooleanOption("webpExact",$.exact)}return lX($,this.options),this._updateFormatOut("webp",$)}function YR($){if(U.object($)){if(U.defined($.reuse))this._setBooleanOption("gifReuse",$.reuse);if(U.defined($.progressive))this._setBooleanOption("gifProgressive",$.progressive);let Z=$.colours||$.colors;if(U.defined(Z))if(U.integer(Z)&&U.inRange(Z,2,256))this.options.gifBitdepth=PU(Z);else throw U.invalidParameterError("colours","integer between 2 and 256",Z);if(U.defined($.effort))if(U.integer($.effort)&&U.inRange($.effort,1,10))this.options.gifEffort=$.effort;else throw U.invalidParameterError("effort","integer between 1 and 10",$.effort);if(U.defined($.dither))if(U.number($.dither)&&U.inRange($.dither,0,1))this.options.gifDither=$.dither;else throw U.invalidParameterError("dither","number between 0.0 and 1.0",$.dither);if(U.defined($.interFrameMaxError))if(U.number($.interFrameMaxError)&&U.inRange($.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=$.interFrameMaxError;else throw U.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",$.interFrameMaxError);if(U.defined($.interPaletteMaxError))if(U.number($.interPaletteMaxError)&&U.inRange($.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=$.interPaletteMaxError;else throw U.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",$.interPaletteMaxError);if(U.defined($.keepDuplicateFrames))if(U.bool($.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",$.keepDuplicateFrames);else throw U.invalidParameterError("keepDuplicateFrames","boolean",$.keepDuplicateFrames)}return lX($,this.options),this._updateFormatOut("gif",$)}function zR($){if(!this.constructor.format.jp2.output.buffer)throw RU();if(U.object($)){if(U.defined($.quality))if(U.integer($.quality)&&U.inRange($.quality,1,100))this.options.jp2Quality=$.quality;else throw U.invalidParameterError("quality","integer between 1 and 100",$.quality);if(U.defined($.lossless))if(U.bool($.lossless))this.options.jp2Lossless=$.lossless;else throw U.invalidParameterError("lossless","boolean",$.lossless);if(U.defined($.tileWidth))if(U.integer($.tileWidth)&&U.inRange($.tileWidth,1,32768))this.options.jp2TileWidth=$.tileWidth;else throw U.invalidParameterError("tileWidth","integer between 1 and 32768",$.tileWidth);if(U.defined($.tileHeight))if(U.integer($.tileHeight)&&U.inRange($.tileHeight,1,32768))this.options.jp2TileHeight=$.tileHeight;else throw U.invalidParameterError("tileHeight","integer between 1 and 32768",$.tileHeight);if(U.defined($.chromaSubsampling))if(U.string($.chromaSubsampling)&&U.inArray($.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=$.chromaSubsampling;else throw U.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",$.chromaSubsampling)}return this._updateFormatOut("jp2",$)}function lX($,Z){if(U.object($)&&U.defined($.loop))if(U.integer($.loop)&&U.inRange($.loop,0,65535))Z.loop=$.loop;else throw U.invalidParameterError("loop","integer between 0 and 65535",$.loop);if(U.object($)&&U.defined($.delay))if(U.integer($.delay)&&U.inRange($.delay,0,65535))Z.delay=[$.delay];else if(Array.isArray($.delay)&&$.delay.every(U.integer)&&$.delay.every((X)=>U.inRange(X,0,65535)))Z.delay=$.delay;else throw U.invalidParameterError("delay","integer or an array of integers between 0 and 65535",$.delay)}function qR($){if(U.object($)){if(U.defined($.quality))if(U.integer($.quality)&&U.inRange($.quality,1,100))this.options.tiffQuality=$.quality;else throw U.invalidParameterError("quality","integer between 1 and 100",$.quality);if(U.defined($.bitdepth))if(U.integer($.bitdepth)&&U.inArray($.bitdepth,[1,2,4]))this.options.tiffBitdepth=$.bitdepth;else throw U.invalidParameterError("bitdepth","1, 2 or 4",$.bitdepth);if(U.defined($.tile))this._setBooleanOption("tiffTile",$.tile);if(U.defined($.tileWidth))if(U.integer($.tileWidth)&&U.inRange($.tileWidth,1,32768))this.options.tiffTileWidth=$.tileWidth;else throw U.invalidParameterError("tileWidth","integer between 1 and 32768",$.tileWidth);if(U.defined($.tileHeight))if(U.integer($.tileHeight)&&U.inRange($.tileHeight,1,32768))this.options.tiffTileHeight=$.tileHeight;else throw U.invalidParameterError("tileHeight","integer between 1 and 32768",$.tileHeight);if(U.defined($.miniswhite))this._setBooleanOption("tiffMiniswhite",$.miniswhite);if(U.defined($.pyramid))this._setBooleanOption("tiffPyramid",$.pyramid);if(U.defined($.xres))if(U.number($.xres)&&U.inRange($.xres,0.001,1e6))this.options.tiffXres=$.xres;else throw U.invalidParameterError("xres","number between 0.001 and 1000000",$.xres);if(U.defined($.yres))if(U.number($.yres)&&U.inRange($.yres,0.001,1e6))this.options.tiffYres=$.yres;else throw U.invalidParameterError("yres","number between 0.001 and 1000000",$.yres);if(U.defined($.compression))if(U.string($.compression)&&U.inArray($.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=$.compression;else throw U.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",$.compression);if(U.defined($.bigtiff))this._setBooleanOption("tiffBigtiff",$.bigtiff);if(U.defined($.predictor))if(U.string($.predictor)&&U.inArray($.predictor,["none","horizontal","float"]))this.options.tiffPredictor=$.predictor;else throw U.invalidParameterError("predictor","one of: none, horizontal, float",$.predictor);if(U.defined($.resolutionUnit))if(U.string($.resolutionUnit)&&U.inArray($.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=$.resolutionUnit;else throw U.invalidParameterError("resolutionUnit","one of: inch, cm",$.resolutionUnit)}return this._updateFormatOut("tiff",$)}function KR($){return this.heif({...$,compression:"av1"})}function UR($){if(U.object($)){if(U.string($.compression)&&U.inArray($.compression,["av1","hevc"]))this.options.heifCompression=$.compression;else throw U.invalidParameterError("compression","one of: av1, hevc",$.compression);if(U.defined($.quality))if(U.integer($.quality)&&U.inRange($.quality,1,100))this.options.heifQuality=$.quality;else throw U.invalidParameterError("quality","integer between 1 and 100",$.quality);if(U.defined($.lossless))if(U.bool($.lossless))this.options.heifLossless=$.lossless;else throw U.invalidParameterError("lossless","boolean",$.lossless);if(U.defined($.effort))if(U.integer($.effort)&&U.inRange($.effort,0,9))this.options.heifEffort=$.effort;else throw U.invalidParameterError("effort","integer between 0 and 9",$.effort);if(U.defined($.chromaSubsampling))if(U.string($.chromaSubsampling)&&U.inArray($.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=$.chromaSubsampling;else throw U.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",$.chromaSubsampling);if(U.defined($.bitdepth))if(U.integer($.bitdepth)&&U.inArray($.bitdepth,[8,10,12]))this.options.heifBitdepth=$.bitdepth;else throw U.invalidParameterError("bitdepth","8, 10 or 12",$.bitdepth);if(U.defined($.tune))if(U.string($.tune)&&U.inArray($.tune,["auto","iq","psnr","ssim"]))if(this.options.heifLossless&&$.tune==="iq")this.options.heifTune="ssim";else this.options.heifTune=$.tune;else throw U.invalidParameterError("tune","one of: auto, iq, psnr, ssim",$.tune)}else throw U.invalidParameterError("options","Object",$);return this._updateFormatOut("heif",$)}function HR($){if(U.object($)){if(U.defined($.quality))if(U.integer($.quality)&&U.inRange($.quality,1,100))this.options.jxlDistance=$.quality>=30?0.1+(100-$.quality)*0.09:0.017666666666666667*$.quality*$.quality-1.15*$.quality+25;else throw U.invalidParameterError("quality","integer between 1 and 100",$.quality);else if(U.defined($.distance))if(U.number($.distance)&&U.inRange($.distance,0,15))this.options.jxlDistance=$.distance;else throw U.invalidParameterError("distance","number between 0.0 and 15.0",$.distance);if(U.defined($.decodingTier))if(U.integer($.decodingTier)&&U.inRange($.decodingTier,0,4))this.options.jxlDecodingTier=$.decodingTier;else throw U.invalidParameterError("decodingTier","integer between 0 and 4",$.decodingTier);if(U.defined($.lossless))if(U.bool($.lossless))this.options.jxlLossless=$.lossless;else throw U.invalidParameterError("lossless","boolean",$.lossless);if(U.defined($.effort))if(U.integer($.effort)&&U.inRange($.effort,1,9))this.options.jxlEffort=$.effort;else throw U.invalidParameterError("effort","integer between 1 and 9",$.effort)}return lX($,this.options),this._updateFormatOut("jxl",$)}function VR($){if(U.object($)){if(U.defined($.depth))if(U.string($.depth)&&U.inArray($.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=$.depth;else throw U.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",$.depth)}return this._updateFormatOut("raw")}function BR($){if(U.object($)){if(U.defined($.size))if(U.integer($.size)&&U.inRange($.size,1,8192))this.options.tileSize=$.size;else throw U.invalidParameterError("size","integer between 1 and 8192",$.size);if(U.defined($.overlap))if(U.integer($.overlap)&&U.inRange($.overlap,0,8192)){if($.overlap>this.options.tileSize)throw U.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,$.overlap);this.options.tileOverlap=$.overlap}else throw U.invalidParameterError("overlap","integer between 0 and 8192",$.overlap);if(U.defined($.container))if(U.string($.container)&&U.inArray($.container,["fs","zip"]))this.options.tileContainer=$.container;else throw U.invalidParameterError("container","one of: fs, zip",$.container);if(U.defined($.layout))if(U.string($.layout)&&U.inArray($.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=$.layout;else throw U.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",$.layout);if(U.defined($.angle))if(U.integer($.angle)&&!($.angle%90))this.options.tileAngle=$.angle;else throw U.invalidParameterError("angle","positive/negative multiple of 90",$.angle);if(this._setBackgroundColourOption("tileBackground",$.background),U.defined($.depth))if(U.string($.depth)&&U.inArray($.depth,["onepixel","onetile","one"]))this.options.tileDepth=$.depth;else throw U.invalidParameterError("depth","one of: onepixel, onetile, one",$.depth);if(U.defined($.skipBlanks))if(U.integer($.skipBlanks)&&U.inRange($.skipBlanks,-1,65535))this.options.tileSkipBlanks=$.skipBlanks;else throw U.invalidParameterError("skipBlanks","integer between -1 and 255/65535",$.skipBlanks);else if(U.defined($.layout)&&$.layout==="google")this.options.tileSkipBlanks=5;let Z=U.bool($.center)?$.center:$.centre;if(U.defined(Z))this._setBooleanOption("tileCentre",Z);if(U.defined($.id))if(U.string($.id))this.options.tileId=$.id;else throw U.invalidParameterError("id","string",$.id);if(U.defined($.basename))if(U.string($.basename))this.options.tileBasename=$.basename;else throw U.invalidParameterError("basename","string",$.basename)}if(U.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw U.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function FR($){if(!U.plainObject($))throw U.invalidParameterError("options","object",$);if(U.integer($.seconds)&&U.inRange($.seconds,0,3600))this.options.timeoutSeconds=$.seconds;else throw U.invalidParameterError("seconds","integer between 0 and 3600",$.seconds);return this}function LR($,Z){if(!(U.object(Z)&&Z.force===!1))this.options.formatOut=$;return this}function MR($,Z){if(U.bool(Z))this.options[$]=Z;else throw U.invalidParameterError($,"boolean",Z)}function AR(){if(!this.options.streamOut){this.options.streamOut=!0;let $=Error();this._pipeline(void 0,$)}}function IR($,Z){if(typeof $==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),x0.pipeline(this.options,(X,Q,J)=>{if(X)$(U.nativeError(X,Z));else $(null,Q,J)})});else x0.pipeline(this.options,(X,Q,J)=>{if(X)$(U.nativeError(X,Z));else $(null,Q,J)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),x0.pipeline(this.options,(X,Q,J)=>{if(X)this.emit("error",U.nativeError(X,Z));else this.emit("info",J),this.push(Q);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else x0.pipeline(this.options,(X,Q,J)=>{if(X)this.emit("error",U.nativeError(X,Z));else this.emit("info",J),this.push(Q);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise((X,Q)=>{this.once("finish",()=>{this._flattenBufferIn(),x0.pipeline(this.options,(J,G,W)=>{if(J)Q(U.nativeError(J,Z));else if(this.options.resolveWithObject)X({data:G,info:W});else X(G)})})});else return new Promise((X,Q)=>{x0.pipeline(this.options,(J,G,W)=>{if(J)Q(U.nativeError(J,Z));else if(this.options.resolveWithObject)X({data:G,info:W});else X(G)})})}var EU,mE,RU=()=>Error("JP2 output requires libvips with support for OpenJPEG"),PU=($)=>1<<31-Math.clz32(Math.ceil(Math.log2($))),CU=($)=>{Object.assign($.prototype,{toFile:dE,toBuffer:lE,toUint8Array:cE,withDensity:pE,keepExif:iE,withExif:nE,withExifMerge:rE,keepIccProfile:aE,withIccProfile:oE,keepGainMap:sE,withGainMap:tE,keepXmp:eE,withXmp:$R,keepMetadata:ZR,withMetadata:XR,toFormat:QR,jpeg:JR,jp2:zR,png:GR,webp:WR,tiff:qR,avif:KR,heif:UR,jxl:HR,gif:YR,raw:VR,tile:BR,timeout:FR,_updateFormatOut:LR,_setBooleanOption:MR,_read:AR,_pipeline:IR})};var SU=s(()=>{C1();d9();/*!
|
|
316
314
|
Copyright 2013 Lovell Fuller and others.
|
|
317
315
|
SPDX-License-Identifier: Apache-2.0
|
|
318
|
-
*/
|
|
316
|
+
*/EU=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"]]),mE=/\.(jp[2x]|j2[kc])$/i});import NR from"node:events";import{createRequire as DR}from"node:module";import{availableParallelism as wR}from"node:os";function bU($){if(U.bool($))if($)return x0.cache(50,20,100);else return x0.cache(0,0,0);else if(U.object($)){for(let Z of["memory","files","items"]){let X=$[Z];if(U.defined(X)&&!(U.integer(X)&&X>=0))throw U.invalidParameterError(Z,"a positive integer",X)}return x0.cache($.memory,$.files,$.items)}else return x0.cache()}function jR($){return x0.concurrency(U.integer($)?$:null)}function ER(){return x0.counters()}function RR($){return x0.simd(U.bool($)?$:null)}function PR($){if(U.object($))if(Array.isArray($.operation)&&$.operation.every(U.string))x0.block($.operation,!0);else throw U.invalidParameterError("operation","Array<string>",$.operation);else throw U.invalidParameterError("options","object",$)}function CR($){if(U.object($))if(Array.isArray($.operation)&&$.operation.every(U.string))x0.block($.operation,!1);else throw U.invalidParameterError("operation","Array<string>",$.operation);else throw U.invalidParameterError("options","object",$)}var l9,cX,_U,pX,C6,TR,m4,OR,xU=($)=>{$.cache=bU,$.concurrency=jR,$.counters=ER,$.simd=RR,$.format=C6,$.interpolators=TR,$.versions=m4,$.queue=OR,$.block=PR,$.unblock=CR};var kU=s(()=>{C1();bX();d9();k5();l9=F$(N5(),1);/*!
|
|
319
317
|
Copyright 2013 Lovell Fuller and others.
|
|
320
318
|
SPDX-License-Identifier: Apache-2.0
|
|
321
|
-
*/
|
|
319
|
+
*/cX=DR(import.meta.url),_U=y5.runtimePlatformArch(),pX=x0.libvipsVersion(),C6=x0.format();C6.heif.output.alias=["avif","heic"];C6.jpeg.output.alias=["jpe","jpg"];C6.tiff.output.alias=["tif"];C6.jp2.output.alias=["j2c","j2k","jp2","jpx"];TR={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},m4={vips:pX.semver};if(!pX.isGlobal)if(!pX.isWasm)try{m4=cX(`@img/sharp-${_U}/versions`)}catch($){try{m4=cX(`@img/sharp-libvips-${_U}/versions`)}catch(Z){}}else try{m4=cX("@img/sharp-wasm32/versions")}catch($){}m4.sharp=e1.version;if(m4.heif&&C6.heif)C6.heif.input.fileSuffix=[".avif"],C6.heif.output.alias=["avif"];bU(!0);if(!process.env.MALLOC_ARENA_MAX&&l9.default.familySync()===l9.default.GLIBC&&!x0._isUsingJemalloc())x0.concurrency(1);else if(l9.default.familySync()===l9.default.MUSL&&x0.concurrency()===1024)x0.concurrency(wR());OR=new NR.EventEmitter});var iX={};m1(iX,{default:()=>SR});var SR;var nX=s(()=>{oK();eK();GU();YU();KU();TU();OU();SU();kU();/*!
|
|
322
320
|
Copyright 2013 Lovell Fuller and others.
|
|
323
321
|
SPDX-License-Identifier: Apache-2.0
|
|
324
|
-
*/uU(x6);iU(x6);rU(x6);sU(x6);UK(x6);HK(x6);MK(x6);DK(x6);LR=x6});import{createHash as TK}from"node:crypto";import{existsSync as MR,mkdirSync as AR,readFileSync as IR}from"node:fs";import{basename as NR,extname as DR,resolve as hX}from"node:path";import{createRequire as wR}from"node:module";async function jK(){if(y4)return y4;try{return y4=(await Promise.resolve().then(() => (fX(),gX))).default,y4}catch{}try{return y4=wR(hX(process.cwd(),"package.json"))("sharp"),y4}catch($){throw Error(`Sharp is required for image optimization but failed to load: ${L1($)}`,{cause:$})}}async function uX($){let X=await(await jK())($).metadata();return{format:X.format??"unknown",height:X.height??0,width:X.width??0}}function f9($){let Z=IR($);return TK("md5").update(Z).digest("hex").slice(0,8)}function mX($){let Z=JSON.stringify({formats:$.formats,quality:$.quality,widths:$.widths});return TK("md5").update(Z).digest("hex").slice(0,8)}function jR($,Z,X,Q){return`${$}-${Z}-${X}.${Q}`}async function OK($,Z,X){let Q=await jK(),J=await uX($),G=f9($),W=NR($,DR($)),Y=hX(Z,"_optimized");AR(Y,{recursive:!0});let z=[],q=X.widths.filter((F)=>F<=J.width);if(q.length===0||!q.includes(J.width))q.push(J.width);q.sort((F,M)=>F-M);let H=[];for(let F of q)for(let M of X.formats){let A=jR(W,F,G,M),w=`/${TR}/${A}`,D=hX(Y,A);if(z.push({absolutePath:D,format:M,outputPath:w,width:F}),MR(D))continue;let j=X.quality[M]??80,R=Q($).resize(F).toFormat(M,{quality:j}).toFile(D).then(()=>{});H.push(R)}let B=4;for(let F=0;F<H.length;F+=B)await Promise.all(H.slice(F,F+B));return{contentHash:G,original:{format:J.format,height:J.height,width:J.width},variants:z}}function dX($,Z){return $.filter((X)=>X.format===Z).map((X)=>`${X.outputPath} ${X.width}w`).join(", ")}var y4=null,TR="images/_optimized";var lX=s(()=>{A1()});import{existsSync as OR,mkdirSync as ER,readFileSync as RR,rmSync as PR,writeFileSync as CR}from"node:fs";import{basename as SR,resolve as C8}from"node:path";import{execSync as _R}from"node:child_process";import{tmpdir as xR}from"node:os";function v4($){if(h9===void 0)try{let Z=_R("npm config get cache",{cwd:xR(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();h9=Z&&Z!=="undefined"?Z:null}catch{h9=null}if(h9)return C8(h9,"jxsuite-images",SR($));return C8($,".cache/images")}function EK($){let Z=C8(v4($),"manifest.json");if(!OR(Z))return{entries:{},touched:new Set,version:1};try{let X=JSON.parse(RR(Z,"utf8"));return X.touched=new Set,X}catch{return{entries:{},touched:new Set,version:1}}}function RK($,Z,X={}){if(X.prune&&Z.touched)bR(Z,Z.touched);let Q=v4($);ER(Q,{recursive:!0}),CR(C8(Q,"manifest.json"),JSON.stringify({entries:Z.entries,version:Z.version},null,2),"utf8")}function bR($,Z){let X=new Set;for(let[Q,J]of Object.entries($.entries))if(Z.has(Q))for(let G of J.manifest.variants??[])X.add(G.absolutePath);for(let[Q,J]of Object.entries($.entries)){if(Z.has(Q))continue;for(let G of J.manifest.variants??[])if(!X.has(G.absolutePath))PR(G.absolutePath,{force:!0});delete $.entries[Q]}}function PK($,Z){$.touched?.add(Z);let X=$.entries[Z];if(!X)return null;return X.manifest}function CK($,Z,X,Q){$.touched?.add(Z),$.entries[Z]={manifest:Q,source:X,timestamp:Date.now()}}var h9;var cX=s(()=>{lX()});import{existsSync as pX}from"node:fs";import{basename as kR,extname as xK,resolve as SK}from"node:path";async function kK($,Z){let X=Z.get($);if(!X){let Q=f9($);try{let J=await uX($);X={width:J.width,height:J.height,hash:Q}}catch(J){if(!_K)_K=!0,console.warn(`Could not read image dimensions (${J.message}) — `+"emitting srcsets without width/height attributes.");X={width:null,height:null,hash:Q}}Z.set($,X)}return X}function S8($,Z,X,Q){let J=Z.quality?.webp??80,G=$.startsWith("/")?"":"/",W=Q?`?v=${Q}`:"";return Z.widths.filter((Y)=>Y<=X).toSorted((Y,z)=>Y-z).map((Y)=>`/cdn-cgi/image/width=${Y},quality=${J},fit=scale-down,format=auto${G}${$}${W} ${Y}w`).join(", ")}async function yK($,Z,X,Q,J){let G=`${f9($)}:${mX(X)}`,W=PK(J,G);if(W){if(W.variants.every((q)=>pX(q.absolutePath)))return W}if(!W)console.log(` Optimizing ${kR($)}...`);let Y=await OK($,v4(Q),X);return CK(J,G,Z,Y),Y}function vK($){if(typeof $!=="string")return!0;if(!$)return!0;if($.includes("${"))return!0;if(yR.some((Z)=>$.startsWith(Z)))return!0;if(bK.has(xK($).toLowerCase()))return!0;return!1}function gK($,Z){if(Z.service!=="cloudflare")return!1;if(!Z.remoteDomains?.length)return!1;if(typeof $!=="string"||!$.startsWith("https://"))return!1;if($.includes("${"))return!1;try{let X=new URL($);if(bK.has(xK(X.pathname).toLowerCase()))return!1;return Z.remoteDomains.includes(X.hostname)}catch{return!1}}function fK($,Z,X){let Q=X?.length?a5(X,$):null;if(Q)return Q;if($.startsWith("/"))return SK(Z,"public",$.slice(1));return SK(Z,$)}async function hK($,Z,X,Q,J,G=[]){let W=new Map;if(!Z.optimize)return{imageRefs:W};return await uK($,Z,X,Q,J??new Map,W,G),{imageRefs:W}}async function uK($,Z,X,Q,J,G,W){if(!$||typeof $!=="object")return;if($.tagName==="img")await vR($,Z,X,Q,J,G,W);if(typeof $.innerHTML==="string"&&$.innerHTML.includes("<img"))$.innerHTML=await mR($.innerHTML,Z,X,Q,J,G,W);if(Array.isArray($.children))for(let Y of $.children){if(typeof Y==="string")continue;await uK(Y,Z,X,Q,J,G,W)}}async function vR($,Z,X,Q,J,G,W){if(!$.attributes)$.attributes={};let Y=$.attributes.src??$.src;if(typeof Y!=="string")return;let z=gK(Y,Z);if(!z&&vK(Y))return;if($.attributes["data-no-optimize"]!==void 0)return;let q,H=null;if(z)q=S8(Y,Z,1/0,null);else{let B=fK(Y,X,W);if(!pX(B))return;if(Z.service==="cloudflare"){let F=await kK(B,J);q=S8(Y,Z,F.width??1/0,F.hash),H=F.width&&F.height?{height:F.height,width:F.width}:null}else{let F=G.get(B);if(!F)F=await yK(B,Y,Z,X,Q),G.set(B,F);let M=Z.formats.includes("avif")?"avif":Z.formats[0];q=dX(F.variants,M),H=F.original?.width&&F.original.height?{height:F.original.height,width:F.original.width}:null}}if(q)$.attributes.srcset=q,$.attributes.sizes??=Z.sizes;if(H&&$.attributes.width===void 0&&$.attributes.height===void 0)$.attributes.width=String(H.width),$.attributes.height=String(H.height);if(Z.lazyLoad&&$.attributes.loading!=="eager")$.attributes.loading="lazy",$.attributes.decoding="async"}async function mR($,Z,X,Q,J,G,W){let Y=[];for(let q of $.matchAll(gR)){let H=q[0],B=q[1];if(hR.test(B))continue;if(uR.test(B))continue;let F=B.match(fR);if(!F)continue;let M=F[1].replaceAll("&","&"),A=gK(M,Z);if(!A&&vK(M))continue;let w=A?null:fK(M,X,W);if(w&&!pX(w))continue;let D,j=null;if(A)D=S8(M,Z,1/0,null);else if(Z.service==="cloudflare"){let P=await kK(w,J);D=S8(M,Z,P.width??1/0,P.hash),j=P.width&&P.height?{height:P.height,width:P.width}:null}else{let P=G.get(w);if(!P)P=await yK(w,M,Z,X,Q),G.set(w,P);let E=Z.formats.includes("avif")?"avif":Z.formats[0];D=dX(P.variants,E),j=P.original?.width&&P.original.height?{height:P.original.height,width:P.original.width}:null}if(!D)continue;let R=` srcset="${D}" sizes="${Z.sizes}"`;if(j&&!/\bwidth=/.test(B)&&!/\bheight=/.test(B))R+=` width="${j.width}" height="${j.height}"`;if(Z.lazyLoad&&!/\bloading="eager"/.test(B)){if(!/\bloading=/.test(B))R+=' loading="lazy"';if(!/\bdecoding=/.test(B))R+=' decoding="async"'}Y.push({match:H,replacement:`<img${B}${R}>`})}let z=$;for(let{match:q,replacement:H}of Y)z=z.replace(q,H);return z}var bK,yR,_K=!1,gR,fR,hR,uR;var mK=s(()=>{lX();cX();N9();bK=new Set([".svg",".gif"]),yR=["http://","https://","data:","//"];gR=/<img\b([^>]*)>/gi,fR=/\bsrc="([^"]*)"/,hR=/\bsrcset="/,uR=/\bdata-no-optimize\b/});var iK={};h6(iK,{buildSite:()=>aR});import{cpSync as iX,existsSync as e1,mkdirSync as $1,readFileSync as dR,readdirSync as lR,rmSync as cR,statSync as pR,writeFileSync as X6}from"node:fs";import{basename as iR,dirname as Z1,join as g4,relative as nR,resolve as J$,sep as rR}from"node:path";async function aR($,Z={}){let{clean:X=!0,verbose:Q=!1}=Z,J=[],G=Q?console.log.bind(console):()=>{};G("Loading project.json...");let{config:W}=N1($);if("contentTypes"in W)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 Y=J$($,W.build.outDir),z=J$($,"pages"),q=J$($,"public"),H=W.build.trailingSlash??"always",B=new Map,F=(o,f)=>{if(!cY(o))return o;try{let $0=pY(o,f??$,$);if(!l1(o)&&!e1($0))return console.warn(`Sidecar "${o}" not found at ${$0} — emitting unbundled`),o;let X0=l1(o)?o:`./${nR($,$0)}`,e=VY(X0),M0=B.get(e);if(M0&&M0.entryPath!==$0)throw Error(`"${o}" and "${M0.specifier}" both bundle to ${e} — rename one`);return B.set(e,{entryPath:$0,specifier:o}),e}catch($0){return J.push(`Sidecar "${o}": ${$0.message}`),o}},M=await E6($,W),A=M.formats;if(A.entries.length>0)G(` Registered ${A.entries.length} format(s): ${A.entries.map((o)=>o.name).join(", ")}`);let w=M.serverMounts().filter((o)=>{if(!o.project)return!0;let f=W[o.project.key];return f!==void 0&&typeof f==="object"&&Object.keys(f).length>0});if(w.length>0&&!W.build.adapter){let o=w.map((f)=>f.project?`"${f.project.key}"`:`"${f.server.basePath}"`).join(", ");throw Error(`project.json declares dynamic section(s) ${o} 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(X&&e1(Y))cR(Y,{force:!0,recursive:!0});if($1(Y,{recursive:!0}),!e1(z))throw Error(`pages/ directory not found in ${$}`);G("Discovering pages...");let D=await oY(z,A);G(` Found ${D.length} page(s)`),G("Loading project sections...");let j=await $z($,W,M),R=Object.keys(j);if(R.length>0)G(` Loaded ${R.length} section(s): ${R.join(", ")}`);let{errors:P,mounts:E}=await Xz(M,W,$);J.push(...P);for(let o of P)console.error(o);if(E.length>0)G(` Mounted ${E.length} asset dir(s): ${E.map((o)=>o.urlPrefix).join(", ")}`);let C=new Set,y=await tY(D,$,j,M,W);G(` ${y.length} route(s) after expansion`);let v=0,m=J$($,"components"),Z0=[],r=new Map,h=new Map;if(e1(m)){G("Compiling components...");let o=[".json",...A.documentExtensions("component")],f=lR(m).filter((X0)=>o.some((e)=>X0.endsWith(e))),$0=J$(Y,"components");$1($0,{recursive:!0});for(let X0 of f)try{let e=J$(m,X0),M0=await p5(e,{...W.$media?{$media:W.$media}:{},formats:A,rewriteSrc:F});for(let N0 of M0.files){let Q0=iR(N0.path);if(X6(J$($0,Q0),N0.content,"utf8"),N0.tagName)Z0.push(N0.tagName);v+=1}let U0=await R9(e,A);if(U0.tagName){h.set(U0.tagName,U0);let N0=tJ(U0.tagName,U0.style,U0,W.$media??{});if(N0)r.set(U0.tagName,N0),e7(N0,E,C),X6(J$($0,`${U0.tagName}.css`),N0,"utf8"),v+=1}}catch(e){let M0=e;J.push(`Error compiling component ${X0}: ${M0.message}`),console.error(`Error compiling component ${X0}: ${M0.message}`)}G(` Compiled ${Z0.length} component(s): ${Z0.join(", ")}`)}let t=[];if(W.build.adapter)for(let[,o]of h){let f=T5(o);for(let $0 of f){let X0=`./components/${$0.src.replace(/^\.\//,"")}`;t.push({exportName:$0.exportName,src:X0})}}let Y0=W.images.optimize&&W.images.service==="cloudflare",G0=W.images.optimize&&!Y0?EK($):null,A0=Y0?new Map:null;if(Y0)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 l=W.url,K0=Boolean(l)&&W.build.sitemap!==!1,V0=[];for(let o of y)try{G(` Compiling ${o.urlPattern} ...`);let f=await oR(o,W,$,j,G0,h,A0,A,M,F,E),$0=new Set;for(let[M0,U0]of h)if(mZ(U0))$0.add(M0);if(Z0.length>0)f.html=$P(f.html,Z0,r,$0);e7(f.html,E,C);let X0=pK(o.urlPattern,Y,H);$1(Z1(X0),{recursive:!0}),X6(X0,f.html,"utf8"),v+=1;let e=!o.urlPattern.includes(":")&&!o.urlPattern.includes("*");if(K0&&!f.excludeFromSitemap&&e)V0.push({lastmod:pR(o.sourcePath).mtime,loc:new URL(o.urlPattern,l).href});for(let M0 of A.withCapability("serialize")){if(!M0.exportTarget)continue;try{let U0=await M0.call("serialize",f.doc,{buildScope:(N0)=>B4(N0,null),componentDefs:h,evaluateTemplate:(N0,Q0)=>{if(!w0(N0))return;return L$(N0,Q0)??N0},mode:"export"});if(U0){let N0=X0.replace(/\.html$/,M0.extensions[0]);X6(N0,U0,"utf8"),v+=1}}catch(U0){let N0=U0;J.push(`Error exporting ${M0.name} for ${o.urlPattern}: ${N0.message}`)}}for(let M0 of f.files){let U0=J$(Z1(X0),M0.path);$1(Z1(U0),{recursive:!0}),X6(U0,M0.content,"utf8"),v+=1}if(f.serverHandler){let M0=J$(Z1(X0),"_server.js");X6(M0,f.serverHandler,"utf8"),v+=1}}catch(f){let $0=f,X0=`Error compiling ${o.urlPattern}: ${$0.message}`;J.push(X0),console.error(X0)}if(G0&&W.images.optimize){RK($,G0,{prune:J.length===0});let o=J$(v4($),"_optimized");if(e1(o)){let $0=J$(Y,"images/_optimized");$1($0,{recursive:!0}),iX(o,$0,{recursive:!0})}let f=Object.keys(G0.entries).length;if(f>0)G(` Optimized ${f} image(s)`)}if(W.build.adapter){let{adapter:o}=W.build;G("Generating site-wide server worker...");let f=new Map;for(let U0 of t)if(!f.has(U0.exportName))f.set(U0.exportName,U0);let{mounts:$0,connectors:X0}=sR(w,M,W);if($0.length>0)G(` Mounting ${$0.length} extension route(s): ${$0.map((U0)=>U0.basePath).join(", ")}`);let M0=o==="cloudflare-pages"&&f.size===0&&$0.length===0?null:S7([...f.values()],{adapter:o,connectors:X0,mounts:$0});if(M0){let U0=o==="cloudflare-pages"?"_worker.js":"worker.js";try{await nY(M0,{adapter:o,outfile:J$(Y,U0),projectRoot:$}),v+=1,G(` Generated dist/${U0} (bundled, ${f.size} server function(s))`)}catch(N0){let Q0=`Error bundling dist/${U0}: ${N0.message}`;J.push(Q0),console.error(Q0)}if(o==="cloudflare-pages")X6(J$(Y,"_routes.json"),`${JSON.stringify({exclude:[],include:["/_jx/*"],version:1},null,2)}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
${E.rules.
|
|
322
|
+
*/tK(k1);JU(k1);WU(k1);qU(k1);wU(k1);jU(k1);CU(k1);xU(k1);SR=k1});import{createHash as yU}from"node:crypto";import{existsSync as _R,mkdirSync as bR,readFileSync as xR}from"node:fs";import{basename as kR,extname as yR,resolve as rX}from"node:path";import{createRequire as vR}from"node:module";async function vU(){if(d4)return d4;try{return d4=(await Promise.resolve().then(() => (nX(),iX))).default,d4}catch{}try{return d4=vR(rX(process.cwd(),"package.json"))("sharp"),d4}catch($){throw Error(`Sharp is required for image optimization but failed to load: ${A6($)}`,{cause:$})}}async function aX($){let X=await(await vU())($).metadata();return{format:X.format??"unknown",height:X.height??0,width:X.width??0}}function c9($){let Z=xR($);return yU("md5").update(Z).digest("hex").slice(0,8)}function oX($){let Z=JSON.stringify({formats:$.formats,quality:$.quality,widths:$.widths});return yU("md5").update(Z).digest("hex").slice(0,8)}function fR($,Z,X,Q){return`${$}-${Z}-${X}.${Q}`}async function gU($,Z,X){let Q=await vU(),J=await aX($),G=c9($),W=kR($,yR($)),Y=rX(Z,"_optimized");bR(Y,{recursive:!0});let z=[],q=X.widths.filter((F)=>F<=J.width);if(q.length===0||!q.includes(J.width))q.push(J.width);q.sort((F,L)=>F-L);let H=[];for(let F of q)for(let L of X.formats){let w=fR(W,F,G,L),N=`/${gR}/${w}`,I=rX(Y,w);if(z.push({absolutePath:I,format:L,outputPath:N,width:F}),_R(I))continue;let T=X.quality[L]??80,E=Q($).resize(F).toFormat(L,{quality:T}).toFile(I).then(()=>{});H.push(E)}let B=4;for(let F=0;F<H.length;F+=B)await Promise.all(H.slice(F,F+B));return{contentHash:G,original:{format:J.format,height:J.height,width:J.width},variants:z}}function sX($,Z){return $.filter((X)=>X.format===Z).map((X)=>`${X.outputPath} ${X.width}w`).join(", ")}var d4=null,gR="images/_optimized";var tX=s(()=>{N6()});import{existsSync as hR,mkdirSync as uR,readFileSync as mR,rmSync as dR,writeFileSync as lR}from"node:fs";import{basename as cR,resolve as h5}from"node:path";import{execSync as pR}from"node:child_process";import{tmpdir as iR}from"node:os";function l4($){if(p9===void 0)try{let Z=pR("npm config get cache",{cwd:iR(),encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();p9=Z&&Z!=="undefined"?Z:null}catch{p9=null}if(p9)return h5(p9,"jxsuite-images",cR($));return h5($,".cache/images")}function fU($){let Z=h5(l4($),"manifest.json");if(!hR(Z))return{entries:{},touched:new Set,version:1};try{let X=JSON.parse(mR(Z,"utf8"));return X.touched=new Set,X}catch{return{entries:{},touched:new Set,version:1}}}function hU($,Z,X={}){if(X.prune&&Z.touched)nR(Z,Z.touched);let Q=l4($);uR(Q,{recursive:!0}),lR(h5(Q,"manifest.json"),JSON.stringify({entries:Z.entries,version:Z.version},null,2),"utf8")}function nR($,Z){let X=new Set;for(let[Q,J]of Object.entries($.entries))if(Z.has(Q))for(let G of J.manifest.variants??[])X.add(G.absolutePath);for(let[Q,J]of Object.entries($.entries)){if(Z.has(Q))continue;for(let G of J.manifest.variants??[])if(!X.has(G.absolutePath))dR(G.absolutePath,{force:!0});delete $.entries[Q]}}function uU($,Z){$.touched?.add(Z);let X=$.entries[Z];if(!X)return null;return X.manifest}function mU($,Z,X,Q){$.touched?.add(Z),$.entries[Z]={manifest:Q,source:X,timestamp:Date.now()}}var p9;var eX=s(()=>{tX()});import{existsSync as $Q}from"node:fs";import{basename as rR,extname as cU,resolve as dU}from"node:path";async function iU($,Z){let X=Z.get($);if(!X){let Q=c9($);try{let J=await aX($);X={width:J.width,height:J.height,hash:Q}}catch(J){if(!lU)lU=!0,console.warn(`Could not read image dimensions (${J.message}) — `+"emitting srcsets without width/height attributes.");X={width:null,height:null,hash:Q}}Z.set($,X)}return X}function u5($,Z,X,Q){let J=Z.quality?.webp??80,G=$.startsWith("/")?"":"/",W=Q?`?v=${Q}`:"";return Z.widths.filter((Y)=>Y<=X).toSorted((Y,z)=>Y-z).map((Y)=>`/cdn-cgi/image/width=${Y},quality=${J},fit=scale-down,format=auto${G}${$}${W} ${Y}w`).join(", ")}async function nU($,Z,X,Q,J){let G=`${c9($)}:${oX(X)}`,W=uU(J,G);if(W){if(W.variants.every((q)=>$Q(q.absolutePath)))return W}if(!W)console.log(` Optimizing ${rR($)}...`);let Y=await gU($,l4(Q),X);return mU(J,G,Z,Y),Y}function rU($){if(typeof $!=="string")return!0;if(!$)return!0;if($.includes("${"))return!0;if(aR.some((Z)=>$.startsWith(Z)))return!0;if(pU.has(cU($).toLowerCase()))return!0;return!1}function aU($,Z){if(Z.service!=="cloudflare")return!1;if(!Z.remoteDomains?.length)return!1;if(typeof $!=="string"||!$.startsWith("https://"))return!1;if($.includes("${"))return!1;try{let X=new URL($);if(pU.has(cU(X.pathname).toLowerCase()))return!1;return Z.remoteDomains.includes(X.hostname)}catch{return!1}}function oU($,Z,X){let Q=X?.length?G5(X,$):null;if(Q)return Q;if($.startsWith("/"))return dU(Z,"public",$.slice(1));return dU(Z,$)}async function sU($,Z,X,Q,J,G=[]){let W=new Map;if(!Z.optimize)return{imageRefs:W};return await tU($,Z,X,Q,J??new Map,W,G),{imageRefs:W}}async function tU($,Z,X,Q,J,G,W){if(!$||typeof $!=="object")return;if($.tagName==="img")await oR($,Z,X,Q,J,G,W);if(typeof $.innerHTML==="string"&&$.innerHTML.includes("<img"))$.innerHTML=await ZP($.innerHTML,Z,X,Q,J,G,W);if(Array.isArray($.children))for(let Y of $.children){if(typeof Y==="string")continue;await tU(Y,Z,X,Q,J,G,W)}}async function oR($,Z,X,Q,J,G,W){if(!$.attributes)$.attributes={};let Y=$.attributes.src??$.src;if(typeof Y!=="string")return;let z=aU(Y,Z);if(!z&&rU(Y))return;if($.attributes["data-no-optimize"]!==void 0)return;let q,H=null;if(z)q=u5(Y,Z,1/0,null);else{let B=oU(Y,X,W);if(!$Q(B))return;if(Z.service==="cloudflare"){let F=await iU(B,J);q=u5(Y,Z,F.width??1/0,F.hash),H=F.width&&F.height?{height:F.height,width:F.width}:null}else{let F=G.get(B);if(!F)F=await nU(B,Y,Z,X,Q),G.set(B,F);let L=Z.formats.includes("avif")?"avif":Z.formats[0];q=sX(F.variants,L),H=F.original?.width&&F.original.height?{height:F.original.height,width:F.original.width}:null}}if(q)$.attributes.srcset=q,$.attributes.sizes??=Z.sizes;if(H&&$.attributes.width===void 0&&$.attributes.height===void 0)$.attributes.width=String(H.width),$.attributes.height=String(H.height);if(Z.lazyLoad&&$.attributes.loading!=="eager")$.attributes.loading="lazy",$.attributes.decoding="async"}async function ZP($,Z,X,Q,J,G,W){let Y=[];for(let q of $.matchAll(sR)){let H=q[0],B=q[1];if(eR.test(B))continue;if($P.test(B))continue;let F=B.match(tR);if(!F)continue;let L=F[1].replaceAll("&","&"),w=aU(L,Z);if(!w&&rU(L))continue;let N=w?null:oU(L,X,W);if(N&&!$Q(N))continue;let I,T=null;if(w)I=u5(L,Z,1/0,null);else if(Z.service==="cloudflare"){let P=await iU(N,J);I=u5(L,Z,P.width??1/0,P.hash),T=P.width&&P.height?{height:P.height,width:P.width}:null}else{let P=G.get(N);if(!P)P=await nU(N,L,Z,X,Q),G.set(N,P);let R=Z.formats.includes("avif")?"avif":Z.formats[0];I=sX(P.variants,R),T=P.original?.width&&P.original.height?{height:P.original.height,width:P.original.width}:null}if(!I)continue;let E=` srcset="${I}" sizes="${Z.sizes}"`;if(T&&!/\bwidth=/.test(B)&&!/\bheight=/.test(B))E+=` width="${T.width}" height="${T.height}"`;if(Z.lazyLoad&&!/\bloading="eager"/.test(B)){if(!/\bloading=/.test(B))E+=' loading="lazy"';if(!/\bdecoding=/.test(B))E+=' decoding="async"'}Y.push({match:H,replacement:`<img${B}${E}>`})}let z=$;for(let{match:q,replacement:H}of Y)z=z.replace(q,H);return z}var pU,aR,lU=!1,sR,tR,eR,$P;var eU=s(()=>{tX();eX();R9();pU=new Set([".svg",".gif"]),aR=["http://","https://","data:","//"];sR=/<img\b([^>]*)>/gi,tR=/\bsrc="([^"]*)"/,eR=/\bsrcset="/,$P=/\bdata-no-optimize\b/});var JH={};m1(JH,{buildSite:()=>qP});import{cpSync as ZQ,existsSync as Q4,mkdirSync as X6,readFileSync as XP,readdirSync as QP,rmSync as JP,statSync as GP,writeFileSync as Q1}from"node:fs";import{basename as WP,dirname as Q6,join as c4,relative as YP,resolve as t0,sep as zP}from"node:path";async function qP($,Z={}){let{clean:X=!0,verbose:Q=!1}=Z,J=[],G=Q?console.log.bind(console):()=>{};G("Loading project.json...");let{config:W}=T6($);if("contentTypes"in W)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 Y=t0($,W.build.outDir),z=t0($,"pages"),q=t0($,"public"),H=W.build.trailingSlash??"always",B=new Map,F=(o,f)=>{if(!Xz(o))return o;try{let Z0=Qz(o,f??$,$);if(!n6(o)&&!Q4(Z0))return console.warn(`Sidecar "${o}" not found at ${Z0} — emitting unbundled`),o;let J0=n6(o)?o:`./${YP($,Z0)}`,$0=OY(J0),F0=B.get($0);if(F0&&F0.entryPath!==Z0)throw Error(`"${o}" and "${F0.specifier}" both bundle to ${$0} — rename one`);return B.set($0,{entryPath:Z0,specifier:o}),$0}catch(Z0){return J.push(`Sidecar "${o}": ${Z0.message}`),o}},L=await R1($,W),w=L.formats;if(w.entries.length>0)G(` Registered ${w.entries.length} format(s): ${w.entries.map((o)=>o.name).join(", ")}`);let N=L.serverMounts().filter((o)=>{if(!o.project)return!0;let f=W[o.project.key];return f!==void 0&&typeof f==="object"&&Object.keys(f).length>0});if(N.length>0&&!W.build.adapter){let o=N.map((f)=>f.project?`"${f.project.key}"`:`"${f.server.basePath}"`).join(", ");throw Error(`project.json declares dynamic section(s) ${o} 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(X&&Q4(Y))JP(Y,{force:!0,recursive:!0});if(X6(Y,{recursive:!0}),!Q4(z))throw Error(`pages/ directory not found in ${$}`);G("Discovering pages...");let I=await zz(z,w);G(` Found ${I.length} page(s)`),G("Loading project sections...");let T=await Hz($,W,L),E=Object.keys(T);if(E.length>0)G(` Loaded ${E.length} section(s): ${E.join(", ")}`);let{errors:P,mounts:R}=await Bz(L,W,$);J.push(...P);for(let o of P)console.error(o);if(R.length>0)G(` Mounted ${R.length} asset dir(s): ${R.map((o)=>o.urlPrefix).join(", ")}`);let C=new Set,y=await Kz(I,$,T,L,W);G(` ${y.length} route(s) after expansion`);let v=0,h=t0($,"components"),X0=[],r=new Map,u=new Map;if(Q4(h)){G("Compiling components...");let o=[".json",...w.documentExtensions("component")],f=QP(h).filter(($0)=>o.some((F0)=>$0.endsWith(F0))),Z0=t0(Y,"components");X6(Z0,{recursive:!0});let J0=new Map;for(let $0 of f){let F0=t0(h,$0);try{let{tagName:U0}=await _4(F0,w);if(U0)J0.set(F0,U0)}catch{}}for(let $0 of f)try{let F0=t0(h,$0),U0=await Z5(F0,{...W.$media?{$media:W.$media}:{},formats:w,resolveElementPath:(e,d0)=>{let R0=d0?t0(d0,e):t0(e),p0=J0.get(R0);return p0?`./${p0}.js`:e.replace(/\.json$/,".js")},rewriteSrc:F});for(let e of U0.files){let d0=e.tagName?`${e.tagName}.js`:WP(e.path);if(Q1(t0(Z0,d0),e.content,"utf8"),e.tagName)X0.push(e.tagName);v+=1}let D0=await _4(F0,w);if(D0.tagName){u.set(D0.tagName,D0);let e=qG(D0.tagName,D0.style,D0,W.$media??{});if(e)r.set(D0.tagName,e),zX(e,R,C),Q1(t0(Z0,`${D0.tagName}.css`),e,"utf8"),v+=1}}catch(F0){let U0=F0;J.push(`Error compiling component ${$0}: ${U0.message}`),console.error(`Error compiling component ${$0}: ${U0.message}`)}G(` Compiled ${X0.length} component(s): ${X0.join(", ")}`)}let t=[];if(W.build.adapter)for(let[,o]of u){let f=x8(o);for(let Z0 of f){let J0=`./components/${Z0.src.replace(/^\.\//,"")}`;t.push({exportName:Z0.exportName,src:J0})}}let Y0=W.images.optimize&&W.images.service==="cloudflare",G0=W.images.optimize&&!Y0?fU($):null,A0=Y0?new Map:null;if(Y0)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 l=W.url,K0=Boolean(l)&&W.build.sitemap!==!1,V0=[];for(let o of y)try{G(` Compiling ${o.urlPattern} ...`);let f=await KP(o,W,$,T,G0,u,A0,w,L,F,R),Z0=new Set;for(let[F0,U0]of u)if(sZ(U0))Z0.add(F0);if(X0.length>0)f.html=BP(f.html,X0,r,Z0,f.files.map((F0)=>F0.content).join(`
|
|
323
|
+
`));zX(f.html,R,C);let J0=QH(o.urlPattern,Y,H);X6(Q6(J0),{recursive:!0}),Q1(J0,f.html,"utf8"),v+=1;let $0=!o.urlPattern.includes(":")&&!o.urlPattern.includes("*");if(K0&&!f.excludeFromSitemap&&$0)V0.push({lastmod:GP(o.sourcePath).mtime,loc:new URL(o.urlPattern,l).href});for(let F0 of w.withCapability("serialize")){if(!F0.exportTarget)continue;try{let U0=await F0.call("serialize",f.doc,{buildScope:(D0)=>N4(D0,null),componentDefs:u,evaluateTemplate:(D0,e)=>{if(!w0(D0))return;return M$(D0,e)??D0},mode:"export"});if(U0){let D0=J0.replace(/\.html$/,F0.extensions[0]);Q1(D0,U0,"utf8"),v+=1}}catch(U0){let D0=U0;J.push(`Error exporting ${F0.name} for ${o.urlPattern}: ${D0.message}`)}}for(let F0 of f.files){let U0=t0(Q6(J0),F0.path);X6(Q6(U0),{recursive:!0}),Q1(U0,F0.content,"utf8"),v+=1}if(f.serverHandler){let F0=t0(Q6(J0),"_server.js");Q1(F0,f.serverHandler,"utf8"),v+=1}}catch(f){let Z0=f,J0=`Error compiling ${o.urlPattern}: ${Z0.message}`;J.push(J0),console.error(J0)}if(G0&&W.images.optimize){hU($,G0,{prune:J.length===0});let o=t0(l4($),"_optimized");if(Q4(o)){let Z0=t0(Y,"images/_optimized");X6(Z0,{recursive:!0}),ZQ(o,Z0,{recursive:!0})}let f=Object.keys(G0.entries).length;if(f>0)G(` Optimized ${f} image(s)`)}if(W.build.adapter){let{adapter:o}=W.build;G("Generating site-wide server worker...");let f=new Map;for(let U0 of t)if(!f.has(U0.exportName))f.set(U0.exportName,U0);let{mounts:Z0,connectors:J0}=UP(N,L,W);if(Z0.length>0)G(` Mounting ${Z0.length} extension route(s): ${Z0.map((U0)=>U0.basePath).join(", ")}`);let F0=o==="cloudflare-pages"&&f.size===0&&Z0.length===0?null:u7([...f.values()],{adapter:o,connectors:J0,mounts:Z0});if(F0){let U0=o==="cloudflare-pages"?"_worker.js":"worker.js";try{await Gz(F0,{adapter:o,outfile:t0(Y,U0),projectRoot:$}),v+=1,G(` Generated dist/${U0} (bundled, ${f.size} server function(s))`)}catch(D0){let e=`Error bundling dist/${U0}: ${D0.message}`;J.push(e),console.error(e)}if(o==="cloudflare-pages")Q1(t0(Y,"_routes.json"),`${JSON.stringify({exclude:[],include:["/_jx/*"],version:1},null,2)}
|
|
324
|
+
`,"utf8"),v+=1}}if(B.size>0){G(`Bundling ${B.size} client sidecar module(s)...`);for(let[o,f]of B)try{let Z0=t0(Y,o.replace(/^\//,""));X6(Q6(Z0),{recursive:!0}),await WX({entryPath:f.entryPath,outfile:Z0},{external:Zz,target:"browser"}),v+=1,G(` ${f.specifier} → ${o}`)}catch(Z0){let J0=`Error bundling sidecar "${f.specifier}": ${Z0.message}`;J.push(J0),console.error(J0)}}for(let o of L.emitters()){let f=o.project?.key,Z0=f?W[f]:void 0;if(f&&(Z0==null||typeof Z0==="object"&&Object.keys(Z0).length===0))continue;try{let J0=await o.call("emit",Z0??null,{projectConfig:W,root:$,routes:y,sections:T});for(let $0 of J0??[]){let F0=t0(Y,$0.path.replace(/^\//,""));if(!F0.startsWith(Y+zP))throw Error(`emit path escapes outDir: ${$0.path}`);X6(Q6(F0),{recursive:!0}),Q1(F0,$0.content),v+=1,G(` ${o.name} emitted ${$0.path}`)}}catch(J0){let $0=`Error in ${o.name}.emit: ${J0.message}`;J.push($0),console.error($0)}}if(W.redirects&&Object.keys(W.redirects).length>0){G("Generating redirects...");let o=new Set(y.map((Z0)=>Z0.urlPattern)),f=MP(W.redirects,Y,o);v+=f}if(K0)G(`Generating sitemap (${V0.length} URL(s))...`),v+=NP(V0,Y);else if(!l&&W.build.sitemap!==!1)console.warn("sitemap.xml skipped — set `url` in project.json to enable sitemap generation.");if(C.size>0){let{copied:o,missing:f}=Fz(C,R,Y);v+=o,G(`Copying ${o} mounted asset(s)...`);for(let Z0 of f)console.warn(`Referenced asset not found: ${Z0}`)}if(Q4(q))G("Copying public/ assets..."),ZQ(q,Y,{recursive:!0});if(K0)v+=DP(Y,l);if(W.copy){G("Copying mapped files...");for(let[o,f]of Object.entries(W.copy)){let Z0=t0($,o),J0=t0(Y,f);X6(Q6(J0),{recursive:!0}),ZQ(Z0,J0)}}if(G(`
|
|
325
|
+
Build complete: ${y.length} routes, ${v} files`),J.length>0)G(` ${J.length} error(s)`);return{errors:J,files:v,routes:y.length}}async function KP($,Z,X,Q={},J=null,G=new Map,W=null,Y,z,q,H=[]){let B=await _4($.sourcePath,Y),F=qX(B,Z,X),L=B.$head??F._pageHead??[],w=F.$head??[],N=B.title??F._pageTitle??null;delete F._pageHead,delete F._pageTitle,Dz(F,Z,$,X),await Tz(F,$,X,{config:Z,sections:Q,...z===void 0?{}:{registry:z},...q===void 0?{}:{registerBundle:(r)=>{q(r,null)}}});let I=N4(F.state??{}),T=N??Z.name??"Jx Site";if(typeof T==="string"&&w0(T))T=M$(T,I)??T;let E=$H(L,I),P=$H(w,I);i9(F,I);let R={counter:{n:0},media:{...Z.$media,...F.$media},rules:[]};if(QQ(F,G,R),F.state)for(let[r,u]of Object.entries(F.state)){if(r==="$site"||r==="$page")continue;if(u&&typeof u==="object"&&!Array.isArray(u)&&u.timing==="compiler")delete F.state[r];else if(Array.isArray(u))delete F.state[r]}let C=HP(Z.$head??[]),y=Iz(C,P,E,{title:T,charset:Z.defaults?.charset??"utf8",...Z.name!=null&&{siteName:Z.name},...Z.url!=null&&{siteUrl:Z.url},pageUrl:$.urlPattern});if(Z.$media)F.$media={...Z.$media,...F.$media};if(Object.values(F.$media??{}).some((r)=>T1(String(r))!==null))y.splice(2,0,{tagName:"script",textContent:D4()});if(Z.images?.optimize&&(J||W))await sU(F,Z.images,X,J,W??void 0,H);let v=await t7(F,{lang:Z.defaults?.lang??"en",prePaintScheme:!1,projectStyle:Z.style??null,...q===void 0?{}:{rewriteSrc:(r)=>q(r,Q6($.sourcePath))},title:T});if(R.rules.length>0)v.html=v.html.replace("</head>",`<style>
|
|
326
|
+
${R.rules.join(`
|
|
328
327
|
`)}
|
|
329
328
|
</style>
|
|
330
|
-
</head>`);v.html=
|
|
331
|
-
`):null,G=
|
|
332
|
-
`),
|
|
333
|
-
</head>`);let Y
|
|
329
|
+
</head>`);v.html=LP(v.html,y,Z.defaults?.lang??"en");let h=(F.$elements??[]).filter((r)=>typeof r==="string"&&!r.startsWith("./")&&!r.startsWith("../"));if(h.length>0)v.html=FP(v.html,h);let X0=null;if(!Z.build?.adapter)try{let r=await T9($.sourcePath);if(r)X0=r}catch{}return{doc:F,excludeFromSitemap:B.$sitemap===!1,files:v.files,html:v.html,serverHandler:X0}}function UP($,Z,X){if($.length===0)return{connectors:[],mounts:[]};let Q={};for(let Y of Z.projectContributions()){let{key:z}=Y.project;if(z in X)Q[z]=X[z]}let J=$.map((Y)=>{let z=Y.server,{module:q}=z;if(typeof q!=="string"||q==="")throw Error(`Extension class "${Y.name}": server.module (a bare import specifier) is required to generate a deployable worker`);return{basePath:z.basePath,className:Y.classDef.title??Y.name,module:q,options:{basePath:z.basePath,sections:Q},order:z.order??100}}),G=new Set;for(let Y of Object.values(Q)){if(!Y||typeof Y!=="object"||Array.isArray(Y))continue;for(let z of Object.values(Y)){let q=z?.provider;if(typeof q==="string")G.add(q)}}let W=[];for(let Y of Z.connectors()){let z=String(Y.connector.provider);if(!G.has(z))continue;let{module:q}=Y.connector;if(typeof q!=="string"||q==="")throw Error(`Connector class "${Y.name}": connector.module (a bare import specifier) is required to generate a deployable worker`);W.push({className:Y.classDef.title??Y.name,module:q,provider:z})}return{connectors:W,mounts:J}}function $H($,Z){return $.map((X)=>{if(!X||typeof X!=="object")return X;let Q={...X};if(Q.attributes){Q.attributes={...Q.attributes};for(let[J,G]of Object.entries(Q.attributes))if(typeof G==="string"&&w0(G))Q.attributes[J]=M$(G,Z)??G}if(typeof Q.textContent==="string"&&w0(Q.textContent))Q.textContent=M$(Q.textContent,Z)??Q.textContent;return Q})}function HP($){return $.map((Z)=>{if(!Z||typeof Z!=="object"||!Z.attributes)return Z;let X={...Z,attributes:{...Z.attributes}};for(let Q of["href","src"]){let J=X.attributes[Q];if(typeof J==="string"&&VP(J))X.attributes[Q]=`/node_modules/${J}`}return X})}function VP($){return!$.startsWith("/")&&!$.startsWith("./")&&!$.startsWith("../")&&!$.startsWith("http")&&!$.startsWith("data:")}function XH($,Z){if(!$||typeof $!=="object")return $;let X={};for(let[Q,J]of Object.entries($))if(Q==="children"&&Array.isArray(J))X.children=J.map((G)=>{if(typeof G==="string")return G;return XH(G,Z)});else if(Q==="style"&&J&&typeof J==="object"){let G={...J};for(let[W,Y]of Object.entries(G))if(w0(Y))G[W]=m5(Y,Z)??Y;X.style=G}else if(Q==="attributes"&&J&&typeof J==="object"){let G={...J};for(let[W,Y]of Object.entries(G))if(w0(Y))G[W]=m5(Y,Z)??Y;X.attributes=G}else if(Q==="$props"&&J&&typeof J==="object"){let G={...J};for(let[W,Y]of Object.entries(G))if(w0(Y)){let z=m5(Y,Z);G[W]=z!==null?z??null:Y}X.$props=G}else if(typeof J==="string"&&w0(J))X[Q]=m5(J,Z)??J;else X[Q]=J;return X}function m5($,Z){try{let X=Z.$map?.item,Q=Z.$map?.index,J=$.match(/^\$\{(.+)\}$/s);if(J)return Function("state","$map","item","index",`return (${J[1]})`)(Z,Z.$map,X,Q);return Function("state","$map","item","index",`return \`${$}\``)(Z,Z.$map,X,Q)}catch{return null}}function i9($,Z){if(!$||typeof $!=="object")return;if(typeof $.innerHTML==="string"&&w0($.innerHTML)){let Q=M$($.innerHTML,Z);if(Q!=null)$.innerHTML=String(Q).replaceAll("${","${")}if(typeof $.textContent==="string"&&w0($.textContent))$.textContent=M$($.textContent,Z)??$.textContent;if($.style&&typeof $.style==="object"){for(let[Q,J]of Object.entries($.style))if(typeof J==="string"&&w0(J))$.style[Q]=M$(J,Z)??J}if($.attributes&&typeof $.attributes==="object"){for(let[Q,J]of Object.entries($.attributes))if(typeof J==="string"&&w0(J))$.attributes[Q]=M$(J,Z)??J}if($.$props&&typeof $.$props==="object"){for(let[Q,J]of Object.entries($.$props))if(typeof J==="string"&&w0(J))$.$props[Q]=M$(J,Z)??J}let X=$.children;if(G$(X)){let Q=ZH(X,Z);if(Q&&Q.length>0){$.children=Q;return}}if(typeof X==="string"&&w0(X)){let Q=M$(X,Z);if(Array.isArray(Q)){let J=Q;$.children=J;for(let G of J)i9(G,Z)}}else if(Array.isArray($.children)){let Q=0;while(Q<$.children.length){let J=$.children[Q];if(typeof J==="string"&&w0(J)){let G=M$(J,Z);if(Array.isArray(G)){let W=G;$.children.splice(Q,1,...W);for(let Y of W)i9(Y,Z);Q+=W.length;continue}}if(G$(J)){let G=ZH(J,Z);if(G&&G.length>0){$.children.splice(Q,1,...G),Q+=G.length;continue}}i9(J,Z),Q+=1}}}function ZH($,Z){let X=$.items,Q=null;if(U$(X))Q=aZ(X.$ref,Z);else if(Array.isArray(X))Q=X;let J=$.map;if(!Array.isArray(Q)||!J)return null;return Q.map((G,W)=>{let Y=Object.create(Z);Y.$map={index:W,item:G},Y["$map/item"]=G,Y["$map/index"]=W;let z=XH(J,Y);return i9(z,Y),z})}function QQ($,Z,X){if(!$||typeof $!=="object")return;if(Array.isArray($)){for(let J of $)QQ(J,Z,X);return}if(Array.isArray($.children))for(let J of $.children)QQ(J,Z,X);let Q=Z.get($.tagName);if(Q){if($.attributes){let Y=null;for(let[z,q]of Object.entries($.attributes))if(z.startsWith("props.")&&z.length>6)Y??={},Y[z.slice(6)]=q,delete $.attributes[z];if(Y)$.$props={...Y,...$.$props}}let J=Array.isArray($.children)&&$.children.length>0?$.children.map((Y)=>{if(X&&Y&&typeof Y==="object")F6(Y,X.rules,X.media,"",X.counter,"jxs");return F4(Y,{},null)}).join(`
|
|
330
|
+
`):null,G=zG(Q,$.$props||null,J),W=sZ(Q);if($.innerHTML=G,delete $.children,Q.style&&$.$props){let Y={...Q.state};for(let[H,B]of Object.entries($.$props))Y[H]=H in Y?B:B;let z=N4(Y,null),q={};for(let[H,B]of Object.entries(Q.style))if(typeof B==="string"&&w0(B)){let F=r0(B,z);if(F!=null)q[H]=F}if(Object.keys(q).length>0)$.style={...$.style,...q}}if(delete $.$props,W)$.$static=!0;else $.$prerendered=!0}}function BP($,Z,X=new Map,Q=new Set,J=""){let G=(N)=>$.includes(`<${N}`),W=(N)=>J.includes(`<${N}`),Y=Z.filter((N)=>G(N)||W(N));if(Y.length===0)return $;let z=Y.filter((N)=>X.has(N)).map((N)=>`<link rel="stylesheet" href="/components/${N}.css">`).join(`
|
|
331
|
+
`),q=$;if(z)q=q.replace("</head>",` ${z}
|
|
332
|
+
</head>`);let H=Y.filter((N)=>W(N)||!Q.has(N));if(H.length===0)return q;let B=`<script type="importmap">
|
|
334
333
|
{
|
|
335
334
|
"imports": {
|
|
336
|
-
"@vue/reactivity": "${
|
|
337
|
-
"lit-html": "${
|
|
335
|
+
"@vue/reactivity": "${M4}",
|
|
336
|
+
"lit-html": "${A4}"
|
|
338
337
|
}
|
|
339
338
|
}
|
|
340
|
-
</script>`,
|
|
341
|
-
`),
|
|
342
|
-
`)+
|
|
343
|
-
</body>`)}function
|
|
339
|
+
</script>`,F=H.map((N)=>`<script type="module" src="/components/${N}.js"></script>`).join(`
|
|
340
|
+
`),w=(q.includes('<script type="importmap">')?"":`${B}
|
|
341
|
+
`)+F;return q.replace("</body>",` ${w}
|
|
342
|
+
</body>`)}function FP($,Z){let X=Z.map((Q)=>`<script type="module" src="/node_modules/${Q}"></script>`).join(`
|
|
344
343
|
`);return $.replace("</body>",` ${X}
|
|
345
|
-
</body>`)}function
|
|
344
|
+
</body>`)}function LP($,Z,X){let Q=Nz(Z),J=/<head>([\s\S]*?)<\/head>/i,G=$.match(J),W="";if(G){let z=G[1].match(/<style>[\s\S]*?<\/style>/gi);if(z)W+=`
|
|
346
345
|
${z.join(`
|
|
347
346
|
`)}`;let q=G[1].match(/<script[\s\S]*?<\/script>/gi);if(q)W+=`
|
|
348
347
|
${q.join(`
|
|
349
348
|
`)}`}let Y=$;if(J.test(Y))Y=Y.replace(J,`<head>
|
|
350
349
|
${Q}${W}
|
|
351
|
-
</head>`);return Y=Y.replace(/<html\s[^>]*>/i,(z)=>{if(/lang=/.test(z))return z.replace(/lang="[^"]*"/,`lang="${X}"`);return z.replace("<html",`<html lang="${X}"`)}),Y}function
|
|
350
|
+
</head>`);return Y=Y.replace(/<html\s[^>]*>/i,(z)=>{if(/lang=/.test(z))return z.replace(/lang="[^"]*"/,`lang="${X}"`);return z.replace("<html",`<html lang="${X}"`)}),Y}function QH($,Z,X){if($==="/")return c4(Z,"index.html");let Q=$.replace(/^\//,"");if(X==="always")return c4(Z,Q,"index.html");return c4(Z,`${Q}.html`)}function MP($,Z,X=new Set){let Q=0,J=[],G=(Y)=>Y.length>1&&Y.endsWith("/")?Y.slice(0,-1):Y,W=new Set([...X].map((Y)=>G(Y)));for(let[Y,z]of Object.entries($)){let q=typeof z==="object"?z.destination:z,H=typeof z==="object"?z.status??301:301;if(Y.includes(":")||Y.includes("*")){J.push(`${Y} ${q} ${H}`);continue}if(W.has(G(Y)))console.warn(`Redirect "${Y}" overwrites a compiled page at the same route — `+"remove the redirect or the page.");let B=QH(Y,Z,"always"),F=`<!DOCTYPE html>
|
|
352
351
|
<html>
|
|
353
352
|
<head>
|
|
354
353
|
<meta charset="utf-8">
|
|
355
|
-
<meta http-equiv="refresh" content="0;url=${
|
|
356
|
-
<link rel="canonical" href="${
|
|
354
|
+
<meta http-equiv="refresh" content="0;url=${XQ(q)}">
|
|
355
|
+
<link rel="canonical" href="${XQ(q)}">
|
|
357
356
|
<title>Redirecting...</title>
|
|
358
357
|
</head>
|
|
359
358
|
<body>
|
|
360
|
-
<p>Redirecting to <a href="${
|
|
359
|
+
<p>Redirecting to <a href="${XQ(q)}">${AP(q)}</a>...</p>
|
|
361
360
|
</body>
|
|
362
|
-
</html
|
|
361
|
+
</html>`;X6(Q6(B),{recursive:!0}),Q1(B,F,"utf8"),Q+=1,J.push(`${Y} ${q} ${H}`)}if(J.length>0)Q1(c4(Z,"_redirects"),`${J.join(`
|
|
363
362
|
`)}
|
|
364
|
-
`,"utf8"),Q+=1;return Q}function
|
|
363
|
+
`,"utf8"),Q+=1;return Q}function AP($){return String($).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}function XQ($){return String($).replaceAll("&","&").replaceAll('"',""").replaceAll("<","<")}function IP($){return String($).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function NP($,Z){if($.length===0)return 0;let Q=`<?xml version="1.0" encoding="UTF-8"?>
|
|
365
364
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
366
365
|
${$.map((J)=>` <url>
|
|
367
|
-
<loc>${
|
|
366
|
+
<loc>${IP(J.loc)}</loc>
|
|
368
367
|
<lastmod>${J.lastmod.toISOString().slice(0,10)}</lastmod>
|
|
369
368
|
</url>`).join(`
|
|
370
369
|
`)}
|
|
371
370
|
</urlset>
|
|
372
|
-
`;return
|
|
371
|
+
`;return Q1(c4(Z,"sitemap.xml"),Q,"utf8"),1}function DP($,Z){let X=c4($,"robots.txt"),Q=Q4(X),J=Q?XP(X,"utf8"):`User-agent: *
|
|
373
372
|
Allow: /
|
|
374
373
|
`;if(/^Sitemap:/im.test(J))return 0;if(!J.endsWith(`
|
|
375
374
|
`))J+=`
|
|
376
375
|
`;return J+=`
|
|
377
376
|
Sitemap: ${new URL("/sitemap.xml",Z).href}
|
|
378
|
-
`,X6(X,J,"utf8"),Q?0:1}var nK=s(()=>{D6();N9();rY();I9();eY();p6();Zz();Jz();Wz();Uz();XY();A9();B1();Hz();mK();cX()});var aK={};h6(aK,{runDev:()=>KP,resolveDevEntry:()=>rK});import{createRequire as zP}from"node:module";import{join as qP}from"node:path";import{spawn as UP}from"node:child_process";function rK($){try{return zP(qP($,"package.json")).resolve("@jxsuite/server/dev")}catch{throw Error(`@jxsuite/server is not installed in ${$}. Add it to devDependencies (e.g. \`bun add -d @jxsuite/server\`) and retry.`)}}function KP($,Z,X=UP,Q=process){let G=[rK($),"--root",$];if(Z!==void 0)G.push("--port",String(Z));let W=X("bun",G,{stdio:"inherit"});return W.on("error",(Y)=>{if(Y.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: ${Y.message}`);Q.exitCode=1}),Q.on("SIGINT",()=>{W.kill("SIGINT")}),Q.on("SIGTERM",()=>{W.kill("SIGTERM")}),W.on("exit",(Y)=>{Q.exitCode=Y??0}),W}var oK=()=>{};var $H={};h6($H,{startPreviewServer:()=>AP,resolvePreviewFile:()=>eK});import{createServer as HP}from"node:http";import{existsSync as x8,readFileSync as sK,statSync as VP}from"node:fs";import{extname as BP,join as aX,normalize as FP,resolve as tK,sep as LP}from"node:path";function eK($,Z){let X=FP(Z).replaceAll("\\","/"),Q=tK($,`.${X.startsWith("/")?X:`/${X}`}`);if(Q!==$&&!Q.startsWith($+LP))return null;if(x8(Q)){if(VP(Q).isDirectory()){let G=aX(Q,"index.html");return x8(G)?G:null}return Q}let J=aX(Q,"index.html");return x8(J)?J:null}function AP($,Z){let X=tK($),Q=HP((J,G)=>{let W=new URL(J.url??"/","http://localhost"),Y=eK(X,decodeURIComponent(W.pathname));if(Y){G.writeHead(200,{"Content-Type":MP[BP(Y).toLowerCase()]??"application/octet-stream"}),G.end(sK(Y));return}let z=aX(X,"404.html");if(x8(z)){G.writeHead(404,{"Content-Type":"text/html; charset=utf-8"}),G.end(sK(z));return}G.writeHead(404,{"Content-Type":"text/plain; charset=utf-8"}),G.end("Not found")});return Q.listen(Z),Q}var MP;var ZH=s(()=>{MP={".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 m9="https://jxsuite.com/schema/project/fields/v2",f4="https://jxsuite.com/schema/document/paths/v2",XH,QH;var b8=s(()=>{XH={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"},QH={description:`Relationship reference field: points at a named entry of a referenceable section via "#/<sectionKey>/<name>" (specs/relationships.md). A bare reference is to-one; wrap in an array field's items for to-many.`,properties:{$ref:{pattern:"^#/[A-Za-z][A-Za-z0-9_-]*/[A-Za-z0-9._-]+$",type:"string"},description:{type:"string"}},required:["$ref"],type:"object"}});function YH($){let{corePath:Z,fragments:X,fieldSchemaRefs:Q=[]}=$;return{$comment:WH,$defs:{Fields:{$id:m9,anyOf:[{$ref:`${JH}#/$defs/JxFieldSchema`},{$ref:`${JH}#/$defs/RelationshipRef`},...Q.map((J)=>({$ref:J}))]}},$schema:"https://json-schema.org/draft/2020-12/schema",allOf:[{$ref:Z},...X.map((J)=>({$ref:J}))],type:"object",unevaluatedProperties:!1}}async function d9($,Z,X){let Q=structuredClone($),J=new Map,G=new Set;oX(Q,G);let W=0,Y=async(q)=>{let H=GH(q),B=J.get(H);if(B!==void 0)return B;let F;try{F=structuredClone(await Z(H))}catch(D){throw Error(`bundleSchema: cannot load $ref target "${H}": ${NP(D)}`,{cause:D})}let M=typeof F.$id==="string"&&k8(F.$id)?F.$id:null;W+=M===null?1:0;let A=M??`urn:jx:bundled:${W}`;if(J.set(H,A),G.has(A))return A;G.add(A),F.$id=A,await z(F,IP(H),!0);let w=Q.$defs??={};return w[A]=F,A},z=async(q,H,B=!1)=>{if(Array.isArray(q)){for(let w of q)await z(w,H);return}if(q===null||typeof q!=="object")return;let F=q,M=H;if(!B&&typeof F.$id==="string"&&k8(F.$id))M=null;let A=F.$ref;if(typeof A==="string"&&M!==null&&!A.startsWith("#")&&!k8(A)){let w=A.indexOf("#"),D=w===-1?A:A.slice(0,w),j=w===-1?"":A.slice(w);if(D){let R=await Y(`${M}/${D}`);F.$ref=`${R}${j}`}}for(let w of Object.values(F))await z(w,M)};return await z(Q,GH(X),!0),Q}function oX($,Z){if(Array.isArray($)){for(let Q of $)oX(Q,Z);return}if($===null||typeof $!=="object")return;let X=$;if(typeof X.$id==="string"&&k8(X.$id))Z.add(X.$id);for(let Q of Object.values(X))oX(Q,Z)}function k8($){return/^[a-zA-Z][a-zA-Z\d+.-]*:/.test($)}function GH($){let Z=$.replaceAll("\\","/"),X=Z.startsWith("/"),Q=[];for(let J of Z.split("/")){if(J===""||J===".")continue;if(J===".."){if(Q.length>0&&Q.at(-1)!=="..")Q.pop();else if(!X)Q.push("..");continue}Q.push(J)}return(X?"/":"")+Q.join("/")}function IP($){let Z=$.lastIndexOf("/");if(Z===-1)return".";return Z===0?"/":$.slice(0,Z)}function NP($){return $ instanceof Error?$.message:String($)}function zH($){let{corePath:Z,pathsValueRefs:X}=$;return{$comment:WH,$defs:{PathsValue:X.length>0?{$id:f4,anyOf:X.map((Q)=>({$ref:Q}))}:{$id:f4}},$ref:Z,$schema:"https://json-schema.org/draft/2020-12/schema"}}var JH="https://jxsuite.com/schema/project/core/v2",WH="Generated by `jx schema` from project.json#/extensions — do not edit.";var qH=s(()=>{b8();b8()});var IH={};h6(IH,{writeProjectSchemas:()=>LH,readBundledProjectSchemas:()=>eX});import{existsSync as FH,readFileSync as l9,statSync as UH,writeFileSync as KH}from"node:fs";import{createRequire as y8}from"node:module";import{dirname as DP,isAbsolute as wP,relative as sX,resolve as k6,sep as tX}from"node:path";async function LH($){let{config:Z}=N1($),X=await E6($,Z),Q=HH($,TP),J=[],G=[],W=[];for(let M of X.extensions){let A=M.schemas.project;if(A)J.push(VH($,M,A));let w=M.schemas.document;if(w)G.push(...BH(w));let D=M.schemas.fields;if(D)W.push(...BH(D)),J.push(VH($,M,D))}let Y=k6($),z=MH(Y),q=await d9(YH({corePath:Q,fieldSchemaRefs:W,fragments:J}),z,Y),H=await d9(zH({corePath:HH($,jP),pathsValueRefs:G}),z,Y),B=k6($,"project.schema.json"),F=k6($,"document.schema.json");return KH(B,`${JSON.stringify(q,null,2)}
|
|
379
|
-
`,"utf8"),
|
|
380
|
-
`,"utf8"),{documentSchemaPath:
|
|
381
|
-
`);return
|
|
377
|
+
`,Q1(X,J,"utf8"),Q?0:1}var GH=s(()=>{w1();R9();Wz();E9();Uz();r1();Vz();Lz();Az();wz();BY();O9();L6();jz();eU();eX()});var YH={};m1(YH,{runDev:()=>OP,resolveDevEntry:()=>WH});import{createRequire as wP}from"node:module";import{join as TP}from"node:path";import{spawn as jP}from"node:child_process";function WH($){try{return wP(TP($,"package.json")).resolve("@jxsuite/server/dev")}catch{throw Error(`@jxsuite/server is not installed in ${$}. Add it to devDependencies (e.g. \`bun add -d @jxsuite/server\`) and retry.`)}}function OP($,Z,X=jP,Q=process){let G=[WH($),"--root",$];if(Z!==void 0)G.push("--port",String(Z));let W=X("bun",G,{stdio:"inherit"});return W.on("error",(Y)=>{if(Y.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: ${Y.message}`);Q.exitCode=1}),Q.on("SIGINT",()=>{W.kill("SIGINT")}),Q.on("SIGTERM",()=>{W.kill("SIGTERM")}),W.on("exit",(Y)=>{Q.exitCode=Y??0}),W}var zH=()=>{};var HH={};m1(HH,{startPreviewServer:()=>bP,resolvePreviewFile:()=>UH});import{createServer as EP}from"node:http";import{existsSync as d5,readFileSync as qH,statSync as RP}from"node:fs";import{extname as PP,join as JQ,normalize as CP,resolve as KH,sep as SP}from"node:path";function UH($,Z){let X=CP(Z).replaceAll("\\","/"),Q=KH($,`.${X.startsWith("/")?X:`/${X}`}`);if(Q!==$&&!Q.startsWith($+SP))return null;if(d5(Q)){if(RP(Q).isDirectory()){let G=JQ(Q,"index.html");return d5(G)?G:null}return Q}let J=JQ(Q,"index.html");return d5(J)?J:null}function bP($,Z){let X=KH($),Q=EP((J,G)=>{let W=new URL(J.url??"/","http://localhost"),Y=UH(X,decodeURIComponent(W.pathname));if(Y){G.writeHead(200,{"Content-Type":_P[PP(Y).toLowerCase()]??"application/octet-stream"}),G.end(qH(Y));return}let z=JQ(X,"404.html");if(d5(z)){G.writeHead(404,{"Content-Type":"text/html; charset=utf-8"}),G.end(qH(z));return}G.writeHead(404,{"Content-Type":"text/plain; charset=utf-8"}),G.end("Not found")});return Q.listen(Z),Q}var _P;var VH=s(()=>{_P={".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 n9="https://jxsuite.com/schema/project/fields/v2",J4="https://jxsuite.com/schema/document/paths/v2",BH,FH,r9,GQ;var l5=s(()=>{BH={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"},FH={description:`Relationship reference field: points at a named entry of a referenceable section via "#/<sectionKey>/<name>" (specs/relationships.md). A bare reference is to-one; wrap in an array field's items for to-many.`,properties:{$ref:{pattern:"^#/[A-Za-z][A-Za-z0-9_-]*/[A-Za-z0-9._-]+$",type:"string"},description:{type:"string"}},required:["$ref"],type:"object"},r9=[{additionalProperties:!1,description:'Explicit value list: generates one page per value, bound to `param` (default "value").',properties:{param:{description:'Route parameter to fill (default "value").',type:"string"},values:{description:"The values to expand.",type:"array"}},required:["values"],type:"object"},{additionalProperties:!1,description:"JSON data-file source: loads a project-relative file that must contain an array, and generates one page per item.",properties:{$ref:{description:"Project-relative path to a .json file containing an array.",type:"string"},field:{description:'Item field providing the parameter value (default "id").',type:"string"},param:{description:'Route parameter to fill (default "id").',type:"string"}},required:["$ref"],type:"object"},{description:"Legacy explicit form: an array of ready-made parameter objects, used as-is with no expansion. Prefer one of the source shapes above.",items:{additionalProperties:{type:"string"},type:"object"},type:"array"}],GQ={description:"A source shape contributed by an extension this schema cannot see. The project's generated document.schema.json validates these exactly; enable the owning extension and regenerate with `jx schema` to get precise checking here.",minProperties:1,type:"object"}});function xP($){let{corePath:Z,fragments:X,fieldSchemaRefs:Q=[]}=$;return{$comment:IH,$defs:{Fields:{$id:n9,anyOf:[{$ref:`${LH}#/$defs/JxFieldSchema`},{$ref:`${LH}#/$defs/RelationshipRef`},...Q.map((J)=>({$ref:J}))]}},$schema:"https://json-schema.org/draft/2020-12/schema",allOf:[{$ref:Z},...X.map((J)=>({$ref:J}))],type:"object",unevaluatedProperties:!1}}async function o9($,Z,X,Q=[]){let J=structuredClone($),G=new Map,W=new Set;WQ(J,W);let Y=0,z=async(H)=>{let B=a9(H),F=G.get(B);if(F!==void 0)return F;let L;try{L=structuredClone(await Z(B))}catch(T){throw Error(`bundleSchema: cannot load $ref target "${B}": ${uP(T)}`,{cause:T})}let w=typeof L.$id==="string"&&S6(L.$id)?L.$id:null;Y+=w===null?1:0;let N=w??`urn:jx:bundled:${Y}`;if(G.set(B,N),W.has(N))return N;W.add(N),L.$id=N,await q(L,hP(B),!0);let I=J.$defs??={};return I[N]=L,N},q=async(H,B,F=!1)=>{if(Array.isArray(H)){for(let I of H)await q(I,B);return}if(H===null||typeof H!=="object")return;let L=H,w=B;if(!F&&typeof L.$id==="string"&&S6(L.$id))w=null;let N=L.$ref;if(typeof N==="string"&&w!==null&&!N.startsWith("#")&&!S6(N)){let I=N.indexOf("#"),T=I===-1?N:N.slice(0,I),E=I===-1?"":N.slice(I);if(T){let P=await z(`${w}/${T}`);L.$ref=`${P}${E}`}}for(let I of Object.values(L))await q(I,w)};await q(J,a9(X),!0);for(let H of Q)await z(`${a9(X)}/${H}`);return J}function G4($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function gP($){return $.replaceAll("~","~0").replaceAll("/","~1")}function*MH($,Z){for(let X of kP){let Q=$[X];if(Array.isArray(Q)){for(let[J,G]of Q.entries())if(G4(G))yield[G,`${Z}/${X}/${J}`]}else if(G4(Q))yield[Q,`${Z}/${X}`]}for(let X of yP){let Q=$[X];if(!G4(Q))continue;for(let[J,G]of Object.entries(Q))if(G4(G))yield[G,`${Z}/${X}/${gP(J)}`]}for(let X of vP){let Q=$[X];if(!Array.isArray(Q))continue;for(let[J,G]of Q.entries())if(G4(G))yield[G,`${Z}/${X}/${J}`]}}function fP($,Z){let X=$.replace(/^[a-zA-Z][a-zA-Z\d+.-]*:/,"");if(X.startsWith("//")){let G=X.indexOf("/",2);X=G===-1?"":X.slice(G+1)}X=X.replace(/^schema\//,"");let Q=X.split(/[^a-zA-Z0-9]+/).filter(Boolean).join("-")||"resource",J=Q;for(let G=2;Z.has(J);G+=1)J=`${Q}-${G}`;return Z.add(J),J}function s9($){let Z=structuredClone($);if(G4(Z.$defs)){let G=new Set(Object.keys(Z.$defs).filter((Y)=>!S6(Y))),W={};for(let[Y,z]of Object.entries(Z.$defs)){let q=G4(z)&&typeof z.$id==="string"?z.$id:Y;W[S6(Y)?fP(q,G):Y]=z}Z.$defs=W}let X=new Map,Q=(G,W)=>{let{$id:Y}=G;if(typeof Y==="string"&&S6(Y)&&!X.has(Y))X.set(Y,W);for(let[z,q]of MH(G,W))Q(z,q)};Q(Z,"#");let J=(G,W)=>{let Y=W,{$id:z}=G;if(typeof z==="string"&&S6(z)){if(Y=X.get(z)??W,Y!=="#")delete G.$id}let q=G.$ref;if(typeof q==="string"){let H=q.indexOf("#"),B=H===-1?q:q.slice(0,H),F=H===-1?"":q.slice(H+1);if(B===""){if(F.startsWith("/"))G.$ref=`${Y}${F}`}else{let L=X.get(B);if(L!==void 0)G.$ref=F?`${L}${F}`:L}}for(let[H]of MH(G,Y))J(H,Y)};return J(Z,"#"),Z}function WQ($,Z){if(Array.isArray($)){for(let Q of $)WQ(Q,Z);return}if($===null||typeof $!=="object")return;let X=$;if(typeof X.$id==="string"&&S6(X.$id))Z.add(X.$id);for(let Q of Object.values(X))WQ(Q,Z)}function S6($){return/^[a-zA-Z][a-zA-Z\d+.-]*:/.test($)}function a9($){let Z=$.replaceAll("\\","/"),X=Z.startsWith("/"),Q=[];for(let J of Z.split("/")){if(J===""||J===".")continue;if(J===".."){if(Q.length>0&&Q.at(-1)!=="..")Q.pop();else if(!X)Q.push("..");continue}Q.push(J)}return(X?"/":"")+Q.join("/")}function hP($){let Z=$.lastIndexOf("/");if(Z===-1)return".";return Z===0?"/":$.slice(0,Z)}function uP($){return $ instanceof Error?$.message:String($)}function mP($){let{corePath:Z,pathsValueRefs:X}=$;return{$comment:IH,$defs:{PathsValue:{$id:J4,anyOf:[...r9,...X.map((Q)=>({$ref:Q}))]}},$schema:"https://json-schema.org/draft/2020-12/schema",allOf:[{$ref:Z}]}}async function NH($){let{baseDir:Z,coreDocumentRef:X,coreProjectRef:Q,extensions:J,loadJson:G}=$,W=[],Y=[],z=[],q=[];for(let F of J){if(F.project)W.push(F.project);if(F.document){let L=await AH(F.document,G,Z);if(Y.push(...L),L.length>0)z.push(F.document)}if(F.fields)q.push(...await AH(F.fields,G,Z)),W.push(F.fields)}let H=xP({corePath:Q,fieldSchemaRefs:q,fragments:W}),B=mP({corePath:X,pathsValueRefs:Y});return{document:s9(await o9(B,G,Z,z)),project:s9(await o9(H,G,Z))}}async function AH($,Z,X){let Q;try{Q=await Z(a9(`${a9(X)}/${$}`))}catch{return[]}let{$id:J}=Q;if(typeof J!=="string"||!Q.$defs)return[];return Object.keys(Q.$defs).map((G)=>`${J}#/$defs/${G}`)}var LH="https://jxsuite.com/schema/project/core/v2",IH="Generated by `jx schema` from project.json#/extensions — do not edit.",kP,yP,vP;var DH=s(()=>{l5();l5();kP=["additionalItems","additionalProperties","contains","contentSchema","else","if","items","not","propertyNames","then","unevaluatedItems","unevaluatedProperties"],yP=["$defs","definitions","dependencies","dependentSchemas","patternProperties","properties"],vP=["allOf","anyOf","oneOf","prefixItems"]});var CH={};m1(CH,{writeProjectSchemas:()=>EH,readBundledProjectSchemas:()=>KQ});import{existsSync as OH,readFileSync as c5,statSync as wH,writeFileSync as TH}from"node:fs";import{createRequire as p5}from"node:module";import{dirname as dP,isAbsolute as lP,relative as zQ,resolve as v1,sep as qQ}from"node:path";async function EH($){let{config:Z}=T6($),X=await R1($,Z),Q=v1($),{document:J,project:G}=await NH({baseDir:Q,coreDocumentRef:jH($,pP),coreProjectRef:jH($,cP),extensions:X.extensions.map((z)=>({document:z.schemas.document&&YQ($,z,z.schemas.document),fields:z.schemas.fields&&YQ($,z,z.schemas.fields),project:z.schemas.project&&YQ($,z,z.schemas.project)})),loadJson:RH(Q)}),W=v1($,"project.schema.json"),Y=v1($,"document.schema.json");return TH(W,`${JSON.stringify(G,null,2)}
|
|
378
|
+
`,"utf8"),TH(Y,`${JSON.stringify(J,null,2)}
|
|
379
|
+
`,"utf8"),{documentSchemaPath:Y,projectSchemaPath:W}}async function KQ($){let Z=v1($),X=v1(Z,"project.json"),Q=v1(Z,"project.schema.json"),J=v1(Z,"document.schema.json"),G=(B)=>{if(!OH(B))return!0;try{return wH(X).mtimeMs>wH(B).mtimeMs}catch{return!1}};if(G(Q)||G(J))await EH(Z);let W=RH(Z),Y=JSON.parse(c5(Q,"utf8")),z=JSON.parse(c5(J,"utf8")),q=s9(await o9(Y,W,Z));return{document:s9(await o9(z,W,Z)),project:q}}function RH($){return async(Z)=>{let X=v1(Z),Q=zQ($,X);if(Q.startsWith("..")||lP(Q))throw Error(`Schema ref "${Z}" escapes the project root ${$}`);if(OH(X))return JSON.parse(c5(X,"utf8"));let J=Q.split(qQ).join("/"),G="node_modules/",W=J.lastIndexOf(G);if(W===-1)throw Error(`Schema ref "${Z}" does not exist`);let Y=J.slice(W+G.length),z;try{z=p5(v1($,"package.json")).resolve(Y)}catch{try{z=p5(import.meta.url).resolve(Y)}catch(q){throw Error(`Schema ref "${Z}" does not exist and "${Y}" is not resolvable from the project or the host`,{cause:q})}}return JSON.parse(c5(z,"utf8"))}}function jH($,Z){let X=null;try{X=p5(v1($,"package.json")).resolve(Z)}catch{try{X=p5(import.meta.url).resolve(Z)}catch{X=null}}let Q=`./node_modules/${Z}`;return X?PH($,X,Q):Q}function YQ($,Z,X){let Q=zQ(dP(Z.manifestPath),X).split(qQ).join("/"),J=`./node_modules/${Z.specifier}/${Q}`;return PH($,X,J)}function PH($,Z,X){let Q=zQ($,Z).split(qQ).join("/");if(Q.startsWith(".."))return X;return Q.startsWith("./")?Q:`./${Q}`}var cP="@jxsuite/schema/schemas/project.core.schema.json",pP="@jxsuite/schema/schema.json";var UQ=s(()=>{DH();r1();E9()});var xH=b((np,bH)=>{var __dirname="/home/runner/work/jx/jx/node_modules/@webref/elements",SH=O0("fs").promises,_H=O0("path");async function iP({folder:$=__dirname}={}){let Z={},X=await SH.readdir($);for(let Q of X)if(Q.endsWith(".json")&&Q!=="package.json"){let J=await SH.readFile(_H.join($,Q),"utf8");Z[_H.basename(Q,".json")]=JSON.parse(J)}return Z}bH.exports={listAll:iP}});var vH=b((rp,yH)=>{var __dirname="/home/runner/work/jx/jx/node_modules/@webref/css",nP=O0("fs").promises,rP=O0("path");async function kH({folder:$=__dirname}={}){let Z=await nP.readFile(rP.join($,"css.json"),"utf8");return JSON.parse(Z)}async function aP({folder:$=__dirname}={}){let Z=await kH($),X={};for(let[Q,J]of Object.entries(Z)){X[Q]={};for(let G of J){let W=G.name,Y=null;if(G.for)Y=J.find((z)=>z!==G&&z.name===G.name);if(Y)W+=" for "+G.for[0];if(X[Q][W]=G,G.descriptors){let z=G.descriptors;G.descriptors={};for(let q of z)G.descriptors[q.name]=q}}}return X}yH.exports={listAll:kH,index:aP}});var gH=b((i5,HQ)=>{(function($,Z){typeof i5=="object"&&typeof HQ=="object"?HQ.exports=Z():typeof define=="function"&&define.amd?define([],Z):typeof i5=="object"?i5.WebIDL2=Z():$.WebIDL2=Z()})(globalThis,()=>(()=>{var $={d:(K,M)=>{for(var D in M)$.o(M,D)&&!$.o(K,D)&&Object.defineProperty(K,D,{enumerable:!0,get:M[D]})},o:(K,M)=>Object.prototype.hasOwnProperty.call(K,M),r:(K)=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(K,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(K,"__esModule",{value:!0})}},Z={};function X(K,M,D,j,O,{level:g="error",autofix:i,ruleName:Q0}={}){function L0(u$){return u$>0?K.slice(M,M+u$):K.slice(Math.max(M+u$,0),M)}function M0(u$,{precedes:h6}={}){let u1=u$.map((U9)=>U9.trivia+U9.value).join(""),K9=K[M];return K9.type==="eof"?u1:h6?u1+K9.trivia:u1.slice(K9.trivia.length)}let j0=K[M].type!=="eof"?K[M].line:K.length>1?K[M-1].line:1,b0=function(u$){let h6=u$.split(`
|
|
380
|
+
`);return h6[h6.length-1]}(M0(L0(-5),{precedes:!0})),B$=L0(5),E$=M0(B$),q9=b0+E$.split(`
|
|
382
381
|
`)[0]+`
|
|
383
|
-
`+(" ".repeat(
|
|
384
|
-
${Q9}`;return{message:`${bJ} ${T}`,bareMessage:T,context:bJ,line:j0,sourceName:U.name,level:g,ruleName:J0,autofix:i,input:O$,tokens:V$}}function Q(U,L,N,T){return X(U,L,N,T,"Syntax")}function J(U,L,N,T,O={}){return O.ruleName=N,X(L.source,U.index,L,T,"Validation",O)}$.r(Z),$.d(Z,{WebIDLParseError:()=>c0,parse:()=>p,validate:()=>c,write:()=>_});class G{constructor({source:U,tokens:L}){Object.defineProperties(this,{source:{value:U},tokens:{value:L,writable:!0},parent:{value:null,writable:!0},this:{value:this}})}toJSON(){let U={type:void 0,name:void 0,inheritance:void 0},L=this;for(;L!==Object.prototype;){let N=Object.getOwnPropertyDescriptors(L);for(let[T,O]of Object.entries(N))(O.enumerable||O.get)&&(U[T]=this[T]);L=Object.getPrototypeOf(L)}return U}}function W(U,L,{useNullableInner:N}={}){if(!U.union){let T=L.unique.get(U.idlType);if(!T)return;if(T.type==="typedef"){let{typedefIncludesDictionary:O}=L.cache;if(O.has(T))return O.get(T);L.cache.typedefIncludesDictionary.set(T,void 0);let g=W(T.idlType,L);if(L.cache.typedefIncludesDictionary.set(T,g),g)return{reference:U,dictionary:g.dictionary}}if(T.type==="dictionary"&&(N||!U.nullable))return{reference:U,dictionary:T}}for(let T of U.subtype){let O=W(T,L);if(O)return T.union?O:{reference:T,dictionary:O.dictionary}}}function Y(U,L){if(L.cache.dictionaryIncludesRequiredField.has(U))return L.cache.dictionaryIncludesRequiredField.get(U);L.cache.dictionaryIncludesRequiredField.set(U,void 0);let N=U.members.some((T)=>T.required);if(!N&&U.inheritance){let T=L.unique.get(U.inheritance);T?Y(T,L)&&(N=!0):N=!0}return L.cache.dictionaryIncludesRequiredField.set(U,N),N}class z extends Array{constructor({source:U,tokens:L}){super(),Object.defineProperties(this,{source:{value:U},tokens:{value:L},parent:{value:null,writable:!0}})}}class q extends G{static parser(U,L){return()=>{let N=U.consumeKind(L);if(N)return new q({source:U.source,tokens:{value:N}})}}get value(){return h(this.tokens.value.value)}write(U){return U.ts.wrap([U.token(this.tokens.value),U.token(this.tokens.separator)])}}class H extends q{static parse(U){let L=U.consumeKind("eof");if(L)return new H({source:U.source,tokens:{value:L}})}get type(){return"eof"}}function B(U,L){return t(U,{parser:q.parser(U,L),listName:L+" list"})}let F=["identifier","decimal","integer","string"],M=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map((U)=>[U,`Legacy${U}`]),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function A(U){for(let L of F){let N=B(U,L);if(N.length)return N}U.error("Expected identifiers, strings, decimals, or integers but none found")}class w extends G{static parse(U){let L={assign:U.consume("=")},N=e(new w({source:U.source,tokens:L}));if(N.list=[],L.assign){if(L.asterisk=U.consume("*"),L.asterisk)return N.this;L.secondaryName=U.consumeKind(...F)}return L.open=U.consume("("),L.open?(N.list=N.rhsIsList?A(U):l(U),L.close=U.consume(")")||U.error("Unexpected token in extended attribute argument list")):L.assign&&!L.secondaryName&&U.error("No right hand side to extended attribute assignment"),N.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.asterisk&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.asterisk?"*":this.tokens.secondaryName?this.tokens.secondaryName.type:null}write(U){let{rhsType:L}=this;return U.ts.wrap([U.token(this.tokens.assign),U.token(this.tokens.asterisk),U.reference_token(this.tokens.secondaryName,this.parent),U.token(this.tokens.open),...this.list.map((N)=>L==="identifier-list"?U.identifier(N,this.parent):N.write(U)),U.token(this.tokens.close)])}}class D extends G{static parse(U){let L=U.consumeKind("identifier");if(L)return new D({source:U.source,tokens:{name:L},params:w.parse(U)})}constructor({source:U,tokens:L,params:N}){super({source:U,tokens:L}),N.parent=this,Object.defineProperty(this,"params",{value:N})}get type(){return"extended-attribute"}get name(){return this.tokens.name.value}get rhs(){let{rhsType:U,tokens:L,list:N}=this.params;if(!U)return null;return{type:U,value:this.params.rhsIsList?N:this.params.tokens.secondaryName?h(L.secondaryName.value):null}}get arguments(){let{rhsIsList:U,list:L}=this.params;return!L||U?[]:L}*validate(U){let{name:L}=this;if(L==="LegacyNoInterfaceObject")yield J(this.tokens.name,this,"no-nointerfaceobject","`[LegacyNoInterfaceObject]` extended attribute is an undesirable feature that may be removed from Web IDL in the future. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more information.",{level:"warning"});else if(M.has(L)){let T=`\`[${L}]\` extended attribute is a legacy feature that is now renamed to \`[${M.get(L)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield J(this.tokens.name,this,"renamed-legacy",T,{level:"warning",autofix:(N=this,()=>{let{name:O}=N;N.tokens.name.value=M.get(O),O==="TreatNullAs"&&(N.params.tokens={})})})}var N;for(let T of this.arguments)yield*T.validate(U)}write(U){return U.ts.wrap([U.ts.trivia(this.tokens.name.trivia),U.ts.extendedAttribute(U.ts.wrap([U.ts.extendedAttributeReference(this.name),this.params.write(U)])),U.token(this.tokens.separator)])}}class j extends z{static parse(U){let L={};L.open=U.consume("[");let N=new j({source:U.source,tokens:L});return L.open?(N.push(...t(U,{parser:D.parse,listName:"extended attribute"})),L.close=U.consume("]")||U.error("Expected a closing token for the extended attribute list"),N.length||(U.unconsume(L.close.index),U.error("An extended attribute list must not be empty")),U.probe("[")&&U.error("Illegal double extended attribute lists, consider merging them"),N):N}*validate(U){for(let L of this)yield*L.validate(U)}write(U){return this.length?U.ts.wrap([U.token(this.tokens.open),...this.map((L)=>L.write(U)),U.token(this.tokens.close)]):""}}function R(U,L){let N=U.consume("?");N&&(L.tokens.nullable=N),U.probe("?")&&U.error("Can't nullable more than once")}function P(U,L){let N=function(T,O){let g=T.consume("FrozenArray","ObservableArray","Promise","async_sequence","sequence","record");if(!g)return;let i=e(new E({source:T.source,tokens:{base:g}}));switch(i.tokens.open=T.consume("<")||T.error(`No opening bracket after ${g.value}`),g.value){case"Promise":{T.probe("[")&&T.error("Promise type cannot have extended attribute");let J0=V0(T,O)||T.error("Missing Promise subtype");i.subtype.push(J0);break}case"async_sequence":case"sequence":case"FrozenArray":case"ObservableArray":{let J0=K0(T,O)||T.error(`Missing ${g.value} subtype`);i.subtype.push(J0);break}case"record":{T.probe("[")&&T.error("Record key cannot have extended attribute");let J0=T.consume(...N0)||T.error(`Record key must be one of: ${N0.join(", ")}`),F0=new E({source:T.source,tokens:{base:J0}});F0.tokens.separator=T.consume(",")||T.error("Missing comma after record key type"),F0.type=O;let L0=K0(T,O)||T.error("Error parsing generic type record");i.subtype.push(F0,L0);break}}return i.idlType||T.error(`Error parsing generic type ${g.value}`),i.tokens.close=T.consume(">")||T.error(`Missing closing bracket after ${g.value}`),i.this}(U,L)||A0(U);if(!N){let T=U.consumeKind("identifier")||U.consume(...N0,...U0);if(!T)return;N=new E({source:U.source,tokens:{base:T}}),U.probe("<")&&U.error(`Unsupported generic type ${T.value}`)}return N.generic==="Promise"&&U.probe("?")&&U.error("Promise type cannot be nullable"),N.type=L||null,R(U,N),N.nullable&&N.idlType==="any"&&U.error("Type `any` cannot be made nullable"),N}class E extends G{static parse(U,L){return P(U,L)||function(N,T){let O={};if(O.open=N.consume("("),!O.open)return;let g=e(new E({source:N.source,tokens:O}));for(g.type=T||null;;){let i=K0(N,T)||N.error("No type after open parenthesis or 'or' in union type");i.idlType==="any"&&N.error("Type `any` cannot be included in a union type"),i.generic==="Promise"&&N.error("Type `Promise` cannot be included in a union type"),g.subtype.push(i);let J0=N.consume("or");if(!J0)break;i.tokens.separator=J0}return g.idlType.length<2&&N.error("At least two types are expected in a union type but found less"),O.close=N.consume(")")||N.error("Unterminated union type"),R(N,g),g.this}(U,L)}constructor({source:U,tokens:L}){super({source:U,tokens:L}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new j({source:U,tokens:{}})}get generic(){return this.subtype.length&&this.tokens.base?this.tokens.base.value:""}get nullable(){return Boolean(this.tokens.nullable)}get union(){return Boolean(this.subtype.length)&&!this.tokens.base}get idlType(){if(this.subtype.length)return this.subtype;return h([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter((U)=>U).map((U)=>U.value).join(" "))}*validate(U){if(yield*this.extAttrs.validate(U),this.idlType==="BufferSource")for(let O of[this.extAttrs,this.parent?.extAttrs])for(let g of O){if(g.name!=="AllowShared")continue;let i="`[AllowShared] BufferSource` is now replaced with AllowSharedBufferSource.";yield J(this.tokens.base,this,"migrate-allowshared",i,{autofix:C(this,g,O)})}if(this.idlType==="void")yield J(this.tokens.base,this,"replace-void","`void` is now replaced by `undefined`. Refer to the [relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) for more information.",{autofix:(L=this,()=>{L.tokens.base.value="undefined"})});var L;let N=!this.union&&U.unique.get(this.idlType),T=this.union?this:N&&N.type==="typedef"?N.idlType:void 0;if(T&&this.nullable){let{reference:O}=W(T,U)||{};if(O){let g=(this.union?O:this).tokens.base;yield J(g,this,"no-nullable-union-dict","Nullable union cannot include a dictionary type.")}}else for(let O of this.subtype)yield*O.validate(U)}write(U){return U.ts.wrap([this.extAttrs.write(U),(()=>{if(this.union||this.generic)return U.ts.wrap([U.token(this.tokens.base,U.ts.generic),U.token(this.tokens.open),...this.subtype.map((O)=>O.write(U)),U.token(this.tokens.close)]);let L=this.tokens.prefix||this.tokens.base,N=this.tokens.prefix?[this.tokens.prefix.value,U.ts.trivia(this.tokens.base.trivia)]:[],T=U.reference(U.ts.wrap([...N,this.tokens.base.value,U.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return U.ts.wrap([U.ts.trivia(L.trivia),T])})(),U.token(this.tokens.nullable),U.token(this.tokens.separator)])}}function C(U,L,N){return()=>{let T=N.indexOf(L);N.splice(T,1),!N.length&&U.tokens.base.trivia.match(/^\s$/)&&(U.tokens.base.trivia=""),U.tokens.base.value="AllowSharedBufferSource"}}class y extends G{static parse(U){let L=U.consume("=");if(!L)return null;let N=Y0(U)||U.consumeKind("string")||U.consume("null","[","{")||U.error("No value for default"),T=[N];if(N.value==="["){let O=U.consume("]")||U.error("Default sequence value must be empty");T.push(O)}else if(N.value==="{"){let O=U.consume("}")||U.error("Default dictionary value must be empty");T.push(O)}return new y({source:U.source,tokens:{assign:L},expression:T})}constructor({source:U,tokens:L,expression:N}){super({source:U,tokens:L}),N.parent=this,Object.defineProperty(this,"expression",{value:N})}get type(){return G0(this.expression[0]).type}get value(){return G0(this.expression[0]).value}get negative(){return G0(this.expression[0]).negative}write(U){return U.ts.wrap([U.token(this.tokens.assign),...this.expression.map((L)=>U.token(L))])}}class v extends G{static parse(U){let L=U.position,N={},T=e(new v({source:U.source,tokens:N}));return T.extAttrs=j.parse(U),N.optional=U.consume("optional"),T.idlType=K0(U,"argument-type"),T.idlType?(N.optional||(N.variadic=U.consume("...")),N.name=U.consumeKind("identifier")||U.consume(...Q0),N.name?(T.default=N.optional?y.parse(U):null,T.this):U.unconsume(L)):U.unconsume(L)}get type(){return"argument"}get optional(){return!!this.tokens.optional}get variadic(){return!!this.tokens.variadic}get name(){return h(this.tokens.name.value)}*validate(U){yield*this.extAttrs.validate(U),yield*this.idlType.validate(U);let L=W(this.idlType,U,{useNullableInner:!0});if(L){if(this.idlType.nullable)yield J(this.tokens.name,this,"no-nullable-dict-arg","Dictionary arguments cannot be nullable.");else if(this.optional){if(!this.default)yield J(this.tokens.name,this,"dict-arg-default","Optional dictionary arguments must have a default value of `{}`.",{autofix:m(this)})}else if(this.parent&&!Y(L.dictionary,U)&&function(T){let O=T.parent.arguments||T.parent.list,g=O.indexOf(T);return!O.slice(g+1).some((J0)=>!J0.optional)}(this))yield J(this.tokens.name,this,"dict-arg-optional","Dictionary argument must be optional if it has no required fields",{autofix:(N=this,()=>{let O=X0(N.idlType);N.tokens.optional={...O,type:"optional",value:"optional"},O.trivia=" ",m(N)()})})}var N}write(U){return U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.optional),U.ts.type(this.idlType.write(U)),U.token(this.tokens.variadic),U.name_token(this.tokens.name,{data:this}),this.default?this.default.write(U):"",U.token(this.tokens.separator)])}}function m(U){return()=>{U.default=y.parse(new v0(" = {}"))}}class Z0 extends G{static parse(U,{special:L,regular:N}={}){let T={special:L},O=e(new Z0({source:U.source,tokens:T}));return L&&L.value==="stringifier"&&(T.termination=U.consume(";"),T.termination)?(O.arguments=[],O):(L||N||(T.special=U.consume("getter","setter","deleter")),O.idlType=V0(U)||U.error("Missing return type"),T.name=U.consumeKind("identifier")||U.consume("includes"),T.open=U.consume("(")||U.error("Invalid operation"),O.arguments=l(U),T.close=U.consume(")")||U.error("Unterminated operation"),T.termination=U.consume(";")||U.error("Unterminated operation, expected `;`"),O.this)}get type(){return"operation"}get name(){let{name:U}=this.tokens;return U?h(U.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(U){if(yield*this.extAttrs.validate(U),!this.name&&["","static"].includes(this.special))yield J(this.tokens.open,this,"incomplete-op","Regular or static operations must have both a return type and an identifier.");if(this.idlType){if(this.idlType.generic==="async_sequence")yield J(this.idlType.tokens.base,this,"async-sequence-idl-to-js","async_sequence types cannot be returned by an operation.");yield*this.idlType.validate(U)}for(let L of this.arguments)yield*L.validate(U)}write(U){let{parent:L}=this,N=this.idlType?[U.ts.type(this.idlType.write(U)),U.name_token(this.tokens.name,{data:this,parent:L}),U.token(this.tokens.open),U.ts.wrap(this.arguments.map((T)=>T.write(U))),U.token(this.tokens.close)]:[];return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),this.tokens.name?U.token(this.tokens.special):U.token(this.tokens.special,U.ts.nameless,{data:this,parent:L}),...N,U.token(this.tokens.termination)]),{data:this,parent:L})}}class r extends G{static parse(U,{special:L,noInherit:N=!1,readonly:T=!1}={}){let O=U.position,g={special:L},i=e(new r({source:U.source,tokens:g}));if(L||N||(g.special=U.consume("inherit")),i.special==="inherit"&&U.probe("readonly")&&U.error("Inherited attributes cannot be read-only"),g.readonly=U.consume("readonly"),T&&!g.readonly&&U.probe("attribute")&&U.error("Attributes must be readonly in this context"),g.base=U.consume("attribute"),g.base)return i.idlType=K0(U,"attribute-type")||U.error("Attribute lacks a type"),g.name=U.consumeKind("identifier")||U.consume("async","required")||U.error("Attribute lacks a name"),g.termination=U.consume(";")||U.error("Unterminated attribute, expected `;`"),i.this;U.unconsume(O)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return h(this.tokens.name.value)}*validate(U){if(yield*this.extAttrs.validate(U),yield*this.idlType.validate(U),["async_sequence","sequence","record"].includes(this.idlType.generic)){let L=`Attributes cannot accept ${this.idlType.generic} types.`;yield J(this.tokens.name,this,"attr-invalid-type",L)}{let{reference:L}=W(this.idlType,U)||{};if(L){let N=(this.idlType.union?L:this.idlType).tokens.base;yield J(N,this,"attr-invalid-type","Attributes cannot accept dictionary types.")}}if(this.readonly&&function(L,N){if(L.union)return!1;if(L.extAttrs.some((O)=>O.name==="EnforceRange"))return!0;let T=N.unique.get(L.idlType);return T?.type==="typedef"&&T.idlType.extAttrs.some((O)=>O.name==="EnforceRange")}(this.idlType,U)){let L=this.idlType.tokens.base;yield J(L,this,"attr-invalid-type","Readonly attributes cannot accept [EnforceRange] extended attribute.")}}write(U){let{parent:L}=this;return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.special),U.token(this.tokens.readonly),U.token(this.tokens.base),U.ts.type(this.idlType.write(U)),U.name_token(this.tokens.name,{data:this,parent:L}),U.token(this.tokens.termination)]),{data:this,parent:L})}}function h(U){return U.startsWith("_")?U.slice(1):U}function t(U,{parser:L,allowDangler:N,listName:T="list"}){let O=L(U);if(!O)return[];O.tokens.separator=U.consume(",");let g=[O];for(;O.tokens.separator;){let i=L(U);if(!i){N||U.error(`Trailing comma in ${T}`);break}if(i.tokens.separator=U.consume(","),g.push(i),!i.tokens.separator)break}return g}function Y0(U){return U.consumeKind("decimal","integer")||U.consume("true","false","Infinity","-Infinity","NaN")}function G0({type:U,value:L}){switch(U){case"decimal":case"integer":return{type:"number",value:L};case"string":return{type:"string",value:L.slice(1,-1)}}switch(L){case"true":case"false":return{type:"boolean",value:L==="true"};case"Infinity":case"-Infinity":return{type:"Infinity",negative:L.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:L}}}function A0(U){let{source:L}=U,N=function(){let O=U.consume("unsigned"),g=U.consume("short","long");if(g){let i=U.consume("long");return new E({source:L,tokens:{prefix:O,base:g,postfix:i}})}O&&U.error("Failed to parse integer type")}()||function(){let O=U.consume("unrestricted"),g=U.consume("float","double");if(g)return new E({source:L,tokens:{prefix:O,base:g}});O&&U.error("Failed to parse float type")}();if(N)return N;let T=U.consume("bigint","boolean","byte","octet","undefined");return T?new E({source:L,tokens:{base:T}}):void 0}function l(U){return t(U,{parser:v.parse,listName:"arguments list"})}function K0(U,L){let N=j.parse(U),T=E.parse(U,L);return T&&(e(T).extAttrs=N),T}function V0(U,L){let N=E.parse(U,L||"return-type");if(N)return N;let T=U.consume("void");if(T){let O=new E({source:U.source,tokens:{base:T}});return O.type="return-type",O}}function o(U){let L=U.consume("stringifier");if(!L)return;return r.parse(U,{special:L})||Z0.parse(U,{special:L})||U.error("Unterminated stringifier")}function f(U){let L=U.split(`
|
|
385
|
-
`);if(
|
|
386
|
-
${f(L)}`}}}function X0(U){if(U.extAttrs.length)return U.extAttrs.tokens.open;if(U.type==="operation"&&!U.special)return X0(U.idlType);return Object.values(U.tokens).sort((L,N)=>L.index-N.index)[0]}function e(U,L){if(L||(L=U),!U)return U;return new Proxy(U,{get(N,T){let O=N[T];return Array.isArray(O)&&T!=="source"?e(O,N):O},set(N,T,O){if(N[T]=O,!O)return!0;if(Array.isArray(O))for(let g of O)g.parent!==void 0&&(g.parent=L);else O.parent!==void 0&&(O.parent=L);return!0}})}let M0={decimal:/-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,integer:/-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,identifier:/[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,string:/"[^"]*"/y,whitespace:/[\t\n\r ]+/y,comment:/\/\/.*|\/\*[\s\S]*?\*\//y,other:/[^\t\n\r 0-9A-Za-z]/y},U0=["ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","Float16Array","Float32Array","Float64Array","any","object","symbol"],N0=["ByteString","DOMString","USVString"],Q0=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],X$=["-Infinity","FrozenArray","Infinity","NaN","ObservableArray","Promise","async_iterable","async_sequence","bigint","boolean","byte","double","false","float","long","mixin","null","octet","optional","or","readonly","record","sequence","short","true","undefined","unsigned","void"].concat(Q0,N0,U0),P0=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],t0=["_constructor","toString","_toString"];class v0{constructor(U){this.source=function(L){let N=[],T=0,O="",g=1,i=0;for(;T<L.length;){let F0=L.charAt(T),L0=-1;if(/[\t\n\r ]/.test(F0)?L0=J0("whitespace",{noFlushTrivia:!0}):F0==="/"&&(L0=J0("comment",{noFlushTrivia:!0})),L0!==-1){let j0=N.pop().value;g+=(j0.match(/\n/g)||[]).length,O+=j0,i-=1}else if(/[-0-9.A-Z_a-z]/.test(F0)){if(L0=J0("decimal"),L0===-1&&(L0=J0("integer")),L0===-1){L0=J0("identifier");let j0=N.length-1,x0=N[j0];if(L0!==-1){if(t0.includes(x0.value)){let V$=`${h(x0.value)} is a reserved identifier and must not be used.`;throw new c0(Q(N,j0,null,V$))}X$.includes(x0.value)&&(x0.type="inline")}}}else F0==='"'&&(L0=J0("string"));for(let j0 of P0)if(L.startsWith(j0,T)){N.push({type:"inline",value:j0,trivia:O,line:g,index:i}),O="",T+=j0.length,L0=T;break}if(L0===-1&&(L0=J0("other")),L0===-1)throw Error("Token stream not progressing");T=L0,i+=1}return N.push({type:"eof",value:"",trivia:O,line:g,index:i}),N;function J0(F0,{noFlushTrivia:L0}={}){let j0=M0[F0];j0.lastIndex=T;let x0=j0.exec(L);return x0?(N.push({type:F0,value:x0[0],trivia:O,line:g,index:i}),L0||(O=""),j0.lastIndex):-1}}(U),this.position=0}error(U){throw new c0(Q(this.source,this.position,this.current,U))}probeKind(U){return this.source.length>this.position&&this.source[this.position].type===U}probe(U){return this.probeKind("inline")&&this.source[this.position].value===U}consumeKind(...U){for(let L of U){if(!this.probeKind(L))continue;let N=this.source[this.position];return this.position++,N}}consume(...U){if(!this.probeKind("inline"))return;let L=this.source[this.position];for(let N of U)if(L.value===N)return this.position++,L}consumeIdentifier(U){if(this.probeKind("identifier")&&this.source[this.position].value===U)return this.consumeKind("identifier")}unconsume(U){this.position=U}}class c0 extends Error{constructor({message:U,bareMessage:L,context:N,line:T,sourceName:O,input:g,tokens:i}){super(U),this.name="WebIDLParseError",this.bareMessage=L,this.context=N,this.line=T,this.sourceName=O,this.input=g,this.tokens=i}}class j$ extends q{static parse(U){let L=U.consumeKind("string");if(L)return new j$({source:U.source,tokens:{value:L}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}write(U){let{parent:L}=this;return U.ts.wrap([U.ts.trivia(this.tokens.value.trivia),U.ts.definition(U.ts.wrap(['"',U.ts.name(this.value,{data:this,parent:L}),'"']),{data:this,parent:L}),U.token(this.tokens.separator)])}}class q$ extends G{static parse(U){let L={};if(L.base=U.consume("enum"),!L.base)return;L.name=U.consumeKind("identifier")||U.error("No name for enum");let N=e(new q$({source:U.source,tokens:L}));return U.current=N.this,L.open=U.consume("{")||U.error("Bodyless enum"),N.values=t(U,{parser:j$.parse,allowDangler:!0,listName:"enumeration"}),U.probeKind("string")&&U.error("No comma between enum values"),L.close=U.consume("}")||U.error("Unexpected value in enum"),N.values.length||U.error("No value in enum"),L.termination=U.consume(";")||U.error("No semicolon after enum"),N.this}get type(){return"enum"}get name(){return h(this.tokens.name.value)}write(U){return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.base),U.name_token(this.tokens.name,{data:this}),U.token(this.tokens.open),U.ts.wrap(this.values.map((L)=>L.write(U))),U.token(this.tokens.close),U.token(this.tokens.termination)]),{data:this})}}class L6 extends G{static parse(U){let L=U.consumeKind("identifier");if(!L)return;let N={target:L};if(N.includes=U.consume("includes"),N.includes)return N.mixin=U.consumeKind("identifier")||U.error("Incomplete includes statement"),N.termination=U.consume(";")||U.error("No terminating ; for includes statement"),new L6({source:U.source,tokens:N});U.unconsume(L.index)}get type(){return"includes"}get target(){return h(this.tokens.target.value)}get includes(){return h(this.tokens.mixin.value)}write(U){return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.reference_token(this.tokens.target,this),U.token(this.tokens.includes),U.reference_token(this.tokens.mixin,this),U.token(this.tokens.termination)]),{data:this})}}class M6 extends G{static parse(U){let L={},N=e(new M6({source:U.source,tokens:L}));if(L.base=U.consume("typedef"),L.base)return N.idlType=K0(U,"typedef-type")||U.error("Typedef lacks a type"),L.name=U.consumeKind("identifier")||U.error("Typedef lacks a name"),U.current=N.this,L.termination=U.consume(";")||U.error("Unterminated typedef, expected `;`"),N.this}get type(){return"typedef"}get name(){return h(this.tokens.name.value)}*validate(U){yield*this.idlType.validate(U)}write(U){return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.base),U.ts.type(this.idlType.write(U)),U.name_token(this.tokens.name,{data:this}),U.token(this.tokens.termination)]),{data:this})}}class g$ extends G{static parse(U,L){let N={base:L},T=e(new g$({source:U.source,tokens:N}));return N.name=U.consumeKind("identifier")||U.error("Callback lacks a name"),U.current=T.this,N.assign=U.consume("=")||U.error("Callback lacks an assignment"),T.idlType=V0(U)||U.error("Callback lacks a return type"),N.open=U.consume("(")||U.error("Callback lacks parentheses for arguments"),T.arguments=l(U),N.close=U.consume(")")||U.error("Unterminated callback"),N.termination=U.consume(";")||U.error("Unterminated callback, expected `;`"),T.this}get type(){return"callback"}get name(){return h(this.tokens.name.value)}*validate(U){yield*this.extAttrs.validate(U);for(let L of this.arguments)if(yield*L.validate(U),L.idlType.generic==="async_sequence")yield J(L.tokens.name,L,"async-sequence-idl-to-js","async_sequence types cannot be returned as a callback argument.");yield*this.idlType.validate(U)}write(U){return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.base),U.name_token(this.tokens.name,{data:this}),U.token(this.tokens.assign),U.ts.type(this.idlType.write(U)),U.token(this.tokens.open),...this.arguments.map((L)=>L.write(U)),U.token(this.tokens.close),U.token(this.tokens.termination)]),{data:this})}}class U$ extends G{static parse(U,L,{inheritable:N,allowedMembers:T}){let{tokens:O,type:g}=L;for(O.name=U.consumeKind("identifier")||U.error(`Missing name in ${g}`),U.current=L,L=e(L),N&&Object.assign(O,function(i){let J0=i.consume(":");return J0?{colon:J0,inheritance:i.consumeKind("identifier")||i.error("Inheritance lacks a type")}:{}}(U)),O.open=U.consume("{")||U.error(`Bodyless ${g}`),L.members=[];;){if(O.close=U.consume("}"),O.close)return O.termination=U.consume(";")||U.error(`Missing semicolon after ${g}`),L.this;let i=j.parse(U),J0;for(let[F0,...L0]of T)if(J0=e(F0(U,...L0)),J0)break;J0||U.error("Unknown member"),J0.extAttrs=i,L.members.push(J0.this)}}get partial(){return!!this.tokens.partial}get name(){return h(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?h(this.tokens.inheritance.value):null}*validate(U){for(let L of this.members)L.validate&&(yield*L.validate(U))}write(U){return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.callback),U.token(this.tokens.partial),U.token(this.tokens.base),U.token(this.tokens.mixin),U.name_token(this.tokens.name,{data:this}),(()=>this.tokens.inheritance?U.ts.wrap([U.token(this.tokens.colon),U.ts.trivia(this.tokens.inheritance.trivia),U.ts.inheritance(U.reference(this.tokens.inheritance.value,{context:this}))]):"")(),U.token(this.tokens.open),U.ts.wrap(this.members.map((L)=>L.write(U))),U.token(this.tokens.close),U.token(this.tokens.termination)]),{data:this})}}class A6 extends G{static parse(U){let L={};if(L.base=U.consume("const"),!L.base)return;let N=A0(U);if(!N){let O=U.consumeKind("identifier")||U.error("Const lacks a type");N=new E({source:U.source,tokens:{base:O}})}U.probe("?")&&U.error("Unexpected nullable constant type"),N.type="const-type",L.name=U.consumeKind("identifier")||U.error("Const lacks a name"),L.assign=U.consume("=")||U.error("Const lacks value assignment"),L.value=Y0(U)||U.error("Const lacks a value"),L.termination=U.consume(";")||U.error("Unterminated const, expected `;`");let T=new A6({source:U.source,tokens:L});return e(T).idlType=N,T}get type(){return"const"}get name(){return h(this.tokens.name.value)}get value(){return G0(this.tokens.value)}write(U){let{parent:L}=this;return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.base),U.ts.type(this.idlType.write(U)),U.name_token(this.tokens.name,{data:this,parent:L}),U.token(this.tokens.assign),U.token(this.tokens.value),U.token(this.tokens.termination)]),{data:this,parent:L})}}class G1 extends G{static parse(U){let L=U.position,N=e(new G1({source:U.source,tokens:{}})),{tokens:T}=N;if(T.readonly=U.consume("readonly"),T.readonly||(T.async=U.consume("async")),T.base=T.readonly?U.consume("maplike","setlike"):T.async?U.consume("iterable"):U.consume("iterable","async_iterable","maplike","setlike"),!T.base)return void U.unconsume(L);let{type:O}=N,g=O==="maplike",i=g||O==="iterable"||O==="async_iterable",J0=O==="async_iterable"||N.async&&O==="iterable";T.open=U.consume("<")||U.error(`Missing less-than sign \`<\` in ${O} declaration`);let F0=K0(U)||U.error(`Missing a type argument in ${O} declaration`);return N.idlType=[F0],N.arguments=[],i&&(F0.tokens.separator=U.consume(","),F0.tokens.separator?N.idlType.push(K0(U)):g&&U.error(`Missing second type argument in ${O} declaration`)),T.close=U.consume(">")||U.error(`Missing greater-than sign \`>\` in ${O} declaration`),U.probe("(")&&(J0?(T.argsOpen=U.consume("("),N.arguments.push(...l(U)),T.argsClose=U.consume(")")||U.error("Unterminated async iterable argument list")):U.error("Arguments are only allowed for `async iterable`")),T.termination=U.consume(";")||U.error(`Missing semicolon after ${O} declaration`),N.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}*validate(U){if(this.async&&this.type==="iterable")yield J(this.tokens.async,this,"obsolete-async-iterable-syntax","`async iterable` is now changed to `async_iterable`.",{autofix:(L=this,()=>{let T=L.tokens.async;L.tokens.base={...T,type:"async_iterable",value:"async_iterable"},delete L.tokens.async})});var L;for(let N of this.idlType)yield*N.validate(U);for(let N of this.arguments)yield*N.validate(U)}write(U){return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.readonly),U.token(this.tokens.async),U.token(this.tokens.base,U.ts.generic),U.token(this.tokens.open),U.ts.wrap(this.idlType.map((L)=>L.write(U))),U.token(this.tokens.close),U.token(this.tokens.argsOpen),U.ts.wrap(this.arguments.map((L)=>L.write(U))),U.token(this.tokens.argsClose),U.token(this.tokens.termination)]),{data:this,parent:this.parent})}}class g6 extends G{static parse(U){let L=U.consume("constructor");if(!L)return;let N={base:L};N.open=U.consume("(")||U.error("No argument list in constructor");let T=l(U);N.close=U.consume(")")||U.error("Unterminated constructor"),N.termination=U.consume(";")||U.error("No semicolon after constructor");let O=new g6({source:U.source,tokens:N});return e(O).arguments=T,O}get type(){return"constructor"}*validate(U){for(let L of this.arguments)yield*L.validate(U)}write(U){let{parent:L}=this;return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.base,U.ts.nameless,{data:this,parent:L}),U.token(this.tokens.open),U.ts.wrap(this.arguments.map((N)=>N.write(U))),U.token(this.tokens.close),U.token(this.tokens.termination)]),{data:this,parent:L})}}function Z9(U){let L=U.consume("static");if(!L)return;return r.parse(U,{special:L})||Z0.parse(U,{special:L})||U.error("No body in static member")}class f$ extends U${static parse(U,L,{extMembers:N=[],partial:T=null}={}){let O={partial:T,base:L};return U$.parse(U,new f$({source:U.source,tokens:O}),{inheritable:!T,allowedMembers:[...N,[A6.parse],[g6.parse],[Z9],[o],[G1.parse],[r.parse],[Z0.parse]]})}get type(){return"interface"}*validate(U){if(yield*this.extAttrs.validate(U),!this.partial&&this.extAttrs.every((N)=>N.name!=="Exposed"))yield J(this.tokens.name,this,"require-exposed","Interfaces must have `[Exposed]` extended attribute. To fix, add, for example, `[Exposed=Window]`. Please also consider carefully if your interface should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.",{autofix:$0(this)});let L=this.extAttrs.filter((N)=>N.name==="Constructor");for(let N of L)yield J(N.tokens.name,this,"constructor-member","Constructors should now be represented as a `constructor()` operation on the interface instead of `[Constructor]` extended attribute. Refer to the [WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) for more information.",{autofix:X9(this,N)});if(this.extAttrs.some((N)=>N.name==="Global")){let N=this.extAttrs.filter((O)=>O.name==="LegacyFactoryFunction");for(let O of N)yield J(O.tokens.name,this,"no-constructible-global","Interfaces marked as `[Global]` cannot have factory functions.");let T=this.members.filter((O)=>O.type==="constructor");for(let O of T)yield J(O.tokens.base,this,"no-constructible-global","Interfaces marked as `[Global]` cannot have constructors.")}yield*super.validate(U),this.partial||(yield*function*(N,T){let O=function(L0){let j0=F0(L0);return{statics:new Set(j0.filter((x0)=>x0.special==="static").map((x0)=>x0.name)),nonstatics:new Set(j0.filter((x0)=>x0.special!=="static").map((x0)=>x0.name))}}(T),g=N.partials.get(T.name)||[],i=N.mixinMap.get(T.name)||[];for(let L0 of[...g,...i]){let j0=F0(L0),x0=j0.filter((O$)=>O$.special==="static"),V$=j0.filter((O$)=>O$.special!=="static");yield*J0(x0,O.statics,L0,T),yield*J0(V$,O.nonstatics,L0,T),x0.forEach((O$)=>O.statics.add(O$.name)),V$.forEach((O$)=>O.nonstatics.add(O$.name))}function*J0(L0,j0,x0,V$){for(let O$ of L0){let{name:Q9}=O$;if(Q9&&j0.has(Q9)){let TZ=`The ${O$.special==="static"?"static ":""}operation "${Q9}" has already been defined for the base interface "${V$.name}" either in itself or in a mixin`;yield J(O$.tokens.name,x0,"no-cross-overload",TZ)}}}function F0(L0){return L0.members.filter(({type:j0})=>j0==="operation")}}(U,this))}}function X9(U,L){return U=e(U),()=>{let N=f(U.extAttrs.tokens.open.trivia),T=U.members.length?f(X0(U.members[0]).trivia):function(j0){let x0=f(j0),V$=x0.includes("\t")?"\t":" ";return x0+V$}(N),O=g6.parse(new v0(`
|
|
387
|
-
${
|
|
382
|
+
`+(" ".repeat(b0.length)+"^"),xZ=O==="Syntax"?"since":"inside",lJ=`${O} error at line ${j0}${K.name?` in ${K.name}`:""}${D&&D.name?`, ${xZ} \`${D.partial?"partial ":""}${function(u$){let h6=[u$];for(;u$&&u$.parent;){let{parent:u1}=u$;h6.unshift(u1),u$=u1}return h6.map((u1)=>function(K9,U9){let cJ=K9;return U9&&(cJ+=` ${U9}`),cJ}(u1.type,u1.name)).join(" -> ")}(D)}\``:""}:
|
|
383
|
+
${q9}`;return{message:`${lJ} ${j}`,bareMessage:j,context:lJ,line:j0,sourceName:K.name,level:g,ruleName:Q0,autofix:i,input:E$,tokens:B$}}function Q(K,M,D,j){return X(K,M,D,j,"Syntax")}function J(K,M,D,j,O={}){return O.ruleName=D,X(M.source,K.index,M,j,"Validation",O)}$.r(Z),$.d(Z,{WebIDLParseError:()=>i0,parse:()=>p,validate:()=>c,write:()=>_});class G{constructor({source:K,tokens:M}){Object.defineProperties(this,{source:{value:K},tokens:{value:M,writable:!0},parent:{value:null,writable:!0},this:{value:this}})}toJSON(){let K={type:void 0,name:void 0,inheritance:void 0},M=this;for(;M!==Object.prototype;){let D=Object.getOwnPropertyDescriptors(M);for(let[j,O]of Object.entries(D))(O.enumerable||O.get)&&(K[j]=this[j]);M=Object.getPrototypeOf(M)}return K}}function W(K,M,{useNullableInner:D}={}){if(!K.union){let j=M.unique.get(K.idlType);if(!j)return;if(j.type==="typedef"){let{typedefIncludesDictionary:O}=M.cache;if(O.has(j))return O.get(j);M.cache.typedefIncludesDictionary.set(j,void 0);let g=W(j.idlType,M);if(M.cache.typedefIncludesDictionary.set(j,g),g)return{reference:K,dictionary:g.dictionary}}if(j.type==="dictionary"&&(D||!K.nullable))return{reference:K,dictionary:j}}for(let j of K.subtype){let O=W(j,M);if(O)return j.union?O:{reference:j,dictionary:O.dictionary}}}function Y(K,M){if(M.cache.dictionaryIncludesRequiredField.has(K))return M.cache.dictionaryIncludesRequiredField.get(K);M.cache.dictionaryIncludesRequiredField.set(K,void 0);let D=K.members.some((j)=>j.required);if(!D&&K.inheritance){let j=M.unique.get(K.inheritance);j?Y(j,M)&&(D=!0):D=!0}return M.cache.dictionaryIncludesRequiredField.set(K,D),D}class z extends Array{constructor({source:K,tokens:M}){super(),Object.defineProperties(this,{source:{value:K},tokens:{value:M},parent:{value:null,writable:!0}})}}class q extends G{static parser(K,M){return()=>{let D=K.consumeKind(M);if(D)return new q({source:K.source,tokens:{value:D}})}}get value(){return u(this.tokens.value.value)}write(K){return K.ts.wrap([K.token(this.tokens.value),K.token(this.tokens.separator)])}}class H extends q{static parse(K){let M=K.consumeKind("eof");if(M)return new H({source:K.source,tokens:{value:M}})}get type(){return"eof"}}function B(K,M){return t(K,{parser:q.parser(K,M),listName:M+" list"})}let F=["identifier","decimal","integer","string"],L=new Map([...["NoInterfaceObject","LenientSetter","LenientThis","TreatNonObjectAsNull","Unforgeable"].map((K)=>[K,`Legacy${K}`]),["NamedConstructor","LegacyFactoryFunction"],["OverrideBuiltins","LegacyOverrideBuiltIns"],["TreatNullAs","LegacyNullToEmptyString"]]);function w(K){for(let M of F){let D=B(K,M);if(D.length)return D}K.error("Expected identifiers, strings, decimals, or integers but none found")}class N extends G{static parse(K){let M={assign:K.consume("=")},D=$0(new N({source:K.source,tokens:M}));if(D.list=[],M.assign){if(M.asterisk=K.consume("*"),M.asterisk)return D.this;M.secondaryName=K.consumeKind(...F)}return M.open=K.consume("("),M.open?(D.list=D.rhsIsList?w(K):l(K),M.close=K.consume(")")||K.error("Unexpected token in extended attribute argument list")):M.assign&&!M.secondaryName&&K.error("No right hand side to extended attribute assignment"),D.this}get rhsIsList(){return this.tokens.assign&&!this.tokens.asterisk&&!this.tokens.secondaryName}get rhsType(){return this.rhsIsList?this.list[0].tokens.value.type+"-list":this.tokens.asterisk?"*":this.tokens.secondaryName?this.tokens.secondaryName.type:null}write(K){let{rhsType:M}=this;return K.ts.wrap([K.token(this.tokens.assign),K.token(this.tokens.asterisk),K.reference_token(this.tokens.secondaryName,this.parent),K.token(this.tokens.open),...this.list.map((D)=>M==="identifier-list"?K.identifier(D,this.parent):D.write(K)),K.token(this.tokens.close)])}}class I extends G{static parse(K){let M=K.consumeKind("identifier");if(M)return new I({source:K.source,tokens:{name:M},params:N.parse(K)})}constructor({source:K,tokens:M,params:D}){super({source:K,tokens:M}),D.parent=this,Object.defineProperty(this,"params",{value:D})}get type(){return"extended-attribute"}get name(){return this.tokens.name.value}get rhs(){let{rhsType:K,tokens:M,list:D}=this.params;if(!K)return null;return{type:K,value:this.params.rhsIsList?D:this.params.tokens.secondaryName?u(M.secondaryName.value):null}}get arguments(){let{rhsIsList:K,list:M}=this.params;return!M||K?[]:M}*validate(K){let{name:M}=this;if(M==="LegacyNoInterfaceObject")yield J(this.tokens.name,this,"no-nointerfaceobject","`[LegacyNoInterfaceObject]` extended attribute is an undesirable feature that may be removed from Web IDL in the future. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/609) for more information.",{level:"warning"});else if(L.has(M)){let j=`\`[${M}]\` extended attribute is a legacy feature that is now renamed to \`[${L.get(M)}]\`. Refer to the [relevant upstream PR](https://github.com/whatwg/webidl/pull/870) for more information.`;yield J(this.tokens.name,this,"renamed-legacy",j,{level:"warning",autofix:(D=this,()=>{let{name:O}=D;D.tokens.name.value=L.get(O),O==="TreatNullAs"&&(D.params.tokens={})})})}var D;for(let j of this.arguments)yield*j.validate(K)}write(K){return K.ts.wrap([K.ts.trivia(this.tokens.name.trivia),K.ts.extendedAttribute(K.ts.wrap([K.ts.extendedAttributeReference(this.name),this.params.write(K)])),K.token(this.tokens.separator)])}}class T extends z{static parse(K){let M={};M.open=K.consume("[");let D=new T({source:K.source,tokens:M});return M.open?(D.push(...t(K,{parser:I.parse,listName:"extended attribute"})),M.close=K.consume("]")||K.error("Expected a closing token for the extended attribute list"),D.length||(K.unconsume(M.close.index),K.error("An extended attribute list must not be empty")),K.probe("[")&&K.error("Illegal double extended attribute lists, consider merging them"),D):D}*validate(K){for(let M of this)yield*M.validate(K)}write(K){return this.length?K.ts.wrap([K.token(this.tokens.open),...this.map((M)=>M.write(K)),K.token(this.tokens.close)]):""}}function E(K,M){let D=K.consume("?");D&&(M.tokens.nullable=D),K.probe("?")&&K.error("Can't nullable more than once")}function P(K,M){let D=function(j,O){let g=j.consume("FrozenArray","ObservableArray","Promise","async_sequence","sequence","record");if(!g)return;let i=$0(new R({source:j.source,tokens:{base:g}}));switch(i.tokens.open=j.consume("<")||j.error(`No opening bracket after ${g.value}`),g.value){case"Promise":{j.probe("[")&&j.error("Promise type cannot have extended attribute");let Q0=V0(j,O)||j.error("Missing Promise subtype");i.subtype.push(Q0);break}case"async_sequence":case"sequence":case"FrozenArray":case"ObservableArray":{let Q0=K0(j,O)||j.error(`Missing ${g.value} subtype`);i.subtype.push(Q0);break}case"record":{j.probe("[")&&j.error("Record key cannot have extended attribute");let Q0=j.consume(...D0)||j.error(`Record key must be one of: ${D0.join(", ")}`),L0=new R({source:j.source,tokens:{base:Q0}});L0.tokens.separator=j.consume(",")||j.error("Missing comma after record key type"),L0.type=O;let M0=K0(j,O)||j.error("Error parsing generic type record");i.subtype.push(L0,M0);break}}return i.idlType||j.error(`Error parsing generic type ${g.value}`),i.tokens.close=j.consume(">")||j.error(`Missing closing bracket after ${g.value}`),i.this}(K,M)||A0(K);if(!D){let j=K.consumeKind("identifier")||K.consume(...D0,...U0);if(!j)return;D=new R({source:K.source,tokens:{base:j}}),K.probe("<")&&K.error(`Unsupported generic type ${j.value}`)}return D.generic==="Promise"&&K.probe("?")&&K.error("Promise type cannot be nullable"),D.type=M||null,E(K,D),D.nullable&&D.idlType==="any"&&K.error("Type `any` cannot be made nullable"),D}class R extends G{static parse(K,M){return P(K,M)||function(D,j){let O={};if(O.open=D.consume("("),!O.open)return;let g=$0(new R({source:D.source,tokens:O}));for(g.type=j||null;;){let i=K0(D,j)||D.error("No type after open parenthesis or 'or' in union type");i.idlType==="any"&&D.error("Type `any` cannot be included in a union type"),i.generic==="Promise"&&D.error("Type `Promise` cannot be included in a union type"),g.subtype.push(i);let Q0=D.consume("or");if(!Q0)break;i.tokens.separator=Q0}return g.idlType.length<2&&D.error("At least two types are expected in a union type but found less"),O.close=D.consume(")")||D.error("Unterminated union type"),E(D,g),g.this}(K,M)}constructor({source:K,tokens:M}){super({source:K,tokens:M}),Object.defineProperty(this,"subtype",{value:[],writable:!0}),this.extAttrs=new T({source:K,tokens:{}})}get generic(){return this.subtype.length&&this.tokens.base?this.tokens.base.value:""}get nullable(){return Boolean(this.tokens.nullable)}get union(){return Boolean(this.subtype.length)&&!this.tokens.base}get idlType(){if(this.subtype.length)return this.subtype;return u([this.tokens.prefix,this.tokens.base,this.tokens.postfix].filter((K)=>K).map((K)=>K.value).join(" "))}*validate(K){if(yield*this.extAttrs.validate(K),this.idlType==="BufferSource")for(let O of[this.extAttrs,this.parent?.extAttrs])for(let g of O){if(g.name!=="AllowShared")continue;let i="`[AllowShared] BufferSource` is now replaced with AllowSharedBufferSource.";yield J(this.tokens.base,this,"migrate-allowshared",i,{autofix:C(this,g,O)})}if(this.idlType==="void")yield J(this.tokens.base,this,"replace-void","`void` is now replaced by `undefined`. Refer to the [relevant GitHub issue](https://github.com/whatwg/webidl/issues/60) for more information.",{autofix:(M=this,()=>{M.tokens.base.value="undefined"})});var M;let D=!this.union&&K.unique.get(this.idlType),j=this.union?this:D&&D.type==="typedef"?D.idlType:void 0;if(j&&this.nullable){let{reference:O}=W(j,K)||{};if(O){let g=(this.union?O:this).tokens.base;yield J(g,this,"no-nullable-union-dict","Nullable union cannot include a dictionary type.")}}else for(let O of this.subtype)yield*O.validate(K)}write(K){return K.ts.wrap([this.extAttrs.write(K),(()=>{if(this.union||this.generic)return K.ts.wrap([K.token(this.tokens.base,K.ts.generic),K.token(this.tokens.open),...this.subtype.map((O)=>O.write(K)),K.token(this.tokens.close)]);let M=this.tokens.prefix||this.tokens.base,D=this.tokens.prefix?[this.tokens.prefix.value,K.ts.trivia(this.tokens.base.trivia)]:[],j=K.reference(K.ts.wrap([...D,this.tokens.base.value,K.token(this.tokens.postfix)]),{unescaped:this.idlType,context:this});return K.ts.wrap([K.ts.trivia(M.trivia),j])})(),K.token(this.tokens.nullable),K.token(this.tokens.separator)])}}function C(K,M,D){return()=>{let j=D.indexOf(M);D.splice(j,1),!D.length&&K.tokens.base.trivia.match(/^\s$/)&&(K.tokens.base.trivia=""),K.tokens.base.value="AllowSharedBufferSource"}}class y extends G{static parse(K){let M=K.consume("=");if(!M)return null;let D=Y0(K)||K.consumeKind("string")||K.consume("null","[","{")||K.error("No value for default"),j=[D];if(D.value==="["){let O=K.consume("]")||K.error("Default sequence value must be empty");j.push(O)}else if(D.value==="{"){let O=K.consume("}")||K.error("Default dictionary value must be empty");j.push(O)}return new y({source:K.source,tokens:{assign:M},expression:j})}constructor({source:K,tokens:M,expression:D}){super({source:K,tokens:M}),D.parent=this,Object.defineProperty(this,"expression",{value:D})}get type(){return G0(this.expression[0]).type}get value(){return G0(this.expression[0]).value}get negative(){return G0(this.expression[0]).negative}write(K){return K.ts.wrap([K.token(this.tokens.assign),...this.expression.map((M)=>K.token(M))])}}class v extends G{static parse(K){let M=K.position,D={},j=$0(new v({source:K.source,tokens:D}));return j.extAttrs=T.parse(K),D.optional=K.consume("optional"),j.idlType=K0(K,"argument-type"),j.idlType?(D.optional||(D.variadic=K.consume("...")),D.name=K.consumeKind("identifier")||K.consume(...e),D.name?(j.default=D.optional?y.parse(K):null,j.this):K.unconsume(M)):K.unconsume(M)}get type(){return"argument"}get optional(){return!!this.tokens.optional}get variadic(){return!!this.tokens.variadic}get name(){return u(this.tokens.name.value)}*validate(K){yield*this.extAttrs.validate(K),yield*this.idlType.validate(K);let M=W(this.idlType,K,{useNullableInner:!0});if(M){if(this.idlType.nullable)yield J(this.tokens.name,this,"no-nullable-dict-arg","Dictionary arguments cannot be nullable.");else if(this.optional){if(!this.default)yield J(this.tokens.name,this,"dict-arg-default","Optional dictionary arguments must have a default value of `{}`.",{autofix:h(this)})}else if(this.parent&&!Y(M.dictionary,K)&&function(j){let O=j.parent.arguments||j.parent.list,g=O.indexOf(j);return!O.slice(g+1).some((Q0)=>!Q0.optional)}(this))yield J(this.tokens.name,this,"dict-arg-optional","Dictionary argument must be optional if it has no required fields",{autofix:(D=this,()=>{let O=J0(D.idlType);D.tokens.optional={...O,type:"optional",value:"optional"},O.trivia=" ",h(D)()})})}var D}write(K){return K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.optional),K.ts.type(this.idlType.write(K)),K.token(this.tokens.variadic),K.name_token(this.tokens.name,{data:this}),this.default?this.default.write(K):"",K.token(this.tokens.separator)])}}function h(K){return()=>{K.default=y.parse(new v0(" = {}"))}}class X0 extends G{static parse(K,{special:M,regular:D}={}){let j={special:M},O=$0(new X0({source:K.source,tokens:j}));return M&&M.value==="stringifier"&&(j.termination=K.consume(";"),j.termination)?(O.arguments=[],O):(M||D||(j.special=K.consume("getter","setter","deleter")),O.idlType=V0(K)||K.error("Missing return type"),j.name=K.consumeKind("identifier")||K.consume("includes"),j.open=K.consume("(")||K.error("Invalid operation"),O.arguments=l(K),j.close=K.consume(")")||K.error("Unterminated operation"),j.termination=K.consume(";")||K.error("Unterminated operation, expected `;`"),O.this)}get type(){return"operation"}get name(){let{name:K}=this.tokens;return K?u(K.value):""}get special(){return this.tokens.special?this.tokens.special.value:""}*validate(K){if(yield*this.extAttrs.validate(K),!this.name&&["","static"].includes(this.special))yield J(this.tokens.open,this,"incomplete-op","Regular or static operations must have both a return type and an identifier.");if(this.idlType){if(this.idlType.generic==="async_sequence")yield J(this.idlType.tokens.base,this,"async-sequence-idl-to-js","async_sequence types cannot be returned by an operation.");yield*this.idlType.validate(K)}for(let M of this.arguments)yield*M.validate(K)}write(K){let{parent:M}=this,D=this.idlType?[K.ts.type(this.idlType.write(K)),K.name_token(this.tokens.name,{data:this,parent:M}),K.token(this.tokens.open),K.ts.wrap(this.arguments.map((j)=>j.write(K))),K.token(this.tokens.close)]:[];return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),this.tokens.name?K.token(this.tokens.special):K.token(this.tokens.special,K.ts.nameless,{data:this,parent:M}),...D,K.token(this.tokens.termination)]),{data:this,parent:M})}}class r extends G{static parse(K,{special:M,noInherit:D=!1,readonly:j=!1}={}){let O=K.position,g={special:M},i=$0(new r({source:K.source,tokens:g}));if(M||D||(g.special=K.consume("inherit")),i.special==="inherit"&&K.probe("readonly")&&K.error("Inherited attributes cannot be read-only"),g.readonly=K.consume("readonly"),j&&!g.readonly&&K.probe("attribute")&&K.error("Attributes must be readonly in this context"),g.base=K.consume("attribute"),g.base)return i.idlType=K0(K,"attribute-type")||K.error("Attribute lacks a type"),g.name=K.consumeKind("identifier")||K.consume("async","required")||K.error("Attribute lacks a name"),g.termination=K.consume(";")||K.error("Unterminated attribute, expected `;`"),i.this;K.unconsume(O)}get type(){return"attribute"}get special(){return this.tokens.special?this.tokens.special.value:""}get readonly(){return!!this.tokens.readonly}get name(){return u(this.tokens.name.value)}*validate(K){if(yield*this.extAttrs.validate(K),yield*this.idlType.validate(K),["async_sequence","sequence","record"].includes(this.idlType.generic)){let M=`Attributes cannot accept ${this.idlType.generic} types.`;yield J(this.tokens.name,this,"attr-invalid-type",M)}{let{reference:M}=W(this.idlType,K)||{};if(M){let D=(this.idlType.union?M:this.idlType).tokens.base;yield J(D,this,"attr-invalid-type","Attributes cannot accept dictionary types.")}}if(this.readonly&&function(M,D){if(M.union)return!1;if(M.extAttrs.some((O)=>O.name==="EnforceRange"))return!0;let j=D.unique.get(M.idlType);return j?.type==="typedef"&&j.idlType.extAttrs.some((O)=>O.name==="EnforceRange")}(this.idlType,K)){let M=this.idlType.tokens.base;yield J(M,this,"attr-invalid-type","Readonly attributes cannot accept [EnforceRange] extended attribute.")}}write(K){let{parent:M}=this;return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.special),K.token(this.tokens.readonly),K.token(this.tokens.base),K.ts.type(this.idlType.write(K)),K.name_token(this.tokens.name,{data:this,parent:M}),K.token(this.tokens.termination)]),{data:this,parent:M})}}function u(K){return K.startsWith("_")?K.slice(1):K}function t(K,{parser:M,allowDangler:D,listName:j="list"}){let O=M(K);if(!O)return[];O.tokens.separator=K.consume(",");let g=[O];for(;O.tokens.separator;){let i=M(K);if(!i){D||K.error(`Trailing comma in ${j}`);break}if(i.tokens.separator=K.consume(","),g.push(i),!i.tokens.separator)break}return g}function Y0(K){return K.consumeKind("decimal","integer")||K.consume("true","false","Infinity","-Infinity","NaN")}function G0({type:K,value:M}){switch(K){case"decimal":case"integer":return{type:"number",value:M};case"string":return{type:"string",value:M.slice(1,-1)}}switch(M){case"true":case"false":return{type:"boolean",value:M==="true"};case"Infinity":case"-Infinity":return{type:"Infinity",negative:M.startsWith("-")};case"[":return{type:"sequence",value:[]};case"{":return{type:"dictionary"};default:return{type:M}}}function A0(K){let{source:M}=K,D=function(){let O=K.consume("unsigned"),g=K.consume("short","long");if(g){let i=K.consume("long");return new R({source:M,tokens:{prefix:O,base:g,postfix:i}})}O&&K.error("Failed to parse integer type")}()||function(){let O=K.consume("unrestricted"),g=K.consume("float","double");if(g)return new R({source:M,tokens:{prefix:O,base:g}});O&&K.error("Failed to parse float type")}();if(D)return D;let j=K.consume("bigint","boolean","byte","octet","undefined");return j?new R({source:M,tokens:{base:j}}):void 0}function l(K){return t(K,{parser:v.parse,listName:"arguments list"})}function K0(K,M){let D=T.parse(K),j=R.parse(K,M);return j&&($0(j).extAttrs=D),j}function V0(K,M){let D=R.parse(K,M||"return-type");if(D)return D;let j=K.consume("void");if(j){let O=new R({source:K.source,tokens:{base:j}});return O.type="return-type",O}}function o(K){let M=K.consume("stringifier");if(!M)return;return r.parse(K,{special:M})||X0.parse(K,{special:M})||K.error("Unterminated stringifier")}function f(K){let M=K.split(`
|
|
384
|
+
`);if(M.length){let D=M[M.length-1].match(/^\s+/);if(D)return D[0]}return""}function Z0(K){return()=>{if(K.extAttrs.length){let M=new v0("Exposed=Window,"),D=I.parse(M);D.tokens.separator=M.consume(",");let j=K.extAttrs[0];/^\s/.test(j.tokens.name.trivia)||(j.tokens.name.trivia=` ${j.tokens.name.trivia}`),K.extAttrs.unshift(D)}else{$0(K).extAttrs=T.parse(new v0("[Exposed=Window]"));let M=K.tokens.base.trivia;K.extAttrs.tokens.open.trivia=M,K.tokens.base.trivia=`
|
|
385
|
+
${f(M)}`}}}function J0(K){if(K.extAttrs.length)return K.extAttrs.tokens.open;if(K.type==="operation"&&!K.special)return J0(K.idlType);return Object.values(K.tokens).sort((M,D)=>M.index-D.index)[0]}function $0(K,M){if(M||(M=K),!K)return K;return new Proxy(K,{get(D,j){let O=D[j];return Array.isArray(O)&&j!=="source"?$0(O,D):O},set(D,j,O){if(D[j]=O,!O)return!0;if(Array.isArray(O))for(let g of O)g.parent!==void 0&&(g.parent=M);else O.parent!==void 0&&(O.parent=M);return!0}})}let F0={decimal:/-?(?=[0-9]*\.|[0-9]+[eE])(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][-+]?[0-9]+)?|[0-9]+[Ee][-+]?[0-9]+)/y,integer:/-?(0([Xx][0-9A-Fa-f]+|[0-7]*)|[1-9][0-9]*)/y,identifier:/[_-]?[A-Za-z][0-9A-Z_a-z-]*/y,string:/"[^"]*"/y,whitespace:/[\t\n\r ]+/y,comment:/\/\/.*|\/\*[\s\S]*?\*\//y,other:/[^\t\n\r 0-9A-Za-z]/y},U0=["ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","BigInt64Array","BigUint64Array","Float16Array","Float32Array","Float64Array","any","object","symbol"],D0=["ByteString","DOMString","USVString"],e=["async","attribute","callback","const","constructor","deleter","dictionary","enum","getter","includes","inherit","interface","iterable","maplike","namespace","partial","required","setlike","setter","static","stringifier","typedef","unrestricted"],d0=["-Infinity","FrozenArray","Infinity","NaN","ObservableArray","Promise","async_iterable","async_sequence","bigint","boolean","byte","double","false","float","long","mixin","null","octet","optional","or","readonly","record","sequence","short","true","undefined","unsigned","void"].concat(e,D0,U0),R0=["(",")",",","...",":",";","<","=",">","?","*","[","]","{","}"],p0=["_constructor","toString","_toString"];class v0{constructor(K){this.source=function(M){let D=[],j=0,O="",g=1,i=0;for(;j<M.length;){let L0=M.charAt(j),M0=-1;if(/[\t\n\r ]/.test(L0)?M0=Q0("whitespace",{noFlushTrivia:!0}):L0==="/"&&(M0=Q0("comment",{noFlushTrivia:!0})),M0!==-1){let j0=D.pop().value;g+=(j0.match(/\n/g)||[]).length,O+=j0,i-=1}else if(/[-0-9.A-Z_a-z]/.test(L0)){if(M0=Q0("decimal"),M0===-1&&(M0=Q0("integer")),M0===-1){M0=Q0("identifier");let j0=D.length-1,b0=D[j0];if(M0!==-1){if(p0.includes(b0.value)){let B$=`${u(b0.value)} is a reserved identifier and must not be used.`;throw new i0(Q(D,j0,null,B$))}d0.includes(b0.value)&&(b0.type="inline")}}}else L0==='"'&&(M0=Q0("string"));for(let j0 of R0)if(M.startsWith(j0,j)){D.push({type:"inline",value:j0,trivia:O,line:g,index:i}),O="",j+=j0.length,M0=j;break}if(M0===-1&&(M0=Q0("other")),M0===-1)throw Error("Token stream not progressing");j=M0,i+=1}return D.push({type:"eof",value:"",trivia:O,line:g,index:i}),D;function Q0(L0,{noFlushTrivia:M0}={}){let j0=F0[L0];j0.lastIndex=j;let b0=j0.exec(M);return b0?(D.push({type:L0,value:b0[0],trivia:O,line:g,index:i}),M0||(O=""),j0.lastIndex):-1}}(K),this.position=0}error(K){throw new i0(Q(this.source,this.position,this.current,K))}probeKind(K){return this.source.length>this.position&&this.source[this.position].type===K}probe(K){return this.probeKind("inline")&&this.source[this.position].value===K}consumeKind(...K){for(let M of K){if(!this.probeKind(M))continue;let D=this.source[this.position];return this.position++,D}}consume(...K){if(!this.probeKind("inline"))return;let M=this.source[this.position];for(let D of K)if(M.value===D)return this.position++,M}consumeIdentifier(K){if(this.probeKind("identifier")&&this.source[this.position].value===K)return this.consumeKind("identifier")}unconsume(K){this.position=K}}class i0 extends Error{constructor({message:K,bareMessage:M,context:D,line:j,sourceName:O,input:g,tokens:i}){super(K),this.name="WebIDLParseError",this.bareMessage=M,this.context=D,this.line=j,this.sourceName=O,this.input=g,this.tokens=i}}class O$ extends q{static parse(K){let M=K.consumeKind("string");if(M)return new O$({source:K.source,tokens:{value:M}})}get type(){return"enum-value"}get value(){return super.value.slice(1,-1)}write(K){let{parent:M}=this;return K.ts.wrap([K.ts.trivia(this.tokens.value.trivia),K.ts.definition(K.ts.wrap(['"',K.ts.name(this.value,{data:this,parent:M}),'"']),{data:this,parent:M}),K.token(this.tokens.separator)])}}class q$ extends G{static parse(K){let M={};if(M.base=K.consume("enum"),!M.base)return;M.name=K.consumeKind("identifier")||K.error("No name for enum");let D=$0(new q$({source:K.source,tokens:M}));return K.current=D.this,M.open=K.consume("{")||K.error("Bodyless enum"),D.values=t(K,{parser:O$.parse,allowDangler:!0,listName:"enumeration"}),K.probeKind("string")&&K.error("No comma between enum values"),M.close=K.consume("}")||K.error("Unexpected value in enum"),D.values.length||K.error("No value in enum"),M.termination=K.consume(";")||K.error("No semicolon after enum"),D.this}get type(){return"enum"}get name(){return u(this.tokens.name.value)}write(K){return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.base),K.name_token(this.tokens.name,{data:this}),K.token(this.tokens.open),K.ts.wrap(this.values.map((M)=>M.write(K))),K.token(this.tokens.close),K.token(this.tokens.termination)]),{data:this})}}class M1 extends G{static parse(K){let M=K.consumeKind("identifier");if(!M)return;let D={target:M};if(D.includes=K.consume("includes"),D.includes)return D.mixin=K.consumeKind("identifier")||K.error("Incomplete includes statement"),D.termination=K.consume(";")||K.error("No terminating ; for includes statement"),new M1({source:K.source,tokens:D});K.unconsume(M.index)}get type(){return"includes"}get target(){return u(this.tokens.target.value)}get includes(){return u(this.tokens.mixin.value)}write(K){return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.reference_token(this.tokens.target,this),K.token(this.tokens.includes),K.reference_token(this.tokens.mixin,this),K.token(this.tokens.termination)]),{data:this})}}class A1 extends G{static parse(K){let M={},D=$0(new A1({source:K.source,tokens:M}));if(M.base=K.consume("typedef"),M.base)return D.idlType=K0(K,"typedef-type")||K.error("Typedef lacks a type"),M.name=K.consumeKind("identifier")||K.error("Typedef lacks a name"),K.current=D.this,M.termination=K.consume(";")||K.error("Unterminated typedef, expected `;`"),D.this}get type(){return"typedef"}get name(){return u(this.tokens.name.value)}*validate(K){yield*this.idlType.validate(K)}write(K){return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.base),K.ts.type(this.idlType.write(K)),K.name_token(this.tokens.name,{data:this}),K.token(this.tokens.termination)]),{data:this})}}class f$ extends G{static parse(K,M){let D={base:M},j=$0(new f$({source:K.source,tokens:D}));return D.name=K.consumeKind("identifier")||K.error("Callback lacks a name"),K.current=j.this,D.assign=K.consume("=")||K.error("Callback lacks an assignment"),j.idlType=V0(K)||K.error("Callback lacks a return type"),D.open=K.consume("(")||K.error("Callback lacks parentheses for arguments"),j.arguments=l(K),D.close=K.consume(")")||K.error("Unterminated callback"),D.termination=K.consume(";")||K.error("Unterminated callback, expected `;`"),j.this}get type(){return"callback"}get name(){return u(this.tokens.name.value)}*validate(K){yield*this.extAttrs.validate(K);for(let M of this.arguments)if(yield*M.validate(K),M.idlType.generic==="async_sequence")yield J(M.tokens.name,M,"async-sequence-idl-to-js","async_sequence types cannot be returned as a callback argument.");yield*this.idlType.validate(K)}write(K){return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.base),K.name_token(this.tokens.name,{data:this}),K.token(this.tokens.assign),K.ts.type(this.idlType.write(K)),K.token(this.tokens.open),...this.arguments.map((M)=>M.write(K)),K.token(this.tokens.close),K.token(this.tokens.termination)]),{data:this})}}class K$ extends G{static parse(K,M,{inheritable:D,allowedMembers:j}){let{tokens:O,type:g}=M;for(O.name=K.consumeKind("identifier")||K.error(`Missing name in ${g}`),K.current=M,M=$0(M),D&&Object.assign(O,function(i){let Q0=i.consume(":");return Q0?{colon:Q0,inheritance:i.consumeKind("identifier")||i.error("Inheritance lacks a type")}:{}}(K)),O.open=K.consume("{")||K.error(`Bodyless ${g}`),M.members=[];;){if(O.close=K.consume("}"),O.close)return O.termination=K.consume(";")||K.error(`Missing semicolon after ${g}`),M.this;let i=T.parse(K),Q0;for(let[L0,...M0]of j)if(Q0=$0(L0(K,...M0)),Q0)break;Q0||K.error("Unknown member"),Q0.extAttrs=i,M.members.push(Q0.this)}}get partial(){return!!this.tokens.partial}get name(){return u(this.tokens.name.value)}get inheritance(){return this.tokens.inheritance?u(this.tokens.inheritance.value):null}*validate(K){for(let M of this.members)M.validate&&(yield*M.validate(K))}write(K){return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.callback),K.token(this.tokens.partial),K.token(this.tokens.base),K.token(this.tokens.mixin),K.name_token(this.tokens.name,{data:this}),(()=>this.tokens.inheritance?K.ts.wrap([K.token(this.tokens.colon),K.ts.trivia(this.tokens.inheritance.trivia),K.ts.inheritance(K.reference(this.tokens.inheritance.value,{context:this}))]):"")(),K.token(this.tokens.open),K.ts.wrap(this.members.map((M)=>M.write(K))),K.token(this.tokens.close),K.token(this.tokens.termination)]),{data:this})}}class I1 extends G{static parse(K){let M={};if(M.base=K.consume("const"),!M.base)return;let D=A0(K);if(!D){let O=K.consumeKind("identifier")||K.error("Const lacks a type");D=new R({source:K.source,tokens:{base:O}})}K.probe("?")&&K.error("Unexpected nullable constant type"),D.type="const-type",M.name=K.consumeKind("identifier")||K.error("Const lacks a name"),M.assign=K.consume("=")||K.error("Const lacks value assignment"),M.value=Y0(K)||K.error("Const lacks a value"),M.termination=K.consume(";")||K.error("Unterminated const, expected `;`");let j=new I1({source:K.source,tokens:M});return $0(j).idlType=D,j}get type(){return"const"}get name(){return u(this.tokens.name.value)}get value(){return G0(this.tokens.value)}write(K){let{parent:M}=this;return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.base),K.ts.type(this.idlType.write(K)),K.name_token(this.tokens.name,{data:this,parent:M}),K.token(this.tokens.assign),K.token(this.tokens.value),K.token(this.tokens.termination)]),{data:this,parent:M})}}class Y6 extends G{static parse(K){let M=K.position,D=$0(new Y6({source:K.source,tokens:{}})),{tokens:j}=D;if(j.readonly=K.consume("readonly"),j.readonly||(j.async=K.consume("async")),j.base=j.readonly?K.consume("maplike","setlike"):j.async?K.consume("iterable"):K.consume("iterable","async_iterable","maplike","setlike"),!j.base)return void K.unconsume(M);let{type:O}=D,g=O==="maplike",i=g||O==="iterable"||O==="async_iterable",Q0=O==="async_iterable"||D.async&&O==="iterable";j.open=K.consume("<")||K.error(`Missing less-than sign \`<\` in ${O} declaration`);let L0=K0(K)||K.error(`Missing a type argument in ${O} declaration`);return D.idlType=[L0],D.arguments=[],i&&(L0.tokens.separator=K.consume(","),L0.tokens.separator?D.idlType.push(K0(K)):g&&K.error(`Missing second type argument in ${O} declaration`)),j.close=K.consume(">")||K.error(`Missing greater-than sign \`>\` in ${O} declaration`),K.probe("(")&&(Q0?(j.argsOpen=K.consume("("),D.arguments.push(...l(K)),j.argsClose=K.consume(")")||K.error("Unterminated async iterable argument list")):K.error("Arguments are only allowed for `async iterable`")),j.termination=K.consume(";")||K.error(`Missing semicolon after ${O} declaration`),D.this}get type(){return this.tokens.base.value}get readonly(){return!!this.tokens.readonly}get async(){return!!this.tokens.async}*validate(K){if(this.async&&this.type==="iterable")yield J(this.tokens.async,this,"obsolete-async-iterable-syntax","`async iterable` is now changed to `async_iterable`.",{autofix:(M=this,()=>{let j=M.tokens.async;M.tokens.base={...j,type:"async_iterable",value:"async_iterable"},delete M.tokens.async})});var M;for(let D of this.idlType)yield*D.validate(K);for(let D of this.arguments)yield*D.validate(K)}write(K){return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.readonly),K.token(this.tokens.async),K.token(this.tokens.base,K.ts.generic),K.token(this.tokens.open),K.ts.wrap(this.idlType.map((M)=>M.write(K))),K.token(this.tokens.close),K.token(this.tokens.argsOpen),K.ts.wrap(this.arguments.map((M)=>M.write(K))),K.token(this.tokens.argsClose),K.token(this.tokens.termination)]),{data:this,parent:this.parent})}}class h1 extends G{static parse(K){let M=K.consume("constructor");if(!M)return;let D={base:M};D.open=K.consume("(")||K.error("No argument list in constructor");let j=l(K);D.close=K.consume(")")||K.error("Unterminated constructor"),D.termination=K.consume(";")||K.error("No semicolon after constructor");let O=new h1({source:K.source,tokens:D});return $0(O).arguments=j,O}get type(){return"constructor"}*validate(K){for(let M of this.arguments)yield*M.validate(K)}write(K){let{parent:M}=this;return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.base,K.ts.nameless,{data:this,parent:M}),K.token(this.tokens.open),K.ts.wrap(this.arguments.map((D)=>D.write(K))),K.token(this.tokens.close),K.token(this.tokens.termination)]),{data:this,parent:M})}}function Y9(K){let M=K.consume("static");if(!M)return;return r.parse(K,{special:M})||X0.parse(K,{special:M})||K.error("No body in static member")}class h$ extends K${static parse(K,M,{extMembers:D=[],partial:j=null}={}){let O={partial:j,base:M};return K$.parse(K,new h$({source:K.source,tokens:O}),{inheritable:!j,allowedMembers:[...D,[I1.parse],[h1.parse],[Y9],[o],[Y6.parse],[r.parse],[X0.parse]]})}get type(){return"interface"}*validate(K){if(yield*this.extAttrs.validate(K),!this.partial&&this.extAttrs.every((D)=>D.name!=="Exposed"))yield J(this.tokens.name,this,"require-exposed","Interfaces must have `[Exposed]` extended attribute. To fix, add, for example, `[Exposed=Window]`. Please also consider carefully if your interface should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.",{autofix:Z0(this)});let M=this.extAttrs.filter((D)=>D.name==="Constructor");for(let D of M)yield J(D.tokens.name,this,"constructor-member","Constructors should now be represented as a `constructor()` operation on the interface instead of `[Constructor]` extended attribute. Refer to the [WebIDL spec section on constructor operations](https://heycam.github.io/webidl/#idl-constructors) for more information.",{autofix:z9(this,D)});if(this.extAttrs.some((D)=>D.name==="Global")){let D=this.extAttrs.filter((O)=>O.name==="LegacyFactoryFunction");for(let O of D)yield J(O.tokens.name,this,"no-constructible-global","Interfaces marked as `[Global]` cannot have factory functions.");let j=this.members.filter((O)=>O.type==="constructor");for(let O of j)yield J(O.tokens.base,this,"no-constructible-global","Interfaces marked as `[Global]` cannot have constructors.")}yield*super.validate(K),this.partial||(yield*function*(D,j){let O=function(M0){let j0=L0(M0);return{statics:new Set(j0.filter((b0)=>b0.special==="static").map((b0)=>b0.name)),nonstatics:new Set(j0.filter((b0)=>b0.special!=="static").map((b0)=>b0.name))}}(j),g=D.partials.get(j.name)||[],i=D.mixinMap.get(j.name)||[];for(let M0 of[...g,...i]){let j0=L0(M0),b0=j0.filter((E$)=>E$.special==="static"),B$=j0.filter((E$)=>E$.special!=="static");yield*Q0(b0,O.statics,M0,j),yield*Q0(B$,O.nonstatics,M0,j),b0.forEach((E$)=>O.statics.add(E$.name)),B$.forEach((E$)=>O.nonstatics.add(E$.name))}function*Q0(M0,j0,b0,B$){for(let E$ of M0){let{name:q9}=E$;if(q9&&j0.has(q9)){let xZ=`The ${E$.special==="static"?"static ":""}operation "${q9}" has already been defined for the base interface "${B$.name}" either in itself or in a mixin`;yield J(E$.tokens.name,b0,"no-cross-overload",xZ)}}}function L0(M0){return M0.members.filter(({type:j0})=>j0==="operation")}}(K,this))}}function z9(K,M){return K=$0(K),()=>{let D=f(K.extAttrs.tokens.open.trivia),j=K.members.length?f(J0(K.members[0]).trivia):function(j0){let b0=f(j0),B$=b0.includes("\t")?"\t":" ";return b0+B$}(D),O=h1.parse(new v0(`
|
|
386
|
+
${j}constructor();`));O.extAttrs=new T({source:K.source,tokens:{}}),$0(O).arguments=M.arguments;let g=function(j0,b0){let B$=j0.slice().reverse().findIndex(b0);return B$===-1?B$:j0.length-B$-1}(K.members,(j0)=>j0.type==="constructor");K.members.splice(g+1,0,O);let{close:i}=K.tokens;i.trivia.includes(`
|
|
388
387
|
`)||(i.trivia+=`
|
|
389
|
-
${N}`);let{extAttrs:J0}=U,F0=J0.indexOf(L),L0=J0.splice(F0,1);J0.length?J0.length===F0?J0[F0-1].tokens.separator=void 0:J0[F0].tokens.name.trivia.trim()||(J0[F0].tokens.name.trivia=L0[0].tokens.name.trivia):J0.tokens.open=J0.tokens.close=void 0}}class W1 extends U${static parse(U,L,{extMembers:N=[],partial:T}={}){let O={partial:T,base:L};if(O.mixin=U.consume("mixin"),O.mixin)return U$.parse(U,new W1({source:U.source,tokens:O}),{allowedMembers:[...N,[A6.parse],[o],[r.parse,{noInherit:!0}],[Z0.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class Y1 extends G{static parse(U){let L={},N=e(new Y1({source:U.source,tokens:L}));return N.extAttrs=j.parse(U),L.required=U.consume("required"),N.idlType=K0(U,"dictionary-type")||U.error("Dictionary member lacks a type"),L.name=U.consumeKind("identifier")||U.error("Dictionary member lacks a name"),N.default=y.parse(U),L.required&&N.default&&U.error("Required member must not have a default"),L.termination=U.consume(";")||U.error("Unterminated dictionary member, expected `;`"),N.this}get type(){return"field"}get name(){return h(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(U){yield*this.idlType.validate(U)}write(U){let{parent:L}=this;return U.ts.definition(U.ts.wrap([this.extAttrs.write(U),U.token(this.tokens.required),U.ts.type(this.idlType.write(U)),U.name_token(this.tokens.name,{data:this,parent:L}),this.default?this.default.write(U):"",U.token(this.tokens.termination)]),{data:this,parent:L})}}class z1 extends U${static parse(U,{extMembers:L=[],partial:N}={}){let T={partial:N};if(T.base=U.consume("dictionary"),T.base)return U$.parse(U,new z1({source:U.source,tokens:T}),{inheritable:!N,allowedMembers:[...L,[Y1.parse]]})}get type(){return"dictionary"}}class V extends U${static parse(U,{extMembers:L=[],partial:N}={}){let T={partial:N};if(T.base=U.consume("namespace"),T.base)return U$.parse(U,new V({source:U.source,tokens:T}),{allowedMembers:[...L,[r.parse,{noInherit:!0,readonly:!0}],[A6.parse],[Z0.parse,{regular:!0}]]})}get type(){return"namespace"}*validate(U){if(!this.partial&&this.extAttrs.every((L)=>L.name!=="Exposed"))yield J(this.tokens.name,this,"require-exposed","Namespaces must have [Exposed] extended attribute. To fix, add, for example, [Exposed=Window]. Please also consider carefully if your namespace should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.",{autofix:$0(this)});yield*super.validate(U)}}class S extends U${static parse(U,L,{extMembers:N=[]}={}){let T={callback:L};if(T.base=U.consume("interface"),T.base)return U$.parse(U,new S({source:U.source,tokens:T}),{allowedMembers:[...N,[A6.parse],[Z0.parse,{regular:!0}]]})}get type(){return"callback interface"}}function u(U,L){let N=U.source;function T(F0){U.error(F0)}function O(...F0){return U.consume(...F0)}function g(F0){let L0=O("interface");if(L0)return W1.parse(U,L0,{...F0,...L?.extensions?.mixin})||f$.parse(U,L0,{...F0,...L?.extensions?.interface})||T("Interface has no proper body")}function i(){if(L.productions)for(let F0 of L.productions){let L0=F0(U);if(L0)return L0}return function(){let F0=O("callback");if(F0)return U.probe("interface")?S.parse(U,F0,{...L?.extensions?.callbackInterface}):g$.parse(U,F0)}()||g()||function(){let F0=O("partial");if(F0)return z1.parse(U,{partial:F0,...L?.extensions?.dictionary})||g({partial:F0})||V.parse(U,{partial:F0,...L?.extensions?.namespace})||T("Partial doesn't apply to anything")}()||z1.parse(U,L?.extensions?.dictionary)||q$.parse(U)||M6.parse(U)||L6.parse(U)||V.parse(U,L?.extensions?.namespace)}let J0=function(){if(!N.length)return[];let F0=[];for(;;){let j0=j.parse(U),x0=i();if(!x0){j0.length&&T("Stray extended attributes");break}e(x0).extAttrs=j0,F0.push(x0)}let L0=H.parse(U);return L.concrete&&F0.push(L0),F0}();return U.position<N.length&&T("Unrecognised tokens"),J0}function p(U,L={}){let N=new v0(U);return L.sourceName!==void 0&&(N.source.name=L.sourceName),u(N,L)}function k(U){return U}let a={wrap:(U)=>U.join(""),trivia:k,name:k,reference:k,type:k,generic:k,nameless:k,inheritance:k,definition:k,extendedAttribute:k,extendedAttributeReference:k};class I{constructor(U){this.ts=Object.assign({},a,U)}reference(U,{unescaped:L,context:N}){return L||(L=U.startsWith("_")?U.slice(1):U),this.ts.reference(U,L,N)}token(U,L=k,...N){if(!U)return"";let T=L(U.value,...N);return this.ts.wrap([this.ts.trivia(U.trivia),T])}reference_token(U,L){return this.token(U,this.reference.bind(this),{context:L})}name_token(U,L){return this.token(U,this.ts.name,L)}identifier(U,L){return this.ts.wrap([this.reference_token(U.tokens.value,L),this.token(U.tokens.separator)])}}function _(U,{templates:L=a}={}){L=Object.assign({},a,L);let N=new I(L);return L.wrap(U.map((T)=>T.write(N)))}function n(U,L){let N=new Map,T=U.filter((O)=>O.type==="includes");for(let O of T){let g=L.get(O.includes);if(!g)continue;let i=N.get(O.target);i?i.push(g):N.set(O.target,[g])}return N}function*d(U){let L=function(N){let T=new Map,O=new Set,g=new Map;for(let i of N)if(i.partial){let J0=g.get(i.name);J0?J0.push(i):g.set(i.name,[i])}else i.name&&(T.has(i.name)?O.add(i):T.set(i.name,i));return{all:N,unique:T,partials:g,duplicates:O,mixinMap:n(N,T),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(U);for(let N of L.all)N.validate&&(yield*N.validate(L));yield*function*({unique:N,duplicates:T}){for(let O of T){let{name:g}=O,i=`The name "${g}" of type "${N.get(g).type}" was already seen`;yield J(O.tokens.name,O,"no-duplicate",i)}}(L)}function c(U){return[...d((L=U,L.flat?L.flat():[].concat(...L)))];var L}return Z})())});var bH=x((Ep,xH)=>{var __dirname="/home/runner/work/jx/jx/node_modules/@webref/idl",CH=O0("fs").promises,PH=O0("path"),CP=RH();class SH{constructor($,Z){this.filename=Z,this.shortname=PH.basename(Z,".idl"),this.path=PH.join($,Z)}async text(){return await CH.readFile(this.path,"utf8")}async parse(){let $=await this.text();return CP.parse($)}}async function _H({folder:$=__dirname}={}){let Z={},X=await CH.readdir($);for(let Q of X)if(Q.endsWith(".idl")){let J=new SH($,Q);Z[J.shortname]=J}return Z}async function SP($){let Z=await _H($);for(let[X,Q]of Object.entries(Z))Z[X]=await Q.parse();return Z}xH.exports={listAll:_H,parseAll:SP}});var kH;var yH=s(()=>{kH={description:"HTML element tag name or custom element name (must contain a hyphen per Web Components spec).",minLength:1,type:"string"}});var vH,gH,fH;var hH=s(()=>{vH={oneOf:[{type:"string"},{$ref:"#/$defs/RefObject"}]},gH={oneOf:[{type:"boolean"},{$ref:"#/$defs/RefObject"}]},fH={oneOf:[{type:"number"},{$ref:"#/$defs/RefObject"}]}});var uH;var mH=s(()=>{uH={additionalProperties:!0,description:"A page-level <head> entry. Defines meta tags, link tags, script tags, etc.",properties:{attributes:{additionalProperties:{oneOf:[{type:"string"},{type:"boolean"}]},type:"object"},children:{items:{$ref:"#/$defs/HeadEntry"},type:"array"},tagName:{type:"string"},textContent:{type:"string"}},required:["tagName"],type:"object"}});var dH,lH;var cH=s(()=>{dH={description:"A CEM-compatible parameter definition for a function. Follows the Custom Elements Manifest Parameter shape.",properties:{default:{description:"Default value for the parameter."},description:{description:"Parameter documentation.",type:"string"},name:{description:"Parameter name.",type:"string"},optional:{description:"Whether the parameter is optional.",type:"boolean"},type:{description:"Parameter type (JSON Schema or CEM { text } format)."}},required:["name"],type:"object"},lH={description:"A CEM-compatible event definition. Describes a CustomEvent the function dispatches.",properties:{deprecated:{description:"Deprecation notice.",oneOf:[{type:"boolean"},{type:"string"}]},description:{description:"Event documentation.",type:"string"},name:{description:"Event name (e.g. 'task-toggled').",type:"string"},type:{description:"Event type (e.g. { text: 'CustomEvent' })."}},required:["name"],type:"object"}});var pH;var iH=s(()=>{pH={enum:["string","number","integer","boolean","array","object","null"],type:"string"}});var nH,rH,aH,oH,sH,tH,eH,$V,ZV;var XV=s(()=>{nH={description:"Reference to a $defs type definition in the current component.",examples:["#/$defs/Count","#/$defs/TodoItem","#/$defs/Status"],pattern:"^#/\\$defs/",type:"string"},rH={description:"Reference to a state entry (runtime variable) in the current component.",examples:["#/state/count","#/state/addTask","#/state/items"],pattern:"^#/state/",type:"string"},aH={description:"Reference to an external Jx component file.",examples:["./card.json","https://cdn.example.com/button.json"],pattern:"^(\\./|\\.\\./).*\\.json$|^https?://",type:"string"},oH={description:"Reference to a window or document global.",examples:["window#/currentUser","document#/appConfig"],pattern:"^(window|document)#/",type:"string"},sH={description:"Reference to a named state entry passed via $props from a parent component.",examples:["parent#/sharedState","parent#/theme"],pattern:"^parent#/",type:"string"},tH={description:"Reference to the current Array map iteration context.",examples:["$map/item","$map/index","$map/item/text","$map/item/done"],pattern:"^\\$map/(item|index)(/.*)?$",type:"string"},eH={oneOf:[{$ref:"#/$defs/InternalRef"},{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/ExternalRef"},{$ref:"#/$defs/GlobalRef"},{$ref:"#/$defs/ParentRef"},{$ref:"#/$defs/MapRef"}],type:"string"},$V={additionalProperties:!1,description:"A $ref binding. Resolves to a state entry (reactive) or plain value (static).",properties:{$ref:{$ref:"#/$defs/AnyRef"}},required:["$ref"],type:"object"},ZV={properties:{$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"}},required:["$ref"],type:"object"}});var g8;var QV=s(()=>{g8={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/StyleObject"}]},description:"CSS style definition. camelCase property names follow CSSOM convention. Keys starting with :, ., &, or [ are treated as nested CSS selectors. Keys matching $media breakpoint names (or other @-prefixed at-rules) group nested rules. Nesting is recursive: selector and at-rule groups may nest to arbitrary depth "+"(e.g. breakpoint → selector → pseudo-class), mirroring the compiler's recursive emission.",properties:{},type:"object"}});var JV,GV;var WV=s(()=>{JV={additionalProperties:!1,description:"Dynamic mapped list. Re-renders when the items state entry changes.",properties:{$prototype:{const:"Array",type:"string"},filter:{$ref:"#/$defs/RefObject"},items:{oneOf:[{$ref:"#/$defs/RefObject"},{type:"array"}]},map:{$ref:"#/$defs/ElementDef"},sort:{$ref:"#/$defs/RefObject"}},required:["$prototype","items","map"],type:"object"},GV={description:"Array of child definitions — elements, text, or Array namespaces (dynamic lists) mixed "+"freely. A bare Array namespace (the whole children slot is one dynamic list) is also "+"accepted for backward compatibility, as is a ${…} template string that resolves at build "+"time to an array of child definitions.",oneOf:[{items:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ArrayNamespace"},{type:"string"},{type:"number"}]},type:"array"},{$ref:"#/$defs/ArrayNamespace"},{description:"Computed children — a ${…} template that resolves at build time to an array of child "+'definitions (e.g. "${state.entry.$children}" for parsed content). A bare plain-text string is NOT a valid children value; text children must be array items.',pattern:"\\$\\{",type:"string"}]}});var YV,zV,qV,UV,KV,XQ;var HV=s(()=>{YV={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{$ref:"#/$defs/RefObject"}]},description:"HTML attributes and ARIA attributes set via element.setAttribute().",type:"object"},zV={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array"},{type:"object"},{$ref:"#/$defs/RefObject"}]},description:"Explicit prop passing at a component boundary.",type:"object"},qV={oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{$ref:"#/$defs/RefObject"}]},UV={additionalProperties:!1,description:"Reactive $ref that drives which case to render.",properties:{$ref:{$ref:"#/$defs/StateRef"}},required:["$ref"],type:"object"},KV={properties:{$switch:{$ref:"#/$defs/SwitchDef"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},type:"object"},tagName:{$ref:"#/$defs/TagName"}},required:["$switch","cases"],type:"object"},XQ={additionalProperties:{$ref:"#/$defs/ElementPropertyValue"},description:"A Jx element definition. Maps directly to a DOM element.",properties:{"$map/index":{$ref:"#/$defs/RefObject"},"$map/item":{$ref:"#/$defs/RefObject"},$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"},$switch:{$ref:"#/$defs/SwitchDef"},alt:{$ref:"#/$defs/StringOrRef"},attributes:{$ref:"#/$defs/AttributesObject"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},description:"Switch cases for this element. Maps case values to element definitions or external component refs, rendered according to the reactive $switch discriminant.",type:"object"},checked:{$ref:"#/$defs/BoolOrRef"},children:{$ref:"#/$defs/ChildrenValue"},className:{$ref:"#/$defs/StringOrRef"},dir:{enum:["ltr","rtl","auto"],type:"string"},disabled:{$ref:"#/$defs/BoolOrRef"},hidden:{$ref:"#/$defs/BoolOrRef"},href:{$ref:"#/$defs/StringOrRef"},id:{type:"string"},innerHTML:{$ref:"#/$defs/StringOrRef"},innerText:{$ref:"#/$defs/StringOrRef"},lang:{$ref:"#/$defs/StringOrRef"},name:{$ref:"#/$defs/StringOrRef"},placeholder:{$ref:"#/$defs/StringOrRef"},selected:{$ref:"#/$defs/BoolOrRef"},src:{$ref:"#/$defs/StringOrRef"},style:{$ref:"#/$defs/StyleObject"},tabIndex:{$ref:"#/$defs/NumberOrRef"},tagName:{$ref:"#/$defs/TagName"},textContent:{$ref:"#/$defs/StringOrRef"},title:{$ref:"#/$defs/StringOrRef"},type:{$ref:"#/$defs/StringOrRef"},value:{$ref:"#/$defs/StringOrRef"}},required:["tagName"],type:"object"}});var VV;var BV=s(()=>{VV={description:"A typed reactive state variable with explicit type and default value. The type property is a JSON Schema or $ref to a $defs type definition. The default property is the initial runtime value.",not:{required:["$prototype"]},properties:{$ref:{description:"Reference to a shared type definition.",type:"string"},attribute:{description:"Linked HTML attribute name for CEM extraction.",type:"string"},default:{description:"Initial state value."},deprecated:{description:"Deprecation notice for CEM extraction.",oneOf:[{type:"boolean"},{type:"string"}]},description:{type:"string"},examples:{type:"array"},reflects:{description:"Whether property changes reflect back to the HTML attribute.",type:"boolean"},type:{description:"JSON Schema type definition, $ref to a $defs type, or JSON Schema type string.",oneOf:[{type:"string"},{type:"object"}]}},required:["default"],type:"object"}});var FV;var LV=s(()=>{FV={additionalProperties:!1,description:'A function declaration. $prototype must be "Function". body (inline) and $src (external) are mutually exclusive. First parameter is always state (the reactive scope).',properties:{$export:{description:"Named export in $src module. Defaults to the state key name.",type:"string"},$prototype:{const:"Function",type:"string"},$src:{description:"External module specifier. Mutually exclusive with body.",examples:["./counter.js","npm:@myorg/validators"],type:"string"},arguments:{description:"Legacy alias for parameters: bare string parameter names (state may be listed explicitly as the first name). Superseded by parameters.",examples:[["state","event"]],items:{type:"string"},type:"array"},body:{description:"Inline function body: an opaque JS source string (first implicit parameter is state), or a structured statement array (spec §20) — explicit structured function declaration, analyzable by tooling and editable visually. The escalation ladder within the shape is structured statements → JS string.",examples:["state.count++",'state.items.push({ id: Date.now(), text: "", done: false })','return state.score >= 90 ? "gold" : "silver"',[{operator:"push",target:{$ref:"#/state/cart"},value:1},{dispatchEvent:"cart-changed",detail:{$ref:"#/state/cart"}}]],oneOf:[{type:"string"},{$ref:"#/$defs/StatementList"}]},description:{type:"string"},emits:{description:"Array of CEM-compatible Event objects this function dispatches. Used for CEM extraction and studio event discovery.",items:{$ref:"#/$defs/CemEvent"},type:"array"},name:{description:"Explicit function name. Defaults to the state key name.",type:"string"},parameters:{description:"Function parameters (after the implicit state parameter). Accepts CEM-compatible parameter objects or bare string names for backward compatibility.",examples:[["event"],[{name:"event",type:{text:"Event"}}],[{description:"Item identifier",name:"id",type:{text:"number"}}]],items:{oneOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"},type:{description:"Return type for tooling (JSON Schema or CEM { text } format)."}},required:["$prototype"],type:"object"}});var MV,AV;var IV=s(()=>{MV={description:"One statement of a structured function body. Either a bare expression node in statement position (a mutation like =/push, or a call — its result discarded unless captured by an assignment), an if/then/else branch (JSON Schema conditional keywords; if holds a pure expression, then/else hold statement lists), a $switch multiway branch (discriminant matched by string form against cases keys, like element-level $switch), or a dispatchEvent statement (WHATWG DOM: dispatches a CustomEvent from the handler's current target, with CustomEventInit members detail/bubbles/composed).",oneOf:[{$ref:"#/$defs/ExpressionNode"},{additionalProperties:!1,properties:{else:{items:{$ref:"#/$defs/Statement"},type:"array"},if:{$ref:"#/$defs/ExpressionOperand"},then:{items:{$ref:"#/$defs/Statement"},type:"array"}},required:["if","then"],title:"if / then / else — conditional branch (JSON Schema keyword triple)",type:"object"},{additionalProperties:!1,properties:{$switch:{$ref:"#/$defs/ExpressionOperand"},cases:{additionalProperties:{items:{$ref:"#/$defs/Statement"},type:"array"},type:"object"},default:{items:{$ref:"#/$defs/Statement"},type:"array"}},required:["$switch","cases"],title:"$switch / cases — multiway branch (element-level convention, ECMA switch semantics)",type:"object"},{additionalProperties:!1,properties:{bubbles:{type:"boolean"},composed:{type:"boolean"},detail:{$ref:"#/$defs/ExpressionOperand"},dispatchEvent:{description:"The CustomEvent type to dispatch (WHATWG DOM dispatchEvent).",type:"string"}},required:["dispatchEvent"],title:"dispatchEvent — emit a CustomEvent (WHATWG naming, CustomEventInit members)",type:"object"}]},AV={description:"A structured function body: statements executed sequentially (one yielding a promise is awaited before the next, per ECMA async/await semantics).",items:{$ref:"#/$defs/Statement"},type:"array"}});var NV;var DV=s(()=>{NV={description:'An external class / data source. $prototype is a constructor name (not "Function"). When $prototype is not in the built-in registry, $src is required. All state entries are reactive by default.',properties:{$export:{description:"Named export in $src module. Defaults to the $prototype value.",type:"string"},$prototype:{description:"Constructor name — built-in Web API class or external class name.",examples:["Request","URLSearchParams","FormData","LocalStorage","SessionStorage","Cookie","IndexedDB","Array","Set","Map","Blob","ReadableStream","MarkdownCollection","MyParser"],not:{const:"Function"},type:"string"},$src:{description:"External module specifier. Required when $prototype is not a built-in.",examples:["@jxsuite/md","./lib/my-parser.js","npm:@myorg/data"],type:"string"},autoIncrement:{type:"boolean"},body:{},database:{type:"string"},debounce:{minimum:0,type:"integer"},default:{},description:{type:"string"},domain:{type:"string"},expires:{type:"string"},filter:{$ref:"#/$defs/RefObject"},headers:{additionalProperties:{type:"string"},type:"object"},indexes:{items:{properties:{keyPath:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},name:{type:"string"},unique:{type:"boolean"}},required:["name","keyPath"],type:"object"},type:"array"},items:{},key:{type:"string"},keyPath:{type:"string"},manual:{type:"boolean"},map:{$ref:"#/$defs/ElementDef"},maxAge:{type:"integer"},method:{enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],type:"string"},name:{type:"string"},path:{type:"string"},responseType:{enum:["json","text","blob","arraybuffer","document",""],type:"string"},sameSite:{enum:["strict","lax","none"],type:"string"},secure:{type:"boolean"},sort:{anyOf:[{$ref:"#/$defs/RefObject"},{description:"A single sort rule, e.g. { field, order }.",type:"object"},{description:'Ordered sort rules, e.g. [{ field: "date", order: "desc" }].',items:{type:"object"},type:"array"}],description:"Sort configuration: a reactive $ref binding, a single { field, order } rule, or an ordered array of rules."},src:{description:"Configuration property passed to external class constructor.",type:"string"},store:{type:"string"},timing:{enum:["compiler","server","client"],type:"string"},url:{$ref:"#/$defs/StringOrRef"},version:{minimum:1,type:"integer"}},required:["$prototype"],type:"object"}});var wV;var TV=s(()=>{wV={description:"A reusable JSON Schema type definition for tooling only. No function, no runtime artifact. Referenced from state entries via $ref. Naming convention: PascalCase.",not:{anyOf:[{required:["default"]},{required:["$prototype"]}]},properties:{description:{type:"string"},enum:{type:"array"},examples:{type:"array"},items:{},maxLength:{minimum:0,type:"integer"},maximum:{type:"number"},minLength:{minimum:0,type:"integer"},minimum:{type:"number"},pattern:{type:"string"},properties:{type:"object"},required:{items:{type:"string"},type:"array"},type:{$ref:"#/$defs/JsonSchemaType"}},required:["type"],type:"object"}});var jV,OV,EV,RV,PV,CV,SV,_V,xV,bV,kV,yV,vV,gV,fV,hV,uV;var mV=s(()=>{jV={additionalProperties:!1,description:"A JSON Pointer $ref operand within an expression node. $args/<name> resolves a named formula's parameter (callable entries only).",properties:{$ref:{pattern:"^(\\$map/|\\$reduce/|\\$args/|event#/|#/|parent#/|window#/|document#/)",type:"string"}},required:["$ref"],type:"object"},OV={anyOf:[{not:{pattern:"\\$\\{"},type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"},{description:"Plain-object literal (e.g. an Intl options bag). Objects carrying $ref or operator keys are pointers/nodes, never literals.",not:{anyOf:[{required:["$ref"]},{required:["operator"]}]},type:"object"}],description:"A non-reactive operand: scalar, plain-object literal, or array of operands."},EV={anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"},{$ref:"#/$defs/ExpressionLiteral"}],description:"Anything that may appear in target or value: a pointer, a literal, or a nested expression node."},RV={enum:["!","-"]},PV={enum:["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]},CV={const:"?:"},SV={const:"switch"},_V={const:"call"},xV={description:"A genuine pure String.prototype / Array.prototype / Number.prototype method (spec §19.4d). The ES2023 change-by-copy family (toSorted, toReversed, toSpliced, with) stands in where mutation would otherwise occur. Receiver in target; value carries the argument (bare scalar) or argument list (array).",enum:["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"]},bV={enum:["=","+=","-=","*=","/="]},kV={enum:["pop","shift"]},yV={enum:["push","unshift"]},vV={const:"splice"},gV={const:"reduce"},fV={enum:["map","filter"]},hV={additionalProperties:!1,description:"The core expression node. operator + target, with value gated by arity.",oneOf:[{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/UnaryOperator"}},required:["operator"],title:"Unary — target only, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/BinaryOperator"}},required:["operator","value"],title:"Binary — left in target, right in value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/AssignmentOperator"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"Assignment — writable target, value required"},{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/NoArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator"],title:"pop / shift — array receiver, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/OneArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"push / unshift — array receiver, single value argument"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/SpliceMethod"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},minItems:1,type:"array"}},required:["operator","value"],title:"splice — array receiver, [start, deleteCount, ...items]"},{properties:{operator:{$ref:"#/$defs/ReduceMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value","initial"],title:"reduce — pure fold over a pointer or derived array; seed in initial"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/MapFilterMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value"],title:"map / filter — pure over a pointer or derived array; per-item expression in value"},{description:"The ECMAScript conditional (ternary) operator, pure: target is the test, value the consequent, initial the alternate (the reduce precedent for repurposing initial). Chain else-if by nesting another ?: node in initial.",properties:{operator:{$ref:"#/$defs/ConditionalOperator"}},required:["operator","value","initial"],title:"?: — pure conditional; test in target, consequent in value, alternate in initial"},{description:"Value-keyed multiway selection, pure: target is the discriminant (matched against case keys by its string form, like element-level $switch), cases maps matched values to result operands, default is the operand when no case matches (result is undefined without it). Condition-chain branching composes from nested ?: nodes instead.",not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},type:"object"},default:{$ref:"#/$defs/ExpressionOperand"},operator:{$ref:"#/$defs/SwitchOperator"}},required:["operator","cases"],title:"switch — pure value-keyed selection; discriminant in target, results in cases/default"},{description:"A pure standard-library method call: target is the receiver (any operand — never mutated; change-by-copy names replace the mutating originals), value the optional argument (bare scalar) or argument list (array). A missing receiver or method yields undefined, matching null-safe path reads.",not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/PureMethod"}},required:["operator"],title:"Pure method — genuine prototype methods; receiver in target, args in value"},{description:"Invoke a callable, pure in formula position: target is the callee pointer — a named formula entry (#/state/…) or a blessed pure global via window#/ (Math.*, JSON.*, Object.keys/values/entries, and the Intl helpers Intl/formatNumber, Intl/formatDate, Intl/formatRelativeTime) — and value is the positional argument list (the splice args-in-value precedent). Argument order follows the callee's declared parameters.",not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/CallOperator"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"}},required:["operator"],title:"call — invoke a named formula or blessed global; callee in target, args in value"}],properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},description:"switch only: matched discriminant value (string form) → result operand.",type:"object"},default:{$ref:"#/$defs/ExpressionOperand",description:"switch only: result operand when no case key matches."},initial:{$ref:"#/$defs/ExpressionOperand"},operator:{type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target"],type:"object"},uV={additionalProperties:!1,description:"A declarative expression entry (Shape 5). Used as a state entry or inline event handler. With parameters it is a named formula: a pure, reusable computation invoked via the call operator, its parameters resolved through $args/<name> refs in the body.",properties:{$description:{type:"string"},$expression:{$ref:"#/$defs/ExpressionNode"},$title:{type:"string"},parameters:{description:"Named-formula parameters (CEM convention, as on Function entries): bare names or CEM parameter objects. Present ⇒ the entry is callable, not a computed value.",items:{anyOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"}},required:["$expression"],type:"object"}});var dV,lV,cV,pV;var iV=s(()=>{dV={description:"A single state entry. Shape is determined by value type: "+"scalar/array → naked reactive property, string with ${} → computed, "+'object with $prototype: "Function" → function, '+"object with $prototype: <other> → data source, "+"object with type and default → typed reactive property, "+"plain object → naked object reactive property.",oneOf:[{type:"number"},{type:"boolean"},{type:"null"},{type:"string"},{type:"array"},{$ref:"#/$defs/TypedStateDef"},{$ref:"#/$defs/FunctionDef"},{$ref:"#/$defs/ExternalClassDef"},{$ref:"#/$defs/ExpressionEntry"},{not:{anyOf:[{required:["$prototype"]},{required:["default"]},{required:["type"]},{required:["$expression"]}]},type:"object"}]},lV={additionalProperties:{$ref:"#/$defs/StateEntry"},description:"Map of runtime variables. Keys are camelCase (public) or #-prefixed (private). All entries are reactive by default.",type:"object"},cV={additionalProperties:{$ref:"#/$defs/TypeDefEntry"},description:"Map of reusable JSON Schema type definitions. Keys are PascalCase type names. No runtime artifacts are produced.",type:"object"},pV={description:"A $defs type definition entry. Must be a pure JSON Schema type definition or a class definition (.class.json format).",oneOf:[{$ref:"#/$defs/PureTypeDef"},{$ref:"#/$defs/ClassDef"}]}});var _P,QQ,JQ,GQ,WQ,YQ,zQ,qQ,UQ,KQ,nV;var rV=s(()=>{_P=["method","accessor","parse","serialize","discover","load","projectData","resolvePaths","lower","emit","assets","mount","dialect","deploySchema","bindings","testConnection"],QQ={description:"A typed parameter definition for a class.",properties:{default:{},description:{type:"string"},examples:{type:"array"},format:{description:`When "json-schema", this parameter's value is itself a JSON Schema.`,type:"string"},identifier:{type:"string"},type:{}},required:["identifier"],type:"object"},JQ={description:"A class field definition with access control and scope.",properties:{$prototype:{description:'Data source prototype for this field (e.g., "Request").',type:"string"},access:{enum:["public","private","protected"],type:"string"},default:{},description:{type:"string"},examples:{type:"array"},identifier:{type:"string"},initializer:{},role:{const:"field",type:"string"},scope:{enum:["instance","static"],type:"string"},type:{}},type:"object"},GQ={description:"Class constructor definition.",properties:{$prototype:{const:"Function",type:"string"},body:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:{type:"string"},parameters:{items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{$ref:"#/$defs/ClassParameterDef"}]},type:"array"},role:{const:"constructor",type:"string"},superCall:{properties:{arguments:{items:{type:"string"},type:"array"}},type:"object"}},type:"object"},WQ={description:"A class method or accessor definition. Capability roles (parse, serialize, discover, load) mark static methods that hosts (compiler, server, studio) invoke for format dispatch.",properties:{$prototype:{const:"Function",type:"string"},access:{enum:["public","private","protected"],type:"string"},body:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:{type:"string"},getter:{properties:{body:{type:"string"}},type:"object"},identifier:{type:"string"},parameters:{items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{$ref:"#/$defs/ClassParameterDef"}]},type:"array"},returnType:{},role:{enum:_P,type:"string"},scope:{enum:["instance","static"],type:"string"},setter:{properties:{body:{type:"string"},parameters:{type:"array"}},type:"object"},timing:{description:"Execution environments allowed to call this capability directly. Hosts outside the list round-trip through the dev server.",items:{enum:["compiler","server","client"],type:"string"},type:"array"}},type:"object"},YQ={description:"Format participation marker. A class carrying this block is auto-discovered from the project imports map and used for file-extension dispatch by the compiler, server, and studio.",properties:{documentKinds:{description:'"page"/"component" allow the extension in pages/components discovery; "content" allows it as a content-type source.',items:{enum:["page","component","content"],type:"string"},type:"array"},exportTarget:{description:"When true, site builds emit a serialized sidecar per page in this format.",type:"boolean"},extensions:{description:'File extensions this format claims, with leading dot (e.g. [".md"]).',items:{pattern:"^\\.",type:"string"},minItems:1,type:"array"},mediaType:{description:"MIME type for the format (icons, labels, HTTP).",type:"string"},remote:{description:"When true, the load capability accepts http(s) URLs as sources.",type:"boolean"}},required:["extensions"],type:"object"},zQ={additionalProperties:!1,description:"Project-section admission block (specs/extensions.md §9). A class carrying this block owns "+"the project.json section named by `key`; hosts dispatch that section's data through the class's projectData/resolvePaths capabilities.",properties:{description:{type:"string"},key:{description:"The project.json top-level section this class owns (exclusive per project).",type:"string"},referenceable:{description:"Whether section entries can be referenced from documents (e.g. content types).",type:"boolean"},title:{type:"string"}},required:["key"],type:"object"},qQ={additionalProperties:!1,description:"Server-mount admission block (specs/extensions.md §11). A class carrying this block mounts "+"routes under its /_jx/ basePath in the site worker and dev server.",properties:{basePath:{description:"Route subtree this class mounts — must be under /_jx/ (exclusive per project).",examples:["/_jx/data","/_jx/auth"],type:"string"},module:{description:"Module specifier exporting the mount handler.",type:"string"},order:{description:"Mount order (ascending; default 100).",type:"number"}},required:["basePath"],type:"object"},UQ={description:"Connection-provider admission block (specs/extensions.md §12). A class carrying this block "+"provides database connections of the given provider/kind.",properties:{kind:{description:"SQL dialect family the provider speaks.",enum:["sqlite","postgres"],type:"string"},local:{description:"Local-development substitute provider (e.g. sqlite for D1).",type:"string"},module:{description:"Module specifier exporting the provider implementation.",type:"string"},provider:{description:"Provider identifier (e.g. d1, supabase, sqlite).",type:"string"},serve:{description:"Module specifier exporting the serve-time worker binding.",type:"string"}},required:["provider","kind"],type:"object"},KQ={description:"Studio control-surface hints for a format class: editor modes, document-mode rules, templates, and the element/nesting constraints that gate structural editing.",properties:{documentMode:{properties:{componentWhen:{description:"Treat the document as a component when this top-level/frontmatter key matches the regex.",properties:{frontmatterKey:{type:"string"},matches:{type:"string"}},type:"object"},default:{enum:["content","component"],type:"string"}},type:"object"},elements:{description:"Element allowlist and nesting constraints for structural editing.",properties:{block:{items:{type:"string"},type:"array"},inline:{items:{type:"string"},type:"array"},nesting:{additionalProperties:{properties:{block:{type:"boolean"},directive:{type:"boolean"},inline:{type:"boolean"},only:{items:{type:"string"},type:"array"}},type:"object"},description:'Per-parent child rules keyed by tag (or "_root"): { block, inline, directive } booleans or { only: [tags] }.',type:"object"},textOnly:{items:{type:"string"},type:"array"},void:{items:{type:"string"},type:"array"}},type:"object"},icon:{type:"string"},modes:{description:"Editor modes the studio offers for documents of this format.",items:{type:"string"},type:"array"},newFileTemplate:{description:"Initial source text for newly created files of this format.",type:"string"}},type:"object"},nV={additionalProperties:!1,description:'A .class.json schema-defined class. $prototype must be "Class". Defines fields, constructor, methods, and type parameters via $defs. Optionally points to a JS module via $implementation for hybrid execution.',properties:{$defs:{description:"Class members: parameters, returnTypes, fields, constructor, methods.",properties:{constructor:{$ref:"#/$defs/ClassConstructorDef"},fields:{additionalProperties:{$ref:"#/$defs/ClassFieldDef"},description:"Class fields with role, access, scope, and type information.",type:"object"},methods:{additionalProperties:{$ref:"#/$defs/ClassMethodDef"},description:"Class methods and accessors.",type:"object"},parameters:{additionalProperties:{$ref:"#/$defs/ClassParameterDef"},description:"Reusable typed parameter schemas, keyed by name.",type:"object"},returnTypes:{additionalProperties:{type:"object"},description:"Output type schemas, keyed by name.",type:"object"}},type:"object"},$id:{type:"string"},$implementation:{description:"Relative path to a JS module containing the actual class implementation.",type:"string"},$prototype:{const:"Class",type:"string"},$schema:{type:"string"},$studio:{$ref:"#/$defs/StudioHints"},connector:{$ref:"#/$defs/ConnectorBlockDef"},description:{type:"string"},extends:{description:"Base class — string name or $ref to another .class.json.",oneOf:[{type:"string"},{properties:{$ref:{type:"string"}},required:["$ref"],type:"object"}]},format:{$ref:"#/$defs/FormatDef"},project:{$ref:"#/$defs/ProjectBlockDef"},server:{$ref:"#/$defs/ServerBlockDef"},title:{description:"PascalCase class name, used as the export name.",type:"string"}},required:["$prototype","title"],type:"object"}});var aV;var oV=s(()=>{aV={additionalProperties:!1,description:"Schema for jx-extension.json manifests. Located at the extension package root and exported so hosts can resolve <package>/jx-extension.json through the exports map.",properties:{$schema:{type:"string"},classes:{additionalProperties:{type:"string"},description:"$prototype-visible class name → class descriptor path, relative to the manifest.",type:"object"},description:{description:"One-line description.",type:"string"},name:{description:"Package name; must match package.json.",type:"string"},schemas:{additionalProperties:!1,description:"Schema fragments this package contributes, relative to the manifest.",properties:{document:{description:"Document-schema fragment (positions like $paths values).",type:"string"},fields:{description:"Field-union fragment: its $defs members are unioned into the per-project "+"field-schema resource as extension field extras (specs/extensions.md §5.3).",type:"string"},project:{description:"Project-schema fragment (top-level project.json sections).",type:"string"}},type:"object"},title:{description:"Human-readable name for studio surfaces.",type:"string"}},required:["name"],type:"object"}});var f8;var sV=s(()=>{f8={description:"Image optimization configuration for the project.",properties:{formats:{items:{type:"string"},type:"array"},lazyLoad:{type:"boolean"},optimize:{type:"boolean"},quality:{properties:{avif:{type:"number"},jpeg:{type:"number"},png:{type:"number"},webp:{type:"number"}},type:"object"},remoteDomains:{description:'Hostnames whose remote (https) images are optimized through /cdn-cgi/image transform URLs (cloudflare service only), e.g. ["drive.usercontent.google.com"]. Remote sources from other hosts are left untouched.',items:{type:"string"},type:"array"},service:{description:'How images are optimized: "build" runs Sharp at build time; "cloudflare" emits /cdn-cgi/image transform URLs served by Cloudflare Image Transformations (requires the feature to be enabled on the serving zone).',enum:["build","cloudflare"],type:"string"},sizes:{type:"string"},widths:{items:{type:"number"},type:"array"}},type:"object"}});var HQ;var tV=s(()=>{HQ={description:"Schema for Jx project.json files. A project.json file is the root anchor file for a Jx project, declaring site metadata, default settings, global styles, extensions, and build configuration. Open by design: extension-contributed sections (e.g. `content`) are opaque top-level keys; the generated per-project entry document (project.schema.json) closes the composition.",properties:{$defs:{description:"Global type definitions available to all pages.",type:"object"},$elements:{description:"Global custom element dependencies available to all pages. Items are $ref objects or npm package specifier strings.",items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{type:"string"}]},type:"array"},$head:{description:"Global <head> entries applied to all pages. Array of element definitions for meta tags, link tags, script tags, etc.",examples:[[{attributes:{href:"/favicon.svg",rel:"icon"},tagName:"link"},{attributes:{content:"Jx",name:"generator"},tagName:"meta"}]],items:{properties:{attributes:{additionalProperties:{type:"string"},type:"object"},tagName:{type:"string"}},type:"object"},type:"array"},$media:{additionalProperties:{type:"string"},description:'Named media breakpoints following CSS @custom-media convention. Available in all component style objects. Declaring a pure color-scheme query (e.g. "--dark": "(prefers-color-scheme: dark)") additionally opts the site into the forced-scheme contract: @--dark style blocks are dual-emitted so a data-color-scheme attribute on <html> overrides the OS preference, color-scheme is declared on :root, and a pre-paint script restores the '+"visitor's persisted choice (spec §9.5).",examples:[{"--dark":"(prefers-color-scheme: dark)","--lg":"(min-width: 1024px)","--md":"(min-width: 768px)","--sm":"(min-width: 640px)"}],type:"object"},$schema:{description:"Relative path to the generated per-project schema (conventionally ./project.schema.json, written by `jx schema`).",type:"string"},build:{description:"Build configuration.",properties:{adapter:{description:"Platform adapter for deployment-specific output.",enum:["static","cloudflare-pages","cloudflare-workers","node","bun"],type:"string"},deploy:{additionalProperties:!1,description:"Deployment tracking: the hosting project this repo publishes to. Identifiers "+"only (no secrets) — safe to commit; Studio uses it to tell whether the publish "+"workflow already exists. `adapter` says how the build is packaged; `deploy` says where it ships.",properties:{accountId:{description:"Hosting account id (e.g. the Cloudflare account id).",type:"string"},productionUrl:{description:"Production URL of the connected hosting project.",type:"string"},projectName:{description:"Hosting project name (e.g. the Cloudflare Pages project).",pattern:"^[a-z0-9][a-z0-9-]*$",type:"string"},provider:{description:"Hosting provider the project is connected to.",enum:["cloudflare-pages"],type:"string"}},required:["provider","accountId","projectName"],type:"object"},format:{default:"directory",description:"Reserved; currently unused. Accepted for forward compatibility with single-file output (desktop single-file mode) — the build emits per-route directories regardless.",enum:["directory","single"],type:"string"},outDir:{default:"./dist",description:"Output directory for compiled site.",type:"string"},sitemap:{default:!0,description:"Generate sitemap.xml from the route table (requires `url`). Set false to disable.",type:"boolean"},trailingSlash:{default:"always",description:"Trailing slash behavior for generated URLs.",enum:["always","never","ignore"],type:"string"}},type:"object"},copy:{additionalProperties:{type:"string"},description:"Declarative file copy map. Keys are source paths (relative to project root), values are destination paths (relative to outDir).",type:"object"},defaults:{description:"Default settings applied to all pages unless overridden.",properties:{charset:{default:"utf8",description:"Default charset for the page.",type:"string"},lang:{default:"en",description:"Default lang attribute for the <html> element.",type:"string"},layout:{default:null,description:"Default layout file path applied to all pages. Set to null to render pages without a layout.",examples:["./layouts/base.json"],oneOf:[{type:"string"},{type:"null"}]}},type:"object"},extensions:{description:"Extension packages: bare package names (resolved project-first through the package exports map) or relative paths. Each must export jx-extension.json.",examples:[["@jxsuite/parser"]],items:{type:"string"},type:"array"},i18n:{description:"Internationalization configuration.",properties:{defaultLocale:{description:"Default locale code.",examples:["en"],type:"string"},locales:{description:"Available locale codes.",examples:[["en","fr","de"]],items:{type:"string"},type:"array"},routing:{description:"Locale routing strategy.",enum:["prefix-except-default","prefix-always"],type:"string"}},type:"object"},images:{$ref:"#/$defs/ImageConfig"},imports:{additionalProperties:{type:"string"},description:"Global import map: $prototype names to .class.json file paths. Makes external classes available by name in all pages.",examples:[{Markdown:"@jxsuite/parser/Markdown.class.json",MarkdownCollection:"@jxsuite/parser/MarkdownCollection.class.json"}],type:"object"},name:{default:"Jx Site",description:"Human-readable project name.",examples:["My Portfolio","Jx Example Site"],type:"string"},redirects:{additionalProperties:{type:"string"},description:"Static redirect rules. Maps source paths to destination paths.",examples:[{"/old-about":"/about"}],type:"object"},state:{description:"Site-wide reactive state available to all pages.",type:"object"},style:{additionalProperties:{oneOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/StyleObject"}]},description:"Global CSS styles applied to the <body> element. Uses the same camelCase CSSOM convention and recursive selector/at-rule nesting as component styles.",type:"object"},url:{description:"Production URL of the deployed site.",examples:["https://example.com","https://jxsuite.com"],type:"string"}},type:"object"}});function xP(){return eV??=bP(),eV}async function bP(){let[$,Z,X]=await Promise.all([$3.listAll(),Z3.default.listAll(),X3.default.parseAll()]),Q=new Set;for(let{elements:q}of Object.values($))for(let H of q)if(!H.obsolete)Q.add(H.name);let J=[...Q].toSorted(),G=new Set;for(let q of Z.properties)for(let H of q.styleDeclaration??[])G.add(H);let W=[...G].toSorted(),Y=new Set;for(let q of Object.values(X))for(let H of q){if(H.type!=="interface"&&H.type!=="interface mixin")continue;if(!H.members)continue;for(let B of H.members)if(B.type==="attribute"&&B.name?.startsWith("on")&&typeof B.idlType?.idlType==="string"&&B.idlType.idlType==="EventHandler")Y.add(B.name)}let z=[...Y].toSorted();return{cssProps:W,eventHandlers:z,tagExamples:J}}function kP($){let Z={};for(let X of $)Z[X]={description:`Event handler for the "${X.slice(2)}" event.`,oneOf:[{$ref:"#/$defs/RefObject"},{$ref:"#/$defs/ExpressionEntry"},{$ref:"#/$defs/FunctionDef"}]};return Z}function yP($){let Z={};for(let X of $)Z[X]={oneOf:[{type:"string"},{type:"number"}]};return Z}async function vP(){let{tagExamples:$,cssProps:Z,eventHandlers:X}=await xP();return{$defs:{DefsMap:cV,TypeDefEntry:pV,StateMap:lV,StateEntry:dV,TypedStateDef:VV,PureTypeDef:wV,FunctionDef:FV,ClassDef:nV,ClassParameterDef:QQ,ClassFieldDef:JQ,ClassConstructorDef:GQ,ClassMethodDef:WQ,FormatDef:YQ,ProjectBlockDef:zQ,ServerBlockDef:qQ,ConnectorBlockDef:UQ,StudioHints:KQ,ExternalClassDef:NV,ExpressionPointer:jV,ExpressionLiteral:OV,ExpressionOperand:EV,UnaryOperator:RV,BinaryOperator:PV,ConditionalOperator:CV,SwitchOperator:SV,CallOperator:_V,PureMethod:xV,AssignmentOperator:bV,NoArgMethod:kV,OneArgMethod:yV,SpliceMethod:vV,ReduceMethod:gV,MapFilterMethod:fV,ExpressionNode:hV,ExpressionEntry:uV,Statement:MV,StatementList:AV,ElementDef:{...XQ,properties:{...XQ.properties,...kP(X)}},ChildrenValue:GV,ArrayNamespace:JV,SwitchDef:UV,SwitchNode:KV,StyleObject:{...g8,properties:yP(Z)},AttributesObject:YV,PropsObject:zV,RefObject:$V,AnyRef:eH,InternalRef:nH,StateRef:rH,ExternalRef:aH,ExternalComponentRef:ZV,GlobalRef:oH,ParentRef:sH,MapRef:tH,ElementPropertyValue:qV,StringOrRef:vH,BoolOrRef:gH,NumberOrRef:fH,CemParameter:dH,CemEvent:lH,TagName:{...kH,examples:[...$,"my-counter","todo-app","user-card"]},JsonSchemaType:pH,HeadEntry:uH,ImageConfig:f8},$id:"https://jxsuite.com/schema/v1",$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:{$ref:"#/$defs/ElementPropertyValue"},description:"Schema for Jx component files. A Jx document is a JSON object that declaratively describes a reactive web component: its structure (DOM tree), styling, type definitions ($defs), runtime state, and inline or external functions. Reactivity is powered by @vue/reactivity.",properties:{$defs:{$ref:"#/$defs/DefsMap",description:"Pure JSON Schema type definitions for this component. "+"All entries are reusable type schemas — no runtime artifacts are produced. "+"Referenced from state entries via $ref. Naming convention: PascalCase."},$elements:{description:"Custom element dependencies. Items are either $ref objects pointing to JX element definitions, or bare npm package name strings for web component libraries.",items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{description:"npm package specifier (must declare customElements in package.json)",type:"string"}]},type:"array"},$head:{description:"Page-level <head> entries. Array of element definitions for meta tags, link tags, script tags, etc. Merged with layout and site-level $head entries.",items:{$ref:"#/$defs/ElementDef"},type:"array"},$id:{description:"Component identifier string. Used by tooling and the builder.",examples:["Counter","TodoApp","UserCard"],type:"string"},$layout:{description:"Layout reference for pages. String path to a layout JSON file, or false to opt out of the default layout.",examples:["./layouts/base.json"],oneOf:[{type:"string"},{const:!1,type:"boolean"}]},$media:{additionalProperties:{type:"string"},description:'Named media breakpoints following CSS @custom-media convention. Keys use the CSS custom property -- prefix. Pure color-scheme queries (e.g. "--dark": "(prefers-color-scheme: dark)") are dual-emitted so a data-color-scheme attribute on the root element forces the scheme '+"regardless of the OS preference (spec §9.5).",examples:[{"--dark":"(prefers-color-scheme: dark)","--md":"(min-width: 768px)","--sm":"(min-width: 640px)"}],type:"object"},$paths:{description:"Dynamic route parameters. Maps parameter names to data sources for generating one page per entry at build time.",type:"object"},$schema:{description:"URI identifying the Jx dialect version. Enables schema-aware IDE tooling.",examples:["https://jxsuite.com/schema/v1"],type:"string"},attributes:{$ref:"#/$defs/AttributesObject"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},description:"Switch cases object. Maps case values to element definitions or external component refs. Used alongside $switch for dynamic component rendering.",type:"object"},children:{$ref:"#/$defs/ChildrenValue"},imports:{additionalProperties:{type:"string"},description:"Import map: $prototype names to .class.json file paths. Allows state entries to reference external classes by name without $src.",type:"object"},observedAttributes:{description:"HTML attributes the custom element watches for changes. Follows the Web Components observedAttributes convention.",items:{type:"string"},type:"array"},state:{$ref:"#/$defs/StateMap",description:"Runtime variables for this component. All entries are reactive by default. Entry shape is determined by value type: "+"scalar/array → reactive property, string with ${} → computed, "+"object with $prototype → function or data source, "+"object with type and default → typed reactive property."},style:{$ref:"#/$defs/StyleObject"},tagName:{$ref:"#/$defs/TagName"},title:{$ref:"#/$defs/StringOrRef",description:"Page title. Can be a static string or a template string with ${} expressions."}},title:"Jx Document",type:"object"}}function gP(){return{$defs:{ImageConfig:f8,StyleObject:g8},$id:"https://jxsuite.com/schema/project/v1",$schema:"https://json-schema.org/draft/2020-12/schema",description:"Schema for Jx project.json files. A project.json file is the root anchor file for a Jx project, declaring site metadata, default settings, global styles, extensions, and build configuration. Open by design: extension-contributed sections are opaque top-level keys; the generated per-project entry document (project.schema.json) closes the composition.",properties:HQ.properties,title:"Jx Project",type:"object"}}function fP(){return{$defs:{ImageConfig:f8,JxFieldSchema:XH,RelationshipRef:QH,StyleObject:g8},$id:"https://jxsuite.com/schema/project/core/v2",$schema:"https://json-schema.org/draft/2020-12/schema",description:"Core fragment of the Jx project.json schema. Open by design: extension fragments contribute their own top-level sections and the generated per-project entry document "+"(project.schema.json) closes the composition. See specs/extensions.md §5.",properties:HQ.properties,title:"Jx Project Core",type:"object"}}function hP(){return{$id:m9,$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"https://jxsuite.com/schema/project/core/v2#/$defs/JxFieldSchema"},{$ref:"https://jxsuite.com/schema/project/core/v2#/$defs/RelationshipRef"}],description:"Default field-schema union for section entry schemas: the core field shape plus relationship references. Per-project entry documents override this resource with the "+"effective union. See specs/extensions.md §5.3.",title:"Jx Project Field Union"}}function uP(){return{$id:f4,$schema:"https://json-schema.org/draft/2020-12/schema",description:"Default $paths-value union for documents. Per-project entry documents override this resource with the union of extension-contributed paths shapes.",title:"Jx Document Paths Union"}}function mP(){return{$id:"https://jxsuite.com/schema/extension-manifest/v1",$schema:"https://json-schema.org/draft/2020-12/schema",title:"Jx Extension Manifest",...aV}}function VQ(){return{$defs:{ClassConstructorDef:GQ,ClassFieldDef:JQ,ClassMethodDef:WQ,ClassParameterDef:QQ,ConnectorBlockDef:UQ,FormatDef:YQ,ProjectBlockDef:zQ,ServerBlockDef:qQ,StudioHints:KQ},$id:"https://jxsuite.com/schema/class/v1",$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Schema for Jx .class.json files. A class definition describes a schema-defined class with fields, constructor, methods, and type parameters. Optionally points to a JS module via $implementation for hybrid execution.",properties:{$defs:{description:"Class members: parameters, returnTypes, fields, constructor, methods.",properties:{constructor:{$ref:"#/$defs/ClassConstructorDef"},fields:{additionalProperties:{$ref:"#/$defs/ClassFieldDef"},description:"Class fields with role, access, scope, and type information.",type:"object"},methods:{additionalProperties:{$ref:"#/$defs/ClassMethodDef"},description:"Class methods and accessors.",type:"object"},parameters:{additionalProperties:{$ref:"#/$defs/ClassParameterDef"},description:"Reusable typed parameter schemas, keyed by name.",type:"object"},returnTypes:{additionalProperties:{type:"object"},description:"Output type schemas, keyed by name.",type:"object"}},type:"object"},$id:{type:"string"},$implementation:{description:"Relative path to a JS module containing the actual class implementation.",examples:["./md.js","./lib/calculator.js"],type:"string"},$prototype:{const:"Class",description:'Must be "Class" for class definition files.',type:"string"},$schema:{type:"string"},$studio:{$ref:"#/$defs/StudioHints"},connector:{$ref:"#/$defs/ConnectorBlockDef"},description:{type:"string"},extends:{description:"Base class — string name or $ref to another .class.json.",oneOf:[{type:"string"},{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"}]},format:{$ref:"#/$defs/FormatDef"},project:{$ref:"#/$defs/ProjectBlockDef"},server:{$ref:"#/$defs/ServerBlockDef"},title:{description:"PascalCase class name, used as the export name.",examples:["MarkdownFile","DataSource","Calculator"],type:"string"}},required:["$prototype","title"],title:"Jx Class Definition",type:"object"}}async function dP(){let{mkdirSync:$,writeFileSync:Z}=await import("node:fs"),{resolve:X,dirname:Q}=await import("node:path"),J=Q(X(process.argv[1],"..")),G=await vP(),W=gP(),Y=VQ(),z=fP(),q=mP(),H=hP(),B=uP(),F=JSON.stringify(G,null,2),M=JSON.stringify(W,null,2),A=JSON.stringify(Y,null,2),w=JSON.stringify(z,null,2),D=JSON.stringify(q,null,2),j=JSON.stringify(H,null,2),R=JSON.stringify(B,null,2),[P]=process.argv.slice(2);if(P)Z(P,F,"utf8"),console.error(`Jx component schema written to ${P}`);else{Z(X(J,"schema.json"),F,"utf8"),Z(X(J,"project-schema.json"),M,"utf8"),Z(X(J,"class-schema.json"),A,"utf8"),$(X(J,"schemas"),{recursive:!0}),Z(X(J,"schemas","project.core.schema.json"),w,"utf8"),Z(X(J,"schemas","project.fields.schema.json"),j,"utf8"),Z(X(J,"schemas","document.paths.schema.json"),R,"utf8"),Z(X(J,"extension-manifest.schema.json"),D,"utf8");let E=Bun.spawnSync(["bunx","oxfmt",X(J,"schemas","project.core.schema.json"),X(J,"schemas","project.fields.schema.json"),X(J,"schemas","document.paths.schema.json")],{cwd:J});if(E.exitCode!==0){let C=E.stderr.toString()||E.stdout.toString()||`exit ${E.exitCode??"null"}${E.signalCode?`, signal ${E.signalCode}`:""}`;console.error(`Warning: skipped oxfmt reformat of generated schemas (${C})`)}console.error("Generated:"),console.error(" schema.json (component)"),console.error(" project-schema.json"),console.error(" class-schema.json"),console.error(" schemas/project.core.schema.json"),console.error(" schemas/project.fields.schema.json"),console.error(" schemas/document.paths.schema.json"),console.error(" extension-manifest.schema.json")}}var $3,Z3,X3,eV=null,Bi;var Q3=s(()=>{yH();hH();mH();cH();iH();XV();QV();WV();HV();BV();LV();IV();DV();TV();mV();iV();rV();oV();b8();sV();tV();$3=B$(TH(),1),Z3=B$(EH(),1),X3=B$(bH(),1);Bi=process.argv[1]?.endsWith("schema.ts")?dP():void 0});var p9=x((W3)=>{Object.defineProperty(W3,"__esModule",{value:!0});W3.regexpCode=W3.getEsmExportName=W3.getProperty=W3.safeStringify=W3.stringify=W3.strConcat=W3.addCodeArg=W3.str=W3._=W3.nil=W3._Code=W3.Name=W3.IDENTIFIER=W3._CodeOrName=void 0;class h8{}W3._CodeOrName=h8;W3.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class h4 extends h8{constructor($){super();if(!W3.IDENTIFIER.test($))throw Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}W3.Name=h4;class U6 extends h8{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((Z,X)=>`${Z}${X}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((Z,X)=>{if(X instanceof h4)Z[X.str]=(Z[X.str]||0)+1;return Z},{})}}W3._Code=U6;W3.nil=new U6("");function J3($,...Z){let X=[$[0]],Q=0;while(Q<Z.length)FQ(X,Z[Q]),X.push($[++Q]);return new U6(X)}W3._=J3;var BQ=new U6("+");function G3($,...Z){let X=[c9($[0])],Q=0;while(Q<Z.length)X.push(BQ),FQ(X,Z[Q]),X.push(BQ,c9($[++Q]));return lP(X),new U6(X)}W3.str=G3;function FQ($,Z){if(Z instanceof U6)$.push(...Z._items);else if(Z instanceof h4)$.push(Z);else $.push(iP(Z))}W3.addCodeArg=FQ;function lP($){let Z=1;while(Z<$.length-1){if($[Z]===BQ){let X=cP($[Z-1],$[Z+1]);if(X!==void 0){$.splice(Z-1,3,X);continue}$[Z++]="+"}Z++}}function cP($,Z){if(Z==='""')return $;if($==='""')return Z;if(typeof $=="string"){if(Z instanceof h4||$[$.length-1]!=='"')return;if(typeof Z!="string")return`${$.slice(0,-1)}${Z}"`;if(Z[0]==='"')return $.slice(0,-1)+Z.slice(1);return}if(typeof Z=="string"&&Z[0]==='"'&&!($ instanceof h4))return`"${$}${Z.slice(1)}`;return}function pP($,Z){return Z.emptyStr()?$:$.emptyStr()?Z:G3`${$}${Z}`}W3.strConcat=pP;function iP($){return typeof $=="number"||typeof $=="boolean"||$===null?$:c9(Array.isArray($)?$.join(","):$)}function nP($){return new U6(c9($))}W3.stringify=nP;function c9($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}W3.safeStringify=c9;function rP($){return typeof $=="string"&&W3.IDENTIFIER.test($)?new U6(`.${$}`):J3`[${$}]`}W3.getProperty=rP;function aP($){if(typeof $=="string"&&W3.IDENTIFIER.test($))return new U6(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}W3.getEsmExportName=aP;function oP($){return new U6($.toString())}W3.regexpCode=oP});var IQ=x((U3)=>{Object.defineProperty(U3,"__esModule",{value:!0});U3.ValueScope=U3.ValueScopeName=U3.Scope=U3.varKinds=U3.UsedValueState=void 0;var x$=p9();class z3 extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var m8;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(m8||(U3.UsedValueState=m8={}));U3.varKinds={const:new x$.Name("const"),let:new x$.Name("let"),var:new x$.Name("var")};class MQ{constructor({prefixes:$,parent:Z}={}){this._names={},this._prefixes=$,this._parent=Z}toName($){return $ instanceof x$.Name?$:this.name($)}name($){return new x$.Name(this._newName($))}_newName($){let Z=this._names[$]||this._nameGroup($);return`${$}${Z.index++}`}_nameGroup($){var Z,X;if(((X=(Z=this._parent)===null||Z===void 0?void 0:Z._prefixes)===null||X===void 0?void 0:X.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}U3.Scope=MQ;class AQ extends x$.Name{constructor($,Z){super(Z);this.prefix=$}setValue($,{property:Z,itemIndex:X}){this.value=$,this.scopePath=x$._`.${new x$.Name(Z)}[${X}]`}}U3.ValueScopeName=AQ;var qC=x$._`\n`;class q3 extends MQ{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?qC:x$.nil}}get(){return this._scope}name($){return new AQ($,this._newName($))}value($,Z){var X;if(Z.ref===void 0)throw Error("CodeGen: ref must be passed in value");let Q=this.toName($),{prefix:J}=Q,G=(X=Z.key)!==null&&X!==void 0?X:Z.ref,W=this._values[J];if(W){let q=W.get(G);if(q)return q}else W=this._values[J]=new Map;W.set(G,Q);let Y=this._scope[J]||(this._scope[J]=[]),z=Y.length;return Y[z]=Z.ref,Q.setValue(Z,{property:J,itemIndex:z}),Q}getValue($,Z){let X=this._values[$];if(!X)return;return X.get(Z)}scopeRefs($,Z=this._values){return this._reduceValues(Z,(X)=>{if(X.scopePath===void 0)throw Error(`CodeGen: name "${X}" has no value`);return x$._`${$}${X.scopePath}`})}scopeCode($=this._values,Z,X){return this._reduceValues($,(Q)=>{if(Q.value===void 0)throw Error(`CodeGen: name "${Q}" has no value`);return Q.value.code},Z,X)}_reduceValues($,Z,X={},Q){let J=x$.nil;for(let G in $){let W=$[G];if(!W)continue;let Y=X[G]=X[G]||new Map;W.forEach((z)=>{if(Y.has(z))return;Y.set(z,m8.Started);let q=Z(z);if(q){let H=this.opts.es5?U3.varKinds.var:U3.varKinds.const;J=x$._`${J}${H} ${z} = ${q};${this.opts._n}`}else if(q=Q===null||Q===void 0?void 0:Q(z))J=x$._`${J}${q}${this.opts._n}`;else throw new z3(z);Y.set(z,m8.Completed)})}return J}}U3.ValueScope=q3});var D0=x((b$)=>{Object.defineProperty(b$,"__esModule",{value:!0});b$.or=b$.and=b$.not=b$.CodeGen=b$.operators=b$.varKinds=b$.ValueScopeName=b$.ValueScope=b$.Scope=b$.Name=b$.regexpCode=b$.stringify=b$.getProperty=b$.nil=b$.strConcat=b$.str=b$._=void 0;var C0=p9(),K6=IQ(),R1=p9();Object.defineProperty(b$,"_",{enumerable:!0,get:function(){return R1._}});Object.defineProperty(b$,"str",{enumerable:!0,get:function(){return R1.str}});Object.defineProperty(b$,"strConcat",{enumerable:!0,get:function(){return R1.strConcat}});Object.defineProperty(b$,"nil",{enumerable:!0,get:function(){return R1.nil}});Object.defineProperty(b$,"getProperty",{enumerable:!0,get:function(){return R1.getProperty}});Object.defineProperty(b$,"stringify",{enumerable:!0,get:function(){return R1.stringify}});Object.defineProperty(b$,"regexpCode",{enumerable:!0,get:function(){return R1.regexpCode}});Object.defineProperty(b$,"Name",{enumerable:!0,get:function(){return R1.Name}});var n8=IQ();Object.defineProperty(b$,"Scope",{enumerable:!0,get:function(){return n8.Scope}});Object.defineProperty(b$,"ValueScope",{enumerable:!0,get:function(){return n8.ValueScope}});Object.defineProperty(b$,"ValueScopeName",{enumerable:!0,get:function(){return n8.ValueScopeName}});Object.defineProperty(b$,"varKinds",{enumerable:!0,get:function(){return n8.varKinds}});b$.operators={GT:new C0._Code(">"),GTE:new C0._Code(">="),LT:new C0._Code("<"),LTE:new C0._Code("<="),EQ:new C0._Code("==="),NEQ:new C0._Code("!=="),NOT:new C0._Code("!"),OR:new C0._Code("||"),AND:new C0._Code("&&"),ADD:new C0._Code("+")};class P1{optimizeNodes(){return this}optimizeNames($,Z){return this}}class H3 extends P1{constructor($,Z,X){super();this.varKind=$,this.name=Z,this.rhs=X}render({es5:$,_n:Z}){let X=$?K6.varKinds.var:this.varKind,Q=this.rhs===void 0?"":` = ${this.rhs}`;return`${X} ${this.name}${Q};`+Z}optimizeNames($,Z){if(!$[this.name.str])return;if(this.rhs)this.rhs=m4(this.rhs,$,Z);return this}get names(){return this.rhs instanceof C0._CodeOrName?this.rhs.names:{}}}class wQ extends P1{constructor($,Z,X){super();this.lhs=$,this.rhs=Z,this.sideEffects=X}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,Z){if(this.lhs instanceof C0.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=m4(this.rhs,$,Z),this}get names(){let $=this.lhs instanceof C0.Name?{}:{...this.lhs.names};return i8($,this.rhs)}}class V3 extends wQ{constructor($,Z,X,Q){super($,X,Q);this.op=Z}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class B3 extends P1{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class F3 extends P1{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class L3 extends P1{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class M3 extends P1{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,Z){return this.code=m4(this.code,$,Z),this}get names(){return this.code instanceof C0._CodeOrName?this.code.names:{}}}class r8 extends P1{constructor($=[]){super();this.nodes=$}render($){return this.nodes.reduce((Z,X)=>Z+X.render($),"")}optimizeNodes(){let{nodes:$}=this,Z=$.length;while(Z--){let X=$[Z].optimizeNodes();if(Array.isArray(X))$.splice(Z,1,...X);else if(X)$[Z]=X;else $.splice(Z,1)}return $.length>0?this:void 0}optimizeNames($,Z){let{nodes:X}=this,Q=X.length;while(Q--){let J=X[Q];if(J.optimizeNames($,Z))continue;VC($,J.names),X.splice(Q,1)}return X.length>0?this:void 0}get names(){return this.nodes.reduce(($,Z)=>$4($,Z.names),{})}}class C1 extends r8{render($){return"{"+$._n+super.render($)+"}"+$._n}}class A3 extends r8{}class i9 extends C1{}i9.kind="else";class X1 extends C1{constructor($,Z){super(Z);this.condition=$}render($){let Z=`if(${this.condition})`+super.render($);if(this.else)Z+="else "+this.else.render($);return Z}optimizeNodes(){super.optimizeNodes();let $=this.condition;if($===!0)return this.nodes;let Z=this.else;if(Z){let X=Z.optimizeNodes();Z=this.else=Array.isArray(X)?new i9(X):X}if(Z){if($===!1)return Z instanceof X1?Z:Z.nodes;if(this.nodes.length)return this;return new X1(T3($),Z instanceof X1?[Z]:Z.nodes)}if($===!1||!this.nodes.length)return;return this}optimizeNames($,Z){var X;if(this.else=(X=this.else)===null||X===void 0?void 0:X.optimizeNames($,Z),!(super.optimizeNames($,Z)||this.else))return;return this.condition=m4(this.condition,$,Z),this}get names(){let $=super.names;if(i8($,this.condition),this.else)$4($,this.else.names);return $}}X1.kind="if";class u4 extends C1{}u4.kind="for";class I3 extends u4{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,Z){if(!super.optimizeNames($,Z))return;return this.iteration=m4(this.iteration,$,Z),this}get names(){return $4(super.names,this.iteration.names)}}class N3 extends u4{constructor($,Z,X,Q){super();this.varKind=$,this.name=Z,this.from=X,this.to=Q}render($){let Z=$.es5?K6.varKinds.var:this.varKind,{name:X,from:Q,to:J}=this;return`for(${Z} ${X}=${Q}; ${X}<${J}; ${X}++)`+super.render($)}get names(){let $=i8(super.names,this.from);return i8($,this.to)}}class NQ extends u4{constructor($,Z,X,Q){super();this.loop=$,this.varKind=Z,this.name=X,this.iterable=Q}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,Z){if(!super.optimizeNames($,Z))return;return this.iterable=m4(this.iterable,$,Z),this}get names(){return $4(super.names,this.iterable.names)}}class d8 extends C1{constructor($,Z,X){super();this.name=$,this.args=Z,this.async=X}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}d8.kind="func";class l8 extends r8{render($){return"return "+super.render($)}}l8.kind="return";class D3 extends C1{render($){let Z="try"+super.render($);if(this.catch)Z+=this.catch.render($);if(this.finally)Z+=this.finally.render($);return Z}optimizeNodes(){var $,Z;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(Z=this.finally)===null||Z===void 0||Z.optimizeNodes(),this}optimizeNames($,Z){var X,Q;return super.optimizeNames($,Z),(X=this.catch)===null||X===void 0||X.optimizeNames($,Z),(Q=this.finally)===null||Q===void 0||Q.optimizeNames($,Z),this}get names(){let $=super.names;if(this.catch)$4($,this.catch.names);if(this.finally)$4($,this.finally.names);return $}}class c8 extends C1{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}c8.kind="catch";class p8 extends C1{render($){return"finally"+super.render($)}}p8.kind="finally";class w3{constructor($,Z={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...Z,_n:Z.lines?`
|
|
390
|
-
`:""},this._extScope=$,this._scope=new K6.Scope({parent:$}),this._nodes=[new A3]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,Z){let X=this._extScope.value($,Z);return(this._values[X.prefix]||(this._values[X.prefix]=new Set)).add(X),X}getScopeValue($,Z){return this._extScope.getValue($,Z)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,Z,X,Q){let J=this._scope.toName(Z);if(X!==void 0&&Q)this._constants[J.str]=X;return this._leafNode(new H3($,J,X)),J}const($,Z,X){return this._def(K6.varKinds.const,$,Z,X)}let($,Z,X){return this._def(K6.varKinds.let,$,Z,X)}var($,Z,X){return this._def(K6.varKinds.var,$,Z,X)}assign($,Z,X){return this._leafNode(new wQ($,Z,X))}add($,Z){return this._leafNode(new V3($,b$.operators.ADD,Z))}code($){if(typeof $=="function")$();else if($!==C0.nil)this._leafNode(new M3($));return this}object(...$){let Z=["{"];for(let[X,Q]of $){if(Z.length>1)Z.push(",");if(Z.push(X),X!==Q||this.opts.es5)Z.push(":"),(0,C0.addCodeArg)(Z,Q)}return Z.push("}"),new C0._Code(Z)}if($,Z,X){if(this._blockNode(new X1($)),Z&&X)this.code(Z).else().code(X).endIf();else if(Z)this.code(Z).endIf();else if(X)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new X1($))}else(){return this._elseNode(new i9)}endIf(){return this._endBlockNode(X1,i9)}_for($,Z){if(this._blockNode($),Z)this.code(Z).endFor();return this}for($,Z){return this._for(new I3($),Z)}forRange($,Z,X,Q,J=this.opts.es5?K6.varKinds.var:K6.varKinds.let){let G=this._scope.toName($);return this._for(new N3(J,G,Z,X),()=>Q(G))}forOf($,Z,X,Q=K6.varKinds.const){let J=this._scope.toName($);if(this.opts.es5){let G=Z instanceof C0.Name?Z:this.var("_arr",Z);return this.forRange("_i",0,C0._`${G}.length`,(W)=>{this.var(J,C0._`${G}[${W}]`),X(J)})}return this._for(new NQ("of",Q,J,Z),()=>X(J))}forIn($,Z,X,Q=this.opts.es5?K6.varKinds.var:K6.varKinds.const){if(this.opts.ownProperties)return this.forOf($,C0._`Object.keys(${Z})`,X);let J=this._scope.toName($);return this._for(new NQ("in",Q,J,Z),()=>X(J))}endFor(){return this._endBlockNode(u4)}label($){return this._leafNode(new B3($))}break($){return this._leafNode(new F3($))}return($){let Z=new l8;if(this._blockNode(Z),this.code($),Z.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(l8)}try($,Z,X){if(!Z&&!X)throw Error('CodeGen: "try" without "catch" and "finally"');let Q=new D3;if(this._blockNode(Q),this.code($),Z){let J=this.name("e");this._currNode=Q.catch=new c8(J),Z(J)}if(X)this._currNode=Q.finally=new p8,this.code(X);return this._endBlockNode(c8,p8)}throw($){return this._leafNode(new L3($))}block($,Z){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(Z);return this}endBlock($){let Z=this._blockStarts.pop();if(Z===void 0)throw Error("CodeGen: not in self-balancing block");let X=this._nodes.length-Z;if(X<0||$!==void 0&&X!==$)throw Error(`CodeGen: wrong number of nodes: ${X} vs ${$} expected`);return this._nodes.length=Z,this}func($,Z=C0.nil,X,Q){if(this._blockNode(new d8($,Z,X)),Q)this.code(Q).endFunc();return this}endFunc(){return this._endBlockNode(d8)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,Z){let X=this._currNode;if(X instanceof $||Z&&X instanceof Z)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${Z?`${$.kind}/${Z.kind}`:$.kind}"`)}_elseNode($){let Z=this._currNode;if(!(Z instanceof X1))throw Error('CodeGen: "else" without "if"');return this._currNode=Z.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let Z=this._nodes;Z[Z.length-1]=$}}b$.CodeGen=w3;function $4($,Z){for(let X in Z)$[X]=($[X]||0)+(Z[X]||0);return $}function i8($,Z){return Z instanceof C0._CodeOrName?$4($,Z.names):$}function m4($,Z,X){if($ instanceof C0.Name)return Q($);if(!J($))return $;return new C0._Code($._items.reduce((G,W)=>{if(W instanceof C0.Name)W=Q(W);if(W instanceof C0._Code)G.push(...W._items);else G.push(W);return G},[]));function Q(G){let W=X[G.str];if(W===void 0||Z[G.str]!==1)return G;return delete Z[G.str],W}function J(G){return G instanceof C0._Code&&G._items.some((W)=>W instanceof C0.Name&&Z[W.str]===1&&X[W.str]!==void 0)}}function VC($,Z){for(let X in Z)$[X]=($[X]||0)-(Z[X]||0)}function T3($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:C0._`!${DQ($)}`}b$.not=T3;var BC=j3(b$.operators.AND);function FC(...$){return $.reduce(BC)}b$.and=FC;var LC=j3(b$.operators.OR);function MC(...$){return $.reduce(LC)}b$.or=MC;function j3($){return(Z,X)=>Z===C0.nil?X:X===C0.nil?Z:C0._`${DQ(Z)} ${$} ${DQ(X)}`}function DQ($){return $ instanceof C0.Name?$:C0._`(${$})`}});var R0=x((b3)=>{Object.defineProperty(b3,"__esModule",{value:!0});b3.checkStrictMode=b3.getErrorPath=b3.Type=b3.useFunc=b3.setEvaluated=b3.evaluatedPropsToName=b3.mergeEvaluated=b3.eachItem=b3.unescapeJsonPointer=b3.escapeJsonPointer=b3.escapeFragment=b3.unescapeFragment=b3.schemaRefOrVal=b3.schemaHasRulesButRef=b3.schemaHasRules=b3.checkUnknownRules=b3.alwaysValidSchema=b3.toHash=void 0;var y0=D0(),DC=p9();function wC($){let Z={};for(let X of $)Z[X]=!0;return Z}b3.toHash=wC;function TC($,Z){if(typeof Z=="boolean")return Z;if(Object.keys(Z).length===0)return!0;return P3($,Z),!C3(Z,$.self.RULES.all)}b3.alwaysValidSchema=TC;function P3($,Z=$.schema){let{opts:X,self:Q}=$;if(!X.strictSchema)return;if(typeof Z==="boolean")return;let J=Q.RULES.keywords;for(let G in Z)if(!J[G])x3($,`unknown keyword: "${G}"`)}b3.checkUnknownRules=P3;function C3($,Z){if(typeof $=="boolean")return!$;for(let X in $)if(Z[X])return!0;return!1}b3.schemaHasRules=C3;function jC($,Z){if(typeof $=="boolean")return!$;for(let X in $)if(X!=="$ref"&&Z.all[X])return!0;return!1}b3.schemaHasRulesButRef=jC;function OC({topSchemaRef:$,schemaPath:Z},X,Q,J){if(!J){if(typeof X=="number"||typeof X=="boolean")return X;if(typeof X=="string")return y0._`${X}`}return y0._`${$}${Z}${(0,y0.getProperty)(Q)}`}b3.schemaRefOrVal=OC;function EC($){return S3(decodeURIComponent($))}b3.unescapeFragment=EC;function RC($){return encodeURIComponent(jQ($))}b3.escapeFragment=RC;function jQ($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}b3.escapeJsonPointer=jQ;function S3($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}b3.unescapeJsonPointer=S3;function PC($,Z){if(Array.isArray($))for(let X of $)Z(X);else Z($)}b3.eachItem=PC;function E3({mergeNames:$,mergeToName:Z,mergeValues:X,resultToName:Q}){return(J,G,W,Y)=>{let z=W===void 0?G:W instanceof y0.Name?(G instanceof y0.Name?$(J,G,W):Z(J,G,W),W):G instanceof y0.Name?(Z(J,W,G),G):X(G,W);return Y===y0.Name&&!(z instanceof y0.Name)?Q(J,z):z}}b3.mergeEvaluated={props:E3({mergeNames:($,Z,X)=>$.if(y0._`${X} !== true && ${Z} !== undefined`,()=>{$.if(y0._`${Z} === true`,()=>$.assign(X,!0),()=>$.assign(X,y0._`${X} || {}`).code(y0._`Object.assign(${X}, ${Z})`))}),mergeToName:($,Z,X)=>$.if(y0._`${X} !== true`,()=>{if(Z===!0)$.assign(X,!0);else $.assign(X,y0._`${X} || {}`),OQ($,X,Z)}),mergeValues:($,Z)=>$===!0?!0:{...$,...Z},resultToName:_3}),items:E3({mergeNames:($,Z,X)=>$.if(y0._`${X} !== true && ${Z} !== undefined`,()=>$.assign(X,y0._`${Z} === true ? true : ${X} > ${Z} ? ${X} : ${Z}`)),mergeToName:($,Z,X)=>$.if(y0._`${X} !== true`,()=>$.assign(X,Z===!0?!0:y0._`${X} > ${Z} ? ${X} : ${Z}`)),mergeValues:($,Z)=>$===!0?!0:Math.max($,Z),resultToName:($,Z)=>$.var("items",Z)})};function _3($,Z){if(Z===!0)return $.var("props",!0);let X=$.var("props",y0._`{}`);if(Z!==void 0)OQ($,X,Z);return X}b3.evaluatedPropsToName=_3;function OQ($,Z,X){Object.keys(X).forEach((Q)=>$.assign(y0._`${Z}${(0,y0.getProperty)(Q)}`,!0))}b3.setEvaluated=OQ;var R3={};function CC($,Z){return $.scopeValue("func",{ref:Z,code:R3[Z.code]||(R3[Z.code]=new DC._Code(Z.code))})}b3.useFunc=CC;var TQ;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(TQ||(b3.Type=TQ={}));function SC($,Z,X){if($ instanceof y0.Name){let Q=Z===TQ.Num;return X?Q?y0._`"[" + ${$} + "]"`:y0._`"['" + ${$} + "']"`:Q?y0._`"/" + ${$}`:y0._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return X?(0,y0.getProperty)($).toString():"/"+jQ($)}b3.getErrorPath=SC;function x3($,Z,X=$.opts.strictSchema){if(!X)return;if(Z=`strict mode: ${Z}`,X===!0)throw Error(Z);$.self.logger.warn(Z)}b3.checkStrictMode=x3});var Q6=x((y3)=>{Object.defineProperty(y3,"__esModule",{value:!0});var H$=D0(),rC={data:new H$.Name("data"),valCxt:new H$.Name("valCxt"),instancePath:new H$.Name("instancePath"),parentData:new H$.Name("parentData"),parentDataProperty:new H$.Name("parentDataProperty"),rootData:new H$.Name("rootData"),dynamicAnchors:new H$.Name("dynamicAnchors"),vErrors:new H$.Name("vErrors"),errors:new H$.Name("errors"),this:new H$.Name("this"),self:new H$.Name("self"),scope:new H$.Name("scope"),json:new H$.Name("json"),jsonPos:new H$.Name("jsonPos"),jsonLen:new H$.Name("jsonLen"),jsonPart:new H$.Name("jsonPart")};y3.default=rC});var n9=x((h3)=>{Object.defineProperty(h3,"__esModule",{value:!0});h3.extendErrors=h3.resetErrorsCount=h3.reportExtraError=h3.reportError=h3.keyword$DataError=h3.keywordError=void 0;var S0=D0(),o8=R0(),w$=Q6();h3.keywordError={message:({keyword:$})=>S0.str`must pass "${$}" keyword validation`};h3.keyword$DataError={message:({keyword:$,schemaType:Z})=>Z?S0.str`"${$}" keyword must be ${Z} ($data)`:S0.str`"${$}" keyword is invalid ($data)`};function oC($,Z=h3.keywordError,X,Q){let{it:J}=$,{gen:G,compositeRule:W,allErrors:Y}=J,z=f3($,Z,X);if(Q!==null&&Q!==void 0?Q:W||Y)v3(G,z);else g3(J,S0._`[${z}]`)}h3.reportError=oC;function sC($,Z=h3.keywordError,X){let{it:Q}=$,{gen:J,compositeRule:G,allErrors:W}=Q,Y=f3($,Z,X);if(v3(J,Y),!(G||W))g3(Q,w$.default.vErrors)}h3.reportExtraError=sC;function tC($,Z){$.assign(w$.default.errors,Z),$.if(S0._`${w$.default.vErrors} !== null`,()=>$.if(Z,()=>$.assign(S0._`${w$.default.vErrors}.length`,Z),()=>$.assign(w$.default.vErrors,null)))}h3.resetErrorsCount=tC;function eC({gen:$,keyword:Z,schemaValue:X,data:Q,errsCount:J,it:G}){if(J===void 0)throw Error("ajv implementation error");let W=$.name("err");$.forRange("i",J,w$.default.errors,(Y)=>{if($.const(W,S0._`${w$.default.vErrors}[${Y}]`),$.if(S0._`${W}.instancePath === undefined`,()=>$.assign(S0._`${W}.instancePath`,(0,S0.strConcat)(w$.default.instancePath,G.errorPath))),$.assign(S0._`${W}.schemaPath`,S0.str`${G.errSchemaPath}/${Z}`),G.opts.verbose)$.assign(S0._`${W}.schema`,X),$.assign(S0._`${W}.data`,Q)})}h3.extendErrors=eC;function v3($,Z){let X=$.const("err",Z);$.if(S0._`${w$.default.vErrors} === null`,()=>$.assign(w$.default.vErrors,S0._`[${X}]`),S0._`${w$.default.vErrors}.push(${X})`),$.code(S0._`${w$.default.errors}++`)}function g3($,Z){let{gen:X,validateName:Q,schemaEnv:J}=$;if(J.$async)X.throw(S0._`new ${$.ValidationError}(${Z})`);else X.assign(S0._`${Q}.errors`,Z),X.return(!1)}var Z4={keyword:new S0.Name("keyword"),schemaPath:new S0.Name("schemaPath"),params:new S0.Name("params"),propertyName:new S0.Name("propertyName"),message:new S0.Name("message"),schema:new S0.Name("schema"),parentSchema:new S0.Name("parentSchema")};function f3($,Z,X){let{createErrors:Q}=$.it;if(Q===!1)return S0._`{}`;return $S($,Z,X)}function $S($,Z,X={}){let{gen:Q,it:J}=$,G=[ZS(J,X),XS($,X)];return QS($,Z,G),Q.object(...G)}function ZS({errorPath:$},{instancePath:Z}){let X=Z?S0.str`${$}${(0,o8.getErrorPath)(Z,o8.Type.Str)}`:$;return[w$.default.instancePath,(0,S0.strConcat)(w$.default.instancePath,X)]}function XS({keyword:$,it:{errSchemaPath:Z}},{schemaPath:X,parentSchema:Q}){let J=Q?Z:S0.str`${Z}/${$}`;if(X)J=S0.str`${J}${(0,o8.getErrorPath)(X,o8.Type.Str)}`;return[Z4.schemaPath,J]}function QS($,{params:Z,message:X},Q){let{keyword:J,data:G,schemaValue:W,it:Y}=$,{opts:z,propertyName:q,topSchemaRef:H,schemaPath:B}=Y;if(Q.push([Z4.keyword,J],[Z4.params,typeof Z=="function"?Z($):Z||S0._`{}`]),z.messages)Q.push([Z4.message,typeof X=="function"?X($):X]);if(z.verbose)Q.push([Z4.schema,W],[Z4.parentSchema,S0._`${H}${B}`],[w$.default.data,G]);if(q)Q.push([Z4.propertyName,q])}});var c3=x((d3)=>{Object.defineProperty(d3,"__esModule",{value:!0});d3.boolOrEmptySchema=d3.topBoolOrEmptySchema=void 0;var zS=n9(),qS=D0(),US=Q6(),KS={message:"boolean schema is false"};function HS($){let{gen:Z,schema:X,validateName:Q}=$;if(X===!1)m3($,!1);else if(typeof X=="object"&&X.$async===!0)Z.return(US.default.data);else Z.assign(qS._`${Q}.errors`,null),Z.return(!0)}d3.topBoolOrEmptySchema=HS;function VS($,Z){let{gen:X,schema:Q}=$;if(Q===!1)X.var(Z,!1),m3($);else X.var(Z,!0)}d3.boolOrEmptySchema=VS;function m3($,Z){let{gen:X,data:Q}=$,J={gen:X,keyword:"false schema",data:Q,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};(0,zS.reportError)(J,KS,void 0,Z)}});var RQ=x((p3)=>{Object.defineProperty(p3,"__esModule",{value:!0});p3.getRules=p3.isJSONType=void 0;var FS=["string","number","integer","boolean","null","object","array"],LS=new Set(FS);function MS($){return typeof $=="string"&&LS.has($)}p3.isJSONType=MS;function AS(){let $={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...$,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},$.number,$.string,$.array,$.object],post:{rules:[]},all:{},keywords:{}}}p3.getRules=AS});var PQ=x((a3)=>{Object.defineProperty(a3,"__esModule",{value:!0});a3.shouldUseRule=a3.shouldUseGroup=a3.schemaHasRulesForType=void 0;function NS({schema:$,self:Z},X){let Q=Z.RULES.types[X];return Q&&Q!==!0&&n3($,Q)}a3.schemaHasRulesForType=NS;function n3($,Z){return Z.rules.some((X)=>r3($,X))}a3.shouldUseGroup=n3;function r3($,Z){var X;return $[Z.keyword]!==void 0||((X=Z.definition.implements)===null||X===void 0?void 0:X.some((Q)=>$[Q]!==void 0))}a3.shouldUseRule=r3});var r9=x(($B)=>{Object.defineProperty($B,"__esModule",{value:!0});$B.reportTypeError=$B.checkDataTypes=$B.checkDataType=$B.coerceAndCheckDataType=$B.getJSONTypes=$B.getSchemaTypes=$B.DataType=void 0;var TS=RQ(),jS=PQ(),OS=n9(),E0=D0(),s3=R0(),d4;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(d4||($B.DataType=d4={}));function ES($){let Z=t3($.type);if(Z.includes("null")){if($.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!Z.length&&$.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if($.nullable===!0)Z.push("null")}return Z}$B.getSchemaTypes=ES;function t3($){let Z=Array.isArray($)?$:$?[$]:[];if(Z.every(TS.isJSONType))return Z;throw Error("type must be JSONType or JSONType[]: "+Z.join(","))}$B.getJSONTypes=t3;function RS($,Z){let{gen:X,data:Q,opts:J}=$,G=PS(Z,J.coerceTypes),W=Z.length>0&&!(G.length===0&&Z.length===1&&(0,jS.schemaHasRulesForType)($,Z[0]));if(W){let Y=SQ(Z,Q,J.strictNumbers,d4.Wrong);X.if(Y,()=>{if(G.length)CS($,Z,G);else _Q($)})}return W}$B.coerceAndCheckDataType=RS;var e3=new Set(["string","number","integer","boolean","null"]);function PS($,Z){return Z?$.filter((X)=>e3.has(X)||Z==="array"&&X==="array"):[]}function CS($,Z,X){let{gen:Q,data:J,opts:G}=$,W=Q.let("dataType",E0._`typeof ${J}`),Y=Q.let("coerced",E0._`undefined`);if(G.coerceTypes==="array")Q.if(E0._`${W} == 'object' && Array.isArray(${J}) && ${J}.length == 1`,()=>Q.assign(J,E0._`${J}[0]`).assign(W,E0._`typeof ${J}`).if(SQ(Z,J,G.strictNumbers),()=>Q.assign(Y,J)));Q.if(E0._`${Y} !== undefined`);for(let q of X)if(e3.has(q)||q==="array"&&G.coerceTypes==="array")z(q);Q.else(),_Q($),Q.endIf(),Q.if(E0._`${Y} !== undefined`,()=>{Q.assign(J,Y),SS($,Y)});function z(q){switch(q){case"string":Q.elseIf(E0._`${W} == "number" || ${W} == "boolean"`).assign(Y,E0._`"" + ${J}`).elseIf(E0._`${J} === null`).assign(Y,E0._`""`);return;case"number":Q.elseIf(E0._`${W} == "boolean" || ${J} === null
|
|
388
|
+
${D}`);let{extAttrs:Q0}=K,L0=Q0.indexOf(M),M0=Q0.splice(L0,1);Q0.length?Q0.length===L0?Q0[L0-1].tokens.separator=void 0:Q0[L0].tokens.name.trivia.trim()||(Q0[L0].tokens.name.trivia=M0[0].tokens.name.trivia):Q0.tokens.open=Q0.tokens.close=void 0}}class z6 extends K${static parse(K,M,{extMembers:D=[],partial:j}={}){let O={partial:j,base:M};if(O.mixin=K.consume("mixin"),O.mixin)return K$.parse(K,new z6({source:K.source,tokens:O}),{allowedMembers:[...D,[I1.parse],[o],[r.parse,{noInherit:!0}],[X0.parse,{regular:!0}]]})}get type(){return"interface mixin"}}class q6 extends G{static parse(K){let M={},D=$0(new q6({source:K.source,tokens:M}));return D.extAttrs=T.parse(K),M.required=K.consume("required"),D.idlType=K0(K,"dictionary-type")||K.error("Dictionary member lacks a type"),M.name=K.consumeKind("identifier")||K.error("Dictionary member lacks a name"),D.default=y.parse(K),M.required&&D.default&&K.error("Required member must not have a default"),M.termination=K.consume(";")||K.error("Unterminated dictionary member, expected `;`"),D.this}get type(){return"field"}get name(){return u(this.tokens.name.value)}get required(){return!!this.tokens.required}*validate(K){yield*this.idlType.validate(K)}write(K){let{parent:M}=this;return K.ts.definition(K.ts.wrap([this.extAttrs.write(K),K.token(this.tokens.required),K.ts.type(this.idlType.write(K)),K.name_token(this.tokens.name,{data:this,parent:M}),this.default?this.default.write(K):"",K.token(this.tokens.termination)]),{data:this,parent:M})}}class K6 extends K${static parse(K,{extMembers:M=[],partial:D}={}){let j={partial:D};if(j.base=K.consume("dictionary"),j.base)return K$.parse(K,new K6({source:K.source,tokens:j}),{inheritable:!D,allowedMembers:[...M,[q6.parse]]})}get type(){return"dictionary"}}class V extends K${static parse(K,{extMembers:M=[],partial:D}={}){let j={partial:D};if(j.base=K.consume("namespace"),j.base)return K$.parse(K,new V({source:K.source,tokens:j}),{allowedMembers:[...M,[r.parse,{noInherit:!0,readonly:!0}],[I1.parse],[X0.parse,{regular:!0}]]})}get type(){return"namespace"}*validate(K){if(!this.partial&&this.extAttrs.every((M)=>M.name!=="Exposed"))yield J(this.tokens.name,this,"require-exposed","Namespaces must have [Exposed] extended attribute. To fix, add, for example, [Exposed=Window]. Please also consider carefully if your namespace should also be exposed in a Worker scope. Refer to the [WebIDL spec section on Exposed](https://heycam.github.io/webidl/#Exposed) for more information.",{autofix:Z0(this)});yield*super.validate(K)}}class S extends K${static parse(K,M,{extMembers:D=[]}={}){let j={callback:M};if(j.base=K.consume("interface"),j.base)return K$.parse(K,new S({source:K.source,tokens:j}),{allowedMembers:[...D,[I1.parse],[X0.parse,{regular:!0}]]})}get type(){return"callback interface"}}function m(K,M){let D=K.source;function j(L0){K.error(L0)}function O(...L0){return K.consume(...L0)}function g(L0){let M0=O("interface");if(M0)return z6.parse(K,M0,{...L0,...M?.extensions?.mixin})||h$.parse(K,M0,{...L0,...M?.extensions?.interface})||j("Interface has no proper body")}function i(){if(M.productions)for(let L0 of M.productions){let M0=L0(K);if(M0)return M0}return function(){let L0=O("callback");if(L0)return K.probe("interface")?S.parse(K,L0,{...M?.extensions?.callbackInterface}):f$.parse(K,L0)}()||g()||function(){let L0=O("partial");if(L0)return K6.parse(K,{partial:L0,...M?.extensions?.dictionary})||g({partial:L0})||V.parse(K,{partial:L0,...M?.extensions?.namespace})||j("Partial doesn't apply to anything")}()||K6.parse(K,M?.extensions?.dictionary)||q$.parse(K)||A1.parse(K)||M1.parse(K)||V.parse(K,M?.extensions?.namespace)}let Q0=function(){if(!D.length)return[];let L0=[];for(;;){let j0=T.parse(K),b0=i();if(!b0){j0.length&&j("Stray extended attributes");break}$0(b0).extAttrs=j0,L0.push(b0)}let M0=H.parse(K);return M.concrete&&L0.push(M0),L0}();return K.position<D.length&&j("Unrecognised tokens"),Q0}function p(K,M={}){let D=new v0(K);return M.sourceName!==void 0&&(D.source.name=M.sourceName),m(D,M)}function k(K){return K}let a={wrap:(K)=>K.join(""),trivia:k,name:k,reference:k,type:k,generic:k,nameless:k,inheritance:k,definition:k,extendedAttribute:k,extendedAttributeReference:k};class A{constructor(K){this.ts=Object.assign({},a,K)}reference(K,{unescaped:M,context:D}){return M||(M=K.startsWith("_")?K.slice(1):K),this.ts.reference(K,M,D)}token(K,M=k,...D){if(!K)return"";let j=M(K.value,...D);return this.ts.wrap([this.ts.trivia(K.trivia),j])}reference_token(K,M){return this.token(K,this.reference.bind(this),{context:M})}name_token(K,M){return this.token(K,this.ts.name,M)}identifier(K,M){return this.ts.wrap([this.reference_token(K.tokens.value,M),this.token(K.tokens.separator)])}}function _(K,{templates:M=a}={}){M=Object.assign({},a,M);let D=new A(M);return M.wrap(K.map((j)=>j.write(D)))}function n(K,M){let D=new Map,j=K.filter((O)=>O.type==="includes");for(let O of j){let g=M.get(O.includes);if(!g)continue;let i=D.get(O.target);i?i.push(g):D.set(O.target,[g])}return D}function*d(K){let M=function(D){let j=new Map,O=new Set,g=new Map;for(let i of D)if(i.partial){let Q0=g.get(i.name);Q0?Q0.push(i):g.set(i.name,[i])}else i.name&&(j.has(i.name)?O.add(i):j.set(i.name,i));return{all:D,unique:j,partials:g,duplicates:O,mixinMap:n(D,j),cache:{typedefIncludesDictionary:new WeakMap,dictionaryIncludesRequiredField:new WeakMap}}}(K);for(let D of M.all)D.validate&&(yield*D.validate(M));yield*function*({unique:D,duplicates:j}){for(let O of j){let{name:g}=O,i=`The name "${g}" of type "${D.get(g).type}" was already seen`;yield J(O.tokens.name,O,"no-duplicate",i)}}(M)}function c(K){return[...d((M=K,M.flat?M.flat():[].concat(...M)))];var M}return Z})())});var lH=b((ap,dH)=>{var __dirname="/home/runner/work/jx/jx/node_modules/@webref/idl",hH=O0("fs").promises,fH=O0("path"),oP=gH();class uH{constructor($,Z){this.filename=Z,this.shortname=fH.basename(Z,".idl"),this.path=fH.join($,Z)}async text(){return await hH.readFile(this.path,"utf8")}async parse(){let $=await this.text();return oP.parse($)}}async function mH({folder:$=__dirname}={}){let Z={},X=await hH.readdir($);for(let Q of X)if(Q.endsWith(".idl")){let J=new uH($,Q);Z[J.shortname]=J}return Z}async function sP($){let Z=await mH($);for(let[X,Q]of Object.entries(Z))Z[X]=await Q.parse();return Z}dH.exports={listAll:mH,parseAll:sP}});var cH;var pH=s(()=>{cH={description:"HTML element tag name or custom element name (must contain a hyphen per Web Components spec).",minLength:1,type:"string"}});var iH,nH,rH;var aH=s(()=>{iH={oneOf:[{type:"string"},{$ref:"#/$defs/RefObject"}]},nH={oneOf:[{type:"boolean"},{$ref:"#/$defs/RefObject"}]},rH={oneOf:[{type:"number"},{$ref:"#/$defs/RefObject"}]}});var oH;var sH=s(()=>{oH={additionalProperties:!0,description:"A page-level <head> entry. Defines meta tags, link tags, script tags, etc.",properties:{attributes:{additionalProperties:{oneOf:[{type:"string"},{type:"boolean"}]},type:"object"},children:{items:{$ref:"#/$defs/HeadEntry"},type:"array"},tagName:{type:"string"},textContent:{type:"string"}},required:["tagName"],type:"object"}});var tH,eH;var $V=s(()=>{tH={description:"A CEM-compatible parameter definition for a function. Follows the Custom Elements Manifest Parameter shape.",properties:{default:{description:"Default value for the parameter."},description:{description:"Parameter documentation.",type:"string"},name:{description:"Parameter name.",type:"string"},optional:{description:"Whether the parameter is optional.",type:"boolean"},type:{description:"Parameter type (JSON Schema or CEM { text } format)."}},required:["name"],type:"object"},eH={description:"A CEM-compatible event definition. Describes a CustomEvent the function dispatches.",properties:{deprecated:{description:"Deprecation notice.",oneOf:[{type:"boolean"},{type:"string"}]},description:{description:"Event documentation.",type:"string"},name:{description:"Event name (e.g. 'task-toggled').",type:"string"},type:{description:"Event type (e.g. { text: 'CustomEvent' })."}},required:["name"],type:"object"}});var ZV;var XV=s(()=>{ZV={enum:["string","number","integer","boolean","array","object","null"],type:"string"}});var QV,JV,GV,WV,YV,zV,qV,KV,UV;var HV=s(()=>{QV={description:"Reference to a $defs type definition in the current component.",examples:["#/$defs/Count","#/$defs/TodoItem","#/$defs/Status"],pattern:"^#/\\$defs/",type:"string"},JV={description:"Reference to a state entry (runtime variable) in the current component.",examples:["#/state/count","#/state/addTask","#/state/items"],pattern:"^#/state/",type:"string"},GV={description:"Reference to an external Jx component file.",examples:["./card.json","https://cdn.example.com/button.json"],pattern:"^(\\./|\\.\\./).*\\.json$|^https?://",type:"string"},WV={description:"Reference to a window or document global.",examples:["window#/currentUser","document#/appConfig"],pattern:"^(window|document)#/",type:"string"},YV={description:"Reference to a named state entry passed via $props from a parent component.",examples:["parent#/sharedState","parent#/theme"],pattern:"^parent#/",type:"string"},zV={description:"Reference to the current Array map iteration context.",examples:["$map/item","$map/index","$map/item/text","$map/item/done"],pattern:"^\\$map/(item|index)(/.*)?$",type:"string"},qV={oneOf:[{$ref:"#/$defs/InternalRef"},{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/ExternalRef"},{$ref:"#/$defs/GlobalRef"},{$ref:"#/$defs/ParentRef"},{$ref:"#/$defs/MapRef"}],type:"string"},KV={additionalProperties:!1,description:"A $ref binding. Resolves to a state entry (reactive) or plain value (static).",properties:{$ref:{$ref:"#/$defs/AnyRef"}},required:["$ref"],type:"object"},UV={properties:{$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"}},required:["$ref"],type:"object"}});var n5;var VV=s(()=>{n5={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/StyleObject"}]},description:"CSS style definition. camelCase property names follow CSSOM convention. Keys starting with :, ., &, or [ are treated as nested CSS selectors. Keys matching $media breakpoint names (or other @-prefixed at-rules) group nested rules. Nesting is recursive: selector and at-rule groups may nest to arbitrary depth "+"(e.g. breakpoint → selector → pseudo-class), mirroring the compiler's recursive emission.",properties:{},type:"object"}});var BV,FV;var LV=s(()=>{BV={additionalProperties:!1,description:"Dynamic mapped list. Re-renders when the items state entry changes.",properties:{$prototype:{const:"Array",type:"string"},filter:{$ref:"#/$defs/RefObject"},items:{oneOf:[{$ref:"#/$defs/RefObject"},{type:"array"}]},map:{$ref:"#/$defs/ElementDef"},sort:{$ref:"#/$defs/RefObject"}},required:["$prototype","items","map"],type:"object"},FV={description:"Array of child definitions — elements, text, or Array namespaces (dynamic lists) mixed "+"freely. A bare Array namespace (the whole children slot is one dynamic list) is also "+"accepted for backward compatibility, as is a ${…} template string that resolves at build "+"time to an array of child definitions.",oneOf:[{items:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ArrayNamespace"},{type:"string"},{type:"number"}]},type:"array"},{$ref:"#/$defs/ArrayNamespace"},{description:"Computed children — a ${…} template that resolves at build time to an array of child "+'definitions (e.g. "${state.entry.$children}" for parsed content). A bare plain-text string is NOT a valid children value; text children must be array items.',pattern:"\\$\\{",type:"string"}]}});var MV,AV,IV,NV,DV,VQ;var wV=s(()=>{MV={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{$ref:"#/$defs/RefObject"}]},description:"HTML attributes and ARIA attributes set via element.setAttribute().",type:"object"},AV={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array"},{type:"object"},{$ref:"#/$defs/RefObject"}]},description:"Explicit prop passing at a component boundary.",type:"object"},IV={oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{$ref:"#/$defs/RefObject"}]},NV={additionalProperties:!1,description:"Reactive $ref that drives which case to render.",properties:{$ref:{$ref:"#/$defs/StateRef"}},required:["$ref"],type:"object"},DV={properties:{$switch:{$ref:"#/$defs/SwitchDef"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},type:"object"},tagName:{$ref:"#/$defs/TagName"}},required:["$switch","cases"],type:"object"},VQ={additionalProperties:{$ref:"#/$defs/ElementPropertyValue"},description:"A Jx element definition. Maps directly to a DOM element.",properties:{"$map/index":{$ref:"#/$defs/RefObject"},"$map/item":{$ref:"#/$defs/RefObject"},$props:{$ref:"#/$defs/PropsObject"},$ref:{$ref:"#/$defs/ExternalRef"},$switch:{$ref:"#/$defs/SwitchDef"},alt:{$ref:"#/$defs/StringOrRef"},attributes:{$ref:"#/$defs/AttributesObject"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},description:"Switch cases for this element. Maps case values to element definitions or external component refs, rendered according to the reactive $switch discriminant.",type:"object"},checked:{$ref:"#/$defs/BoolOrRef"},children:{$ref:"#/$defs/ChildrenValue"},className:{$ref:"#/$defs/StringOrRef"},dir:{enum:["ltr","rtl","auto"],type:"string"},disabled:{$ref:"#/$defs/BoolOrRef"},hidden:{$ref:"#/$defs/BoolOrRef"},href:{$ref:"#/$defs/StringOrRef"},id:{type:"string"},innerHTML:{$ref:"#/$defs/StringOrRef"},innerText:{$ref:"#/$defs/StringOrRef"},lang:{$ref:"#/$defs/StringOrRef"},name:{$ref:"#/$defs/StringOrRef"},placeholder:{$ref:"#/$defs/StringOrRef"},selected:{$ref:"#/$defs/BoolOrRef"},src:{$ref:"#/$defs/StringOrRef"},style:{$ref:"#/$defs/StyleObject"},tabIndex:{$ref:"#/$defs/NumberOrRef"},tagName:{$ref:"#/$defs/TagName"},textContent:{$ref:"#/$defs/StringOrRef"},title:{$ref:"#/$defs/StringOrRef"},type:{$ref:"#/$defs/StringOrRef"},value:{$ref:"#/$defs/StringOrRef"}},required:["tagName"],type:"object"}});var TV;var jV=s(()=>{TV={description:"A typed reactive state variable with explicit type and default value. The type property is a JSON Schema or $ref to a $defs type definition. The default property is the initial runtime value.",not:{required:["$prototype"]},properties:{$ref:{description:"Reference to a shared type definition.",type:"string"},attribute:{description:"Linked HTML attribute name for CEM extraction.",type:"string"},default:{description:"Initial state value."},deprecated:{description:"Deprecation notice for CEM extraction.",oneOf:[{type:"boolean"},{type:"string"}]},description:{type:"string"},examples:{type:"array"},reflects:{description:"Whether property changes reflect back to the HTML attribute.",type:"boolean"},type:{description:"JSON Schema type definition, $ref to a $defs type, or JSON Schema type string.",oneOf:[{type:"string"},{type:"object"}]}},required:["default"],type:"object"}});var OV;var EV=s(()=>{OV={additionalProperties:!1,description:'A function declaration. $prototype must be "Function". body (inline) and $src (external) are mutually exclusive. First parameter is always state (the reactive scope).',properties:{$export:{description:"Named export in $src module. Defaults to the state key name.",type:"string"},$prototype:{const:"Function",type:"string"},$src:{description:"External module specifier. Mutually exclusive with body.",examples:["./counter.js","npm:@myorg/validators"],type:"string"},arguments:{description:"Legacy alias for parameters: bare string parameter names (state may be listed explicitly as the first name). Superseded by parameters.",examples:[["state","event"]],items:{type:"string"},type:"array"},body:{description:"Inline function body: an opaque JS source string (first implicit parameter is state), or a structured statement array (spec §20) — explicit structured function declaration, analyzable by tooling and editable visually. The escalation ladder within the shape is structured statements → JS string.",examples:["state.count++",'state.items.push({ id: Date.now(), text: "", done: false })','return state.score >= 90 ? "gold" : "silver"',[{operator:"push",target:{$ref:"#/state/cart"},value:1},{dispatchEvent:"cart-changed",detail:{$ref:"#/state/cart"}}]],oneOf:[{type:"string"},{$ref:"#/$defs/StatementList"}]},description:{type:"string"},emits:{description:"Array of CEM-compatible Event objects this function dispatches. Used for CEM extraction and studio event discovery.",items:{$ref:"#/$defs/CemEvent"},type:"array"},name:{description:"Explicit function name. Defaults to the state key name.",type:"string"},parameters:{description:"Function parameters (after the implicit state parameter). Accepts CEM-compatible parameter objects or bare string names for backward compatibility.",examples:[["event"],[{name:"event",type:{text:"Event"}}],[{description:"Item identifier",name:"id",type:{text:"number"}}]],items:{oneOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"},type:{description:"Return type for tooling (JSON Schema or CEM { text } format)."}},required:["$prototype"],type:"object"}});var RV,PV;var CV=s(()=>{RV={description:"One statement of a structured function body. Either a bare expression node in statement position (a mutation like =/push, or a call — its result discarded unless captured by an assignment), an if/then/else branch (JSON Schema conditional keywords; if holds a pure expression, then/else hold statement lists), a $switch multiway branch (discriminant matched by string form against cases keys, like element-level $switch), or a dispatchEvent statement (WHATWG DOM: dispatches a CustomEvent from the handler's current target, with CustomEventInit members detail/bubbles/composed).",oneOf:[{$ref:"#/$defs/ExpressionNode"},{additionalProperties:!1,properties:{else:{items:{$ref:"#/$defs/Statement"},type:"array"},if:{$ref:"#/$defs/ExpressionOperand"},then:{items:{$ref:"#/$defs/Statement"},type:"array"}},required:["if","then"],title:"if / then / else — conditional branch (JSON Schema keyword triple)",type:"object"},{additionalProperties:!1,properties:{$switch:{$ref:"#/$defs/ExpressionOperand"},cases:{additionalProperties:{items:{$ref:"#/$defs/Statement"},type:"array"},type:"object"},default:{items:{$ref:"#/$defs/Statement"},type:"array"}},required:["$switch","cases"],title:"$switch / cases — multiway branch (element-level convention, ECMA switch semantics)",type:"object"},{additionalProperties:!1,properties:{bubbles:{type:"boolean"},composed:{type:"boolean"},detail:{$ref:"#/$defs/ExpressionOperand"},dispatchEvent:{description:"The CustomEvent type to dispatch (WHATWG DOM dispatchEvent).",type:"string"}},required:["dispatchEvent"],title:"dispatchEvent — emit a CustomEvent (WHATWG naming, CustomEventInit members)",type:"object"}]},PV={description:"A structured function body: statements executed sequentially (one yielding a promise is awaited before the next, per ECMA async/await semantics).",items:{$ref:"#/$defs/Statement"},type:"array"}});var SV;var _V=s(()=>{SV={description:'An external class / data source. $prototype is a constructor name (not "Function"). When $prototype is not in the built-in registry, $src is required. All state entries are reactive by default.',properties:{$export:{description:"Named export in $src module. Defaults to the $prototype value.",type:"string"},$prototype:{description:"Constructor name — built-in Web API class or external class name.",examples:["Request","URLSearchParams","FormData","LocalStorage","SessionStorage","Cookie","IndexedDB","Array","Set","Map","Blob","ReadableStream","MarkdownCollection","MyParser"],not:{const:"Function"},type:"string"},$src:{description:"External module specifier. Required when $prototype is not a built-in.",examples:["@jxsuite/md","./lib/my-parser.js","npm:@myorg/data"],type:"string"},autoIncrement:{type:"boolean"},body:{},database:{type:"string"},debounce:{minimum:0,type:"integer"},default:{},description:{type:"string"},domain:{type:"string"},expires:{type:"string"},filter:{$ref:"#/$defs/RefObject"},headers:{additionalProperties:{type:"string"},type:"object"},indexes:{items:{properties:{keyPath:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},name:{type:"string"},unique:{type:"boolean"}},required:["name","keyPath"],type:"object"},type:"array"},items:{},key:{type:"string"},keyPath:{type:"string"},manual:{type:"boolean"},map:{$ref:"#/$defs/ElementDef"},maxAge:{type:"integer"},method:{enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],type:"string"},name:{type:"string"},path:{type:"string"},responseType:{enum:["json","text","blob","arraybuffer","document",""],type:"string"},sameSite:{enum:["strict","lax","none"],type:"string"},secure:{type:"boolean"},sort:{anyOf:[{$ref:"#/$defs/RefObject"},{description:"A single sort rule, e.g. { field, order }.",type:"object"},{description:'Ordered sort rules, e.g. [{ field: "date", order: "desc" }].',items:{type:"object"},type:"array"}],description:"Sort configuration: a reactive $ref binding, a single { field, order } rule, or an ordered array of rules."},src:{description:"Configuration property passed to external class constructor.",type:"string"},store:{type:"string"},timing:{enum:["compiler","server","client"],type:"string"},url:{$ref:"#/$defs/StringOrRef"},version:{minimum:1,type:"integer"}},required:["$prototype"],type:"object"}});var bV;var xV=s(()=>{bV={description:"A reusable JSON Schema type definition for tooling only. No function, no runtime artifact. Referenced from state entries via $ref. Naming convention: PascalCase.",not:{anyOf:[{required:["default"]},{required:["$prototype"]}]},properties:{description:{type:"string"},enum:{type:"array"},examples:{type:"array"},items:{},maxLength:{minimum:0,type:"integer"},maximum:{type:"number"},minLength:{minimum:0,type:"integer"},minimum:{type:"number"},pattern:{type:"string"},properties:{type:"object"},required:{items:{type:"string"},type:"array"},type:{$ref:"#/$defs/JsonSchemaType"}},required:["type"],type:"object"}});var kV,yV,vV,gV,fV,hV,uV,mV,dV,lV,cV,pV,iV,nV,rV,aV,oV;var sV=s(()=>{kV={additionalProperties:!1,description:"A JSON Pointer $ref operand within an expression node. $args/<name> resolves a named formula's parameter (callable entries only).",properties:{$ref:{pattern:"^(\\$map/|\\$reduce/|\\$args/|event#/|#/|parent#/|window#/|document#/)",type:"string"}},required:["$ref"],type:"object"},yV={anyOf:[{not:{pattern:"\\$\\{"},type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"},{description:"Plain-object literal (e.g. an Intl options bag). Objects carrying $ref or operator keys are pointers/nodes, never literals.",not:{anyOf:[{required:["$ref"]},{required:["operator"]}]},type:"object"}],description:"A non-reactive operand: scalar, plain-object literal, or array of operands."},vV={anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"},{$ref:"#/$defs/ExpressionLiteral"}],description:"Anything that may appear in target or value: a pointer, a literal, or a nested expression node."},gV={enum:["!","-"]},fV={enum:["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]},hV={const:"?:"},uV={const:"switch"},mV={const:"call"},dV={description:"A genuine pure String.prototype / Array.prototype / Number.prototype method (spec §19.4d). The ES2023 change-by-copy family (toSorted, toReversed, toSpliced, with) stands in where mutation would otherwise occur. Receiver in target; value carries the argument (bare scalar) or argument list (array).",enum:["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"]},lV={enum:["=","+=","-=","*=","/="]},cV={enum:["pop","shift"]},pV={enum:["push","unshift"]},iV={const:"splice"},nV={const:"reduce"},rV={enum:["map","filter"]},aV={additionalProperties:!1,description:"The core expression node. operator + target, with value gated by arity.",oneOf:[{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/UnaryOperator"}},required:["operator"],title:"Unary — target only, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/BinaryOperator"}},required:["operator","value"],title:"Binary — left in target, right in value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/AssignmentOperator"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"Assignment — writable target, value required"},{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/NoArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator"],title:"pop / shift — array receiver, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/OneArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"push / unshift — array receiver, single value argument"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/SpliceMethod"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},minItems:1,type:"array"}},required:["operator","value"],title:"splice — array receiver, [start, deleteCount, ...items]"},{properties:{operator:{$ref:"#/$defs/ReduceMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value","initial"],title:"reduce — pure fold over a pointer or derived array; seed in initial"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/MapFilterMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value"],title:"map / filter — pure over a pointer or derived array; per-item expression in value"},{description:"The ECMAScript conditional (ternary) operator, pure: target is the test, value the consequent, initial the alternate (the reduce precedent for repurposing initial). Chain else-if by nesting another ?: node in initial.",properties:{operator:{$ref:"#/$defs/ConditionalOperator"}},required:["operator","value","initial"],title:"?: — pure conditional; test in target, consequent in value, alternate in initial"},{description:"Value-keyed multiway selection, pure: target is the discriminant (matched against case keys by its string form, like element-level $switch), cases maps matched values to result operands, default is the operand when no case matches (result is undefined without it). Condition-chain branching composes from nested ?: nodes instead.",not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},type:"object"},default:{$ref:"#/$defs/ExpressionOperand"},operator:{$ref:"#/$defs/SwitchOperator"}},required:["operator","cases"],title:"switch — pure value-keyed selection; discriminant in target, results in cases/default"},{description:"A pure standard-library method call: target is the receiver (any operand — never mutated; change-by-copy names replace the mutating originals), value the optional argument (bare scalar) or argument list (array). A missing receiver or method yields undefined, matching null-safe path reads.",not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/PureMethod"}},required:["operator"],title:"Pure method — genuine prototype methods; receiver in target, args in value"},{description:"Invoke a callable, pure in formula position: target is the callee pointer — a named formula entry (#/state/…) or a blessed pure global via window#/ (Math.*, JSON.*, Object.keys/values/entries, and the Intl helpers Intl/formatNumber, Intl/formatDate, Intl/formatRelativeTime) — and value is the positional argument list (the splice args-in-value precedent). Argument order follows the callee's declared parameters.",not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/CallOperator"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"}},required:["operator"],title:"call — invoke a named formula or blessed global; callee in target, args in value"}],properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},description:"switch only: matched discriminant value (string form) → result operand.",type:"object"},default:{$ref:"#/$defs/ExpressionOperand",description:"switch only: result operand when no case key matches."},initial:{$ref:"#/$defs/ExpressionOperand"},operator:{type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target"],type:"object"},oV={additionalProperties:!1,description:"A declarative expression entry (Shape 5). Used as a state entry or inline event handler. With parameters it is a named formula: a pure, reusable computation invoked via the call operator, its parameters resolved through $args/<name> refs in the body.",properties:{$description:{type:"string"},$expression:{$ref:"#/$defs/ExpressionNode"},$title:{type:"string"},parameters:{description:"Named-formula parameters (CEM convention, as on Function entries): bare names or CEM parameter objects. Present ⇒ the entry is callable, not a computed value.",items:{anyOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"}},required:["$expression"],type:"object"}});var tV,eV,$3,Z3;var X3=s(()=>{tV={description:"A single state entry. Shape is determined by value type: "+"scalar/array → naked reactive property, string with ${} → computed, "+'object with $prototype: "Function" → function, '+"object with $prototype: <other> → data source, "+"object with type and default → typed reactive property, "+"plain object → naked object reactive property.",oneOf:[{type:"number"},{type:"boolean"},{type:"null"},{type:"string"},{type:"array"},{$ref:"#/$defs/TypedStateDef"},{$ref:"#/$defs/FunctionDef"},{$ref:"#/$defs/ExternalClassDef"},{$ref:"#/$defs/ExpressionEntry"},{not:{anyOf:[{required:["$prototype"]},{required:["default"]},{required:["type"]},{required:["$expression"]}]},type:"object"}]},eV={additionalProperties:{$ref:"#/$defs/StateEntry"},description:"Map of runtime variables. Keys are camelCase (public) or #-prefixed (private). All entries are reactive by default.",type:"object"},$3={additionalProperties:{$ref:"#/$defs/TypeDefEntry"},description:"Map of reusable JSON Schema type definitions. Keys are PascalCase type names. No runtime artifacts are produced.",type:"object"},Z3={description:"A $defs type definition entry. Must be a pure JSON Schema type definition or a class definition (.class.json format).",oneOf:[{$ref:"#/$defs/PureTypeDef"},{$ref:"#/$defs/ClassDef"}]}});var tP,BQ,FQ,LQ,MQ,AQ,IQ,NQ,DQ,wQ,Q3;var J3=s(()=>{tP=["method","accessor","parse","serialize","discover","load","projectData","resolvePaths","lower","emit","assets","mount","dialect","deploySchema","bindings","testConnection"],BQ={description:"A typed parameter definition for a class.",properties:{default:{},description:{type:"string"},examples:{type:"array"},format:{description:`When "json-schema", this parameter's value is itself a JSON Schema.`,type:"string"},identifier:{type:"string"},type:{}},required:["identifier"],type:"object"},FQ={description:"A class field definition with access control and scope.",properties:{$prototype:{description:'Data source prototype for this field (e.g., "Request").',type:"string"},access:{enum:["public","private","protected"],type:"string"},default:{},description:{type:"string"},examples:{type:"array"},identifier:{type:"string"},initializer:{},role:{const:"field",type:"string"},scope:{enum:["instance","static"],type:"string"},type:{}},type:"object"},LQ={description:"Class constructor definition.",properties:{$prototype:{const:"Function",type:"string"},body:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:{type:"string"},parameters:{items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{$ref:"#/$defs/ClassParameterDef"}]},type:"array"},role:{const:"constructor",type:"string"},superCall:{properties:{arguments:{items:{type:"string"},type:"array"}},type:"object"}},type:"object"},MQ={description:"A class method or accessor definition. Capability roles (parse, serialize, discover, load) mark static methods that hosts (compiler, server, studio) invoke for format dispatch.",properties:{$prototype:{const:"Function",type:"string"},access:{enum:["public","private","protected"],type:"string"},body:{oneOf:[{type:"string"},{items:{type:"string"},type:"array"}]},description:{type:"string"},getter:{properties:{body:{type:"string"}},type:"object"},identifier:{type:"string"},parameters:{items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{$ref:"#/$defs/ClassParameterDef"}]},type:"array"},returnType:{},role:{enum:tP,type:"string"},scope:{enum:["instance","static"],type:"string"},setter:{properties:{body:{type:"string"},parameters:{type:"array"}},type:"object"},timing:{description:"Execution environments allowed to call this capability directly. Hosts outside the list round-trip through the dev server.",items:{enum:["compiler","server","client"],type:"string"},type:"array"}},type:"object"},AQ={description:"Format participation marker. A class carrying this block is auto-discovered from the project imports map and used for file-extension dispatch by the compiler, server, and studio.",properties:{documentKinds:{description:'"page"/"component" allow the extension in pages/components discovery; "content" allows it as a content-type source.',items:{enum:["page","component","content"],type:"string"},type:"array"},exportTarget:{description:"When true, site builds emit a serialized sidecar per page in this format.",type:"boolean"},extensions:{description:'File extensions this format claims, with leading dot (e.g. [".md"]).',items:{pattern:"^\\.",type:"string"},minItems:1,type:"array"},mediaType:{description:"MIME type for the format (icons, labels, HTTP).",type:"string"},remote:{description:"When true, the load capability accepts http(s) URLs as sources.",type:"boolean"}},required:["extensions"],type:"object"},IQ={additionalProperties:!1,description:"Project-section admission block (specs/extensions.md §9). A class carrying this block owns "+"the project.json section named by `key`; hosts dispatch that section's data through the class's projectData/resolvePaths capabilities.",properties:{description:{type:"string"},key:{description:"The project.json top-level section this class owns (exclusive per project).",type:"string"},referenceable:{description:"Whether section entries can be referenced from documents (e.g. content types).",type:"boolean"},title:{type:"string"}},required:["key"],type:"object"},NQ={additionalProperties:!1,description:"Server-mount admission block (specs/extensions.md §11). A class carrying this block mounts "+"routes under its /_jx/ basePath in the site worker and dev server.",properties:{basePath:{description:"Route subtree this class mounts — must be under /_jx/ (exclusive per project).",examples:["/_jx/data","/_jx/auth"],type:"string"},module:{description:"Module specifier exporting the mount handler.",type:"string"},order:{description:"Mount order (ascending; default 100).",type:"number"}},required:["basePath"],type:"object"},DQ={description:"Connection-provider admission block (specs/extensions.md §12). A class carrying this block "+"provides database connections of the given provider/kind.",properties:{kind:{description:"SQL dialect family the provider speaks.",enum:["sqlite","postgres"],type:"string"},local:{description:"Local-development substitute provider (e.g. sqlite for D1).",type:"string"},module:{description:"Module specifier exporting the provider implementation.",type:"string"},provider:{description:"Provider identifier (e.g. d1, supabase, sqlite).",type:"string"},serve:{description:"Module specifier exporting the serve-time worker binding.",type:"string"}},required:["provider","kind"],type:"object"},wQ={description:"Studio control-surface hints for a format class: editor modes, document-mode rules, templates, and the element/nesting constraints that gate structural editing.",properties:{documentMode:{properties:{componentWhen:{description:"Treat the document as a component when this top-level/frontmatter key matches the regex.",properties:{frontmatterKey:{type:"string"},matches:{type:"string"}},type:"object"},default:{enum:["content","component"],type:"string"}},type:"object"},elements:{description:"Element allowlist and nesting constraints for structural editing.",properties:{block:{items:{type:"string"},type:"array"},inline:{items:{type:"string"},type:"array"},nesting:{additionalProperties:{properties:{block:{type:"boolean"},directive:{type:"boolean"},inline:{type:"boolean"},only:{items:{type:"string"},type:"array"}},type:"object"},description:'Per-parent child rules keyed by tag (or "_root"): { block, inline, directive } booleans or { only: [tags] }.',type:"object"},textOnly:{items:{type:"string"},type:"array"},void:{items:{type:"string"},type:"array"}},type:"object"},icon:{type:"string"},modes:{description:"Editor modes the studio offers for documents of this format.",items:{type:"string"},type:"array"},newFileTemplate:{description:"Initial source text for newly created files of this format.",type:"string"}},type:"object"},Q3={additionalProperties:!1,description:'A .class.json schema-defined class. $prototype must be "Class". Defines fields, constructor, methods, and type parameters via $defs. Optionally points to a JS module via $implementation for hybrid execution.',properties:{$defs:{description:"Class members: parameters, returnTypes, fields, constructor, methods.",properties:{constructor:{$ref:"#/$defs/ClassConstructorDef"},fields:{additionalProperties:{$ref:"#/$defs/ClassFieldDef"},description:"Class fields with role, access, scope, and type information.",type:"object"},methods:{additionalProperties:{$ref:"#/$defs/ClassMethodDef"},description:"Class methods and accessors.",type:"object"},parameters:{additionalProperties:{$ref:"#/$defs/ClassParameterDef"},description:"Reusable typed parameter schemas, keyed by name.",type:"object"},returnTypes:{additionalProperties:{type:"object"},description:"Output type schemas, keyed by name.",type:"object"}},type:"object"},$id:{type:"string"},$implementation:{description:"Relative path to a JS module containing the actual class implementation.",type:"string"},$prototype:{const:"Class",type:"string"},$schema:{type:"string"},$studio:{$ref:"#/$defs/StudioHints"},connector:{$ref:"#/$defs/ConnectorBlockDef"},description:{type:"string"},extends:{description:"Base class — string name or $ref to another .class.json.",oneOf:[{type:"string"},{properties:{$ref:{type:"string"}},required:["$ref"],type:"object"}]},format:{$ref:"#/$defs/FormatDef"},project:{$ref:"#/$defs/ProjectBlockDef"},server:{$ref:"#/$defs/ServerBlockDef"},title:{description:"PascalCase class name, used as the export name.",type:"string"}},required:["$prototype","title"],type:"object"}});var G3;var W3=s(()=>{G3={additionalProperties:!1,description:"Schema for jx-extension.json manifests. Located at the extension package root and exported so hosts can resolve <package>/jx-extension.json through the exports map.",properties:{$schema:{type:"string"},classes:{additionalProperties:{type:"string"},description:"$prototype-visible class name → class descriptor path, relative to the manifest.",type:"object"},description:{description:"One-line description.",type:"string"},name:{description:"Package name; must match package.json.",type:"string"},schemas:{additionalProperties:!1,description:"Schema fragments this package contributes, relative to the manifest.",properties:{document:{description:"Document-schema fragment (positions like $paths values).",type:"string"},fields:{description:"Field-union fragment: its $defs members are unioned into the per-project "+"field-schema resource as extension field extras (specs/extensions.md §5.3).",type:"string"},project:{description:"Project-schema fragment (top-level project.json sections).",type:"string"}},type:"object"},title:{description:"Human-readable name for studio surfaces.",type:"string"}},required:["name"],type:"object"}});var r5;var Y3=s(()=>{r5={description:"Image optimization configuration for the project.",properties:{formats:{items:{type:"string"},type:"array"},lazyLoad:{type:"boolean"},optimize:{type:"boolean"},quality:{properties:{avif:{type:"number"},jpeg:{type:"number"},png:{type:"number"},webp:{type:"number"}},type:"object"},remoteDomains:{description:'Hostnames whose remote (https) images are optimized through /cdn-cgi/image transform URLs (cloudflare service only), e.g. ["drive.usercontent.google.com"]. Remote sources from other hosts are left untouched.',items:{type:"string"},type:"array"},service:{description:'How images are optimized: "build" runs Sharp at build time; "cloudflare" emits /cdn-cgi/image transform URLs served by Cloudflare Image Transformations (requires the feature to be enabled on the serving zone).',enum:["build","cloudflare"],type:"string"},sizes:{type:"string"},widths:{items:{type:"number"},type:"array"}},type:"object"}});var TQ;var z3=s(()=>{TQ={description:"Schema for Jx project.json files. A project.json file is the root anchor file for a Jx project, declaring site metadata, default settings, global styles, extensions, and build configuration. Open by design: extension-contributed sections (e.g. `content`) are opaque top-level keys; the generated per-project entry document (project.schema.json) closes the composition.",properties:{$defs:{description:"Global type definitions available to all pages.",type:"object"},$elements:{description:"Global custom element dependencies available to all pages. Items are $ref objects or npm package specifier strings.",items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{type:"string"}]},type:"array"},$head:{description:"Global <head> entries applied to all pages. Array of element definitions for meta tags, link tags, script tags, etc.",examples:[[{attributes:{href:"/favicon.svg",rel:"icon"},tagName:"link"},{attributes:{content:"Jx",name:"generator"},tagName:"meta"}]],items:{properties:{attributes:{additionalProperties:{type:"string"},type:"object"},tagName:{type:"string"}},type:"object"},type:"array"},$media:{additionalProperties:{type:"string"},description:'Named media breakpoints following CSS @custom-media convention. Available in all component style objects. Declaring a pure color-scheme query (e.g. "--dark": "(prefers-color-scheme: dark)") additionally opts the site into the forced-scheme contract: @--dark style blocks are dual-emitted so a data-color-scheme attribute on <html> overrides the OS preference, color-scheme is declared on :root, and a pre-paint script restores the '+"visitor's persisted choice (spec §9.5).",examples:[{"--dark":"(prefers-color-scheme: dark)","--lg":"(min-width: 1024px)","--md":"(min-width: 768px)","--sm":"(min-width: 640px)"}],type:"object"},$schema:{description:"Relative path to the generated per-project schema (conventionally ./project.schema.json, written by `jx schema`).",type:"string"},build:{description:"Build configuration.",properties:{adapter:{description:"Platform adapter for deployment-specific output.",enum:["static","cloudflare-pages","cloudflare-workers","node","bun"],type:"string"},deploy:{additionalProperties:!1,description:"Deployment tracking: the hosting project this repo publishes to. Identifiers "+"only (no secrets) — safe to commit; Studio uses it to tell whether the publish "+"workflow already exists. `adapter` says how the build is packaged; `deploy` says where it ships.",properties:{accountId:{description:"Hosting account id (e.g. the Cloudflare account id).",type:"string"},productionUrl:{description:"Production URL of the connected hosting project.",type:"string"},projectName:{description:"Hosting project name (e.g. the Cloudflare Pages project).",pattern:"^[a-z0-9][a-z0-9-]*$",type:"string"},provider:{description:"Hosting provider the project is connected to.",enum:["cloudflare-pages"],type:"string"}},required:["provider","accountId","projectName"],type:"object"},format:{default:"directory",description:"Reserved; currently unused. Accepted for forward compatibility with single-file output (desktop single-file mode) — the build emits per-route directories regardless.",enum:["directory","single"],type:"string"},outDir:{default:"./dist",description:"Output directory for compiled site.",type:"string"},sitemap:{default:!0,description:"Generate sitemap.xml from the route table (requires `url`). Set false to disable.",type:"boolean"},trailingSlash:{default:"always",description:"Trailing slash behavior for generated URLs.",enum:["always","never","ignore"],type:"string"}},type:"object"},copy:{additionalProperties:{type:"string"},description:"Declarative file copy map. Keys are source paths (relative to project root), values are destination paths (relative to outDir).",type:"object"},defaults:{description:"Default settings applied to all pages unless overridden.",properties:{charset:{default:"utf8",description:"Default charset for the page.",type:"string"},lang:{default:"en",description:"Default lang attribute for the <html> element.",type:"string"},layout:{default:null,description:"Default layout file path applied to all pages. Set to null to render pages without a layout.",examples:["./layouts/base.json"],oneOf:[{type:"string"},{type:"null"}]}},type:"object"},extensions:{description:"Extension packages: bare package names (resolved project-first through the package exports map) or relative paths. Each must export jx-extension.json.",examples:[["@jxsuite/parser"]],items:{type:"string"},type:"array"},i18n:{description:"Internationalization configuration.",properties:{defaultLocale:{description:"Default locale code.",examples:["en"],type:"string"},locales:{description:"Available locale codes.",examples:[["en","fr","de"]],items:{type:"string"},type:"array"},routing:{description:"Locale routing strategy.",enum:["prefix-except-default","prefix-always"],type:"string"}},type:"object"},images:{$ref:"#/$defs/ImageConfig"},imports:{additionalProperties:{type:"string"},description:"Global import map: $prototype names to .class.json file paths. Makes external classes available by name in all pages.",examples:[{Markdown:"@jxsuite/parser/Markdown.class.json",MarkdownCollection:"@jxsuite/parser/MarkdownCollection.class.json"}],type:"object"},name:{default:"Jx Site",description:"Human-readable project name.",examples:["My Portfolio","Jx Example Site"],type:"string"},redirects:{additionalProperties:{type:"string"},description:"Static redirect rules. Maps source paths to destination paths.",examples:[{"/old-about":"/about"}],type:"object"},state:{description:"Site-wide reactive state available to all pages.",type:"object"},style:{additionalProperties:{oneOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/StyleObject"}]},description:"Global CSS styles applied to the <body> element. Uses the same camelCase CSSOM convention and recursive selector/at-rule nesting as component styles.",type:"object"},url:{description:"Production URL of the deployed site.",examples:["https://example.com","https://jxsuite.com"],type:"string"}},type:"object"}});function eP(){return q3??=$C(),q3}async function $C(){let[$,Z,X]=await Promise.all([K3.listAll(),U3.default.listAll(),H3.default.parseAll()]),Q=new Set;for(let{elements:q}of Object.values($))for(let H of q)if(!H.obsolete)Q.add(H.name);let J=[...Q].toSorted(),G=new Set;for(let q of Z.properties)for(let H of q.styleDeclaration??[])G.add(H);let W=[...G].toSorted(),Y=new Set;for(let q of Object.values(X))for(let H of q){if(H.type!=="interface"&&H.type!=="interface mixin")continue;if(!H.members)continue;for(let B of H.members)if(B.type==="attribute"&&B.name?.startsWith("on")&&typeof B.idlType?.idlType==="string"&&B.idlType.idlType==="EventHandler")Y.add(B.name)}let z=[...Y].toSorted();return{cssProps:W,eventHandlers:z,tagExamples:J}}function ZC($){let Z={};for(let X of $)Z[X]={description:`Event handler for the "${X.slice(2)}" event.`,oneOf:[{$ref:"#/$defs/RefObject"},{$ref:"#/$defs/ExpressionEntry"},{$ref:"#/$defs/FunctionDef"}]};return Z}function XC($){let Z={};for(let X of $)Z[X]={oneOf:[{type:"string"},{type:"number"}]};return Z}async function QC(){let{tagExamples:$,cssProps:Z,eventHandlers:X}=await eP();return{$defs:{DefsMap:$3,TypeDefEntry:Z3,StateMap:eV,StateEntry:tV,TypedStateDef:TV,PureTypeDef:bV,FunctionDef:OV,ClassDef:Q3,ClassParameterDef:BQ,ClassFieldDef:FQ,ClassConstructorDef:LQ,ClassMethodDef:MQ,FormatDef:AQ,ProjectBlockDef:IQ,ServerBlockDef:NQ,ConnectorBlockDef:DQ,StudioHints:wQ,ExternalClassDef:SV,ExpressionPointer:kV,ExpressionLiteral:yV,ExpressionOperand:vV,UnaryOperator:gV,BinaryOperator:fV,ConditionalOperator:hV,SwitchOperator:uV,CallOperator:mV,PureMethod:dV,AssignmentOperator:lV,NoArgMethod:cV,OneArgMethod:pV,SpliceMethod:iV,ReduceMethod:nV,MapFilterMethod:rV,ExpressionNode:aV,ExpressionEntry:oV,Statement:RV,StatementList:PV,ElementDef:{...VQ,properties:{...VQ.properties,...ZC(X)}},ChildrenValue:FV,ArrayNamespace:BV,SwitchDef:NV,SwitchNode:DV,StyleObject:{...n5,properties:XC(Z)},AttributesObject:MV,PropsObject:AV,RefObject:KV,AnyRef:qV,InternalRef:QV,StateRef:JV,ExternalRef:GV,ExternalComponentRef:UV,GlobalRef:WV,ParentRef:YV,MapRef:zV,ElementPropertyValue:IV,StringOrRef:iH,BoolOrRef:nH,NumberOrRef:rH,CemParameter:tH,CemEvent:eH,TagName:{...cH,examples:[...$,"my-counter","todo-app","user-card"]},JsonSchemaType:ZV,HeadEntry:oH,ImageConfig:r5,PathsValue:{$id:J4,anyOf:[...r9,GQ],description:"Default $paths source union: the core shapes, plus a catch-all for source shapes contributed by extensions this schema cannot see. The project's generated document.schema.json replaces this with the exact set its extensions provide."}},$id:"https://jxsuite.com/schema/v1",$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:{$ref:"#/$defs/ElementPropertyValue"},description:"Schema for Jx component files. A Jx document is a JSON object that declaratively describes a reactive web component: its structure (DOM tree), styling, type definitions ($defs), runtime state, and inline or external functions. Reactivity is powered by @vue/reactivity.",properties:{$defs:{$ref:"#/$defs/DefsMap",description:"Pure JSON Schema type definitions for this component. "+"All entries are reusable type schemas — no runtime artifacts are produced. "+"Referenced from state entries via $ref. Naming convention: PascalCase."},$elements:{description:"Custom element dependencies. Items are either $ref objects pointing to JX element definitions, or bare npm package name strings for web component libraries.",items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{description:"npm package specifier (must declare customElements in package.json)",type:"string"}]},type:"array"},$head:{description:"Page-level <head> entries. Array of element definitions for meta tags, link tags, script tags, etc. Merged with layout and site-level $head entries.",items:{$ref:"#/$defs/ElementDef"},type:"array"},$id:{description:"Component identifier string. Used by tooling and the builder.",examples:["Counter","TodoApp","UserCard"],type:"string"},$layout:{description:"Layout reference for pages. String path to a layout JSON file, or false to opt out of the default layout.",examples:["./layouts/base.json"],oneOf:[{type:"string"},{const:!1,type:"boolean"}]},$media:{additionalProperties:{type:"string"},description:'Named media breakpoints following CSS @custom-media convention. Keys use the CSS custom property -- prefix. Pure color-scheme queries (e.g. "--dark": "(prefers-color-scheme: dark)") are dual-emitted so a data-color-scheme attribute on the root element forces the scheme '+"regardless of the OS preference (spec §9.5).",examples:[{"--dark":"(prefers-color-scheme: dark)","--md":"(min-width: 768px)","--sm":"(min-width: 640px)"}],type:"object"},$paths:{$ref:J4,description:"Dynamic route source for a page: expands one page per entry at build time. One of the core shapes (explicit `values`, a `$ref` data file, or a bare array of parameter objects) or a source shape contributed by an enabled extension, such as the parser's `contentType`."},$schema:{description:"URI identifying the Jx dialect version. Enables schema-aware IDE tooling.",examples:["https://jxsuite.com/schema/v1"],type:"string"},attributes:{$ref:"#/$defs/AttributesObject"},cases:{additionalProperties:{oneOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/ExternalComponentRef"}]},description:"Switch cases object. Maps case values to element definitions or external component refs. Used alongside $switch for dynamic component rendering.",type:"object"},children:{$ref:"#/$defs/ChildrenValue"},imports:{additionalProperties:{type:"string"},description:"Import map: $prototype names to .class.json file paths. Allows state entries to reference external classes by name without $src.",type:"object"},observedAttributes:{description:"HTML attributes the custom element watches for changes. Follows the Web Components observedAttributes convention.",items:{type:"string"},type:"array"},state:{$ref:"#/$defs/StateMap",description:"Runtime variables for this component. All entries are reactive by default. Entry shape is determined by value type: "+"scalar/array → reactive property, string with ${} → computed, "+"object with $prototype → function or data source, "+"object with type and default → typed reactive property."},style:{$ref:"#/$defs/StyleObject"},tagName:{$ref:"#/$defs/TagName"},title:{$ref:"#/$defs/StringOrRef",description:"Page title. Can be a static string or a template string with ${} expressions."}},title:"Jx Document",type:"object"}}function JC(){return{$defs:{ImageConfig:r5,StyleObject:n5},$id:"https://jxsuite.com/schema/project/v1",$schema:"https://json-schema.org/draft/2020-12/schema",description:"Schema for Jx project.json files. A project.json file is the root anchor file for a Jx project, declaring site metadata, default settings, global styles, extensions, and build configuration. Open by design: extension-contributed sections are opaque top-level keys; the generated per-project entry document (project.schema.json) closes the composition.",properties:TQ.properties,title:"Jx Project",type:"object"}}function GC(){return{$defs:{ImageConfig:r5,JxFieldSchema:BH,RelationshipRef:FH,StyleObject:n5},$id:"https://jxsuite.com/schema/project/core/v2",$schema:"https://json-schema.org/draft/2020-12/schema",description:"Core fragment of the Jx project.json schema. Open by design: extension fragments contribute their own top-level sections and the generated per-project entry document "+"(project.schema.json) closes the composition. See specs/extensions.md §5.",properties:TQ.properties,title:"Jx Project Core",type:"object"}}function WC(){return{$id:n9,$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[{$ref:"https://jxsuite.com/schema/project/core/v2#/$defs/JxFieldSchema"},{$ref:"https://jxsuite.com/schema/project/core/v2#/$defs/RelationshipRef"}],description:"Default field-schema union for section entry schemas: the core field shape plus relationship references. Per-project entry documents override this resource with the "+"effective union. See specs/extensions.md §5.3.",title:"Jx Project Field Union"}}function YC(){return{$id:J4,$schema:"https://json-schema.org/draft/2020-12/schema",anyOf:[...r9,GQ],description:"Default $paths-value union for documents: the core source shapes. Per-project entry documents override this resource with those members PLUS every extension-contributed paths shape.",title:"Jx Document Paths Union"}}function zC(){return{$id:"https://jxsuite.com/schema/extension-manifest/v1",$schema:"https://json-schema.org/draft/2020-12/schema",title:"Jx Extension Manifest",...G3}}function jQ(){return{$defs:{ClassConstructorDef:LQ,ClassFieldDef:FQ,ClassMethodDef:MQ,ClassParameterDef:BQ,ConnectorBlockDef:DQ,FormatDef:AQ,ProjectBlockDef:IQ,ServerBlockDef:NQ,StudioHints:wQ},$id:"https://jxsuite.com/schema/class/v1",$schema:"https://json-schema.org/draft/2020-12/schema",additionalProperties:!1,description:"Schema for Jx .class.json files. A class definition describes a schema-defined class with fields, constructor, methods, and type parameters. Optionally points to a JS module via $implementation for hybrid execution.",properties:{$defs:{description:"Class members: parameters, returnTypes, fields, constructor, methods.",properties:{constructor:{$ref:"#/$defs/ClassConstructorDef"},fields:{additionalProperties:{$ref:"#/$defs/ClassFieldDef"},description:"Class fields with role, access, scope, and type information.",type:"object"},methods:{additionalProperties:{$ref:"#/$defs/ClassMethodDef"},description:"Class methods and accessors.",type:"object"},parameters:{additionalProperties:{$ref:"#/$defs/ClassParameterDef"},description:"Reusable typed parameter schemas, keyed by name.",type:"object"},returnTypes:{additionalProperties:{type:"object"},description:"Output type schemas, keyed by name.",type:"object"}},type:"object"},$id:{type:"string"},$implementation:{description:"Relative path to a JS module containing the actual class implementation.",examples:["./md.js","./lib/calculator.js"],type:"string"},$prototype:{const:"Class",description:'Must be "Class" for class definition files.',type:"string"},$schema:{type:"string"},$studio:{$ref:"#/$defs/StudioHints"},connector:{$ref:"#/$defs/ConnectorBlockDef"},description:{type:"string"},extends:{description:"Base class — string name or $ref to another .class.json.",oneOf:[{type:"string"},{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"}]},format:{$ref:"#/$defs/FormatDef"},project:{$ref:"#/$defs/ProjectBlockDef"},server:{$ref:"#/$defs/ServerBlockDef"},title:{description:"PascalCase class name, used as the export name.",examples:["MarkdownFile","DataSource","Calculator"],type:"string"}},required:["$prototype","title"],title:"Jx Class Definition",type:"object"}}async function qC(){let{mkdirSync:$,writeFileSync:Z}=await import("node:fs"),{resolve:X,dirname:Q}=await import("node:path"),J=Q(X(process.argv[1],"..")),G=await QC(),W=JC(),Y=jQ(),z=GC(),q=zC(),H=WC(),B=YC(),F=JSON.stringify(G,null,2),L=JSON.stringify(W,null,2),w=JSON.stringify(Y,null,2),N=JSON.stringify(z,null,2),I=JSON.stringify(q,null,2),T=JSON.stringify(H,null,2),E=JSON.stringify(B,null,2),[P]=process.argv.slice(2);if(P)Z(P,F,"utf8"),console.error(`Jx component schema written to ${P}`);else{Z(X(J,"schema.json"),F,"utf8"),Z(X(J,"project-schema.json"),L,"utf8"),Z(X(J,"class-schema.json"),w,"utf8"),$(X(J,"schemas"),{recursive:!0}),Z(X(J,"schemas","project.core.schema.json"),N,"utf8"),Z(X(J,"schemas","project.fields.schema.json"),T,"utf8"),Z(X(J,"schemas","document.paths.schema.json"),E,"utf8"),Z(X(J,"extension-manifest.schema.json"),I,"utf8");let R=Bun.spawnSync(["bunx","oxfmt",X(J,"schemas","project.core.schema.json"),X(J,"schemas","project.fields.schema.json"),X(J,"schemas","document.paths.schema.json")],{cwd:J});if(R.exitCode!==0){let C=R.stderr.toString()||R.stdout.toString()||`exit ${R.exitCode??"null"}${R.signalCode?`, signal ${R.signalCode}`:""}`;console.error(`Warning: skipped oxfmt reformat of generated schemas (${C})`)}console.error("Generated:"),console.error(" schema.json (component)"),console.error(" project-schema.json"),console.error(" class-schema.json"),console.error(" schemas/project.core.schema.json"),console.error(" schemas/project.fields.schema.json"),console.error(" schemas/document.paths.schema.json"),console.error(" extension-manifest.schema.json")}}var K3,U3,H3,q3=null,gi;var V3=s(()=>{pH();aH();sH();$V();XV();HV();VV();LV();wV();jV();EV();CV();_V();xV();sV();X3();J3();W3();l5();Y3();z3();K3=F$(xH(),1),U3=F$(vH(),1),H3=F$(lH(),1);gi=process.argv[1]?.endsWith("schema.ts")?qC():void 0});var e9=b((L3)=>{Object.defineProperty(L3,"__esModule",{value:!0});L3.regexpCode=L3.getEsmExportName=L3.getProperty=L3.safeStringify=L3.stringify=L3.strConcat=L3.addCodeArg=L3.str=L3._=L3.nil=L3._Code=L3.Name=L3.IDENTIFIER=L3._CodeOrName=void 0;class a5{}L3._CodeOrName=a5;L3.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class p4 extends a5{constructor($){super();if(!L3.IDENTIFIER.test($))throw Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}L3.Name=p4;class U1 extends a5{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((Z,X)=>`${Z}${X}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((Z,X)=>{if(X instanceof p4)Z[X.str]=(Z[X.str]||0)+1;return Z},{})}}L3._Code=U1;L3.nil=new U1("");function B3($,...Z){let X=[$[0]],Q=0;while(Q<Z.length)EQ(X,Z[Q]),X.push($[++Q]);return new U1(X)}L3._=B3;var OQ=new U1("+");function F3($,...Z){let X=[t9($[0])],Q=0;while(Q<Z.length)X.push(OQ),EQ(X,Z[Q]),X.push(OQ,t9($[++Q]));return KC(X),new U1(X)}L3.str=F3;function EQ($,Z){if(Z instanceof U1)$.push(...Z._items);else if(Z instanceof p4)$.push(Z);else $.push(VC(Z))}L3.addCodeArg=EQ;function KC($){let Z=1;while(Z<$.length-1){if($[Z]===OQ){let X=UC($[Z-1],$[Z+1]);if(X!==void 0){$.splice(Z-1,3,X);continue}$[Z++]="+"}Z++}}function UC($,Z){if(Z==='""')return $;if($==='""')return Z;if(typeof $=="string"){if(Z instanceof p4||$[$.length-1]!=='"')return;if(typeof Z!="string")return`${$.slice(0,-1)}${Z}"`;if(Z[0]==='"')return $.slice(0,-1)+Z.slice(1);return}if(typeof Z=="string"&&Z[0]==='"'&&!($ instanceof p4))return`"${$}${Z.slice(1)}`;return}function HC($,Z){return Z.emptyStr()?$:$.emptyStr()?Z:F3`${$}${Z}`}L3.strConcat=HC;function VC($){return typeof $=="number"||typeof $=="boolean"||$===null?$:t9(Array.isArray($)?$.join(","):$)}function BC($){return new U1(t9($))}L3.stringify=BC;function t9($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}L3.safeStringify=t9;function FC($){return typeof $=="string"&&L3.IDENTIFIER.test($)?new U1(`.${$}`):B3`[${$}]`}L3.getProperty=FC;function LC($){if(typeof $=="string"&&L3.IDENTIFIER.test($))return new U1(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}L3.getEsmExportName=LC;function MC($){return new U1($.toString())}L3.regexpCode=MC});var SQ=b((N3)=>{Object.defineProperty(N3,"__esModule",{value:!0});N3.ValueScope=N3.ValueScopeName=N3.Scope=N3.varKinds=N3.UsedValueState=void 0;var x$=e9();class A3 extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var s5;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(s5||(N3.UsedValueState=s5={}));N3.varKinds={const:new x$.Name("const"),let:new x$.Name("let"),var:new x$.Name("var")};class PQ{constructor({prefixes:$,parent:Z}={}){this._names={},this._prefixes=$,this._parent=Z}toName($){return $ instanceof x$.Name?$:this.name($)}name($){return new x$.Name(this._newName($))}_newName($){let Z=this._names[$]||this._nameGroup($);return`${$}${Z.index++}`}_nameGroup($){var Z,X;if(((X=(Z=this._parent)===null||Z===void 0?void 0:Z._prefixes)===null||X===void 0?void 0:X.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}N3.Scope=PQ;class CQ extends x$.Name{constructor($,Z){super(Z);this.prefix=$}setValue($,{property:Z,itemIndex:X}){this.value=$,this.scopePath=x$._`.${new x$.Name(Z)}[${X}]`}}N3.ValueScopeName=CQ;var SC=x$._`\n`;class I3 extends PQ{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?SC:x$.nil}}get(){return this._scope}name($){return new CQ($,this._newName($))}value($,Z){var X;if(Z.ref===void 0)throw Error("CodeGen: ref must be passed in value");let Q=this.toName($),{prefix:J}=Q,G=(X=Z.key)!==null&&X!==void 0?X:Z.ref,W=this._values[J];if(W){let q=W.get(G);if(q)return q}else W=this._values[J]=new Map;W.set(G,Q);let Y=this._scope[J]||(this._scope[J]=[]),z=Y.length;return Y[z]=Z.ref,Q.setValue(Z,{property:J,itemIndex:z}),Q}getValue($,Z){let X=this._values[$];if(!X)return;return X.get(Z)}scopeRefs($,Z=this._values){return this._reduceValues(Z,(X)=>{if(X.scopePath===void 0)throw Error(`CodeGen: name "${X}" has no value`);return x$._`${$}${X.scopePath}`})}scopeCode($=this._values,Z,X){return this._reduceValues($,(Q)=>{if(Q.value===void 0)throw Error(`CodeGen: name "${Q}" has no value`);return Q.value.code},Z,X)}_reduceValues($,Z,X={},Q){let J=x$.nil;for(let G in $){let W=$[G];if(!W)continue;let Y=X[G]=X[G]||new Map;W.forEach((z)=>{if(Y.has(z))return;Y.set(z,s5.Started);let q=Z(z);if(q){let H=this.opts.es5?N3.varKinds.var:N3.varKinds.const;J=x$._`${J}${H} ${z} = ${q};${this.opts._n}`}else if(q=Q===null||Q===void 0?void 0:Q(z))J=x$._`${J}${q}${this.opts._n}`;else throw new A3(z);Y.set(z,s5.Completed)})}return J}}N3.ValueScope=I3});var N0=b((k$)=>{Object.defineProperty(k$,"__esModule",{value:!0});k$.or=k$.and=k$.not=k$.CodeGen=k$.operators=k$.varKinds=k$.ValueScopeName=k$.ValueScope=k$.Scope=k$.Name=k$.regexpCode=k$.stringify=k$.getProperty=k$.nil=k$.strConcat=k$.str=k$._=void 0;var C0=e9(),H1=SQ(),_6=e9();Object.defineProperty(k$,"_",{enumerable:!0,get:function(){return _6._}});Object.defineProperty(k$,"str",{enumerable:!0,get:function(){return _6.str}});Object.defineProperty(k$,"strConcat",{enumerable:!0,get:function(){return _6.strConcat}});Object.defineProperty(k$,"nil",{enumerable:!0,get:function(){return _6.nil}});Object.defineProperty(k$,"getProperty",{enumerable:!0,get:function(){return _6.getProperty}});Object.defineProperty(k$,"stringify",{enumerable:!0,get:function(){return _6.stringify}});Object.defineProperty(k$,"regexpCode",{enumerable:!0,get:function(){return _6.regexpCode}});Object.defineProperty(k$,"Name",{enumerable:!0,get:function(){return _6.Name}});var QZ=SQ();Object.defineProperty(k$,"Scope",{enumerable:!0,get:function(){return QZ.Scope}});Object.defineProperty(k$,"ValueScope",{enumerable:!0,get:function(){return QZ.ValueScope}});Object.defineProperty(k$,"ValueScopeName",{enumerable:!0,get:function(){return QZ.ValueScopeName}});Object.defineProperty(k$,"varKinds",{enumerable:!0,get:function(){return QZ.varKinds}});k$.operators={GT:new C0._Code(">"),GTE:new C0._Code(">="),LT:new C0._Code("<"),LTE:new C0._Code("<="),EQ:new C0._Code("==="),NEQ:new C0._Code("!=="),NOT:new C0._Code("!"),OR:new C0._Code("||"),AND:new C0._Code("&&"),ADD:new C0._Code("+")};class b6{optimizeNodes(){return this}optimizeNames($,Z){return this}}class w3 extends b6{constructor($,Z,X){super();this.varKind=$,this.name=Z,this.rhs=X}render({es5:$,_n:Z}){let X=$?H1.varKinds.var:this.varKind,Q=this.rhs===void 0?"":` = ${this.rhs}`;return`${X} ${this.name}${Q};`+Z}optimizeNames($,Z){if(!$[this.name.str])return;if(this.rhs)this.rhs=n4(this.rhs,$,Z);return this}get names(){return this.rhs instanceof C0._CodeOrName?this.rhs.names:{}}}class xQ extends b6{constructor($,Z,X){super();this.lhs=$,this.rhs=Z,this.sideEffects=X}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,Z){if(this.lhs instanceof C0.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=n4(this.rhs,$,Z),this}get names(){let $=this.lhs instanceof C0.Name?{}:{...this.lhs.names};return XZ($,this.rhs)}}class T3 extends xQ{constructor($,Z,X,Q){super($,X,Q);this.op=Z}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class j3 extends b6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class O3 extends b6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class E3 extends b6{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class R3 extends b6{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,Z){return this.code=n4(this.code,$,Z),this}get names(){return this.code instanceof C0._CodeOrName?this.code.names:{}}}class JZ extends b6{constructor($=[]){super();this.nodes=$}render($){return this.nodes.reduce((Z,X)=>Z+X.render($),"")}optimizeNodes(){let{nodes:$}=this,Z=$.length;while(Z--){let X=$[Z].optimizeNodes();if(Array.isArray(X))$.splice(Z,1,...X);else if(X)$[Z]=X;else $.splice(Z,1)}return $.length>0?this:void 0}optimizeNames($,Z){let{nodes:X}=this,Q=X.length;while(Q--){let J=X[Q];if(J.optimizeNames($,Z))continue;kC($,J.names),X.splice(Q,1)}return X.length>0?this:void 0}get names(){return this.nodes.reduce(($,Z)=>W4($,Z.names),{})}}class x6 extends JZ{render($){return"{"+$._n+super.render($)+"}"+$._n}}class P3 extends JZ{}class $8 extends x6{}$8.kind="else";class J6 extends x6{constructor($,Z){super(Z);this.condition=$}render($){let Z=`if(${this.condition})`+super.render($);if(this.else)Z+="else "+this.else.render($);return Z}optimizeNodes(){super.optimizeNodes();let $=this.condition;if($===!0)return this.nodes;let Z=this.else;if(Z){let X=Z.optimizeNodes();Z=this.else=Array.isArray(X)?new $8(X):X}if(Z){if($===!1)return Z instanceof J6?Z:Z.nodes;if(this.nodes.length)return this;return new J6(x3($),Z instanceof J6?[Z]:Z.nodes)}if($===!1||!this.nodes.length)return;return this}optimizeNames($,Z){var X;if(this.else=(X=this.else)===null||X===void 0?void 0:X.optimizeNames($,Z),!(super.optimizeNames($,Z)||this.else))return;return this.condition=n4(this.condition,$,Z),this}get names(){let $=super.names;if(XZ($,this.condition),this.else)W4($,this.else.names);return $}}J6.kind="if";class i4 extends x6{}i4.kind="for";class C3 extends i4{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,Z){if(!super.optimizeNames($,Z))return;return this.iteration=n4(this.iteration,$,Z),this}get names(){return W4(super.names,this.iteration.names)}}class S3 extends i4{constructor($,Z,X,Q){super();this.varKind=$,this.name=Z,this.from=X,this.to=Q}render($){let Z=$.es5?H1.varKinds.var:this.varKind,{name:X,from:Q,to:J}=this;return`for(${Z} ${X}=${Q}; ${X}<${J}; ${X}++)`+super.render($)}get names(){let $=XZ(super.names,this.from);return XZ($,this.to)}}class _Q extends i4{constructor($,Z,X,Q){super();this.loop=$,this.varKind=Z,this.name=X,this.iterable=Q}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,Z){if(!super.optimizeNames($,Z))return;return this.iterable=n4(this.iterable,$,Z),this}get names(){return W4(super.names,this.iterable.names)}}class t5 extends x6{constructor($,Z,X){super();this.name=$,this.args=Z,this.async=X}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}t5.kind="func";class e5 extends JZ{render($){return"return "+super.render($)}}e5.kind="return";class _3 extends x6{render($){let Z="try"+super.render($);if(this.catch)Z+=this.catch.render($);if(this.finally)Z+=this.finally.render($);return Z}optimizeNodes(){var $,Z;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(Z=this.finally)===null||Z===void 0||Z.optimizeNodes(),this}optimizeNames($,Z){var X,Q;return super.optimizeNames($,Z),(X=this.catch)===null||X===void 0||X.optimizeNames($,Z),(Q=this.finally)===null||Q===void 0||Q.optimizeNames($,Z),this}get names(){let $=super.names;if(this.catch)W4($,this.catch.names);if(this.finally)W4($,this.finally.names);return $}}class $Z extends x6{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}$Z.kind="catch";class ZZ extends x6{render($){return"finally"+super.render($)}}ZZ.kind="finally";class b3{constructor($,Z={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...Z,_n:Z.lines?`
|
|
389
|
+
`:""},this._extScope=$,this._scope=new H1.Scope({parent:$}),this._nodes=[new P3]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,Z){let X=this._extScope.value($,Z);return(this._values[X.prefix]||(this._values[X.prefix]=new Set)).add(X),X}getScopeValue($,Z){return this._extScope.getValue($,Z)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,Z,X,Q){let J=this._scope.toName(Z);if(X!==void 0&&Q)this._constants[J.str]=X;return this._leafNode(new w3($,J,X)),J}const($,Z,X){return this._def(H1.varKinds.const,$,Z,X)}let($,Z,X){return this._def(H1.varKinds.let,$,Z,X)}var($,Z,X){return this._def(H1.varKinds.var,$,Z,X)}assign($,Z,X){return this._leafNode(new xQ($,Z,X))}add($,Z){return this._leafNode(new T3($,k$.operators.ADD,Z))}code($){if(typeof $=="function")$();else if($!==C0.nil)this._leafNode(new R3($));return this}object(...$){let Z=["{"];for(let[X,Q]of $){if(Z.length>1)Z.push(",");if(Z.push(X),X!==Q||this.opts.es5)Z.push(":"),(0,C0.addCodeArg)(Z,Q)}return Z.push("}"),new C0._Code(Z)}if($,Z,X){if(this._blockNode(new J6($)),Z&&X)this.code(Z).else().code(X).endIf();else if(Z)this.code(Z).endIf();else if(X)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new J6($))}else(){return this._elseNode(new $8)}endIf(){return this._endBlockNode(J6,$8)}_for($,Z){if(this._blockNode($),Z)this.code(Z).endFor();return this}for($,Z){return this._for(new C3($),Z)}forRange($,Z,X,Q,J=this.opts.es5?H1.varKinds.var:H1.varKinds.let){let G=this._scope.toName($);return this._for(new S3(J,G,Z,X),()=>Q(G))}forOf($,Z,X,Q=H1.varKinds.const){let J=this._scope.toName($);if(this.opts.es5){let G=Z instanceof C0.Name?Z:this.var("_arr",Z);return this.forRange("_i",0,C0._`${G}.length`,(W)=>{this.var(J,C0._`${G}[${W}]`),X(J)})}return this._for(new _Q("of",Q,J,Z),()=>X(J))}forIn($,Z,X,Q=this.opts.es5?H1.varKinds.var:H1.varKinds.const){if(this.opts.ownProperties)return this.forOf($,C0._`Object.keys(${Z})`,X);let J=this._scope.toName($);return this._for(new _Q("in",Q,J,Z),()=>X(J))}endFor(){return this._endBlockNode(i4)}label($){return this._leafNode(new j3($))}break($){return this._leafNode(new O3($))}return($){let Z=new e5;if(this._blockNode(Z),this.code($),Z.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(e5)}try($,Z,X){if(!Z&&!X)throw Error('CodeGen: "try" without "catch" and "finally"');let Q=new _3;if(this._blockNode(Q),this.code($),Z){let J=this.name("e");this._currNode=Q.catch=new $Z(J),Z(J)}if(X)this._currNode=Q.finally=new ZZ,this.code(X);return this._endBlockNode($Z,ZZ)}throw($){return this._leafNode(new E3($))}block($,Z){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(Z);return this}endBlock($){let Z=this._blockStarts.pop();if(Z===void 0)throw Error("CodeGen: not in self-balancing block");let X=this._nodes.length-Z;if(X<0||$!==void 0&&X!==$)throw Error(`CodeGen: wrong number of nodes: ${X} vs ${$} expected`);return this._nodes.length=Z,this}func($,Z=C0.nil,X,Q){if(this._blockNode(new t5($,Z,X)),Q)this.code(Q).endFunc();return this}endFunc(){return this._endBlockNode(t5)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,Z){let X=this._currNode;if(X instanceof $||Z&&X instanceof Z)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${Z?`${$.kind}/${Z.kind}`:$.kind}"`)}_elseNode($){let Z=this._currNode;if(!(Z instanceof J6))throw Error('CodeGen: "else" without "if"');return this._currNode=Z.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let Z=this._nodes;Z[Z.length-1]=$}}k$.CodeGen=b3;function W4($,Z){for(let X in Z)$[X]=($[X]||0)+(Z[X]||0);return $}function XZ($,Z){return Z instanceof C0._CodeOrName?W4($,Z.names):$}function n4($,Z,X){if($ instanceof C0.Name)return Q($);if(!J($))return $;return new C0._Code($._items.reduce((G,W)=>{if(W instanceof C0.Name)W=Q(W);if(W instanceof C0._Code)G.push(...W._items);else G.push(W);return G},[]));function Q(G){let W=X[G.str];if(W===void 0||Z[G.str]!==1)return G;return delete Z[G.str],W}function J(G){return G instanceof C0._Code&&G._items.some((W)=>W instanceof C0.Name&&Z[W.str]===1&&X[W.str]!==void 0)}}function kC($,Z){for(let X in Z)$[X]=($[X]||0)-(Z[X]||0)}function x3($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:C0._`!${bQ($)}`}k$.not=x3;var yC=k3(k$.operators.AND);function vC(...$){return $.reduce(yC)}k$.and=vC;var gC=k3(k$.operators.OR);function fC(...$){return $.reduce(gC)}k$.or=fC;function k3($){return(Z,X)=>Z===C0.nil?X:X===C0.nil?Z:C0._`${bQ(Z)} ${$} ${bQ(X)}`}function bQ($){return $ instanceof C0.Name?$:C0._`(${$})`}});var P0=b((l3)=>{Object.defineProperty(l3,"__esModule",{value:!0});l3.checkStrictMode=l3.getErrorPath=l3.Type=l3.useFunc=l3.setEvaluated=l3.evaluatedPropsToName=l3.mergeEvaluated=l3.eachItem=l3.unescapeJsonPointer=l3.escapeJsonPointer=l3.escapeFragment=l3.unescapeFragment=l3.schemaRefOrVal=l3.schemaHasRulesButRef=l3.schemaHasRules=l3.checkUnknownRules=l3.alwaysValidSchema=l3.toHash=void 0;var y0=N0(),dC=e9();function lC($){let Z={};for(let X of $)Z[X]=!0;return Z}l3.toHash=lC;function cC($,Z){if(typeof Z=="boolean")return Z;if(Object.keys(Z).length===0)return!0;return f3($,Z),!h3(Z,$.self.RULES.all)}l3.alwaysValidSchema=cC;function f3($,Z=$.schema){let{opts:X,self:Q}=$;if(!X.strictSchema)return;if(typeof Z==="boolean")return;let J=Q.RULES.keywords;for(let G in Z)if(!J[G])d3($,`unknown keyword: "${G}"`)}l3.checkUnknownRules=f3;function h3($,Z){if(typeof $=="boolean")return!$;for(let X in $)if(Z[X])return!0;return!1}l3.schemaHasRules=h3;function pC($,Z){if(typeof $=="boolean")return!$;for(let X in $)if(X!=="$ref"&&Z.all[X])return!0;return!1}l3.schemaHasRulesButRef=pC;function iC({topSchemaRef:$,schemaPath:Z},X,Q,J){if(!J){if(typeof X=="number"||typeof X=="boolean")return X;if(typeof X=="string")return y0._`${X}`}return y0._`${$}${Z}${(0,y0.getProperty)(Q)}`}l3.schemaRefOrVal=iC;function nC($){return u3(decodeURIComponent($))}l3.unescapeFragment=nC;function rC($){return encodeURIComponent(yQ($))}l3.escapeFragment=rC;function yQ($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}l3.escapeJsonPointer=yQ;function u3($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}l3.unescapeJsonPointer=u3;function aC($,Z){if(Array.isArray($))for(let X of $)Z(X);else Z($)}l3.eachItem=aC;function v3({mergeNames:$,mergeToName:Z,mergeValues:X,resultToName:Q}){return(J,G,W,Y)=>{let z=W===void 0?G:W instanceof y0.Name?(G instanceof y0.Name?$(J,G,W):Z(J,G,W),W):G instanceof y0.Name?(Z(J,W,G),G):X(G,W);return Y===y0.Name&&!(z instanceof y0.Name)?Q(J,z):z}}l3.mergeEvaluated={props:v3({mergeNames:($,Z,X)=>$.if(y0._`${X} !== true && ${Z} !== undefined`,()=>{$.if(y0._`${Z} === true`,()=>$.assign(X,!0),()=>$.assign(X,y0._`${X} || {}`).code(y0._`Object.assign(${X}, ${Z})`))}),mergeToName:($,Z,X)=>$.if(y0._`${X} !== true`,()=>{if(Z===!0)$.assign(X,!0);else $.assign(X,y0._`${X} || {}`),vQ($,X,Z)}),mergeValues:($,Z)=>$===!0?!0:{...$,...Z},resultToName:m3}),items:v3({mergeNames:($,Z,X)=>$.if(y0._`${X} !== true && ${Z} !== undefined`,()=>$.assign(X,y0._`${Z} === true ? true : ${X} > ${Z} ? ${X} : ${Z}`)),mergeToName:($,Z,X)=>$.if(y0._`${X} !== true`,()=>$.assign(X,Z===!0?!0:y0._`${X} > ${Z} ? ${X} : ${Z}`)),mergeValues:($,Z)=>$===!0?!0:Math.max($,Z),resultToName:($,Z)=>$.var("items",Z)})};function m3($,Z){if(Z===!0)return $.var("props",!0);let X=$.var("props",y0._`{}`);if(Z!==void 0)vQ($,X,Z);return X}l3.evaluatedPropsToName=m3;function vQ($,Z,X){Object.keys(X).forEach((Q)=>$.assign(y0._`${Z}${(0,y0.getProperty)(Q)}`,!0))}l3.setEvaluated=vQ;var g3={};function oC($,Z){return $.scopeValue("func",{ref:Z,code:g3[Z.code]||(g3[Z.code]=new dC._Code(Z.code))})}l3.useFunc=oC;var kQ;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(kQ||(l3.Type=kQ={}));function sC($,Z,X){if($ instanceof y0.Name){let Q=Z===kQ.Num;return X?Q?y0._`"[" + ${$} + "]"`:y0._`"['" + ${$} + "']"`:Q?y0._`"/" + ${$}`:y0._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return X?(0,y0.getProperty)($).toString():"/"+yQ($)}l3.getErrorPath=sC;function d3($,Z,X=$.opts.strictSchema){if(!X)return;if(Z=`strict mode: ${Z}`,X===!0)throw Error(Z);$.self.logger.warn(Z)}l3.checkStrictMode=d3});var J1=b((p3)=>{Object.defineProperty(p3,"__esModule",{value:!0});var V$=N0(),FS={data:new V$.Name("data"),valCxt:new V$.Name("valCxt"),instancePath:new V$.Name("instancePath"),parentData:new V$.Name("parentData"),parentDataProperty:new V$.Name("parentDataProperty"),rootData:new V$.Name("rootData"),dynamicAnchors:new V$.Name("dynamicAnchors"),vErrors:new V$.Name("vErrors"),errors:new V$.Name("errors"),this:new V$.Name("this"),self:new V$.Name("self"),scope:new V$.Name("scope"),json:new V$.Name("json"),jsonPos:new V$.Name("jsonPos"),jsonLen:new V$.Name("jsonLen"),jsonPart:new V$.Name("jsonPart")};p3.default=FS});var Z8=b((a3)=>{Object.defineProperty(a3,"__esModule",{value:!0});a3.extendErrors=a3.resetErrorsCount=a3.reportExtraError=a3.reportError=a3.keyword$DataError=a3.keywordError=void 0;var S0=N0(),WZ=P0(),T$=J1();a3.keywordError={message:({keyword:$})=>S0.str`must pass "${$}" keyword validation`};a3.keyword$DataError={message:({keyword:$,schemaType:Z})=>Z?S0.str`"${$}" keyword must be ${Z} ($data)`:S0.str`"${$}" keyword is invalid ($data)`};function MS($,Z=a3.keywordError,X,Q){let{it:J}=$,{gen:G,compositeRule:W,allErrors:Y}=J,z=r3($,Z,X);if(Q!==null&&Q!==void 0?Q:W||Y)i3(G,z);else n3(J,S0._`[${z}]`)}a3.reportError=MS;function AS($,Z=a3.keywordError,X){let{it:Q}=$,{gen:J,compositeRule:G,allErrors:W}=Q,Y=r3($,Z,X);if(i3(J,Y),!(G||W))n3(Q,T$.default.vErrors)}a3.reportExtraError=AS;function IS($,Z){$.assign(T$.default.errors,Z),$.if(S0._`${T$.default.vErrors} !== null`,()=>$.if(Z,()=>$.assign(S0._`${T$.default.vErrors}.length`,Z),()=>$.assign(T$.default.vErrors,null)))}a3.resetErrorsCount=IS;function NS({gen:$,keyword:Z,schemaValue:X,data:Q,errsCount:J,it:G}){if(J===void 0)throw Error("ajv implementation error");let W=$.name("err");$.forRange("i",J,T$.default.errors,(Y)=>{if($.const(W,S0._`${T$.default.vErrors}[${Y}]`),$.if(S0._`${W}.instancePath === undefined`,()=>$.assign(S0._`${W}.instancePath`,(0,S0.strConcat)(T$.default.instancePath,G.errorPath))),$.assign(S0._`${W}.schemaPath`,S0.str`${G.errSchemaPath}/${Z}`),G.opts.verbose)$.assign(S0._`${W}.schema`,X),$.assign(S0._`${W}.data`,Q)})}a3.extendErrors=NS;function i3($,Z){let X=$.const("err",Z);$.if(S0._`${T$.default.vErrors} === null`,()=>$.assign(T$.default.vErrors,S0._`[${X}]`),S0._`${T$.default.vErrors}.push(${X})`),$.code(S0._`${T$.default.errors}++`)}function n3($,Z){let{gen:X,validateName:Q,schemaEnv:J}=$;if(J.$async)X.throw(S0._`new ${$.ValidationError}(${Z})`);else X.assign(S0._`${Q}.errors`,Z),X.return(!1)}var Y4={keyword:new S0.Name("keyword"),schemaPath:new S0.Name("schemaPath"),params:new S0.Name("params"),propertyName:new S0.Name("propertyName"),message:new S0.Name("message"),schema:new S0.Name("schema"),parentSchema:new S0.Name("parentSchema")};function r3($,Z,X){let{createErrors:Q}=$.it;if(Q===!1)return S0._`{}`;return DS($,Z,X)}function DS($,Z,X={}){let{gen:Q,it:J}=$,G=[wS(J,X),TS($,X)];return jS($,Z,G),Q.object(...G)}function wS({errorPath:$},{instancePath:Z}){let X=Z?S0.str`${$}${(0,WZ.getErrorPath)(Z,WZ.Type.Str)}`:$;return[T$.default.instancePath,(0,S0.strConcat)(T$.default.instancePath,X)]}function TS({keyword:$,it:{errSchemaPath:Z}},{schemaPath:X,parentSchema:Q}){let J=Q?Z:S0.str`${Z}/${$}`;if(X)J=S0.str`${J}${(0,WZ.getErrorPath)(X,WZ.Type.Str)}`;return[Y4.schemaPath,J]}function jS($,{params:Z,message:X},Q){let{keyword:J,data:G,schemaValue:W,it:Y}=$,{opts:z,propertyName:q,topSchemaRef:H,schemaPath:B}=Y;if(Q.push([Y4.keyword,J],[Y4.params,typeof Z=="function"?Z($):Z||S0._`{}`]),z.messages)Q.push([Y4.message,typeof X=="function"?X($):X]);if(z.verbose)Q.push([Y4.schema,W],[Y4.parentSchema,S0._`${H}${B}`],[T$.default.data,G]);if(q)Q.push([Y4.propertyName,q])}});var $B=b((t3)=>{Object.defineProperty(t3,"__esModule",{value:!0});t3.boolOrEmptySchema=t3.topBoolOrEmptySchema=void 0;var CS=Z8(),SS=N0(),_S=J1(),bS={message:"boolean schema is false"};function xS($){let{gen:Z,schema:X,validateName:Q}=$;if(X===!1)s3($,!1);else if(typeof X=="object"&&X.$async===!0)Z.return(_S.default.data);else Z.assign(SS._`${Q}.errors`,null),Z.return(!0)}t3.topBoolOrEmptySchema=xS;function kS($,Z){let{gen:X,schema:Q}=$;if(Q===!1)X.var(Z,!1),s3($);else X.var(Z,!0)}t3.boolOrEmptySchema=kS;function s3($,Z){let{gen:X,data:Q}=$,J={gen:X,keyword:"false schema",data:Q,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};(0,CS.reportError)(J,bS,void 0,Z)}});var fQ=b((ZB)=>{Object.defineProperty(ZB,"__esModule",{value:!0});ZB.getRules=ZB.isJSONType=void 0;var vS=["string","number","integer","boolean","null","object","array"],gS=new Set(vS);function fS($){return typeof $=="string"&&gS.has($)}ZB.isJSONType=fS;function hS(){let $={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...$,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},$.number,$.string,$.array,$.object],post:{rules:[]},all:{},keywords:{}}}ZB.getRules=hS});var hQ=b((GB)=>{Object.defineProperty(GB,"__esModule",{value:!0});GB.shouldUseRule=GB.shouldUseGroup=GB.schemaHasRulesForType=void 0;function mS({schema:$,self:Z},X){let Q=Z.RULES.types[X];return Q&&Q!==!0&&QB($,Q)}GB.schemaHasRulesForType=mS;function QB($,Z){return Z.rules.some((X)=>JB($,X))}GB.shouldUseGroup=QB;function JB($,Z){var X;return $[Z.keyword]!==void 0||((X=Z.definition.implements)===null||X===void 0?void 0:X.some((Q)=>$[Q]!==void 0))}GB.shouldUseRule=JB});var X8=b((KB)=>{Object.defineProperty(KB,"__esModule",{value:!0});KB.reportTypeError=KB.checkDataTypes=KB.checkDataType=KB.coerceAndCheckDataType=KB.getJSONTypes=KB.getSchemaTypes=KB.DataType=void 0;var cS=fQ(),pS=hQ(),iS=Z8(),E0=N0(),YB=P0(),r4;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(r4||(KB.DataType=r4={}));function nS($){let Z=zB($.type);if(Z.includes("null")){if($.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!Z.length&&$.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if($.nullable===!0)Z.push("null")}return Z}KB.getSchemaTypes=nS;function zB($){let Z=Array.isArray($)?$:$?[$]:[];if(Z.every(cS.isJSONType))return Z;throw Error("type must be JSONType or JSONType[]: "+Z.join(","))}KB.getJSONTypes=zB;function rS($,Z){let{gen:X,data:Q,opts:J}=$,G=aS(Z,J.coerceTypes),W=Z.length>0&&!(G.length===0&&Z.length===1&&(0,pS.schemaHasRulesForType)($,Z[0]));if(W){let Y=mQ(Z,Q,J.strictNumbers,r4.Wrong);X.if(Y,()=>{if(G.length)oS($,Z,G);else dQ($)})}return W}KB.coerceAndCheckDataType=rS;var qB=new Set(["string","number","integer","boolean","null"]);function aS($,Z){return Z?$.filter((X)=>qB.has(X)||Z==="array"&&X==="array"):[]}function oS($,Z,X){let{gen:Q,data:J,opts:G}=$,W=Q.let("dataType",E0._`typeof ${J}`),Y=Q.let("coerced",E0._`undefined`);if(G.coerceTypes==="array")Q.if(E0._`${W} == 'object' && Array.isArray(${J}) && ${J}.length == 1`,()=>Q.assign(J,E0._`${J}[0]`).assign(W,E0._`typeof ${J}`).if(mQ(Z,J,G.strictNumbers),()=>Q.assign(Y,J)));Q.if(E0._`${Y} !== undefined`);for(let q of X)if(qB.has(q)||q==="array"&&G.coerceTypes==="array")z(q);Q.else(),dQ($),Q.endIf(),Q.if(E0._`${Y} !== undefined`,()=>{Q.assign(J,Y),sS($,Y)});function z(q){switch(q){case"string":Q.elseIf(E0._`${W} == "number" || ${W} == "boolean"`).assign(Y,E0._`"" + ${J}`).elseIf(E0._`${J} === null`).assign(Y,E0._`""`);return;case"number":Q.elseIf(E0._`${W} == "boolean" || ${J} === null
|
|
391
390
|
|| (${W} == "string" && ${J} && ${J} == +${J})`).assign(Y,E0._`+${J}`);return;case"integer":Q.elseIf(E0._`${W} === "boolean" || ${J} === null
|
|
392
391
|
|| (${W} === "string" && ${J} && ${J} == +${J} && !(${J} % 1))`).assign(Y,E0._`+${J}`);return;case"boolean":Q.elseIf(E0._`${J} === "false" || ${J} === 0 || ${J} === null`).assign(Y,!1).elseIf(E0._`${J} === "true" || ${J} === 1`).assign(Y,!0);return;case"null":Q.elseIf(E0._`${J} === "" || ${J} === 0 || ${J} === false`),Q.assign(Y,null);return;case"array":Q.elseIf(E0._`${W} === "string" || ${W} === "number"
|
|
393
|
-
|| ${W} === "boolean" || ${J} === null`).assign(Y,E0._`[${J}]`)}}}function SS({gen:$,parentData:Z,parentDataProperty:X},Q){$.if(E0._`${Z} !== undefined`,()=>$.assign(E0._`${Z}[${X}]`,Q))}function CQ($,Z,X,Q=d4.Correct){let J=Q===d4.Correct?E0.operators.EQ:E0.operators.NEQ,G;switch($){case"null":return E0._`${Z} ${J} null`;case"array":G=E0._`Array.isArray(${Z})`;break;case"object":G=E0._`${Z} && typeof ${Z} == "object" && !Array.isArray(${Z})`;break;case"integer":G=W(E0._`!(${Z} % 1) && !isNaN(${Z})`);break;case"number":G=W();break;default:return E0._`typeof ${Z} ${J} ${$}`}return Q===d4.Correct?G:(0,E0.not)(G);function W(Y=E0.nil){return(0,E0.and)(E0._`typeof ${Z} == "number"`,Y,X?E0._`isFinite(${Z})`:E0.nil)}}$B.checkDataType=CQ;function SQ($,Z,X,Q){if($.length===1)return CQ($[0],Z,X,Q);let J,G=(0,s3.toHash)($);if(G.array&&G.object){let W=E0._`typeof ${Z} != "object"`;J=G.null?W:E0._`!${Z} || ${W}`,delete G.null,delete G.array,delete G.object}else J=E0.nil;if(G.number)delete G.integer;for(let W in G)J=(0,E0.and)(J,CQ(W,Z,X,Q));return J}$B.checkDataTypes=SQ;var _S={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:Z})=>typeof $=="string"?E0._`{type: ${$}}`:E0._`{type: ${Z}}`};function _Q($){let Z=xS($);(0,OS.reportError)(Z,_S)}$B.reportTypeError=_Q;function xS($){let{gen:Z,data:X,schema:Q}=$,J=(0,s3.schemaRefOrVal)($,Q,"type");return{gen:Z,keyword:"type",data:X,schema:Q.type,schemaCode:J,schemaValue:J,parentSchema:Q,params:{},it:$}}});var GB=x((QB)=>{Object.defineProperty(QB,"__esModule",{value:!0});QB.assignDefaults=void 0;var l4=D0(),hS=R0();function uS($,Z){let{properties:X,items:Q}=$.schema;if(Z==="object"&&X)for(let J in X)XB($,J,X[J].default);else if(Z==="array"&&Array.isArray(Q))Q.forEach((J,G)=>XB($,G,J.default))}QB.assignDefaults=uS;function XB($,Z,X){let{gen:Q,compositeRule:J,data:G,opts:W}=$;if(X===void 0)return;let Y=l4._`${G}${(0,l4.getProperty)(Z)}`;if(J){(0,hS.checkStrictMode)($,`default is ignored for: ${Y}`);return}let z=l4._`${Y} === undefined`;if(W.useDefaults==="empty")z=l4._`${z} || ${Y} === null || ${Y} === ""`;Q.if(z,l4._`${Y} = ${(0,l4.stringify)(X)}`)}});var J6=x((zB)=>{Object.defineProperty(zB,"__esModule",{value:!0});zB.validateUnion=zB.validateArray=zB.usePattern=zB.callValidateCode=zB.schemaProperties=zB.allSchemaProperties=zB.noPropertyInData=zB.propertyInData=zB.isOwnProperty=zB.hasPropFunc=zB.reportMissingProp=zB.checkMissingProp=zB.checkReportMissingProp=void 0;var h0=D0(),xQ=R0(),S1=Q6(),mS=R0();function dS($,Z){let{gen:X,data:Q,it:J}=$;X.if(kQ(X,Q,Z,J.opts.ownProperties),()=>{$.setParams({missingProperty:h0._`${Z}`},!0),$.error()})}zB.checkReportMissingProp=dS;function lS({gen:$,data:Z,it:{opts:X}},Q,J){return(0,h0.or)(...Q.map((G)=>(0,h0.and)(kQ($,Z,G,X.ownProperties),h0._`${J} = ${G}`)))}zB.checkMissingProp=lS;function cS($,Z){$.setParams({missingProperty:Z},!0),$.error()}zB.reportMissingProp=cS;function WB($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:h0._`Object.prototype.hasOwnProperty`})}zB.hasPropFunc=WB;function bQ($,Z,X){return h0._`${WB($)}.call(${Z}, ${X})`}zB.isOwnProperty=bQ;function pS($,Z,X,Q){let J=h0._`${Z}${(0,h0.getProperty)(X)} !== undefined`;return Q?h0._`${J} && ${bQ($,Z,X)}`:J}zB.propertyInData=pS;function kQ($,Z,X,Q){let J=h0._`${Z}${(0,h0.getProperty)(X)} === undefined`;return Q?(0,h0.or)(J,(0,h0.not)(bQ($,Z,X))):J}zB.noPropertyInData=kQ;function YB($){return $?Object.keys($).filter((Z)=>Z!=="__proto__"):[]}zB.allSchemaProperties=YB;function iS($,Z){return YB(Z).filter((X)=>!(0,xQ.alwaysValidSchema)($,Z[X]))}zB.schemaProperties=iS;function nS({schemaCode:$,data:Z,it:{gen:X,topSchemaRef:Q,schemaPath:J,errorPath:G},it:W},Y,z,q){let H=q?h0._`${$}, ${Z}, ${Q}${J}`:Z,B=[[S1.default.instancePath,(0,h0.strConcat)(S1.default.instancePath,G)],[S1.default.parentData,W.parentData],[S1.default.parentDataProperty,W.parentDataProperty],[S1.default.rootData,S1.default.rootData]];if(W.opts.dynamicRef)B.push([S1.default.dynamicAnchors,S1.default.dynamicAnchors]);let F=h0._`${H}, ${X.object(...B)}`;return z!==h0.nil?h0._`${Y}.call(${z}, ${F})`:h0._`${Y}(${F})`}zB.callValidateCode=nS;var rS=h0._`new RegExp`;function aS({gen:$,it:{opts:Z}},X){let Q=Z.unicodeRegExp?"u":"",{regExp:J}=Z.code,G=J(X,Q);return $.scopeValue("pattern",{key:G.toString(),ref:G,code:h0._`${J.code==="new RegExp"?rS:(0,mS.useFunc)($,J)}(${X}, ${Q})`})}zB.usePattern=aS;function oS($){let{gen:Z,data:X,keyword:Q,it:J}=$,G=Z.name("valid");if(J.allErrors){let Y=Z.let("valid",!0);return W(()=>Z.assign(Y,!1)),Y}return Z.var(G,!0),W(()=>Z.break()),G;function W(Y){let z=Z.const("len",h0._`${X}.length`);Z.forRange("i",0,z,(q)=>{$.subschema({keyword:Q,dataProp:q,dataPropType:xQ.Type.Num},G),Z.if((0,h0.not)(G),Y)})}}zB.validateArray=oS;function sS($){let{gen:Z,schema:X,keyword:Q,it:J}=$;if(!Array.isArray(X))throw Error("ajv implementation error");if(X.some((z)=>(0,xQ.alwaysValidSchema)(J,z))&&!J.opts.unevaluated)return;let W=Z.let("valid",!1),Y=Z.name("_valid");Z.block(()=>X.forEach((z,q)=>{let H=$.subschema({keyword:Q,schemaProp:q,compositeRule:!0},Y);if(Z.assign(W,h0._`${W} || ${Y}`),!$.mergeValidEvaluated(H,Y))Z.if((0,h0.not)(W))})),$.result(W,()=>$.reset(),()=>$.error(!0))}zB.validateUnion=sS});var BB=x((HB)=>{Object.defineProperty(HB,"__esModule",{value:!0});HB.validateKeywordUsage=HB.validSchemaType=HB.funcKeywordCode=HB.macroKeywordCode=void 0;var T$=D0(),X4=Q6(),U_=J6(),K_=n9();function H_($,Z){let{gen:X,keyword:Q,schema:J,parentSchema:G,it:W}=$,Y=Z.macro.call(W.self,J,G,W),z=KB(X,Q,Y);if(W.opts.validateSchema!==!1)W.self.validateSchema(Y,!0);let q=X.name("valid");$.subschema({schema:Y,schemaPath:T$.nil,errSchemaPath:`${W.errSchemaPath}/${Q}`,topSchemaRef:z,compositeRule:!0},q),$.pass(q,()=>$.error(!0))}HB.macroKeywordCode=H_;function V_($,Z){var X;let{gen:Q,keyword:J,schema:G,parentSchema:W,$data:Y,it:z}=$;F_(z,Z);let q=!Y&&Z.compile?Z.compile.call(z.self,G,W,z):Z.validate,H=KB(Q,J,q),B=Q.let("valid");$.block$data(B,F),$.ok((X=Z.valid)!==null&&X!==void 0?X:B);function F(){if(Z.errors===!1){if(w(),Z.modifying)UB($);D(()=>$.error())}else{let j=Z.async?M():A();if(Z.modifying)UB($);D(()=>B_($,j))}}function M(){let j=Q.let("ruleErrs",null);return Q.try(()=>w(T$._`await `),(R)=>Q.assign(B,!1).if(T$._`${R} instanceof ${z.ValidationError}`,()=>Q.assign(j,T$._`${R}.errors`),()=>Q.throw(R))),j}function A(){let j=T$._`${H}.errors`;return Q.assign(j,null),w(T$.nil),j}function w(j=Z.async?T$._`await `:T$.nil){let R=z.opts.passContext?X4.default.this:X4.default.self,P=!(("compile"in Z)&&!Y||Z.schema===!1);Q.assign(B,T$._`${j}${(0,U_.callValidateCode)($,H,R,P)}`,Z.modifying)}function D(j){var R;Q.if((0,T$.not)((R=Z.valid)!==null&&R!==void 0?R:B),j)}}HB.funcKeywordCode=V_;function UB($){let{gen:Z,data:X,it:Q}=$;Z.if(Q.parentData,()=>Z.assign(X,T$._`${Q.parentData}[${Q.parentDataProperty}]`))}function B_($,Z){let{gen:X}=$;X.if(T$._`Array.isArray(${Z})`,()=>{X.assign(X4.default.vErrors,T$._`${X4.default.vErrors} === null ? ${Z} : ${X4.default.vErrors}.concat(${Z})`).assign(X4.default.errors,T$._`${X4.default.vErrors}.length`),(0,K_.extendErrors)($)},()=>$.error())}function F_({schemaEnv:$},Z){if(Z.async&&!$.$async)throw Error("async keyword in sync schema")}function KB($,Z,X){if(X===void 0)throw Error(`keyword "${Z}" failed to compile`);return $.scopeValue("keyword",typeof X=="function"?{ref:X}:{ref:X,code:(0,T$.stringify)(X)})}function L_($,Z,X=!1){return!Z.length||Z.some((Q)=>Q==="array"?Array.isArray($):Q==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==Q||X&&typeof $>"u")}HB.validSchemaType=L_;function M_({schema:$,opts:Z,self:X,errSchemaPath:Q},J,G){if(Array.isArray(J.keyword)?!J.keyword.includes(G):J.keyword!==G)throw Error("ajv implementation error");let W=J.dependencies;if(W===null||W===void 0?void 0:W.some((Y)=>!Object.prototype.hasOwnProperty.call($,Y)))throw Error(`parent schema must have dependencies of ${G}: ${W.join(",")}`);if(J.validateSchema){if(!J.validateSchema($[G])){let z=`keyword "${G}" value is invalid at path "${Q}": `+X.errorsText(J.validateSchema.errors);if(Z.validateSchema==="log")X.logger.error(z);else throw Error(z)}}}HB.validateKeywordUsage=M_});var AB=x((LB)=>{Object.defineProperty(LB,"__esModule",{value:!0});LB.extendSubschemaMode=LB.extendSubschemaData=LB.getSubschema=void 0;var y6=D0(),FB=R0();function D_($,{keyword:Z,schemaProp:X,schema:Q,schemaPath:J,errSchemaPath:G,topSchemaRef:W}){if(Z!==void 0&&Q!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(Z!==void 0){let Y=$.schema[Z];return X===void 0?{schema:Y,schemaPath:y6._`${$.schemaPath}${(0,y6.getProperty)(Z)}`,errSchemaPath:`${$.errSchemaPath}/${Z}`}:{schema:Y[X],schemaPath:y6._`${$.schemaPath}${(0,y6.getProperty)(Z)}${(0,y6.getProperty)(X)}`,errSchemaPath:`${$.errSchemaPath}/${Z}/${(0,FB.escapeFragment)(X)}`}}if(Q!==void 0){if(J===void 0||G===void 0||W===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:Q,schemaPath:J,topSchemaRef:W,errSchemaPath:G}}throw Error('either "keyword" or "schema" must be passed')}LB.getSubschema=D_;function w_($,Z,{dataProp:X,dataPropType:Q,data:J,dataTypes:G,propertyName:W}){if(J!==void 0&&X!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:Y}=Z;if(X!==void 0){let{errorPath:q,dataPathArr:H,opts:B}=Z,F=Y.let("data",y6._`${Z.data}${(0,y6.getProperty)(X)}`,!0);z(F),$.errorPath=y6.str`${q}${(0,FB.getErrorPath)(X,Q,B.jsPropertySyntax)}`,$.parentDataProperty=y6._`${X}`,$.dataPathArr=[...H,$.parentDataProperty]}if(J!==void 0){let q=J instanceof y6.Name?J:Y.let("data",J,!0);if(z(q),W!==void 0)$.propertyName=W}if(G)$.dataTypes=G;function z(q){$.data=q,$.dataLevel=Z.dataLevel+1,$.dataTypes=[],Z.definedProperties=new Set,$.parentData=Z.data,$.dataNames=[...Z.dataNames,q]}}LB.extendSubschemaData=w_;function T_($,{jtdDiscriminator:Z,jtdMetadata:X,compositeRule:Q,createErrors:J,allErrors:G}){if(Q!==void 0)$.compositeRule=Q;if(J!==void 0)$.createErrors=J;if(G!==void 0)$.allErrors=G;$.jtdDiscriminator=Z,$.jtdMetadata=X}LB.extendSubschemaMode=T_});var yQ=x((di,IB)=>{IB.exports=function $(Z,X){if(Z===X)return!0;if(Z&&X&&typeof Z=="object"&&typeof X=="object"){if(Z.constructor!==X.constructor)return!1;var Q,J,G;if(Array.isArray(Z)){if(Q=Z.length,Q!=X.length)return!1;for(J=Q;J--!==0;)if(!$(Z[J],X[J]))return!1;return!0}if(Z.constructor===RegExp)return Z.source===X.source&&Z.flags===X.flags;if(Z.valueOf!==Object.prototype.valueOf)return Z.valueOf()===X.valueOf();if(Z.toString!==Object.prototype.toString)return Z.toString()===X.toString();if(G=Object.keys(Z),Q=G.length,Q!==Object.keys(X).length)return!1;for(J=Q;J--!==0;)if(!Object.prototype.hasOwnProperty.call(X,G[J]))return!1;for(J=Q;J--!==0;){var W=G[J];if(!$(Z[W],X[W]))return!1}return!0}return Z!==Z&&X!==X}});var DB=x((li,NB)=>{var _1=NB.exports=function($,Z,X){if(typeof Z=="function")X=Z,Z={};X=Z.cb||X;var Q=typeof X=="function"?X:X.pre||function(){},J=X.post||function(){};s8(Z,Q,J,$,"",$)};_1.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};_1.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};_1.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};_1.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 s8($,Z,X,Q,J,G,W,Y,z,q){if(Q&&typeof Q=="object"&&!Array.isArray(Q)){Z(Q,J,G,W,Y,z,q);for(var H in Q){var B=Q[H];if(Array.isArray(B)){if(H in _1.arrayKeywords)for(var F=0;F<B.length;F++)s8($,Z,X,B[F],J+"/"+H+"/"+F,G,J,H,Q,F)}else if(H in _1.propsKeywords){if(B&&typeof B=="object")for(var M in B)s8($,Z,X,B[M],J+"/"+H+"/"+E_(M),G,J,H,Q,M)}else if(H in _1.keywords||$.allKeys&&!(H in _1.skipKeywords))s8($,Z,X,B,J+"/"+H,G,J,H,Q)}X(Q,J,G,W,Y,z,q)}}function E_($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var a9=x((OB)=>{Object.defineProperty(OB,"__esModule",{value:!0});OB.getSchemaRefs=OB.resolveUrl=OB.normalizeId=OB._getFullPath=OB.getFullPath=OB.inlineRef=void 0;var R_=R0(),P_=yQ(),C_=DB(),S_=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function __($,Z=!0){if(typeof $=="boolean")return!0;if(Z===!0)return!vQ($);if(!Z)return!1;return wB($)<=Z}OB.inlineRef=__;var x_=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function vQ($){for(let Z in $){if(x_.has(Z))return!0;let X=$[Z];if(Array.isArray(X)&&X.some(vQ))return!0;if(typeof X=="object"&&vQ(X))return!0}return!1}function wB($){let Z=0;for(let X in $){if(X==="$ref")return 1/0;if(Z++,S_.has(X))continue;if(typeof $[X]=="object")(0,R_.eachItem)($[X],(Q)=>Z+=wB(Q));if(Z===1/0)return 1/0}return Z}function TB($,Z="",X){if(X!==!1)Z=c4(Z);let Q=$.parse(Z);return jB($,Q)}OB.getFullPath=TB;function jB($,Z){return $.serialize(Z).split("#")[0]+"#"}OB._getFullPath=jB;var b_=/#\/?$/;function c4($){return $?$.replace(b_,""):""}OB.normalizeId=c4;function k_($,Z,X){return X=c4(X),$.resolve(Z,X)}OB.resolveUrl=k_;var y_=/^[a-z_][-a-z0-9._]*$/i;function v_($,Z){if(typeof $=="boolean")return{};let{schemaId:X,uriResolver:Q}=this.opts,J=c4($[X]||Z),G={"":J},W=TB(Q,J,!1),Y={},z=new Set;return C_($,{allKeys:!0},(B,F,M,A)=>{if(A===void 0)return;let w=W+F,D=G[A];if(typeof B[X]=="string")D=j.call(this,B[X]);R.call(this,B.$anchor),R.call(this,B.$dynamicAnchor),G[F]=D;function j(P){let E=this.opts.uriResolver.resolve;if(P=c4(D?E(D,P):P),z.has(P))throw H(P);z.add(P);let C=this.refs[P];if(typeof C=="string")C=this.refs[C];if(typeof C=="object")q(B,C.schema,P);else if(P!==c4(w))if(P[0]==="#")q(B,Y[P],P),Y[P]=B;else this.refs[P]=w;return P}function R(P){if(typeof P=="string"){if(!y_.test(P))throw Error(`invalid anchor "${P}"`);j.call(this,`#${P}`)}}}),Y;function q(B,F,M){if(F!==void 0&&!P_(B,F))throw H(M)}function H(B){return Error(`reference "${B}" resolves to more than one schema`)}}OB.getSchemaRefs=v_});var p4=x((mB)=>{Object.defineProperty(mB,"__esModule",{value:!0});mB.getData=mB.KeywordCxt=mB.validateFunctionCode=void 0;var _B=c3(),RB=r9(),fQ=PQ(),t8=r9(),d_=GB(),s9=BB(),gQ=AB(),B0=D0(),I0=Q6(),l_=a9(),Q1=R0(),o9=n9();function c_($){if(kB($)){if(yB($),bB($)){n_($);return}}xB($,()=>(0,_B.topBoolOrEmptySchema)($))}mB.validateFunctionCode=c_;function xB({gen:$,validateName:Z,schema:X,schemaEnv:Q,opts:J},G){if(J.code.es5)$.func(Z,B0._`${I0.default.data}, ${I0.default.valCxt}`,Q.$async,()=>{$.code(B0._`"use strict"; ${PB(X,J)}`),i_($,J),$.code(G)});else $.func(Z,B0._`${I0.default.data}, ${p_(J)}`,Q.$async,()=>$.code(PB(X,J)).code(G))}function p_($){return B0._`{${I0.default.instancePath}="", ${I0.default.parentData}, ${I0.default.parentDataProperty}, ${I0.default.rootData}=${I0.default.data}${$.dynamicRef?B0._`, ${I0.default.dynamicAnchors}={}`:B0.nil}}={}`}function i_($,Z){$.if(I0.default.valCxt,()=>{if($.var(I0.default.instancePath,B0._`${I0.default.valCxt}.${I0.default.instancePath}`),$.var(I0.default.parentData,B0._`${I0.default.valCxt}.${I0.default.parentData}`),$.var(I0.default.parentDataProperty,B0._`${I0.default.valCxt}.${I0.default.parentDataProperty}`),$.var(I0.default.rootData,B0._`${I0.default.valCxt}.${I0.default.rootData}`),Z.dynamicRef)$.var(I0.default.dynamicAnchors,B0._`${I0.default.valCxt}.${I0.default.dynamicAnchors}`)},()=>{if($.var(I0.default.instancePath,B0._`""`),$.var(I0.default.parentData,B0._`undefined`),$.var(I0.default.parentDataProperty,B0._`undefined`),$.var(I0.default.rootData,I0.default.data),Z.dynamicRef)$.var(I0.default.dynamicAnchors,B0._`{}`)})}function n_($){let{schema:Z,opts:X,gen:Q}=$;xB($,()=>{if(X.$comment&&Z.$comment)gB($);if(t_($),Q.let(I0.default.vErrors,null),Q.let(I0.default.errors,0),X.unevaluated)r_($);vB($),Zx($)});return}function r_($){let{gen:Z,validateName:X}=$;$.evaluated=Z.const("evaluated",B0._`${X}.evaluated`),Z.if(B0._`${$.evaluated}.dynamicProps`,()=>Z.assign(B0._`${$.evaluated}.props`,B0._`undefined`)),Z.if(B0._`${$.evaluated}.dynamicItems`,()=>Z.assign(B0._`${$.evaluated}.items`,B0._`undefined`))}function PB($,Z){let X=typeof $=="object"&&$[Z.schemaId];return X&&(Z.code.source||Z.code.process)?B0._`/*# sourceURL=${X} */`:B0.nil}function a_($,Z){if(kB($)){if(yB($),bB($)){o_($,Z);return}}(0,_B.boolOrEmptySchema)($,Z)}function bB({schema:$,self:Z}){if(typeof $=="boolean")return!$;for(let X in $)if(Z.RULES.all[X])return!0;return!1}function kB($){return typeof $.schema!="boolean"}function o_($,Z){let{schema:X,gen:Q,opts:J}=$;if(J.$comment&&X.$comment)gB($);e_($),$x($);let G=Q.const("_errs",I0.default.errors);vB($,G),Q.var(Z,B0._`${G} === ${I0.default.errors}`)}function yB($){(0,Q1.checkUnknownRules)($),s_($)}function vB($,Z){if($.opts.jtd)return CB($,[],!1,Z);let X=(0,RB.getSchemaTypes)($.schema),Q=(0,RB.coerceAndCheckDataType)($,X);CB($,X,!Q,Z)}function s_($){let{schema:Z,errSchemaPath:X,opts:Q,self:J}=$;if(Z.$ref&&Q.ignoreKeywordsWithRef&&(0,Q1.schemaHasRulesButRef)(Z,J.RULES))J.logger.warn(`$ref: keywords ignored in schema at path "${X}"`)}function t_($){let{schema:Z,opts:X}=$;if(Z.default!==void 0&&X.useDefaults&&X.strictSchema)(0,Q1.checkStrictMode)($,"default is ignored in the schema root")}function e_($){let Z=$.schema[$.opts.schemaId];if(Z)$.baseId=(0,l_.resolveUrl)($.opts.uriResolver,$.baseId,Z)}function $x($){if($.schema.$async&&!$.schemaEnv.$async)throw Error("async schema in sync schema")}function gB({gen:$,schemaEnv:Z,schema:X,errSchemaPath:Q,opts:J}){let G=X.$comment;if(J.$comment===!0)$.code(B0._`${I0.default.self}.logger.log(${G})`);else if(typeof J.$comment=="function"){let W=B0.str`${Q}/$comment`,Y=$.scopeValue("root",{ref:Z.root});$.code(B0._`${I0.default.self}.opts.$comment(${G}, ${W}, ${Y}.schema)`)}}function Zx($){let{gen:Z,schemaEnv:X,validateName:Q,ValidationError:J,opts:G}=$;if(X.$async)Z.if(B0._`${I0.default.errors} === 0`,()=>Z.return(I0.default.data),()=>Z.throw(B0._`new ${J}(${I0.default.vErrors})`));else{if(Z.assign(B0._`${Q}.errors`,I0.default.vErrors),G.unevaluated)Xx($);Z.return(B0._`${I0.default.errors} === 0`)}}function Xx({gen:$,evaluated:Z,props:X,items:Q}){if(X instanceof B0.Name)$.assign(B0._`${Z}.props`,X);if(Q instanceof B0.Name)$.assign(B0._`${Z}.items`,Q)}function CB($,Z,X,Q){let{gen:J,schema:G,data:W,allErrors:Y,opts:z,self:q}=$,{RULES:H}=q;if(G.$ref&&(z.ignoreKeywordsWithRef||!(0,Q1.schemaHasRulesButRef)(G,H))){J.block(()=>hB($,"$ref",H.all.$ref.definition));return}if(!z.jtd)Qx($,Z);J.block(()=>{for(let F of H.rules)B(F);B(H.post)});function B(F){if(!(0,fQ.shouldUseGroup)(G,F))return;if(F.type){if(J.if((0,t8.checkDataType)(F.type,W,z.strictNumbers)),SB($,F),Z.length===1&&Z[0]===F.type&&X)J.else(),(0,t8.reportTypeError)($);J.endIf()}else SB($,F);if(!Y)J.if(B0._`${I0.default.errors} === ${Q||0}`)}}function SB($,Z){let{gen:X,schema:Q,opts:{useDefaults:J}}=$;if(J)(0,d_.assignDefaults)($,Z.type);X.block(()=>{for(let G of Z.rules)if((0,fQ.shouldUseRule)(Q,G))hB($,G.keyword,G.definition,Z.type)})}function Qx($,Z){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(Jx($,Z),!$.opts.allowUnionTypes)Gx($,Z);Wx($,$.dataTypes)}function Jx($,Z){if(!Z.length)return;if(!$.dataTypes.length){$.dataTypes=Z;return}Z.forEach((X)=>{if(!fB($.dataTypes,X))hQ($,`type "${X}" not allowed by context "${$.dataTypes.join(",")}"`)}),zx($,Z)}function Gx($,Z){if(Z.length>1&&!(Z.length===2&&Z.includes("null")))hQ($,"use allowUnionTypes to allow union type keyword")}function Wx($,Z){let X=$.self.RULES.all;for(let Q in X){let J=X[Q];if(typeof J=="object"&&(0,fQ.shouldUseRule)($.schema,J)){let{type:G}=J.definition;if(G.length&&!G.some((W)=>Yx(Z,W)))hQ($,`missing type "${G.join(",")}" for keyword "${Q}"`)}}}function Yx($,Z){return $.includes(Z)||Z==="number"&&$.includes("integer")}function fB($,Z){return $.includes(Z)||Z==="integer"&&$.includes("number")}function zx($,Z){let X=[];for(let Q of $.dataTypes)if(fB(Z,Q))X.push(Q);else if(Z.includes("integer")&&Q==="number")X.push("integer");$.dataTypes=X}function hQ($,Z){let X=$.schemaEnv.baseId+$.errSchemaPath;Z+=` at "${X}" (strictTypes)`,(0,Q1.checkStrictMode)($,Z,$.opts.strictTypes)}class uQ{constructor($,Z,X){if((0,s9.validateKeywordUsage)($,Z,X),this.gen=$.gen,this.allErrors=$.allErrors,this.keyword=X,this.data=$.data,this.schema=$.schema[X],this.$data=Z.$data&&$.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Q1.schemaRefOrVal)($,this.schema,X,this.$data),this.schemaType=Z.schemaType,this.parentSchema=$.schema,this.params={},this.it=$,this.def=Z,this.$data)this.schemaCode=$.gen.const("vSchema",uB(this.$data,$));else if(this.schemaCode=this.schemaValue,!(0,s9.validSchemaType)(this.schema,Z.schemaType,Z.allowUndefined))throw Error(`${X} value must be ${JSON.stringify(Z.schemaType)}`);if("code"in Z?Z.trackErrors:Z.errors!==!1)this.errsCount=$.gen.const("_errs",I0.default.errors)}result($,Z,X){this.failResult((0,B0.not)($),Z,X)}failResult($,Z,X){if(this.gen.if($),X)X();else this.error();if(Z){if(this.gen.else(),Z(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass($,Z){this.failResult((0,B0.not)($),void 0,Z)}fail($){if($===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if($),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data($){if(!this.$data)return this.fail($);let{schemaCode:Z}=this;this.fail(B0._`${Z} !== undefined && (${(0,B0.or)(this.invalid$data(),$)})`)}error($,Z,X){if(Z){this.setParams(Z),this._error($,X),this.setParams({});return}this._error($,X)}_error($,Z){($?o9.reportExtraError:o9.reportError)(this,this.def.error,Z)}$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($){if(!this.allErrors)this.gen.if($)}setParams($,Z){if(Z)Object.assign(this.params,$);else this.params=$}block$data($,Z,X=B0.nil){this.gen.block(()=>{this.check$data($,X),Z()})}check$data($=B0.nil,Z=B0.nil){if(!this.$data)return;let{gen:X,schemaCode:Q,schemaType:J,def:G}=this;if(X.if((0,B0.or)(B0._`${Q} === undefined`,Z)),$!==B0.nil)X.assign($,!0);if(J.length||G.validateSchema){if(X.elseIf(this.invalid$data()),this.$dataError(),$!==B0.nil)X.assign($,!1)}X.else()}invalid$data(){let{gen:$,schemaCode:Z,schemaType:X,def:Q,it:J}=this;return(0,B0.or)(G(),W());function G(){if(X.length){if(!(Z instanceof B0.Name))throw Error("ajv implementation error");let Y=Array.isArray(X)?X:[X];return B0._`${(0,t8.checkDataTypes)(Y,Z,J.opts.strictNumbers,t8.DataType.Wrong)}`}return B0.nil}function W(){if(Q.validateSchema){let Y=$.scopeValue("validate$data",{ref:Q.validateSchema});return B0._`!${Y}(${Z})`}return B0.nil}}subschema($,Z){let X=(0,gQ.getSubschema)(this.it,$);(0,gQ.extendSubschemaData)(X,this.it,$),(0,gQ.extendSubschemaMode)(X,$);let Q={...this.it,...X,items:void 0,props:void 0};return a_(Q,Z),Q}mergeEvaluated($,Z){let{it:X,gen:Q}=this;if(!X.opts.unevaluated)return;if(X.props!==!0&&$.props!==void 0)X.props=Q1.mergeEvaluated.props(Q,$.props,X.props,Z);if(X.items!==!0&&$.items!==void 0)X.items=Q1.mergeEvaluated.items(Q,$.items,X.items,Z)}mergeValidEvaluated($,Z){let{it:X,gen:Q}=this;if(X.opts.unevaluated&&(X.props!==!0||X.items!==!0))return Q.if(Z,()=>this.mergeEvaluated($,B0.Name)),!0}}mB.KeywordCxt=uQ;function hB($,Z,X,Q){let J=new uQ($,X,Z);if("code"in X)X.code(J,Q);else if(J.$data&&X.validate)(0,s9.funcKeywordCode)(J,X);else if("macro"in X)(0,s9.macroKeywordCode)(J,X);else if(X.compile||X.validate)(0,s9.funcKeywordCode)(J,X)}var qx=/^\/(?:[^~]|~0|~1)*$/,Ux=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function uB($,{dataLevel:Z,dataNames:X,dataPathArr:Q}){let J,G;if($==="")return I0.default.rootData;if($[0]==="/"){if(!qx.test($))throw Error(`Invalid JSON-pointer: ${$}`);J=$,G=I0.default.rootData}else{let q=Ux.exec($);if(!q)throw Error(`Invalid JSON-pointer: ${$}`);let H=+q[1];if(J=q[2],J==="#"){if(H>=Z)throw Error(z("property/index",H));return Q[Z-H]}if(H>Z)throw Error(z("data",H));if(G=X[Z-H],!J)return G}let W=G,Y=J.split("/");for(let q of Y)if(q)G=B0._`${G}${(0,B0.getProperty)((0,Q1.unescapeJsonPointer)(q))}`,W=B0._`${W} && ${G}`;return W;function z(q,H){return`Cannot access ${q} ${H} levels up, current level is ${Z}`}}mB.getData=uB});var t9=x((cB)=>{Object.defineProperty(cB,"__esModule",{value:!0});class lB extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}cB.default=lB});var i4=x((iB)=>{Object.defineProperty(iB,"__esModule",{value:!0});var mQ=a9();class pB extends Error{constructor($,Z,X,Q){super(Q||`can't resolve reference ${X} from id ${Z}`);this.missingRef=(0,mQ.resolveUrl)($,Z,X),this.missingSchema=(0,mQ.normalizeId)((0,mQ.getFullPath)($,this.missingRef))}}iB.default=pB});var $5=x((aB)=>{Object.defineProperty(aB,"__esModule",{value:!0});aB.resolveSchema=aB.getCompilingSchema=aB.resolveRef=aB.compileSchema=aB.SchemaEnv=void 0;var H6=D0(),Fx=t9(),Q4=Q6(),V6=a9(),nB=R0(),Lx=p4();class e9{constructor($){var Z;this.refs={},this.dynamicAnchors={};let X;if(typeof $.schema=="object")X=$.schema;this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(Z=$.baseId)!==null&&Z!==void 0?Z:(0,V6.normalizeId)(X===null||X===void 0?void 0:X[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=X===null||X===void 0?void 0:X.$async,this.refs={}}}aB.SchemaEnv=e9;function lQ($){let Z=rB.call(this,$);if(Z)return Z;let X=(0,V6.getFullPath)(this.opts.uriResolver,$.root.baseId),{es5:Q,lines:J}=this.opts.code,{ownProperties:G}=this.opts,W=new H6.CodeGen(this.scope,{es5:Q,lines:J,ownProperties:G}),Y;if($.$async)Y=W.scopeValue("Error",{ref:Fx.default,code:H6._`require("ajv/dist/runtime/validation_error").default`});let z=W.scopeName("validate");$.validateName=z;let q={gen:W,allErrors:this.opts.allErrors,data:Q4.default.data,parentData:Q4.default.parentData,parentDataProperty:Q4.default.parentDataProperty,dataNames:[Q4.default.data],dataPathArr:[H6.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:W.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:(0,H6.stringify)($.schema)}:{ref:$.schema}),validateName:z,ValidationError:Y,schema:$.schema,schemaEnv:$,rootId:X,baseId:$.baseId||X,schemaPath:H6.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:H6._`""`,opts:this.opts,self:this},H;try{this._compilations.add($),(0,Lx.validateFunctionCode)(q),W.optimize(this.opts.code.optimize);let B=W.toString();if(H=`${W.scopeRefs(Q4.default.scope)}return ${B}`,this.opts.code.process)H=this.opts.code.process(H,$);let M=Function(`${Q4.default.self}`,`${Q4.default.scope}`,H)(this,this.scope.get());if(this.scope.value(z,{ref:M}),M.errors=null,M.schema=$.schema,M.schemaEnv=$,$.$async)M.$async=!0;if(this.opts.code.source===!0)M.source={validateName:z,validateCode:B,scopeValues:W._values};if(this.opts.unevaluated){let{props:A,items:w}=q;if(M.evaluated={props:A instanceof H6.Name?void 0:A,items:w instanceof H6.Name?void 0:w,dynamicProps:A instanceof H6.Name,dynamicItems:w instanceof H6.Name},M.source)M.source.evaluated=(0,H6.stringify)(M.evaluated)}return $.validate=M,$}catch(B){if(delete $.validate,delete $.validateName,H)this.logger.error("Error compiling schema, function code:",H);throw B}finally{this._compilations.delete($)}}aB.compileSchema=lQ;function Mx($,Z,X){var Q;X=(0,V6.resolveUrl)(this.opts.uriResolver,Z,X);let J=$.refs[X];if(J)return J;let G=Nx.call(this,$,X);if(G===void 0){let W=(Q=$.localRefs)===null||Q===void 0?void 0:Q[X],{schemaId:Y}=this.opts;if(W)G=new e9({schema:W,schemaId:Y,root:$,baseId:Z})}if(G===void 0)return;return $.refs[X]=Ax.call(this,G)}aB.resolveRef=Mx;function Ax($){if((0,V6.inlineRef)($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:lQ.call(this,$)}function rB($){for(let Z of this._compilations)if(Ix(Z,$))return Z}aB.getCompilingSchema=rB;function Ix($,Z){return $.schema===Z.schema&&$.root===Z.root&&$.baseId===Z.baseId}function Nx($,Z){let X;while(typeof(X=this.refs[Z])=="string")Z=X;return X||this.schemas[Z]||e8.call(this,$,Z)}function e8($,Z){let X=this.opts.uriResolver.parse(Z),Q=(0,V6._getFullPath)(this.opts.uriResolver,X),J=(0,V6.getFullPath)(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&Q===J)return dQ.call(this,X,$);let G=(0,V6.normalizeId)(Q),W=this.refs[G]||this.schemas[G];if(typeof W=="string"){let Y=e8.call(this,$,W);if(typeof(Y===null||Y===void 0?void 0:Y.schema)!=="object")return;return dQ.call(this,X,Y)}if(typeof(W===null||W===void 0?void 0:W.schema)!=="object")return;if(!W.validate)lQ.call(this,W);if(G===(0,V6.normalizeId)(Z)){let{schema:Y}=W,{schemaId:z}=this.opts,q=Y[z];if(q)J=(0,V6.resolveUrl)(this.opts.uriResolver,J,q);return new e9({schema:Y,schemaId:z,root:$,baseId:J})}return dQ.call(this,X,W)}aB.resolveSchema=e8;var Dx=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function dQ($,{baseId:Z,schema:X,root:Q}){var J;if(((J=$.fragment)===null||J===void 0?void 0:J[0])!=="/")return;for(let Y of $.fragment.slice(1).split("/")){if(typeof X==="boolean")return;let z=X[(0,nB.unescapeFragment)(Y)];if(z===void 0)return;X=z;let q=typeof X==="object"&&X[this.opts.schemaId];if(!Dx.has(Y)&&q)Z=(0,V6.resolveUrl)(this.opts.uriResolver,Z,q)}let G;if(typeof X!="boolean"&&X.$ref&&!(0,nB.schemaHasRulesButRef)(X,this.RULES)){let Y=(0,V6.resolveUrl)(this.opts.uriResolver,Z,X.$ref);G=e8.call(this,Q,Y)}let{schemaId:W}=this.opts;if(G=G||new e9({schema:X,schemaId:W,root:Q,baseId:Z}),G.schema!==G.root.schema)return G;return}});var sB=x((ai,Ex)=>{Ex.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 iQ=x((oi,QF)=>{var Rx=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),eB=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),cQ=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),$F=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Px=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function pQ($){let Z="",X=0,Q=0;for(Q=0;Q<$.length;Q++){if(X=$[Q].charCodeAt(0),X===48)continue;if(!(X>=48&&X<=57||X>=65&&X<=70||X>=97&&X<=102))return"";Z+=$[Q];break}for(Q+=1;Q<$.length;Q++){if(X=$[Q].charCodeAt(0),!(X>=48&&X<=57||X>=65&&X<=70||X>=97&&X<=102))return"";Z+=$[Q]}return Z}var Cx=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function tB($){return $.length=0,!0}function Sx($,Z,X){if($.length){let Q=pQ($);if(Q!=="")Z.push(Q);else return X.error=!0,!1;$.length=0}return!0}function _x($){let Z=0,X={error:!1,address:"",zone:""},Q=[],J=[],G=!1,W=!1,Y=Sx;for(let z=0;z<$.length;z++){let q=$[z];if(q==="["||q==="]")continue;if(q===":"){if(G===!0)W=!0;if(!Y(J,Q,X))break;if(++Z>7){X.error=!0;break}if(z>0&&$[z-1]===":")G=!0;Q.push(":");continue}else if(q==="%"){if(!Y(J,Q,X))break;Y=tB}else{J.push(q);continue}}if(J.length)if(Y===tB)X.zone=J.join("");else if(W)Q.push(J.join(""));else Q.push(pQ(J));return X.address=Q.join(""),X}function ZF($){if(xx($,":")<2)return{host:$,isIPV6:!1};let Z=_x($);if(!Z.error){let{address:X,address:Q}=Z;if(Z.zone)X+="%"+Z.zone,Q+="%25"+Z.zone;return{host:X,isIPV6:!0,escapedHost:Q}}else return{host:$,isIPV6:!1}}function xx($,Z){let X=0;for(let Q=0;Q<$.length;Q++)if($[Q]===Z)X++;return X}function bx($){let Z=$,X=[],Q=-1,J=0;while(J=Z.length){if(J===1)if(Z===".")break;else if(Z==="/"){X.push("/");break}else{X.push(Z);break}else if(J===2){if(Z[0]==="."){if(Z[1]===".")break;else if(Z[1]==="/"){Z=Z.slice(2);continue}}else if(Z[0]==="/"){if(Z[1]==="."||Z[1]==="/"){X.push("/");break}}}else if(J===3){if(Z==="/.."){if(X.length!==0)X.pop();X.push("/");break}}if(Z[0]==="."){if(Z[1]==="."){if(Z[2]==="/"){Z=Z.slice(3);continue}}else if(Z[1]==="/"){Z=Z.slice(2);continue}}else if(Z[0]==="/"){if(Z[1]==="."){if(Z[2]==="/"){Z=Z.slice(2);continue}else if(Z[2]==="."){if(Z[3]==="/"){if(Z=Z.slice(3),X.length!==0)X.pop();continue}}}}if((Q=Z.indexOf("/",1))===-1){X.push(Z);break}else X.push(Z.slice(0,Q)),Z=Z.slice(Q)}return X.join("")}var kx={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},yx=/[@/?#:]/g,vx=/[@/?#]/g;function XF($,Z){let X=Z?vx:yx;return X.lastIndex=0,$.replace(X,(Q)=>kx[Q])}function gx($,Z=!1){if($.indexOf("%")===-1)return $;let X="";for(let Q=0;Q<$.length;Q++){if($[Q]==="%"&&Q+2<$.length){let J=$.slice(Q+1,Q+3);if(cQ(J)){let G=J.toUpperCase(),W=String.fromCharCode(parseInt(G,16));if(Z&&$F(W))X+=W;else X+="%"+G;Q+=2;continue}}X+=$[Q]}return X}function fx($){let Z="";for(let X=0;X<$.length;X++){if($[X]==="%"&&X+2<$.length){let Q=$.slice(X+1,X+3);if(cQ(Q)){let J=Q.toUpperCase(),G=String.fromCharCode(parseInt(J,16));if(G!=="."&&$F(G))Z+=G;else Z+="%"+J;X+=2;continue}}if(Px($[X]))Z+=$[X];else Z+=escape($[X])}return Z}function hx($){let Z="";for(let X=0;X<$.length;X++){if($[X]==="%"&&X+2<$.length){let Q=$.slice(X+1,X+3);if(cQ(Q)){Z+="%"+Q.toUpperCase(),X+=2;continue}}Z+=escape($[X])}return Z}function ux($){let Z=[];if($.userinfo!==void 0)Z.push($.userinfo),Z.push("@");if($.host!==void 0){let X=unescape($.host);if(!eB(X)){let Q=ZF(X);if(Q.isIPV6===!0)X=`[${Q.escapedHost}]`;else X=XF(X,!1)}Z.push(X)}if(typeof $.port==="number"||typeof $.port==="string")Z.push(":"),Z.push(String($.port));return Z.length?Z.join(""):void 0}QF.exports={nonSimpleDomain:Cx,recomposeAuthority:ux,reescapeHostDelimiters:XF,normalizePercentEncoding:gx,normalizePathEncoding:fx,escapePreservingEscapes:hx,removeDotSegments:bx,isIPv4:eB,isUUID:Rx,normalizeIPv6:ZF,stringArrayToHexStripped:pQ}});var zF=x((si,YF)=>{var{isUUID:mx}=iQ(),dx=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,lx=["http","https","ws","wss","urn","urn:uuid"];function cx($){return lx.indexOf($)!==-1}function nQ($){if($.secure===!0)return!0;else if($.secure===!1)return!1;else if($.scheme)return $.scheme.length===3&&($.scheme[0]==="w"||$.scheme[0]==="W")&&($.scheme[1]==="s"||$.scheme[1]==="S")&&($.scheme[2]==="s"||$.scheme[2]==="S");else return!1}function JF($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function GF($){let Z=String($.scheme).toLowerCase()==="https";if($.port===(Z?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function px($){return $.secure=nQ($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function ix($){if($.port===(nQ($)?443:80)||$.port==="")$.port=void 0;if(typeof $.secure==="boolean")$.scheme=$.secure?"wss":"ws",$.secure=void 0;if($.resourceName){let[Z,X]=$.resourceName.split("?");$.path=Z&&Z!=="/"?Z:void 0,$.query=X,$.resourceName=void 0}return $.fragment=void 0,$}function nx($,Z){if(!$.path)return $.error="URN can not be parsed",$;let X=$.path.match(dx);if(X){let Q=Z.scheme||$.scheme||"urn";$.nid=X[1].toLowerCase(),$.nss=X[2];let J=`${Q}:${Z.nid||$.nid}`,G=rQ(J);if($.path=void 0,G)$=G.parse($,Z)}else $.error=$.error||"URN can not be parsed.";return $}function rx($,Z){if($.nid===void 0)throw Error("URN without nid cannot be serialized");let X=Z.scheme||$.scheme||"urn",Q=$.nid.toLowerCase(),J=`${X}:${Z.nid||Q}`,G=rQ(J);if(G)$=G.serialize($,Z);let W=$,Y=$.nss;return W.path=`${Q||Z.nid}:${Y}`,Z.skipEscape=!0,W}function ax($,Z){let X=$;if(X.uuid=X.nss,X.nss=void 0,!Z.tolerant&&(!X.uuid||!mx(X.uuid)))X.error=X.error||"UUID is not valid.";return X}function ox($){let Z=$;return Z.nss=($.uuid||"").toLowerCase(),Z}var WF={scheme:"http",domainHost:!0,parse:JF,serialize:GF},sx={scheme:"https",domainHost:WF.domainHost,parse:JF,serialize:GF},$Z={scheme:"ws",domainHost:!0,parse:px,serialize:ix},tx={scheme:"wss",domainHost:$Z.domainHost,parse:$Z.parse,serialize:$Z.serialize},ex={scheme:"urn",parse:nx,serialize:rx,skipNormalize:!0},$b={scheme:"urn:uuid",parse:ax,serialize:ox,skipNormalize:!0},ZZ={http:WF,https:sx,ws:$Z,wss:tx,urn:ex,"urn:uuid":$b};Object.setPrototypeOf(ZZ,null);function rQ($){return $&&(ZZ[$]||ZZ[$.toLowerCase()])||void 0}YF.exports={wsIsSecure:nQ,SCHEMES:ZZ,isValidSchemeName:cx,getSchemeHandler:rQ}});var BF=x((ti,XZ)=>{var{normalizeIPv6:Zb,removeDotSegments:Z5,recomposeAuthority:Xb,normalizePercentEncoding:Qb,normalizePathEncoding:Jb,escapePreservingEscapes:Gb,reescapeHostDelimiters:Wb,isIPv4:Yb,nonSimpleDomain:zb}=iQ(),{SCHEMES:qb,getSchemeHandler:UF}=zF();function Ub($,Z){if(typeof $==="string")$=Fb($,Z);else if(typeof $==="object")$=n4(J4($,Z),Z);return $}function Kb($,Z,X){let Q=X?Object.assign({scheme:"null"},X):{scheme:"null"},J=KF(n4($,Q),n4(Z,Q),Q,!0);return Q.skipEscape=!0,J4(J,Q)}function KF($,Z,X,Q){let J={};if(!Q)$=n4(J4($,X),X),Z=n4(J4(Z,X),X);if(X=X||{},!X.tolerant&&Z.scheme)J.scheme=Z.scheme,J.userinfo=Z.userinfo,J.host=Z.host,J.port=Z.port,J.path=Z5(Z.path||""),J.query=Z.query;else{if(Z.userinfo!==void 0||Z.host!==void 0||Z.port!==void 0)J.userinfo=Z.userinfo,J.host=Z.host,J.port=Z.port,J.path=Z5(Z.path||""),J.query=Z.query;else{if(!Z.path)if(J.path=$.path,Z.query!==void 0)J.query=Z.query;else J.query=$.query;else{if(Z.path[0]==="/")J.path=Z5(Z.path);else{if(($.userinfo!==void 0||$.host!==void 0||$.port!==void 0)&&!$.path)J.path="/"+Z.path;else if(!$.path)J.path=Z.path;else J.path=$.path.slice(0,$.path.lastIndexOf("/")+1)+Z.path;J.path=Z5(J.path)}J.query=Z.query}J.userinfo=$.userinfo,J.host=$.host,J.port=$.port}J.scheme=$.scheme}return J.fragment=Z.fragment,J}function Hb($,Z,X){let Q=qF($,X),J=qF(Z,X);return Q!==void 0&&J!==void 0&&Q.toLowerCase()===J.toLowerCase()}function J4($,Z){let X={host:$.host,scheme:$.scheme,userinfo:$.userinfo,port:$.port,path:$.path,query:$.query,nid:$.nid,nss:$.nss,uuid:$.uuid,fragment:$.fragment,reference:$.reference,resourceName:$.resourceName,secure:$.secure,error:""},Q=Object.assign({},Z),J=[],G=UF(Q.scheme||X.scheme);if(G&&G.serialize)G.serialize(X,Q);if(X.path!==void 0)if(!Q.skipEscape){if(X.path=Gb(X.path),X.scheme!==void 0)X.path=X.path.split("%3A").join(":")}else X.path=Qb(X.path);if(Q.reference!=="suffix"&&X.scheme)J.push(X.scheme,":");let W=Xb(X);if(W!==void 0){if(Q.reference!=="suffix")J.push("//");if(J.push(W),X.path&&X.path[0]!=="/")J.push("/")}if(X.path!==void 0){let Y=X.path;if(!Q.absolutePath&&(!G||!G.absolutePath))Y=Z5(Y);if(W===void 0&&Y[0]==="/"&&Y[1]==="/")Y="/%2F"+Y.slice(2);J.push(Y)}if(X.query!==void 0)J.push("?",X.query);if(X.fragment!==void 0)J.push("#",X.fragment);return J.join("")}var Vb=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Bb($,Z){if(Z[2]!==void 0&&$.path&&$.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof $.port==="number"&&($.port<0||$.port>65535))return"URI port is malformed.";return}function HF($,Z){let X=Object.assign({},Z),Q={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},J=!1,G=!1;if(X.reference==="suffix")if(X.scheme)$=X.scheme+":"+$;else $="//"+$;let W=$.match(Vb);if(W){if(Q.scheme=W[1],Q.userinfo=W[3],Q.host=W[4],Q.port=parseInt(W[5],10),Q.path=W[6]||"",Q.query=W[7],Q.fragment=W[8],isNaN(Q.port))Q.port=W[5];let Y=Bb(Q,W);if(Y!==void 0)Q.error=Q.error||Y,J=!0;if(Q.host)if(Yb(Q.host)===!1){let H=Zb(Q.host);Q.host=H.host.toLowerCase(),G=H.isIPV6}else G=!0;if(Q.scheme===void 0&&Q.userinfo===void 0&&Q.host===void 0&&Q.port===void 0&&Q.query===void 0&&!Q.path)Q.reference="same-document";else if(Q.scheme===void 0)Q.reference="relative";else if(Q.fragment===void 0)Q.reference="absolute";else Q.reference="uri";if(X.reference&&X.reference!=="suffix"&&X.reference!==Q.reference)Q.error=Q.error||"URI is not a "+X.reference+" reference.";let z=UF(X.scheme||Q.scheme);if(!X.unicodeSupport&&(!z||!z.unicodeSupport)){if(Q.host&&(X.domainHost||z&&z.domainHost)&&G===!1&&zb(Q.host))try{Q.host=URL.domainToASCII(Q.host.toLowerCase())}catch(q){Q.error=Q.error||"Host's domain name can not be converted to ASCII: "+q}}if(!z||z&&!z.skipNormalize){if($.indexOf("%")!==-1){if(Q.scheme!==void 0)Q.scheme=unescape(Q.scheme);if(Q.host!==void 0)Q.host=Wb(unescape(Q.host),G)}if(Q.path)Q.path=Jb(Q.path);if(Q.fragment)try{Q.fragment=encodeURI(decodeURIComponent(Q.fragment))}catch{Q.error=Q.error||"URI malformed"}}if(z&&z.parse)z.parse(Q,X)}else Q.error=Q.error||"URI can not be parsed.";return{parsed:Q,malformedAuthorityOrPort:J}}function n4($,Z){return HF($,Z).parsed}function Fb($,Z){return VF($,Z).normalized}function VF($,Z){let{parsed:X,malformedAuthorityOrPort:Q}=HF($,Z);return{normalized:Q?$:J4(X,Z),malformedAuthorityOrPort:Q}}function qF($,Z){if(typeof $==="string"){let{normalized:X,malformedAuthorityOrPort:Q}=VF($,Z);return Q?void 0:X}if(typeof $==="object")return J4($,Z)}var aQ={SCHEMES:qb,normalize:Ub,resolve:Kb,resolveComponent:KF,equal:Hb,serialize:J4,parse:n4};XZ.exports=aQ;XZ.exports.default=aQ;XZ.exports.fastUri=aQ});var MF=x((LF)=>{Object.defineProperty(LF,"__esModule",{value:!0});var FF=BF();FF.code='require("ajv/dist/runtime/uri").default';LF.default=FF});var tQ=x((J1)=>{Object.defineProperty(J1,"__esModule",{value:!0});J1.CodeGen=J1.Name=J1.nil=J1.stringify=J1.str=J1._=J1.KeywordCxt=void 0;var Mb=p4();Object.defineProperty(J1,"KeywordCxt",{enumerable:!0,get:function(){return Mb.KeywordCxt}});var r4=D0();Object.defineProperty(J1,"_",{enumerable:!0,get:function(){return r4._}});Object.defineProperty(J1,"str",{enumerable:!0,get:function(){return r4.str}});Object.defineProperty(J1,"stringify",{enumerable:!0,get:function(){return r4.stringify}});Object.defineProperty(J1,"nil",{enumerable:!0,get:function(){return r4.nil}});Object.defineProperty(J1,"Name",{enumerable:!0,get:function(){return r4.Name}});Object.defineProperty(J1,"CodeGen",{enumerable:!0,get:function(){return r4.CodeGen}});var Ab=t9(),wF=i4(),Ib=RQ(),X5=$5(),Nb=D0(),Q5=a9(),QZ=r9(),sQ=R0(),AF=sB(),Db=MF(),TF=($,Z)=>new RegExp($,Z);TF.code="new RegExp";var wb=["removeAdditional","useDefaults","coerceTypes"],Tb=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),jb={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."},Ob={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},IF=200;function Eb($){var Z,X,Q,J,G,W,Y,z,q,H,B,F,M,A,w,D,j,R,P,E,C,y,v,m,Z0;let r=$.strict,h=(Z=$.code)===null||Z===void 0?void 0:Z.optimize,t=h===!0||h===void 0?1:h||0,Y0=(Q=(X=$.code)===null||X===void 0?void 0:X.regExp)!==null&&Q!==void 0?Q:TF,G0=(J=$.uriResolver)!==null&&J!==void 0?J:Db.default;return{strictSchema:(W=(G=$.strictSchema)!==null&&G!==void 0?G:r)!==null&&W!==void 0?W:!0,strictNumbers:(z=(Y=$.strictNumbers)!==null&&Y!==void 0?Y:r)!==null&&z!==void 0?z:!0,strictTypes:(H=(q=$.strictTypes)!==null&&q!==void 0?q:r)!==null&&H!==void 0?H:"log",strictTuples:(F=(B=$.strictTuples)!==null&&B!==void 0?B:r)!==null&&F!==void 0?F:"log",strictRequired:(A=(M=$.strictRequired)!==null&&M!==void 0?M:r)!==null&&A!==void 0?A:!1,code:$.code?{...$.code,optimize:t,regExp:Y0}:{optimize:t,regExp:Y0},loopRequired:(w=$.loopRequired)!==null&&w!==void 0?w:IF,loopEnum:(D=$.loopEnum)!==null&&D!==void 0?D:IF,meta:(j=$.meta)!==null&&j!==void 0?j:!0,messages:(R=$.messages)!==null&&R!==void 0?R:!0,inlineRefs:(P=$.inlineRefs)!==null&&P!==void 0?P:!0,schemaId:(E=$.schemaId)!==null&&E!==void 0?E:"$id",addUsedSchema:(C=$.addUsedSchema)!==null&&C!==void 0?C:!0,validateSchema:(y=$.validateSchema)!==null&&y!==void 0?y:!0,validateFormats:(v=$.validateFormats)!==null&&v!==void 0?v:!0,unicodeRegExp:(m=$.unicodeRegExp)!==null&&m!==void 0?m:!0,int32range:(Z0=$.int32range)!==null&&Z0!==void 0?Z0:!0,uriResolver:G0}}class JZ{constructor($={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...Eb($)};let{es5:Z,lines:X}=this.opts.code;this.scope=new Nb.ValueScope({scope:{},prefixes:Tb,es5:Z,lines:X}),this.logger=xb($.logger);let Q=$.validateFormats;if($.validateFormats=!1,this.RULES=(0,Ib.getRules)(),NF.call(this,jb,$,"NOT SUPPORTED"),NF.call(this,Ob,$,"DEPRECATED","warn"),this._metaOpts=Sb.call(this),$.formats)Pb.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)Cb.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);Rb.call(this),$.validateFormats=Q}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:Z,schemaId:X}=this.opts,Q=AF;if(X==="id")Q={...AF},Q.id=Q.$id,delete Q.$id;if(Z&&$)this.addMetaSchema(Q,Q[X],!1)}defaultMeta(){let{meta:$,schemaId:Z}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[Z]||$:void 0}validate($,Z){let X;if(typeof $=="string"){if(X=this.getSchema($),!X)throw Error(`no schema with key or ref "${$}"`)}else X=this.compile($);let Q=X(Z);if(!("$async"in X))this.errors=X.errors;return Q}compile($,Z){let X=this._addSchema($,Z);return X.validate||this._compileSchemaEnv(X)}compileAsync($,Z){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:X}=this.opts;return Q.call(this,$,Z);async function Q(q,H){await J.call(this,q.$schema);let B=this._addSchema(q,H);return B.validate||G.call(this,B)}async function J(q){if(q&&!this.getSchema(q))await Q.call(this,{$ref:q},!0)}async function G(q){try{return this._compileSchemaEnv(q)}catch(H){if(!(H instanceof wF.default))throw H;return W.call(this,H),await Y.call(this,H.missingSchema),G.call(this,q)}}function W({missingSchema:q,missingRef:H}){if(this.refs[q])throw Error(`AnySchema ${q} is loaded but ${H} cannot be resolved`)}async function Y(q){let H=await z.call(this,q);if(!this.refs[q])await J.call(this,H.$schema);if(!this.refs[q])this.addSchema(H,q,Z)}async function z(q){let H=this._loading[q];if(H)return H;try{return await(this._loading[q]=X(q))}finally{delete this._loading[q]}}}addSchema($,Z,X,Q=this.opts.validateSchema){if(Array.isArray($)){for(let G of $)this.addSchema(G,void 0,X,Q);return this}let J;if(typeof $==="object"){let{schemaId:G}=this.opts;if(J=$[G],J!==void 0&&typeof J!="string")throw Error(`schema ${G} must be string`)}return Z=(0,Q5.normalizeId)(Z||J),this._checkUnique(Z),this.schemas[Z]=this._addSchema($,X,Z,Q,!0),this}addMetaSchema($,Z,X=this.opts.validateSchema){return this.addSchema($,Z,!0,X),this}validateSchema($,Z){if(typeof $=="boolean")return!0;let X;if(X=$.$schema,X!==void 0&&typeof X!="string")throw Error("$schema must be a string");if(X=X||this.opts.defaultMeta||this.defaultMeta(),!X)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let Q=this.validate(X,$);if(!Q&&Z){let J="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(J);else throw Error(J)}return Q}getSchema($){let Z;while(typeof(Z=DF.call(this,$))=="string")$=Z;if(Z===void 0){let{schemaId:X}=this.opts,Q=new X5.SchemaEnv({schema:{},schemaId:X});if(Z=X5.resolveSchema.call(this,Q,$),!Z)return;this.refs[$]=Z}return Z.validate||this._compileSchemaEnv(Z)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let Z=DF.call(this,$);if(typeof Z=="object")this._cache.delete(Z.schema);return delete this.schemas[$],delete this.refs[$],this}case"object":{let Z=$;this._cache.delete(Z);let X=$[this.opts.schemaId];if(X)X=(0,Q5.normalizeId)(X),delete this.schemas[X],delete this.refs[X];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let Z of $)this.addKeyword(Z);return this}addKeyword($,Z){let X;if(typeof $=="string"){if(X=$,typeof Z=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),Z.keyword=X}else if(typeof $=="object"&&Z===void 0){if(Z=$,X=Z.keyword,Array.isArray(X)&&!X.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(kb.call(this,X,Z),!Z)return(0,sQ.eachItem)(X,(J)=>oQ.call(this,J)),this;vb.call(this,Z);let Q={...Z,type:(0,QZ.getJSONTypes)(Z.type),schemaType:(0,QZ.getJSONTypes)(Z.schemaType)};return(0,sQ.eachItem)(X,Q.type.length===0?(J)=>oQ.call(this,J,Q):(J)=>Q.type.forEach((G)=>oQ.call(this,J,Q,G))),this}getKeyword($){let Z=this.RULES.all[$];return typeof Z=="object"?Z.definition:!!Z}removeKeyword($){let{RULES:Z}=this;delete Z.keywords[$],delete Z.all[$];for(let X of Z.rules){let Q=X.rules.findIndex((J)=>J.keyword===$);if(Q>=0)X.rules.splice(Q,1)}return this}addFormat($,Z){if(typeof Z=="string")Z=new RegExp(Z);return this.formats[$]=Z,this}errorsText($=this.errors,{separator:Z=", ",dataVar:X="data"}={}){if(!$||$.length===0)return"No errors";return $.map((Q)=>`${X}${Q.instancePath} ${Q.message}`).reduce((Q,J)=>Q+Z+J)}$dataMetaSchema($,Z){let X=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let Q of Z){let J=Q.split("/").slice(1),G=$;for(let W of J)G=G[W];for(let W in X){let Y=X[W];if(typeof Y!="object")continue;let{$data:z}=Y.definition,q=G[W];if(z&&q)G[W]=jF(q)}}return $}_removeAllSchemas($,Z){for(let X in $){let Q=$[X];if(!Z||Z.test(X)){if(typeof Q=="string")delete $[X];else if(Q&&!Q.meta)this._cache.delete(Q.schema),delete $[X]}}}_addSchema($,Z,X,Q=this.opts.validateSchema,J=this.opts.addUsedSchema){let G,{schemaId:W}=this.opts;if(typeof $=="object")G=$[W];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof $!="boolean")throw Error("schema must be object or boolean");let Y=this._cache.get($);if(Y!==void 0)return Y;X=(0,Q5.normalizeId)(G||X);let z=Q5.getSchemaRefs.call(this,$,X);if(Y=new X5.SchemaEnv({schema:$,schemaId:W,meta:Z,baseId:X,localRefs:z}),this._cache.set(Y.schema,Y),J&&!X.startsWith("#")){if(X)this._checkUnique(X);this.refs[X]=Y}if(Q)this.validateSchema($,!0);return Y}_checkUnique($){if(this.schemas[$]||this.refs[$])throw Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta)this._compileMetaSchema($);else X5.compileSchema.call(this,$);if(!$.validate)throw Error("ajv implementation error");return $.validate}_compileMetaSchema($){let Z=this.opts;this.opts=this._metaOpts;try{X5.compileSchema.call(this,$)}finally{this.opts=Z}}}JZ.ValidationError=Ab.default;JZ.MissingRefError=wF.default;J1.default=JZ;function NF($,Z,X,Q="error"){for(let J in $){let G=J;if(G in Z)this.logger[Q](`${X}: option ${J}. ${$[G]}`)}}function DF($){return $=(0,Q5.normalizeId)($),this.schemas[$]||this.refs[$]}function Rb(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let Z in $)this.addSchema($[Z],Z)}function Pb(){for(let $ in this.opts.formats){let Z=this.opts.formats[$];if(Z)this.addFormat($,Z)}}function Cb($){if(Array.isArray($)){this.addVocabulary($);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let Z in $){let X=$[Z];if(!X.keyword)X.keyword=Z;this.addKeyword(X)}}function Sb(){let $={...this.opts};for(let Z of wb)delete $[Z];return $}var _b={log(){},warn(){},error(){}};function xb($){if($===!1)return _b;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw Error("logger must implement log, warn and error methods")}var bb=/^[a-z_$][a-z0-9_$:-]*$/i;function kb($,Z){let{RULES:X}=this;if((0,sQ.eachItem)($,(Q)=>{if(X.keywords[Q])throw Error(`Keyword ${Q} is already defined`);if(!bb.test(Q))throw Error(`Keyword ${Q} has invalid name`)}),!Z)return;if(Z.$data&&!(("code"in Z)||("validate"in Z)))throw Error('$data keyword must have "code" or "validate" function')}function oQ($,Z,X){var Q;let J=Z===null||Z===void 0?void 0:Z.post;if(X&&J)throw Error('keyword with "post" flag cannot have "type"');let{RULES:G}=this,W=J?G.post:G.rules.find(({type:z})=>z===X);if(!W)W={type:X,rules:[]},G.rules.push(W);if(G.keywords[$]=!0,!Z)return;let Y={keyword:$,definition:{...Z,type:(0,QZ.getJSONTypes)(Z.type),schemaType:(0,QZ.getJSONTypes)(Z.schemaType)}};if(Z.before)yb.call(this,W,Y,Z.before);else W.rules.push(Y);G.all[$]=Y,(Q=Z.implements)===null||Q===void 0||Q.forEach((z)=>this.addKeyword(z))}function yb($,Z,X){let Q=$.rules.findIndex((J)=>J.keyword===X);if(Q>=0)$.rules.splice(Q,0,Z);else $.rules.push(Z),this.logger.warn(`rule ${X} is not defined`)}function vb($){let{metaSchema:Z}=$;if(Z===void 0)return;if($.$data&&this.opts.$data)Z=jF(Z);$.validateSchema=this.compile(Z,!0)}var gb={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function jF($){return{anyOf:[$,gb]}}});var EF=x((OF)=>{Object.defineProperty(OF,"__esModule",{value:!0});var ub={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};OF.default=ub});var YZ=x((SF)=>{Object.defineProperty(SF,"__esModule",{value:!0});SF.callRef=SF.getValidate=void 0;var db=i4(),RF=J6(),k$=D0(),a4=Q6(),PF=$5(),GZ=R0(),lb={keyword:"$ref",schemaType:"string",code($){let{gen:Z,schema:X,it:Q}=$,{baseId:J,schemaEnv:G,validateName:W,opts:Y,self:z}=Q,{root:q}=G;if((X==="#"||X==="#/")&&J===q.baseId)return B();let H=PF.resolveRef.call(z,q,J,X);if(H===void 0)throw new db.default(Q.opts.uriResolver,J,X);if(H instanceof PF.SchemaEnv)return F(H);return M(H);function B(){if(G===q)return WZ($,W,G,G.$async);let A=Z.scopeValue("root",{ref:q});return WZ($,k$._`${A}.validate`,q,q.$async)}function F(A){let w=CF($,A);WZ($,w,A,A.$async)}function M(A){let w=Z.scopeValue("schema",Y.code.source===!0?{ref:A,code:(0,k$.stringify)(A)}:{ref:A}),D=Z.name("valid"),j=$.subschema({schema:A,dataTypes:[],schemaPath:k$.nil,topSchemaRef:w,errSchemaPath:X},D);$.mergeEvaluated(j),$.ok(D)}}};function CF($,Z){let{gen:X}=$;return Z.validate?X.scopeValue("validate",{ref:Z.validate}):k$._`${X.scopeValue("wrapper",{ref:Z})}.validate`}SF.getValidate=CF;function WZ($,Z,X,Q){let{gen:J,it:G}=$,{allErrors:W,schemaEnv:Y,opts:z}=G,q=z.passContext?a4.default.this:k$.nil;if(Q)H();else B();function H(){if(!Y.$async)throw Error("async schema referenced by sync schema");let A=J.let("valid");J.try(()=>{if(J.code(k$._`await ${(0,RF.callValidateCode)($,Z,q)}`),M(Z),!W)J.assign(A,!0)},(w)=>{if(J.if(k$._`!(${w} instanceof ${G.ValidationError})`,()=>J.throw(w)),F(w),!W)J.assign(A,!1)}),$.ok(A)}function B(){$.result((0,RF.callValidateCode)($,Z,q),()=>M(Z),()=>F(Z))}function F(A){let w=k$._`${A}.errors`;J.assign(a4.default.vErrors,k$._`${a4.default.vErrors} === null ? ${w} : ${a4.default.vErrors}.concat(${w})`),J.assign(a4.default.errors,k$._`${a4.default.vErrors}.length`)}function M(A){var w;if(!G.opts.unevaluated)return;let D=(w=X===null||X===void 0?void 0:X.validate)===null||w===void 0?void 0:w.evaluated;if(G.props!==!0)if(D&&!D.dynamicProps){if(D.props!==void 0)G.props=GZ.mergeEvaluated.props(J,D.props,G.props)}else{let j=J.var("props",k$._`${A}.evaluated.props`);G.props=GZ.mergeEvaluated.props(J,j,G.props,k$.Name)}if(G.items!==!0)if(D&&!D.dynamicItems){if(D.items!==void 0)G.items=GZ.mergeEvaluated.items(J,D.items,G.items)}else{let j=J.var("items",k$._`${A}.evaluated.items`);G.items=GZ.mergeEvaluated.items(J,j,G.items,k$.Name)}}}SF.callRef=WZ;SF.default=lb});var eQ=x((xF)=>{Object.defineProperty(xF,"__esModule",{value:!0});var ib=EF(),nb=YZ(),rb=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",ib.default,nb.default];xF.default=rb});var kF=x((bF)=>{Object.defineProperty(bF,"__esModule",{value:!0});var zZ=D0(),x1=zZ.operators,qZ={maximum:{okStr:"<=",ok:x1.LTE,fail:x1.GT},minimum:{okStr:">=",ok:x1.GTE,fail:x1.LT},exclusiveMaximum:{okStr:"<",ok:x1.LT,fail:x1.GTE},exclusiveMinimum:{okStr:">",ok:x1.GT,fail:x1.LTE}},ob={message:({keyword:$,schemaCode:Z})=>zZ.str`must be ${qZ[$].okStr} ${Z}`,params:({keyword:$,schemaCode:Z})=>zZ._`{comparison: ${qZ[$].okStr}, limit: ${Z}}`},sb={keyword:Object.keys(qZ),type:"number",schemaType:"number",$data:!0,error:ob,code($){let{keyword:Z,data:X,schemaCode:Q}=$;$.fail$data(zZ._`${X} ${qZ[Z].fail} ${Q} || isNaN(${X})`)}};bF.default=sb});var vF=x((yF)=>{Object.defineProperty(yF,"__esModule",{value:!0});var J5=D0(),eb={message:({schemaCode:$})=>J5.str`must be multiple of ${$}`,params:({schemaCode:$})=>J5._`{multipleOf: ${$}}`},$k={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:eb,code($){let{gen:Z,data:X,schemaCode:Q,it:J}=$,G=J.opts.multipleOfPrecision,W=Z.let("res"),Y=G?J5._`Math.abs(Math.round(${W}) - ${W}) > 1e-${G}`:J5._`${W} !== parseInt(${W})`;$.fail$data(J5._`(${Q} === 0 || (${W} = ${X}/${Q}, ${Y}))`)}};yF.default=$k});var hF=x((fF)=>{Object.defineProperty(fF,"__esModule",{value:!0});function gF($){let Z=$.length,X=0,Q=0,J;while(Q<Z)if(X++,J=$.charCodeAt(Q++),J>=55296&&J<=56319&&Q<Z){if(J=$.charCodeAt(Q),(J&64512)===56320)Q++}return X}fF.default=gF;gF.code='require("ajv/dist/runtime/ucs2length").default'});var mF=x((uF)=>{Object.defineProperty(uF,"__esModule",{value:!0});var G4=D0(),Qk=R0(),Jk=hF(),Gk={message({keyword:$,schemaCode:Z}){let X=$==="maxLength"?"more":"fewer";return G4.str`must NOT have ${X} than ${Z} characters`},params:({schemaCode:$})=>G4._`{limit: ${$}}`},Wk={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Gk,code($){let{keyword:Z,data:X,schemaCode:Q,it:J}=$,G=Z==="maxLength"?G4.operators.GT:G4.operators.LT,W=J.opts.unicode===!1?G4._`${X}.length`:G4._`${(0,Qk.useFunc)($.gen,Jk.default)}(${X})`;$.fail$data(G4._`${W} ${G} ${Q}`)}};uF.default=Wk});var lF=x((dF)=>{Object.defineProperty(dF,"__esModule",{value:!0});var zk=J6(),qk=R0(),o4=D0(),Uk={message:({schemaCode:$})=>o4.str`must match pattern "${$}"`,params:({schemaCode:$})=>o4._`{pattern: ${$}}`},Kk={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Uk,code($){let{gen:Z,data:X,$data:Q,schema:J,schemaCode:G,it:W}=$,Y=W.opts.unicodeRegExp?"u":"";if(Q){let{regExp:z}=W.opts.code,q=z.code==="new RegExp"?o4._`new RegExp`:(0,qk.useFunc)(Z,z),H=Z.let("valid");Z.try(()=>Z.assign(H,o4._`${q}(${G}, ${Y}).test(${X})`),()=>Z.assign(H,!1)),$.fail$data(o4._`!${H}`)}else{let z=(0,zk.usePattern)($,J);$.fail$data(o4._`!${z}.test(${X})`)}}};dF.default=Kk});var pF=x((cF)=>{Object.defineProperty(cF,"__esModule",{value:!0});var G5=D0(),Vk={message({keyword:$,schemaCode:Z}){let X=$==="maxProperties"?"more":"fewer";return G5.str`must NOT have ${X} than ${Z} properties`},params:({schemaCode:$})=>G5._`{limit: ${$}}`},Bk={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Vk,code($){let{keyword:Z,data:X,schemaCode:Q}=$,J=Z==="maxProperties"?G5.operators.GT:G5.operators.LT;$.fail$data(G5._`Object.keys(${X}).length ${J} ${Q}`)}};cF.default=Bk});var nF=x((iF)=>{Object.defineProperty(iF,"__esModule",{value:!0});var W5=J6(),Y5=D0(),Lk=R0(),Mk={message:({params:{missingProperty:$}})=>Y5.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>Y5._`{missingProperty: ${$}}`},Ak={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Mk,code($){let{gen:Z,schema:X,schemaCode:Q,data:J,$data:G,it:W}=$,{opts:Y}=W;if(!G&&X.length===0)return;let z=X.length>=Y.loopRequired;if(W.allErrors)q();else H();if(Y.strictRequired){let M=$.parentSchema.properties,{definedProperties:A}=$.it;for(let w of X)if((M===null||M===void 0?void 0:M[w])===void 0&&!A.has(w)){let D=W.schemaEnv.baseId+W.errSchemaPath,j=`required property "${w}" is not defined at "${D}" (strictRequired)`;(0,Lk.checkStrictMode)(W,j,W.opts.strictRequired)}}function q(){if(z||G)$.block$data(Y5.nil,B);else for(let M of X)(0,W5.checkReportMissingProp)($,M)}function H(){let M=Z.let("missing");if(z||G){let A=Z.let("valid",!0);$.block$data(A,()=>F(M,A)),$.ok(A)}else Z.if((0,W5.checkMissingProp)($,X,M)),(0,W5.reportMissingProp)($,M),Z.else()}function B(){Z.forOf("prop",Q,(M)=>{$.setParams({missingProperty:M}),Z.if((0,W5.noPropertyInData)(Z,J,M,Y.ownProperties),()=>$.error())})}function F(M,A){$.setParams({missingProperty:M}),Z.forOf(M,Q,()=>{Z.assign(A,(0,W5.propertyInData)(Z,J,M,Y.ownProperties)),Z.if((0,Y5.not)(A),()=>{$.error(),Z.break()})},Y5.nil)}}};iF.default=Ak});var aF=x((rF)=>{Object.defineProperty(rF,"__esModule",{value:!0});var z5=D0(),Nk={message({keyword:$,schemaCode:Z}){let X=$==="maxItems"?"more":"fewer";return z5.str`must NOT have ${X} than ${Z} items`},params:({schemaCode:$})=>z5._`{limit: ${$}}`},Dk={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Nk,code($){let{keyword:Z,data:X,schemaCode:Q}=$,J=Z==="maxItems"?z5.operators.GT:z5.operators.LT;$.fail$data(z5._`${X}.length ${J} ${Q}`)}};rF.default=Dk});var UZ=x((sF)=>{Object.defineProperty(sF,"__esModule",{value:!0});var oF=yQ();oF.code='require("ajv/dist/runtime/equal").default';sF.default=oF});var eF=x((tF)=>{Object.defineProperty(tF,"__esModule",{value:!0});var $J=r9(),z$=D0(),jk=R0(),Ok=UZ(),Ek={message:({params:{i:$,j:Z}})=>z$.str`must NOT have duplicate items (items ## ${Z} and ${$} are identical)`,params:({params:{i:$,j:Z}})=>z$._`{i: ${$}, j: ${Z}}`},Rk={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Ek,code($){let{gen:Z,data:X,$data:Q,schema:J,parentSchema:G,schemaCode:W,it:Y}=$;if(!Q&&!J)return;let z=Z.let("valid"),q=G.items?(0,$J.getSchemaTypes)(G.items):[];$.block$data(z,H,z$._`${W} === false`),$.ok(z);function H(){let A=Z.let("i",z$._`${X}.length`),w=Z.let("j");$.setParams({i:A,j:w}),Z.assign(z,!0),Z.if(z$._`${A} > 1`,()=>(B()?F:M)(A,w))}function B(){return q.length>0&&!q.some((A)=>A==="object"||A==="array")}function F(A,w){let D=Z.name("item"),j=(0,$J.checkDataTypes)(q,D,Y.opts.strictNumbers,$J.DataType.Wrong),R=Z.const("indices",z$._`{}`);Z.for(z$._`;${A}--;`,()=>{if(Z.let(D,z$._`${X}[${A}]`),Z.if(j,z$._`continue`),q.length>1)Z.if(z$._`typeof ${D} == "string"`,z$._`${D} += "_"`);Z.if(z$._`typeof ${R}[${D}] == "number"`,()=>{Z.assign(w,z$._`${R}[${D}]`),$.error(),Z.assign(z,!1).break()}).code(z$._`${R}[${D}] = ${A}`)})}function M(A,w){let D=(0,jk.useFunc)(Z,Ok.default),j=Z.name("outer");Z.label(j).for(z$._`;${A}--;`,()=>Z.for(z$._`${w} = ${A}; ${w}--;`,()=>Z.if(z$._`${D}(${X}[${A}], ${X}[${w}])`,()=>{$.error(),Z.assign(z,!1).break(j)})))}}};tF.default=Rk});var ZL=x(($L)=>{Object.defineProperty($L,"__esModule",{value:!0});var ZJ=D0(),Ck=R0(),Sk=UZ(),_k={message:"must be equal to constant",params:({schemaCode:$})=>ZJ._`{allowedValue: ${$}}`},xk={keyword:"const",$data:!0,error:_k,code($){let{gen:Z,data:X,$data:Q,schemaCode:J,schema:G}=$;if(Q||G&&typeof G=="object")$.fail$data(ZJ._`!${(0,Ck.useFunc)(Z,Sk.default)}(${X}, ${J})`);else $.fail(ZJ._`${G} !== ${X}`)}};$L.default=xk});var QL=x((XL)=>{Object.defineProperty(XL,"__esModule",{value:!0});var q5=D0(),kk=R0(),yk=UZ(),vk={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>q5._`{allowedValues: ${$}}`},gk={keyword:"enum",schemaType:"array",$data:!0,error:vk,code($){let{gen:Z,data:X,$data:Q,schema:J,schemaCode:G,it:W}=$;if(!Q&&J.length===0)throw Error("enum must have non-empty array");let Y=J.length>=W.opts.loopEnum,z,q=()=>z!==null&&z!==void 0?z:z=(0,kk.useFunc)(Z,yk.default),H;if(Y||Q)H=Z.let("valid"),$.block$data(H,B);else{if(!Array.isArray(J))throw Error("ajv implementation error");let M=Z.const("vSchema",G);H=(0,q5.or)(...J.map((A,w)=>F(M,w)))}$.pass(H);function B(){Z.assign(H,!1),Z.forOf("v",G,(M)=>Z.if(q5._`${q()}(${X}, ${M})`,()=>Z.assign(H,!0).break()))}function F(M,A){let w=J[A];return typeof w==="object"&&w!==null?q5._`${q()}(${X}, ${M}[${A}])`:q5._`${X} === ${w}`}}};XL.default=gk});var XJ=x((JL)=>{Object.defineProperty(JL,"__esModule",{value:!0});var hk=kF(),uk=vF(),mk=mF(),dk=lF(),lk=pF(),ck=nF(),pk=aF(),ik=eF(),nk=ZL(),rk=QL(),ak=[hk.default,uk.default,mk.default,dk.default,lk.default,ck.default,pk.default,ik.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},nk.default,rk.default];JL.default=ak});var JJ=x((WL)=>{Object.defineProperty(WL,"__esModule",{value:!0});WL.validateAdditionalItems=void 0;var W4=D0(),QJ=R0(),sk={message:({params:{len:$}})=>W4.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>W4._`{limit: ${$}}`},tk={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:sk,code($){let{parentSchema:Z,it:X}=$,{items:Q}=Z;if(!Array.isArray(Q)){(0,QJ.checkStrictMode)(X,'"additionalItems" is ignored when "items" is not an array of schemas');return}GL($,Q)}};function GL($,Z){let{gen:X,schema:Q,data:J,keyword:G,it:W}=$;W.items=!0;let Y=X.const("len",W4._`${J}.length`);if(Q===!1)$.setParams({len:Z.length}),$.pass(W4._`${Y} <= ${Z.length}`);else if(typeof Q=="object"&&!(0,QJ.alwaysValidSchema)(W,Q)){let q=X.var("valid",W4._`${Y} <= ${Z.length}`);X.if((0,W4.not)(q),()=>z(q)),$.ok(q)}function z(q){X.forRange("i",Z.length,Y,(H)=>{if($.subschema({keyword:G,dataProp:H,dataPropType:QJ.Type.Num},q),!W.allErrors)X.if((0,W4.not)(q),()=>X.break())})}}WL.validateAdditionalItems=GL;WL.default=tk});var GJ=x((UL)=>{Object.defineProperty(UL,"__esModule",{value:!0});UL.validateTuple=void 0;var zL=D0(),KZ=R0(),$y=J6(),Zy={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:Z,it:X}=$;if(Array.isArray(Z))return qL($,"additionalItems",Z);if(X.items=!0,(0,KZ.alwaysValidSchema)(X,Z))return;$.ok((0,$y.validateArray)($))}};function qL($,Z,X=$.schema){let{gen:Q,parentSchema:J,data:G,keyword:W,it:Y}=$;if(H(J),Y.opts.unevaluated&&X.length&&Y.items!==!0)Y.items=KZ.mergeEvaluated.items(Q,X.length,Y.items);let z=Q.name("valid"),q=Q.const("len",zL._`${G}.length`);X.forEach((B,F)=>{if((0,KZ.alwaysValidSchema)(Y,B))return;Q.if(zL._`${q} > ${F}`,()=>$.subschema({keyword:W,schemaProp:F,dataProp:F},z)),$.ok(z)});function H(B){let{opts:F,errSchemaPath:M}=Y,A=X.length,w=A===B.minItems&&(A===B.maxItems||B[Z]===!1);if(F.strictTuples&&!w){let D=`"${W}" is ${A}-tuple, but minItems or maxItems/${Z} are not specified or different at path "${M}"`;(0,KZ.checkStrictMode)(Y,D,F.strictTuples)}}}UL.validateTuple=qL;UL.default=Zy});var VL=x((HL)=>{Object.defineProperty(HL,"__esModule",{value:!0});var Qy=GJ(),Jy={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>(0,Qy.validateTuple)($,"items")};HL.default=Jy});var LL=x((FL)=>{Object.defineProperty(FL,"__esModule",{value:!0});var BL=D0(),Wy=R0(),Yy=J6(),zy=JJ(),qy={message:({params:{len:$}})=>BL.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>BL._`{limit: ${$}}`},Uy={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:qy,code($){let{schema:Z,parentSchema:X,it:Q}=$,{prefixItems:J}=X;if(Q.items=!0,(0,Wy.alwaysValidSchema)(Q,Z))return;if(J)(0,zy.validateAdditionalItems)($,J);else $.ok((0,Yy.validateArray)($))}};FL.default=Uy});var AL=x((ML)=>{Object.defineProperty(ML,"__esModule",{value:!0});var G6=D0(),HZ=R0(),Hy={message:({params:{min:$,max:Z}})=>Z===void 0?G6.str`must contain at least ${$} valid item(s)`:G6.str`must contain at least ${$} and no more than ${Z} valid item(s)`,params:({params:{min:$,max:Z}})=>Z===void 0?G6._`{minContains: ${$}}`:G6._`{minContains: ${$}, maxContains: ${Z}}`},Vy={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Hy,code($){let{gen:Z,schema:X,parentSchema:Q,data:J,it:G}=$,W,Y,{minContains:z,maxContains:q}=Q;if(G.opts.next)W=z===void 0?1:z,Y=q;else W=1;let H=Z.const("len",G6._`${J}.length`);if($.setParams({min:W,max:Y}),Y===void 0&&W===0){(0,HZ.checkStrictMode)(G,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(Y!==void 0&&W>Y){(0,HZ.checkStrictMode)(G,'"minContains" > "maxContains" is always invalid'),$.fail();return}if((0,HZ.alwaysValidSchema)(G,X)){let w=G6._`${H} >= ${W}`;if(Y!==void 0)w=G6._`${w} && ${H} <= ${Y}`;$.pass(w);return}G.items=!0;let B=Z.name("valid");if(Y===void 0&&W===1)M(B,()=>Z.if(B,()=>Z.break()));else if(W===0){if(Z.let(B,!0),Y!==void 0)Z.if(G6._`${J}.length > 0`,F)}else Z.let(B,!1),F();$.result(B,()=>$.reset());function F(){let w=Z.name("_valid"),D=Z.let("count",0);M(w,()=>Z.if(w,()=>A(D)))}function M(w,D){Z.forRange("i",0,H,(j)=>{$.subschema({keyword:"contains",dataProp:j,dataPropType:HZ.Type.Num,compositeRule:!0},w),D()})}function A(w){if(Z.code(G6._`${w}++`),Y===void 0)Z.if(G6._`${w} >= ${W}`,()=>Z.assign(B,!0).break());else if(Z.if(G6._`${w} > ${Y}`,()=>Z.assign(B,!1).break()),W===1)Z.assign(B,!0);else Z.if(G6._`${w} >= ${W}`,()=>Z.assign(B,!0))}}};ML.default=Vy});var VZ=x((DL)=>{Object.defineProperty(DL,"__esModule",{value:!0});DL.validateSchemaDeps=DL.validatePropertyDeps=DL.error=void 0;var WJ=D0(),Fy=R0(),U5=J6();DL.error={message:({params:{property:$,depsCount:Z,deps:X}})=>{let Q=Z===1?"property":"properties";return WJ.str`must have ${Q} ${X} when property ${$} is present`},params:({params:{property:$,depsCount:Z,deps:X,missingProperty:Q}})=>WJ._`{property: ${$},
|
|
392
|
+
|| ${W} === "boolean" || ${J} === null`).assign(Y,E0._`[${J}]`)}}}function sS({gen:$,parentData:Z,parentDataProperty:X},Q){$.if(E0._`${Z} !== undefined`,()=>$.assign(E0._`${Z}[${X}]`,Q))}function uQ($,Z,X,Q=r4.Correct){let J=Q===r4.Correct?E0.operators.EQ:E0.operators.NEQ,G;switch($){case"null":return E0._`${Z} ${J} null`;case"array":G=E0._`Array.isArray(${Z})`;break;case"object":G=E0._`${Z} && typeof ${Z} == "object" && !Array.isArray(${Z})`;break;case"integer":G=W(E0._`!(${Z} % 1) && !isNaN(${Z})`);break;case"number":G=W();break;default:return E0._`typeof ${Z} ${J} ${$}`}return Q===r4.Correct?G:(0,E0.not)(G);function W(Y=E0.nil){return(0,E0.and)(E0._`typeof ${Z} == "number"`,Y,X?E0._`isFinite(${Z})`:E0.nil)}}KB.checkDataType=uQ;function mQ($,Z,X,Q){if($.length===1)return uQ($[0],Z,X,Q);let J,G=(0,YB.toHash)($);if(G.array&&G.object){let W=E0._`typeof ${Z} != "object"`;J=G.null?W:E0._`!${Z} || ${W}`,delete G.null,delete G.array,delete G.object}else J=E0.nil;if(G.number)delete G.integer;for(let W in G)J=(0,E0.and)(J,uQ(W,Z,X,Q));return J}KB.checkDataTypes=mQ;var tS={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:Z})=>typeof $=="string"?E0._`{type: ${$}}`:E0._`{type: ${Z}}`};function dQ($){let Z=eS($);(0,iS.reportError)(Z,tS)}KB.reportTypeError=dQ;function eS($){let{gen:Z,data:X,schema:Q}=$,J=(0,YB.schemaRefOrVal)($,Q,"type");return{gen:Z,keyword:"type",data:X,schema:Q.type,schemaCode:J,schemaValue:J,parentSchema:Q,params:{},it:$}}});var FB=b((VB)=>{Object.defineProperty(VB,"__esModule",{value:!0});VB.assignDefaults=void 0;var a4=N0(),W_=P0();function Y_($,Z){let{properties:X,items:Q}=$.schema;if(Z==="object"&&X)for(let J in X)HB($,J,X[J].default);else if(Z==="array"&&Array.isArray(Q))Q.forEach((J,G)=>HB($,G,J.default))}VB.assignDefaults=Y_;function HB($,Z,X){let{gen:Q,compositeRule:J,data:G,opts:W}=$;if(X===void 0)return;let Y=a4._`${G}${(0,a4.getProperty)(Z)}`;if(J){(0,W_.checkStrictMode)($,`default is ignored for: ${Y}`);return}let z=a4._`${Y} === undefined`;if(W.useDefaults==="empty")z=a4._`${z} || ${Y} === null || ${Y} === ""`;Q.if(z,a4._`${Y} = ${(0,a4.stringify)(X)}`)}});var G1=b((AB)=>{Object.defineProperty(AB,"__esModule",{value:!0});AB.validateUnion=AB.validateArray=AB.usePattern=AB.callValidateCode=AB.schemaProperties=AB.allSchemaProperties=AB.noPropertyInData=AB.propertyInData=AB.isOwnProperty=AB.hasPropFunc=AB.reportMissingProp=AB.checkMissingProp=AB.checkReportMissingProp=void 0;var h0=N0(),lQ=P0(),k6=J1(),z_=P0();function q_($,Z){let{gen:X,data:Q,it:J}=$;X.if(pQ(X,Q,Z,J.opts.ownProperties),()=>{$.setParams({missingProperty:h0._`${Z}`},!0),$.error()})}AB.checkReportMissingProp=q_;function K_({gen:$,data:Z,it:{opts:X}},Q,J){return(0,h0.or)(...Q.map((G)=>(0,h0.and)(pQ($,Z,G,X.ownProperties),h0._`${J} = ${G}`)))}AB.checkMissingProp=K_;function U_($,Z){$.setParams({missingProperty:Z},!0),$.error()}AB.reportMissingProp=U_;function LB($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:h0._`Object.prototype.hasOwnProperty`})}AB.hasPropFunc=LB;function cQ($,Z,X){return h0._`${LB($)}.call(${Z}, ${X})`}AB.isOwnProperty=cQ;function H_($,Z,X,Q){let J=h0._`${Z}${(0,h0.getProperty)(X)} !== undefined`;return Q?h0._`${J} && ${cQ($,Z,X)}`:J}AB.propertyInData=H_;function pQ($,Z,X,Q){let J=h0._`${Z}${(0,h0.getProperty)(X)} === undefined`;return Q?(0,h0.or)(J,(0,h0.not)(cQ($,Z,X))):J}AB.noPropertyInData=pQ;function MB($){return $?Object.keys($).filter((Z)=>Z!=="__proto__"):[]}AB.allSchemaProperties=MB;function V_($,Z){return MB(Z).filter((X)=>!(0,lQ.alwaysValidSchema)($,Z[X]))}AB.schemaProperties=V_;function B_({schemaCode:$,data:Z,it:{gen:X,topSchemaRef:Q,schemaPath:J,errorPath:G},it:W},Y,z,q){let H=q?h0._`${$}, ${Z}, ${Q}${J}`:Z,B=[[k6.default.instancePath,(0,h0.strConcat)(k6.default.instancePath,G)],[k6.default.parentData,W.parentData],[k6.default.parentDataProperty,W.parentDataProperty],[k6.default.rootData,k6.default.rootData]];if(W.opts.dynamicRef)B.push([k6.default.dynamicAnchors,k6.default.dynamicAnchors]);let F=h0._`${H}, ${X.object(...B)}`;return z!==h0.nil?h0._`${Y}.call(${z}, ${F})`:h0._`${Y}(${F})`}AB.callValidateCode=B_;var F_=h0._`new RegExp`;function L_({gen:$,it:{opts:Z}},X){let Q=Z.unicodeRegExp?"u":"",{regExp:J}=Z.code,G=J(X,Q);return $.scopeValue("pattern",{key:G.toString(),ref:G,code:h0._`${J.code==="new RegExp"?F_:(0,z_.useFunc)($,J)}(${X}, ${Q})`})}AB.usePattern=L_;function M_($){let{gen:Z,data:X,keyword:Q,it:J}=$,G=Z.name("valid");if(J.allErrors){let Y=Z.let("valid",!0);return W(()=>Z.assign(Y,!1)),Y}return Z.var(G,!0),W(()=>Z.break()),G;function W(Y){let z=Z.const("len",h0._`${X}.length`);Z.forRange("i",0,z,(q)=>{$.subschema({keyword:Q,dataProp:q,dataPropType:lQ.Type.Num},G),Z.if((0,h0.not)(G),Y)})}}AB.validateArray=M_;function A_($){let{gen:Z,schema:X,keyword:Q,it:J}=$;if(!Array.isArray(X))throw Error("ajv implementation error");if(X.some((z)=>(0,lQ.alwaysValidSchema)(J,z))&&!J.opts.unevaluated)return;let W=Z.let("valid",!1),Y=Z.name("_valid");Z.block(()=>X.forEach((z,q)=>{let H=$.subschema({keyword:Q,schemaProp:q,compositeRule:!0},Y);if(Z.assign(W,h0._`${W} || ${Y}`),!$.mergeValidEvaluated(H,Y))Z.if((0,h0.not)(W))})),$.result(W,()=>$.reset(),()=>$.error(!0))}AB.validateUnion=A_});var jB=b((wB)=>{Object.defineProperty(wB,"__esModule",{value:!0});wB.validateKeywordUsage=wB.validSchemaType=wB.funcKeywordCode=wB.macroKeywordCode=void 0;var j$=N0(),z4=J1(),__=G1(),b_=Z8();function x_($,Z){let{gen:X,keyword:Q,schema:J,parentSchema:G,it:W}=$,Y=Z.macro.call(W.self,J,G,W),z=DB(X,Q,Y);if(W.opts.validateSchema!==!1)W.self.validateSchema(Y,!0);let q=X.name("valid");$.subschema({schema:Y,schemaPath:j$.nil,errSchemaPath:`${W.errSchemaPath}/${Q}`,topSchemaRef:z,compositeRule:!0},q),$.pass(q,()=>$.error(!0))}wB.macroKeywordCode=x_;function k_($,Z){var X;let{gen:Q,keyword:J,schema:G,parentSchema:W,$data:Y,it:z}=$;v_(z,Z);let q=!Y&&Z.compile?Z.compile.call(z.self,G,W,z):Z.validate,H=DB(Q,J,q),B=Q.let("valid");$.block$data(B,F),$.ok((X=Z.valid)!==null&&X!==void 0?X:B);function F(){if(Z.errors===!1){if(N(),Z.modifying)NB($);I(()=>$.error())}else{let T=Z.async?L():w();if(Z.modifying)NB($);I(()=>y_($,T))}}function L(){let T=Q.let("ruleErrs",null);return Q.try(()=>N(j$._`await `),(E)=>Q.assign(B,!1).if(j$._`${E} instanceof ${z.ValidationError}`,()=>Q.assign(T,j$._`${E}.errors`),()=>Q.throw(E))),T}function w(){let T=j$._`${H}.errors`;return Q.assign(T,null),N(j$.nil),T}function N(T=Z.async?j$._`await `:j$.nil){let E=z.opts.passContext?z4.default.this:z4.default.self,P=!(("compile"in Z)&&!Y||Z.schema===!1);Q.assign(B,j$._`${T}${(0,__.callValidateCode)($,H,E,P)}`,Z.modifying)}function I(T){var E;Q.if((0,j$.not)((E=Z.valid)!==null&&E!==void 0?E:B),T)}}wB.funcKeywordCode=k_;function NB($){let{gen:Z,data:X,it:Q}=$;Z.if(Q.parentData,()=>Z.assign(X,j$._`${Q.parentData}[${Q.parentDataProperty}]`))}function y_($,Z){let{gen:X}=$;X.if(j$._`Array.isArray(${Z})`,()=>{X.assign(z4.default.vErrors,j$._`${z4.default.vErrors} === null ? ${Z} : ${z4.default.vErrors}.concat(${Z})`).assign(z4.default.errors,j$._`${z4.default.vErrors}.length`),(0,b_.extendErrors)($)},()=>$.error())}function v_({schemaEnv:$},Z){if(Z.async&&!$.$async)throw Error("async keyword in sync schema")}function DB($,Z,X){if(X===void 0)throw Error(`keyword "${Z}" failed to compile`);return $.scopeValue("keyword",typeof X=="function"?{ref:X}:{ref:X,code:(0,j$.stringify)(X)})}function g_($,Z,X=!1){return!Z.length||Z.some((Q)=>Q==="array"?Array.isArray($):Q==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==Q||X&&typeof $>"u")}wB.validSchemaType=g_;function f_({schema:$,opts:Z,self:X,errSchemaPath:Q},J,G){if(Array.isArray(J.keyword)?!J.keyword.includes(G):J.keyword!==G)throw Error("ajv implementation error");let W=J.dependencies;if(W===null||W===void 0?void 0:W.some((Y)=>!Object.prototype.hasOwnProperty.call($,Y)))throw Error(`parent schema must have dependencies of ${G}: ${W.join(",")}`);if(J.validateSchema){if(!J.validateSchema($[G])){let z=`keyword "${G}" value is invalid at path "${Q}": `+X.errorsText(J.validateSchema.errors);if(Z.validateSchema==="log")X.logger.error(z);else throw Error(z)}}}wB.validateKeywordUsage=f_});var PB=b((EB)=>{Object.defineProperty(EB,"__esModule",{value:!0});EB.extendSubschemaMode=EB.extendSubschemaData=EB.getSubschema=void 0;var g1=N0(),OB=P0();function d_($,{keyword:Z,schemaProp:X,schema:Q,schemaPath:J,errSchemaPath:G,topSchemaRef:W}){if(Z!==void 0&&Q!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(Z!==void 0){let Y=$.schema[Z];return X===void 0?{schema:Y,schemaPath:g1._`${$.schemaPath}${(0,g1.getProperty)(Z)}`,errSchemaPath:`${$.errSchemaPath}/${Z}`}:{schema:Y[X],schemaPath:g1._`${$.schemaPath}${(0,g1.getProperty)(Z)}${(0,g1.getProperty)(X)}`,errSchemaPath:`${$.errSchemaPath}/${Z}/${(0,OB.escapeFragment)(X)}`}}if(Q!==void 0){if(J===void 0||G===void 0||W===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:Q,schemaPath:J,topSchemaRef:W,errSchemaPath:G}}throw Error('either "keyword" or "schema" must be passed')}EB.getSubschema=d_;function l_($,Z,{dataProp:X,dataPropType:Q,data:J,dataTypes:G,propertyName:W}){if(J!==void 0&&X!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:Y}=Z;if(X!==void 0){let{errorPath:q,dataPathArr:H,opts:B}=Z,F=Y.let("data",g1._`${Z.data}${(0,g1.getProperty)(X)}`,!0);z(F),$.errorPath=g1.str`${q}${(0,OB.getErrorPath)(X,Q,B.jsPropertySyntax)}`,$.parentDataProperty=g1._`${X}`,$.dataPathArr=[...H,$.parentDataProperty]}if(J!==void 0){let q=J instanceof g1.Name?J:Y.let("data",J,!0);if(z(q),W!==void 0)$.propertyName=W}if(G)$.dataTypes=G;function z(q){$.data=q,$.dataLevel=Z.dataLevel+1,$.dataTypes=[],Z.definedProperties=new Set,$.parentData=Z.data,$.dataNames=[...Z.dataNames,q]}}EB.extendSubschemaData=l_;function c_($,{jtdDiscriminator:Z,jtdMetadata:X,compositeRule:Q,createErrors:J,allErrors:G}){if(Q!==void 0)$.compositeRule=Q;if(J!==void 0)$.createErrors=J;if(G!==void 0)$.allErrors=G;$.jtdDiscriminator=Z,$.jtdMetadata=X}EB.extendSubschemaMode=c_});var iQ=b((Un,CB)=>{CB.exports=function $(Z,X){if(Z===X)return!0;if(Z&&X&&typeof Z=="object"&&typeof X=="object"){if(Z.constructor!==X.constructor)return!1;var Q,J,G;if(Array.isArray(Z)){if(Q=Z.length,Q!=X.length)return!1;for(J=Q;J--!==0;)if(!$(Z[J],X[J]))return!1;return!0}if(Z.constructor===RegExp)return Z.source===X.source&&Z.flags===X.flags;if(Z.valueOf!==Object.prototype.valueOf)return Z.valueOf()===X.valueOf();if(Z.toString!==Object.prototype.toString)return Z.toString()===X.toString();if(G=Object.keys(Z),Q=G.length,Q!==Object.keys(X).length)return!1;for(J=Q;J--!==0;)if(!Object.prototype.hasOwnProperty.call(X,G[J]))return!1;for(J=Q;J--!==0;){var W=G[J];if(!$(Z[W],X[W]))return!1}return!0}return Z!==Z&&X!==X}});var _B=b((Hn,SB)=>{var y6=SB.exports=function($,Z,X){if(typeof Z=="function")X=Z,Z={};X=Z.cb||X;var Q=typeof X=="function"?X:X.pre||function(){},J=X.post||function(){};YZ(Z,Q,J,$,"",$)};y6.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};y6.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};y6.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};y6.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 YZ($,Z,X,Q,J,G,W,Y,z,q){if(Q&&typeof Q=="object"&&!Array.isArray(Q)){Z(Q,J,G,W,Y,z,q);for(var H in Q){var B=Q[H];if(Array.isArray(B)){if(H in y6.arrayKeywords)for(var F=0;F<B.length;F++)YZ($,Z,X,B[F],J+"/"+H+"/"+F,G,J,H,Q,F)}else if(H in y6.propsKeywords){if(B&&typeof B=="object")for(var L in B)YZ($,Z,X,B[L],J+"/"+H+"/"+n_(L),G,J,H,Q,L)}else if(H in y6.keywords||$.allKeys&&!(H in y6.skipKeywords))YZ($,Z,X,B,J+"/"+H,G,J,H,Q)}X(Q,J,G,W,Y,z,q)}}function n_($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var Q8=b((yB)=>{Object.defineProperty(yB,"__esModule",{value:!0});yB.getSchemaRefs=yB.resolveUrl=yB.normalizeId=yB._getFullPath=yB.getFullPath=yB.inlineRef=void 0;var r_=P0(),a_=iQ(),o_=_B(),s_=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function t_($,Z=!0){if(typeof $=="boolean")return!0;if(Z===!0)return!nQ($);if(!Z)return!1;return bB($)<=Z}yB.inlineRef=t_;var e_=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function nQ($){for(let Z in $){if(e_.has(Z))return!0;let X=$[Z];if(Array.isArray(X)&&X.some(nQ))return!0;if(typeof X=="object"&&nQ(X))return!0}return!1}function bB($){let Z=0;for(let X in $){if(X==="$ref")return 1/0;if(Z++,s_.has(X))continue;if(typeof $[X]=="object")(0,r_.eachItem)($[X],(Q)=>Z+=bB(Q));if(Z===1/0)return 1/0}return Z}function xB($,Z="",X){if(X!==!1)Z=o4(Z);let Q=$.parse(Z);return kB($,Q)}yB.getFullPath=xB;function kB($,Z){return $.serialize(Z).split("#")[0]+"#"}yB._getFullPath=kB;var $b=/#\/?$/;function o4($){return $?$.replace($b,""):""}yB.normalizeId=o4;function Zb($,Z,X){return X=o4(X),$.resolve(Z,X)}yB.resolveUrl=Zb;var Xb=/^[a-z_][-a-z0-9._]*$/i;function Qb($,Z){if(typeof $=="boolean")return{};let{schemaId:X,uriResolver:Q}=this.opts,J=o4($[X]||Z),G={"":J},W=xB(Q,J,!1),Y={},z=new Set;return o_($,{allKeys:!0},(B,F,L,w)=>{if(w===void 0)return;let N=W+F,I=G[w];if(typeof B[X]=="string")I=T.call(this,B[X]);E.call(this,B.$anchor),E.call(this,B.$dynamicAnchor),G[F]=I;function T(P){let R=this.opts.uriResolver.resolve;if(P=o4(I?R(I,P):P),z.has(P))throw H(P);z.add(P);let C=this.refs[P];if(typeof C=="string")C=this.refs[C];if(typeof C=="object")q(B,C.schema,P);else if(P!==o4(N))if(P[0]==="#")q(B,Y[P],P),Y[P]=B;else this.refs[P]=N;return P}function E(P){if(typeof P=="string"){if(!Xb.test(P))throw Error(`invalid anchor "${P}"`);T.call(this,`#${P}`)}}}),Y;function q(B,F,L){if(F!==void 0&&!a_(B,F))throw H(L)}function H(B){return Error(`reference "${B}" resolves to more than one schema`)}}yB.getSchemaRefs=Qb});var s4=b((sB)=>{Object.defineProperty(sB,"__esModule",{value:!0});sB.getData=sB.KeywordCxt=sB.validateFunctionCode=void 0;var mB=$B(),gB=X8(),aQ=hQ(),zZ=X8(),qb=FB(),G8=jB(),rQ=PB(),B0=N0(),I0=J1(),Kb=Q8(),G6=P0(),J8=Z8();function Ub($){if(cB($)){if(pB($),lB($)){Bb($);return}}dB($,()=>(0,mB.topBoolOrEmptySchema)($))}sB.validateFunctionCode=Ub;function dB({gen:$,validateName:Z,schema:X,schemaEnv:Q,opts:J},G){if(J.code.es5)$.func(Z,B0._`${I0.default.data}, ${I0.default.valCxt}`,Q.$async,()=>{$.code(B0._`"use strict"; ${fB(X,J)}`),Vb($,J),$.code(G)});else $.func(Z,B0._`${I0.default.data}, ${Hb(J)}`,Q.$async,()=>$.code(fB(X,J)).code(G))}function Hb($){return B0._`{${I0.default.instancePath}="", ${I0.default.parentData}, ${I0.default.parentDataProperty}, ${I0.default.rootData}=${I0.default.data}${$.dynamicRef?B0._`, ${I0.default.dynamicAnchors}={}`:B0.nil}}={}`}function Vb($,Z){$.if(I0.default.valCxt,()=>{if($.var(I0.default.instancePath,B0._`${I0.default.valCxt}.${I0.default.instancePath}`),$.var(I0.default.parentData,B0._`${I0.default.valCxt}.${I0.default.parentData}`),$.var(I0.default.parentDataProperty,B0._`${I0.default.valCxt}.${I0.default.parentDataProperty}`),$.var(I0.default.rootData,B0._`${I0.default.valCxt}.${I0.default.rootData}`),Z.dynamicRef)$.var(I0.default.dynamicAnchors,B0._`${I0.default.valCxt}.${I0.default.dynamicAnchors}`)},()=>{if($.var(I0.default.instancePath,B0._`""`),$.var(I0.default.parentData,B0._`undefined`),$.var(I0.default.parentDataProperty,B0._`undefined`),$.var(I0.default.rootData,I0.default.data),Z.dynamicRef)$.var(I0.default.dynamicAnchors,B0._`{}`)})}function Bb($){let{schema:Z,opts:X,gen:Q}=$;dB($,()=>{if(X.$comment&&Z.$comment)nB($);if(Ib($),Q.let(I0.default.vErrors,null),Q.let(I0.default.errors,0),X.unevaluated)Fb($);iB($),wb($)});return}function Fb($){let{gen:Z,validateName:X}=$;$.evaluated=Z.const("evaluated",B0._`${X}.evaluated`),Z.if(B0._`${$.evaluated}.dynamicProps`,()=>Z.assign(B0._`${$.evaluated}.props`,B0._`undefined`)),Z.if(B0._`${$.evaluated}.dynamicItems`,()=>Z.assign(B0._`${$.evaluated}.items`,B0._`undefined`))}function fB($,Z){let X=typeof $=="object"&&$[Z.schemaId];return X&&(Z.code.source||Z.code.process)?B0._`/*# sourceURL=${X} */`:B0.nil}function Lb($,Z){if(cB($)){if(pB($),lB($)){Mb($,Z);return}}(0,mB.boolOrEmptySchema)($,Z)}function lB({schema:$,self:Z}){if(typeof $=="boolean")return!$;for(let X in $)if(Z.RULES.all[X])return!0;return!1}function cB($){return typeof $.schema!="boolean"}function Mb($,Z){let{schema:X,gen:Q,opts:J}=$;if(J.$comment&&X.$comment)nB($);Nb($),Db($);let G=Q.const("_errs",I0.default.errors);iB($,G),Q.var(Z,B0._`${G} === ${I0.default.errors}`)}function pB($){(0,G6.checkUnknownRules)($),Ab($)}function iB($,Z){if($.opts.jtd)return hB($,[],!1,Z);let X=(0,gB.getSchemaTypes)($.schema),Q=(0,gB.coerceAndCheckDataType)($,X);hB($,X,!Q,Z)}function Ab($){let{schema:Z,errSchemaPath:X,opts:Q,self:J}=$;if(Z.$ref&&Q.ignoreKeywordsWithRef&&(0,G6.schemaHasRulesButRef)(Z,J.RULES))J.logger.warn(`$ref: keywords ignored in schema at path "${X}"`)}function Ib($){let{schema:Z,opts:X}=$;if(Z.default!==void 0&&X.useDefaults&&X.strictSchema)(0,G6.checkStrictMode)($,"default is ignored in the schema root")}function Nb($){let Z=$.schema[$.opts.schemaId];if(Z)$.baseId=(0,Kb.resolveUrl)($.opts.uriResolver,$.baseId,Z)}function Db($){if($.schema.$async&&!$.schemaEnv.$async)throw Error("async schema in sync schema")}function nB({gen:$,schemaEnv:Z,schema:X,errSchemaPath:Q,opts:J}){let G=X.$comment;if(J.$comment===!0)$.code(B0._`${I0.default.self}.logger.log(${G})`);else if(typeof J.$comment=="function"){let W=B0.str`${Q}/$comment`,Y=$.scopeValue("root",{ref:Z.root});$.code(B0._`${I0.default.self}.opts.$comment(${G}, ${W}, ${Y}.schema)`)}}function wb($){let{gen:Z,schemaEnv:X,validateName:Q,ValidationError:J,opts:G}=$;if(X.$async)Z.if(B0._`${I0.default.errors} === 0`,()=>Z.return(I0.default.data),()=>Z.throw(B0._`new ${J}(${I0.default.vErrors})`));else{if(Z.assign(B0._`${Q}.errors`,I0.default.vErrors),G.unevaluated)Tb($);Z.return(B0._`${I0.default.errors} === 0`)}}function Tb({gen:$,evaluated:Z,props:X,items:Q}){if(X instanceof B0.Name)$.assign(B0._`${Z}.props`,X);if(Q instanceof B0.Name)$.assign(B0._`${Z}.items`,Q)}function hB($,Z,X,Q){let{gen:J,schema:G,data:W,allErrors:Y,opts:z,self:q}=$,{RULES:H}=q;if(G.$ref&&(z.ignoreKeywordsWithRef||!(0,G6.schemaHasRulesButRef)(G,H))){J.block(()=>aB($,"$ref",H.all.$ref.definition));return}if(!z.jtd)jb($,Z);J.block(()=>{for(let F of H.rules)B(F);B(H.post)});function B(F){if(!(0,aQ.shouldUseGroup)(G,F))return;if(F.type){if(J.if((0,zZ.checkDataType)(F.type,W,z.strictNumbers)),uB($,F),Z.length===1&&Z[0]===F.type&&X)J.else(),(0,zZ.reportTypeError)($);J.endIf()}else uB($,F);if(!Y)J.if(B0._`${I0.default.errors} === ${Q||0}`)}}function uB($,Z){let{gen:X,schema:Q,opts:{useDefaults:J}}=$;if(J)(0,qb.assignDefaults)($,Z.type);X.block(()=>{for(let G of Z.rules)if((0,aQ.shouldUseRule)(Q,G))aB($,G.keyword,G.definition,Z.type)})}function jb($,Z){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(Ob($,Z),!$.opts.allowUnionTypes)Eb($,Z);Rb($,$.dataTypes)}function Ob($,Z){if(!Z.length)return;if(!$.dataTypes.length){$.dataTypes=Z;return}Z.forEach((X)=>{if(!rB($.dataTypes,X))oQ($,`type "${X}" not allowed by context "${$.dataTypes.join(",")}"`)}),Cb($,Z)}function Eb($,Z){if(Z.length>1&&!(Z.length===2&&Z.includes("null")))oQ($,"use allowUnionTypes to allow union type keyword")}function Rb($,Z){let X=$.self.RULES.all;for(let Q in X){let J=X[Q];if(typeof J=="object"&&(0,aQ.shouldUseRule)($.schema,J)){let{type:G}=J.definition;if(G.length&&!G.some((W)=>Pb(Z,W)))oQ($,`missing type "${G.join(",")}" for keyword "${Q}"`)}}}function Pb($,Z){return $.includes(Z)||Z==="number"&&$.includes("integer")}function rB($,Z){return $.includes(Z)||Z==="integer"&&$.includes("number")}function Cb($,Z){let X=[];for(let Q of $.dataTypes)if(rB(Z,Q))X.push(Q);else if(Z.includes("integer")&&Q==="number")X.push("integer");$.dataTypes=X}function oQ($,Z){let X=$.schemaEnv.baseId+$.errSchemaPath;Z+=` at "${X}" (strictTypes)`,(0,G6.checkStrictMode)($,Z,$.opts.strictTypes)}class sQ{constructor($,Z,X){if((0,G8.validateKeywordUsage)($,Z,X),this.gen=$.gen,this.allErrors=$.allErrors,this.keyword=X,this.data=$.data,this.schema=$.schema[X],this.$data=Z.$data&&$.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,G6.schemaRefOrVal)($,this.schema,X,this.$data),this.schemaType=Z.schemaType,this.parentSchema=$.schema,this.params={},this.it=$,this.def=Z,this.$data)this.schemaCode=$.gen.const("vSchema",oB(this.$data,$));else if(this.schemaCode=this.schemaValue,!(0,G8.validSchemaType)(this.schema,Z.schemaType,Z.allowUndefined))throw Error(`${X} value must be ${JSON.stringify(Z.schemaType)}`);if("code"in Z?Z.trackErrors:Z.errors!==!1)this.errsCount=$.gen.const("_errs",I0.default.errors)}result($,Z,X){this.failResult((0,B0.not)($),Z,X)}failResult($,Z,X){if(this.gen.if($),X)X();else this.error();if(Z){if(this.gen.else(),Z(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass($,Z){this.failResult((0,B0.not)($),void 0,Z)}fail($){if($===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if($),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data($){if(!this.$data)return this.fail($);let{schemaCode:Z}=this;this.fail(B0._`${Z} !== undefined && (${(0,B0.or)(this.invalid$data(),$)})`)}error($,Z,X){if(Z){this.setParams(Z),this._error($,X),this.setParams({});return}this._error($,X)}_error($,Z){($?J8.reportExtraError:J8.reportError)(this,this.def.error,Z)}$dataError(){(0,J8.reportError)(this,this.def.$dataError||J8.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,J8.resetErrorsCount)(this.gen,this.errsCount)}ok($){if(!this.allErrors)this.gen.if($)}setParams($,Z){if(Z)Object.assign(this.params,$);else this.params=$}block$data($,Z,X=B0.nil){this.gen.block(()=>{this.check$data($,X),Z()})}check$data($=B0.nil,Z=B0.nil){if(!this.$data)return;let{gen:X,schemaCode:Q,schemaType:J,def:G}=this;if(X.if((0,B0.or)(B0._`${Q} === undefined`,Z)),$!==B0.nil)X.assign($,!0);if(J.length||G.validateSchema){if(X.elseIf(this.invalid$data()),this.$dataError(),$!==B0.nil)X.assign($,!1)}X.else()}invalid$data(){let{gen:$,schemaCode:Z,schemaType:X,def:Q,it:J}=this;return(0,B0.or)(G(),W());function G(){if(X.length){if(!(Z instanceof B0.Name))throw Error("ajv implementation error");let Y=Array.isArray(X)?X:[X];return B0._`${(0,zZ.checkDataTypes)(Y,Z,J.opts.strictNumbers,zZ.DataType.Wrong)}`}return B0.nil}function W(){if(Q.validateSchema){let Y=$.scopeValue("validate$data",{ref:Q.validateSchema});return B0._`!${Y}(${Z})`}return B0.nil}}subschema($,Z){let X=(0,rQ.getSubschema)(this.it,$);(0,rQ.extendSubschemaData)(X,this.it,$),(0,rQ.extendSubschemaMode)(X,$);let Q={...this.it,...X,items:void 0,props:void 0};return Lb(Q,Z),Q}mergeEvaluated($,Z){let{it:X,gen:Q}=this;if(!X.opts.unevaluated)return;if(X.props!==!0&&$.props!==void 0)X.props=G6.mergeEvaluated.props(Q,$.props,X.props,Z);if(X.items!==!0&&$.items!==void 0)X.items=G6.mergeEvaluated.items(Q,$.items,X.items,Z)}mergeValidEvaluated($,Z){let{it:X,gen:Q}=this;if(X.opts.unevaluated&&(X.props!==!0||X.items!==!0))return Q.if(Z,()=>this.mergeEvaluated($,B0.Name)),!0}}sB.KeywordCxt=sQ;function aB($,Z,X,Q){let J=new sQ($,X,Z);if("code"in X)X.code(J,Q);else if(J.$data&&X.validate)(0,G8.funcKeywordCode)(J,X);else if("macro"in X)(0,G8.macroKeywordCode)(J,X);else if(X.compile||X.validate)(0,G8.funcKeywordCode)(J,X)}var Sb=/^\/(?:[^~]|~0|~1)*$/,_b=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function oB($,{dataLevel:Z,dataNames:X,dataPathArr:Q}){let J,G;if($==="")return I0.default.rootData;if($[0]==="/"){if(!Sb.test($))throw Error(`Invalid JSON-pointer: ${$}`);J=$,G=I0.default.rootData}else{let q=_b.exec($);if(!q)throw Error(`Invalid JSON-pointer: ${$}`);let H=+q[1];if(J=q[2],J==="#"){if(H>=Z)throw Error(z("property/index",H));return Q[Z-H]}if(H>Z)throw Error(z("data",H));if(G=X[Z-H],!J)return G}let W=G,Y=J.split("/");for(let q of Y)if(q)G=B0._`${G}${(0,B0.getProperty)((0,G6.unescapeJsonPointer)(q))}`,W=B0._`${W} && ${G}`;return W;function z(q,H){return`Cannot access ${q} ${H} levels up, current level is ${Z}`}}sB.getData=oB});var W8=b(($F)=>{Object.defineProperty($F,"__esModule",{value:!0});class eB extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}$F.default=eB});var t4=b((XF)=>{Object.defineProperty(XF,"__esModule",{value:!0});var tQ=Q8();class ZF extends Error{constructor($,Z,X,Q){super(Q||`can't resolve reference ${X} from id ${Z}`);this.missingRef=(0,tQ.resolveUrl)($,Z,X),this.missingSchema=(0,tQ.normalizeId)((0,tQ.getFullPath)($,this.missingRef))}}XF.default=ZF});var z8=b((GF)=>{Object.defineProperty(GF,"__esModule",{value:!0});GF.resolveSchema=GF.getCompilingSchema=GF.resolveRef=GF.compileSchema=GF.SchemaEnv=void 0;var V1=N0(),vb=W8(),q4=J1(),B1=Q8(),QF=P0(),gb=s4();class Y8{constructor($){var Z;this.refs={},this.dynamicAnchors={};let X;if(typeof $.schema=="object")X=$.schema;this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(Z=$.baseId)!==null&&Z!==void 0?Z:(0,B1.normalizeId)(X===null||X===void 0?void 0:X[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=X===null||X===void 0?void 0:X.$async,this.refs={}}}GF.SchemaEnv=Y8;function $J($){let Z=JF.call(this,$);if(Z)return Z;let X=(0,B1.getFullPath)(this.opts.uriResolver,$.root.baseId),{es5:Q,lines:J}=this.opts.code,{ownProperties:G}=this.opts,W=new V1.CodeGen(this.scope,{es5:Q,lines:J,ownProperties:G}),Y;if($.$async)Y=W.scopeValue("Error",{ref:vb.default,code:V1._`require("ajv/dist/runtime/validation_error").default`});let z=W.scopeName("validate");$.validateName=z;let q={gen:W,allErrors:this.opts.allErrors,data:q4.default.data,parentData:q4.default.parentData,parentDataProperty:q4.default.parentDataProperty,dataNames:[q4.default.data],dataPathArr:[V1.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:W.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:(0,V1.stringify)($.schema)}:{ref:$.schema}),validateName:z,ValidationError:Y,schema:$.schema,schemaEnv:$,rootId:X,baseId:$.baseId||X,schemaPath:V1.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:V1._`""`,opts:this.opts,self:this},H;try{this._compilations.add($),(0,gb.validateFunctionCode)(q),W.optimize(this.opts.code.optimize);let B=W.toString();if(H=`${W.scopeRefs(q4.default.scope)}return ${B}`,this.opts.code.process)H=this.opts.code.process(H,$);let L=Function(`${q4.default.self}`,`${q4.default.scope}`,H)(this,this.scope.get());if(this.scope.value(z,{ref:L}),L.errors=null,L.schema=$.schema,L.schemaEnv=$,$.$async)L.$async=!0;if(this.opts.code.source===!0)L.source={validateName:z,validateCode:B,scopeValues:W._values};if(this.opts.unevaluated){let{props:w,items:N}=q;if(L.evaluated={props:w instanceof V1.Name?void 0:w,items:N instanceof V1.Name?void 0:N,dynamicProps:w instanceof V1.Name,dynamicItems:N instanceof V1.Name},L.source)L.source.evaluated=(0,V1.stringify)(L.evaluated)}return $.validate=L,$}catch(B){if(delete $.validate,delete $.validateName,H)this.logger.error("Error compiling schema, function code:",H);throw B}finally{this._compilations.delete($)}}GF.compileSchema=$J;function fb($,Z,X){var Q;X=(0,B1.resolveUrl)(this.opts.uriResolver,Z,X);let J=$.refs[X];if(J)return J;let G=mb.call(this,$,X);if(G===void 0){let W=(Q=$.localRefs)===null||Q===void 0?void 0:Q[X],{schemaId:Y}=this.opts;if(W)G=new Y8({schema:W,schemaId:Y,root:$,baseId:Z})}if(G===void 0)return;return $.refs[X]=hb.call(this,G)}GF.resolveRef=fb;function hb($){if((0,B1.inlineRef)($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:$J.call(this,$)}function JF($){for(let Z of this._compilations)if(ub(Z,$))return Z}GF.getCompilingSchema=JF;function ub($,Z){return $.schema===Z.schema&&$.root===Z.root&&$.baseId===Z.baseId}function mb($,Z){let X;while(typeof(X=this.refs[Z])=="string")Z=X;return X||this.schemas[Z]||qZ.call(this,$,Z)}function qZ($,Z){let X=this.opts.uriResolver.parse(Z),Q=(0,B1._getFullPath)(this.opts.uriResolver,X),J=(0,B1.getFullPath)(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&Q===J)return eQ.call(this,X,$);let G=(0,B1.normalizeId)(Q),W=this.refs[G]||this.schemas[G];if(typeof W=="string"){let Y=qZ.call(this,$,W);if(typeof(Y===null||Y===void 0?void 0:Y.schema)!=="object")return;return eQ.call(this,X,Y)}if(typeof(W===null||W===void 0?void 0:W.schema)!=="object")return;if(!W.validate)$J.call(this,W);if(G===(0,B1.normalizeId)(Z)){let{schema:Y}=W,{schemaId:z}=this.opts,q=Y[z];if(q)J=(0,B1.resolveUrl)(this.opts.uriResolver,J,q);return new Y8({schema:Y,schemaId:z,root:$,baseId:J})}return eQ.call(this,X,W)}GF.resolveSchema=qZ;var db=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function eQ($,{baseId:Z,schema:X,root:Q}){var J;if(((J=$.fragment)===null||J===void 0?void 0:J[0])!=="/")return;for(let Y of $.fragment.slice(1).split("/")){if(typeof X==="boolean")return;let z=X[(0,QF.unescapeFragment)(Y)];if(z===void 0)return;X=z;let q=typeof X==="object"&&X[this.opts.schemaId];if(!db.has(Y)&&q)Z=(0,B1.resolveUrl)(this.opts.uriResolver,Z,q)}let G;if(typeof X!="boolean"&&X.$ref&&!(0,QF.schemaHasRulesButRef)(X,this.RULES)){let Y=(0,B1.resolveUrl)(this.opts.uriResolver,Z,X.$ref);G=qZ.call(this,Q,Y)}let{schemaId:W}=this.opts;if(G=G||new Y8({schema:X,schemaId:W,root:Q,baseId:Z}),G.schema!==G.root.schema)return G;return}});var YF=b((An,nb)=>{nb.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 QJ=b((In,VF)=>{var rb=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),qF=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),ZJ=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),KF=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),ab=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function XJ($){let Z="",X=0,Q=0;for(Q=0;Q<$.length;Q++){if(X=$[Q].charCodeAt(0),X===48)continue;if(!(X>=48&&X<=57||X>=65&&X<=70||X>=97&&X<=102))return"";Z+=$[Q];break}for(Q+=1;Q<$.length;Q++){if(X=$[Q].charCodeAt(0),!(X>=48&&X<=57||X>=65&&X<=70||X>=97&&X<=102))return"";Z+=$[Q]}return Z}var ob=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function zF($){return $.length=0,!0}function sb($,Z,X){if($.length){let Q=XJ($);if(Q!=="")Z.push(Q);else return X.error=!0,!1;$.length=0}return!0}function tb($){let Z=0,X={error:!1,address:"",zone:""},Q=[],J=[],G=!1,W=!1,Y=sb;for(let z=0;z<$.length;z++){let q=$[z];if(q==="["||q==="]")continue;if(q===":"){if(G===!0)W=!0;if(!Y(J,Q,X))break;if(++Z>7){X.error=!0;break}if(z>0&&$[z-1]===":")G=!0;Q.push(":");continue}else if(q==="%"){if(!Y(J,Q,X))break;Y=zF}else{J.push(q);continue}}if(J.length)if(Y===zF)X.zone=J.join("");else if(W)Q.push(J.join(""));else Q.push(XJ(J));return X.address=Q.join(""),X}function UF($){if(eb($,":")<2)return{host:$,isIPV6:!1};let Z=tb($);if(!Z.error){let{address:X,address:Q}=Z;if(Z.zone)X+="%"+Z.zone,Q+="%25"+Z.zone;return{host:X,isIPV6:!0,escapedHost:Q}}else return{host:$,isIPV6:!1}}function eb($,Z){let X=0;for(let Q=0;Q<$.length;Q++)if($[Q]===Z)X++;return X}function $x($){let Z=$,X=[],Q=-1,J=0;while(J=Z.length){if(J===1)if(Z===".")break;else if(Z==="/"){X.push("/");break}else{X.push(Z);break}else if(J===2){if(Z[0]==="."){if(Z[1]===".")break;else if(Z[1]==="/"){Z=Z.slice(2);continue}}else if(Z[0]==="/"){if(Z[1]==="."||Z[1]==="/"){X.push("/");break}}}else if(J===3){if(Z==="/.."){if(X.length!==0)X.pop();X.push("/");break}}if(Z[0]==="."){if(Z[1]==="."){if(Z[2]==="/"){Z=Z.slice(3);continue}}else if(Z[1]==="/"){Z=Z.slice(2);continue}}else if(Z[0]==="/"){if(Z[1]==="."){if(Z[2]==="/"){Z=Z.slice(2);continue}else if(Z[2]==="."){if(Z[3]==="/"){if(Z=Z.slice(3),X.length!==0)X.pop();continue}}}}if((Q=Z.indexOf("/",1))===-1){X.push(Z);break}else X.push(Z.slice(0,Q)),Z=Z.slice(Q)}return X.join("")}var Zx={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Xx=/[@/?#:]/g,Qx=/[@/?#]/g;function HF($,Z){let X=Z?Qx:Xx;return X.lastIndex=0,$.replace(X,(Q)=>Zx[Q])}function Jx($,Z=!1){if($.indexOf("%")===-1)return $;let X="";for(let Q=0;Q<$.length;Q++){if($[Q]==="%"&&Q+2<$.length){let J=$.slice(Q+1,Q+3);if(ZJ(J)){let G=J.toUpperCase(),W=String.fromCharCode(parseInt(G,16));if(Z&&KF(W))X+=W;else X+="%"+G;Q+=2;continue}}X+=$[Q]}return X}function Gx($){let Z="";for(let X=0;X<$.length;X++){if($[X]==="%"&&X+2<$.length){let Q=$.slice(X+1,X+3);if(ZJ(Q)){let J=Q.toUpperCase(),G=String.fromCharCode(parseInt(J,16));if(G!=="."&&KF(G))Z+=G;else Z+="%"+J;X+=2;continue}}if(ab($[X]))Z+=$[X];else Z+=escape($[X])}return Z}function Wx($){let Z="";for(let X=0;X<$.length;X++){if($[X]==="%"&&X+2<$.length){let Q=$.slice(X+1,X+3);if(ZJ(Q)){Z+="%"+Q.toUpperCase(),X+=2;continue}}Z+=escape($[X])}return Z}function Yx($){let Z=[];if($.userinfo!==void 0)Z.push($.userinfo),Z.push("@");if($.host!==void 0){let X=unescape($.host);if(!qF(X)){let Q=UF(X);if(Q.isIPV6===!0)X=`[${Q.escapedHost}]`;else X=HF(X,!1)}Z.push(X)}if(typeof $.port==="number"||typeof $.port==="string")Z.push(":"),Z.push(String($.port));return Z.length?Z.join(""):void 0}VF.exports={nonSimpleDomain:ob,recomposeAuthority:Yx,reescapeHostDelimiters:HF,normalizePercentEncoding:Jx,normalizePathEncoding:Gx,escapePreservingEscapes:Wx,removeDotSegments:$x,isIPv4:qF,isUUID:rb,normalizeIPv6:UF,stringArrayToHexStripped:XJ}});var AF=b((Nn,MF)=>{var{isUUID:zx}=QJ(),qx=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Kx=["http","https","ws","wss","urn","urn:uuid"];function Ux($){return Kx.indexOf($)!==-1}function JJ($){if($.secure===!0)return!0;else if($.secure===!1)return!1;else if($.scheme)return $.scheme.length===3&&($.scheme[0]==="w"||$.scheme[0]==="W")&&($.scheme[1]==="s"||$.scheme[1]==="S")&&($.scheme[2]==="s"||$.scheme[2]==="S");else return!1}function BF($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function FF($){let Z=String($.scheme).toLowerCase()==="https";if($.port===(Z?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function Hx($){return $.secure=JJ($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function Vx($){if($.port===(JJ($)?443:80)||$.port==="")$.port=void 0;if(typeof $.secure==="boolean")$.scheme=$.secure?"wss":"ws",$.secure=void 0;if($.resourceName){let[Z,X]=$.resourceName.split("?");$.path=Z&&Z!=="/"?Z:void 0,$.query=X,$.resourceName=void 0}return $.fragment=void 0,$}function Bx($,Z){if(!$.path)return $.error="URN can not be parsed",$;let X=$.path.match(qx);if(X){let Q=Z.scheme||$.scheme||"urn";$.nid=X[1].toLowerCase(),$.nss=X[2];let J=`${Q}:${Z.nid||$.nid}`,G=GJ(J);if($.path=void 0,G)$=G.parse($,Z)}else $.error=$.error||"URN can not be parsed.";return $}function Fx($,Z){if($.nid===void 0)throw Error("URN without nid cannot be serialized");let X=Z.scheme||$.scheme||"urn",Q=$.nid.toLowerCase(),J=`${X}:${Z.nid||Q}`,G=GJ(J);if(G)$=G.serialize($,Z);let W=$,Y=$.nss;return W.path=`${Q||Z.nid}:${Y}`,Z.skipEscape=!0,W}function Lx($,Z){let X=$;if(X.uuid=X.nss,X.nss=void 0,!Z.tolerant&&(!X.uuid||!zx(X.uuid)))X.error=X.error||"UUID is not valid.";return X}function Mx($){let Z=$;return Z.nss=($.uuid||"").toLowerCase(),Z}var LF={scheme:"http",domainHost:!0,parse:BF,serialize:FF},Ax={scheme:"https",domainHost:LF.domainHost,parse:BF,serialize:FF},KZ={scheme:"ws",domainHost:!0,parse:Hx,serialize:Vx},Ix={scheme:"wss",domainHost:KZ.domainHost,parse:KZ.parse,serialize:KZ.serialize},Nx={scheme:"urn",parse:Bx,serialize:Fx,skipNormalize:!0},Dx={scheme:"urn:uuid",parse:Lx,serialize:Mx,skipNormalize:!0},UZ={http:LF,https:Ax,ws:KZ,wss:Ix,urn:Nx,"urn:uuid":Dx};Object.setPrototypeOf(UZ,null);function GJ($){return $&&(UZ[$]||UZ[$.toLowerCase()])||void 0}MF.exports={wsIsSecure:JJ,SCHEMES:UZ,isValidSchemeName:Ux,getSchemeHandler:GJ}});var jF=b((Dn,HZ)=>{var{normalizeIPv6:wx,removeDotSegments:q8,recomposeAuthority:Tx,normalizePercentEncoding:jx,normalizePathEncoding:Ox,escapePreservingEscapes:Ex,reescapeHostDelimiters:Rx,isIPv4:Px,nonSimpleDomain:Cx}=QJ(),{SCHEMES:Sx,getSchemeHandler:NF}=AF();function _x($,Z){if(typeof $==="string")$=vx($,Z);else if(typeof $==="object")$=e4(K4($,Z),Z);return $}function bx($,Z,X){let Q=X?Object.assign({scheme:"null"},X):{scheme:"null"},J=DF(e4($,Q),e4(Z,Q),Q,!0);return Q.skipEscape=!0,K4(J,Q)}function DF($,Z,X,Q){let J={};if(!Q)$=e4(K4($,X),X),Z=e4(K4(Z,X),X);if(X=X||{},!X.tolerant&&Z.scheme)J.scheme=Z.scheme,J.userinfo=Z.userinfo,J.host=Z.host,J.port=Z.port,J.path=q8(Z.path||""),J.query=Z.query;else{if(Z.userinfo!==void 0||Z.host!==void 0||Z.port!==void 0)J.userinfo=Z.userinfo,J.host=Z.host,J.port=Z.port,J.path=q8(Z.path||""),J.query=Z.query;else{if(!Z.path)if(J.path=$.path,Z.query!==void 0)J.query=Z.query;else J.query=$.query;else{if(Z.path[0]==="/")J.path=q8(Z.path);else{if(($.userinfo!==void 0||$.host!==void 0||$.port!==void 0)&&!$.path)J.path="/"+Z.path;else if(!$.path)J.path=Z.path;else J.path=$.path.slice(0,$.path.lastIndexOf("/")+1)+Z.path;J.path=q8(J.path)}J.query=Z.query}J.userinfo=$.userinfo,J.host=$.host,J.port=$.port}J.scheme=$.scheme}return J.fragment=Z.fragment,J}function xx($,Z,X){let Q=IF($,X),J=IF(Z,X);return Q!==void 0&&J!==void 0&&Q.toLowerCase()===J.toLowerCase()}function K4($,Z){let X={host:$.host,scheme:$.scheme,userinfo:$.userinfo,port:$.port,path:$.path,query:$.query,nid:$.nid,nss:$.nss,uuid:$.uuid,fragment:$.fragment,reference:$.reference,resourceName:$.resourceName,secure:$.secure,error:""},Q=Object.assign({},Z),J=[],G=NF(Q.scheme||X.scheme);if(G&&G.serialize)G.serialize(X,Q);if(X.path!==void 0)if(!Q.skipEscape){if(X.path=Ex(X.path),X.scheme!==void 0)X.path=X.path.split("%3A").join(":")}else X.path=jx(X.path);if(Q.reference!=="suffix"&&X.scheme)J.push(X.scheme,":");let W=Tx(X);if(W!==void 0){if(Q.reference!=="suffix")J.push("//");if(J.push(W),X.path&&X.path[0]!=="/")J.push("/")}if(X.path!==void 0){let Y=X.path;if(!Q.absolutePath&&(!G||!G.absolutePath))Y=q8(Y);if(W===void 0&&Y[0]==="/"&&Y[1]==="/")Y="/%2F"+Y.slice(2);J.push(Y)}if(X.query!==void 0)J.push("?",X.query);if(X.fragment!==void 0)J.push("#",X.fragment);return J.join("")}var kx=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function yx($,Z){if(Z[2]!==void 0&&$.path&&$.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof $.port==="number"&&($.port<0||$.port>65535))return"URI port is malformed.";return}function wF($,Z){let X=Object.assign({},Z),Q={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},J=!1,G=!1;if(X.reference==="suffix")if(X.scheme)$=X.scheme+":"+$;else $="//"+$;let W=$.match(kx);if(W){if(Q.scheme=W[1],Q.userinfo=W[3],Q.host=W[4],Q.port=parseInt(W[5],10),Q.path=W[6]||"",Q.query=W[7],Q.fragment=W[8],isNaN(Q.port))Q.port=W[5];let Y=yx(Q,W);if(Y!==void 0)Q.error=Q.error||Y,J=!0;if(Q.host)if(Px(Q.host)===!1){let H=wx(Q.host);Q.host=H.host.toLowerCase(),G=H.isIPV6}else G=!0;if(Q.scheme===void 0&&Q.userinfo===void 0&&Q.host===void 0&&Q.port===void 0&&Q.query===void 0&&!Q.path)Q.reference="same-document";else if(Q.scheme===void 0)Q.reference="relative";else if(Q.fragment===void 0)Q.reference="absolute";else Q.reference="uri";if(X.reference&&X.reference!=="suffix"&&X.reference!==Q.reference)Q.error=Q.error||"URI is not a "+X.reference+" reference.";let z=NF(X.scheme||Q.scheme);if(!X.unicodeSupport&&(!z||!z.unicodeSupport)){if(Q.host&&(X.domainHost||z&&z.domainHost)&&G===!1&&Cx(Q.host))try{Q.host=URL.domainToASCII(Q.host.toLowerCase())}catch(q){Q.error=Q.error||"Host's domain name can not be converted to ASCII: "+q}}if(!z||z&&!z.skipNormalize){if($.indexOf("%")!==-1){if(Q.scheme!==void 0)Q.scheme=unescape(Q.scheme);if(Q.host!==void 0)Q.host=Rx(unescape(Q.host),G)}if(Q.path)Q.path=Ox(Q.path);if(Q.fragment)try{Q.fragment=encodeURI(decodeURIComponent(Q.fragment))}catch{Q.error=Q.error||"URI malformed"}}if(z&&z.parse)z.parse(Q,X)}else Q.error=Q.error||"URI can not be parsed.";return{parsed:Q,malformedAuthorityOrPort:J}}function e4($,Z){return wF($,Z).parsed}function vx($,Z){return TF($,Z).normalized}function TF($,Z){let{parsed:X,malformedAuthorityOrPort:Q}=wF($,Z);return{normalized:Q?$:K4(X,Z),malformedAuthorityOrPort:Q}}function IF($,Z){if(typeof $==="string"){let{normalized:X,malformedAuthorityOrPort:Q}=TF($,Z);return Q?void 0:X}if(typeof $==="object")return K4($,Z)}var WJ={SCHEMES:Sx,normalize:_x,resolve:bx,resolveComponent:DF,equal:xx,serialize:K4,parse:e4};HZ.exports=WJ;HZ.exports.default=WJ;HZ.exports.fastUri=WJ});var RF=b((EF)=>{Object.defineProperty(EF,"__esModule",{value:!0});var OF=jF();OF.code='require("ajv/dist/runtime/uri").default';EF.default=OF});var qJ=b((W6)=>{Object.defineProperty(W6,"__esModule",{value:!0});W6.CodeGen=W6.Name=W6.nil=W6.stringify=W6.str=W6._=W6.KeywordCxt=void 0;var fx=s4();Object.defineProperty(W6,"KeywordCxt",{enumerable:!0,get:function(){return fx.KeywordCxt}});var $9=N0();Object.defineProperty(W6,"_",{enumerable:!0,get:function(){return $9._}});Object.defineProperty(W6,"str",{enumerable:!0,get:function(){return $9.str}});Object.defineProperty(W6,"stringify",{enumerable:!0,get:function(){return $9.stringify}});Object.defineProperty(W6,"nil",{enumerable:!0,get:function(){return $9.nil}});Object.defineProperty(W6,"Name",{enumerable:!0,get:function(){return $9.Name}});Object.defineProperty(W6,"CodeGen",{enumerable:!0,get:function(){return $9.CodeGen}});var hx=W8(),bF=t4(),ux=fQ(),K8=z8(),mx=N0(),U8=Q8(),VZ=X8(),zJ=P0(),PF=YF(),dx=RF(),xF=($,Z)=>new RegExp($,Z);xF.code="new RegExp";var lx=["removeAdditional","useDefaults","coerceTypes"],cx=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),px={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."},ix={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},CF=200;function nx($){var Z,X,Q,J,G,W,Y,z,q,H,B,F,L,w,N,I,T,E,P,R,C,y,v,h,X0;let r=$.strict,u=(Z=$.code)===null||Z===void 0?void 0:Z.optimize,t=u===!0||u===void 0?1:u||0,Y0=(Q=(X=$.code)===null||X===void 0?void 0:X.regExp)!==null&&Q!==void 0?Q:xF,G0=(J=$.uriResolver)!==null&&J!==void 0?J:dx.default;return{strictSchema:(W=(G=$.strictSchema)!==null&&G!==void 0?G:r)!==null&&W!==void 0?W:!0,strictNumbers:(z=(Y=$.strictNumbers)!==null&&Y!==void 0?Y:r)!==null&&z!==void 0?z:!0,strictTypes:(H=(q=$.strictTypes)!==null&&q!==void 0?q:r)!==null&&H!==void 0?H:"log",strictTuples:(F=(B=$.strictTuples)!==null&&B!==void 0?B:r)!==null&&F!==void 0?F:"log",strictRequired:(w=(L=$.strictRequired)!==null&&L!==void 0?L:r)!==null&&w!==void 0?w:!1,code:$.code?{...$.code,optimize:t,regExp:Y0}:{optimize:t,regExp:Y0},loopRequired:(N=$.loopRequired)!==null&&N!==void 0?N:CF,loopEnum:(I=$.loopEnum)!==null&&I!==void 0?I:CF,meta:(T=$.meta)!==null&&T!==void 0?T:!0,messages:(E=$.messages)!==null&&E!==void 0?E:!0,inlineRefs:(P=$.inlineRefs)!==null&&P!==void 0?P:!0,schemaId:(R=$.schemaId)!==null&&R!==void 0?R:"$id",addUsedSchema:(C=$.addUsedSchema)!==null&&C!==void 0?C:!0,validateSchema:(y=$.validateSchema)!==null&&y!==void 0?y:!0,validateFormats:(v=$.validateFormats)!==null&&v!==void 0?v:!0,unicodeRegExp:(h=$.unicodeRegExp)!==null&&h!==void 0?h:!0,int32range:(X0=$.int32range)!==null&&X0!==void 0?X0:!0,uriResolver:G0}}class BZ{constructor($={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...nx($)};let{es5:Z,lines:X}=this.opts.code;this.scope=new mx.ValueScope({scope:{},prefixes:cx,es5:Z,lines:X}),this.logger=ex($.logger);let Q=$.validateFormats;if($.validateFormats=!1,this.RULES=(0,ux.getRules)(),SF.call(this,px,$,"NOT SUPPORTED"),SF.call(this,ix,$,"DEPRECATED","warn"),this._metaOpts=sx.call(this),$.formats)ax.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)ox.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);rx.call(this),$.validateFormats=Q}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:Z,schemaId:X}=this.opts,Q=PF;if(X==="id")Q={...PF},Q.id=Q.$id,delete Q.$id;if(Z&&$)this.addMetaSchema(Q,Q[X],!1)}defaultMeta(){let{meta:$,schemaId:Z}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[Z]||$:void 0}validate($,Z){let X;if(typeof $=="string"){if(X=this.getSchema($),!X)throw Error(`no schema with key or ref "${$}"`)}else X=this.compile($);let Q=X(Z);if(!("$async"in X))this.errors=X.errors;return Q}compile($,Z){let X=this._addSchema($,Z);return X.validate||this._compileSchemaEnv(X)}compileAsync($,Z){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:X}=this.opts;return Q.call(this,$,Z);async function Q(q,H){await J.call(this,q.$schema);let B=this._addSchema(q,H);return B.validate||G.call(this,B)}async function J(q){if(q&&!this.getSchema(q))await Q.call(this,{$ref:q},!0)}async function G(q){try{return this._compileSchemaEnv(q)}catch(H){if(!(H instanceof bF.default))throw H;return W.call(this,H),await Y.call(this,H.missingSchema),G.call(this,q)}}function W({missingSchema:q,missingRef:H}){if(this.refs[q])throw Error(`AnySchema ${q} is loaded but ${H} cannot be resolved`)}async function Y(q){let H=await z.call(this,q);if(!this.refs[q])await J.call(this,H.$schema);if(!this.refs[q])this.addSchema(H,q,Z)}async function z(q){let H=this._loading[q];if(H)return H;try{return await(this._loading[q]=X(q))}finally{delete this._loading[q]}}}addSchema($,Z,X,Q=this.opts.validateSchema){if(Array.isArray($)){for(let G of $)this.addSchema(G,void 0,X,Q);return this}let J;if(typeof $==="object"){let{schemaId:G}=this.opts;if(J=$[G],J!==void 0&&typeof J!="string")throw Error(`schema ${G} must be string`)}return Z=(0,U8.normalizeId)(Z||J),this._checkUnique(Z),this.schemas[Z]=this._addSchema($,X,Z,Q,!0),this}addMetaSchema($,Z,X=this.opts.validateSchema){return this.addSchema($,Z,!0,X),this}validateSchema($,Z){if(typeof $=="boolean")return!0;let X;if(X=$.$schema,X!==void 0&&typeof X!="string")throw Error("$schema must be a string");if(X=X||this.opts.defaultMeta||this.defaultMeta(),!X)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let Q=this.validate(X,$);if(!Q&&Z){let J="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(J);else throw Error(J)}return Q}getSchema($){let Z;while(typeof(Z=_F.call(this,$))=="string")$=Z;if(Z===void 0){let{schemaId:X}=this.opts,Q=new K8.SchemaEnv({schema:{},schemaId:X});if(Z=K8.resolveSchema.call(this,Q,$),!Z)return;this.refs[$]=Z}return Z.validate||this._compileSchemaEnv(Z)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let Z=_F.call(this,$);if(typeof Z=="object")this._cache.delete(Z.schema);return delete this.schemas[$],delete this.refs[$],this}case"object":{let Z=$;this._cache.delete(Z);let X=$[this.opts.schemaId];if(X)X=(0,U8.normalizeId)(X),delete this.schemas[X],delete this.refs[X];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let Z of $)this.addKeyword(Z);return this}addKeyword($,Z){let X;if(typeof $=="string"){if(X=$,typeof Z=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),Z.keyword=X}else if(typeof $=="object"&&Z===void 0){if(Z=$,X=Z.keyword,Array.isArray(X)&&!X.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Zk.call(this,X,Z),!Z)return(0,zJ.eachItem)(X,(J)=>YJ.call(this,J)),this;Qk.call(this,Z);let Q={...Z,type:(0,VZ.getJSONTypes)(Z.type),schemaType:(0,VZ.getJSONTypes)(Z.schemaType)};return(0,zJ.eachItem)(X,Q.type.length===0?(J)=>YJ.call(this,J,Q):(J)=>Q.type.forEach((G)=>YJ.call(this,J,Q,G))),this}getKeyword($){let Z=this.RULES.all[$];return typeof Z=="object"?Z.definition:!!Z}removeKeyword($){let{RULES:Z}=this;delete Z.keywords[$],delete Z.all[$];for(let X of Z.rules){let Q=X.rules.findIndex((J)=>J.keyword===$);if(Q>=0)X.rules.splice(Q,1)}return this}addFormat($,Z){if(typeof Z=="string")Z=new RegExp(Z);return this.formats[$]=Z,this}errorsText($=this.errors,{separator:Z=", ",dataVar:X="data"}={}){if(!$||$.length===0)return"No errors";return $.map((Q)=>`${X}${Q.instancePath} ${Q.message}`).reduce((Q,J)=>Q+Z+J)}$dataMetaSchema($,Z){let X=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let Q of Z){let J=Q.split("/").slice(1),G=$;for(let W of J)G=G[W];for(let W in X){let Y=X[W];if(typeof Y!="object")continue;let{$data:z}=Y.definition,q=G[W];if(z&&q)G[W]=kF(q)}}return $}_removeAllSchemas($,Z){for(let X in $){let Q=$[X];if(!Z||Z.test(X)){if(typeof Q=="string")delete $[X];else if(Q&&!Q.meta)this._cache.delete(Q.schema),delete $[X]}}}_addSchema($,Z,X,Q=this.opts.validateSchema,J=this.opts.addUsedSchema){let G,{schemaId:W}=this.opts;if(typeof $=="object")G=$[W];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof $!="boolean")throw Error("schema must be object or boolean");let Y=this._cache.get($);if(Y!==void 0)return Y;X=(0,U8.normalizeId)(G||X);let z=U8.getSchemaRefs.call(this,$,X);if(Y=new K8.SchemaEnv({schema:$,schemaId:W,meta:Z,baseId:X,localRefs:z}),this._cache.set(Y.schema,Y),J&&!X.startsWith("#")){if(X)this._checkUnique(X);this.refs[X]=Y}if(Q)this.validateSchema($,!0);return Y}_checkUnique($){if(this.schemas[$]||this.refs[$])throw Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta)this._compileMetaSchema($);else K8.compileSchema.call(this,$);if(!$.validate)throw Error("ajv implementation error");return $.validate}_compileMetaSchema($){let Z=this.opts;this.opts=this._metaOpts;try{K8.compileSchema.call(this,$)}finally{this.opts=Z}}}BZ.ValidationError=hx.default;BZ.MissingRefError=bF.default;W6.default=BZ;function SF($,Z,X,Q="error"){for(let J in $){let G=J;if(G in Z)this.logger[Q](`${X}: option ${J}. ${$[G]}`)}}function _F($){return $=(0,U8.normalizeId)($),this.schemas[$]||this.refs[$]}function rx(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let Z in $)this.addSchema($[Z],Z)}function ax(){for(let $ in this.opts.formats){let Z=this.opts.formats[$];if(Z)this.addFormat($,Z)}}function ox($){if(Array.isArray($)){this.addVocabulary($);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let Z in $){let X=$[Z];if(!X.keyword)X.keyword=Z;this.addKeyword(X)}}function sx(){let $={...this.opts};for(let Z of lx)delete $[Z];return $}var tx={log(){},warn(){},error(){}};function ex($){if($===!1)return tx;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw Error("logger must implement log, warn and error methods")}var $k=/^[a-z_$][a-z0-9_$:-]*$/i;function Zk($,Z){let{RULES:X}=this;if((0,zJ.eachItem)($,(Q)=>{if(X.keywords[Q])throw Error(`Keyword ${Q} is already defined`);if(!$k.test(Q))throw Error(`Keyword ${Q} has invalid name`)}),!Z)return;if(Z.$data&&!(("code"in Z)||("validate"in Z)))throw Error('$data keyword must have "code" or "validate" function')}function YJ($,Z,X){var Q;let J=Z===null||Z===void 0?void 0:Z.post;if(X&&J)throw Error('keyword with "post" flag cannot have "type"');let{RULES:G}=this,W=J?G.post:G.rules.find(({type:z})=>z===X);if(!W)W={type:X,rules:[]},G.rules.push(W);if(G.keywords[$]=!0,!Z)return;let Y={keyword:$,definition:{...Z,type:(0,VZ.getJSONTypes)(Z.type),schemaType:(0,VZ.getJSONTypes)(Z.schemaType)}};if(Z.before)Xk.call(this,W,Y,Z.before);else W.rules.push(Y);G.all[$]=Y,(Q=Z.implements)===null||Q===void 0||Q.forEach((z)=>this.addKeyword(z))}function Xk($,Z,X){let Q=$.rules.findIndex((J)=>J.keyword===X);if(Q>=0)$.rules.splice(Q,0,Z);else $.rules.push(Z),this.logger.warn(`rule ${X} is not defined`)}function Qk($){let{metaSchema:Z}=$;if(Z===void 0)return;if($.$data&&this.opts.$data)Z=kF(Z);$.validateSchema=this.compile(Z,!0)}var Jk={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function kF($){return{anyOf:[$,Jk]}}});var vF=b((yF)=>{Object.defineProperty(yF,"__esModule",{value:!0});var Yk={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};yF.default=Yk});var MZ=b((uF)=>{Object.defineProperty(uF,"__esModule",{value:!0});uF.callRef=uF.getValidate=void 0;var qk=t4(),gF=G1(),y$=N0(),Z9=J1(),fF=z8(),FZ=P0(),Kk={keyword:"$ref",schemaType:"string",code($){let{gen:Z,schema:X,it:Q}=$,{baseId:J,schemaEnv:G,validateName:W,opts:Y,self:z}=Q,{root:q}=G;if((X==="#"||X==="#/")&&J===q.baseId)return B();let H=fF.resolveRef.call(z,q,J,X);if(H===void 0)throw new qk.default(Q.opts.uriResolver,J,X);if(H instanceof fF.SchemaEnv)return F(H);return L(H);function B(){if(G===q)return LZ($,W,G,G.$async);let w=Z.scopeValue("root",{ref:q});return LZ($,y$._`${w}.validate`,q,q.$async)}function F(w){let N=hF($,w);LZ($,N,w,w.$async)}function L(w){let N=Z.scopeValue("schema",Y.code.source===!0?{ref:w,code:(0,y$.stringify)(w)}:{ref:w}),I=Z.name("valid"),T=$.subschema({schema:w,dataTypes:[],schemaPath:y$.nil,topSchemaRef:N,errSchemaPath:X},I);$.mergeEvaluated(T),$.ok(I)}}};function hF($,Z){let{gen:X}=$;return Z.validate?X.scopeValue("validate",{ref:Z.validate}):y$._`${X.scopeValue("wrapper",{ref:Z})}.validate`}uF.getValidate=hF;function LZ($,Z,X,Q){let{gen:J,it:G}=$,{allErrors:W,schemaEnv:Y,opts:z}=G,q=z.passContext?Z9.default.this:y$.nil;if(Q)H();else B();function H(){if(!Y.$async)throw Error("async schema referenced by sync schema");let w=J.let("valid");J.try(()=>{if(J.code(y$._`await ${(0,gF.callValidateCode)($,Z,q)}`),L(Z),!W)J.assign(w,!0)},(N)=>{if(J.if(y$._`!(${N} instanceof ${G.ValidationError})`,()=>J.throw(N)),F(N),!W)J.assign(w,!1)}),$.ok(w)}function B(){$.result((0,gF.callValidateCode)($,Z,q),()=>L(Z),()=>F(Z))}function F(w){let N=y$._`${w}.errors`;J.assign(Z9.default.vErrors,y$._`${Z9.default.vErrors} === null ? ${N} : ${Z9.default.vErrors}.concat(${N})`),J.assign(Z9.default.errors,y$._`${Z9.default.vErrors}.length`)}function L(w){var N;if(!G.opts.unevaluated)return;let I=(N=X===null||X===void 0?void 0:X.validate)===null||N===void 0?void 0:N.evaluated;if(G.props!==!0)if(I&&!I.dynamicProps){if(I.props!==void 0)G.props=FZ.mergeEvaluated.props(J,I.props,G.props)}else{let T=J.var("props",y$._`${w}.evaluated.props`);G.props=FZ.mergeEvaluated.props(J,T,G.props,y$.Name)}if(G.items!==!0)if(I&&!I.dynamicItems){if(I.items!==void 0)G.items=FZ.mergeEvaluated.items(J,I.items,G.items)}else{let T=J.var("items",y$._`${w}.evaluated.items`);G.items=FZ.mergeEvaluated.items(J,T,G.items,y$.Name)}}}uF.callRef=LZ;uF.default=Kk});var KJ=b((dF)=>{Object.defineProperty(dF,"__esModule",{value:!0});var Vk=vF(),Bk=MZ(),Fk=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Vk.default,Bk.default];dF.default=Fk});var cF=b((lF)=>{Object.defineProperty(lF,"__esModule",{value:!0});var AZ=N0(),v6=AZ.operators,IZ={maximum:{okStr:"<=",ok:v6.LTE,fail:v6.GT},minimum:{okStr:">=",ok:v6.GTE,fail:v6.LT},exclusiveMaximum:{okStr:"<",ok:v6.LT,fail:v6.GTE},exclusiveMinimum:{okStr:">",ok:v6.GT,fail:v6.LTE}},Mk={message:({keyword:$,schemaCode:Z})=>AZ.str`must be ${IZ[$].okStr} ${Z}`,params:({keyword:$,schemaCode:Z})=>AZ._`{comparison: ${IZ[$].okStr}, limit: ${Z}}`},Ak={keyword:Object.keys(IZ),type:"number",schemaType:"number",$data:!0,error:Mk,code($){let{keyword:Z,data:X,schemaCode:Q}=$;$.fail$data(AZ._`${X} ${IZ[Z].fail} ${Q} || isNaN(${X})`)}};lF.default=Ak});var iF=b((pF)=>{Object.defineProperty(pF,"__esModule",{value:!0});var H8=N0(),Nk={message:({schemaCode:$})=>H8.str`must be multiple of ${$}`,params:({schemaCode:$})=>H8._`{multipleOf: ${$}}`},Dk={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Nk,code($){let{gen:Z,data:X,schemaCode:Q,it:J}=$,G=J.opts.multipleOfPrecision,W=Z.let("res"),Y=G?H8._`Math.abs(Math.round(${W}) - ${W}) > 1e-${G}`:H8._`${W} !== parseInt(${W})`;$.fail$data(H8._`(${Q} === 0 || (${W} = ${X}/${Q}, ${Y}))`)}};pF.default=Dk});var aF=b((rF)=>{Object.defineProperty(rF,"__esModule",{value:!0});function nF($){let Z=$.length,X=0,Q=0,J;while(Q<Z)if(X++,J=$.charCodeAt(Q++),J>=55296&&J<=56319&&Q<Z){if(J=$.charCodeAt(Q),(J&64512)===56320)Q++}return X}rF.default=nF;nF.code='require("ajv/dist/runtime/ucs2length").default'});var sF=b((oF)=>{Object.defineProperty(oF,"__esModule",{value:!0});var U4=N0(),jk=P0(),Ok=aF(),Ek={message({keyword:$,schemaCode:Z}){let X=$==="maxLength"?"more":"fewer";return U4.str`must NOT have ${X} than ${Z} characters`},params:({schemaCode:$})=>U4._`{limit: ${$}}`},Rk={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Ek,code($){let{keyword:Z,data:X,schemaCode:Q,it:J}=$,G=Z==="maxLength"?U4.operators.GT:U4.operators.LT,W=J.opts.unicode===!1?U4._`${X}.length`:U4._`${(0,jk.useFunc)($.gen,Ok.default)}(${X})`;$.fail$data(U4._`${W} ${G} ${Q}`)}};oF.default=Rk});var eF=b((tF)=>{Object.defineProperty(tF,"__esModule",{value:!0});var Ck=G1(),Sk=P0(),X9=N0(),_k={message:({schemaCode:$})=>X9.str`must match pattern "${$}"`,params:({schemaCode:$})=>X9._`{pattern: ${$}}`},bk={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:_k,code($){let{gen:Z,data:X,$data:Q,schema:J,schemaCode:G,it:W}=$,Y=W.opts.unicodeRegExp?"u":"";if(Q){let{regExp:z}=W.opts.code,q=z.code==="new RegExp"?X9._`new RegExp`:(0,Sk.useFunc)(Z,z),H=Z.let("valid");Z.try(()=>Z.assign(H,X9._`${q}(${G}, ${Y}).test(${X})`),()=>Z.assign(H,!1)),$.fail$data(X9._`!${H}`)}else{let z=(0,Ck.usePattern)($,J);$.fail$data(X9._`!${z}.test(${X})`)}}};tF.default=bk});var ZL=b(($L)=>{Object.defineProperty($L,"__esModule",{value:!0});var V8=N0(),kk={message({keyword:$,schemaCode:Z}){let X=$==="maxProperties"?"more":"fewer";return V8.str`must NOT have ${X} than ${Z} properties`},params:({schemaCode:$})=>V8._`{limit: ${$}}`},yk={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:kk,code($){let{keyword:Z,data:X,schemaCode:Q}=$,J=Z==="maxProperties"?V8.operators.GT:V8.operators.LT;$.fail$data(V8._`Object.keys(${X}).length ${J} ${Q}`)}};$L.default=yk});var QL=b((XL)=>{Object.defineProperty(XL,"__esModule",{value:!0});var B8=G1(),F8=N0(),gk=P0(),fk={message:({params:{missingProperty:$}})=>F8.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>F8._`{missingProperty: ${$}}`},hk={keyword:"required",type:"object",schemaType:"array",$data:!0,error:fk,code($){let{gen:Z,schema:X,schemaCode:Q,data:J,$data:G,it:W}=$,{opts:Y}=W;if(!G&&X.length===0)return;let z=X.length>=Y.loopRequired;if(W.allErrors)q();else H();if(Y.strictRequired){let L=$.parentSchema.properties,{definedProperties:w}=$.it;for(let N of X)if((L===null||L===void 0?void 0:L[N])===void 0&&!w.has(N)){let I=W.schemaEnv.baseId+W.errSchemaPath,T=`required property "${N}" is not defined at "${I}" (strictRequired)`;(0,gk.checkStrictMode)(W,T,W.opts.strictRequired)}}function q(){if(z||G)$.block$data(F8.nil,B);else for(let L of X)(0,B8.checkReportMissingProp)($,L)}function H(){let L=Z.let("missing");if(z||G){let w=Z.let("valid",!0);$.block$data(w,()=>F(L,w)),$.ok(w)}else Z.if((0,B8.checkMissingProp)($,X,L)),(0,B8.reportMissingProp)($,L),Z.else()}function B(){Z.forOf("prop",Q,(L)=>{$.setParams({missingProperty:L}),Z.if((0,B8.noPropertyInData)(Z,J,L,Y.ownProperties),()=>$.error())})}function F(L,w){$.setParams({missingProperty:L}),Z.forOf(L,Q,()=>{Z.assign(w,(0,B8.propertyInData)(Z,J,L,Y.ownProperties)),Z.if((0,F8.not)(w),()=>{$.error(),Z.break()})},F8.nil)}}};XL.default=hk});var GL=b((JL)=>{Object.defineProperty(JL,"__esModule",{value:!0});var L8=N0(),mk={message({keyword:$,schemaCode:Z}){let X=$==="maxItems"?"more":"fewer";return L8.str`must NOT have ${X} than ${Z} items`},params:({schemaCode:$})=>L8._`{limit: ${$}}`},dk={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:mk,code($){let{keyword:Z,data:X,schemaCode:Q}=$,J=Z==="maxItems"?L8.operators.GT:L8.operators.LT;$.fail$data(L8._`${X}.length ${J} ${Q}`)}};JL.default=dk});var NZ=b((YL)=>{Object.defineProperty(YL,"__esModule",{value:!0});var WL=iQ();WL.code='require("ajv/dist/runtime/equal").default';YL.default=WL});var qL=b((zL)=>{Object.defineProperty(zL,"__esModule",{value:!0});var UJ=X8(),z$=N0(),pk=P0(),ik=NZ(),nk={message:({params:{i:$,j:Z}})=>z$.str`must NOT have duplicate items (items ## ${Z} and ${$} are identical)`,params:({params:{i:$,j:Z}})=>z$._`{i: ${$}, j: ${Z}}`},rk={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:nk,code($){let{gen:Z,data:X,$data:Q,schema:J,parentSchema:G,schemaCode:W,it:Y}=$;if(!Q&&!J)return;let z=Z.let("valid"),q=G.items?(0,UJ.getSchemaTypes)(G.items):[];$.block$data(z,H,z$._`${W} === false`),$.ok(z);function H(){let w=Z.let("i",z$._`${X}.length`),N=Z.let("j");$.setParams({i:w,j:N}),Z.assign(z,!0),Z.if(z$._`${w} > 1`,()=>(B()?F:L)(w,N))}function B(){return q.length>0&&!q.some((w)=>w==="object"||w==="array")}function F(w,N){let I=Z.name("item"),T=(0,UJ.checkDataTypes)(q,I,Y.opts.strictNumbers,UJ.DataType.Wrong),E=Z.const("indices",z$._`{}`);Z.for(z$._`;${w}--;`,()=>{if(Z.let(I,z$._`${X}[${w}]`),Z.if(T,z$._`continue`),q.length>1)Z.if(z$._`typeof ${I} == "string"`,z$._`${I} += "_"`);Z.if(z$._`typeof ${E}[${I}] == "number"`,()=>{Z.assign(N,z$._`${E}[${I}]`),$.error(),Z.assign(z,!1).break()}).code(z$._`${E}[${I}] = ${w}`)})}function L(w,N){let I=(0,pk.useFunc)(Z,ik.default),T=Z.name("outer");Z.label(T).for(z$._`;${w}--;`,()=>Z.for(z$._`${N} = ${w}; ${N}--;`,()=>Z.if(z$._`${I}(${X}[${w}], ${X}[${N}])`,()=>{$.error(),Z.assign(z,!1).break(T)})))}}};zL.default=rk});var UL=b((KL)=>{Object.defineProperty(KL,"__esModule",{value:!0});var HJ=N0(),ok=P0(),sk=NZ(),tk={message:"must be equal to constant",params:({schemaCode:$})=>HJ._`{allowedValue: ${$}}`},ek={keyword:"const",$data:!0,error:tk,code($){let{gen:Z,data:X,$data:Q,schemaCode:J,schema:G}=$;if(Q||G&&typeof G=="object")$.fail$data(HJ._`!${(0,ok.useFunc)(Z,sk.default)}(${X}, ${J})`);else $.fail(HJ._`${G} !== ${X}`)}};KL.default=ek});var VL=b((HL)=>{Object.defineProperty(HL,"__esModule",{value:!0});var M8=N0(),Zy=P0(),Xy=NZ(),Qy={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>M8._`{allowedValues: ${$}}`},Jy={keyword:"enum",schemaType:"array",$data:!0,error:Qy,code($){let{gen:Z,data:X,$data:Q,schema:J,schemaCode:G,it:W}=$;if(!Q&&J.length===0)throw Error("enum must have non-empty array");let Y=J.length>=W.opts.loopEnum,z,q=()=>z!==null&&z!==void 0?z:z=(0,Zy.useFunc)(Z,Xy.default),H;if(Y||Q)H=Z.let("valid"),$.block$data(H,B);else{if(!Array.isArray(J))throw Error("ajv implementation error");let L=Z.const("vSchema",G);H=(0,M8.or)(...J.map((w,N)=>F(L,N)))}$.pass(H);function B(){Z.assign(H,!1),Z.forOf("v",G,(L)=>Z.if(M8._`${q()}(${X}, ${L})`,()=>Z.assign(H,!0).break()))}function F(L,w){let N=J[w];return typeof N==="object"&&N!==null?M8._`${q()}(${X}, ${L}[${w}])`:M8._`${X} === ${N}`}}};HL.default=Jy});var VJ=b((BL)=>{Object.defineProperty(BL,"__esModule",{value:!0});var Wy=cF(),Yy=iF(),zy=sF(),qy=eF(),Ky=ZL(),Uy=QL(),Hy=GL(),Vy=qL(),By=UL(),Fy=VL(),Ly=[Wy.default,Yy.default,zy.default,qy.default,Ky.default,Uy.default,Hy.default,Vy.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},By.default,Fy.default];BL.default=Ly});var FJ=b((LL)=>{Object.defineProperty(LL,"__esModule",{value:!0});LL.validateAdditionalItems=void 0;var H4=N0(),BJ=P0(),Ay={message:({params:{len:$}})=>H4.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>H4._`{limit: ${$}}`},Iy={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Ay,code($){let{parentSchema:Z,it:X}=$,{items:Q}=Z;if(!Array.isArray(Q)){(0,BJ.checkStrictMode)(X,'"additionalItems" is ignored when "items" is not an array of schemas');return}FL($,Q)}};function FL($,Z){let{gen:X,schema:Q,data:J,keyword:G,it:W}=$;W.items=!0;let Y=X.const("len",H4._`${J}.length`);if(Q===!1)$.setParams({len:Z.length}),$.pass(H4._`${Y} <= ${Z.length}`);else if(typeof Q=="object"&&!(0,BJ.alwaysValidSchema)(W,Q)){let q=X.var("valid",H4._`${Y} <= ${Z.length}`);X.if((0,H4.not)(q),()=>z(q)),$.ok(q)}function z(q){X.forRange("i",Z.length,Y,(H)=>{if($.subschema({keyword:G,dataProp:H,dataPropType:BJ.Type.Num},q),!W.allErrors)X.if((0,H4.not)(q),()=>X.break())})}}LL.validateAdditionalItems=FL;LL.default=Iy});var LJ=b((NL)=>{Object.defineProperty(NL,"__esModule",{value:!0});NL.validateTuple=void 0;var AL=N0(),DZ=P0(),Dy=G1(),wy={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:Z,it:X}=$;if(Array.isArray(Z))return IL($,"additionalItems",Z);if(X.items=!0,(0,DZ.alwaysValidSchema)(X,Z))return;$.ok((0,Dy.validateArray)($))}};function IL($,Z,X=$.schema){let{gen:Q,parentSchema:J,data:G,keyword:W,it:Y}=$;if(H(J),Y.opts.unevaluated&&X.length&&Y.items!==!0)Y.items=DZ.mergeEvaluated.items(Q,X.length,Y.items);let z=Q.name("valid"),q=Q.const("len",AL._`${G}.length`);X.forEach((B,F)=>{if((0,DZ.alwaysValidSchema)(Y,B))return;Q.if(AL._`${q} > ${F}`,()=>$.subschema({keyword:W,schemaProp:F,dataProp:F},z)),$.ok(z)});function H(B){let{opts:F,errSchemaPath:L}=Y,w=X.length,N=w===B.minItems&&(w===B.maxItems||B[Z]===!1);if(F.strictTuples&&!N){let I=`"${W}" is ${w}-tuple, but minItems or maxItems/${Z} are not specified or different at path "${L}"`;(0,DZ.checkStrictMode)(Y,I,F.strictTuples)}}}NL.validateTuple=IL;NL.default=wy});var TL=b((wL)=>{Object.defineProperty(wL,"__esModule",{value:!0});var jy=LJ(),Oy={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>(0,jy.validateTuple)($,"items")};wL.default=Oy});var EL=b((OL)=>{Object.defineProperty(OL,"__esModule",{value:!0});var jL=N0(),Ry=P0(),Py=G1(),Cy=FJ(),Sy={message:({params:{len:$}})=>jL.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>jL._`{limit: ${$}}`},_y={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Sy,code($){let{schema:Z,parentSchema:X,it:Q}=$,{prefixItems:J}=X;if(Q.items=!0,(0,Ry.alwaysValidSchema)(Q,Z))return;if(J)(0,Cy.validateAdditionalItems)($,J);else $.ok((0,Py.validateArray)($))}};OL.default=_y});var PL=b((RL)=>{Object.defineProperty(RL,"__esModule",{value:!0});var W1=N0(),wZ=P0(),xy={message:({params:{min:$,max:Z}})=>Z===void 0?W1.str`must contain at least ${$} valid item(s)`:W1.str`must contain at least ${$} and no more than ${Z} valid item(s)`,params:({params:{min:$,max:Z}})=>Z===void 0?W1._`{minContains: ${$}}`:W1._`{minContains: ${$}, maxContains: ${Z}}`},ky={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:xy,code($){let{gen:Z,schema:X,parentSchema:Q,data:J,it:G}=$,W,Y,{minContains:z,maxContains:q}=Q;if(G.opts.next)W=z===void 0?1:z,Y=q;else W=1;let H=Z.const("len",W1._`${J}.length`);if($.setParams({min:W,max:Y}),Y===void 0&&W===0){(0,wZ.checkStrictMode)(G,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(Y!==void 0&&W>Y){(0,wZ.checkStrictMode)(G,'"minContains" > "maxContains" is always invalid'),$.fail();return}if((0,wZ.alwaysValidSchema)(G,X)){let N=W1._`${H} >= ${W}`;if(Y!==void 0)N=W1._`${N} && ${H} <= ${Y}`;$.pass(N);return}G.items=!0;let B=Z.name("valid");if(Y===void 0&&W===1)L(B,()=>Z.if(B,()=>Z.break()));else if(W===0){if(Z.let(B,!0),Y!==void 0)Z.if(W1._`${J}.length > 0`,F)}else Z.let(B,!1),F();$.result(B,()=>$.reset());function F(){let N=Z.name("_valid"),I=Z.let("count",0);L(N,()=>Z.if(N,()=>w(I)))}function L(N,I){Z.forRange("i",0,H,(T)=>{$.subschema({keyword:"contains",dataProp:T,dataPropType:wZ.Type.Num,compositeRule:!0},N),I()})}function w(N){if(Z.code(W1._`${N}++`),Y===void 0)Z.if(W1._`${N} >= ${W}`,()=>Z.assign(B,!0).break());else if(Z.if(W1._`${N} > ${Y}`,()=>Z.assign(B,!1).break()),W===1)Z.assign(B,!0);else Z.if(W1._`${N} >= ${W}`,()=>Z.assign(B,!0))}}};RL.default=ky});var TZ=b((_L)=>{Object.defineProperty(_L,"__esModule",{value:!0});_L.validateSchemaDeps=_L.validatePropertyDeps=_L.error=void 0;var MJ=N0(),vy=P0(),A8=G1();_L.error={message:({params:{property:$,depsCount:Z,deps:X}})=>{let Q=Z===1?"property":"properties";return MJ.str`must have ${Q} ${X} when property ${$} is present`},params:({params:{property:$,depsCount:Z,deps:X,missingProperty:Q}})=>MJ._`{property: ${$},
|
|
394
393
|
missingProperty: ${Q},
|
|
395
394
|
depsCount: ${Z},
|
|
396
|
-
deps: ${X}}`};var Ly={keyword:"dependencies",type:"object",schemaType:"object",error:DL.error,code($){let[Z,X]=My($);IL($,Z),NL($,X)}};function My({schema:$}){let Z={},X={};for(let Q in $){if(Q==="__proto__")continue;let J=Array.isArray($[Q])?Z:X;J[Q]=$[Q]}return[Z,X]}function IL($,Z=$.schema){let{gen:X,data:Q,it:J}=$;if(Object.keys(Z).length===0)return;let G=X.let("missing");for(let W in Z){let Y=Z[W];if(Y.length===0)continue;let z=(0,U5.propertyInData)(X,Q,W,J.opts.ownProperties);if($.setParams({property:W,depsCount:Y.length,deps:Y.join(", ")}),J.allErrors)X.if(z,()=>{for(let q of Y)(0,U5.checkReportMissingProp)($,q)});else X.if(WJ._`${z} && (${(0,U5.checkMissingProp)($,Y,G)})`),(0,U5.reportMissingProp)($,G),X.else()}}DL.validatePropertyDeps=IL;function NL($,Z=$.schema){let{gen:X,data:Q,keyword:J,it:G}=$,W=X.name("valid");for(let Y in Z){if((0,Fy.alwaysValidSchema)(G,Z[Y]))continue;X.if((0,U5.propertyInData)(X,Q,Y,G.opts.ownProperties),()=>{let z=$.subschema({keyword:J,schemaProp:Y},W);$.mergeValidEvaluated(z,W)},()=>X.var(W,!0)),$.ok(W)}}DL.validateSchemaDeps=NL;DL.default=Ly});var EL=x((OL)=>{Object.defineProperty(OL,"__esModule",{value:!0});var jL=D0(),Ny=R0(),Dy={message:"property name must be valid",params:({params:$})=>jL._`{propertyName: ${$.propertyName}}`},wy={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Dy,code($){let{gen:Z,schema:X,data:Q,it:J}=$;if((0,Ny.alwaysValidSchema)(J,X))return;let G=Z.name("valid");Z.forIn("key",Q,(W)=>{$.setParams({propertyName:W}),$.subschema({keyword:"propertyNames",data:W,dataTypes:["string"],propertyName:W,compositeRule:!0},G),Z.if((0,jL.not)(G),()=>{if($.error(!0),!J.allErrors)Z.break()})}),$.ok(G)}};OL.default=wy});var YJ=x((RL)=>{Object.defineProperty(RL,"__esModule",{value:!0});var BZ=J6(),B6=D0(),jy=Q6(),FZ=R0(),Oy={message:"must NOT have additional properties",params:({params:$})=>B6._`{additionalProperty: ${$.additionalProperty}}`},Ey={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Oy,code($){let{gen:Z,schema:X,parentSchema:Q,data:J,errsCount:G,it:W}=$;if(!G)throw Error("ajv implementation error");let{allErrors:Y,opts:z}=W;if(W.props=!0,z.removeAdditional!=="all"&&(0,FZ.alwaysValidSchema)(W,X))return;let q=(0,BZ.allSchemaProperties)(Q.properties),H=(0,BZ.allSchemaProperties)(Q.patternProperties);B(),$.ok(B6._`${G} === ${jy.default.errors}`);function B(){Z.forIn("key",J,(D)=>{if(!q.length&&!H.length)A(D);else Z.if(F(D),()=>A(D))})}function F(D){let j;if(q.length>8){let R=(0,FZ.schemaRefOrVal)(W,Q.properties,"properties");j=(0,BZ.isOwnProperty)(Z,R,D)}else if(q.length)j=(0,B6.or)(...q.map((R)=>B6._`${D} === ${R}`));else j=B6.nil;if(H.length)j=(0,B6.or)(j,...H.map((R)=>B6._`${(0,BZ.usePattern)($,R)}.test(${D})`));return(0,B6.not)(j)}function M(D){Z.code(B6._`delete ${J}[${D}]`)}function A(D){if(z.removeAdditional==="all"||z.removeAdditional&&X===!1){M(D);return}if(X===!1){if($.setParams({additionalProperty:D}),$.error(),!Y)Z.break();return}if(typeof X=="object"&&!(0,FZ.alwaysValidSchema)(W,X)){let j=Z.name("valid");if(z.removeAdditional==="failing")w(D,j,!1),Z.if((0,B6.not)(j),()=>{$.reset(),M(D)});else if(w(D,j),!Y)Z.if((0,B6.not)(j),()=>Z.break())}}function w(D,j,R){let P={keyword:"additionalProperties",dataProp:D,dataPropType:FZ.Type.Str};if(R===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(P,j)}}};RL.default=Ey});var _L=x((SL)=>{Object.defineProperty(SL,"__esModule",{value:!0});var Py=p4(),PL=J6(),zJ=R0(),CL=YJ(),Cy={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:Z,schema:X,parentSchema:Q,data:J,it:G}=$;if(G.opts.removeAdditional==="all"&&Q.additionalProperties===void 0)CL.default.code(new Py.KeywordCxt(G,CL.default,"additionalProperties"));let W=(0,PL.allSchemaProperties)(X);for(let B of W)G.definedProperties.add(B);if(G.opts.unevaluated&&W.length&&G.props!==!0)G.props=zJ.mergeEvaluated.props(Z,(0,zJ.toHash)(W),G.props);let Y=W.filter((B)=>!(0,zJ.alwaysValidSchema)(G,X[B]));if(Y.length===0)return;let z=Z.name("valid");for(let B of Y){if(q(B))H(B);else{if(Z.if((0,PL.propertyInData)(Z,J,B,G.opts.ownProperties)),H(B),!G.allErrors)Z.else().var(z,!0);Z.endIf()}$.it.definedProperties.add(B),$.ok(z)}function q(B){return G.opts.useDefaults&&!G.compositeRule&&X[B].default!==void 0}function H(B){$.subschema({keyword:"properties",schemaProp:B,dataProp:B},z)}}};SL.default=Cy});var vL=x((yL)=>{Object.defineProperty(yL,"__esModule",{value:!0});var xL=J6(),LZ=D0(),bL=R0(),kL=R0(),_y={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:Z,schema:X,data:Q,parentSchema:J,it:G}=$,{opts:W}=G,Y=(0,xL.allSchemaProperties)(X),z=Y.filter((w)=>(0,bL.alwaysValidSchema)(G,X[w]));if(Y.length===0||z.length===Y.length&&(!G.opts.unevaluated||G.props===!0))return;let q=W.strictSchema&&!W.allowMatchingProperties&&J.properties,H=Z.name("valid");if(G.props!==!0&&!(G.props instanceof LZ.Name))G.props=(0,kL.evaluatedPropsToName)(Z,G.props);let{props:B}=G;F();function F(){for(let w of Y){if(q)M(w);if(G.allErrors)A(w);else Z.var(H,!0),A(w),Z.if(H)}}function M(w){for(let D in q)if(new RegExp(w).test(D))(0,bL.checkStrictMode)(G,`property ${D} matches pattern ${w} (use allowMatchingProperties)`)}function A(w){Z.forIn("key",Q,(D)=>{Z.if(LZ._`${(0,xL.usePattern)($,w)}.test(${D})`,()=>{let j=z.includes(w);if(!j)$.subschema({keyword:"patternProperties",schemaProp:w,dataProp:D,dataPropType:kL.Type.Str},H);if(G.opts.unevaluated&&B!==!0)Z.assign(LZ._`${B}[${D}]`,!0);else if(!j&&!G.allErrors)Z.if((0,LZ.not)(H),()=>Z.break())})})}}};yL.default=_y});var fL=x((gL)=>{Object.defineProperty(gL,"__esModule",{value:!0});var by=R0(),ky={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:Z,schema:X,it:Q}=$;if((0,by.alwaysValidSchema)(Q,X)){$.fail();return}let J=Z.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},J),$.failResult(J,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};gL.default=ky});var uL=x((hL)=>{Object.defineProperty(hL,"__esModule",{value:!0});var vy=J6(),gy={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:vy.validateUnion,error:{message:"must match a schema in anyOf"}};hL.default=gy});var dL=x((mL)=>{Object.defineProperty(mL,"__esModule",{value:!0});var MZ=D0(),hy=R0(),uy={message:"must match exactly one schema in oneOf",params:({params:$})=>MZ._`{passingSchemas: ${$.passing}}`},my={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:uy,code($){let{gen:Z,schema:X,parentSchema:Q,it:J}=$;if(!Array.isArray(X))throw Error("ajv implementation error");if(J.opts.discriminator&&Q.discriminator)return;let G=X,W=Z.let("valid",!1),Y=Z.let("passing",null),z=Z.name("_valid");$.setParams({passing:Y}),Z.block(q),$.result(W,()=>$.reset(),()=>$.error(!0));function q(){G.forEach((H,B)=>{let F;if((0,hy.alwaysValidSchema)(J,H))Z.var(z,!0);else F=$.subschema({keyword:"oneOf",schemaProp:B,compositeRule:!0},z);if(B>0)Z.if(MZ._`${z} && ${W}`).assign(W,!1).assign(Y,MZ._`[${Y}, ${B}]`).else();Z.if(z,()=>{if(Z.assign(W,!0),Z.assign(Y,B),F)$.mergeEvaluated(F,MZ.Name)})})}}};mL.default=my});var cL=x((lL)=>{Object.defineProperty(lL,"__esModule",{value:!0});var ly=R0(),cy={keyword:"allOf",schemaType:"array",code($){let{gen:Z,schema:X,it:Q}=$;if(!Array.isArray(X))throw Error("ajv implementation error");let J=Z.name("valid");X.forEach((G,W)=>{if((0,ly.alwaysValidSchema)(Q,G))return;let Y=$.subschema({keyword:"allOf",schemaProp:W},J);$.ok(J),$.mergeEvaluated(Y)})}};lL.default=cy});var rL=x((nL)=>{Object.defineProperty(nL,"__esModule",{value:!0});var AZ=D0(),iL=R0(),iy={message:({params:$})=>AZ.str`must match "${$.ifClause}" schema`,params:({params:$})=>AZ._`{failingKeyword: ${$.ifClause}}`},ny={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:iy,code($){let{gen:Z,parentSchema:X,it:Q}=$;if(X.then===void 0&&X.else===void 0)(0,iL.checkStrictMode)(Q,'"if" without "then" and "else" is ignored');let J=pL(Q,"then"),G=pL(Q,"else");if(!J&&!G)return;let W=Z.let("valid",!0),Y=Z.name("_valid");if(z(),$.reset(),J&&G){let H=Z.let("ifClause");$.setParams({ifClause:H}),Z.if(Y,q("then",H),q("else",H))}else if(J)Z.if(Y,q("then"));else Z.if((0,AZ.not)(Y),q("else"));$.pass(W,()=>$.error(!0));function z(){let H=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Y);$.mergeEvaluated(H)}function q(H,B){return()=>{let F=$.subschema({keyword:H},Y);if(Z.assign(W,Y),$.mergeValidEvaluated(F,W),B)Z.assign(B,AZ._`${H}`);else $.setParams({ifClause:H})}}}};function pL($,Z){let X=$.schema[Z];return X!==void 0&&!(0,iL.alwaysValidSchema)($,X)}nL.default=ny});var oL=x((aL)=>{Object.defineProperty(aL,"__esModule",{value:!0});var ay=R0(),oy={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:Z,it:X}){if(Z.if===void 0)(0,ay.checkStrictMode)(X,`"${$}" without "if" is ignored`)}};aL.default=oy});var qJ=x((sL)=>{Object.defineProperty(sL,"__esModule",{value:!0});var ty=JJ(),ey=VL(),$v=GJ(),Zv=LL(),Xv=AL(),Qv=VZ(),Jv=EL(),Gv=YJ(),Wv=_L(),Yv=vL(),zv=fL(),qv=uL(),Uv=dL(),Kv=cL(),Hv=rL(),Vv=oL();function Bv($=!1){let Z=[zv.default,qv.default,Uv.default,Kv.default,Hv.default,Vv.default,Jv.default,Gv.default,Qv.default,Wv.default,Yv.default];if($)Z.push(ey.default,Zv.default);else Z.push(ty.default,$v.default);return Z.push(Xv.default),Z}sL.default=Bv});var KJ=x(($M)=>{Object.defineProperty($M,"__esModule",{value:!0});$M.dynamicAnchor=void 0;var UJ=D0(),Lv=Q6(),tL=$5(),Mv=YZ(),Av={keyword:"$dynamicAnchor",schemaType:"string",code:($)=>eL($,$.schema)};function eL($,Z){let{gen:X,it:Q}=$;Q.schemaEnv.root.dynamicAnchors[Z]=!0;let J=UJ._`${Lv.default.dynamicAnchors}${(0,UJ.getProperty)(Z)}`,G=Q.errSchemaPath==="#"?Q.validateName:Iv($);X.if(UJ._`!${J}`,()=>X.assign(J,G))}$M.dynamicAnchor=eL;function Iv($){let{schemaEnv:Z,schema:X,self:Q}=$.it,{root:J,baseId:G,localRefs:W,meta:Y}=Z.root,{schemaId:z}=Q.opts,q=new tL.SchemaEnv({schema:X,schemaId:z,root:J,baseId:G,localRefs:W,meta:Y});return tL.compileSchema.call(Q,q),(0,Mv.getValidate)($,q)}$M.default=Av});var HJ=x((GM)=>{Object.defineProperty(GM,"__esModule",{value:!0});GM.dynamicRef=void 0;var XM=D0(),Dv=Q6(),QM=YZ(),wv={keyword:"$dynamicRef",schemaType:"string",code:($)=>JM($,$.schema)};function JM($,Z){let{gen:X,keyword:Q,it:J}=$;if(Z[0]!=="#")throw Error(`"${Q}" only supports hash fragment reference`);let G=Z.slice(1);if(J.allErrors)W();else{let z=X.let("valid",!1);W(z),$.ok(z)}function W(z){if(J.schemaEnv.root.dynamicAnchors[G]){let q=X.let("_v",XM._`${Dv.default.dynamicAnchors}${(0,XM.getProperty)(G)}`);X.if(q,Y(q,z),Y(J.validateName,z))}else Y(J.validateName,z)()}function Y(z,q){return q?()=>X.block(()=>{(0,QM.callRef)($,z),X.let(q,!0)}):()=>(0,QM.callRef)($,z)}}GM.dynamicRef=JM;GM.default=wv});var zM=x((YM)=>{Object.defineProperty(YM,"__esModule",{value:!0});var jv=KJ(),Ov=R0(),Ev={keyword:"$recursiveAnchor",schemaType:"boolean",code($){if($.schema)(0,jv.dynamicAnchor)($,"");else(0,Ov.checkStrictMode)($.it,"$recursiveAnchor: false is ignored")}};YM.default=Ev});var UM=x((qM)=>{Object.defineProperty(qM,"__esModule",{value:!0});var Pv=HJ(),Cv={keyword:"$recursiveRef",schemaType:"string",code:($)=>(0,Pv.dynamicRef)($,$.schema)};qM.default=Cv});var HM=x((KM)=>{Object.defineProperty(KM,"__esModule",{value:!0});var _v=KJ(),xv=HJ(),bv=zM(),kv=UM(),yv=[_v.default,xv.default,bv.default,kv.default];KM.default=yv});var FM=x((BM)=>{Object.defineProperty(BM,"__esModule",{value:!0});var VM=VZ(),gv={keyword:"dependentRequired",type:"object",schemaType:"object",error:VM.error,code:($)=>(0,VM.validatePropertyDeps)($)};BM.default=gv});var MM=x((LM)=>{Object.defineProperty(LM,"__esModule",{value:!0});var hv=VZ(),uv={keyword:"dependentSchemas",type:"object",schemaType:"object",code:($)=>(0,hv.validateSchemaDeps)($)};LM.default=uv});var IM=x((AM)=>{Object.defineProperty(AM,"__esModule",{value:!0});var dv=R0(),lv={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:$,parentSchema:Z,it:X}){if(Z.contains===void 0)(0,dv.checkStrictMode)(X,`"${$}" without "contains" is ignored`)}};AM.default=lv});var DM=x((NM)=>{Object.defineProperty(NM,"__esModule",{value:!0});var pv=FM(),iv=MM(),nv=IM(),rv=[pv.default,iv.default,nv.default];NM.default=rv});var jM=x((TM)=>{Object.defineProperty(TM,"__esModule",{value:!0});var b1=D0(),wM=R0(),ov=Q6(),sv={message:"must NOT have unevaluated properties",params:({params:$})=>b1._`{unevaluatedProperty: ${$.unevaluatedProperty}}`},tv={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:sv,code($){let{gen:Z,schema:X,data:Q,errsCount:J,it:G}=$;if(!J)throw Error("ajv implementation error");let{allErrors:W,props:Y}=G;if(Y instanceof b1.Name)Z.if(b1._`${Y} !== true`,()=>Z.forIn("key",Q,(B)=>Z.if(q(Y,B),()=>z(B))));else if(Y!==!0)Z.forIn("key",Q,(B)=>Y===void 0?z(B):Z.if(H(Y,B),()=>z(B)));G.props=!0,$.ok(b1._`${J} === ${ov.default.errors}`);function z(B){if(X===!1){if($.setParams({unevaluatedProperty:B}),$.error(),!W)Z.break();return}if(!(0,wM.alwaysValidSchema)(G,X)){let F=Z.name("valid");if($.subschema({keyword:"unevaluatedProperties",dataProp:B,dataPropType:wM.Type.Str},F),!W)Z.if((0,b1.not)(F),()=>Z.break())}}function q(B,F){return b1._`!${B} || !${B}[${F}]`}function H(B,F){let M=[];for(let A in B)if(B[A]===!0)M.push(b1._`${F} !== ${A}`);return(0,b1.and)(...M)}}};TM.default=tv});var RM=x((EM)=>{Object.defineProperty(EM,"__esModule",{value:!0});var Y4=D0(),OM=R0(),$g={message:({params:{len:$}})=>Y4.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>Y4._`{limit: ${$}}`},Zg={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:$g,code($){let{gen:Z,schema:X,data:Q,it:J}=$,G=J.items||0;if(G===!0)return;let W=Z.const("len",Y4._`${Q}.length`);if(X===!1)$.setParams({len:G}),$.fail(Y4._`${W} > ${G}`);else if(typeof X=="object"&&!(0,OM.alwaysValidSchema)(J,X)){let z=Z.var("valid",Y4._`${W} <= ${G}`);Z.if((0,Y4.not)(z),()=>Y(z,G)),$.ok(z)}J.items=!0;function Y(z,q){Z.forRange("i",q,W,(H)=>{if($.subschema({keyword:"unevaluatedItems",dataProp:H,dataPropType:OM.Type.Num},z),!J.allErrors)Z.if((0,Y4.not)(z),()=>Z.break())})}}};EM.default=Zg});var CM=x((PM)=>{Object.defineProperty(PM,"__esModule",{value:!0});var Qg=jM(),Jg=RM(),Gg=[Qg.default,Jg.default];PM.default=Gg});var _M=x((SM)=>{Object.defineProperty(SM,"__esModule",{value:!0});var o0=D0(),Yg={message:({schemaCode:$})=>o0.str`must match format "${$}"`,params:({schemaCode:$})=>o0._`{format: ${$}}`},zg={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Yg,code($,Z){let{gen:X,data:Q,$data:J,schema:G,schemaCode:W,it:Y}=$,{opts:z,errSchemaPath:q,schemaEnv:H,self:B}=Y;if(!z.validateFormats)return;if(J)F();else M();function F(){let A=X.scopeValue("formats",{ref:B.formats,code:z.code.formats}),w=X.const("fDef",o0._`${A}[${W}]`),D=X.let("fType"),j=X.let("format");X.if(o0._`typeof ${w} == "object" && !(${w} instanceof RegExp)`,()=>X.assign(D,o0._`${w}.type || "string"`).assign(j,o0._`${w}.validate`),()=>X.assign(D,o0._`"string"`).assign(j,w)),$.fail$data((0,o0.or)(R(),P()));function R(){if(z.strictSchema===!1)return o0.nil;return o0._`${W} && !${j}`}function P(){let E=H.$async?o0._`(${w}.async ? await ${j}(${Q}) : ${j}(${Q}))`:o0._`${j}(${Q})`,C=o0._`(typeof ${j} == "function" ? ${E} : ${j}.test(${Q}))`;return o0._`${j} && ${j} !== true && ${D} === ${Z} && !${C}`}}function M(){let A=B.formats[G];if(!A){R();return}if(A===!0)return;let[w,D,j]=P(A);if(w===Z)$.pass(E());function R(){if(z.strictSchema===!1){B.logger.warn(C());return}throw Error(C());function C(){return`unknown format "${G}" ignored in schema at path "${q}"`}}function P(C){let y=C instanceof RegExp?(0,o0.regexpCode)(C):z.code.formats?o0._`${z.code.formats}${(0,o0.getProperty)(G)}`:void 0,v=X.scopeValue("formats",{key:G,ref:C,code:y});if(typeof C=="object"&&!(C instanceof RegExp))return[C.type||"string",C.validate,o0._`${v}.validate`];return["string",C,v]}function E(){if(typeof A=="object"&&!(A instanceof RegExp)&&A.async){if(!H.$async)throw Error("async format in sync schema");return o0._`await ${j}(${Q})`}return typeof D=="function"?o0._`${j}(${Q})`:o0._`${j}.test(${Q})`}}}};SM.default=zg});var VJ=x((xM)=>{Object.defineProperty(xM,"__esModule",{value:!0});var Ug=_M(),Kg=[Ug.default];xM.default=Kg});var BJ=x((bM)=>{Object.defineProperty(bM,"__esModule",{value:!0});bM.contentVocabulary=bM.metadataVocabulary=void 0;bM.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];bM.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var gM=x((vM)=>{Object.defineProperty(vM,"__esModule",{value:!0});var Bg=eQ(),Fg=XJ(),Lg=qJ(),Mg=HM(),Ag=DM(),Ig=CM(),Ng=VJ(),yM=BJ(),Dg=[Mg.default,Bg.default,Fg.default,(0,Lg.default)(!0),Ng.default,yM.metadataVocabulary,yM.contentVocabulary,Ag.default,Ig.default];vM.default=Dg});var mM=x((hM)=>{Object.defineProperty(hM,"__esModule",{value:!0});hM.DiscrError=void 0;var fM;(function($){$.Tag="tag",$.Mapping="mapping"})(fM||(hM.DiscrError=fM={}))});var LJ=x((lM)=>{Object.defineProperty(lM,"__esModule",{value:!0});var s4=D0(),FJ=mM(),dM=$5(),Tg=i4(),jg=R0(),Og={message:({params:{discrError:$,tagName:Z}})=>$===FJ.DiscrError.Tag?`tag "${Z}" must be string`:`value of tag "${Z}" must be in oneOf`,params:({params:{discrError:$,tag:Z,tagName:X}})=>s4._`{error: ${$}, tag: ${X}, tagValue: ${Z}}`},Eg={keyword:"discriminator",type:"object",schemaType:"object",error:Og,code($){let{gen:Z,data:X,schema:Q,parentSchema:J,it:G}=$,{oneOf:W}=J;if(!G.opts.discriminator)throw Error("discriminator: requires discriminator option");let Y=Q.propertyName;if(typeof Y!="string")throw Error("discriminator: requires propertyName");if(Q.mapping)throw Error("discriminator: mapping is not supported");if(!W)throw Error("discriminator: requires oneOf keyword");let z=Z.let("valid",!1),q=Z.const("tag",s4._`${X}${(0,s4.getProperty)(Y)}`);Z.if(s4._`typeof ${q} == "string"`,()=>H(),()=>$.error(!1,{discrError:FJ.DiscrError.Tag,tag:q,tagName:Y})),$.ok(z);function H(){let M=F();Z.if(!1);for(let A in M)Z.elseIf(s4._`${q} === ${A}`),Z.assign(z,B(M[A]));Z.else(),$.error(!1,{discrError:FJ.DiscrError.Mapping,tag:q,tagName:Y}),Z.endIf()}function B(M){let A=Z.name("valid"),w=$.subschema({keyword:"oneOf",schemaProp:M},A);return $.mergeEvaluated(w,s4.Name),A}function F(){var M;let A={},w=j(J),D=!0;for(let E=0;E<W.length;E++){let C=W[E];if((C===null||C===void 0?void 0:C.$ref)&&!(0,jg.schemaHasRulesButRef)(C,G.self.RULES)){let v=C.$ref;if(C=dM.resolveRef.call(G.self,G.schemaEnv.root,G.baseId,v),C instanceof dM.SchemaEnv)C=C.schema;if(C===void 0)throw new Tg.default(G.opts.uriResolver,G.baseId,v)}let y=(M=C===null||C===void 0?void 0:C.properties)===null||M===void 0?void 0:M[Y];if(typeof y!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${Y}"`);D=D&&(w||j(C)),R(y,E)}if(!D)throw Error(`discriminator: "${Y}" must be required`);return A;function j({required:E}){return Array.isArray(E)&&E.includes(Y)}function R(E,C){if(E.const)P(E.const,C);else if(E.enum)for(let y of E.enum)P(y,C);else throw Error(`discriminator: "properties/${Y}" must have "const" or "enum"`)}function P(E,C){if(typeof E!="string"||E in A)throw Error(`discriminator: "${Y}" values must be unique strings`);A[E]=C}}}};lM.default=Eg});var cM=x((Gr,Pg)=>{Pg.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 pM=x((Wr,Cg)=>{Cg.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 iM=x((Yr,Sg)=>{Sg.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 nM=x((zr,_g)=>{_g.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 rM=x((qr,xg)=>{xg.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 aM=x((Ur,bg)=>{bg.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 oM=x((Kr,kg)=>{kg.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 sM=x((Hr,yg)=>{yg.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 eM=x((tM)=>{Object.defineProperty(tM,"__esModule",{value:!0});var vg=cM(),gg=pM(),fg=iM(),hg=nM(),ug=rM(),mg=aM(),dg=oM(),lg=sM(),cg=["/properties"];function pg($){return[vg,gg,fg,hg,ug,Z(this,mg),dg,Z(this,lg)].forEach((X)=>this.addMetaSchema(X,void 0,!1)),this;function Z(X,Q){return $?X.$dataMetaSchema(Q,cg):Q}}tM.default=pg});var IJ=x((y$,AJ)=>{Object.defineProperty(y$,"__esModule",{value:!0});y$.MissingRefError=y$.ValidationError=y$.CodeGen=y$.Name=y$.nil=y$.stringify=y$.str=y$._=y$.KeywordCxt=y$.Ajv2020=void 0;var ng=tQ(),rg=gM(),ag=LJ(),og=eM(),MJ="https://json-schema.org/draft/2020-12/schema";class K5 extends ng.default{constructor($={}){super({...$,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),rg.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(ag.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:$,meta:Z}=this.opts;if(!Z)return;og.default.call(this,$),this.refs["http://json-schema.org/schema"]=MJ}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(MJ)?MJ:void 0)}}y$.Ajv2020=K5;AJ.exports=y$=K5;AJ.exports.Ajv2020=K5;Object.defineProperty(y$,"__esModule",{value:!0});y$.default=K5;var sg=p4();Object.defineProperty(y$,"KeywordCxt",{enumerable:!0,get:function(){return sg.KeywordCxt}});var t4=D0();Object.defineProperty(y$,"_",{enumerable:!0,get:function(){return t4._}});Object.defineProperty(y$,"str",{enumerable:!0,get:function(){return t4.str}});Object.defineProperty(y$,"stringify",{enumerable:!0,get:function(){return t4.stringify}});Object.defineProperty(y$,"nil",{enumerable:!0,get:function(){return t4.nil}});Object.defineProperty(y$,"Name",{enumerable:!0,get:function(){return t4.Name}});Object.defineProperty(y$,"CodeGen",{enumerable:!0,get:function(){return t4.CodeGen}});var tg=t9();Object.defineProperty(y$,"ValidationError",{enumerable:!0,get:function(){return tg.default}});var eg=i4();Object.defineProperty(y$,"MissingRefError",{enumerable:!0,get:function(){return eg.default}})});import{existsSync as NZ,readFileSync as H5}from"node:fs";import{createRequire as $A}from"node:module";import{isAbsolute as Xf,relative as Qf,resolve as IZ}from"node:path";import{fileURLToPath as ZA,pathToFileURL as Jf}from"node:url";async function XA($){let Z=IZ($),X=IZ(Z,"project.json"),Q=IZ(Z,"project.schema.json");if(!NZ(X))throw Error(`project.json not found in ${Z}`);if(!NZ(Q))throw Error(`project.schema.json not found in ${Z} — run \`jx schema\` to generate it from `+"project.json#/extensions");let J=JSON.parse(H5(X,"utf8")),G=JSON.parse(H5(Q,"utf8"));G.$id=Jf(Q).href;let W;try{({default:W}=await Promise.resolve().then(() => B$(IJ(),1)))}catch(H){throw Error("Project validation requires ajv: bun add ajv",{cause:H})}let z=await new W({allErrors:!0,loadSchema:(H)=>Gf(H,Z),strict:!1}).compileAsync(G),q=z(J);return{errors:z.errors??null,valid:q}}async function Gf($,Z){if(!$.startsWith("file:"))throw Error(`Cannot resolve schema ref "${$}": only project-relative file refs are loadable (canonical URIs must resolve from already-loaded fragments)`);let X=ZA($),Q=Qf(Z,X);if(Q.startsWith("..")||Xf(Q))throw Error(`Schema ref "${$}" escapes the project root ${Z}`);if(NZ(X))return JSON.parse(H5(X,"utf8"));let J=Q.split("\\").join("/"),G="node_modules/",W=J.lastIndexOf(G);if(W===-1)throw Error(`Schema ref "${$}" does not exist`);let Y=J.slice(W+G.length),z;try{z=$A(IZ(Z,"package.json")).resolve(Y)}catch{try{z=$A(import.meta.url).resolve(Y)}catch(q){if(Y.startsWith("@jxsuite/schema/")){let B=ZA(new URL(`../${Y.slice(16)}`,import.meta.url));if(NZ(B))return JSON.parse(H5(B,"utf8"))}throw Error(`Schema ref "${$}" does not exist and "${Y}" is not resolvable from the project or the host`,{cause:q})}}return JSON.parse(H5(z,"utf8"))}var QA=()=>{};var VA=x((KA)=>{Object.defineProperty(KA,"__esModule",{value:!0});KA.formatNames=KA.fastFormats=KA.fullFormats=void 0;function v6($,Z){return{validate:$,compare:Z}}KA.fullFormats={date:v6(YA,TJ),time:v6(DJ(!0),jJ),"date-time":v6(JA(!0),qA),"iso-time":v6(DJ(),zA),"iso-date-time":v6(JA(),UA),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:Kf,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:Af,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:Hf,int32:{type:"number",validate:Ff},int64:{type:"number",validate:Lf},float:{type:"number",validate:WA},double:{type:"number",validate:WA},password:!0,binary:!0};KA.fastFormats={...KA.fullFormats,date:v6(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,TJ),time:v6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,jJ),"date-time":v6(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,qA),"iso-time":v6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,zA),"iso-date-time":v6(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,UA),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};KA.formatNames=Object.keys(KA.fullFormats);function Wf($){return $%4===0&&($%100!==0||$%400===0)}var Yf=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,zf=[0,31,28,31,30,31,30,31,31,30,31,30,31];function YA($){let Z=Yf.exec($);if(!Z)return!1;let X=+Z[1],Q=+Z[2],J=+Z[3];return Q>=1&&Q<=12&&J>=1&&J<=(Q===2&&Wf(X)?29:zf[Q])}function TJ($,Z){if(!($&&Z))return;if($>Z)return 1;if($<Z)return-1;return 0}var NJ=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function DJ($){return function(X){let Q=NJ.exec(X);if(!Q)return!1;let J=+Q[1],G=+Q[2],W=+Q[3],Y=Q[4],z=Q[5]==="-"?-1:1,q=+(Q[6]||0),H=+(Q[7]||0);if(q>23||H>59||$&&!Y)return!1;if(J<=23&&G<=59&&W<60)return!0;let B=G-H*z,F=J-q*z-(B<0?1:0);return(F===23||F===-1)&&(B===59||B===-1)&&W<61}}function jJ($,Z){if(!($&&Z))return;let X=new Date("2020-01-01T"+$).valueOf(),Q=new Date("2020-01-01T"+Z).valueOf();if(!(X&&Q))return;return X-Q}function zA($,Z){if(!($&&Z))return;let X=NJ.exec($),Q=NJ.exec(Z);if(!(X&&Q))return;if($=X[1]+X[2]+X[3],Z=Q[1]+Q[2]+Q[3],$>Z)return 1;if($<Z)return-1;return 0}var wJ=/t|\s/i;function JA($){let Z=DJ($);return function(Q){let J=Q.split(wJ);return J.length===2&&YA(J[0])&&Z(J[1])}}function qA($,Z){if(!($&&Z))return;let X=new Date($).valueOf(),Q=new Date(Z).valueOf();if(!(X&&Q))return;return X-Q}function UA($,Z){if(!($&&Z))return;let[X,Q]=$.split(wJ),[J,G]=Z.split(wJ),W=TJ(X,J);if(W===void 0)return;return W||jJ(Q,G)}var qf=/\/|:/,Uf=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Kf($){return qf.test($)&&Uf.test($)}var GA=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Hf($){return GA.lastIndex=0,GA.test($)}var Vf=-2147483648,Bf=2147483647;function Ff($){return Number.isInteger($)&&$<=Bf&&$>=Vf}function Lf($){return Number.isInteger($)}function WA(){return!0}var Mf=/[^\\]\\Z/;function Af($){if(Mf.test($))return!1;try{return new RegExp($),!0}catch(Z){return!1}}});var LA=x((FA)=>{Object.defineProperty(FA,"__esModule",{value:!0});var Nf=eQ(),Df=XJ(),wf=qJ(),Tf=VJ(),BA=BJ(),jf=[Nf.default,Df.default,(0,wf.default)(),Tf.default,BA.metadataVocabulary,BA.contentVocabulary];FA.default=jf});var MA=x((Cr,Ef)=>{Ef.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var IA=x((v$,EJ)=>{Object.defineProperty(v$,"__esModule",{value:!0});v$.MissingRefError=v$.ValidationError=v$.CodeGen=v$.Name=v$.nil=v$.stringify=v$.str=v$._=v$.KeywordCxt=v$.Ajv=void 0;var Rf=tQ(),Pf=LA(),Cf=LJ(),AA=MA(),Sf=["/properties"],DZ="http://json-schema.org/draft-07/schema";class V5 extends Rf.default{_addVocabularies(){if(super._addVocabularies(),Pf.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(Cf.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(AA,Sf):AA;this.addMetaSchema($,DZ,!1),this.refs["http://json-schema.org/schema"]=DZ}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(DZ)?DZ:void 0)}}v$.Ajv=V5;EJ.exports=v$=V5;EJ.exports.Ajv=V5;Object.defineProperty(v$,"__esModule",{value:!0});v$.default=V5;var _f=p4();Object.defineProperty(v$,"KeywordCxt",{enumerable:!0,get:function(){return _f.KeywordCxt}});var e4=D0();Object.defineProperty(v$,"_",{enumerable:!0,get:function(){return e4._}});Object.defineProperty(v$,"str",{enumerable:!0,get:function(){return e4.str}});Object.defineProperty(v$,"stringify",{enumerable:!0,get:function(){return e4.stringify}});Object.defineProperty(v$,"nil",{enumerable:!0,get:function(){return e4.nil}});Object.defineProperty(v$,"Name",{enumerable:!0,get:function(){return e4.Name}});Object.defineProperty(v$,"CodeGen",{enumerable:!0,get:function(){return e4.CodeGen}});var xf=t9();Object.defineProperty(v$,"ValidationError",{enumerable:!0,get:function(){return xf.default}});var bf=i4();Object.defineProperty(v$,"MissingRefError",{enumerable:!0,get:function(){return bf.default}})});var DA=x((NA)=>{Object.defineProperty(NA,"__esModule",{value:!0});NA.formatLimitDefinition=void 0;var vf=IA(),F6=D0(),k1=F6.operators,wZ={formatMaximum:{okStr:"<=",ok:k1.LTE,fail:k1.GT},formatMinimum:{okStr:">=",ok:k1.GTE,fail:k1.LT},formatExclusiveMaximum:{okStr:"<",ok:k1.LT,fail:k1.GTE},formatExclusiveMinimum:{okStr:">",ok:k1.GT,fail:k1.LTE}},gf={message:({keyword:$,schemaCode:Z})=>F6.str`should be ${wZ[$].okStr} ${Z}`,params:({keyword:$,schemaCode:Z})=>F6._`{comparison: ${wZ[$].okStr}, limit: ${Z}}`};NA.formatLimitDefinition={keyword:Object.keys(wZ),type:"string",schemaType:"string",$data:!0,error:gf,code($){let{gen:Z,data:X,schemaCode:Q,keyword:J,it:G}=$,{opts:W,self:Y}=G;if(!W.validateFormats)return;let z=new vf.KeywordCxt(G,Y.RULES.all.format.definition,"format");if(z.$data)q();else H();function q(){let F=Z.scopeValue("formats",{ref:Y.formats,code:W.code.formats}),M=Z.const("fmt",F6._`${F}[${z.schemaCode}]`);$.fail$data((0,F6.or)(F6._`typeof ${M} != "object"`,F6._`${M} instanceof RegExp`,F6._`typeof ${M}.compare != "function"`,B(M)))}function H(){let F=z.schema,M=Y.formats[F];if(!M||M===!0)return;if(typeof M!="object"||M instanceof RegExp||typeof M.compare!="function")throw Error(`"${J}": format "${F}" does not define "compare" function`);let A=Z.scopeValue("formats",{key:F,ref:M,code:W.code.formats?F6._`${W.code.formats}${(0,F6.getProperty)(F)}`:void 0});$.fail$data(B(A))}function B(F){return F6._`${F}.compare(${X}, ${Q}) ${wZ[J].fail} 0`}},dependencies:["format"]};var ff=($)=>{return $.addKeyword(NA.formatLimitDefinition),$};NA.default=ff});var OA=x((B5,jA)=>{Object.defineProperty(B5,"__esModule",{value:!0});var $9=VA(),uf=DA(),PJ=D0(),wA=new PJ.Name("fullFormats"),mf=new PJ.Name("fastFormats"),CJ=($,Z={keywords:!0})=>{if(Array.isArray(Z))return TA($,Z,$9.fullFormats,wA),$;let[X,Q]=Z.mode==="fast"?[$9.fastFormats,mf]:[$9.fullFormats,wA],J=Z.formats||$9.formatNames;if(TA($,J,X,Q),Z.keywords)(0,uf.default)($);return $};CJ.get=($,Z="full")=>{let Q=(Z==="fast"?$9.fastFormats:$9.fullFormats)[$];if(!Q)throw Error(`Unknown format "${$}"`);return Q};function TA($,Z,X,Q){var J,G;(J=(G=$.opts.code).formats)!==null&&J!==void 0||(G.formats=PJ._`require("ajv-formats/dist/formats").${Q}`);for(let W of Z)$.addFormat(W,X[W])}jA.exports=B5=CJ;Object.defineProperty(B5,"__esModule",{value:!0});B5.default=CJ});var xA={};h6(xA,{validateProjectTree:()=>rf,formatProjectTreeIssues:()=>of});import{existsSync as RA,readFileSync as F5,readdirSync as PA,statSync as CA}from"node:fs";import{createRequire as df}from"node:module";import{join as SA,relative as EA,resolve as SJ}from"node:path";async function nf(){try{let{default:$}=await Promise.resolve().then(() => B$(IJ(),1)),{default:Z}=await Promise.resolve().then(() => B$(OA(),1));return{addFormats:Z,Ajv:$}}catch($){throw Error("Project validation requires ajv and ajv-formats: bun add ajv ajv-formats",{cause:$})}}async function rf($){let Z=SJ($),X=[],Q=0,J=await XA(Z);if(Q+=1,!J.valid)X.push({errors:J.errors??[],file:"project.json"});for(let w of["project.schema.json","document.schema.json"]){let D=SJ(Z,w);if(!RA(D))continue;Q+=1;let j=[];if(_J(JSON.parse(F5(D,"utf8")),j),j.length>0)X.push({errors:j.map((R)=>({message:`relative $ref "${R}" — committed entry documents must be self-contained; `+"regenerate with `jx schema`"})),file:w})}let{addFormats:G,Ajv:W}=await nf(),{document:Y}=await eX(Z),z=new W({allErrors:!0,ownProperties:!0,strict:!1});G(z);let q=z.compile(Y);for(let w of lf)for(let D of _A(SJ(Z,w))){if(D.endsWith(".class.json"))continue;Q+=1;let j=JSON.parse(F5(D,"utf8"));if(!q(j))X.push({errors:q.errors??[],file:EA(Z,D)})}let H=new W({allErrors:!0,ownProperties:!0,strict:!1});G(H);let B=H.compile(VQ());for(let w of af(Z)){Q+=1;let D=JSON.parse(F5(w,"utf8"));if(!B(D))X.push({errors:B.errors??[],file:EA(Z,w)})}let{config:F}=N1(Z),M=await E6(Z,F),A=df(import.meta.url);for(let w of M.extensions)for(let D of["project","document","fields"]){let j=w.schemas[D];if(!j)continue;Q+=1;let R=new W({allErrors:!0,ownProperties:!0,strict:!1});G(R);for(let P of pf){let E=A.resolve(P),C=JSON.parse(F5(E,"utf8"));R.addSchema(C)}try{R.compile(JSON.parse(F5(j,"utf8")))}catch(P){X.push({errors:[{message:P instanceof Error?P.message:String(P)}],file:`${w.specifier} (${D} fragment)`})}}return{checked:Q,issues:X,valid:X.length===0}}function _J($,Z){if(Array.isArray($)){for(let X of $)_J(X,Z);return}if($===null||typeof $!=="object")return;for(let[X,Q]of Object.entries($)){if(X==="$ref"&&typeof Q==="string"&&!Q.startsWith("#")&&!/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(Q))Z.push(Q);_J(Q,Z)}}function _A($){if(!RA($))return[];let Z=[];for(let X of PA($)){let Q=SA($,X);if(CA(Q).isDirectory())Z.push(..._A(Q));else if(X.endsWith(".json"))Z.push(Q)}return Z.toSorted()}function af($){let Z=[],X=(Q)=>{for(let J of PA(Q)){if(cf.has(J))continue;let G=SA(Q,J);if(CA(G).isDirectory())X(G);else if(J.endsWith(".class.json"))Z.push(G)}};return X($),Z.toSorted()}function of($){let Z=[];for(let X of $.issues){Z.push(`${X.file}:`);for(let Q of X.errors){let{instancePath:J,message:G}=Q??{};Z.push(` - ${J||"/"}: ${G??JSON.stringify(Q)}`)}}return Z}var lf,cf,pf;var bA=s(()=>{Q3();QA();p6();I9();$Q();lf=["components","pages","layouts"],cf=new Set(["node_modules","dist",".git"]),pf=["@jxsuite/schema/schemas/project.core.schema.json","@jxsuite/schema/schemas/project.fields.schema.json","@jxsuite/schema/schemas/document.paths.schema.json"]});import{relative as xJ,resolve as kA}from"node:path";async function sf(){let $=process.argv.slice(2),[Z]=$;if(!Z||Z==="--help"||Z==="-h")console.log(`Usage: jx <command> [options]
|
|
395
|
+
deps: ${X}}`};var gy={keyword:"dependencies",type:"object",schemaType:"object",error:_L.error,code($){let[Z,X]=fy($);CL($,Z),SL($,X)}};function fy({schema:$}){let Z={},X={};for(let Q in $){if(Q==="__proto__")continue;let J=Array.isArray($[Q])?Z:X;J[Q]=$[Q]}return[Z,X]}function CL($,Z=$.schema){let{gen:X,data:Q,it:J}=$;if(Object.keys(Z).length===0)return;let G=X.let("missing");for(let W in Z){let Y=Z[W];if(Y.length===0)continue;let z=(0,A8.propertyInData)(X,Q,W,J.opts.ownProperties);if($.setParams({property:W,depsCount:Y.length,deps:Y.join(", ")}),J.allErrors)X.if(z,()=>{for(let q of Y)(0,A8.checkReportMissingProp)($,q)});else X.if(MJ._`${z} && (${(0,A8.checkMissingProp)($,Y,G)})`),(0,A8.reportMissingProp)($,G),X.else()}}_L.validatePropertyDeps=CL;function SL($,Z=$.schema){let{gen:X,data:Q,keyword:J,it:G}=$,W=X.name("valid");for(let Y in Z){if((0,vy.alwaysValidSchema)(G,Z[Y]))continue;X.if((0,A8.propertyInData)(X,Q,Y,G.opts.ownProperties),()=>{let z=$.subschema({keyword:J,schemaProp:Y},W);$.mergeValidEvaluated(z,W)},()=>X.var(W,!0)),$.ok(W)}}_L.validateSchemaDeps=SL;_L.default=gy});var vL=b((yL)=>{Object.defineProperty(yL,"__esModule",{value:!0});var kL=N0(),my=P0(),dy={message:"property name must be valid",params:({params:$})=>kL._`{propertyName: ${$.propertyName}}`},ly={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:dy,code($){let{gen:Z,schema:X,data:Q,it:J}=$;if((0,my.alwaysValidSchema)(J,X))return;let G=Z.name("valid");Z.forIn("key",Q,(W)=>{$.setParams({propertyName:W}),$.subschema({keyword:"propertyNames",data:W,dataTypes:["string"],propertyName:W,compositeRule:!0},G),Z.if((0,kL.not)(G),()=>{if($.error(!0),!J.allErrors)Z.break()})}),$.ok(G)}};yL.default=ly});var AJ=b((gL)=>{Object.defineProperty(gL,"__esModule",{value:!0});var jZ=G1(),F1=N0(),py=J1(),OZ=P0(),iy={message:"must NOT have additional properties",params:({params:$})=>F1._`{additionalProperty: ${$.additionalProperty}}`},ny={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:iy,code($){let{gen:Z,schema:X,parentSchema:Q,data:J,errsCount:G,it:W}=$;if(!G)throw Error("ajv implementation error");let{allErrors:Y,opts:z}=W;if(W.props=!0,z.removeAdditional!=="all"&&(0,OZ.alwaysValidSchema)(W,X))return;let q=(0,jZ.allSchemaProperties)(Q.properties),H=(0,jZ.allSchemaProperties)(Q.patternProperties);B(),$.ok(F1._`${G} === ${py.default.errors}`);function B(){Z.forIn("key",J,(I)=>{if(!q.length&&!H.length)w(I);else Z.if(F(I),()=>w(I))})}function F(I){let T;if(q.length>8){let E=(0,OZ.schemaRefOrVal)(W,Q.properties,"properties");T=(0,jZ.isOwnProperty)(Z,E,I)}else if(q.length)T=(0,F1.or)(...q.map((E)=>F1._`${I} === ${E}`));else T=F1.nil;if(H.length)T=(0,F1.or)(T,...H.map((E)=>F1._`${(0,jZ.usePattern)($,E)}.test(${I})`));return(0,F1.not)(T)}function L(I){Z.code(F1._`delete ${J}[${I}]`)}function w(I){if(z.removeAdditional==="all"||z.removeAdditional&&X===!1){L(I);return}if(X===!1){if($.setParams({additionalProperty:I}),$.error(),!Y)Z.break();return}if(typeof X=="object"&&!(0,OZ.alwaysValidSchema)(W,X)){let T=Z.name("valid");if(z.removeAdditional==="failing")N(I,T,!1),Z.if((0,F1.not)(T),()=>{$.reset(),L(I)});else if(N(I,T),!Y)Z.if((0,F1.not)(T),()=>Z.break())}}function N(I,T,E){let P={keyword:"additionalProperties",dataProp:I,dataPropType:OZ.Type.Str};if(E===!1)Object.assign(P,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(P,T)}}};gL.default=ny});var mL=b((uL)=>{Object.defineProperty(uL,"__esModule",{value:!0});var ay=s4(),fL=G1(),IJ=P0(),hL=AJ(),oy={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:Z,schema:X,parentSchema:Q,data:J,it:G}=$;if(G.opts.removeAdditional==="all"&&Q.additionalProperties===void 0)hL.default.code(new ay.KeywordCxt(G,hL.default,"additionalProperties"));let W=(0,fL.allSchemaProperties)(X);for(let B of W)G.definedProperties.add(B);if(G.opts.unevaluated&&W.length&&G.props!==!0)G.props=IJ.mergeEvaluated.props(Z,(0,IJ.toHash)(W),G.props);let Y=W.filter((B)=>!(0,IJ.alwaysValidSchema)(G,X[B]));if(Y.length===0)return;let z=Z.name("valid");for(let B of Y){if(q(B))H(B);else{if(Z.if((0,fL.propertyInData)(Z,J,B,G.opts.ownProperties)),H(B),!G.allErrors)Z.else().var(z,!0);Z.endIf()}$.it.definedProperties.add(B),$.ok(z)}function q(B){return G.opts.useDefaults&&!G.compositeRule&&X[B].default!==void 0}function H(B){$.subschema({keyword:"properties",schemaProp:B,dataProp:B},z)}}};uL.default=oy});var iL=b((pL)=>{Object.defineProperty(pL,"__esModule",{value:!0});var dL=G1(),EZ=N0(),lL=P0(),cL=P0(),ty={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:Z,schema:X,data:Q,parentSchema:J,it:G}=$,{opts:W}=G,Y=(0,dL.allSchemaProperties)(X),z=Y.filter((N)=>(0,lL.alwaysValidSchema)(G,X[N]));if(Y.length===0||z.length===Y.length&&(!G.opts.unevaluated||G.props===!0))return;let q=W.strictSchema&&!W.allowMatchingProperties&&J.properties,H=Z.name("valid");if(G.props!==!0&&!(G.props instanceof EZ.Name))G.props=(0,cL.evaluatedPropsToName)(Z,G.props);let{props:B}=G;F();function F(){for(let N of Y){if(q)L(N);if(G.allErrors)w(N);else Z.var(H,!0),w(N),Z.if(H)}}function L(N){for(let I in q)if(new RegExp(N).test(I))(0,lL.checkStrictMode)(G,`property ${I} matches pattern ${N} (use allowMatchingProperties)`)}function w(N){Z.forIn("key",Q,(I)=>{Z.if(EZ._`${(0,dL.usePattern)($,N)}.test(${I})`,()=>{let T=z.includes(N);if(!T)$.subschema({keyword:"patternProperties",schemaProp:N,dataProp:I,dataPropType:cL.Type.Str},H);if(G.opts.unevaluated&&B!==!0)Z.assign(EZ._`${B}[${I}]`,!0);else if(!T&&!G.allErrors)Z.if((0,EZ.not)(H),()=>Z.break())})})}}};pL.default=ty});var rL=b((nL)=>{Object.defineProperty(nL,"__esModule",{value:!0});var $v=P0(),Zv={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:Z,schema:X,it:Q}=$;if((0,$v.alwaysValidSchema)(Q,X)){$.fail();return}let J=Z.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},J),$.failResult(J,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};nL.default=Zv});var oL=b((aL)=>{Object.defineProperty(aL,"__esModule",{value:!0});var Qv=G1(),Jv={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Qv.validateUnion,error:{message:"must match a schema in anyOf"}};aL.default=Jv});var tL=b((sL)=>{Object.defineProperty(sL,"__esModule",{value:!0});var RZ=N0(),Wv=P0(),Yv={message:"must match exactly one schema in oneOf",params:({params:$})=>RZ._`{passingSchemas: ${$.passing}}`},zv={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Yv,code($){let{gen:Z,schema:X,parentSchema:Q,it:J}=$;if(!Array.isArray(X))throw Error("ajv implementation error");if(J.opts.discriminator&&Q.discriminator)return;let G=X,W=Z.let("valid",!1),Y=Z.let("passing",null),z=Z.name("_valid");$.setParams({passing:Y}),Z.block(q),$.result(W,()=>$.reset(),()=>$.error(!0));function q(){G.forEach((H,B)=>{let F;if((0,Wv.alwaysValidSchema)(J,H))Z.var(z,!0);else F=$.subschema({keyword:"oneOf",schemaProp:B,compositeRule:!0},z);if(B>0)Z.if(RZ._`${z} && ${W}`).assign(W,!1).assign(Y,RZ._`[${Y}, ${B}]`).else();Z.if(z,()=>{if(Z.assign(W,!0),Z.assign(Y,B),F)$.mergeEvaluated(F,RZ.Name)})})}}};sL.default=zv});var $M=b((eL)=>{Object.defineProperty(eL,"__esModule",{value:!0});var Kv=P0(),Uv={keyword:"allOf",schemaType:"array",code($){let{gen:Z,schema:X,it:Q}=$;if(!Array.isArray(X))throw Error("ajv implementation error");let J=Z.name("valid");X.forEach((G,W)=>{if((0,Kv.alwaysValidSchema)(Q,G))return;let Y=$.subschema({keyword:"allOf",schemaProp:W},J);$.ok(J),$.mergeEvaluated(Y)})}};eL.default=Uv});var JM=b((QM)=>{Object.defineProperty(QM,"__esModule",{value:!0});var PZ=N0(),XM=P0(),Vv={message:({params:$})=>PZ.str`must match "${$.ifClause}" schema`,params:({params:$})=>PZ._`{failingKeyword: ${$.ifClause}}`},Bv={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Vv,code($){let{gen:Z,parentSchema:X,it:Q}=$;if(X.then===void 0&&X.else===void 0)(0,XM.checkStrictMode)(Q,'"if" without "then" and "else" is ignored');let J=ZM(Q,"then"),G=ZM(Q,"else");if(!J&&!G)return;let W=Z.let("valid",!0),Y=Z.name("_valid");if(z(),$.reset(),J&&G){let H=Z.let("ifClause");$.setParams({ifClause:H}),Z.if(Y,q("then",H),q("else",H))}else if(J)Z.if(Y,q("then"));else Z.if((0,PZ.not)(Y),q("else"));$.pass(W,()=>$.error(!0));function z(){let H=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Y);$.mergeEvaluated(H)}function q(H,B){return()=>{let F=$.subschema({keyword:H},Y);if(Z.assign(W,Y),$.mergeValidEvaluated(F,W),B)Z.assign(B,PZ._`${H}`);else $.setParams({ifClause:H})}}}};function ZM($,Z){let X=$.schema[Z];return X!==void 0&&!(0,XM.alwaysValidSchema)($,X)}QM.default=Bv});var WM=b((GM)=>{Object.defineProperty(GM,"__esModule",{value:!0});var Lv=P0(),Mv={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:Z,it:X}){if(Z.if===void 0)(0,Lv.checkStrictMode)(X,`"${$}" without "if" is ignored`)}};GM.default=Mv});var NJ=b((YM)=>{Object.defineProperty(YM,"__esModule",{value:!0});var Iv=FJ(),Nv=TL(),Dv=LJ(),wv=EL(),Tv=PL(),jv=TZ(),Ov=vL(),Ev=AJ(),Rv=mL(),Pv=iL(),Cv=rL(),Sv=oL(),_v=tL(),bv=$M(),xv=JM(),kv=WM();function yv($=!1){let Z=[Cv.default,Sv.default,_v.default,bv.default,xv.default,kv.default,Ov.default,Ev.default,jv.default,Rv.default,Pv.default];if($)Z.push(Nv.default,wv.default);else Z.push(Iv.default,Dv.default);return Z.push(Tv.default),Z}YM.default=yv});var wJ=b((KM)=>{Object.defineProperty(KM,"__esModule",{value:!0});KM.dynamicAnchor=void 0;var DJ=N0(),gv=J1(),zM=z8(),fv=MZ(),hv={keyword:"$dynamicAnchor",schemaType:"string",code:($)=>qM($,$.schema)};function qM($,Z){let{gen:X,it:Q}=$;Q.schemaEnv.root.dynamicAnchors[Z]=!0;let J=DJ._`${gv.default.dynamicAnchors}${(0,DJ.getProperty)(Z)}`,G=Q.errSchemaPath==="#"?Q.validateName:uv($);X.if(DJ._`!${J}`,()=>X.assign(J,G))}KM.dynamicAnchor=qM;function uv($){let{schemaEnv:Z,schema:X,self:Q}=$.it,{root:J,baseId:G,localRefs:W,meta:Y}=Z.root,{schemaId:z}=Q.opts,q=new zM.SchemaEnv({schema:X,schemaId:z,root:J,baseId:G,localRefs:W,meta:Y});return zM.compileSchema.call(Q,q),(0,fv.getValidate)($,q)}KM.default=hv});var TJ=b((FM)=>{Object.defineProperty(FM,"__esModule",{value:!0});FM.dynamicRef=void 0;var HM=N0(),dv=J1(),VM=MZ(),lv={keyword:"$dynamicRef",schemaType:"string",code:($)=>BM($,$.schema)};function BM($,Z){let{gen:X,keyword:Q,it:J}=$;if(Z[0]!=="#")throw Error(`"${Q}" only supports hash fragment reference`);let G=Z.slice(1);if(J.allErrors)W();else{let z=X.let("valid",!1);W(z),$.ok(z)}function W(z){if(J.schemaEnv.root.dynamicAnchors[G]){let q=X.let("_v",HM._`${dv.default.dynamicAnchors}${(0,HM.getProperty)(G)}`);X.if(q,Y(q,z),Y(J.validateName,z))}else Y(J.validateName,z)()}function Y(z,q){return q?()=>X.block(()=>{(0,VM.callRef)($,z),X.let(q,!0)}):()=>(0,VM.callRef)($,z)}}FM.dynamicRef=BM;FM.default=lv});var AM=b((MM)=>{Object.defineProperty(MM,"__esModule",{value:!0});var pv=wJ(),iv=P0(),nv={keyword:"$recursiveAnchor",schemaType:"boolean",code($){if($.schema)(0,pv.dynamicAnchor)($,"");else(0,iv.checkStrictMode)($.it,"$recursiveAnchor: false is ignored")}};MM.default=nv});var NM=b((IM)=>{Object.defineProperty(IM,"__esModule",{value:!0});var av=TJ(),ov={keyword:"$recursiveRef",schemaType:"string",code:($)=>(0,av.dynamicRef)($,$.schema)};IM.default=ov});var wM=b((DM)=>{Object.defineProperty(DM,"__esModule",{value:!0});var tv=wJ(),ev=TJ(),$g=AM(),Zg=NM(),Xg=[tv.default,ev.default,$g.default,Zg.default];DM.default=Xg});var OM=b((jM)=>{Object.defineProperty(jM,"__esModule",{value:!0});var TM=TZ(),Jg={keyword:"dependentRequired",type:"object",schemaType:"object",error:TM.error,code:($)=>(0,TM.validatePropertyDeps)($)};jM.default=Jg});var RM=b((EM)=>{Object.defineProperty(EM,"__esModule",{value:!0});var Wg=TZ(),Yg={keyword:"dependentSchemas",type:"object",schemaType:"object",code:($)=>(0,Wg.validateSchemaDeps)($)};EM.default=Yg});var CM=b((PM)=>{Object.defineProperty(PM,"__esModule",{value:!0});var qg=P0(),Kg={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:$,parentSchema:Z,it:X}){if(Z.contains===void 0)(0,qg.checkStrictMode)(X,`"${$}" without "contains" is ignored`)}};PM.default=Kg});var _M=b((SM)=>{Object.defineProperty(SM,"__esModule",{value:!0});var Hg=OM(),Vg=RM(),Bg=CM(),Fg=[Hg.default,Vg.default,Bg.default];SM.default=Fg});var kM=b((xM)=>{Object.defineProperty(xM,"__esModule",{value:!0});var g6=N0(),bM=P0(),Mg=J1(),Ag={message:"must NOT have unevaluated properties",params:({params:$})=>g6._`{unevaluatedProperty: ${$.unevaluatedProperty}}`},Ig={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:Ag,code($){let{gen:Z,schema:X,data:Q,errsCount:J,it:G}=$;if(!J)throw Error("ajv implementation error");let{allErrors:W,props:Y}=G;if(Y instanceof g6.Name)Z.if(g6._`${Y} !== true`,()=>Z.forIn("key",Q,(B)=>Z.if(q(Y,B),()=>z(B))));else if(Y!==!0)Z.forIn("key",Q,(B)=>Y===void 0?z(B):Z.if(H(Y,B),()=>z(B)));G.props=!0,$.ok(g6._`${J} === ${Mg.default.errors}`);function z(B){if(X===!1){if($.setParams({unevaluatedProperty:B}),$.error(),!W)Z.break();return}if(!(0,bM.alwaysValidSchema)(G,X)){let F=Z.name("valid");if($.subschema({keyword:"unevaluatedProperties",dataProp:B,dataPropType:bM.Type.Str},F),!W)Z.if((0,g6.not)(F),()=>Z.break())}}function q(B,F){return g6._`!${B} || !${B}[${F}]`}function H(B,F){let L=[];for(let w in B)if(B[w]===!0)L.push(g6._`${F} !== ${w}`);return(0,g6.and)(...L)}}};xM.default=Ig});var gM=b((vM)=>{Object.defineProperty(vM,"__esModule",{value:!0});var V4=N0(),yM=P0(),Dg={message:({params:{len:$}})=>V4.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>V4._`{limit: ${$}}`},wg={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:Dg,code($){let{gen:Z,schema:X,data:Q,it:J}=$,G=J.items||0;if(G===!0)return;let W=Z.const("len",V4._`${Q}.length`);if(X===!1)$.setParams({len:G}),$.fail(V4._`${W} > ${G}`);else if(typeof X=="object"&&!(0,yM.alwaysValidSchema)(J,X)){let z=Z.var("valid",V4._`${W} <= ${G}`);Z.if((0,V4.not)(z),()=>Y(z,G)),$.ok(z)}J.items=!0;function Y(z,q){Z.forRange("i",q,W,(H)=>{if($.subschema({keyword:"unevaluatedItems",dataProp:H,dataPropType:yM.Type.Num},z),!J.allErrors)Z.if((0,V4.not)(z),()=>Z.break())})}}};vM.default=wg});var hM=b((fM)=>{Object.defineProperty(fM,"__esModule",{value:!0});var jg=kM(),Og=gM(),Eg=[jg.default,Og.default];fM.default=Eg});var mM=b((uM)=>{Object.defineProperty(uM,"__esModule",{value:!0});var e0=N0(),Pg={message:({schemaCode:$})=>e0.str`must match format "${$}"`,params:({schemaCode:$})=>e0._`{format: ${$}}`},Cg={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Pg,code($,Z){let{gen:X,data:Q,$data:J,schema:G,schemaCode:W,it:Y}=$,{opts:z,errSchemaPath:q,schemaEnv:H,self:B}=Y;if(!z.validateFormats)return;if(J)F();else L();function F(){let w=X.scopeValue("formats",{ref:B.formats,code:z.code.formats}),N=X.const("fDef",e0._`${w}[${W}]`),I=X.let("fType"),T=X.let("format");X.if(e0._`typeof ${N} == "object" && !(${N} instanceof RegExp)`,()=>X.assign(I,e0._`${N}.type || "string"`).assign(T,e0._`${N}.validate`),()=>X.assign(I,e0._`"string"`).assign(T,N)),$.fail$data((0,e0.or)(E(),P()));function E(){if(z.strictSchema===!1)return e0.nil;return e0._`${W} && !${T}`}function P(){let R=H.$async?e0._`(${N}.async ? await ${T}(${Q}) : ${T}(${Q}))`:e0._`${T}(${Q})`,C=e0._`(typeof ${T} == "function" ? ${R} : ${T}.test(${Q}))`;return e0._`${T} && ${T} !== true && ${I} === ${Z} && !${C}`}}function L(){let w=B.formats[G];if(!w){E();return}if(w===!0)return;let[N,I,T]=P(w);if(N===Z)$.pass(R());function E(){if(z.strictSchema===!1){B.logger.warn(C());return}throw Error(C());function C(){return`unknown format "${G}" ignored in schema at path "${q}"`}}function P(C){let y=C instanceof RegExp?(0,e0.regexpCode)(C):z.code.formats?e0._`${z.code.formats}${(0,e0.getProperty)(G)}`:void 0,v=X.scopeValue("formats",{key:G,ref:C,code:y});if(typeof C=="object"&&!(C instanceof RegExp))return[C.type||"string",C.validate,e0._`${v}.validate`];return["string",C,v]}function R(){if(typeof w=="object"&&!(w instanceof RegExp)&&w.async){if(!H.$async)throw Error("async format in sync schema");return e0._`await ${T}(${Q})`}return typeof I=="function"?e0._`${T}(${Q})`:e0._`${T}.test(${Q})`}}}};uM.default=Cg});var jJ=b((dM)=>{Object.defineProperty(dM,"__esModule",{value:!0});var _g=mM(),bg=[_g.default];dM.default=bg});var OJ=b((lM)=>{Object.defineProperty(lM,"__esModule",{value:!0});lM.contentVocabulary=lM.metadataVocabulary=void 0;lM.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];lM.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var nM=b((iM)=>{Object.defineProperty(iM,"__esModule",{value:!0});var yg=KJ(),vg=VJ(),gg=NJ(),fg=wM(),hg=_M(),ug=hM(),mg=jJ(),pM=OJ(),dg=[fg.default,yg.default,vg.default,(0,gg.default)(!0),mg.default,pM.metadataVocabulary,pM.contentVocabulary,hg.default,ug.default];iM.default=dg});var sM=b((aM)=>{Object.defineProperty(aM,"__esModule",{value:!0});aM.DiscrError=void 0;var rM;(function($){$.Tag="tag",$.Mapping="mapping"})(rM||(aM.DiscrError=rM={}))});var RJ=b((eM)=>{Object.defineProperty(eM,"__esModule",{value:!0});var Q9=N0(),EJ=sM(),tM=z8(),cg=t4(),pg=P0(),ig={message:({params:{discrError:$,tagName:Z}})=>$===EJ.DiscrError.Tag?`tag "${Z}" must be string`:`value of tag "${Z}" must be in oneOf`,params:({params:{discrError:$,tag:Z,tagName:X}})=>Q9._`{error: ${$}, tag: ${X}, tagValue: ${Z}}`},ng={keyword:"discriminator",type:"object",schemaType:"object",error:ig,code($){let{gen:Z,data:X,schema:Q,parentSchema:J,it:G}=$,{oneOf:W}=J;if(!G.opts.discriminator)throw Error("discriminator: requires discriminator option");let Y=Q.propertyName;if(typeof Y!="string")throw Error("discriminator: requires propertyName");if(Q.mapping)throw Error("discriminator: mapping is not supported");if(!W)throw Error("discriminator: requires oneOf keyword");let z=Z.let("valid",!1),q=Z.const("tag",Q9._`${X}${(0,Q9.getProperty)(Y)}`);Z.if(Q9._`typeof ${q} == "string"`,()=>H(),()=>$.error(!1,{discrError:EJ.DiscrError.Tag,tag:q,tagName:Y})),$.ok(z);function H(){let L=F();Z.if(!1);for(let w in L)Z.elseIf(Q9._`${q} === ${w}`),Z.assign(z,B(L[w]));Z.else(),$.error(!1,{discrError:EJ.DiscrError.Mapping,tag:q,tagName:Y}),Z.endIf()}function B(L){let w=Z.name("valid"),N=$.subschema({keyword:"oneOf",schemaProp:L},w);return $.mergeEvaluated(N,Q9.Name),w}function F(){var L;let w={},N=T(J),I=!0;for(let R=0;R<W.length;R++){let C=W[R];if((C===null||C===void 0?void 0:C.$ref)&&!(0,pg.schemaHasRulesButRef)(C,G.self.RULES)){let v=C.$ref;if(C=tM.resolveRef.call(G.self,G.schemaEnv.root,G.baseId,v),C instanceof tM.SchemaEnv)C=C.schema;if(C===void 0)throw new cg.default(G.opts.uriResolver,G.baseId,v)}let y=(L=C===null||C===void 0?void 0:C.properties)===null||L===void 0?void 0:L[Y];if(typeof y!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${Y}"`);I=I&&(N||T(C)),E(y,R)}if(!I)throw Error(`discriminator: "${Y}" must be required`);return w;function T({required:R}){return Array.isArray(R)&&R.includes(Y)}function E(R,C){if(R.const)P(R.const,C);else if(R.enum)for(let y of R.enum)P(y,C);else throw Error(`discriminator: "properties/${Y}" must have "const" or "enum"`)}function P(R,C){if(typeof R!="string"||R in w)throw Error(`discriminator: "${Y}" values must be unique strings`);w[R]=C}}}};eM.default=ng});var $A=b((Pr,ag)=>{ag.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 ZA=b((Cr,og)=>{og.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 XA=b((Sr,sg)=>{sg.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 QA=b((_r,tg)=>{tg.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 JA=b((br,eg)=>{eg.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 GA=b((xr,$f)=>{$f.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 WA=b((kr,Zf)=>{Zf.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 YA=b((yr,Xf)=>{Xf.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 qA=b((zA)=>{Object.defineProperty(zA,"__esModule",{value:!0});var Qf=$A(),Jf=ZA(),Gf=XA(),Wf=QA(),Yf=JA(),zf=GA(),qf=WA(),Kf=YA(),Uf=["/properties"];function Hf($){return[Qf,Jf,Gf,Wf,Yf,Z(this,zf),qf,Z(this,Kf)].forEach((X)=>this.addMetaSchema(X,void 0,!1)),this;function Z(X,Q){return $?X.$dataMetaSchema(Q,Uf):Q}}zA.default=Hf});var SJ=b((v$,CJ)=>{Object.defineProperty(v$,"__esModule",{value:!0});v$.MissingRefError=v$.ValidationError=v$.CodeGen=v$.Name=v$.nil=v$.stringify=v$.str=v$._=v$.KeywordCxt=v$.Ajv2020=void 0;var Bf=qJ(),Ff=nM(),Lf=RJ(),Mf=qA(),PJ="https://json-schema.org/draft/2020-12/schema";class I8 extends Bf.default{constructor($={}){super({...$,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),Ff.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(Lf.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:$,meta:Z}=this.opts;if(!Z)return;Mf.default.call(this,$),this.refs["http://json-schema.org/schema"]=PJ}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(PJ)?PJ:void 0)}}v$.Ajv2020=I8;CJ.exports=v$=I8;CJ.exports.Ajv2020=I8;Object.defineProperty(v$,"__esModule",{value:!0});v$.default=I8;var Af=s4();Object.defineProperty(v$,"KeywordCxt",{enumerable:!0,get:function(){return Af.KeywordCxt}});var J9=N0();Object.defineProperty(v$,"_",{enumerable:!0,get:function(){return J9._}});Object.defineProperty(v$,"str",{enumerable:!0,get:function(){return J9.str}});Object.defineProperty(v$,"stringify",{enumerable:!0,get:function(){return J9.stringify}});Object.defineProperty(v$,"nil",{enumerable:!0,get:function(){return J9.nil}});Object.defineProperty(v$,"Name",{enumerable:!0,get:function(){return J9.Name}});Object.defineProperty(v$,"CodeGen",{enumerable:!0,get:function(){return J9.CodeGen}});var If=W8();Object.defineProperty(v$,"ValidationError",{enumerable:!0,get:function(){return If.default}});var Nf=t4();Object.defineProperty(v$,"MissingRefError",{enumerable:!0,get:function(){return Nf.default}})});import{existsSync as SZ,readFileSync as N8}from"node:fs";import{createRequire as KA}from"node:module";import{isAbsolute as Tf,relative as jf,resolve as CZ}from"node:path";import{fileURLToPath as UA,pathToFileURL as Of}from"node:url";async function HA($){let Z=CZ($),X=CZ(Z,"project.json"),Q=CZ(Z,"project.schema.json");if(!SZ(X))throw Error(`project.json not found in ${Z}`);if(!SZ(Q))throw Error(`project.schema.json not found in ${Z} — run \`jx schema\` to generate it from `+"project.json#/extensions");let J=JSON.parse(N8(X,"utf8")),G=JSON.parse(N8(Q,"utf8"));G.$id=Of(Q).href;let W;try{({default:W}=await Promise.resolve().then(() => F$(SJ(),1)))}catch(H){throw Error("Project validation requires ajv: bun add ajv",{cause:H})}let z=await new W({allErrors:!0,loadSchema:(H)=>Ef(H,Z),strict:!1}).compileAsync(G),q=z(J);return{errors:z.errors??null,valid:q}}async function Ef($,Z){if(!$.startsWith("file:"))throw Error(`Cannot resolve schema ref "${$}": only project-relative file refs are loadable (canonical URIs must resolve from already-loaded fragments)`);let X=UA($),Q=jf(Z,X);if(Q.startsWith("..")||Tf(Q))throw Error(`Schema ref "${$}" escapes the project root ${Z}`);if(SZ(X))return JSON.parse(N8(X,"utf8"));let J=Q.split("\\").join("/"),G="node_modules/",W=J.lastIndexOf(G);if(W===-1)throw Error(`Schema ref "${$}" does not exist`);let Y=J.slice(W+G.length),z;try{z=KA(CZ(Z,"package.json")).resolve(Y)}catch{try{z=KA(import.meta.url).resolve(Y)}catch(q){if(Y.startsWith("@jxsuite/schema/")){let B=UA(new URL(`../${Y.slice(16)}`,import.meta.url));if(SZ(B))return JSON.parse(N8(B,"utf8"))}throw Error(`Schema ref "${$}" does not exist and "${Y}" is not resolvable from the project or the host`,{cause:q})}}return JSON.parse(N8(z,"utf8"))}var VA=()=>{};var TA=b((DA)=>{Object.defineProperty(DA,"__esModule",{value:!0});DA.formatNames=DA.fastFormats=DA.fullFormats=void 0;function f1($,Z){return{validate:$,compare:Z}}DA.fullFormats={date:f1(MA,kJ),time:f1(bJ(!0),yJ),"date-time":f1(BA(!0),IA),"iso-time":f1(bJ(),AA),"iso-date-time":f1(BA(),NA),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:bf,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:hf,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:xf,int32:{type:"number",validate:vf},int64:{type:"number",validate:gf},float:{type:"number",validate:LA},double:{type:"number",validate:LA},password:!0,binary:!0};DA.fastFormats={...DA.fullFormats,date:f1(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,kJ),time:f1(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,yJ),"date-time":f1(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,IA),"iso-time":f1(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,AA),"iso-date-time":f1(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,NA),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};DA.formatNames=Object.keys(DA.fullFormats);function Rf($){return $%4===0&&($%100!==0||$%400===0)}var Pf=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Cf=[0,31,28,31,30,31,30,31,31,30,31,30,31];function MA($){let Z=Pf.exec($);if(!Z)return!1;let X=+Z[1],Q=+Z[2],J=+Z[3];return Q>=1&&Q<=12&&J>=1&&J<=(Q===2&&Rf(X)?29:Cf[Q])}function kJ($,Z){if(!($&&Z))return;if($>Z)return 1;if($<Z)return-1;return 0}var _J=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function bJ($){return function(X){let Q=_J.exec(X);if(!Q)return!1;let J=+Q[1],G=+Q[2],W=+Q[3],Y=Q[4],z=Q[5]==="-"?-1:1,q=+(Q[6]||0),H=+(Q[7]||0);if(q>23||H>59||$&&!Y)return!1;if(J<=23&&G<=59&&W<60)return!0;let B=G-H*z,F=J-q*z-(B<0?1:0);return(F===23||F===-1)&&(B===59||B===-1)&&W<61}}function yJ($,Z){if(!($&&Z))return;let X=new Date("2020-01-01T"+$).valueOf(),Q=new Date("2020-01-01T"+Z).valueOf();if(!(X&&Q))return;return X-Q}function AA($,Z){if(!($&&Z))return;let X=_J.exec($),Q=_J.exec(Z);if(!(X&&Q))return;if($=X[1]+X[2]+X[3],Z=Q[1]+Q[2]+Q[3],$>Z)return 1;if($<Z)return-1;return 0}var xJ=/t|\s/i;function BA($){let Z=bJ($);return function(Q){let J=Q.split(xJ);return J.length===2&&MA(J[0])&&Z(J[1])}}function IA($,Z){if(!($&&Z))return;let X=new Date($).valueOf(),Q=new Date(Z).valueOf();if(!(X&&Q))return;return X-Q}function NA($,Z){if(!($&&Z))return;let[X,Q]=$.split(xJ),[J,G]=Z.split(xJ),W=kJ(X,J);if(W===void 0)return;return W||yJ(Q,G)}var Sf=/\/|:/,_f=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function bf($){return Sf.test($)&&_f.test($)}var FA=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function xf($){return FA.lastIndex=0,FA.test($)}var kf=-2147483648,yf=2147483647;function vf($){return Number.isInteger($)&&$<=yf&&$>=kf}function gf($){return Number.isInteger($)}function LA(){return!0}var ff=/[^\\]\\Z/;function hf($){if(ff.test($))return!1;try{return new RegExp($),!0}catch(Z){return!1}}});var EA=b((OA)=>{Object.defineProperty(OA,"__esModule",{value:!0});var mf=KJ(),df=VJ(),lf=NJ(),cf=jJ(),jA=OJ(),pf=[mf.default,df.default,(0,lf.default)(),cf.default,jA.metadataVocabulary,jA.contentVocabulary];OA.default=pf});var RA=b((tr,rf)=>{rf.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var CA=b((g$,gJ)=>{Object.defineProperty(g$,"__esModule",{value:!0});g$.MissingRefError=g$.ValidationError=g$.CodeGen=g$.Name=g$.nil=g$.stringify=g$.str=g$._=g$.KeywordCxt=g$.Ajv=void 0;var af=qJ(),of=EA(),sf=RJ(),PA=RA(),tf=["/properties"],_Z="http://json-schema.org/draft-07/schema";class D8 extends af.default{_addVocabularies(){if(super._addVocabularies(),of.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(sf.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(PA,tf):PA;this.addMetaSchema($,_Z,!1),this.refs["http://json-schema.org/schema"]=_Z}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(_Z)?_Z:void 0)}}g$.Ajv=D8;gJ.exports=g$=D8;gJ.exports.Ajv=D8;Object.defineProperty(g$,"__esModule",{value:!0});g$.default=D8;var ef=s4();Object.defineProperty(g$,"KeywordCxt",{enumerable:!0,get:function(){return ef.KeywordCxt}});var G9=N0();Object.defineProperty(g$,"_",{enumerable:!0,get:function(){return G9._}});Object.defineProperty(g$,"str",{enumerable:!0,get:function(){return G9.str}});Object.defineProperty(g$,"stringify",{enumerable:!0,get:function(){return G9.stringify}});Object.defineProperty(g$,"nil",{enumerable:!0,get:function(){return G9.nil}});Object.defineProperty(g$,"Name",{enumerable:!0,get:function(){return G9.Name}});Object.defineProperty(g$,"CodeGen",{enumerable:!0,get:function(){return G9.CodeGen}});var $h=W8();Object.defineProperty(g$,"ValidationError",{enumerable:!0,get:function(){return $h.default}});var Zh=t4();Object.defineProperty(g$,"MissingRefError",{enumerable:!0,get:function(){return Zh.default}})});var _A=b((SA)=>{Object.defineProperty(SA,"__esModule",{value:!0});SA.formatLimitDefinition=void 0;var Jh=CA(),L1=N0(),f6=L1.operators,bZ={formatMaximum:{okStr:"<=",ok:f6.LTE,fail:f6.GT},formatMinimum:{okStr:">=",ok:f6.GTE,fail:f6.LT},formatExclusiveMaximum:{okStr:"<",ok:f6.LT,fail:f6.GTE},formatExclusiveMinimum:{okStr:">",ok:f6.GT,fail:f6.LTE}},Gh={message:({keyword:$,schemaCode:Z})=>L1.str`should be ${bZ[$].okStr} ${Z}`,params:({keyword:$,schemaCode:Z})=>L1._`{comparison: ${bZ[$].okStr}, limit: ${Z}}`};SA.formatLimitDefinition={keyword:Object.keys(bZ),type:"string",schemaType:"string",$data:!0,error:Gh,code($){let{gen:Z,data:X,schemaCode:Q,keyword:J,it:G}=$,{opts:W,self:Y}=G;if(!W.validateFormats)return;let z=new Jh.KeywordCxt(G,Y.RULES.all.format.definition,"format");if(z.$data)q();else H();function q(){let F=Z.scopeValue("formats",{ref:Y.formats,code:W.code.formats}),L=Z.const("fmt",L1._`${F}[${z.schemaCode}]`);$.fail$data((0,L1.or)(L1._`typeof ${L} != "object"`,L1._`${L} instanceof RegExp`,L1._`typeof ${L}.compare != "function"`,B(L)))}function H(){let F=z.schema,L=Y.formats[F];if(!L||L===!0)return;if(typeof L!="object"||L instanceof RegExp||typeof L.compare!="function")throw Error(`"${J}": format "${F}" does not define "compare" function`);let w=Z.scopeValue("formats",{key:F,ref:L,code:W.code.formats?L1._`${W.code.formats}${(0,L1.getProperty)(F)}`:void 0});$.fail$data(B(w))}function B(F){return L1._`${F}.compare(${X}, ${Q}) ${bZ[J].fail} 0`}},dependencies:["format"]};var Wh=($)=>{return $.addKeyword(SA.formatLimitDefinition),$};SA.default=Wh});var yA=b((w8,kA)=>{Object.defineProperty(w8,"__esModule",{value:!0});var W9=TA(),zh=_A(),hJ=N0(),bA=new hJ.Name("fullFormats"),qh=new hJ.Name("fastFormats"),uJ=($,Z={keywords:!0})=>{if(Array.isArray(Z))return xA($,Z,W9.fullFormats,bA),$;let[X,Q]=Z.mode==="fast"?[W9.fastFormats,qh]:[W9.fullFormats,bA],J=Z.formats||W9.formatNames;if(xA($,J,X,Q),Z.keywords)(0,zh.default)($);return $};uJ.get=($,Z="full")=>{let Q=(Z==="fast"?W9.fastFormats:W9.fullFormats)[$];if(!Q)throw Error(`Unknown format "${$}"`);return Q};function xA($,Z,X,Q){var J,G;(J=(G=$.opts.code).formats)!==null&&J!==void 0||(G.formats=hJ._`require("ajv-formats/dist/formats").${Q}`);for(let W of Z)$.addFormat(W,X[W])}kA.exports=w8=uJ;Object.defineProperty(w8,"__esModule",{value:!0});w8.default=uJ});var cA={};m1(cA,{validateProjectTree:()=>Fh,formatProjectTreeIssues:()=>Ih});import{existsSync as fA,readFileSync as T8,readdirSync as hA,statSync as uA}from"node:fs";import{createRequire as Kh}from"node:module";import{join as mA,relative as vA,resolve as mJ}from"node:path";async function Bh(){try{let{default:$}=await Promise.resolve().then(() => F$(SJ(),1)),{default:Z}=await Promise.resolve().then(() => F$(yA(),1));return{addFormats:Z,Ajv:$}}catch($){throw Error("Project validation requires ajv and ajv-formats: bun add ajv ajv-formats",{cause:$})}}async function Fh($){let Z=mJ($),X=[],Q=0;for(let N of["project.schema.json","document.schema.json"]){let I=mJ(Z,N);if(!fA(I))continue;Q+=1;let T=JSON.parse(T8(I,"utf8")),E=Lh(T);if(E.length>0)X.push({errors:E.map(({reason:P,ref:R})=>({message:`$ref "${R}" ${P} — committed entry documents must be self-contained `+"single-resource schemas; regenerate with `jx schema`"})),file:N})}if(X.length>0)return{checked:Q,issues:X,valid:!1};let J=await HA(Z);if(Q+=1,!J.valid)X.push({errors:J.errors??[],file:"project.json"});let{addFormats:G,Ajv:W}=await Bh(),{document:Y}=await KQ(Z),z=new W({allErrors:!0,ownProperties:!0,strict:!1});G(z);let q=z.compile(Y);for(let N of Uh)for(let I of lA(mJ(Z,N))){if(I.endsWith(".class.json"))continue;Q+=1;let T=JSON.parse(T8(I,"utf8"));if(!q(T))X.push({errors:q.errors??[],file:vA(Z,I)})}let H=new W({allErrors:!0,ownProperties:!0,strict:!1});G(H);let B=H.compile(jQ());for(let N of Ah(Z)){Q+=1;let I=JSON.parse(T8(N,"utf8"));if(!B(I))X.push({errors:B.errors??[],file:vA(Z,N)})}let{config:F}=T6(Z),L=await R1(Z,F),w=Kh(import.meta.url);for(let N of L.extensions)for(let I of["project","document","fields"]){let T=N.schemas[I];if(!T)continue;Q+=1;let E=new W({allErrors:!0,ownProperties:!0,strict:!1});G(E);for(let P of Vh){let R=w.resolve(P),C=JSON.parse(T8(R,"utf8"));E.addSchema(C)}try{E.compile(JSON.parse(T8(T,"utf8")))}catch(P){X.push({errors:[{message:P instanceof Error?P.message:String(P)}],file:`${N.specifier} (${I} fragment)`})}}return{checked:Q,issues:X,valid:X.length===0}}function Lh($){let Z=[],X=new Set,Q=(G)=>{let W=$;for(let Y of G.slice(1).split("/")){if(Y==="")continue;let z=Y.replaceAll("~1","/").replaceAll("~0","~");if(typeof W!=="object"||W===null)return!1;if(W=W[z],W===void 0)return!1}return!0},J=(G)=>{if(!gA(G)||X.has(G))return;X.add(G);let W=G.$ref;if(typeof W==="string"){if(/^[a-zA-Z][a-zA-Z\d+.-]*:/.test(W))Z.push({reason:"is an absolute URI editors resolve over the network",ref:W});else if(!W.startsWith("#"))Z.push({reason:"is a relative path only Node module resolution can follow",ref:W});else if(W.length>1&&!W.startsWith("#/"))Z.push({reason:"is an $anchor reference, which has no root-pointer form",ref:W});else if(W.length>1&&!Q(W.slice(1)))Z.push({reason:"points at no node in this document",ref:W})}for(let[Y,z]of Object.entries(G)){if(!Mh.has(Y))continue;if(Array.isArray(z))for(let q of z)J(q);else if(gA(z)){if(J(z),dA.has(Y))for(let q of Object.values(z))J(q)}}};return J($),Z}function gA($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function lA($){if(!fA($))return[];let Z=[];for(let X of hA($)){let Q=mA($,X);if(uA(Q).isDirectory())Z.push(...lA(Q));else if(X.endsWith(".json"))Z.push(Q)}return Z.toSorted()}function Ah($){let Z=[],X=(Q)=>{for(let J of hA(Q)){if(Hh.has(J))continue;let G=mA(Q,J);if(uA(G).isDirectory())X(G);else if(J.endsWith(".class.json"))Z.push(G)}};return X($),Z.toSorted()}function Ih($){let Z=[];for(let X of $.issues){Z.push(`${X.file}:`);for(let Q of X.errors){let{instancePath:J,message:G}=Q??{};Z.push(` - ${J||"/"}: ${G??JSON.stringify(Q)}`)}}return Z}var Uh,Hh,Vh,dA,Mh;var pA=s(()=>{V3();VA();r1();E9();UQ();Uh=["components","pages","layouts"],Hh=new Set(["node_modules","dist",".git"]),Vh=["@jxsuite/schema/schemas/project.core.schema.json","@jxsuite/schema/schemas/project.fields.schema.json","@jxsuite/schema/schemas/document.paths.schema.json"];dA=new Set(["$defs","definitions","dependencies","dependentSchemas","patternProperties","properties"]),Mh=new Set([...dA,"additionalItems","additionalProperties","allOf","anyOf","contains","contentSchema","else","if","items","not","oneOf","prefixItems","propertyNames","then","unevaluatedItems","unevaluatedProperties"])});import{relative as dJ,resolve as iA}from"node:path";async function Nh(){let $=process.argv.slice(2),[Z]=$;if(!Z||Z==="--help"||Z==="-h")console.log(`Usage: jx <command> [options]
|
|
397
396
|
|
|
398
397
|
Commands:
|
|
399
398
|
build [root] Build a Jx site to dist/
|
|
@@ -408,8 +407,8 @@ Options:
|
|
|
408
407
|
--no-clean Don't clean outDir before building
|
|
409
408
|
--port <n> dev/preview: port to listen on (default 3000 / 4173)
|
|
410
409
|
--dry-run db push: print the statements without executing them
|
|
411
|
-
--connection db push: restrict to one connection name`),process.exit(0);let X=Z==="db",Q=X?$[1]:null,J=$.slice(X?2:1),G=new Set,W=[],Y,z;for(let B=0;B<J.length;B+=1){let F=J[B];if(F==="--connection")B+=1,Y=J[B];else if(F==="--port"){B+=1;let
|
|
412
|
-
Usage: jx db push [root] [--dry-run] [--connection <name>]`),process.exit(1);let B=G.has("--dry-run");try{let{dbPush:F}=await Promise.resolve().then(() => (
|
|
413
|
-
Build completed with ${
|
|
414
|
-
Done: ${
|
|
415
|
-
Run "jx --help" for usage.`),process.exit(1)}var
|
|
410
|
+
--connection db push: restrict to one connection name`),process.exit(0);let X=Z==="db",Q=X?$[1]:null,J=$.slice(X?2:1),G=new Set,W=[],Y,z;for(let B=0;B<J.length;B+=1){let F=J[B];if(F==="--connection")B+=1,Y=J[B];else if(F==="--port"){B+=1;let L=Math.trunc(Number(J[B]??""));if(Number.isFinite(L)&&L>=0)z=L}else if(F.startsWith("--"))G.add(F);else W.push(F)}let[q]=W,H=iA(q??".");if(X){if(Q!=="push")console.error(`Unknown db subcommand: ${Q??"(none)"}
|
|
411
|
+
Usage: jx db push [root] [--dry-run] [--connection <name>]`),process.exit(1);let B=G.has("--dry-run");try{let{dbPush:F}=await Promise.resolve().then(() => (TY(),wY)),{results:L,bindingsPatched:w,wranglerPath:N}=await F(H,{dryRun:B,...Y===void 0?{}:{connection:Y}});for(let I of L){let T=I.applied?"applied":"dry-run";console.log(`${I.connection} (${I.provider}) — ${I.tables.length} table(s), ${I.statements.length} statement(s) [${T}]`);for(let E of I.statements)console.log(` ${E}`);for(let E of I.warnings)console.warn(` warning: ${E}`)}if(w&&N)console.log(`Updated bindings in ${dJ(H,N)}`)}catch(F){console.error(`db push failed: ${F.message}`),process.exit(1)}return}if(Z==="build"){let B=G.has("--verbose"),F=!G.has("--no-clean");console.log(`Building site from ${H}...`);try{let{buildSite:L}=await Promise.resolve().then(() => (GH(),JH)),w=await L(H,{clean:F,verbose:B});if(w.errors.length>0){console.error(`
|
|
412
|
+
Build completed with ${w.errors.length} error(s):`);for(let N of w.errors)console.error(` - ${N}`);process.exit(1)}console.log(`
|
|
413
|
+
Done: ${w.routes} routes → ${w.files} files`)}catch(L){console.error(`Build failed: ${L.message}`),process.exit(1)}}else if(Z==="dev")try{let{runDev:B}=await Promise.resolve().then(() => (zH(),YH));B(H,z)}catch(B){console.error(B.message),process.exit(1)}else if(Z==="preview"){let{existsSync:B}=await import("node:fs"),F=iA(H,"dist");if(!B(F))console.error(`No build output at ${F} — run \`jx build\` first.`),process.exit(1);let{startPreviewServer:L}=await Promise.resolve().then(() => (VH(),HH)),w=z??4173;L(F,w),console.log(`Previewing ${F} at http://localhost:${w}`)}else if(Z==="schema")try{let{writeProjectSchemas:B}=await Promise.resolve().then(() => (UQ(),CH)),{projectSchemaPath:F,documentSchemaPath:L}=await B(H);console.log(`Wrote ${dJ(H,F)}`),console.log(`Wrote ${dJ(H,L)}`)}catch(B){console.error(`Schema generation failed: ${B.message}`),process.exit(1)}else if(Z==="validate")try{let{formatProjectTreeIssues:B,validateProjectTree:F}=await Promise.resolve().then(() => (pA(),cA)),L=await F(H);if(L.valid)console.log(`Project is valid (${L.checked} files checked in ${H})`);else{console.error(`Project is INVALID (${H}):`);for(let w of B(L))console.error(w);process.exit(1)}}catch(B){console.error(`Validation failed: ${B.message}`),process.exit(1)}else console.error(`Unknown command: ${Z}
|
|
414
|
+
Run "jx --help" for usage.`),process.exit(1)}var Ma=Nh();export{Ma as ready};
|