create-nexo 1.8.2 → 1.8.5

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.
Files changed (2) hide show
  1. package/dist/bin/nexo.js +3 -3
  2. package/package.json +1 -1
package/dist/bin/nexo.js CHANGED
@@ -104,12 +104,12 @@ Consider using a shorter project name or parent directory.`,e);let r=e.split(/[/
104
104
  `,o=Buffer.byteLength(n),s=Math.floor(Math.log(o)/Math.log(10))+1;return o+s>=10**s&&(s+=1),s+o+n}static parse(t,r,i=!1){return new op(Ky(Zy(t),r),i)}},Ky=(e,t)=>t?Object.assign({},t,e):e,Zy=e=>e.replace(/\n$/,"").split(`
105
105
  `).reduce(Jy,Object.create(null)),Jy=(e,t)=>{let r=parseInt(t,10);if(r!==Buffer.byteLength(t)+1)return e;t=t.slice((r+" ").length);let i=t.split("="),n=i.shift();if(!n)return e;let o=n.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),s=i.join("=");return e[o]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(o)?new Date(Number(s)*1e3):/^[0-9]+$/.test(s)?+s:s,e},S=(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)==="win32"?e=>e&&e.replace(/\\/g,"/"):e=>e,na=class extends Ye{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(e,t,r){switch(super({}),this.pause(),this.extended=t,this.globalExtended=r,this.header=e,this.remain=e.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=e.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!e.path)throw Error("no path provided for tar.ReadEntry");this.path=S(e.path),this.mode=e.mode,this.mode&&(this.mode&=4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=this.remain,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath?S(e.linkpath):void 0,this.uname=e.uname,this.gname=e.gname,t&&this.#e(t),r&&this.#e(r,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw Error("writing more to entry than is appropriate");let r=this.remain,i=this.blockRemain;return this.remain=Math.max(0,r-t),this.blockRemain=Math.max(0,i-t),this.ignore?!0:r>=t?super.write(e):super.write(e.subarray(0,r))}#e(e,t=!1){e.path&&=S(e.path),e.linkpath&&=S(e.linkpath),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([r,i])=>!(i==null||r==="path"&&t))))}},hn=(e,t,r,i={})=>{e.file&&(i.file=e.file),e.cwd&&(i.cwd=e.cwd),i.code=r instanceof Error&&r.code||t,i.tarCode=t,!e.strict&&i.recoverable!==!1?(r instanceof Error&&(i=Object.assign(r,i),r=r.message),e.emit("warn",t,r,i)):r instanceof Error?e.emit("error",Object.assign(r,i)):e.emit("error",Object.assign(Error(`${t}: ${r}`),i))},jo=Buffer.from([31,139]),Bo=Buffer.from([40,181,47,253]),Xy=Math.max(jo.length,Bo.length),Ee=Symbol("state"),Tt=Symbol("writeEntry"),Ke=Symbol("readEntry"),So=Symbol("nextEntry"),$l=Symbol("processEntry"),Be=Symbol("extendedHeader"),$r=Symbol("globalExtendedHeader"),pt=Symbol("meta"),Pl=Symbol("emitMeta"),R=Symbol("buffer"),Ze=Symbol("queue"),ht=Symbol("ended"),Fo=Symbol("emittedEnd"),Ot=Symbol("emit"),z=Symbol("unzip"),Vi=Symbol("consumeChunk"),qi=Symbol("consumeChunkSub"),xo=Symbol("consumeBody"),Il=Symbol("consumeMeta"),Nl=Symbol("consumeHeader"),Pr=Symbol("consuming"),ko=Symbol("bufferConcat"),Yi=Symbol("maybeEnd"),Jt=Symbol("writing"),mt=Symbol("aborted"),Ki=Symbol("onDone"),Rt=Symbol("sawValidEntry"),Zi=Symbol("sawNullBlock"),Ji=Symbol("sawEOF"),jl=Symbol("closeStream"),Qy=()=>!0,rr=class extends wy{file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[Ze]=[];[R];[Ke];[Tt];[Ee]="begin";[pt]="";[Be];[$r];[ht]=!1;[z];[mt]=!1;[Rt];[Zi]=!1;[Ji]=!1;[Jt]=!1;[Pr]=!1;[Fo]=!1;constructor(e={}){super(),this.file=e.file||"",this.on(Ki,()=>{(this[Ee]==="begin"||this[Rt]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(Ki,e.ondone):this.on(Ki,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||1048576,this.filter=typeof e.filter=="function"?e.filter:Qy;let t=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=!(e.gzip||e.zstd)&&e.brotli!==void 0?e.brotli:t?void 0:!1;let r=e.file&&(e.file.endsWith(".tar.zst")||e.file.endsWith(".tzst"));this.zstd=!(e.gzip||e.brotli)&&e.zstd!==void 0?e.zstd:r?!0:void 0,this.on("end",()=>this[jl]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onReadEntry=="function"&&this.on("entry",e.onReadEntry)}warn(e,t,r={}){hn(this,e,t,r)}[Nl](e,t){this[Rt]===void 0&&(this[Rt]=!1);let r;try{r=new yt(e,t,this[Be],this[$r])}catch(i){return this.warn("TAR_ENTRY_INVALID",i)}if(r.nullBlock)this[Zi]?(this[Ji]=!0,this[Ee]==="begin"&&(this[Ee]="header"),this[Ot]("eof")):(this[Zi]=!0,this[Ot]("nullBlock"));else if(this[Zi]=!1,!r.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:r});else if(!r.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:r});else{let i=r.type;if(/^(Symbolic)?Link$/.test(i)&&!r.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:r});else if(!/^(Symbolic)?Link$/.test(i)&&!/^(Global)?ExtendedHeader$/.test(i)&&r.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:r});else{let n=this[Tt]=new na(r,this[Be],this[$r]);this[Rt]||(n.remain?n.on("end",()=>{n.invalid||(this[Rt]=!0)}):this[Rt]=!0),n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[Ot]("ignoredEntry",n),this[Ee]="ignore",n.resume()):n.size>0&&(this[pt]="",n.on("data",o=>this[pt]+=o),this[Ee]="meta"):(this[Be]=void 0,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[Ot]("ignoredEntry",n),this[Ee]=n.remain?"ignore":"header",n.resume()):(n.remain?this[Ee]="body":(this[Ee]="header",n.end()),this[Ke]?this[Ze].push(n):(this[Ze].push(n),this[So]())))}}}[jl](){queueMicrotask(()=>this.emit("close"))}[$l](e){let t=!0;if(!e)this[Ke]=void 0,t=!1;else if(Array.isArray(e)){let[r,...i]=e;this.emit(r,...i)}else this[Ke]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",()=>this[So]()),t=!1);return t}[So](){do;while(this[$l](this[Ze].shift()));if(!this[Ze].length){let e=this[Ke];!e||e.flowing||e.size===e.remain?this[Jt]||this.emit("drain"):e.once("drain",()=>this.emit("drain"))}}[xo](e,t){let r=this[Tt];if(!r)throw Error("attempt to consume body without entry??");let i=r.blockRemain??0,n=i>=e.length&&t===0?e:e.subarray(t,t+i);return r.write(n),r.blockRemain||(this[Ee]="header",this[Tt]=void 0,r.end()),n.length}[Il](e,t){let r=this[Tt],i=this[xo](e,t);return!this[Tt]&&r&&this[Pl](r),i}[Ot](e,t,r){!this[Ze].length&&!this[Ke]?this.emit(e,t,r):this[Ze].push([e,t,r])}[Pl](e){switch(this[Ot]("meta",this[pt]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[Be]=Wr.parse(this[pt],this[Be],!1);break;case"GlobalExtendedHeader":this[$r]=Wr.parse(this[pt],this[$r],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let t=this[Be]??Object.create(null);this[Be]=t,t.path=this[pt].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let t=this[Be]||Object.create(null);this[Be]=t,t.linkpath=this[pt].replace(/\0.*/,"");break}default:throw Error("unknown meta: "+e.type)}}abort(e){this[mt]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e,t,r){if(typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this[mt])return r?.(),!1;if((this[z]===void 0||this.brotli===void 0&&this[z]===!1)&&e){if(this[R]&&(e=Buffer.concat([this[R],e]),this[R]=void 0),e.length<Xy)return this[R]=e,r?.(),!0;for(let s=0;this[z]===void 0&&s<jo.length;s++)e[s]!==jo[s]&&(this[z]=!1);let n=!1;if(this[z]===!1&&this.zstd!==!1){n=!0;for(let s=0;s<Bo.length;s++)if(e[s]!==Bo[s]){n=!1;break}}let o=this.brotli===void 0&&!n;if(this[z]===!1&&o)if(e.length<512)if(this[ht])this.brotli=!0;else return this[R]=e,r?.(),!0;else try{new yt(e.subarray(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[z]===void 0||this[z]===!1&&(this.brotli||n)){let s=this[ht];this[ht]=!1,this[z]=this[z]===void 0?new Sl({}):n?new Tl({}):new kl({}),this[z].on("data",u=>this[Vi](u)),this[z].on("error",u=>this.abort(u)),this[z].on("end",()=>{this[ht]=!0,this[Vi]()}),this[Jt]=!0;let a=!!this[z][s?"end":"write"](e);return this[Jt]=!1,r?.(),a}}this[Jt]=!0,this[z]?this[z].write(e):this[Vi](e),this[Jt]=!1;let i=this[Ze].length?!1:this[Ke]?this[Ke].flowing:!0;return!i&&!this[Ze].length&&this[Ke]?.once("drain",()=>this.emit("drain")),r?.(),i}[ko](e){e&&!this[mt]&&(this[R]=this[R]?Buffer.concat([this[R],e]):e)}[Yi](){if(this[ht]&&!this[Fo]&&!this[mt]&&!this[Pr]){this[Fo]=!0;let e=this[Tt];if(e&&e.blockRemain){let t=this[R]?this[R].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[R]&&e.write(this[R]),e.end()}this[Ot](Ki)}}[Vi](e){if(this[Pr]&&e)this[ko](e);else if(!e&&!this[R])this[Yi]();else if(e){if(this[Pr]=!0,this[R]){this[ko](e);let t=this[R];this[R]=void 0,this[qi](t)}else this[qi](e);for(;this[R]&&this[R]?.length>=512&&!this[mt]&&!this[Ji];){let t=this[R];this[R]=void 0,this[qi](t)}this[Pr]=!1}(!this[R]||this[ht])&&this[Yi]()}[qi](e){let t=0,r=e.length;for(;t+512<=r&&!this[mt]&&!this[Ji];)switch(this[Ee]){case"begin":case"header":this[Nl](e,t),t+=512;break;case"ignore":case"body":t+=this[xo](e,t);break;case"meta":t+=this[Il](e,t);break;default:throw Error("invalid state: "+this[Ee])}t<r&&(this[R]?this[R]=Buffer.concat([e.subarray(t),this[R]]):this[R]=e.subarray(t))}end(e,t,r){return typeof e=="function"&&(r=e,t=void 0,e=void 0),typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t)),r&&this.once("finish",r),this[mt]||(this[z]?(e&&this[z].write(e),this[z].end()):(this[ht]=!0,(this.brotli===void 0||this.zstd===void 0)&&(e||=Buffer.alloc(0)),e&&this.write(e),this[Yi]())),this}},Br=e=>{let t=e.length-1,r=-1;for(;t>-1&&e.charAt(t)==="/";)r=t,t--;return r===-1?e:e.slice(0,r)},e0=e=>{let t=e.onReadEntry;e.onReadEntry=t?r=>{t(r),r.resume()}:r=>r.resume()},sa=(e,t)=>{let r=new Map(t.map(o=>[Br(o),!0])),i=e.filter,n=(o,s="")=>{let a=s||Sy(o).root||".",u;if(o===a)u=!1;else{let c=r.get(o);u=c===void 0?n(vy(o),a):c}return r.set(o,u),u};e.filter=i?(o,s)=>i(o,s)&&n(Br(o)):o=>n(Br(o))},Vr=Gr(e=>{let t=new rr(e),r=e.file,i;try{i=b.openSync(r,"r");let n=b.fstatSync(i),o=e.maxReadSize||16*1024*1024;if(n.size<o){let s=Buffer.allocUnsafe(n.size),a=b.readSync(i,s,0,n.size,0);t.end(a===s.byteLength?s:s.subarray(0,a))}else{let s=0,a=Buffer.allocUnsafe(o);for(;s<n.size;){let u=b.readSync(i,a,0,o,s);if(u===0)break;s+=u,t.write(a.subarray(0,u))}t.end()}}finally{if(typeof i=="number")try{b.closeSync(i)}catch{}}},(e,t)=>{let r=new rr(e),i=e.maxReadSize||16*1024*1024,n=e.file;return new Promise((o,s)=>{r.on("error",s),r.on("end",o),b.stat(n,(a,u)=>{if(a)s(a);else{let c=new zi(n,{readSize:i,size:u.size});c.on("error",s),c.pipe(r)}})})},e=>new rr(e),e=>new rr(e),(e,t)=>{t?.length&&sa(e,t),e.noResume||e0(e)}),ap=(e,t,r)=>(e&=4095,r&&(e=(e|384)&-19),t&&(e&256&&(e|=64),e&32&&(e|=8),e&4&&(e|=1)),e),{isAbsolute:t0,parse:Bl}=Ey,oa=e=>{let t="",r=Bl(e);for(;t0(e)||r.root;){let i=e.charAt(0)==="/"&&e.slice(0,4)!=="//?/"?"/":r.root;e=e.slice(i.length),t+=i,r=Bl(e)}return[t,e]},mn=["|","<",">","?",":"],aa=mn.map(e=>String.fromCharCode(61440+e.charCodeAt(0))),r0=new Map(mn.map((e,t)=>[e,aa[t]])),i0=new Map(aa.map((e,t)=>[e,mn[t]])),Ll=e=>mn.reduce((t,r)=>t.split(r).join(r0.get(r)),e),n0=e=>aa.reduce((t,r)=>t.split(r).join(i0.get(r)),e),up=(e,t)=>t?(e=S(e).replace(/^\.(\/|$)/,""),Br(t)+"/"+e):S(e),Ml=Symbol("process"),Ul=Symbol("file"),zl=Symbol("directory"),Lo=Symbol("symlink"),Hl=Symbol("hardlink"),Ir=Symbol("header"),en=Symbol("read"),Mo=Symbol("lstat"),tn=Symbol("onlstat"),Uo=Symbol("onread"),zo=Symbol("onreadlink"),Ho=Symbol("openfile"),Wo=Symbol("onopenfile"),gt=Symbol("close"),ln=Symbol("mode"),Go=Symbol("awaitDrain"),Ao=Symbol("ondrain"),Le=Symbol("prefix"),ua=class extends Ye{path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#e=!1;constructor(e,t={}){let r=ra(t);super(),this.path=S(e),this.portable=!!r.portable,this.maxReadSize=r.maxReadSize||16777216,this.linkCache=r.linkCache||new Map,this.statCache=r.statCache||new Map,this.preservePaths=!!r.preservePaths,this.cwd=S(r.cwd||process.cwd()),this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.mtime=r.mtime,this.prefix=r.prefix?S(r.prefix):void 0,this.onWriteEntry=r.onWriteEntry,typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let i=!1;if(!this.preservePaths){let[o,s]=oa(this.path);o&&typeof s=="string"&&(this.path=s,i=o)}this.win32=!!r.win32||process.platform==="win32",this.win32&&(this.path=n0(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=S(r.absolute||cn.resolve(this.cwd,e)),this.path===""&&(this.path="./"),i&&this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:this,path:i+this.path});let n=this.statCache.get(this.absolute);n?this[tn](n):this[Mo]()}warn(e,t,r={}){return hn(this,e,t,r)}emit(e,...t){return e==="error"&&(this.#e=!0),super.emit(e,...t)}[Mo](){re.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[tn](t)})}[tn](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=s0(e),this.emit("stat",e),this[Ml]()}[Ml](){switch(this.type){case"File":return this[Ul]();case"Directory":return this[zl]();case"SymbolicLink":return this[Lo]();default:return this.end()}}[ln](e){return ap(e,this.type==="Directory",this.portable)}[Le](e){return up(e,this.prefix)}[Ir](){if(!this.stat)throw Error("cannot write header before stat");this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new yt({path:this[Le](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Le](this.linkpath):this.linkpath,mode:this[ln](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new Wr({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[Le](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Le](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());let e=this.header?.block;if(!e)throw Error("failed to encode header");super.write(e)}[zl](){if(!this.stat)throw Error("cannot create directory entry without stat");this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[Ir](),this.end()}[Lo](){re.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[zo](t)})}[zo](e){this.linkpath=S(e),this[Ir](),this.end()}[Hl](e){if(!this.stat)throw Error("cannot create link entry without stat");this.type="Link",this.linkpath=S(cn.relative(this.cwd,e)),this.stat.size=0,this[Ir](),this.end()}[Ul](){if(!this.stat)throw Error("cannot create file entry without stat");if(this.stat.nlink>1){let e=`${this.stat.dev}:${this.stat.ino}`,t=this.linkCache.get(e);if(t?.indexOf(this.cwd)===0)return this[Hl](t);this.linkCache.set(e,this.absolute)}if(this[Ir](),this.stat.size===0)return this.end();this[Ho]()}[Ho](){re.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[Wo](t)})}[Wo](e){if(this.fd=e,this.#e)return this[gt]();if(!this.stat)throw Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[en]()}[en](){let{fd:e,buf:t,offset:r,length:i,pos:n}=this;if(e===void 0||t===void 0)throw Error("cannot read file without first opening");re.read(e,t,r,i,n,(o,s)=>{if(o)return this[gt](()=>this.emit("error",o));this[Uo](s)})}[gt](e=()=>{}){this.fd!==void 0&&re.close(this.fd,e)}[Uo](e){if(e<=0&&this.remain>0){let r=Object.assign(Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[gt](()=>this.emit("error",r))}if(e>this.remain){let r=Object.assign(Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[gt](()=>this.emit("error",r))}if(!this.buf)throw Error("should have created buffer prior to reading");if(e===this.remain)for(let r=e;r<this.length&&e<this.blockRemain;r++)this.buf[r+this.offset]=0,e++,this.remain++;let t=this.offset===0&&e===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+e);this.write(t)?this[Ao]():this[Go](()=>this[Ao]())}[Go](e){this.once("drain",e)}write(e,t,r){if(typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this.blockRemain<e.length){let i=Object.assign(Error("writing more data than expected"),{path:this.absolute});return this.emit("error",i)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e,null,r)}[Ao](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[gt](e=>e?this.emit("error",e):this.end());if(!this.buf)throw Error("buffer lost somehow in ONDRAIN");this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[en]()}},cp=class extends ua{sync=!0;[Mo](){this[tn](re.lstatSync(this.absolute))}[Lo](){this[zo](re.readlinkSync(this.absolute))}[Ho](){this[Wo](re.openSync(this.absolute,"r"))}[en](){let e=!0;try{let{fd:t,buf:r,offset:i,length:n,pos:o}=this;if(t===void 0||r===void 0)throw Error("fd and buf must be set in READ method");let s=re.readSync(t,r,i,n,o);this[Uo](s),e=!1}finally{if(e)try{this[gt](()=>{})}catch{}}}[Go](e){e()}[gt](e=()=>{}){this.fd!==void 0&&re.closeSync(this.fd),e()}},lp=class extends Ye{blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(e,t,r={}){return hn(this,e,t,r)}constructor(e,t={}){let r=ra(t);super(),this.preservePaths=!!r.preservePaths,this.portable=!!r.portable,this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.onWriteEntry=r.onWriteEntry,this.readEntry=e;let{type:i}=e;if(i==="Unsupported")throw Error("writing entry that should be ignored");this.type=i,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=r.prefix,this.path=S(e.path),this.mode=e.mode===void 0?void 0:this[ln](e.mode),this.uid=this.portable?void 0:e.uid,this.gid=this.portable?void 0:e.gid,this.uname=this.portable?void 0:e.uname,this.gname=this.portable?void 0:e.gname,this.size=e.size,this.mtime=this.noMtime?void 0:r.mtime||e.mtime,this.atime=this.portable?void 0:e.atime,this.ctime=this.portable?void 0:e.ctime,this.linkpath=e.linkpath===void 0?void 0:S(e.linkpath),typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let n=!1;if(!this.preservePaths){let[s,a]=oa(this.path);s&&typeof a=="string"&&(this.path=a,n=s)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.onWriteEntry?.(this),this.header=new yt({path:this[Le](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Le](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime}),n&&this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:this,path:n+this.path}),this.header.encode()&&!this.noPax&&super.write(new Wr({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[Le](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[Le](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());let o=this.header?.block;if(!o)throw Error("failed to encode header");super.write(o),e.pipe(this)}[Le](e){return up(e,this.prefix)}[ln](e){return ap(e,this.type==="Directory",this.portable)}write(e,t,r){typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8"));let i=e.length;if(i>this.blockRemain)throw Error("writing more to entry than is appropriate");return this.blockRemain-=i,super.write(e,r)}end(e,t,r){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),typeof e=="function"&&(r=e,t=void 0,e=void 0),typeof t=="function"&&(r=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t??"utf8")),r&&this.once("finish",r),e?super.end(e,r):super.end(r),this}},s0=e=>e.isFile()?"File":e.isDirectory()?"Directory":e.isSymbolicLink()?"SymbolicLink":"Unsupported",o0=class er{tail;head;length=0;static create(t=[]){return new er(t)}constructor(t=[]){for(let r of t)this.push(r)}*[Symbol.iterator](){for(let t=this.head;t;t=t.next)yield t.value}removeNode(t){if(t.list!==this)throw Error("removing node which does not belong to this list");let r=t.next,i=t.prev;return r&&(r.prev=i),i&&(i.next=r),t===this.head&&(this.head=r),t===this.tail&&(this.tail=i),this.length--,t.next=void 0,t.prev=void 0,t.list=void 0,r}unshiftNode(t){if(t===this.head)return;t.list&&t.list.removeNode(t);let r=this.head;t.list=this,t.next=r,r&&(r.prev=t),this.head=t,this.tail||=t,this.length++}pushNode(t){if(t===this.tail)return;t.list&&t.list.removeNode(t);let r=this.tail;t.list=this,t.prev=r,r&&(r.next=t),this.tail=t,this.head||=t,this.length++}push(...t){for(let r=0,i=t.length;r<i;r++)u0(this,t[r]);return this.length}unshift(...t){for(var r=0,i=t.length;r<i;r++)c0(this,t[r]);return this.length}pop(){if(!this.tail)return;let t=this.tail.value,r=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,r.list=void 0,this.length--,t}shift(){if(!this.head)return;let t=this.head.value,r=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,r.list=void 0,this.length--,t}forEach(t,r){r||=this;for(let i=this.head,n=0;i;n++)t.call(r,i.value,n,this),i=i.next}forEachReverse(t,r){r||=this;for(let i=this.tail,n=this.length-1;i;n--)t.call(r,i.value,n,this),i=i.prev}get(t){let r=0,i=this.head;for(;i&&r<t;r++)i=i.next;if(r===t&&i)return i.value}getReverse(t){let r=0,i=this.tail;for(;i&&r<t;r++)i=i.prev;if(r===t&&i)return i.value}map(t,r){r||=this;let i=new er;for(let n=this.head;n;)i.push(t.call(r,n.value,this)),n=n.next;return i}mapReverse(t,r){r||=this;var i=new er;for(let n=this.tail;n;)i.push(t.call(r,n.value,this)),n=n.prev;return i}reduce(t,r){let i,n=this.head;if(arguments.length>1)i=r;else if(this.head)n=this.head.next,i=this.head.value;else throw TypeError("Reduce of empty list with no initial value");for(var o=0;n;o++)i=t(i,n.value,o),n=n.next;return i}reduceReverse(t,r){let i,n=this.tail;if(arguments.length>1)i=r;else if(this.tail)n=this.tail.prev,i=this.tail.value;else throw TypeError("Reduce of empty list with no initial value");for(let o=this.length-1;n;o--)i=t(i,n.value,o),n=n.prev;return i}toArray(){let t=Array(this.length);for(let r=0,i=this.head;i;r++)t[r]=i.value,i=i.next;return t}toArrayReverse(){let t=Array(this.length);for(let r=0,i=this.tail;i;r++)t[r]=i.value,i=i.prev;return t}slice(t=0,r=this.length){r<0&&(r+=this.length),t<0&&(t+=this.length);let i=new er;if(r<t||r<0)return i;t<0&&(t=0),r>this.length&&(r=this.length);let n=this.head,o=0;for(o=0;n&&o<t;o++)n=n.next;for(;n&&o<r;o++,n=n.next)i.push(n.value);return i}sliceReverse(t=0,r=this.length){r<0&&(r+=this.length),t<0&&(t+=this.length);let i=new er;if(r<t||r<0)return i;t<0&&(t=0),r>this.length&&(r=this.length);let n=this.length,o=this.tail;for(;o&&n>r;n--)o=o.prev;for(;o&&n>t;n--,o=o.prev)i.push(o.value);return i}splice(t,r=0,...i){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);let n=this.head;for(let s=0;n&&s<t;s++)n=n.next;let o=[];for(let s=0;n&&s<r;s++)o.push(n.value),n=this.removeNode(n);n?n!==this.tail&&(n=n.prev):n=this.tail;for(let s of i)n=a0(this,n,s);return o}reverse(){let t=this.head,r=this.tail;for(let i=t;i;i=i.prev){let n=i.prev;i.prev=i.next,i.next=n}return this.head=r,this.tail=t,this}};ca=class{list;next;prev;value;constructor(e,t,r,i){this.list=i,this.value=e,t?(t.next=this,this.prev=t):this.prev=void 0,r?(r.prev=this,this.next=r):this.next=void 0}},Vo=class{path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(e,t){this.path=e||"./",this.absolute=t}},Wl=Buffer.alloc(1024),rn=Symbol("onStat"),Nr=Symbol("ended"),Te=Symbol("queue"),$t=Symbol("current"),Pt=Symbol("process"),jr=Symbol("processing"),_o=Symbol("processJob"),Oe=Symbol("jobs"),To=Symbol("jobDone"),nn=Symbol("addFSEntry"),Gl=Symbol("addTarEntry"),qo=Symbol("stat"),Yo=Symbol("readdir"),sn=Symbol("onreaddir"),on=Symbol("pipe"),Vl=Symbol("entry"),Oo=Symbol("entryOpt"),an=Symbol("writeEntryClass"),pp=Symbol("write"),Ro=Symbol("ondrain"),qr=class extends Ye{sync=!1;opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[an];onWriteEntry;[Te];[Oe]=0;[jr]=!1;[Nr]=!1;constructor(e={}){if(super(),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=S(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this.onWriteEntry=e.onWriteEntry,this[an]=ua,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,e.gzip||e.brotli||e.zstd){if((e.gzip?1:0)+(e.brotli?1:0)+(e.zstd?1:0)>1)throw TypeError("gzip, brotli, zstd are mutually exclusive");if(e.gzip&&(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new vl(e.gzip)),e.brotli&&(typeof e.brotli!="object"&&(e.brotli={}),this.zip=new xl(e.brotli)),e.zstd&&(typeof e.zstd!="object"&&(e.zstd={}),this.zip=new _l(e.zstd)),!this.zip)throw Error("impossible");let t=this.zip;t.on("data",r=>super.write(r)),t.on("end",()=>super.end()),t.on("drain",()=>this[Ro]()),this.on("resume",()=>t.resume())}else this.on("drain",this[Ro]);this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,e.mtime&&(this.mtime=e.mtime),this.filter=typeof e.filter=="function"?e.filter:()=>!0,this[Te]=new o0,this[Oe]=0,this.jobs=Number(e.jobs)||4,this[jr]=!1,this[Nr]=!1}[pp](e){return super.write(e)}add(e){return this.write(e),this}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t=void 0),e&&this.add(e),this[Nr]=!0,this[Pt](),r&&r(),this}write(e){if(this[Nr])throw Error("write after end");return e instanceof na?this[Gl](e):this[nn](e),this.flowing}[Gl](e){let t=S(cn.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let r=new Vo(e.path,t);r.entry=new lp(e,this[Oo](r)),r.entry.on("end",()=>this[To](r)),this[Oe]+=1,this[Te].push(r)}this[Pt]()}[nn](e){let t=S(cn.resolve(this.cwd,e));this[Te].push(new Vo(e,t)),this[Pt]()}[qo](e){e.pending=!0,this[Oe]+=1,re[this.follow?"stat":"lstat"](e.absolute,(t,r)=>{e.pending=!1,--this[Oe],t?this.emit("error",t):this[rn](e,r)})}[rn](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)?t.isFile()&&t.nlink>1&&e===this[$t]&&!this.linkCache.get(`${t.dev}:${t.ino}`)&&!this.sync&&this[_o](e):e.ignore=!0,this[Pt]()}[Yo](e){e.pending=!0,this[Oe]+=1,re.readdir(e.absolute,(t,r)=>{if(e.pending=!1,--this[Oe],t)return this.emit("error",t);this[sn](e,r)})}[sn](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[Pt]()}[Pt](){if(!this[jr]){this[jr]=!0;for(let e=this[Te].head;e&&this[Oe]<this.jobs;e=e.next)if(this[_o](e.value),e.value.ignore){let t=e.next;this[Te].removeNode(e),e.next=t}this[jr]=!1,this[Nr]&&!this[Te].length&&this[Oe]===0&&(this.zip?this.zip.end(Wl):(super.write(Wl),super.end()))}}get[$t](){return this[Te]&&this[Te].head&&this[Te].head.value}[To](e){this[Te].shift(),--this[Oe],this[Pt]()}[_o](e){if(!e.pending){if(e.entry){e===this[$t]&&!e.piped&&this[on](e);return}if(!e.stat){let t=this.statCache.get(e.absolute);t?this[rn](e,t):this[qo](e)}if(e.stat&&!e.ignore){if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){let t=this.readdirCache.get(e.absolute);if(t?this[sn](e,t):this[Yo](e),!e.readdir)return}if(e.entry=this[Vl](e),!e.entry){e.ignore=!0;return}e===this[$t]&&!e.piped&&this[on](e)}}}[Oo](e){return{onwarn:(t,r,i)=>this.warn(t,r,i),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[Vl](e){this[Oe]+=1;try{return new this[an](e.path,this[Oo](e)).on("end",()=>this[To](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[Ro](){this[$t]&&this[$t].entry&&this[$t].entry.resume()}[on](e){e.piped=!0,e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[nn](o+i)});let t=e.entry,r=this.zip;if(!t)throw Error("cannot pipe without source");r?t.on("data",i=>{r.write(i)||t.pause()}):t.on("data",i=>{super.write(i)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(e,t,r={}){hn(this,e,t,r)}},dn=class extends qr{sync=!0;constructor(e){super(e),this[an]=cp}pause(){}resume(){}[qo](e){let t=this.follow?"statSync":"lstatSync";this[rn](e,re[t](e.absolute))}[Yo](e){this[sn](e,re.readdirSync(e.absolute))}[on](e){let t=e.entry,r=this.zip;if(e.readdir&&e.readdir.forEach(i=>{let n=e.path,o=n==="./"?"":n.replace(/\/*$/,"/");this[nn](o+i)}),!t)throw Error("Cannot pipe without source");r?t.on("data",i=>{r.write(i)}):t.on("data",i=>{super[pp](i)})}},l0=(e,t)=>{let r=new dn(e),i=new po(e.file,{mode:e.mode||438});r.pipe(i),hp(r,t)},p0=(e,t)=>{let r=new qr(e),i=new Or(e.file,{mode:e.mode||438});r.pipe(i);let n=new Promise((o,s)=>{i.on("error",s),i.on("close",o),r.on("error",s)});return mp(r,t),n},hp=(e,t)=>{t.forEach(r=>{r.charAt(0)==="@"?Vr({file:H.resolve(e.cwd,r.slice(1)),sync:!0,noResume:!0,onReadEntry:i=>e.add(i)}):e.add(r)}),e.end()},mp=async(e,t)=>{for(let r=0;r<t.length;r++){let i=String(t[r]);i.charAt(0)==="@"?await Vr({file:H.resolve(String(e.cwd),i.slice(1)),noResume:!0,onReadEntry:n=>{e.add(n)}}):e.add(i)}e.end()};Gr(l0,p0,(e,t)=>{let r=new dn(e);return hp(r,t),r},(e,t)=>{let r=new qr(e);return mp(r,t),r},(e,t)=>{if(!t?.length)throw TypeError("no paths specified to add to archive")});h0=(process.env.__FAKE_PLATFORM__||process.platform)==="win32",{O_CREAT:m0,O_TRUNC:d0,O_WRONLY:f0}=re.constants,dp=Number(process.env.__FAKE_FS_O_FILENAME__)||re.constants.UV_FS_O_FILEMAP||0,g0=h0&&!!dp,D0=dp|d0|m0|f0,fp=g0?e=>e<524288?D0:"w":()=>"w",gp=class extends Error{path;code;syscall="chdir";constructor(e,t){super(`${t}: Cannot cd into '${e}'`),this.path=e,this.code=t}get name(){return"CwdError"}},Dp=class extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(e,t){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=e,this.path=t}get name(){return"SymlinkError"}},y0=(e,t)=>{b.stat(e,(r,i)=>{(r||!i.isDirectory())&&(r=new gp(e,r?.code||"ENOTDIR")),t(r)})},b0=(e,t,r)=>{e=S(e);let i=t.umask??18,n=t.mode|448,o=(n&i)!==0,s=t.uid,a=t.gid,u=typeof s=="number"&&typeof a=="number"&&(s!==t.processUid||a!==t.processGid),c=t.preserve,l=t.unlink,p=S(t.cwd),h=(m,g)=>{m?r(m):g&&u?bo(g,s,a,y=>h(y)):o?b.chmod(e,n,r):r()};if(e===p)return y0(e,h);if(c)return by.mkdir(e,{mode:n,recursive:!0}).then(m=>h(null,m??void 0),h);Ko(p,S(H.relative(p,e)).split("/"),n,l,p,void 0,h)},Ko=(e,t,r,i,n,o,s)=>{if(!t.length)return s(null,o);let a=t.shift(),u=S(H.resolve(e+"/"+a));b.mkdir(u,r,yp(u,t,r,i,n,o,s))},yp=(e,t,r,i,n,o,s)=>a=>{a?b.lstat(e,(u,c)=>{if(u)u.path=u.path&&S(u.path),s(u);else if(c.isDirectory())Ko(e,t,r,i,n,o,s);else if(i)b.unlink(e,l=>{if(l)return s(l);b.mkdir(e,r,yp(e,t,r,i,n,o,s))});else{if(c.isSymbolicLink())return s(new Dp(e,e+"/"+t.join("/")));s(a)}}):(o||=e,Ko(e,t,r,i,n,o,s))},C0=e=>{let t=!1,r;try{t=b.statSync(e).isDirectory()}catch(i){r=i?.code}finally{if(!t)throw new gp(e,r??"ENOTDIR")}},E0=(e,t)=>{e=S(e);let r=t.umask??18,i=t.mode|448,n=(i&r)!==0,o=t.uid,s=t.gid,a=typeof o=="number"&&typeof s=="number"&&(o!==t.processUid||s!==t.processGid),u=t.preserve,c=t.unlink,l=S(t.cwd),p=g=>{g&&a&&Co(g,o,s),n&&b.chmodSync(e,i)};if(e===l)return C0(l),p();if(u)return p(b.mkdirSync(e,{mode:i,recursive:!0})??void 0);let h=S(H.relative(l,e)).split("/"),m;for(let g=h.shift(),y=l;g&&(y+="/"+g);g=h.shift()){y=S(H.resolve(y));try{b.mkdirSync(y,i),m||=y}catch{let w=b.lstatSync(y);if(w.isDirectory())continue;if(c){b.unlinkSync(y),b.mkdirSync(y,i),m||=y;continue}else if(w.isSymbolicLink())return new Dp(y,y+"/"+h.join("/"))}}return p(m)},$o=Object.create(null),ql=1e4,Xt=new Set,w0=e=>{Xt.has(e)?Xt.delete(e):$o[e]=e.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"),Xt.add(e);let t=$o[e],r=Xt.size-ql;if(r>ql/10){for(let i of Xt)if(Xt.delete(i),delete $o[i],--r<=0)break}return t},v0=(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)==="win32",S0=e=>e.split("/").slice(0,-1).reduce((t,r)=>{let i=t[t.length-1];return i!==void 0&&(r=rp(i,r)),t.push(r||"/"),t},[]),F0=class{#e=new Map;#i=new Map;#t=new Set;reserve(e,t){e=v0?["win32 parallelization disabled"]:e.map(i=>Br(rp(w0(i))));let r=new Set(e.map(i=>S0(i)).reduce((i,n)=>i.concat(n)));this.#i.set(t,{dirs:r,paths:e});for(let i of e){let n=this.#e.get(i);n?n.push(t):this.#e.set(i,[t])}for(let i of r){let n=this.#e.get(i);if(!n)this.#e.set(i,[new Set([t])]);else{let o=n[n.length-1];o instanceof Set?o.add(t):n.push(new Set([t]))}}return this.#s(t)}#o(e){let t=this.#i.get(e);if(!t)throw Error("function does not have any path reservations");return{paths:t.paths.map(r=>this.#e.get(r)),dirs:[...t.dirs].map(r=>this.#e.get(r))}}check(e){let{paths:t,dirs:r}=this.#o(e);return t.every(i=>i&&i[0]===e)&&r.every(i=>i&&i[0]instanceof Set&&i[0].has(e))}#s(e){return this.#t.has(e)||!this.check(e)?!1:(this.#t.add(e),e(()=>this.#r(e)),!0)}#r(e){if(!this.#t.has(e))return!1;let t=this.#i.get(e);if(!t)throw Error("invalid reservation");let{paths:r,dirs:i}=t,n=new Set;for(let o of r){let s=this.#e.get(o);if(!s||s?.[0]!==e)continue;let a=s[1];if(!a){this.#e.delete(o);continue}if(s.shift(),typeof a=="function")n.add(a);else for(let u of a)n.add(u)}for(let o of i){let s=this.#e.get(o),a=s?.[0];if(!(!s||!(a instanceof Set)))if(a.size===1&&s.length===1){this.#e.delete(o);continue}else if(a.size===1){s.shift();let u=s[0];typeof u=="function"&&n.add(u)}else a.delete(e)}return this.#t.delete(e),n.forEach(o=>this.#s(o)),!0}},Yl=Symbol("onEntry"),Zo=Symbol("checkFs"),Kl=Symbol("checkFs2"),Jo=Symbol("isReusable"),we=Symbol("makeFs"),Xo=Symbol("file"),Qo=Symbol("directory"),un=Symbol("link"),Zl=Symbol("symlink"),Jl=Symbol("hardlink"),Xl=Symbol("unsupported"),Ql=Symbol("checkPath"),Po=Symbol("stripAbsolutePath"),Dt=Symbol("mkdir"),te=Symbol("onError"),Xi=Symbol("pending"),ep=Symbol("pend"),Qt=Symbol("unpend"),Io=Symbol("ended"),No=Symbol("maybeClose"),ea=Symbol("skip"),Lr=Symbol("doChown"),Mr=Symbol("uid"),Ur=Symbol("gid"),zr=Symbol("checkedCwd"),Hr=(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)==="win32",x0=(e,t)=>{if(!Hr)return b.unlink(e,t);let r=e+".DELETE."+ip(16).toString("hex");b.rename(e,r,i=>{if(i)return t(i);b.unlink(r,t)})},k0=e=>{if(!Hr)return b.unlinkSync(e);let t=e+".DELETE."+ip(16).toString("hex");b.renameSync(e,t),b.unlinkSync(t)},tp=(e,t,r)=>e!==void 0&&e===e>>>0?e:t!==void 0&&t===t>>>0?t:r,pn=class extends rr{[Io]=!1;[zr]=!1;[Xi]=0;reservations=new F0;transform;writable=!0;readable=!1;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(e={}){if(e.ondone=()=>{this[Io]=!0,this[No]()},super(e),this.transform=e.transform,this.chmod=!!e.chmod,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=!!(process.getuid&&process.getuid()===0):this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1024,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||Hr,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=S(H.resolve(e.cwd||process.cwd())),this.strip=Number(e.strip)||0,this.processUmask=this.chmod?typeof e.processUmask=="number"?e.processUmask:process.umask():0,this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[Yl](t))}warn(e,t,r={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(r.recoverable=!1),super.warn(e,t,r)}[No](){this[Io]&&this[Xi]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[Po](e,t){let r=e[t];if(!r||this.preservePaths)return!0;let i=r.split("/");if(i.includes("..")||Hr&&/^[a-z]:\.\.$/i.test(i[0]??"")){if(t==="path")return this.warn("TAR_ENTRY_ERROR",`${t} contains '..'`,{entry:e,[t]:r}),!1;{let s=H.posix.dirname(e.path),a=H.posix.normalize(H.posix.join(s,r));if(a.startsWith("../")||a==="..")return this.warn("TAR_ENTRY_ERROR",`${t} escapes extraction directory`,{entry:e,[t]:r}),!1}}let[n,o]=oa(r);return n&&(e[t]=String(o),this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute ${t}`,{entry:e,[t]:r})),!0}[Ql](e){let t=S(e.path),r=t.split("/");if(this.strip){if(r.length<this.strip)return!1;if(e.type==="Link"){let i=S(String(e.linkpath)).split("/");if(i.length>=this.strip)e.linkpath=i.slice(this.strip).join("/");else return!1}r.splice(0,this.strip),e.path=r.join("/")}if(isFinite(this.maxDepth)&&r.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:t,depth:r.length,maxDepth:this.maxDepth}),!1;if(!this[Po](e,"path")||!this[Po](e,"linkpath"))return!1;if(H.isAbsolute(e.path)?e.absolute=S(H.resolve(e.path)):e.absolute=S(H.resolve(this.cwd,e.path)),!this.preservePaths&&typeof e.absolute=="string"&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:S(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:i}=H.win32.parse(String(e.absolute));e.absolute=i+Ll(String(e.absolute).slice(i.length));let{root:n}=H.win32.parse(e.path);e.path=n+Ll(e.path.slice(n.length))}return!0}[Yl](e){if(!this[Ql](e))return e.resume();switch(Fy.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode|=448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[Zo](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[Xl](e)}}[te](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[Qt](),t.resume())}[Dt](e,t,r){b0(S(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:t},r)}[Lr](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[Mr](e){return tp(this.uid,e.uid,this.processUid)}[Ur](e){return tp(this.gid,e.gid,this.processGid)}[Xo](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.fmode,i=new Or(String(e.absolute),{flags:fp(e.size),mode:r,autoClose:!1});i.on("error",a=>{i.fd&&b.close(i.fd,()=>{}),i.write=()=>!0,this[te](a,e),t()});let n=1,o=a=>{if(a){i.fd&&b.close(i.fd,()=>{}),this[te](a,e),t();return}--n===0&&i.fd!==void 0&&b.close(i.fd,u=>{u?this[te](u,e):this[Qt](),t()})};i.on("finish",()=>{let a=String(e.absolute),u=i.fd;if(typeof u=="number"&&e.mtime&&!this.noMtime){n++;let c=e.atime||new Date,l=e.mtime;b.futimes(u,c,l,p=>p?b.utimes(a,c,l,h=>o(h&&p)):o())}if(typeof u=="number"&&this[Lr](e)){n++;let c=this[Mr](e),l=this[Ur](e);typeof c=="number"&&typeof l=="number"&&b.fchown(u,c,l,p=>p?b.chown(a,c,l,h=>o(h&&p)):o())}o()});let s=this.transform&&this.transform(e)||e;s!==e&&(s.on("error",a=>{this[te](a,e),t()}),e.pipe(s)),s.pipe(i)}[Qo](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.dmode;this[Dt](String(e.absolute),r,i=>{if(i){this[te](i,e),t();return}let n=1,o=()=>{--n===0&&(t(),this[Qt](),e.resume())};e.mtime&&!this.noMtime&&(n++,b.utimes(String(e.absolute),e.atime||new Date,e.mtime,o)),this[Lr](e)&&(n++,b.chown(String(e.absolute),Number(this[Mr](e)),Number(this[Ur](e)),o)),o()})}[Xl](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[Zl](e,t){this[un](e,String(e.linkpath),"symlink",t)}[Jl](e,t){let r=S(H.resolve(this.cwd,String(e.linkpath)));this[un](e,r,"link",t)}[ep](){this[Xi]++}[Qt](){this[Xi]--,this[No]()}[ea](e){this[Qt](),e.resume()}[Jo](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!Hr}[Zo](e){this[ep]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,r=>this[Kl](e,r))}[Kl](e,t){let r=s=>{t(s)},i=()=>{this[Dt](this.cwd,this.dmode,s=>{if(s){this[te](s,e),r();return}this[zr]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let s=S(H.dirname(String(e.absolute)));if(s!==this.cwd)return this[Dt](s,this.dmode,a=>{if(a){this[te](a,e),r();return}o()})}o()},o=()=>{b.lstat(String(e.absolute),(s,a)=>{if(a&&(this.keep||this.newer&&a.mtime>(e.mtime??a.mtime))){this[ea](e),r();return}if(s||this[Jo](e,a))return this[we](null,e,r);if(a.isDirectory()){if(e.type==="Directory"){let u=this.chmod&&e.mode&&(a.mode&4095)!==e.mode,c=l=>this[we](l??null,e,r);return u?b.chmod(String(e.absolute),Number(e.mode),c):c()}if(e.absolute!==this.cwd)return b.rmdir(String(e.absolute),u=>this[we](u??null,e,r))}if(e.absolute===this.cwd)return this[we](null,e,r);x0(String(e.absolute),u=>this[we](u??null,e,r))})};this[zr]?n():i()}[we](e,t,r){if(e){this[te](e,t),r();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[Xo](t,r);case"Link":return this[Jl](t,r);case"SymbolicLink":return this[Zl](t,r);case"Directory":case"GNUDumpDir":return this[Qo](t,r)}}[un](e,t,r,i){b[r](t,String(e.absolute),n=>{n?this[te](n,e):(this[Qt](),e.resume()),i()})}},Qi=e=>{try{return[null,e()]}catch(t){return[t,null]}},ta=class extends pn{sync=!0;[we](e,t){return super[we](e,t,()=>{})}[Zo](e){if(!this[zr]){let n=this[Dt](this.cwd,this.dmode);if(n)return this[te](n,e);this[zr]=!0}if(e.absolute!==this.cwd){let n=S(H.dirname(String(e.absolute)));if(n!==this.cwd){let o=this[Dt](n,this.dmode);if(o)return this[te](o,e)}}let[t,r]=Qi(()=>b.lstatSync(String(e.absolute)));if(r&&(this.keep||this.newer&&r.mtime>(e.mtime??r.mtime)))return this[ea](e);if(t||this[Jo](e,r))return this[we](null,e);if(r.isDirectory()){if(e.type==="Directory"){let[o]=this.chmod&&e.mode&&(r.mode&4095)!==e.mode?Qi(()=>{b.chmodSync(String(e.absolute),Number(e.mode))}):[];return this[we](o,e)}let[n]=Qi(()=>b.rmdirSync(String(e.absolute)));this[we](n,e)}let[i]=e.absolute===this.cwd?[]:Qi(()=>k0(String(e.absolute)));this[we](i,e)}[Xo](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.fmode,i=s=>{let a;try{b.closeSync(n)}catch(u){a=u}(s||a)&&this[te](s||a,e),t()},n;try{n=b.openSync(String(e.absolute),fp(e.size),r)}catch(s){return i(s)}let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",s=>this[te](s,e)),e.pipe(o)),o.on("data",s=>{try{b.writeSync(n,s,0,s.length)}catch(a){i(a)}}),o.on("end",()=>{let s=null;if(e.mtime&&!this.noMtime){let a=e.atime||new Date,u=e.mtime;try{b.futimesSync(n,a,u)}catch(c){try{b.utimesSync(String(e.absolute),a,u)}catch{s=c}}}if(this[Lr](e)){let a=this[Mr](e),u=this[Ur](e);try{b.fchownSync(n,Number(a),Number(u))}catch(c){try{b.chownSync(String(e.absolute),Number(a),Number(u))}catch{s||=c}}}i(s)})}[Qo](e,t){let r=typeof e.mode=="number"?e.mode&4095:this.dmode,i=this[Dt](String(e.absolute),r);if(i){this[te](i,e),t();return}if(e.mtime&&!this.noMtime)try{b.utimesSync(String(e.absolute),e.atime||new Date,e.mtime)}catch{}if(this[Lr](e))try{b.chownSync(String(e.absolute),Number(this[Mr](e)),Number(this[Ur](e)))}catch{}t(),e.resume()}[Dt](e,t){try{return E0(S(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:t})}catch(r){return r}}[un](e,t,r,i){let n=`${r}Sync`;try{b[n](t,String(e.absolute)),i(),e.resume()}catch(o){return this[te](o,e)}}},A0=Gr(e=>{let t=new ta(e),r=e.file,i=b.statSync(r);new bl(r,{readSize:e.maxReadSize||16*1024*1024,size:i.size}).pipe(t)},(e,t)=>{let r=new pn(e),i=e.maxReadSize||16*1024*1024,n=e.file;return new Promise((o,s)=>{r.on("error",s),r.on("close",o),b.stat(n,(a,u)=>{if(a)s(a);else{let c=new zi(n,{readSize:i,size:u.size});c.on("error",s),c.pipe(r)}})})},e=>new ta(e),e=>new pn(e),(e,t)=>{t?.length&&sa(e,t)}),_0=(e,t)=>{let r=new dn(e),i=!0,n,o;try{try{n=b.openSync(e.file,"r+")}catch(u){if(u?.code==="ENOENT")n=b.openSync(e.file,"w+");else throw u}let s=b.fstatSync(n),a=Buffer.alloc(512);e:for(o=0;o<s.size;o+=512){for(let l=0,p=0;l<512;l+=p){if(p=b.readSync(n,a,l,a.length-l,o+l),o===0&&a[0]===31&&a[1]===139)throw Error("cannot append to compressed archives");if(!p)break e}let u=new yt(a);if(!u.cksumValid)break;let c=512*Math.ceil((u.size||0)/512);if(o+c+512>s.size)break;o+=c,e.mtimeCache&&u.mtime&&e.mtimeCache.set(String(u.path),u.mtime)}i=!1,T0(e,r,o,n,t)}finally{if(i)try{b.closeSync(n)}catch{}}},T0=(e,t,r,i,n)=>{let o=new po(e.file,{fd:i,start:r});t.pipe(o),R0(t,n)},O0=(e,t)=>{t=Array.from(t);let r=new qr(e),i=(n,o,s)=>{let a=(h,m)=>{h?b.close(n,g=>s(h)):s(null,m)},u=0;if(o===0)return a(null,0);let c=0,l=Buffer.alloc(512),p=(h,m)=>{if(h||m===void 0)return a(h);if(c+=m,c<512&&m)return b.read(n,l,c,l.length-c,u+c,p);if(u===0&&l[0]===31&&l[1]===139)return a(Error("cannot append to compressed archives"));if(c<512)return a(null,u);let g=new yt(l);if(!g.cksumValid)return a(null,u);let y=512*Math.ceil((g.size??0)/512);if(u+y+512>o||(u+=y+512,u>=o))return a(null,u);e.mtimeCache&&g.mtime&&e.mtimeCache.set(String(g.path),g.mtime),c=0,b.read(n,l,0,512,u,p)};b.read(n,l,0,512,u,p)};return new Promise((n,o)=>{r.on("error",o);let s="r+",a=(u,c)=>{if(u&&u.code==="ENOENT"&&s==="r+")return s="w+",b.open(e.file,s,a);if(u||!c)return o(u);b.fstat(c,(l,p)=>{if(l)return b.close(c,()=>o(l));i(c,p.size,(h,m)=>{if(h)return o(h);let g=new Or(e.file,{fd:c,start:m});r.pipe(g),g.on("error",o),g.on("close",n),$0(r,t)})})};b.open(e.file,s,a)})},R0=(e,t)=>{t.forEach(r=>{r.charAt(0)==="@"?Vr({file:H.resolve(e.cwd,r.slice(1)),sync:!0,noResume:!0,onReadEntry:i=>e.add(i)}):e.add(r)}),e.end()},$0=async(e,t)=>{for(let r=0;r<t.length;r++){let i=String(t[r]);i.charAt(0)==="@"?await Vr({file:H.resolve(String(e.cwd),i.slice(1)),noResume:!0,onReadEntry:n=>e.add(n)}):e.add(i)}e.end()},tr=Gr(_0,O0,()=>{throw TypeError("file is required")},()=>{throw TypeError("file is required")},(e,t)=>{if(!Oy(e))throw TypeError("file is required");if(e.gzip||e.brotli||e.zstd||e.file.endsWith(".br")||e.file.endsWith(".tbr"))throw TypeError("cannot append to compressed archives");if(!t?.length)throw TypeError("no paths specified to add/replace")});Gr(tr.syncFile,tr.asyncFile,tr.syncNoFile,tr.asyncNoFile,(e,t=[])=>{tr.validate?.(e,t),P0(e)});P0=e=>{let t=e.filter;e.mtimeCache||=new Map,e.filter=t?(r,i)=>t(r,i)&&!((e.mtimeCache?.get(r)??i.mtime??0)>(i.mtime??0)):(r,i)=>!((e.mtimeCache?.get(r)??i.mtime??0)>(i.mtime??0))},I0=Ri({Header:()=>yt,Pack:()=>qr,PackJob:()=>Vo,PackSync:()=>dn,Parser:()=>rr,Pax:()=>Wr,ReadEntry:()=>na,Unpack:()=>pn,UnpackSync:()=>ta,WriteEntry:()=>ua,WriteEntrySync:()=>cp,WriteEntryTar:()=>lp,extract:()=>A0,filesFilter:()=>sa,list:()=>Vr,replace:()=>tr})});import{mkdir as Ep,readFile as N0,rm as j0,writeFile as B0}from"node:fs/promises";import{createWriteStream as L0,existsSync as It,readdirSync as M0,renameSync as U0}from"node:fs";import{pipeline as z0}from"node:stream";import{homedir as H0,tmpdir as W0}from"node:os";import{promisify as G0}from"node:util";async function V0(e,t,r={}){let i=t+".json",n=JSON.parse(await N0(i,"utf8").catch(()=>"{}")),o=(await Yr(e,{method:"HEAD",headers:r.headers}).catch(()=>{}))?.headers.get("etag");if(n.etag===o&&It(t))return;typeof o=="string"&&(n.etag=o);let s=await Yr(e,{headers:r.headers});if(s.status>=400)throw new Error(`Failed to download ${e}: ${s.status} ${s.statusText}`);let a=L0(t);await G0(z0)(s.body,a),await B0(i,JSON.stringify(n),"utf8")}function fn(e){let t=e.match(q0)?.groups||{};return{repo:t.repo||"",subdir:t.subdir||"/",ref:t.ref?t.ref.slice(1):"main"}}function ir(...e){process.env.DEBUG&&console.debug("[giget]",...e)}async function Yr(e,t={}){t.headers?.["sec-fetch-mode"]&&(t.mode=t.headers["sec-fetch-mode"]);let r=await fetch(e,{...t,headers:Fp(t.headers)}).catch(i=>{throw new Error(`Failed to download ${e}: ${i}`,{cause:i})});if(t.validateStatus&&r.status>=400)throw new Error(`Failed to fetch ${e}: ${r.status} ${r.statusText}`);return r}function Y0(){let e=process.env.XDG_CACHE_HOME?pe(process.env.XDG_CACHE_HOME,"giget"):pe(H0(),".cache/giget");if(process.platform==="win32"){let t=pe(W0(),"giget");if(!It(t)&&It(e))try{U0(e,t)}catch{}return t}return e}function Fp(e={}){let t={};for(let[r,i]of Object.entries(e))i&&(t[r.toLowerCase()]=i);return t}async function la(e,t={}){t.registry=process.env.GIGET_REGISTRY??t.registry,t.auth=process.env.GIGET_AUTH??t.auth;let r=t.registry===!1?void 0:xp(t.registry,{auth:t.auth}),i=t.provider||(r?"registry":"github"),n=e,o=e.match(eb);o&&(i=o[1],n=e.slice(o[0].length),(i==="http"||i==="https")&&(n=e));let s=t.providers?.[i]||X0[i]||r;if(!s)throw new Error(`Unsupported provider: ${i}`);let a=await Promise.resolve().then(()=>s(n,{auth:t.auth})).catch(m=>{throw new Error(`Failed to download template from ${i}: ${m.message}`)});if(!a)throw new Error(`Failed to resolve template from ${i}`);a.name=(a.name||"template").replace(/[^\da-z-]/gi,"-"),a.defaultDir=(a.defaultDir||a.name).replace(/[^\da-z-]/gi,"-");let u=pe(pe(Y0(),i,a.name),(a.version||a.name)+".tar.gz");if(t.preferOffline&&It(u)&&(t.offline=!0),!t.offline){await Ep(Ys(u),{recursive:!0});let m=Date.now();await V0(a.tar,u,{headers:{Authorization:t.auth?`Bearer ${t.auth}`:void 0,...Fp(a.headers)}}).catch(g=>{if(!It(u))throw g;ir("Download error. Using cached version:",g),t.offline=!0}),ir(`Downloaded ${a.tar} to ${u} in ${Date.now()-m}ms`)}if(!It(u))throw new Error(`Tarball not found: ${u} (offline: ${t.offline})`);let c=pe(pe(t.cwd||"."),t.dir||a.defaultDir);if(t.forceClean&&await j0(c,{recursive:!0,force:!0}),!t.force&&It(c)&&M0(c).length>0)throw new Error(`Destination ${c} already exists.`);await Ep(c,{recursive:!0});let l=Date.now(),p=a.subdir?.replace(/^\//,"")||"",{extract:h}=await Promise.resolve().then(()=>(Cp(),bp)).then(m=>m.t);if(await h({file:u,cwd:c,onReadEntry(m){m.path=m.path.split("/").splice(1).join("/"),p&&(m.path.startsWith(p+"/")?m.path=m.path.slice(p.length):m.path="")}}),ir(`Extracted to ${c} in ${Date.now()-l}ms`),t.install){ir("Installing dependencies...");let{installDependencies:m}=await Promise.resolve().then(()=>(Js(),hl)).then(g=>g.t);await m({cwd:c,silent:t.silent,...typeof t.install=="object"?t.install:{}})}return{...a,source:n,dir:c}}var q0,wp,vp,Sp,K0,Z0,J0,X0,Q0,xp,eb,kp=D(()=>{Js();q0=/^(?<repo>[\w.-]+\/[\w.-]+)(?<subdir>[^#]+)?(?<ref>#[\w./@-]+)?/;wp=async(e,t)=>{if(e.endsWith(".json"))return await vp(e,t);let r=new URL(e),i=Ks(r.pathname);try{let n=await Yr(r.href,{method:"HEAD",validateStatus:!0,headers:{authorization:t.auth?`Bearer ${t.auth}`:void 0}});if((n.headers.get("content-type")||"").includes("application/json"))return await vp(e,t);let o=n.headers.get("content-disposition")?.match(/filename="?(.+)"?/)?.[1];o&&(i=o.split(".")[0])}catch(n){ir(`Failed to fetch HEAD for ${r.href}:`,n)}return{name:`${i}-${r.href.slice(0,8)}`,version:"",subdir:"",tar:r.href,defaultDir:i,headers:{Authorization:t.auth?`Bearer ${t.auth}`:void 0}}},vp=async(e,t)=>{let r=await(await Yr(e,{validateStatus:!0,headers:{authorization:t.auth?`Bearer ${t.auth}`:void 0}})).json();if(!r.tar||!r.name)throw new Error(`Invalid template info from ${e}. name or tar fields are missing!`);return r},Sp=(e,t)=>{let r=fn(e),i=process.env.GIGET_GITHUB_URL||"https://api.github.com";return{name:r.repo.replace("/","-"),version:r.ref,subdir:r.subdir,headers:{Authorization:t.auth?`Bearer ${t.auth}`:void 0,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"},url:`${i.replace("api.github.com","github.com")}/${r.repo}/tree/${r.ref}${r.subdir}`,tar:`${i}/repos/${r.repo}/tarball/${r.ref}`}},K0=(e,t)=>{let r=fn(e),i=process.env.GIGET_GITLAB_URL||"https://gitlab.com";return{name:r.repo.replace("/","-"),version:r.ref,subdir:r.subdir,headers:{authorization:t.auth?`Bearer ${t.auth}`:void 0,"sec-fetch-mode":"same-origin"},url:`${i}/${r.repo}/tree/${r.ref}${r.subdir}`,tar:`${i}/${r.repo}/-/archive/${r.ref}.tar.gz`}},Z0=(e,t)=>{let r=fn(e);return{name:r.repo.replace("/","-"),version:r.ref,subdir:r.subdir,headers:{authorization:t.auth?`Bearer ${t.auth}`:void 0},url:`https://bitbucket.com/${r.repo}/src/${r.ref}${r.subdir}`,tar:`https://bitbucket.org/${r.repo}/get/${r.ref}.tar.gz`}},J0=(e,t)=>{let r=fn(e);return{name:r.repo.replace("/","-"),version:r.ref,subdir:r.subdir,headers:{authorization:t.auth?`Bearer ${t.auth}`:void 0},url:`https://git.sr.ht/~${r.repo}/tree/${r.ref}/item${r.subdir}`,tar:`https://git.sr.ht/~${r.repo}/archive/${r.ref}.tar.gz`}},X0={http:wp,https:wp,github:Sp,gh:Sp,gitlab:K0,bitbucket:Z0,sourcehut:J0},Q0="https://raw.githubusercontent.com/unjs/giget/main/templates",xp=(e=Q0,t={})=>(async r=>{let i=Date.now(),n=`${e}/${r}.json`,o=await Yr(n,{headers:{authorization:t.auth?`Bearer ${t.auth}`:void 0}});if(o.status>=400)throw new Error(`Failed to download ${r} template info from ${n}: ${o.status} ${o.statusText}`);let s=await o.json();if(!s.tar||!s.name)throw new Error(`Invalid template info from ${n}. name or tar fields are missing!`);return ir(`Fetched ${r} template info from ${n} in ${Date.now()-i}ms`),s}),eb=/^([\w-.]+):/});var Ap=D(()=>{kp()});var gn,_p,tb,rb,pa,Je,ha=D(()=>{"use strict";gn=G(oe(),1),_p=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],tb=gn.default.green("\u2714"),rb=gn.default.red("\u2716"),pa=()=>{let e=null,t=0,r="",i=()=>{process.stdout.write("\r\x1B[K")},n=()=>{i(),process.stdout.write(`${gn.default.cyan(_p[t])} ${r}`),t=(t+1)%_p.length};return{start:o=>{r=o,t=0,e&&clearInterval(e),e=setInterval(n,80),n()},succeed:o=>{e&&(clearInterval(e),e=null),i(),console.log(`${tb} ${o||r}`)},fail:o=>{e&&(clearInterval(e),e=null),i(),console.log(`${rb} ${o||r}`)},stop:()=>{e&&(clearInterval(e),e=null),i()}}},Je=e=>{let t=pa();return t.start(e),t}});var Tp,Op,Dn,Rp,$p,ib,nb,ma,da,Pp=D(()=>{"use strict";Ap();Tp=G(oe(),1);Cr();ha();Op={saas:"gh:Moshaban09/nexo-templates/react/saas",landing:"gh:Moshaban09/nexo-templates/react/landing",dashboard:"gh:Moshaban09/nexo-templates/react/dashboard",portfolio:"gh:Moshaban09/nexo-templates/react/portfolio",ecommerce:"gh:Moshaban09/nexo-templates/react/ecommerce","blog-docs":"gh:Moshaban09/nexo-templates/react/blog-docs","components-ui":"gh:Moshaban09/nexo-templates/react/components-ui"},Dn=e=>e instanceof Error?e.message.toLowerCase():String(e).toLowerCase(),Rp=e=>{let t=Dn(e);return t.includes("network")||t.includes("enotfound")||t.includes("econnrefused")||t.includes("etimedout")||t.includes("unable to connect")||t.includes("unable to access")||t.includes("fetch failed")},$p=e=>{let t=Dn(e);return t.includes("403")||t.includes("rate limit")},ib=e=>{let r=Dn(e).match(/retry[- ]?after[:\s]+(\d+)/i);if(r)return parseInt(r[1],10)},nb=e=>{let t=Dn(e);return Rp(e)||$p(e)||t.includes("500")||t.includes("502")||t.includes("503")||t.includes("504")},ma=async(e,t,r=vi)=>{let i;for(let n=0;n<=r.maxRetries;n++){let s=n>0?`Retrying (${n}/${r.maxRetries})...`:`Cloning template from ${e}...`,a=Je(s);try{await la(e,{dir:t,force:!0}),a.succeed("Template cloned successfully");return}catch(u){if(a.fail(),i=u,n<r.maxRetries&&nb(u)){let c=$c(n,r);console.log(Tp.default.yellow(` \u23F3 Waiting ${c/1e3}s before retry...`)),await Pc(c);continue}break}}if($p(i)){let n=ib(i);throw new xi(`GitHub rate limit exceeded while cloning "${e}"`,n,n?new Date(Date.now()+n*1e3):void 0)}throw Rp(i)?new ki(`Unable to clone "${e}" - no network connection.
106
106
  Try again when online, or use a local template with --template-dir.`):new Fi(`Failed to clone template "${e}" after ${r.maxRetries+1} attempts: ${i?.message||"Unknown error"}`,`https://github.com/${e}`,void 0,r.maxRetries+1)},da=e=>Op[e.toLowerCase()]});import Kr from"node:path";var fa,sb,Ip,Np,ob,jp,ab,ub,cb,lb,pb,hb,mb,db,fb,Bp=D(()=>{"use strict";st();fa=async(e,t)=>{let r=await nt(e);if(t.dependencies)for(let[i,n]of Object.entries(t.dependencies))wr(r,i,n,!1);if(t.devDependencies)for(let[i,n]of Object.entries(t.devDependencies))wr(r,i,n,!0);return await Oi(e,r),r},sb=async(e,t,r)=>t?fa(e,r):null,Ip=async(e,t)=>{await Promise.all(t.map(async r=>{let i=Kr.join(e.projectPath,r.path);await x(Kr.dirname(i)),await v(i,r.content)}))},Np=async(e,t)=>{let r=Object.entries(t).map(([i,n])=>({path:i,content:n}));await Ip(e,r)},ob=async(e,t,r)=>{let i=Kr.join(e.projectPath,t),{pathExists:n}=await Promise.resolve().then(()=>(st(),Vc));return await n(i)?!1:(await x(Kr.dirname(i)),await v(i,r),!0)},jp=async(e,t)=>{await Promise.all(t.map(r=>x(Kr.join(e.projectPath,r))))},ab=(e,t)=>{let r=e;for(let[i,n]of Object.entries(t))r=r.replace(new RegExp(`\\{\\{${i}\\}\\}`,"g"),n);return r},ub=e=>e.map(({from:t,imports:r,default:i})=>{let n=[];return i&&n.push(i),Array.isArray(r)&&r.length>0?n.push(`{ ${r.join(", ")} }`):typeof r=="string"&&r&&n.push(`{ ${r} }`),`import ${n.join(", ")} from '${t}'`}).join(`
107
- `),cb=(e,t)=>e.selections[t]==="none",lb=e=>{let t=e.selections.variant.startsWith("ts");return{ts:t,ext:t?"tsx":"jsx",configExt:t?"ts":"js"}},pb=e=>async t=>{let r=t.selections[e.selectionKey];if(r==="none")return;let i=e.configs[r];if(i){if((i.dependencies||i.devDependencies)&&await fa(t,{dependencies:i.dependencies,devDependencies:i.devDependencies}),i.directories&&await jp(t,i.directories),i.files){let n=i.files(t);await Np(t,n)}i.setup&&await i.setup(t)}},hb=async(e,t)=>e?t():null,mb=(e,t,r)=>e?t:r,db=(...e)=>e.filter(t=>t!==!1&&t!==null&&t!==void 0),fb=(...e)=>{let t={};for(let r of e)if(r&&Array.isArray(r)){let[i,n]=r;n!=null&&(t[i]=n)}return t}});var qp={};k(qp,{MAX_MAJOR_CONSTRAINTS:()=>Up,checkNetworkConnectivity:()=>Gp,clearCache:()=>yb,fetchWithTimeout:()=>bn,getCached:()=>zp,getLatestVersion:()=>Wp,getPackageVersions:()=>Vp,isOffline:()=>Cb,setCache:()=>Hp,setOfflineMode:()=>Eb,startPrefetch:()=>vb,waitForPrefetch:()=>Sb});var Mp,gb,Da,Db,Lp,Up,yn,zp,Hp,yb,nr,ga,bb,Cb,Eb,bn,Wp,Gp,Vp,Zr,wb,vb,Sb,Yp=D(()=>{"use strict";Mp=G(oe(),1),gb=3e3,Da="https://registry.npmjs.org",Db=36e5,Lp={react:"^19.0.0","react-dom":"^19.0.0","@vitejs/plugin-react":"^4.3.4",zustand:"^5.0.0","@reduxjs/toolkit":"^2.5.0",jotai:"^2.11.0","react-router-dom":"^7.13.0","@tanstack/react-router":"^1.157.0","@tanstack/react-query":"^5.64.0",axios:"^1.7.0","react-hook-form":"^7.54.0",zod:"^3.24.0",tailwindcss:"^4.0.0","lucide-react":"^0.553.0",eslint:"^9.29.0","@eslint/js":"^9.29.0",globals:"^16.0.0","typescript-eslint":"^8.33.0","eslint-plugin-react-hooks":"^5.2.0","eslint-plugin-react-refresh":"^0.4.20"},Up={eslint:9,"@eslint/js":9},yn=new Map,zp=e=>{let t=yn.get(e);return t?Date.now()-t.timestamp>Db?(yn.delete(e),null):t.value:null},Hp=(e,t)=>{yn.set(e,{value:t,timestamp:Date.now()})},yb=()=>{yn.clear()},nr=!1,ga=0,bb=3e4,Cb=()=>nr,Eb=e=>{nr=e,e&&console.log(Mp.default.yellow("\u26A0 Offline mode enabled. Using built-in stable versions."))},bn=async(e,t={},r=gb)=>{let i=new AbortController,n=setTimeout(()=>i.abort(),r);try{let o=await fetch(e,{...t,signal:i.signal});return clearTimeout(n),o}catch(o){throw clearTimeout(n),o.name==="AbortError"?new Error(`Network timeout after ${r}ms`):o}},Wp=async e=>{let t=zp(`version:${e}`);if(t)return t;if(nr)return Lp[e]||"latest";let r=Up[e];try{let i;if(r!==void 0){let n=await bn(`${Da}/${encodeURIComponent(e)}`,{headers:{Accept:"application/json"}});if(!n.ok)throw new Error(`HTTP ${n.status}`);let o=await n.json(),a=Object.keys(o.versions??{}).filter(u=>{let c=u.match(/^(\d+)\./);return c&&parseInt(c[1],10)<=r}).sort((u,c)=>{let l=N=>N.split(".").map(Number),[p,h,m]=l(u),[g,y,w]=l(c);return g-p||y-h||w-m});if(a.length===0)throw new Error("No compatible version found");i=`^${a[0]}`}else{let n=await bn(`${Da}/${encodeURIComponent(e)}/latest`,{headers:{Accept:"application/json"}});if(!n.ok)throw new Error(`HTTP ${n.status}`);i=`^${(await n.json()).version}`}return Hp(`version:${e}`,i),i}catch{return Lp[e]??"latest"}},Gp=async()=>{let e=Date.now();if(e-ga<bb)return!nr;try{return await bn(`${Da}/react`,{},2e3),ga=e,nr=!1,!0}catch{return ga=e,nr=!0,!1}},Vp=async e=>{let t={};return await Promise.all(e.map(async r=>{t[r]=await Wp(r)})),t},Zr=null,wb=["react","react-dom","zustand","react-router-dom","@tanstack/react-query","react-hook-form","zod","tailwindcss","lucide-react"],vb=()=>{Zr||(Zr=(async()=>{try{if(!await Gp())return;await Vp(wb)}catch{}finally{Zr=null}})())},Sb=async()=>{Zr&&await Zr}});var ya={};k(ya,{PackageManager:()=>Cn});import Fb from"node:path";var Cn,En=D(()=>{"use strict";st();Cn=class{projectPath;pkg=null;dependencies=new Map;devDependencies=new Map;scripts=new Map;constructor(t){this.projectPath=t}async load(t){this.pkg=await nt(t),this.pkg.dependencies&&Object.entries(this.pkg.dependencies).forEach(([r,i])=>this.dependencies.set(r,i)),this.pkg.devDependencies&&Object.entries(this.pkg.devDependencies).forEach(([r,i])=>this.devDependencies.set(r,i)),this.pkg.scripts&&Object.entries(this.pkg.scripts).forEach(([r,i])=>this.scripts.set(r,i))}add(t,r,i=!1){i?this.devDependencies.set(t,r):this.dependencies.set(t,r)}addScript(t,r){this.scripts.set(t,r)}set(t,r){this.pkg&&(this.pkg[t]=r)}async resolveLatestVersions(){if(process.env.NODE_ENV==="test")return;let t=[...this.dependencies.keys()],r=[...this.devDependencies.keys()],i=[...new Set([...t,...r])];if(i.length===0)return;let{getLatestVersion:n}=await Promise.resolve().then(()=>(Yp(),qp)),o=await Promise.allSettled(i.map(async s=>{try{let a=await n(s);return{name:s,version:a}}catch{return{name:s,version:null}}}));for(let s of o)if(s.status==="fulfilled"&&s.value.version){let{name:a,version:u}=s.value;if(u==="latest"||/^\^?\d+\.\d+\.\d+/.test(u)){let c=u==="latest"||u.startsWith("^")?u:`^${u}`;this.dependencies.has(a)&&this.dependencies.set(a,c),this.devDependencies.has(a)&&this.devDependencies.set(a,c)}}}async save(){if(!this.pkg)throw new Error("Package.json not loaded. Call load() first.");let t=r=>Object.fromEntries([...r.entries()].sort((i,n)=>i[0].localeCompare(n[0])));this.pkg.dependencies=t(this.dependencies),this.pkg.devDependencies=t(this.devDependencies),this.pkg.scripts=t(this.scripts),await He(Fb.join(this.projectPath,"package.json"),this.pkg)}}});var Zp={};k(Zp,{detectAvailableManagers:()=>Sn,detectPackageManagerUsed:()=>wn,getInstallCommand:()=>Nt,getPrefetchCommand:()=>vn,getRunCommand:()=>Kp});import{execSync as ba}from"node:child_process";var wn,vn,Sn,Nt,Kp,Fn=D(()=>{"use strict";wn=()=>{let e=process.env.npm_config_user_agent;if(e){if(e.startsWith("pnpm"))return"pnpm";if(e.startsWith("yarn"))return"yarn";if(e.startsWith("bun"))return"bun"}return"npm"},vn=e=>{switch(e){case"npm":return{command:"npm",args:["cache","add"]};case"pnpm":return{command:"pnpm",args:["store","add"]};case"yarn":return{command:"yarn",args:["cache","add"]};case"bun":return null;default:return{command:"npm",args:["cache","add"]}}},Sn=()=>{let e=["npm"];try{ba("pnpm --version",{stdio:"ignore"}),e.push("pnpm")}catch{}try{ba("yarn --version",{stdio:"ignore"}),e.push("yarn")}catch{}try{ba("bun --version",{stdio:"ignore"}),e.push("bun")}catch{}return e},Nt=(e,t={})=>{let{audit:r=!1,strict:i=!1}=t;switch(e){case"npm":return`npm install ${r?"":"--no-audit"} ${i?"":"--legacy-peer-deps"}`.replace(/\s+/g," ").trim();case"pnpm":return"pnpm install";case"bun":return"bun install";case"yarn":return"yarn install";default:return"npm install"}},Kp=(e,t)=>{switch(e){case"npm":return`npm run ${t}`;case"pnpm":return`pnpm run ${t}`;case"bun":return`bun run ${t}`;case"yarn":return`yarn ${t}`;default:return`npm run ${t}`}}});var th=I((i2,eh)=>{eh.exports=Qp;Qp.sync=kb;var Jp=ce("fs");function xb(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var i=0;i<r.length;i++){var n=r[i].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n)return!0}return!1}function Xp(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:xb(t,r)}function Qp(e,t,r){Jp.stat(e,function(i,n){r(i,i?!1:Xp(n,e,t))})}function kb(e,t){return Xp(Jp.statSync(e),e,t)}});var oh=I((n2,sh)=>{sh.exports=ih;ih.sync=Ab;var rh=ce("fs");function ih(e,t,r){rh.stat(e,function(i,n){r(i,i?!1:nh(n,t))})}function Ab(e,t){return nh(rh.statSync(e),t)}function nh(e,t){return e.isFile()&&_b(e,t)}function _b(e,t){var r=e.mode,i=e.uid,n=e.gid,o=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),l=a|u,p=r&c||r&u&&n===s||r&a&&i===o||r&l&&o===0;return p}});var uh=I((o2,ah)=>{var s2=ce("fs"),xn;process.platform==="win32"||global.TESTING_WINDOWS?xn=th():xn=oh();ah.exports=Ca;Ca.sync=Tb;function Ca(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){Ca(e,t||{},function(o,s){o?n(o):i(s)})})}xn(e,t||{},function(i,n){i&&(i.code==="EACCES"||t&&t.ignoreErrors)&&(i=null,n=!1),r(i,n)})}function Tb(e,t){try{return xn.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var fh=I((a2,dh)=>{var sr=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",ch=ce("path"),Ob=sr?";":":",lh=uh(),ph=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),hh=(e,t)=>{let r=t.colon||Ob,i=e.match(/\//)||sr&&e.match(/\\/)?[""]:[...sr?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=sr?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=sr?n.split(r):[""];return sr&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:n}},mh=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:i,pathExt:n,pathExtExe:o}=hh(e,t),s=[],a=c=>new Promise((l,p)=>{if(c===i.length)return t.all&&s.length?l(s):p(ph(e));let h=i[c],m=/^".*"$/.test(h)?h.slice(1,-1):h,g=ch.join(m,e),y=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+g:g;l(u(y,c,0))}),u=(c,l,p)=>new Promise((h,m)=>{if(p===n.length)return h(a(l+1));let g=n[p];lh(c+g,{pathExt:o},(y,w)=>{if(!y&&w)if(t.all)s.push(c+g);else return h(c+g);return h(u(c,l,p+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},Rb=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=hh(e,t),o=[];for(let s=0;s<r.length;s++){let a=r[s],u=/^".*"$/.test(a)?a.slice(1,-1):a,c=ch.join(u,e),l=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+c:c;for(let p=0;p<i.length;p++){let h=l+i[p];try{if(lh.sync(h,{pathExt:n}))if(t.all)o.push(h);else return h}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw ph(e)};dh.exports=mh;mh.sync=Rb});var Dh=I((u2,Ea)=>{"use strict";var gh=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};Ea.exports=gh;Ea.exports.default=gh});var Eh=I((c2,Ch)=>{"use strict";var yh=ce("path"),$b=fh(),Pb=Dh();function bh(e,t){let r=e.options.env||process.env,i=process.cwd(),n=e.options.cwd!=null,o=n&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let s;try{s=$b.sync(e.command,{path:r[Pb({env:r})],pathExt:t?yh.delimiter:void 0})}catch{}finally{o&&process.chdir(i)}return s&&(s=yh.resolve(n?e.options.cwd:"",s)),s}function Ib(e){return bh(e)||bh(e,!0)}Ch.exports=Ib});var wh=I((l2,va)=>{"use strict";var wa=/([()\][%!^"`<>&|;, *?])/g;function Nb(e){return e=e.replace(wa,"^$1"),e}function jb(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(wa,"^$1"),t&&(e=e.replace(wa,"^$1")),e}va.exports.command=Nb;va.exports.argument=jb});var Sh=I((p2,vh)=>{"use strict";vh.exports=/^#!(.*)/});var xh=I((h2,Fh)=>{"use strict";var Bb=Sh();Fh.exports=(e="")=>{let t=e.match(Bb);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n}});var Ah=I((m2,kh)=>{"use strict";var Sa=ce("fs"),Lb=xh();function Mb(e){let r=Buffer.alloc(150),i;try{i=Sa.openSync(e,"r"),Sa.readSync(i,r,0,150,0),Sa.closeSync(i)}catch{}return Lb(r.toString())}kh.exports=Mb});var Rh=I((d2,Oh)=>{"use strict";var Ub=ce("path"),_h=Eh(),Th=wh(),zb=Ah(),Hb=process.platform==="win32",Wb=/\.(?:com|exe)$/i,Gb=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Vb(e){e.file=_h(e);let t=e.file&&zb(e.file);return t?(e.args.unshift(e.file),e.command=t,_h(e)):e.file}function qb(e){if(!Hb)return e;let t=Vb(e),r=!Wb.test(t);if(e.options.forceShell||r){let i=Gb.test(t);e.command=Ub.normalize(e.command),e.command=Th.command(e.command),e.args=e.args.map(o=>Th.argument(o,i));let n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Yb(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let i={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?i:qb(i)}Oh.exports=Yb});var Ih=I((f2,Ph)=>{"use strict";var Fa=process.platform==="win32";function xa(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Kb(e,t){if(!Fa)return;let r=e.emit;e.emit=function(i,n){if(i==="exit"){let o=$h(n,t);if(o)return r.call(e,"error",o)}return r.apply(e,arguments)}}function $h(e,t){return Fa&&e===1&&!t.file?xa(t.original,"spawn"):null}function Zb(e,t){return Fa&&e===1&&!t.file?xa(t.original,"spawnSync"):null}Ph.exports={hookChildProcess:Kb,verifyENOENT:$h,verifyENOENTSync:Zb,notFoundError:xa}});var Bh=I((g2,or)=>{"use strict";var Nh=ce("child_process"),ka=Rh(),Aa=Ih();function jh(e,t,r){let i=ka(e,t,r),n=Nh.spawn(i.command,i.args,i.options);return Aa.hookChildProcess(n,i),n}function Jb(e,t,r){let i=ka(e,t,r),n=Nh.spawnSync(i.command,i.args,i.options);return n.error=n.error||Aa.verifyENOENTSync(n.status,i),n}or.exports=jh;or.exports.spawn=jh;or.exports.sync=Jb;or.exports._parse=ka;or.exports._enoent=Aa});function _a(e){let t=typeof e=="string"?`
107
+ `),cb=(e,t)=>e.selections[t]==="none",lb=e=>{let t=e.selections.variant.startsWith("ts");return{ts:t,ext:t?"tsx":"jsx",configExt:t?"ts":"js"}},pb=e=>async t=>{let r=t.selections[e.selectionKey];if(r==="none")return;let i=e.configs[r];if(i){if((i.dependencies||i.devDependencies)&&await fa(t,{dependencies:i.dependencies,devDependencies:i.devDependencies}),i.directories&&await jp(t,i.directories),i.files){let n=i.files(t);await Np(t,n)}i.setup&&await i.setup(t)}},hb=async(e,t)=>e?t():null,mb=(e,t,r)=>e?t:r,db=(...e)=>e.filter(t=>t!==!1&&t!==null&&t!==void 0),fb=(...e)=>{let t={};for(let r of e)if(r&&Array.isArray(r)){let[i,n]=r;n!=null&&(t[i]=n)}return t}});var qp={};k(qp,{MAX_MAJOR_CONSTRAINTS:()=>Up,checkNetworkConnectivity:()=>Gp,clearCache:()=>yb,fetchWithTimeout:()=>bn,getCached:()=>zp,getLatestVersion:()=>Wp,getPackageVersions:()=>Vp,isOffline:()=>Cb,setCache:()=>Hp,setOfflineMode:()=>Eb,startPrefetch:()=>vb,waitForPrefetch:()=>Sb});var Mp,gb,Da,Db,Lp,Up,yn,zp,Hp,yb,nr,ga,bb,Cb,Eb,bn,Wp,Gp,Vp,Zr,wb,vb,Sb,Yp=D(()=>{"use strict";Mp=G(oe(),1),gb=3e3,Da="https://registry.npmjs.org",Db=36e5,Lp={react:"^19.0.0","react-dom":"^19.0.0","@vitejs/plugin-react":"^4.3.4",zustand:"^5.0.0","@reduxjs/toolkit":"^2.5.0",jotai:"^2.11.0","react-router-dom":"^7.13.0","@tanstack/react-router":"^1.157.0","@tanstack/react-query":"^5.64.0",axios:"^1.7.0","react-hook-form":"^7.54.0",zod:"^3.24.0",tailwindcss:"^4.0.0","lucide-react":"^0.553.0",eslint:"^9.29.0","@eslint/js":"^9.29.0",globals:"^16.0.0","typescript-eslint":"^8.33.0","eslint-plugin-react-hooks":"^5.2.0","eslint-plugin-react-refresh":"^0.4.20"},Up={eslint:9,"@eslint/js":9},yn=new Map,zp=e=>{let t=yn.get(e);return t?Date.now()-t.timestamp>Db?(yn.delete(e),null):t.value:null},Hp=(e,t)=>{yn.set(e,{value:t,timestamp:Date.now()})},yb=()=>{yn.clear()},nr=!1,ga=0,bb=3e4,Cb=()=>nr,Eb=e=>{nr=e,e&&console.log(Mp.default.yellow("\u26A0 Offline mode enabled. Using built-in stable versions."))},bn=async(e,t={},r=gb)=>{let i=new AbortController,n=setTimeout(()=>i.abort(),r);try{let o=await fetch(e,{...t,signal:i.signal});return clearTimeout(n),o}catch(o){throw clearTimeout(n),o.name==="AbortError"?new Error(`Network timeout after ${r}ms`):o}},Wp=async e=>{let t=zp(`version:${e}`);if(t)return t;if(nr)return Lp[e]||"latest";let r=Up[e];try{let i;if(r!==void 0){let n=await bn(`${Da}/${encodeURIComponent(e)}`,{headers:{Accept:"application/json"}});if(!n.ok)throw new Error(`HTTP ${n.status}`);let o=await n.json(),a=Object.keys(o.versions??{}).filter(u=>{let c=u.match(/^(\d+)\./);return c&&parseInt(c[1],10)<=r}).sort((u,c)=>{let l=N=>N.split(".").map(Number),[p,h,m]=l(u),[g,y,w]=l(c);return g-p||y-h||w-m});if(a.length===0)throw new Error("No compatible version found");i=`^${a[0]}`}else{let n=await bn(`${Da}/${encodeURIComponent(e)}/latest`,{headers:{Accept:"application/json"}});if(!n.ok)throw new Error(`HTTP ${n.status}`);i=`^${(await n.json()).version}`}return Hp(`version:${e}`,i),i}catch{return Lp[e]??"latest"}},Gp=async()=>{let e=Date.now();if(e-ga<bb)return!nr;try{return await bn(`${Da}/react`,{},2e3),ga=e,nr=!1,!0}catch{return ga=e,nr=!0,!1}},Vp=async e=>{let t={};return await Promise.all(e.map(async r=>{t[r]=await Wp(r)})),t},Zr=null,wb=["react","react-dom","zustand","react-router-dom","@tanstack/react-query","react-hook-form","zod","tailwindcss","lucide-react"],vb=()=>{Zr||(Zr=(async()=>{try{if(!await Gp())return;await Vp(wb)}catch{}finally{Zr=null}})())},Sb=async()=>{Zr&&await Zr}});var ya={};k(ya,{PackageManager:()=>Cn});import Fb from"node:path";var Cn,En=D(()=>{"use strict";st();Cn=class{projectPath;pkg=null;dependencies=new Map;devDependencies=new Map;scripts=new Map;overrides=new Map;constructor(t){this.projectPath=t}async load(t){this.pkg=await nt(t),this.pkg.dependencies&&Object.entries(this.pkg.dependencies).forEach(([r,i])=>this.dependencies.set(r,i)),this.pkg.devDependencies&&Object.entries(this.pkg.devDependencies).forEach(([r,i])=>this.devDependencies.set(r,i)),this.pkg.scripts&&Object.entries(this.pkg.scripts).forEach(([r,i])=>this.scripts.set(r,i)),this.pkg.overrides&&Object.entries(this.pkg.overrides).forEach(([r,i])=>this.overrides.set(r,i))}add(t,r,i=!1){i?this.devDependencies.set(t,r):this.dependencies.set(t,r)}addScript(t,r){this.scripts.set(t,r)}addOverride(t,r){this.overrides.set(t,r)}set(t,r){this.pkg&&(this.pkg[t]=r)}async resolveLatestVersions(){if(process.env.NODE_ENV==="test")return;let t=[...this.dependencies.keys()],r=[...this.devDependencies.keys()],i=[...new Set([...t,...r])];if(i.length===0)return;let{getLatestVersion:n}=await Promise.resolve().then(()=>(Yp(),qp)),o=await Promise.allSettled(i.map(async s=>{try{let a=await n(s);return{name:s,version:a}}catch{return{name:s,version:null}}}));for(let s of o)if(s.status==="fulfilled"&&s.value.version){let{name:a,version:u}=s.value;if(u==="latest"||/^\^?\d+\.\d+\.\d+/.test(u)){let c=u==="latest"||u.startsWith("^")?u:`^${u}`;this.dependencies.has(a)&&this.dependencies.set(a,c),this.devDependencies.has(a)&&this.devDependencies.set(a,c)}}}async save(){if(!this.pkg)throw new Error("Package.json not loaded. Call load() first.");let t=r=>Object.fromEntries([...r.entries()].sort((i,n)=>i[0].localeCompare(n[0])));this.pkg.dependencies=t(this.dependencies),this.pkg.devDependencies=t(this.devDependencies),this.pkg.scripts=t(this.scripts),this.overrides.size>0&&(this.pkg.overrides=t(this.overrides)),await He(Fb.join(this.projectPath,"package.json"),this.pkg)}}});var Zp={};k(Zp,{detectAvailableManagers:()=>Sn,detectPackageManagerUsed:()=>wn,getInstallCommand:()=>Nt,getPrefetchCommand:()=>vn,getRunCommand:()=>Kp});import{execSync as ba}from"node:child_process";var wn,vn,Sn,Nt,Kp,Fn=D(()=>{"use strict";wn=()=>{let e=process.env.npm_config_user_agent;if(e){if(e.startsWith("pnpm"))return"pnpm";if(e.startsWith("yarn"))return"yarn";if(e.startsWith("bun"))return"bun"}return"npm"},vn=e=>{switch(e){case"npm":return{command:"npm",args:["cache","add"]};case"pnpm":return{command:"pnpm",args:["store","add"]};case"yarn":return{command:"yarn",args:["cache","add"]};case"bun":return null;default:return{command:"npm",args:["cache","add"]}}},Sn=()=>{let e=["npm"];try{ba("pnpm --version",{stdio:"ignore"}),e.push("pnpm")}catch{}try{ba("yarn --version",{stdio:"ignore"}),e.push("yarn")}catch{}try{ba("bun --version",{stdio:"ignore"}),e.push("bun")}catch{}return e},Nt=(e,t={})=>{let{audit:r=!1,strict:i=!1}=t;switch(e){case"npm":return`npm install ${r?"":"--no-audit"} ${i?"":"--legacy-peer-deps"}`.replace(/\s+/g," ").trim();case"pnpm":return"pnpm install";case"bun":return"bun install";case"yarn":return"yarn install";default:return"npm install"}},Kp=(e,t)=>{switch(e){case"npm":return`npm run ${t}`;case"pnpm":return`pnpm run ${t}`;case"bun":return`bun run ${t}`;case"yarn":return`yarn ${t}`;default:return`npm run ${t}`}}});var th=I((i2,eh)=>{eh.exports=Qp;Qp.sync=kb;var Jp=ce("fs");function xb(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var i=0;i<r.length;i++){var n=r[i].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n)return!0}return!1}function Xp(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:xb(t,r)}function Qp(e,t,r){Jp.stat(e,function(i,n){r(i,i?!1:Xp(n,e,t))})}function kb(e,t){return Xp(Jp.statSync(e),e,t)}});var oh=I((n2,sh)=>{sh.exports=ih;ih.sync=Ab;var rh=ce("fs");function ih(e,t,r){rh.stat(e,function(i,n){r(i,i?!1:nh(n,t))})}function Ab(e,t){return nh(rh.statSync(e),t)}function nh(e,t){return e.isFile()&&_b(e,t)}function _b(e,t){var r=e.mode,i=e.uid,n=e.gid,o=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),l=a|u,p=r&c||r&u&&n===s||r&a&&i===o||r&l&&o===0;return p}});var uh=I((o2,ah)=>{var s2=ce("fs"),xn;process.platform==="win32"||global.TESTING_WINDOWS?xn=th():xn=oh();ah.exports=Ca;Ca.sync=Tb;function Ca(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){Ca(e,t||{},function(o,s){o?n(o):i(s)})})}xn(e,t||{},function(i,n){i&&(i.code==="EACCES"||t&&t.ignoreErrors)&&(i=null,n=!1),r(i,n)})}function Tb(e,t){try{return xn.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var fh=I((a2,dh)=>{var sr=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",ch=ce("path"),Ob=sr?";":":",lh=uh(),ph=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),hh=(e,t)=>{let r=t.colon||Ob,i=e.match(/\//)||sr&&e.match(/\\/)?[""]:[...sr?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=sr?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=sr?n.split(r):[""];return sr&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:n}},mh=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:i,pathExt:n,pathExtExe:o}=hh(e,t),s=[],a=c=>new Promise((l,p)=>{if(c===i.length)return t.all&&s.length?l(s):p(ph(e));let h=i[c],m=/^".*"$/.test(h)?h.slice(1,-1):h,g=ch.join(m,e),y=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+g:g;l(u(y,c,0))}),u=(c,l,p)=>new Promise((h,m)=>{if(p===n.length)return h(a(l+1));let g=n[p];lh(c+g,{pathExt:o},(y,w)=>{if(!y&&w)if(t.all)s.push(c+g);else return h(c+g);return h(u(c,l,p+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},Rb=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=hh(e,t),o=[];for(let s=0;s<r.length;s++){let a=r[s],u=/^".*"$/.test(a)?a.slice(1,-1):a,c=ch.join(u,e),l=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+c:c;for(let p=0;p<i.length;p++){let h=l+i[p];try{if(lh.sync(h,{pathExt:n}))if(t.all)o.push(h);else return h}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw ph(e)};dh.exports=mh;mh.sync=Rb});var Dh=I((u2,Ea)=>{"use strict";var gh=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};Ea.exports=gh;Ea.exports.default=gh});var Eh=I((c2,Ch)=>{"use strict";var yh=ce("path"),$b=fh(),Pb=Dh();function bh(e,t){let r=e.options.env||process.env,i=process.cwd(),n=e.options.cwd!=null,o=n&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let s;try{s=$b.sync(e.command,{path:r[Pb({env:r})],pathExt:t?yh.delimiter:void 0})}catch{}finally{o&&process.chdir(i)}return s&&(s=yh.resolve(n?e.options.cwd:"",s)),s}function Ib(e){return bh(e)||bh(e,!0)}Ch.exports=Ib});var wh=I((l2,va)=>{"use strict";var wa=/([()\][%!^"`<>&|;, *?])/g;function Nb(e){return e=e.replace(wa,"^$1"),e}function jb(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(wa,"^$1"),t&&(e=e.replace(wa,"^$1")),e}va.exports.command=Nb;va.exports.argument=jb});var Sh=I((p2,vh)=>{"use strict";vh.exports=/^#!(.*)/});var xh=I((h2,Fh)=>{"use strict";var Bb=Sh();Fh.exports=(e="")=>{let t=e.match(Bb);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n}});var Ah=I((m2,kh)=>{"use strict";var Sa=ce("fs"),Lb=xh();function Mb(e){let r=Buffer.alloc(150),i;try{i=Sa.openSync(e,"r"),Sa.readSync(i,r,0,150,0),Sa.closeSync(i)}catch{}return Lb(r.toString())}kh.exports=Mb});var Rh=I((d2,Oh)=>{"use strict";var Ub=ce("path"),_h=Eh(),Th=wh(),zb=Ah(),Hb=process.platform==="win32",Wb=/\.(?:com|exe)$/i,Gb=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Vb(e){e.file=_h(e);let t=e.file&&zb(e.file);return t?(e.args.unshift(e.file),e.command=t,_h(e)):e.file}function qb(e){if(!Hb)return e;let t=Vb(e),r=!Wb.test(t);if(e.options.forceShell||r){let i=Gb.test(t);e.command=Ub.normalize(e.command),e.command=Th.command(e.command),e.args=e.args.map(o=>Th.argument(o,i));let n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Yb(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let i={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?i:qb(i)}Oh.exports=Yb});var Ih=I((f2,Ph)=>{"use strict";var Fa=process.platform==="win32";function xa(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Kb(e,t){if(!Fa)return;let r=e.emit;e.emit=function(i,n){if(i==="exit"){let o=$h(n,t);if(o)return r.call(e,"error",o)}return r.apply(e,arguments)}}function $h(e,t){return Fa&&e===1&&!t.file?xa(t.original,"spawn"):null}function Zb(e,t){return Fa&&e===1&&!t.file?xa(t.original,"spawnSync"):null}Ph.exports={hookChildProcess:Kb,verifyENOENT:$h,verifyENOENTSync:Zb,notFoundError:xa}});var Bh=I((g2,or)=>{"use strict";var Nh=ce("child_process"),ka=Rh(),Aa=Ih();function jh(e,t,r){let i=ka(e,t,r),n=Nh.spawn(i.command,i.args,i.options);return Aa.hookChildProcess(n,i),n}function Jb(e,t,r){let i=ka(e,t,r),n=Nh.spawnSync(i.command,i.args,i.options);return n.error=n.error||Aa.verifyENOENTSync(n.status,i),n}or.exports=jh;or.exports.spawn=jh;or.exports.sync=Jb;or.exports._parse=ka;or.exports._enoent=Aa});function _a(e){let t=typeof e=="string"?`
108
108
  `:10,r=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===r&&(e=e.slice(0,-1)),e}var Lh=D(()=>{});function kn(e={}){let{env:t=process.env,platform:r=process.platform}=e;return r!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"}var Mh=D(()=>{});import An from"node:process";import Jr from"node:path";import{fileURLToPath as Uh}from"node:url";var Xb,Qb,eC,zh,Hh=D(()=>{Mh();Xb=({cwd:e=An.cwd(),path:t=An.env[kn()],preferLocal:r=!0,execPath:i=An.execPath,addExecPath:n=!0}={})=>{let o=e instanceof URL?Uh(e):e,s=Jr.resolve(o),a=[];return r&&Qb(a,s),n&&eC(a,i,s),[...a,t].join(Jr.delimiter)},Qb=(e,t)=>{let r;for(;r!==t;)e.push(Jr.join(t,"node_modules/.bin")),r=t,t=Jr.resolve(t,"..")},eC=(e,t,r)=>{let i=t instanceof URL?Uh(t):t;e.push(Jr.resolve(r,i,".."))},zh=({env:e=An.env,...t}={})=>{e={...e};let r=kn({env:e});return t.path=e[r],e[r]=Xb(t),e}});function Ta(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:i}=e;for(let n of Reflect.ownKeys(t))tC(e,t,n,r);return iC(e,t),aC(e,t,i),e}var tC,rC,iC,nC,sC,oC,aC,Wh=D(()=>{tC=(e,t,r,i)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let n=Object.getOwnPropertyDescriptor(e,r),o=Object.getOwnPropertyDescriptor(t,r);!rC(n,o)&&i||Object.defineProperty(e,r,o)},rC=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},iC=(e,t)=>{let r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},nC=(e,t)=>`/* Wrapped ${e}*/
109
109
  ${t}`,sC=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),oC=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),aC=(e,t,r)=>{let i=r===""?"":`with ${r.trim()}() `,n=nC.bind(null,i,t.toString());Object.defineProperty(n,"name",oC),Object.defineProperty(e,"toString",{...sC,value:n})}});var _n,Gh,Vh,qh=D(()=>{Wh();_n=new WeakMap,Gh=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,i=0,n=e.displayName||e.name||"<anonymous>",o=function(...s){if(_n.set(o,++i),i===1)r=e.apply(this,s),e=null;else if(t.throw===!0)throw new Error(`Function \`${n}\` can only be called once`);return r};return Ta(o,e),_n.set(o,i),o};Gh.callCount=e=>{if(!_n.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return _n.get(e)};Vh=Gh});var Yh,uC,Kh,Zh,Jh=D(()=>{Yh=()=>{let e=Zh-Kh+1;return Array.from({length:e},uC)},uC=(e,t)=>({name:`SIGRT${t+1}`,number:Kh+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Kh=34,Zh=64});var Xh,Qh=D(()=>{Xh=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}]});import{constants as cC}from"node:os";var Oa,lC,em=D(()=>{Qh();Jh();Oa=()=>{let e=Yh();return[...Xh,...e].map(lC)},lC=({name:e,number:t,description:r,action:i,forced:n=!1,standard:o})=>{let{signals:{[e]:s}}=cC,a=s!==void 0;return{name:e,number:a?s:t,description:r,supported:a,action:i,forced:n,standard:o}}});import{constants as pC}from"node:os";var hC,mC,tm,dC,fC,gC,I2,rm=D(()=>{em();hC=()=>{let e=Oa();return Object.fromEntries(e.map(mC))},mC=({name:e,number:t,description:r,supported:i,action:n,forced:o,standard:s})=>[e,{name:e,number:t,description:r,supported:i,action:n,forced:o,standard:s}],tm=hC(),dC=()=>{let e=Oa(),t=65,r=Array.from({length:t},(i,n)=>fC(n,e));return Object.assign({},...r)},fC=(e,t)=>{let r=gC(e,t);if(r===void 0)return{};let{name:i,description:n,supported:o,action:s,forced:a,standard:u}=r;return{[e]:{name:i,number:e,description:n,supported:o,action:s,forced:a,standard:u}}},gC=(e,t)=>{let r=t.find(({name:i})=>pC.signals[i]===e);return r!==void 0?r:t.find(i=>i.number===e)},I2=dC()});import DC from"node:process";var yC,Xr,im=D(()=>{rm();yC=({timedOut:e,timeout:t,errorCode:r,signal:i,signalDescription:n,exitCode:o,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":r!==void 0?`failed with ${r}`:i!==void 0?`was killed with ${i} (${n})`:o!==void 0?`failed with exit code ${o}`:"failed",Xr=({stdout:e,stderr:t,all:r,error:i,signal:n,exitCode:o,command:s,escapedCommand:a,timedOut:u,isCanceled:c,killed:l,parsed:{options:{timeout:p,cwd:h=DC.cwd()}}})=>{o=o===null?void 0:o,n=n===null?void 0:n;let m=n===void 0?void 0:tm[n].description,g=i&&i.code,w=`Command ${yC({timedOut:u,timeout:p,errorCode:g,signal:n,signalDescription:m,exitCode:o,isCanceled:c})}: ${s}`,N=Object.prototype.toString.call(i)==="[object Error]",C=N?`${w}
110
110
  ${i.message}`:w,ne=[C,t,e].filter(Boolean).join(`
111
111
  `);return N?(i.originalMessage=i.message,i.message=ne):i=new Error(ne),i.shortMessage=C,i.command=s,i.escapedCommand=a,i.exitCode=o,i.signal=n,i.signalDescription=m,i.stdout=e,i.stderr=t,i.cwd=h,r!==void 0&&(i.all=r),"bufferedData"in i&&delete i.bufferedData,i.failed=!0,i.timedOut=!!u,i.isCanceled=c,i.killed=l&&!u,i}});var Tn,bC,Ra,nm,sm=D(()=>{Tn=["stdin","stdout","stderr"],bC=e=>Tn.some(t=>e[t]!==void 0),Ra=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return Tn.map(i=>e[i]);if(bC(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Tn.map(i=>`\`${i}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,Tn.length);return Array.from({length:r},(i,n)=>t[n])},nm=e=>{let t=Ra(e);return t==="ipc"?"ipc":t===void 0||typeof t=="string"?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"]}});var jt,om=D(()=>{jt=[];jt.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&jt.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&jt.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var On,$a,Pa,CC,Ia,Rn,EC,Na,ja,Ba,am,H2,W2,um=D(()=>{om();On=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",$a=Symbol.for("signal-exit emitter"),Pa=globalThis,CC=Object.defineProperty.bind(Object),Ia=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Pa[$a])return Pa[$a];CC(Pa,$a,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let i=this.listeners[t],n=i.indexOf(r);n!==-1&&(n===0&&i.length===1?i.length=0:i.splice(n,1))}emit(t,r,i){if(this.emitted[t])return!1;this.emitted[t]=!0;let n=!1;for(let o of this.listeners[t])n=o(r,i)===!0||n;return t==="exit"&&(n=this.emit("afterExit",r,i)||n),n}},Rn=class{},EC=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),Na=class extends Rn{onExit(){return()=>{}}load(){}unload(){}},ja=class extends Rn{#e=Ba.platform==="win32"?"SIGINT":"SIGHUP";#i=new Ia;#t;#o;#s;#r={};#n=!1;constructor(t){super(),this.#t=t,this.#r={};for(let r of jt)this.#r[r]=()=>{let i=this.#t.listeners(r),{count:n}=this.#i,o=t;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(n+=o.__signal_exit_emitter__.count),i.length===n){this.unload();let s=this.#i.emit("exit",null,r),a=r==="SIGHUP"?this.#e:r;s||t.kill(t.pid,a)}};this.#s=t.reallyExit,this.#o=t.emit}onExit(t,r){if(!On(this.#t))return()=>{};this.#n===!1&&this.load();let i=r?.alwaysLast?"afterExit":"exit";return this.#i.on(i,t),()=>{this.#i.removeListener(i,t),this.#i.listeners.exit.length===0&&this.#i.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#n){this.#n=!0,this.#i.count+=1;for(let t of jt)try{let r=this.#r[t];r&&this.#t.on(t,r)}catch{}this.#t.emit=(t,...r)=>this.#u(t,...r),this.#t.reallyExit=t=>this.#a(t)}}unload(){this.#n&&(this.#n=!1,jt.forEach(t=>{let r=this.#r[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#t.removeListener(t,r)}catch{}}),this.#t.emit=this.#o,this.#t.reallyExit=this.#s,this.#i.count-=1)}#a(t){return On(this.#t)?(this.#t.exitCode=t||0,this.#i.emit("exit",this.#t.exitCode,null),this.#s.call(this.#t,this.#t.exitCode)):0}#u(t,...r){let i=this.#o;if(t==="exit"&&On(this.#t)){typeof r[0]=="number"&&(this.#t.exitCode=r[0]);let n=i.call(this.#t,t,...r);return this.#i.emit("exit",this.#t.exitCode,null),n}else return i.call(this.#t,t,...r)}},Ba=globalThis.process,{onExit:am,load:H2,unload:W2}=EC(On(Ba)?new ja(Ba):new Na)});import wC from"node:os";var vC,cm,SC,FC,xC,kC,lm,AC,pm,hm,mm,dm=D(()=>{um();vC=1e3*5,cm=(e,t="SIGTERM",r={})=>{let i=e(t);return SC(e,t,r,i),i},SC=(e,t,r,i)=>{if(!FC(t,r,i))return;let n=kC(r),o=setTimeout(()=>{e("SIGKILL")},n);o.unref&&o.unref()},FC=(e,{forceKillAfterTimeout:t},r)=>xC(e)&&t!==!1&&r,xC=e=>e===wC.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",kC=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return vC;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},lm=(e,t)=>{e.kill()&&(t.isCanceled=!0)},AC=(e,t,r)=>{e.kill(t),r(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},pm=(e,{timeout:t,killSignal:r="SIGTERM"},i)=>{if(t===0||t===void 0)return i;let n,o=new Promise((a,u)=>{n=setTimeout(()=>{AC(e,r,u)},t)}),s=i.finally(()=>{clearTimeout(n)});return Promise.race([o,s])},hm=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},mm=async(e,{cleanup:t,detached:r},i)=>{if(!t||r)return i;let n=am(()=>{e.kill()});return i.finally(()=>{n()})}});function $n(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}function La(e){return $n(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"}var Ma=D(()=>{});import{createWriteStream as _C}from"node:fs";import{ChildProcess as TC}from"node:child_process";var OC,Ua,fm,gm=D(()=>{Ma();OC=e=>e instanceof TC&&typeof e.then=="function",Ua=(e,t,r)=>{if(typeof r=="string")return e[t].pipe(_C(r)),e;if(La(r))return e[t].pipe(r),e;if(!OC(r))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!La(r.stdin))throw new TypeError("The target child process's stdin must be available.");return e[t].pipe(r.stdin),r},fm=e=>{e.stdout!==null&&(e.pipeStdout=Ua.bind(void 0,e,"stdout")),e.stderr!==null&&(e.pipeStderr=Ua.bind(void 0,e,"stderr")),e.all!==void 0&&(e.pipeAll=Ua.bind(void 0,e,"all"))}});var Qr,RC,bm,Dm,$C,PC,ym,Pn,ei=D(()=>{Qr=async(e,{init:t,convertChunk:r,getSize:i,truncateChunk:n,addChunk:o,getFinalChunk:s,finalize:a},{maxBuffer:u=Number.POSITIVE_INFINITY}={})=>{if(!$C(e))throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");let c=t();c.length=0;try{for await(let l of e){let p=PC(l),h=r[p](l,c);bm({convertedChunk:h,state:c,getSize:i,truncateChunk:n,addChunk:o,maxBuffer:u})}return RC({state:c,convertChunk:r,getSize:i,truncateChunk:n,addChunk:o,getFinalChunk:s,maxBuffer:u}),a(c)}catch(l){throw l.bufferedData=a(c),l}},RC=({state:e,getSize:t,truncateChunk:r,addChunk:i,getFinalChunk:n,maxBuffer:o})=>{let s=n(e);s!==void 0&&bm({convertedChunk:s,state:e,getSize:t,truncateChunk:r,addChunk:i,maxBuffer:o})},bm=({convertedChunk:e,state:t,getSize:r,truncateChunk:i,addChunk:n,maxBuffer:o})=>{let s=r(e),a=t.length+s;if(a<=o){Dm(e,t,n,a);return}let u=i(e,o-t.length);throw u!==void 0&&Dm(u,t,n,o),new Pn},Dm=(e,t,r,i)=>{t.contents=r(e,t,i),t.length=i},$C=e=>typeof e=="object"&&e!==null&&typeof e[Symbol.asyncIterator]=="function",PC=e=>{let t=typeof e;if(t==="string")return"string";if(t!=="object"||e===null)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";let r=ym.call(e);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&ym.call(e.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:ym}=Object.prototype,Pn=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var za,Ha,Wa,In,Nn,jn=D(()=>{za=e=>e,Ha=()=>{},Wa=({contents:e})=>e,In=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},Nn=e=>e.length});var Cm=D(()=>{ei();jn()});async function Ga(e,t){return Qr(e,HC,t)}var IC,NC,jC,Em,wm,BC,LC,MC,UC,Sm,vm,zC,Fm,HC,Va=D(()=>{ei();jn();IC=()=>({contents:new ArrayBuffer(0)}),NC=e=>jC.encode(e),jC=new TextEncoder,Em=e=>new Uint8Array(e),wm=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),BC=(e,t)=>e.slice(0,t),LC=(e,{contents:t,length:r},i)=>{let n=Fm()?UC(t,i):MC(t,i);return new Uint8Array(n).set(e,r),n},MC=(e,t)=>{if(t<=e.byteLength)return e;let r=new ArrayBuffer(Sm(t));return new Uint8Array(r).set(new Uint8Array(e),0),r},UC=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let r=new ArrayBuffer(t,{maxByteLength:Sm(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r},Sm=e=>vm**Math.ceil(Math.log(e)/Math.log(vm)),vm=2,zC=({contents:e,length:t})=>Fm()?e:e.slice(0,t),Fm=()=>"resize"in ArrayBuffer.prototype,HC={init:IC,convertChunk:{string:NC,buffer:Em,arrayBuffer:Em,dataView:wm,typedArray:wm,others:In},getSize:Nn,truncateChunk:BC,addChunk:LC,getFinalChunk:Ha,finalize:zC}});async function Bn(e,t){if(!("Buffer"in globalThis))throw new Error("getStreamAsBuffer() is only supported in Node.js");try{return xm(await Ga(e,t))}catch(r){throw r.bufferedData!==void 0&&(r.bufferedData=xm(r.bufferedData)),r}}var xm,km=D(()=>{Va();xm=e=>globalThis.Buffer.from(e)});async function qa(e,t){return Qr(e,YC,t)}var WC,Ln,GC,VC,qC,YC,Am=D(()=>{ei();jn();WC=()=>({contents:"",textDecoder:new TextDecoder}),Ln=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),GC=(e,{contents:t})=>t+e,VC=(e,t)=>e.slice(0,t),qC=({textDecoder:e})=>{let t=e.decode();return t===""?void 0:t},YC={init:WC,convertChunk:{string:za,buffer:Ln,arrayBuffer:Ln,dataView:Ln,typedArray:Ln,others:In},getSize:Nn,truncateChunk:VC,addChunk:GC,getFinalChunk:qC,finalize:Wa}});var _m=D(()=>{Cm();Va();km();Am();ei()});var Om=I((CF,Tm)=>{"use strict";var{PassThrough:KC}=ce("stream");Tm.exports=function(){var e=[],t=new KC({objectMode:!0});return t.setMaxListeners(0),t.add=r,t.isEmpty=i,t.on("unpipe",n),Array.prototype.slice.call(arguments).forEach(r),t;function r(o){return Array.isArray(o)?(o.forEach(r),this):(e.push(o),o.once("end",n.bind(null,o)),o.once("error",t.emit.bind(t,"error")),o.pipe(t,{end:!1}),this)}function i(){return e.length==0}function n(o){e=e.filter(function(s){return s!==o}),!e.length&&t.readable&&t.end()}}});import{createReadStream as ZC,readFileSync as JC}from"node:fs";import{setTimeout as XC}from"node:timers/promises";var Rm,$m,QC,Pm,eE,Im,Nm,Ya,Ka,tE,jm,Bm=D(()=>{Ma();_m();Rm=G(Om(),1),$m=e=>{if(e!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},QC=({input:e,inputFile:t})=>typeof t!="string"?e:($m(e),JC(t)),Pm=e=>{let t=QC(e);if($n(t))throw new TypeError("The `input` option cannot be a stream in sync mode");return t},eE=({input:e,inputFile:t})=>typeof t!="string"?e:($m(e),ZC(t)),Im=(e,t)=>{let r=eE(t);r!==void 0&&($n(r)?r.pipe(e.stdin):e.stdin.end(r))},Nm=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let r=(0,Rm.default)();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r},Ya=async(e,t)=>{if(!(!e||t===void 0)){await XC(0),e.destroy();try{return await t}catch(r){return r.bufferedData}}},Ka=(e,{encoding:t,buffer:r,maxBuffer:i})=>{if(!(!e||!r))return t==="utf8"||t==="utf-8"?qa(e,{maxBuffer:i}):t===null||t==="buffer"?Bn(e,{maxBuffer:i}):tE(e,i,t)},tE=async(e,t,r)=>(await Bn(e,{maxBuffer:t})).toString(r),jm=async({stdout:e,stderr:t,all:r},{encoding:i,buffer:n,maxBuffer:o},s)=>{let a=Ka(e,{encoding:i,buffer:n,maxBuffer:o}),u=Ka(t,{encoding:i,buffer:n,maxBuffer:o}),c=Ka(r,{encoding:i,buffer:n,maxBuffer:o*2});try{return await Promise.all([s,a,u,c])}catch(l){return Promise.all([{error:l,signal:l.signal,timedOut:l.timedOut},Ya(e,a),Ya(t,u),Ya(r,c)])}}});var rE,iE,Za,Lm,Mm=D(()=>{rE=(async()=>{})().constructor.prototype,iE=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(rE,e)]),Za=(e,t)=>{for(let[r,i]of iE){let n=typeof t=="function"?(...o)=>Reflect.apply(i.value,t(),o):i.value.bind(t);Reflect.defineProperty(e,r,{...i,value:n})}},Lm=e=>new Promise((t,r)=>{e.on("exit",(i,n)=>{t({exitCode:i,signal:n})}),e.on("error",i=>{r(i)}),e.stdin&&e.stdin.on("error",i=>{r(i)})})});import{Buffer as nE}from"node:buffer";import{ChildProcess as sE}from"node:child_process";var Hm,oE,aE,Ja,Xa,Wm,Qa,Um,zm,uE,eu,Gm=D(()=>{Hm=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],oE=/^[\w.-]+$/,aE=e=>typeof e!="string"||oE.test(e)?e:`"${e.replaceAll('"','\\"')}"`,Ja=(e,t)=>Hm(e,t).join(" "),Xa=(e,t)=>Hm(e,t).map(r=>aE(r)).join(" "),Wm=/ +/g,Qa=e=>{let t=[];for(let r of e.trim().split(Wm)){let i=t.at(-1);i&&i.endsWith("\\")?t[t.length-1]=`${i.slice(0,-1)} ${r}`:t.push(r)}return t},Um=e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(t==="object"&&e!==null&&!(e instanceof sE)&&"stdout"in e){let r=typeof e.stdout;if(r==="string")return e.stdout;if(nE.isBuffer(e.stdout))return e.stdout.toString();throw new TypeError(`Unexpected "${r}" stdout in template expression`)}throw new TypeError(`Unexpected "${t}" in template expression`)},zm=(e,t,r)=>r||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],uE=({templates:e,expressions:t,tokens:r,index:i,template:n})=>{let o=n??e.raw[i],s=o.split(Wm).filter(Boolean),a=zm(r,s,o.startsWith(" "));if(i===t.length)return a;let u=t[i],c=Array.isArray(u)?u.map(l=>Um(l)):[Um(u)];return zm(a,c,o.endsWith(" "))},eu=(e,t)=>{let r=[];for(let[i,n]of e.entries())r=uE({templates:e,expressions:t,tokens:r,index:i,template:n});return r}});import{debuglog as cE}from"node:util";import lE from"node:process";var Vm,Mn,pE,tu,qm=D(()=>{Vm=cE("execa").enabled,Mn=(e,t)=>String(e).padStart(t,"0"),pE=()=>{let e=new Date;return`${Mn(e.getHours(),2)}:${Mn(e.getMinutes(),2)}:${Mn(e.getSeconds(),2)}.${Mn(e.getMilliseconds(),3)}`},tu=(e,{verbose:t})=>{t&&lE.stderr.write(`[${pE()}] ${e}
112
- `)}});var Xm={};k(Xm,{$:()=>DE,execa:()=>ue,execaCommand:()=>yE,execaCommandSync:()=>bE,execaNode:()=>CE,execaSync:()=>iu});import{Buffer as hE}from"node:buffer";import mE from"node:path";import ru from"node:child_process";import ar from"node:process";function ue(e,t,r){let i=Zm(e,t,r),n=Ja(e,t),o=Xa(e,t);tu(o,i.options),hm(i.options);let s;try{s=ru.spawn(i.file,i.args,i.options)}catch(m){let g=new ru.ChildProcess,y=Promise.reject(Xr({error:m,stdout:"",stderr:"",all:"",command:n,escapedCommand:o,parsed:i,timedOut:!1,isCanceled:!1,killed:!1}));return Za(g,y),g}let a=Lm(s),u=pm(s,i.options,a),c=mm(s,i.options,u),l={isCanceled:!1};s.kill=cm.bind(null,s.kill.bind(s)),s.cancel=lm.bind(null,s,l);let h=Vh(async()=>{let[{error:m,exitCode:g,signal:y,timedOut:w},N,C,ne]=await jm(s,i.options,c),se=ti(i.options,N),E=ti(i.options,C),q=ti(i.options,ne);if(m||g!==0||y!==null){let j=Xr({error:m,exitCode:g,signal:y,stdout:se,stderr:E,all:q,command:n,escapedCommand:o,parsed:i,timedOut:w,isCanceled:l.isCanceled||(i.options.signal?i.options.signal.aborted:!1),killed:s.killed});if(!i.options.reject)return j;throw j}return{command:n,escapedCommand:o,exitCode:0,stdout:se,stderr:E,all:q,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Im(s,i.options),s.all=Nm(s,i.options),fm(s),Za(s,h),s}function iu(e,t,r){let i=Zm(e,t,r),n=Ja(e,t),o=Xa(e,t);tu(o,i.options);let s=Pm(i.options),a;try{a=ru.spawnSync(i.file,i.args,{...i.options,input:s})}catch(l){throw Xr({error:l,stdout:"",stderr:"",all:"",command:n,escapedCommand:o,parsed:i,timedOut:!1,isCanceled:!1,killed:!1})}let u=ti(i.options,a.stdout,a.error),c=ti(i.options,a.stderr,a.error);if(a.error||a.status!==0||a.signal!==null){let l=Xr({stdout:u,stderr:c,error:a.error,signal:a.signal,exitCode:a.status,command:n,escapedCommand:o,parsed:i,timedOut:a.error&&a.error.code==="ETIMEDOUT",isCanceled:!1,killed:a.signal!==null});if(!i.options.reject)return l;throw l}return{command:n,escapedCommand:o,exitCode:0,stdout:u,stderr:c,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}function Jm(e){function t(r,...i){if(!Array.isArray(r))return Jm({...e,...r});let[n,...o]=eu(r,i);return ue(n,o,Ym(e))}return t.sync=(r,...i)=>{if(!Array.isArray(r))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[n,...o]=eu(r,i);return iu(n,o,Ym(e))},t}function yE(e,t){let[r,...i]=Qa(e);return ue(r,i,t)}function bE(e,t){let[r,...i]=Qa(e);return iu(r,i,t)}function CE(e,t,r={}){t&&!Array.isArray(t)&&typeof t=="object"&&(r=t,t=[]);let i=nm(r),n=ar.execArgv.filter(a=>!a.startsWith("--inspect")),{nodePath:o=ar.execPath,nodeOptions:s=n}=r;return ue(o,[...s,e,...Array.isArray(t)?t:[]],{...r,stdin:void 0,stdout:void 0,stderr:void 0,stdio:i,shell:!1})}var Km,dE,fE,Zm,ti,gE,Ym,DE,ri=D(()=>{Km=G(Bh(),1);Lh();Hh();qh();im();sm();dm();gm();Bm();Mm();Gm();qm();dE=1e3*1e3*100,fE=({env:e,extendEnv:t,preferLocal:r,localDir:i,execPath:n})=>{let o=t?{...ar.env,...e}:e;return r?zh({env:o,cwd:i,execPath:n}):o},Zm=(e,t,r={})=>{let i=Km.default._parse(e,t,r);return e=i.command,t=i.args,r=i.options,r={maxBuffer:dE,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:r.cwd||ar.cwd(),execPath:ar.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:Vm,...r},r.env=fE(r),r.stdio=Ra(r),ar.platform==="win32"&&mE.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:r,parsed:i}},ti=(e,t,r)=>typeof t!="string"&&!hE.isBuffer(t)?r===void 0?void 0:"":e.stripFinalNewline?_a(t):t;gE=({input:e,inputFile:t,stdio:r})=>e===void 0&&t===void 0&&r===void 0?{stdin:"inherit"}:{},Ym=(e={})=>({preferLocal:!0,...gE(e),...e});DE=Jm()});var Qm={};k(Qm,{prefetchCommonPackages:()=>ur,prefetchPackages:()=>Me,prefetchedStats:()=>Un});var Me,Un,ur,zn=D(()=>{"use strict";ri();Fn();Me=e=>{if(e.length===0)return;let t=wn(),r=vn(t);if(!r)return;let{command:i,args:n}=r,o=[...n,...e];ue(i,o,{stdio:"ignore",detached:!1}).then(()=>{Un.successCount+=e.length}).catch(s=>{Un.failCount+=1})},Un={successCount:0,failCount:0},ur=()=>{Me(["react@latest","react-dom@latest","vite@latest","typescript@latest","@vitejs/plugin-react@latest","tailwindcss@latest","postcss@latest","autoprefixer@latest"])}});var ie,EE,wE,vE,SE,ed=D(()=>{"use strict";ie=G(oe(),1),EE=e=>{let{total:t,width:r=30,showPercentage:i=!0,showStepCount:n=!0,completeChar:o="\u2588",incompleteChar:s="\u2591",filledColor:a=ie.default.cyan,emptyColor:u=ie.default.dim}=e,c=0,l="",p=()=>{let h=Math.round(c/t*100),m=Math.round(c/t*r),g=r-m,w=`\r${a(o.repeat(m))+u(s.repeat(g))}`;i&&(w+=` ${h.toString().padStart(3)}%`),n&&(w+=` (${c}/${t})`),l&&(w+=` ${ie.default.dim(l)}`),w+="\x1B[K",process.stdout.write(w)};return{increment:h=>{c=Math.min(c+1,t),l=h||"",p()},update:(h,m)=>{c=Math.min(Math.max(0,h),t),l=m||"",p()},complete:h=>{c=t,l="",p(),console.log(),h&&console.log(ie.default.green(`\u2713 ${h}`))},fail:h=>{l="",console.log(),h&&console.log(ie.default.red(`\u2717 ${h}`))},getPercentage:()=>Math.round(c/t*100)}},wE=e=>{let{total:t,showStepNumbers:r=!0}=e,i=0,n="",o=()=>r?`[${i}/${t}]`:"";return{start:s=>{i++,n=s,process.stdout.write(`${ie.default.cyan("\u25CF")} ${o()} ${s}...`)},succeed:s=>{process.stdout.write(`\r${ie.default.green("\u2713")} ${o()} ${s||n}\x1B[K
112
+ `)}});var Xm={};k(Xm,{$:()=>DE,execa:()=>ue,execaCommand:()=>yE,execaCommandSync:()=>bE,execaNode:()=>CE,execaSync:()=>iu});import{Buffer as hE}from"node:buffer";import mE from"node:path";import ru from"node:child_process";import ar from"node:process";function ue(e,t,r){let i=Zm(e,t,r),n=Ja(e,t),o=Xa(e,t);tu(o,i.options),hm(i.options);let s;try{s=ru.spawn(i.file,i.args,i.options)}catch(m){let g=new ru.ChildProcess,y=Promise.reject(Xr({error:m,stdout:"",stderr:"",all:"",command:n,escapedCommand:o,parsed:i,timedOut:!1,isCanceled:!1,killed:!1}));return Za(g,y),g}let a=Lm(s),u=pm(s,i.options,a),c=mm(s,i.options,u),l={isCanceled:!1};s.kill=cm.bind(null,s.kill.bind(s)),s.cancel=lm.bind(null,s,l);let h=Vh(async()=>{let[{error:m,exitCode:g,signal:y,timedOut:w},N,C,ne]=await jm(s,i.options,c),se=ti(i.options,N),E=ti(i.options,C),q=ti(i.options,ne);if(m||g!==0||y!==null){let j=Xr({error:m,exitCode:g,signal:y,stdout:se,stderr:E,all:q,command:n,escapedCommand:o,parsed:i,timedOut:w,isCanceled:l.isCanceled||(i.options.signal?i.options.signal.aborted:!1),killed:s.killed});if(!i.options.reject)return j;throw j}return{command:n,escapedCommand:o,exitCode:0,stdout:se,stderr:E,all:q,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Im(s,i.options),s.all=Nm(s,i.options),fm(s),Za(s,h),s}function iu(e,t,r){let i=Zm(e,t,r),n=Ja(e,t),o=Xa(e,t);tu(o,i.options);let s=Pm(i.options),a;try{a=ru.spawnSync(i.file,i.args,{...i.options,input:s})}catch(l){throw Xr({error:l,stdout:"",stderr:"",all:"",command:n,escapedCommand:o,parsed:i,timedOut:!1,isCanceled:!1,killed:!1})}let u=ti(i.options,a.stdout,a.error),c=ti(i.options,a.stderr,a.error);if(a.error||a.status!==0||a.signal!==null){let l=Xr({stdout:u,stderr:c,error:a.error,signal:a.signal,exitCode:a.status,command:n,escapedCommand:o,parsed:i,timedOut:a.error&&a.error.code==="ETIMEDOUT",isCanceled:!1,killed:a.signal!==null});if(!i.options.reject)return l;throw l}return{command:n,escapedCommand:o,exitCode:0,stdout:u,stderr:c,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}function Jm(e){function t(r,...i){if(!Array.isArray(r))return Jm({...e,...r});let[n,...o]=eu(r,i);return ue(n,o,Ym(e))}return t.sync=(r,...i)=>{if(!Array.isArray(r))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[n,...o]=eu(r,i);return iu(n,o,Ym(e))},t}function yE(e,t){let[r,...i]=Qa(e);return ue(r,i,t)}function bE(e,t){let[r,...i]=Qa(e);return iu(r,i,t)}function CE(e,t,r={}){t&&!Array.isArray(t)&&typeof t=="object"&&(r=t,t=[]);let i=nm(r),n=ar.execArgv.filter(a=>!a.startsWith("--inspect")),{nodePath:o=ar.execPath,nodeOptions:s=n}=r;return ue(o,[...s,e,...Array.isArray(t)?t:[]],{...r,stdin:void 0,stdout:void 0,stderr:void 0,stdio:i,shell:!1})}var Km,dE,fE,Zm,ti,gE,Ym,DE,ri=D(()=>{Km=G(Bh(),1);Lh();Hh();qh();im();sm();dm();gm();Bm();Mm();Gm();qm();dE=1e3*1e3*100,fE=({env:e,extendEnv:t,preferLocal:r,localDir:i,execPath:n})=>{let o=t?{...ar.env,...e}:e;return r?zh({env:o,cwd:i,execPath:n}):o},Zm=(e,t,r={})=>{let i=Km.default._parse(e,t,r);return e=i.command,t=i.args,r=i.options,r={maxBuffer:dE,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:r.cwd||ar.cwd(),execPath:ar.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:Vm,...r},r.env=fE(r),r.stdio=Ra(r),ar.platform==="win32"&&mE.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:r,parsed:i}},ti=(e,t,r)=>typeof t!="string"&&!hE.isBuffer(t)?r===void 0?void 0:"":e.stripFinalNewline?_a(t):t;gE=({input:e,inputFile:t,stdio:r})=>e===void 0&&t===void 0&&r===void 0?{stdin:"inherit"}:{},Ym=(e={})=>({preferLocal:!0,...gE(e),...e});DE=Jm()});var Qm={};k(Qm,{prefetchCommonPackages:()=>ur,prefetchPackages:()=>Me,prefetchedStats:()=>Un});var Me,Un,ur,zn=D(()=>{"use strict";ri();Fn();Me=e=>{if(e.length===0)return;let t=wn(),r=vn(t);if(!r)return;let{command:i,args:n}=r,o=[...n,...e];ue(i,o,{stdio:"ignore",detached:!1}).then(()=>{Un.successCount+=e.length}).catch(s=>{Un.failCount+=1})},Un={successCount:0,failCount:0},ur=()=>{Me(["react@latest","react-dom@latest","typescript@latest","postcss@latest","autoprefixer@latest"])}});var ie,EE,wE,vE,SE,ed=D(()=>{"use strict";ie=G(oe(),1),EE=e=>{let{total:t,width:r=30,showPercentage:i=!0,showStepCount:n=!0,completeChar:o="\u2588",incompleteChar:s="\u2591",filledColor:a=ie.default.cyan,emptyColor:u=ie.default.dim}=e,c=0,l="",p=()=>{let h=Math.round(c/t*100),m=Math.round(c/t*r),g=r-m,w=`\r${a(o.repeat(m))+u(s.repeat(g))}`;i&&(w+=` ${h.toString().padStart(3)}%`),n&&(w+=` (${c}/${t})`),l&&(w+=` ${ie.default.dim(l)}`),w+="\x1B[K",process.stdout.write(w)};return{increment:h=>{c=Math.min(c+1,t),l=h||"",p()},update:(h,m)=>{c=Math.min(Math.max(0,h),t),l=m||"",p()},complete:h=>{c=t,l="",p(),console.log(),h&&console.log(ie.default.green(`\u2713 ${h}`))},fail:h=>{l="",console.log(),h&&console.log(ie.default.red(`\u2717 ${h}`))},getPercentage:()=>Math.round(c/t*100)}},wE=e=>{let{total:t,showStepNumbers:r=!0}=e,i=0,n="",o=()=>r?`[${i}/${t}]`:"";return{start:s=>{i++,n=s,process.stdout.write(`${ie.default.cyan("\u25CF")} ${o()} ${s}...`)},succeed:s=>{process.stdout.write(`\r${ie.default.green("\u2713")} ${o()} ${s||n}\x1B[K
113
113
  `)},fail:s=>{process.stdout.write(`\r${ie.default.red("\u2717")} ${o()} ${s||n}\x1B[K
114
114
  `)},skip:s=>{let a=s?` (${s})`:"";process.stdout.write(`\r${ie.default.yellow("\u25CB")} ${o()} ${n}${ie.default.dim(a)}\x1B[K
115
115
  `)},complete:()=>{console.log(),console.log(ie.default.green(`\u2713 All ${t} steps completed successfully!`))}}},vE=()=>({log:e=>{console.log(` ${e}`)},success:e=>{console.log(`${ie.default.green("\u2713")} ${e}`)},error:e=>{console.log(`${ie.default.red("\u2717")} ${e}`)},warn:e=>{console.log(`${ie.default.yellow("\u26A0")} ${e}`)},info:e=>{console.log(`${ie.default.blue("\u2139")} ${e}`)}}),SE=()=>{let e=Date.now(),t=null;return{elapsed:()=>(t||Date.now())-e,format:()=>{let r=(t||Date.now())-e;return r<1e3?`${r}ms`:`${(r/1e3).toFixed(2)}s`},stop:()=>{t=Date.now();let r=t-e;return r<1e3?`${r}ms`:`${(r/1e3).toFixed(2)}s`}}}});import FE from"node:os";var Hn,ii,Wn,nu,su,td,rd,id,nd,xE,sd,od=D(()=>{"use strict";br();Cr();Hn={framework:Object.values(vc),variant:Object.values(Sc),language:["typescript","javascript"],styling:Object.values(wc),ui:Object.values(Ec),forms:Object.values(xc),state:Object.values(Fc),routing:Object.values(kc),dataFetching:Object.values(Ac),icons:Object.values(_c),structure:Object.values(Tc),testing:["vitest","jest"],linting:["eslint-prettier","biome"],api:["openapi","graphql","trpc"],animation:["framer-motion","gsap"]},ii=[{name:"shadcn-requires-tailwind",check:e=>e.ui==="shadcn"&&e.styling!=="tailwind",message:"shadcn/ui requires Tailwind CSS as the styling solution",suggestion:'Change styling to "tailwind" or choose a different UI library',severity:"error"},{name:"heroui-requires-tailwind",check:e=>e.ui==="heroui"&&e.styling!=="tailwind",message:"HeroUI requires Tailwind CSS as the styling solution",suggestion:'Change styling to "tailwind" or choose a different UI library',severity:"error"},{name:"react-compiler-react-only",check:e=>e.variant?.includes("compiler")&&e.framework!=="react",message:"React Compiler is only available for React framework",suggestion:'Change framework to "react" or choose a different variant',severity:"error"},{name:"swc-react-only",check:e=>e.variant?.includes("swc")&&e.framework!=="react",message:"SWC plugin is currently only configured for React",suggestion:"Use default variant for non-React frameworks",severity:"warning"},{name:"tanstack-router-typescript",check:e=>e.routing==="tanstack-router"&&!e.variant?.startsWith("ts"),message:"TanStack Router works best with TypeScript for full type safety",suggestion:"Consider using TypeScript variant for better DX",severity:"warning"},{name:"antd-bundle-warning",check:e=>e.ui==="antd",message:"Ant Design has a large bundle size (~120KB gzipped)",suggestion:"Consider shadcn/ui for smaller bundle size",severity:"warning"},{name:"chakra-bundle-warning",check:e=>e.ui==="chakra",message:"Chakra UI has a moderate bundle size (~80KB gzipped)",suggestion:"Consider shadcn/ui for smaller bundle with similar features",severity:"warning"}],Wn=e=>{let t=[],r=[],i=[];return!e||e.trim().length===0?t.push("Project name is required"):(e.length>214&&t.push("Project name must be less than 214 characters"),/^[a-z0-9]/.test(e)||t.push("Project name must start with a lowercase letter or number"),/^[a-z0-9._-]+$/.test(e)||(t.push("Project name can only contain lowercase letters, numbers, hyphens, underscores, and dots"),i.push("Use kebab-case: my-project-name")),["node_modules","favicon.ico","package","test"].includes(e.toLowerCase())&&t.push(`"${e}" is a reserved name`),e.startsWith(".")&&r.push('Project names starting with "." are hidden on Unix systems'),e.includes("..")&&t.push('Project name cannot contain ".."')),{valid:t.length===0,errors:t,warnings:r,suggestions:i}},nu=(e,t,r)=>{let i=[],n=[],o=[];if(!t||t==="")return{valid:!0,errors:i,warnings:n,suggestions:o};let s=r||Hn[e];return s&&!s.includes(t)&&(i.push(`Invalid ${e}: "${t}". Valid options: ${s.join(", ")}`),o.push(`Choose one of: ${s.join(", ")}`)),{valid:i.length===0,errors:i,warnings:n,suggestions:o}},su=e=>{let t=[],r=[],i=[];if(e.projectName){let s=Wn(e.projectName);t.push(...s.errors),r.push(...s.warnings),i.push(...s.suggestions)}let n=Object.keys(Hn);for(let s of n){let a=e[s];if(a!=null){let u=nu(s,a);t.push(...u.errors),r.push(...u.warnings),i.push(...u.suggestions)}}let o=Object.fromEntries(Object.entries(e).map(([s,a])=>[s,String(a)]));for(let s of ii)s.check(o)&&(s.severity==="error"?t.push(s.message):r.push(s.message),s.suggestion&&i.push(s.suggestion));return{valid:t.length===0,errors:[...new Set(t)],warnings:[...new Set(r)],suggestions:[...new Set(i)]}},td=e=>{let t=su(e);if(!t.valid)throw new Ai(t.errors.join("; "),{errors:t.errors,selections:e})},rd=e=>{let t=ii.filter(r=>r.severity==="error"&&r.check(e));if(t.length>0)throw new _i(t.map(r=>r.message).join("; "),e)},id=e=>ii.filter(t=>t.severity==="warning"&&t.check(e)).map(t=>t.message),nd=e=>e.toLowerCase().replace(/[^a-z0-9._-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").slice(0,214),xE=e=>{let t=[],r=[],i=[],n=FE.platform()==="win32";n&&e.length>=Re?(t.push(`Path too long: ${e.length} characters exceeds Windows limit of ${Re}`),i.push("Use a shorter project name or parent directory")):e.length>=Re&&r.push(`Path length (${e.length}) may cause issues on Windows (limit: ${Re})`);let o=n?/[\\/]/:/\//,s=e.split(o).filter(Boolean);for(let a of s)a.length>rt&&t.push(`Path component "${a.slice(0,30)}..." is too long (${a.length} chars, max: ${rt})`);return{valid:t.length===0,errors:t,warnings:r,suggestions:i}},sd=(e,t)=>{let r=[],i=[],n=[],o=t||e.split(/[\\/]/).pop()||"",s=Wn(o);r.push(...s.errors),i.push(...s.warnings),n.push(...s.suggestions);let a=xE(e);return r.push(...a.errors),i.push(...a.warnings),n.push(...a.suggestions),{valid:r.length===0,errors:[...new Set(r)],warnings:[...new Set(i)],suggestions:[...new Set(n)]}}});var J,ad,Gn,me,d,bt=D(()=>{"use strict";J=G(oe(),1),ad={debug:0,info:1,warn:2,error:3,silent:4},Gn=class{level;prefix;colors;constructor(t={}){this.level=t.level||(process.env.DEBUG?"debug":"info"),this.prefix=t.prefix||"",this.colors=t.colors!==!1}shouldLog(t){return ad[t]>=ad[this.level]}format(t){return this.prefix?`${this.prefix} ${t}`:t}newline(){this.shouldLog("info")&&process.stdout.write(`
@@ -198,7 +198,7 @@ export default tseslint.config(
198
198
  },
199
199
  },
200
200
  );
201
- `,{writeFile:o}=await Promise.resolve().then(()=>(W(),ou));await o(ni.join(e.projectPath,"eslint.config.js"),n),e.pkg.add("eslint","^9.29.0",!0),e.pkg.add("eslint-plugin-react-hooks","^5.2.0",!0),e.pkg.add("eslint-plugin-react-refresh","^0.4.14",!0),e.pkg.add("globals","^15.12.0",!0),e.pkg.add("typescript-eslint","^8.15.0",!0),e.pkg.add("@eslint/js","^9.29.0",!0)}await x(ni.join(e.projectPath,".vscode")),await He(ni.join(e.projectPath,".vscode","settings.json"),{"json.schemas":[],"typescript.tsdk":"node_modules/typescript/lib"})}});var dd={};k(dd,{stylingConfigurator:()=>OE});import si from"node:path";var OE,fd=D(()=>{"use strict";W();OE=async e=>{let{variant:t}=e.selections,i=t.startsWith("ts")?"ts":"js",n=e.selections.rtl===!0;switch(e.selections.styling){case"tailwind":e.pkg&&(e.pkg.add("tailwindcss","^4.1.0",!0),e.pkg.add("@tailwindcss/vite","^4.1.0",!0));let s=`${t.includes("swc")?"import react from '@vitejs/plugin-react-swc'":"import react from '@vitejs/plugin-react'"}
201
+ `,{writeFile:o}=await Promise.resolve().then(()=>(W(),ou));await o(ni.join(e.projectPath,"eslint.config.js"),n),e.pkg.add("eslint","^9.29.0",!0),e.pkg.add("eslint-plugin-react-hooks","^5.2.0",!0),e.pkg.add("eslint-plugin-react-refresh","^0.4.14",!0),e.pkg.add("globals","^15.12.0",!0),e.pkg.add("typescript-eslint","^8.15.0",!0),e.pkg.add("@eslint/js","^9.29.0",!0),e.pkg.addOverride("minimatch","^10.0.0")}await x(ni.join(e.projectPath,".vscode")),await He(ni.join(e.projectPath,".vscode","settings.json"),{"json.schemas":[],"typescript.tsdk":"node_modules/typescript/lib"})}});var dd={};k(dd,{stylingConfigurator:()=>OE});import si from"node:path";var OE,fd=D(()=>{"use strict";W();OE=async e=>{let{variant:t}=e.selections,i=t.startsWith("ts")?"ts":"js",n=e.selections.rtl===!0;switch(e.selections.styling){case"tailwind":e.pkg&&(e.pkg.add("tailwindcss","^4.1.0",!0),e.pkg.add("@tailwindcss/vite","^4.1.0",!0));let s=`${t.includes("swc")?"import react from '@vitejs/plugin-react-swc'":"import react from '@vitejs/plugin-react'"}
202
202
  import { defineConfig } from 'vite'
203
203
  import tailwindcss from '@tailwindcss/vite'
204
204
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-nexo",
3
- "version": "1.8.2",
3
+ "version": "1.8.5",
4
4
  "description": "NEXO is a next-generation, extensible CLI for scaffolding and orchestrating modern frontend projects",
5
5
  "type": "module",
6
6
  "bin": {