@jxsuite/compiler 0.26.1 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js
CHANGED
|
@@ -395,12 +395,12 @@ ${b.join(`,
|
|
|
395
395
|
<${W}></${W}>
|
|
396
396
|
<script type="module" src="./${W}.js"></script>
|
|
397
397
|
</body>
|
|
398
|
-
</html>`,files:[z]}}return wM(Y,{title:X,reactivitySrc:J,litHtmlSrc:q,projectStyle:Q})}async function ZU1(Z,U){let[X,J]=await Promise.all([DY(Z),C7(Z)]),{writeFileSync:q,mkdirSync:Q}=await import("node:fs"),{dirname:Y,join:W}=await import("node:path");if(U){q(U,X.html,"utf8"),console.error(`Written to ${U}`);let H=Y(U);for(let K of X.files){let z=W(H,K.path);Q(Y(z),{recursive:!0}),q(z,K.content,"utf8"),console.error(`Written to ${z}`)}}else process.stdout.write(X.html);if(J&&U){let H=U.replace(/(\.[^.]+)?$/,"-server.js");q(H,J,"utf8"),console.error(`Server handler written to ${H}`)}}var DM=P(()=>{_5();kK();bZ();RM();NM()});import{readFileSync as Hm,existsSync as Km}from"node:fs";import{resolve as OM}from"node:path";function PM(Z){let U=OM(Z,"project.json");if(!Km(U))throw Error(`project.json not found in ${Z}`);let X;try{X=JSON.parse(Hm(U,"utf8"))}catch(Q){throw Error(`Invalid JSON in ${U}: ${Q.message}`)}if(typeof X!=="object"||X===null||Array.isArray(X))throw Error(`project.json must be a JSON object, got ${typeof X}`);let J={...gZ,...X,defaults:{...gZ.defaults,...X.defaults},images:{...gZ.images,...X.images},build:{...gZ.build,...X.build}};if(X.$head)J.$head=X.$head;if(X.$media)J.$media=X.$media;if(X.style)J.style=X.style;if(X.state)J.state=X.state;if(X.redirects)J.redirects=X.redirects;if(X.imports)J.imports=X.imports;if(X.contentTypes)J.contentTypes=X.contentTypes;let q=["cloudflare-workers","cloudflare-pages","node","bun"];if(J.build.adapter&&!q.includes(J.build.adapter))throw Error(`Unknown build adapter "${J.build.adapter}" in project.json. Valid adapters: ${q.join(", ")}`);return{config:J,configPath:U,projectRoot:OM(Z)}}var gZ;var CM=P(()=>{gZ={name:"Jx Site",url:"",defaults:{layout:null,lang:"en",charset:"utf-8"},$head:[],imports:{},$media:{},style:{},state:{},contentTypes:{},redirects:{},images:{optimize:!0,widths:[320,640,960,1280,1920],formats:["webp","avif"],quality:{webp:80,avif:65,jpeg:80,png:80},sizes:"(max-width: 768px) 100vw, 50vw",lazyLoad:!0},build:{outDir:"./dist",format:"directory",trailingSlash:"always",provider:null}}});import{readdirSync as zm,readFileSync as OY}from"node:fs";import{resolve as Bm,relative as Fm,extname as Vm,join as Lm}from"node:path";function IM(Z){let U=[];return EM(Z,Z,U),U.sort((X,J)=>{if(X.isDynamic!==J.isDynamic)return X.isDynamic?1:-1;if(X.isCatchAll!==J.isCatchAll)return X.isCatchAll?1:-1;return X.urlPattern.localeCompare(J.urlPattern)}),U}function EM(Z,U,X){let J=zm(Z,{withFileTypes:!0});for(let q of J){let Q=Lm(Z,q.name);if(q.isDirectory()){if(q.name.startsWith("_"))continue;EM(Q,U,X);continue}let Y=Vm(q.name);if(Y!==".json"&&Y!==".md")continue;if(q.name.startsWith("_"))continue;let W=Fm(U,Q),H=Rm(W,Q);if(H)X.push(H)}}function Rm(Z,U){let X=Z.replace(/\.(json|md)$/,"");if(X=X.split("\\").join("/"),X.endsWith("/index"))X=X.slice(0,-6)||"/";else if(X==="index")X="/";if(!X.startsWith("/"))X="/"+X;let J=[],q=!1,Q=!1,Y=X.replace(/\[\.\.\.(\w+)\]|\[(\w+)\]/g,(H,K,z)=>{if(K)return Q=!0,q=!0,J.push(K),"*";return q=!0,J.push(z),`:${z}`}),W=null;try{let H=OY(U,"utf8");if(U.endsWith(".md")){let K=H.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(K){let z=K[1].match(/^\$layout:\s*(.+)/m);if(z)W=z[1].trim().replace(/^['"]|['"]$/g,"")}}else{let K=JSON.parse(H);if(typeof K.$layout==="string")W=K.$layout}}catch{}return{urlPattern:Y,sourcePath:U,relativePath:Z,isDynamic:q,isCatchAll:Q,params:J,$layout:W}}async function _M(Z,U,X=new Map){let J=[];for(let q of Z){if(!q.isDynamic){J.push(q);continue}let Q;try{Q=JSON.parse(OY(q.sourcePath,"utf8"))}catch{J.push(q);continue}if(!Q.$paths){console.warn(`Warning: dynamic route ${q.urlPattern} has no $paths — skipping`);continue}let Y=wm(Q.$paths,U,X);for(let W of Y){let H=q.urlPattern;for(let[K,z]of Object.entries(W))H=H.replace(`:${K}`,z),H=H.replace("*",z);J.push({...q,urlPattern:H,isDynamic:!1,isCatchAll:!1,params:[],_pathParams:W})}}return J}function wm(Z,U,X){if(Array.isArray(Z))return Z;if(Z.contentType){let J=X.get(Z.contentType);if(!J||J.length===0)return console.warn(`Warning: $paths references content type "${Z.contentType}" but it has no entries`),[];let q=Z.param??"slug",Q=Z.field??"id";return J.map((Y)=>({[q]:Q==="id"?Y.id:Y.data[Q]??Y.id}))}if(Array.isArray(Z.values)){let J=Z.param??"value";return Z.values.map((q)=>({[J]:q}))}if(Z.$ref){let J=Bm(U,Z.$ref),q;try{q=JSON.parse(OY(J,"utf8"))}catch(W){let H=W;return console.warn(`Warning: $paths.$ref could not load "${Z.$ref}": ${H.message}`),[]}if(!Array.isArray(q))return console.warn(`Warning: $paths.$ref "${Z.$ref}" must be a JSON array`),[];let Q=Z.param??"id",Y=Z.field??"id";return q.map((W)=>({[Q]:W[Y]??W.id??String(W)}))}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var AM=()=>{};import{readFileSync as Gm,existsSync as Mm}from"node:fs";import{resolve as Nm}from"node:path";function PY(Z,U,X){let J=Z.$layout??U.defaults?.layout??null;if(!J)return Z;let q=Nm(X,J);if(!Mm(q))throw Error(`Layout not found: ${J} (resolved to ${q})`);let Q;try{Q=JSON.parse(Gm(q,"utf8"))}catch(K){throw Error(`Invalid layout JSON at ${q}: ${K.message}`)}if(Q.$layout)Q=PY(Q,U,X);let Y=Z.children??[],W=typeof Y==="string"?[Y]:Array.isArray(Y)?Y:[],H=jm(Q);if($m(H,W),Z.state)H.state={...H.state,...Z.state};if(Z.$media)H.$media={...H.$media,...Z.$media};if(Z.style)H.style={...H.style,...Z.style};if(Z.attributes)H.attributes={...H.attributes,...Z.attributes};if(Z.$head)H._pageHead=Z.$head;if(Z.title)H._pageTitle=Z.title;return delete H.$layout,H}function $m(Z,U){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let X=new Map,J=[];for(let q of U)if(q&&typeof q==="object"&&q.attributes?.slot){let Q=q.attributes.slot;if(!X.has(Q))X.set(Q,[]);X.get(Q).push(q)}else J.push(q);TM(Z,X,J)}function TM(Z,U,X){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let J=[];for(let q of Z.children)if(q&&typeof q==="object"&&q.tagName==="slot"){let Q=q.attributes?.name;if(Q&&U.has(Q))J.push(...U.get(Q)),U.delete(Q);else if(!Q&&X.length>0)J.push(...X);else if(Array.isArray(q.children))J.push(...q.children)}else TM(q,U,X),J.push(q);Z.children=J}function jm(Z){return JSON.parse(JSON.stringify(Z))}var xM=()=>{};function SM(Z=[],U=[],X=[],J={}){let q=[{tagName:"meta",attributes:{charset:J.charset??"utf-8"}},{tagName:"meta",attributes:{name:"viewport",content:"width=device-width, initial-scale=1"}}],Q=new Map;for(let W of[...q,...Z,...U,...X]){let H=Dm(W);Q.set(H,W)}let Y=J.title??J.siteName??"Jx Site";if(Q.set("title",{tagName:"title",children:[Y]}),J.pageUrl&&J.siteUrl){let W=new URL(J.pageUrl,J.siteUrl).href;Q.set("link:canonical",{tagName:"link",attributes:{rel:"canonical",href:W}})}return Array.from(Q.values())}function Dm(Z){if(!Z||typeof Z!=="object")return String(Z);let U=Z.tagName??"unknown",X=Z.attributes??{};if(U==="title")return"title";if(X.charset)return"meta:charset";if(U==="meta"&&X.name)return`meta:${X.name}`;if(U==="meta"&&X.property)return`meta:${X.property}`;if(U==="link"&&X.rel)return`link:${X.rel}:${X.href??""}`;if(U==="script"&&X.src)return`script:${X.src}`;if(U==="style"){let J=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`style:${Om(J)}`}return`${U}:${JSON.stringify(Z)}`}function Om(Z){let U=0;for(let X=0;X<Z.length;X++)U=(U<<5)-U+Z.charCodeAt(X)|0;return U.toString(36)}function bM(Z){return Z.map((U)=>Pm(U)).join(`
|
|
398
|
+
</html>`,files:[z]}}return wM(Y,{title:X,reactivitySrc:J,litHtmlSrc:q,projectStyle:Q})}async function ZU1(Z,U){let[X,J]=await Promise.all([DY(Z),C7(Z)]),{writeFileSync:q,mkdirSync:Q}=await import("node:fs"),{dirname:Y,join:W}=await import("node:path");if(U){q(U,X.html,"utf8"),console.error(`Written to ${U}`);let H=Y(U);for(let K of X.files){let z=W(H,K.path);Q(Y(z),{recursive:!0}),q(z,K.content,"utf8"),console.error(`Written to ${z}`)}}else process.stdout.write(X.html);if(J&&U){let H=U.replace(/(\.[^.]+)?$/,"-server.js");q(H,J,"utf8"),console.error(`Server handler written to ${H}`)}}var DM=P(()=>{_5();kK();bZ();RM();NM()});import{readFileSync as Hm,existsSync as Km}from"node:fs";import{resolve as OM}from"node:path";function PM(Z){let U=OM(Z,"project.json");if(!Km(U))throw Error(`project.json not found in ${Z}`);let X;try{X=JSON.parse(Hm(U,"utf8"))}catch(Q){throw Error(`Invalid JSON in ${U}: ${Q.message}`)}if(typeof X!=="object"||X===null||Array.isArray(X))throw Error(`project.json must be a JSON object, got ${typeof X}`);let J={...gZ,...X,defaults:{...gZ.defaults,...X.defaults},images:{...gZ.images,...X.images},build:{...gZ.build,...X.build}};if(X.$head)J.$head=X.$head;if(X.$media)J.$media=X.$media;if(X.style)J.style=X.style;if(X.state)J.state=X.state;if(X.redirects)J.redirects=X.redirects;if(X.imports)J.imports=X.imports;if(X.contentTypes)J.contentTypes=X.contentTypes;let q=["cloudflare-workers","cloudflare-pages","node","bun"];if(J.build.adapter&&!q.includes(J.build.adapter))throw Error(`Unknown build adapter "${J.build.adapter}" in project.json. Valid adapters: ${q.join(", ")}`);return{config:J,configPath:U,projectRoot:OM(Z)}}var gZ;var CM=P(()=>{gZ={name:"Jx Site",url:"",defaults:{layout:null,lang:"en",charset:"utf-8"},$head:[],imports:{},$media:{},style:{},state:{},contentTypes:{},redirects:{},images:{optimize:!0,widths:[320,640,960,1280,1920],formats:["webp","avif"],quality:{webp:80,avif:65,jpeg:80,png:80},sizes:"(max-width: 768px) 100vw, 50vw",lazyLoad:!0},build:{outDir:"./dist",format:"directory",trailingSlash:"always",provider:null}}});import{readdirSync as zm,readFileSync as OY}from"node:fs";import{resolve as Bm,relative as Fm,extname as Vm,join as Lm}from"node:path";function IM(Z){let U=[];return EM(Z,Z,U),U.sort((X,J)=>{if(X.isDynamic!==J.isDynamic)return X.isDynamic?1:-1;if(X.isCatchAll!==J.isCatchAll)return X.isCatchAll?1:-1;return X.urlPattern.localeCompare(J.urlPattern)}),U}function EM(Z,U,X){let J=zm(Z,{withFileTypes:!0});for(let q of J){let Q=Lm(Z,q.name);if(q.isDirectory()){if(q.name.startsWith("_"))continue;EM(Q,U,X);continue}let Y=Vm(q.name);if(Y!==".json"&&Y!==".md")continue;if(q.name.startsWith("_"))continue;let W=Fm(U,Q),H=Rm(W,Q);if(H)X.push(H)}}function Rm(Z,U){let X=Z.replace(/\.(json|md)$/,"");if(X=X.split("\\").join("/"),X.endsWith("/index"))X=X.slice(0,-6)||"/";else if(X==="index")X="/";if(!X.startsWith("/"))X="/"+X;let J=[],q=!1,Q=!1,Y=X.replace(/\[\.\.\.(\w+)\]|\[(\w+)\]/g,(H,K,z)=>{if(K)return Q=!0,q=!0,J.push(K),"*";return q=!0,J.push(z),`:${z}`}),W=null;try{let H=OY(U,"utf8");if(U.endsWith(".md")){let K=H.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(K){let z=K[1].match(/^\$layout:\s*(.+)/m);if(z)W=z[1].trim().replace(/^['"]|['"]$/g,"")}}else{let K=JSON.parse(H);if(typeof K.$layout==="string")W=K.$layout}}catch{}return{urlPattern:Y,sourcePath:U,relativePath:Z,isDynamic:q,isCatchAll:Q,params:J,$layout:W}}async function _M(Z,U,X=new Map){let J=[];for(let q of Z){if(!q.isDynamic){J.push(q);continue}let Q;try{Q=JSON.parse(OY(q.sourcePath,"utf8"))}catch{J.push(q);continue}if(!Q.$paths){console.warn(`Warning: dynamic route ${q.urlPattern} has no $paths — skipping`);continue}let Y=wm(Q.$paths,U,X);for(let W of Y){let H=q.urlPattern;for(let[K,z]of Object.entries(W))H=H.replace(`:${K}`,z),H=H.replace("*",z);J.push({...q,urlPattern:H,isDynamic:!1,isCatchAll:!1,params:[],_pathParams:W})}}return J}function wm(Z,U,X){if(Array.isArray(Z))return Z;if(Z.contentType){let J=X.get(Z.contentType);if(!J||J.length===0)return console.warn(`Warning: $paths references content type "${Z.contentType}" but it has no entries`),[];let q=Z.param??"slug",Q=Z.field??"id";return J.map((Y)=>({[q]:Q==="id"?Y.id:Y.data[Q]??Y.id})).filter((Y)=>Y[q])}if(Array.isArray(Z.values)){let J=Z.param??"value";return Z.values.map((q)=>({[J]:q}))}if(Z.$ref){let J=Bm(U,Z.$ref),q;try{q=JSON.parse(OY(J,"utf8"))}catch(W){let H=W;return console.warn(`Warning: $paths.$ref could not load "${Z.$ref}": ${H.message}`),[]}if(!Array.isArray(q))return console.warn(`Warning: $paths.$ref "${Z.$ref}" must be a JSON array`),[];let Q=Z.param??"id",Y=Z.field??"id";return q.map((W)=>({[Q]:W[Y]??W.id??String(W)}))}return console.warn("Warning: unrecognized $paths shape — skipping"),[]}var AM=()=>{};import{readFileSync as Gm,existsSync as Mm}from"node:fs";import{resolve as Nm}from"node:path";function PY(Z,U,X){let J=Z.$layout??U.defaults?.layout??null;if(!J)return Z;let q=Nm(X,J);if(!Mm(q))throw Error(`Layout not found: ${J} (resolved to ${q})`);let Q;try{Q=JSON.parse(Gm(q,"utf8"))}catch(K){throw Error(`Invalid layout JSON at ${q}: ${K.message}`)}if(Q.$layout)Q=PY(Q,U,X);let Y=Z.children??[],W=typeof Y==="string"?[Y]:Array.isArray(Y)?Y:[],H=jm(Q);if($m(H,W),Z.state)H.state={...H.state,...Z.state};if(Z.$media)H.$media={...H.$media,...Z.$media};if(Z.style)H.style={...H.style,...Z.style};if(Z.attributes)H.attributes={...H.attributes,...Z.attributes};if(Z.$head)H._pageHead=Z.$head;if(Z.title)H._pageTitle=Z.title;return delete H.$layout,H}function $m(Z,U){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let X=new Map,J=[];for(let q of U)if(q&&typeof q==="object"&&q.attributes?.slot){let Q=q.attributes.slot;if(!X.has(Q))X.set(Q,[]);X.get(Q).push(q)}else J.push(q);TM(Z,X,J)}function TM(Z,U,X){if(!Z||typeof Z!=="object")return;if(!Array.isArray(Z.children))return;let J=[];for(let q of Z.children)if(q&&typeof q==="object"&&q.tagName==="slot"){let Q=q.attributes?.name;if(Q&&U.has(Q))J.push(...U.get(Q)),U.delete(Q);else if(!Q&&X.length>0)J.push(...X);else if(Array.isArray(q.children))J.push(...q.children)}else TM(q,U,X),J.push(q);Z.children=J}function jm(Z){return JSON.parse(JSON.stringify(Z))}var xM=()=>{};function SM(Z=[],U=[],X=[],J={}){let q=[{tagName:"meta",attributes:{charset:J.charset??"utf-8"}},{tagName:"meta",attributes:{name:"viewport",content:"width=device-width, initial-scale=1"}}],Q=new Map;for(let W of[...q,...Z,...U,...X]){let H=Dm(W);Q.set(H,W)}let Y=J.title??J.siteName??"Jx Site";if(Q.set("title",{tagName:"title",children:[Y]}),J.pageUrl&&J.siteUrl){let W=new URL(J.pageUrl,J.siteUrl).href;Q.set("link:canonical",{tagName:"link",attributes:{rel:"canonical",href:W}})}return Array.from(Q.values())}function Dm(Z){if(!Z||typeof Z!=="object")return String(Z);let U=Z.tagName??"unknown",X=Z.attributes??{};if(U==="title")return"title";if(X.charset)return"meta:charset";if(U==="meta"&&X.name)return`meta:${X.name}`;if(U==="meta"&&X.property)return`meta:${X.property}`;if(U==="link"&&X.rel)return`link:${X.rel}:${X.href??""}`;if(U==="script"&&X.src)return`script:${X.src}`;if(U==="style"){let J=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`style:${Om(J)}`}return`${U}:${JSON.stringify(Z)}`}function Om(Z){let U=0;for(let X=0;X<Z.length;X++)U=(U<<5)-U+Z.charCodeAt(X)|0;return U.toString(36)}function bM(Z){return Z.map((U)=>Pm(U)).join(`
|
|
399
399
|
`)}function Pm(Z){if(typeof Z==="string")return Z;if(!Z||typeof Z!=="object")return"";let U=Z.tagName,X=Z.attributes??{},J=Object.entries(X).map(([W,H])=>H===!0?W:`${W}="${Cm(H)}"`).join(" "),q=J?`<${U} ${J}>`:`<${U}>`;if(new Set(["meta","link","base","br","hr","img","input"]).has(U))return q;let Y=Array.isArray(Z.children)?Z.children.join(""):Z.textContent??"";return`${q}${Y}</${U}>`}function Cm(Z){return String(Z).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}import{resolve as Im,dirname as Em,relative as _m}from"node:path";function gM(Z,U,X,J=new Map,q=null){if(!Z.state)Z.state={};if(Z.state.$site={name:U.name??"Jx Site",url:U.url??"",...U.state},Z.state.$page={url:X.urlPattern,title:Z.title??Z._pageTitle??U.name??"",params:X._pathParams??{}},U.state){for(let[Q,Y]of Object.entries(U.state))if(Q!=="$site"&&Q!=="$page"&&!(Q in Z.state))Z.state[Q]=Y}if(U.$media)Z.$media={...U.$media,...Z.$media};if(U.imports&&Object.keys(U.imports).length>0){if(!Z.imports)Z.imports={};for(let[Q,Y]of Object.entries(U.imports))if(!(Q in Z.imports)){let W=Y;if(q&&X.sourcePath&&(W.startsWith("./")||W.startsWith("../"))){let H=Im(q,W);Z.imports[Q]="./"+_m(Em(X.sourcePath),H)}else Z.imports[Q]=W}}if(U.$elements?.length)if(!Z.$elements?.length)Z.$elements=[...U.$elements];else{let Q=new Set,Y=[];for(let W of[...U.$elements,...Z.$elements]){let H=typeof W==="string"?W:W?.$ref;if(H&&!Q.has(H))Q.add(H),Y.push(W)}Z.$elements=Y}return Z}var yM=()=>{};import{fileURLToPath as xu}from"node:url";import{posix as yu,win32 as gY}from"node:path";import{fileURLToPath as vu}from"node:url";import{lstatSync as ku,readdir as hu,readdirSync as mu,readlinkSync as uu,realpathSync as fu}from"fs";import*as lu from"node:fs";import{lstat as pu,readdir as du,readlink as cu,realpath as iu}from"node:fs/promises";import{EventEmitter as kY}from"node:events";import $N from"node:stream";import{StringDecoder as ru}from"node:string_decoder";function CY(Z){return isNaN(Z)?Z.charCodeAt(0):parseInt(Z,10)}function fm(Z){return Z.replace(ym,YN).replace(vm,WN).replace(km,yY).replace(hm,HN).replace(mm,KN)}function lm(Z){return Z.replace(Tm,"\\").replace(xm,"{").replace(Sm,"}").replace(bm,",").replace(gm,".")}function zN(Z){if(!Z)return[""];let U=[],X=QN("{","}",Z);if(!X)return Z.split(",");let{pre:J,body:q,post:Q}=X,Y=J.split(",");Y[Y.length-1]+="{"+q+"}";let W=zN(Q);return Q.length&&(Y[Y.length-1]+=W.shift(),Y.push.apply(Y,W)),U.push.apply(U,Y),U}function pm(Z,U={}){if(!Z)return[];let{max:X=um}=U;return Z.slice(0,2)==="{}"&&(Z="\\{\\}"+Z.slice(2)),p8(fm(Z),X,!0).map(lm)}function dm(Z){return"{"+Z+"}"}function cm(Z){return/^-?0\d/.test(Z)}function im(Z,U){return Z<=U}function rm(Z,U){return Z>=U}function p8(Z,U,X){let J=[],q=QN("{","}",Z);if(!q)return[Z];let Q=q.pre,Y=q.post.length?p8(q.post,U,!1):[""];if(/\$$/.test(q.pre))for(let W=0;W<Y.length&&W<U;W++){let H=Q+"{"+q.body+"}"+Y[W];J.push(H)}else{let W=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(q.body),H=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(q.body),K=W||H,z=q.body.indexOf(",")>=0;if(!K&&!z)return q.post.match(/,(?!,).*\}/)?(Z=q.pre+"{"+q.body+yY+q.post,p8(Z,U,!0)):[Z];let B;if(K)B=q.body.split(/\.\./);else if(B=zN(q.body),B.length===1&&B[0]!==void 0&&(B=p8(B[0],U,!1).map(dm),B.length===1))return Y.map((V)=>q.pre+B[0]+V);let F;if(K&&B[0]!==void 0&&B[1]!==void 0){let V=CY(B[0]),w=CY(B[1]),M=Math.max(B[0].length,B[1].length),N=B.length===3&&B[2]!==void 0?Math.abs(CY(B[2])):1,$=im;w<V&&(N*=-1,$=rm);let O=B.some(cm);F=[];for(let C=V;$(C,w);C+=N){let b;if(H)b=String.fromCharCode(C),b==="\\"&&(b="");else if(b=String(C),O){let u=M-b.length;if(u>0){let T=Array(u+1).join("0");C<0?b="-"+T+b.slice(1):b=T+b}}F.push(b)}}else{F=[];for(let V=0;V<B.length;V++)F.push.apply(F,p8(B[V],U,!1))}for(let V=0;V<F.length;V++)for(let w=0;w<Y.length&&J.length<U;w++){let M=Q+F[V]+Y[w];(!X||K||M)&&J.push(M)}}return J}function nZ(Z,U={}){return new a6(Z,U).streamSync()}function vN(Z,U={}){return new a6(Z,U).stream()}function sZ(Z,U={}){return new a6(Z,U).walkSync()}async function JN(Z,U={}){return new a6(Z,U).walk()}function oZ(Z,U={}){return new a6(Z,U).iterateSync()}function kN(Z,U={}){return new a6(Z,U).iterate()}var QN=(Z,U,X)=>{let J=Z instanceof RegExp?vM(Z,X):Z,q=U instanceof RegExp?vM(U,X):U,Q=J!==null&&q!=null&&Am(J,q,X);return Q&&{start:Q[0],end:Q[1],pre:X.slice(0,Q[0]),body:X.slice(Q[0]+J.length,Q[1]),post:X.slice(Q[1]+q.length)}},vM=(Z,U)=>{let X=U.match(Z);return X?X[0]:null},Am=(Z,U,X)=>{let J,q,Q,Y,W,H=X.indexOf(Z),K=X.indexOf(U,H+1),z=H;if(H>=0&&K>0){if(Z===U)return[H,K];for(J=[],Q=X.length;z>=0&&!W;){if(z===H)J.push(z),H=X.indexOf(Z,z+1);else if(J.length===1){let B=J.pop();B!==void 0&&(W=[B,K])}else q=J.pop(),q!==void 0&&q<Q&&(Q=q,Y=K),K=X.indexOf(U,z+1);z=H<K&&H>=0?H:K}J.length&&Y!==void 0&&(W=[Q,Y])}return W},YN,WN,yY,HN,KN,Tm,xm,Sm,bm,gm,ym,vm,km,hm,mm,um=1e5,cZ=(Z)=>{if(typeof Z!="string")throw TypeError("invalid pattern");if(Z.length>65536)throw TypeError("pattern is too long")},am,k8=(Z)=>Z.replace(/[[\]\\-]/g,"\\$&"),nm=(Z)=>Z.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),kM=(Z)=>Z.join(""),sm=(Z,U)=>{let X=U;if(Z.charAt(X)!=="[")throw Error("not in a brace expression");let J=[],q=[],Q=X+1,Y=!1,W=!1,H=!1,K=!1,z=X,B="";Z:for(;Q<Z.length;){let w=Z.charAt(Q);if((w==="!"||w==="^")&&Q===X+1){K=!0,Q++;continue}if(w==="]"&&Y&&!H){z=Q+1;break}if(Y=!0,w==="\\"&&!H){H=!0,Q++;continue}if(w==="["&&!H){for(let[M,[N,$,O]]of Object.entries(am))if(Z.startsWith(M,Q)){if(B)return["$.",!1,Z.length-X,!0];Q+=M.length,O?q.push(N):J.push(N),W=W||$;continue Z}}if(H=!1,B){w>B?J.push(k8(B)+"-"+k8(w)):w===B&&J.push(k8(w)),B="",Q++;continue}if(Z.startsWith("-]",Q+1)){J.push(k8(w+"-")),Q+=2;continue}if(Z.startsWith("-",Q+1)){B=w,Q+=2;continue}J.push(k8(w)),Q++}if(z<Q)return["",!1,0,!1];if(!J.length&&!q.length)return["$.",!1,Z.length-X,!0];if(q.length===0&&J.length===1&&/^\\?.$/.test(J[0])&&!K){let w=J[0].length===2?J[0].slice(-1):J[0];return[nm(w),!1,z-X,!1]}let F="["+(K?"^":"")+kM(J)+"]",V="["+(K?"":"^")+kM(q)+"]";return[J.length&&q.length?"("+F+"|"+V+")":J.length?F:V,W,z-X,!0]},W3=(Z,{windowsPathsNoEscape:U=!1,magicalBraces:X=!0}={})=>X?U?Z.replace(/\[([^\/\\])\]/g,"$1"):Z.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):U?Z.replace(/\[([^\/\\{}])\]/g,"$1"):Z.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1"),om,hM=(Z)=>om.has(Z),tm="(?!(?:^|/)\\.\\.?(?:$|/))",yZ="(?!\\.)",em,Zu,Uu,Xu=(Z)=>Z.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),vY="[^/]",mM,uM,BN=class Z{type;#Z;#X;#Q=!1;#q=[];#Y;#$;#G;#z=!1;#W;#F;#B=!1;constructor(U,X,J={}){this.type=U,U&&(this.#X=!0),this.#Y=X,this.#Z=this.#Y?this.#Y.#Z:this,this.#W=this.#Z===this?J:this.#Z.#W,this.#G=this.#Z===this?[]:this.#Z.#G,U==="!"&&!this.#Z.#z&&this.#G.push(this),this.#$=this.#Y?this.#Y.#q.length:0}get hasMagic(){if(this.#X!==void 0)return this.#X;for(let U of this.#q)if(typeof U!="string"&&(U.type||U.hasMagic))return this.#X=!0;return this.#X}toString(){return this.#F!==void 0?this.#F:this.type?this.#F=this.type+"("+this.#q.map((U)=>String(U)).join("|")+")":this.#F=this.#q.map((U)=>String(U)).join("")}#H(){if(this!==this.#Z)throw Error("should only call on root");if(this.#z)return this;this.toString(),this.#z=!0;let U;for(;U=this.#G.pop();){if(U.type!=="!")continue;let X=U,J=X.#Y;for(;J;){for(let q=X.#$+1;!J.type&&q<J.#q.length;q++)for(let Q of U.#q){if(typeof Q=="string")throw Error("string part in extglob AST??");Q.copyIn(J.#q[q])}X=J,J=X.#Y}}return this}push(...U){for(let X of U)if(X!==""){if(typeof X!="string"&&!(X instanceof Z&&X.#Y===this))throw Error("invalid part: "+X);this.#q.push(X)}}toJSON(){let U=this.type===null?this.#q.slice().map((X)=>typeof X=="string"?X:X.toJSON()):[this.type,...this.#q.map((X)=>X.toJSON())];return this.isStart()&&!this.type&&U.unshift([]),this.isEnd()&&(this===this.#Z||this.#Z.#z&&this.#Y?.type==="!")&&U.push({}),U}isStart(){if(this.#Z===this)return!0;if(!this.#Y?.isStart())return!1;if(this.#$===0)return!0;let U=this.#Y;for(let X=0;X<this.#$;X++){let J=U.#q[X];if(!(J instanceof Z&&J.type==="!"))return!1}return!0}isEnd(){if(this.#Z===this||this.#Y?.type==="!")return!0;if(!this.#Y?.isEnd())return!1;if(!this.type)return this.#Y?.isEnd();let U=this.#Y?this.#Y.#q.length:0;return this.#$===U-1}copyIn(U){typeof U=="string"?this.push(U):this.push(U.clone(this))}clone(U){let X=new Z(this.type,U);for(let J of this.#q)X.copyIn(J);return X}static#J(U,X,J,q){let Q=!1,Y=!1,W=-1,H=!1;if(X.type===null){let V=J,w="";for(;V<U.length;){let M=U.charAt(V++);if(Q||M==="\\"){Q=!Q,w+=M;continue}if(Y){V===W+1?(M==="^"||M==="!")&&(H=!0):M==="]"&&!(V===W+2&&H)&&(Y=!1),w+=M;continue}else if(M==="["){Y=!0,W=V,H=!1,w+=M;continue}if(!q.noext&&hM(M)&&U.charAt(V)==="("){X.push(w),w="";let N=new Z(M,X);V=Z.#J(U,N,V,q),X.push(N);continue}w+=M}return X.push(w),V}let K=J+1,z=new Z(null,X),B=[],F="";for(;K<U.length;){let V=U.charAt(K++);if(Q||V==="\\"){Q=!Q,F+=V;continue}if(Y){K===W+1?(V==="^"||V==="!")&&(H=!0):V==="]"&&!(K===W+2&&H)&&(Y=!1),F+=V;continue}else if(V==="["){Y=!0,W=K,H=!1,F+=V;continue}if(hM(V)&&U.charAt(K)==="("){z.push(F),F="";let w=new Z(V,z);z.push(w),K=Z.#J(U,w,K,q);continue}if(V==="|"){z.push(F),F="",B.push(z),z=new Z(null,X);continue}if(V===")")return F===""&&X.#q.length===0&&(X.#B=!0),z.push(F),F="",X.push(...B,z),K;F+=V}return X.type=null,X.#X=void 0,X.#q=[U.substring(J-1)],K}static fromGlob(U,X={}){let J=new Z(null,void 0,X);return Z.#J(U,J,0,X),J}toMMPattern(){if(this!==this.#Z)return this.#Z.toMMPattern();let U=this.toString(),[X,J,q,Q]=this.toRegExpSource();if(!(q||this.#X||this.#W.nocase&&!this.#W.nocaseMagicOnly&&U.toUpperCase()!==U.toLowerCase()))return J;let Y=(this.#W.nocase?"i":"")+(Q?"u":"");return Object.assign(new RegExp(`^${X}$`,Y),{_src:X,_glob:U})}get options(){return this.#W}toRegExpSource(U){let X=U??!!this.#W.dot;if(this.#Z===this&&this.#H(),!this.type){let H=this.isStart()&&this.isEnd()&&!this.#q.some((F)=>typeof F!="string"),K=this.#q.map((F)=>{let[V,w,M,N]=typeof F=="string"?Z.#j(F,this.#X,H):F.toRegExpSource(U);return this.#X=this.#X||M,this.#Q=this.#Q||N,V}).join(""),z="";if(this.isStart()&&typeof this.#q[0]=="string"&&!(this.#q.length===1&&Zu.has(this.#q[0]))){let F=em,V=X&&F.has(K.charAt(0))||K.startsWith("\\.")&&F.has(K.charAt(2))||K.startsWith("\\.\\.")&&F.has(K.charAt(4)),w=!X&&!U&&F.has(K.charAt(0));z=V?tm:w?yZ:""}let B="";return this.isEnd()&&this.#Z.#z&&this.#Y?.type==="!"&&(B="(?:$|\\/)"),[z+K+B,W3(K),this.#X=!!this.#X,this.#Q]}let J=this.type==="*"||this.type==="+",q=this.type==="!"?"(?:(?!(?:":"(?:",Q=this.#V(X);if(this.isStart()&&this.isEnd()&&!Q&&this.type!=="!"){let H=this.toString();return this.#q=[H],this.type=null,this.#X=void 0,[H,W3(this.toString()),!1,!1]}let Y=!J||U||X||!yZ?"":this.#V(!0);Y===Q&&(Y=""),Y&&(Q=`(?:${Q})(?:${Y})*?`);let W="";if(this.type==="!"&&this.#B)W=(this.isStart()&&!X?yZ:"")+uM;else{let H=this.type==="!"?"))"+(this.isStart()&&!X&&!U?yZ:"")+mM+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&Y?")":this.type==="*"&&Y?")?":`)${this.type}`;W=q+Q+H}return[W,W3(Q),this.#X=!!this.#X,this.#Q]}#V(U){return this.#q.map((X)=>{if(typeof X=="string")throw Error("string type in extglob ast??");let[J,q,Q,Y]=X.toRegExpSource(U);return this.#Q=this.#Q||Y,J}).filter((X)=>!(this.isStart()&&this.isEnd())||!!X).join("|")}static#j(U,X,J=!1){let q=!1,Q="",Y=!1,W=!1;for(let H=0;H<U.length;H++){let K=U.charAt(H);if(q){q=!1,Q+=(Uu.has(K)?"\\":"")+K;continue}if(K==="*"){if(W)continue;W=!0,Q+=J&&/^[*]+$/.test(U)?uM:mM,X=!0;continue}else W=!1;if(K==="\\"){H===U.length-1?Q+="\\\\":q=!0;continue}if(K==="["){let[z,B,F,V]=sm(U,H);if(F){Q+=z,Y=Y||B,H+=F-1,X=X||V;continue}}if(K==="?"){Q+=vY,X=!0;continue}Q+=Xu(K)}return[Q,W3(U),!!X,Y]}},FN=(Z,{windowsPathsNoEscape:U=!1,magicalBraces:X=!1}={})=>X?U?Z.replace(/[?*()[\]{}]/g,"[$&]"):Z.replace(/[?*()[\]\\{}]/g,"\\$&"):U?Z.replace(/[?*()[\]]/g,"[$&]"):Z.replace(/[?*()[\]\\]/g,"\\$&"),g0=(Z,U,X={})=>(cZ(U),!X.nocomment&&U.charAt(0)==="#"?!1:new s5(U,X).match(Z)),Ju,qu=(Z)=>(U)=>!U.startsWith(".")&&U.endsWith(Z),Qu=(Z)=>(U)=>U.endsWith(Z),Yu=(Z)=>(Z=Z.toLowerCase(),(U)=>!U.startsWith(".")&&U.toLowerCase().endsWith(Z)),Wu=(Z)=>(Z=Z.toLowerCase(),(U)=>U.toLowerCase().endsWith(Z)),Hu,Ku=(Z)=>!Z.startsWith(".")&&Z.includes("."),zu=(Z)=>Z!=="."&&Z!==".."&&Z.includes("."),Bu,Fu=(Z)=>Z!=="."&&Z!==".."&&Z.startsWith("."),Vu,Lu=(Z)=>Z.length!==0&&!Z.startsWith("."),Ru=(Z)=>Z.length!==0&&Z!=="."&&Z!=="..",wu,Gu=([Z,U=""])=>{let X=VN([Z]);return U?(U=U.toLowerCase(),(J)=>X(J)&&J.toLowerCase().endsWith(U)):X},Mu=([Z,U=""])=>{let X=LN([Z]);return U?(U=U.toLowerCase(),(J)=>X(J)&&J.toLowerCase().endsWith(U)):X},Nu=([Z,U=""])=>{let X=LN([Z]);return U?(J)=>X(J)&&J.endsWith(U):X},$u=([Z,U=""])=>{let X=VN([Z]);return U?(J)=>X(J)&&J.endsWith(U):X},VN=([Z])=>{let U=Z.length;return(X)=>X.length===U&&!X.startsWith(".")},LN=([Z])=>{let U=Z.length;return(X)=>X.length===U&&X!=="."&&X!==".."},RN,fM,ju,b0,Du="[^/]",Ou,Pu="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Cu="(?:(?!(?:\\/|^)\\.).)*?",Iu=(Z,U={})=>(X)=>g0(X,Z,U),L4=(Z,U={})=>Object.assign({},Z,U),Eu=(Z)=>{if(!Z||typeof Z!="object"||!Object.keys(Z).length)return g0;let U=g0;return Object.assign((X,J,q={})=>U(X,J,L4(Z,q)),{Minimatch:class extends U.Minimatch{constructor(X,J={}){super(X,L4(Z,J))}static defaults(X){return U.defaults(L4(Z,X)).Minimatch}},AST:class extends U.AST{constructor(X,J,q={}){super(X,J,L4(Z,q))}static fromGlob(X,J={}){return U.AST.fromGlob(X,L4(Z,J))}},unescape:(X,J={})=>U.unescape(X,L4(Z,J)),escape:(X,J={})=>U.escape(X,L4(Z,J)),filter:(X,J={})=>U.filter(X,L4(Z,J)),defaults:(X)=>U.defaults(L4(Z,X)),makeRe:(X,J={})=>U.makeRe(X,L4(Z,J)),braceExpand:(X,J={})=>U.braceExpand(X,L4(Z,J)),match:(X,J,q={})=>U.match(X,J,L4(Z,q)),sep:U.sep,GLOBSTAR:b0})},wN=(Z,U={})=>(cZ(Z),U.nobrace||!/\{(?:(?!\{).)*\}/.test(Z)?[Z]:pm(Z,{max:U.braceExpandMax})),_u=(Z,U={})=>new s5(Z,U).makeRe(),Au=(Z,U,X={})=>{let J=new s5(U,X);return Z=Z.filter((q)=>J.match(q)),J.options.nonull&&!Z.length&&Z.push(U),Z},lM,Tu=(Z)=>Z.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),s5=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(Z,U={}){cZ(Z),U=U||{},this.options=U,this.pattern=Z,this.platform=U.platform||RN,this.isWindows=this.platform==="win32";let X="allowWindowsEscape";this.windowsPathsNoEscape=!!U.windowsPathsNoEscape||U[X]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!U.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!U.nonegate,this.comment=!1,this.empty=!1,this.partial=!!U.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=U.windowsNoMagicRoot!==void 0?U.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let Z of this.set)for(let U of Z)if(typeof U!="string")return!0;return!1}debug(...Z){}make(){let Z=this.pattern,U=this.options;if(!U.nocomment&&Z.charAt(0)==="#"){this.comment=!0;return}if(!Z){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],U.debug&&(this.debug=(...q)=>console.error(...q)),this.debug(this.pattern,this.globSet);let X=this.globSet.map((q)=>this.slashSplit(q));this.globParts=this.preprocess(X),this.debug(this.pattern,this.globParts);let J=this.globParts.map((q,Q,Y)=>{if(this.isWindows&&this.windowsNoMagicRoot){let W=q[0]===""&&q[1]===""&&(q[2]==="?"||!lM.test(q[2]))&&!lM.test(q[3]),H=/^[a-z]:/i.test(q[0]);if(W)return[...q.slice(0,4),...q.slice(4).map((K)=>this.parse(K))];if(H)return[q[0],...q.slice(1).map((K)=>this.parse(K))]}return q.map((W)=>this.parse(W))});if(this.debug(this.pattern,J),this.set=J.filter((q)=>q.indexOf(!1)===-1),this.isWindows)for(let q=0;q<this.set.length;q++){let Q=this.set[q];Q[0]===""&&Q[1]===""&&this.globParts[q][2]==="?"&&typeof Q[3]=="string"&&/^[a-z]:$/i.test(Q[3])&&(Q[2]="?")}this.debug(this.pattern,this.set)}preprocess(Z){if(this.options.noglobstar)for(let X=0;X<Z.length;X++)for(let J=0;J<Z[X].length;J++)Z[X][J]==="**"&&(Z[X][J]="*");let{optimizationLevel:U=1}=this.options;return U>=2?(Z=this.firstPhasePreProcess(Z),Z=this.secondPhasePreProcess(Z)):U>=1?Z=this.levelOneOptimize(Z):Z=this.adjascentGlobstarOptimize(Z),Z}adjascentGlobstarOptimize(Z){return Z.map((U)=>{let X=-1;for(;(X=U.indexOf("**",X+1))!==-1;){let J=X;for(;U[J+1]==="**";)J++;J!==X&&U.splice(X,J-X)}return U})}levelOneOptimize(Z){return Z.map((U)=>(U=U.reduce((X,J)=>{let q=X[X.length-1];return J==="**"&&q==="**"?X:J===".."&&q&&q!==".."&&q!=="."&&q!=="**"?(X.pop(),X):(X.push(J),X)},[]),U.length===0?[""]:U))}levelTwoFileOptimize(Z){Array.isArray(Z)||(Z=this.slashSplit(Z));let U=!1;do{if(U=!1,!this.preserveMultipleSlashes){for(let J=1;J<Z.length-1;J++){let q=Z[J];J===1&&q===""&&Z[0]===""||(q==="."||q==="")&&(U=!0,Z.splice(J,1),J--)}Z[0]==="."&&Z.length===2&&(Z[1]==="."||Z[1]==="")&&(U=!0,Z.pop())}let X=0;for(;(X=Z.indexOf("..",X+1))!==-1;){let J=Z[X-1];J&&J!=="."&&J!==".."&&J!=="**"&&(U=!0,Z.splice(X-1,2),X-=2)}}while(U);return Z.length===0?[""]:Z}firstPhasePreProcess(Z){let U=!1;do{U=!1;for(let X of Z){let J=-1;for(;(J=X.indexOf("**",J+1))!==-1;){let Q=J;for(;X[Q+1]==="**";)Q++;Q>J&&X.splice(J+1,Q-J);let Y=X[J+1],W=X[J+2],H=X[J+3];if(Y!==".."||!W||W==="."||W===".."||!H||H==="."||H==="..")continue;U=!0,X.splice(J,1);let K=X.slice(0);K[J]="**",Z.push(K),J--}if(!this.preserveMultipleSlashes){for(let Q=1;Q<X.length-1;Q++){let Y=X[Q];Q===1&&Y===""&&X[0]===""||(Y==="."||Y==="")&&(U=!0,X.splice(Q,1),Q--)}X[0]==="."&&X.length===2&&(X[1]==="."||X[1]==="")&&(U=!0,X.pop())}let q=0;for(;(q=X.indexOf("..",q+1))!==-1;){let Q=X[q-1];if(Q&&Q!=="."&&Q!==".."&&Q!=="**"){U=!0;let Y=q===1&&X[q+1]==="**"?["."]:[];X.splice(q-1,2,...Y),X.length===0&&X.push(""),q-=2}}}}while(U);return Z}secondPhasePreProcess(Z){for(let U=0;U<Z.length-1;U++)for(let X=U+1;X<Z.length;X++){let J=this.partsMatch(Z[U],Z[X],!this.preserveMultipleSlashes);if(J){Z[U]=[],Z[X]=J;break}}return Z.filter((U)=>U.length)}partsMatch(Z,U,X=!1){let J=0,q=0,Q=[],Y="";for(;J<Z.length&&q<U.length;)if(Z[J]===U[q])Q.push(Y==="b"?U[q]:Z[J]),J++,q++;else if(X&&Z[J]==="**"&&U[q]===Z[J+1])Q.push(Z[J]),J++;else if(X&&U[q]==="**"&&Z[J]===U[q+1])Q.push(U[q]),q++;else if(Z[J]==="*"&&U[q]&&(this.options.dot||!U[q].startsWith("."))&&U[q]!=="**"){if(Y==="b")return!1;Y="a",Q.push(Z[J]),J++,q++}else if(U[q]==="*"&&Z[J]&&(this.options.dot||!Z[J].startsWith("."))&&Z[J]!=="**"){if(Y==="a")return!1;Y="b",Q.push(U[q]),J++,q++}else return!1;return Z.length===U.length&&Q}parseNegate(){if(this.nonegate)return;let Z=this.pattern,U=!1,X=0;for(let J=0;J<Z.length&&Z.charAt(J)==="!";J++)U=!U,X++;X&&(this.pattern=Z.slice(X)),this.negate=U}matchOne(Z,U,X=!1){let J=this.options;if(this.isWindows){let w=typeof Z[0]=="string"&&/^[a-z]:$/i.test(Z[0]),M=!w&&Z[0]===""&&Z[1]===""&&Z[2]==="?"&&/^[a-z]:$/i.test(Z[3]),N=typeof U[0]=="string"&&/^[a-z]:$/i.test(U[0]),$=!N&&U[0]===""&&U[1]===""&&U[2]==="?"&&typeof U[3]=="string"&&/^[a-z]:$/i.test(U[3]),O=M?3:w?0:void 0,C=$?3:N?0:void 0;if(typeof O=="number"&&typeof C=="number"){let[b,u]=[Z[O],U[C]];b.toLowerCase()===u.toLowerCase()&&(U[C]=b,C>O?U=U.slice(C):O>C&&(Z=Z.slice(O)))}}let{optimizationLevel:q=1}=this.options;q>=2&&(Z=this.levelTwoFileOptimize(Z)),this.debug("matchOne",this,{file:Z,pattern:U}),this.debug("matchOne",Z.length,U.length);for(var Q=0,Y=0,W=Z.length,H=U.length;Q<W&&Y<H;Q++,Y++){this.debug("matchOne loop");var K=U[Y],z=Z[Q];if(this.debug(U,K,z),K===!1)return!1;if(K===b0){this.debug("GLOBSTAR",[U,K,z]);var B=Q,F=Y+1;if(F===H){for(this.debug("** at the end");Q<W;Q++)if(Z[Q]==="."||Z[Q]===".."||!J.dot&&Z[Q].charAt(0)===".")return!1;return!0}for(;B<W;){var V=Z[B];if(this.debug(`
|
|
400
400
|
globstar while`,Z,B,U,F,V),this.matchOne(Z.slice(B),U.slice(F),X))return this.debug("globstar found match!",B,W,V),!0;if(V==="."||V===".."||!J.dot&&V.charAt(0)==="."){this.debug("dot detected!",Z,B,U,F);break}this.debug("globstar swallow a segment, and continue"),B++}return!!(X&&(this.debug(`
|
|
401
401
|
>>> no match, partial?`,Z,B,U,F),B===W))}let w;if(typeof K=="string"?(w=z===K,this.debug("string match",K,z,w)):(w=K.test(z),this.debug("pattern match",K,z,w)),!w)return!1}if(Q===W&&Y===H)return!0;if(Q===W)return X;if(Y===H)return Q===W-1&&Z[Q]==="";throw Error("wtf?")}braceExpand(){return wN(this.pattern,this.options)}parse(Z){cZ(Z);let U=this.options;if(Z==="**")return b0;if(Z==="")return"";let X,J=null;(X=Z.match(Vu))?J=U.dot?Ru:Lu:(X=Z.match(Ju))?J=(U.nocase?U.dot?Wu:Yu:U.dot?Qu:qu)(X[1]):(X=Z.match(wu))?J=(U.nocase?U.dot?Mu:Gu:U.dot?Nu:$u)(X):(X=Z.match(Hu))?J=U.dot?zu:Ku:(X=Z.match(Bu))&&(J=Fu);let q=BN.fromGlob(Z,this.options).toMMPattern();return J&&typeof q=="object"&&Reflect.defineProperty(q,"test",{value:J}),q}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let Z=this.set;if(!Z.length)return this.regexp=!1,this.regexp;let U=this.options,X=U.noglobstar?Ou:U.dot?Pu:Cu,J=new Set(U.nocase?["i"]:[]),q=Z.map((W)=>{let H=W.map((z)=>{if(z instanceof RegExp)for(let B of z.flags.split(""))J.add(B);return typeof z=="string"?Tu(z):z===b0?b0:z._src});H.forEach((z,B)=>{let F=H[B+1],V=H[B-1];z!==b0||V===b0||(V===void 0?F!==void 0&&F!==b0?H[B+1]="(?:\\/|"+X+"\\/)?"+F:H[B]=X:F===void 0?H[B-1]=V+"(?:\\/|\\/"+X+")?":F!==b0&&(H[B-1]=V+"(?:\\/|\\/"+X+"\\/)"+F,H[B+1]=b0))});let K=H.filter((z)=>z!==b0);if(this.partial&&K.length>=1){let z=[];for(let B=1;B<=K.length;B++)z.push(K.slice(0,B).join("/"));return"(?:"+z.join("|")+")"}return K.join("/")}).join("|"),[Q,Y]=Z.length>1?["(?:",")"]:["",""];q="^"+Q+q+Y+"$",this.partial&&(q="^(?:\\/|"+Q+q.slice(1,-1)+Y+")$"),this.negate&&(q="^(?!"+q+").+$");try{this.regexp=new RegExp(q,[...J].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(Z){return this.preserveMultipleSlashes?Z.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(Z)?["",...Z.split(/\/+/)]:Z.split(/\/+/)}match(Z,U=this.partial){if(this.debug("match",Z,this.pattern),this.comment)return!1;if(this.empty)return Z==="";if(Z==="/"&&U)return!0;let X=this.options;this.isWindows&&(Z=Z.split("\\").join("/"));let J=this.slashSplit(Z);this.debug(this.pattern,"split",J);let q=this.set;this.debug(this.pattern,"set",q);let Q=J[J.length-1];if(!Q)for(let Y=J.length-2;!Q&&Y>=0;Y--)Q=J[Y];for(let Y=0;Y<q.length;Y++){let W=q[Y],H=J;if(X.matchBase&&W.length===1&&(H=[Q]),this.matchOne(H,W,U))return X.flipNegate?!0:!this.negate}return X.flipNegate?!1:this.negate}static defaults(Z){return g0.defaults(Z).Minimatch}},Su,GN,bY,MN=(Z,U,X,J)=>{typeof bY.emitWarning=="function"?bY.emitWarning(Z,U,X,J):console.error(`[${X}] ${U}: ${Z}`)},iZ,pM,bu=(Z)=>!GN.has(Z),n5=(Z)=>Z&&Z===Math.floor(Z)&&Z>0&&isFinite(Z),NN=(Z)=>n5(Z)?Z<=Math.pow(2,8)?Uint8Array:Z<=Math.pow(2,16)?Uint16Array:Z<=Math.pow(2,32)?Uint32Array:Z<=Number.MAX_SAFE_INTEGER?pZ:null:null,pZ,gu=class Z{heap;length;static#Z=!1;static create(U){let X=NN(U);if(!X)return[];Z.#Z=!0;let J=new Z(U,X);return Z.#Z=!1,J}constructor(U,X){if(!Z.#Z)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new X(U),this.length=0}push(U){this.heap[this.length++]=U}pop(){return this.heap[--this.length]}},aZ,dM,au=(Z)=>!!Z&&typeof Z=="object"&&(Z instanceof rZ||Z instanceof $N||nu(Z)||su(Z)),nu=(Z)=>!!Z&&typeof Z=="object"&&Z instanceof kY&&typeof Z.pipe=="function"&&Z.pipe!==$N.Writable.prototype.pipe,su=(Z)=>!!Z&&typeof Z=="object"&&Z instanceof kY&&typeof Z.write=="function"&&typeof Z.end=="function",G5,M5,a5,vZ,h8,kZ,cM,hZ,iM,I4,Q3,W0,m8,Y3,H0,S0,K0,IY,mZ,D0,i1,EY,_Y,rM,AY,m4,TY,uZ,u8,i6,X4,f8=(Z)=>Promise.resolve().then(Z),ou=(Z)=>Z(),tu=(Z)=>Z==="end"||Z==="finish"||Z==="prefinish",eu=(Z)=>Z instanceof ArrayBuffer||!!Z&&typeof Z=="object"&&Z.constructor&&Z.constructor.name==="ArrayBuffer"&&Z.byteLength>=0,Zf=(Z)=>!Buffer.isBuffer(Z)&&ArrayBuffer.isView(Z),jN=class{src;dest;opts;ondrain;constructor(Z,U,X){this.src=Z,this.dest=U,this.opts=X,this.ondrain=()=>Z[Y3](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(Z){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Uf,Xf=(Z)=>!!Z.objectMode,Jf=(Z)=>!Z.objectMode&&!!Z.encoding&&Z.encoding!=="buffer",rZ,qf,d8,DN=(Z)=>!Z||Z===d8||Z===lu?d8:{...d8,...Z,promises:{...d8.promises,...Z.promises||{}}},ON,Qf=(Z)=>Z.replace(/\//g,"\\").replace(ON,"$1\\"),Yf,w4=0,PN=1,CN=2,u4=4,IN=6,EN=8,r6=10,_N=12,R4=15,l8,xY=16,aM=32,c8=64,E4=128,fZ=256,dZ=512,nM,Wf=1023,SY=(Z)=>Z.isFile()?EN:Z.isDirectory()?u4:Z.isSymbolicLink()?r6:Z.isCharacterDevice()?CN:Z.isBlockDevice()?IN:Z.isSocket()?_N:Z.isFIFO()?PN:w4,sM,i8=(Z)=>{let U=sM.get(Z);if(U)return U;let X=Z.normalize("NFKD");return sM.set(Z,X),X},oM,lZ=(Z)=>{let U=oM.get(Z);if(U)return U;let X=i8(Z.toLowerCase());return oM.set(Z,X),X},tM,Hf,AN,c0,TN,xN,SN,hY,mY,bN,OU1,Kf,zf=(Z)=>Z.length>=1,Bf=(Z)=>Z.length>=1,Ff,gN,Vf,eM=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(Z,{nobrace:U,nocase:X,noext:J,noglobstar:q,platform:Q=Vf}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=Q,this.mmopts={dot:!0,nobrace:U,nocase:X,noext:J,noglobstar:q,optimizationLevel:2,platform:Q,nocomment:!0,nonegate:!0};for(let Y of Z)this.add(Y)}add(Z){let U=new s5(Z,this.mmopts);for(let X=0;X<U.set.length;X++){let J=U.set[X],q=U.globParts[X];if(!J||!q)throw Error("invalid pattern object");for(;J[0]==="."&&q[0]===".";)J.shift(),q.shift();let Q=new gN(J,q,0,this.platform),Y=new s5(Q.globString(),this.mmopts),W=q[q.length-1]==="**",H=Q.isAbsolute();H?this.absolute.push(Y):this.relative.push(Y),W&&(H?this.absoluteChildren.push(Y):this.relativeChildren.push(Y))}}ignored(Z){let U=Z.fullpath(),X=`${U}/`,J=Z.relative()||".",q=`${J}/`;for(let Q of this.relative)if(Q.match(J)||Q.match(q))return!0;for(let Q of this.absolute)if(Q.match(U)||Q.match(X))return!0;return!1}childrenIgnored(Z){let U=Z.fullpath()+"/",X=(Z.relative()||".")+"/";for(let J of this.relativeChildren)if(J.match(X))return!0;for(let J of this.absoluteChildren)if(J.match(U))return!0;return!1}},Lf=class Z{store;constructor(U=new Map){this.store=U}copy(){return new Z(new Map(this.store))}hasWalked(U,X){return this.store.get(U.fullpath())?.has(X.globString())}storeWalked(U,X){let J=U.fullpath(),q=this.store.get(J);q?q.add(X.globString()):this.store.set(J,new Set([X.globString()]))}},Rf=class{store=new Map;add(Z,U,X){let J=(U?2:0)|(X?1:0),q=this.store.get(Z);this.store.set(Z,q===void 0?J:J&q)}entries(){return[...this.store.entries()].map(([Z,U])=>[Z,!!(U&2),!!(U&1)])}},wf=class{store=new Map;add(Z,U){if(!Z.canReaddir())return;let X=this.store.get(Z);X?X.find((J)=>J.globString()===U.globString())||X.push(U):this.store.set(Z,[U])}get(Z){let U=this.store.get(Z);if(!U)throw Error("attempting to walk unknown path");return U}entries(){return this.keys().map((Z)=>[Z,this.store.get(Z)])}keys(){return[...this.store.keys()].filter((Z)=>Z.canReaddir())}},ZN=class Z{hasWalkedCache;matches=new Rf;subwalks=new wf;patterns;follow;dot;opts;constructor(U,X){this.opts=U,this.follow=!!U.follow,this.dot=!!U.dot,this.hasWalkedCache=X?X.copy():new Lf}processPatterns(U,X){this.patterns=X;let J=X.map((q)=>[U,q]);for(let[q,Q]of J){this.hasWalkedCache.storeWalked(q,Q);let Y=Q.root(),W=Q.isAbsolute()&&this.opts.absolute!==!1;if(Y){q=q.resolve(Y==="/"&&this.opts.root!==void 0?this.opts.root:Y);let B=Q.rest();if(B)Q=B;else{this.matches.add(q,!0,!1);continue}}if(q.isENOENT())continue;let H,K,z=!1;for(;typeof(H=Q.pattern())=="string"&&(K=Q.rest());)q=q.resolve(H),Q=K,z=!0;if(H=Q.pattern(),K=Q.rest(),z){if(this.hasWalkedCache.hasWalked(q,Q))continue;this.hasWalkedCache.storeWalked(q,Q)}if(typeof H=="string"){let B=H===".."||H===""||H===".";this.matches.add(q.resolve(H),W,B);continue}else if(H===b0){(!q.isSymbolicLink()||this.follow||Q.checkFollowGlobstar())&&this.subwalks.add(q,Q);let B=K?.pattern(),F=K?.rest();if(!K||(B===""||B===".")&&!F)this.matches.add(q,W,B===""||B===".");else if(B===".."){let V=q.parent||q;F?this.hasWalkedCache.hasWalked(V,F)||this.subwalks.add(V,F):this.matches.add(V,W,!0)}}else H instanceof RegExp&&this.subwalks.add(q,Q)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Z(this.opts,this.hasWalkedCache)}filterEntries(U,X){let J=this.subwalks.get(U),q=this.child();for(let Q of X)for(let Y of J){let W=Y.isAbsolute(),H=Y.pattern(),K=Y.rest();H===b0?q.testGlobstar(Q,Y,K,W):H instanceof RegExp?q.testRegExp(Q,H,K,W):q.testString(Q,H,K,W)}return q}testGlobstar(U,X,J,q){if((this.dot||!U.name.startsWith("."))&&(X.hasMore()||this.matches.add(U,q,!1),U.canReaddir()&&(this.follow||!U.isSymbolicLink()?this.subwalks.add(U,X):U.isSymbolicLink()&&(J&&X.checkFollowGlobstar()?this.subwalks.add(U,J):X.markFollowGlobstar()&&this.subwalks.add(U,X)))),J){let Q=J.pattern();if(typeof Q=="string"&&Q!==".."&&Q!==""&&Q!==".")this.testString(U,Q,J.rest(),q);else if(Q===".."){let Y=U.parent||U;this.subwalks.add(Y,J)}else Q instanceof RegExp&&this.testRegExp(U,Q,J.rest(),q)}}testRegExp(U,X,J,q){X.test(U.name)&&(J?this.subwalks.add(U,J):this.matches.add(U,q,!1))}testString(U,X,J,q){U.isNamed(X)&&(J?this.subwalks.add(U,J):this.matches.add(U,q,!1))}},Gf=(Z,U)=>typeof Z=="string"?new eM([Z],U):Array.isArray(Z)?new eM(Z,U):Z,yN=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#Z=[];#X;#Q;signal;maxDepth;includeChildMatches;constructor(Z,U,X){if(this.patterns=Z,this.path=U,this.opts=X,this.#Q=!X.posix&&X.platform==="win32"?"\\":"/",this.includeChildMatches=X.includeChildMatches!==!1,(X.ignore||!this.includeChildMatches)&&(this.#X=Gf(X.ignore??[],X),!this.includeChildMatches&&typeof this.#X.add!="function"))throw Error("cannot ignore child matches, ignore lacks add() method.");this.maxDepth=X.maxDepth||1/0,X.signal&&(this.signal=X.signal,this.signal.addEventListener("abort",()=>{this.#Z.length=0}))}#q(Z){return this.seen.has(Z)||!!this.#X?.ignored?.(Z)}#Y(Z){return!!this.#X?.childrenIgnored?.(Z)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let Z;for(;!this.paused&&(Z=this.#Z.shift());)Z()}onResume(Z){this.signal?.aborted||(this.paused?this.#Z.push(Z):Z())}async matchCheck(Z,U){if(U&&this.opts.nodir)return;let X;if(this.opts.realpath){if(X=Z.realpathCached()||await Z.realpath(),!X)return;Z=X}let J=Z.isUnknown()||this.opts.stat?await Z.lstat():Z;if(this.opts.follow&&this.opts.nodir&&J?.isSymbolicLink()){let q=await J.realpath();q&&(q.isUnknown()||this.opts.stat)&&await q.lstat()}return this.matchCheckTest(J,U)}matchCheckTest(Z,U){return Z&&(this.maxDepth===1/0||Z.depth()<=this.maxDepth)&&(!U||Z.canReaddir())&&(!this.opts.nodir||!Z.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!Z.isSymbolicLink()||!Z.realpathCached()?.isDirectory())&&!this.#q(Z)?Z:void 0}matchCheckSync(Z,U){if(U&&this.opts.nodir)return;let X;if(this.opts.realpath){if(X=Z.realpathCached()||Z.realpathSync(),!X)return;Z=X}let J=Z.isUnknown()||this.opts.stat?Z.lstatSync():Z;if(this.opts.follow&&this.opts.nodir&&J?.isSymbolicLink()){let q=J.realpathSync();q&&(q?.isUnknown()||this.opts.stat)&&q.lstatSync()}return this.matchCheckTest(J,U)}matchFinish(Z,U){if(this.#q(Z))return;if(!this.includeChildMatches&&this.#X?.add){let q=`${Z.relativePosix()}/**`;this.#X.add(q)}let X=this.opts.absolute===void 0?U:this.opts.absolute;this.seen.add(Z);let J=this.opts.mark&&Z.isDirectory()?this.#Q:"";if(this.opts.withFileTypes)this.matchEmit(Z);else if(X){let q=this.opts.posix?Z.fullpathPosix():Z.fullpath();this.matchEmit(q+J)}else{let q=this.opts.posix?Z.relativePosix():Z.relative(),Q=this.opts.dotRelative&&!q.startsWith(".."+this.#Q)?"."+this.#Q:"";this.matchEmit(q?Q+q+J:"."+J)}}async match(Z,U,X){let J=await this.matchCheck(Z,X);J&&this.matchFinish(J,U)}matchSync(Z,U,X){let J=this.matchCheckSync(Z,X);J&&this.matchFinish(J,U)}walkCB(Z,U,X){this.signal?.aborted&&X(),this.walkCB2(Z,U,new ZN(this.opts),X)}walkCB2(Z,U,X,J){if(this.#Y(Z))return J();if(this.signal?.aborted&&J(),this.paused){this.onResume(()=>this.walkCB2(Z,U,X,J));return}X.processPatterns(Z,U);let q=1,Q=()=>{--q===0&&J()};for(let[Y,W,H]of X.matches.entries())this.#q(Y)||(q++,this.match(Y,W,H).then(()=>Q()));for(let Y of X.subwalkTargets()){if(this.maxDepth!==1/0&&Y.depth()>=this.maxDepth)continue;q++;let W=Y.readdirCached();Y.calledReaddir()?this.walkCB3(Y,W,X,Q):Y.readdirCB((H,K)=>this.walkCB3(Y,K,X,Q),!0)}Q()}walkCB3(Z,U,X,J){X=X.filterEntries(Z,U);let q=1,Q=()=>{--q===0&&J()};for(let[Y,W,H]of X.matches.entries())this.#q(Y)||(q++,this.match(Y,W,H).then(()=>Q()));for(let[Y,W]of X.subwalks.entries())q++,this.walkCB2(Y,W,X.child(),Q);Q()}walkCBSync(Z,U,X){this.signal?.aborted&&X(),this.walkCB2Sync(Z,U,new ZN(this.opts),X)}walkCB2Sync(Z,U,X,J){if(this.#Y(Z))return J();if(this.signal?.aborted&&J(),this.paused){this.onResume(()=>this.walkCB2Sync(Z,U,X,J));return}X.processPatterns(Z,U);let q=1,Q=()=>{--q===0&&J()};for(let[Y,W,H]of X.matches.entries())this.#q(Y)||this.matchSync(Y,W,H);for(let Y of X.subwalkTargets()){if(this.maxDepth!==1/0&&Y.depth()>=this.maxDepth)continue;q++;let W=Y.readdirSync();this.walkCB3Sync(Y,W,X,Q)}Q()}walkCB3Sync(Z,U,X,J){X=X.filterEntries(Z,U);let q=1,Q=()=>{--q===0&&J()};for(let[Y,W,H]of X.matches.entries())this.#q(Y)||this.matchSync(Y,W,H);for(let[Y,W]of X.subwalks.entries())q++,this.walkCB2Sync(Y,W,X.child(),Q);Q()}},UN,XN,Mf,a6,Nf=(Z,U={})=>{Array.isArray(Z)||(Z=[Z]);for(let X of Z)if(new s5(X,U).hasMagic())return!0;return!1},$f,jf,Df,Of,Pf,qN;var hN=P(()=>{YN="\x00SLASH"+Math.random()+"\x00",WN="\x00OPEN"+Math.random()+"\x00",yY="\x00CLOSE"+Math.random()+"\x00",HN="\x00COMMA"+Math.random()+"\x00",KN="\x00PERIOD"+Math.random()+"\x00",Tm=new RegExp(YN,"g"),xm=new RegExp(WN,"g"),Sm=new RegExp(yY,"g"),bm=new RegExp(HN,"g"),gm=new RegExp(KN,"g"),ym=/\\\\/g,vm=/\\{/g,km=/\\}/g,hm=/\\,/g,mm=/\\./g;am={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},om=new Set(["!","?","+","*","@"]),em=new Set(["[","."]),Zu=new Set(["..","."]),Uu=new Set("().*{}+?[]^$\\!"),mM=vY+"*?",uM=vY+"+?",Ju=/^\*+([^+@!?\*\[\(]*)$/,Hu=/^\*+\.\*+$/,Bu=/^\.\*+$/,Vu=/^\*+$/,wu=/^\?+([^+@!?\*\[\(]*)?$/,RN=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",fM={win32:{sep:"\\"},posix:{sep:"/"}},ju=RN==="win32"?fM.win32.sep:fM.posix.sep;g0.sep=ju;b0=Symbol("globstar **");g0.GLOBSTAR=b0;Ou=Du+"*?";g0.filter=Iu;g0.defaults=Eu;g0.braceExpand=wN;g0.makeRe=_u;g0.match=Au;lM=/[?*]|[+@!]\(.*?\)|\[|\]/;g0.AST=BN;g0.Minimatch=s5;g0.escape=FN;g0.unescape=W3;Su=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,GN=new Set,bY=typeof process=="object"&&process?process:{},iZ=globalThis.AbortController,pM=globalThis.AbortSignal;if(typeof iZ>"u"){pM=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(X,J){this._onabort.push(J)}},iZ=class{constructor(){U()}signal=new pM;abort(X){if(!this.signal.aborted){this.signal.reason=X,this.signal.aborted=!0;for(let J of this.signal._onabort)J(X);this.signal.onabort?.(X)}}};let Z=bY.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",U=()=>{Z&&(Z=!1,MN("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",U))}}pZ=class extends Array{constructor(Z){super(Z),this.fill(0)}},aZ=class Z{#Z;#X;#Q;#q;#Y;#$;#G;#z;get perf(){return this.#z}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#W;#F;#B;#H;#J;#V;#j;#N;#L;#_;#R;#P;#C;#w;#M;#D;#I;#U;#g;static unsafeExposeInternals(U){return{starts:U.#C,ttls:U.#w,autopurgeTimers:U.#M,sizes:U.#P,keyMap:U.#B,keyList:U.#H,valList:U.#J,next:U.#V,prev:U.#j,get head(){return U.#N},get tail(){return U.#L},free:U.#_,isBackgroundFetch:(X)=>U.#K(X),backgroundFetch:(X,J,q,Q)=>U.#l(X,J,q,Q),moveToTail:(X)=>U.#v(X),indexes:(X)=>U.#T(X),rindexes:(X)=>U.#x(X),isStale:(X)=>U.#O(X)}}get max(){return this.#Z}get maxSize(){return this.#X}get calculatedSize(){return this.#F}get size(){return this.#W}get fetchMethod(){return this.#$}get memoMethod(){return this.#G}get dispose(){return this.#Q}get onInsert(){return this.#q}get disposeAfter(){return this.#Y}constructor(U){let{max:X=0,ttl:J,ttlResolution:q=1,ttlAutopurge:Q,updateAgeOnGet:Y,updateAgeOnHas:W,allowStale:H,dispose:K,onInsert:z,disposeAfter:B,noDisposeOnSet:F,noUpdateTTL:V,maxSize:w=0,maxEntrySize:M=0,sizeCalculation:N,fetchMethod:$,memoMethod:O,noDeleteOnFetchRejection:C,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:T,ignoreFetchAbort:f,perf:p}=U;if(p!==void 0&&typeof p?.now!="function")throw TypeError("perf option must have a now() method if specified");if(this.#z=p??Su,X!==0&&!n5(X))throw TypeError("max option must be a nonnegative integer");let y=X?NN(X):Array;if(!y)throw Error("invalid max value: "+X);if(this.#Z=X,this.#X=w,this.maxEntrySize=M||this.#X,this.sizeCalculation=N,this.sizeCalculation){if(!this.#X&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw TypeError("sizeCalculation set to non-function")}if(O!==void 0&&typeof O!="function")throw TypeError("memoMethod must be a function if defined");if(this.#G=O,$!==void 0&&typeof $!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#$=$,this.#I=!!$,this.#B=new Map,this.#H=Array(X).fill(void 0),this.#J=Array(X).fill(void 0),this.#V=new y(X),this.#j=new y(X),this.#N=0,this.#L=0,this.#_=gu.create(X),this.#W=0,this.#F=0,typeof K=="function"&&(this.#Q=K),typeof z=="function"&&(this.#q=z),typeof B=="function"?(this.#Y=B,this.#R=[]):(this.#Y=void 0,this.#R=void 0),this.#D=!!this.#Q,this.#g=!!this.#q,this.#U=!!this.#Y,this.noDisposeOnSet=!!F,this.noUpdateTTL=!!V,this.noDeleteOnFetchRejection=!!C,this.allowStaleOnFetchRejection=!!u,this.allowStaleOnFetchAbort=!!T,this.ignoreFetchAbort=!!f,this.maxEntrySize!==0){if(this.#X!==0&&!n5(this.#X))throw TypeError("maxSize must be a positive integer if specified");if(!n5(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#d()}if(this.allowStale=!!H,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!Y,this.updateAgeOnHas=!!W,this.ttlResolution=n5(q)||q===0?q:1,this.ttlAutopurge=!!Q,this.ttl=J||0,this.ttl){if(!n5(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#S()}if(this.#Z===0&&this.ttl===0&&this.#X===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#Z&&!this.#X){let A="LRU_CACHE_UNBOUNDED";bu(A)&&(GN.add(A),MN("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",A,Z))}}getRemainingTTL(U){return this.#B.has(U)?1/0:0}#S(){let U=new pZ(this.#Z),X=new pZ(this.#Z);this.#w=U,this.#C=X;let J=this.ttlAutopurge?Array(this.#Z):void 0;this.#M=J,this.#h=(Y,W,H=this.#z.now())=>{if(X[Y]=W!==0?H:0,U[Y]=W,J?.[Y]&&(clearTimeout(J[Y]),J[Y]=void 0),W!==0&&J){let K=setTimeout(()=>{this.#O(Y)&&this.#A(this.#H[Y],"expire")},W+1);K.unref&&K.unref(),J[Y]=K}},this.#E=(Y)=>{X[Y]=U[Y]!==0?this.#z.now():0},this.#b=(Y,W)=>{if(U[W]){let H=U[W],K=X[W];if(!H||!K)return;Y.ttl=H,Y.start=K,Y.now=q||Q();let z=Y.now-K;Y.remainingTTL=H-z}};let q=0,Q=()=>{let Y=this.#z.now();if(this.ttlResolution>0){q=Y;let W=setTimeout(()=>q=0,this.ttlResolution);W.unref&&W.unref()}return Y};this.getRemainingTTL=(Y)=>{let W=this.#B.get(Y);if(W===void 0)return 0;let H=U[W],K=X[W];if(!H||!K)return 1/0;let z=(q||Q())-K;return H-z},this.#O=(Y)=>{let W=X[Y],H=U[Y];return!!H&&!!W&&(q||Q())-W>H}}#E=()=>{};#b=()=>{};#h=()=>{};#O=()=>!1;#d(){let U=new pZ(this.#Z);this.#F=0,this.#P=U,this.#k=(X)=>{this.#F-=U[X],U[X]=0},this.#m=(X,J,q,Q)=>{if(this.#K(J))return 0;if(!n5(q))if(Q){if(typeof Q!="function")throw TypeError("sizeCalculation must be a function");if(q=Q(J,X),!n5(q))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return q},this.#y=(X,J,q)=>{if(U[X]=J,this.#X){let Q=this.#X-U[X];for(;this.#F>Q;)this.#f(!0)}this.#F+=U[X],q&&(q.entrySize=J,q.totalCalculatedSize=this.#F)}}#k=(U)=>{};#y=(U,X,J)=>{};#m=(U,X,J,q)=>{if(J||q)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#T({allowStale:U=this.allowStale}={}){if(this.#W)for(let X=this.#L;!(!this.#u(X)||((U||!this.#O(X))&&(yield X),X===this.#N));)X=this.#j[X]}*#x({allowStale:U=this.allowStale}={}){if(this.#W)for(let X=this.#N;!(!this.#u(X)||((U||!this.#O(X))&&(yield X),X===this.#L));)X=this.#V[X]}#u(U){return U!==void 0&&this.#B.get(this.#H[U])===U}*entries(){for(let U of this.#T())this.#J[U]!==void 0&&this.#H[U]!==void 0&&!this.#K(this.#J[U])&&(yield[this.#H[U],this.#J[U]])}*rentries(){for(let U of this.#x())this.#J[U]!==void 0&&this.#H[U]!==void 0&&!this.#K(this.#J[U])&&(yield[this.#H[U],this.#J[U]])}*keys(){for(let U of this.#T()){let X=this.#H[U];X!==void 0&&!this.#K(this.#J[U])&&(yield X)}}*rkeys(){for(let U of this.#x()){let X=this.#H[U];X!==void 0&&!this.#K(this.#J[U])&&(yield X)}}*values(){for(let U of this.#T())this.#J[U]!==void 0&&!this.#K(this.#J[U])&&(yield this.#J[U])}*rvalues(){for(let U of this.#x())this.#J[U]!==void 0&&!this.#K(this.#J[U])&&(yield this.#J[U])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(U,X={}){for(let J of this.#T()){let q=this.#J[J],Q=this.#K(q)?q.__staleWhileFetching:q;if(Q!==void 0&&U(Q,this.#H[J],this))return this.get(this.#H[J],X)}}forEach(U,X=this){for(let J of this.#T()){let q=this.#J[J],Q=this.#K(q)?q.__staleWhileFetching:q;Q!==void 0&&U.call(X,Q,this.#H[J],this)}}rforEach(U,X=this){for(let J of this.#x()){let q=this.#J[J],Q=this.#K(q)?q.__staleWhileFetching:q;Q!==void 0&&U.call(X,Q,this.#H[J],this)}}purgeStale(){let U=!1;for(let X of this.#x({allowStale:!0}))this.#O(X)&&(this.#A(this.#H[X],"expire"),U=!0);return U}info(U){let X=this.#B.get(U);if(X===void 0)return;let J=this.#J[X],q=this.#K(J)?J.__staleWhileFetching:J;if(q===void 0)return;let Q={value:q};if(this.#w&&this.#C){let Y=this.#w[X],W=this.#C[X];if(Y&&W){let H=Y-(this.#z.now()-W);Q.ttl=H,Q.start=Date.now()}}return this.#P&&(Q.size=this.#P[X]),Q}dump(){let U=[];for(let X of this.#T({allowStale:!0})){let J=this.#H[X],q=this.#J[X],Q=this.#K(q)?q.__staleWhileFetching:q;if(Q===void 0||J===void 0)continue;let Y={value:Q};if(this.#w&&this.#C){Y.ttl=this.#w[X];let W=this.#z.now()-this.#C[X];Y.start=Math.floor(Date.now()-W)}this.#P&&(Y.size=this.#P[X]),U.unshift([J,Y])}return U}load(U){this.clear();for(let[X,J]of U){if(J.start){let q=Date.now()-J.start;J.start=this.#z.now()-q}this.set(X,J.value,J)}}set(U,X,J={}){if(X===void 0)return this.delete(U),this;let{ttl:q=this.ttl,start:Q,noDisposeOnSet:Y=this.noDisposeOnSet,sizeCalculation:W=this.sizeCalculation,status:H}=J,{noUpdateTTL:K=this.noUpdateTTL}=J,z=this.#m(U,X,J.size||0,W);if(this.maxEntrySize&&z>this.maxEntrySize)return H&&(H.set="miss",H.maxEntrySizeExceeded=!0),this.#A(U,"set"),this;let B=this.#W===0?void 0:this.#B.get(U);if(B===void 0)B=this.#W===0?this.#L:this.#_.length!==0?this.#_.pop():this.#W===this.#Z?this.#f(!1):this.#W,this.#H[B]=U,this.#J[B]=X,this.#B.set(U,B),this.#V[this.#L]=B,this.#j[B]=this.#L,this.#L=B,this.#W++,this.#y(B,z,H),H&&(H.set="add"),K=!1,this.#g&&this.#q?.(X,U,"add");else{this.#v(B);let F=this.#J[B];if(X!==F){if(this.#I&&this.#K(F)){F.__abortController.abort(Error("replaced"));let{__staleWhileFetching:V}=F;V!==void 0&&!Y&&(this.#D&&this.#Q?.(V,U,"set"),this.#U&&this.#R?.push([V,U,"set"]))}else Y||(this.#D&&this.#Q?.(F,U,"set"),this.#U&&this.#R?.push([F,U,"set"]));if(this.#k(B),this.#y(B,z,H),this.#J[B]=X,H){H.set="replace";let V=F&&this.#K(F)?F.__staleWhileFetching:F;V!==void 0&&(H.oldValue=V)}}else H&&(H.set="update");this.#g&&this.onInsert?.(X,U,X===F?"update":"replace")}if(q!==0&&!this.#w&&this.#S(),this.#w&&(K||this.#h(B,q,Q),H&&this.#b(H,B)),!Y&&this.#U&&this.#R){let F=this.#R,V;for(;V=F?.shift();)this.#Y?.(...V)}return this}pop(){try{for(;this.#W;){let U=this.#J[this.#N];if(this.#f(!0),this.#K(U)){if(U.__staleWhileFetching)return U.__staleWhileFetching}else if(U!==void 0)return U}}finally{if(this.#U&&this.#R){let U=this.#R,X;for(;X=U?.shift();)this.#Y?.(...X)}}}#f(U){let X=this.#N,J=this.#H[X],q=this.#J[X];return this.#I&&this.#K(q)?q.__abortController.abort(Error("evicted")):(this.#D||this.#U)&&(this.#D&&this.#Q?.(q,J,"evict"),this.#U&&this.#R?.push([q,J,"evict"])),this.#k(X),this.#M?.[X]&&(clearTimeout(this.#M[X]),this.#M[X]=void 0),U&&(this.#H[X]=void 0,this.#J[X]=void 0,this.#_.push(X)),this.#W===1?(this.#N=this.#L=0,this.#_.length=0):this.#N=this.#V[X],this.#B.delete(J),this.#W--,X}has(U,X={}){let{updateAgeOnHas:J=this.updateAgeOnHas,status:q}=X,Q=this.#B.get(U);if(Q!==void 0){let Y=this.#J[Q];if(this.#K(Y)&&Y.__staleWhileFetching===void 0)return!1;if(this.#O(Q))q&&(q.has="stale",this.#b(q,Q));else return J&&this.#E(Q),q&&(q.has="hit",this.#b(q,Q)),!0}else q&&(q.has="miss");return!1}peek(U,X={}){let{allowStale:J=this.allowStale}=X,q=this.#B.get(U);if(q===void 0||!J&&this.#O(q))return;let Q=this.#J[q];return this.#K(Q)?Q.__staleWhileFetching:Q}#l(U,X,J,q){let Q=X===void 0?void 0:this.#J[X];if(this.#K(Q))return Q;let Y=new iZ,{signal:W}=J;W?.addEventListener("abort",()=>Y.abort(W.reason),{signal:Y.signal});let H={signal:Y.signal,options:J,context:q},K=(M,N=!1)=>{let{aborted:$}=Y.signal,O=J.ignoreFetchAbort&&M!==void 0,C=J.ignoreFetchAbort||!!(J.allowStaleOnFetchAbort&&M!==void 0);if(J.status&&($&&!N?(J.status.fetchAborted=!0,J.status.fetchError=Y.signal.reason,O&&(J.status.fetchAbortIgnored=!0)):J.status.fetchResolved=!0),$&&!O&&!N)return B(Y.signal.reason,C);let b=V,u=this.#J[X];return(u===V||O&&N&&u===void 0)&&(M===void 0?b.__staleWhileFetching!==void 0?this.#J[X]=b.__staleWhileFetching:this.#A(U,"fetch"):(J.status&&(J.status.fetchUpdated=!0),this.set(U,M,H.options))),M},z=(M)=>(J.status&&(J.status.fetchRejected=!0,J.status.fetchError=M),B(M,!1)),B=(M,N)=>{let{aborted:$}=Y.signal,O=$&&J.allowStaleOnFetchAbort,C=O||J.allowStaleOnFetchRejection,b=C||J.noDeleteOnFetchRejection,u=V;if(this.#J[X]===V&&(!b||!N&&u.__staleWhileFetching===void 0?this.#A(U,"fetch"):O||(this.#J[X]=u.__staleWhileFetching)),C)return J.status&&u.__staleWhileFetching!==void 0&&(J.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw M},F=(M,N)=>{let $=this.#$?.(U,Q,H);$&&$ instanceof Promise&&$.then((O)=>M(O===void 0?void 0:O),N),Y.signal.addEventListener("abort",()=>{(!J.ignoreFetchAbort||J.allowStaleOnFetchAbort)&&(M(void 0),J.allowStaleOnFetchAbort&&(M=(O)=>K(O,!0)))})};J.status&&(J.status.fetchDispatched=!0);let V=new Promise(F).then(K,z),w=Object.assign(V,{__abortController:Y,__staleWhileFetching:Q,__returned:void 0});return X===void 0?(this.set(U,w,{...H.options,status:void 0}),X=this.#B.get(U)):this.#J[X]=w,w}#K(U){if(!this.#I)return!1;let X=U;return!!X&&X instanceof Promise&&X.hasOwnProperty("__staleWhileFetching")&&X.__abortController instanceof iZ}async fetch(U,X={}){let{allowStale:J=this.allowStale,updateAgeOnGet:q=this.updateAgeOnGet,noDeleteOnStaleGet:Q=this.noDeleteOnStaleGet,ttl:Y=this.ttl,noDisposeOnSet:W=this.noDisposeOnSet,size:H=0,sizeCalculation:K=this.sizeCalculation,noUpdateTTL:z=this.noUpdateTTL,noDeleteOnFetchRejection:B=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:F=this.allowStaleOnFetchRejection,ignoreFetchAbort:V=this.ignoreFetchAbort,allowStaleOnFetchAbort:w=this.allowStaleOnFetchAbort,context:M,forceRefresh:N=!1,status:$,signal:O}=X;if(!this.#I)return $&&($.fetch="get"),this.get(U,{allowStale:J,updateAgeOnGet:q,noDeleteOnStaleGet:Q,status:$});let C={allowStale:J,updateAgeOnGet:q,noDeleteOnStaleGet:Q,ttl:Y,noDisposeOnSet:W,size:H,sizeCalculation:K,noUpdateTTL:z,noDeleteOnFetchRejection:B,allowStaleOnFetchRejection:F,allowStaleOnFetchAbort:w,ignoreFetchAbort:V,status:$,signal:O},b=this.#B.get(U);if(b===void 0){$&&($.fetch="miss");let u=this.#l(U,b,C,M);return u.__returned=u}else{let u=this.#J[b];if(this.#K(u)){let y=J&&u.__staleWhileFetching!==void 0;return $&&($.fetch="inflight",y&&($.returnedStale=!0)),y?u.__staleWhileFetching:u.__returned=u}let T=this.#O(b);if(!N&&!T)return $&&($.fetch="hit"),this.#v(b),q&&this.#E(b),$&&this.#b($,b),u;let f=this.#l(U,b,C,M),p=f.__staleWhileFetching!==void 0&&J;return $&&($.fetch=T?"stale":"refresh",p&&T&&($.returnedStale=!0)),p?f.__staleWhileFetching:f.__returned=f}}async forceFetch(U,X={}){let J=await this.fetch(U,X);if(J===void 0)throw Error("fetch() returned undefined");return J}memo(U,X={}){let J=this.#G;if(!J)throw Error("no memoMethod provided to constructor");let{context:q,forceRefresh:Q,...Y}=X,W=this.get(U,Y);if(!Q&&W!==void 0)return W;let H=J(U,W,{options:Y,context:q});return this.set(U,H,Y),H}get(U,X={}){let{allowStale:J=this.allowStale,updateAgeOnGet:q=this.updateAgeOnGet,noDeleteOnStaleGet:Q=this.noDeleteOnStaleGet,status:Y}=X,W=this.#B.get(U);if(W!==void 0){let H=this.#J[W],K=this.#K(H);return Y&&this.#b(Y,W),this.#O(W)?(Y&&(Y.get="stale"),K?(Y&&J&&H.__staleWhileFetching!==void 0&&(Y.returnedStale=!0),J?H.__staleWhileFetching:void 0):(Q||this.#A(U,"expire"),Y&&J&&(Y.returnedStale=!0),J?H:void 0)):(Y&&(Y.get="hit"),K?H.__staleWhileFetching:(this.#v(W),q&&this.#E(W),H))}else Y&&(Y.get="miss")}#p(U,X){this.#j[X]=U,this.#V[U]=X}#v(U){U!==this.#L&&(U===this.#N?this.#N=this.#V[U]:this.#p(this.#j[U],this.#V[U]),this.#p(this.#L,U),this.#L=U)}delete(U){return this.#A(U,"delete")}#A(U,X){let J=!1;if(this.#W!==0){let q=this.#B.get(U);if(q!==void 0)if(this.#M?.[q]&&(clearTimeout(this.#M?.[q]),this.#M[q]=void 0),J=!0,this.#W===1)this.#c(X);else{this.#k(q);let Q=this.#J[q];if(this.#K(Q)?Q.__abortController.abort(Error("deleted")):(this.#D||this.#U)&&(this.#D&&this.#Q?.(Q,U,X),this.#U&&this.#R?.push([Q,U,X])),this.#B.delete(U),this.#H[q]=void 0,this.#J[q]=void 0,q===this.#L)this.#L=this.#j[q];else if(q===this.#N)this.#N=this.#V[q];else{let Y=this.#j[q];this.#V[Y]=this.#V[q];let W=this.#V[q];this.#j[W]=this.#j[q]}this.#W--,this.#_.push(q)}}if(this.#U&&this.#R?.length){let q=this.#R,Q;for(;Q=q?.shift();)this.#Y?.(...Q)}return J}clear(){return this.#c("delete")}#c(U){for(let X of this.#x({allowStale:!0})){let J=this.#J[X];if(this.#K(J))J.__abortController.abort(Error("deleted"));else{let q=this.#H[X];this.#D&&this.#Q?.(J,q,U),this.#U&&this.#R?.push([J,q,U])}}if(this.#B.clear(),this.#J.fill(void 0),this.#H.fill(void 0),this.#w&&this.#C){this.#w.fill(0),this.#C.fill(0);for(let X of this.#M??[])X!==void 0&&clearTimeout(X);this.#M?.fill(void 0)}if(this.#P&&this.#P.fill(0),this.#N=0,this.#L=0,this.#_.length=0,this.#F=0,this.#W=0,this.#U&&this.#R){let X=this.#R,J;for(;J=X?.shift();)this.#Y?.(...J)}}},dM=typeof process=="object"&&process?process:{stdout:null,stderr:null},G5=Symbol("EOF"),M5=Symbol("maybeEmitEnd"),a5=Symbol("emittedEnd"),vZ=Symbol("emittingEnd"),h8=Symbol("emittedError"),kZ=Symbol("closed"),cM=Symbol("read"),hZ=Symbol("flush"),iM=Symbol("flushChunk"),I4=Symbol("encoding"),Q3=Symbol("decoder"),W0=Symbol("flowing"),m8=Symbol("paused"),Y3=Symbol("resume"),H0=Symbol("buffer"),S0=Symbol("pipes"),K0=Symbol("bufferLength"),IY=Symbol("bufferPush"),mZ=Symbol("bufferShift"),D0=Symbol("objectMode"),i1=Symbol("destroyed"),EY=Symbol("error"),_Y=Symbol("emitData"),rM=Symbol("emitEnd"),AY=Symbol("emitEnd2"),m4=Symbol("async"),TY=Symbol("abort"),uZ=Symbol("aborted"),u8=Symbol("signal"),i6=Symbol("dataListeners"),X4=Symbol("discarded"),Uf=class extends jN{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(Z,U,X){super(Z,U,X),this.proxyErrors=(J)=>this.dest.emit("error",J),Z.on("error",this.proxyErrors)}},rZ=class extends kY{[W0]=!1;[m8]=!1;[S0]=[];[H0]=[];[D0];[I4];[m4];[Q3];[G5]=!1;[a5]=!1;[vZ]=!1;[kZ]=!1;[h8]=null;[K0]=0;[i1]=!1;[u8];[uZ]=!1;[i6]=0;[X4]=!1;writable=!0;readable=!0;constructor(...Z){let U=Z[0]||{};if(super(),U.objectMode&&typeof U.encoding=="string")throw TypeError("Encoding and objectMode may not be used together");Xf(U)?(this[D0]=!0,this[I4]=null):Jf(U)?(this[I4]=U.encoding,this[D0]=!1):(this[D0]=!1,this[I4]=null),this[m4]=!!U.async,this[Q3]=this[I4]?new ru(this[I4]):null,U&&U.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[H0]}),U&&U.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[S0]});let{signal:X}=U;X&&(this[u8]=X,X.aborted?this[TY]():X.addEventListener("abort",()=>this[TY]()))}get bufferLength(){return this[K0]}get encoding(){return this[I4]}set encoding(Z){throw Error("Encoding must be set at instantiation time")}setEncoding(Z){throw Error("Encoding must be set at instantiation time")}get objectMode(){return this[D0]}set objectMode(Z){throw Error("objectMode must be set at instantiation time")}get async(){return this[m4]}set async(Z){this[m4]=this[m4]||!!Z}[TY](){this[uZ]=!0,this.emit("abort",this[u8]?.reason),this.destroy(this[u8]?.reason)}get aborted(){return this[uZ]}set aborted(Z){}write(Z,U,X){if(this[uZ])return!1;if(this[G5])throw Error("write after end");if(this[i1])return this.emit("error",Object.assign(Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof U=="function"&&(X=U,U="utf8"),U||(U="utf8");let J=this[m4]?f8:ou;if(!this[D0]&&!Buffer.isBuffer(Z)){if(Zf(Z))Z=Buffer.from(Z.buffer,Z.byteOffset,Z.byteLength);else if(eu(Z))Z=Buffer.from(Z);else if(typeof Z!="string")throw Error("Non-contiguous data written to non-objectMode stream")}return this[D0]?(this[W0]&&this[K0]!==0&&this[hZ](!0),this[W0]?this.emit("data",Z):this[IY](Z),this[K0]!==0&&this.emit("readable"),X&&J(X),this[W0]):Z.length?(typeof Z=="string"&&!(U===this[I4]&&!this[Q3]?.lastNeed)&&(Z=Buffer.from(Z,U)),Buffer.isBuffer(Z)&&this[I4]&&(Z=this[Q3].write(Z)),this[W0]&&this[K0]!==0&&this[hZ](!0),this[W0]?this.emit("data",Z):this[IY](Z),this[K0]!==0&&this.emit("readable"),X&&J(X),this[W0]):(this[K0]!==0&&this.emit("readable"),X&&J(X),this[W0])}read(Z){if(this[i1])return null;if(this[X4]=!1,this[K0]===0||Z===0||Z&&Z>this[K0])return this[M5](),null;this[D0]&&(Z=null),this[H0].length>1&&!this[D0]&&(this[H0]=[this[I4]?this[H0].join(""):Buffer.concat(this[H0],this[K0])]);let U=this[cM](Z||null,this[H0][0]);return this[M5](),U}[cM](Z,U){if(this[D0])this[mZ]();else{let X=U;Z===X.length||Z===null?this[mZ]():typeof X=="string"?(this[H0][0]=X.slice(Z),U=X.slice(0,Z),this[K0]-=Z):(this[H0][0]=X.subarray(Z),U=X.subarray(0,Z),this[K0]-=Z)}return this.emit("data",U),!this[H0].length&&!this[G5]&&this.emit("drain"),U}end(Z,U,X){return typeof Z=="function"&&(X=Z,Z=void 0),typeof U=="function"&&(X=U,U="utf8"),Z!==void 0&&this.write(Z,U),X&&this.once("end",X),this[G5]=!0,this.writable=!1,(this[W0]||!this[m8])&&this[M5](),this}[Y3](){this[i1]||(!this[i6]&&!this[S0].length&&(this[X4]=!0),this[m8]=!1,this[W0]=!0,this.emit("resume"),this[H0].length?this[hZ]():this[G5]?this[M5]():this.emit("drain"))}resume(){return this[Y3]()}pause(){this[W0]=!1,this[m8]=!0,this[X4]=!1}get destroyed(){return this[i1]}get flowing(){return this[W0]}get paused(){return this[m8]}[IY](Z){this[D0]?this[K0]+=1:this[K0]+=Z.length,this[H0].push(Z)}[mZ](){return this[D0]?this[K0]-=1:this[K0]-=this[H0][0].length,this[H0].shift()}[hZ](Z=!1){do;while(this[iM](this[mZ]())&&this[H0].length);!Z&&!this[H0].length&&!this[G5]&&this.emit("drain")}[iM](Z){return this.emit("data",Z),this[W0]}pipe(Z,U){if(this[i1])return Z;this[X4]=!1;let X=this[a5];return U=U||{},Z===dM.stdout||Z===dM.stderr?U.end=!1:U.end=U.end!==!1,U.proxyErrors=!!U.proxyErrors,X?U.end&&Z.end():(this[S0].push(U.proxyErrors?new Uf(this,Z,U):new jN(this,Z,U)),this[m4]?f8(()=>this[Y3]()):this[Y3]()),Z}unpipe(Z){let U=this[S0].find((X)=>X.dest===Z);U&&(this[S0].length===1?(this[W0]&&this[i6]===0&&(this[W0]=!1),this[S0]=[]):this[S0].splice(this[S0].indexOf(U),1),U.unpipe())}addListener(Z,U){return this.on(Z,U)}on(Z,U){let X=super.on(Z,U);if(Z==="data")this[X4]=!1,this[i6]++,!this[S0].length&&!this[W0]&&this[Y3]();else if(Z==="readable"&&this[K0]!==0)super.emit("readable");else if(tu(Z)&&this[a5])super.emit(Z),this.removeAllListeners(Z);else if(Z==="error"&&this[h8]){let J=U;this[m4]?f8(()=>J.call(this,this[h8])):J.call(this,this[h8])}return X}removeListener(Z,U){return this.off(Z,U)}off(Z,U){let X=super.off(Z,U);return Z==="data"&&(this[i6]=this.listeners("data").length,this[i6]===0&&!this[X4]&&!this[S0].length&&(this[W0]=!1)),X}removeAllListeners(Z){let U=super.removeAllListeners(Z);return(Z==="data"||Z===void 0)&&(this[i6]=0,!this[X4]&&!this[S0].length&&(this[W0]=!1)),U}get emittedEnd(){return this[a5]}[M5](){!this[vZ]&&!this[a5]&&!this[i1]&&this[H0].length===0&&this[G5]&&(this[vZ]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[kZ]&&this.emit("close"),this[vZ]=!1)}emit(Z,...U){let X=U[0];if(Z!=="error"&&Z!=="close"&&Z!==i1&&this[i1])return!1;if(Z==="data")return!this[D0]&&!X?!1:this[m4]?(f8(()=>this[_Y](X)),!0):this[_Y](X);if(Z==="end")return this[rM]();if(Z==="close"){if(this[kZ]=!0,!this[a5]&&!this[i1])return!1;let q=super.emit("close");return this.removeAllListeners("close"),q}else if(Z==="error"){this[h8]=X,super.emit(EY,X);let q=!this[u8]||this.listeners("error").length?super.emit("error",X):!1;return this[M5](),q}else if(Z==="resume"){let q=super.emit("resume");return this[M5](),q}else if(Z==="finish"||Z==="prefinish"){let q=super.emit(Z);return this.removeAllListeners(Z),q}let J=super.emit(Z,...U);return this[M5](),J}[_Y](Z){for(let X of this[S0])X.dest.write(Z)===!1&&this.pause();let U=this[X4]?!1:super.emit("data",Z);return this[M5](),U}[rM](){return this[a5]?!1:(this[a5]=!0,this.readable=!1,this[m4]?(f8(()=>this[AY]()),!0):this[AY]())}[AY](){if(this[Q3]){let U=this[Q3].end();if(U){for(let X of this[S0])X.dest.write(U);this[X4]||super.emit("data",U)}}for(let U of this[S0])U.end();let Z=super.emit("end");return this.removeAllListeners("end"),Z}async collect(){let Z=Object.assign([],{dataLength:0});this[D0]||(Z.dataLength=0);let U=this.promise();return this.on("data",(X)=>{Z.push(X),this[D0]||(Z.dataLength+=X.length)}),await U,Z}async concat(){if(this[D0])throw Error("cannot concat in objectMode");let Z=await this.collect();return this[I4]?Z.join(""):Buffer.concat(Z,Z.dataLength)}async promise(){return new Promise((Z,U)=>{this.on(i1,()=>U(Error("stream destroyed"))),this.on("error",(X)=>U(X)),this.on("end",()=>Z())})}[Symbol.asyncIterator](){this[X4]=!1;let Z=!1,U=async()=>(this.pause(),Z=!0,{value:void 0,done:!0});return{next:()=>{if(Z)return U();let X=this.read();if(X!==null)return Promise.resolve({done:!1,value:X});if(this[G5])return U();let J,q,Q=(K)=>{this.off("data",Y),this.off("end",W),this.off(i1,H),U(),q(K)},Y=(K)=>{this.off("error",Q),this.off("end",W),this.off(i1,H),this.pause(),J({value:K,done:!!this[G5]})},W=()=>{this.off("error",Q),this.off("data",Y),this.off(i1,H),U(),J({done:!0,value:void 0})},H=()=>Q(Error("stream destroyed"));return new Promise((K,z)=>{q=z,J=K,this.once(i1,H),this.once("error",Q),this.once("end",W),this.once("data",Y)})},throw:U,return:U,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[X4]=!1;let Z=!1,U=()=>(this.pause(),this.off(EY,U),this.off(i1,U),this.off("end",U),Z=!0,{done:!0,value:void 0}),X=()=>{if(Z)return U();let J=this.read();return J===null?U():{done:!1,value:J}};return this.once("end",U),this.once(EY,U),this.once(i1,U),{next:X,throw:U,return:U,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(Z){if(this[i1])return Z?this.emit("error",Z):this.emit(i1),this;this[i1]=!0,this[X4]=!0,this[H0].length=0,this[K0]=0;let U=this;return typeof U.close=="function"&&!this[kZ]&&U.close(),Z?this.emit("error",Z):this.emit(i1),this}static get isStream(){return au}},qf=fu.native,d8={lstatSync:ku,readdir:hu,readdirSync:mu,readlinkSync:uu,realpathSync:qf,promises:{lstat:pu,readdir:du,readlink:cu,realpath:iu}},ON=/^\\\\\?\\([a-z]:)\\?$/i,Yf=/[\\\/]/,l8=~R4,nM=c8|E4|dZ,sM=new aZ({max:4096}),oM=new aZ({max:4096}),tM=class extends aZ{constructor(){super({max:256})}},Hf=class extends aZ{constructor(Z=16384){super({maxSize:Z,sizeCalculation:(U)=>U.length+1})}},AN=Symbol("PathScurry setAsCwd"),c0=class{name;root;roots;parent;nocase;isCWD=!1;#Z;#X;get dev(){return this.#X}#Q;get mode(){return this.#Q}#q;get nlink(){return this.#q}#Y;get uid(){return this.#Y}#$;get gid(){return this.#$}#G;get rdev(){return this.#G}#z;get blksize(){return this.#z}#W;get ino(){return this.#W}#F;get size(){return this.#F}#B;get blocks(){return this.#B}#H;get atimeMs(){return this.#H}#J;get mtimeMs(){return this.#J}#V;get ctimeMs(){return this.#V}#j;get birthtimeMs(){return this.#j}#N;get atime(){return this.#N}#L;get mtime(){return this.#L}#_;get ctime(){return this.#_}#R;get birthtime(){return this.#R}#P;#C;#w;#M;#D;#I;#U;#g;#S;#E;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(Z,U=w4,X,J,q,Q,Y){this.name=Z,this.#P=q?lZ(Z):i8(Z),this.#U=U&Wf,this.nocase=q,this.roots=J,this.root=X||this,this.#g=Q,this.#w=Y.fullpath,this.#D=Y.relative,this.#I=Y.relativePosix,this.parent=Y.parent,this.parent?this.#Z=this.parent.#Z:this.#Z=DN(Y.fs)}depth(){return this.#C!==void 0?this.#C:this.parent?this.#C=this.parent.depth()+1:this.#C=0}childrenCache(){return this.#g}resolve(Z){if(!Z)return this;let U=this.getRootString(Z),X=Z.substring(U.length).split(this.splitSep);return U?this.getRoot(U).#b(X):this.#b(X)}#b(Z){let U=this;for(let X of Z)U=U.child(X);return U}children(){let Z=this.#g.get(this);if(Z)return Z;let U=Object.assign([],{provisional:0});return this.#g.set(this,U),this.#U&=~xY,U}child(Z,U){if(Z===""||Z===".")return this;if(Z==="..")return this.parent||this;let X=this.children(),J=this.nocase?lZ(Z):i8(Z);for(let W of X)if(W.#P===J)return W;let q=this.parent?this.sep:"",Q=this.#w?this.#w+q+Z:void 0,Y=this.newChild(Z,w4,{...U,parent:this,fullpath:Q});return this.canReaddir()||(Y.#U|=E4),X.push(Y),Y}relative(){if(this.isCWD)return"";if(this.#D!==void 0)return this.#D;let Z=this.name,U=this.parent;if(!U)return this.#D=this.name;let X=U.relative();return X+(!X||!U.parent?"":this.sep)+Z}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#I!==void 0)return this.#I;let Z=this.name,U=this.parent;if(!U)return this.#I=this.fullpathPosix();let X=U.relativePosix();return X+(!X||!U.parent?"":"/")+Z}fullpath(){if(this.#w!==void 0)return this.#w;let Z=this.name,U=this.parent;if(!U)return this.#w=this.name;let X=U.fullpath()+(U.parent?this.sep:"")+Z;return this.#w=X}fullpathPosix(){if(this.#M!==void 0)return this.#M;if(this.sep==="/")return this.#M=this.fullpath();if(!this.parent){let J=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(J)?this.#M=`//?/${J}`:this.#M=J}let Z=this.parent,U=Z.fullpathPosix(),X=U+(!U||!Z.parent?"":"/")+this.name;return this.#M=X}isUnknown(){return(this.#U&R4)===w4}isType(Z){return this[`is${Z}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#U&R4)===EN}isDirectory(){return(this.#U&R4)===u4}isCharacterDevice(){return(this.#U&R4)===CN}isBlockDevice(){return(this.#U&R4)===IN}isFIFO(){return(this.#U&R4)===PN}isSocket(){return(this.#U&R4)===_N}isSymbolicLink(){return(this.#U&r6)===r6}lstatCached(){return this.#U&aM?this:void 0}readlinkCached(){return this.#S}realpathCached(){return this.#E}readdirCached(){let Z=this.children();return Z.slice(0,Z.provisional)}canReadlink(){if(this.#S)return!0;if(!this.parent)return!1;let Z=this.#U&R4;return!(Z!==w4&&Z!==r6||this.#U&fZ||this.#U&E4)}calledReaddir(){return!!(this.#U&xY)}isENOENT(){return!!(this.#U&E4)}isNamed(Z){return this.nocase?this.#P===lZ(Z):this.#P===i8(Z)}async readlink(){let Z=this.#S;if(Z)return Z;if(this.canReadlink()&&this.parent)try{let U=await this.#Z.promises.readlink(this.fullpath()),X=(await this.parent.realpath())?.resolve(U);if(X)return this.#S=X}catch(U){this.#x(U.code);return}}readlinkSync(){let Z=this.#S;if(Z)return Z;if(this.canReadlink()&&this.parent)try{let U=this.#Z.readlinkSync(this.fullpath()),X=this.parent.realpathSync()?.resolve(U);if(X)return this.#S=X}catch(U){this.#x(U.code);return}}#h(Z){this.#U|=xY;for(let U=Z.provisional;U<Z.length;U++){let X=Z[U];X&&X.#O()}}#O(){this.#U&E4||(this.#U=(this.#U|E4)&l8,this.#d())}#d(){let Z=this.children();Z.provisional=0;for(let U of Z)U.#O()}#k(){this.#U|=dZ,this.#y()}#y(){if(this.#U&c8)return;let Z=this.#U;(Z&R4)===u4&&(Z&=l8),this.#U=Z|c8,this.#d()}#m(Z=""){Z==="ENOTDIR"||Z==="EPERM"?this.#y():Z==="ENOENT"?this.#O():this.children().provisional=0}#T(Z=""){Z==="ENOTDIR"?this.parent.#y():Z==="ENOENT"&&this.#O()}#x(Z=""){let U=this.#U;U|=fZ,Z==="ENOENT"&&(U|=E4),(Z==="EINVAL"||Z==="UNKNOWN")&&(U&=l8),this.#U=U,Z==="ENOTDIR"&&this.parent&&this.parent.#y()}#u(Z,U){return this.#l(Z,U)||this.#f(Z,U)}#f(Z,U){let X=SY(Z),J=this.newChild(Z.name,X,{parent:this}),q=J.#U&R4;return q!==u4&&q!==r6&&q!==w4&&(J.#U|=c8),U.unshift(J),U.provisional++,J}#l(Z,U){for(let X=U.provisional;X<U.length;X++){let J=U[X];if((this.nocase?lZ(Z.name):i8(Z.name))===J.#P)return this.#K(Z,J,X,U)}}#K(Z,U,X,J){let q=U.name;return U.#U=U.#U&l8|SY(Z),q!==Z.name&&(U.name=Z.name),X!==J.provisional&&(X===J.length-1?J.pop():J.splice(X,1),J.unshift(U)),J.provisional++,U}async lstat(){if((this.#U&E4)===0)try{return this.#p(await this.#Z.promises.lstat(this.fullpath())),this}catch(Z){this.#T(Z.code)}}lstatSync(){if((this.#U&E4)===0)try{return this.#p(this.#Z.lstatSync(this.fullpath())),this}catch(Z){this.#T(Z.code)}}#p(Z){let{atime:U,atimeMs:X,birthtime:J,birthtimeMs:q,blksize:Q,blocks:Y,ctime:W,ctimeMs:H,dev:K,gid:z,ino:B,mode:F,mtime:V,mtimeMs:w,nlink:M,rdev:N,size:$,uid:O}=Z;this.#N=U,this.#H=X,this.#R=J,this.#j=q,this.#z=Q,this.#B=Y,this.#_=W,this.#V=H,this.#X=K,this.#$=z,this.#W=B,this.#Q=F,this.#L=V,this.#J=w,this.#q=M,this.#G=N,this.#F=$,this.#Y=O;let C=SY(Z);this.#U=this.#U&l8|C|aM,C!==w4&&C!==u4&&C!==r6&&(this.#U|=c8)}#v=[];#A=!1;#c(Z){this.#A=!1;let U=this.#v.slice();this.#v.length=0,U.forEach((X)=>X(null,Z))}readdirCB(Z,U=!1){if(!this.canReaddir()){U?Z(null,[]):queueMicrotask(()=>Z(null,[]));return}let X=this.children();if(this.calledReaddir()){let q=X.slice(0,X.provisional);U?Z(null,q):queueMicrotask(()=>Z(null,q));return}if(this.#v.push(Z),this.#A)return;this.#A=!0;let J=this.fullpath();this.#Z.readdir(J,{withFileTypes:!0},(q,Q)=>{if(q)this.#m(q.code),X.provisional=0;else{for(let Y of Q)this.#u(Y,X);this.#h(X)}this.#c(X.slice(0,X.provisional))})}#i;async readdir(){if(!this.canReaddir())return[];let Z=this.children();if(this.calledReaddir())return Z.slice(0,Z.provisional);let U=this.fullpath();if(this.#i)await this.#i;else{let X=()=>{};this.#i=new Promise((J)=>X=J);try{for(let J of await this.#Z.promises.readdir(U,{withFileTypes:!0}))this.#u(J,Z);this.#h(Z)}catch(J){this.#m(J.code),Z.provisional=0}this.#i=void 0,X()}return Z.slice(0,Z.provisional)}readdirSync(){if(!this.canReaddir())return[];let Z=this.children();if(this.calledReaddir())return Z.slice(0,Z.provisional);let U=this.fullpath();try{for(let X of this.#Z.readdirSync(U,{withFileTypes:!0}))this.#u(X,Z);this.#h(Z)}catch(X){this.#m(X.code),Z.provisional=0}return Z.slice(0,Z.provisional)}canReaddir(){if(this.#U&nM)return!1;let Z=R4&this.#U;return Z===w4||Z===u4||Z===r6}shouldWalk(Z,U){return(this.#U&u4)===u4&&!(this.#U&nM)&&!Z.has(this)&&(!U||U(this))}async realpath(){if(this.#E)return this.#E;if(!((dZ|fZ|E4)&this.#U))try{let Z=await this.#Z.promises.realpath(this.fullpath());return this.#E=this.resolve(Z)}catch{this.#k()}}realpathSync(){if(this.#E)return this.#E;if(!((dZ|fZ|E4)&this.#U))try{let Z=this.#Z.realpathSync(this.fullpath());return this.#E=this.resolve(Z)}catch{this.#k()}}[AN](Z){if(Z===this)return;Z.isCWD=!1,this.isCWD=!0;let U=new Set([]),X=[],J=this;for(;J&&J.parent;)U.add(J),J.#D=X.join(this.sep),J.#I=X.join("/"),J=J.parent,X.push("..");for(J=Z;J&&J.parent&&!U.has(J);)J.#D=void 0,J.#I=void 0,J=J.parent}},TN=class Z extends c0{sep="\\";splitSep=Yf;constructor(U,X=w4,J,q,Q,Y,W){super(U,X,J,q,Q,Y,W)}newChild(U,X=w4,J={}){return new Z(U,X,this.root,this.roots,this.nocase,this.childrenCache(),J)}getRootString(U){return gY.parse(U).root}getRoot(U){if(U=Qf(U.toUpperCase()),U===this.root.name)return this.root;for(let[X,J]of Object.entries(this.roots))if(this.sameRoot(U,X))return this.roots[U]=J;return this.roots[U]=new hY(U,this).root}sameRoot(U,X=this.root.name){return U=U.toUpperCase().replace(/\//g,"\\").replace(ON,"$1\\"),U===X}},xN=class Z extends c0{splitSep="/";sep="/";constructor(U,X=w4,J,q,Q,Y,W){super(U,X,J,q,Q,Y,W)}getRootString(U){return U.startsWith("/")?"/":""}getRoot(U){return this.root}newChild(U,X=w4,J={}){return new Z(U,X,this.root,this.roots,this.nocase,this.childrenCache(),J)}},SN=class{root;rootPath;roots;cwd;#Z;#X;#Q;nocase;#q;constructor(Z=process.cwd(),U,X,{nocase:J,childrenCacheSize:q=16384,fs:Q=d8}={}){this.#q=DN(Q),(Z instanceof URL||Z.startsWith("file://"))&&(Z=vu(Z));let Y=U.resolve(Z);this.roots=Object.create(null),this.rootPath=this.parseRootPath(Y),this.#Z=new tM,this.#X=new tM,this.#Q=new Hf(q);let W=Y.substring(this.rootPath.length).split(X);if(W.length===1&&!W[0]&&W.pop(),J===void 0)throw TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=J,this.root=this.newRoot(this.#q),this.roots[this.rootPath]=this.root;let H=this.root,K=W.length-1,z=U.sep,B=this.rootPath,F=!1;for(let V of W){let w=K--;H=H.child(V,{relative:Array(w).fill("..").join(z),relativePosix:Array(w).fill("..").join("/"),fullpath:B+=(F?"":z)+V}),F=!0}this.cwd=H}depth(Z=this.cwd){return typeof Z=="string"&&(Z=this.cwd.resolve(Z)),Z.depth()}childrenCache(){return this.#Q}resolve(...Z){let U="";for(let q=Z.length-1;q>=0;q--){let Q=Z[q];if(!(!Q||Q===".")&&(U=U?`${Q}/${U}`:Q,this.isAbsolute(Q)))break}let X=this.#Z.get(U);if(X!==void 0)return X;let J=this.cwd.resolve(U).fullpath();return this.#Z.set(U,J),J}resolvePosix(...Z){let U="";for(let q=Z.length-1;q>=0;q--){let Q=Z[q];if(!(!Q||Q===".")&&(U=U?`${Q}/${U}`:Q,this.isAbsolute(Q)))break}let X=this.#X.get(U);if(X!==void 0)return X;let J=this.cwd.resolve(U).fullpathPosix();return this.#X.set(U,J),J}relative(Z=this.cwd){return typeof Z=="string"&&(Z=this.cwd.resolve(Z)),Z.relative()}relativePosix(Z=this.cwd){return typeof Z=="string"&&(Z=this.cwd.resolve(Z)),Z.relativePosix()}basename(Z=this.cwd){return typeof Z=="string"&&(Z=this.cwd.resolve(Z)),Z.name}dirname(Z=this.cwd){return typeof Z=="string"&&(Z=this.cwd.resolve(Z)),(Z.parent||Z).fullpath()}async readdir(Z=this.cwd,U={withFileTypes:!0}){typeof Z=="string"?Z=this.cwd.resolve(Z):Z instanceof c0||(U=Z,Z=this.cwd);let{withFileTypes:X}=U;if(Z.canReaddir()){let J=await Z.readdir();return X?J:J.map((q)=>q.name)}else return[]}readdirSync(Z=this.cwd,U={withFileTypes:!0}){typeof Z=="string"?Z=this.cwd.resolve(Z):Z instanceof c0||(U=Z,Z=this.cwd);let{withFileTypes:X=!0}=U;return Z.canReaddir()?X?Z.readdirSync():Z.readdirSync().map((J)=>J.name):[]}async lstat(Z=this.cwd){return typeof Z=="string"&&(Z=this.cwd.resolve(Z)),Z.lstat()}lstatSync(Z=this.cwd){return typeof Z=="string"&&(Z=this.cwd.resolve(Z)),Z.lstatSync()}async readlink(Z=this.cwd,{withFileTypes:U}={withFileTypes:!1}){typeof Z=="string"?Z=this.cwd.resolve(Z):Z instanceof c0||(U=Z.withFileTypes,Z=this.cwd);let X=await Z.readlink();return U?X:X?.fullpath()}readlinkSync(Z=this.cwd,{withFileTypes:U}={withFileTypes:!1}){typeof Z=="string"?Z=this.cwd.resolve(Z):Z instanceof c0||(U=Z.withFileTypes,Z=this.cwd);let X=Z.readlinkSync();return U?X:X?.fullpath()}async realpath(Z=this.cwd,{withFileTypes:U}={withFileTypes:!1}){typeof Z=="string"?Z=this.cwd.resolve(Z):Z instanceof c0||(U=Z.withFileTypes,Z=this.cwd);let X=await Z.realpath();return U?X:X?.fullpath()}realpathSync(Z=this.cwd,{withFileTypes:U}={withFileTypes:!1}){typeof Z=="string"?Z=this.cwd.resolve(Z):Z instanceof c0||(U=Z.withFileTypes,Z=this.cwd);let X=Z.realpathSync();return U?X:X?.fullpath()}async walk(Z=this.cwd,U={}){typeof Z=="string"?Z=this.cwd.resolve(Z):Z instanceof c0||(U=Z,Z=this.cwd);let{withFileTypes:X=!0,follow:J=!1,filter:q,walkFilter:Q}=U,Y=[];(!q||q(Z))&&Y.push(X?Z:Z.fullpath());let W=new Set,H=(z,B)=>{W.add(z),z.readdirCB((F,V)=>{if(F)return B(F);let w=V.length;if(!w)return B();let M=()=>{--w===0&&B()};for(let N of V)(!q||q(N))&&Y.push(X?N:N.fullpath()),J&&N.isSymbolicLink()?N.realpath().then(($)=>$?.isUnknown()?$.lstat():$).then(($)=>$?.shouldWalk(W,Q)?H($,M):M()):N.shouldWalk(W,Q)?H(N,M):M()},!0)},K=Z;return new Promise((z,B)=>{H(K,(F)=>{if(F)return B(F);z(Y)})})}walkSync(Z=this.cwd,U={}){typeof Z=="string"?Z=this.cwd.resolve(Z):Z instanceof c0||(U=Z,Z=this.cwd);let{withFileTypes:X=!0,follow:J=!1,filter:q,walkFilter:Q}=U,Y=[];(!q||q(Z))&&Y.push(X?Z:Z.fullpath());let W=new Set([Z]);for(let H of W){let K=H.readdirSync();for(let z of K){(!q||q(z))&&Y.push(X?z:z.fullpath());let B=z;if(z.isSymbolicLink()){if(!(J&&(B=z.realpathSync())))continue;B.isUnknown()&&B.lstatSync()}B.shouldWalk(W,Q)&&W.add(B)}}return Y}[Symbol.asyncIterator](){return this.iterate()}iterate(Z=this.cwd,U={}){return typeof Z=="string"?Z=this.cwd.resolve(Z):Z instanceof c0||(U=Z,Z=this.cwd),this.stream(Z,U)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(Z=this.cwd,U={}){typeof Z=="string"?Z=this.cwd.resolve(Z):Z instanceof c0||(U=Z,Z=this.cwd);let{withFileTypes:X=!0,follow:J=!1,filter:q,walkFilter:Q}=U;(!q||q(Z))&&(yield X?Z:Z.fullpath());let Y=new Set([Z]);for(let W of Y){let H=W.readdirSync();for(let K of H){(!q||q(K))&&(yield X?K:K.fullpath());let z=K;if(K.isSymbolicLink()){if(!(J&&(z=K.realpathSync())))continue;z.isUnknown()&&z.lstatSync()}z.shouldWalk(Y,Q)&&Y.add(z)}}}stream(Z=this.cwd,U={}){typeof Z=="string"?Z=this.cwd.resolve(Z):Z instanceof c0||(U=Z,Z=this.cwd);let{withFileTypes:X=!0,follow:J=!1,filter:q,walkFilter:Q}=U,Y=new rZ({objectMode:!0});(!q||q(Z))&&Y.write(X?Z:Z.fullpath());let W=new Set,H=[Z],K=0,z=()=>{let B=!1;for(;!B;){let F=H.shift();if(!F){K===0&&Y.end();return}K++,W.add(F);let V=(M,N,$=!1)=>{if(M)return Y.emit("error",M);if(J&&!$){let O=[];for(let C of N)C.isSymbolicLink()&&O.push(C.realpath().then((b)=>b?.isUnknown()?b.lstat():b));if(O.length){Promise.all(O).then(()=>V(null,N,!0));return}}for(let O of N)O&&(!q||q(O))&&(Y.write(X?O:O.fullpath())||(B=!0));K--;for(let O of N){let C=O.realpathCached()||O;C.shouldWalk(W,Q)&&H.push(C)}B&&!Y.flowing?Y.once("drain",z):w||z()},w=!0;F.readdirCB(V,!0),w=!1}};return z(),Y}streamSync(Z=this.cwd,U={}){typeof Z=="string"?Z=this.cwd.resolve(Z):Z instanceof c0||(U=Z,Z=this.cwd);let{withFileTypes:X=!0,follow:J=!1,filter:q,walkFilter:Q}=U,Y=new rZ({objectMode:!0}),W=new Set;(!q||q(Z))&&Y.write(X?Z:Z.fullpath());let H=[Z],K=0,z=()=>{let B=!1;for(;!B;){let F=H.shift();if(!F){K===0&&Y.end();return}K++,W.add(F);let V=F.readdirSync();for(let w of V)(!q||q(w))&&(Y.write(X?w:w.fullpath())||(B=!0));K--;for(let w of V){let M=w;if(w.isSymbolicLink()){if(!(J&&(M=w.realpathSync())))continue;M.isUnknown()&&M.lstatSync()}M.shouldWalk(W,Q)&&H.push(M)}}B&&!Y.flowing&&Y.once("drain",z)};return z(),Y}chdir(Z=this.cwd){let U=this.cwd;this.cwd=typeof Z=="string"?this.cwd.resolve(Z):Z,this.cwd[AN](U)}},hY=class extends SN{sep="\\";constructor(Z=process.cwd(),U={}){let{nocase:X=!0}=U;super(Z,gY,"\\",{...U,nocase:X}),this.nocase=X;for(let J=this.cwd;J;J=J.parent)J.nocase=this.nocase}parseRootPath(Z){return gY.parse(Z).root.toUpperCase()}newRoot(Z){return new TN(this.rootPath,u4,void 0,this.roots,this.nocase,this.childrenCache(),{fs:Z})}isAbsolute(Z){return Z.startsWith("/")||Z.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(Z)}},mY=class extends SN{sep="/";constructor(Z=process.cwd(),U={}){let{nocase:X=!1}=U;super(Z,yu,"/",{...U,nocase:X}),this.nocase=X}parseRootPath(Z){return"/"}newRoot(Z){return new xN(this.rootPath,u4,void 0,this.roots,this.nocase,this.childrenCache(),{fs:Z})}isAbsolute(Z){return Z.startsWith("/")}},bN=class extends mY{constructor(Z=process.cwd(),U={}){let{nocase:X=!0}=U;super(Z,{...U,nocase:X})}},OU1=process.platform==="win32"?TN:xN,Kf=process.platform==="win32"?hY:process.platform==="darwin"?bN:mY,Ff=Symbol.for("nodejs.util.inspect.custom"),gN=class Z{#Z;#X;#Q;length;#q;#Y;#$;#G;#z;#W;#F=!0;constructor(U,X,J,q){if(!zf(U))throw TypeError("empty pattern list");if(!Bf(X))throw TypeError("empty glob list");if(X.length!==U.length)throw TypeError("mismatched pattern list and glob list lengths");if(this.length=U.length,J<0||J>=this.length)throw TypeError("index out of range");if(this.#Z=U,this.#X=X,this.#Q=J,this.#q=q,this.#Q===0){if(this.isUNC()){let[Q,Y,W,H,...K]=this.#Z,[z,B,F,V,...w]=this.#X;K[0]===""&&(K.shift(),w.shift());let M=[Q,Y,W,H,""].join("/"),N=[z,B,F,V,""].join("/");this.#Z=[M,...K],this.#X=[N,...w],this.length=this.#Z.length}else if(this.isDrive()||this.isAbsolute()){let[Q,...Y]=this.#Z,[W,...H]=this.#X;Y[0]===""&&(Y.shift(),H.shift());let K=Q+"/",z=W+"/";this.#Z=[K,...Y],this.#X=[z,...H],this.length=this.#Z.length}}}[Ff](){return"Pattern <"+this.#X.slice(this.#Q).join("/")+">"}pattern(){return this.#Z[this.#Q]}isString(){return typeof this.#Z[this.#Q]=="string"}isGlobstar(){return this.#Z[this.#Q]===b0}isRegExp(){return this.#Z[this.#Q]instanceof RegExp}globString(){return this.#$=this.#$||(this.#Q===0?this.isAbsolute()?this.#X[0]+this.#X.slice(1).join("/"):this.#X.join("/"):this.#X.slice(this.#Q).join("/"))}hasMore(){return this.length>this.#Q+1}rest(){return this.#Y!==void 0?this.#Y:this.hasMore()?(this.#Y=new Z(this.#Z,this.#X,this.#Q+1,this.#q),this.#Y.#W=this.#W,this.#Y.#z=this.#z,this.#Y.#G=this.#G,this.#Y):this.#Y=null}isUNC(){let U=this.#Z;return this.#z!==void 0?this.#z:this.#z=this.#q==="win32"&&this.#Q===0&&U[0]===""&&U[1]===""&&typeof U[2]=="string"&&!!U[2]&&typeof U[3]=="string"&&!!U[3]}isDrive(){let U=this.#Z;return this.#G!==void 0?this.#G:this.#G=this.#q==="win32"&&this.#Q===0&&this.length>1&&typeof U[0]=="string"&&/^[a-z]:$/i.test(U[0])}isAbsolute(){let U=this.#Z;return this.#W!==void 0?this.#W:this.#W=U[0]===""&&U.length>1||this.isDrive()||this.isUNC()}root(){let U=this.#Z[0];return typeof U=="string"&&this.isAbsolute()&&this.#Q===0?U:""}checkFollowGlobstar(){return!(this.#Q===0||!this.isGlobstar()||!this.#F)}markFollowGlobstar(){return this.#Q===0||!this.isGlobstar()||!this.#F?!1:(this.#F=!1,!0)}},Vf=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",UN=class extends yN{matches=new Set;constructor(Z,U,X){super(Z,U,X)}matchEmit(Z){this.matches.add(Z)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((Z,U)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?U(this.signal.reason):Z(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},XN=class extends yN{results;constructor(Z,U,X){super(Z,U,X),this.results=new rZ({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(Z){this.results.write(Z),this.results.flowing||this.pause()}stream(){let Z=this.path;return Z.isUnknown()?Z.lstat().then(()=>{this.walkCB(Z,this.patterns,()=>this.results.end())}):this.walkCB(Z,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}},Mf=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",a6=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(Z,U){if(!U)throw TypeError("glob options required");if(this.withFileTypes=!!U.withFileTypes,this.signal=U.signal,this.follow=!!U.follow,this.dot=!!U.dot,this.dotRelative=!!U.dotRelative,this.nodir=!!U.nodir,this.mark=!!U.mark,U.cwd?(U.cwd instanceof URL||U.cwd.startsWith("file://"))&&(U.cwd=xu(U.cwd)):this.cwd="",this.cwd=U.cwd||"",this.root=U.root,this.magicalBraces=!!U.magicalBraces,this.nobrace=!!U.nobrace,this.noext=!!U.noext,this.realpath=!!U.realpath,this.absolute=U.absolute,this.includeChildMatches=U.includeChildMatches!==!1,this.noglobstar=!!U.noglobstar,this.matchBase=!!U.matchBase,this.maxDepth=typeof U.maxDepth=="number"?U.maxDepth:1/0,this.stat=!!U.stat,this.ignore=U.ignore,this.withFileTypes&&this.absolute!==void 0)throw Error("cannot set absolute and withFileTypes:true");if(typeof Z=="string"&&(Z=[Z]),this.windowsPathsNoEscape=!!U.windowsPathsNoEscape||U.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(Z=Z.map((W)=>W.replace(/\\/g,"/"))),this.matchBase){if(U.noglobstar)throw TypeError("base matching requires globstar");Z=Z.map((W)=>W.includes("/")?W:`./**/${W}`)}if(this.pattern=Z,this.platform=U.platform||Mf,this.opts={...U,platform:this.platform},U.scurry){if(this.scurry=U.scurry,U.nocase!==void 0&&U.nocase!==U.scurry.nocase)throw Error("nocase option contradicts provided scurry option")}else{let W=U.platform==="win32"?hY:U.platform==="darwin"?bN:U.platform?mY:Kf;this.scurry=new W(this.cwd,{nocase:U.nocase,fs:U.fs})}this.nocase=this.scurry.nocase;let X=this.platform==="darwin"||this.platform==="win32",J={braceExpandMax:1e4,...U,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:X,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},q=this.pattern.map((W)=>new s5(W,J)),[Q,Y]=q.reduce((W,H)=>(W[0].push(...H.set),W[1].push(...H.globParts),W),[[],[]]);this.patterns=Q.map((W,H)=>{let K=Y[H];if(!K)throw Error("invalid pattern object");return new gN(W,K,0,this.platform)})}async walk(){return[...await new UN(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new UN(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new XN(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new XN(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};$f=nZ,jf=Object.assign(vN,{sync:nZ}),Df=oZ,Of=Object.assign(kN,{sync:oZ}),Pf=Object.assign(sZ,{stream:nZ,iterate:oZ}),qN=Object.assign(JN,{glob:JN,globSync:sZ,sync:Pf,globStream:vN,stream:jf,globStreamSync:nZ,streamSync:$f,globIterate:kN,iterate:Of,globIterateSync:oZ,iterateSync:Df,Glob:a6,hasMagic:Nf,escape:FN,unescape:W3});qN.glob=qN});var iN={};Y6(iN,{transpileJxMarkdown:()=>MY,mdastNodeToJx:()=>w5,mdKey:()=>LY,jxKey:()=>J3,isJxMarkdown:()=>GY,expandStylePaths:()=>RY,expandDotPaths:()=>b8,convertChildren:()=>r5,collapseStylePaths:()=>wY,collapseDotPaths:()=>TZ,applyStyleKeyMapping:()=>g8,MarkdownFile:()=>dN,MarkdownCollection:()=>cN});import{readFileSync as fN}from"node:fs";import{basename as Cf,extname as If,resolve as uY}from"node:path";function lN(Z,U,X){let J=typeof U==="string"?U:null,q=J?X:U;function Q(Y){if(!Y||typeof Y!=="object")return;if(!J||Y.type===J)q(Y);if(Array.isArray(Y.children))for(let W of Y.children)Q(W)}Q(Z)}function tZ(Z){if(!Z)return"";if(typeof Z==="string")return Z;if(Z.value)return Z.value;if(Array.isArray(Z.children))return Z.children.map(tZ).join("");return""}function Ef(Z){let U=Z.split(/\s+/).filter(Boolean).length;return Math.max(1,Math.ceil(U/200))}function _f(Z){let U=[];return lN(Z,"heading",(X)=>{let J=tZ(X),q=J.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");U.push({depth:X.depth,text:J,id:q})}),U}function Af(Z){let U=null;if(lN(Z,"paragraph",(X)=>{if(!U)U=X}),!U)return"";return tZ(U)}function pN(Z,U,X={}){let J=R6().use(O9).use(C9,["yaml"]).use(uN.default).use(f5);if(X.directives||X.directiveOptions)J=J.use(t9);let q=J.parse(Z),Q={data:{}};J.runSync(q,Q);let W=Q.data.frontmatter??{},K=tZ(q),z=_f(q),B=Af(q),F=Cf(U,If(U)),w=q.children.filter((M)=>M.type!=="yaml"&&M.type!=="toml").map(w5).filter(Boolean);return{slug:F,path:U,frontmatter:W,$children:w,$excerpt:B,$toc:z,$readingTime:Ef(K),$wordCount:K.split(/\s+/).filter(Boolean).length}}function mN(Z,U){return U.split(".").reduce((X,J)=>X?.[J],Z)}class dN{config;constructor(Z){this.config=Z}resolve(){let{src:Z,basePath:U,...X}=this.config,J=U?uY(U,Z):uY(Z),q=fN(J,"utf-8");return pN(q,J,X)}}class cN{config;constructor(Z){this.config=Z}async resolve(){let{src:Z,sortBy:U="frontmatter.date",sortOrder:X="desc",limit:J,filter:q,basePath:Q,...Y}=this.config,H=(Q?uY(Q,Z):Z).split("\\").join("/"),z=sZ(H,{absolute:!0}).map((F)=>{let V=fN(F,"utf-8");return pN(V,F,Y)}),B=z;if(typeof q==="function")B=z.filter(q);if(B.sort((F,V)=>{let w=mN(F,U)??"",M=mN(V,U)??"";if(w<M)return X==="asc"?-1:1;if(w>M)return X==="asc"?1:-1;return 0}),J&&J>0)return B.slice(0,J);return B}}var uN;var rN=P(()=>{T7();KJ();MJ();t2();RQ();hN();p6();p6();uN=Q6(Fq(),1)});import{readFileSync as pY,readdirSync as Tf,existsSync as xf}from"node:fs";import{resolve as lY,basename as aN,extname as nN}from"node:path";function oN(Z){let U=[],X="",J=!1,q=[];for(let W=0;W<Z.length;W++){let H=Z[W];if(H==='"')if(X+=H,J&&Z[W+1]==='"')X+=Z[W+1],W++;else J=!J;else if((H===`
|
|
402
402
|
`||H==="\r"&&Z[W+1]===`
|
|
403
|
-
`)&&!J){if(q.push(X),X="",H==="\r")W++}else X+=H}if(X.trim())q.push(X);if(q.length===0)return[];let Q=(W)=>{let H=[],K="",z=!1;for(let B=0;B<W.length;B++){let F=W[B];if(F==='"')if(z&&W[B+1]==='"')K+='"',B++;else z=!z;else if(F===","&&!z)H.push(K),K="";else K+=F}return H.push(K),H},Y=Q(q[0]);for(let W=1;W<q.length;W++){let H=Q(q[W]),K={};for(let z=0;z<Y.length;z++)K[Y[z].trim()]=H[z]?.trim()??"";U.push(K)}return U}async function Sf(){if(!fY)fY=await Promise.resolve().then(() => (rN(),iN));return fY}async function bf(Z,U){let{MarkdownFile:X}=await Sf(),q=new X({src:Z,directiveOptions:U}).resolve(),Q={};if(q.$excerpt!=null)Q.excerpt=q.$excerpt;if(q.$toc!=null)Q.toc=q.$toc;if(q.$readingTime!=null)Q.readingTime=q.$readingTime;if(q.$wordCount!=null)Q.wordCount=q.$wordCount;return{id:q.slug,data:q.frontmatter,body:pY(Z,"utf-8"),$children:q.$children,_meta:Q}}function gf(Z){let U=JSON.parse(pY(Z,"utf-8"));if(Array.isArray(U))return U.map((J,q)=>({id:J.id??aN(Z,".json")+"-"+q,data:J,body:null}));let X=U;return[{id:X.id??aN(Z,".json"),data:X,body:null}]}function tN(Z,U){return Z.map((X,J)=>{let q={...X};if(U?.properties)for(let[Y,W]of Object.entries(U.properties)){if(!(Y in q))continue;if(W.type==="number"){let H=String(q[Y]??"").trim();if(H==="")q[Y]=null;else{let K=H.replace(/[$€£¥,\s]/g,""),z=Number(K);q[Y]=isNaN(z)?null:z}}else if(W.type==="boolean")q[Y]=q[Y]==="true"}return{id:q.id??q.sku??String(J),data:q,body:null}})}function yf(Z,U){let X=oN(pY(Z,"utf-8"));return tN(X,U)}async function vf(Z,U){let X=await fetch(Z);if(!X.ok)throw Error(`Failed to fetch CSV from ${Z}: ${X.status} ${X.statusText}`);return tN(oN(await X.text()),U)}function dY(Z,U){let X=lY(Z,"content");return{config:{contentTypes:U?.contentTypes??{}},contentDir:X}}async function eN(Z,U){let X=dY(Z,U);if(!X)return new Map;let{config:J}=X,q=new Map;for(let[Q,Y]of Object.entries(J.contentTypes)){let W=await kf(Q,Y,Z);q.set(Q,W)}return q}async function kf(Z,U,X){let J=U.source;if(!J)return[];let q=U.schema,Q=U.$elements?.length?{allowedNames:U.$elements.filter((K)=>typeof K==="string"||typeof K==="object"&&K?.$ref).map((K)=>typeof K==="string"?K:K.$ref)}:void 0;if(J.startsWith("http://")||J.startsWith("https://"))try{let K=await vf(J,q);if(q)sN(K,q,Z);return K}catch(K){return console.warn(`Content type "${Z}": ${K.message}`),[]}let Y=lY(X,J).split("\\").join("/"),W;if(nN(J))W=xf(Y)?[Y]:[];else{let z=`.${U.format||"md"}`,B=Y.endsWith("/")?Y:Y+"/";try{W=Tf(B,{recursive:!0}).filter((F)=>String(F).endsWith(z)).map((F)=>lY(B,String(F)))}catch{W=[]}}let H=[];for(let K of W){let z=nN(K).toLowerCase();if(z===".md")H.push(await bf(K,Q));else if(z===".json")H.push(...gf(K));else if(z===".csv")H.push(...yf(K,q))}if(q)sN(H,q,Z);return H}function sN(Z,U,X){let J=U.required??[],q=U.properties??{};for(let Q of Z){for(let Y of J)if(!(Y in Q.data)||Q.data[Y]==null)console.warn(`Content validation: "${X}/${Q.id}" missing required field "${Y}"`);for(let[Y,W]of Object.entries(q)){let H=Q.data[Y];if(H==null)continue;if(W.type==="string"&&typeof H!=="string")console.warn(`Content validation: "${X}/${Q.id}" field "${Y}" expected string, got ${typeof H}`);else if(W.type==="number"&&typeof H!=="number")console.warn(`Content validation: "${X}/${Q.id}" field "${Y}" expected number, got ${typeof H}`);else if(W.type==="boolean"&&typeof H!=="boolean")console.warn(`Content validation: "${X}/${Q.id}" field "${Y}" expected boolean, got ${typeof H}`);else if(W.type==="array"&&!Array.isArray(H))console.warn(`Content validation: "${X}/${Q.id}" field "${Y}" expected array, got ${typeof H}`)}}}function Z$(Z,U){for(let[X,J]of Object.entries(U.contentTypes)){let q=J.schema;if(!q?.properties)continue;let Q=Z.get(X);if(!Q)continue;for(let[Y,W]of Object.entries(q.properties)){if(!W.$ref?.startsWith("#/contentTypes/"))continue;let H=W.$ref.replace("#/contentTypes/",""),K=Z.get(H);if(!K)continue;for(let z of Q){let B=z.data[Y];if(typeof B==="string"){let F=K.find((V)=>V.id===B);if(F)z.data[Y]=F}}}}}var fY=null;var U$=()=>{};import{readFileSync as hf}from"node:fs";import{dirname as X$,resolve as cY}from"node:path";import{pathToFileURL as mf}from"node:url";import{createRequire as uf}from"node:module";async function J$(Z,U,X,J={}){let q=Z.imports??{},Q=Z.state;if(!Q)return;for(let[Y,W]of Object.entries(Q)){if(!W||typeof W!=="object"||!W.$prototype)continue;if(ff.has(W.$prototype))continue;if(W.timing&&W.timing!=="compiler")continue;if(!W.$src){let H=q[W.$prototype];if(!H)continue;W.$src=H}try{let H=await pf(W,U,X,Q,J);if(W.timing&&H&&typeof H==="object"&&!Array.isArray(H))H.timing=W.timing;Q[Y]=H}catch(H){console.warn(`prototype-resolver: failed to resolve "${Y}" ($prototype: "${W.$prototype}"):`,H.message)}}}async function pf(Z,U,X,J,q){let Q=Z.$src,Y;if(Q.startsWith("./")||Q.startsWith("../"))Y=U.sourcePath?cY(X$(U.sourcePath),Q):cY(X,Q);else Y=uf(cY(X,"package.json")).resolve(Q);let W=hf(Y,"utf-8"),H=JSON.parse(W);if(!H.$implementation)throw Error(`${Q} has no $implementation field`);let K=mf(Y).href,B=await import(new URL(H.$implementation,K).href),F=Z.$export??H.title??Z.$prototype,V=B[F]??B.default?.[F];if(!V)throw Error(`Module ${H.$implementation} does not export "${F}"`);let w={};for(let[N,$]of Object.entries(Z))if(!lf.has(N))w[N]=$;if(w.src&&!w.basePath&&U.sourcePath)w.basePath=X$(U.sourcePath);w._project={config:q.config??null,contentTypes:q.contentTypes??null,root:X},w._document={route:U,state:J};let M=new V(w);if(typeof M.resolve==="function")return await M.resolve();return M}var ff,lf;var q$=P(()=>{ff=new Set(["Function","LocalStorage","SessionStorage","Array"]),lf=new Set(["$prototype","$src","$export","timing","default","description"])});function eZ(Z){let U=this;U.compiler=X;function X(J){return mq(J,{...U.data("settings"),...Z,extensions:U.data("toMarkdownExtensions")||[]})}}var Q$=P(()=>{s2()});var Y$=P(()=>{Q$()});function H3(Z,U,X){if(typeof Z==="string")return Z.trim()?[{type:"text",value:Z}]:[];if(typeof Z==="number")return[{type:"text",value:String(Z)}];if(!Z||typeof Z!=="object")return[];if(Z.$prototype==="Array")return nf(Z,U,X);let J=Z.tagName??"div",q=rY(Z.textContent,X);if(typeof Z.innerHTML==="string"&&Z.innerHTML.trim()){let Y=UU(Z.innerHTML);if(Y.length>0)return Y}if(J.includes("-"))return rf(Z,J,U);if(cf.has(J)){if(q!=null)return q.trim()?[{type:"paragraph",children:[{type:"text",value:q}]}]:[];return N5(Z,U,X)}let Q=df[J];if(!Q){if(q!=null)return q.trim()?[{type:"paragraph",children:[{type:"text",value:q}]}]:[];return N5(Z,U,X)}switch(Q){case"heading":{let Y=parseInt(J.slice(1),10),W=q!=null?[{type:"text",value:q}]:r8(Z,U,X);return[{type:"heading",depth:Y,children:W}]}case"paragraph":{let Y=q!=null?[{type:"text",value:q}]:r8(Z,U,X);if(Y.length===0)return[];return[{type:"paragraph",children:Y}]}case"emphasis":case"strong":case"delete":{let Y=q!=null?[{type:"text",value:q}]:r8(Z,U,X);return[{type:Q,children:Y}]}case"inlineCode":return[{type:"inlineCode",value:q??""}];case"link":{let Y=String(Z.attributes?.href??""),W=Z.attributes?.title??null,H=q!=null?[{type:"text",value:q}]:r8(Z,U,X);return[{type:"link",url:Y,title:W,children:H}]}case"image":{let Y=String(Z.attributes?.src??""),W=String(Z.attributes?.alt??""),H=Z.attributes?.title??null;return[{type:"image",url:Y,alt:W,title:H}]}case"blockquote":return[{type:"blockquote",children:N5(Z,U,X).map((H)=>H.type==="text"?{type:"paragraph",children:[H]}:H)}];case"list":{let Y=J==="ol",H=N5(Z,U,X).filter((K)=>K.type==="listItem");if(H.length===0)return[];return[{type:"list",ordered:Y,spread:!1,children:H}]}case"listItem":{let Y=N5(Z,U,X);if(Y.length>0&&Y.every((W)=>W.type==="text"||H$(W.type)))Y=[{type:"paragraph",children:Y}];return[{type:"listItem",spread:!1,children:Y}]}case"code":{let Y=Array.isArray(Z.children)?Z.children.find((K)=>K?.tagName==="code"):null,W=Y?.textContent??q??"";return[{type:"code",lang:Y?.className?.replace("language-","")??null,value:W}]}case"thematicBreak":return[{type:"thematicBreak"}];case"break":return[{type:"break"}];case"table":return of(Z,U,X);case"thead":case"tbody":return N5(Z,U,X);case"tableRow":return[{type:"tableRow",children:N5(Z,U,X).filter((W)=>W.type==="tableCell")}];case"tableCell":return[{type:"tableCell",children:q!=null?[{type:"text",value:q}]:r8(Z,U,X)}]}return[]}function H$(Z){return["text","emphasis","strong","delete","inlineCode","link","image","break"].includes(Z)}function N5(Z,U,X){if(Z.textContent!=null){let J=rY(Z.textContent,X);if(J)return[{type:"text",value:J}];return[]}if(!Array.isArray(Z.children))return[];return Z.children.flatMap((J)=>H3(J,U,X))}function r8(Z,U,X){if(Z.textContent!=null){let J=rY(Z.textContent,X);if(J)return[{type:"text",value:J}];return[]}if(!Array.isArray(Z.children))return[];return Z.children.flatMap((J)=>H3(J,U,X))}function rf(Z,U,X){let J=X.get(U);if(!J)return N5(Z,X);let q=Z.$props??{},Q={...J.state};for(let[K,z]of Object.entries(q))if(K in Q){let B=Q[K];if(B&&typeof B==="object"&&!Array.isArray(B)&&"default"in B)Q[K]={...B,default:z};else Q[K]=z}else Q[K]=z;let Y=E5(Q,null);if(!Array.isArray(J.children))return[];let W=K$(J.children,Y),H=Z.children;return W.flatMap((K)=>{if(typeof K!=="string"&&K?.tagName==="slot"&&Array.isArray(H))return H.flatMap((z)=>H3(z,X));return H3(K,X,Y)})}function K$(Z,U){if(!Array.isArray(Z))return[];return Z.map((X)=>af(X,U))}function af(Z,U){if(typeof Z==="string")return N1(Z)?String(a1(Z,U)??Z):Z;if(!Z||typeof Z!=="object")return Z;let X={...Z};if(typeof X.textContent==="string"&&N1(X.textContent))X.textContent=String(a1(X.textContent,U)??X.textContent);if(typeof X.innerHTML==="string"&&N1(X.innerHTML))X.innerHTML=String(a1(X.innerHTML,U)??X.innerHTML);if(X.attributes){X.attributes={...X.attributes};for(let[J,q]of Object.entries(X.attributes))if(typeof q==="string"&&N1(q))X.attributes[J]=a1(q,U)??q}if(Array.isArray(X.children))X.children=K$(X.children,U);return X}function nf(Z,U,X){let J=Z.items?.$ref;if(!J||!X)return[];let q=sf(J,X);if(!Array.isArray(q))return[];let Q=Z.map;if(!Q)return[];return q.flatMap((Y,W)=>{let H=Object.create(X);H.item=Y,H.index=W;let K=iY(Q,Y);return H3(K,U,X)})}function iY(Z,U){if(typeof Z==="string")return Z;if(!Z||typeof Z!=="object")return Z;let X={...Z};for(let[J,q]of Object.entries(X))if(q&&typeof q==="object"&&q.$ref){let Q=q.$ref;if(Q.startsWith("$map/")){let Y=Q.slice(5);X[J]=ZU(Y==="item"?U:U,Y.startsWith("item/")?Y.slice(5):Y)}}if(X.$props)X.$props=iY(X.$props,U);if(typeof X.textContent==="string"&&X.textContent.startsWith("$map/"))X.textContent=ZU(U,X.textContent.slice(5));if(Array.isArray(X.children))X.children=X.children.map((J)=>iY(J,U));return X}function ZU(Z,U){let X=U.split(/[/.]/),J=Z;for(let q of X){if(J==null)return;J=J[q]}return J}function sf(Z,U){if(Z.startsWith("#/state/"))return ZU(U,Z.slice(8));return ZU(U,Z)}function of(Z,U,X){let J=N5(Z,U,X).filter((q)=>q.type==="tableRow");if(J.length===0)return[];return[{type:"table",children:J}]}function rY(Z,U){if(Z==null)return null;if(typeof Z==="string"){if(U&&N1(Z)){let X=a1(Z,U);return X!=null?String(X):Z}return Z}return String(Z)}function UU(Z){let U=[],X=tf(Z);for(let J of X){let q=J.trim();if(!q)continue;let Q=ef(q);if(Q)U.push(...Q)}return U}function tf(Z){let U=[],X=Z.trim(),J=/(<(?:h[1-6]|p|blockquote|pre|ul|ol|hr|table|div|section|article|aside|figure|nav|header|footer|main)[\s>][\s\S]*?<\/(?:h[1-6]|p|blockquote|pre|ul|ol|table|div|section|article|aside|figure|nav|header|footer|main)>|<hr\s*\/?>)/gi,q=0,Q;while((Q=J.exec(X))!==null){if(Q.index>q){let Y=X.slice(q,Q.index).trim();if(Y)U.push(Y)}U.push(Q[0]),q=J.lastIndex}if(q<X.length){let Y=X.slice(q).trim();if(Y)U.push(Y)}return U}function ef(Z){let U=Z.match(/^<(h[1-6])(?:\s[^>]*)?>(.+?)<\/\1>$/is);if(U){let z=parseInt(U[1].slice(1),10),B=$5(U[2]);return[{type:"heading",depth:z,children:B}]}let X=Z.match(/^<p(?:\s[^>]*)?>(.+?)<\/p>$/is);if(X){let z=$5(X[1]);if(z.length===0)return null;return[{type:"paragraph",children:z}]}if(/^<hr\s*\/?>$/i.test(Z))return[{type:"thematicBreak"}];let J=Z.match(/^<pre(?:\s[^>]*)?>\s*<code(?:\s+class="language-(\w+)")?(?:\s[^>]*)?>([^]*?)<\/code>\s*<\/pre>$/is);if(J){let z=J[1]??null,B=o5(J[2]);return[{type:"code",lang:z,value:B}]}let q=Z.match(/^<blockquote(?:\s[^>]*)?>([^]*?)<\/blockquote>$/is);if(q)return[{type:"blockquote",children:UU(q[1]).map((F)=>F.type==="text"?{type:"paragraph",children:[F]}:F)}];let Q=Z.match(/^<ul(?:\s[^>]*)?>([^]*?)<\/ul>$/is);if(Q){let z=W$(Q[1]);if(z.length===0)return null;return[{type:"list",ordered:!1,spread:!1,children:z}]}let Y=Z.match(/^<ol(?:\s[^>]*)?>([^]*?)<\/ol>$/is);if(Y){let z=W$(Y[1]);if(z.length===0)return null;return[{type:"list",ordered:!0,spread:!1,children:z}]}let W=Z.match(/^<table(?:\s[^>]*)?>([^]*?)<\/table>$/is);if(W)return Ul(W[1]);let H=Z.match(/^<(?:div|section|article|aside|figure|nav|header|footer|main)(?:\s[^>]*)?>([^]*?)<\/(?:div|section|article|aside|figure|nav|header|footer|main)>$/is);if(H)return UU(H[1]);if(Xl(Z).trim())return[{type:"paragraph",children:$5(Z)}];return null}function $5(Z){let U=[],X=0;while(X<Z.length){let J=Z.indexOf("<",X);if(J===-1){let H=o5(Z.slice(X));if(H.trim())U.push({type:"text",value:H});break}if(J>X){let H=o5(Z.slice(X,J));if(H.trim())U.push({type:"text",value:H})}let q=Z.slice(J).match(/^<br\s*\/?>/i);if(q){U.push({type:"break"}),X=J+q[0].length;continue}let Q=Z.slice(J).match(/^<img(\s[^>]*?)\/?>/i);if(Q){let H=Q[1]??"",K=H.match(/src="([^"]*)"/)?.[1]??"",z=H.match(/alt="([^"]*)"/)?.[1]??"";U.push({type:"image",url:o5(K),alt:o5(z)}),X=J+Q[0].length;continue}let Y=Z.slice(J).match(/^<(a|em|strong|del|code|b|i|s)(\s[^>]*)?>/);if(Y){let H=Y[1].toLowerCase(),K=Y[2]??"",z=J+Y[0].length,B=`</${H}>`,F=Zl(Z,z,H);if(F===-1){X=J+1;continue}let V=Z.slice(z,F);switch(X=F+B.length,H){case"a":{let w=K.match(/href="([^"]*)"/)?.[1]??"",M=K.match(/title="([^"]*)"/)?.[1]??null,N=$5(V);if(N.length===0)N.push({type:"text",value:o5(V)});U.push({type:"link",url:o5(w),title:M,children:N});break}case"em":case"i":U.push({type:"emphasis",children:$5(V)});break;case"strong":case"b":U.push({type:"strong",children:$5(V)});break;case"del":case"s":U.push({type:"delete",children:$5(V)});break;case"code":U.push({type:"inlineCode",value:o5(V)});break}continue}let W=Z.slice(J).match(/^<[^>]*>/);if(W)X=J+W[0].length;else X=J+1}return U}function Zl(Z,U,X){let J=1,q=new RegExp(`<${X}[\\s>]`,"gi"),Q=new RegExp(`</${X}>`,"gi");q.lastIndex=U,Q.lastIndex=U;while(J>0){let Y=q.exec(Z),W=Q.exec(Z);if(!W)return-1;if(Y&&Y.index<W.index)J++,q.lastIndex=Y.index+Y[0].length,Q.lastIndex=W.index;else if(J--,J===0)return W.index}return-1}function W$(Z){let U=[],X=/<li(?:\s[^>]*)?>([\s\S]*?)<\/li>/gi,J;while((J=X.exec(Z))!==null){let q=J[1].trim(),Q=/<(?:p|ul|ol|blockquote|pre)[\s>]/i.test(q)?UU(q):[{type:"paragraph",children:$5(q)}];U.push({type:"listItem",spread:!1,children:Q})}return U}function Ul(Z){let U=[],X=/<tr(?:\s[^>]*)?>([\s\S]*?)<\/tr>/gi,J;while((J=X.exec(Z))!==null){let q=/<(?:th|td)(?:\s[^>]*)?>([\s\S]*?)<\/(?:th|td)>/gi,Q=[],Y;while((Y=q.exec(J[1]))!==null)Q.push({type:"tableCell",children:$5(Y[1])});if(Q.length>0)U.push({type:"tableRow",children:Q})}if(U.length===0)return[];return[{type:"table",children:U}]}function Xl(Z){return Z.replace(/<[^>]+>/g,"")}function o5(Z){return Z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/$/g,"$").replace(/ /g," ")}function z$(Z,U=new Map){if(!Array.isArray(Z.children)||Z.children.length===0)return{content:""};let X=Z.state?E5(Z.state,null):null,J=Z.children.flatMap((z)=>H3(z,U,X)),q=[],Q=[],Y=()=>{if(Q.length>0)q.push({type:"paragraph",children:Q}),Q=[]};for(let z of J)if(H$(z.type))Q.push(z);else Y(),q.push(z);Y();let W={type:"root",children:q};return{content:R6().use(f5).use(eZ,{bullet:"-",emphasis:"*",strong:"*",setext:!1}).stringify(W).replace(/\n{3,}/g,`
|
|
403
|
+
`)&&!J){if(q.push(X),X="",H==="\r")W++}else X+=H}if(X.trim())q.push(X);if(q.length===0)return[];let Q=(W)=>{let H=[],K="",z=!1;for(let B=0;B<W.length;B++){let F=W[B];if(F==='"')if(z&&W[B+1]==='"')K+='"',B++;else z=!z;else if(F===","&&!z)H.push(K),K="";else K+=F}return H.push(K),H},Y=Q(q[0]);for(let W=1;W<q.length;W++){let H=Q(q[W]),K={};for(let z=0;z<Y.length;z++)K[Y[z].trim()]=H[z]?.trim()??"";U.push(K)}return U}async function Sf(){if(!fY)fY=await Promise.resolve().then(() => (rN(),iN));return fY}async function bf(Z,U){let{MarkdownFile:X}=await Sf(),q=new X({src:Z,directiveOptions:U}).resolve(),Q={};if(q.$excerpt!=null)Q.excerpt=q.$excerpt;if(q.$toc!=null)Q.toc=q.$toc;if(q.$readingTime!=null)Q.readingTime=q.$readingTime;if(q.$wordCount!=null)Q.wordCount=q.$wordCount;return{id:q.slug,data:q.frontmatter,body:pY(Z,"utf-8"),$children:q.$children,_meta:Q}}function gf(Z){let U=JSON.parse(pY(Z,"utf-8"));if(Array.isArray(U))return U.map((J,q)=>({id:J.id??aN(Z,".json")+"-"+q,data:J,body:null}));let X=U;return[{id:X.id??aN(Z,".json"),data:X,body:null}]}function tN(Z,U){return Z.map((X,J)=>{let q={...X};if(U?.properties)for(let[Y,W]of Object.entries(U.properties)){if(!(Y in q))continue;if(W.type==="number"){let H=String(q[Y]??"").trim();if(H==="")q[Y]=null;else{let K=H.replace(/[$€£¥,\s]/g,""),z=Number(K);q[Y]=isNaN(z)?null:z}}else if(W.type==="boolean")q[Y]=q[Y]==="true";else if(W.type==="array"){let H=String(q[Y]??"").trim();q[Y]=H===""?[]:H.split(",").map((K)=>K.trim()).filter(Boolean)}}return{id:q.id??q.sku??q.slug??q.Slug??String(J),data:q,body:null}})}function yf(Z,U){let X=oN(pY(Z,"utf-8"));return tN(X,U)}async function vf(Z,U){let X=await fetch(Z);if(!X.ok)throw Error(`Failed to fetch CSV from ${Z}: ${X.status} ${X.statusText}`);return tN(oN(await X.text()),U)}function dY(Z,U){let X=lY(Z,"content");return{config:{contentTypes:U?.contentTypes??{}},contentDir:X}}async function eN(Z,U){let X=dY(Z,U);if(!X)return new Map;let{config:J}=X,q=new Map;for(let[Q,Y]of Object.entries(J.contentTypes)){let W=await kf(Q,Y,Z);q.set(Q,W)}return q}async function kf(Z,U,X){let J=U.source;if(!J)return[];let q=U.schema,Q=U.$elements?.length?{allowedNames:U.$elements.filter((K)=>typeof K==="string"||typeof K==="object"&&K?.$ref).map((K)=>typeof K==="string"?K:K.$ref)}:void 0;if(J.startsWith("http://")||J.startsWith("https://"))try{let K=await vf(J,q);if(q)sN(K,q,Z);return K}catch(K){return console.warn(`Content type "${Z}": ${K.message}`),[]}let Y=lY(X,J).split("\\").join("/"),W;if(nN(J))W=xf(Y)?[Y]:[];else{let z=`.${U.format||"md"}`,B=Y.endsWith("/")?Y:Y+"/";try{W=Tf(B,{recursive:!0}).filter((F)=>String(F).endsWith(z)).map((F)=>lY(B,String(F)))}catch{W=[]}}let H=[];for(let K of W){let z=nN(K).toLowerCase();if(z===".md")H.push(await bf(K,Q));else if(z===".json")H.push(...gf(K));else if(z===".csv")H.push(...yf(K,q))}if(q)sN(H,q,Z);return H}function sN(Z,U,X){let J=U.required??[],q=U.properties??{};for(let Q of Z){for(let Y of J)if(!(Y in Q.data)||Q.data[Y]==null)console.warn(`Content validation: "${X}/${Q.id}" missing required field "${Y}"`);for(let[Y,W]of Object.entries(q)){let H=Q.data[Y];if(H==null)continue;if(W.type==="string"&&typeof H!=="string")console.warn(`Content validation: "${X}/${Q.id}" field "${Y}" expected string, got ${typeof H}`);else if(W.type==="number"&&typeof H!=="number")console.warn(`Content validation: "${X}/${Q.id}" field "${Y}" expected number, got ${typeof H}`);else if(W.type==="boolean"&&typeof H!=="boolean")console.warn(`Content validation: "${X}/${Q.id}" field "${Y}" expected boolean, got ${typeof H}`);else if(W.type==="array"&&!Array.isArray(H))console.warn(`Content validation: "${X}/${Q.id}" field "${Y}" expected array, got ${typeof H}`)}}}function Z$(Z,U){for(let[X,J]of Object.entries(U.contentTypes)){let q=J.schema;if(!q?.properties)continue;let Q=Z.get(X);if(!Q)continue;for(let[Y,W]of Object.entries(q.properties)){if(!W.$ref?.startsWith("#/contentTypes/"))continue;let H=W.$ref.replace("#/contentTypes/",""),K=Z.get(H);if(!K)continue;for(let z of Q){let B=z.data[Y];if(typeof B==="string"){let F=K.find((V)=>V.id===B);if(F)z.data[Y]=F}}}}}var fY=null;var U$=()=>{};import{readFileSync as hf}from"node:fs";import{dirname as X$,resolve as cY}from"node:path";import{pathToFileURL as mf}from"node:url";import{createRequire as uf}from"node:module";async function J$(Z,U,X,J={}){let q=Z.imports??{},Q=Z.state;if(!Q)return;for(let[Y,W]of Object.entries(Q)){if(!W||typeof W!=="object"||!W.$prototype)continue;if(ff.has(W.$prototype))continue;if(W.timing&&W.timing!=="compiler")continue;if(!W.$src){let H=q[W.$prototype];if(!H)continue;W.$src=H}try{let H=await pf(W,U,X,Q,J);if(W.timing&&H&&typeof H==="object"&&!Array.isArray(H))H.timing=W.timing;Q[Y]=H}catch(H){console.warn(`prototype-resolver: failed to resolve "${Y}" ($prototype: "${W.$prototype}"):`,H.message)}}}async function pf(Z,U,X,J,q){let Q=Z.$src,Y;if(Q.startsWith("./")||Q.startsWith("../"))Y=U.sourcePath?cY(X$(U.sourcePath),Q):cY(X,Q);else Y=uf(cY(X,"package.json")).resolve(Q);let W=hf(Y,"utf-8"),H=JSON.parse(W);if(!H.$implementation)throw Error(`${Q} has no $implementation field`);let K=mf(Y).href,B=await import(new URL(H.$implementation,K).href),F=Z.$export??H.title??Z.$prototype,V=B[F]??B.default?.[F];if(!V)throw Error(`Module ${H.$implementation} does not export "${F}"`);let w={};for(let[N,$]of Object.entries(Z))if(!lf.has(N))w[N]=$;if(w.src&&!w.basePath&&U.sourcePath)w.basePath=X$(U.sourcePath);w._project={config:q.config??null,contentTypes:q.contentTypes??null,root:X},w._document={route:U,state:J};let M=new V(w);if(typeof M.resolve==="function")return await M.resolve();return M}var ff,lf;var q$=P(()=>{ff=new Set(["Function","LocalStorage","SessionStorage","Array"]),lf=new Set(["$prototype","$src","$export","timing","default","description"])});function eZ(Z){let U=this;U.compiler=X;function X(J){return mq(J,{...U.data("settings"),...Z,extensions:U.data("toMarkdownExtensions")||[]})}}var Q$=P(()=>{s2()});var Y$=P(()=>{Q$()});function H3(Z,U,X){if(typeof Z==="string")return Z.trim()?[{type:"text",value:Z}]:[];if(typeof Z==="number")return[{type:"text",value:String(Z)}];if(!Z||typeof Z!=="object")return[];if(Z.$prototype==="Array")return nf(Z,U,X);let J=Z.tagName??"div",q=rY(Z.textContent,X);if(typeof Z.innerHTML==="string"&&Z.innerHTML.trim()){let Y=UU(Z.innerHTML);if(Y.length>0)return Y}if(J.includes("-"))return rf(Z,J,U);if(cf.has(J)){if(q!=null)return q.trim()?[{type:"paragraph",children:[{type:"text",value:q}]}]:[];return N5(Z,U,X)}let Q=df[J];if(!Q){if(q!=null)return q.trim()?[{type:"paragraph",children:[{type:"text",value:q}]}]:[];return N5(Z,U,X)}switch(Q){case"heading":{let Y=parseInt(J.slice(1),10),W=q!=null?[{type:"text",value:q}]:r8(Z,U,X);return[{type:"heading",depth:Y,children:W}]}case"paragraph":{let Y=q!=null?[{type:"text",value:q}]:r8(Z,U,X);if(Y.length===0)return[];return[{type:"paragraph",children:Y}]}case"emphasis":case"strong":case"delete":{let Y=q!=null?[{type:"text",value:q}]:r8(Z,U,X);return[{type:Q,children:Y}]}case"inlineCode":return[{type:"inlineCode",value:q??""}];case"link":{let Y=String(Z.attributes?.href??""),W=Z.attributes?.title??null,H=q!=null?[{type:"text",value:q}]:r8(Z,U,X);return[{type:"link",url:Y,title:W,children:H}]}case"image":{let Y=String(Z.attributes?.src??""),W=String(Z.attributes?.alt??""),H=Z.attributes?.title??null;return[{type:"image",url:Y,alt:W,title:H}]}case"blockquote":return[{type:"blockquote",children:N5(Z,U,X).map((H)=>H.type==="text"?{type:"paragraph",children:[H]}:H)}];case"list":{let Y=J==="ol",H=N5(Z,U,X).filter((K)=>K.type==="listItem");if(H.length===0)return[];return[{type:"list",ordered:Y,spread:!1,children:H}]}case"listItem":{let Y=N5(Z,U,X);if(Y.length>0&&Y.every((W)=>W.type==="text"||H$(W.type)))Y=[{type:"paragraph",children:Y}];return[{type:"listItem",spread:!1,children:Y}]}case"code":{let Y=Array.isArray(Z.children)?Z.children.find((K)=>K?.tagName==="code"):null,W=Y?.textContent??q??"";return[{type:"code",lang:Y?.className?.replace("language-","")??null,value:W}]}case"thematicBreak":return[{type:"thematicBreak"}];case"break":return[{type:"break"}];case"table":return of(Z,U,X);case"thead":case"tbody":return N5(Z,U,X);case"tableRow":return[{type:"tableRow",children:N5(Z,U,X).filter((W)=>W.type==="tableCell")}];case"tableCell":return[{type:"tableCell",children:q!=null?[{type:"text",value:q}]:r8(Z,U,X)}]}return[]}function H$(Z){return["text","emphasis","strong","delete","inlineCode","link","image","break"].includes(Z)}function N5(Z,U,X){if(Z.textContent!=null){let J=rY(Z.textContent,X);if(J)return[{type:"text",value:J}];return[]}if(!Array.isArray(Z.children))return[];return Z.children.flatMap((J)=>H3(J,U,X))}function r8(Z,U,X){if(Z.textContent!=null){let J=rY(Z.textContent,X);if(J)return[{type:"text",value:J}];return[]}if(!Array.isArray(Z.children))return[];return Z.children.flatMap((J)=>H3(J,U,X))}function rf(Z,U,X){let J=X.get(U);if(!J)return N5(Z,X);let q=Z.$props??{},Q={...J.state};for(let[K,z]of Object.entries(q))if(K in Q){let B=Q[K];if(B&&typeof B==="object"&&!Array.isArray(B)&&"default"in B)Q[K]={...B,default:z};else Q[K]=z}else Q[K]=z;let Y=E5(Q,null);if(!Array.isArray(J.children))return[];let W=K$(J.children,Y),H=Z.children;return W.flatMap((K)=>{if(typeof K!=="string"&&K?.tagName==="slot"&&Array.isArray(H))return H.flatMap((z)=>H3(z,X));return H3(K,X,Y)})}function K$(Z,U){if(!Array.isArray(Z))return[];return Z.map((X)=>af(X,U))}function af(Z,U){if(typeof Z==="string")return N1(Z)?String(a1(Z,U)??Z):Z;if(!Z||typeof Z!=="object")return Z;let X={...Z};if(typeof X.textContent==="string"&&N1(X.textContent))X.textContent=String(a1(X.textContent,U)??X.textContent);if(typeof X.innerHTML==="string"&&N1(X.innerHTML))X.innerHTML=String(a1(X.innerHTML,U)??X.innerHTML);if(X.attributes){X.attributes={...X.attributes};for(let[J,q]of Object.entries(X.attributes))if(typeof q==="string"&&N1(q))X.attributes[J]=a1(q,U)??q}if(Array.isArray(X.children))X.children=K$(X.children,U);return X}function nf(Z,U,X){let J=Z.items?.$ref;if(!J||!X)return[];let q=sf(J,X);if(!Array.isArray(q))return[];let Q=Z.map;if(!Q)return[];return q.flatMap((Y,W)=>{let H=Object.create(X);H.item=Y,H.index=W;let K=iY(Q,Y);return H3(K,U,X)})}function iY(Z,U){if(typeof Z==="string")return Z;if(!Z||typeof Z!=="object")return Z;let X={...Z};for(let[J,q]of Object.entries(X))if(q&&typeof q==="object"&&q.$ref){let Q=q.$ref;if(Q.startsWith("$map/")){let Y=Q.slice(5);X[J]=ZU(Y==="item"?U:U,Y.startsWith("item/")?Y.slice(5):Y)}}if(X.$props)X.$props=iY(X.$props,U);if(typeof X.textContent==="string"&&X.textContent.startsWith("$map/"))X.textContent=ZU(U,X.textContent.slice(5));if(Array.isArray(X.children))X.children=X.children.map((J)=>iY(J,U));return X}function ZU(Z,U){let X=U.split(/[/.]/),J=Z;for(let q of X){if(J==null)return;J=J[q]}return J}function sf(Z,U){if(Z.startsWith("#/state/"))return ZU(U,Z.slice(8));return ZU(U,Z)}function of(Z,U,X){let J=N5(Z,U,X).filter((q)=>q.type==="tableRow");if(J.length===0)return[];return[{type:"table",children:J}]}function rY(Z,U){if(Z==null)return null;if(typeof Z==="string"){if(U&&N1(Z)){let X=a1(Z,U);return X!=null?String(X):Z}return Z}return String(Z)}function UU(Z){let U=[],X=tf(Z);for(let J of X){let q=J.trim();if(!q)continue;let Q=ef(q);if(Q)U.push(...Q)}return U}function tf(Z){let U=[],X=Z.trim(),J=/(<(?:h[1-6]|p|blockquote|pre|ul|ol|hr|table|div|section|article|aside|figure|nav|header|footer|main)[\s>][\s\S]*?<\/(?:h[1-6]|p|blockquote|pre|ul|ol|table|div|section|article|aside|figure|nav|header|footer|main)>|<hr\s*\/?>)/gi,q=0,Q;while((Q=J.exec(X))!==null){if(Q.index>q){let Y=X.slice(q,Q.index).trim();if(Y)U.push(Y)}U.push(Q[0]),q=J.lastIndex}if(q<X.length){let Y=X.slice(q).trim();if(Y)U.push(Y)}return U}function ef(Z){let U=Z.match(/^<(h[1-6])(?:\s[^>]*)?>(.+?)<\/\1>$/is);if(U){let z=parseInt(U[1].slice(1),10),B=$5(U[2]);return[{type:"heading",depth:z,children:B}]}let X=Z.match(/^<p(?:\s[^>]*)?>(.+?)<\/p>$/is);if(X){let z=$5(X[1]);if(z.length===0)return null;return[{type:"paragraph",children:z}]}if(/^<hr\s*\/?>$/i.test(Z))return[{type:"thematicBreak"}];let J=Z.match(/^<pre(?:\s[^>]*)?>\s*<code(?:\s+class="language-(\w+)")?(?:\s[^>]*)?>([^]*?)<\/code>\s*<\/pre>$/is);if(J){let z=J[1]??null,B=o5(J[2]);return[{type:"code",lang:z,value:B}]}let q=Z.match(/^<blockquote(?:\s[^>]*)?>([^]*?)<\/blockquote>$/is);if(q)return[{type:"blockquote",children:UU(q[1]).map((F)=>F.type==="text"?{type:"paragraph",children:[F]}:F)}];let Q=Z.match(/^<ul(?:\s[^>]*)?>([^]*?)<\/ul>$/is);if(Q){let z=W$(Q[1]);if(z.length===0)return null;return[{type:"list",ordered:!1,spread:!1,children:z}]}let Y=Z.match(/^<ol(?:\s[^>]*)?>([^]*?)<\/ol>$/is);if(Y){let z=W$(Y[1]);if(z.length===0)return null;return[{type:"list",ordered:!0,spread:!1,children:z}]}let W=Z.match(/^<table(?:\s[^>]*)?>([^]*?)<\/table>$/is);if(W)return Ul(W[1]);let H=Z.match(/^<(?:div|section|article|aside|figure|nav|header|footer|main)(?:\s[^>]*)?>([^]*?)<\/(?:div|section|article|aside|figure|nav|header|footer|main)>$/is);if(H)return UU(H[1]);if(Xl(Z).trim())return[{type:"paragraph",children:$5(Z)}];return null}function $5(Z){let U=[],X=0;while(X<Z.length){let J=Z.indexOf("<",X);if(J===-1){let H=o5(Z.slice(X));if(H.trim())U.push({type:"text",value:H});break}if(J>X){let H=o5(Z.slice(X,J));if(H.trim())U.push({type:"text",value:H})}let q=Z.slice(J).match(/^<br\s*\/?>/i);if(q){U.push({type:"break"}),X=J+q[0].length;continue}let Q=Z.slice(J).match(/^<img(\s[^>]*?)\/?>/i);if(Q){let H=Q[1]??"",K=H.match(/src="([^"]*)"/)?.[1]??"",z=H.match(/alt="([^"]*)"/)?.[1]??"";U.push({type:"image",url:o5(K),alt:o5(z)}),X=J+Q[0].length;continue}let Y=Z.slice(J).match(/^<(a|em|strong|del|code|b|i|s)(\s[^>]*)?>/);if(Y){let H=Y[1].toLowerCase(),K=Y[2]??"",z=J+Y[0].length,B=`</${H}>`,F=Zl(Z,z,H);if(F===-1){X=J+1;continue}let V=Z.slice(z,F);switch(X=F+B.length,H){case"a":{let w=K.match(/href="([^"]*)"/)?.[1]??"",M=K.match(/title="([^"]*)"/)?.[1]??null,N=$5(V);if(N.length===0)N.push({type:"text",value:o5(V)});U.push({type:"link",url:o5(w),title:M,children:N});break}case"em":case"i":U.push({type:"emphasis",children:$5(V)});break;case"strong":case"b":U.push({type:"strong",children:$5(V)});break;case"del":case"s":U.push({type:"delete",children:$5(V)});break;case"code":U.push({type:"inlineCode",value:o5(V)});break}continue}let W=Z.slice(J).match(/^<[^>]*>/);if(W)X=J+W[0].length;else X=J+1}return U}function Zl(Z,U,X){let J=1,q=new RegExp(`<${X}[\\s>]`,"gi"),Q=new RegExp(`</${X}>`,"gi");q.lastIndex=U,Q.lastIndex=U;while(J>0){let Y=q.exec(Z),W=Q.exec(Z);if(!W)return-1;if(Y&&Y.index<W.index)J++,q.lastIndex=Y.index+Y[0].length,Q.lastIndex=W.index;else if(J--,J===0)return W.index}return-1}function W$(Z){let U=[],X=/<li(?:\s[^>]*)?>([\s\S]*?)<\/li>/gi,J;while((J=X.exec(Z))!==null){let q=J[1].trim(),Q=/<(?:p|ul|ol|blockquote|pre)[\s>]/i.test(q)?UU(q):[{type:"paragraph",children:$5(q)}];U.push({type:"listItem",spread:!1,children:Q})}return U}function Ul(Z){let U=[],X=/<tr(?:\s[^>]*)?>([\s\S]*?)<\/tr>/gi,J;while((J=X.exec(Z))!==null){let q=/<(?:th|td)(?:\s[^>]*)?>([\s\S]*?)<\/(?:th|td)>/gi,Q=[],Y;while((Y=q.exec(J[1]))!==null)Q.push({type:"tableCell",children:$5(Y[1])});if(Q.length>0)U.push({type:"tableRow",children:Q})}if(U.length===0)return[];return[{type:"table",children:U}]}function Xl(Z){return Z.replace(/<[^>]+>/g,"")}function o5(Z){return Z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/$/g,"$").replace(/ /g," ")}function z$(Z,U=new Map){if(!Array.isArray(Z.children)||Z.children.length===0)return{content:""};let X=Z.state?E5(Z.state,null):null,J=Z.children.flatMap((z)=>H3(z,U,X)),q=[],Q=[],Y=()=>{if(Q.length>0)q.push({type:"paragraph",children:Q}),Q=[]};for(let z of J)if(H$(z.type))Q.push(z);else Y(),q.push(z);Y();let W={type:"root",children:q};return{content:R6().use(f5).use(eZ,{bullet:"-",emphasis:"*",strong:"*",setext:!1}).stringify(W).replace(/\n{3,}/g,`
|
|
404
404
|
|
|
405
405
|
`).trim()+`
|
|
406
406
|
`}}var df,cf;var B$=P(()=>{T7();Y$();t2();_5();df={h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",p:"paragraph",em:"emphasis",strong:"strong",del:"delete",code:"inlineCode",a:"link",img:"image",blockquote:"blockquote",ul:"list",ol:"list",li:"listItem",pre:"code",hr:"thematicBreak",br:"break",table:"table",thead:"thead",tbody:"tbody",tr:"tableRow",th:"tableCell",td:"tableCell"},cf=new Set(["div","section","span","nav","header","footer","main","article","aside","figure","figcaption","slot"])});var f4=Y1((PX1,V$)=>{/*!
|
|
@@ -443,7 +443,7 @@ globstar while`,Z,B,U,F,V),this.matchOne(Z.slice(B),U.slice(F),X))return this.de
|
|
|
443
443
|
*/var Ki=E1("node:events"),MU=qU(),G4=f4(),{runtimePlatformArch:zi}=YW(),k0=e8(),CD=zi(),NW=k0.libvipsVersion(),U6=k0.format();U6.heif.output.alias=["avif","heic"];U6.jpeg.output.alias=["jpe","jpg"];U6.tiff.output.alias=["tif"];U6.jp2k.output.alias=["j2c","j2k","jp2","jpx"];var Bi={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},N3={vips:NW.semver};if(!NW.isGlobal)if(!NW.isWasm)try{N3=E1(`@img/sharp-${CD}/versions`)}catch(Z){try{N3=E1(`@img/sharp-libvips-${CD}/versions`)}catch(U){}}else try{N3=(()=>{throw new Error("Cannot require module "+"@img/sharp-wasm32/versions");})()}catch(Z){}N3.sharp=qW().version;if(N3.heif&&U6.heif)U6.heif.input.fileSuffix=[".avif"],U6.heif.output.alias=["avif"];function ID(Z){if(G4.bool(Z))if(Z)return k0.cache(50,20,100);else return k0.cache(0,0,0);else if(G4.object(Z))return k0.cache(Z.memory,Z.files,Z.items);else return k0.cache()}ID(!0);function Fi(Z){return k0.concurrency(G4.integer(Z)?Z:null)}if(MU.familySync()===MU.GLIBC&&!k0._isUsingJemalloc())k0.concurrency(1);else if(MU.familySync()===MU.MUSL&&k0.concurrency()===1024)k0.concurrency(E1("node:os").availableParallelism());var Vi=new Ki.EventEmitter;function Li(){return k0.counters()}function Ri(Z){return k0.simd(G4.bool(Z)?Z:null)}function wi(Z){if(G4.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(G4.string))k0.block(Z.operation,!0);else throw G4.invalidParameterError("operation","Array<string>",Z.operation);else throw G4.invalidParameterError("options","object",Z)}function Gi(Z){if(G4.object(Z))if(Array.isArray(Z.operation)&&Z.operation.every(G4.string))k0.block(Z.operation,!1);else throw G4.invalidParameterError("operation","Array<string>",Z.operation);else throw G4.invalidParameterError("options","object",Z)}ED.exports=(Z)=>{Z.cache=ID,Z.concurrency=Fi,Z.counters=Li,Z.simd=Ri,Z.format=U6,Z.interpolators=Bi,Z.versions=N3,Z.queue=Vi,Z.block=wi,Z.unblock=Gi}});var $W=Y1((BJ1,AD)=>{/*!
|
|
444
444
|
Copyright 2013 Lovell Fuller and others.
|
|
445
445
|
SPDX-License-Identifier: Apache-2.0
|
|
446
|
-
*/var P5=pj();ij()(P5);tj()(P5);ZD()(P5);QD()(P5);GD()(P5);ND()(P5);PD()(P5);_D()(P5);AD.exports=P5});import{createHash as TD}from"node:crypto";import{readFileSync as Mi,mkdirSync as Ni,existsSync as $i}from"node:fs";import{resolve as jW,basename as ji,extname as Di}from"node:path";import{createRequire as Oi}from"node:module";async function xD(){if($3)return $3;try{return $3=(await Promise.resolve().then(() => Q6($W(),1))).default,$3}catch{}try{return $3=Oi(jW(process.cwd(),"package.json"))("sharp"),$3}catch(Z){throw Error(`Sharp is required for image optimization but failed to load: ${Z.message}`)}}async function Ci(Z){let X=await(await xD())(Z).metadata();return{width:X.width??0,height:X.height??0,format:X.format??"unknown"}}function NU(Z){let U=Mi(Z);return TD("md5").update(U).digest("hex").slice(0,8)}function DW(Z){let U=JSON.stringify({widths:Z.widths,formats:Z.formats,quality:Z.quality});return TD("md5").update(U).digest("hex").slice(0,8)}function Ii(Z,U,X,J){return`${Z}-${U}-${X}.${J}`}async function SD(Z,U,X){let J=await xD(),q=await Ci(Z),Q=NU(Z),Y=ji(Z,Di(Z)),W=jW(U,"_optimized");Ni(W,{recursive:!0});let H=[],K=X.widths.filter((F)=>F<=q.width);if(K.length===0||!K.includes(q.width))K.push(q.width);K.sort((F,V)=>F-V);let z=[];for(let F of K)for(let V of X.formats){let w=Ii(Y,F,Q,V),M=`/${Pi}/${w}`,N=jW(W,w);if(H.push({width:F,format:V,outputPath:M,absolutePath:N}),$i(N))continue;let $=X.quality[V]??80,O=J(Z).resize(F).toFormat(V,{quality:$}).toFile(N).then(()=>{});z.push(O)}let B=4;for(let F=0;F<z.length;F+=B)await Promise.all(z.slice(F,F+B));return{original:{width:q.width,height:q.height,format:q.format},variants:H,contentHash:Q}}function OW(Z,U){return Z.filter((X)=>X.format===U).map((X)=>`${X.outputPath} ${X.width}w`).join(", ")}var $3=null,Pi="images/_optimized";var PW=()=>{};import{readFileSync as Ei,writeFileSync as _i,mkdirSync as Ai,existsSync as Ti}from"node:fs";import{resolve as $U,basename as xi}from"node:path";import{execSync as Si}from"node:child_process";import{tmpdir as bi}from"node:os";function j3(Z){if(Z7===void 0)try{let U=Si("npm config get cache",{encoding:"utf-8",stdio:["ignore","pipe","ignore"],cwd:bi()}).trim();Z7=U&&U!=="undefined"?U:null}catch{Z7=null}if(Z7)return $U(Z7,"jxsuite-images",xi(Z));return $U(Z,".cache/images")}function bD(Z){let U=$U(j3(Z),"manifest.json");if(!Ti(U))return{version:1,entries:{}};try{return JSON.parse(Ei(U,"utf8"))}catch{return{version:1,entries:{}}}}function gD(Z,U){let X=j3(Z);Ai(X,{recursive:!0}),_i($U(X,"manifest.json"),JSON.stringify(U,null,2),"utf8")}function yD(Z,U){let X=Z.entries[U];if(!X)return null;return X.manifest}function vD(Z,U,X,J){Z.entries[U]={source:X,manifest:J,timestamp:Date.now()}}var Z7=void 0;var CW=P(()=>{PW()});import{existsSync as IW}from"node:fs";import{resolve as kD,extname as gi,basename as yi}from"node:path";async function hD(Z,U,X,J,q){let Q=`${NU(Z)}:${DW(X)}`,Y=yD(q,Q);if(Y){if(Y.variants.every((K)=>IW(K.absolutePath)))return Y}if(!Y)console.log(` Optimizing ${yi(Z)}...`);let W=await SD(Z,j3(J),X);return vD(q,Q,U,W),W}function mD(Z){if(typeof Z!=="string")return!0;if(Z.includes("${"))return!0;if(ki.some((U)=>Z.startsWith(U)))return!0;if(vi.has(gi(Z).toLowerCase()))return!0;return!1}function uD(Z,U){if(Z.startsWith("/"))return kD(U,"public",Z.slice(1));return kD(U,Z)}async function fD(Z,U,X,J){let q=new Map;if(!U.optimize)return{imageRefs:q};return await lD(Z,U,X,J,q),{imageRefs:q}}async function lD(Z,U,X,J,q){if(!Z||typeof Z!=="object")return;if(Z.tagName==="img")await hi(Z,U,X,J,q);if(typeof Z.innerHTML==="string"&&Z.innerHTML.includes("<img"))Z.innerHTML=await pi(Z.innerHTML,U,X,J,q);if(Array.isArray(Z.children))for(let Q of Z.children){if(typeof Q==="string")continue;await lD(Q,U,X,J,q)}}async function hi(Z,U,X,J,q){if(!Z.attributes)Z.attributes={};let Q=Z.attributes.src??Z.src;if(mD(Q))return;if(Z.attributes["data-no-optimize"]!==void 0)return;let Y=uD(Q,X);if(!IW(Y))return;let W=q.get(Y);if(!W)W=await hD(Y,Q,U,X,J),q.set(Y,W);let H=U.formats.includes("avif")?"avif":U.formats[0],K=OW(W.variants,H);if(K)Z.attributes.srcset=K,Z.attributes.sizes=Z.attributes.sizes??U.sizes;if(!Z.attributes.width&&W.original?.width)Z.attributes.width=String(W.original.width);if(!Z.attributes.height&&W.original?.height)Z.attributes.height=String(W.original.height);if(U.lazyLoad&&Z.attributes.loading!=="eager")Z.attributes.loading="lazy",Z.attributes.decoding="async"}async function pi(Z,U,X,J,q){let Q=[];for(let W of Z.matchAll(mi)){let H=W[0],K=W[1];if(fi.test(K))continue;if(li.test(K))continue;let z=K.match(ui);if(!z)continue;let B=z[1];if(mD(B))continue;let F=uD(B,X);if(!IW(F))continue;let V=q.get(F);if(!V)V=await hD(F,B,U,X,J),q.set(F,V);let w=U.formats.includes("avif")?"avif":U.formats[0],M=OW(V.variants,w);if(!M)continue;let N=` srcset="${M}" sizes="${U.sizes}"`;if(!/\bwidth=/.test(K)&&V.original?.width)N+=` width="${V.original.width}"`;if(!/\bheight=/.test(K)&&V.original?.height)N+=` height="${V.original.height}"`;if(U.lazyLoad&&!/\bloading="eager"/.test(K)){if(!/\bloading=/.test(K))N+=' loading="lazy"';if(!/\bdecoding=/.test(K))N+=' decoding="async"'}Q.push({match:H,replacement:`<img${K}${N}>`})}let Y=Z;for(let{match:W,replacement:H}of Q)Y=Y.replace(W,H);return Y}var vi,ki,mi,ui,fi,li;var pD=P(()=>{PW();CW();vi=new Set([".svg",".gif"]),ki=["http://","https://","data:","//"];mi=/<img\b([^>]*)>/gi,ui=/\bsrc="([^"]*)"/,fi=/\bsrcset="/,li=/\bdata-no-optimize\b/});var aD={};Y6(aD,{buildSite:()=>ii});import{readFileSync as OU,writeFileSync as a4,copyFileSync as dD,mkdirSync as C5,existsSync as Z9,rmSync as di,cpSync as EW,readdirSync as ci}from"node:fs";import{resolve as m1,dirname as D3,join as DU}from"node:path";async function ii(Z,U={}){let{clean:X=!0,verbose:J=!1}=U,q=[],Q=J?console.log.bind(console):()=>{};Q("Loading project.json...");let{config:Y}=PM(Z),W=m1(Z,Y.build.outDir),H=m1(Z,"pages"),K=m1(Z,"public"),z=Y.build.trailingSlash??"always";if(X&&Z9(W))di(W,{recursive:!0,force:!0});if(C5(W,{recursive:!0}),!Z9(H))throw Error(`pages/ directory not found in ${Z}`);Q("Discovering pages...");let B=IM(H);Q(` Found ${B.length} page(s)`),Q("Loading content types...");let F=await eN(Z,Y);if(F.size>0){Q(` Loaded ${F.size} content type(s): ${[...F.keys()].join(", ")}`);let u=dY(Z,Y);if(u)Z$(F,u.config)}let V=await _M(B,Z,F);Q(` ${V.length} route(s) after expansion`);let w=0,M=m1(Z,"components"),N=[],$=new Map,O=new Map;if(Z9(M)){Q("Compiling components...");let u=ci(M).filter((f)=>f.endsWith(".json")||f.endsWith(".md")),T=m1(W,"components");C5(T,{recursive:!0});for(let f of u)try{let p=m1(M,f),y=await SZ(p,{$media:Y.$media});for(let U1 of y.files){let B1=U1.path.includes("/")?U1.path.split("/").pop():U1.path;if(a4(m1(T,B1),U1.content,"utf8"),U1.tagName)N.push(U1.tagName);w++}let A=p.endsWith(".md")?(await Promise.resolve().then(() => (p6(),y8))).transpileJxMarkdown(OU(p,"utf8")):JSON.parse(OU(p,"utf8"));if(A.tagName){O.set(A.tagName,A);let U1=cW(A.tagName,A.style,A,Y.$media??{});if(U1)$.set(A.tagName,U1),a4(m1(T,`${A.tagName}.css`),U1,"utf8"),w++}}catch(p){let y=p;q.push(`Error compiling component ${f}: ${y.message}`),console.error(`Error compiling component ${f}: ${y.message}`)}Q(` Compiled ${N.length} component(s): ${N.join(", ")}`)}let C=[];if(Y.build.adapter)for(let[,u]of O){let T=W7(u);for(let f of T){let p="./components/"+f.src.replace(/^\.\//,"");C.push({exportName:f.exportName,src:p})}}let b=Y.images.optimize?bD(Z):null;for(let u of V)try{Q(` Compiling ${u.urlPattern} ...`);let T=await ri(u,Y,Z,F,b,O),f=new Set;for(let[y,A]of O)if(yU(A))f.add(y);if(N.length>0)T.html=si(T.html,N,$,f);let p=rD(u.urlPattern,W,z);C5(D3(p),{recursive:!0}),a4(p,T.html,"utf8"),w++;try{let y=z$(T.doc,O);if(y.content){let A=p.replace(/\.html$/,".md");a4(A,y.content,"utf8"),w++}}catch(y){let A=y;q.push(`Error exporting markdown for ${u.urlPattern}: ${A.message}`)}for(let y of T.files){let A=m1(D3(p),y.path);C5(D3(A),{recursive:!0}),a4(A,y.content,"utf8"),w++}if(T.serverHandler){let y=m1(D3(p),"_server.js");a4(y,T.serverHandler,"utf8"),w++}}catch(T){let f=T,p=`Error compiling ${u.urlPattern}: ${f.message}`;q.push(p),console.error(p)}if(b&&Y.images.optimize){gD(Z,b);let u=m1(j3(Z),"_optimized");if(Z9(u)){let f=m1(W,"images/_optimized");C5(f,{recursive:!0}),EW(u,f,{recursive:!0})}let T=Object.keys(b.entries).length;if(T>0)Q(` Optimized ${T} image(s)`)}if(Y.build.adapter){let u=Y.build.adapter;Q("Generating site-wide server worker...");let T=new Map;for(let f of C)if(!T.has(f.exportName))T.set(f.exportName,f);if(u==="cloudflare-pages"){let f=NX([...T.values()]);for(let[y,A]of f){let U1=m1(W,y);C5(m1(U1,".."),{recursive:!0}),a4(U1,A,"utf8"),w++}let p=m1(W,"components");C5(p,{recursive:!0});for(let{src:y}of T.values()){let A=m1(Z,y.replace(/^\.\//,"")),U1=m1(p,y.replace(/^\.\/components\//,""));if(Z9(A))dD(A,U1)}if(f.size>0)Q(` Generated ${f.size} Pages function(s) in dist/functions/`)}else{let f=MX([...T.values()],{adapter:u});if(f){let p=m1(W,"worker.js");a4(p,f,"utf8"),w++,Q(` Generated dist/worker.js (${T.size} server function(s))`);let y=m1(W,"components");for(let{src:A}of T.values()){let U1=m1(Z,A.replace(/^\.\//,"")),B1=m1(y,A.replace(/^\.\/components\//,""));if(Z9(U1))dD(U1,B1)}}}}if(Y.redirects&&Object.keys(Y.redirects).length>0){Q("Generating redirects...");let u=ei(Y.redirects,W);w+=u}if(Z9(K))Q("Copying public/ assets..."),EW(K,W,{recursive:!0});if(Y.copy){Q("Copying mapped files...");for(let[u,T]of Object.entries(Y.copy)){let f=m1(Z,u),p=m1(W,T);C5(D3(p),{recursive:!0}),EW(f,p)}}if(Q(`
|
|
446
|
+
*/var P5=pj();ij()(P5);tj()(P5);ZD()(P5);QD()(P5);GD()(P5);ND()(P5);PD()(P5);_D()(P5);AD.exports=P5});import{createHash as TD}from"node:crypto";import{readFileSync as Mi,mkdirSync as Ni,existsSync as $i}from"node:fs";import{resolve as jW,basename as ji,extname as Di}from"node:path";import{createRequire as Oi}from"node:module";async function xD(){if($3)return $3;try{return $3=(await Promise.resolve().then(() => Q6($W(),1))).default,$3}catch{}try{return $3=Oi(jW(process.cwd(),"package.json"))("sharp"),$3}catch(Z){throw Error(`Sharp is required for image optimization but failed to load: ${Z.message}`)}}async function Ci(Z){let X=await(await xD())(Z).metadata();return{width:X.width??0,height:X.height??0,format:X.format??"unknown"}}function NU(Z){let U=Mi(Z);return TD("md5").update(U).digest("hex").slice(0,8)}function DW(Z){let U=JSON.stringify({widths:Z.widths,formats:Z.formats,quality:Z.quality});return TD("md5").update(U).digest("hex").slice(0,8)}function Ii(Z,U,X,J){return`${Z}-${U}-${X}.${J}`}async function SD(Z,U,X){let J=await xD(),q=await Ci(Z),Q=NU(Z),Y=ji(Z,Di(Z)),W=jW(U,"_optimized");Ni(W,{recursive:!0});let H=[],K=X.widths.filter((F)=>F<=q.width);if(K.length===0||!K.includes(q.width))K.push(q.width);K.sort((F,V)=>F-V);let z=[];for(let F of K)for(let V of X.formats){let w=Ii(Y,F,Q,V),M=`/${Pi}/${w}`,N=jW(W,w);if(H.push({width:F,format:V,outputPath:M,absolutePath:N}),$i(N))continue;let $=X.quality[V]??80,O=J(Z).resize(F).toFormat(V,{quality:$}).toFile(N).then(()=>{});z.push(O)}let B=4;for(let F=0;F<z.length;F+=B)await Promise.all(z.slice(F,F+B));return{original:{width:q.width,height:q.height,format:q.format},variants:H,contentHash:Q}}function OW(Z,U){return Z.filter((X)=>X.format===U).map((X)=>`${X.outputPath} ${X.width}w`).join(", ")}var $3=null,Pi="images/_optimized";var PW=()=>{};import{readFileSync as Ei,writeFileSync as _i,mkdirSync as Ai,existsSync as Ti}from"node:fs";import{resolve as $U,basename as xi}from"node:path";import{execSync as Si}from"node:child_process";import{tmpdir as bi}from"node:os";function j3(Z){if(Z7===void 0)try{let U=Si("npm config get cache",{encoding:"utf-8",stdio:["ignore","pipe","ignore"],cwd:bi()}).trim();Z7=U&&U!=="undefined"?U:null}catch{Z7=null}if(Z7)return $U(Z7,"jxsuite-images",xi(Z));return $U(Z,".cache/images")}function bD(Z){let U=$U(j3(Z),"manifest.json");if(!Ti(U))return{version:1,entries:{}};try{return JSON.parse(Ei(U,"utf8"))}catch{return{version:1,entries:{}}}}function gD(Z,U){let X=j3(Z);Ai(X,{recursive:!0}),_i($U(X,"manifest.json"),JSON.stringify(U,null,2),"utf8")}function yD(Z,U){let X=Z.entries[U];if(!X)return null;return X.manifest}function vD(Z,U,X,J){Z.entries[U]={source:X,manifest:J,timestamp:Date.now()}}var Z7=void 0;var CW=P(()=>{PW()});import{existsSync as IW}from"node:fs";import{resolve as kD,extname as gi,basename as yi}from"node:path";async function hD(Z,U,X,J,q){let Q=`${NU(Z)}:${DW(X)}`,Y=yD(q,Q);if(Y){if(Y.variants.every((K)=>IW(K.absolutePath)))return Y}if(!Y)console.log(` Optimizing ${yi(Z)}...`);let W=await SD(Z,j3(J),X);return vD(q,Q,U,W),W}function mD(Z){if(typeof Z!=="string")return!0;if(!Z)return!0;if(Z.includes("${"))return!0;if(ki.some((U)=>Z.startsWith(U)))return!0;if(vi.has(gi(Z).toLowerCase()))return!0;return!1}function uD(Z,U){if(Z.startsWith("/"))return kD(U,"public",Z.slice(1));return kD(U,Z)}async function fD(Z,U,X,J){let q=new Map;if(!U.optimize)return{imageRefs:q};return await lD(Z,U,X,J,q),{imageRefs:q}}async function lD(Z,U,X,J,q){if(!Z||typeof Z!=="object")return;if(Z.tagName==="img")await hi(Z,U,X,J,q);if(typeof Z.innerHTML==="string"&&Z.innerHTML.includes("<img"))Z.innerHTML=await pi(Z.innerHTML,U,X,J,q);if(Array.isArray(Z.children))for(let Q of Z.children){if(typeof Q==="string")continue;await lD(Q,U,X,J,q)}}async function hi(Z,U,X,J,q){if(!Z.attributes)Z.attributes={};let Q=Z.attributes.src??Z.src;if(mD(Q))return;if(Z.attributes["data-no-optimize"]!==void 0)return;let Y=uD(Q,X);if(!IW(Y))return;let W=q.get(Y);if(!W)W=await hD(Y,Q,U,X,J),q.set(Y,W);let H=U.formats.includes("avif")?"avif":U.formats[0],K=OW(W.variants,H);if(K)Z.attributes.srcset=K,Z.attributes.sizes=Z.attributes.sizes??U.sizes;if(!Z.attributes.width&&W.original?.width)Z.attributes.width=String(W.original.width);if(!Z.attributes.height&&W.original?.height)Z.attributes.height=String(W.original.height);if(U.lazyLoad&&Z.attributes.loading!=="eager")Z.attributes.loading="lazy",Z.attributes.decoding="async"}async function pi(Z,U,X,J,q){let Q=[];for(let W of Z.matchAll(mi)){let H=W[0],K=W[1];if(fi.test(K))continue;if(li.test(K))continue;let z=K.match(ui);if(!z)continue;let B=z[1];if(mD(B))continue;let F=uD(B,X);if(!IW(F))continue;let V=q.get(F);if(!V)V=await hD(F,B,U,X,J),q.set(F,V);let w=U.formats.includes("avif")?"avif":U.formats[0],M=OW(V.variants,w);if(!M)continue;let N=` srcset="${M}" sizes="${U.sizes}"`;if(!/\bwidth=/.test(K)&&V.original?.width)N+=` width="${V.original.width}"`;if(!/\bheight=/.test(K)&&V.original?.height)N+=` height="${V.original.height}"`;if(U.lazyLoad&&!/\bloading="eager"/.test(K)){if(!/\bloading=/.test(K))N+=' loading="lazy"';if(!/\bdecoding=/.test(K))N+=' decoding="async"'}Q.push({match:H,replacement:`<img${K}${N}>`})}let Y=Z;for(let{match:W,replacement:H}of Q)Y=Y.replace(W,H);return Y}var vi,ki,mi,ui,fi,li;var pD=P(()=>{PW();CW();vi=new Set([".svg",".gif"]),ki=["http://","https://","data:","//"];mi=/<img\b([^>]*)>/gi,ui=/\bsrc="([^"]*)"/,fi=/\bsrcset="/,li=/\bdata-no-optimize\b/});var aD={};Y6(aD,{buildSite:()=>ii});import{readFileSync as OU,writeFileSync as a4,copyFileSync as dD,mkdirSync as C5,existsSync as Z9,rmSync as di,cpSync as EW,readdirSync as ci}from"node:fs";import{resolve as m1,dirname as D3,join as DU}from"node:path";async function ii(Z,U={}){let{clean:X=!0,verbose:J=!1}=U,q=[],Q=J?console.log.bind(console):()=>{};Q("Loading project.json...");let{config:Y}=PM(Z),W=m1(Z,Y.build.outDir),H=m1(Z,"pages"),K=m1(Z,"public"),z=Y.build.trailingSlash??"always";if(X&&Z9(W))di(W,{recursive:!0,force:!0});if(C5(W,{recursive:!0}),!Z9(H))throw Error(`pages/ directory not found in ${Z}`);Q("Discovering pages...");let B=IM(H);Q(` Found ${B.length} page(s)`),Q("Loading content types...");let F=await eN(Z,Y);if(F.size>0){Q(` Loaded ${F.size} content type(s): ${[...F.keys()].join(", ")}`);let u=dY(Z,Y);if(u)Z$(F,u.config)}let V=await _M(B,Z,F);Q(` ${V.length} route(s) after expansion`);let w=0,M=m1(Z,"components"),N=[],$=new Map,O=new Map;if(Z9(M)){Q("Compiling components...");let u=ci(M).filter((f)=>f.endsWith(".json")||f.endsWith(".md")),T=m1(W,"components");C5(T,{recursive:!0});for(let f of u)try{let p=m1(M,f),y=await SZ(p,{$media:Y.$media});for(let U1 of y.files){let B1=U1.path.includes("/")?U1.path.split("/").pop():U1.path;if(a4(m1(T,B1),U1.content,"utf8"),U1.tagName)N.push(U1.tagName);w++}let A=p.endsWith(".md")?(await Promise.resolve().then(() => (p6(),y8))).transpileJxMarkdown(OU(p,"utf8")):JSON.parse(OU(p,"utf8"));if(A.tagName){O.set(A.tagName,A);let U1=cW(A.tagName,A.style,A,Y.$media??{});if(U1)$.set(A.tagName,U1),a4(m1(T,`${A.tagName}.css`),U1,"utf8"),w++}}catch(p){let y=p;q.push(`Error compiling component ${f}: ${y.message}`),console.error(`Error compiling component ${f}: ${y.message}`)}Q(` Compiled ${N.length} component(s): ${N.join(", ")}`)}let C=[];if(Y.build.adapter)for(let[,u]of O){let T=W7(u);for(let f of T){let p="./components/"+f.src.replace(/^\.\//,"");C.push({exportName:f.exportName,src:p})}}let b=Y.images.optimize?bD(Z):null;for(let u of V)try{Q(` Compiling ${u.urlPattern} ...`);let T=await ri(u,Y,Z,F,b,O),f=new Set;for(let[y,A]of O)if(yU(A))f.add(y);if(N.length>0)T.html=si(T.html,N,$,f);let p=rD(u.urlPattern,W,z);C5(D3(p),{recursive:!0}),a4(p,T.html,"utf8"),w++;try{let y=z$(T.doc,O);if(y.content){let A=p.replace(/\.html$/,".md");a4(A,y.content,"utf8"),w++}}catch(y){let A=y;q.push(`Error exporting markdown for ${u.urlPattern}: ${A.message}`)}for(let y of T.files){let A=m1(D3(p),y.path);C5(D3(A),{recursive:!0}),a4(A,y.content,"utf8"),w++}if(T.serverHandler){let y=m1(D3(p),"_server.js");a4(y,T.serverHandler,"utf8"),w++}}catch(T){let f=T,p=`Error compiling ${u.urlPattern}: ${f.message}`;q.push(p),console.error(p)}if(b&&Y.images.optimize){gD(Z,b);let u=m1(j3(Z),"_optimized");if(Z9(u)){let f=m1(W,"images/_optimized");C5(f,{recursive:!0}),EW(u,f,{recursive:!0})}let T=Object.keys(b.entries).length;if(T>0)Q(` Optimized ${T} image(s)`)}if(Y.build.adapter){let u=Y.build.adapter;Q("Generating site-wide server worker...");let T=new Map;for(let f of C)if(!T.has(f.exportName))T.set(f.exportName,f);if(u==="cloudflare-pages"){let f=NX([...T.values()]);for(let[y,A]of f){let U1=m1(W,y);C5(m1(U1,".."),{recursive:!0}),a4(U1,A,"utf8"),w++}let p=m1(W,"components");C5(p,{recursive:!0});for(let{src:y}of T.values()){let A=m1(Z,y.replace(/^\.\//,"")),U1=m1(p,y.replace(/^\.\/components\//,""));if(Z9(A))dD(A,U1)}if(f.size>0)Q(` Generated ${f.size} Pages function(s) in dist/functions/`)}else{let f=MX([...T.values()],{adapter:u});if(f){let p=m1(W,"worker.js");a4(p,f,"utf8"),w++,Q(` Generated dist/worker.js (${T.size} server function(s))`);let y=m1(W,"components");for(let{src:A}of T.values()){let U1=m1(Z,A.replace(/^\.\//,"")),B1=m1(y,A.replace(/^\.\/components\//,""));if(Z9(U1))dD(U1,B1)}}}}if(Y.redirects&&Object.keys(Y.redirects).length>0){Q("Generating redirects...");let u=ei(Y.redirects,W);w+=u}if(Z9(K))Q("Copying public/ assets..."),EW(K,W,{recursive:!0});if(Y.copy){Q("Copying mapped files...");for(let[u,T]of Object.entries(Y.copy)){let f=m1(Z,u),p=m1(W,T);C5(D3(p),{recursive:!0}),EW(f,p)}}if(Q(`
|
|
447
447
|
Build complete: ${V.length} routes, ${w} files`),q.length>0)Q(` ${q.length} error(s)`);return{routes:V.length,files:w,errors:q}}async function ri(Z,U,X,J=new Map,q=null,Q=new Map){let Y;if(Z.sourcePath.endsWith(".md")){let{transpileJxMarkdown:b}=await Promise.resolve().then(() => (p6(),y8));Y=b(OU(Z.sourcePath,"utf8"))}else Y=JSON.parse(OU(Z.sourcePath,"utf8"));let W=PY(Y,U,X),H=Y.$head??W._pageHead??[],K=W.$head??[],z=Y.title??W._pageTitle??null;delete W._pageHead,delete W._pageTitle,gM(W,U,Z,J,X),await J$(W,Z,X,{config:U,contentTypes:J});let B=E5(W.state??{}),F=z??U.name??"Jx Site";if(typeof F==="string"&&N1(F))F=a1(F,B)??F;let V=cD(H,B),w=cD(K,B);if(U7(W,B),AW(W,Q),W.state)for(let[b,u]of Object.entries(W.state)){if(b==="$site"||b==="$page")continue;if(u&&typeof u==="object"&&!Array.isArray(u)&&u.timing==="compiler")delete W.state[b];else if(Array.isArray(u))delete W.state[b]}let M=ai(U.$head??[]),N=SM(M,w,V,{title:F,charset:U.defaults?.charset??"utf-8",...U.name!=null&&{siteName:U.name},...U.url!=null&&{siteUrl:U.url},pageUrl:Z.urlPattern});if(U.$media)W.$media={...U.$media,...W.$media};if(q&&U.images?.optimize)await fD(W,U.images,X,q);let $=await DY(W,{title:F,lang:U.defaults?.lang??"en",projectStyle:U.style??null});$.html=ti($.html,N,U.defaults?.lang??"en");let O=(W.$elements??[]).filter((b)=>typeof b==="string"&&!b.startsWith("./")&&!b.startsWith("../"));if(O.length>0)$.html=oi($.html,O);let C=null;if(!U.build?.adapter)try{let b=await C7(Z.sourcePath);if(b)C=b}catch{}return{html:$.html,files:$.files,serverHandler:C,doc:W}}function cD(Z,U){return Z.map((X)=>{if(!X||typeof X!=="object")return X;let J={...X};if(J.attributes){J.attributes={...J.attributes};for(let[q,Q]of Object.entries(J.attributes))if(typeof Q==="string"&&N1(Q))J.attributes[q]=a1(Q,U)??Q}if(typeof J.textContent==="string"&&N1(J.textContent))J.textContent=a1(J.textContent,U)??J.textContent;return J})}function ai(Z){return Z.map((U)=>{if(!U||typeof U!=="object"||!U.attributes)return U;let X={...U,attributes:{...U.attributes}};for(let J of["href","src"]){let q=X.attributes[J];if(typeof q==="string"&&ni(q))X.attributes[J]=`/node_modules/${q}`}return X})}function ni(Z){return!Z.startsWith("/")&&!Z.startsWith("./")&&!Z.startsWith("../")&&!Z.startsWith("http")&&!Z.startsWith("data:")}function iD(Z,U){if(!Z||typeof Z!=="object")return Z;let X={};for(let[J,q]of Object.entries(Z))if(J==="children"&&Array.isArray(q))X.children=q.map((Q)=>{if(typeof Q==="string")return Q;return iD(Q,U)});else if(J==="style"&&q&&typeof q==="object"){let Q={...q};for(let[Y,W]of Object.entries(Q))if(typeof W==="string"&&N1(W))Q[Y]=jU(W,U)??W;X.style=Q}else if(J==="attributes"&&q&&typeof q==="object"){let Q={...q};for(let[Y,W]of Object.entries(Q))if(typeof W==="string"&&N1(W))Q[Y]=jU(W,U)??W;X.attributes=Q}else if(J==="$props"&&q&&typeof q==="object"){let Q={...q};for(let[Y,W]of Object.entries(Q))if(typeof W==="string"&&N1(W)){let H=jU(W,U);Q[Y]=H!==null?H??null:W}X.$props=Q}else if(typeof q==="string"&&N1(q))X[J]=jU(q,U)??q;else X[J]=q;return X}function jU(Z,U){try{let X=U.$map?.item,J=U.$map?.index,q=Z.match(/^\$\{(.+)\}$/s);if(q)return Function("state","$map","item","index",`return (${q[1]})`)(U,U.$map,X,J);return Function("state","$map","item","index",`return \`${Z}\``)(U,U.$map,X,J)}catch{return null}}function U7(Z,U){if(!Z||typeof Z!=="object")return;if(typeof Z.innerHTML==="string"&&N1(Z.innerHTML)){let J=a1(Z.innerHTML,U);if(J!=null)Z.innerHTML=String(J).replaceAll("${","${")}if(typeof Z.textContent==="string"&&N1(Z.textContent))Z.textContent=a1(Z.textContent,U)??Z.textContent;if(Z.style&&typeof Z.style==="object"){for(let[J,q]of Object.entries(Z.style))if(typeof q==="string"&&N1(q))Z.style[J]=a1(q,U)??q}if(Z.attributes&&typeof Z.attributes==="object"){for(let[J,q]of Object.entries(Z.attributes))if(typeof q==="string"&&N1(q))Z.attributes[J]=a1(q,U)??q}if(Z.$props&&typeof Z.$props==="object"){for(let[J,q]of Object.entries(Z.$props))if(typeof q==="string"&&N1(q))Z.$props[J]=a1(q,U)??q}let X=Z.children;if(X&&typeof X==="object"&&!Array.isArray(X)&&X.$prototype==="Array"){let J=X,q=J.items,Q=null;if(q&&typeof q==="object"&&q.$ref){let Y=q.$ref;Q=gU(Y,U)}else if(Array.isArray(q))Q=q;if(Array.isArray(Q)&&J.map){Z.children=Q.map((Y,W)=>{let H=Object.create(U);H.$map={item:Y,index:W},H["$map/item"]=Y,H["$map/index"]=W;let K=iD(J.map,H);return U7(K,H),K});return}}if(typeof X==="string"&&N1(X)){let J=a1(X,U);if(Array.isArray(J)){let q=J;Z.children=q;for(let Q of q)U7(Q,U)}}else if(Array.isArray(Z.children)){let J=0;while(J<Z.children.length){let q=Z.children[J];if(typeof q==="string"&&N1(q)){let Q=a1(q,U);if(Array.isArray(Q)){let Y=Q;Z.children.splice(J,1,...Y);for(let W of Y)U7(W,U);J+=Y.length;continue}}U7(q,U),J++}}}function AW(Z,U){if(!Z||typeof Z!=="object")return;if(Array.isArray(Z)){Z.forEach((J)=>AW(J,U));return}if(Array.isArray(Z.children))for(let J of Z.children)AW(J,U);let X=U.get(Z.tagName);if(X){let J=Array.isArray(Z.children)&&Z.children.length>0?Z.children.map((Y)=>I3(Y,{},null)).join(`
|
|
448
448
|
`):null,q=dW(X,Z.$props||null,J),Q=yU(X);if(Z.innerHTML=q,delete Z.children,X.style&&Z.$props){let Y={...X.state};for(let[K,z]of Object.entries(Z.$props))if(K in Y)Y[K]=z;else Y[K]=z;let W=E5(Y,null),H={};for(let[K,z]of Object.entries(X.style))if(typeof z==="string"&&N1(z)){let B=r1(z,W);if(B!=null)H[K]=B}if(Object.keys(H).length>0)Z.style={...Z.style,...H}}if(delete Z.$props,Q)Z.$static=!0;else Z.$prerendered=!0}}function si(Z,U,X=new Map,J=new Set){let q=U.filter((B)=>Z.includes(`<${B}`));if(q.length===0)return Z;let Q=q.filter((B)=>X.has(B)).map((B)=>`<link rel="stylesheet" href="/components/${B}.css">`).join(`
|
|
449
449
|
`);if(Q)Z=Z.replace("</head>",` ${Q}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jxsuite/compiler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "Jx static HTML compiler, island detector, and site builder",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@apidevtools/json-schema-ref-parser": "^15.3.5",
|
|
44
|
-
"@jxsuite/parser": "^0.
|
|
45
|
-
"@jxsuite/runtime": "^0.
|
|
46
|
-
"@jxsuite/schema": "^0.
|
|
44
|
+
"@jxsuite/parser": "^0.27.0",
|
|
45
|
+
"@jxsuite/runtime": "^0.27.0",
|
|
46
|
+
"@jxsuite/schema": "^0.27.0",
|
|
47
47
|
"remark-gfm": "^4.0.1",
|
|
48
48
|
"remark-stringify": "^11.0.0",
|
|
49
49
|
"sharp": "^0.34.5",
|
|
@@ -205,10 +205,24 @@ function coerceCSVRows(
|
|
|
205
205
|
}
|
|
206
206
|
} else if (def.type === "boolean") {
|
|
207
207
|
data[key] = data[key] === "true";
|
|
208
|
+
} else if (def.type === "array") {
|
|
209
|
+
const raw = String(data[key] ?? "").trim();
|
|
210
|
+
data[key] =
|
|
211
|
+
raw === ""
|
|
212
|
+
? []
|
|
213
|
+
: raw
|
|
214
|
+
.split(",")
|
|
215
|
+
.map((s) => s.trim())
|
|
216
|
+
.filter(Boolean);
|
|
208
217
|
}
|
|
209
218
|
}
|
|
210
219
|
}
|
|
211
|
-
const id =
|
|
220
|
+
const id =
|
|
221
|
+
(data.id as string | undefined) ??
|
|
222
|
+
(data.sku as string | undefined) ??
|
|
223
|
+
(data.slug as string | undefined) ??
|
|
224
|
+
(data.Slug as string | undefined) ??
|
|
225
|
+
String(i);
|
|
212
226
|
return { id, data, body: null };
|
|
213
227
|
});
|
|
214
228
|
}
|
|
@@ -57,6 +57,7 @@ async function resolveManifest(
|
|
|
57
57
|
*/
|
|
58
58
|
function shouldSkip(src: string) {
|
|
59
59
|
if (typeof src !== "string") return true;
|
|
60
|
+
if (!src) return true;
|
|
60
61
|
if (src.includes("${")) return true;
|
|
61
62
|
if (EXTERNAL_PREFIXES.some((p) => src.startsWith(p))) return true;
|
|
62
63
|
if (SKIP_EXTENSIONS.has(extname(src).toLowerCase())) return true;
|
|
@@ -246,9 +246,11 @@ function resolvePathEntries($paths: any, projectRoot: string, contentTypes: Map<
|
|
|
246
246
|
}
|
|
247
247
|
const param = $paths.param ?? "slug";
|
|
248
248
|
const field = $paths.field ?? "id";
|
|
249
|
-
return entries
|
|
250
|
-
|
|
251
|
-
|
|
249
|
+
return entries
|
|
250
|
+
.map((entry: ContentLoaderEntry) => ({
|
|
251
|
+
[param]: field === "id" ? entry.id : (entry.data[field] ?? entry.id),
|
|
252
|
+
}))
|
|
253
|
+
.filter((p: Record<string, unknown>) => p[param]);
|
|
252
254
|
}
|
|
253
255
|
|
|
254
256
|
// Explicit values: { values: ["en", "fr"], param: "lang" }
|