site/node_modules/tsx/dist/cli.mjs

56 lines
118 KiB
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
#!/usr/bin/env node
var $n=Object.defineProperty;var a=(t,e)=>$n(t,"name",{value:e,configurable:!0});import{constants as dt}from"node:os";import Tn from"tty";import{transformSync as xn}from"esbuild";import{v as On}from"./package-Bx1e9Vvg.mjs";import{r as We,g as Nn,i as Hn}from"./get-pipe-path-BHW2eJdv.mjs";import{pathToFileURL as Ln,fileURLToPath as In}from"node:url";import Pn from"child_process";import z from"path";import oe from"fs";import{i as wu,m as kn,t as Mn}from"./node-features-_8ZFwP_x.mjs";import Gn from"node:path";import Wn from"events";import _e from"util";import jn from"stream";import Ru from"os";import Un from"node:net";import Et from"node:fs";import{t as Kn}from"./temporary-directory-CwHp0_NW.mjs";import"module";const Vn="known-flag",zn="unknown-flag",Yn="argument",{stringify:Ae}=JSON,qn=/\B([A-Z])/g,Xn=a(t=>t.replace(qn,"-$1").toLowerCase(),"v$1"),{hasOwnProperty:Qn}=Object.prototype,ye=a((t,e)=>Qn.call(t,e),"w$2"),Zn=a(t=>Array.isArray(t),"L$2"),bu=a(t=>typeof t=="function"?[t,!1]:Zn(t)?[t[0],!0]:bu(t.type),"b$2"),Jn=a((t,e)=>t===Boolean?e!=="false":e,"d$2"),er=a((t,e)=>typeof e=="boolean"?e:t===Number&&e===""?Number.NaN:t(e),"m$1"),tr=/[\s.:=]/,ur=a(t=>{const e=`Flag name ${Ae(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(tr);if(u)throw new Error(`${e} cannot contain ${Ae(u?.[0])}`)},"B"),sr=a(t=>{const e={},u=a((s,n)=>{if(ye(e,s))throw new Error(`Duplicate flags named ${Ae(s)}`);e[s]=n},"r");for(const s in t){if(!ye(t,s))continue;ur(s);const n=t[s],r=[[],...bu(n),n];u(s,r);const i=Xn(s);if(s!==i&&u(i,r),"alias"in n&&typeof n.alias=="string"){const{alias:o}=n,D=`Flag alias ${Ae(o)} for flag ${Ae(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},"K$1"),nr=a((t,e)=>{const u={};for(const s in t){if(!ye(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},"_$2"),je="--",rr=/[.:=]/,ir=/^-{1,2}\w/,or=a(t=>{if(!ir.test(t))return;const e=!t.startsWith(je);let u=t.slice(e?1:2),s;const n=u.match(rr);if(n){const{index:r}=n;s=u.slice(r+1),u=u.slice(0,r)}return[u,s,e]},"N"),Dr=a((t,{onFlag:e,onArgument:u})=>{let s;const n=a((r,i)=>{if(typeof s!="function")return!0;s(r,i),s=void 0},"o");for(let r=0;r<t.length;r+=1){const i=t[r];if(i===je){n();const D=t.slice(r+1);u?.(D,[r],!0);break}const o=or(i);if(o){if(n(),!e)continue;const[D,c,f]=o;if(f)for(let h=0;h<D.length;h+=1){n();const l=h===D.length-1;s=e(D[h],l?c:void 0,[r,h+1,l])}else s=e(D,c,[r])}else n(i,[r])&&u?.([i],[r])}n()},"$$1"),ar=a((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)}},"E"),vu=a((t,e=process.argv.slice(2),{ignore:u}={})=>{const s=[],n=sr(t),r={},i=[];return i[je]=[],Dr(e,{onFlag(o,D,c){const f=ye(n,o);if(!u?.(f?Vn:zn,o,D)){if(f){const[h,l]=n[o],p=Jn(l,D),C=a((g,y)=>{s.push(c),y&&s.push(y),h.push(er(l,g||""))},"p");return p===void 0?C:C(p)}ye(r,o)||(r[o]=[]),r[o].push(D===void 0?!0:D),s.push(c)}},onArgument(o,D,c){u?.(Yn,e[D[0]])||(i.push(...o),c?(i[je]=o,e.splice(D[0])):s.push(D))}}),ar(e,s),{flags:nr(t,n),unknownFlags:r,_:i}},"U$2");var lr=Object.create,Ue=Object.defineProperty,cr=Object.defineProperties,fr=Object.getOwnPropertyDescriptor,hr=Object.getOwnPropertyDescriptors,dr=Object.getOwnPropertyNames,Su=Object.getOwnPropertySymbols,Er=Object.getPrototypeOf,Bu=Object.prototype.hasOwnProperty,pr=Object.prototype.propertyIsEnumerable,$u=a((t,e,u)=>e in t?Ue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):t[e]=u,"W$1"),Ke=a((t,e)=>{for(var u in e||(e={}))Bu.call(e,u)&&$u(t,u,e[u]);if(Su)for(var u of Su(e))pr.call(e,u)&&$u(t,u,e[u]);return t},"p"),pt=a((t,e)=>cr(t,hr(e)),"c"),Cr=a(t=>Ue(t,"__esModule",{value:!0}),"nD"),Fr=a((t,e)=>()=>(t&&(e=t(t=0)),e),"rD"),gr=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"iD"),mr=a((t,e,u,s)=>{if(e&&typeof e=="object"||typeof e=="
`).map(De)),"b$1"),vr=a(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=xu(u[r]);i>e[r]&&(e[r]=i)}}return e},"k$1");K();var Ou=/^\d+%$/,Nu={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},Sr=a((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"&&Ou.test(r)){s.push(pt(Ke({},Nu),{width:r,contentWidth:t[n]}));continue}if(r&&typeof r=="object"){let i=pt(Ke(Ke({},Nu),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},"sD");function Br(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"&&Ou.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,c=Math.ceil(u.paddingLeft/n*D),f=D-c;u.paddingLeft-=c,u.paddingRight-=f,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)}}a(Br,"aD");var Hu=a(()=>Object.assign([],{columns:0}),"G$1");function $r(t,e){let u=[Hu()],[s]=u;for(let n of t){let r=n.width+n.horizontalPadding;s.columns+r>e&&(s=Hu(),u.push(s)),s.push(n),s.columns+=r}for(let n of u){let r=n.reduce((l,p)=>l+p.width+p.horizontalPadding,0),i=e-r;if(i===0)continue;let o=n.filter(l=>"autoOverflow"in l),D=o.filter(l=>l.autoOverflow>0),c=D.reduce((l,p)=>l+p.autoOverflow,0),f=Math.min(c,i);for(let l of D){let p=Math.floor(l.autoOverflow/c*f);l.width+=p,i-=p}let h=Math.floor(i/o.length);for(let l=0;l<o.length;l+=1){let p=o[l];l===o.length-1?p.width+=i:p.width+=h,i-=h}}return u}a($r,"lD");function Tr(t,e,u){let s=Sr(u,e);return Br(s,t),$r(s,t)}a(Tr,"Z$1"),K(),K(),K();var Ct=10,Lu=a((t=0)=>e=>`\x1B[${e+t}m`,"U$1"),Iu=a((t=0)=>e=>`\x1B[${38+t};5;${e}m`,"V$1"),Pu=a((t=0)=>(e,u,s)=>`\x1B[${38+t};2;${e};${u};${s}m`,"Y");function xr(){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=Lu(),e.color.ansi256=Iu(),e.color.ansi16m=Pu(),e.bgColor.ansi=Lu(Ct),e.bgColor.ansi256=Iu(Ct),e.bgColor.ansi16m=Pu(Ct),Object.defineProperties(e,{rgbToAnsi256:{value:a((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),"value"),enumerable:!1},hexToRgb:{value:a(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===
`)];for(let[c,f]of D.entries()){if(s+=f,Ve.has(f)){let{groups:l}=new RegExp(`(?:\\${ku}(?<code>\\d+)m|\\${gt}(?<uri>.*)${Ft})`).exec(D.slice(c).join(""))||{groups:{}};if(l.code!==void 0){let p=Number.parseFloat(l.code);n=p===Hr?void 0:p}else l.uri!==void 0&&(r=l.uri.length===0?void 0:l.uri)}let h=Nr.codes.get(Number(n));D[c+1]===`
`?(r&&(s+=Wu("")),n&&h&&(s+=Gu(h))):f===`
`&&(n&&h&&(s+=Gu(n)),r&&(s+=Wu(r)))}return s},"dD");function Mr(t,e,u){return String(t).normalize().replace(/\r\n/g,`
`).split(`
`).map(s=>kr(s,e,u)).join(`
`)}a(Mr,"T$1");var ju=a(t=>Array.from({length:t}).fill(""),"X");function Gr(t,e){let u=[],s=0;for(let n of t){let r=0,i=n.map(D=>{var c;let f=(c=e[s])!=null?c:"";s+=1,D.preprocess&&(f=D.preprocess(f)),xu(f)>D.width&&(f=Mr(f,D.width,{hard:!0}));let h=f.split(`
`);if(D.postprocess){let{postprocess:l}=D;h=h.map((p,C)=>l.call(D,p,C))}return D.paddingTop&&h.unshift(...ju(D.paddingTop)),D.paddingBottom&&h.push(...ju(D.paddingBottom)),h.length>r&&(r=h.length),pt(Ke({},D),{lines:h})}),o=[];for(let D=0;D<r;D+=1){let c=i.map(f=>{var h;let l=(h=f.lines[D])!=null?h:"",p=Number.isFinite(f.width)?" ".repeat(f.width-De(l)):"",C=f.paddingLeftString;return f.align==="right"&&(C+=p),C+=l,f.align==="left"&&(C+=p),C+f.paddingRightString}).join("");o.push(c)}u.push(o.join(`
`))}return u.join(`
`)}a(Gr,"P");function Wr(t,e){if(!t||t.length===0)return"";let u=vr(t),s=u.length;if(s===0)return"";let{stdoutColumns:n,columns:r}=yr(e);if(r.length>s)throw new Error(`${r.length} columns defined, but only ${s} columns found`);let i=Tr(n,r,u);return t.map(o=>Gr(i,o)).join(`
`)}a(Wr,"mD"),K();var jr=["<",">","=",">=","<="];function Ur(t){if(!jr.includes(t))throw new TypeError(`Invalid breakpoint operator: ${t}`)}a(Ur,"xD");function Kr(t){let e=Object.keys(t).map(u=>{let[s,n]=u.split(" ");Ur(s);let r=Number.parseInt(n,10);if(Number.isNaN(r))throw new TypeError(`Invalid breakpoint value: ${n}`);let i=t[u];return{operator:s,breakpoint:r,value:i}}).sort((u,s)=>s.breakpoint-u.breakpoint);return u=>{var s;return(s=e.find(({operator:n,breakpoint:r})=>n==="="&&u===r||n===">"&&u>r||n==="<"&&u<r||n===">="&&u>=r||n==="<="&&u<=r))==null?void 0:s.value}}a(Kr,"wD");const Vr=a(t=>t.replace(/[\W_]([a-z\d])?/gi,(e,u)=>u?u.toUpperCase():""),"S"),zr=a(t=>t.replace(/\B([A-Z])/g,"-$1").toLowerCase(),"q"),Yr={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:a(t=>t.trim(),"preprocess")},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function qr(t){let e=!1;return{type:"table",data:{tableData:Object.keys(t).sort((u,s)=>u.localeCompare(s)).map(u=>{const s=t[u],n="alias"in s;return n&&(e=!0),{name:u,flag:s,flagFormatted:`--${zr(u)}`,aliasesEnabled:e,aliasFormatted:n?`-${s.alias}`:void 0}}).map(u=>(u.aliasesEnabled=e,[{type:"flagName",data:u},{type:"flagDescription",data:u}])),tableBreakpoints:Yr}}}a(qr,"D");const Uu=a(t=>!t||(t.version??(t.help?t.help.version:void 0)),"A"),Ku=a(t=>{const e="parent"in t&&t.parent?.name;return(e?`${e} `:"")+t.name},"C");function Xr(t){const e=[];t.name&&e.push(Ku(t));const u=Uu(t)??("parent"in t&&Uu(t.parent));if(u&&e.push(`v${u}`),e.length!==0)return{id:"name",type:"text",data:`${e.join(" ")}
`}}a(Xr,"R");function Qr(t){const{help:e}=t;if(!(!e||!e.description))return{id:"description",type:"text",data:`${e.description}
`}}a(Qr,"L");function Zr(t){const e=t.help||{};if("usage"in e)return e.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(e.usage)?e.usage.join(`
`):e.usage}}:void 0;if(t.name){const u=[],s=[Ku(t)];if(t.flags&&Object.keys(t.flags).length>0&&s.push("[flags...]"),t.parameters&&t.parameters.length>0){const{parameters:n}=t,r=n.indexOf("--"),i=r>-1&&n.slice(r+1).some(o=>o.startsWith("<"));s.push(n.map(o=>o!=="--"?o:i?"--":"[--]").join(" "))}if(s.length>1&&u.push(s.join(" ")),"commands"in t&&t.commands?.length&&u.push(`${t.name} <command>`),u.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:u.join(`
`)}}}}a(Zr,"T");function Jr(t){return!("commands"in t)||!t.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:t.commands.map(e=>[e.options.name,e.options.help?e.options.help.description:""]),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}a(Jr,"_");function ei(t){if(!(!t.flags||Object.keys(t.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:qr(t.flags),indentBody:0}}}a(ei,"k");function ti(t){const{help:e}=t;if(!e||!e.examples||e.examples.length===0)return;let{examples:u}=e;if(Array.isArray(u)&&(u=u.join(`
`)),u)return{id:"examples",type:"section",data:{title:"Examples:",body:u}}}a(ti,"F");function ui(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}}}a(ui,"H");const si=a(t=>[Xr,Qr,Zr,Jr,ei,ti,ui].map(e=>e(t)).filter(Boolean),"U"),ni=Tn.WriteStream.prototype.hasColors();class ri{static{a(this,"M")}text(e){return e}bold(e){return ni?`\x1B[1m${e}\x1B[22m`:e.toLocaleUpperCase()}indentText({text:e,spaces:u}){return e.replace(/^/gm," ".repeat(u))}heading(e){return this.bold(e)}section({title:e,body:u,indentBody:s=2}){return`${(e?`${this.heading(e)}
`:"")+(u?this.indentText({text:this.render(u),spaces:s}):"")}
`}table({tableData:e,tableOptions:u,tableBreakpoints:s}){return Wr(e.map(n=>n.map(r=>this.render(r))),s?Kr(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}){let u="description"in e?e.description??"":"";if("default"in e){let{default:s}=e;typeof s=="function"&&(s=s()),s&&(u+=` (default: ${this.flagDefault(s)})`)}return u}render(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(u=>this.render(u)).join(`
`);if("type"in e&&this[e.type]){const u=this[e.type];if(typeof u=="function")return u.call(this,e.data)}throw new Error(`Invalid node type: ${JSON.stringify(e)}`)}}const _t=/^[\w.-]+$/,{stringify:ee}=JSON,ii=/[|\\{}()[\]^$+*?.]/;function At(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 c=D.slice(-3)==="...";c&&(s=n,D=D.slice(0,-3));const f=D.match(ii);if(f)throw new Error(`Invalid parameter: ${ee(n)}. Invalid character found ${ee(f[0])}`);e.push({name:D,required:o,spread:c})}return e}a(At,"w");function yt(t,e,u,s){for(let n=0;n<e.length;n+=1){const{name:r,required:i,spread:o}=e[n],D=Vr(r);if(D in t)throw new Error(`Invalid parameter: ${ee(r)} is used more than once.`);const c=o?u.slice(n):u[n];if(o&&(n=e.length),i&&(!c||o&&c.length===0))return console.error(`Error: Missing required parameter ${ee(r)}
`),s(),process.exit(1);t[D]=c}}a(yt,"b");function oi(t){return t===void 0||t!==!1}a(oi,"W");function Vu(t,e,u,s){const n={...e.flags},r=e.version;r&&(n.version={type:Boolean,description:"Show version"});const{help:i}=e,o=oi(i);o&&!("help"in n)&&(n.help={type:Boolean,alias:"h",description:"Show help"});const D=vu(n,s,{ignore:e.ignoreArgv}),c=a(()=>{console.log(e.version)},"f");if(r&&D.flags.version===!0)return c(),process.exit(0);const f=new ri,h=o&&i?.render?i.render:C=>f.render(C),l=a(C=>{const g=si({...e,...C?{help:C}:{},flags:n});console.log(h(g,f))},"u");if(o&&D.flags.help===!0)return l(),process.exit(0);if(e.parameters){let{parameters:C}=e,g=D._;const y=C.indexOf("--"),B=C.slice(y+1),H=Object.create(null);if(y>-1&&B.length>0){C=C.slice(0,y);const $=D._["--"];g=g.slice(0,-$.length||void 0),yt(H,At(C),g,l),yt(H,At(B),$,l)}else yt(H,At(C),g,l);Object.assign(D._,H)}const p={...D,showVersion:c,showHelp:l};return typeof u=="function"&&u(p),{command:t,...p}}a(Vu,"x");function Di(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)}a(Di,"z");function zu(t,e,u=process.argv.slice(2)){if(!t)throw new Error("Options is required");if("name"in t&&(!t.name||!_t.test(t.name)))throw new Error(`Invalid script name: ${ee(t.name)}`);const s=u[0];if(t.commands&&_t.test(s)){const n=Di(s,t.commands);if(n)return Vu(n.options.name,{...n.options,parent:t},n.callback,u.slice(1))}return Vu(void 0,t,e,u)}a(zu,"Z");function ai(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(!_t.test(u))throw new Error(`Invalid command name ${JSON.stringify(u)}. Command names must be one word.`);return{options:t,callback:e}}a(ai,"G");var li=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ci(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}a(ci,"getDefaultExportFromCjs");var he={exports:{}},wt,Yu;function fi(){if(Yu)return wt;Yu=1,wt=s,s.sync=n;var t=oe;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 c=o[D].toLowerCase();if(c&&r.substr(-c.length).toLowerCase()===c)return!0}return!1}a(e,"checkPathExt");function u(r,i,o){return!r.isSymbolicLink()&&!r.isFile()?!1:e(i,o)}a(u,"checkStat");function s(r,i,o){t.stat(r,function(D,c){o(D,D?!1:u(c,r,i))})}a(s,"isexe");function n(r,i){return u(t.statSync(r),r,i)}return a(n,"sync"),wt}a(fi,"requireWindows");var Rt,qu;function hi(){if(qu)return Rt;qu=1,Rt=e,e.sync=u;var t=oe;function e(r,i,o){t.stat(r,function(D,c){o(D,D?!1:s(c,i))})}a(e,"isexe");function u(r,i){return s(t.statSync(r),i)}a(u,"sync");function s(r,i){return r.isFile()&&n(r,i)}a(s,"checkStat");function n(r,i){var o=r.mode,D=r.uid,c=r.gid,f=i.uid!==void 0?i.uid:process.getuid&&process.getuid(),h=i.gid!==void 0?i.gid:process.getgid&&process.getgid(),l=parseInt("100",8),p=parseInt("010",8),C=parseInt("001",8),g=l|p,y=o&C||o&p&&c===h||o&l&&D===f||o&g&&f===0;return y}return a(n,"checkMode"),Rt}a(hi,"requireMode");var ze;process.platform==="win32"||li.TESTING_WINDOWS?ze=fi():ze=hi();var di=bt;bt.sync=Ei;function bt(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){bt(t,e||{},function(r,i){r?n(r):s(i)})})}ze(t,e||{},function(s,n){s&&(s.code==="EACCES"||e&&e.ignoreErrors)&&(s=null,n=!1),u(s,n)})}a(bt,"isexe$1");function Ei(t,e){try{return ze.sync(t,e||{})}catch(u){if(e&&e.ignoreErrors||u.code==="EACCES")return!1;throw u}}a(Ei,"sync");const de=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Xu=z,pi=de?";":":",Qu=di,Zu=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),Ju=a((t,e)=>{const u=e.colon||pi,s=t.ma
* normalize-path <https://github.com/jonschlinkert/normalize-path>
*
* Copyright (c) 2014-2018, Jon Schlinkert.
* Released under the MIT License.
*/var Ss=a(function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return"/";var u=t.length;if(u<=1)return t;var s="";if(u>4&&t[3]==="\\"){var n=t[2];(n==="?"||n===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),s="//")}var r=t.split(/[/\\]+/);return e!==!1&&r[r.length-1]===""&&r.pop(),s+r.join("/")},"normalizePath$2"),Ho=zt.exports;Object.defineProperty(Ho,"__esModule",{value:!0});const Bs=_s,Lo=Ss,$s="!",Io={returnIndex:!1},Po=a(t=>Array.isArray(t)?t:[t],"arrify$1"),ko=a((t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){const u=Bs(t,e);return s=>t===s||u(s)}return t instanceof RegExp?u=>t.test(u):u=>!1},"createPattern"),Ts=a((t,e,u,s)=>{const n=Array.isArray(u),r=n?u[0]:u;if(!n&&typeof r!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(r));const i=Lo(r,!1);for(let D=0;D<e.length;D++){const c=e[D];if(c(i))return s?-1:!1}const o=n&&[i].concat(u.slice(1));for(let D=0;D<t.length;D++){const c=t[D];if(n?c(...o):c(i))return s?D:!0}return s?-1:!1},"matchPatterns"),Yt=a((t,e,u=Io)=>{if(t==null)throw new TypeError("anymatch: specify first argument");const s=typeof u=="boolean"?{returnIndex:u}:u,n=s.returnIndex||!1,r=Po(t),i=r.filter(D=>typeof D=="string"&&D.charAt(0)===$s).map(D=>D.slice(1)).map(D=>Bs(D,s)),o=r.filter(D=>typeof D!="string"||typeof D=="string"&&D.charAt(0)!==$s).map(D=>ko(D,s));return e==null?(D,c=!1)=>Ts(o,i,D,typeof c=="boolean"?c:!1):Ts(o,i,e,n)},"anymatch$1");Yt.default=Yt,zt.exports=Yt;var Mo=zt.exports;/*!
* is-extglob <https://github.com/jonschlinkert/is-extglob>
*
* Copyright (c) 2014-2016, Jon Schlinkert.
* Licensed under the MIT License.
*/var Go=a(function(e){if(typeof e!="string"||e==="")return!1;for(var u;u=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(u[2])return!0;e=e.slice(u.index+u[0].length)}return!1},"isExtglob");/*!
* is-glob <https://github.com/jonschlinkert/is-glob>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/var Wo=Go,xs={"{":"}","(":")","[":"]"},jo=a(function(t){if(t[0]==="!")return!0;for(var e=0,u=-2,s=-2,n=-2,r=-2,i=-2;e<t.length;){if(t[e]==="*"||t[e+1]==="?"&&/[\].+)]/.test(t[e])||s!==-1&&t[e]==="["&&t[e+1]!=="]"&&(s<e&&(s=t.indexOf("]",e)),s>e&&(i===-1||i>s||(i=t.indexOf("\\",e),i===-1||i>s)))||n!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(n=t.indexOf("}",e),n>e&&(i=t.indexOf("\\",e),i===-1||i>n))||r!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(r=t.indexOf(")",e),r>e&&(i=t.indexOf("\\",e),i===-1||i>r))||u!==-1&&t[e]==="("&&t[e+1]!=="|"&&(u<e&&(u=t.indexOf("|",e)),u!==-1&&t[u+1]!==")"&&(r=t.indexOf(")",u),r>u&&(i=t.indexOf("\\",u),i===-1||i>r))))return!0;if(t[e]==="\\"){var o=t[e+1];e+=2;var D=xs[o];if(D){var c=t.indexOf(D,e);c!==-1&&(e=c+1)}if(t[e]==="!")return!0}else e++}return!1},"strictCheck"),Uo=a(function(t){if(t[0]==="!")return!0;for(var e=0;e<t.length;){if(/[*?{}()[\]]/.test(t[e]))return!0;if(t[e]==="\\"){var u=t[e+1];e+=2;var s=xs[u];if(s){var n=t.indexOf(s,e);n!==-1&&(e=n+1)}if(t[e]==="!")return!0}else e++}return!1},"relaxedCheck"),Os=a(function(e,u){if(typeof e!="string"||e==="")return!1;if(Wo(e))return!0;var s=jo;return u&&u.strict===!1&&(s=Uo),s(e)},"isGlob"),Ko=Os,Vo=z.posix.dirname,zo=Ru.platform()==="win32",qt="/",Yo=/\\/g,qo=/[\{\[].*[\}\]]$/,Xo=/(^|[^\\])([\{\[]|\([^\)]+$)/,Qo=/\\([\!\*\?\|\[\]\(\)\{\}])/g,Zo=a(function(e,u){var s=Object.assign({flipBackslashes:!0},u);s.flipBackslashes&&zo&&e.indexOf(qt)<0&&(e=e.replace(Yo,qt)),qo.test(e)&&(e+=qt),e+="a";do e=Vo(e);while(Ko(e)||Xo.test(e));return e.replace(Qo,"$1")},"globParent"),ut={};(function(t){t.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1,t.find=(e,u)=>e.nodes.find(s=>s.type===u),t.exceedsLimit=(e,u,s=1,n)=>n===!1||!t.isInteger(e)||!t.isInteger(u)?!1:(Number(u)-Number(e))/Number(s)>=n,t.escapeNode=(e,u=0,s)=>{let n=e.nodes[u];n&&(s&&n.type===s||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)},t.encloseBrace=e=>e.type!=="brace"||e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0),t.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1,t.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0,t.reduce=e=>e.reduce((u,s)=>(s.type==="text"&&u.push(s.value),s.type==="range"&&(s.type="text"),u),[]),t.flatten=(...e)=>{const u=[],s=a(n=>{for(let r=0;r<n.length;r++){let i=n[r];Array.isArray(i)?s(i):i!==void 0&&u.push(i)}return u},"flat");return s(e),u}})(ut);const Ns=ut;var Xt=a((t,e={})=>{let u=a((s,n={})=>{let r=e.escapeInvalid&&Ns.isInvalidBrace(n),i=s.invalid===!0&&e.escapeInvalid===!0,o="";if(s.value)return(r||i)&&Ns.isOpenOrClose(s)?"\\"+s.value:s.value;if(s.value)return s.value;if(s.nodes)for(let D of s.nodes)o+=u(D);return o},"stringify");return u(t)},"stringify$4");/*!
* is-number <https://github.com/jonschlinkert/is-number>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*/var Jo=a(function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1},"isNumber$2");/*!
* to-regex-range <https://github.com/micromatch/to-regex-range>
*
* Copyright (c) 2015-present, Jon Schlinkert.
* Released under the MIT License.
*/const Hs=Jo,ae=a((t,e,u)=>{if(Hs(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(Hs(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let s={relaxZeros:!0,...u};typeof s.strictZeros=="boolean"&&(s.relaxZeros=s.strictZeros===!1);let n=String(s.relaxZeros),r=String(s.shorthand),i=String(s.capture),o=String(s.wrap),D=t+":"+e+"="+n+r+i+o;if(ae.cache.hasOwnProperty(D))return ae.cache[D].result;let c=Math.min(t,e),f=Math.max(t,e);if(Math.abs(c-f)===1){let g=t+"|"+e;return s.capture?`(${g})`:s.wrap===!1?g:`(?:${g})`}let h=Gs(t)||Gs(e),l={min:t,max:e,a:c,b:f},p=[],C=[];if(h&&(l.isPadded=h,l.maxLen=String(l.max).length),c<0){let g=f<0?Math.abs(f):1;C=Ls(g,Math.abs(c),l,s),c=l.a=0}return f>=0&&(p=Ls(c,f,l,s)),l.negatives=C,l.positives=p,l.result=eD(C,p),s.capture===!0?l.result=`(${l.result})`:s.wrap!==!1&&p.length+C.length>1&&(l.result=`(?:${l.result})`),ae.cache[D]=l,l.result},"toRegexRange$1");function eD(t,e,u){let s=Qt(t,e,"-",!1)||[],n=Qt(e,t,"",!1)||[],r=Qt(t,e,"-?",!0)||[];return s.concat(r).concat(n).join("|")}a(eD,"collatePatterns");function tD(t,e){let u=1,s=1,n=Ps(t,u),r=new Set([e]);for(;t<=n&&n<=e;)r.add(n),u+=1,n=Ps(t,u);for(n=ks(e+1,s)-1;t<n&&n<=e;)r.add(n),s+=1,n=ks(e+1,s)-1;return r=[...r],r.sort(nD),r}a(tD,"splitToRanges");function uD(t,e,u){if(t===e)return{pattern:t,count:[],digits:0};let s=sD(t,e),n=s.length,r="",i=0;for(let o=0;o<n;o++){let[D,c]=s[o];D===c?r+=D:D!=="0"||c!=="9"?r+=rD(D,c):i++}return i&&(r+=u.shorthand===!0?"\\d":"[0-9]"),{pattern:r,count:[i],digits:n}}a(uD,"rangeToPattern");function Ls(t,e,u,s){let n=tD(t,e),r=[],i=t,o;for(let D=0;D<n.length;D++){let c=n[D],f=uD(String(i),String(c),s),h="";if(!u.isPadded&&o&&o.pattern===f.pattern){o.count.length>1&&o.count.pop(),o.count.push(f.count[0]),o.string=o.pattern+Ms(o.count),i=c+1;continue}u.isPadded&&(h=iD(c,u,s)),f.string=h+f.pattern+Ms(f.count),r.push(f),i=c+1,o=f}return r}a(Ls,"splitToPatterns");function Qt(t,e,u,s,n){let r=[];for(let i of t){let{string:o}=i;!s&&!Is(e,"string",o)&&r.push(u+o),s&&Is(e,"string",o)&&r.push(u+o)}return r}a(Qt,"filterPatterns");function sD(t,e){let u=[];for(let s=0;s<t.length;s++)u.push([t[s],e[s]]);return u}a(sD,"zip");function nD(t,e){return t>e?1:e>t?-1:0}a(nD,"compare");function Is(t,e,u){return t.some(s=>s[e]===u)}a(Is,"contains");function Ps(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}a(Ps,"countNines");function ks(t,e){return t-t%Math.pow(10,e)}a(ks,"countZeros");function Ms(t){let[e=0,u=""]=t;return u||e>1?`{${e+(u?","+u:"")}}`:""}a(Ms,"toQuantifier");function rD(t,e,u){return`[${t}${e-t===1?"":"-"}${e}]`}a(rD,"toCharacterClass");function Gs(t){return/^-?(0+)\d/.test(t)}a(Gs,"hasPadding");function iD(t,e,u){if(!e.isPadded)return t;let s=Math.abs(e.maxLen-String(t).length),n=u.relaxZeros!==!1;switch(s){case 0:return"";case 1:return n?"0?":"0";case 2:return n?"0{0,2}":"00";default:return n?`0{0,${s}}`:`0{${s}}`}}a(iD,"padZeros"),ae.cache={},ae.clearCache=()=>ae.cache={};var oD=ae;/*!
* fill-range <https://github.com/jonschlinkert/fill-range>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Licensed under the MIT License.
*/const DD=_e,Ws=oD,js=a(t=>t!==null&&typeof t=="object"&&!Array.isArray(t),"isObject"),aD=a(t=>e=>t===!0?Number(e):String(e),"transform"),Zt=a(t=>typeof t=="number"||typeof t=="string"&&t!=="","isValidValue"),ve=a(t=>Number.isInteger(+t),"isNumber"),Jt=a(t=>{let e=`${t}`,u=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++u]==="0";);return u>0},"zeros"),lD=a((t,e,u)=>typeof t=="string"||typeof e=="string"?!0:u.stringify===!0,"stringify$3"),cD=a((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},"pad"),Us=a((t,e)=>{let u=t[0]==="-"?"-":"";for(u&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return u?"-"+t:t},"toMaxLen"),fD=a((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},"toSequence"),Ks=a((t,e,u,s)=>{if(u)return Ws(t,e,{wrap:!1,...s});let n=String.fromCharCode(t);if(t===e)return n;let r=String.fromCharCode(e);return`[${n}-${r}]`},"toRange"),Vs=a((t,e,u)=>{if(Array.isArray(t)){let s=u.wrap===!0,n=u.capture?"":"?:";return s?`(${n}${t.join("|")})`:t.join("|")}return Ws(t,e,u)},"toRegex"),zs=a((...t)=>new RangeError("Invalid range arguments: "+DD.inspect(...t)),"rangeError"),Ys=a((t,e,u)=>{if(u.strictRanges===!0)throw zs([t,e]);return[]},"invalidRange"),hD=a((t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},"invalidStep"),dD=a((t,e,u=1,s={})=>{let n=Number(t),r=Number(e);if(!Number.isInteger(n)||!Number.isInteger(r)){if(s.strictRanges===!0)throw zs([t,e]);return[]}n===0&&(n=0),r===0&&(r=0);let i=n>r,o=String(t),D=String(e),c=String(u);u=Math.max(Math.abs(u),1);let f=Jt(o)||Jt(D)||Jt(c),h=f?Math.max(o.length,D.length,c.length):0,l=f===!1&&lD(t,e,s)===!1,p=s.transform||aD(l);if(s.toRegex&&u===1)return Ks(Us(t,h),Us(e,h),!0,s);let C={negatives:[],positives:[]},g=a(H=>C[H<0?"negatives":"positives"].push(Math.abs(H)),"push"),y=[],B=0;for(;i?n>=r:n<=r;)s.toRegex===!0&&u>1?g(n):y.push(cD(p(n,B),h,l)),n=i?n-u:n+u,B++;return s.toRegex===!0?u>1?fD(C,s):Vs(y,null,{wrap:!1,...s}):y},"fillNumbers"),ED=a((t,e,u=1,s={})=>{if(!ve(t)&&t.length>1||!ve(e)&&e.length>1)return Ys(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),c=Math.max(r,i);if(s.toRegex&&u===1)return Ks(D,c,!1,s);let f=[],h=0;for(;o?r>=i:r<=i;)f.push(n(r,h)),r=o?r-u:r+u,h++;return s.toRegex===!0?Vs(f,null,{wrap:!1,options:s}):f},"fillLetters"),st=a((t,e,u,s={})=>{if(e==null&&Zt(t))return[t];if(!Zt(t)||!Zt(e))return Ys(t,e,s);if(typeof u=="function")return st(t,e,1,{transform:u});if(js(u))return st(t,e,0,u);let n={...s};return n.capture===!0&&(n.wrap=!0),u=u||n.step||1,ve(u)?ve(t)&&ve(e)?dD(t,e,u,n):ED(t,e,Math.max(Math.abs(u),1),n):u!=null&&!js(u)?hD(u,n):st(t,e,1,u)},"fill$2");var qs=st;const pD=qs,Xs=ut,CD=a((t,e={})=>{let u=a((s,n={})=>{let r=Xs.isInvalidBrace(n),i=s.invalid===!0&&e.escapeInvalid===!0,o=r===!0||i===!0,D=e.escapeInvalid===!0?"\\":"",c="";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 f=Xs.reduce(s.nodes),h=pD(...f,{...e,wrap:!1,toRegex:!0});if(h.length!==0)return f.length>1&&h.length>1?`(${h})`:h}if(s.nodes)for(let f of s.nodes)c+=u(f,s);return c},"walk");return u(t)},"compile$1");var FD=CD;const gD=qs,Qs=Xt,Ce=ut,le=a((t="",e="",u=!1)=>{let s=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return u?Ce.flatten(e).map(n=>`{${n}}`):e;for(let n of t)if(Array.isArray(n))for(let r of n)s.push(le(r,e,u));else for(let r of e)u===!0&&typeof r=="string"&&(r=`{${r}}`),s.push(Array.isArray(r)?le(n,r,u):n+r);return Ce.flatten(s)},"append"),mD=a((t,e={})=>{let u=e.rangeLimit===void 0?1e3:e.rangeLimit,s=a((n,r={})=>{n.queue=[];
`,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 yD=Xt,{MAX_LENGTH:Zs,CHAR_BACKSLASH:eu,CHAR_BACKTICK:wD,CHAR_COMMA:RD,CHAR_DOT:bD,CHAR_LEFT_PARENTHESES:vD,CHAR_RIGHT_PARENTHESES:SD,CHAR_LEFT_CURLY_BRACE:BD,CHAR_RIGHT_CURLY_BRACE:$D,CHAR_LEFT_SQUARE_BRACKET:Js,CHAR_RIGHT_SQUARE_BRACKET:en,CHAR_DOUBLE_QUOTE:TD,CHAR_SINGLE_QUOTE:xD,CHAR_NO_BREAK_SPACE:OD,CHAR_ZERO_WIDTH_NOBREAK_SPACE:ND}=AD,HD=a((t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let u=e||{},s=typeof u.maxLength=="number"?Math.min(Zs,u.maxLength):Zs;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,c=t.length,f=0,h=0,l;const p=a(()=>t[f++],"advance"),C=a(g=>{if(g.type==="text"&&o.type==="dot"&&(o.type="text"),o&&o.type==="text"&&g.type==="text"){o.value+=g.value;return}return i.nodes.push(g),g.parent=i,g.prev=o,o=g,g},"push");for(C({type:"bos"});f<c;)if(i=r[r.length-1],l=p(),!(l===ND||l===OD)){if(l===eu){C({type:"text",value:(e.keepEscaping?l:"")+p()});continue}if(l===en){C({type:"text",value:"\\"+l});continue}if(l===Js){D++;let g;for(;f<c&&(g=p());){if(l+=g,g===Js){D++;continue}if(g===eu){l+=p();continue}if(g===en&&(D--,D===0))break}C({type:"text",value:l});continue}if(l===vD){i=C({type:"paren",nodes:[]}),r.push(i),C({type:"text",value:l});continue}if(l===SD){if(i.type!=="paren"){C({type:"text",value:l});continue}i=r.pop(),C({type:"text",value:l}),i=r[r.length-1];continue}if(l===TD||l===xD||l===wD){let g=l,y;for(e.keepQuotes!==!0&&(l="");f<c&&(y=p());){if(y===eu){l+=y+p();continue}if(y===g){e.keepQuotes===!0&&(l+=y);break}l+=y}C({type:"text",value:l});continue}if(l===BD){h++;let y={type:"brace",open:!0,close:!1,dollar:o.value&&o.value.slice(-1)==="$"||i.dollar===!0,depth:h,commas:0,ranges:0,nodes:[]};i=C(y),r.push(i),C({type:"open",value:l});continue}if(l===$D){if(i.type!=="brace"){C({type:"text",value:l});continue}let g="close";i=r.pop(),i.close=!0,C({type:g,value:l}),h--,i=r[r.length-1];continue}if(l===RD&&h>0){if(i.ranges>0){i.ranges=0;let g=i.nodes.shift();i.nodes=[g,{type:"text",value:yD(i)}]}C({type:"comma",value:l}),i.commas++;continue}if(l===bD&&h>0&&i.commas===0){let g=i.nodes;if(h===0||g.length===0){C({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"){g.pop();let y=g[g.length-1];y.value+=o.value+l,o=y,i.ranges--;continue}C({type:"dot",value:l});continue}C({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 g=r[r.length-1],y=g.nodes.indexOf(i);g.nodes.splice(y,1,...i.nodes)}while(r.length>0);return C({type:"eos"}),n},"parse$1");var LD=HD;const tn=Xt,ID=FD,PD=_D,kD=LD,q=a((t,e={})=>{let u=[];if(Array.isArray(t))for(let s of t){let n=q.create(s,e);Array.isArray(n)?u.push(...n):u.push(n)}else u=[].concat(q.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(u=[...new Set(u)]),u},"braces$1");q.parse=(t,e={})=>kD(t,e),q.stringify=(t,e={})=>tn(typeof t=="string"?q.parse(t,e):t,e),q.compile=(t,e={})=>(typeof t=="string"&&(t=q.parse(t,e)),ID(t,e)),q.expand=(t,e={})=>{typeof t=="string"&&(t=q.parse(t,e));let u=PD(t,e);return e.noempty===!0&&(u=u.filter(Boolean)),e.nodupes===!0&&(u=[...new Set(u)]),u},q.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?q.compile(t,e):q.expand(t,e);var MD=q,GD=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2",
node `):t.flags.help&&(t.showHelp({description:"Node.js runtime enhanced with esbuild for loading TypeScript & ESM"}),console.log(`${"-".repeat(45)}
`));const e={eval:{type:String,alias:"e"},print:{type:String,alias:"p"}},{_:u,flags:s}=zu({flags:{...e,inputType:String,test:Boolean},help:!1,ignoreArgv:ct(!1)}),n=wn({...vn,...e}),i=["print","eval"].find(c=>!!s[c]);if(i){const{inputType:c}=s,f=s[i],h=xn(f,{loader:"default",sourcefile:"/eval.ts",format:c==="module"?"esm":"cjs"});n.unshift(`--${i}`,h.code)}wu(Mn)&&s.test&&u.length===0&&n.push("**/{test,test/**/*,test-*,*[.-_]test}.?(c|m)@(t|j)s");const o=await Rn(),D=as(n,{noCache:!!t.flags.noCache,tsconfigPath:t.flags.tsconfig});Bl(D,o),process.send&&D.on("message",c=>{process.send(c)}),D.send&&process.on("message",c=>{D.send(c)}),D.on("close",c=>{c===null&&(c=dt.signals[D.signalCode]+128),process.exit(c)})});