tsx 4.7.0 → 4.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.mjs +1 -1
- package/dist/cli.cjs +4 -4
- package/dist/cli.mjs +4 -4
- package/dist/esm/index.cjs +3 -3
- package/dist/esm/index.mjs +2 -2
- package/dist/{index-bd1ceb03.mjs → index-29948669.mjs} +1 -1
- package/dist/{index-5d1f01e6.cjs → index-971a6964.cjs} +11 -11
- package/dist/loader.cjs +1 -1
- package/dist/loader.mjs +1 -1
- package/dist/package-68fc26ee.mjs +1 -0
- package/dist/package-afa28eaf.cjs +1 -0
- package/dist/repl.cjs +1 -1
- package/dist/repl.mjs +1 -1
- package/package.json +3 -3
- package/dist/package-22dbf202.cjs +0 -1
- package/dist/package-a2d7442c.mjs +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import Au,{constants as ft}from"os";import Bn from"tty";import{transformSync as Sn}from"esbuild";import{v as $n}from"./package-a2d7442c.mjs";import{r as ht}from"./pkgroll_create-require-b92e8e0d.mjs";import{pathToFileURL as Tn,fileURLToPath as xn}from"url";import On from"child_process";import K from"path";import te from"fs";import{i as yu,m as Nn,t as Hn}from"./node-features-fb266590.mjs";import Ln from"events";import me from"util";import In from"stream";import Pn from"net";import{t as kn}from"./temporary-directory-04b36185.mjs";import{g as Mn}from"./get-pipe-path-b74d9893.mjs";import"module";const Wn="known-flag",Gn="unknown-flag",jn="argument",{stringify:_e}=JSON,Un=/\B([A-Z])/g,Kn=t=>t.replace(Un,"-$1").toLowerCase(),{hasOwnProperty:Vn}=Object.prototype,Ae=(t,e)=>Vn.call(t,e),zn=t=>Array.isArray(t),wu=t=>typeof t=="function"?[t,!1]:zn(t)?[t[0],!0]:wu(t.type),Yn=(t,e)=>t===Boolean?e!=="false":e,qn=(t,e)=>typeof e=="boolean"?e:t===Number&&e===""?Number.NaN:t(e),Xn=/[\s.:=]/,Qn=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(Xn);if(u)throw new Error(`${e} cannot contain ${_e(u==null?void 0:u[0])}`)},Zn=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;Qn(s);const n=t[s],r=[[],...wu(n),n];u(s,r);const i=Kn(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},Jn=(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},We="--",er=/[.:=]/,tr=/^-{1,2}\w/,ur=t=>{if(!tr.test(t))return;const e=!t.startsWith(We);let u=t.slice(e?1:2),s;const n=u.match(er);if(n){const{index:r}=n;s=u.slice(r+1),u=u.slice(0,r)}return[u,s,e]},sr=(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<t.length;r+=1){const i=t[r];if(i===We){n();const D=t.slice(r+1);u==null||u(D,[r],!0);break}const o=ur(i);if(o){if(n(),!e)continue;const[D,a,c]=o;if(c)for(let f=0;f<D.length;f+=1){n();const l=f===D.length-1;s=e(D[f],l?a:void 0,[r,f+1,l])}else s=e(D,a,[r])}else n(i,[r])&&(u==null||u([i],[r]))}n()},nr=(t,e)=>{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)}},Ru=(t,e=process.argv.slice(2),{ignore:u}={})=>{const s=[],n=Zn(t),r={},i=[];return i[We]=[],sr(e,{onFlag(o,D,a){const c=Ae(n,o);if(!(u!=null&&u(c?Wn:Gn,o,D))){if(c){const[f,l]=n[o],E=Yn(l,D),p=(F,A)=>{s.push(a),A&&s.push(A),f.push(qn(l,F||""))};return E===void 0?p:p(E)}Ae(r,o)||(r[o]=[]),r[o].push(D===void 0?!0:D),s.push(a)}},onArgument(o,D,a){u!=null&&u(jn,e[D[0]])||(i.push(...o),a?(i[We]=o,e.splice(D[0])):s.push(D))}}),nr(e,s),{flags:Jn(t,n),unknownFlags:r,_:i}};var rr=Object.create,Ge=Object.defineProperty,ir=Object.defineProperties,or=Object.getOwnPropertyDescriptor,Dr=Object.getOwnPropertyDescriptors,ar=Object.getOwnPropertyNames,bu=Object.getOwnPropertySymbols,lr=Object.getPrototypeOf,vu=Object.prototype.hasOwnProperty,cr=Object.prototype.propertyIsEnumerable,Bu=(t,e,u)=>e in t?Ge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):t[e]=u,je=(t,e)=>{for(var u in e||(e={}))vu.call(e,u)&&Bu(t,u,e[u]);if(bu)for(var u of bu(e))cr.call(e,u)&&Bu(t,u,e[u]);return t},dt=(t,e)=>ir(t,Dr(e)),fr=t=>Ge(t,"__esModule",{value:!0}),hr=(t,e)=>()=>(t&&(e=t(t=0)),e),dr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Er=(t,e,u,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ar(e))!vu.call(t,n)&&(u||n!=="default")&&Ge(t,n,{get:()=>e[n],enumerable:!(s=or(e,n))||s.enumerable});return t},pr=(t,e)=>Er(fr(Ge(t!=null?rr(lr(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),U=hr(()=>{}),Cr=dr((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 Fr=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 gr({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 Su(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(gr(),"")}U();function mr(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 _r=pr(Cr(),1);function oe(t){if(typeof t!="string"||t.length===0||(t=Su(t),t.length===0))return 0;t=t.replace((0,_r.default)()," ");let e=0;for(let u=0;u<t.length;u++){let s=t.codePointAt(u);s<=31||s>=127&&s<=159||s>=768&&s<=879||(s>65535&&u++,e+=mr(s)?2:1)}return e}var $u=t=>Math.max(...t.split(`
|
|
2
|
+
import Au,{constants as ft}from"os";import Bn from"tty";import{transformSync as Sn}from"esbuild";import{v as $n}from"./package-68fc26ee.mjs";import{r as ht}from"./pkgroll_create-require-b92e8e0d.mjs";import{pathToFileURL as Tn,fileURLToPath as xn}from"url";import On from"child_process";import K from"path";import J from"fs";import{i as yu,m as Nn,t as Hn}from"./node-features-fb266590.mjs";import Ln from"events";import me from"util";import In from"stream";import Pn from"net";import{t as kn}from"./temporary-directory-04b36185.mjs";import{g as Mn}from"./get-pipe-path-b74d9893.mjs";import"module";const Wn="known-flag",Gn="unknown-flag",jn="argument",{stringify:_e}=JSON,Un=/\B([A-Z])/g,Kn=t=>t.replace(Un,"-$1").toLowerCase(),{hasOwnProperty:Vn}=Object.prototype,Ae=(t,e)=>Vn.call(t,e),zn=t=>Array.isArray(t),wu=t=>typeof t=="function"?[t,!1]:zn(t)?[t[0],!0]:wu(t.type),Yn=(t,e)=>t===Boolean?e!=="false":e,qn=(t,e)=>typeof e=="boolean"?e:t===Number&&e===""?Number.NaN:t(e),Xn=/[\s.:=]/,Qn=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(Xn);if(u)throw new Error(`${e} cannot contain ${_e(u==null?void 0:u[0])}`)},Zn=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;Qn(s);const n=t[s],r=[[],...wu(n),n];u(s,r);const i=Kn(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},Jn=(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},We="--",er=/[.:=]/,tr=/^-{1,2}\w/,ur=t=>{if(!tr.test(t))return;const e=!t.startsWith(We);let u=t.slice(e?1:2),s;const n=u.match(er);if(n){const{index:r}=n;s=u.slice(r+1),u=u.slice(0,r)}return[u,s,e]},sr=(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<t.length;r+=1){const i=t[r];if(i===We){n();const D=t.slice(r+1);u==null||u(D,[r],!0);break}const o=ur(i);if(o){if(n(),!e)continue;const[D,a,c]=o;if(c)for(let f=0;f<D.length;f+=1){n();const l=f===D.length-1;s=e(D[f],l?a:void 0,[r,f+1,l])}else s=e(D,a,[r])}else n(i,[r])&&(u==null||u([i],[r]))}n()},nr=(t,e)=>{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)}},Ru=(t,e=process.argv.slice(2),{ignore:u}={})=>{const s=[],n=Zn(t),r={},i=[];return i[We]=[],sr(e,{onFlag(o,D,a){const c=Ae(n,o);if(!(u!=null&&u(c?Wn:Gn,o,D))){if(c){const[f,l]=n[o],E=Yn(l,D),p=(F,A)=>{s.push(a),A&&s.push(A),f.push(qn(l,F||""))};return E===void 0?p:p(E)}Ae(r,o)||(r[o]=[]),r[o].push(D===void 0?!0:D),s.push(a)}},onArgument(o,D,a){u!=null&&u(jn,e[D[0]])||(i.push(...o),a?(i[We]=o,e.splice(D[0])):s.push(D))}}),nr(e,s),{flags:Jn(t,n),unknownFlags:r,_:i}};var rr=Object.create,Ge=Object.defineProperty,ir=Object.defineProperties,or=Object.getOwnPropertyDescriptor,Dr=Object.getOwnPropertyDescriptors,ar=Object.getOwnPropertyNames,bu=Object.getOwnPropertySymbols,lr=Object.getPrototypeOf,vu=Object.prototype.hasOwnProperty,cr=Object.prototype.propertyIsEnumerable,Bu=(t,e,u)=>e in t?Ge(t,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):t[e]=u,je=(t,e)=>{for(var u in e||(e={}))vu.call(e,u)&&Bu(t,u,e[u]);if(bu)for(var u of bu(e))cr.call(e,u)&&Bu(t,u,e[u]);return t},dt=(t,e)=>ir(t,Dr(e)),fr=t=>Ge(t,"__esModule",{value:!0}),hr=(t,e)=>()=>(t&&(e=t(t=0)),e),dr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Er=(t,e,u,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ar(e))!vu.call(t,n)&&(u||n!=="default")&&Ge(t,n,{get:()=>e[n],enumerable:!(s=or(e,n))||s.enumerable});return t},pr=(t,e)=>Er(fr(Ge(t!=null?rr(lr(t)):{},"default",!e&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),U=hr(()=>{}),Cr=dr((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 Fr=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 gr({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 Su(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(gr(),"")}U();function mr(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 _r=pr(Cr(),1);function oe(t){if(typeof t!="string"||t.length===0||(t=Su(t),t.length===0))return 0;t=t.replace((0,_r.default)()," ");let e=0;for(let u=0;u<t.length;u++){let s=t.codePointAt(u);s<=31||s>=127&&s<=159||s>=768&&s<=879||(s>65535&&u++,e+=mr(s)?2:1)}return e}var $u=t=>Math.max(...t.split(`
|
|
3
3
|
`).map(oe)),Ar=t=>{let e=[];for(let u of t){let{length:s}=u,n=s-e.length;for(let r=0;r<n;r+=1)e.push(0);for(let r=0;r<s;r+=1){let i=$u(u[r]);i>e[r]&&(e[r]=i)}}return e};U();var Tu=/^\d+%$/,xu={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},yr=(t,e)=>{var u;let s=[];for(let n=0;n<t.length;n+=1){let r=(u=e[n])!=null?u:"auto";if(typeof r=="number"||r==="auto"||r==="content-width"||typeof r=="string"&&Tu.test(r)){s.push(dt(je({},xu),{width:r,contentWidth:t[n]}));continue}if(r&&typeof r=="object"){let i=dt(je(je({},xu),r),{contentWidth:t[n]});i.horizontalPadding=i.paddingLeft+i.paddingRight,s.push(i);continue}throw new Error(`Invalid column width: ${JSON.stringify(r)}`)}return s};function wr(t,e){for(let u of t){let{width:s}=u;if(s==="content-width"&&(u.width=u.contentWidth),s==="auto"){let D=Math.min(20,u.contentWidth);u.width=D,u.autoOverflow=u.contentWidth-D}if(typeof s=="string"&&Tu.test(s)){let D=Number.parseFloat(s.slice(0,-1))/100;u.width=Math.floor(e*D)-(u.paddingLeft+u.paddingRight)}let{horizontalPadding:n}=u,r=1,i=r+n;if(i>=e){let D=i-e,a=Math.ceil(u.paddingLeft/n*D),c=D-a;u.paddingLeft-=a,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 Ou=()=>Object.assign([],{columns:0});function Rr(t,e){let u=[Ou()],[s]=u;for(let n of t){let r=n.width+n.horizontalPadding;s.columns+r>e&&(s=Ou(),u.push(s)),s.push(n),s.columns+=r}for(let n of u){let r=n.reduce((l,E)=>l+E.width+E.horizontalPadding,0),i=e-r;if(i===0)continue;let o=n.filter(l=>"autoOverflow"in l),D=o.filter(l=>l.autoOverflow>0),a=D.reduce((l,E)=>l+E.autoOverflow,0),c=Math.min(a,i);for(let l of D){let E=Math.floor(l.autoOverflow/a*c);l.width+=E,i-=E}let f=Math.floor(i/o.length);for(let l=0;l<o.length;l+=1){let E=o[l];l===o.length-1?E.width+=i:E.width+=f,i-=f}}return u}function br(t,e,u){let s=yr(u,e);return wr(s,t),Rr(s,t)}U(),U(),U();var Et=10,Nu=(t=0)=>e=>`\x1B[${e+t}m`,Hu=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Lu=(t=0)=>(e,u,s)=>`\x1B[${38+t};2;${e};${u};${s}m`;function vr(){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=Nu(),e.color.ansi256=Hu(),e.color.ansi16m=Lu(),e.bgColor.ansi=Nu(Et),e.bgColor.ansi256=Hu(Et),e.bgColor.ansi16m=Lu(Et),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=/(?<colorString>[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 Br=vr(),Sr=Br,Ue=new Set(["\x1B","\x9B"]),$r=39,pt="\x07",Iu="[",Tr="]",Pu="m",Ct=`${Tr}8;;`,ku=t=>`${Ue.values().next().value}${Iu}${t}${Pu}`,Mu=t=>`${Ue.values().next().value}${Ct}${t}${pt}`,xr=t=>t.split(" ").map(e=>oe(e)),Ft=(t,e,u)=>{let s=[...e],n=!1,r=!1,i=oe(Su(t[t.length-1]));for(let[o,D]of s.entries()){let a=oe(D);if(i+a<=u?t[t.length-1]+=D:(t.push(D),i=0),Ue.has(D)&&(n=!0,r=s.slice(o+1).join("").startsWith(Ct)),n){r?D===pt&&(n=!1,r=!1):D===Pu&&(n=!1);continue}i+=a,i===u&&o<s.length-1&&(t.push(""),i=0)}!i&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},Or=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("")},Nr=(t,e,u={})=>{if(u.trim!==!1&&t.trim()==="")return"";let s="",n,r,i=xr(t),o=[""];for(let[a,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(a!==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[a]>e){let l=e-f,E=1+Math.floor((i[a]-l-1)/e);Math.floor((i[a]-1)/e)<E&&o.push(""),Ft(o,c,e);continue}if(f+i[a]>e&&f>0&&i[a]>0){if(u.wordWrap===!1&&f<e){Ft(o,c,e);continue}o.push("")}if(f+i[a]>e&&u.wordWrap===!1){Ft(o,c,e);continue}o[o.length-1]+=c}u.trim!==!1&&(o=o.map(a=>Or(a)));let D=[...o.join(`
|
|
4
4
|
`)];for(let[a,c]of D.entries()){if(s+=c,Ue.has(c)){let{groups:l}=new RegExp(`(?:\\${Iu}(?<code>\\d+)m|\\${Ct}(?<uri>.*)${pt})`).exec(D.slice(a).join(""))||{groups:{}};if(l.code!==void 0){let E=Number.parseFloat(l.code);n=E===$r?void 0:E}else l.uri!==void 0&&(r=l.uri.length===0?void 0:l.uri)}let f=Sr.codes.get(Number(n));D[a+1]===`
|
|
5
5
|
`?(r&&(s+=Mu("")),n&&f&&(s+=ku(f))):c===`
|
|
@@ -18,8 +18,8 @@ import Au,{constants as ft}from"os";import Bn from"tty";import{transformSync as
|
|
|
18
18
|
`)),u)return{id:"examples",type:"section",data:{title:"Examples:",body:u}}}function Qr(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 Zr=t=>[Kr,Vr,zr,Yr,qr,Xr,Qr].map(e=>e(t)).filter(Boolean),Jr=Bn.WriteStream.prototype.hasColors();class ei{text(e){return e}bold(e){return Jr?`\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)}
|
|
19
19
|
`:"")+(u?this.indentText({text:this.render(u),spaces:s}):"")}
|
|
20
20
|
`}table({tableData:e,tableOptions:u,tableBreakpoints:s}){return Ir(e.map(n=>n.map(r=>this.render(r))),s?Mr(s):u)}flagParameter(e){return e===Boolean?"":e===String?"<string>":e===Number?"<number>":Array.isArray(e)?this.flagParameter(e[0]):"<value>"}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}){var s;let u="description"in e&&(s=e.description)!=null?s:"";if("default"in e){let{default:n}=e;typeof n=="function"&&(n=n()),n&&(u+=` (default: ${this.flagDefault(n)})`)}return u}render(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(u=>this.render(u)).join(`
|
|
21
|
-
`);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 gt=/^[\w.-]+$/,{stringify:
|
|
22
|
-
`),s(),process.exit(1);t[D]=a}}function ui(t){return t===void 0||t!==!1}function Uu(t,e,u,s){const n={...e.flags},r=e.version;r&&(n.version={type:Boolean,description:"Show version"});const{help:i}=e,o=ui(i);o&&!("help"in n)&&(n.help={type:Boolean,alias:"h",description:"Show help"});const D=Ru(n,s,{ignore:e.ignoreArgv}),a=()=>{console.log(e.version)};if(r&&D.flags.version===!0)return a(),process.exit(0);const c=new ei,f=o&&(i!=null&&i.render)?i.render:p=>c.render(p),l=p=>{const F=Zr({...e,...p?{help:p}:{},flags:n});console.log(f(F,c))};if(o&&D.flags.help===!0)return l(),process.exit(0);if(e.parameters){let{parameters:p}=e,F=D._;const A=p.indexOf("--"),B=p.slice(A+1),N=Object.create(null);if(A>-1&&B.length>0){p=p.slice(0,A);const S=D._["--"];F=F.slice(0,-S.length||void 0),_t(N,mt(p),F,l),_t(N,mt(B),S,l)}else _t(N,mt(p),F,l);Object.assign(D._,N)}const E={...D,showVersion:a,showHelp:l};return typeof u=="function"&&u(E),{command:t,...E}}function si(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 Ku(t,e,u=process.argv.slice(2)){if(!t)throw new Error("Options is required");if("name"in t&&(!t.name||!gt.test(t.name)))throw new Error(`Invalid script name: ${J(t.name)}`);const s=u[0];if(t.commands&>.test(s)){const n=si(s,t.commands);if(n)return Uu(n.options.name,{...n.options,parent:t},n.callback,u.slice(1))}return Uu(void 0,t,e,u)}function ni(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(!gt.test(u))throw new Error(`Invalid command name ${JSON.stringify(u)}. Command names must be one word.`);return{options:t,callback:e}}var ri=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ii(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fe={exports:{}},At,Vu;function oi(){if(Vu)return At;Vu=1,At=s,s.sync=n;var t=te;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;D<o.length;D++){var a=o[D].toLowerCase();if(a&&r.substr(-a.length).toLowerCase()===a)return!0}return!1}function u(r,i,o){return!r.isSymbolicLink()&&!r.isFile()?!1:e(i,o)}function s(r,i,o){t.stat(r,function(D,a){o(D,D?!1:u(a,r,i))})}function n(r,i){return u(t.statSync(r),r,i)}return At}var yt,zu;function Di(){if(zu)return yt;zu=1,yt=e,e.sync=u;var t=te;function e(r,i,o){t.stat(r,function(D,a){o(D,D?!1:s(a,i))})}function u(r,i){return s(t.statSync(r),i)}function s(r,i){return r.isFile()&&n(r,i)}function n(r,i){var o=r.mode,D=r.uid,a=r.gid,c=i.uid!==void 0?i.uid:process.getuid&&process.getuid(),f=i.gid!==void 0?i.gid:process.getgid&&process.getgid(),l=parseInt("100",8),E=parseInt("010",8),p=parseInt("001",8),F=l|E,A=o&p||o&E&&a===f||o&l&&D===c||o&F&&c===0;return A}return yt}var Ke;process.platform==="win32"||ri.TESTING_WINDOWS?Ke=oi():Ke=Di();var ai=wt;wt.sync=li;function wt(t,e,u){if(typeof e=="function"&&(u=e,e={}),!u){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(s,n){wt(t,e||{},function(r,i){r?n(r):s(i)})})}Ke(t,e||{},function(s,n){s&&(s.code==="EACCES"||e&&e.ignoreErrors)&&(s=null,n=!1),u(s,n)})}function li(t,e){try{return Ke.sync(t,e||{})}catch(u){if(e&&e.ignoreErrors||u.code==="EACCES")return!1;throw u}}const he=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Yu=K,ci=he?";":":",qu=ai,Xu=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),Qu=(t,e)=>{const u=e.colon||ci,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}},Zu=(t,e,u)=>{typeof e=="function"&&(u=e,e={}),e||(e={});const{pathEnv:s,pathExt:n,pathExtExe:r}=Qu(t,e),i=[],o=a=>new Promise((c,f)=>{if(a===s.length)return e.all&&i.length?c(i):f(Xu(t));const l=s[a],E=/^".*"$/.test(l)?l.slice(1,-1):l,p=Yu.join(E,t),F=!E&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;c(D(F,a,0))}),D=(a,c,f)=>new Promise((l,E)=>{if(f===n.length)return l(o(c+1));const p=n[f];qu(a+p,{pathExt:r},(F,A)=>{if(!F&&A)if(e.all)i.push(a+p);else return l(a+p);return l(D(a,c,f+1))})});return u?o(0).then(a=>u(null,a),u):o(0)},fi=(t,e)=>{e=e||{};const{pathEnv:u,pathExt:s,pathExtExe:n}=Qu(t,e),r=[];for(let i=0;i<u.length;i++){const o=u[i],D=/^".*"$/.test(o)?o.slice(1,-1):o,a=Yu.join(D,t),c=!D&&/^\.[\\\/]/.test(t)?t.slice(0,2)+a:a;for(let f=0;f<s.length;f++){const l=c+s[f];try{if(qu.sync(l,{pathExt:n}))if(e.all)r.push(l);else return l}catch{}}}if(e.all&&r.length)return r;if(e.nothrow)return null;throw Xu(t)};var hi=Zu;Zu.sync=fi;var Rt={exports:{}};const Ju=(t={})=>{const e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(s=>s.toUpperCase()==="PATH")||"Path"};Rt.exports=Ju,Rt.exports.default=Ju;var di=Rt.exports;const es=K,Ei=hi,pi=di;function ts(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=Ei.sync(t.command,{path:u[pi({env:u})],pathExt:e?es.delimiter:void 0})}catch{}finally{r&&process.chdir(s)}return i&&(i=es.resolve(n?t.options.cwd:"",i)),i}function Ci(t){return ts(t)||ts(t,!0)}var Fi=Ci,bt={};const vt=/([()\][%!^"`<>&|;, *?])/g;function gi(t){return t=t.replace(vt,"^$1"),t}function mi(t,e){return t=`${t}`,t=t.replace(/(\\*)"/g,'$1$1\\"'),t=t.replace(/(\\*)$/,"$1$1"),t=`"${t}"`,t=t.replace(vt,"^$1"),e&&(t=t.replace(vt,"^$1")),t}bt.command=gi,bt.argument=mi;var _i=/^#!(.*)/;const Ai=_i;var yi=(t="")=>{const e=t.match(Ai);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=te,wi=yi;function Ri(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 wi(u.toString())}var bi=Ri;const vi=K,us=Fi,ss=bt,Bi=bi,Si=process.platform==="win32",$i=/\.(?:com|exe)$/i,Ti=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function xi(t){t.file=us(t);const e=t.file&&Bi(t.file);return e?(t.args.unshift(t.file),t.command=e,us(t)):t.file}function Oi(t){if(!Si)return t;const e=xi(t),u=!$i.test(e);if(t.options.forceShell||u){const s=Ti.test(e);t.command=vi.normalize(t.command),t.command=ss.command(t.command),t.args=t.args.map(r=>ss.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 Ni(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:Oi(s)}var Hi=Ni;const St=process.platform==="win32";function $t(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 Li(t,e){if(!St)return;const u=t.emit;t.emit=function(s,n){if(s==="exit"){const r=ns(n,e);if(r)return u.call(t,"error",r)}return u.apply(t,arguments)}}function ns(t,e){return St&&t===1&&!e.file?$t(e.original,"spawn"):null}function Ii(t,e){return St&&t===1&&!e.file?$t(e.original,"spawnSync"):null}var Pi={hookChildProcess:Li,verifyENOENT:ns,verifyENOENTSync:Ii,notFoundError:$t};const rs=On,Tt=Hi,xt=Pi;function is(t,e,u){const s=Tt(t,e,u),n=rs.spawn(s.command,s.args,s.options);return xt.hookChildProcess(n,s),n}function ki(t,e,u){const s=Tt(t,e,u),n=rs.spawnSync(s.command,s.args,s.options);return n.error=n.error||xt.verifyENOENTSync(n.status,s),n}fe.exports=is,fe.exports.spawn=is,fe.exports.sync=ki,fe.exports._parse=Tt,fe.exports._enoent=xt;var Mi=fe.exports,Wi=ii(Mi);const os=(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)),Wi(process.execPath,["--require",ht.resolve("./preflight.cjs"),yu(Nn)?"--import":"--loader",Tn(ht.resolve("./loader.mjs")).toString(),...t],{stdio:s,env:u})};var Ve={};const Gi=K,ee="\\\\/",Ds=`[^${ee}]`,ue="\\.",ji="\\+",Ui="\\?",ze="\\/",Ki="(?=.)",as="[^/]",Ot=`(?:${ze}|$)`,ls=`(?:^|${ze})`,Nt=`${ue}{1,2}${Ot}`,Vi=`(?!${ue})`,zi=`(?!${ls}${Nt})`,Yi=`(?!${ue}{0,1}${Ot})`,qi=`(?!${Nt})`,Xi=`[^.${ze}]`,Qi=`${as}*?`,cs={DOT_LITERAL:ue,PLUS_LITERAL:ji,QMARK_LITERAL:Ui,SLASH_LITERAL:ze,ONE_CHAR:Ki,QMARK:as,END_ANCHOR:Ot,DOTS_SLASH:Nt,NO_DOT:Vi,NO_DOTS:zi,NO_DOT_SLASH:Yi,NO_DOTS_SLASH:qi,QMARK_NO_DOT:Xi,STAR:Qi,START_ANCHOR:ls},Zi={...cs,SLASH_LITERAL:`[${ee}]`,QMARK:Ds,STAR:`${Ds}*?`,DOTS_SLASH:`${ue}{1,2}(?:[${ee}]|$)`,NO_DOT:`(?!${ue})`,NO_DOTS:`(?!(?:^|[${ee}])${ue}{1,2}(?:[${ee}]|$))`,NO_DOT_SLASH:`(?!${ue}{0,1}(?:[${ee}]|$))`,NO_DOTS_SLASH:`(?!${ue}{1,2}(?:[${ee}]|$))`,QMARK_NO_DOT:`[^.${ee}]`,START_ANCHOR:`(?:^|[${ee}])`,END_ANCHOR:`(?:[${ee}]|$)`},Ji={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:Ji,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:Gi.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?Zi:cs}};(function(t){const e=K,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,a)=>{const c=o.lastIndexOf(D,a);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 a=o;return a.startsWith("./")&&(a=a.slice(2),D.prefix="./"),a},t.wrapOutput=(o,D={},a={})=>{const c=a.contains?"":"^",f=a.contains?"":"$";let l=`${c}(?:${o})${f}`;return D.negated===!0&&(l=`(?:^(?!${l}).*$)`),l}})(Ve);const fs=Ve,{CHAR_ASTERISK:Ht,CHAR_AT:eo,CHAR_BACKWARD_SLASH:ye,CHAR_COMMA:to,CHAR_DOT:Lt,CHAR_EXCLAMATION_MARK:It,CHAR_FORWARD_SLASH:hs,CHAR_LEFT_CURLY_BRACE:Pt,CHAR_LEFT_PARENTHESES:kt,CHAR_LEFT_SQUARE_BRACKET:uo,CHAR_PLUS:so,CHAR_QUESTION_MARK:ds,CHAR_RIGHT_CURLY_BRACE:no,CHAR_RIGHT_PARENTHESES:Es,CHAR_RIGHT_SQUARE_BRACKET:ro}=Ye,ps=t=>t===hs||t===ye,Cs=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},io=(t,e)=>{const u=e||{},s=t.length-1,n=u.parts===!0||u.scanToEnd===!0,r=[],i=[],o=[];let D=t,a=-1,c=0,f=0,l=!1,E=!1,p=!1,F=!1,A=!1,B=!1,N=!1,S=!1,X=!1,M=!1,ne=0,W,_,b={value:"",depth:0,isGlob:!1};const k=()=>a>=s,C=()=>D.charCodeAt(a+1),x=()=>(W=_,D.charCodeAt(++a));for(;a<s;){_=x();let G;if(_===ye){N=b.backslashes=!0,_=x(),_===Pt&&(B=!0);continue}if(B===!0||_===Pt){for(ne++;k()!==!0&&(_=x());){if(_===ye){N=b.backslashes=!0,x();continue}if(_===Pt){ne++;continue}if(B!==!0&&_===Lt&&(_=x())===Lt){if(l=b.isBrace=!0,p=b.isGlob=!0,M=!0,n===!0)continue;break}if(B!==!0&&_===to){if(l=b.isBrace=!0,p=b.isGlob=!0,M=!0,n===!0)continue;break}if(_===no&&(ne--,ne===0)){B=!1,l=b.isBrace=!0,M=!0;break}}if(n===!0)continue;break}if(_===hs){if(r.push(a),i.push(b),b={value:"",depth:0,isGlob:!1},M===!0)continue;if(W===Lt&&a===c+1){c+=2;continue}f=a+1;continue}if(u.noext!==!0&&(_===so||_===eo||_===Ht||_===ds||_===It)===!0&&C()===kt){if(p=b.isGlob=!0,F=b.isExtglob=!0,M=!0,_===It&&a===c&&(X=!0),n===!0){for(;k()!==!0&&(_=x());){if(_===ye){N=b.backslashes=!0,_=x();continue}if(_===Es){p=b.isGlob=!0,M=!0;break}}continue}break}if(_===Ht){if(W===Ht&&(A=b.isGlobstar=!0),p=b.isGlob=!0,M=!0,n===!0)continue;break}if(_===ds){if(p=b.isGlob=!0,M=!0,n===!0)continue;break}if(_===uo){for(;k()!==!0&&(G=x());){if(G===ye){N=b.backslashes=!0,x();continue}if(G===ro){E=b.isBracket=!0,p=b.isGlob=!0,M=!0;break}}if(n===!0)continue;break}if(u.nonegate!==!0&&_===It&&a===c){S=b.negated=!0,c++;continue}if(u.noparen!==!0&&_===kt){if(p=b.isGlob=!0,n===!0){for(;k()!==!0&&(_=x());){if(_===kt){N=b.backslashes=!0,_=x();continue}if(_===Es){M=!0;break}}continue}break}if(p===!0){if(M=!0,n===!0)continue;break}}u.noext===!0&&(F=!1,p=!1);let $=D,re="",h="";c>0&&(re=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&&ps($.charCodeAt($.length-1))&&($=$.slice(0,-1)),u.unescape===!0&&(h&&(h=fs.removeBackslashes(h)),$&&N===!0&&($=fs.removeBackslashes($)));const d={prefix:re,input:t,start:c,base:$,glob:h,isBrace:l,isBracket:E,isGlob:p,isExtglob:F,isGlobstar:A,negated:S,negatedExtglob:X};if(u.tokens===!0&&(d.maxDepth=0,ps(_)||i.push(b),d.tokens=i),u.parts===!0||u.tokens===!0){let G;for(let R=0;R<r.length;R++){const Q=G?G+1:c,Z=r[R],V=t.slice(Q,Z);u.tokens&&(R===0&&c!==0?(i[R].isPrefix=!0,i[R].value=re):i[R].value=V,Cs(i[R]),d.maxDepth+=i[R].depth),(R!==0||V!=="")&&o.push(V),G=Z}if(G&&G+1<t.length){const R=t.slice(G+1);o.push(R),u.tokens&&(i[i.length-1].value=R,Cs(i[i.length-1]),d.maxDepth+=i[i.length-1].depth)}d.slashes=r,d.parts=o}return d};var oo=io;const qe=Ye,z=Ve,{MAX_LENGTH:Xe,POSIX_REGEX_SOURCE:Do,REGEX_NON_SPECIAL_CHARS:ao,REGEX_SPECIAL_CHARS_BACKREF:lo,REPLACEMENTS:Fs}=qe,co=(t,e)=>{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`,Mt=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Fs[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),a=qe.globChars(D),c=qe.extglobChars(a),{DOT_LITERAL:f,PLUS_LITERAL:l,SLASH_LITERAL:E,ONE_CHAR:p,DOTS_SLASH:F,NO_DOT:A,NO_DOT_SLASH:B,NO_DOTS_SLASH:N,QMARK:S,QMARK_NO_DOT:X,STAR:M,START_ANCHOR:ne}=a,W=m=>`(${o}(?:(?!${ne}${m.dot?F:f}).)*?)`,_=u.dot?"":A,b=u.dot?S:X;let k=u.bash===!0?W(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=[],$=[],re=[];let h=r,d;const G=()=>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),V=(m="",T=0)=>{C.consumed+=m,C.index+=T},Ie=m=>{C.output+=m.output!=null?m.output:m.value,V(m.value)},bn=()=>{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]++,re.push(m)},ie=m=>{C[m]--,re.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)},vn=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=W(u)),(y!==k||G()||/^\)+$/.test(Z()))&&(T=m.close=`)$))${y}`),m.inner.includes("*")&&(g=Z())&&/^\.[^\\/.]+$/.test(g)){const O=Mt(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}),ie("parens")};if(u.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let m=!1,T=t.replace(lo,(g,y,O,j,L,ct)=>j==="\\"?(m=!0,g):j==="?"?y?y+j+(L?S.repeat(L.length):""):ct===0?b+(L?S.repeat(L.length):""):S.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(;!G();){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=Do[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){vn(x.pop());continue}w({type:"paren",value:d,output:C.parens?")":"\\)"}),ie("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}ie("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=co(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}),ie("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&&re[re.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:S});continue}if(d==="!"){if(u.noextglob!==!0&&R()==="("&&(R(2)!=="?"||!/[!=<:]/.test(R(3)))){ke("negate",d);continue}if(u.nonegate!==!0&&C.index===0){bn();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:l});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:l});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=ao.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,V(d);continue}let m=Z();if(u.noextglob!==!0&&/^\([^?]/.test(m)){ke("star",d);continue}if(h.type==="star"){if(u.noglobstar===!0){V(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),V("/**",3)}if(g.type==="bos"&&G()){h.type="globstar",h.value+=d,h.output=W(u),C.output=h.output,C.globstar=!0,V(d);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&!j&&G()){C.output=C.output.slice(0,-(g.output+h.output).length),g.output=`(?:${g.output}`,h.type="globstar",h.output=W(u)+(u.strictSlashes?")":"|$)"),h.value+=d,C.globstar=!0,C.output+=g.output+h.output,V(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=`${W(u)}${E}|${E}${Me})`,h.value+=d,C.output+=g.output+h.output,C.globstar=!0,V(d+Q()),w({type:"slash",value:"/",output:""});continue}if(g.type==="bos"&&m[0]==="/"){h.type="globstar",h.value+=d,h.output=`(?:^|${E}|${W(u)}${E})`,C.output=h.output,C.globstar=!0,V(d+Q()),w({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-h.output.length),h.type="globstar",h.output=W(u),h.value+=d,C.output+=h.output,C.globstar=!0,V(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+=B,h.output+=B):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,"["),ie("brackets")}for(;C.parens>0;){if(u.strictBrackets===!0)throw new SyntaxError(de("closing",")"));C.output=z.escapeLast(C.output,"("),ie("parens")}for(;C.braces>0;){if(u.strictBrackets===!0)throw new SyntaxError(de("closing","}"));C.output=z.escapeLast(C.output,"{"),ie("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};Mt.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=Fs[t]||t;const r=z.isWindows(e),{DOT_LITERAL:i,SLASH_LITERAL:o,ONE_CHAR:D,DOTS_SLASH:a,NO_DOT:c,NO_DOTS:f,NO_DOTS_SLASH:l,STAR:E,START_ANCHOR:p}=qe.globChars(r),F=u.dot?f:c,A=u.dot?l:c,B=u.capture?"":"?:",N={negated:!1,prefix:""};let S=u.bash===!0?".*?":E;u.capture&&(S=`(${S})`);const X=_=>_.noglobstar===!0?S:`(${B}(?:(?!${p}${_.dot?a:i}).)*?)`,M=_=>{switch(_){case"*":return`${F}${D}${S}`;case".*":return`${i}${D}${S}`;case"*.*":return`${F}${S}${i}${D}${S}`;case"*/*":return`${F}${S}${o}${D}${A}${S}`;case"**":return F+X(u);case"**/*":return`(?:${F}${X(u)}${o})?${A}${D}${S}`;case"**/*.*":return`(?:${F}${X(u)}${o})?${A}${S}${i}${D}${S}`;case"**/.*":return`(?:${F}${X(u)}${o})?${i}${D}${S}`;default:{const b=/^(.*?)\.(\w+)$/.exec(_);if(!b)return;const k=M(b[1]);return k?k+i+b[2]:void 0}}},ne=z.removePrefix(t,N);let W=M(ne);return W&&u.strictSlashes!==!0&&(W+=`${o}?`),W};var fo=Mt;const ho=K,Eo=oo,Wt=fo,Gt=Ve,po=Ye,Co=t=>t&&typeof t=="object"&&!Array.isArray(t),H=(t,e,u=!1)=>{if(Array.isArray(t)){const c=t.map(l=>H(l,e,u));return l=>{for(const E of c){const p=E(l);if(p)return p}return!1}}const s=Co(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=Gt.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 a=(c,f=!1)=>{const{isMatch:l,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:l};return typeof n.onResult=="function"&&n.onResult(F),l===!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&&(a.state=o),a};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?Gt.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=Gt.isWindows(u))=>(e instanceof RegExp?e:H.makeRe(e,u)).test(ho.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)=>Eo(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=po;var Fo=H,gs=Fo;const we=te,{Readable:go}=In,Re=K,{promisify:Qe}=me,jt=gs,mo=Qe(we.readdir),_o=Qe(we.stat),ms=Qe(we.lstat),Ao=Qe(we.realpath),yo="!",_s="READDIRP_RECURSIVE_ERROR",wo=new Set(["ENOENT","EPERM","EACCES","ELOOP",_s]),Ut="files",As="directories",Ze="files_directories",Je="all",ys=[Ut,As,Ze,Je],Ro=t=>wo.has(t.code),[ws,bo]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),vo=process.platform==="win32"&&(ws>10||ws===10&&bo>=5),Rs=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){const e=jt(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)===yo?u.push(jt(n.slice(1))):e.push(jt(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 go{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Ut,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=Rs(u.fileFilter),this._directoryFilter=Rs(u.directoryFilter);const r=u.lstat?ms:_o;vo?this._stat=i=>r(i,{bigint:!0}):this._stat=r,this._maxDepth=u.depth,this._wantsDir=[As,Ze,Je].includes(n),this._wantsFile=[Ut,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 mo(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){Ro(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 Ao(s),r=await ms(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=_s,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&&!ys.includes(u))throw new Error(`readdirp: Invalid type passed. Use one of ${ys.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new lt(e)},Bo=(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=Bo,Ee.ReaddirpStream=lt,Ee.default=Ee;var So=Ee,Kt={exports:{}};/*!
|
|
21
|
+
`);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 gt=/^[\w.-]+$/,{stringify:ee}=JSON,ti=/[|\\{}()[\]^$+*?.]/;function mt(t){const e=[];let u,s;for(const n of t){if(s)throw new Error(`Invalid parameter: Spread parameter ${ee(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 ${ee(n)} cannot come after optional parameter ${ee(u)}`);if(r==="["&&i==="]"&&(o=!1,u=n),o===void 0)throw new Error(`Invalid parameter: ${ee(n)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let D=n.slice(1,-1);const a=D.slice(-3)==="...";a&&(s=n,D=D.slice(0,-3));const c=D.match(ti);if(c)throw new Error(`Invalid parameter: ${ee(n)}. Invalid character found ${ee(c[0])}`);e.push({name:D,required:o,spread:a})}return e}function _t(t,e,u,s){for(let n=0;n<e.length;n+=1){const{name:r,required:i,spread:o}=e[n],D=Wr(r);if(D in t)throw new Error(`Invalid parameter: ${ee(r)} is used more than once.`);const a=o?u.slice(n):u[n];if(o&&(n=e.length),i&&(!a||o&&a.length===0))return console.error(`Error: Missing required parameter ${ee(r)}
|
|
22
|
+
`),s(),process.exit(1);t[D]=a}}function ui(t){return t===void 0||t!==!1}function Uu(t,e,u,s){const n={...e.flags},r=e.version;r&&(n.version={type:Boolean,description:"Show version"});const{help:i}=e,o=ui(i);o&&!("help"in n)&&(n.help={type:Boolean,alias:"h",description:"Show help"});const D=Ru(n,s,{ignore:e.ignoreArgv}),a=()=>{console.log(e.version)};if(r&&D.flags.version===!0)return a(),process.exit(0);const c=new ei,f=o&&(i!=null&&i.render)?i.render:p=>c.render(p),l=p=>{const F=Zr({...e,...p?{help:p}:{},flags:n});console.log(f(F,c))};if(o&&D.flags.help===!0)return l(),process.exit(0);if(e.parameters){let{parameters:p}=e,F=D._;const A=p.indexOf("--"),B=p.slice(A+1),N=Object.create(null);if(A>-1&&B.length>0){p=p.slice(0,A);const S=D._["--"];F=F.slice(0,-S.length||void 0),_t(N,mt(p),F,l),_t(N,mt(B),S,l)}else _t(N,mt(p),F,l);Object.assign(D._,N)}const E={...D,showVersion:a,showHelp:l};return typeof u=="function"&&u(E),{command:t,...E}}function si(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: ${ee(i)}`);u.set(i,s)}}return u.get(t)}function Ku(t,e,u=process.argv.slice(2)){if(!t)throw new Error("Options is required");if("name"in t&&(!t.name||!gt.test(t.name)))throw new Error(`Invalid script name: ${ee(t.name)}`);const s=u[0];if(t.commands&>.test(s)){const n=si(s,t.commands);if(n)return Uu(n.options.name,{...n.options,parent:t},n.callback,u.slice(1))}return Uu(void 0,t,e,u)}function ni(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(!gt.test(u))throw new Error(`Invalid command name ${JSON.stringify(u)}. Command names must be one word.`);return{options:t,callback:e}}var ri=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ii(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fe={exports:{}},At,Vu;function oi(){if(Vu)return At;Vu=1,At=s,s.sync=n;var t=J;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;D<o.length;D++){var a=o[D].toLowerCase();if(a&&r.substr(-a.length).toLowerCase()===a)return!0}return!1}function u(r,i,o){return!r.isSymbolicLink()&&!r.isFile()?!1:e(i,o)}function s(r,i,o){t.stat(r,function(D,a){o(D,D?!1:u(a,r,i))})}function n(r,i){return u(t.statSync(r),r,i)}return At}var yt,zu;function Di(){if(zu)return yt;zu=1,yt=e,e.sync=u;var t=J;function e(r,i,o){t.stat(r,function(D,a){o(D,D?!1:s(a,i))})}function u(r,i){return s(t.statSync(r),i)}function s(r,i){return r.isFile()&&n(r,i)}function n(r,i){var o=r.mode,D=r.uid,a=r.gid,c=i.uid!==void 0?i.uid:process.getuid&&process.getuid(),f=i.gid!==void 0?i.gid:process.getgid&&process.getgid(),l=parseInt("100",8),E=parseInt("010",8),p=parseInt("001",8),F=l|E,A=o&p||o&E&&a===f||o&l&&D===c||o&F&&c===0;return A}return yt}var Ke;process.platform==="win32"||ri.TESTING_WINDOWS?Ke=oi():Ke=Di();var ai=wt;wt.sync=li;function wt(t,e,u){if(typeof e=="function"&&(u=e,e={}),!u){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(s,n){wt(t,e||{},function(r,i){r?n(r):s(i)})})}Ke(t,e||{},function(s,n){s&&(s.code==="EACCES"||e&&e.ignoreErrors)&&(s=null,n=!1),u(s,n)})}function li(t,e){try{return Ke.sync(t,e||{})}catch(u){if(e&&e.ignoreErrors||u.code==="EACCES")return!1;throw u}}const he=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Yu=K,ci=he?";":":",qu=ai,Xu=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),Qu=(t,e)=>{const u=e.colon||ci,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}},Zu=(t,e,u)=>{typeof e=="function"&&(u=e,e={}),e||(e={});const{pathEnv:s,pathExt:n,pathExtExe:r}=Qu(t,e),i=[],o=a=>new Promise((c,f)=>{if(a===s.length)return e.all&&i.length?c(i):f(Xu(t));const l=s[a],E=/^".*"$/.test(l)?l.slice(1,-1):l,p=Yu.join(E,t),F=!E&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;c(D(F,a,0))}),D=(a,c,f)=>new Promise((l,E)=>{if(f===n.length)return l(o(c+1));const p=n[f];qu(a+p,{pathExt:r},(F,A)=>{if(!F&&A)if(e.all)i.push(a+p);else return l(a+p);return l(D(a,c,f+1))})});return u?o(0).then(a=>u(null,a),u):o(0)},fi=(t,e)=>{e=e||{};const{pathEnv:u,pathExt:s,pathExtExe:n}=Qu(t,e),r=[];for(let i=0;i<u.length;i++){const o=u[i],D=/^".*"$/.test(o)?o.slice(1,-1):o,a=Yu.join(D,t),c=!D&&/^\.[\\\/]/.test(t)?t.slice(0,2)+a:a;for(let f=0;f<s.length;f++){const l=c+s[f];try{if(qu.sync(l,{pathExt:n}))if(e.all)r.push(l);else return l}catch{}}}if(e.all&&r.length)return r;if(e.nothrow)return null;throw Xu(t)};var hi=Zu;Zu.sync=fi;var Rt={exports:{}};const Ju=(t={})=>{const e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(s=>s.toUpperCase()==="PATH")||"Path"};Rt.exports=Ju,Rt.exports.default=Ju;var di=Rt.exports;const es=K,Ei=hi,pi=di;function ts(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=Ei.sync(t.command,{path:u[pi({env:u})],pathExt:e?es.delimiter:void 0})}catch{}finally{r&&process.chdir(s)}return i&&(i=es.resolve(n?t.options.cwd:"",i)),i}function Ci(t){return ts(t)||ts(t,!0)}var Fi=Ci,bt={};const vt=/([()\][%!^"`<>&|;, *?])/g;function gi(t){return t=t.replace(vt,"^$1"),t}function mi(t,e){return t=`${t}`,t=t.replace(/(\\*)"/g,'$1$1\\"'),t=t.replace(/(\\*)$/,"$1$1"),t=`"${t}"`,t=t.replace(vt,"^$1"),e&&(t=t.replace(vt,"^$1")),t}bt.command=gi,bt.argument=mi;var _i=/^#!(.*)/;const Ai=_i;var yi=(t="")=>{const e=t.match(Ai);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=J,wi=yi;function Ri(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 wi(u.toString())}var bi=Ri;const vi=K,us=Fi,ss=bt,Bi=bi,Si=process.platform==="win32",$i=/\.(?:com|exe)$/i,Ti=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function xi(t){t.file=us(t);const e=t.file&&Bi(t.file);return e?(t.args.unshift(t.file),t.command=e,us(t)):t.file}function Oi(t){if(!Si)return t;const e=xi(t),u=!$i.test(e);if(t.options.forceShell||u){const s=Ti.test(e);t.command=vi.normalize(t.command),t.command=ss.command(t.command),t.args=t.args.map(r=>ss.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 Ni(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:Oi(s)}var Hi=Ni;const St=process.platform==="win32";function $t(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 Li(t,e){if(!St)return;const u=t.emit;t.emit=function(s,n){if(s==="exit"){const r=ns(n,e);if(r)return u.call(t,"error",r)}return u.apply(t,arguments)}}function ns(t,e){return St&&t===1&&!e.file?$t(e.original,"spawn"):null}function Ii(t,e){return St&&t===1&&!e.file?$t(e.original,"spawnSync"):null}var Pi={hookChildProcess:Li,verifyENOENT:ns,verifyENOENTSync:Ii,notFoundError:$t};const rs=On,Tt=Hi,xt=Pi;function is(t,e,u){const s=Tt(t,e,u),n=rs.spawn(s.command,s.args,s.options);return xt.hookChildProcess(n,s),n}function ki(t,e,u){const s=Tt(t,e,u),n=rs.spawnSync(s.command,s.args,s.options);return n.error=n.error||xt.verifyENOENTSync(n.status,s),n}fe.exports=is,fe.exports.spawn=is,fe.exports.sync=ki,fe.exports._parse=Tt,fe.exports._enoent=xt;var Mi=fe.exports,Wi=ii(Mi);const os=(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)),Wi(process.execPath,["--require",ht.resolve("./preflight.cjs"),yu(Nn)?"--import":"--loader",Tn(ht.resolve("./loader.mjs")).toString(),...t],{stdio:s,env:u})};var Ve={};const Gi=K,te="\\\\/",Ds=`[^${te}]`,ue="\\.",ji="\\+",Ui="\\?",ze="\\/",Ki="(?=.)",as="[^/]",Ot=`(?:${ze}|$)`,ls=`(?:^|${ze})`,Nt=`${ue}{1,2}${Ot}`,Vi=`(?!${ue})`,zi=`(?!${ls}${Nt})`,Yi=`(?!${ue}{0,1}${Ot})`,qi=`(?!${Nt})`,Xi=`[^.${ze}]`,Qi=`${as}*?`,cs={DOT_LITERAL:ue,PLUS_LITERAL:ji,QMARK_LITERAL:Ui,SLASH_LITERAL:ze,ONE_CHAR:Ki,QMARK:as,END_ANCHOR:Ot,DOTS_SLASH:Nt,NO_DOT:Vi,NO_DOTS:zi,NO_DOT_SLASH:Yi,NO_DOTS_SLASH:qi,QMARK_NO_DOT:Xi,STAR:Qi,START_ANCHOR:ls},Zi={...cs,SLASH_LITERAL:`[${te}]`,QMARK:Ds,STAR:`${Ds}*?`,DOTS_SLASH:`${ue}{1,2}(?:[${te}]|$)`,NO_DOT:`(?!${ue})`,NO_DOTS:`(?!(?:^|[${te}])${ue}{1,2}(?:[${te}]|$))`,NO_DOT_SLASH:`(?!${ue}{0,1}(?:[${te}]|$))`,NO_DOTS_SLASH:`(?!${ue}{1,2}(?:[${te}]|$))`,QMARK_NO_DOT:`[^.${te}]`,START_ANCHOR:`(?:^|[${te}])`,END_ANCHOR:`(?:[${te}]|$)`},Ji={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:Ji,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:Gi.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?Zi:cs}};(function(t){const e=K,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,a)=>{const c=o.lastIndexOf(D,a);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 a=o;return a.startsWith("./")&&(a=a.slice(2),D.prefix="./"),a},t.wrapOutput=(o,D={},a={})=>{const c=a.contains?"":"^",f=a.contains?"":"$";let l=`${c}(?:${o})${f}`;return D.negated===!0&&(l=`(?:^(?!${l}).*$)`),l}})(Ve);const fs=Ve,{CHAR_ASTERISK:Ht,CHAR_AT:eo,CHAR_BACKWARD_SLASH:ye,CHAR_COMMA:to,CHAR_DOT:Lt,CHAR_EXCLAMATION_MARK:It,CHAR_FORWARD_SLASH:hs,CHAR_LEFT_CURLY_BRACE:Pt,CHAR_LEFT_PARENTHESES:kt,CHAR_LEFT_SQUARE_BRACKET:uo,CHAR_PLUS:so,CHAR_QUESTION_MARK:ds,CHAR_RIGHT_CURLY_BRACE:no,CHAR_RIGHT_PARENTHESES:Es,CHAR_RIGHT_SQUARE_BRACKET:ro}=Ye,ps=t=>t===hs||t===ye,Cs=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},io=(t,e)=>{const u=e||{},s=t.length-1,n=u.parts===!0||u.scanToEnd===!0,r=[],i=[],o=[];let D=t,a=-1,c=0,f=0,l=!1,E=!1,p=!1,F=!1,A=!1,B=!1,N=!1,S=!1,X=!1,M=!1,ne=0,W,_,b={value:"",depth:0,isGlob:!1};const k=()=>a>=s,C=()=>D.charCodeAt(a+1),x=()=>(W=_,D.charCodeAt(++a));for(;a<s;){_=x();let G;if(_===ye){N=b.backslashes=!0,_=x(),_===Pt&&(B=!0);continue}if(B===!0||_===Pt){for(ne++;k()!==!0&&(_=x());){if(_===ye){N=b.backslashes=!0,x();continue}if(_===Pt){ne++;continue}if(B!==!0&&_===Lt&&(_=x())===Lt){if(l=b.isBrace=!0,p=b.isGlob=!0,M=!0,n===!0)continue;break}if(B!==!0&&_===to){if(l=b.isBrace=!0,p=b.isGlob=!0,M=!0,n===!0)continue;break}if(_===no&&(ne--,ne===0)){B=!1,l=b.isBrace=!0,M=!0;break}}if(n===!0)continue;break}if(_===hs){if(r.push(a),i.push(b),b={value:"",depth:0,isGlob:!1},M===!0)continue;if(W===Lt&&a===c+1){c+=2;continue}f=a+1;continue}if(u.noext!==!0&&(_===so||_===eo||_===Ht||_===ds||_===It)===!0&&C()===kt){if(p=b.isGlob=!0,F=b.isExtglob=!0,M=!0,_===It&&a===c&&(X=!0),n===!0){for(;k()!==!0&&(_=x());){if(_===ye){N=b.backslashes=!0,_=x();continue}if(_===Es){p=b.isGlob=!0,M=!0;break}}continue}break}if(_===Ht){if(W===Ht&&(A=b.isGlobstar=!0),p=b.isGlob=!0,M=!0,n===!0)continue;break}if(_===ds){if(p=b.isGlob=!0,M=!0,n===!0)continue;break}if(_===uo){for(;k()!==!0&&(G=x());){if(G===ye){N=b.backslashes=!0,x();continue}if(G===ro){E=b.isBracket=!0,p=b.isGlob=!0,M=!0;break}}if(n===!0)continue;break}if(u.nonegate!==!0&&_===It&&a===c){S=b.negated=!0,c++;continue}if(u.noparen!==!0&&_===kt){if(p=b.isGlob=!0,n===!0){for(;k()!==!0&&(_=x());){if(_===kt){N=b.backslashes=!0,_=x();continue}if(_===Es){M=!0;break}}continue}break}if(p===!0){if(M=!0,n===!0)continue;break}}u.noext===!0&&(F=!1,p=!1);let $=D,re="",h="";c>0&&(re=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&&ps($.charCodeAt($.length-1))&&($=$.slice(0,-1)),u.unescape===!0&&(h&&(h=fs.removeBackslashes(h)),$&&N===!0&&($=fs.removeBackslashes($)));const d={prefix:re,input:t,start:c,base:$,glob:h,isBrace:l,isBracket:E,isGlob:p,isExtglob:F,isGlobstar:A,negated:S,negatedExtglob:X};if(u.tokens===!0&&(d.maxDepth=0,ps(_)||i.push(b),d.tokens=i),u.parts===!0||u.tokens===!0){let G;for(let R=0;R<r.length;R++){const Q=G?G+1:c,Z=r[R],V=t.slice(Q,Z);u.tokens&&(R===0&&c!==0?(i[R].isPrefix=!0,i[R].value=re):i[R].value=V,Cs(i[R]),d.maxDepth+=i[R].depth),(R!==0||V!=="")&&o.push(V),G=Z}if(G&&G+1<t.length){const R=t.slice(G+1);o.push(R),u.tokens&&(i[i.length-1].value=R,Cs(i[i.length-1]),d.maxDepth+=i[i.length-1].depth)}d.slashes=r,d.parts=o}return d};var oo=io;const qe=Ye,z=Ve,{MAX_LENGTH:Xe,POSIX_REGEX_SOURCE:Do,REGEX_NON_SPECIAL_CHARS:ao,REGEX_SPECIAL_CHARS_BACKREF:lo,REPLACEMENTS:Fs}=qe,co=(t,e)=>{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`,Mt=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Fs[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),a=qe.globChars(D),c=qe.extglobChars(a),{DOT_LITERAL:f,PLUS_LITERAL:l,SLASH_LITERAL:E,ONE_CHAR:p,DOTS_SLASH:F,NO_DOT:A,NO_DOT_SLASH:B,NO_DOTS_SLASH:N,QMARK:S,QMARK_NO_DOT:X,STAR:M,START_ANCHOR:ne}=a,W=m=>`(${o}(?:(?!${ne}${m.dot?F:f}).)*?)`,_=u.dot?"":A,b=u.dot?S:X;let k=u.bash===!0?W(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=[],$=[],re=[];let h=r,d;const G=()=>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),V=(m="",T=0)=>{C.consumed+=m,C.index+=T},Ie=m=>{C.output+=m.output!=null?m.output:m.value,V(m.value)},bn=()=>{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]++,re.push(m)},ie=m=>{C[m]--,re.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)},vn=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=W(u)),(y!==k||G()||/^\)+$/.test(Z()))&&(T=m.close=`)$))${y}`),m.inner.includes("*")&&(g=Z())&&/^\.[^\\/.]+$/.test(g)){const O=Mt(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}),ie("parens")};if(u.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let m=!1,T=t.replace(lo,(g,y,O,j,L,ct)=>j==="\\"?(m=!0,g):j==="?"?y?y+j+(L?S.repeat(L.length):""):ct===0?b+(L?S.repeat(L.length):""):S.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(;!G();){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=Do[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){vn(x.pop());continue}w({type:"paren",value:d,output:C.parens?")":"\\)"}),ie("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}ie("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=co(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}),ie("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&&re[re.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:S});continue}if(d==="!"){if(u.noextglob!==!0&&R()==="("&&(R(2)!=="?"||!/[!=<:]/.test(R(3)))){ke("negate",d);continue}if(u.nonegate!==!0&&C.index===0){bn();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:l});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:l});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=ao.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,V(d);continue}let m=Z();if(u.noextglob!==!0&&/^\([^?]/.test(m)){ke("star",d);continue}if(h.type==="star"){if(u.noglobstar===!0){V(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),V("/**",3)}if(g.type==="bos"&&G()){h.type="globstar",h.value+=d,h.output=W(u),C.output=h.output,C.globstar=!0,V(d);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&!j&&G()){C.output=C.output.slice(0,-(g.output+h.output).length),g.output=`(?:${g.output}`,h.type="globstar",h.output=W(u)+(u.strictSlashes?")":"|$)"),h.value+=d,C.globstar=!0,C.output+=g.output+h.output,V(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=`${W(u)}${E}|${E}${Me})`,h.value+=d,C.output+=g.output+h.output,C.globstar=!0,V(d+Q()),w({type:"slash",value:"/",output:""});continue}if(g.type==="bos"&&m[0]==="/"){h.type="globstar",h.value+=d,h.output=`(?:^|${E}|${W(u)}${E})`,C.output=h.output,C.globstar=!0,V(d+Q()),w({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-h.output.length),h.type="globstar",h.output=W(u),h.value+=d,C.output+=h.output,C.globstar=!0,V(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+=B,h.output+=B):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,"["),ie("brackets")}for(;C.parens>0;){if(u.strictBrackets===!0)throw new SyntaxError(de("closing",")"));C.output=z.escapeLast(C.output,"("),ie("parens")}for(;C.braces>0;){if(u.strictBrackets===!0)throw new SyntaxError(de("closing","}"));C.output=z.escapeLast(C.output,"{"),ie("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};Mt.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=Fs[t]||t;const r=z.isWindows(e),{DOT_LITERAL:i,SLASH_LITERAL:o,ONE_CHAR:D,DOTS_SLASH:a,NO_DOT:c,NO_DOTS:f,NO_DOTS_SLASH:l,STAR:E,START_ANCHOR:p}=qe.globChars(r),F=u.dot?f:c,A=u.dot?l:c,B=u.capture?"":"?:",N={negated:!1,prefix:""};let S=u.bash===!0?".*?":E;u.capture&&(S=`(${S})`);const X=_=>_.noglobstar===!0?S:`(${B}(?:(?!${p}${_.dot?a:i}).)*?)`,M=_=>{switch(_){case"*":return`${F}${D}${S}`;case".*":return`${i}${D}${S}`;case"*.*":return`${F}${S}${i}${D}${S}`;case"*/*":return`${F}${S}${o}${D}${A}${S}`;case"**":return F+X(u);case"**/*":return`(?:${F}${X(u)}${o})?${A}${D}${S}`;case"**/*.*":return`(?:${F}${X(u)}${o})?${A}${S}${i}${D}${S}`;case"**/.*":return`(?:${F}${X(u)}${o})?${i}${D}${S}`;default:{const b=/^(.*?)\.(\w+)$/.exec(_);if(!b)return;const k=M(b[1]);return k?k+i+b[2]:void 0}}},ne=z.removePrefix(t,N);let W=M(ne);return W&&u.strictSlashes!==!0&&(W+=`${o}?`),W};var fo=Mt;const ho=K,Eo=oo,Wt=fo,Gt=Ve,po=Ye,Co=t=>t&&typeof t=="object"&&!Array.isArray(t),H=(t,e,u=!1)=>{if(Array.isArray(t)){const c=t.map(l=>H(l,e,u));return l=>{for(const E of c){const p=E(l);if(p)return p}return!1}}const s=Co(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=Gt.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 a=(c,f=!1)=>{const{isMatch:l,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:l};return typeof n.onResult=="function"&&n.onResult(F),l===!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&&(a.state=o),a};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?Gt.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=Gt.isWindows(u))=>(e instanceof RegExp?e:H.makeRe(e,u)).test(ho.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)=>Eo(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=po;var Fo=H,gs=Fo;const we=J,{Readable:go}=In,Re=K,{promisify:Qe}=me,jt=gs,mo=Qe(we.readdir),_o=Qe(we.stat),ms=Qe(we.lstat),Ao=Qe(we.realpath),yo="!",_s="READDIRP_RECURSIVE_ERROR",wo=new Set(["ENOENT","EPERM","EACCES","ELOOP",_s]),Ut="files",As="directories",Ze="files_directories",Je="all",ys=[Ut,As,Ze,Je],Ro=t=>wo.has(t.code),[ws,bo]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),vo=process.platform==="win32"&&(ws>10||ws===10&&bo>=5),Rs=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){const e=jt(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)===yo?u.push(jt(n.slice(1))):e.push(jt(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 go{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Ut,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=Rs(u.fileFilter),this._directoryFilter=Rs(u.directoryFilter);const r=u.lstat?ms:_o;vo?this._stat=i=>r(i,{bigint:!0}):this._stat=r,this._maxDepth=u.depth,this._wantsDir=[As,Ze,Je].includes(n),this._wantsFile=[Ut,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 mo(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){Ro(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 Ao(s),r=await ms(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=_s,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&&!ys.includes(u))throw new Error(`readdirp: Invalid type passed. Use one of ${ys.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new lt(e)},Bo=(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=Bo,Ee.ReaddirpStream=lt,Ee.default=Ee;var So=Ee,Kt={exports:{}};/*!
|
|
23
23
|
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
|
24
24
|
*
|
|
25
25
|
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|
@@ -50,6 +50,6 @@ import Au,{constants as ft}from"os";import Bn from"tty";import{transformSync as
|
|
|
50
50
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
51
51
|
* Licensed under the MIT License.
|
|
52
52
|
*/const sD=me,Ms=uD,Ws=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),nD=t=>e=>t===!0?Number(e):String(e),Xt=t=>typeof t=="number"||typeof t=="string"&&t!=="",be=t=>Number.isInteger(+t),Qt=t=>{let e=`${t}`,u=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++u]==="0";);return u>0},rD=(t,e,u)=>typeof t=="string"||typeof e=="string"?!0:u.stringify===!0,iD=(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},Gs=(t,e)=>{let u=t[0]==="-"?"-":"";for(u&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return u?"-"+t:t},oD=(t,e)=>{t.negatives.sort((i,o)=>i<o?-1:i>o?1:0),t.positives.sort((i,o)=>i<o?-1:i>o?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},js=(t,e,u,s)=>{if(u)return Ms(t,e,{wrap:!1,...s});let n=String.fromCharCode(t);if(t===e)return n;let r=String.fromCharCode(e);return`[${n}-${r}]`},Us=(t,e,u)=>{if(Array.isArray(t)){let s=u.wrap===!0,n=u.capture?"":"?:";return s?`(${n}${t.join("|")})`:t.join("|")}return Ms(t,e,u)},Ks=(...t)=>new RangeError("Invalid range arguments: "+sD.inspect(...t)),Vs=(t,e,u)=>{if(u.strictRanges===!0)throw Ks([t,e]);return[]},DD=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},aD=(t,e,u=1,s={})=>{let n=Number(t),r=Number(e);if(!Number.isInteger(n)||!Number.isInteger(r)){if(s.strictRanges===!0)throw Ks([t,e]);return[]}n===0&&(n=0),r===0&&(r=0);let i=n>r,o=String(t),D=String(e),a=String(u);u=Math.max(Math.abs(u),1);let c=Qt(o)||Qt(D)||Qt(a),f=c?Math.max(o.length,D.length,a.length):0,l=c===!1&&rD(t,e,s)===!1,E=s.transform||nD(l);if(s.toRegex&&u===1)return js(Gs(t,f),Gs(e,f),!0,s);let p={negatives:[],positives:[]},F=N=>p[N<0?"negatives":"positives"].push(Math.abs(N)),A=[],B=0;for(;i?n>=r:n<=r;)s.toRegex===!0&&u>1?F(n):A.push(iD(E(n,B),f,l)),n=i?n-u:n+u,B++;return s.toRegex===!0?u>1?oD(p,s):Us(A,null,{wrap:!1,...s}):A},lD=(t,e,u=1,s={})=>{if(!be(t)&&t.length>1||!be(e)&&e.length>1)return Vs(t,e,s);let n=s.transform||(l=>String.fromCharCode(l)),r=`${t}`.charCodeAt(0),i=`${e}`.charCodeAt(0),o=r>i,D=Math.min(r,i),a=Math.max(r,i);if(s.toRegex&&u===1)return js(D,a,!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?Us(c,null,{wrap:!1,options:s}):c},tt=(t,e,u,s={})=>{if(e==null&&Xt(t))return[t];if(!Xt(t)||!Xt(e))return Vs(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)?aD(t,e,u,n):lD(t,e,Math.max(Math.abs(u),1),n):u!=null&&!Ws(u)?DD(u,n):tt(t,e,1,u)};var zs=tt;const cD=zs,Ys=et,fD=(t,e={})=>{let u=(s,n={})=>{let r=Ys.isInvalidBrace(n),i=s.invalid===!0&&e.escapeInvalid===!0,o=r===!0||i===!0,D=e.escapeInvalid===!0?"\\":"",a="";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=Ys.reduce(s.nodes),f=cD(...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)a+=u(c,s);return a};return u(t)};var hD=fD;const dD=zs,qs=Yt,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)},ED=(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(),qs(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 l=dD(...f,e);l.length===0&&(l=qs(n,e)),o.push(ae(o.pop(),l)),n.nodes=[];return}let D=pe.encloseBrace(n),a=n.queue,c=n;for(;c.type!=="brace"&&c.type!=="root"&&c.parent;)c=c.parent,a=c.queue;for(let f=0;f<n.nodes.length;f++){let l=n.nodes[f];if(l.type==="comma"&&n.type==="brace"){f===1&&a.push(""),a.push("");continue}if(l.type==="close"){o.push(ae(o.pop(),a,D));continue}if(l.value&&l.type!=="open"){a.push(ae(a.pop(),l.value));continue}l.nodes&&s(l,n)}return a};return pe.flatten(s(t))};var pD=ED,CD={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
53
|
-
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",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 FD=Yt,{MAX_LENGTH:Xs,CHAR_BACKSLASH:Zt,CHAR_BACKTICK:gD,CHAR_COMMA:mD,CHAR_DOT:_D,CHAR_LEFT_PARENTHESES:AD,CHAR_RIGHT_PARENTHESES:yD,CHAR_LEFT_CURLY_BRACE:wD,CHAR_RIGHT_CURLY_BRACE:RD,CHAR_LEFT_SQUARE_BRACKET:Qs,CHAR_RIGHT_SQUARE_BRACKET:Zs,CHAR_DOUBLE_QUOTE:bD,CHAR_SINGLE_QUOTE:vD,CHAR_NO_BREAK_SPACE:BD,CHAR_ZERO_WIDTH_NOBREAK_SPACE:SD}=CD,$D=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let u=e||{},s=typeof u.maxLength=="number"?Math.min(Xs,u.maxLength):Xs;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,a=t.length,c=0,f=0,l;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"});c<a;)if(i=r[r.length-1],l=E(),!(l===SD||l===BD)){if(l===Zt){p({type:"text",value:(e.keepEscaping?l:"")+E()});continue}if(l===Zs){p({type:"text",value:"\\"+l});continue}if(l===Qs){D++;let F;for(;c<a&&(F=E());){if(l+=F,F===Qs){D++;continue}if(F===Zt){l+=E();continue}if(F===Zs&&(D--,D===0))break}p({type:"text",value:l});continue}if(l===AD){i=p({type:"paren",nodes:[]}),r.push(i),p({type:"text",value:l});continue}if(l===yD){if(i.type!=="paren"){p({type:"text",value:l});continue}i=r.pop(),p({type:"text",value:l}),i=r[r.length-1];continue}if(l===bD||l===vD||l===gD){let F=l,A;for(e.keepQuotes!==!0&&(l="");c<a&&(A=E());){if(A===Zt){l+=A+E();continue}if(A===F){e.keepQuotes===!0&&(l+=A);break}l+=A}p({type:"text",value:l});continue}if(l===wD){f++;let A={type:"brace",open:!0,close:!1,dollar:o.value&&o.value.slice(-1)==="$"||i.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};i=p(A),r.push(i),p({type:"open",value:l});continue}if(l===RD){if(i.type!=="brace"){p({type:"text",value:l});continue}let F="close";i=r.pop(),i.close=!0,p({type:F,value:l}),f--,i=r[r.length-1];continue}if(l===mD&&f>0){if(i.ranges>0){i.ranges=0;let F=i.nodes.shift();i.nodes=[F,{type:"text",value:FD(i)}]}p({type:"comma",value:l}),i.commas++;continue}if(l===_D&&f>0&&i.commas===0){let F=i.nodes;if(f===0||F.length===0){p({type:"text",value:l});continue}if(o.type==="dot"){if(i.range=[],o.value+=l,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+l,o=A,i.ranges--;continue}p({type:"dot",value:l});continue}p({type:"text",value:l})}do if(i=r.pop(),i.type!=="root"){i.nodes.forEach(B=>{B.nodes||(B.type==="open"&&(B.isOpen=!0),B.type==="close"&&(B.isClose=!0),B.nodes||(B.type="text"),B.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 TD=$D;const Js=Yt,xD=hD,OD=pD,ND=TD,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={})=>ND(t,e),Y.stringify=(t,e={})=>Js(typeof t=="string"?Y.parse(t,e):t,e),Y.compile=(t,e={})=>(typeof t=="string"&&(t=Y.parse(t,e)),xD(t,e)),Y.expand=(t,e={})=>{typeof t=="string"&&(t=Y.parse(t,e));let u=OD(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 HD=Y,LD=["3dm","3ds","3g2","3gp","7z","a","aac","adp","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"],ID=LD;const PD=K,kD=ID,MD=new Set(kD);var WD=t=>MD.has(PD.extname(t).slice(1).toLowerCase()),ut={};(function(t){const{sep:e}=K,{platform:u}=process,s=Au;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_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 se=te,I=K,{promisify:ve}=me,GD=WD,{isWindows:jD,isLinux:UD,EMPTY_FN:KD,EMPTY_STR:VD,KEY_LISTENERS:Ce,KEY_ERR:Jt,KEY_RAW:Be,HANDLER_KEYS:zD,EV_CHANGE:st,EV_ADD:nt,EV_ADD_DIR:YD,EV_ERROR:en,STR_DATA:qD,STR_END:XD,BRACE_START:QD,STAR:ZD}=ut,JD="watch",ea=ve(se.open),tn=ve(se.stat),ta=ve(se.lstat),ua=ve(se.close),eu=ve(se.realpath),sa={lstat:ta,stat:tn},tu=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},Se=(t,e,u)=>{let s=t[e];s instanceof Set||(t[e]=s=new Set([s])),s.add(u)},na=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]},un=t=>t instanceof Set?t.size===0:!t,rt=new Map;function sn(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 se.watch(t,e,r)}catch(i){s(i)}}const it=(t,e,u,s,n)=>{const r=rt.get(t);r&&tu(r[e],i=>{i(u,s,n)})},ra=(t,e,u,s)=>{const{listener:n,errHandler:r,rawEmitter:i}=s;let o=rt.get(e),D;if(!u.persistent)return D=sn(t,u,n,r,i),D.close.bind(D);if(o)Se(o,Ce,n),Se(o,Jt,r),Se(o,Be,i);else{if(D=sn(t,u,it.bind(null,e,Ce),r,it.bind(null,e,Be)),!D)return;D.on(en,async a=>{const c=it.bind(null,e,Jt);if(o.watcherUnusable=!0,jD&&a.code==="EPERM")try{const f=await ea(t,"r");await ua(f),c(a)}catch{}else c(a)}),o={listeners:n,errHandlers:r,rawEmitters:i,watcher:D},rt.set(e,o)}return()=>{$e(o,Ce,n),$e(o,Jt,r),$e(o,Be,i),un(o.listeners)&&(o.watcher.close(),rt.delete(e),zD.forEach(na(o)),o.watcher=void 0,Object.freeze(o))}},uu=new Map,ia=(t,e,u,s)=>{const{listener:n,rawEmitter:r}=s;let i=uu.get(e);const o=i&&i.options;return o&&(o.persistent<u.persistent||o.interval>u.interval)&&(i.listeners,i.rawEmitters,se.unwatchFile(e),i=void 0),i?(Se(i,Ce,n),Se(i,Be,r)):(i={listeners:n,rawEmitters:r,options:u,watcher:se.watchFile(e,u,(D,a)=>{tu(i.rawEmitters,f=>{f(st,e,{curr:D,prev:a})});const c=D.mtimeMs;(D.size!==a.size||c>a.mtimeMs||c===0)&&tu(i.listeners,f=>f(t,D))})},uu.set(e,i)),()=>{$e(i,Ce,n),$e(i,Be,r),un(i.listeners)&&(uu.delete(e),se.unwatchFile(e),i.options=i.watcher=void 0,Object.freeze(i))}};let oa=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=KD);let a;return s.usePolling?(D.interval=s.enableBinaryInterval&&GD(r)?s.binaryInterval:s.interval,a=ia(e,o,D,{listener:u,rawEmitter:this.fsw._emitRaw})):a=ra(e,o,D,{listener:u,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),a}_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(JD,e,5)){if(!f||f.mtimeMs===0)try{const l=await tn(e);if(this.fsw.closed)return;const E=l.atimeMs,p=l.mtimeMs;(!E||E<=p||p!==o.mtimeMs)&&this.fsw._emit(st,e,l),UD&&o.ino!==l.ino?(this.fsw._closeFile(c),o=l,this.fsw._addPathCloser(c,this._watchWithNodeFs(e,D))):o=l}catch{this.fsw._remove(n,r)}else if(i.has(r)){const l=f.atimeMs,E=f.mtimeMs;(!l||l<=E||E!==o.mtimeMs)&&this.fsw._emit(st,e,f),o=f}}},a=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 a}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 eu(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,VD),!s.hasGlob&&(o=this.fsw._throttle("readdir",e,1e3),!o))return;const D=this.fsw._getWatchedDir(s.path),a=new Set;let c=this.fsw._readdirp(e,{fileFilter:f=>s.filterPath(f),directoryFilter:f=>s.filterDir(f),depth:0}).on(qD,async f=>{if(this.fsw.closed){c=void 0;return}const l=f.path;let E=I.join(e,l);if(a.add(l),!(f.stats.isSymbolicLink()&&await this._handleSymlink(f,e,E,l))){if(this.fsw.closed){c=void 0;return}(l===n||!n&&!D.has(l))&&(this.fsw._incrReadyCount(),E=I.join(r,I.relative(r,E)),this._addToNodeFs(E,u,s,i+1))}}).on(en,this._boundHandleError);return new Promise(f=>c.once(XD,()=>{if(this.fsw.closed){c=void 0;return}const l=o?o.clear():!1;f(),D.getChildren().filter(E=>E!==e&&!a.has(E)&&(!s.hasGlob||s.filterPath({fullPath:I.resolve(e,E)}))).forEach(E=>{this.fsw._remove(e,E)}),c=void 0,l&&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)),a=D.has(I.basename(e));!(s&&this.fsw.options.ignoreInitial)&&!r&&!a&&(!i.hasGlob||i.globFilter(e))&&this.fsw._emit(YD,e,u),D.add(I.basename(e)),this.fsw._getWatchedDir(e);let c,f;const l=this.fsw.options.depth;if((l==null||n<=l)&&!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 sa[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,D))return i(),!1;const a=this.fsw.options.followSymlinks&&!e.includes(ZD)&&!e.includes(QD);let c;if(D.isDirectory()){const f=I.resolve(e),l=a?await eu(e):e;if(this.fsw.closed||(c=await this._handleDir(o.watchPath,D,u,n,r,o,l),this.fsw.closed))return;f!==l&&l!==void 0&&this.fsw._symlinkPaths.set(f,l)}else if(D.isSymbolicLink()){const f=a?await eu(e):e;if(this.fsw.closed)return;const l=I.dirname(o.watchPath);if(this.fsw._getWatchedDir(l).add(o.watchPath),this.fsw._emit(nt,o.watchPath,D),c=await this._handleDir(l,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 Da=oa,su={exports:{}};const nu=te,P=K,{promisify:ru}=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:iu,EV_CHANGE:aa,EV_ADD_DIR:nn,EV_UNLINK:ot,EV_ERROR:la,STR_DATA:ca,STR_END:fa,FSEVENT_CREATED:ha,FSEVENT_MODIFIED:da,FSEVENT_DELETED:Ea,FSEVENT_MOVED:pa,FSEVENT_UNKNOWN:Ca,FSEVENT_TYPE_FILE:Fa,FSEVENT_TYPE_DIRECTORY:Te,FSEVENT_TYPE_SYMLINK:rn,ROOT_GLOBSTAR:on,DIR_SUFFIX:ga,DOT_SLASH:Dn,FUNCTION_TYPE:ou,EMPTY_FN:ma,IDENTITY_FN:_a}=ut,Aa=t=>isNaN(t)?{}:{depth:t},Du=ru(nu.stat),ya=ru(nu.lstat),an=ru(nu.realpath),wa={stat:Du,lstat:ya},le=new Map,Ra=10,ba=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),va=(t,e)=>({stop:Fe.watch(t,e)});function Ba(t,e,u,s){let n=P.extname(e)?P.dirname(e):e;const r=P.dirname(n);let i=le.get(n);Sa(r)&&(n=r);const o=P.resolve(t),D=o!==e,a=(f,l,E)=>{D&&(f=f.replace(e,o)),(f===o||!f.indexOf(o+P.sep))&&u(f,l,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(a):(i={listeners:new Set([a]),rawEmitter:s,watcher:va(n,(f,l)=>{if(!i.listeners.size)return;const E=Fe.getInfo(f,l);i.listeners.forEach(p=>{p(f,l,E)}),i.rawEmitter(E.event,f,E)})},le.set(n,i)),()=>{const f=i.listeners;if(f.delete(a),!f.size&&(le.delete(n),i.watcher))return i.watcher.stop().then(()=>{i.rawEmitter=i.watcher=void 0,Object.freeze(i)})}}const Sa=t=>{let e=0;for(const u of le.keys())if(u.indexOf(t)===0&&(e++,e>=Ra))return!0;return!1},$a=()=>Fe&&le.size<128,au=(t,e)=>{let u=0;for(;!t.indexOf(e)&&(t=P.dirname(t))!==e;)u++;return u},ln=(t,e)=>t.type===Te&&e.isDirectory()||t.type===rn&&e.isSymbolicLink()||t.type===Fa&&e.isFile();let Ta=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+on),!0;s.delete(e),s.delete(e+on)}addOrChange(e,u,s,n,r,i,o,D){const a=r.has(i)?aa:iu;this.handleEvent(a,e,u,s,n,r,i,o,D)}async checkExists(e,u,s,n,r,i,o,D){try{const a=await Du(e);if(this.fsw.closed)return;ln(o,a)?this.addOrChange(e,u,s,n,r,i,o,D):this.handleEvent(ot,e,u,s,n,r,i,o,D)}catch(a){a.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,a){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===iu){if(D.type===Te&&this.fsw._getWatchedDir(u),D.type===rn&&a.followSymlinks){const f=a.depth===void 0?void 0:au(s,n)+1;return this._addToFsEvents(u,!1,!0,f)}this.fsw._getWatchedDir(r).add(o)}const c=D.type===Te?e+ga:e;this.fsw._emit(c,u),c===nn&&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=Ba(e,u,async(D,a,c)=>{if(this.fsw.closed||r.depth!==void 0&&au(D,u)>r.depth)return;const f=s(P.join(e,P.relative(e,D)));if(n&&!n(f))return;const l=P.dirname(f),E=P.basename(f),p=this.fsw._getWatchedDir(c.type===Te?f:l);if(ba.has(a)||c.event===Ca)if(typeof r.ignored===ou){let F;try{F=await Du(f)}catch{}if(this.fsw.closed||this.checkIgnored(f,F))return;ln(c,F)?this.addOrChange(f,D,u,l,p,E,c,r):this.handleEvent(ot,f,D,u,l,p,E,c,r)}else this.checkExists(f,D,u,l,p,E,c,r);else switch(c.event){case ha:case da:return this.addOrChange(f,D,u,l,p,E,c,r);case Ea:case pa:return this.checkExists(f,D,u,l,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 an(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!==Dn?o=i.replace(r,e):i!==Dn&&(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)),a=P.basename(i);o&&this.fsw._getWatchedDir(i),!D.has(a)&&(D.add(a),(!n.ignoreInitial||r===!0)&&this.fsw._emit(o?nn:iu,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===ou?u:_a,o=this.fsw._getWatchHelpers(e);try{const D=await wa[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:a=>o.filterPath(a),directoryFilter:a=>o.filterDir(a),...Aa(r.depth-(n||0))}).on(ca,a=>{if(this.fsw.closed||a.stats.isDirectory()&&!o.filterPath(a))return;const c=P.join(o.watchPath,a.path),{fullPath:f}=a;if(o.followSymlinks&&a.stats.isSymbolicLink()){const l=r.depth===void 0?void 0:au(c,P.resolve(o.watchPath))+1;this._handleFsEventsSymlink(c,f,i,l)}else this.emitAdd(c,a.stats,i,r,s)}).on(la,ma).on(fa,()=>{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===ou)this.initWatch(void 0,e,o,i);else{let D;try{D=await an(o.watchPath)}catch{}this.initWatch(D,e,o,i)}}};su.exports=Ta,su.exports.canUse=$a;var xa=su.exports;const{EventEmitter:Oa}=Ln,lu=te,v=K,{promisify:cn}=me,Na=So,cu=Ho.default,Ha=zo,fu=Ts,La=HD,Ia=bs,Pa=Da,fn=xa,{EV_ALL:hu,EV_READY:ka,EV_ADD:Dt,EV_CHANGE:xe,EV_UNLINK:hn,EV_ADD_DIR:Ma,EV_UNLINK_DIR:Wa,EV_RAW:Ga,EV_ERROR:du,STR_CLOSE:ja,STR_END:Ua,BACK_SLASH_RE:Ka,DOUBLE_SLASH_RE:dn,SLASH_OR_BACK_SLASH_RE:Va,DOT_RE:za,REPLACER_RE:Ya,SLASH:Eu,SLASH_SLASH:qa,BRACE_START:Xa,BANG:pu,ONE_DOT:En,TWO_DOTS:Qa,GLOBSTAR:Za,SLASH_GLOBSTAR:Cu,ANYMATCH_OPTS:Fu,STRING_TYPE:gu,FUNCTION_TYPE:Ja,EMPTY_STR:mu,EMPTY_FN:el,isWindows:tl,isMacos:ul,isIBMi:sl}=ut,nl=cn(lu.stat),rl=cn(lu.readdir),_u=(t=[])=>Array.isArray(t)?t:[t],pn=(t,e=[])=>(t.forEach(u=>{Array.isArray(u)?pn(u,e):e.push(u)}),e),Cn=t=>{const e=pn(_u(t));if(!e.every(u=>typeof u===gu))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(gn)},Fn=t=>{let e=t.replace(Ka,Eu),u=!1;for(e.startsWith(qa)&&(u=!0);e.match(dn);)e=e.replace(dn,Eu);return u&&(e=Eu+e),e},gn=t=>Fn(v.normalize(Fn(t))),mn=(t=mu)=>e=>typeof e!==gu?e:gn(v.isAbsolute(e)?e:v.join(t,e)),il=(t,e)=>v.isAbsolute(t)?t:t.startsWith(pu)?pu+v.join(e,t.slice(1)):v.join(e,t),q=(t,e)=>t[e]===void 0;class ol{constructor(e,u){this.path=e,this._removeWatcher=u,this.items=new Set}add(e){const{items:u}=this;u&&e!==En&&e!==Qa&&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 rl(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 Dl="stat",al="lstat";class ll{constructor(e,u,s,n){this.fsw=n,this.path=e=e.replace(Ya,mu),this.watchPath=u,this.fullWatchPath=v.resolve(u),this.hasGlob=u!==e,e===mu&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&s?void 0:!1,this.globFilter=this.hasGlob?cu(e,void 0,Fu):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(r=>{r.length>1&&r.pop()}),this.followSymlinks=s,this.statMethod=s?Dl:al}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===Ja?this.globFilter(s):!0)&&this.fsw._isntIgnored(s,u)&&this.fsw._hasReadPermissions(u)}getDirParts(e){if(!this.hasGlob)return[];const u=[];return(e.includes(Xa)?La.expand(e):[e]).forEach(n=>{u.push(v.relative(this.watchPath,n).split(Va))}),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===Za&&(s=!0),s||!u[0][i]||cu(r,u[0][i],Fu))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class cl extends Oa{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),fn.canUse()||(u.useFsEvents=!1),q(u,"usePolling")&&!u.useFsEvents&&(u.usePolling=ul),sl&&(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=_u(u.ignored));let o=0;this._emitReady=()=>{o++,o>=this._readyCount&&(this._emitReady=el,this._readyEmitted=!0,process.nextTick(()=>this.emit(ka)))},this._emitRaw=(...D)=>this.emit(Ga,...D),this._readyEmitted=!1,this.options=u,u.useFsEvents?this._fsEventsHandler=new fn(this):this._nodeFsHandler=new Pa(this),Object.freeze(u)}add(e,u,s){const{cwd:n,disableGlobbing:r}=this.options;this.closed=!1;let i=Cn(e);return n&&(i=i.map(o=>{const D=il(o,n);return r||!fu(o)?D:Ia(D)})),i=i.filter(o=>o.startsWith(pu)?(this._ignoredPaths.add(o.slice(1)),!1):(this._ignoredPaths.delete(o),this._ignoredPaths.delete(o+Cu),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=i.length),this.options.persistent&&(this._readyCount*=2),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=Cn(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+Cu),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||En]=u.getChildren().sort()}),e}emitWithAll(e,u){this.emit(...u),e!==du&&this.emit(hu,...u)}async _emit(e,u,s,n,r){if(this.closed)return;const i=this.options;tl&&(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 a;if(D&&(a=this._pendingWrites.get(u)))return a.lastChange=new Date,this;if(i.atomic){if(e===hn)return this._pendingUnlinks.set(u,o),setTimeout(()=>{this._pendingUnlinks.forEach((c,f)=>{this.emit(...c),this.emit(hu,...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,l)=>{f?(e=o[0]=du,o[1]=f,this.emitWithAll(e,o)):l&&(o.length>2?o[2]=l:o.push(l),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===Ma||e===xe)){const c=i.cwd?v.join(i.cwd,u):u;let f;try{f=await nl(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(du,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 a=n.get(u),c=a?a.count:0;return n.delete(u),clearTimeout(i),a&&clearTimeout(a.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=a=>{lu.stat(i,(c,f)=>{if(c||!this._pendingWrites.has(e)){c&&c.code!=="ENOENT"&&n(c);return}const l=Number(new Date);a&&f.size!==a.size&&(this._pendingWrites.get(e).lastChange=l);const E=this._pendingWrites.get(e);l-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&&za.test(e))return!0;if(!this._userIgnored){const{cwd:s}=this.options,n=this.options.ignored,r=n&&n.map(mn(s)),i=_u(r).filter(D=>typeof D===gu&&!fu(D)).map(D=>D+Cu),o=this._getGlobIgnored().map(mn(s)).concat(r,i);this._userIgnored=cu(o,void 0,Fu)}return this._userIgnored([e,u])}_isntIgnored(e,u){return!this._isIgnored(e,u)}_getWatchHelpers(e,u){const s=u||this.options.disableGlobbing||!fu(e)?e:Ha(e),n=this.options.followSymlinks;return new ll(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 ol(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!=null?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(l=>this._remove(n,l));const D=this._getWatchedDir(e),a=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?Wa:hn;a&&!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:hu,alwaysStat:!0,lstat:!0,...u};let n=Na(e,s);return this._streams.add(n),n.once(ja,()=>{n=void 0}),n.once(Ua,()=>{n&&(this._streams.delete(n),n=void 0)}),n}}const fl=(t,e)=>{const u=new cl(e);return u.add(t),u};var hl=fl;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 _n={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=>_n.enabled&&_n.supportLevel>=u?s+(""+i).replace(r,s)+n:""+i}const He=Ne(33,39),dl=Ne(90,39),El=Ne(92,39),pl=Ne(95,39),Cl=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}},An=(t,e=process.argv.slice(2))=>(Ru(t,e,{ignore:at()}),e),Fl=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}}},yn=async()=>{const t=Pn.createServer(u=>{u.on("data",Fl(s=>{const n=JSON.parse(s.toString());t.emit("data",n)}))}),e=Mn(process.pid);return await te.promises.mkdir(kn,{recursive:!0}),await new Promise((u,s)=>{t.listen(e,u),t.on("error",s)}),t.unref(),process.on("exit",()=>{if(t.close(),process.platform!=="win32")try{te.rmSync(e)}catch{}}),t},gl=()=>new Date().toLocaleTimeString(),Le=(...t)=>console.log(dl(gl()),Cl("[tsx]"),...t),ml="\x1Bc",_l=(t,e)=>{let u;return function(){u&&clearTimeout(u),u=setTimeout(()=>Reflect.apply(t,this,arguments),e)}},wn={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"}},Al=ni({name:"watch",parameters:["<script path>"],flags:wn,help:{description:"Run the script and watch for changes"},ignoreArgv:at(!1)},async t=>{const e=An(wn,process.argv.slice(3)),u={noCache:t.flags.noCache,tsconfigPath:t.flags.tsconfig,clearScreen:t.flags.clearScreen,ignore:t.flags.ignore,ipc:!0};let s,n=!1;(await yn()).on("data",l=>{if(l&&typeof l=="object"&&"type"in l&&l.type==="dependency"&&"path"in l&&typeof l.path=="string"){const E=l.path.startsWith("file:")?xn(l.path):l.path;K.isAbsolute(E)&&f.add(E)}});const i=()=>{if(!n)return os(e,u)};let o=!1;const D=async(l,E="SIGTERM",p=5e3)=>{let F=!1;const A=new Promise(B=>{l.on("exit",N=>{F=!0,o=!1,B(N)})});return o=!0,l.kill(E),setTimeout(()=>{F||(Le(He(`Process didn't exit in ${Math.floor(p/1e3)}s. Force killing...`)),l.kill("SIGKILL"))},p),await A},a=_l(async(l,E)=>{const p=l?`${l?pl(l):""}${E?` in ${El(`./${E}`)}`:""}`:"";if(o){Le(p,He("Process hasn't exited. Killing process...")),s.kill("SIGKILL");return}s&&(s.exitCode===null?(Le(p,He("Restarting...")),await D(s)):Le(p,He("Rerunning...")),u.clearScreen&&process.stdout.write(ml)),s=i()},100);a();const c=l=>{n=!0,(s==null?void 0:s.exitCode)===null?(o&&Le(He("Previous process hasn't exited yet. Force killing...")),D(s,o?"SIGKILL":l).then(E=>{process.exit(E!=null?E:0)},()=>{})):process.exit(ft.signals[l])};process.on("SIGINT",c),process.on("SIGTERM",c);const f=hl(t._,{cwd:process.cwd(),ignoreInitial:!0,ignored:["**/.*/**","**/.*","**/{node_modules,bower_components,vendor}/**",...u.ignore],ignorePermissionErrors:!0}).on("all",a);process.stdin.on("data",()=>a("Return key"))}),yl=(t,e)=>{let u;e.on("data",r=>{r&&r.type==="signal"&&u&&u(r.signal)});const s=()=>{const r=new Promise(i=>{setTimeout(()=>i(void 0),30),u=i});return r.then(()=>{u=void 0},()=>{}),r},n=async r=>{await s()!==r&&(t.kill(r),await s()!==r&&(t.on("exit",()=>{const D=ft.signals[r];process.exit(128+D)}),t.kill("SIGKILL")))};process.on("SIGINT",n),process.on("SIGTERM",n)},Rn={noCache:{type:Boolean,description:"Disable caching"},tsconfig:{type:String,description:"Custom tsconfig.json path"}};Ku({name:"tsx",parameters:["[script path]"],commands:[Al],flags:{...Rn,version:{type:Boolean,alias:"v",description:"Show version"},help:{type:Boolean,alias:"h",description:"Show help"}},help:!1,ignoreArgv:at()},async t=>{t.flags.version?process.stdout.write(`tsx v${$n}
|
|
53
|
+
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",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 FD=Yt,{MAX_LENGTH:Xs,CHAR_BACKSLASH:Zt,CHAR_BACKTICK:gD,CHAR_COMMA:mD,CHAR_DOT:_D,CHAR_LEFT_PARENTHESES:AD,CHAR_RIGHT_PARENTHESES:yD,CHAR_LEFT_CURLY_BRACE:wD,CHAR_RIGHT_CURLY_BRACE:RD,CHAR_LEFT_SQUARE_BRACKET:Qs,CHAR_RIGHT_SQUARE_BRACKET:Zs,CHAR_DOUBLE_QUOTE:bD,CHAR_SINGLE_QUOTE:vD,CHAR_NO_BREAK_SPACE:BD,CHAR_ZERO_WIDTH_NOBREAK_SPACE:SD}=CD,$D=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let u=e||{},s=typeof u.maxLength=="number"?Math.min(Xs,u.maxLength):Xs;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,a=t.length,c=0,f=0,l;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"});c<a;)if(i=r[r.length-1],l=E(),!(l===SD||l===BD)){if(l===Zt){p({type:"text",value:(e.keepEscaping?l:"")+E()});continue}if(l===Zs){p({type:"text",value:"\\"+l});continue}if(l===Qs){D++;let F;for(;c<a&&(F=E());){if(l+=F,F===Qs){D++;continue}if(F===Zt){l+=E();continue}if(F===Zs&&(D--,D===0))break}p({type:"text",value:l});continue}if(l===AD){i=p({type:"paren",nodes:[]}),r.push(i),p({type:"text",value:l});continue}if(l===yD){if(i.type!=="paren"){p({type:"text",value:l});continue}i=r.pop(),p({type:"text",value:l}),i=r[r.length-1];continue}if(l===bD||l===vD||l===gD){let F=l,A;for(e.keepQuotes!==!0&&(l="");c<a&&(A=E());){if(A===Zt){l+=A+E();continue}if(A===F){e.keepQuotes===!0&&(l+=A);break}l+=A}p({type:"text",value:l});continue}if(l===wD){f++;let A={type:"brace",open:!0,close:!1,dollar:o.value&&o.value.slice(-1)==="$"||i.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};i=p(A),r.push(i),p({type:"open",value:l});continue}if(l===RD){if(i.type!=="brace"){p({type:"text",value:l});continue}let F="close";i=r.pop(),i.close=!0,p({type:F,value:l}),f--,i=r[r.length-1];continue}if(l===mD&&f>0){if(i.ranges>0){i.ranges=0;let F=i.nodes.shift();i.nodes=[F,{type:"text",value:FD(i)}]}p({type:"comma",value:l}),i.commas++;continue}if(l===_D&&f>0&&i.commas===0){let F=i.nodes;if(f===0||F.length===0){p({type:"text",value:l});continue}if(o.type==="dot"){if(i.range=[],o.value+=l,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+l,o=A,i.ranges--;continue}p({type:"dot",value:l});continue}p({type:"text",value:l})}do if(i=r.pop(),i.type!=="root"){i.nodes.forEach(B=>{B.nodes||(B.type==="open"&&(B.isOpen=!0),B.type==="close"&&(B.isClose=!0),B.nodes||(B.type="text"),B.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 TD=$D;const Js=Yt,xD=hD,OD=pD,ND=TD,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={})=>ND(t,e),Y.stringify=(t,e={})=>Js(typeof t=="string"?Y.parse(t,e):t,e),Y.compile=(t,e={})=>(typeof t=="string"&&(t=Y.parse(t,e)),xD(t,e)),Y.expand=(t,e={})=>{typeof t=="string"&&(t=Y.parse(t,e));let u=OD(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 HD=Y,LD=["3dm","3ds","3g2","3gp","7z","a","aac","adp","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"],ID=LD;const PD=K,kD=ID,MD=new Set(kD);var WD=t=>MD.has(PD.extname(t).slice(1).toLowerCase()),ut={};(function(t){const{sep:e}=K,{platform:u}=process,s=Au;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_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 se=J,I=K,{promisify:ve}=me,GD=WD,{isWindows:jD,isLinux:UD,EMPTY_FN:KD,EMPTY_STR:VD,KEY_LISTENERS:Ce,KEY_ERR:Jt,KEY_RAW:Be,HANDLER_KEYS:zD,EV_CHANGE:st,EV_ADD:nt,EV_ADD_DIR:YD,EV_ERROR:en,STR_DATA:qD,STR_END:XD,BRACE_START:QD,STAR:ZD}=ut,JD="watch",ea=ve(se.open),tn=ve(se.stat),ta=ve(se.lstat),ua=ve(se.close),eu=ve(se.realpath),sa={lstat:ta,stat:tn},tu=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},Se=(t,e,u)=>{let s=t[e];s instanceof Set||(t[e]=s=new Set([s])),s.add(u)},na=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]},un=t=>t instanceof Set?t.size===0:!t,rt=new Map;function sn(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 se.watch(t,e,r)}catch(i){s(i)}}const it=(t,e,u,s,n)=>{const r=rt.get(t);r&&tu(r[e],i=>{i(u,s,n)})},ra=(t,e,u,s)=>{const{listener:n,errHandler:r,rawEmitter:i}=s;let o=rt.get(e),D;if(!u.persistent)return D=sn(t,u,n,r,i),D.close.bind(D);if(o)Se(o,Ce,n),Se(o,Jt,r),Se(o,Be,i);else{if(D=sn(t,u,it.bind(null,e,Ce),r,it.bind(null,e,Be)),!D)return;D.on(en,async a=>{const c=it.bind(null,e,Jt);if(o.watcherUnusable=!0,jD&&a.code==="EPERM")try{const f=await ea(t,"r");await ua(f),c(a)}catch{}else c(a)}),o={listeners:n,errHandlers:r,rawEmitters:i,watcher:D},rt.set(e,o)}return()=>{$e(o,Ce,n),$e(o,Jt,r),$e(o,Be,i),un(o.listeners)&&(o.watcher.close(),rt.delete(e),zD.forEach(na(o)),o.watcher=void 0,Object.freeze(o))}},uu=new Map,ia=(t,e,u,s)=>{const{listener:n,rawEmitter:r}=s;let i=uu.get(e);const o=i&&i.options;return o&&(o.persistent<u.persistent||o.interval>u.interval)&&(i.listeners,i.rawEmitters,se.unwatchFile(e),i=void 0),i?(Se(i,Ce,n),Se(i,Be,r)):(i={listeners:n,rawEmitters:r,options:u,watcher:se.watchFile(e,u,(D,a)=>{tu(i.rawEmitters,f=>{f(st,e,{curr:D,prev:a})});const c=D.mtimeMs;(D.size!==a.size||c>a.mtimeMs||c===0)&&tu(i.listeners,f=>f(t,D))})},uu.set(e,i)),()=>{$e(i,Ce,n),$e(i,Be,r),un(i.listeners)&&(uu.delete(e),se.unwatchFile(e),i.options=i.watcher=void 0,Object.freeze(i))}};let oa=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=KD);let a;return s.usePolling?(D.interval=s.enableBinaryInterval&&GD(r)?s.binaryInterval:s.interval,a=ia(e,o,D,{listener:u,rawEmitter:this.fsw._emitRaw})):a=ra(e,o,D,{listener:u,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),a}_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(JD,e,5)){if(!f||f.mtimeMs===0)try{const l=await tn(e);if(this.fsw.closed)return;const E=l.atimeMs,p=l.mtimeMs;(!E||E<=p||p!==o.mtimeMs)&&this.fsw._emit(st,e,l),UD&&o.ino!==l.ino?(this.fsw._closeFile(c),o=l,this.fsw._addPathCloser(c,this._watchWithNodeFs(e,D))):o=l}catch{this.fsw._remove(n,r)}else if(i.has(r)){const l=f.atimeMs,E=f.mtimeMs;(!l||l<=E||E!==o.mtimeMs)&&this.fsw._emit(st,e,f),o=f}}},a=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 a}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 eu(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,VD),!s.hasGlob&&(o=this.fsw._throttle("readdir",e,1e3),!o))return;const D=this.fsw._getWatchedDir(s.path),a=new Set;let c=this.fsw._readdirp(e,{fileFilter:f=>s.filterPath(f),directoryFilter:f=>s.filterDir(f),depth:0}).on(qD,async f=>{if(this.fsw.closed){c=void 0;return}const l=f.path;let E=I.join(e,l);if(a.add(l),!(f.stats.isSymbolicLink()&&await this._handleSymlink(f,e,E,l))){if(this.fsw.closed){c=void 0;return}(l===n||!n&&!D.has(l))&&(this.fsw._incrReadyCount(),E=I.join(r,I.relative(r,E)),this._addToNodeFs(E,u,s,i+1))}}).on(en,this._boundHandleError);return new Promise(f=>c.once(XD,()=>{if(this.fsw.closed){c=void 0;return}const l=o?o.clear():!1;f(),D.getChildren().filter(E=>E!==e&&!a.has(E)&&(!s.hasGlob||s.filterPath({fullPath:I.resolve(e,E)}))).forEach(E=>{this.fsw._remove(e,E)}),c=void 0,l&&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)),a=D.has(I.basename(e));!(s&&this.fsw.options.ignoreInitial)&&!r&&!a&&(!i.hasGlob||i.globFilter(e))&&this.fsw._emit(YD,e,u),D.add(I.basename(e)),this.fsw._getWatchedDir(e);let c,f;const l=this.fsw.options.depth;if((l==null||n<=l)&&!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 sa[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,D))return i(),!1;const a=this.fsw.options.followSymlinks&&!e.includes(ZD)&&!e.includes(QD);let c;if(D.isDirectory()){const f=I.resolve(e),l=a?await eu(e):e;if(this.fsw.closed||(c=await this._handleDir(o.watchPath,D,u,n,r,o,l),this.fsw.closed))return;f!==l&&l!==void 0&&this.fsw._symlinkPaths.set(f,l)}else if(D.isSymbolicLink()){const f=a?await eu(e):e;if(this.fsw.closed)return;const l=I.dirname(o.watchPath);if(this.fsw._getWatchedDir(l).add(o.watchPath),this.fsw._emit(nt,o.watchPath,D),c=await this._handleDir(l,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 Da=oa,su={exports:{}};const nu=J,P=K,{promisify:ru}=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:iu,EV_CHANGE:aa,EV_ADD_DIR:nn,EV_UNLINK:ot,EV_ERROR:la,STR_DATA:ca,STR_END:fa,FSEVENT_CREATED:ha,FSEVENT_MODIFIED:da,FSEVENT_DELETED:Ea,FSEVENT_MOVED:pa,FSEVENT_UNKNOWN:Ca,FSEVENT_TYPE_FILE:Fa,FSEVENT_TYPE_DIRECTORY:Te,FSEVENT_TYPE_SYMLINK:rn,ROOT_GLOBSTAR:on,DIR_SUFFIX:ga,DOT_SLASH:Dn,FUNCTION_TYPE:ou,EMPTY_FN:ma,IDENTITY_FN:_a}=ut,Aa=t=>isNaN(t)?{}:{depth:t},Du=ru(nu.stat),ya=ru(nu.lstat),an=ru(nu.realpath),wa={stat:Du,lstat:ya},le=new Map,Ra=10,ba=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),va=(t,e)=>({stop:Fe.watch(t,e)});function Ba(t,e,u,s){let n=P.extname(e)?P.dirname(e):e;const r=P.dirname(n);let i=le.get(n);Sa(r)&&(n=r);const o=P.resolve(t),D=o!==e,a=(f,l,E)=>{D&&(f=f.replace(e,o)),(f===o||!f.indexOf(o+P.sep))&&u(f,l,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(a):(i={listeners:new Set([a]),rawEmitter:s,watcher:va(n,(f,l)=>{if(!i.listeners.size)return;const E=Fe.getInfo(f,l);i.listeners.forEach(p=>{p(f,l,E)}),i.rawEmitter(E.event,f,E)})},le.set(n,i)),()=>{const f=i.listeners;if(f.delete(a),!f.size&&(le.delete(n),i.watcher))return i.watcher.stop().then(()=>{i.rawEmitter=i.watcher=void 0,Object.freeze(i)})}}const Sa=t=>{let e=0;for(const u of le.keys())if(u.indexOf(t)===0&&(e++,e>=Ra))return!0;return!1},$a=()=>Fe&&le.size<128,au=(t,e)=>{let u=0;for(;!t.indexOf(e)&&(t=P.dirname(t))!==e;)u++;return u},ln=(t,e)=>t.type===Te&&e.isDirectory()||t.type===rn&&e.isSymbolicLink()||t.type===Fa&&e.isFile();let Ta=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+on),!0;s.delete(e),s.delete(e+on)}addOrChange(e,u,s,n,r,i,o,D){const a=r.has(i)?aa:iu;this.handleEvent(a,e,u,s,n,r,i,o,D)}async checkExists(e,u,s,n,r,i,o,D){try{const a=await Du(e);if(this.fsw.closed)return;ln(o,a)?this.addOrChange(e,u,s,n,r,i,o,D):this.handleEvent(ot,e,u,s,n,r,i,o,D)}catch(a){a.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,a){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===iu){if(D.type===Te&&this.fsw._getWatchedDir(u),D.type===rn&&a.followSymlinks){const f=a.depth===void 0?void 0:au(s,n)+1;return this._addToFsEvents(u,!1,!0,f)}this.fsw._getWatchedDir(r).add(o)}const c=D.type===Te?e+ga:e;this.fsw._emit(c,u),c===nn&&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=Ba(e,u,async(D,a,c)=>{if(this.fsw.closed||r.depth!==void 0&&au(D,u)>r.depth)return;const f=s(P.join(e,P.relative(e,D)));if(n&&!n(f))return;const l=P.dirname(f),E=P.basename(f),p=this.fsw._getWatchedDir(c.type===Te?f:l);if(ba.has(a)||c.event===Ca)if(typeof r.ignored===ou){let F;try{F=await Du(f)}catch{}if(this.fsw.closed||this.checkIgnored(f,F))return;ln(c,F)?this.addOrChange(f,D,u,l,p,E,c,r):this.handleEvent(ot,f,D,u,l,p,E,c,r)}else this.checkExists(f,D,u,l,p,E,c,r);else switch(c.event){case ha:case da:return this.addOrChange(f,D,u,l,p,E,c,r);case Ea:case pa:return this.checkExists(f,D,u,l,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 an(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!==Dn?o=i.replace(r,e):i!==Dn&&(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)),a=P.basename(i);o&&this.fsw._getWatchedDir(i),!D.has(a)&&(D.add(a),(!n.ignoreInitial||r===!0)&&this.fsw._emit(o?nn:iu,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===ou?u:_a,o=this.fsw._getWatchHelpers(e);try{const D=await wa[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:a=>o.filterPath(a),directoryFilter:a=>o.filterDir(a),...Aa(r.depth-(n||0))}).on(ca,a=>{if(this.fsw.closed||a.stats.isDirectory()&&!o.filterPath(a))return;const c=P.join(o.watchPath,a.path),{fullPath:f}=a;if(o.followSymlinks&&a.stats.isSymbolicLink()){const l=r.depth===void 0?void 0:au(c,P.resolve(o.watchPath))+1;this._handleFsEventsSymlink(c,f,i,l)}else this.emitAdd(c,a.stats,i,r,s)}).on(la,ma).on(fa,()=>{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===ou)this.initWatch(void 0,e,o,i);else{let D;try{D=await an(o.watchPath)}catch{}this.initWatch(D,e,o,i)}}};su.exports=Ta,su.exports.canUse=$a;var xa=su.exports;const{EventEmitter:Oa}=Ln,lu=J,v=K,{promisify:cn}=me,Na=So,cu=Ho.default,Ha=zo,fu=Ts,La=HD,Ia=bs,Pa=Da,fn=xa,{EV_ALL:hu,EV_READY:ka,EV_ADD:Dt,EV_CHANGE:xe,EV_UNLINK:hn,EV_ADD_DIR:Ma,EV_UNLINK_DIR:Wa,EV_RAW:Ga,EV_ERROR:du,STR_CLOSE:ja,STR_END:Ua,BACK_SLASH_RE:Ka,DOUBLE_SLASH_RE:dn,SLASH_OR_BACK_SLASH_RE:Va,DOT_RE:za,REPLACER_RE:Ya,SLASH:Eu,SLASH_SLASH:qa,BRACE_START:Xa,BANG:pu,ONE_DOT:En,TWO_DOTS:Qa,GLOBSTAR:Za,SLASH_GLOBSTAR:Cu,ANYMATCH_OPTS:Fu,STRING_TYPE:gu,FUNCTION_TYPE:Ja,EMPTY_STR:mu,EMPTY_FN:el,isWindows:tl,isMacos:ul,isIBMi:sl}=ut,nl=cn(lu.stat),rl=cn(lu.readdir),_u=(t=[])=>Array.isArray(t)?t:[t],pn=(t,e=[])=>(t.forEach(u=>{Array.isArray(u)?pn(u,e):e.push(u)}),e),Cn=t=>{const e=pn(_u(t));if(!e.every(u=>typeof u===gu))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(gn)},Fn=t=>{let e=t.replace(Ka,Eu),u=!1;for(e.startsWith(qa)&&(u=!0);e.match(dn);)e=e.replace(dn,Eu);return u&&(e=Eu+e),e},gn=t=>Fn(v.normalize(Fn(t))),mn=(t=mu)=>e=>typeof e!==gu?e:gn(v.isAbsolute(e)?e:v.join(t,e)),il=(t,e)=>v.isAbsolute(t)?t:t.startsWith(pu)?pu+v.join(e,t.slice(1)):v.join(e,t),q=(t,e)=>t[e]===void 0;class ol{constructor(e,u){this.path=e,this._removeWatcher=u,this.items=new Set}add(e){const{items:u}=this;u&&e!==En&&e!==Qa&&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 rl(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 Dl="stat",al="lstat";class ll{constructor(e,u,s,n){this.fsw=n,this.path=e=e.replace(Ya,mu),this.watchPath=u,this.fullWatchPath=v.resolve(u),this.hasGlob=u!==e,e===mu&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&s?void 0:!1,this.globFilter=this.hasGlob?cu(e,void 0,Fu):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(r=>{r.length>1&&r.pop()}),this.followSymlinks=s,this.statMethod=s?Dl:al}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===Ja?this.globFilter(s):!0)&&this.fsw._isntIgnored(s,u)&&this.fsw._hasReadPermissions(u)}getDirParts(e){if(!this.hasGlob)return[];const u=[];return(e.includes(Xa)?La.expand(e):[e]).forEach(n=>{u.push(v.relative(this.watchPath,n).split(Va))}),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===Za&&(s=!0),s||!u[0][i]||cu(r,u[0][i],Fu))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class cl extends Oa{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),fn.canUse()||(u.useFsEvents=!1),q(u,"usePolling")&&!u.useFsEvents&&(u.usePolling=ul),sl&&(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=_u(u.ignored));let o=0;this._emitReady=()=>{o++,o>=this._readyCount&&(this._emitReady=el,this._readyEmitted=!0,process.nextTick(()=>this.emit(ka)))},this._emitRaw=(...D)=>this.emit(Ga,...D),this._readyEmitted=!1,this.options=u,u.useFsEvents?this._fsEventsHandler=new fn(this):this._nodeFsHandler=new Pa(this),Object.freeze(u)}add(e,u,s){const{cwd:n,disableGlobbing:r}=this.options;this.closed=!1;let i=Cn(e);return n&&(i=i.map(o=>{const D=il(o,n);return r||!fu(o)?D:Ia(D)})),i=i.filter(o=>o.startsWith(pu)?(this._ignoredPaths.add(o.slice(1)),!1):(this._ignoredPaths.delete(o),this._ignoredPaths.delete(o+Cu),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=i.length),this.options.persistent&&(this._readyCount*=2),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=Cn(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+Cu),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||En]=u.getChildren().sort()}),e}emitWithAll(e,u){this.emit(...u),e!==du&&this.emit(hu,...u)}async _emit(e,u,s,n,r){if(this.closed)return;const i=this.options;tl&&(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 a;if(D&&(a=this._pendingWrites.get(u)))return a.lastChange=new Date,this;if(i.atomic){if(e===hn)return this._pendingUnlinks.set(u,o),setTimeout(()=>{this._pendingUnlinks.forEach((c,f)=>{this.emit(...c),this.emit(hu,...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,l)=>{f?(e=o[0]=du,o[1]=f,this.emitWithAll(e,o)):l&&(o.length>2?o[2]=l:o.push(l),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===Ma||e===xe)){const c=i.cwd?v.join(i.cwd,u):u;let f;try{f=await nl(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(du,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 a=n.get(u),c=a?a.count:0;return n.delete(u),clearTimeout(i),a&&clearTimeout(a.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=a=>{lu.stat(i,(c,f)=>{if(c||!this._pendingWrites.has(e)){c&&c.code!=="ENOENT"&&n(c);return}const l=Number(new Date);a&&f.size!==a.size&&(this._pendingWrites.get(e).lastChange=l);const E=this._pendingWrites.get(e);l-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&&za.test(e))return!0;if(!this._userIgnored){const{cwd:s}=this.options,n=this.options.ignored,r=n&&n.map(mn(s)),i=_u(r).filter(D=>typeof D===gu&&!fu(D)).map(D=>D+Cu),o=this._getGlobIgnored().map(mn(s)).concat(r,i);this._userIgnored=cu(o,void 0,Fu)}return this._userIgnored([e,u])}_isntIgnored(e,u){return!this._isIgnored(e,u)}_getWatchHelpers(e,u){const s=u||this.options.disableGlobbing||!fu(e)?e:Ha(e),n=this.options.followSymlinks;return new ll(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 ol(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!=null?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(l=>this._remove(n,l));const D=this._getWatchedDir(e),a=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?Wa:hn;a&&!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:hu,alwaysStat:!0,lstat:!0,...u};let n=Na(e,s);return this._streams.add(n),n.once(ja,()=>{n=void 0}),n.once(Ua,()=>{n&&(this._streams.delete(n),n=void 0)}),n}}const fl=(t,e)=>{const u=new cl(e);return u.add(t),u};var hl=fl;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 _n={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=>_n.enabled&&_n.supportLevel>=u?s+(""+i).replace(r,s)+n:""+i}const He=Ne(33,39),dl=Ne(90,39),El=Ne(92,39),pl=Ne(95,39),Cl=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}},An=(t,e=process.argv.slice(2))=>(Ru(t,e,{ignore:at()}),e),Fl=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}}},yn=async()=>{const t=Pn.createServer(u=>{u.on("data",Fl(s=>{const n=JSON.parse(s.toString());t.emit("data",n)}))}),e=Mn(process.pid);return await J.promises.mkdir(kn,{recursive:!0}),await J.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(),process.platform!=="win32")try{J.rmSync(e)}catch{}}),t},gl=()=>new Date().toLocaleTimeString(),Le=(...t)=>console.log(dl(gl()),Cl("[tsx]"),...t),ml="\x1Bc",_l=(t,e)=>{let u;return function(){u&&clearTimeout(u),u=setTimeout(()=>Reflect.apply(t,this,arguments),e)}},wn={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"}},Al=ni({name:"watch",parameters:["<script path>"],flags:wn,help:{description:"Run the script and watch for changes"},ignoreArgv:at(!1)},async t=>{const e=An(wn,process.argv.slice(3)),u={noCache:t.flags.noCache,tsconfigPath:t.flags.tsconfig,clearScreen:t.flags.clearScreen,ignore:t.flags.ignore,ipc:!0};let s,n=!1;(await yn()).on("data",l=>{if(l&&typeof l=="object"&&"type"in l&&l.type==="dependency"&&"path"in l&&typeof l.path=="string"){const E=l.path.startsWith("file:")?xn(l.path):l.path;K.isAbsolute(E)&&f.add(E)}});const i=()=>{if(!n)return os(e,u)};let o=!1;const D=async(l,E="SIGTERM",p=5e3)=>{let F=!1;const A=new Promise(B=>{l.on("exit",N=>{F=!0,o=!1,B(N)})});return o=!0,l.kill(E),setTimeout(()=>{F||(Le(He(`Process didn't exit in ${Math.floor(p/1e3)}s. Force killing...`)),l.kill("SIGKILL"))},p),await A},a=_l(async(l,E)=>{const p=l?`${l?pl(l):""}${E?` in ${El(`./${E}`)}`:""}`:"";if(o){Le(p,He("Process hasn't exited. Killing process...")),s.kill("SIGKILL");return}s&&(s.exitCode===null?(Le(p,He("Restarting...")),await D(s)):Le(p,He("Rerunning...")),u.clearScreen&&process.stdout.write(ml)),s=i()},100);a();const c=l=>{n=!0,(s==null?void 0:s.exitCode)===null?(o&&Le(He("Previous process hasn't exited yet. Force killing...")),D(s,o?"SIGKILL":l).then(E=>{process.exit(E!=null?E:0)},()=>{})):process.exit(ft.signals[l])};process.on("SIGINT",c),process.on("SIGTERM",c);const f=hl(t._,{cwd:process.cwd(),ignoreInitial:!0,ignored:["**/.*/**","**/.*","**/{node_modules,bower_components,vendor}/**",...u.ignore],ignorePermissionErrors:!0}).on("all",a);process.stdin.on("data",()=>a("Return key"))}),yl=(t,e)=>{let u;e.on("data",r=>{r&&r.type==="signal"&&u&&u(r.signal)});const s=()=>{const r=new Promise(i=>{setTimeout(()=>i(void 0),30),u=i});return r.then(()=>{u=void 0},()=>{}),r},n=async r=>{await s()!==r&&(t.kill(r),await s()!==r&&(t.on("exit",()=>{const D=ft.signals[r];process.exit(128+D)}),t.kill("SIGKILL")))};process.on("SIGINT",n),process.on("SIGTERM",n)},Rn={noCache:{type:Boolean,description:"Disable caching"},tsconfig:{type:String,description:"Custom tsconfig.json path"}};Ku({name:"tsx",parameters:["[script path]"],commands:[Al],flags:{...Rn,version:{type:Boolean,alias:"v",description:"Show version"},help:{type:Boolean,alias:"h",description:"Show help"}},help:!1,ignoreArgv:at()},async t=>{t.flags.version?process.stdout.write(`tsx v${$n}
|
|
54
54
|
node `):t.flags.help&&(t.showHelp({description:"Node.js runtime enhanced with esbuild for loading TypeScript & ESM"}),console.log(`${"-".repeat(45)}
|
|
55
55
|
`));const e={eval:{type:String,alias:"e"},print:{type:String,alias:"p"}},{_:u,flags:s}=Ku({flags:{...e,inputType:String,test:Boolean},help:!1,ignoreArgv:at(!1)}),n=An({...Rn,...e}),i=["print","eval"].find(a=>!!s[a]);if(i){const{inputType:a}=s,c=s[i],f=Sn(c,{loader:"default",sourcefile:"/eval.ts",format:a==="module"?"esm":"cjs"});n.unshift(`--${i}`,f.code)}yu(Hn)&&s.test&&u.length===0&&n.push("**/{test,test/**/*,test-*,*[.-_]test}.?(c|m)@(t|j)s");const o=await yn(),D=os(n,{noCache:!!t.flags.noCache,tsconfigPath:t.flags.tsconfig});yl(D,o),process.send&&D.on("message",a=>{process.send(a)}),D.send&&process.on("message",a=>{D.send(a)}),D.on("close",a=>{a===null&&(a=ft.signals[D.signalCode]+128),process.exit(a)})});
|
package/dist/esm/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var O=require("worker_threads"),p=require("../node-features-c450ed54.cjs"),M=require("module"),v=require("../source-map.cjs"),h=require("path"),g=require("url"),R=require("../index-
|
|
1
|
+
"use strict";var O=require("worker_threads"),p=require("../node-features-c450ed54.cjs"),M=require("module"),v=require("../source-map.cjs"),h=require("path"),g=require("url"),R=require("../index-971a6964.cjs"),L=require("../resolve-ts-path-3fca13b7.cjs"),N=require("../client-2f0df4a6.cjs"),d=require("get-tsconfig"),E=require("fs");require("esbuild"),require("crypto"),require("os"),require("../temporary-directory-2a027842.cjs"),require("net"),require("../get-pipe-path-86e97fc9.cjs");var m=typeof document<"u"?document.currentScript:null;const D=()=>{v.installSourceMapSupport(),M.register("./index.mjs",{parentURL:typeof document>"u"?require("url").pathToFileURL(__filename).href:m&&m.src||new URL("esm/index.cjs",document.baseURI).href,data:!0})},l=new Map,b=async e=>{if(l.has(e))return l.get(e);if(!await E.promises.access(e).then(()=>!0,()=>!1)){l.set(e,void 0);return}const r=await E.promises.readFile(e,"utf8");try{const a=JSON.parse(r);return l.set(e,a),a}catch{throw new Error(`Error parsing: ${e}`)}},x=async e=>{let t=new URL("package.json",e);for(;!t.pathname.endsWith("/node_modules/package.json");){const r=g.fileURLToPath(t),a=await b(r);if(a)return a;const o=t;if(t=new URL("../package.json",t),t.pathname===o.pathname)break}},A=async e=>{var t;const r=await x(e);return(t=r==null?void 0:r.type)!=null?t:"commonjs"},f=process.env.TSX_TSCONFIG_PATH?{path:h.resolve(process.env.TSX_TSCONFIG_PATH),config:d.parseTsconfig(process.env.TSX_TSCONFIG_PATH)}:d.getTsconfig(),I=f&&d.createFilesMatcher(f),q=f&&d.createPathsMatcher(f),S="file://",y=/\.([cm]?ts|[tj]sx)($|\?)/,J=/\.json(?:$|\?)/,C=e=>{const t=h.extname(e);if(t===".json")return"json";if(t===".mjs"||t===".mts")return"module";if(t===".cjs"||t===".cts")return"commonjs"},W=e=>{const t=C(e);if(t)return t;if(y.test(e))return A(e)},k=v.installSourceMapSupport(),U=/\/(?:$|\?)/,G=async e=>{if(!e)throw new Error(`tsx must be loaded with --import instead of --loader
|
|
2
2
|
The --loader flag was deprecated in Node v20.6.0 and v18.19.0`)},H=()=>`
|
|
3
|
-
const require = getBuiltin('module').createRequire("${typeof document>"u"?require("url").pathToFileURL(__filename).href:
|
|
3
|
+
const require = getBuiltin('module').createRequire("${typeof document>"u"?require("url").pathToFileURL(__filename).href:m&&m.src||new URL("esm/index.cjs",document.baseURI).href}");
|
|
4
4
|
require('../source-map.cjs').installSourceMapSupport();
|
|
5
|
-
`,w=async(e,t,r)=>{const a=await e(t,r);return!a.format&&a.url.startsWith(S)&&(a.format=await W(a.url)),a},X=[".js",".json",".ts",".tsx",".jsx"]
|
|
5
|
+
`,w=async(e,t,r)=>{const a=await e(t,r);return!a.format&&a.url.startsWith(S)&&(a.format=await W(a.url)),a},X=[".js",".json",".ts",".tsx",".jsx"],_=async(e,t,r)=>{const[a,o]=e.split("?");let c;for(const n of X)try{return await w(r,a+n+(o?`?${o}`:""),t)}catch(s){if(c===void 0&&s instanceof Error){const{message:i}=s;s.message=s.message.replace(`${n}'`,"'"),s.stack=s.stack.replace(i,s.message),c=s}}throw c},j=async(e,t,r)=>{const a=U.test(e),o=a?"index":"/index",[c,n]=e.split("?");try{return await _(c+o+(n?`?${n}`:""),t,r)}catch(s){if(!a)try{return await _(e,t,r)}catch{}const i=s,{message:u}=i;throw i.message=i.message.replace(`${o.replace("/",h.sep)}'`,"'"),i.stack=i.stack.replace(u,i.message),i}},$=/^\.{1,2}\//,F=async(e,t,r,a)=>{var o;if(U.test(e))return await j(e,t,r);const c=e.startsWith(S)||$.test(e);if(q&&!c&&!((o=t.parentURL)!=null&&o.includes("/node_modules/"))){const n=q(e);for(const s of n)try{return await F(g.pathToFileURL(s).toString(),t,r)}catch{}}if(y.test(t.parentURL)){const n=L.resolveTsPath(e);if(n)for(const s of n)try{return await w(r,s,t)}catch(i){const{code:u}=i;if(u!=="ERR_MODULE_NOT_FOUND"&&u!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw i}}try{return await w(r,e,t)}catch(n){if(n instanceof Error&&!a){const{code:s}=n;if(s==="ERR_UNSUPPORTED_DIR_IMPORT")try{return await j(e,t,r)}catch(i){if(i.code!=="ERR_PACKAGE_IMPORT_NOT_DEFINED")throw i}if(s==="ERR_MODULE_NOT_FOUND")try{return await _(e,t,r)}catch{}}throw n}};let T;N.connectingToServer.then(e=>{T=e},()=>{});const P=p.isFeatureSupported(p.importAttributes)?"importAttributes":"importAssertions",z=async(e,t,r)=>{var a;T&&T({type:"dependency",path:e}),J.test(e)&&(t[P]||(t[P]={}),t[P].type="json");const o=await r(e,t);if(!o.source)return o;const c=e.startsWith("file://")?g.fileURLToPath(e):e,n=o.source.toString();if(o.format==="json"||y.test(e)){const s=await R.transform(n,c,{tsconfigRaw:(a=I)==null?void 0:a(c)});return{format:"module",source:k(s)}}if(o.format==="module"){const s=R.transformDynamicImport(c,n);s&&(o.source=k(s))}return o};p.isFeatureSupported(p.moduleRegister)&&O.isMainThread&&D(),exports.globalPreload=H,exports.initialize=G,exports.load=z,exports.resolve=F;
|