#!/usr/bin/env node import{constants as ft}from"node:os";import Bn from"tty";import{transformSync as $n}from"esbuild";import{v as Tn}from"./package-DMb7cufA.mjs";import{r as ht}from"./pkgroll_create-require-CddX1PP_.mjs";import{pathToFileURL as xn,fileURLToPath as On}from"node:url";import Nn from"child_process";import V from"path";import ie from"fs";import{i as yu,m as Hn,t as Ln}from"./node-features-Dcn4STxq.mjs";import In from"node:path";import Pn from"events";import me from"util";import kn from"stream";import wu from"os";import Mn from"node:net";import dt from"node:fs";import{t as Gn}from"./temporary-directory-CwHp0_NW.mjs";import{g as Wn,i as jn}from"./get-pipe-path-CmcG6VNd.mjs";import"module";const Un="known-flag",Kn="unknown-flag",Vn="argument",{stringify:_e}=JSON,zn=/\B([A-Z])/g,Yn=t=>t.replace(zn,"-$1").toLowerCase(),{hasOwnProperty:qn}=Object.prototype,Ae=(t,e)=>qn.call(t,e),Xn=t=>Array.isArray(t),Ru=t=>typeof t=="function"?[t,!1]:Xn(t)?[t[0],!0]:Ru(t.type),Qn=(t,e)=>t===Boolean?e!=="false":e,Zn=(t,e)=>typeof e=="boolean"?e:t===Number&&e===""?Number.NaN:t(e),Jn=/[\s.:=]/,er=t=>{const e=`Flag name ${_e(t)}`;if(t.length===0)throw new Error(`${e} cannot be empty`);if(t.length===1)throw new Error(`${e} must be longer than a character`);const u=t.match(Jn);if(u)throw new Error(`${e} cannot contain ${_e(u?.[0])}`)},tr=t=>{const e={},u=(s,n)=>{if(Ae(e,s))throw new Error(`Duplicate flags named ${_e(s)}`);e[s]=n};for(const s in t){if(!Ae(t,s))continue;er(s);const n=t[s],r=[[],...Ru(n),n];u(s,r);const i=Yn(s);if(s!==i&&u(i,r),"alias"in n&&typeof n.alias=="string"){const{alias:o}=n,D=`Flag alias ${_e(o)} for flag ${_e(s)}`;if(o.length===0)throw new Error(`${D} cannot be empty`);if(o.length>1)throw new Error(`${D} must be a single character`);u(o,r)}}return e},ur=(t,e)=>{const u={};for(const s in t){if(!Ae(t,s))continue;const[n,,r,i]=e[s];if(n.length===0&&"default"in i){let{default:o}=i;typeof o=="function"&&(o=o()),u[s]=o}else u[s]=r?n:n.pop()}return u},Ge="--",sr=/[.:=]/,nr=/^-{1,2}\w/,rr=t=>{if(!nr.test(t))return;const e=!t.startsWith(Ge);let u=t.slice(e?1:2),s;const n=u.match(sr);if(n){const{index:r}=n;s=u.slice(r+1),u=u.slice(0,r)}return[u,s,e]},ir=(t,{onFlag:e,onArgument:u})=>{let s;const n=(r,i)=>{if(typeof s!="function")return!0;s(r,i),s=void 0};for(let r=0;r{for(const[u,s,n]of e.reverse()){if(s){const r=t[u];let i=r.slice(0,s);if(n||(i+=r.slice(s+1)),i!=="-"){t[u]=i;continue}}t.splice(u,1)}},bu=(t,e=process.argv.slice(2),{ignore:u}={})=>{const s=[],n=tr(t),r={},i=[];return i[Ge]=[],ir(e,{onFlag(o,D,l){const c=Ae(n,o);if(!u?.(c?Un:Kn,o,D)){if(c){const[f,a]=n[o],E=Qn(a,D),p=(F,A)=>{s.push(l),A&&s.push(A),f.push(Zn(a,F||""))};return E===void 0?p:p(E)}Ae(r,o)||(r[o]=[]),r[o].push(D===void 0?!0:D),s.push(l)}},onArgument(o,D,l){u?.(Vn,e[D[0]])||(i.push(...o),l?(i[Ge]=o,e.splice(D[0])):s.push(D))}}),or(e,s),{flags:ur(t,n),unknownFlags:r,_:i}};var Dr=Object.create,We=Object.defineProperty,ar=Object.defineProperties,lr=Object.getOwnPropertyDescriptor,cr=Object.getOwnPropertyDescriptors,fr=Object.getOwnPropertyNames,vu=Object.getOwnPropertySymbols,hr=Object.getPrototypeOf,Su=Object.prototype.hasOwnProperty,dr=Object.prototype.propertyIsEnumerable,Bu=(t,e,u)=>e in t?We(t,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):t[e]=u,je=(t,e)=>{for(var u in e||(e={}))Su.call(e,u)&&Bu(t,u,e[u]);if(vu)for(var u of vu(e))dr.call(e,u)&&Bu(t,u,e[u]);return t},Et=(t,e)=>ar(t,cr(e)),Er=t=>We(t,"__esModule",{value:!0}),pr=(t,e)=>()=>(t&&(e=t(t=0)),e),Cr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Fr=(t,e,u,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of fr(e))!Su.call(t,n)&&n!=="default"&&We(t,n,{get:()=>e[n],enumerable:!(s=lr(e,n))||s.enumerable});return t},gr=(t,e)=>Fr(Er(We(t!=null?Dr(hr(t)):{},"default",{value:t,enumerable:!0})),t),U=pr(()=>{}),mr=Cr((t,e)=>{U(),e.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});U(),U(),U();var _r=t=>{var e,u,s;let n=(e=process.stdout.columns)!=null?e:Number.POSITIVE_INFINITY;return typeof t=="function"&&(t=t(n)),t||(t={}),Array.isArray(t)?{columns:t,stdoutColumns:n}:{columns:(u=t.columns)!=null?u:[],stdoutColumns:(s=t.stdoutColumns)!=null?s:n}};U(),U(),U(),U(),U();function Ar({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}function $u(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Ar(),"")}U();function yr(t){return Number.isInteger(t)?t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141):!1}var wr=gr(mr());function oe(t){if(typeof t!="string"||t.length===0||(t=$u(t),t.length===0))return 0;t=t.replace((0,wr.default)()," ");let e=0;for(let u=0;u=127&&s<=159||s>=768&&s<=879||(s>65535&&u++,e+=yr(s)?2:1)}return e}var Tu=t=>Math.max(...t.split(` `).map(oe)),Rr=t=>{let e=[];for(let u of t){let{length:s}=u,n=s-e.length;for(let r=0;re[r]&&(e[r]=i)}}return e};U();var xu=/^\d+%$/,Ou={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},br=(t,e)=>{var u;let s=[];for(let n=0;n=e){let D=i-e,l=Math.ceil(u.paddingLeft/n*D),c=D-l;u.paddingLeft-=l,u.paddingRight-=c,u.horizontalPadding=u.paddingLeft+u.paddingRight}u.paddingLeftString=u.paddingLeft?" ".repeat(u.paddingLeft):"",u.paddingRightString=u.paddingRight?" ".repeat(u.paddingRight):"";let o=e-u.horizontalPadding;u.width=Math.max(Math.min(u.width,o),r)}}var Nu=()=>Object.assign([],{columns:0});function Sr(t,e){let u=[Nu()],[s]=u;for(let n of t){let r=n.width+n.horizontalPadding;s.columns+r>e&&(s=Nu(),u.push(s)),s.push(n),s.columns+=r}for(let n of u){let r=n.reduce((a,E)=>a+E.width+E.horizontalPadding,0),i=e-r;if(i===0)continue;let o=n.filter(a=>"autoOverflow"in a),D=o.filter(a=>a.autoOverflow>0),l=D.reduce((a,E)=>a+E.autoOverflow,0),c=Math.min(l,i);for(let a of D){let E=Math.floor(a.autoOverflow/l*c);a.width+=E,i-=E}let f=Math.floor(i/o.length);for(let a=0;ae=>`\x1B[${e+t}m`,Lu=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Iu=(t=0)=>(e,u,s)=>`\x1B[${38+t};2;${e};${u};${s}m`;function $r(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[u,s]of Object.entries(e)){for(let[n,r]of Object.entries(s))e[n]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},s[n]=e[n],t.set(r[0],r[1]);Object.defineProperty(e,u,{value:s,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi=Hu(),e.color.ansi256=Lu(),e.color.ansi16m=Iu(),e.bgColor.ansi=Hu(pt),e.bgColor.ansi256=Lu(pt),e.bgColor.ansi16m=Iu(pt),Object.defineProperties(e,{rgbToAnsi256:{value:(u,s,n)=>u===s&&s===n?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(s/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:u=>{let s=/(?[a-f\d]{6}|[a-f\d]{3})/i.exec(u.toString(16));if(!s)return[0,0,0];let{colorString:n}=s.groups;n.length===3&&(n=n.split("").map(i=>i+i).join(""));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:u=>e.rgbToAnsi256(...e.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:u=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let s,n,r;if(u>=232)s=((u-232)*10+8)/255,n=s,r=s;else{u-=16;let D=u%36;s=Math.floor(u/36)/5,n=Math.floor(D/6)/5,r=D%6/5}let i=Math.max(s,n,r)*2;if(i===0)return 30;let o=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(s));return i===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(u,s,n)=>e.ansi256ToAnsi(e.rgbToAnsi256(u,s,n)),enumerable:!1},hexToAnsi:{value:u=>e.ansi256ToAnsi(e.hexToAnsi256(u)),enumerable:!1}}),e}var Tr=$r(),xr=Tr,Ue=new Set(["\x1B","\x9B"]),Or=39,Ct="\x07",Pu="[",Nr="]",ku="m",Ft=`${Nr}8;;`,Mu=t=>`${Ue.values().next().value}${Pu}${t}${ku}`,Gu=t=>`${Ue.values().next().value}${Ft}${t}${Ct}`,Hr=t=>t.split(" ").map(e=>oe(e)),gt=(t,e,u)=>{let s=[...e],n=!1,r=!1,i=oe($u(t[t.length-1]));for(let[o,D]of s.entries()){let l=oe(D);if(i+l<=u?t[t.length-1]+=D:(t.push(D),i=0),Ue.has(D)&&(n=!0,r=s.slice(o+1).join("").startsWith(Ft)),n){r?D===Ct&&(n=!1,r=!1):D===ku&&(n=!1);continue}i+=l,i===u&&o0&&t.length>1&&(t[t.length-2]+=t.pop())},Lr=t=>{let e=t.split(" "),u=e.length;for(;u>0&&!(oe(e[u-1])>0);)u--;return u===e.length?t:e.slice(0,u).join(" ")+e.slice(u).join("")},Ir=(t,e,u={})=>{if(u.trim!==!1&&t.trim()==="")return"";let s="",n,r,i=Hr(t),o=[""];for(let[l,c]of t.split(" ").entries()){u.trim!==!1&&(o[o.length-1]=o[o.length-1].trimStart());let f=oe(o[o.length-1]);if(l!==0&&(f>=e&&(u.wordWrap===!1||u.trim===!1)&&(o.push(""),f=0),(f>0||u.trim===!1)&&(o[o.length-1]+=" ",f++)),u.hard&&i[l]>e){let a=e-f,E=1+Math.floor((i[l]-a-1)/e);Math.floor((i[l]-1)/e)e&&f>0&&i[l]>0){if(u.wordWrap===!1&&fe&&u.wordWrap===!1){gt(o,c,e);continue}o[o.length-1]+=c}u.trim!==!1&&(o=o.map(l=>Lr(l)));let D=[...o.join(` `)];for(let[l,c]of D.entries()){if(s+=c,Ue.has(c)){let{groups:a}=new RegExp(`(?:\\${Pu}(?\\d+)m|\\${Ft}(?.*)${Ct})`).exec(D.slice(l).join(""))||{groups:{}};if(a.code!==void 0){let E=Number.parseFloat(a.code);n=E===Or?void 0:E}else a.uri!==void 0&&(r=a.uri.length===0?void 0:a.uri)}let f=xr.codes.get(Number(n));D[l+1]===` `?(r&&(s+=Gu("")),n&&f&&(s+=Mu(f))):c===` `&&(n&&f&&(s+=Mu(n)),r&&(s+=Gu(r)))}return s};function Pr(t,e,u){return String(t).normalize().replace(/\r\n/g,` `).split(` `).map(s=>Ir(s,e,u)).join(` `)}var Wu=t=>Array.from({length:t}).fill("");function kr(t,e){let u=[],s=0;for(let n of t){let r=0,i=n.map(D=>{var l;let c=(l=e[s])!=null?l:"";s+=1,D.preprocess&&(c=D.preprocess(c)),Tu(c)>D.width&&(c=Pr(c,D.width,{hard:!0}));let f=c.split(` `);if(D.postprocess){let{postprocess:a}=D;f=f.map((E,p)=>a.call(D,E,p))}return D.paddingTop&&f.unshift(...Wu(D.paddingTop)),D.paddingBottom&&f.push(...Wu(D.paddingBottom)),f.length>r&&(r=f.length),Et(je({},D),{lines:f})}),o=[];for(let D=0;D{var f;let a=(f=c.lines[D])!=null?f:"",E=Number.isFinite(c.width)?" ".repeat(c.width-oe(a)):"",p=c.paddingLeftString;return c.align==="right"&&(p+=E),p+=a,c.align==="left"&&(p+=E),p+c.paddingRightString}).join("");o.push(l)}u.push(o.join(` `))}return u.join(` `)}function Mr(t,e){if(!t||t.length===0)return"";let u=Rr(t),s=u.length;if(s===0)return"";let{stdoutColumns:n,columns:r}=_r(e);if(r.length>s)throw new Error(`${r.length} columns defined, but only ${s} columns found`);let i=Br(n,r,u);return t.map(o=>kr(i,o)).join(` `)}U();var Gr=["<",">","=",">=","<="];function Wr(t){if(!Gr.includes(t))throw new TypeError(`Invalid breakpoint operator: ${t}`)}function jr(t){let e=Object.keys(t).map(u=>{let[s,n]=u.split(" ");Wr(s);let r=Number.parseInt(n,10);if(Number.isNaN(r))throw new TypeError(`Invalid breakpoint value: ${n}`);let i=t[u];return{operator:s,breakpoint:r,value:i}}).sort((u,s)=>s.breakpoint-u.breakpoint);return u=>{var s;return(s=e.find(({operator:n,breakpoint:r})=>n==="="&&u===r||n===">"&&u>r||n==="<"&&u="&&u>=r||n==="<="&&u<=r))==null?void 0:s.value}}const Ur=t=>t.replace(/[\W_]([a-z\d])?/gi,(e,u)=>u?u.toUpperCase():""),Kr=t=>t.replace(/\B([A-Z])/g,"-$1").toLowerCase(),Vr={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:t=>t.trim()},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function zr(t){let e=!1;return{type:"table",data:{tableData:Object.keys(t).sort((u,s)=>u.localeCompare(s)).map(u=>{const s=t[u],n="alias"in s;return n&&(e=!0),{name:u,flag:s,flagFormatted:`--${Kr(u)}`,aliasesEnabled:e,aliasFormatted:n?`-${s.alias}`:void 0}}).map(u=>(u.aliasesEnabled=e,[{type:"flagName",data:u},{type:"flagDescription",data:u}])),tableBreakpoints:Vr}}}const ju=t=>!t||(t.version??(t.help?t.help.version:void 0)),Uu=t=>{const e="parent"in t&&t.parent?.name;return(e?`${e} `:"")+t.name};function Yr(t){const e=[];t.name&&e.push(Uu(t));const u=ju(t)??("parent"in t&&ju(t.parent));if(u&&e.push(`v${u}`),e.length!==0)return{id:"name",type:"text",data:`${e.join(" ")} `}}function qr(t){const{help:e}=t;if(!(!e||!e.description))return{id:"description",type:"text",data:`${e.description} `}}function Xr(t){const e=t.help||{};if("usage"in e)return e.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(e.usage)?e.usage.join(` `):e.usage}}:void 0;if(t.name){const u=[],s=[Uu(t)];if(t.flags&&Object.keys(t.flags).length>0&&s.push("[flags...]"),t.parameters&&t.parameters.length>0){const{parameters:n}=t,r=n.indexOf("--"),i=r>-1&&n.slice(r+1).some(o=>o.startsWith("<"));s.push(n.map(o=>o!=="--"?o:i?"--":"[--]").join(" "))}if(s.length>1&&u.push(s.join(" ")),"commands"in t&&t.commands?.length&&u.push(`${t.name} `),u.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:u.join(` `)}}}}function Qr(t){return!("commands"in t)||!t.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:t.commands.map(e=>[e.options.name,e.options.help?e.options.help.description:""]),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}function Zr(t){if(!(!t.flags||Object.keys(t.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:zr(t.flags),indentBody:0}}}function Jr(t){const{help:e}=t;if(!e||!e.examples||e.examples.length===0)return;let{examples:u}=e;if(Array.isArray(u)&&(u=u.join(` `)),u)return{id:"examples",type:"section",data:{title:"Examples:",body:u}}}function ei(t){if(!("alias"in t)||!t.alias)return;const{alias:e}=t;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(e)?e.join(", "):e}}}const ti=t=>[Yr,qr,Xr,Qr,Zr,Jr,ei].map(e=>e(t)).filter(Boolean),ui=Bn.WriteStream.prototype.hasColors();class si{text(e){return e}bold(e){return ui?`\x1B[1m${e}\x1B[22m`:e.toLocaleUpperCase()}indentText({text:e,spaces:u}){return e.replace(/^/gm," ".repeat(u))}heading(e){return this.bold(e)}section({title:e,body:u,indentBody:s=2}){return`${(e?`${this.heading(e)} `:"")+(u?this.indentText({text:this.render(u),spaces:s}):"")} `}table({tableData:e,tableOptions:u,tableBreakpoints:s}){return Mr(e.map(n=>n.map(r=>this.render(r))),s?jr(s):u)}flagParameter(e){return e===Boolean?"":e===String?"":e===Number?"":Array.isArray(e)?this.flagParameter(e[0]):""}flagOperator(e){return" "}flagName(e){const{flag:u,flagFormatted:s,aliasesEnabled:n,aliasFormatted:r}=e;let i="";if(r?i+=`${r}, `:n&&(i+=" "),i+=s,"placeholder"in u&&typeof u.placeholder=="string")i+=`${this.flagOperator(e)}${u.placeholder}`;else{const o=this.flagParameter("type"in u?u.type:u);o&&(i+=`${this.flagOperator(e)}${o}`)}return i}flagDefault(e){return JSON.stringify(e)}flagDescription({flag:e}){let u="description"in e?e.description??"":"";if("default"in e){let{default:s}=e;typeof s=="function"&&(s=s()),s&&(u+=` (default: ${this.flagDefault(s)})`)}return u}render(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(u=>this.render(u)).join(` `);if("type"in e&&this[e.type]){const u=this[e.type];if(typeof u=="function")return u.call(this,e.data)}throw new Error(`Invalid node type: ${JSON.stringify(e)}`)}}const mt=/^[\w.-]+$/,{stringify:J}=JSON,ni=/[|\\{}()[\]^$+*?.]/;function _t(t){const e=[];let u,s;for(const n of t){if(s)throw new Error(`Invalid parameter: Spread parameter ${J(s)} must be last`);const r=n[0],i=n[n.length-1];let o;if(r==="<"&&i===">"&&(o=!0,u))throw new Error(`Invalid parameter: Required parameter ${J(n)} cannot come after optional parameter ${J(u)}`);if(r==="["&&i==="]"&&(o=!1,u=n),o===void 0)throw new Error(`Invalid parameter: ${J(n)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let D=n.slice(1,-1);const l=D.slice(-3)==="...";l&&(s=n,D=D.slice(0,-3));const c=D.match(ni);if(c)throw new Error(`Invalid parameter: ${J(n)}. Invalid character found ${J(c[0])}`);e.push({name:D,required:o,spread:l})}return e}function At(t,e,u,s){for(let n=0;n{console.log(e.version)};if(r&&D.flags.version===!0)return l(),process.exit(0);const c=new si,f=o&&i?.render?i.render:p=>c.render(p),a=p=>{const F=ti({...e,...p?{help:p}:{},flags:n});console.log(f(F,c))};if(o&&D.flags.help===!0)return a(),process.exit(0);if(e.parameters){let{parameters:p}=e,F=D._;const A=p.indexOf("--"),S=p.slice(A+1),N=Object.create(null);if(A>-1&&S.length>0){p=p.slice(0,A);const B=D._["--"];F=F.slice(0,-B.length||void 0),At(N,_t(p),F,a),At(N,_t(S),B,a)}else At(N,_t(p),F,a);Object.assign(D._,N)}const E={...D,showVersion:l,showHelp:a};return typeof u=="function"&&u(E),{command:t,...E}}function ii(t,e){const u=new Map;for(const s of e){const n=[s.options.name],{alias:r}=s.options;r&&(Array.isArray(r)?n.push(...r):n.push(r));for(const i of n){if(u.has(i))throw new Error(`Duplicate command name found: ${J(i)}`);u.set(i,s)}}return u.get(t)}function Vu(t,e,u=process.argv.slice(2)){if(!t)throw new Error("Options is required");if("name"in t&&(!t.name||!mt.test(t.name)))throw new Error(`Invalid script name: ${J(t.name)}`);const s=u[0];if(t.commands&&mt.test(s)){const n=ii(s,t.commands);if(n)return Ku(n.options.name,{...n.options,parent:t},n.callback,u.slice(1))}return Ku(void 0,t,e,u)}function oi(t,e){if(!t)throw new Error("Command options are required");const{name:u}=t;if(t.name===void 0)throw new Error("Command name is required");if(!mt.test(u))throw new Error(`Invalid command name ${JSON.stringify(u)}. Command names must be one word.`);return{options:t,callback:e}}var Di=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ai(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fe={exports:{}},yt,zu;function li(){if(zu)return yt;zu=1,yt=s,s.sync=n;var t=ie;function e(r,i){var o=i.pathExt!==void 0?i.pathExt:process.env.PATHEXT;if(!o||(o=o.split(";"),o.indexOf("")!==-1))return!0;for(var D=0;DObject.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),Zu=(t,e)=>{const u=e.colon||di,s=t.match(/\//)||he&&t.match(/\\/)?[""]:[...he?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(u)],n=he?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",r=he?n.split(u):[""];return he&&t.indexOf(".")!==-1&&r[0]!==""&&r.unshift(""),{pathEnv:s,pathExt:r,pathExtExe:n}},Ju=(t,e,u)=>{typeof e=="function"&&(u=e,e={}),e||(e={});const{pathEnv:s,pathExt:n,pathExtExe:r}=Zu(t,e),i=[],o=l=>new Promise((c,f)=>{if(l===s.length)return e.all&&i.length?c(i):f(Qu(t));const a=s[l],E=/^".*"$/.test(a)?a.slice(1,-1):a,p=qu.join(E,t),F=!E&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;c(D(F,l,0))}),D=(l,c,f)=>new Promise((a,E)=>{if(f===n.length)return a(o(c+1));const p=n[f];Xu(l+p,{pathExt:r},(F,A)=>{if(!F&&A)if(e.all)i.push(l+p);else return a(l+p);return a(D(l,c,f+1))})});return u?o(0).then(l=>u(null,l),u):o(0)},Ei=(t,e)=>{e=e||{};const{pathEnv:u,pathExt:s,pathExtExe:n}=Zu(t,e),r=[];for(let i=0;i{const e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(s=>s.toUpperCase()==="PATH")||"Path"};bt.exports=es,bt.exports.default=es;var Ci=bt.exports;const ts=V,Fi=pi,gi=Ci;function us(t,e){const u=t.options.env||process.env,s=process.cwd(),n=t.options.cwd!=null,r=n&&process.chdir!==void 0&&!process.chdir.disabled;if(r)try{process.chdir(t.options.cwd)}catch{}let i;try{i=Fi.sync(t.command,{path:u[gi({env:u})],pathExt:e?ts.delimiter:void 0})}catch{}finally{r&&process.chdir(s)}return i&&(i=ts.resolve(n?t.options.cwd:"",i)),i}function mi(t){return us(t)||us(t,!0)}var _i=mi,vt={};const St=/([()\][%!^"`<>&|;, *?])/g;function Ai(t){return t=t.replace(St,"^$1"),t}function yi(t,e){return t=`${t}`,t=t.replace(/(\\*)"/g,'$1$1\\"'),t=t.replace(/(\\*)$/,"$1$1"),t=`"${t}"`,t=t.replace(St,"^$1"),e&&(t=t.replace(St,"^$1")),t}vt.command=Ai,vt.argument=yi;var wi=/^#!(.*)/;const Ri=wi;var bi=(t="")=>{const e=t.match(Ri);if(!e)return null;const[u,s]=e[0].replace(/#! ?/,"").split(" "),n=u.split("/").pop();return n==="env"?s:s?`${n} ${s}`:n};const Bt=ie,vi=bi;function Si(t){const u=Buffer.alloc(150);let s;try{s=Bt.openSync(t,"r"),Bt.readSync(s,u,0,150,0),Bt.closeSync(s)}catch{}return vi(u.toString())}var Bi=Si;const $i=V,ss=_i,ns=vt,Ti=Bi,xi=process.platform==="win32",Oi=/\.(?:com|exe)$/i,Ni=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Hi(t){t.file=ss(t);const e=t.file&&Ti(t.file);return e?(t.args.unshift(t.file),t.command=e,ss(t)):t.file}function Li(t){if(!xi)return t;const e=Hi(t),u=!Oi.test(e);if(t.options.forceShell||u){const s=Ni.test(e);t.command=$i.normalize(t.command),t.command=ns.command(t.command),t.args=t.args.map(r=>ns.argument(r,s));const n=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${n}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function Ii(t,e,u){e&&!Array.isArray(e)&&(u=e,e=null),e=e?e.slice(0):[],u=Object.assign({},u);const s={command:t,args:e,options:u,file:void 0,original:{command:t,args:e}};return u.shell?s:Li(s)}var Pi=Ii;const $t=process.platform==="win32";function Tt(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function ki(t,e){if(!$t)return;const u=t.emit;t.emit=function(s,n){if(s==="exit"){const r=rs(n,e);if(r)return u.call(t,"error",r)}return u.apply(t,arguments)}}function rs(t,e){return $t&&t===1&&!e.file?Tt(e.original,"spawn"):null}function Mi(t,e){return $t&&t===1&&!e.file?Tt(e.original,"spawnSync"):null}var Gi={hookChildProcess:ki,verifyENOENT:rs,verifyENOENTSync:Mi,notFoundError:Tt};const is=Nn,xt=Pi,Ot=Gi;function os(t,e,u){const s=xt(t,e,u),n=is.spawn(s.command,s.args,s.options);return Ot.hookChildProcess(n,s),n}function Wi(t,e,u){const s=xt(t,e,u),n=is.spawnSync(s.command,s.args,s.options);return n.error=n.error||Ot.verifyENOENTSync(n.status,s),n}fe.exports=os,fe.exports.spawn=os,fe.exports.sync=Wi,fe.exports._parse=xt,fe.exports._enoent=Ot;var ji=fe.exports,Ui=ai(ji);const Ds=(t,e)=>{const u={...process.env},s=["inherit","inherit","inherit"];return process.send&&s.push("ipc"),e&&(e.noCache&&(u.TSX_DISABLE_CACHE="1"),e.tsconfigPath&&(u.TSX_TSCONFIG_PATH=e.tsconfigPath)),Ui(process.execPath,["--require",ht.resolve("./preflight.cjs"),yu(Hn)?"--import":"--loader",xn(ht.resolve("./loader.mjs")).toString(),...t],{stdio:s,env:u})};var Ve={};const Ki=V,ee="\\\\/",as=`[^${ee}]`,te="\\.",Vi="\\+",zi="\\?",ze="\\/",Yi="(?=.)",ls="[^/]",Nt=`(?:${ze}|$)`,cs=`(?:^|${ze})`,Ht=`${te}{1,2}${Nt}`,qi=`(?!${te})`,Xi=`(?!${cs}${Ht})`,Qi=`(?!${te}{0,1}${Nt})`,Zi=`(?!${Ht})`,Ji=`[^.${ze}]`,eo=`${ls}*?`,fs={DOT_LITERAL:te,PLUS_LITERAL:Vi,QMARK_LITERAL:zi,SLASH_LITERAL:ze,ONE_CHAR:Yi,QMARK:ls,END_ANCHOR:Nt,DOTS_SLASH:Ht,NO_DOT:qi,NO_DOTS:Xi,NO_DOT_SLASH:Qi,NO_DOTS_SLASH:Zi,QMARK_NO_DOT:Ji,STAR:eo,START_ANCHOR:cs},to={...fs,SLASH_LITERAL:`[${ee}]`,QMARK:as,STAR:`${as}*?`,DOTS_SLASH:`${te}{1,2}(?:[${ee}]|$)`,NO_DOT:`(?!${te})`,NO_DOTS:`(?!(?:^|[${ee}])${te}{1,2}(?:[${ee}]|$))`,NO_DOT_SLASH:`(?!${te}{0,1}(?:[${ee}]|$))`,NO_DOTS_SLASH:`(?!${te}{1,2}(?:[${ee}]|$))`,QMARK_NO_DOT:`[^.${ee}]`,START_ANCHOR:`(?:^|[${ee}])`,END_ANCHOR:`(?:[${ee}]|$)`},uo={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};var Ye={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:uo,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Ki.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?to:fs}};(function(t){const e=V,u=process.platform==="win32",{REGEX_BACKSLASH:s,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=Ye;t.isObject=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),t.hasRegexChars=o=>r.test(o),t.isRegexChar=o=>o.length===1&&t.hasRegexChars(o),t.escapeRegex=o=>o.replace(i,"\\$1"),t.toPosixSlashes=o=>o.replace(s,"/"),t.removeBackslashes=o=>o.replace(n,D=>D==="\\"?"":D),t.supportsLookbehinds=()=>{const o=process.version.slice(1).split(".").map(Number);return o.length===3&&o[0]>=9||o[0]===8&&o[1]>=10},t.isWindows=o=>o&&typeof o.windows=="boolean"?o.windows:u===!0||e.sep==="\\",t.escapeLast=(o,D,l)=>{const c=o.lastIndexOf(D,l);return c===-1?o:o[c-1]==="\\"?t.escapeLast(o,D,c-1):`${o.slice(0,c)}\\${o.slice(c)}`},t.removePrefix=(o,D={})=>{let l=o;return l.startsWith("./")&&(l=l.slice(2),D.prefix="./"),l},t.wrapOutput=(o,D={},l={})=>{const c=l.contains?"":"^",f=l.contains?"":"$";let a=`${c}(?:${o})${f}`;return D.negated===!0&&(a=`(?:^(?!${a}).*$)`),a}})(Ve);const hs=Ve,{CHAR_ASTERISK:Lt,CHAR_AT:so,CHAR_BACKWARD_SLASH:ye,CHAR_COMMA:no,CHAR_DOT:It,CHAR_EXCLAMATION_MARK:Pt,CHAR_FORWARD_SLASH:ds,CHAR_LEFT_CURLY_BRACE:kt,CHAR_LEFT_PARENTHESES:Mt,CHAR_LEFT_SQUARE_BRACKET:ro,CHAR_PLUS:io,CHAR_QUESTION_MARK:Es,CHAR_RIGHT_CURLY_BRACE:oo,CHAR_RIGHT_PARENTHESES:ps,CHAR_RIGHT_SQUARE_BRACKET:Do}=Ye,Cs=t=>t===ds||t===ye,Fs=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},ao=(t,e)=>{const u=e||{},s=t.length-1,n=u.parts===!0||u.scanToEnd===!0,r=[],i=[],o=[];let D=t,l=-1,c=0,f=0,a=!1,E=!1,p=!1,F=!1,A=!1,S=!1,N=!1,B=!1,X=!1,M=!1,se=0,G,_,b={value:"",depth:0,isGlob:!1};const k=()=>l>=s,C=()=>D.charCodeAt(l+1),x=()=>(G=_,D.charCodeAt(++l));for(;l0&&(ne=D.slice(0,c),D=D.slice(c),f-=c),$&&p===!0&&f>0?($=D.slice(0,f),h=D.slice(f)):p===!0?($="",h=D):$=D,$&&$!==""&&$!=="/"&&$!==D&&Cs($.charCodeAt($.length-1))&&($=$.slice(0,-1)),u.unescape===!0&&(h&&(h=hs.removeBackslashes(h)),$&&N===!0&&($=hs.removeBackslashes($)));const d={prefix:ne,input:t,start:c,base:$,glob:h,isBrace:a,isBracket:E,isGlob:p,isExtglob:F,isGlobstar:A,negated:B,negatedExtglob:X};if(u.tokens===!0&&(d.maxDepth=0,Cs(_)||i.push(b),d.tokens=i),u.parts===!0||u.tokens===!0){let W;for(let R=0;R{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();const u=`[${t.join("-")}]`;try{new RegExp(u)}catch{return t.map(n=>z.escapeRegex(n)).join("..")}return u},de=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Gt=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=gs[t]||t;const u={...e},s=typeof u.maxLength=="number"?Math.min(Xe,u.maxLength):Xe;let n=t.length;if(n>s)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${s}`);const r={type:"bos",value:"",output:u.prepend||""},i=[r],o=u.capture?"":"?:",D=z.isWindows(e),l=qe.globChars(D),c=qe.extglobChars(l),{DOT_LITERAL:f,PLUS_LITERAL:a,SLASH_LITERAL:E,ONE_CHAR:p,DOTS_SLASH:F,NO_DOT:A,NO_DOT_SLASH:S,NO_DOTS_SLASH:N,QMARK:B,QMARK_NO_DOT:X,STAR:M,START_ANCHOR:se}=l,G=m=>`(${o}(?:(?!${se}${m.dot?F:f}).)*?)`,_=u.dot?"":A,b=u.dot?B:X;let k=u.bash===!0?G(u):M;u.capture&&(k=`(${k})`),typeof u.noext=="boolean"&&(u.noextglob=u.noext);const C={input:t,index:-1,start:0,dot:u.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};t=z.removePrefix(t,C),n=t.length;const x=[],$=[],ne=[];let h=r,d;const W=()=>C.index===n-1,R=C.peek=(m=1)=>t[C.index+m],Q=C.advance=()=>t[++C.index]||"",Z=()=>t.slice(C.index+1),K=(m="",T=0)=>{C.consumed+=m,C.index+=T},Ie=m=>{C.output+=m.output!=null?m.output:m.value,K(m.value)},vn=()=>{let m=1;for(;R()==="!"&&(R(2)!=="("||R(3)==="?");)Q(),C.start++,m++;return m%2===0?!1:(C.negated=!0,C.start++,!0)},Pe=m=>{C[m]++,ne.push(m)},re=m=>{C[m]--,ne.pop()},w=m=>{if(h.type==="globstar"){const T=C.braces>0&&(m.type==="comma"||m.type==="brace"),g=m.extglob===!0||x.length&&(m.type==="pipe"||m.type==="paren");m.type!=="slash"&&m.type!=="paren"&&!T&&!g&&(C.output=C.output.slice(0,-h.output.length),h.type="star",h.value="*",h.output=k,C.output+=h.output)}if(x.length&&m.type!=="paren"&&(x[x.length-1].inner+=m.value),(m.value||m.output)&&Ie(m),h&&h.type==="text"&&m.type==="text"){h.value+=m.value,h.output=(h.output||"")+m.value;return}m.prev=h,i.push(m),h=m},ke=(m,T)=>{const g={...c[T],conditions:1,inner:""};g.prev=h,g.parens=C.parens,g.output=C.output;const y=(u.capture?"(":"")+g.open;Pe("parens"),w({type:m,value:T,output:C.output?"":p}),w({type:"paren",extglob:!0,value:Q(),output:y}),x.push(g)},Sn=m=>{let T=m.close+(u.capture?")":""),g;if(m.type==="negate"){let y=k;if(m.inner&&m.inner.length>1&&m.inner.includes("/")&&(y=G(u)),(y!==k||W()||/^\)+$/.test(Z()))&&(T=m.close=`)$))${y}`),m.inner.includes("*")&&(g=Z())&&/^\.[^\\/.]+$/.test(g)){const O=Gt(g,{...e,fastpaths:!1}).output;T=m.close=`)${O})${y})`}m.prev.type==="bos"&&(C.negatedExtglob=!0)}w({type:"paren",extglob:!0,value:d,output:T}),re("parens")};if(u.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let m=!1,T=t.replace(ho,(g,y,O,j,L,ct)=>j==="\\"?(m=!0,g):j==="?"?y?y+j+(L?B.repeat(L.length):""):ct===0?b+(L?B.repeat(L.length):""):B.repeat(O.length):j==="."?f.repeat(O.length):j==="*"?y?y+j+(L?k:""):k:y?g:`\\${g}`);return m===!0&&(u.unescape===!0?T=T.replace(/\\/g,""):T=T.replace(/\\+/g,g=>g.length%2===0?"\\\\":g?"\\":"")),T===t&&u.contains===!0?(C.output=t,C):(C.output=z.wrapOutput(T,C,e),C)}for(;!W();){if(d=Q(),d==="\0")continue;if(d==="\\"){const g=R();if(g==="/"&&u.bash!==!0||g==="."||g===";")continue;if(!g){d+="\\",w({type:"text",value:d});continue}const y=/^\\+/.exec(Z());let O=0;if(y&&y[0].length>2&&(O=y[0].length,C.index+=O,O%2!==0&&(d+="\\")),u.unescape===!0?d=Q():d+=Q(),C.brackets===0){w({type:"text",value:d});continue}}if(C.brackets>0&&(d!=="]"||h.value==="["||h.value==="[^")){if(u.posix!==!1&&d===":"){const g=h.value.slice(1);if(g.includes("[")&&(h.posix=!0,g.includes(":"))){const y=h.value.lastIndexOf("["),O=h.value.slice(0,y),j=h.value.slice(y+2),L=co[j];if(L){h.value=O+L,C.backtrack=!0,Q(),!r.output&&i.indexOf(h)===1&&(r.output=p);continue}}}(d==="["&&R()!==":"||d==="-"&&R()==="]")&&(d=`\\${d}`),d==="]"&&(h.value==="["||h.value==="[^")&&(d=`\\${d}`),u.posix===!0&&d==="!"&&h.value==="["&&(d="^"),h.value+=d,Ie({value:d});continue}if(C.quotes===1&&d!=='"'){d=z.escapeRegex(d),h.value+=d,Ie({value:d});continue}if(d==='"'){C.quotes=C.quotes===1?0:1,u.keepQuotes===!0&&w({type:"text",value:d});continue}if(d==="("){Pe("parens"),w({type:"paren",value:d});continue}if(d===")"){if(C.parens===0&&u.strictBrackets===!0)throw new SyntaxError(de("opening","("));const g=x[x.length-1];if(g&&C.parens===g.parens+1){Sn(x.pop());continue}w({type:"paren",value:d,output:C.parens?")":"\\)"}),re("parens");continue}if(d==="["){if(u.nobracket===!0||!Z().includes("]")){if(u.nobracket!==!0&&u.strictBrackets===!0)throw new SyntaxError(de("closing","]"));d=`\\${d}`}else Pe("brackets");w({type:"bracket",value:d});continue}if(d==="]"){if(u.nobracket===!0||h&&h.type==="bracket"&&h.value.length===1){w({type:"text",value:d,output:`\\${d}`});continue}if(C.brackets===0){if(u.strictBrackets===!0)throw new SyntaxError(de("opening","["));w({type:"text",value:d,output:`\\${d}`});continue}re("brackets");const g=h.value.slice(1);if(h.posix!==!0&&g[0]==="^"&&!g.includes("/")&&(d=`/${d}`),h.value+=d,Ie({value:d}),u.literalBrackets===!1||z.hasRegexChars(g))continue;const y=z.escapeRegex(h.value);if(C.output=C.output.slice(0,-h.value.length),u.literalBrackets===!0){C.output+=y,h.value=y;continue}h.value=`(${o}${y}|${h.value})`,C.output+=h.value;continue}if(d==="{"&&u.nobrace!==!0){Pe("braces");const g={type:"brace",value:d,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};$.push(g),w(g);continue}if(d==="}"){const g=$[$.length-1];if(u.nobrace===!0||!g){w({type:"text",value:d,output:d});continue}let y=")";if(g.dots===!0){const O=i.slice(),j=[];for(let L=O.length-1;L>=0&&(i.pop(),O[L].type!=="brace");L--)O[L].type!=="dots"&&j.unshift(O[L].value);y=Eo(j,u),C.backtrack=!0}if(g.comma!==!0&&g.dots!==!0){const O=C.output.slice(0,g.outputIndex),j=C.tokens.slice(g.tokensIndex);g.value=g.output="\\{",d=y="\\}",C.output=O;for(const L of j)C.output+=L.output||L.value}w({type:"brace",value:d,output:y}),re("braces"),$.pop();continue}if(d==="|"){x.length>0&&x[x.length-1].conditions++,w({type:"text",value:d});continue}if(d===","){let g=d;const y=$[$.length-1];y&&ne[ne.length-1]==="braces"&&(y.comma=!0,g="|"),w({type:"comma",value:d,output:g});continue}if(d==="/"){if(h.type==="dot"&&C.index===C.start+1){C.start=C.index+1,C.consumed="",C.output="",i.pop(),h=r;continue}w({type:"slash",value:d,output:E});continue}if(d==="."){if(C.braces>0&&h.type==="dot"){h.value==="."&&(h.output=f);const g=$[$.length-1];h.type="dots",h.output+=d,h.value+=d,g.dots=!0;continue}if(C.braces+C.parens===0&&h.type!=="bos"&&h.type!=="slash"){w({type:"text",value:d,output:f});continue}w({type:"dot",value:d,output:f});continue}if(d==="?"){if(!(h&&h.value==="(")&&u.noextglob!==!0&&R()==="("&&R(2)!=="?"){ke("qmark",d);continue}if(h&&h.type==="paren"){const y=R();let O=d;if(y==="<"&&!z.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(h.value==="("&&!/[!=<:]/.test(y)||y==="<"&&!/<([!=]|\w+>)/.test(Z()))&&(O=`\\${d}`),w({type:"text",value:d,output:O});continue}if(u.dot!==!0&&(h.type==="slash"||h.type==="bos")){w({type:"qmark",value:d,output:X});continue}w({type:"qmark",value:d,output:B});continue}if(d==="!"){if(u.noextglob!==!0&&R()==="("&&(R(2)!=="?"||!/[!=<:]/.test(R(3)))){ke("negate",d);continue}if(u.nonegate!==!0&&C.index===0){vn();continue}}if(d==="+"){if(u.noextglob!==!0&&R()==="("&&R(2)!=="?"){ke("plus",d);continue}if(h&&h.value==="("||u.regex===!1){w({type:"plus",value:d,output:a});continue}if(h&&(h.type==="bracket"||h.type==="paren"||h.type==="brace")||C.parens>0){w({type:"plus",value:d});continue}w({type:"plus",value:a});continue}if(d==="@"){if(u.noextglob!==!0&&R()==="("&&R(2)!=="?"){w({type:"at",extglob:!0,value:d,output:""});continue}w({type:"text",value:d});continue}if(d!=="*"){(d==="$"||d==="^")&&(d=`\\${d}`);const g=fo.exec(Z());g&&(d+=g[0],C.index+=g[0].length),w({type:"text",value:d});continue}if(h&&(h.type==="globstar"||h.star===!0)){h.type="star",h.star=!0,h.value+=d,h.output=k,C.backtrack=!0,C.globstar=!0,K(d);continue}let m=Z();if(u.noextglob!==!0&&/^\([^?]/.test(m)){ke("star",d);continue}if(h.type==="star"){if(u.noglobstar===!0){K(d);continue}const g=h.prev,y=g.prev,O=g.type==="slash"||g.type==="bos",j=y&&(y.type==="star"||y.type==="globstar");if(u.bash===!0&&(!O||m[0]&&m[0]!=="/")){w({type:"star",value:d,output:""});continue}const L=C.braces>0&&(g.type==="comma"||g.type==="brace"),ct=x.length&&(g.type==="pipe"||g.type==="paren");if(!O&&g.type!=="paren"&&!L&&!ct){w({type:"star",value:d,output:""});continue}for(;m.slice(0,3)==="/**";){const Me=t[C.index+4];if(Me&&Me!=="/")break;m=m.slice(3),K("/**",3)}if(g.type==="bos"&&W()){h.type="globstar",h.value+=d,h.output=G(u),C.output=h.output,C.globstar=!0,K(d);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&!j&&W()){C.output=C.output.slice(0,-(g.output+h.output).length),g.output=`(?:${g.output}`,h.type="globstar",h.output=G(u)+(u.strictSlashes?")":"|$)"),h.value+=d,C.globstar=!0,C.output+=g.output+h.output,K(d);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&m[0]==="/"){const Me=m[1]!==void 0?"|$":"";C.output=C.output.slice(0,-(g.output+h.output).length),g.output=`(?:${g.output}`,h.type="globstar",h.output=`${G(u)}${E}|${E}${Me})`,h.value+=d,C.output+=g.output+h.output,C.globstar=!0,K(d+Q()),w({type:"slash",value:"/",output:""});continue}if(g.type==="bos"&&m[0]==="/"){h.type="globstar",h.value+=d,h.output=`(?:^|${E}|${G(u)}${E})`,C.output=h.output,C.globstar=!0,K(d+Q()),w({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-h.output.length),h.type="globstar",h.output=G(u),h.value+=d,C.output+=h.output,C.globstar=!0,K(d);continue}const T={type:"star",value:d,output:k};if(u.bash===!0){T.output=".*?",(h.type==="bos"||h.type==="slash")&&(T.output=_+T.output),w(T);continue}if(h&&(h.type==="bracket"||h.type==="paren")&&u.regex===!0){T.output=d,w(T);continue}(C.index===C.start||h.type==="slash"||h.type==="dot")&&(h.type==="dot"?(C.output+=S,h.output+=S):u.dot===!0?(C.output+=N,h.output+=N):(C.output+=_,h.output+=_),R()!=="*"&&(C.output+=p,h.output+=p)),w(T)}for(;C.brackets>0;){if(u.strictBrackets===!0)throw new SyntaxError(de("closing","]"));C.output=z.escapeLast(C.output,"["),re("brackets")}for(;C.parens>0;){if(u.strictBrackets===!0)throw new SyntaxError(de("closing",")"));C.output=z.escapeLast(C.output,"("),re("parens")}for(;C.braces>0;){if(u.strictBrackets===!0)throw new SyntaxError(de("closing","}"));C.output=z.escapeLast(C.output,"{"),re("braces")}if(u.strictSlashes!==!0&&(h.type==="star"||h.type==="bracket")&&w({type:"maybe_slash",value:"",output:`${E}?`}),C.backtrack===!0){C.output="";for(const m of C.tokens)C.output+=m.output!=null?m.output:m.value,m.suffix&&(C.output+=m.suffix)}return C};Gt.fastpaths=(t,e)=>{const u={...e},s=typeof u.maxLength=="number"?Math.min(Xe,u.maxLength):Xe,n=t.length;if(n>s)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${s}`);t=gs[t]||t;const r=z.isWindows(e),{DOT_LITERAL:i,SLASH_LITERAL:o,ONE_CHAR:D,DOTS_SLASH:l,NO_DOT:c,NO_DOTS:f,NO_DOTS_SLASH:a,STAR:E,START_ANCHOR:p}=qe.globChars(r),F=u.dot?f:c,A=u.dot?a:c,S=u.capture?"":"?:",N={negated:!1,prefix:""};let B=u.bash===!0?".*?":E;u.capture&&(B=`(${B})`);const X=_=>_.noglobstar===!0?B:`(${S}(?:(?!${p}${_.dot?l:i}).)*?)`,M=_=>{switch(_){case"*":return`${F}${D}${B}`;case".*":return`${i}${D}${B}`;case"*.*":return`${F}${B}${i}${D}${B}`;case"*/*":return`${F}${B}${o}${D}${A}${B}`;case"**":return F+X(u);case"**/*":return`(?:${F}${X(u)}${o})?${A}${D}${B}`;case"**/*.*":return`(?:${F}${X(u)}${o})?${A}${B}${i}${D}${B}`;case"**/.*":return`(?:${F}${X(u)}${o})?${i}${D}${B}`;default:{const b=/^(.*?)\.(\w+)$/.exec(_);if(!b)return;const k=M(b[1]);return k?k+i+b[2]:void 0}}},se=z.removePrefix(t,N);let G=M(se);return G&&u.strictSlashes!==!0&&(G+=`${o}?`),G};var po=Gt;const Co=V,Fo=lo,Wt=po,jt=Ve,go=Ye,mo=t=>t&&typeof t=="object"&&!Array.isArray(t),H=(t,e,u=!1)=>{if(Array.isArray(t)){const c=t.map(a=>H(a,e,u));return a=>{for(const E of c){const p=E(a);if(p)return p}return!1}}const s=mo(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!s)throw new TypeError("Expected pattern to be a non-empty string");const n=e||{},r=jt.isWindows(e),i=s?H.compileRe(t,e):H.makeRe(t,e,!1,!0),o=i.state;delete i.state;let D=()=>!1;if(n.ignore){const c={...e,ignore:null,onMatch:null,onResult:null};D=H(n.ignore,c,u)}const l=(c,f=!1)=>{const{isMatch:a,match:E,output:p}=H.test(c,i,e,{glob:t,posix:r}),F={glob:t,state:o,regex:i,posix:r,input:c,output:p,match:E,isMatch:a};return typeof n.onResult=="function"&&n.onResult(F),a===!1?(F.isMatch=!1,f?F:!1):D(c)?(typeof n.onIgnore=="function"&&n.onIgnore(F),F.isMatch=!1,f?F:!1):(typeof n.onMatch=="function"&&n.onMatch(F),f?F:!0)};return u&&(l.state=o),l};H.test=(t,e,u,{glob:s,posix:n}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};const r=u||{},i=r.format||(n?jt.toPosixSlashes:null);let o=t===s,D=o&&i?i(t):t;return o===!1&&(D=i?i(t):t,o=D===s),(o===!1||r.capture===!0)&&(r.matchBase===!0||r.basename===!0?o=H.matchBase(t,e,u,n):o=e.exec(D)),{isMatch:!!o,match:o,output:D}},H.matchBase=(t,e,u,s=jt.isWindows(u))=>(e instanceof RegExp?e:H.makeRe(e,u)).test(Co.basename(t)),H.isMatch=(t,e,u)=>H(e,u)(t),H.parse=(t,e)=>Array.isArray(t)?t.map(u=>H.parse(u,e)):Wt(t,{...e,fastpaths:!1}),H.scan=(t,e)=>Fo(t,e),H.compileRe=(t,e,u=!1,s=!1)=>{if(u===!0)return t.output;const n=e||{},r=n.contains?"":"^",i=n.contains?"":"$";let o=`${r}(?:${t.output})${i}`;t&&t.negated===!0&&(o=`^(?!${o}).*$`);const D=H.toRegex(o,e);return s===!0&&(D.state=t),D},H.makeRe=(t,e={},u=!1,s=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let n={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(n.output=Wt.fastpaths(t,e)),n.output||(n=Wt(t,e)),H.compileRe(n,e,u,s)},H.toRegex=(t,e)=>{try{const u=e||{};return new RegExp(t,u.flags||(u.nocase?"i":""))}catch(u){if(e&&e.debug===!0)throw u;return/$^/}},H.constants=go;var _o=H,ms=_o;const we=ie,{Readable:Ao}=kn,Re=V,{promisify:Qe}=me,Ut=ms,yo=Qe(we.readdir),wo=Qe(we.stat),_s=Qe(we.lstat),Ro=Qe(we.realpath),bo="!",As="READDIRP_RECURSIVE_ERROR",vo=new Set(["ENOENT","EPERM","EACCES","ELOOP",As]),Kt="files",ys="directories",Ze="files_directories",Je="all",ws=[Kt,ys,Ze,Je],So=t=>vo.has(t.code),[Rs,Bo]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),$o=process.platform==="win32"&&(Rs>10||Rs===10&&Bo>=5),bs=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){const e=Ut(t.trim());return u=>e(u.basename)}if(Array.isArray(t)){const e=[],u=[];for(const s of t){const n=s.trim();n.charAt(0)===bo?u.push(Ut(n.slice(1))):e.push(Ut(n))}return u.length>0?e.length>0?s=>e.some(n=>n(s.basename))&&!u.some(n=>n(s.basename)):s=>!u.some(n=>n(s.basename)):s=>e.some(n=>n(s.basename))}}};class lt extends Ao{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Kt,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});const u={...lt.defaultOptions,...e},{root:s,type:n}=u;this._fileFilter=bs(u.fileFilter),this._directoryFilter=bs(u.directoryFilter);const r=u.lstat?_s:wo;$o?this._stat=i=>r(i,{bigint:!0}):this._stat=r,this._maxDepth=u.depth,this._wantsDir=[ys,Ze,Je].includes(n),this._wantsFile=[Kt,Ze,Je].includes(n),this._wantsEverything=n===Je,this._root=Re.resolve(s),this._isDirent="Dirent"in we&&!u.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(s,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){const{path:u,depth:s,files:n=[]}=this.parent||{};if(n.length>0){const r=n.splice(0,e).map(i=>this._formatEntry(i,u));for(const i of await Promise.all(r)){if(this.destroyed)return;const o=await this._getEntryType(i);o==="directory"&&this._directoryFilter(i)?(s<=this._maxDepth&&this.parents.push(this._exploreDir(i.fullPath,s+1)),this._wantsDir&&(this.push(i),e--)):(o==="file"||this._includeAsFile(i))&&this._fileFilter(i)&&this._wantsFile&&(this.push(i),e--)}}else{const r=this.parents.pop();if(!r){this.push(null);break}if(this.parent=await r,this.destroyed)return}}}catch(u){this.destroy(u)}finally{this.reading=!1}}}async _exploreDir(e,u){let s;try{s=await yo(e,this._rdOptions)}catch(n){this._onError(n)}return{files:s,depth:u,path:e}}async _formatEntry(e,u){let s;try{const n=this._isDirent?e.name:e,r=Re.resolve(Re.join(u,n));s={path:Re.relative(this._root,r),fullPath:r,basename:n},s[this._statsProp]=this._isDirent?e:await this._stat(r)}catch(n){this._onError(n)}return s}_onError(e){So(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){const u=e&&e[this._statsProp];if(u){if(u.isFile())return"file";if(u.isDirectory())return"directory";if(u&&u.isSymbolicLink()){const s=e.fullPath;try{const n=await Ro(s),r=await _s(n);if(r.isFile())return"file";if(r.isDirectory()){const i=n.length;if(s.startsWith(n)&&s.substr(i,1)===Re.sep){const o=new Error(`Circular symlink detected: "${s}" points to "${n}"`);return o.code=As,this._onError(o)}return"directory"}}catch(n){this._onError(n)}}}}_includeAsFile(e){const u=e&&e[this._statsProp];return u&&this._wantsEverything&&!u.isDirectory()}}const Ee=(t,e={})=>{let u=e.entryType||e.type;if(u==="both"&&(u=Ze),u&&(e.type=u),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(u&&!ws.includes(u))throw new Error(`readdirp: Invalid type passed. Use one of ${ws.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new lt(e)},To=(t,e={})=>new Promise((u,s)=>{const n=[];Ee(t,e).on("data",r=>n.push(r)).on("end",()=>u(n)).on("error",r=>s(r))});Ee.promise=To,Ee.ReaddirpStream=lt,Ee.default=Ee;var xo=Ee,Vt={exports:{}};/*! * normalize-path * * Copyright (c) 2014-2018, Jon Schlinkert. * Released under the MIT License. */var vs=function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return"/";var u=t.length;if(u<=1)return t;var s="";if(u>4&&t[3]==="\\"){var n=t[2];(n==="?"||n===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),s="//")}var r=t.split(/[/\\]+/);return e!==!1&&r[r.length-1]===""&&r.pop(),s+r.join("/")},Oo=Vt.exports;Object.defineProperty(Oo,"__esModule",{value:!0});const Ss=ms,No=vs,Bs="!",Ho={returnIndex:!1},Lo=t=>Array.isArray(t)?t:[t],Io=(t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){const u=Ss(t,e);return s=>t===s||u(s)}return t instanceof RegExp?u=>t.test(u):u=>!1},$s=(t,e,u,s)=>{const n=Array.isArray(u),r=n?u[0]:u;if(!n&&typeof r!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(r));const i=No(r,!1);for(let D=0;D{if(t==null)throw new TypeError("anymatch: specify first argument");const s=typeof u=="boolean"?{returnIndex:u}:u,n=s.returnIndex||!1,r=Lo(t),i=r.filter(D=>typeof D=="string"&&D.charAt(0)===Bs).map(D=>D.slice(1)).map(D=>Ss(D,s)),o=r.filter(D=>typeof D!="string"||typeof D=="string"&&D.charAt(0)!==Bs).map(D=>Io(D,s));return e==null?(D,l=!1)=>$s(o,i,D,typeof l=="boolean"?l:!1):$s(o,i,e,n)};zt.default=zt,Vt.exports=zt;var Po=Vt.exports;/*! * is-extglob * * Copyright (c) 2014-2016, Jon Schlinkert. * Licensed under the MIT License. */var ko=function(e){if(typeof e!="string"||e==="")return!1;for(var u;u=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(u[2])return!0;e=e.slice(u.index+u[0].length)}return!1};/*! * is-glob * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */var Mo=ko,Ts={"{":"}","(":")","[":"]"},Go=function(t){if(t[0]==="!")return!0;for(var e=0,u=-2,s=-2,n=-2,r=-2,i=-2;ee&&(i===-1||i>s||(i=t.indexOf("\\",e),i===-1||i>s)))||n!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(n=t.indexOf("}",e),n>e&&(i=t.indexOf("\\",e),i===-1||i>n))||r!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(r=t.indexOf(")",e),r>e&&(i=t.indexOf("\\",e),i===-1||i>r))||u!==-1&&t[e]==="("&&t[e+1]!=="|"&&(uu&&(i=t.indexOf("\\",u),i===-1||i>r))))return!0;if(t[e]==="\\"){var o=t[e+1];e+=2;var D=Ts[o];if(D){var l=t.indexOf(D,e);l!==-1&&(e=l+1)}if(t[e]==="!")return!0}else e++}return!1},Wo=function(t){if(t[0]==="!")return!0;for(var e=0;etypeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1,t.find=(e,u)=>e.nodes.find(s=>s.type===u),t.exceedsLimit=(e,u,s=1,n)=>n===!1||!t.isInteger(e)||!t.isInteger(u)?!1:(Number(u)-Number(e))/Number(s)>=n,t.escapeNode=(e,u=0,s)=>{let n=e.nodes[u];n&&(s&&n.type===s||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)},t.encloseBrace=e=>e.type!=="brace"||e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0),t.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1,t.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0,t.reduce=e=>e.reduce((u,s)=>(s.type==="text"&&u.push(s.value),s.type==="range"&&(s.type="text"),u),[]),t.flatten=(...e)=>{const u=[],s=n=>{for(let r=0;r{let u=(s,n={})=>{let r=e.escapeInvalid&&Os.isInvalidBrace(n),i=s.invalid===!0&&e.escapeInvalid===!0,o="";if(s.value)return(r||i)&&Os.isOpenOrClose(s)?"\\"+s.value:s.value;if(s.value)return s.value;if(s.nodes)for(let D of s.nodes)o+=u(D);return o};return u(t)};/*! * is-number * * Copyright (c) 2014-present, Jon Schlinkert. * Released under the MIT License. */var Qo=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1};/*! * to-regex-range * * Copyright (c) 2015-present, Jon Schlinkert. * Released under the MIT License. */const Ns=Qo,De=(t,e,u)=>{if(Ns(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(Ns(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let s={relaxZeros:!0,...u};typeof s.strictZeros=="boolean"&&(s.relaxZeros=s.strictZeros===!1);let n=String(s.relaxZeros),r=String(s.shorthand),i=String(s.capture),o=String(s.wrap),D=t+":"+e+"="+n+r+i+o;if(De.cache.hasOwnProperty(D))return De.cache[D].result;let l=Math.min(t,e),c=Math.max(t,e);if(Math.abs(l-c)===1){let F=t+"|"+e;return s.capture?`(${F})`:s.wrap===!1?F:`(?:${F})`}let f=Ms(t)||Ms(e),a={min:t,max:e,a:l,b:c},E=[],p=[];if(f&&(a.isPadded=f,a.maxLen=String(a.max).length),l<0){let F=c<0?Math.abs(c):1;p=Hs(F,Math.abs(l),a,s),l=a.a=0}return c>=0&&(E=Hs(l,c,a,s)),a.negatives=p,a.positives=E,a.result=Zo(p,E),s.capture===!0?a.result=`(${a.result})`:s.wrap!==!1&&E.length+p.length>1&&(a.result=`(?:${a.result})`),De.cache[D]=a,a.result};function Zo(t,e,u){let s=Xt(t,e,"-",!1)||[],n=Xt(e,t,"",!1)||[],r=Xt(t,e,"-?",!0)||[];return s.concat(r).concat(n).join("|")}function Jo(t,e){let u=1,s=1,n=Is(t,u),r=new Set([e]);for(;t<=n&&n<=e;)r.add(n),u+=1,n=Is(t,u);for(n=Ps(e+1,s)-1;t1&&o.count.pop(),o.count.push(c.count[0]),o.string=o.pattern+ks(o.count),i=l+1;continue}u.isPadded&&(f=nD(l,u,s)),c.string=f+c.pattern+ks(c.count),r.push(c),i=l+1,o=c}return r}function Xt(t,e,u,s,n){let r=[];for(let i of t){let{string:o}=i;!s&&!Ls(e,"string",o)&&r.push(u+o),s&&Ls(e,"string",o)&&r.push(u+o)}return r}function tD(t,e){let u=[];for(let s=0;se?1:e>t?-1:0}function Ls(t,e,u){return t.some(s=>s[e]===u)}function Is(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function Ps(t,e){return t-t%Math.pow(10,e)}function ks(t){let[e=0,u=""]=t;return u||e>1?`{${e+(u?","+u:"")}}`:""}function sD(t,e,u){return`[${t}${e-t===1?"":"-"}${e}]`}function Ms(t){return/^-?(0+)\d/.test(t)}function nD(t,e,u){if(!e.isPadded)return t;let s=Math.abs(e.maxLen-String(t).length),n=u.relaxZeros!==!1;switch(s){case 0:return"";case 1:return n?"0?":"0";case 2:return n?"0{0,2}":"00";default:return n?`0{0,${s}}`:`0{${s}}`}}De.cache={},De.clearCache=()=>De.cache={};var rD=De;/*! * fill-range * * Copyright (c) 2014-present, Jon Schlinkert. * Licensed under the MIT License. */const iD=me,Gs=rD,Ws=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),oD=t=>e=>t===!0?Number(e):String(e),Qt=t=>typeof t=="number"||typeof t=="string"&&t!=="",be=t=>Number.isInteger(+t),Zt=t=>{let e=`${t}`,u=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++u]==="0";);return u>0},DD=(t,e,u)=>typeof t=="string"||typeof e=="string"?!0:u.stringify===!0,aD=(t,e,u)=>{if(e>0){let s=t[0]==="-"?"-":"";s&&(t=t.slice(1)),t=s+t.padStart(s?e-1:e,"0")}return u===!1?String(t):t},js=(t,e)=>{let u=t[0]==="-"?"-":"";for(u&&(t=t.slice(1),e--);t.length{t.negatives.sort((i,o)=>io?1:0),t.positives.sort((i,o)=>io?1:0);let u=e.capture?"":"?:",s="",n="",r;return t.positives.length&&(s=t.positives.join("|")),t.negatives.length&&(n=`-(${u}${t.negatives.join("|")})`),s&&n?r=`${s}|${n}`:r=s||n,e.wrap?`(${u}${r})`:r},Us=(t,e,u,s)=>{if(u)return Gs(t,e,{wrap:!1,...s});let n=String.fromCharCode(t);if(t===e)return n;let r=String.fromCharCode(e);return`[${n}-${r}]`},Ks=(t,e,u)=>{if(Array.isArray(t)){let s=u.wrap===!0,n=u.capture?"":"?:";return s?`(${n}${t.join("|")})`:t.join("|")}return Gs(t,e,u)},Vs=(...t)=>new RangeError("Invalid range arguments: "+iD.inspect(...t)),zs=(t,e,u)=>{if(u.strictRanges===!0)throw Vs([t,e]);return[]},cD=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},fD=(t,e,u=1,s={})=>{let n=Number(t),r=Number(e);if(!Number.isInteger(n)||!Number.isInteger(r)){if(s.strictRanges===!0)throw Vs([t,e]);return[]}n===0&&(n=0),r===0&&(r=0);let i=n>r,o=String(t),D=String(e),l=String(u);u=Math.max(Math.abs(u),1);let c=Zt(o)||Zt(D)||Zt(l),f=c?Math.max(o.length,D.length,l.length):0,a=c===!1&&DD(t,e,s)===!1,E=s.transform||oD(a);if(s.toRegex&&u===1)return Us(js(t,f),js(e,f),!0,s);let p={negatives:[],positives:[]},F=N=>p[N<0?"negatives":"positives"].push(Math.abs(N)),A=[],S=0;for(;i?n>=r:n<=r;)s.toRegex===!0&&u>1?F(n):A.push(aD(E(n,S),f,a)),n=i?n-u:n+u,S++;return s.toRegex===!0?u>1?lD(p,s):Ks(A,null,{wrap:!1,...s}):A},hD=(t,e,u=1,s={})=>{if(!be(t)&&t.length>1||!be(e)&&e.length>1)return zs(t,e,s);let n=s.transform||(a=>String.fromCharCode(a)),r=`${t}`.charCodeAt(0),i=`${e}`.charCodeAt(0),o=r>i,D=Math.min(r,i),l=Math.max(r,i);if(s.toRegex&&u===1)return Us(D,l,!1,s);let c=[],f=0;for(;o?r>=i:r<=i;)c.push(n(r,f)),r=o?r-u:r+u,f++;return s.toRegex===!0?Ks(c,null,{wrap:!1,options:s}):c},tt=(t,e,u,s={})=>{if(e==null&&Qt(t))return[t];if(!Qt(t)||!Qt(e))return zs(t,e,s);if(typeof u=="function")return tt(t,e,1,{transform:u});if(Ws(u))return tt(t,e,0,u);let n={...s};return n.capture===!0&&(n.wrap=!0),u=u||n.step||1,be(u)?be(t)&&be(e)?fD(t,e,u,n):hD(t,e,Math.max(Math.abs(u),1),n):u!=null&&!Ws(u)?cD(u,n):tt(t,e,1,u)};var Ys=tt;const dD=Ys,qs=et,ED=(t,e={})=>{let u=(s,n={})=>{let r=qs.isInvalidBrace(n),i=s.invalid===!0&&e.escapeInvalid===!0,o=r===!0||i===!0,D=e.escapeInvalid===!0?"\\":"",l="";if(s.isOpen===!0||s.isClose===!0)return D+s.value;if(s.type==="open")return o?D+s.value:"(";if(s.type==="close")return o?D+s.value:")";if(s.type==="comma")return s.prev.type==="comma"?"":o?s.value:"|";if(s.value)return s.value;if(s.nodes&&s.ranges>0){let c=qs.reduce(s.nodes),f=dD(...c,{...e,wrap:!1,toRegex:!0});if(f.length!==0)return c.length>1&&f.length>1?`(${f})`:f}if(s.nodes)for(let c of s.nodes)l+=u(c,s);return l};return u(t)};var pD=ED;const CD=Ys,Xs=qt,pe=et,ae=(t="",e="",u=!1)=>{let s=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return u?pe.flatten(e).map(n=>`{${n}}`):e;for(let n of t)if(Array.isArray(n))for(let r of n)s.push(ae(r,e,u));else for(let r of e)u===!0&&typeof r=="string"&&(r=`{${r}}`),s.push(Array.isArray(r)?ae(n,r,u):n+r);return pe.flatten(s)},FD=(t,e={})=>{let u=e.rangeLimit===void 0?1e3:e.rangeLimit,s=(n,r={})=>{n.queue=[];let i=r,o=r.queue;for(;i.type!=="brace"&&i.type!=="root"&&i.parent;)i=i.parent,o=i.queue;if(n.invalid||n.dollar){o.push(ae(o.pop(),Xs(n,e)));return}if(n.type==="brace"&&n.invalid!==!0&&n.nodes.length===2){o.push(ae(o.pop(),["{}"]));return}if(n.nodes&&n.ranges>0){let f=pe.reduce(n.nodes);if(pe.exceedsLimit(...f,e.step,u))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let a=CD(...f,e);a.length===0&&(a=Xs(n,e)),o.push(ae(o.pop(),a)),n.nodes=[];return}let D=pe.encloseBrace(n),l=n.queue,c=n;for(;c.type!=="brace"&&c.type!=="root"&&c.parent;)c=c.parent,l=c.queue;for(let f=0;f",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};const _D=qt,{MAX_LENGTH:Qs,CHAR_BACKSLASH:Jt,CHAR_BACKTICK:AD,CHAR_COMMA:yD,CHAR_DOT:wD,CHAR_LEFT_PARENTHESES:RD,CHAR_RIGHT_PARENTHESES:bD,CHAR_LEFT_CURLY_BRACE:vD,CHAR_RIGHT_CURLY_BRACE:SD,CHAR_LEFT_SQUARE_BRACKET:Zs,CHAR_RIGHT_SQUARE_BRACKET:Js,CHAR_DOUBLE_QUOTE:BD,CHAR_SINGLE_QUOTE:$D,CHAR_NO_BREAK_SPACE:TD,CHAR_ZERO_WIDTH_NOBREAK_SPACE:xD}=mD,OD=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let u=e||{},s=typeof u.maxLength=="number"?Math.min(Qs,u.maxLength):Qs;if(t.length>s)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${s})`);let n={type:"root",input:t,nodes:[]},r=[n],i=n,o=n,D=0,l=t.length,c=0,f=0,a;const E=()=>t[c++],p=F=>{if(F.type==="text"&&o.type==="dot"&&(o.type="text"),o&&o.type==="text"&&F.type==="text"){o.value+=F.value;return}return i.nodes.push(F),F.parent=i,F.prev=o,o=F,F};for(p({type:"bos"});c0){if(i.ranges>0){i.ranges=0;let F=i.nodes.shift();i.nodes=[F,{type:"text",value:_D(i)}]}p({type:"comma",value:a}),i.commas++;continue}if(a===wD&&f>0&&i.commas===0){let F=i.nodes;if(f===0||F.length===0){p({type:"text",value:a});continue}if(o.type==="dot"){if(i.range=[],o.value+=a,o.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,o.type="text";continue}i.ranges++,i.args=[];continue}if(o.type==="range"){F.pop();let A=F[F.length-1];A.value+=o.value+a,o=A,i.ranges--;continue}p({type:"dot",value:a});continue}p({type:"text",value:a})}do if(i=r.pop(),i.type!=="root"){i.nodes.forEach(S=>{S.nodes||(S.type==="open"&&(S.isOpen=!0),S.type==="close"&&(S.isClose=!0),S.nodes||(S.type="text"),S.invalid=!0)});let F=r[r.length-1],A=F.nodes.indexOf(i);F.nodes.splice(A,1,...i.nodes)}while(r.length>0);return p({type:"eos"}),n};var ND=OD;const en=qt,HD=pD,LD=gD,ID=ND,Y=(t,e={})=>{let u=[];if(Array.isArray(t))for(let s of t){let n=Y.create(s,e);Array.isArray(n)?u.push(...n):u.push(n)}else u=[].concat(Y.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(u=[...new Set(u)]),u};Y.parse=(t,e={})=>ID(t,e),Y.stringify=(t,e={})=>en(typeof t=="string"?Y.parse(t,e):t,e),Y.compile=(t,e={})=>(typeof t=="string"&&(t=Y.parse(t,e)),HD(t,e)),Y.expand=(t,e={})=>{typeof t=="string"&&(t=Y.parse(t,e));let u=LD(t,e);return e.noempty===!0&&(u=u.filter(Boolean)),e.nodupes===!0&&(u=[...new Set(u)]),u},Y.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Y.compile(t,e):Y.expand(t,e);var PD=Y,kD=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"],MD=kD;const GD=V,WD=MD,jD=new Set(WD);var UD=t=>jD.has(GD.extname(t).slice(1).toLowerCase()),ut={};(function(t){const{sep:e}=V,{platform:u}=process,s=wu;t.EV_ALL="all",t.EV_READY="ready",t.EV_ADD="add",t.EV_CHANGE="change",t.EV_ADD_DIR="addDir",t.EV_UNLINK="unlink",t.EV_UNLINK_DIR="unlinkDir",t.EV_RAW="raw",t.EV_ERROR="error",t.STR_DATA="data",t.STR_END="end",t.STR_CLOSE="close",t.FSEVENT_CREATED="created",t.FSEVENT_MODIFIED="modified",t.FSEVENT_DELETED="deleted",t.FSEVENT_MOVED="moved",t.FSEVENT_CLONED="cloned",t.FSEVENT_UNKNOWN="unknown",t.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1,t.FSEVENT_TYPE_FILE="file",t.FSEVENT_TYPE_DIRECTORY="directory",t.FSEVENT_TYPE_SYMLINK="symlink",t.KEY_LISTENERS="listeners",t.KEY_ERR="errHandlers",t.KEY_RAW="rawEmitters",t.HANDLER_KEYS=[t.KEY_LISTENERS,t.KEY_ERR,t.KEY_RAW],t.DOT_SLASH=`.${e}`,t.BACK_SLASH_RE=/\\/g,t.DOUBLE_SLASH_RE=/\/\//,t.SLASH_OR_BACK_SLASH_RE=/[/\\]/,t.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,t.REPLACER_RE=/^\.[/\\]/,t.SLASH="/",t.SLASH_SLASH="//",t.BRACE_START="{",t.BANG="!",t.ONE_DOT=".",t.TWO_DOTS="..",t.STAR="*",t.GLOBSTAR="**",t.ROOT_GLOBSTAR="/**/*",t.SLASH_GLOBSTAR="/**",t.DIR_SUFFIX="Dir",t.ANYMATCH_OPTS={dot:!0},t.STRING_TYPE="string",t.FUNCTION_TYPE="function",t.EMPTY_STR="",t.EMPTY_FN=()=>{},t.IDENTITY_FN=n=>n,t.isWindows=u==="win32",t.isMacos=u==="darwin",t.isLinux=u==="linux",t.isIBMi=s.type()==="OS400"})(ut);const ue=ie,I=V,{promisify:ve}=me,KD=UD,{isWindows:VD,isLinux:zD,EMPTY_FN:YD,EMPTY_STR:qD,KEY_LISTENERS:Ce,KEY_ERR:eu,KEY_RAW:Se,HANDLER_KEYS:XD,EV_CHANGE:st,EV_ADD:nt,EV_ADD_DIR:QD,EV_ERROR:tn,STR_DATA:ZD,STR_END:JD,BRACE_START:ea,STAR:ta}=ut,ua="watch",sa=ve(ue.open),un=ve(ue.stat),na=ve(ue.lstat),ra=ve(ue.close),tu=ve(ue.realpath),ia={lstat:na,stat:un},uu=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},Be=(t,e,u)=>{let s=t[e];s instanceof Set||(t[e]=s=new Set([s])),s.add(u)},oa=t=>e=>{const u=t[e];u instanceof Set?u.clear():delete t[e]},$e=(t,e,u)=>{const s=t[e];s instanceof Set?s.delete(u):s===u&&delete t[e]},sn=t=>t instanceof Set?t.size===0:!t,rt=new Map;function nn(t,e,u,s,n){const r=(i,o)=>{u(t),n(i,o,{watchedPath:t}),o&&t!==o&&it(I.resolve(t,o),Ce,I.join(t,o))};try{return ue.watch(t,e,r)}catch(i){s(i)}}const it=(t,e,u,s,n)=>{const r=rt.get(t);r&&uu(r[e],i=>{i(u,s,n)})},Da=(t,e,u,s)=>{const{listener:n,errHandler:r,rawEmitter:i}=s;let o=rt.get(e),D;if(!u.persistent)return D=nn(t,u,n,r,i),D.close.bind(D);if(o)Be(o,Ce,n),Be(o,eu,r),Be(o,Se,i);else{if(D=nn(t,u,it.bind(null,e,Ce),r,it.bind(null,e,Se)),!D)return;D.on(tn,async l=>{const c=it.bind(null,e,eu);if(o.watcherUnusable=!0,VD&&l.code==="EPERM")try{const f=await sa(t,"r");await ra(f),c(l)}catch{}else c(l)}),o={listeners:n,errHandlers:r,rawEmitters:i,watcher:D},rt.set(e,o)}return()=>{$e(o,Ce,n),$e(o,eu,r),$e(o,Se,i),sn(o.listeners)&&(o.watcher.close(),rt.delete(e),XD.forEach(oa(o)),o.watcher=void 0,Object.freeze(o))}},su=new Map,aa=(t,e,u,s)=>{const{listener:n,rawEmitter:r}=s;let i=su.get(e);const o=i&&i.options;return o&&(o.persistentu.interval)&&(i.listeners,i.rawEmitters,ue.unwatchFile(e),i=void 0),i?(Be(i,Ce,n),Be(i,Se,r)):(i={listeners:n,rawEmitters:r,options:u,watcher:ue.watchFile(e,u,(D,l)=>{uu(i.rawEmitters,f=>{f(st,e,{curr:D,prev:l})});const c=D.mtimeMs;(D.size!==l.size||c>l.mtimeMs||c===0)&&uu(i.listeners,f=>f(t,D))})},su.set(e,i)),()=>{$e(i,Ce,n),$e(i,Se,r),sn(i.listeners)&&(su.delete(e),ue.unwatchFile(e),i.options=i.watcher=void 0,Object.freeze(i))}};let la=class{constructor(e){this.fsw=e,this._boundHandleError=u=>e._handleError(u)}_watchWithNodeFs(e,u){const s=this.fsw.options,n=I.dirname(e),r=I.basename(e);this.fsw._getWatchedDir(n).add(r);const o=I.resolve(e),D={persistent:s.persistent};u||(u=YD);let l;return s.usePolling?(D.interval=s.enableBinaryInterval&&KD(r)?s.binaryInterval:s.interval,l=aa(e,o,D,{listener:u,rawEmitter:this.fsw._emitRaw})):l=Da(e,o,D,{listener:u,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),l}_handleFile(e,u,s){if(this.fsw.closed)return;const n=I.dirname(e),r=I.basename(e),i=this.fsw._getWatchedDir(n);let o=u;if(i.has(r))return;const D=async(c,f)=>{if(this.fsw._throttle(ua,e,5)){if(!f||f.mtimeMs===0)try{const a=await un(e);if(this.fsw.closed)return;const E=a.atimeMs,p=a.mtimeMs;(!E||E<=p||p!==o.mtimeMs)&&this.fsw._emit(st,e,a),zD&&o.ino!==a.ino?(this.fsw._closeFile(c),o=a,this.fsw._addPathCloser(c,this._watchWithNodeFs(e,D))):o=a}catch{this.fsw._remove(n,r)}else if(i.has(r)){const a=f.atimeMs,E=f.mtimeMs;(!a||a<=E||E!==o.mtimeMs)&&this.fsw._emit(st,e,f),o=f}}},l=this._watchWithNodeFs(e,D);if(!(s&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(nt,e,0))return;this.fsw._emit(nt,e,u)}return l}async _handleSymlink(e,u,s,n){if(this.fsw.closed)return;const r=e.fullPath,i=this.fsw._getWatchedDir(u);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let o;try{o=await tu(s)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(i.has(n)?this.fsw._symlinkPaths.get(r)!==o&&(this.fsw._symlinkPaths.set(r,o),this.fsw._emit(st,s,e.stats)):(i.add(n),this.fsw._symlinkPaths.set(r,o),this.fsw._emit(nt,s,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(r))return!0;this.fsw._symlinkPaths.set(r,!0)}_handleRead(e,u,s,n,r,i,o){if(e=I.join(e,qD),!s.hasGlob&&(o=this.fsw._throttle("readdir",e,1e3),!o))return;const D=this.fsw._getWatchedDir(s.path),l=new Set;let c=this.fsw._readdirp(e,{fileFilter:f=>s.filterPath(f),directoryFilter:f=>s.filterDir(f),depth:0}).on(ZD,async f=>{if(this.fsw.closed){c=void 0;return}const a=f.path;let E=I.join(e,a);if(l.add(a),!(f.stats.isSymbolicLink()&&await this._handleSymlink(f,e,E,a))){if(this.fsw.closed){c=void 0;return}(a===n||!n&&!D.has(a))&&(this.fsw._incrReadyCount(),E=I.join(r,I.relative(r,E)),this._addToNodeFs(E,u,s,i+1))}}).on(tn,this._boundHandleError);return new Promise(f=>c.once(JD,()=>{if(this.fsw.closed){c=void 0;return}const a=o?o.clear():!1;f(),D.getChildren().filter(E=>E!==e&&!l.has(E)&&(!s.hasGlob||s.filterPath({fullPath:I.resolve(e,E)}))).forEach(E=>{this.fsw._remove(e,E)}),c=void 0,a&&this._handleRead(e,!1,s,n,r,i,o)}))}async _handleDir(e,u,s,n,r,i,o){const D=this.fsw._getWatchedDir(I.dirname(e)),l=D.has(I.basename(e));!(s&&this.fsw.options.ignoreInitial)&&!r&&!l&&(!i.hasGlob||i.globFilter(e))&&this.fsw._emit(QD,e,u),D.add(I.basename(e)),this.fsw._getWatchedDir(e);let c,f;const a=this.fsw.options.depth;if((a==null||n<=a)&&!this.fsw._symlinkPaths.has(o)){if(!r&&(await this._handleRead(e,s,i,r,e,n,c),this.fsw.closed))return;f=this._watchWithNodeFs(e,(E,p)=>{p&&p.mtimeMs===0||this._handleRead(E,!1,i,r,e,n,c)})}return f}async _addToNodeFs(e,u,s,n,r){const i=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return i(),!1;const o=this.fsw._getWatchHelpers(e,n);!o.hasGlob&&s&&(o.hasGlob=s.hasGlob,o.globFilter=s.globFilter,o.filterPath=D=>s.filterPath(D),o.filterDir=D=>s.filterDir(D));try{const D=await ia[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,D))return i(),!1;const l=this.fsw.options.followSymlinks&&!e.includes(ta)&&!e.includes(ea);let c;if(D.isDirectory()){const f=I.resolve(e),a=l?await tu(e):e;if(this.fsw.closed||(c=await this._handleDir(o.watchPath,D,u,n,r,o,a),this.fsw.closed))return;f!==a&&a!==void 0&&this.fsw._symlinkPaths.set(f,a)}else if(D.isSymbolicLink()){const f=l?await tu(e):e;if(this.fsw.closed)return;const a=I.dirname(o.watchPath);if(this.fsw._getWatchedDir(a).add(o.watchPath),this.fsw._emit(nt,o.watchPath,D),c=await this._handleDir(a,D,u,n,e,o,f),this.fsw.closed)return;f!==void 0&&this.fsw._symlinkPaths.set(I.resolve(e),f)}else c=this._handleFile(o.watchPath,D,u);return i(),this.fsw._addPathCloser(e,c),!1}catch(D){if(this.fsw._handleError(D))return i(),e}}};var ca=la,nu={exports:{}};const ru=ie,P=V,{promisify:iu}=me;let Fe;try{Fe=ht("fsevents")}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t)}if(Fe){const t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){const e=Number.parseInt(t[1],10),u=Number.parseInt(t[2],10);e===8&&u<16&&(Fe=void 0)}}const{EV_ADD:ou,EV_CHANGE:fa,EV_ADD_DIR:rn,EV_UNLINK:ot,EV_ERROR:ha,STR_DATA:da,STR_END:Ea,FSEVENT_CREATED:pa,FSEVENT_MODIFIED:Ca,FSEVENT_DELETED:Fa,FSEVENT_MOVED:ga,FSEVENT_UNKNOWN:ma,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:_a,FSEVENT_TYPE_FILE:Aa,FSEVENT_TYPE_DIRECTORY:Te,FSEVENT_TYPE_SYMLINK:on,ROOT_GLOBSTAR:Dn,DIR_SUFFIX:ya,DOT_SLASH:an,FUNCTION_TYPE:Du,EMPTY_FN:wa,IDENTITY_FN:Ra}=ut,ba=t=>isNaN(t)?{}:{depth:t},au=iu(ru.stat),va=iu(ru.lstat),ln=iu(ru.realpath),Sa={stat:au,lstat:va},le=new Map,Ba=10,$a=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),Ta=(t,e)=>({stop:Fe.watch(t,e)});function xa(t,e,u,s){let n=P.extname(e)?P.dirname(e):e;const r=P.dirname(n);let i=le.get(n);Oa(r)&&(n=r);const o=P.resolve(t),D=o!==e,l=(f,a,E)=>{D&&(f=f.replace(e,o)),(f===o||!f.indexOf(o+P.sep))&&u(f,a,E)};let c=!1;for(const f of le.keys())if(e.indexOf(P.resolve(f)+P.sep)===0){n=f,i=le.get(n),c=!0;break}return i||c?i.listeners.add(l):(i={listeners:new Set([l]),rawEmitter:s,watcher:Ta(n,(f,a)=>{if(!i.listeners.size||a&_a)return;const E=Fe.getInfo(f,a);i.listeners.forEach(p=>{p(f,a,E)}),i.rawEmitter(E.event,f,E)})},le.set(n,i)),()=>{const f=i.listeners;if(f.delete(l),!f.size&&(le.delete(n),i.watcher))return i.watcher.stop().then(()=>{i.rawEmitter=i.watcher=void 0,Object.freeze(i)})}}const Oa=t=>{let e=0;for(const u of le.keys())if(u.indexOf(t)===0&&(e++,e>=Ba))return!0;return!1},Na=()=>Fe&&le.size<128,lu=(t,e)=>{let u=0;for(;!t.indexOf(e)&&(t=P.dirname(t))!==e;)u++;return u},cn=(t,e)=>t.type===Te&&e.isDirectory()||t.type===on&&e.isSymbolicLink()||t.type===Aa&&e.isFile();let Ha=class{constructor(e){this.fsw=e}checkIgnored(e,u){const s=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,u))return s.add(e),u&&u.isDirectory()&&s.add(e+Dn),!0;s.delete(e),s.delete(e+Dn)}addOrChange(e,u,s,n,r,i,o,D){const l=r.has(i)?fa:ou;this.handleEvent(l,e,u,s,n,r,i,o,D)}async checkExists(e,u,s,n,r,i,o,D){try{const l=await au(e);if(this.fsw.closed)return;cn(o,l)?this.addOrChange(e,u,s,n,r,i,o,D):this.handleEvent(ot,e,u,s,n,r,i,o,D)}catch(l){l.code==="EACCES"?this.addOrChange(e,u,s,n,r,i,o,D):this.handleEvent(ot,e,u,s,n,r,i,o,D)}}handleEvent(e,u,s,n,r,i,o,D,l){if(!(this.fsw.closed||this.checkIgnored(u)))if(e===ot){const c=D.type===Te;(c||i.has(o))&&this.fsw._remove(r,o,c)}else{if(e===ou){if(D.type===Te&&this.fsw._getWatchedDir(u),D.type===on&&l.followSymlinks){const f=l.depth===void 0?void 0:lu(s,n)+1;return this._addToFsEvents(u,!1,!0,f)}this.fsw._getWatchedDir(r).add(o)}const c=D.type===Te?e+ya:e;this.fsw._emit(c,u),c===rn&&this._addToFsEvents(u,!1,!0)}}_watchWithFsEvents(e,u,s,n){if(this.fsw.closed||this.fsw._isIgnored(e))return;const r=this.fsw.options,o=xa(e,u,async(D,l,c)=>{if(this.fsw.closed||r.depth!==void 0&&lu(D,u)>r.depth)return;const f=s(P.join(e,P.relative(e,D)));if(n&&!n(f))return;const a=P.dirname(f),E=P.basename(f),p=this.fsw._getWatchedDir(c.type===Te?f:a);if($a.has(l)||c.event===ma)if(typeof r.ignored===Du){let F;try{F=await au(f)}catch{}if(this.fsw.closed||this.checkIgnored(f,F))return;cn(c,F)?this.addOrChange(f,D,u,a,p,E,c,r):this.handleEvent(ot,f,D,u,a,p,E,c,r)}else this.checkExists(f,D,u,a,p,E,c,r);else switch(c.event){case pa:case Ca:return this.addOrChange(f,D,u,a,p,E,c,r);case Fa:case ga:return this.checkExists(f,D,u,a,p,E,c,r)}},this.fsw._emitRaw);return this.fsw._emitReady(),o}async _handleFsEventsSymlink(e,u,s,n){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(u))){this.fsw._symlinkPaths.set(u,!0),this.fsw._incrReadyCount();try{const r=await ln(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(r))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(r||e,i=>{let o=e;return r&&r!==an?o=i.replace(r,e):i!==an&&(o=P.join(e,i)),s(o)},!1,n)}catch(r){if(this.fsw._handleError(r))return this.fsw._emitReady()}}}emitAdd(e,u,s,n,r){const i=s(e),o=u.isDirectory(),D=this.fsw._getWatchedDir(P.dirname(i)),l=P.basename(i);o&&this.fsw._getWatchedDir(i),!D.has(l)&&(D.add(l),(!n.ignoreInitial||r===!0)&&this.fsw._emit(o?rn:ou,i,u))}initWatch(e,u,s,n){if(this.fsw.closed)return;const r=this._watchWithFsEvents(s.watchPath,P.resolve(e||s.watchPath),n,s.globFilter);this.fsw._addPathCloser(u,r)}async _addToFsEvents(e,u,s,n){if(this.fsw.closed)return;const r=this.fsw.options,i=typeof u===Du?u:Ra,o=this.fsw._getWatchHelpers(e);try{const D=await Sa[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,D))throw null;if(D.isDirectory()){if(o.globFilter||this.emitAdd(i(e),D,i,r,s),n&&n>r.depth)return;this.fsw._readdirp(o.watchPath,{fileFilter:l=>o.filterPath(l),directoryFilter:l=>o.filterDir(l),...ba(r.depth-(n||0))}).on(da,l=>{if(this.fsw.closed||l.stats.isDirectory()&&!o.filterPath(l))return;const c=P.join(o.watchPath,l.path),{fullPath:f}=l;if(o.followSymlinks&&l.stats.isSymbolicLink()){const a=r.depth===void 0?void 0:lu(c,P.resolve(o.watchPath))+1;this._handleFsEventsSymlink(c,f,i,a)}else this.emitAdd(c,l.stats,i,r,s)}).on(ha,wa).on(Ea,()=>{this.fsw._emitReady()})}else this.emitAdd(o.watchPath,D,i,r,s),this.fsw._emitReady()}catch(D){(!D||this.fsw._handleError(D))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(r.persistent&&s!==!0)if(typeof u===Du)this.initWatch(void 0,e,o,i);else{let D;try{D=await ln(o.watchPath)}catch{}this.initWatch(D,e,o,i)}}};nu.exports=Ha,nu.exports.canUse=Na;var La=nu.exports;const{EventEmitter:Ia}=Pn,cu=ie,v=V,{promisify:fn}=me,Pa=xo,fu=Po.default,ka=Xo,hu=xs,Ma=PD,Ga=vs,Wa=ca,hn=La,{EV_ALL:du,EV_READY:ja,EV_ADD:Dt,EV_CHANGE:xe,EV_UNLINK:dn,EV_ADD_DIR:Ua,EV_UNLINK_DIR:Ka,EV_RAW:Va,EV_ERROR:Eu,STR_CLOSE:za,STR_END:Ya,BACK_SLASH_RE:qa,DOUBLE_SLASH_RE:En,SLASH_OR_BACK_SLASH_RE:Xa,DOT_RE:Qa,REPLACER_RE:Za,SLASH:pu,SLASH_SLASH:Ja,BRACE_START:el,BANG:Cu,ONE_DOT:pn,TWO_DOTS:tl,GLOBSTAR:ul,SLASH_GLOBSTAR:Fu,ANYMATCH_OPTS:gu,STRING_TYPE:mu,FUNCTION_TYPE:sl,EMPTY_STR:_u,EMPTY_FN:nl,isWindows:rl,isMacos:il,isIBMi:ol}=ut,Dl=fn(cu.stat),al=fn(cu.readdir),Au=(t=[])=>Array.isArray(t)?t:[t],Cn=(t,e=[])=>(t.forEach(u=>{Array.isArray(u)?Cn(u,e):e.push(u)}),e),Fn=t=>{const e=Cn(Au(t));if(!e.every(u=>typeof u===mu))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(mn)},gn=t=>{let e=t.replace(qa,pu),u=!1;for(e.startsWith(Ja)&&(u=!0);e.match(En);)e=e.replace(En,pu);return u&&(e=pu+e),e},mn=t=>gn(v.normalize(gn(t))),_n=(t=_u)=>e=>typeof e!==mu?e:mn(v.isAbsolute(e)?e:v.join(t,e)),ll=(t,e)=>v.isAbsolute(t)?t:t.startsWith(Cu)?Cu+v.join(e,t.slice(1)):v.join(e,t),q=(t,e)=>t[e]===void 0;class cl{constructor(e,u){this.path=e,this._removeWatcher=u,this.items=new Set}add(e){const{items:u}=this;u&&e!==pn&&e!==tl&&u.add(e)}async remove(e){const{items:u}=this;if(!u||(u.delete(e),u.size>0))return;const s=this.path;try{await al(s)}catch{this._removeWatcher&&this._removeWatcher(v.dirname(s),v.basename(s))}}has(e){const{items:u}=this;if(u)return u.has(e)}getChildren(){const{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}}const fl="stat",hl="lstat";class dl{constructor(e,u,s,n){this.fsw=n,this.path=e=e.replace(Za,_u),this.watchPath=u,this.fullWatchPath=v.resolve(u),this.hasGlob=u!==e,e===_u&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&s?void 0:!1,this.globFilter=this.hasGlob?fu(e,void 0,gu):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(r=>{r.length>1&&r.pop()}),this.followSymlinks=s,this.statMethod=s?fl:hl}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return v.join(this.watchPath,v.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){const{stats:u}=e;if(u&&u.isSymbolicLink())return this.filterDir(e);const s=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===sl?this.globFilter(s):!0)&&this.fsw._isntIgnored(s,u)&&this.fsw._hasReadPermissions(u)}getDirParts(e){if(!this.hasGlob)return[];const u=[];return(e.includes(el)?Ma.expand(e):[e]).forEach(n=>{u.push(v.relative(this.watchPath,n).split(Xa))}),u}filterDir(e){if(this.hasGlob){const u=this.getDirParts(this.checkGlobSymlink(e));let s=!1;this.unmatchedGlob=!this.dirParts.some(n=>n.every((r,i)=>(r===ul&&(s=!0),s||!u[0][i]||fu(r,u[0][i],gu))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class El extends Ia{constructor(e){super();const u={};e&&Object.assign(u,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,q(u,"persistent")&&(u.persistent=!0),q(u,"ignoreInitial")&&(u.ignoreInitial=!1),q(u,"ignorePermissionErrors")&&(u.ignorePermissionErrors=!1),q(u,"interval")&&(u.interval=100),q(u,"binaryInterval")&&(u.binaryInterval=300),q(u,"disableGlobbing")&&(u.disableGlobbing=!1),u.enableBinaryInterval=u.binaryInterval!==u.interval,q(u,"useFsEvents")&&(u.useFsEvents=!u.usePolling),hn.canUse()||(u.useFsEvents=!1),q(u,"usePolling")&&!u.useFsEvents&&(u.usePolling=il),ol&&(u.usePolling=!0);const n=process.env.CHOKIDAR_USEPOLLING;if(n!==void 0){const D=n.toLowerCase();D==="false"||D==="0"?u.usePolling=!1:D==="true"||D==="1"?u.usePolling=!0:u.usePolling=!!D}const r=process.env.CHOKIDAR_INTERVAL;r&&(u.interval=Number.parseInt(r,10)),q(u,"atomic")&&(u.atomic=!u.usePolling&&!u.useFsEvents),u.atomic&&(this._pendingUnlinks=new Map),q(u,"followSymlinks")&&(u.followSymlinks=!0),q(u,"awaitWriteFinish")&&(u.awaitWriteFinish=!1),u.awaitWriteFinish===!0&&(u.awaitWriteFinish={});const i=u.awaitWriteFinish;i&&(i.stabilityThreshold||(i.stabilityThreshold=2e3),i.pollInterval||(i.pollInterval=100),this._pendingWrites=new Map),u.ignored&&(u.ignored=Au(u.ignored));let o=0;this._emitReady=()=>{o++,o>=this._readyCount&&(this._emitReady=nl,this._readyEmitted=!0,process.nextTick(()=>this.emit(ja)))},this._emitRaw=(...D)=>this.emit(Va,...D),this._readyEmitted=!1,this.options=u,u.useFsEvents?this._fsEventsHandler=new hn(this):this._nodeFsHandler=new Wa(this),Object.freeze(u)}add(e,u,s){const{cwd:n,disableGlobbing:r}=this.options;this.closed=!1;let i=Fn(e);return n&&(i=i.map(o=>{const D=ll(o,n);return r||!hu(o)?D:Ga(D)})),i=i.filter(o=>o.startsWith(Cu)?(this._ignoredPaths.add(o.slice(1)),!1):(this._ignoredPaths.delete(o),this._ignoredPaths.delete(o+Fu),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=i.length),this.options.persistent&&(this._readyCount+=i.length),i.forEach(o=>this._fsEventsHandler._addToFsEvents(o))):(this._readyCount||(this._readyCount=0),this._readyCount+=i.length,Promise.all(i.map(async o=>{const D=await this._nodeFsHandler._addToNodeFs(o,!s,0,0,u);return D&&this._emitReady(),D})).then(o=>{this.closed||o.filter(D=>D).forEach(D=>{this.add(v.dirname(D),v.basename(u||D))})})),this}unwatch(e){if(this.closed)return this;const u=Fn(e),{cwd:s}=this.options;return u.forEach(n=>{!v.isAbsolute(n)&&!this._closers.has(n)&&(s&&(n=v.join(s,n)),n=v.resolve(n)),this._closePath(n),this._ignoredPaths.add(n),this._watched.has(n)&&this._ignoredPaths.add(n+Fu),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();const e=[];return this._closers.forEach(u=>u.forEach(s=>{const n=s();n instanceof Promise&&e.push(n)})),this._streams.forEach(u=>u.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(u=>u.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(u=>{this[`_${u}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){const e={};return this._watched.forEach((u,s)=>{const n=this.options.cwd?v.relative(this.options.cwd,s):s;e[n||pn]=u.getChildren().sort()}),e}emitWithAll(e,u){this.emit(...u),e!==Eu&&this.emit(du,...u)}async _emit(e,u,s,n,r){if(this.closed)return;const i=this.options;rl&&(u=v.normalize(u)),i.cwd&&(u=v.relative(i.cwd,u));const o=[e,u];r!==void 0?o.push(s,n,r):n!==void 0?o.push(s,n):s!==void 0&&o.push(s);const D=i.awaitWriteFinish;let l;if(D&&(l=this._pendingWrites.get(u)))return l.lastChange=new Date,this;if(i.atomic){if(e===dn)return this._pendingUnlinks.set(u,o),setTimeout(()=>{this._pendingUnlinks.forEach((c,f)=>{this.emit(...c),this.emit(du,...c),this._pendingUnlinks.delete(f)})},typeof i.atomic=="number"?i.atomic:100),this;e===Dt&&this._pendingUnlinks.has(u)&&(e=o[0]=xe,this._pendingUnlinks.delete(u))}if(D&&(e===Dt||e===xe)&&this._readyEmitted){const c=(f,a)=>{f?(e=o[0]=Eu,o[1]=f,this.emitWithAll(e,o)):a&&(o.length>2?o[2]=a:o.push(a),this.emitWithAll(e,o))};return this._awaitWriteFinish(u,D.stabilityThreshold,e,c),this}if(e===xe&&!this._throttle(xe,u,50))return this;if(i.alwaysStat&&s===void 0&&(e===Dt||e===Ua||e===xe)){const c=i.cwd?v.join(i.cwd,u):u;let f;try{f=await Dl(c)}catch{}if(!f||this.closed)return;o.push(f)}return this.emitWithAll(e,o),this}_handleError(e){const u=e&&e.code;return e&&u!=="ENOENT"&&u!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||u!=="EPERM"&&u!=="EACCES")&&this.emit(Eu,e),e||this.closed}_throttle(e,u,s){this._throttled.has(e)||this._throttled.set(e,new Map);const n=this._throttled.get(e),r=n.get(u);if(r)return r.count++,!1;let i;const o=()=>{const l=n.get(u),c=l?l.count:0;return n.delete(u),clearTimeout(i),l&&clearTimeout(l.timeoutObject),c};i=setTimeout(o,s);const D={timeoutObject:i,clear:o,count:0};return n.set(u,D),D}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,u,s,n){let r,i=e;this.options.cwd&&!v.isAbsolute(e)&&(i=v.join(this.options.cwd,e));const o=new Date,D=l=>{cu.stat(i,(c,f)=>{if(c||!this._pendingWrites.has(e)){c&&c.code!=="ENOENT"&&n(c);return}const a=Number(new Date);l&&f.size!==l.size&&(this._pendingWrites.get(e).lastChange=a);const E=this._pendingWrites.get(e);a-E.lastChange>=u?(this._pendingWrites.delete(e),n(void 0,f)):r=setTimeout(D,this.options.awaitWriteFinish.pollInterval,f)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:o,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(r),s)}),r=setTimeout(D,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,u){if(this.options.atomic&&Qa.test(e))return!0;if(!this._userIgnored){const{cwd:s}=this.options,n=this.options.ignored,r=n&&n.map(_n(s)),i=Au(r).filter(D=>typeof D===mu&&!hu(D)).map(D=>D+Fu),o=this._getGlobIgnored().map(_n(s)).concat(r,i);this._userIgnored=fu(o,void 0,gu)}return this._userIgnored([e,u])}_isntIgnored(e,u){return!this._isIgnored(e,u)}_getWatchHelpers(e,u){const s=u||this.options.disableGlobbing||!hu(e)?e:ka(e),n=this.options.followSymlinks;return new dl(e,s,n,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));const u=v.resolve(e);return this._watched.has(u)||this._watched.set(u,new cl(u,this._boundRemove)),this._watched.get(u)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;const s=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(s.toString(8)[0],10))}_remove(e,u,s){const n=v.join(e,u),r=v.resolve(n);if(s=s??(this._watched.has(n)||this._watched.has(r)),!this._throttle("remove",n,100))return;!s&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,u,!0),this._getWatchedDir(n).getChildren().forEach(a=>this._remove(n,a));const D=this._getWatchedDir(e),l=D.has(u);D.remove(u),this._symlinkPaths.has(r)&&this._symlinkPaths.delete(r);let c=n;if(this.options.cwd&&(c=v.relative(this.options.cwd,n)),this.options.awaitWriteFinish&&this._pendingWrites.has(c)&&this._pendingWrites.get(c).cancelWait()===Dt)return;this._watched.delete(n),this._watched.delete(r);const f=s?Ka:dn;l&&!this._isIgnored(n)&&this._emit(f,n),this.options.useFsEvents||this._closePath(n)}_closePath(e){this._closeFile(e);const u=v.dirname(e);this._getWatchedDir(u).remove(v.basename(e))}_closeFile(e){const u=this._closers.get(e);u&&(u.forEach(s=>s()),this._closers.delete(e))}_addPathCloser(e,u){if(!u)return;let s=this._closers.get(e);s||(s=[],this._closers.set(e,s)),s.push(u)}_readdirp(e,u){if(this.closed)return;const s={type:du,alwaysStat:!0,lstat:!0,...u};let n=Pa(e,s);return this._streams.add(n),n.once(za,()=>{n=void 0}),n.once(Ya,()=>{n&&(this._streams.delete(n),n=void 0)}),n}}const pl=(t,e)=>{const u=new El(e);return u.add(t),u};var Cl=pl;let ce=!0;const ge=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let Oe=0;if(ge.process&&ge.process.env&&ge.process.stdout){const{FORCE_COLOR:t,NODE_DISABLE_COLORS:e,NO_COLOR:u,TERM:s,COLORTERM:n}=ge.process.env;e||u||t==="0"?ce=!1:t==="1"||t==="2"||t==="3"?ce=!0:s==="dumb"?ce=!1:"CI"in ge.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(r=>r in ge.process.env)?ce=!0:ce=process.stdout.isTTY,ce&&(process.platform==="win32"||n&&(n==="truecolor"||n==="24bit")?Oe=3:s&&(s.endsWith("-256color")||s.endsWith("256"))?Oe=2:Oe=1)}let An={enabled:ce,supportLevel:Oe};function Ne(t,e,u=1){const s=`\x1B[${t}m`,n=`\x1B[${e}m`,r=new RegExp(`\\x1b\\[${e}m`,"g");return i=>An.enabled&&An.supportLevel>=u?s+(""+i).replace(r,s)+n:""+i}const He=Ne(33,39),Fl=Ne(90,39),gl=Ne(92,39),ml=Ne(95,39),_l=Ne(96,39),at=(t=!0)=>{let e=!1;return u=>{if(e||u==="unknown-flag")return!0;if(u==="argument")return e=!0,t}},yn=(t,e=process.argv.slice(2))=>(bu(t,e,{ignore:at()}),e),Al=t=>{let e=Buffer.alloc(0);return u=>{for(e=Buffer.concat([e,u]);e.length>4;){const s=e.readInt32BE(0);if(e.length>=4+s){const n=e.slice(4,4+s);t(n),e=e.slice(4+s)}else break}}},wn=async()=>{const t=Mn.createServer(u=>{u.on("data",Al(s=>{const n=JSON.parse(s.toString());t.emit("data",n)}))}),e=Wn(process.pid);return await dt.promises.mkdir(Gn,{recursive:!0}),await dt.promises.rm(e,{force:!0}),await new Promise((u,s)=>{t.listen(e,u),t.on("error",s)}),t.unref(),process.on("exit",()=>{if(t.close(),!jn)try{dt.rmSync(e)}catch{}}),t},yl=()=>new Date().toLocaleTimeString(),Le=(...t)=>console.log(Fl(yl()),_l("[tsx]"),...t),wl="\x1Bc",Rl=(t,e)=>{let u;return function(){u&&clearTimeout(u),u=setTimeout(()=>Reflect.apply(t,this,arguments),e)}},Rn={noCache:{type:Boolean,description:"Disable caching",default:!1},tsconfig:{type:String,description:"Custom tsconfig.json path"},clearScreen:{type:Boolean,description:"Clearing the screen on rerun",default:!0},ignore:{type:[String],description:"Paths & globs to exclude from being watched"}},bl=oi({name:"watch",parameters:["