tembro 3.1.7 → 3.1.9

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 (33) hide show
  1. package/dist/showcase/package-meta.d.ts +2 -2
  2. package/dist/src/components/layout/app-sidebar.cjs +1 -1
  3. package/dist/src/components/layout/app-sidebar.js +10 -5
  4. package/dist/src/showcase/package-meta.cjs +1 -1
  5. package/dist/src/showcase/package-meta.js +1 -1
  6. package/dist/src/showcase/site-data.cjs +1 -1
  7. package/dist/src/showcase/site-data.js +1 -1
  8. package/dist/src/showcase/tembro-registry.json.cjs +1 -1
  9. package/dist/src/showcase/tembro-registry.json.js +1 -1
  10. package/package.json +1 -1
  11. package/packages/cli/dist/index.cjs +116 -116
  12. package/packages/cli/vendor/src/components/layout/app-sidebar.tsx +19 -14
  13. package/packages/cli/vendor/src/showcase/package-meta.ts +1 -1
  14. package/packages/cli/vendor/src/showcase/tembro-registry.json +1 -1
  15. package/packages/cli/vendor/templates/showcase/src/App.tsx +107 -0
  16. package/packages/cli/vendor/templates/showcase/src/showcase/data/registry.ts +273 -0
  17. package/packages/cli/vendor/templates/showcase/src/showcase/layout/HeroSection.tsx +41 -0
  18. package/packages/cli/vendor/templates/showcase/src/showcase/layout/WorkbenchSidebar.tsx +82 -0
  19. package/packages/cli/vendor/templates/showcase/src/showcase/sections/CalendarSection.tsx +35 -0
  20. package/packages/cli/vendor/templates/showcase/src/showcase/sections/CategorySection.tsx +48 -0
  21. package/packages/cli/vendor/templates/showcase/src/showcase/sections/ComponentDetailSection.tsx +46 -0
  22. package/packages/cli/vendor/templates/showcase/src/showcase/sections/ComponentLivePreview.tsx +64 -0
  23. package/packages/cli/vendor/templates/showcase/src/showcase/sections/CoreUiSection.tsx +100 -0
  24. package/packages/cli/vendor/templates/showcase/src/showcase/sections/DataTableSection.tsx +45 -0
  25. package/packages/cli/vendor/templates/showcase/src/showcase/sections/FormsSection.tsx +26 -0
  26. package/packages/cli/vendor/templates/showcase/src/showcase/sections/InventorySection.tsx +38 -0
  27. package/packages/cli/vendor/templates/showcase/src/showcase/sections/KanbanSection.tsx +42 -0
  28. package/packages/cli/vendor/templates/showcase/src/showcase/sections/OverlaySection.tsx +62 -0
  29. package/packages/cli/vendor/templates/showcase/src/showcase/sections/PatternsSection.tsx +36 -0
  30. package/packages/cli/vendor/templates/showcase/src/showcase/sections/VerificationSection.tsx +42 -0
  31. package/packages/cli/vendor/templates/showcase/src/showcase/sections/WizardSection.tsx +44 -0
  32. package/packages/cli/vendor/templates/showcase/src/showcase/shared/SectionTitle.tsx +13 -0
  33. package/registry.json +1 -1
@@ -1,174 +1,174 @@
1
1
  #!/usr/bin/env node
2
- 'use strict';var events=require('events'),Nn=require('child_process'),L=require('path'),Wr=require('fs'),R=require('process'),util=require('util'),url=require('url'),string_decoder=require('string_decoder'),sC=require('tty'),promises$1=require('timers/promises'),os=require('os'),v8=require('v8'),promises=require('stream/promises'),stream=require('stream'),buffer=require('buffer');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Nn__default=/*#__PURE__*/_interopDefault(Nn);var L__default=/*#__PURE__*/_interopDefault(L);var Wr__default=/*#__PURE__*/_interopDefault(Wr);var R__default=/*#__PURE__*/_interopDefault(R);var sC__default=/*#__PURE__*/_interopDefault(sC);var sw=Object.create;var Ha=Object.defineProperty;var aw=Object.getOwnPropertyDescriptor;var cw=Object.getOwnPropertyNames;var lw=Object.getPrototypeOf,dw=Object.prototype.hasOwnProperty;var F=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var uw=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of cw(e))!dw.call(t,n)&&n!==r&&Ha(t,n,{get:()=>e[n],enumerable:!(i=aw(e,n))||i.enumerable});return t};var Ce=(t,e,r)=>(r=t!=null?sw(lw(t)):{},uw(Ha(r,"default",{value:t,enumerable:true}),t));var ee=g(Ln=>{Ln.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,i)=>{e.push((n,o)=>n!=null?i(n):r(o)),t.apply(this,e);})},"name",{value:t.name})};Ln.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(i=>r(null,i),r);},"name",{value:t.name})};});var Za=g((dP,Xa)=>{var Ze=F("constants"),bw=process.cwd,Hr=null,yw=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Hr||(Hr=bw.call(process)),Hr};try{process.cwd();}catch{}typeof process.chdir=="function"&&(qn=process.chdir,process.chdir=function(t){Hr=null,qn.call(process,t);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,qn));var qn;Xa.exports=ww;function ww(t){Ze.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=i(t.chmod),t.fchmod=i(t.fchmod),t.lchmod=i(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=n(t.chmodSync),t.fchmodSync=n(t.fchmodSync),t.lchmodSync=n(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,u,h){h&&process.nextTick(h);},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,u,h,p){p&&process.nextTick(p);},t.lchownSync=function(){}),yw==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(l){function u(h,p,f){var b=Date.now(),v=0;l(h,p,function y(x){if(x&&(x.code==="EACCES"||x.code==="EPERM"||x.code==="EBUSY")&&Date.now()-b<6e4){setTimeout(function(){t.stat(p,function(k,C){k&&k.code==="ENOENT"?l(h,p,y):f(x);});},v),v<100&&(v+=10);return}f&&f(x);});}return Object.setPrototypeOf&&Object.setPrototypeOf(u,l),u})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(l){function u(h,p,f,b,v,y){var x;if(y&&typeof y=="function"){var k=0;x=function(C,D,_){if(C&&C.code==="EAGAIN"&&k<10)return k++,l.call(t,h,p,f,b,v,x);y.apply(this,arguments);};}return l.call(t,h,p,f,b,v,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(u,l),u})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(l){return function(u,h,p,f,b){for(var v=0;;)try{return l.call(t,u,h,p,f,b)}catch(y){if(y.code==="EAGAIN"&&v<10){v++;continue}throw y}}})(t.readSync);function e(l){l.lchmod=function(u,h,p){l.open(u,Ze.O_WRONLY|Ze.O_SYMLINK,h,function(f,b){if(f){p&&p(f);return}l.fchmod(b,h,function(v){l.close(b,function(y){p&&p(v||y);});});});},l.lchmodSync=function(u,h){var p=l.openSync(u,Ze.O_WRONLY|Ze.O_SYMLINK,h),f=true,b;try{b=l.fchmodSync(p,h),f=!1;}finally{if(f)try{l.closeSync(p);}catch{}else l.closeSync(p);}return b};}function r(l){Ze.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(u,h,p,f){l.open(u,Ze.O_SYMLINK,function(b,v){if(b){f&&f(b);return}l.futimes(v,h,p,function(y){l.close(v,function(x){f&&f(y||x);});});});},l.lutimesSync=function(u,h,p){var f=l.openSync(u,Ze.O_SYMLINK),b,v=true;try{b=l.futimesSync(f,h,p),v=!1;}finally{if(v)try{l.closeSync(f);}catch{}else l.closeSync(f);}return b}):l.futimes&&(l.lutimes=function(u,h,p,f){f&&process.nextTick(f);},l.lutimesSync=function(){});}function i(l){return l&&function(u,h,p){return l.call(t,u,h,function(f){d(f)&&(f=null),p&&p.apply(this,arguments);})}}function n(l){return l&&function(u,h){try{return l.call(t,u,h)}catch(p){if(!d(p))throw p}}}function o(l){return l&&function(u,h,p,f){return l.call(t,u,h,p,function(b){d(b)&&(b=null),f&&f.apply(this,arguments);})}}function s(l){return l&&function(u,h,p){try{return l.call(t,u,h,p)}catch(f){if(!d(f))throw f}}}function a(l){return l&&function(u,h,p){typeof h=="function"&&(p=h,h=null);function f(b,v){v&&(v.uid<0&&(v.uid+=4294967296),v.gid<0&&(v.gid+=4294967296)),p&&p.apply(this,arguments);}return h?l.call(t,u,h,f):l.call(t,u,f)}}function c(l){return l&&function(u,h){var p=h?l.call(t,u,h):l.call(t,u);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}function d(l){if(!l||l.code==="ENOSYS")return true;var u=!process.getuid||process.getuid()!==0;return !!(u&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var tc=g((uP,ec)=>{var Qa=F("stream").Stream;ec.exports=vw;function vw(t){return {ReadStream:e,WriteStream:r};function e(i,n){if(!(this instanceof e))return new e(i,n);Qa.call(this);var o=this;this.path=i,this.fd=null,this.readable=true,this.paused=false,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var s=Object.keys(n),a=0,c=s.length;a<c;a++){var d=s[a];this[d]=n[d];}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start;}if(this.fd!==null){process.nextTick(function(){o._read();});return}t.open(this.path,this.flags,this.mode,function(l,u){if(l){o.emit("error",l),o.readable=false;return}o.fd=u,o.emit("open",u),o._read();});}function r(i,n){if(!(this instanceof r))return new r(i,n);Qa.call(this),this.path=i,this.fd=null,this.writable=true,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var o=Object.keys(n),s=0,a=o.length;s<a;s++){var c=o[s];this[c]=n[c];}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start;}this.busy=false,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush());}}});var ic=g((hP,rc)=>{rc.exports=Sw;var xw=Object.getPrototypeOf||function(t){return t.__proto__};function Sw(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:xw(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));}),e}});var It=g((pP,zn)=>{var W=F("fs"),kw=Za(),Cw=tc(),Ow=ic(),Yr=F("util"),ie,Kr;typeof Symbol=="function"&&typeof Symbol.for=="function"?(ie=Symbol.for("graceful-fs.queue"),Kr=Symbol.for("graceful-fs.previous")):(ie="___graceful-fs.queue",Kr="___graceful-fs.previous");function Ew(){}function sc(t,e){Object.defineProperty(t,ie,{get:function(){return e}});}var ft=Ew;Yr.debuglog?ft=Yr.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(ft=function(){var t=Yr.format.apply(Yr,arguments);t="GFS4: "+t.split(/\n/).join(`
3
- GFS4: `),console.error(t);});W[ie]||(nc=global[ie]||[],sc(W,nc),W.close=(function(t){function e(r,i){return t.call(W,r,function(n){n||oc(),typeof i=="function"&&i.apply(this,arguments);})}return Object.defineProperty(e,Kr,{value:t}),e})(W.close),W.closeSync=(function(t){function e(r){t.apply(W,arguments),oc();}return Object.defineProperty(e,Kr,{value:t}),e})(W.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){ft(W[ie]),F("assert").equal(W[ie].length,0);}));var nc;global[ie]||sc(global,W[ie]);zn.exports=Bn(Ow(W));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!W.__patched&&(zn.exports=Bn(W),W.__patched=true);function Bn(t){kw(t),t.gracefulify=Bn,t.createReadStream=D,t.createWriteStream=_;var e=t.readFile;t.readFile=r;function r(w,E,O){return typeof E=="function"&&(O=E,E=null),G(w,E,O);function G(V,$,I,M){return e(V,$,function(P){P&&(P.code==="EMFILE"||P.code==="ENFILE")?Pt([G,[V,$,I],P,M||Date.now(),Date.now()]):typeof I=="function"&&I.apply(this,arguments);})}}var i=t.writeFile;t.writeFile=n;function n(w,E,O,G){return typeof O=="function"&&(G=O,O=null),V(w,E,O,G);function V($,I,M,P,Z){return i($,I,M,function(q){q&&(q.code==="EMFILE"||q.code==="ENFILE")?Pt([V,[$,I,M,P],q,Z||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}var o=t.appendFile;o&&(t.appendFile=s);function s(w,E,O,G){return typeof O=="function"&&(G=O,O=null),V(w,E,O,G);function V($,I,M,P,Z){return o($,I,M,function(q){q&&(q.code==="EMFILE"||q.code==="ENFILE")?Pt([V,[$,I,M,P],q,Z||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}var a=t.copyFile;a&&(t.copyFile=c);function c(w,E,O,G){return typeof O=="function"&&(G=O,O=0),V(w,E,O,G);function V($,I,M,P,Z){return a($,I,M,function(q){q&&(q.code==="EMFILE"||q.code==="ENFILE")?Pt([V,[$,I,M,P],q,Z||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}var d=t.readdir;t.readdir=u;var l=/^v[0-5]\./;function u(w,E,O){typeof E=="function"&&(O=E,E=null);var G=l.test(process.version)?function(I,M,P,Z){return d(I,V(I,M,P,Z))}:function(I,M,P,Z){return d(I,M,V(I,M,P,Z))};return G(w,E,O);function V($,I,M,P){return function(Z,q){Z&&(Z.code==="EMFILE"||Z.code==="ENFILE")?Pt([G,[$,I,M],Z,P||Date.now(),Date.now()]):(q&&q.sort&&q.sort(),typeof M=="function"&&M.call(this,Z,q));}}}if(process.version.substr(0,4)==="v0.8"){var h=Cw(t);y=h.ReadStream,k=h.WriteStream;}var p=t.ReadStream;p&&(y.prototype=Object.create(p.prototype),y.prototype.open=x);var f=t.WriteStream;f&&(k.prototype=Object.create(f.prototype),k.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return y},set:function(w){y=w;},enumerable:true,configurable:true}),Object.defineProperty(t,"WriteStream",{get:function(){return k},set:function(w){k=w;},enumerable:true,configurable:true});var b=y;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(w){b=w;},enumerable:true,configurable:true});var v=k;Object.defineProperty(t,"FileWriteStream",{get:function(){return v},set:function(w){v=w;},enumerable:true,configurable:true});function y(w,E){return this instanceof y?(p.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}function x(){var w=this;K(w.path,w.flags,w.mode,function(E,O){E?(w.autoClose&&w.destroy(),w.emit("error",E)):(w.fd=O,w.emit("open",O),w.read());});}function k(w,E){return this instanceof k?(f.apply(this,arguments),this):k.apply(Object.create(k.prototype),arguments)}function C(){var w=this;K(w.path,w.flags,w.mode,function(E,O){E?(w.destroy(),w.emit("error",E)):(w.fd=O,w.emit("open",O));});}function D(w,E){return new t.ReadStream(w,E)}function _(w,E){return new t.WriteStream(w,E)}var z=t.open;t.open=K;function K(w,E,O,G){return typeof O=="function"&&(G=O,O=null),V(w,E,O,G);function V($,I,M,P,Z){return z($,I,M,function(q,$D){q&&(q.code==="EMFILE"||q.code==="ENFILE")?Pt([V,[$,I,M,P],q,Z||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}return t}function Pt(t){ft("ENQUEUE",t[0].name,t[1]),W[ie].push(t),Un();}var Jr;function oc(){for(var t=Date.now(),e=0;e<W[ie].length;++e)W[ie][e].length>2&&(W[ie][e][3]=t,W[ie][e][4]=t);Un();}function Un(){if(clearTimeout(Jr),Jr=void 0,W[ie].length!==0){var t=W[ie].shift(),e=t[0],r=t[1],i=t[2],n=t[3],o=t[4];if(n===void 0)ft("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-n>=6e4){ft("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,i);}else {var a=Date.now()-o,c=Math.max(o-n,1),d=Math.min(c*1.2,100);a>=d?(ft("RETRY",e.name,r),e.apply(null,r.concat([n]))):W[ie].push(t);}Jr===void 0&&(Jr=setTimeout(Un,0));}}});var ae=g(je=>{var ac=ee().fromCallback,se=It(),Tw=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof se[t]=="function");Object.assign(je,se);Tw.forEach(t=>{je[t]=ac(se[t]);});je.exists=function(t,e){return typeof e=="function"?se.exists(t,e):new Promise(r=>se.exists(t,r))};je.read=function(t,e,r,i,n,o){return typeof o=="function"?se.read(t,e,r,i,n,o):new Promise((s,a)=>{se.read(t,e,r,i,n,(c,d,l)=>{if(c)return a(c);s({bytesRead:d,buffer:l});});})};je.write=function(t,e,...r){return typeof r[r.length-1]=="function"?se.write(t,e,...r):new Promise((i,n)=>{se.write(t,e,...r,(o,s,a)=>{if(o)return n(o);i({bytesWritten:s,buffer:a});});})};je.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?se.readv(t,e,...r):new Promise((i,n)=>{se.readv(t,e,...r,(o,s,a)=>{if(o)return n(o);i({bytesRead:s,buffers:a});});})};je.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?se.writev(t,e,...r):new Promise((i,n)=>{se.writev(t,e,...r,(o,s,a)=>{if(o)return n(o);i({bytesWritten:s,buffers:a});});})};typeof se.realpath.native=="function"?je.realpath.native=ac(se.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");});var lc=g((fP,cc)=>{var Aw=F("path");cc.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(Aw.parse(e).root,""))){let i=new Error(`Path contains invalid characters: ${e}`);throw i.code="EINVAL",i}};});var pc=g((gP,Gn)=>{var dc=ae(),{checkPath:uc}=lc(),hc=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};Gn.exports.makeDir=async(t,e)=>(uc(t),dc.mkdir(t,{mode:hc(e),recursive:true}));Gn.exports.makeDirSync=(t,e)=>(uc(t),dc.mkdirSync(t,{mode:hc(e),recursive:true}));});var be=g((bP,mc)=>{var _w=ee().fromPromise,{makeDir:Dw,makeDirSync:Vn}=pc(),Wn=_w(Dw);mc.exports={mkdirs:Wn,mkdirsSync:Vn,mkdirp:Wn,mkdirpSync:Vn,ensureDir:Wn,ensureDirSync:Vn};});var Qe=g((yP,gc)=>{var Pw=ee().fromPromise,fc=ae();function Iw(t){return fc.access(t).then(()=>true).catch(()=>false)}gc.exports={pathExists:Pw(Iw),pathExistsSync:fc.existsSync};});var Hn=g((wP,bc)=>{var $t=ae(),$w=ee().fromPromise;async function Rw(t,e,r){let i=await $t.open(t,"r+"),n=null;try{await $t.futimes(i,e,r);}catch(o){n=o;}finally{try{await $t.close(i);}catch(o){n||(n=o);}}if(n)throw n}function Mw(t,e,r){let i=$t.openSync(t,"r+"),n=null;try{$t.futimesSync(i,e,r);}catch(o){n=o;}finally{try{$t.closeSync(i);}catch(o){n||(n=o);}}if(n)throw n}bc.exports={utimesMillis:$w(Rw),utimesMillisSync:Mw};});var gt=g((vP,xc)=>{var Rt=ae(),te=F("path"),yc=ee().fromPromise;function Fw(t,e,r){let i=r.dereference?n=>Rt.stat(n,{bigint:true}):n=>Rt.lstat(n,{bigint:true});return Promise.all([i(t),i(e).catch(n=>{if(n.code==="ENOENT")return null;throw n})]).then(([n,o])=>({srcStat:n,destStat:o}))}function jw(t,e,r){let i,n=r.dereference?s=>Rt.statSync(s,{bigint:true}):s=>Rt.lstatSync(s,{bigint:true}),o=n(t);try{i=n(e);}catch(s){if(s.code==="ENOENT")return {srcStat:o,destStat:null};throw s}return {srcStat:o,destStat:i}}async function Nw(t,e,r,i){let{srcStat:n,destStat:o}=await Fw(t,e,i);if(o){if(or(n,o)){let s=te.basename(t),a=te.basename(e);if(r==="move"&&s!==a&&s.toLowerCase()===a.toLowerCase())return {srcStat:n,destStat:o,isChangingCase:true};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!n.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(n.isDirectory()&&Yn(t,e))throw new Error(Xr(t,e,r));return {srcStat:n,destStat:o}}function Lw(t,e,r,i){let{srcStat:n,destStat:o}=jw(t,e,i);if(o){if(or(n,o)){let s=te.basename(t),a=te.basename(e);if(r==="move"&&s!==a&&s.toLowerCase()===a.toLowerCase())return {srcStat:n,destStat:o,isChangingCase:true};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!n.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(n.isDirectory()&&Yn(t,e))throw new Error(Xr(t,e,r));return {srcStat:n,destStat:o}}async function wc(t,e,r,i){let n=te.resolve(te.dirname(t)),o=te.resolve(te.dirname(r));if(o===n||o===te.parse(o).root)return;let s;try{s=await Rt.stat(o,{bigint:!0});}catch(a){if(a.code==="ENOENT")return;throw a}if(or(e,s))throw new Error(Xr(t,r,i));return wc(t,e,o,i)}function vc(t,e,r,i){let n=te.resolve(te.dirname(t)),o=te.resolve(te.dirname(r));if(o===n||o===te.parse(o).root)return;let s;try{s=Rt.statSync(o,{bigint:!0});}catch(a){if(a.code==="ENOENT")return;throw a}if(or(e,s))throw new Error(Xr(t,r,i));return vc(t,e,o,i)}function or(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}function Yn(t,e){let r=te.resolve(t).split(te.sep).filter(n=>n),i=te.resolve(e).split(te.sep).filter(n=>n);return r.every((n,o)=>i[o]===n)}function Xr(t,e,r){return `Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}xc.exports={checkPaths:yc(Nw),checkPathsSync:Lw,checkParentPaths:yc(wc),checkParentPathsSync:vc,isSrcSubdir:Yn,areIdentical:or};});var kc=g((xP,Sc)=>{async function qw(t,e){let r=[];for await(let i of t)r.push(e(i).then(()=>null,n=>n??new Error("unknown error")));await Promise.all(r.map(i=>i.then(n=>{if(n!==null)throw n})));}Sc.exports={asyncIteratorConcurrentProcess:qw};});var Ac=g((SP,Tc)=>{var oe=ae(),sr=F("path"),{mkdirs:Bw}=be(),{pathExists:Uw}=Qe(),{utimesMillis:zw}=Hn(),ar=gt(),{asyncIteratorConcurrentProcess:Gw}=kc();async function Vw(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:true,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
2
+ 'use strict';var events=require('events'),Ln=require('child_process'),L=require('path'),Jr=require('fs'),$=require('process'),util=require('util'),url=require('url'),string_decoder=require('string_decoder'),pC=require('tty'),promises$1=require('timers/promises'),os$1=require('os'),v8=require('v8'),promises=require('stream/promises'),stream=require('stream'),buffer=require('buffer');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Ln__default=/*#__PURE__*/_interopDefault(Ln);var L__default=/*#__PURE__*/_interopDefault(L);var Jr__default=/*#__PURE__*/_interopDefault(Jr);var $__default=/*#__PURE__*/_interopDefault($);var pC__default=/*#__PURE__*/_interopDefault(pC);var pw=Object.create;var Za=Object.defineProperty;var mw=Object.getOwnPropertyDescriptor;var fw=Object.getOwnPropertyNames;var gw=Object.getPrototypeOf,bw=Object.prototype.hasOwnProperty;var F=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var yw=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of fw(e))!bw.call(t,n)&&n!==r&&Za(t,n,{get:()=>e[n],enumerable:!(i=mw(e,n))||i.enumerable});return t};var be=(t,e,r)=>(r=t!=null?pw(gw(t)):{},yw(Za(r,"default",{value:t,enumerable:true}),t));var ee=g(Bn=>{Bn.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,i)=>{e.push((n,o)=>n!=null?i(n):r(o)),t.apply(this,e);})},"name",{value:t.name})};Bn.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(i=>r(null,i),r);},"name",{value:t.name})};});var ic=g((yD,rc)=>{var tt=F("constants"),Cw=process.cwd,Kr=null,Ow=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Kr||(Kr=Cw.call(process)),Kr};try{process.cwd();}catch{}typeof process.chdir=="function"&&(Un=process.chdir,process.chdir=function(t){Kr=null,Un.call(process,t);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Un));var Un;rc.exports=Ew;function Ew(t){tt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=i(t.chmod),t.fchmod=i(t.fchmod),t.lchmod=i(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=n(t.chmodSync),t.fchmodSync=n(t.fchmodSync),t.lchmodSync=n(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,u,h){h&&process.nextTick(h);},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,u,h,p){p&&process.nextTick(p);},t.lchownSync=function(){}),Ow==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(l){function u(h,p,m){var b=Date.now(),y=0;l(h,p,function w(S){if(S&&(S.code==="EACCES"||S.code==="EPERM"||S.code==="EBUSY")&&Date.now()-b<6e4){setTimeout(function(){t.stat(p,function(C,M){C&&C.code==="ENOENT"?l(h,p,w):m(S);});},y),y<100&&(y+=10);return}m&&m(S);});}return Object.setPrototypeOf&&Object.setPrototypeOf(u,l),u})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(l){function u(h,p,m,b,y,w){var S;if(w&&typeof w=="function"){var C=0;S=function(M,Z,O){if(M&&M.code==="EAGAIN"&&C<10)return C++,l.call(t,h,p,m,b,y,S);w.apply(this,arguments);};}return l.call(t,h,p,m,b,y,S)}return Object.setPrototypeOf&&Object.setPrototypeOf(u,l),u})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(l){return function(u,h,p,m,b){for(var y=0;;)try{return l.call(t,u,h,p,m,b)}catch(w){if(w.code==="EAGAIN"&&y<10){y++;continue}throw w}}})(t.readSync);function e(l){l.lchmod=function(u,h,p){l.open(u,tt.O_WRONLY|tt.O_SYMLINK,h,function(m,b){if(m){p&&p(m);return}l.fchmod(b,h,function(y){l.close(b,function(w){p&&p(y||w);});});});},l.lchmodSync=function(u,h){var p=l.openSync(u,tt.O_WRONLY|tt.O_SYMLINK,h),m=true,b;try{b=l.fchmodSync(p,h),m=!1;}finally{if(m)try{l.closeSync(p);}catch{}else l.closeSync(p);}return b};}function r(l){tt.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(u,h,p,m){l.open(u,tt.O_SYMLINK,function(b,y){if(b){m&&m(b);return}l.futimes(y,h,p,function(w){l.close(y,function(S){m&&m(w||S);});});});},l.lutimesSync=function(u,h,p){var m=l.openSync(u,tt.O_SYMLINK),b,y=true;try{b=l.futimesSync(m,h,p),y=!1;}finally{if(y)try{l.closeSync(m);}catch{}else l.closeSync(m);}return b}):l.futimes&&(l.lutimes=function(u,h,p,m){m&&process.nextTick(m);},l.lutimesSync=function(){});}function i(l){return l&&function(u,h,p){return l.call(t,u,h,function(m){d(m)&&(m=null),p&&p.apply(this,arguments);})}}function n(l){return l&&function(u,h){try{return l.call(t,u,h)}catch(p){if(!d(p))throw p}}}function o(l){return l&&function(u,h,p,m){return l.call(t,u,h,p,function(b){d(b)&&(b=null),m&&m.apply(this,arguments);})}}function s(l){return l&&function(u,h,p){try{return l.call(t,u,h,p)}catch(m){if(!d(m))throw m}}}function a(l){return l&&function(u,h,p){typeof h=="function"&&(p=h,h=null);function m(b,y){y&&(y.uid<0&&(y.uid+=4294967296),y.gid<0&&(y.gid+=4294967296)),p&&p.apply(this,arguments);}return h?l.call(t,u,h,m):l.call(t,u,m)}}function c(l){return l&&function(u,h){var p=h?l.call(t,u,h):l.call(t,u);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}function d(l){if(!l||l.code==="ENOSYS")return true;var u=!process.getuid||process.getuid()!==0;return !!(u&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var sc=g((wD,oc)=>{var nc=F("stream").Stream;oc.exports=Tw;function Tw(t){return {ReadStream:e,WriteStream:r};function e(i,n){if(!(this instanceof e))return new e(i,n);nc.call(this);var o=this;this.path=i,this.fd=null,this.readable=true,this.paused=false,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var s=Object.keys(n),a=0,c=s.length;a<c;a++){var d=s[a];this[d]=n[d];}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start;}if(this.fd!==null){process.nextTick(function(){o._read();});return}t.open(this.path,this.flags,this.mode,function(l,u){if(l){o.emit("error",l),o.readable=false;return}o.fd=u,o.emit("open",u),o._read();});}function r(i,n){if(!(this instanceof r))return new r(i,n);nc.call(this),this.path=i,this.fd=null,this.writable=true,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var o=Object.keys(n),s=0,a=o.length;s<a;s++){var c=o[s];this[c]=n[c];}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start;}this.busy=false,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush());}}});var cc=g((vD,ac)=>{ac.exports=_w;var Aw=Object.getPrototypeOf||function(t){return t.__proto__};function _w(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Aw(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));}),e}});var Mt=g((xD,Vn)=>{var H=F("fs"),Pw=ic(),Dw=sc(),Iw=cc(),Xr=F("util"),ne,Qr;typeof Symbol=="function"&&typeof Symbol.for=="function"?(ne=Symbol.for("graceful-fs.queue"),Qr=Symbol.for("graceful-fs.previous")):(ne="___graceful-fs.queue",Qr="___graceful-fs.previous");function $w(){}function uc(t,e){Object.defineProperty(t,ne,{get:function(){return e}});}var gt=$w;Xr.debuglog?gt=Xr.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(gt=function(){var t=Xr.format.apply(Xr,arguments);t="GFS4: "+t.split(/\n/).join(`
3
+ GFS4: `),console.error(t);});H[ne]||(lc=global[ne]||[],uc(H,lc),H.close=(function(t){function e(r,i){return t.call(H,r,function(n){n||dc(),typeof i=="function"&&i.apply(this,arguments);})}return Object.defineProperty(e,Qr,{value:t}),e})(H.close),H.closeSync=(function(t){function e(r){t.apply(H,arguments),dc();}return Object.defineProperty(e,Qr,{value:t}),e})(H.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){gt(H[ne]),F("assert").equal(H[ne].length,0);}));var lc;global[ne]||uc(global,H[ne]);Vn.exports=zn(Iw(H));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!H.__patched&&(Vn.exports=zn(H),H.__patched=true);function zn(t){Pw(t),t.gracefulify=zn,t.createReadStream=Z,t.createWriteStream=O;var e=t.readFile;t.readFile=r;function r(v,E,k){return typeof E=="function"&&(k=E,E=null),B(v,E,k);function B(W,G,j,_){return e(W,G,function(P){P&&(P.code==="EMFILE"||P.code==="ENFILE")?Rt([B,[W,G,j],P,_||Date.now(),Date.now()]):typeof j=="function"&&j.apply(this,arguments);})}}var i=t.writeFile;t.writeFile=n;function n(v,E,k,B){return typeof k=="function"&&(B=k,k=null),W(v,E,k,B);function W(G,j,_,P,V){return i(G,j,_,function(I){I&&(I.code==="EMFILE"||I.code==="ENFILE")?Rt([W,[G,j,_,P],I,V||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}var o=t.appendFile;o&&(t.appendFile=s);function s(v,E,k,B){return typeof k=="function"&&(B=k,k=null),W(v,E,k,B);function W(G,j,_,P,V){return o(G,j,_,function(I){I&&(I.code==="EMFILE"||I.code==="ENFILE")?Rt([W,[G,j,_,P],I,V||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}var a=t.copyFile;a&&(t.copyFile=c);function c(v,E,k,B){return typeof k=="function"&&(B=k,k=0),W(v,E,k,B);function W(G,j,_,P,V){return a(G,j,_,function(I){I&&(I.code==="EMFILE"||I.code==="ENFILE")?Rt([W,[G,j,_,P],I,V||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}var d=t.readdir;t.readdir=u;var l=/^v[0-5]\./;function u(v,E,k){typeof E=="function"&&(k=E,E=null);var B=l.test(process.version)?function(j,_,P,V){return d(j,W(j,_,P,V))}:function(j,_,P,V){return d(j,_,W(j,_,P,V))};return B(v,E,k);function W(G,j,_,P){return function(V,I){V&&(V.code==="EMFILE"||V.code==="ENFILE")?Rt([B,[G,j,_],V,P||Date.now(),Date.now()]):(I&&I.sort&&I.sort(),typeof _=="function"&&_.call(this,V,I));}}}if(process.version.substr(0,4)==="v0.8"){var h=Dw(t);w=h.ReadStream,C=h.WriteStream;}var p=t.ReadStream;p&&(w.prototype=Object.create(p.prototype),w.prototype.open=S);var m=t.WriteStream;m&&(C.prototype=Object.create(m.prototype),C.prototype.open=M),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(v){w=v;},enumerable:true,configurable:true}),Object.defineProperty(t,"WriteStream",{get:function(){return C},set:function(v){C=v;},enumerable:true,configurable:true});var b=w;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(v){b=v;},enumerable:true,configurable:true});var y=C;Object.defineProperty(t,"FileWriteStream",{get:function(){return y},set:function(v){y=v;},enumerable:true,configurable:true});function w(v,E){return this instanceof w?(p.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function S(){var v=this;q(v.path,v.flags,v.mode,function(E,k){E?(v.autoClose&&v.destroy(),v.emit("error",E)):(v.fd=k,v.emit("open",k),v.read());});}function C(v,E){return this instanceof C?(m.apply(this,arguments),this):C.apply(Object.create(C.prototype),arguments)}function M(){var v=this;q(v.path,v.flags,v.mode,function(E,k){E?(v.destroy(),v.emit("error",E)):(v.fd=k,v.emit("open",k));});}function Z(v,E){return new t.ReadStream(v,E)}function O(v,E){return new t.WriteStream(v,E)}var D=t.open;t.open=q;function q(v,E,k,B){return typeof k=="function"&&(B=k,k=null),W(v,E,k,B);function W(G,j,_,P,V){return D(G,j,_,function(I,Xa){I&&(I.code==="EMFILE"||I.code==="ENFILE")?Rt([W,[G,j,_,P],I,V||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}return t}function Rt(t){gt("ENQUEUE",t[0].name,t[1]),H[ne].push(t),Gn();}var Zr;function dc(){for(var t=Date.now(),e=0;e<H[ne].length;++e)H[ne][e].length>2&&(H[ne][e][3]=t,H[ne][e][4]=t);Gn();}function Gn(){if(clearTimeout(Zr),Zr=void 0,H[ne].length!==0){var t=H[ne].shift(),e=t[0],r=t[1],i=t[2],n=t[3],o=t[4];if(n===void 0)gt("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-n>=6e4){gt("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,i);}else {var a=Date.now()-o,c=Math.max(o-n,1),d=Math.min(c*1.2,100);a>=d?(gt("RETRY",e.name,r),e.apply(null,r.concat([n]))):H[ne].push(t);}Zr===void 0&&(Zr=setTimeout(Gn,0));}}});var ae=g(je=>{var hc=ee().fromCallback,se=Mt(),Rw=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof se[t]=="function");Object.assign(je,se);Rw.forEach(t=>{je[t]=hc(se[t]);});je.exists=function(t,e){return typeof e=="function"?se.exists(t,e):new Promise(r=>se.exists(t,r))};je.read=function(t,e,r,i,n,o){return typeof o=="function"?se.read(t,e,r,i,n,o):new Promise((s,a)=>{se.read(t,e,r,i,n,(c,d,l)=>{if(c)return a(c);s({bytesRead:d,buffer:l});});})};je.write=function(t,e,...r){return typeof r[r.length-1]=="function"?se.write(t,e,...r):new Promise((i,n)=>{se.write(t,e,...r,(o,s,a)=>{if(o)return n(o);i({bytesWritten:s,buffer:a});});})};je.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?se.readv(t,e,...r):new Promise((i,n)=>{se.readv(t,e,...r,(o,s,a)=>{if(o)return n(o);i({bytesRead:s,buffers:a});});})};je.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?se.writev(t,e,...r):new Promise((i,n)=>{se.writev(t,e,...r,(o,s,a)=>{if(o)return n(o);i({bytesWritten:s,buffers:a});});})};typeof se.realpath.native=="function"?je.realpath.native=hc(se.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");});var mc=g((kD,pc)=>{var Mw=F("path");pc.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(Mw.parse(e).root,""))){let i=new Error(`Path contains invalid characters: ${e}`);throw i.code="EINVAL",i}};});var yc=g((CD,Wn)=>{var fc=ae(),{checkPath:gc}=mc(),bc=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};Wn.exports.makeDir=async(t,e)=>(gc(t),fc.mkdir(t,{mode:bc(e),recursive:true}));Wn.exports.makeDirSync=(t,e)=>(gc(t),fc.mkdirSync(t,{mode:bc(e),recursive:true}));});var ye=g((OD,wc)=>{var Fw=ee().fromPromise,{makeDir:jw,makeDirSync:Hn}=yc(),Yn=Fw(jw);wc.exports={mkdirs:Yn,mkdirsSync:Hn,mkdirp:Yn,mkdirpSync:Hn,ensureDir:Yn,ensureDirSync:Hn};});var rt=g((ED,xc)=>{var Nw=ee().fromPromise,vc=ae();function qw(t){return vc.access(t).then(()=>true).catch(()=>false)}xc.exports={pathExists:Nw(qw),pathExistsSync:vc.existsSync};});var Jn=g((TD,Sc)=>{var Ft=ae(),Lw=ee().fromPromise;async function Bw(t,e,r){let i=await Ft.open(t,"r+"),n=null;try{await Ft.futimes(i,e,r);}catch(o){n=o;}finally{try{await Ft.close(i);}catch(o){n||(n=o);}}if(n)throw n}function Uw(t,e,r){let i=Ft.openSync(t,"r+"),n=null;try{Ft.futimesSync(i,e,r);}catch(o){n=o;}finally{try{Ft.closeSync(i);}catch(o){n||(n=o);}}if(n)throw n}Sc.exports={utimesMillis:Lw(Bw),utimesMillisSync:Uw};});var bt=g((AD,Ec)=>{var jt=ae(),te=F("path"),kc=ee().fromPromise;function zw(t,e,r){let i=r.dereference?n=>jt.stat(n,{bigint:true}):n=>jt.lstat(n,{bigint:true});return Promise.all([i(t),i(e).catch(n=>{if(n.code==="ENOENT")return null;throw n})]).then(([n,o])=>({srcStat:n,destStat:o}))}function Gw(t,e,r){let i,n=r.dereference?s=>jt.statSync(s,{bigint:true}):s=>jt.lstatSync(s,{bigint:true}),o=n(t);try{i=n(e);}catch(s){if(s.code==="ENOENT")return {srcStat:o,destStat:null};throw s}return {srcStat:o,destStat:i}}async function Vw(t,e,r,i){let{srcStat:n,destStat:o}=await zw(t,e,i);if(o){if(cr(n,o)){let s=te.basename(t),a=te.basename(e);if(r==="move"&&s!==a&&s.toLowerCase()===a.toLowerCase())return {srcStat:n,destStat:o,isChangingCase:true};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!n.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(n.isDirectory()&&Kn(t,e))throw new Error(ei(t,e,r));return {srcStat:n,destStat:o}}function Ww(t,e,r,i){let{srcStat:n,destStat:o}=Gw(t,e,i);if(o){if(cr(n,o)){let s=te.basename(t),a=te.basename(e);if(r==="move"&&s!==a&&s.toLowerCase()===a.toLowerCase())return {srcStat:n,destStat:o,isChangingCase:true};throw new Error("Source and destination must not be the same.")}if(n.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!n.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(n.isDirectory()&&Kn(t,e))throw new Error(ei(t,e,r));return {srcStat:n,destStat:o}}async function Cc(t,e,r,i){let n=te.resolve(te.dirname(t)),o=te.resolve(te.dirname(r));if(o===n||o===te.parse(o).root)return;let s;try{s=await jt.stat(o,{bigint:!0});}catch(a){if(a.code==="ENOENT")return;throw a}if(cr(e,s))throw new Error(ei(t,r,i));return Cc(t,e,o,i)}function Oc(t,e,r,i){let n=te.resolve(te.dirname(t)),o=te.resolve(te.dirname(r));if(o===n||o===te.parse(o).root)return;let s;try{s=jt.statSync(o,{bigint:!0});}catch(a){if(a.code==="ENOENT")return;throw a}if(cr(e,s))throw new Error(ei(t,r,i));return Oc(t,e,o,i)}function cr(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}function Kn(t,e){let r=te.resolve(t).split(te.sep).filter(n=>n),i=te.resolve(e).split(te.sep).filter(n=>n);return r.every((n,o)=>i[o]===n)}function ei(t,e,r){return `Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}Ec.exports={checkPaths:kc(Vw),checkPathsSync:Ww,checkParentPaths:kc(Cc),checkParentPathsSync:Oc,isSrcSubdir:Kn,areIdentical:cr};});var Ac=g((_D,Tc)=>{async function Hw(t,e){let r=[];for await(let i of t)r.push(e(i).then(()=>null,n=>n??new Error("unknown error")));await Promise.all(r.map(i=>i.then(n=>{if(n!==null)throw n})));}Tc.exports={asyncIteratorConcurrentProcess:Hw};});var $c=g((PD,Ic)=>{var oe=ae(),lr=F("path"),{mkdirs:Yw}=ye(),{pathExists:Jw}=rt(),{utimesMillis:Kw}=Jn(),dr=bt(),{asyncIteratorConcurrentProcess:Xw}=Ac();async function Zw(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:true,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
4
4
 
5
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:i,destStat:n}=await ar.checkPaths(t,e,"copy",r);if(await ar.checkParentPaths(t,i,e,"copy"),!await Oc(t,e,r))return;let s=sr.dirname(e);await Uw(s)||await Bw(s),await Ec(n,t,e,r);}async function Oc(t,e,r){return r.filter?r.filter(t,e):true}async function Ec(t,e,r,i){let o=await(i.dereference?oe.stat:oe.lstat)(e);if(o.isDirectory())return Jw(o,t,e,r,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return Ww(o,t,e,r,i);if(o.isSymbolicLink())return Kw(t,e,r,i);throw o.isSocket()?new Error(`Cannot copy a socket file: ${e}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}async function Ww(t,e,r,i,n){if(!e)return Cc(t,r,i,n);if(n.overwrite)return await oe.unlink(i),Cc(t,r,i,n);if(n.errorOnExist)throw new Error(`'${i}' already exists`)}async function Cc(t,e,r,i){if(await oe.copyFile(e,r),i.preserveTimestamps){Hw(t.mode)&&await Yw(r,t.mode);let n=await oe.stat(e);await zw(r,n.atime,n.mtime);}return oe.chmod(r,t.mode)}function Hw(t){return (t&128)===0}function Yw(t,e){return oe.chmod(t,e|128)}async function Jw(t,e,r,i,n){e||await oe.mkdir(i),await Gw(await oe.opendir(r),async o=>{let s=sr.join(r,o.name),a=sr.join(i,o.name);if(await Oc(s,a,n)){let{destStat:d}=await ar.checkPaths(s,a,"copy",n);await Ec(d,s,a,n);}}),e||await oe.chmod(i,t.mode);}async function Kw(t,e,r,i){let n=await oe.readlink(e);if(i.dereference&&(n=sr.resolve(process.cwd(),n)),!t)return oe.symlink(n,r);let o=null;try{o=await oe.readlink(r);}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return oe.symlink(n,r);throw s}if(i.dereference&&(o=sr.resolve(process.cwd(),o)),n!==o){if(ar.isSrcSubdir(n,o))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${o}'.`);if(ar.isSrcSubdir(o,n))throw new Error(`Cannot overwrite '${o}' with '${n}'.`)}return await oe.unlink(r),oe.symlink(n,r)}Tc.exports=Vw;});var $c=g((kP,Ic)=>{var ce=It(),cr=F("path"),Xw=be().mkdirsSync,Zw=Hn().utimesMillisSync,lr=gt();function Qw(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:true,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
5
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:i,destStat:n}=await dr.checkPaths(t,e,"copy",r);if(await dr.checkParentPaths(t,i,e,"copy"),!await Pc(t,e,r))return;let s=lr.dirname(e);await Jw(s)||await Yw(s),await Dc(n,t,e,r);}async function Pc(t,e,r){return r.filter?r.filter(t,e):true}async function Dc(t,e,r,i){let o=await(i.dereference?oe.stat:oe.lstat)(e);if(o.isDirectory())return rv(o,t,e,r,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return Qw(o,t,e,r,i);if(o.isSymbolicLink())return iv(t,e,r,i);throw o.isSocket()?new Error(`Cannot copy a socket file: ${e}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}async function Qw(t,e,r,i,n){if(!e)return _c(t,r,i,n);if(n.overwrite)return await oe.unlink(i),_c(t,r,i,n);if(n.errorOnExist)throw new Error(`'${i}' already exists`)}async function _c(t,e,r,i){if(await oe.copyFile(e,r),i.preserveTimestamps){ev(t.mode)&&await tv(r,t.mode);let n=await oe.stat(e);await Kw(r,n.atime,n.mtime);}return oe.chmod(r,t.mode)}function ev(t){return (t&128)===0}function tv(t,e){return oe.chmod(t,e|128)}async function rv(t,e,r,i,n){e||await oe.mkdir(i),await Xw(await oe.opendir(r),async o=>{let s=lr.join(r,o.name),a=lr.join(i,o.name);if(await Pc(s,a,n)){let{destStat:d}=await dr.checkPaths(s,a,"copy",n);await Dc(d,s,a,n);}}),e||await oe.chmod(i,t.mode);}async function iv(t,e,r,i){let n=await oe.readlink(e);if(i.dereference&&(n=lr.resolve(process.cwd(),n)),!t)return oe.symlink(n,r);let o=null;try{o=await oe.readlink(r);}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return oe.symlink(n,r);throw s}if(i.dereference&&(o=lr.resolve(process.cwd(),o)),n!==o){if(dr.isSrcSubdir(n,o))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${o}'.`);if(dr.isSrcSubdir(o,n))throw new Error(`Cannot overwrite '${o}' with '${n}'.`)}return await oe.unlink(r),oe.symlink(n,r)}Ic.exports=Zw;});var Nc=g((DD,jc)=>{var ce=Mt(),ur=F("path"),nv=ye().mkdirsSync,ov=Jn().utimesMillisSync,hr=bt();function sv(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:true,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
6
6
 
7
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:i,destStat:n}=lr.checkPathsSync(t,e,"copy",r);if(lr.checkParentPathsSync(t,i,e,"copy"),r.filter&&!r.filter(t,e))return;let o=cr.dirname(e);return ce.existsSync(o)||Xw(o),_c(n,t,e,r)}function _c(t,e,r,i){let o=(i.dereference?ce.statSync:ce.lstatSync)(e);if(o.isDirectory())return sv(o,t,e,r,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return ev(o,t,e,r,i);if(o.isSymbolicLink())return lv(t,e,r,i);throw o.isSocket()?new Error(`Cannot copy a socket file: ${e}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function ev(t,e,r,i,n){return e?tv(t,r,i,n):Dc(t,r,i,n)}function tv(t,e,r,i){if(i.overwrite)return ce.unlinkSync(r),Dc(t,e,r,i);if(i.errorOnExist)throw new Error(`'${r}' already exists`)}function Dc(t,e,r,i){return ce.copyFileSync(e,r),i.preserveTimestamps&&rv(t.mode,e,r),Jn(r,t.mode)}function rv(t,e,r){return iv(t)&&nv(r,t),ov(e,r)}function iv(t){return (t&128)===0}function nv(t,e){return Jn(t,e|128)}function Jn(t,e){return ce.chmodSync(t,e)}function ov(t,e){let r=ce.statSync(t);return Zw(e,r.atime,r.mtime)}function sv(t,e,r,i,n){return e?Pc(r,i,n):av(t.mode,r,i,n)}function av(t,e,r,i){return ce.mkdirSync(r),Pc(e,r,i),Jn(r,t)}function Pc(t,e,r){let i=ce.opendirSync(t);try{let n;for(;(n=i.readSync())!==null;)cv(n.name,t,e,r);}finally{i.closeSync();}}function cv(t,e,r,i){let n=cr.join(e,t),o=cr.join(r,t);if(i.filter&&!i.filter(n,o))return;let{destStat:s}=lr.checkPathsSync(n,o,"copy",i);return _c(s,n,o,i)}function lv(t,e,r,i){let n=ce.readlinkSync(e);if(i.dereference&&(n=cr.resolve(process.cwd(),n)),t){let o;try{o=ce.readlinkSync(r);}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return ce.symlinkSync(n,r);throw s}if(i.dereference&&(o=cr.resolve(process.cwd(),o)),n!==o){if(lr.isSrcSubdir(n,o))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${o}'.`);if(lr.isSrcSubdir(o,n))throw new Error(`Cannot overwrite '${o}' with '${n}'.`)}return dv(n,r)}else return ce.symlinkSync(n,r)}function dv(t,e){return ce.unlinkSync(e),ce.symlinkSync(t,e)}Ic.exports=Qw;});var Zr=g((CP,Rc)=>{var uv=ee().fromPromise;Rc.exports={copy:uv(Ac()),copySync:$c()};});var dr=g((OP,Fc)=>{var Mc=It(),hv=ee().fromCallback;function pv(t,e){Mc.rm(t,{recursive:true,force:true},e);}function mv(t){Mc.rmSync(t,{recursive:true,force:true});}Fc.exports={remove:hv(pv),removeSync:mv};});var Gc=g((EP,zc)=>{var fv=ee().fromPromise,Lc=ae(),qc=F("path"),Bc=be(),Uc=dr(),jc=fv(async function(e){let r;try{r=await Lc.readdir(e);}catch{return Bc.mkdirs(e)}return Promise.all(r.map(i=>Uc.remove(qc.join(e,i))))});function Nc(t){let e;try{e=Lc.readdirSync(t);}catch{return Bc.mkdirsSync(t)}e.forEach(r=>{r=qc.join(t,r),Uc.removeSync(r);});}zc.exports={emptyDirSync:Nc,emptydirSync:Nc,emptyDir:jc,emptydir:jc};});var Yc=g((TP,Hc)=>{var gv=ee().fromPromise,Vc=F("path"),Ne=ae(),Wc=be();async function bv(t){let e;try{e=await Ne.stat(t);}catch{}if(e&&e.isFile())return;let r=Vc.dirname(t),i=null;try{i=await Ne.stat(r);}catch(n){if(n.code==="ENOENT"){await Wc.mkdirs(r),await Ne.writeFile(t,"");return}else throw n}i.isDirectory()?await Ne.writeFile(t,""):await Ne.readdir(r);}function yv(t){let e;try{e=Ne.statSync(t);}catch{}if(e&&e.isFile())return;let r=Vc.dirname(t);try{Ne.statSync(r).isDirectory()||Ne.readdirSync(r);}catch(i){if(i&&i.code==="ENOENT")Wc.mkdirsSync(r);else throw i}Ne.writeFileSync(t,"");}Hc.exports={createFile:gv(bv),createFileSync:yv};});var Qc=g((AP,Zc)=>{var wv=ee().fromPromise,Jc=F("path"),et=ae(),Kc=be(),{pathExists:vv}=Qe(),{areIdentical:Xc}=gt();async function xv(t,e){let r;try{r=await et.lstat(e,{bigint:!0});}catch{}let i;try{i=await et.lstat(t,{bigint:!0});}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}if(r&&Xc(i,r))return;let n=Jc.dirname(e);await vv(n)||await Kc.mkdirs(n),await et.link(t,e);}function Sv(t,e){let r;try{r=et.lstatSync(e,{bigint:!0});}catch{}try{let o=et.lstatSync(t,{bigint:!0});if(r&&Xc(o,r))return}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let i=Jc.dirname(e);return et.existsSync(i)||Kc.mkdirsSync(i),et.linkSync(t,e)}Zc.exports={createLink:wv(xv),createLinkSync:Sv};});var tl=g((_P,el)=>{var tt=F("path"),ur=ae(),{pathExists:kv}=Qe(),Cv=ee().fromPromise;async function Ov(t,e){if(tt.isAbsolute(t)){try{await ur.lstat(t);}catch(o){throw o.message=o.message.replace("lstat","ensureSymlink"),o}return {toCwd:t,toDst:t}}let r=tt.dirname(e),i=tt.join(r,t);if(await kv(i))return {toCwd:i,toDst:t};try{await ur.lstat(t);}catch(o){throw o.message=o.message.replace("lstat","ensureSymlink"),o}return {toCwd:t,toDst:tt.relative(r,t)}}function Ev(t,e){if(tt.isAbsolute(t)){if(!ur.existsSync(t))throw new Error("absolute srcpath does not exist");return {toCwd:t,toDst:t}}let r=tt.dirname(e),i=tt.join(r,t);if(ur.existsSync(i))return {toCwd:i,toDst:t};if(!ur.existsSync(t))throw new Error("relative srcpath does not exist");return {toCwd:t,toDst:tt.relative(r,t)}}el.exports={symlinkPaths:Cv(Ov),symlinkPathsSync:Ev};});var nl=g((DP,il)=>{var rl=ae(),Tv=ee().fromPromise;async function Av(t,e){if(e)return e;let r;try{r=await rl.lstat(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}function _v(t,e){if(e)return e;let r;try{r=rl.lstatSync(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}il.exports={symlinkType:Tv(Av),symlinkTypeSync:_v};});var al=g((PP,sl)=>{var Dv=ee().fromPromise,rt=F("path"),de=ae(),{mkdirs:Pv,mkdirsSync:Iv}=be(),{symlinkPaths:$v,symlinkPathsSync:Rv}=tl(),{symlinkType:Mv,symlinkTypeSync:Fv}=nl(),{pathExists:jv}=Qe(),{areIdentical:ol}=gt();async function Nv(t,e,r){let i;try{i=await de.lstat(e);}catch{}if(i&&i.isSymbolicLink()){let a;if(rt.isAbsolute(t))a=await de.stat(t,{bigint:true});else {let d=rt.dirname(e),l=rt.join(d,t);try{a=await de.stat(l,{bigint:!0});}catch{a=await de.stat(t,{bigint:true});}}let c=await de.stat(e,{bigint:true});if(ol(a,c))return}let n=await $v(t,e);t=n.toDst;let o=await Mv(n.toCwd,r),s=rt.dirname(e);return await jv(s)||await Pv(s),de.symlink(t,e,o)}function Lv(t,e,r){let i;try{i=de.lstatSync(e);}catch{}if(i&&i.isSymbolicLink()){let a;if(rt.isAbsolute(t))a=de.statSync(t,{bigint:true});else {let d=rt.dirname(e),l=rt.join(d,t);try{a=de.statSync(l,{bigint:!0});}catch{a=de.statSync(t,{bigint:true});}}let c=de.statSync(e,{bigint:true});if(ol(a,c))return}let n=Rv(t,e);t=n.toDst,r=Fv(n.toCwd,r);let o=rt.dirname(e);return de.existsSync(o)||Iv(o),de.symlinkSync(t,e,r)}sl.exports={createSymlink:Dv(Nv),createSymlinkSync:Lv};});var fl=g((IP,ml)=>{var{createFile:cl,createFileSync:ll}=Yc(),{createLink:dl,createLinkSync:ul}=Qc(),{createSymlink:hl,createSymlinkSync:pl}=al();ml.exports={createFile:cl,createFileSync:ll,ensureFile:cl,ensureFileSync:ll,createLink:dl,createLinkSync:ul,ensureLink:dl,ensureLinkSync:ul,createSymlink:hl,createSymlinkSync:pl,ensureSymlink:hl,ensureSymlinkSync:pl};});var Qr=g(($P,gl)=>{function qv(t,{EOL:e=`
8
- `,finalEOL:r=true,replacer:i=null,spaces:n}={}){let o=r?e:"",s=JSON.stringify(t,i,n);if(s===void 0)throw new TypeError(`Converting ${typeof t} value to JSON is not supported`);return s.replace(/\n/g,e)+o}function Bv(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}gl.exports={stringify:qv,stripBom:Bv};});var vl=g((RP,wl)=>{var Mt;try{Mt=It();}catch{Mt=F("fs");}var ei=ee(),{stringify:bl,stripBom:yl}=Qr();async function Uv(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Mt,i="throws"in e?e.throws:true,n=await ei.fromCallback(r.readFile)(t,e);n=yl(n);let o;try{o=JSON.parse(n,e?e.reviver:null);}catch(s){if(i)throw s.message=`${t}: ${s.message}`,s;return null}return o}var zv=ei.fromPromise(Uv);function Gv(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Mt,i="throws"in e?e.throws:true;try{let n=r.readFileSync(t,e);return n=yl(n),JSON.parse(n,e.reviver)}catch(n){if(i)throw n.message=`${t}: ${n.message}`,n;return null}}async function Vv(t,e,r={}){let i=r.fs||Mt,n=bl(e,r);await ei.fromCallback(i.writeFile)(t,n,r);}var Wv=ei.fromPromise(Vv);function Hv(t,e,r={}){let i=r.fs||Mt,n=bl(e,r);return i.writeFileSync(t,n,r)}wl.exports={readFile:zv,readFileSync:Gv,writeFile:Wv,writeFileSync:Hv};});var Sl=g((MP,xl)=>{var ti=vl();xl.exports={readJson:ti.readFile,readJsonSync:ti.readFileSync,writeJson:ti.writeFile,writeJsonSync:ti.writeFileSync};});var ri=g((FP,Ol)=>{var Yv=ee().fromPromise,Kn=ae(),kl=F("path"),Cl=be(),Jv=Qe().pathExists;async function Kv(t,e,r="utf-8"){let i=kl.dirname(t);return await Jv(i)||await Cl.mkdirs(i),Kn.writeFile(t,e,r)}function Xv(t,...e){let r=kl.dirname(t);Kn.existsSync(r)||Cl.mkdirsSync(r),Kn.writeFileSync(t,...e);}Ol.exports={outputFile:Yv(Kv),outputFileSync:Xv};});var Tl=g((jP,El)=>{var{stringify:Zv}=Qr(),{outputFile:Qv}=ri();async function ex(t,e,r={}){let i=Zv(e,r);await Qv(t,i,r);}El.exports=ex;});var _l=g((NP,Al)=>{var{stringify:tx}=Qr(),{outputFileSync:rx}=ri();function ix(t,e,r){let i=tx(e,r);rx(t,i,r);}Al.exports=ix;});var Pl=g((LP,Dl)=>{var nx=ee().fromPromise,le=Sl();le.outputJson=nx(Tl());le.outputJsonSync=_l();le.outputJSON=le.outputJson;le.outputJSONSync=le.outputJsonSync;le.writeJSON=le.writeJson;le.writeJSONSync=le.writeJsonSync;le.readJSON=le.readJson;le.readJSONSync=le.readJsonSync;Dl.exports=le;});var Fl=g((qP,Ml)=>{var ox=ae(),Il=F("path"),{copy:sx}=Zr(),{remove:Rl}=dr(),{mkdirp:ax}=be(),{pathExists:cx}=Qe(),$l=gt();async function lx(t,e,r={}){let i=r.overwrite||r.clobber||false,{srcStat:n,isChangingCase:o=false}=await $l.checkPaths(t,e,"move",r);await $l.checkParentPaths(t,n,e,"move");let s=Il.dirname(e);return Il.parse(s).root!==s&&await ax(s),dx(t,e,i,o)}async function dx(t,e,r,i){if(!i){if(r)await Rl(e);else if(await cx(e))throw new Error("dest already exists.")}try{await ox.rename(t,e);}catch(n){if(n.code!=="EXDEV")throw n;await ux(t,e,r);}}async function ux(t,e,r){return await sx(t,e,{overwrite:r,errorOnExist:true,preserveTimestamps:true}),Rl(t)}Ml.exports=lx;});var Bl=g((BP,ql)=>{var Nl=It(),Zn=F("path"),hx=Zr().copySync,Ll=dr().removeSync,px=be().mkdirpSync,jl=gt();function mx(t,e,r){r=r||{};let i=r.overwrite||r.clobber||false,{srcStat:n,isChangingCase:o=false}=jl.checkPathsSync(t,e,"move",r);return jl.checkParentPathsSync(t,n,e,"move"),fx(e)||px(Zn.dirname(e)),gx(t,e,i,o)}function fx(t){let e=Zn.dirname(t);return Zn.parse(e).root===e}function gx(t,e,r,i){if(i)return Xn(t,e,r);if(r)return Ll(e),Xn(t,e,r);if(Nl.existsSync(e))throw new Error("dest already exists.");return Xn(t,e,r)}function Xn(t,e,r){try{Nl.renameSync(t,e);}catch(i){if(i.code!=="EXDEV")throw i;return bx(t,e,r)}}function bx(t,e,r){return hx(t,e,{overwrite:r,errorOnExist:true,preserveTimestamps:true}),Ll(t)}ql.exports=mx;});var zl=g((UP,Ul)=>{var yx=ee().fromPromise;Ul.exports={move:yx(Fl()),moveSync:Bl()};});var it=g((zP,Gl)=>{Gl.exports={...ae(),...Zr(),...Gc(),...fl(),...Pl(),...be(),...zl(),...ri(),...Qe(),...dr()};});var H=g((GP,Wl)=>{var{FORCE_COLOR:wx,NODE_DISABLE_COLORS:vx,TERM:xx}=process.env,j={enabled:!vx&&xx!=="dumb"&&wx!=="0",reset:B(0,0),bold:B(1,22),dim:B(2,22),italic:B(3,23),underline:B(4,24),inverse:B(7,27),hidden:B(8,28),strikethrough:B(9,29),black:B(30,39),red:B(31,39),green:B(32,39),yellow:B(33,39),blue:B(34,39),magenta:B(35,39),cyan:B(36,39),white:B(37,39),gray:B(90,39),grey:B(90,39),bgBlack:B(40,49),bgRed:B(41,49),bgGreen:B(42,49),bgYellow:B(43,49),bgBlue:B(44,49),bgMagenta:B(45,49),bgCyan:B(46,49),bgWhite:B(47,49)};function Vl(t,e){let r=0,i,n="",o="";for(;r<t.length;r++)i=t[r],n+=i.open,o+=i.close,e.includes(i.close)&&(e=e.replace(i.rgx,i.close+i.open));return n+e+o}function Sx(t,e){let r={has:t,keys:e};return r.reset=j.reset.bind(r),r.bold=j.bold.bind(r),r.dim=j.dim.bind(r),r.italic=j.italic.bind(r),r.underline=j.underline.bind(r),r.inverse=j.inverse.bind(r),r.hidden=j.hidden.bind(r),r.strikethrough=j.strikethrough.bind(r),r.black=j.black.bind(r),r.red=j.red.bind(r),r.green=j.green.bind(r),r.yellow=j.yellow.bind(r),r.blue=j.blue.bind(r),r.magenta=j.magenta.bind(r),r.cyan=j.cyan.bind(r),r.white=j.white.bind(r),r.gray=j.gray.bind(r),r.grey=j.grey.bind(r),r.bgBlack=j.bgBlack.bind(r),r.bgRed=j.bgRed.bind(r),r.bgGreen=j.bgGreen.bind(r),r.bgYellow=j.bgYellow.bind(r),r.bgBlue=j.bgBlue.bind(r),r.bgMagenta=j.bgMagenta.bind(r),r.bgCyan=j.bgCyan.bind(r),r.bgWhite=j.bgWhite.bind(r),r}function B(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),i===void 0?this:j.enabled?Vl(this.keys,i+""):i+""):i===void 0?Sx([t],[r]):j.enabled?Vl([r],i+""):i+""}}Wl.exports=j;});var Yl=g((VP,Hl)=>{Hl.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return "first";if(t.name==="c"||t.name==="d")return "abort";if(t.name==="e")return "last";if(t.name==="g")return "reset"}if(e){if(t.name==="j")return "down";if(t.name==="k")return "up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":false}};});var ii=g((WP,Jl)=>{Jl.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t};});var Y=g((HP,Kl)=>{var Qn={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},kx={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Cx={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?Qn.up():"");return t&&(e+=Qn.left),e}};Kl.exports={cursor:Qn,scroll:kx,erase:Cx,beep:"\x07"};});var td=g((YP,ed)=>{function Ox(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Ex(t))||e){r&&(t=r);var i=0,n=function(){};return {s:n,n:function(){return i>=t.length?{done:true}:{done:false,value:t[i++]}},e:function(d){throw d},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
9
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=true,s=false,a;return {s:function(){r=r.call(t);},n:function(){var d=r.next();return o=d.done,d},e:function(d){s=true,a=d;},f:function(){try{!o&&r.return!=null&&r.return();}finally{if(s)throw a}}}}function Ex(t,e){if(t){if(typeof t=="string")return Xl(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xl(t,e)}}function Xl(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}var Tx=ii(),Ql=Y(),Zl=Ql.erase,Ax=Ql.cursor,_x=t=>[...Tx(t)].length;ed.exports=function(t,e){if(!e)return Zl.line+Ax.to(0);let r=0,i=t.split(/\r?\n/);var n=Ox(i),o;try{for(n.s();!(o=n.n()).done;){let s=o.value;r+=1+Math.floor(Math.max(_x(s)-1,0)/e);}}catch(s){n.e(s);}finally{n.f();}return Zl.lines(r)};});var eo=g((JP,rd)=>{var hr={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},Dx={arrowUp:hr.arrowUp,arrowDown:hr.arrowDown,arrowLeft:hr.arrowLeft,arrowRight:hr.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Px=process.platform==="win32"?Dx:hr;rd.exports=Px;});var nd=g((KP,id)=>{var Ft=H(),bt=eo(),to=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),Ix=t=>to[t]||to.default,pr=Object.freeze({aborted:Ft.red(bt.cross),done:Ft.green(bt.tick),exited:Ft.yellow(bt.cross),default:Ft.cyan("?")}),$x=(t,e,r)=>e?pr.aborted:r?pr.exited:t?pr.done:pr.default,Rx=t=>Ft.gray(t?bt.ellipsis:bt.pointerSmall),Mx=(t,e)=>Ft.gray(t?e?bt.pointerSmall:"+":bt.line);id.exports={styles:to,render:Ix,symbols:pr,symbol:$x,delimiter:Rx,item:Mx};});var sd=g((XP,od)=>{var Fx=ii();od.exports=function(t,e){let r=String(Fx(t)||"").split(/\r?\n/);return e?r.map(i=>Math.ceil(i.length/e)).reduce((i,n)=>i+n):r.length};});var cd=g((ZP,ad)=>{ad.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return (t||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=i||o[o.length-1].length+s.length+1<i?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
7
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:i,destStat:n}=hr.checkPathsSync(t,e,"copy",r);if(hr.checkParentPathsSync(t,i,e,"copy"),r.filter&&!r.filter(t,e))return;let o=ur.dirname(e);return ce.existsSync(o)||nv(o),Rc(n,t,e,r)}function Rc(t,e,r,i){let o=(i.dereference?ce.statSync:ce.lstatSync)(e);if(o.isDirectory())return pv(o,t,e,r,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return av(o,t,e,r,i);if(o.isSymbolicLink())return gv(t,e,r,i);throw o.isSocket()?new Error(`Cannot copy a socket file: ${e}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function av(t,e,r,i,n){return e?cv(t,r,i,n):Mc(t,r,i,n)}function cv(t,e,r,i){if(i.overwrite)return ce.unlinkSync(r),Mc(t,e,r,i);if(i.errorOnExist)throw new Error(`'${r}' already exists`)}function Mc(t,e,r,i){return ce.copyFileSync(e,r),i.preserveTimestamps&&lv(t.mode,e,r),Xn(r,t.mode)}function lv(t,e,r){return dv(t)&&uv(r,t),hv(e,r)}function dv(t){return (t&128)===0}function uv(t,e){return Xn(t,e|128)}function Xn(t,e){return ce.chmodSync(t,e)}function hv(t,e){let r=ce.statSync(t);return ov(e,r.atime,r.mtime)}function pv(t,e,r,i,n){return e?Fc(r,i,n):mv(t.mode,r,i,n)}function mv(t,e,r,i){return ce.mkdirSync(r),Fc(e,r,i),Xn(r,t)}function Fc(t,e,r){let i=ce.opendirSync(t);try{let n;for(;(n=i.readSync())!==null;)fv(n.name,t,e,r);}finally{i.closeSync();}}function fv(t,e,r,i){let n=ur.join(e,t),o=ur.join(r,t);if(i.filter&&!i.filter(n,o))return;let{destStat:s}=hr.checkPathsSync(n,o,"copy",i);return Rc(s,n,o,i)}function gv(t,e,r,i){let n=ce.readlinkSync(e);if(i.dereference&&(n=ur.resolve(process.cwd(),n)),t){let o;try{o=ce.readlinkSync(r);}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return ce.symlinkSync(n,r);throw s}if(i.dereference&&(o=ur.resolve(process.cwd(),o)),n!==o){if(hr.isSrcSubdir(n,o))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${o}'.`);if(hr.isSrcSubdir(o,n))throw new Error(`Cannot overwrite '${o}' with '${n}'.`)}return bv(n,r)}else return ce.symlinkSync(n,r)}function bv(t,e){return ce.unlinkSync(e),ce.symlinkSync(t,e)}jc.exports=sv;});var ti=g((ID,qc)=>{var yv=ee().fromPromise;qc.exports={copy:yv($c()),copySync:Nc()};});var pr=g(($D,Bc)=>{var Lc=Mt(),wv=ee().fromCallback;function vv(t,e){Lc.rm(t,{recursive:true,force:true},e);}function xv(t){Lc.rmSync(t,{recursive:true,force:true});}Bc.exports={remove:wv(vv),removeSync:xv};});var Jc=g((RD,Yc)=>{var Sv=ee().fromPromise,Gc=ae(),Vc=F("path"),Wc=ye(),Hc=pr(),Uc=Sv(async function(e){let r;try{r=await Gc.readdir(e);}catch{return Wc.mkdirs(e)}return Promise.all(r.map(i=>Hc.remove(Vc.join(e,i))))});function zc(t){let e;try{e=Gc.readdirSync(t);}catch{return Wc.mkdirsSync(t)}e.forEach(r=>{r=Vc.join(t,r),Hc.removeSync(r);});}Yc.exports={emptyDirSync:zc,emptydirSync:zc,emptyDir:Uc,emptydir:Uc};});var Qc=g((MD,Zc)=>{var kv=ee().fromPromise,Kc=F("path"),Ne=ae(),Xc=ye();async function Cv(t){let e;try{e=await Ne.stat(t);}catch{}if(e&&e.isFile())return;let r=Kc.dirname(t),i=null;try{i=await Ne.stat(r);}catch(n){if(n.code==="ENOENT"){await Xc.mkdirs(r),await Ne.writeFile(t,"");return}else throw n}i.isDirectory()?await Ne.writeFile(t,""):await Ne.readdir(r);}function Ov(t){let e;try{e=Ne.statSync(t);}catch{}if(e&&e.isFile())return;let r=Kc.dirname(t);try{Ne.statSync(r).isDirectory()||Ne.readdirSync(r);}catch(i){if(i&&i.code==="ENOENT")Xc.mkdirsSync(r);else throw i}Ne.writeFileSync(t,"");}Zc.exports={createFile:kv(Cv),createFileSync:Ov};});var nl=g((FD,il)=>{var Ev=ee().fromPromise,el=F("path"),it=ae(),tl=ye(),{pathExists:Tv}=rt(),{areIdentical:rl}=bt();async function Av(t,e){let r;try{r=await it.lstat(e,{bigint:!0});}catch{}let i;try{i=await it.lstat(t,{bigint:!0});}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}if(r&&rl(i,r))return;let n=el.dirname(e);await Tv(n)||await tl.mkdirs(n),await it.link(t,e);}function _v(t,e){let r;try{r=it.lstatSync(e,{bigint:!0});}catch{}try{let o=it.lstatSync(t,{bigint:!0});if(r&&rl(o,r))return}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let i=el.dirname(e);return it.existsSync(i)||tl.mkdirsSync(i),it.linkSync(t,e)}il.exports={createLink:Ev(Av),createLinkSync:_v};});var sl=g((jD,ol)=>{var nt=F("path"),mr=ae(),{pathExists:Pv}=rt(),Dv=ee().fromPromise;async function Iv(t,e){if(nt.isAbsolute(t)){try{await mr.lstat(t);}catch(o){throw o.message=o.message.replace("lstat","ensureSymlink"),o}return {toCwd:t,toDst:t}}let r=nt.dirname(e),i=nt.join(r,t);if(await Pv(i))return {toCwd:i,toDst:t};try{await mr.lstat(t);}catch(o){throw o.message=o.message.replace("lstat","ensureSymlink"),o}return {toCwd:t,toDst:nt.relative(r,t)}}function $v(t,e){if(nt.isAbsolute(t)){if(!mr.existsSync(t))throw new Error("absolute srcpath does not exist");return {toCwd:t,toDst:t}}let r=nt.dirname(e),i=nt.join(r,t);if(mr.existsSync(i))return {toCwd:i,toDst:t};if(!mr.existsSync(t))throw new Error("relative srcpath does not exist");return {toCwd:t,toDst:nt.relative(r,t)}}ol.exports={symlinkPaths:Dv(Iv),symlinkPathsSync:$v};});var ll=g((ND,cl)=>{var al=ae(),Rv=ee().fromPromise;async function Mv(t,e){if(e)return e;let r;try{r=await al.lstat(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}function Fv(t,e){if(e)return e;let r;try{r=al.lstatSync(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}cl.exports={symlinkType:Rv(Mv),symlinkTypeSync:Fv};});var hl=g((qD,ul)=>{var jv=ee().fromPromise,ot=F("path"),de=ae(),{mkdirs:Nv,mkdirsSync:qv}=ye(),{symlinkPaths:Lv,symlinkPathsSync:Bv}=sl(),{symlinkType:Uv,symlinkTypeSync:zv}=ll(),{pathExists:Gv}=rt(),{areIdentical:dl}=bt();async function Vv(t,e,r){let i;try{i=await de.lstat(e);}catch{}if(i&&i.isSymbolicLink()){let a;if(ot.isAbsolute(t))a=await de.stat(t,{bigint:true});else {let d=ot.dirname(e),l=ot.join(d,t);try{a=await de.stat(l,{bigint:!0});}catch{a=await de.stat(t,{bigint:true});}}let c=await de.stat(e,{bigint:true});if(dl(a,c))return}let n=await Lv(t,e);t=n.toDst;let o=await Uv(n.toCwd,r),s=ot.dirname(e);return await Gv(s)||await Nv(s),de.symlink(t,e,o)}function Wv(t,e,r){let i;try{i=de.lstatSync(e);}catch{}if(i&&i.isSymbolicLink()){let a;if(ot.isAbsolute(t))a=de.statSync(t,{bigint:true});else {let d=ot.dirname(e),l=ot.join(d,t);try{a=de.statSync(l,{bigint:!0});}catch{a=de.statSync(t,{bigint:true});}}let c=de.statSync(e,{bigint:true});if(dl(a,c))return}let n=Bv(t,e);t=n.toDst,r=zv(n.toCwd,r);let o=ot.dirname(e);return de.existsSync(o)||qv(o),de.symlinkSync(t,e,r)}ul.exports={createSymlink:jv(Vv),createSymlinkSync:Wv};});var vl=g((LD,wl)=>{var{createFile:pl,createFileSync:ml}=Qc(),{createLink:fl,createLinkSync:gl}=nl(),{createSymlink:bl,createSymlinkSync:yl}=hl();wl.exports={createFile:pl,createFileSync:ml,ensureFile:pl,ensureFileSync:ml,createLink:fl,createLinkSync:gl,ensureLink:fl,ensureLinkSync:gl,createSymlink:bl,createSymlinkSync:yl,ensureSymlink:bl,ensureSymlinkSync:yl};});var ri=g((BD,xl)=>{function Hv(t,{EOL:e=`
8
+ `,finalEOL:r=true,replacer:i=null,spaces:n}={}){let o=r?e:"",s=JSON.stringify(t,i,n);if(s===void 0)throw new TypeError(`Converting ${typeof t} value to JSON is not supported`);return s.replace(/\n/g,e)+o}function Yv(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}xl.exports={stringify:Hv,stripBom:Yv};});var Ol=g((UD,Cl)=>{var Nt;try{Nt=Mt();}catch{Nt=F("fs");}var ii=ee(),{stringify:Sl,stripBom:kl}=ri();async function Jv(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Nt,i="throws"in e?e.throws:true,n=await ii.fromCallback(r.readFile)(t,e);n=kl(n);let o;try{o=JSON.parse(n,e?e.reviver:null);}catch(s){if(i)throw s.message=`${t}: ${s.message}`,s;return null}return o}var Kv=ii.fromPromise(Jv);function Xv(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Nt,i="throws"in e?e.throws:true;try{let n=r.readFileSync(t,e);return n=kl(n),JSON.parse(n,e.reviver)}catch(n){if(i)throw n.message=`${t}: ${n.message}`,n;return null}}async function Zv(t,e,r={}){let i=r.fs||Nt,n=Sl(e,r);await ii.fromCallback(i.writeFile)(t,n,r);}var Qv=ii.fromPromise(Zv);function ex(t,e,r={}){let i=r.fs||Nt,n=Sl(e,r);return i.writeFileSync(t,n,r)}Cl.exports={readFile:Kv,readFileSync:Xv,writeFile:Qv,writeFileSync:ex};});var Tl=g((zD,El)=>{var ni=Ol();El.exports={readJson:ni.readFile,readJsonSync:ni.readFileSync,writeJson:ni.writeFile,writeJsonSync:ni.writeFileSync};});var oi=g((GD,Pl)=>{var tx=ee().fromPromise,Zn=ae(),Al=F("path"),_l=ye(),rx=rt().pathExists;async function ix(t,e,r="utf-8"){let i=Al.dirname(t);return await rx(i)||await _l.mkdirs(i),Zn.writeFile(t,e,r)}function nx(t,...e){let r=Al.dirname(t);Zn.existsSync(r)||_l.mkdirsSync(r),Zn.writeFileSync(t,...e);}Pl.exports={outputFile:tx(ix),outputFileSync:nx};});var Il=g((VD,Dl)=>{var{stringify:ox}=ri(),{outputFile:sx}=oi();async function ax(t,e,r={}){let i=ox(e,r);await sx(t,i,r);}Dl.exports=ax;});var Rl=g((WD,$l)=>{var{stringify:cx}=ri(),{outputFileSync:lx}=oi();function dx(t,e,r){let i=cx(e,r);lx(t,i,r);}$l.exports=dx;});var Fl=g((HD,Ml)=>{var ux=ee().fromPromise,le=Tl();le.outputJson=ux(Il());le.outputJsonSync=Rl();le.outputJSON=le.outputJson;le.outputJSONSync=le.outputJsonSync;le.writeJSON=le.writeJson;le.writeJSONSync=le.writeJsonSync;le.readJSON=le.readJson;le.readJSONSync=le.readJsonSync;Ml.exports=le;});var Bl=g((YD,Ll)=>{var hx=ae(),jl=F("path"),{copy:px}=ti(),{remove:ql}=pr(),{mkdirp:mx}=ye(),{pathExists:fx}=rt(),Nl=bt();async function gx(t,e,r={}){let i=r.overwrite||r.clobber||false,{srcStat:n,isChangingCase:o=false}=await Nl.checkPaths(t,e,"move",r);await Nl.checkParentPaths(t,n,e,"move");let s=jl.dirname(e);return jl.parse(s).root!==s&&await mx(s),bx(t,e,i,o)}async function bx(t,e,r,i){if(!i){if(r)await ql(e);else if(await fx(e))throw new Error("dest already exists.")}try{await hx.rename(t,e);}catch(n){if(n.code!=="EXDEV")throw n;await yx(t,e,r);}}async function yx(t,e,r){return await px(t,e,{overwrite:r,errorOnExist:true,preserveTimestamps:true}),ql(t)}Ll.exports=gx;});var Wl=g((JD,Vl)=>{var zl=Mt(),eo=F("path"),wx=ti().copySync,Gl=pr().removeSync,vx=ye().mkdirpSync,Ul=bt();function xx(t,e,r){r=r||{};let i=r.overwrite||r.clobber||false,{srcStat:n,isChangingCase:o=false}=Ul.checkPathsSync(t,e,"move",r);return Ul.checkParentPathsSync(t,n,e,"move"),Sx(e)||vx(eo.dirname(e)),kx(t,e,i,o)}function Sx(t){let e=eo.dirname(t);return eo.parse(e).root===e}function kx(t,e,r,i){if(i)return Qn(t,e,r);if(r)return Gl(e),Qn(t,e,r);if(zl.existsSync(e))throw new Error("dest already exists.");return Qn(t,e,r)}function Qn(t,e,r){try{zl.renameSync(t,e);}catch(i){if(i.code!=="EXDEV")throw i;return Cx(t,e,r)}}function Cx(t,e,r){return wx(t,e,{overwrite:r,errorOnExist:true,preserveTimestamps:true}),Gl(t)}Vl.exports=xx;});var Yl=g((KD,Hl)=>{var Ox=ee().fromPromise;Hl.exports={move:Ox(Bl()),moveSync:Wl()};});var qe=g((XD,Jl)=>{Jl.exports={...ae(),...ti(),...Jc(),...vl(),...Fl(),...ye(),...Yl(),...oi(),...rt(),...pr()};});var Y=g((ZD,Xl)=>{var{FORCE_COLOR:Ex,NODE_DISABLE_COLORS:Tx,TERM:Ax}=process.env,N={enabled:!Tx&&Ax!=="dumb"&&Ex!=="0",reset:U(0,0),bold:U(1,22),dim:U(2,22),italic:U(3,23),underline:U(4,24),inverse:U(7,27),hidden:U(8,28),strikethrough:U(9,29),black:U(30,39),red:U(31,39),green:U(32,39),yellow:U(33,39),blue:U(34,39),magenta:U(35,39),cyan:U(36,39),white:U(37,39),gray:U(90,39),grey:U(90,39),bgBlack:U(40,49),bgRed:U(41,49),bgGreen:U(42,49),bgYellow:U(43,49),bgBlue:U(44,49),bgMagenta:U(45,49),bgCyan:U(46,49),bgWhite:U(47,49)};function Kl(t,e){let r=0,i,n="",o="";for(;r<t.length;r++)i=t[r],n+=i.open,o+=i.close,e.includes(i.close)&&(e=e.replace(i.rgx,i.close+i.open));return n+e+o}function _x(t,e){let r={has:t,keys:e};return r.reset=N.reset.bind(r),r.bold=N.bold.bind(r),r.dim=N.dim.bind(r),r.italic=N.italic.bind(r),r.underline=N.underline.bind(r),r.inverse=N.inverse.bind(r),r.hidden=N.hidden.bind(r),r.strikethrough=N.strikethrough.bind(r),r.black=N.black.bind(r),r.red=N.red.bind(r),r.green=N.green.bind(r),r.yellow=N.yellow.bind(r),r.blue=N.blue.bind(r),r.magenta=N.magenta.bind(r),r.cyan=N.cyan.bind(r),r.white=N.white.bind(r),r.gray=N.gray.bind(r),r.grey=N.grey.bind(r),r.bgBlack=N.bgBlack.bind(r),r.bgRed=N.bgRed.bind(r),r.bgGreen=N.bgGreen.bind(r),r.bgYellow=N.bgYellow.bind(r),r.bgBlue=N.bgBlue.bind(r),r.bgMagenta=N.bgMagenta.bind(r),r.bgCyan=N.bgCyan.bind(r),r.bgWhite=N.bgWhite.bind(r),r}function U(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),i===void 0?this:N.enabled?Kl(this.keys,i+""):i+""):i===void 0?_x([t],[r]):N.enabled?Kl([r],i+""):i+""}}Xl.exports=N;});var Ql=g((QD,Zl)=>{Zl.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return "first";if(t.name==="c"||t.name==="d")return "abort";if(t.name==="e")return "last";if(t.name==="g")return "reset"}if(e){if(t.name==="j")return "down";if(t.name==="k")return "up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":false}};});var si=g((eI,ed)=>{ed.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t};});var J=g((tI,td)=>{var to={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Px={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Dx={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?to.up():"");return t&&(e+=to.left),e}};td.exports={cursor:to,scroll:Px,erase:Dx,beep:"\x07"};});var sd=g((rI,od)=>{function Ix(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=$x(t))||e){r&&(t=r);var i=0,n=function(){};return {s:n,n:function(){return i>=t.length?{done:true}:{done:false,value:t[i++]}},e:function(d){throw d},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
9
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=true,s=false,a;return {s:function(){r=r.call(t);},n:function(){var d=r.next();return o=d.done,d},e:function(d){s=true,a=d;},f:function(){try{!o&&r.return!=null&&r.return();}finally{if(s)throw a}}}}function $x(t,e){if(t){if(typeof t=="string")return rd(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rd(t,e)}}function rd(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}var Rx=si(),nd=J(),id=nd.erase,Mx=nd.cursor,Fx=t=>[...Rx(t)].length;od.exports=function(t,e){if(!e)return id.line+Mx.to(0);let r=0,i=t.split(/\r?\n/);var n=Ix(i),o;try{for(n.s();!(o=n.n()).done;){let s=o.value;r+=1+Math.floor(Math.max(Fx(s)-1,0)/e);}}catch(s){n.e(s);}finally{n.f();}return id.lines(r)};});var ro=g((iI,ad)=>{var fr={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},jx={arrowUp:fr.arrowUp,arrowDown:fr.arrowDown,arrowLeft:fr.arrowLeft,arrowRight:fr.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Nx=process.platform==="win32"?jx:fr;ad.exports=Nx;});var ld=g((nI,cd)=>{var qt=Y(),yt=ro(),io=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),qx=t=>io[t]||io.default,gr=Object.freeze({aborted:qt.red(yt.cross),done:qt.green(yt.tick),exited:qt.yellow(yt.cross),default:qt.cyan("?")}),Lx=(t,e,r)=>e?gr.aborted:r?gr.exited:t?gr.done:gr.default,Bx=t=>qt.gray(t?yt.ellipsis:yt.pointerSmall),Ux=(t,e)=>qt.gray(t?e?yt.pointerSmall:"+":yt.line);cd.exports={styles:io,render:qx,symbols:gr,symbol:Lx,delimiter:Bx,item:Ux};});var ud=g((oI,dd)=>{var zx=si();dd.exports=function(t,e){let r=String(zx(t)||"").split(/\r?\n/);return e?r.map(i=>Math.ceil(i.length/e)).reduce((i,n)=>i+n):r.length};});var pd=g((sI,hd)=>{hd.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return (t||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=i||o[o.length-1].length+s.length+1<i?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
10
10
  `)).join(`
11
- `)};});var dd=g((QP,ld)=>{ld.exports=(t,e,r)=>{r=r||e;let i=Math.min(e-r,t-Math.floor(r/2));i<0&&(i=0);let n=Math.min(i+r,e);return {startIndex:i,endIndex:n}};});var ye=g((eI,ud)=>{ud.exports={action:Yl(),clear:td(),style:nd(),strip:ii(),figures:eo(),lines:sd(),wrap:cd(),entriesToDisplay:dd()};});var Le=g((tI,md)=>{var hd=F("readline"),jx=ye(),Nx=jx.action,Lx=F("events"),pd=Y(),qx=pd.beep,Bx=pd.cursor,Ux=H(),ro=class extends Lx{constructor(e={}){super(),this.firstRender=true,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=hd.createInterface({input:this.in,escapeCodeTimeout:50});hd.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(true);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(o,s)=>{let a=Nx(s,i);a===false?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell();};this.close=()=>{this.out.write(Bx.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(false),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=true;},this.in.on("keypress",n);}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited});}bell(){this.out.write(qx);}render(){this.onRender(Ux),this.firstRender&&(this.firstRender=false);}};md.exports=ro;});var wd=g((rI,yd)=>{function fd(t,e,r,i,n,o,s){try{var a=t[o](s),c=a.value;}catch(d){r(d);return}a.done?e(c):Promise.resolve(c).then(i,n);}function gd(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var o=t.apply(e,r);function s(c){fd(o,i,n,s,a,"next",c);}function a(c){fd(o,i,n,s,a,"throw",c);}s(void 0);})}}var ni=H(),zx=Le(),bd=Y(),Gx=bd.erase,mr=bd.cursor,oi=ye(),io=oi.style,no=oi.clear,Vx=oi.lines,Wx=oi.figures,oo=class extends zx{constructor(e={}){super(e),this.transform=io.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>true),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=no("",this.out.columns),this.render();}set value(e){!e&&this.initial?(this.placeholder=true,this.rendered=ni.gray(this.transform.render(this.initial))):(this.placeholder=false,this.rendered=this.transform.render(e)),this._value=e,this.fire();}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render();}exit(){this.abort();}abort(){this.value=this.value||this.initial,this.done=this.aborted=true,this.error=false,this.red=false,this.fire(),this.render(),this.out.write(`
12
- `),this.close();}validate(){var e=this;return gd(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=false),e.error=!r;})()}submit(){var e=this;return gd(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=true,e.fire(),e.render();return}e.done=true,e.aborted=false,e.fire(),e.render(),e.out.write(`
13
- `),e.close();})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render();}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e);}_(e,r){let i=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.value=`${i}${e}${n}`,this.red=false,this.cursor=this.placeholder?0:i.length+1,this.render();}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=false,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=false,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render();}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length,this.render();}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render();}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render();}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(mr.down(Vx(this.outputError,this.out.columns)-1)+no(this.outputError,this.out.columns)),this.out.write(no(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[io.symbol(this.done,this.aborted),ni.bold(this.msg),io.delimiter(this.done),this.red?ni.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
11
+ `)};});var fd=g((aI,md)=>{md.exports=(t,e,r)=>{r=r||e;let i=Math.min(e-r,t-Math.floor(r/2));i<0&&(i=0);let n=Math.min(i+r,e);return {startIndex:i,endIndex:n}};});var we=g((cI,gd)=>{gd.exports={action:Ql(),clear:sd(),style:ld(),strip:si(),figures:ro(),lines:ud(),wrap:pd(),entriesToDisplay:fd()};});var Le=g((lI,wd)=>{var bd=F("readline"),Gx=we(),Vx=Gx.action,Wx=F("events"),yd=J(),Hx=yd.beep,Yx=yd.cursor,Jx=Y(),no=class extends Wx{constructor(e={}){super(),this.firstRender=true,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=bd.createInterface({input:this.in,escapeCodeTimeout:50});bd.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(true);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(o,s)=>{let a=Vx(s,i);a===false?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell();};this.close=()=>{this.out.write(Yx.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(false),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=true;},this.in.on("keypress",n);}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited});}bell(){this.out.write(Hx);}render(){this.onRender(Jx),this.firstRender&&(this.firstRender=false);}};wd.exports=no;});var Cd=g((dI,kd)=>{function vd(t,e,r,i,n,o,s){try{var a=t[o](s),c=a.value;}catch(d){r(d);return}a.done?e(c):Promise.resolve(c).then(i,n);}function xd(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var o=t.apply(e,r);function s(c){vd(o,i,n,s,a,"next",c);}function a(c){vd(o,i,n,s,a,"throw",c);}s(void 0);})}}var ai=Y(),Kx=Le(),Sd=J(),Xx=Sd.erase,br=Sd.cursor,ci=we(),oo=ci.style,so=ci.clear,Zx=ci.lines,Qx=ci.figures,ao=class extends Kx{constructor(e={}){super(e),this.transform=oo.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>true),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=so("",this.out.columns),this.render();}set value(e){!e&&this.initial?(this.placeholder=true,this.rendered=ai.gray(this.transform.render(this.initial))):(this.placeholder=false,this.rendered=this.transform.render(e)),this._value=e,this.fire();}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render();}exit(){this.abort();}abort(){this.value=this.value||this.initial,this.done=this.aborted=true,this.error=false,this.red=false,this.fire(),this.render(),this.out.write(`
12
+ `),this.close();}validate(){var e=this;return xd(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=false),e.error=!r;})()}submit(){var e=this;return xd(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=true,e.fire(),e.render();return}e.done=true,e.aborted=false,e.fire(),e.render(),e.out.write(`
13
+ `),e.close();})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render();}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e);}_(e,r){let i=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.value=`${i}${e}${n}`,this.red=false,this.cursor=this.placeholder?0:i.length+1,this.render();}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=false,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=false,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render();}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length,this.render();}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render();}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render();}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(br.down(Zx(this.outputError,this.out.columns)-1)+so(this.outputError,this.out.columns)),this.out.write(so(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[oo.symbol(this.done,this.aborted),ai.bold(this.msg),oo.delimiter(this.done),this.red?ai.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
14
14
  `).reduce((e,r,i)=>e+`
15
- ${i?" ":Wx.pointerSmall} ${ni.red().italic(r)}`,"")),this.out.write(Gx.line+mr.to(0)+this.outputText+mr.save+this.outputError+mr.restore+mr.move(this.cursorOffset,0)));}};yd.exports=oo;});var kd=g((iI,Sd)=>{var qe=H(),Hx=Le(),fr=ye(),vd=fr.style,xd=fr.clear,si=fr.figures,Yx=fr.wrap,Jx=fr.entriesToDisplay,Kx=Y(),Xx=Kx.cursor,so=class extends Hx{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=xd("",this.out.columns),this.render();}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire();}reset(){this.moveCursor(0),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
15
+ ${i?" ":Qx.pointerSmall} ${ai.red().italic(r)}`,"")),this.out.write(Xx.line+br.to(0)+this.outputText+br.save+this.outputError+br.restore+br.move(this.cursorOffset,0)));}};kd.exports=ao;});var Ad=g((uI,Td)=>{var Be=Y(),eS=Le(),yr=we(),Od=yr.style,Ed=yr.clear,li=yr.figures,tS=yr.wrap,rS=yr.entriesToDisplay,iS=J(),nS=iS.cursor,co=class extends eS{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=Ed("",this.out.columns),this.render();}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire();}reset(){this.moveCursor(0),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
16
16
  `),this.close();}submit(){this.selection.disabled?this.bell():(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
17
- `),this.close());}first(){this.moveCursor(0),this.render();}last(){this.moveCursor(this.choices.length-1),this.render();}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render();}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render();}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render();}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Xx.hide):this.out.write(xd(this.outputText,this.out.columns)),super.render();let e=Jx(this.cursor,this.choices.length,this.optionsPerPage),r=e.startIndex,i=e.endIndex;if(this.outputText=[vd.symbol(this.done,this.aborted),qe.bold(this.msg),vd.delimiter(false),this.done?this.selection.title:this.selection.disabled?qe.yellow(this.warn):qe.gray(this.hint)].join(" "),!this.done){this.outputText+=`
18
- `;for(let n=r;n<i;n++){let o,s,a="",c=this.choices[n];n===r&&r>0?s=si.arrowUp:n===i-1&&i<this.choices.length?s=si.arrowDown:s=" ",c.disabled?(o=this.cursor===n?qe.gray().underline(c.title):qe.strikethrough().gray(c.title),s=(this.cursor===n?qe.bold().gray(si.pointer)+" ":" ")+s):(o=this.cursor===n?qe.cyan().underline(c.title):c.title,s=(this.cursor===n?qe.cyan(si.pointer)+" ":" ")+s,c.description&&this.cursor===n&&(a=` - ${c.description}`,(s.length+o.length+a.length>=this.out.columns||c.description.split(/\r?\n/).length>1)&&(a=`
19
- `+Yx(c.description,{margin:3,width:this.out.columns})))),this.outputText+=`${s} ${o}${qe.gray(a)}
20
- `;}}this.out.write(this.outputText);}};Sd.exports=so;});var _d=g((nI,Ad)=>{var ai=H(),Zx=Le(),Ed=ye(),Cd=Ed.style,Qx=Ed.clear,Td=Y(),Od=Td.cursor,eS=Td.erase,ao=class extends Zx{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
17
+ `),this.close());}first(){this.moveCursor(0),this.render();}last(){this.moveCursor(this.choices.length-1),this.render();}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render();}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render();}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render();}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(nS.hide):this.out.write(Ed(this.outputText,this.out.columns)),super.render();let e=rS(this.cursor,this.choices.length,this.optionsPerPage),r=e.startIndex,i=e.endIndex;if(this.outputText=[Od.symbol(this.done,this.aborted),Be.bold(this.msg),Od.delimiter(false),this.done?this.selection.title:this.selection.disabled?Be.yellow(this.warn):Be.gray(this.hint)].join(" "),!this.done){this.outputText+=`
18
+ `;for(let n=r;n<i;n++){let o,s,a="",c=this.choices[n];n===r&&r>0?s=li.arrowUp:n===i-1&&i<this.choices.length?s=li.arrowDown:s=" ",c.disabled?(o=this.cursor===n?Be.gray().underline(c.title):Be.strikethrough().gray(c.title),s=(this.cursor===n?Be.bold().gray(li.pointer)+" ":" ")+s):(o=this.cursor===n?Be.cyan().underline(c.title):c.title,s=(this.cursor===n?Be.cyan(li.pointer)+" ":" ")+s,c.description&&this.cursor===n&&(a=` - ${c.description}`,(s.length+o.length+a.length>=this.out.columns||c.description.split(/\r?\n/).length>1)&&(a=`
19
+ `+tS(c.description,{margin:3,width:this.out.columns})))),this.outputText+=`${s} ${o}${Be.gray(a)}
20
+ `;}}this.out.write(this.outputText);}};Td.exports=co;});var Rd=g((hI,$d)=>{var di=Y(),oS=Le(),Dd=we(),_d=Dd.style,sS=Dd.clear,Id=J(),Pd=Id.cursor,aS=Id.erase,lo=class extends oS{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
21
21
  `),this.close();}submit(){this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
22
- `),this.close();}deactivate(){if(this.value===false)return this.bell();this.value=false,this.render();}activate(){if(this.value===true)return this.bell();this.value=true,this.render();}delete(){this.deactivate();}left(){this.deactivate();}right(){this.activate();}down(){this.deactivate();}up(){this.activate();}next(){this.value=!this.value,this.fire(),this.render();}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=true;else if(e==="0")this.value=false;else return this.bell();this.render();}render(){this.closed||(this.firstRender?this.out.write(Od.hide):this.out.write(Qx(this.outputText,this.out.columns)),super.render(),this.outputText=[Cd.symbol(this.done,this.aborted),ai.bold(this.msg),Cd.delimiter(this.done),this.value?this.inactive:ai.cyan().underline(this.inactive),ai.gray("/"),this.value?ai.cyan().underline(this.active):this.active].join(" "),this.out.write(eS.line+Od.to(0)+this.outputText));}};Ad.exports=ao;});var Oe=g((oI,Dd)=>{var co=class t{constructor({token:e,date:r,parts:i,locales:n}){this.token=e,this.date=r||new Date,this.parts=i||[this],this.locales=n||{};}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,i)=>i>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((i,n)=>n>r&&i instanceof t)}toString(){return String(this.date)}};Dd.exports=co;});var Id=g((sI,Pd)=>{var tS=Oe(),lo=class extends tS{constructor(e={}){super(e);}up(){this.date.setHours((this.date.getHours()+12)%24);}down(){this.up();}toString(){let e=this.date.getHours()>12?"pm":"am";return /\A/.test(this.token)?e.toUpperCase():e}};Pd.exports=lo;});var Rd=g((aI,$d)=>{var rS=Oe(),iS=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),uo=class extends rS{constructor(e={}){super(e);}up(){this.date.setDate(this.date.getDate()+1);}down(){this.date.setDate(this.date.getDate()-1);}setTo(e){this.date.setDate(parseInt(e.substr(-2)));}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+iS(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};$d.exports=uo;});var Fd=g((cI,Md)=>{var nS=Oe(),ho=class extends nS{constructor(e={}){super(e);}up(){this.date.setHours(this.date.getHours()+1);}down(){this.date.setHours(this.date.getHours()-1);}setTo(e){this.date.setHours(parseInt(e.substr(-2)));}toString(){let e=this.date.getHours();return /h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};Md.exports=ho;});var Nd=g((lI,jd)=>{var oS=Oe(),po=class extends oS{constructor(e={}){super(e);}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1);}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1);}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)));}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};jd.exports=po;});var qd=g((dI,Ld)=>{var sS=Oe(),mo=class extends sS{constructor(e={}){super(e);}up(){this.date.setMinutes(this.date.getMinutes()+1);}down(){this.date.setMinutes(this.date.getMinutes()-1);}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)));}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Ld.exports=mo;});var Ud=g((uI,Bd)=>{var aS=Oe(),fo=class extends aS{constructor(e={}){super(e);}up(){this.date.setMonth(this.date.getMonth()+1);}down(){this.date.setMonth(this.date.getMonth()-1);}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e);}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};Bd.exports=fo;});var Gd=g((hI,zd)=>{var cS=Oe(),go=class extends cS{constructor(e={}){super(e);}up(){this.date.setSeconds(this.date.getSeconds()+1);}down(){this.date.setSeconds(this.date.getSeconds()-1);}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)));}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};zd.exports=go;});var Wd=g((pI,Vd)=>{var lS=Oe(),bo=class extends lS{constructor(e={}){super(e);}up(){this.date.setFullYear(this.date.getFullYear()+1);}down(){this.date.setFullYear(this.date.getFullYear()-1);}setTo(e){this.date.setFullYear(e.substr(-4));}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Vd.exports=bo;});var Yd=g((mI,Hd)=>{Hd.exports={DatePart:Oe(),Meridiem:Id(),Day:Rd(),Hours:Fd(),Milliseconds:Nd(),Minutes:qd(),Month:Ud(),Seconds:Gd(),Year:Wd()};});var nu=g((fI,iu)=>{function Jd(t,e,r,i,n,o,s){try{var a=t[o](s),c=a.value;}catch(d){r(d);return}a.done?e(c):Promise.resolve(c).then(i,n);}function Kd(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var o=t.apply(e,r);function s(c){Jd(o,i,n,s,a,"next",c);}function a(c){Jd(o,i,n,s,a,"throw",c);}s(void 0);})}}var yo=H(),dS=Le(),vo=ye(),Xd=vo.style,Zd=vo.clear,uS=vo.figures,ru=Y(),hS=ru.erase,Qd=ru.cursor,Be=Yd(),eu=Be.DatePart,pS=Be.Meridiem,mS=Be.Day,fS=Be.Hours,gS=Be.Milliseconds,bS=Be.Minutes,yS=Be.Month,wS=Be.Seconds,vS=Be.Year,xS=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,tu={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new mS(t),3:t=>new yS(t),4:t=>new vS(t),5:t=>new pS(t),6:t=>new fS(t),7:t=>new bS(t),8:t=>new wS(t),9:t=>new gS(t)},SS={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},wo=class extends dS{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(SS,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Zd("",this.out.columns),this.render();}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime());}set mask(e){let r;for(this.parts=[];r=xS.exec(e);){let n=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in tu?tu[o]({token:r[o]||n,date:this.date,parts:this.parts,locales:this.locales}):r[o]||n);}let i=this.parts.reduce((n,o)=>(typeof o=="string"&&typeof n[n.length-1]=="string"?n[n.length-1]+=o:n.push(o),n),[]);this.parts.splice(0),this.parts.push(...i),this.reset();}moveCursor(e){this.typed="",this.cursor=e,this.fire();}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof eu)),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
23
- `),this.close();}validate(){var e=this;return Kd(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=false),e.error=!r;})()}submit(){var e=this;return Kd(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=true,e.aborted=false,e.fire(),e.render(),e.out.write(`
24
- `),e.close();})()}up(){this.typed="",this.parts[this.cursor].up(),this.render();}down(){this.typed="",this.parts[this.cursor].down(),this.render();}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof eu)),this.render();}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render());}render(){this.closed||(this.firstRender?this.out.write(Qd.hide):this.out.write(Zd(this.outputText,this.out.columns)),super.render(),this.outputText=[Xd.symbol(this.done,this.aborted),yo.bold(this.msg),Xd.delimiter(false),this.parts.reduce((e,r,i)=>e.concat(i===this.cursor&&!this.done?yo.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
22
+ `),this.close();}deactivate(){if(this.value===false)return this.bell();this.value=false,this.render();}activate(){if(this.value===true)return this.bell();this.value=true,this.render();}delete(){this.deactivate();}left(){this.deactivate();}right(){this.activate();}down(){this.deactivate();}up(){this.activate();}next(){this.value=!this.value,this.fire(),this.render();}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=true;else if(e==="0")this.value=false;else return this.bell();this.render();}render(){this.closed||(this.firstRender?this.out.write(Pd.hide):this.out.write(sS(this.outputText,this.out.columns)),super.render(),this.outputText=[_d.symbol(this.done,this.aborted),di.bold(this.msg),_d.delimiter(this.done),this.value?this.inactive:di.cyan().underline(this.inactive),di.gray("/"),this.value?di.cyan().underline(this.active):this.active].join(" "),this.out.write(aS.line+Pd.to(0)+this.outputText));}};$d.exports=lo;});var Oe=g((pI,Md)=>{var uo=class t{constructor({token:e,date:r,parts:i,locales:n}){this.token=e,this.date=r||new Date,this.parts=i||[this],this.locales=n||{};}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,i)=>i>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((i,n)=>n>r&&i instanceof t)}toString(){return String(this.date)}};Md.exports=uo;});var jd=g((mI,Fd)=>{var cS=Oe(),ho=class extends cS{constructor(e={}){super(e);}up(){this.date.setHours((this.date.getHours()+12)%24);}down(){this.up();}toString(){let e=this.date.getHours()>12?"pm":"am";return /\A/.test(this.token)?e.toUpperCase():e}};Fd.exports=ho;});var qd=g((fI,Nd)=>{var lS=Oe(),dS=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),po=class extends lS{constructor(e={}){super(e);}up(){this.date.setDate(this.date.getDate()+1);}down(){this.date.setDate(this.date.getDate()-1);}setTo(e){this.date.setDate(parseInt(e.substr(-2)));}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+dS(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};Nd.exports=po;});var Bd=g((gI,Ld)=>{var uS=Oe(),mo=class extends uS{constructor(e={}){super(e);}up(){this.date.setHours(this.date.getHours()+1);}down(){this.date.setHours(this.date.getHours()-1);}setTo(e){this.date.setHours(parseInt(e.substr(-2)));}toString(){let e=this.date.getHours();return /h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};Ld.exports=mo;});var zd=g((bI,Ud)=>{var hS=Oe(),fo=class extends hS{constructor(e={}){super(e);}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1);}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1);}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)));}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Ud.exports=fo;});var Vd=g((yI,Gd)=>{var pS=Oe(),go=class extends pS{constructor(e={}){super(e);}up(){this.date.setMinutes(this.date.getMinutes()+1);}down(){this.date.setMinutes(this.date.getMinutes()-1);}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)));}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Gd.exports=go;});var Hd=g((wI,Wd)=>{var mS=Oe(),bo=class extends mS{constructor(e={}){super(e);}up(){this.date.setMonth(this.date.getMonth()+1);}down(){this.date.setMonth(this.date.getMonth()-1);}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e);}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};Wd.exports=bo;});var Jd=g((vI,Yd)=>{var fS=Oe(),yo=class extends fS{constructor(e={}){super(e);}up(){this.date.setSeconds(this.date.getSeconds()+1);}down(){this.date.setSeconds(this.date.getSeconds()-1);}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)));}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Yd.exports=yo;});var Xd=g((xI,Kd)=>{var gS=Oe(),wo=class extends gS{constructor(e={}){super(e);}up(){this.date.setFullYear(this.date.getFullYear()+1);}down(){this.date.setFullYear(this.date.getFullYear()-1);}setTo(e){this.date.setFullYear(e.substr(-4));}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Kd.exports=wo;});var Qd=g((SI,Zd)=>{Zd.exports={DatePart:Oe(),Meridiem:jd(),Day:qd(),Hours:Bd(),Milliseconds:zd(),Minutes:Vd(),Month:Hd(),Seconds:Jd(),Year:Xd()};});var lu=g((kI,cu)=>{function eu(t,e,r,i,n,o,s){try{var a=t[o](s),c=a.value;}catch(d){r(d);return}a.done?e(c):Promise.resolve(c).then(i,n);}function tu(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var o=t.apply(e,r);function s(c){eu(o,i,n,s,a,"next",c);}function a(c){eu(o,i,n,s,a,"throw",c);}s(void 0);})}}var vo=Y(),bS=Le(),So=we(),ru=So.style,iu=So.clear,yS=So.figures,au=J(),wS=au.erase,nu=au.cursor,Ue=Qd(),ou=Ue.DatePart,vS=Ue.Meridiem,xS=Ue.Day,SS=Ue.Hours,kS=Ue.Milliseconds,CS=Ue.Minutes,OS=Ue.Month,ES=Ue.Seconds,TS=Ue.Year,AS=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,su={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new xS(t),3:t=>new OS(t),4:t=>new TS(t),5:t=>new vS(t),6:t=>new SS(t),7:t=>new CS(t),8:t=>new ES(t),9:t=>new kS(t)},_S={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},xo=class extends bS{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(_S,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=iu("",this.out.columns),this.render();}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime());}set mask(e){let r;for(this.parts=[];r=AS.exec(e);){let n=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in su?su[o]({token:r[o]||n,date:this.date,parts:this.parts,locales:this.locales}):r[o]||n);}let i=this.parts.reduce((n,o)=>(typeof o=="string"&&typeof n[n.length-1]=="string"?n[n.length-1]+=o:n.push(o),n),[]);this.parts.splice(0),this.parts.push(...i),this.reset();}moveCursor(e){this.typed="",this.cursor=e,this.fire();}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof ou)),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
23
+ `),this.close();}validate(){var e=this;return tu(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=false),e.error=!r;})()}submit(){var e=this;return tu(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=true,e.aborted=false,e.fire(),e.render(),e.out.write(`
24
+ `),e.close();})()}up(){this.typed="",this.parts[this.cursor].up(),this.render();}down(){this.typed="",this.parts[this.cursor].down(),this.render();}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof ou)),this.render();}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render());}render(){this.closed||(this.firstRender?this.out.write(nu.hide):this.out.write(iu(this.outputText,this.out.columns)),super.render(),this.outputText=[ru.symbol(this.done,this.aborted),vo.bold(this.msg),ru.delimiter(false),this.parts.reduce((e,r,i)=>e.concat(i===this.cursor&&!this.done?vo.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
25
25
  `).reduce((e,r,i)=>e+`
26
- ${i?" ":uS.pointerSmall} ${yo.red().italic(r)}`,"")),this.out.write(hS.line+Qd.to(0)+this.outputText));}};iu.exports=wo;});var uu=g((gI,du)=>{function ou(t,e,r,i,n,o,s){try{var a=t[o](s),c=a.value;}catch(d){r(d);return}a.done?e(c):Promise.resolve(c).then(i,n);}function su(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var o=t.apply(e,r);function s(c){ou(o,i,n,s,a,"next",c);}function a(c){ou(o,i,n,s,a,"throw",c);}s(void 0);})}}var ci=H(),kS=Le(),lu=Y(),li=lu.cursor,CS=lu.erase,di=ye(),xo=di.style,OS=di.figures,au=di.clear,ES=di.lines,TS=/[0-9]/,So=t=>t!==void 0,cu=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},ko=class extends kS{constructor(e={}){super(e),this.transform=xo.render(e.style),this.msg=e.message,this.initial=So(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=So(e.min)?e.min:-1/0,this.max=So(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render();}set value(e){!e&&e!==0?(this.placeholder=true,this.rendered=ci.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=false,this.rendered=this.transform.render(`${cu(e,this.round)}`),this._value=cu(e,this.round)),this.fire();}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||TS.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render();}exit(){this.abort();}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
27
- `),this.close();}validate(){var e=this;return su(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=false),e.error=!r;})()}submit(){var e=this;return su(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let r=e.value;e.value=r!==""?r:e.initial,e.done=true,e.aborted=false,e.error=false,e.fire(),e.render(),e.out.write(`
28
- `),e.close();})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render();}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render();}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render();}next(){this.value=this.initial,this.fire(),this.render();}_(e,r){if(!this.valid(e))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render();}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(li.down(ES(this.outputError,this.out.columns)-1)+au(this.outputError,this.out.columns)),this.out.write(au(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[xo.symbol(this.done,this.aborted),ci.bold(this.msg),xo.delimiter(this.done),!this.done||!this.done&&!this.placeholder?ci[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
26
+ ${i?" ":yS.pointerSmall} ${vo.red().italic(r)}`,"")),this.out.write(wS.line+nu.to(0)+this.outputText));}};cu.exports=xo;});var gu=g((CI,fu)=>{function du(t,e,r,i,n,o,s){try{var a=t[o](s),c=a.value;}catch(d){r(d);return}a.done?e(c):Promise.resolve(c).then(i,n);}function uu(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var o=t.apply(e,r);function s(c){du(o,i,n,s,a,"next",c);}function a(c){du(o,i,n,s,a,"throw",c);}s(void 0);})}}var ui=Y(),PS=Le(),mu=J(),hi=mu.cursor,DS=mu.erase,pi=we(),ko=pi.style,IS=pi.figures,hu=pi.clear,$S=pi.lines,RS=/[0-9]/,Co=t=>t!==void 0,pu=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},Oo=class extends PS{constructor(e={}){super(e),this.transform=ko.render(e.style),this.msg=e.message,this.initial=Co(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=Co(e.min)?e.min:-1/0,this.max=Co(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render();}set value(e){!e&&e!==0?(this.placeholder=true,this.rendered=ui.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=false,this.rendered=this.transform.render(`${pu(e,this.round)}`),this._value=pu(e,this.round)),this.fire();}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||RS.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render();}exit(){this.abort();}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
27
+ `),this.close();}validate(){var e=this;return uu(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=false),e.error=!r;})()}submit(){var e=this;return uu(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let r=e.value;e.value=r!==""?r:e.initial,e.done=true,e.aborted=false,e.error=false,e.fire(),e.render(),e.out.write(`
28
+ `),e.close();})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render();}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render();}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render();}next(){this.value=this.initial,this.fire(),this.render();}_(e,r){if(!this.valid(e))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render();}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(hi.down($S(this.outputError,this.out.columns)-1)+hu(this.outputError,this.out.columns)),this.out.write(hu(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[ko.symbol(this.done,this.aborted),ui.bold(this.msg),ko.delimiter(this.done),!this.done||!this.done&&!this.placeholder?ui[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
29
29
  `).reduce((e,r,i)=>e+`
30
- ${i?" ":OS.pointerSmall} ${ci.red().italic(r)}`,"")),this.out.write(CS.line+li.to(0)+this.outputText+li.save+this.outputError+li.restore));}};du.exports=ko;});var Oo=g((bI,mu)=>{var Ee=H(),AS=Y(),_S=AS.cursor,DS=Le(),gr=ye(),hu=gr.clear,nt=gr.figures,pu=gr.style,PS=gr.wrap,IS=gr.entriesToDisplay,Co=class extends DS{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=false,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=hu("",this.out.columns),e.overrideRender||this.render();}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render();}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
30
+ ${i?" ":IS.pointerSmall} ${ui.red().italic(r)}`,"")),this.out.write(DS.line+hi.to(0)+this.outputText+hi.save+this.outputError+hi.restore));}};fu.exports=Oo;});var To=g((OI,wu)=>{var Ee=Y(),MS=J(),FS=MS.cursor,jS=Le(),wr=we(),bu=wr.clear,st=wr.figures,yu=wr.style,NS=wr.wrap,qS=wr.entriesToDisplay,Eo=class extends jS{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=false,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=bu("",this.out.columns),e.overrideRender||this.render();}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render();}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
31
31
  `),this.close();}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=true,this.render()):(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
32
32
  `),this.close());}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.value.length,this.render();}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render();}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.value[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true,this.render();}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render();}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
33
33
  Instructions:
34
- ${nt.arrowUp}/${nt.arrowDown}: Highlight option
35
- ${nt.arrowLeft}/${nt.arrowRight}/[space]: Toggle selection
34
+ ${st.arrowUp}/${st.arrowDown}: Highlight option
35
+ ${st.arrowLeft}/${st.arrowRight}/[space]: Toggle selection
36
36
  `+(this.maxChoices===void 0?` a: Toggle all
37
- `:"")+" enter/return: Complete answer":""}renderOption(e,r,i,n){let o=(r.selected?Ee.green(nt.radioOn):nt.radioOff)+" "+n+" ",s,a;return r.disabled?s=e===i?Ee.gray().underline(r.title):Ee.strikethrough().gray(r.title):(s=e===i?Ee.cyan().underline(r.title):r.title,e===i&&r.description&&(a=` - ${r.description}`,(o.length+s.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
38
- `+PS(r.description,{margin:o.length,width:this.out.columns})))),o+s+Ee.gray(a||"")}paginateOptions(e){if(e.length===0)return Ee.red("No matches for this query.");let r=IS(this.cursor,e.length,this.optionsPerPage),i=r.startIndex,n=r.endIndex,o,s=[];for(let a=i;a<n;a++)a===i&&i>0?o=nt.arrowUp:a===n-1&&n<e.length?o=nt.arrowDown:o=" ",s.push(this.renderOption(this.cursor,e[a],a,o));return `
37
+ `:"")+" enter/return: Complete answer":""}renderOption(e,r,i,n){let o=(r.selected?Ee.green(st.radioOn):st.radioOff)+" "+n+" ",s,a;return r.disabled?s=e===i?Ee.gray().underline(r.title):Ee.strikethrough().gray(r.title):(s=e===i?Ee.cyan().underline(r.title):r.title,e===i&&r.description&&(a=` - ${r.description}`,(o.length+s.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
38
+ `+NS(r.description,{margin:o.length,width:this.out.columns})))),o+s+Ee.gray(a||"")}paginateOptions(e){if(e.length===0)return Ee.red("No matches for this query.");let r=qS(this.cursor,e.length,this.optionsPerPage),i=r.startIndex,n=r.endIndex,o,s=[];for(let a=i;a<n;a++)a===i&&i>0?o=st.arrowUp:a===n-1&&n<e.length?o=st.arrowDown:o=" ",s.push(this.renderOption(this.cursor,e[a],a,o));return `
39
39
  `+s.join(`
40
- `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Ee.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Ee.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(_S.hide),super.render();let e=[pu.symbol(this.done,this.aborted),Ee.bold(this.msg),pu.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Ee.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=hu(e,this.out.columns);}};mu.exports=Co;});var xu=g((yI,vu)=>{function fu(t,e,r,i,n,o,s){try{var a=t[o](s),c=a.value;}catch(d){r(d);return}a.done?e(c):Promise.resolve(c).then(i,n);}function $S(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var o=t.apply(e,r);function s(c){fu(o,i,n,s,a,"next",c);}function a(c){fu(o,i,n,s,a,"throw",c);}s(void 0);})}}var br=H(),RS=Le(),wu=Y(),MS=wu.erase,gu=wu.cursor,yr=ye(),Eo=yr.style,bu=yr.clear,To=yr.figures,FS=yr.wrap,jS=yr.entriesToDisplay,yu=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),NS=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),LS=(t,e)=>{let r=t.findIndex(i=>i.value===e||i.title===e);return r>-1?r:void 0},Ao=class extends RS{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:LS(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||false,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=Eo.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=bu("",this.out.columns),this.complete(this.render),this.render();}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e;}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=yu(this.suggestions,e):this.value=this.fallback.value,this.fire();}complete(e){var r=this;return $S(function*(){let i=r.completing=r.suggest(r.input,r.choices),n=yield i;if(r.completing!==i)return;r.suggestions=n.map((s,a,c)=>({title:NS(c,a),value:yu(c,a),description:s.description})),r.completing=false;let o=Math.max(n.length-1,0);r.moveSelect(Math.min(o,r.select)),e&&e();})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render();}),this.render();}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
40
+ `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Ee.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Ee.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(FS.hide),super.render();let e=[yu.symbol(this.done,this.aborted),Ee.bold(this.msg),yu.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Ee.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=bu(e,this.out.columns);}};wu.exports=Eo;});var Eu=g((EI,Ou)=>{function vu(t,e,r,i,n,o,s){try{var a=t[o](s),c=a.value;}catch(d){r(d);return}a.done?e(c):Promise.resolve(c).then(i,n);}function LS(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var o=t.apply(e,r);function s(c){vu(o,i,n,s,a,"next",c);}function a(c){vu(o,i,n,s,a,"throw",c);}s(void 0);})}}var vr=Y(),BS=Le(),Cu=J(),US=Cu.erase,xu=Cu.cursor,xr=we(),Ao=xr.style,Su=xr.clear,_o=xr.figures,zS=xr.wrap,GS=xr.entriesToDisplay,ku=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),VS=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),WS=(t,e)=>{let r=t.findIndex(i=>i.value===e||i.title===e);return r>-1?r:void 0},Po=class extends BS{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:WS(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||false,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=Ao.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Su("",this.out.columns),this.complete(this.render),this.render();}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e;}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=ku(this.suggestions,e):this.value=this.fallback.value,this.fire();}complete(e){var r=this;return LS(function*(){let i=r.completing=r.suggest(r.input,r.choices),n=yield i;if(r.completing!==i)return;r.suggestions=n.map((s,a,c)=>({title:VS(c,a),value:ku(c,a),description:s.description})),r.completing=false;let o=Math.max(n.length-1,0);r.moveSelect(Math.min(o,r.select)),e&&e();})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render();}),this.render();}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
41
41
  `),this.close());}abort(){this.done=this.aborted=true,this.exited=false,this.fire(),this.render(),this.out.write(`
42
42
  `),this.close();}submit(){this.done=true,this.aborted=this.exited=false,this.fire(),this.render(),this.out.write(`
43
- `),this.close();}_(e,r){let i=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor);this.input=`${i}${e}${n}`,this.cursor=i.length+1,this.complete(this.render),this.render();}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render();}first(){this.moveSelect(0),this.render();}last(){this.moveSelect(this.suggestions.length-1),this.render();}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render();}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render();}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render();}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render();}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render();}renderOption(e,r,i,n){let o,s=i?To.arrowUp:n?To.arrowDown:" ",a=r?br.cyan().underline(e.title):e.title;return s=(r?br.cyan(To.pointer)+" ":" ")+s,e.description&&(o=` - ${e.description}`,(s.length+a.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
44
- `+FS(e.description,{margin:3,width:this.out.columns}))),s+" "+a+br.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(gu.hide):this.out.write(bu(this.outputText,this.out.columns)),super.render();let e=jS(this.select,this.choices.length,this.limit),r=e.startIndex,i=e.endIndex;if(this.outputText=[Eo.symbol(this.done,this.aborted,this.exited),br.bold(this.msg),Eo.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let n=this.suggestions.slice(r,i).map((o,s)=>this.renderOption(o,this.select===s+r,s===0&&r>0,s+r===i-1&&i<this.choices.length)).join(`
43
+ `),this.close();}_(e,r){let i=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor);this.input=`${i}${e}${n}`,this.cursor=i.length+1,this.complete(this.render),this.render();}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render();}first(){this.moveSelect(0),this.render();}last(){this.moveSelect(this.suggestions.length-1),this.render();}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render();}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render();}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render();}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render();}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render();}renderOption(e,r,i,n){let o,s=i?_o.arrowUp:n?_o.arrowDown:" ",a=r?vr.cyan().underline(e.title):e.title;return s=(r?vr.cyan(_o.pointer)+" ":" ")+s,e.description&&(o=` - ${e.description}`,(s.length+a.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
44
+ `+zS(e.description,{margin:3,width:this.out.columns}))),s+" "+a+vr.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(xu.hide):this.out.write(Su(this.outputText,this.out.columns)),super.render();let e=GS(this.select,this.choices.length,this.limit),r=e.startIndex,i=e.endIndex;if(this.outputText=[Ao.symbol(this.done,this.aborted,this.exited),vr.bold(this.msg),Ao.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let n=this.suggestions.slice(r,i).map((o,s)=>this.renderOption(o,this.select===s+r,s===0&&r>0,s+r===i-1&&i<this.choices.length)).join(`
45
45
  `);this.outputText+=`
46
- `+(n||br.gray(this.fallback.title));}this.out.write(MS.line+gu.to(0)+this.outputText);}};vu.exports=Ao;});var Ou=g((wI,Cu)=>{var Ue=H(),qS=Y(),BS=qS.cursor,US=Oo(),Do=ye(),Su=Do.clear,ku=Do.style,jt=Do.figures,_o=class extends US{constructor(e={}){e.overrideRender=true,super(e),this.inputValue="",this.clear=Su("",this.out.columns),this.filteredOptions=this.value,this.render();}last(){this.cursor=this.filteredOptions.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render();}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render();}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.filteredOptions[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true,this.render();}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions());}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):true);let r=this.filteredOptions.findIndex(i=>i===e);this.cursor=r<0?0:r,this.render();}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions();}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e);}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
46
+ `+(n||vr.gray(this.fallback.title));}this.out.write(US.line+xu.to(0)+this.outputText);}};Ou.exports=Po;});var Pu=g((TI,_u)=>{var ze=Y(),HS=J(),YS=HS.cursor,JS=To(),Io=we(),Tu=Io.clear,Au=Io.style,Lt=Io.figures,Do=class extends JS{constructor(e={}){e.overrideRender=true,super(e),this.inputValue="",this.clear=Tu("",this.out.columns),this.filteredOptions=this.value,this.render();}last(){this.cursor=this.filteredOptions.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render();}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render();}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.filteredOptions[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true,this.render();}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions());}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):true);let r=this.filteredOptions.findIndex(i=>i===e);this.cursor=r<0?0:r,this.render();}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions();}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e);}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
47
47
  Instructions:
48
- ${jt.arrowUp}/${jt.arrowDown}: Highlight option
49
- ${jt.arrowLeft}/${jt.arrowRight}/[space]: Toggle selection
48
+ ${Lt.arrowUp}/${Lt.arrowDown}: Highlight option
49
+ ${Lt.arrowLeft}/${Lt.arrowRight}/[space]: Toggle selection
50
50
  [a,b,c]/delete: Filter choices
51
51
  enter/return: Complete answer
52
52
  `:""}renderCurrentInput(){return `
53
- Filtered results for: ${this.inputValue?this.inputValue:Ue.gray("Enter something to filter")}
54
- `}renderOption(e,r,i){let n;return r.disabled?n=e===i?Ue.gray().underline(r.title):Ue.strikethrough().gray(r.title):n=e===i?Ue.cyan().underline(r.title):r.title,(r.selected?Ue.green(jt.radioOn):jt.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Ue.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Ue.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(BS.hide),super.render();let e=[ku.symbol(this.done,this.aborted),Ue.bold(this.msg),ku.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Ue.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=Su(e,this.out.columns);}};Cu.exports=_o;});var Iu=g((vI,Pu)=>{var Eu=H(),zS=Le(),_u=ye(),Tu=_u.style,GS=_u.clear,Du=Y(),VS=Du.erase,Au=Du.cursor,Po=class extends zS{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
53
+ Filtered results for: ${this.inputValue?this.inputValue:ze.gray("Enter something to filter")}
54
+ `}renderOption(e,r,i){let n;return r.disabled?n=e===i?ze.gray().underline(r.title):ze.strikethrough().gray(r.title):n=e===i?ze.cyan().underline(r.title):r.title,(r.selected?ze.green(Lt.radioOn):Lt.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[ze.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(ze.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(YS.hide),super.render();let e=[Au.symbol(this.done,this.aborted),ze.bold(this.msg),Au.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=ze.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=Tu(e,this.out.columns);}};_u.exports=Do;});var ju=g((AI,Fu)=>{var Du=Y(),KS=Le(),Ru=we(),Iu=Ru.style,XS=Ru.clear,Mu=J(),ZS=Mu.erase,$u=Mu.cursor,$o=class extends KS{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
55
55
  `),this.close();}submit(){this.value=this.value||false,this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
56
- `),this.close();}_(e,r){return e.toLowerCase()==="y"?(this.value=true,this.submit()):e.toLowerCase()==="n"?(this.value=false,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Au.hide):this.out.write(GS(this.outputText,this.out.columns)),super.render(),this.outputText=[Tu.symbol(this.done,this.aborted),Eu.bold(this.msg),Tu.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Eu.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(VS.line+Au.to(0)+this.outputText));}};Pu.exports=Po;});var Ru=g((xI,$u)=>{$u.exports={TextPrompt:wd(),SelectPrompt:kd(),TogglePrompt:_d(),DatePrompt:nu(),NumberPrompt:uu(),MultiselectPrompt:Oo(),AutocompletePrompt:xu(),AutocompleteMultiselectPrompt:Ou(),ConfirmPrompt:Iu()};});var Fu=g(Mu=>{var ue=Mu,WS=Ru(),ui=t=>t;function Te(t,e,r={}){return new Promise((i,n)=>{let o=new WS[t](e),s=r.onAbort||ui,a=r.onSubmit||ui,c=r.onExit||ui;o.on("state",e.onState||ui),o.on("submit",d=>i(a(d))),o.on("exit",d=>i(c(d))),o.on("abort",d=>n(s(d)));})}ue.text=t=>Te("TextPrompt",t);ue.password=t=>(t.style="password",ue.text(t));ue.invisible=t=>(t.style="invisible",ue.text(t));ue.number=t=>Te("NumberPrompt",t);ue.date=t=>Te("DatePrompt",t);ue.confirm=t=>Te("ConfirmPrompt",t);ue.list=t=>{let e=t.separator||",";return Te("TextPrompt",t,{onSubmit:r=>r.split(e).map(i=>i.trim())})};ue.toggle=t=>Te("TogglePrompt",t);ue.select=t=>Te("SelectPrompt",t);ue.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Te("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};ue.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Te("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var HS=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));ue.autocomplete=t=>(t.suggest=t.suggest||HS,t.choices=[].concat(t.choices||[]),Te("AutocompletePrompt",t));});var Gu=g((kI,zu)=>{function ju(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i);}return r}function Nu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ju(Object(r),true).forEach(function(i){YS(t,i,r[i]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ju(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i));});}return t}function YS(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true}):t[e]=r,t}function JS(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=KS(t))||e){r&&(t=r);var i=0,n=function(){};return {s:n,n:function(){return i>=t.length?{done:true}:{done:false,value:t[i++]}},e:function(d){throw d},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
57
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=true,s=false,a;return {s:function(){r=r.call(t);},n:function(){var d=r.next();return o=d.done,d},e:function(d){s=true,a=d;},f:function(){try{!o&&r.return!=null&&r.return();}finally{if(s)throw a}}}}function KS(t,e){if(t){if(typeof t=="string")return Lu(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lu(t,e)}}function Lu(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function qu(t,e,r,i,n,o,s){try{var a=t[o](s),c=a.value;}catch(d){r(d);return}a.done?e(c):Promise.resolve(c).then(i,n);}function Bu(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var o=t.apply(e,r);function s(c){qu(o,i,n,s,a,"next",c);}function a(c){qu(o,i,n,s,a,"throw",c);}s(void 0);})}}var Io=Fu(),XS=["suggest","format","onState","validate","onRender","type"],Uu=()=>{};function ot(){return $o.apply(this,arguments)}function $o(){return $o=Bu(function*(t=[],{onSubmit:e=Uu,onCancel:r=Uu}={}){let i={},n=ot._override||{};t=[].concat(t);let o,s,a,c,d,l,u=(function(){var v=Bu(function*(y,x,k=false){if(!(!k&&y.validate&&y.validate(x)!==true))return y.format?yield y.format(x,i):x});return function(x,k){return v.apply(this,arguments)}})();var h=JS(t),p;try{for(h.s();!(p=h.n()).done;){s=p.value;var f=s;if(c=f.name,d=f.type,typeof d=="function"&&(d=yield d(o,Nu({},i),s),s.type=d),!!d){for(let v in s){if(XS.includes(v))continue;let y=s[v];s[v]=typeof y=="function"?yield y(o,Nu({},i),l):y;}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");var b=s;if(c=b.name,d=b.type,Io[d]===void 0)throw new Error(`prompt type (${d}) is not defined`);if(n[s.name]!==void 0&&(o=yield u(s,n[s.name]),o!==void 0)){i[c]=o;continue}try{o=ot._injected?ZS(ot._injected,s.initial):yield Io[d](s),i[c]=o=yield u(s,o,!0),a=yield e(s,o,i);}catch{a=!(yield r(s,i));}if(a)return i}}}catch(v){h.e(v);}finally{h.f();}return i}),$o.apply(this,arguments)}function ZS(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function QS(t){ot._injected=(ot._injected||[]).concat(t);}function e0(t){ot._override=Object.assign({},t);}zu.exports=Object.assign(ot,{prompt:ot,prompts:Io,inject:QS,override:e0});});var Wu=g((CI,Vu)=>{Vu.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return "first";if(t.name==="c"||t.name==="d")return "abort";if(t.name==="e")return "last";if(t.name==="g")return "reset"}if(e){if(t.name==="j")return "down";if(t.name==="k")return "up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":false}};});var hi=g((OI,Hu)=>{Hu.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t};});var Ku=g((EI,Ju)=>{var t0=hi(),{erase:Yu,cursor:r0}=Y(),i0=t=>[...t0(t)].length;Ju.exports=function(t,e){if(!e)return Yu.line+r0.to(0);let r=0,i=t.split(/\r?\n/);for(let n of i)r+=1+Math.floor(Math.max(i0(n)-1,0)/e);return Yu.lines(r)};});var Ro=g((TI,Xu)=>{var wr={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},n0={arrowUp:wr.arrowUp,arrowDown:wr.arrowDown,arrowLeft:wr.arrowLeft,arrowRight:wr.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},o0=process.platform==="win32"?n0:wr;Xu.exports=o0;});var Qu=g((AI,Zu)=>{var Nt=H(),yt=Ro(),Mo=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),s0=t=>Mo[t]||Mo.default,vr=Object.freeze({aborted:Nt.red(yt.cross),done:Nt.green(yt.tick),exited:Nt.yellow(yt.cross),default:Nt.cyan("?")}),a0=(t,e,r)=>e?vr.aborted:r?vr.exited:t?vr.done:vr.default,c0=t=>Nt.gray(t?yt.ellipsis:yt.pointerSmall),l0=(t,e)=>Nt.gray(t?e?yt.pointerSmall:"+":yt.line);Zu.exports={styles:Mo,render:s0,symbols:vr,symbol:a0,delimiter:c0,item:l0};});var th=g((_I,eh)=>{var d0=hi();eh.exports=function(t,e){let r=String(d0(t)||"").split(/\r?\n/);return e?r.map(i=>Math.ceil(i.length/e)).reduce((i,n)=>i+n):r.length};});var ih=g((DI,rh)=>{rh.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return (t||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=i||o[o.length-1].length+s.length+1<i?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
56
+ `),this.close();}_(e,r){return e.toLowerCase()==="y"?(this.value=true,this.submit()):e.toLowerCase()==="n"?(this.value=false,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write($u.hide):this.out.write(XS(this.outputText,this.out.columns)),super.render(),this.outputText=[Iu.symbol(this.done,this.aborted),Du.bold(this.msg),Iu.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Du.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(ZS.line+$u.to(0)+this.outputText));}};Fu.exports=$o;});var qu=g((_I,Nu)=>{Nu.exports={TextPrompt:Cd(),SelectPrompt:Ad(),TogglePrompt:Rd(),DatePrompt:lu(),NumberPrompt:gu(),MultiselectPrompt:To(),AutocompletePrompt:Eu(),AutocompleteMultiselectPrompt:Pu(),ConfirmPrompt:ju()};});var Bu=g(Lu=>{var ue=Lu,QS=qu(),mi=t=>t;function Te(t,e,r={}){return new Promise((i,n)=>{let o=new QS[t](e),s=r.onAbort||mi,a=r.onSubmit||mi,c=r.onExit||mi;o.on("state",e.onState||mi),o.on("submit",d=>i(a(d))),o.on("exit",d=>i(c(d))),o.on("abort",d=>n(s(d)));})}ue.text=t=>Te("TextPrompt",t);ue.password=t=>(t.style="password",ue.text(t));ue.invisible=t=>(t.style="invisible",ue.text(t));ue.number=t=>Te("NumberPrompt",t);ue.date=t=>Te("DatePrompt",t);ue.confirm=t=>Te("ConfirmPrompt",t);ue.list=t=>{let e=t.separator||",";return Te("TextPrompt",t,{onSubmit:r=>r.split(e).map(i=>i.trim())})};ue.toggle=t=>Te("TogglePrompt",t);ue.select=t=>Te("SelectPrompt",t);ue.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Te("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};ue.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Te("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var e0=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));ue.autocomplete=t=>(t.suggest=t.suggest||e0,t.choices=[].concat(t.choices||[]),Te("AutocompletePrompt",t));});var Ju=g((DI,Yu)=>{function Uu(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i);}return r}function zu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Uu(Object(r),true).forEach(function(i){t0(t,i,r[i]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Uu(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i));});}return t}function t0(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true}):t[e]=r,t}function r0(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=i0(t))||e){r&&(t=r);var i=0,n=function(){};return {s:n,n:function(){return i>=t.length?{done:true}:{done:false,value:t[i++]}},e:function(d){throw d},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
57
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=true,s=false,a;return {s:function(){r=r.call(t);},n:function(){var d=r.next();return o=d.done,d},e:function(d){s=true,a=d;},f:function(){try{!o&&r.return!=null&&r.return();}finally{if(s)throw a}}}}function i0(t,e){if(t){if(typeof t=="string")return Gu(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gu(t,e)}}function Gu(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function Vu(t,e,r,i,n,o,s){try{var a=t[o](s),c=a.value;}catch(d){r(d);return}a.done?e(c):Promise.resolve(c).then(i,n);}function Wu(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var o=t.apply(e,r);function s(c){Vu(o,i,n,s,a,"next",c);}function a(c){Vu(o,i,n,s,a,"throw",c);}s(void 0);})}}var Ro=Bu(),n0=["suggest","format","onState","validate","onRender","type"],Hu=()=>{};function at(){return Mo.apply(this,arguments)}function Mo(){return Mo=Wu(function*(t=[],{onSubmit:e=Hu,onCancel:r=Hu}={}){let i={},n=at._override||{};t=[].concat(t);let o,s,a,c,d,l,u=(function(){var y=Wu(function*(w,S,C=false){if(!(!C&&w.validate&&w.validate(S)!==true))return w.format?yield w.format(S,i):S});return function(S,C){return y.apply(this,arguments)}})();var h=r0(t),p;try{for(h.s();!(p=h.n()).done;){s=p.value;var m=s;if(c=m.name,d=m.type,typeof d=="function"&&(d=yield d(o,zu({},i),s),s.type=d),!!d){for(let y in s){if(n0.includes(y))continue;let w=s[y];s[y]=typeof w=="function"?yield w(o,zu({},i),l):w;}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");var b=s;if(c=b.name,d=b.type,Ro[d]===void 0)throw new Error(`prompt type (${d}) is not defined`);if(n[s.name]!==void 0&&(o=yield u(s,n[s.name]),o!==void 0)){i[c]=o;continue}try{o=at._injected?o0(at._injected,s.initial):yield Ro[d](s),i[c]=o=yield u(s,o,!0),a=yield e(s,o,i);}catch{a=!(yield r(s,i));}if(a)return i}}}catch(y){h.e(y);}finally{h.f();}return i}),Mo.apply(this,arguments)}function o0(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function s0(t){at._injected=(at._injected||[]).concat(t);}function a0(t){at._override=Object.assign({},t);}Yu.exports=Object.assign(at,{prompt:at,prompts:Ro,inject:s0,override:a0});});var Xu=g((II,Ku)=>{Ku.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return "first";if(t.name==="c"||t.name==="d")return "abort";if(t.name==="e")return "last";if(t.name==="g")return "reset"}if(e){if(t.name==="j")return "down";if(t.name==="k")return "up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":false}};});var fi=g(($I,Zu)=>{Zu.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t};});var th=g((RI,eh)=>{var c0=fi(),{erase:Qu,cursor:l0}=J(),d0=t=>[...c0(t)].length;eh.exports=function(t,e){if(!e)return Qu.line+l0.to(0);let r=0,i=t.split(/\r?\n/);for(let n of i)r+=1+Math.floor(Math.max(d0(n)-1,0)/e);return Qu.lines(r)};});var Fo=g((MI,rh)=>{var Sr={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},u0={arrowUp:Sr.arrowUp,arrowDown:Sr.arrowDown,arrowLeft:Sr.arrowLeft,arrowRight:Sr.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},h0=process.platform==="win32"?u0:Sr;rh.exports=h0;});var nh=g((FI,ih)=>{var Bt=Y(),wt=Fo(),jo=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),p0=t=>jo[t]||jo.default,kr=Object.freeze({aborted:Bt.red(wt.cross),done:Bt.green(wt.tick),exited:Bt.yellow(wt.cross),default:Bt.cyan("?")}),m0=(t,e,r)=>e?kr.aborted:r?kr.exited:t?kr.done:kr.default,f0=t=>Bt.gray(t?wt.ellipsis:wt.pointerSmall),g0=(t,e)=>Bt.gray(t?e?wt.pointerSmall:"+":wt.line);ih.exports={styles:jo,render:p0,symbols:kr,symbol:m0,delimiter:f0,item:g0};});var sh=g((jI,oh)=>{var b0=fi();oh.exports=function(t,e){let r=String(b0(t)||"").split(/\r?\n/);return e?r.map(i=>Math.ceil(i.length/e)).reduce((i,n)=>i+n):r.length};});var ch=g((NI,ah)=>{ah.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",i=e.width;return (t||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=i||o[o.length-1].length+s.length+1<i?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
58
58
  `)).join(`
59
- `)};});var oh=g((PI,nh)=>{nh.exports=(t,e,r)=>{r=r||e;let i=Math.min(e-r,t-Math.floor(r/2));i<0&&(i=0);let n=Math.min(i+r,e);return {startIndex:i,endIndex:n}};});var we=g((II,sh)=>{sh.exports={action:Wu(),clear:Ku(),style:Qu(),strip:hi(),figures:Ro(),lines:th(),wrap:ih(),entriesToDisplay:oh()};});var ze=g(($I,ch)=>{var ah=F("readline"),{action:u0}=we(),h0=F("events"),{beep:p0,cursor:m0}=Y(),f0=H(),Fo=class extends h0{constructor(e={}){super(),this.firstRender=true,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=ah.createInterface({input:this.in,escapeCodeTimeout:50});ah.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(true);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(o,s)=>{let a=u0(s,i);a===false?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell();};this.close=()=>{this.out.write(m0.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(false),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=true;},this.in.on("keypress",n);}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited});}bell(){this.out.write(p0);}render(){this.onRender(f0),this.firstRender&&(this.firstRender=false);}};ch.exports=Fo;});var dh=g((RI,lh)=>{var pi=H(),g0=ze(),{erase:b0,cursor:xr}=Y(),{style:jo,clear:No,lines:y0,figures:w0}=we(),Lo=class extends g0{constructor(e={}){super(e),this.transform=jo.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>true),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=No("",this.out.columns),this.render();}set value(e){!e&&this.initial?(this.placeholder=true,this.rendered=pi.gray(this.transform.render(this.initial))):(this.placeholder=false,this.rendered=this.transform.render(e)),this._value=e,this.fire();}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render();}exit(){this.abort();}abort(){this.value=this.value||this.initial,this.done=this.aborted=true,this.error=false,this.red=false,this.fire(),this.render(),this.out.write(`
59
+ `)};});var dh=g((qI,lh)=>{lh.exports=(t,e,r)=>{r=r||e;let i=Math.min(e-r,t-Math.floor(r/2));i<0&&(i=0);let n=Math.min(i+r,e);return {startIndex:i,endIndex:n}};});var ve=g((LI,uh)=>{uh.exports={action:Xu(),clear:th(),style:nh(),strip:fi(),figures:Fo(),lines:sh(),wrap:ch(),entriesToDisplay:dh()};});var Ge=g((BI,ph)=>{var hh=F("readline"),{action:y0}=ve(),w0=F("events"),{beep:v0,cursor:x0}=J(),S0=Y(),No=class extends w0{constructor(e={}){super(),this.firstRender=true,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=hh.createInterface({input:this.in,escapeCodeTimeout:50});hh.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(true);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(o,s)=>{let a=y0(s,i);a===false?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell();};this.close=()=>{this.out.write(x0.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(false),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=true;},this.in.on("keypress",n);}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited});}bell(){this.out.write(v0);}render(){this.onRender(S0),this.firstRender&&(this.firstRender=false);}};ph.exports=No;});var fh=g((UI,mh)=>{var gi=Y(),k0=Ge(),{erase:C0,cursor:Cr}=J(),{style:qo,clear:Lo,lines:O0,figures:E0}=ve(),Bo=class extends k0{constructor(e={}){super(e),this.transform=qo.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>true),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=Lo("",this.out.columns),this.render();}set value(e){!e&&this.initial?(this.placeholder=true,this.rendered=gi.gray(this.transform.render(this.initial))):(this.placeholder=false,this.rendered=this.transform.render(e)),this._value=e,this.fire();}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render();}exit(){this.abort();}abort(){this.value=this.value||this.initial,this.done=this.aborted=true,this.error=false,this.red=false,this.fire(),this.render(),this.out.write(`
60
60
  `),this.close();}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=false),this.error=!e;}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=true,this.fire(),this.render();return}this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
61
- `),this.close();}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render();}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e);}_(e,r){let i=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.value=`${i}${e}${n}`,this.red=false,this.cursor=this.placeholder?0:i.length+1,this.render();}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=false,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=false,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render();}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length,this.render();}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render();}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render();}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(xr.down(y0(this.outputError,this.out.columns)-1)+No(this.outputError,this.out.columns)),this.out.write(No(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[jo.symbol(this.done,this.aborted),pi.bold(this.msg),jo.delimiter(this.done),this.red?pi.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
61
+ `),this.close();}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render();}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e);}_(e,r){let i=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.value=`${i}${e}${n}`,this.red=false,this.cursor=this.placeholder?0:i.length+1,this.render();}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=false,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=false,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render();}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length,this.render();}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render();}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render();}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Cr.down(O0(this.outputError,this.out.columns)-1)+Lo(this.outputError,this.out.columns)),this.out.write(Lo(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[qo.symbol(this.done,this.aborted),gi.bold(this.msg),qo.delimiter(this.done),this.red?gi.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
62
62
  `).reduce((e,r,i)=>e+`
63
- ${i?" ":w0.pointerSmall} ${pi.red().italic(r)}`,"")),this.out.write(b0.line+xr.to(0)+this.outputText+xr.save+this.outputError+xr.restore+xr.move(this.cursorOffset,0)));}};lh.exports=Lo;});var mh=g((MI,ph)=>{var Ge=H(),v0=ze(),{style:uh,clear:hh,figures:mi,wrap:x0,entriesToDisplay:S0}=we(),{cursor:k0}=Y(),qo=class extends v0{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=hh("",this.out.columns),this.render();}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire();}reset(){this.moveCursor(0),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
63
+ ${i?" ":E0.pointerSmall} ${gi.red().italic(r)}`,"")),this.out.write(C0.line+Cr.to(0)+this.outputText+Cr.save+this.outputError+Cr.restore+Cr.move(this.cursorOffset,0)));}};mh.exports=Bo;});var wh=g((zI,yh)=>{var Ve=Y(),T0=Ge(),{style:gh,clear:bh,figures:bi,wrap:A0,entriesToDisplay:_0}=ve(),{cursor:P0}=J(),Uo=class extends T0{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=bh("",this.out.columns),this.render();}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire();}reset(){this.moveCursor(0),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
64
64
  `),this.close();}submit(){this.selection.disabled?this.bell():(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
65
- `),this.close());}first(){this.moveCursor(0),this.render();}last(){this.moveCursor(this.choices.length-1),this.render();}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render();}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render();}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render();}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(k0.hide):this.out.write(hh(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=S0(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[uh.symbol(this.done,this.aborted),Ge.bold(this.msg),uh.delimiter(false),this.done?this.selection.title:this.selection.disabled?Ge.yellow(this.warn):Ge.gray(this.hint)].join(" "),!this.done){this.outputText+=`
66
- `;for(let i=e;i<r;i++){let n,o,s="",a=this.choices[i];i===e&&e>0?o=mi.arrowUp:i===r-1&&r<this.choices.length?o=mi.arrowDown:o=" ",a.disabled?(n=this.cursor===i?Ge.gray().underline(a.title):Ge.strikethrough().gray(a.title),o=(this.cursor===i?Ge.bold().gray(mi.pointer)+" ":" ")+o):(n=this.cursor===i?Ge.cyan().underline(a.title):a.title,o=(this.cursor===i?Ge.cyan(mi.pointer)+" ":" ")+o,a.description&&this.cursor===i&&(s=` - ${a.description}`,(o.length+n.length+s.length>=this.out.columns||a.description.split(/\r?\n/).length>1)&&(s=`
67
- `+x0(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${Ge.gray(s)}
68
- `;}}this.out.write(this.outputText);}};ph.exports=qo;});var yh=g((FI,bh)=>{var fi=H(),C0=ze(),{style:fh,clear:O0}=we(),{cursor:gh,erase:E0}=Y(),Bo=class extends C0{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
65
+ `),this.close());}first(){this.moveCursor(0),this.render();}last(){this.moveCursor(this.choices.length-1),this.render();}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render();}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render();}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render();}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(P0.hide):this.out.write(bh(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=_0(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[gh.symbol(this.done,this.aborted),Ve.bold(this.msg),gh.delimiter(false),this.done?this.selection.title:this.selection.disabled?Ve.yellow(this.warn):Ve.gray(this.hint)].join(" "),!this.done){this.outputText+=`
66
+ `;for(let i=e;i<r;i++){let n,o,s="",a=this.choices[i];i===e&&e>0?o=bi.arrowUp:i===r-1&&r<this.choices.length?o=bi.arrowDown:o=" ",a.disabled?(n=this.cursor===i?Ve.gray().underline(a.title):Ve.strikethrough().gray(a.title),o=(this.cursor===i?Ve.bold().gray(bi.pointer)+" ":" ")+o):(n=this.cursor===i?Ve.cyan().underline(a.title):a.title,o=(this.cursor===i?Ve.cyan(bi.pointer)+" ":" ")+o,a.description&&this.cursor===i&&(s=` - ${a.description}`,(o.length+n.length+s.length>=this.out.columns||a.description.split(/\r?\n/).length>1)&&(s=`
67
+ `+A0(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${Ve.gray(s)}
68
+ `;}}this.out.write(this.outputText);}};yh.exports=Uo;});var kh=g((GI,Sh)=>{var yi=Y(),D0=Ge(),{style:vh,clear:I0}=ve(),{cursor:xh,erase:$0}=J(),zo=class extends D0{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
69
69
  `),this.close();}submit(){this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
70
- `),this.close();}deactivate(){if(this.value===false)return this.bell();this.value=false,this.render();}activate(){if(this.value===true)return this.bell();this.value=true,this.render();}delete(){this.deactivate();}left(){this.deactivate();}right(){this.activate();}down(){this.deactivate();}up(){this.activate();}next(){this.value=!this.value,this.fire(),this.render();}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=true;else if(e==="0")this.value=false;else return this.bell();this.render();}render(){this.closed||(this.firstRender?this.out.write(gh.hide):this.out.write(O0(this.outputText,this.out.columns)),super.render(),this.outputText=[fh.symbol(this.done,this.aborted),fi.bold(this.msg),fh.delimiter(this.done),this.value?this.inactive:fi.cyan().underline(this.inactive),fi.gray("/"),this.value?fi.cyan().underline(this.active):this.active].join(" "),this.out.write(E0.line+gh.to(0)+this.outputText));}};bh.exports=Bo;});var Ae=g((jI,wh)=>{var Uo=class t{constructor({token:e,date:r,parts:i,locales:n}){this.token=e,this.date=r||new Date,this.parts=i||[this],this.locales=n||{};}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,i)=>i>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((i,n)=>n>r&&i instanceof t)}toString(){return String(this.date)}};wh.exports=Uo;});var xh=g((NI,vh)=>{var T0=Ae(),zo=class extends T0{constructor(e={}){super(e);}up(){this.date.setHours((this.date.getHours()+12)%24);}down(){this.up();}toString(){let e=this.date.getHours()>12?"pm":"am";return /\A/.test(this.token)?e.toUpperCase():e}};vh.exports=zo;});var kh=g((LI,Sh)=>{var A0=Ae(),_0=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),Go=class extends A0{constructor(e={}){super(e);}up(){this.date.setDate(this.date.getDate()+1);}down(){this.date.setDate(this.date.getDate()-1);}setTo(e){this.date.setDate(parseInt(e.substr(-2)));}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+_0(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};Sh.exports=Go;});var Oh=g((qI,Ch)=>{var D0=Ae(),Vo=class extends D0{constructor(e={}){super(e);}up(){this.date.setHours(this.date.getHours()+1);}down(){this.date.setHours(this.date.getHours()-1);}setTo(e){this.date.setHours(parseInt(e.substr(-2)));}toString(){let e=this.date.getHours();return /h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};Ch.exports=Vo;});var Th=g((BI,Eh)=>{var P0=Ae(),Wo=class extends P0{constructor(e={}){super(e);}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1);}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1);}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)));}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Eh.exports=Wo;});var _h=g((UI,Ah)=>{var I0=Ae(),Ho=class extends I0{constructor(e={}){super(e);}up(){this.date.setMinutes(this.date.getMinutes()+1);}down(){this.date.setMinutes(this.date.getMinutes()-1);}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)));}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};Ah.exports=Ho;});var Ph=g((zI,Dh)=>{var $0=Ae(),Yo=class extends $0{constructor(e={}){super(e);}up(){this.date.setMonth(this.date.getMonth()+1);}down(){this.date.setMonth(this.date.getMonth()-1);}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e);}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};Dh.exports=Yo;});var $h=g((GI,Ih)=>{var R0=Ae(),Jo=class extends R0{constructor(e={}){super(e);}up(){this.date.setSeconds(this.date.getSeconds()+1);}down(){this.date.setSeconds(this.date.getSeconds()-1);}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)));}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};Ih.exports=Jo;});var Mh=g((VI,Rh)=>{var M0=Ae(),Ko=class extends M0{constructor(e={}){super(e);}up(){this.date.setFullYear(this.date.getFullYear()+1);}down(){this.date.setFullYear(this.date.getFullYear()-1);}setTo(e){this.date.setFullYear(e.substr(-4));}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};Rh.exports=Ko;});var jh=g((WI,Fh)=>{Fh.exports={DatePart:Ae(),Meridiem:xh(),Day:kh(),Hours:Oh(),Milliseconds:Th(),Minutes:_h(),Month:Ph(),Seconds:$h(),Year:Mh()};});var Gh=g((HI,zh)=>{var Xo=H(),F0=ze(),{style:Nh,clear:Lh,figures:j0}=we(),{erase:N0,cursor:qh}=Y(),{DatePart:Bh,Meridiem:L0,Day:q0,Hours:B0,Milliseconds:U0,Minutes:z0,Month:G0,Seconds:V0,Year:W0}=jh(),H0=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,Uh={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new q0(t),3:t=>new G0(t),4:t=>new W0(t),5:t=>new L0(t),6:t=>new B0(t),7:t=>new z0(t),8:t=>new V0(t),9:t=>new U0(t)},Y0={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},Zo=class extends F0{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(Y0,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Lh("",this.out.columns),this.render();}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime());}set mask(e){let r;for(this.parts=[];r=H0.exec(e);){let n=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in Uh?Uh[o]({token:r[o]||n,date:this.date,parts:this.parts,locales:this.locales}):r[o]||n);}let i=this.parts.reduce((n,o)=>(typeof o=="string"&&typeof n[n.length-1]=="string"?n[n.length-1]+=o:n.push(o),n),[]);this.parts.splice(0),this.parts.push(...i),this.reset();}moveCursor(e){this.typed="",this.cursor=e,this.fire();}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof Bh)),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
70
+ `),this.close();}deactivate(){if(this.value===false)return this.bell();this.value=false,this.render();}activate(){if(this.value===true)return this.bell();this.value=true,this.render();}delete(){this.deactivate();}left(){this.deactivate();}right(){this.activate();}down(){this.deactivate();}up(){this.activate();}next(){this.value=!this.value,this.fire(),this.render();}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=true;else if(e==="0")this.value=false;else return this.bell();this.render();}render(){this.closed||(this.firstRender?this.out.write(xh.hide):this.out.write(I0(this.outputText,this.out.columns)),super.render(),this.outputText=[vh.symbol(this.done,this.aborted),yi.bold(this.msg),vh.delimiter(this.done),this.value?this.inactive:yi.cyan().underline(this.inactive),yi.gray("/"),this.value?yi.cyan().underline(this.active):this.active].join(" "),this.out.write($0.line+xh.to(0)+this.outputText));}};Sh.exports=zo;});var Ae=g((VI,Ch)=>{var Go=class t{constructor({token:e,date:r,parts:i,locales:n}){this.token=e,this.date=r||new Date,this.parts=i||[this],this.locales=n||{};}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,i)=>i>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((i,n)=>n>r&&i instanceof t)}toString(){return String(this.date)}};Ch.exports=Go;});var Eh=g((WI,Oh)=>{var R0=Ae(),Vo=class extends R0{constructor(e={}){super(e);}up(){this.date.setHours((this.date.getHours()+12)%24);}down(){this.up();}toString(){let e=this.date.getHours()>12?"pm":"am";return /\A/.test(this.token)?e.toUpperCase():e}};Oh.exports=Vo;});var Ah=g((HI,Th)=>{var M0=Ae(),F0=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),Wo=class extends M0{constructor(e={}){super(e);}up(){this.date.setDate(this.date.getDate()+1);}down(){this.date.setDate(this.date.getDate()-1);}setTo(e){this.date.setDate(parseInt(e.substr(-2)));}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+F0(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};Th.exports=Wo;});var Ph=g((YI,_h)=>{var j0=Ae(),Ho=class extends j0{constructor(e={}){super(e);}up(){this.date.setHours(this.date.getHours()+1);}down(){this.date.setHours(this.date.getHours()-1);}setTo(e){this.date.setHours(parseInt(e.substr(-2)));}toString(){let e=this.date.getHours();return /h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};_h.exports=Ho;});var Ih=g((JI,Dh)=>{var N0=Ae(),Yo=class extends N0{constructor(e={}){super(e);}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1);}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1);}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)));}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};Dh.exports=Yo;});var Rh=g((KI,$h)=>{var q0=Ae(),Jo=class extends q0{constructor(e={}){super(e);}up(){this.date.setMinutes(this.date.getMinutes()+1);}down(){this.date.setMinutes(this.date.getMinutes()-1);}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)));}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};$h.exports=Jo;});var Fh=g((XI,Mh)=>{var L0=Ae(),Ko=class extends L0{constructor(e={}){super(e);}up(){this.date.setMonth(this.date.getMonth()+1);}down(){this.date.setMonth(this.date.getMonth()-1);}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e);}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};Mh.exports=Ko;});var Nh=g((ZI,jh)=>{var B0=Ae(),Xo=class extends B0{constructor(e={}){super(e);}up(){this.date.setSeconds(this.date.getSeconds()+1);}down(){this.date.setSeconds(this.date.getSeconds()-1);}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)));}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};jh.exports=Xo;});var Lh=g((QI,qh)=>{var U0=Ae(),Zo=class extends U0{constructor(e={}){super(e);}up(){this.date.setFullYear(this.date.getFullYear()+1);}down(){this.date.setFullYear(this.date.getFullYear()-1);}setTo(e){this.date.setFullYear(e.substr(-4));}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};qh.exports=Zo;});var Uh=g((e$,Bh)=>{Bh.exports={DatePart:Ae(),Meridiem:Eh(),Day:Ah(),Hours:Ph(),Milliseconds:Ih(),Minutes:Rh(),Month:Fh(),Seconds:Nh(),Year:Lh()};});var Jh=g((t$,Yh)=>{var Qo=Y(),z0=Ge(),{style:zh,clear:Gh,figures:G0}=ve(),{erase:V0,cursor:Vh}=J(),{DatePart:Wh,Meridiem:W0,Day:H0,Hours:Y0,Milliseconds:J0,Minutes:K0,Month:X0,Seconds:Z0,Year:Q0}=Uh(),ek=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,Hh={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new H0(t),3:t=>new X0(t),4:t=>new Q0(t),5:t=>new W0(t),6:t=>new Y0(t),7:t=>new K0(t),8:t=>new Z0(t),9:t=>new J0(t)},tk={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},es=class extends z0{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(tk,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=Gh("",this.out.columns),this.render();}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime());}set mask(e){let r;for(this.parts=[];r=ek.exec(e);){let n=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in Hh?Hh[o]({token:r[o]||n,date:this.date,parts:this.parts,locales:this.locales}):r[o]||n);}let i=this.parts.reduce((n,o)=>(typeof o=="string"&&typeof n[n.length-1]=="string"?n[n.length-1]+=o:n.push(o),n),[]);this.parts.splice(0),this.parts.push(...i),this.reset();}moveCursor(e){this.typed="",this.cursor=e,this.fire();}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof Wh)),this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
71
71
  `),this.close();}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=false),this.error=!e;}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
72
- `),this.close();}up(){this.typed="",this.parts[this.cursor].up(),this.render();}down(){this.typed="",this.parts[this.cursor].down(),this.render();}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof Bh)),this.render();}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render());}render(){this.closed||(this.firstRender?this.out.write(qh.hide):this.out.write(Lh(this.outputText,this.out.columns)),super.render(),this.outputText=[Nh.symbol(this.done,this.aborted),Xo.bold(this.msg),Nh.delimiter(false),this.parts.reduce((e,r,i)=>e.concat(i===this.cursor&&!this.done?Xo.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
72
+ `),this.close();}up(){this.typed="",this.parts[this.cursor].up(),this.render();}down(){this.typed="",this.parts[this.cursor].down(),this.render();}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render();}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof Wh)),this.render();}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render());}render(){this.closed||(this.firstRender?this.out.write(Vh.hide):this.out.write(Gh(this.outputText,this.out.columns)),super.render(),this.outputText=[zh.symbol(this.done,this.aborted),Qo.bold(this.msg),zh.delimiter(false),this.parts.reduce((e,r,i)=>e.concat(i===this.cursor&&!this.done?Qo.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
73
73
  `).reduce((e,r,i)=>e+`
74
- ${i?" ":j0.pointerSmall} ${Xo.red().italic(r)}`,"")),this.out.write(N0.line+qh.to(0)+this.outputText));}};zh.exports=Zo;});var Yh=g((YI,Hh)=>{var gi=H(),J0=ze(),{cursor:bi,erase:K0}=Y(),{style:Qo,figures:X0,clear:Vh,lines:Z0}=we(),Q0=/[0-9]/,es=t=>t!==void 0,Wh=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},ts=class extends J0{constructor(e={}){super(e),this.transform=Qo.render(e.style),this.msg=e.message,this.initial=es(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=es(e.min)?e.min:-1/0,this.max=es(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render();}set value(e){!e&&e!==0?(this.placeholder=true,this.rendered=gi.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=false,this.rendered=this.transform.render(`${Wh(e,this.round)}`),this._value=Wh(e,this.round)),this.fire();}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||Q0.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render();}exit(){this.abort();}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
74
+ ${i?" ":G0.pointerSmall} ${Qo.red().italic(r)}`,"")),this.out.write(V0.line+Vh.to(0)+this.outputText));}};Yh.exports=es;});var Qh=g((r$,Zh)=>{var wi=Y(),rk=Ge(),{cursor:vi,erase:ik}=J(),{style:ts,figures:nk,clear:Kh,lines:ok}=ve(),sk=/[0-9]/,rs=t=>t!==void 0,Xh=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},is=class extends rk{constructor(e={}){super(e),this.transform=ts.render(e.style),this.msg=e.message,this.initial=rs(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=rs(e.min)?e.min:-1/0,this.max=rs(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>true),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render();}set value(e){!e&&e!==0?(this.placeholder=true,this.rendered=wi.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=false,this.rendered=this.transform.render(`${Xh(e,this.round)}`),this._value=Xh(e,this.round)),this.fire();}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||sk.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render();}exit(){this.abort();}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=true,this.error=false,this.fire(),this.render(),this.out.write(`
75
75
  `),this.close();}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=false),this.error=!e;}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let e=this.value;this.value=e!==""?e:this.initial,this.done=true,this.aborted=false,this.error=false,this.fire(),this.render(),this.out.write(`
76
- `),this.close();}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render();}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render();}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render();}next(){this.value=this.initial,this.fire(),this.render();}_(e,r){if(!this.valid(e))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render();}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(bi.down(Z0(this.outputError,this.out.columns)-1)+Vh(this.outputError,this.out.columns)),this.out.write(Vh(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[Qo.symbol(this.done,this.aborted),gi.bold(this.msg),Qo.delimiter(this.done),!this.done||!this.done&&!this.placeholder?gi[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
76
+ `),this.close();}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render();}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render();}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render();}next(){this.value=this.initial,this.fire(),this.render();}_(e,r){if(!this.valid(e))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=i,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render();}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(vi.down(ok(this.outputError,this.out.columns)-1)+Kh(this.outputError,this.out.columns)),this.out.write(Kh(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[ts.symbol(this.done,this.aborted),wi.bold(this.msg),ts.delimiter(this.done),!this.done||!this.done&&!this.placeholder?wi[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
77
77
  `).reduce((e,r,i)=>e+`
78
- ${i?" ":X0.pointerSmall} ${gi.red().italic(r)}`,"")),this.out.write(K0.line+bi.to(0)+this.outputText+bi.save+this.outputError+bi.restore));}};Hh.exports=ts;});var is=g((JI,Xh)=>{var _e=H(),{cursor:ek}=Y(),tk=ze(),{clear:Jh,figures:st,style:Kh,wrap:rk,entriesToDisplay:ik}=we(),rs=class extends tk{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=false,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=Jh("",this.out.columns),e.overrideRender||this.render();}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render();}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
78
+ ${i?" ":nk.pointerSmall} ${wi.red().italic(r)}`,"")),this.out.write(ik.line+vi.to(0)+this.outputText+vi.save+this.outputError+vi.restore));}};Zh.exports=is;});var os=g((i$,rp)=>{var _e=Y(),{cursor:ak}=J(),ck=Ge(),{clear:ep,figures:ct,style:tp,wrap:lk,entriesToDisplay:dk}=ve(),ns=class extends ck{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=false,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=ep("",this.out.columns),e.overrideRender||this.render();}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render();}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
79
79
  `),this.close();}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=true,this.render()):(this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
80
80
  `),this.close());}first(){this.cursor=0,this.render();}last(){this.cursor=this.value.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.value.length,this.render();}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render();}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.value[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true,this.render();}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render();}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
81
81
  Instructions:
82
- ${st.arrowUp}/${st.arrowDown}: Highlight option
83
- ${st.arrowLeft}/${st.arrowRight}/[space]: Toggle selection
82
+ ${ct.arrowUp}/${ct.arrowDown}: Highlight option
83
+ ${ct.arrowLeft}/${ct.arrowRight}/[space]: Toggle selection
84
84
  `+(this.maxChoices===void 0?` a: Toggle all
85
- `:"")+" enter/return: Complete answer":""}renderOption(e,r,i,n){let o=(r.selected?_e.green(st.radioOn):st.radioOff)+" "+n+" ",s,a;return r.disabled?s=e===i?_e.gray().underline(r.title):_e.strikethrough().gray(r.title):(s=e===i?_e.cyan().underline(r.title):r.title,e===i&&r.description&&(a=` - ${r.description}`,(o.length+s.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
86
- `+rk(r.description,{margin:o.length,width:this.out.columns})))),o+s+_e.gray(a||"")}paginateOptions(e){if(e.length===0)return _e.red("No matches for this query.");let{startIndex:r,endIndex:i}=ik(this.cursor,e.length,this.optionsPerPage),n,o=[];for(let s=r;s<i;s++)s===r&&r>0?n=st.arrowUp:s===i-1&&i<e.length?n=st.arrowDown:n=" ",o.push(this.renderOption(this.cursor,e[s],s,n));return `
85
+ `:"")+" enter/return: Complete answer":""}renderOption(e,r,i,n){let o=(r.selected?_e.green(ct.radioOn):ct.radioOff)+" "+n+" ",s,a;return r.disabled?s=e===i?_e.gray().underline(r.title):_e.strikethrough().gray(r.title):(s=e===i?_e.cyan().underline(r.title):r.title,e===i&&r.description&&(a=` - ${r.description}`,(o.length+s.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
86
+ `+lk(r.description,{margin:o.length,width:this.out.columns})))),o+s+_e.gray(a||"")}paginateOptions(e){if(e.length===0)return _e.red("No matches for this query.");let{startIndex:r,endIndex:i}=dk(this.cursor,e.length,this.optionsPerPage),n,o=[];for(let s=r;s<i;s++)s===r&&r>0?n=ct.arrowUp:s===i-1&&i<e.length?n=ct.arrowDown:n=" ",o.push(this.renderOption(this.cursor,e[s],s,n));return `
87
87
  `+o.join(`
88
- `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[_e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(_e.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(ek.hide),super.render();let e=[Kh.symbol(this.done,this.aborted),_e.bold(this.msg),Kh.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=_e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=Jh(e,this.out.columns);}};Xh.exports=rs;});var rp=g((KI,tp)=>{var Sr=H(),nk=ze(),{erase:ok,cursor:Zh}=Y(),{style:ns,clear:Qh,figures:os,wrap:sk,entriesToDisplay:ak}=we(),ep=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),ck=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),lk=(t,e)=>{let r=t.findIndex(i=>i.value===e||i.title===e);return r>-1?r:void 0},ss=class extends nk{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:lk(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||false,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=ns.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Qh("",this.out.columns),this.complete(this.render),this.render();}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e;}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=ep(this.suggestions,e):this.value=this.fallback.value,this.fire();}async complete(e){let r=this.completing=this.suggest(this.input,this.choices),i=await r;if(this.completing!==r)return;this.suggestions=i.map((o,s,a)=>({title:ck(a,s),value:ep(a,s),description:o.description})),this.completing=false;let n=Math.max(i.length-1,0);this.moveSelect(Math.min(n,this.select)),e&&e();}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render();}),this.render();}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
88
+ `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[_e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(_e.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(ak.hide),super.render();let e=[tp.symbol(this.done,this.aborted),_e.bold(this.msg),tp.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=_e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=ep(e,this.out.columns);}};rp.exports=ns;});var ap=g((n$,sp)=>{var Or=Y(),uk=Ge(),{erase:hk,cursor:ip}=J(),{style:ss,clear:np,figures:as,wrap:pk,entriesToDisplay:mk}=ve(),op=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),fk=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),gk=(t,e)=>{let r=t.findIndex(i=>i.value===e||i.title===e);return r>-1?r:void 0},cs=class extends uk{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:gk(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||false,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=ss.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=np("",this.out.columns),this.complete(this.render),this.render();}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e;}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=op(this.suggestions,e):this.value=this.fallback.value,this.fire();}async complete(e){let r=this.completing=this.suggest(this.input,this.choices),i=await r;if(this.completing!==r)return;this.suggestions=i.map((o,s,a)=>({title:fk(a,s),value:op(a,s),description:o.description})),this.completing=false;let n=Math.max(i.length-1,0);this.moveSelect(Math.min(n,this.select)),e&&e();}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render();}),this.render();}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
89
89
  `),this.close());}abort(){this.done=this.aborted=true,this.exited=false,this.fire(),this.render(),this.out.write(`
90
90
  `),this.close();}submit(){this.done=true,this.aborted=this.exited=false,this.fire(),this.render(),this.out.write(`
91
- `),this.close();}_(e,r){let i=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor);this.input=`${i}${e}${n}`,this.cursor=i.length+1,this.complete(this.render),this.render();}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render();}first(){this.moveSelect(0),this.render();}last(){this.moveSelect(this.suggestions.length-1),this.render();}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render();}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render();}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render();}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render();}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render();}renderOption(e,r,i,n){let o,s=i?os.arrowUp:n?os.arrowDown:" ",a=r?Sr.cyan().underline(e.title):e.title;return s=(r?Sr.cyan(os.pointer)+" ":" ")+s,e.description&&(o=` - ${e.description}`,(s.length+a.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
92
- `+sk(e.description,{margin:3,width:this.out.columns}))),s+" "+a+Sr.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Zh.hide):this.out.write(Qh(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=ak(this.select,this.choices.length,this.limit);if(this.outputText=[ns.symbol(this.done,this.aborted,this.exited),Sr.bold(this.msg),ns.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(e,r).map((n,o)=>this.renderOption(n,this.select===o+e,o===0&&e>0,o+e===r-1&&r<this.choices.length)).join(`
91
+ `),this.close();}_(e,r){let i=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor);this.input=`${i}${e}${n}`,this.cursor=i.length+1,this.complete(this.render),this.render();}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render();}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render();}first(){this.moveSelect(0),this.render();}last(){this.moveSelect(this.suggestions.length-1),this.render();}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render();}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render();}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render();}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render();}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render();}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render();}renderOption(e,r,i,n){let o,s=i?as.arrowUp:n?as.arrowDown:" ",a=r?Or.cyan().underline(e.title):e.title;return s=(r?Or.cyan(as.pointer)+" ":" ")+s,e.description&&(o=` - ${e.description}`,(s.length+a.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
92
+ `+pk(e.description,{margin:3,width:this.out.columns}))),s+" "+a+Or.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(ip.hide):this.out.write(np(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=mk(this.select,this.choices.length,this.limit);if(this.outputText=[ss.symbol(this.done,this.aborted,this.exited),Or.bold(this.msg),ss.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(e,r).map((n,o)=>this.renderOption(n,this.select===o+e,o===0&&e>0,o+e===r-1&&r<this.choices.length)).join(`
93
93
  `);this.outputText+=`
94
- `+(i||Sr.gray(this.fallback.title));}this.out.write(ok.line+Zh.to(0)+this.outputText);}};tp.exports=ss;});var sp=g((XI,op)=>{var Ve=H(),{cursor:dk}=Y(),uk=is(),{clear:ip,style:np,figures:Lt}=we(),as=class extends uk{constructor(e={}){e.overrideRender=true,super(e),this.inputValue="",this.clear=ip("",this.out.columns),this.filteredOptions=this.value,this.render();}last(){this.cursor=this.filteredOptions.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render();}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render();}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.filteredOptions[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true,this.render();}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions());}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):true);let r=this.filteredOptions.findIndex(i=>i===e);this.cursor=r<0?0:r,this.render();}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions();}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e);}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
94
+ `+(i||Or.gray(this.fallback.title));}this.out.write(hk.line+ip.to(0)+this.outputText);}};sp.exports=cs;});var up=g((o$,dp)=>{var We=Y(),{cursor:bk}=J(),yk=os(),{clear:cp,style:lp,figures:Ut}=ve(),ls=class extends yk{constructor(e={}){e.overrideRender=true,super(e),this.inputValue="",this.clear=cp("",this.out.columns),this.filteredOptions=this.value,this.render();}last(){this.cursor=this.filteredOptions.length-1,this.render();}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render();}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render();}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render();}left(){this.filteredOptions[this.cursor].selected=false,this.render();}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true,this.render();}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions());}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):true);let r=this.filteredOptions.findIndex(i=>i===e);this.cursor=r<0?0:r,this.render();}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=false,this.render();else {if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=true,this.render();}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions();}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e);}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
95
95
  Instructions:
96
- ${Lt.arrowUp}/${Lt.arrowDown}: Highlight option
97
- ${Lt.arrowLeft}/${Lt.arrowRight}/[space]: Toggle selection
96
+ ${Ut.arrowUp}/${Ut.arrowDown}: Highlight option
97
+ ${Ut.arrowLeft}/${Ut.arrowRight}/[space]: Toggle selection
98
98
  [a,b,c]/delete: Filter choices
99
99
  enter/return: Complete answer
100
100
  `:""}renderCurrentInput(){return `
101
- Filtered results for: ${this.inputValue?this.inputValue:Ve.gray("Enter something to filter")}
102
- `}renderOption(e,r,i){let n;return r.disabled?n=e===i?Ve.gray().underline(r.title):Ve.strikethrough().gray(r.title):n=e===i?Ve.cyan().underline(r.title):r.title,(r.selected?Ve.green(Lt.radioOn):Lt.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Ve.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Ve.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(dk.hide),super.render();let e=[np.symbol(this.done,this.aborted),Ve.bold(this.msg),np.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Ve.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=ip(e,this.out.columns);}};op.exports=as;});var up=g((ZI,dp)=>{var ap=H(),hk=ze(),{style:cp,clear:pk}=we(),{erase:mk,cursor:lp}=Y(),cs=class extends hk{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
101
+ Filtered results for: ${this.inputValue?this.inputValue:We.gray("Enter something to filter")}
102
+ `}renderOption(e,r,i){let n;return r.disabled?n=e===i?We.gray().underline(r.title):We.strikethrough().gray(r.title):n=e===i?We.cyan().underline(r.title):r.title,(r.selected?We.green(Ut.radioOn):Ut.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[We.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(We.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(bk.hide),super.render();let e=[lp.symbol(this.done,this.aborted),We.bold(this.msg),lp.delimiter(false),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=We.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=false),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=cp(e,this.out.columns);}};dp.exports=ls;});var gp=g((s$,fp)=>{var hp=Y(),wk=Ge(),{style:pp,clear:vk}=ve(),{erase:xk,cursor:mp}=J(),ds=class extends wk{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render();}reset(){this.value=this.initialValue,this.fire(),this.render();}exit(){this.abort();}abort(){this.done=this.aborted=true,this.fire(),this.render(),this.out.write(`
103
103
  `),this.close();}submit(){this.value=this.value||false,this.done=true,this.aborted=false,this.fire(),this.render(),this.out.write(`
104
- `),this.close();}_(e,r){return e.toLowerCase()==="y"?(this.value=true,this.submit()):e.toLowerCase()==="n"?(this.value=false,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(lp.hide):this.out.write(pk(this.outputText,this.out.columns)),super.render(),this.outputText=[cp.symbol(this.done,this.aborted),ap.bold(this.msg),cp.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:ap.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(mk.line+lp.to(0)+this.outputText));}};dp.exports=cs;});var pp=g((QI,hp)=>{hp.exports={TextPrompt:dh(),SelectPrompt:mh(),TogglePrompt:yh(),DatePrompt:Gh(),NumberPrompt:Yh(),MultiselectPrompt:is(),AutocompletePrompt:rp(),AutocompleteMultiselectPrompt:sp(),ConfirmPrompt:up()};});var fp=g(mp=>{var he=mp,fk=pp(),yi=t=>t;function De(t,e,r={}){return new Promise((i,n)=>{let o=new fk[t](e),s=r.onAbort||yi,a=r.onSubmit||yi,c=r.onExit||yi;o.on("state",e.onState||yi),o.on("submit",d=>i(a(d))),o.on("exit",d=>i(c(d))),o.on("abort",d=>n(s(d)));})}he.text=t=>De("TextPrompt",t);he.password=t=>(t.style="password",he.text(t));he.invisible=t=>(t.style="invisible",he.text(t));he.number=t=>De("NumberPrompt",t);he.date=t=>De("DatePrompt",t);he.confirm=t=>De("ConfirmPrompt",t);he.list=t=>{let e=t.separator||",";return De("TextPrompt",t,{onSubmit:r=>r.split(e).map(i=>i.trim())})};he.toggle=t=>De("TogglePrompt",t);he.select=t=>De("SelectPrompt",t);he.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return De("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};he.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return De("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var gk=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));he.autocomplete=t=>(t.suggest=t.suggest||gk,t.choices=[].concat(t.choices||[]),De("AutocompletePrompt",t));});var yp=g((t$,bp)=>{var ls=fp(),bk=["suggest","format","onState","validate","onRender","type"],gp=()=>{};async function at(t=[],{onSubmit:e=gp,onCancel:r=gp}={}){let i={},n=at._override||{};t=[].concat(t);let o,s,a,c,d,l,u=async(h,p,f=false)=>{if(!(!f&&h.validate&&h.validate(p)!==true))return h.format?await h.format(p,i):p};for(s of t)if({name:c,type:d}=s,typeof d=="function"&&(d=await d(o,{...i},s),s.type=d),!!d){for(let h in s){if(bk.includes(h))continue;let p=s[h];s[h]=typeof p=="function"?await p(o,{...i},l):p;}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");if({name:c,type:d}=s,ls[d]===void 0)throw new Error(`prompt type (${d}) is not defined`);if(n[s.name]!==void 0&&(o=await u(s,n[s.name]),o!==void 0)){i[c]=o;continue}try{o=at._injected?yk(at._injected,s.initial):await ls[d](s),i[c]=o=await u(s,o,!0),a=await e(s,o,i);}catch{a=!await r(s,i);}if(a)return i}return i}function yk(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function wk(t){at._injected=(at._injected||[]).concat(t);}function vk(t){at._override=Object.assign({},t);}bp.exports=Object.assign(at,{prompt:at,prompts:ls,inject:wk,override:vk});});var ds=g((r$,wp)=>{function xk(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let e=0,r=process.versions.node.split(".").map(Number);for(;e<t.length;e++){if(r[e]>t[e])return false;if(t[e]>r[e])return true}return false}wp.exports=xk("8.6.0")?Gu():yp();});var rm=g((E2,tm)=>{tm.exports=em;em.sync=SC;var Zp=F("fs");function xC(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return true;for(var i=0;i<r.length;i++){var n=r[i].toLowerCase();if(n&&t.substr(-n.length).toLowerCase()===n)return true}return false}function Qp(t,e,r){return !t.isSymbolicLink()&&!t.isFile()?false:xC(e,r)}function em(t,e,r){Zp.stat(t,function(i,n){r(i,i?false:Qp(n,t,e));});}function SC(t,e){return Qp(Zp.statSync(t),t,e)}});var am=g((T2,sm)=>{sm.exports=nm;nm.sync=kC;var im=F("fs");function nm(t,e,r){im.stat(t,function(i,n){r(i,i?false:om(n,e));});}function kC(t,e){return om(im.statSync(t),e)}function om(t,e){return t.isFile()&&CC(t,e)}function CC(t,e){var r=t.mode,i=t.uid,n=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),d=parseInt("001",8),l=a|c,u=r&d||r&c&&n===s||r&a&&i===o||r&l&&o===0;return u}});var lm=g((_2,cm)=>{F("fs");var $i;process.platform==="win32"||global.TESTING_WINDOWS?$i=rm():$i=am();cm.exports=xs;xs.sync=OC;function xs(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){xs(t,e||{},function(o,s){o?n(o):i(s);});})}$i(t,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=false),r(i,n);});}function OC(t,e){try{return $i.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return false;throw r}}});var gm=g((D2,fm)=>{var Gt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",dm=F("path"),EC=Gt?";":":",um=lm(),hm=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),pm=(t,e)=>{let r=e.colon||EC,i=t.match(/\//)||Gt&&t.match(/\\/)?[""]:[...Gt?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],n=Gt?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=Gt?n.split(r):[""];return Gt&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:n}},mm=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:o}=pm(t,e),s=[],a=d=>new Promise((l,u)=>{if(d===i.length)return e.all&&s.length?l(s):u(hm(t));let h=i[d],p=/^".*"$/.test(h)?h.slice(1,-1):h,f=dm.join(p,t),b=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+f:f;l(c(b,d,0));}),c=(d,l,u)=>new Promise((h,p)=>{if(u===n.length)return h(a(l+1));let f=n[u];um(d+f,{pathExt:o},(b,v)=>{if(!b&&v)if(e.all)s.push(d+f);else return h(d+f);return h(c(d,l,u+1))});});return r?a(0).then(d=>r(null,d),r):a(0)},TC=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=pm(t,e),o=[];for(let s=0;s<r.length;s++){let a=r[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,d=dm.join(c,t),l=!c&&/^\.[\\\/]/.test(t)?t.slice(0,2)+d:d;for(let u=0;u<i.length;u++){let h=l+i[u];try{if(um.sync(h,{pathExt:n}))if(e.all)o.push(h);else return h}catch{}}}if(e.all&&o.length)return o;if(e.nothrow)return null;throw hm(t)};fm.exports=mm;mm.sync=TC;});var ym=g((P2,Ss)=>{var bm=(t={})=>{let e=t.env||process.env;return (t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};Ss.exports=bm;Ss.exports.default=bm;});var Sm=g((I2,xm)=>{var wm=F("path"),AC=gm(),_C=ym();function vm(t,e){let r=t.options.env||process.env,i=process.cwd(),n=t.options.cwd!=null,o=n&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd);}catch{}let s;try{s=AC.sync(t.command,{path:r[_C({env:r})],pathExt:e?wm.delimiter:void 0});}catch{}finally{o&&process.chdir(i);}return s&&(s=wm.resolve(n?t.options.cwd:"",s)),s}function DC(t){return vm(t)||vm(t,true)}xm.exports=DC;});var km=g(($2,Cs)=>{var ks=/([()\][%!^"`<>&|;, *?])/g;function PC(t){return t=t.replace(ks,"^$1"),t}function IC(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(ks,"^$1"),e&&(t=t.replace(ks,"^$1")),t}Cs.exports.command=PC;Cs.exports.argument=IC;});var Om=g((R2,Cm)=>{Cm.exports=/^#!(.*)/;});var Tm=g((M2,Em)=>{var $C=Om();Em.exports=(t="")=>{let e=t.match($C);if(!e)return null;let[r,i]=e[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n};});var _m=g((F2,Am)=>{var Os=F("fs"),RC=Tm();function MC(t){let r=Buffer.alloc(150),i;try{i=Os.openSync(t,"r"),Os.readSync(i,r,0,150,0),Os.closeSync(i);}catch{}return RC(r.toString())}Am.exports=MC;});var $m=g((j2,Im)=>{var FC=F("path"),Dm=Sm(),Pm=km(),jC=_m(),NC=process.platform==="win32",LC=/\.(?:com|exe)$/i,qC=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function BC(t){t.file=Dm(t);let e=t.file&&jC(t.file);return e?(t.args.unshift(t.file),t.command=e,Dm(t)):t.file}function UC(t){if(!NC)return t;let e=BC(t),r=!LC.test(e);if(t.options.forceShell||r){let i=qC.test(e);t.command=FC.normalize(t.command),t.command=Pm.command(t.command),t.args=t.args.map(o=>Pm.argument(o,i));let n=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${n}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=true;}return t}function zC(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let i={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?i:UC(i)}Im.exports=zC;});var Fm=g((N2,Mm)=>{var Es=process.platform==="win32";function Ts(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function GC(t,e){if(!Es)return;let r=t.emit;t.emit=function(i,n){if(i==="exit"){let o=Rm(n,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)};}function Rm(t,e){return Es&&t===1&&!e.file?Ts(e.original,"spawn"):null}function VC(t,e){return Es&&t===1&&!e.file?Ts(e.original,"spawnSync"):null}Mm.exports={hookChildProcess:GC,verifyENOENT:Rm,verifyENOENTSync:VC,notFoundError:Ts};});var Lm=g((L2,Vt)=>{var jm=F("child_process"),As=$m(),_s=Fm();function Nm(t,e,r){let i=As(t,e,r),n=jm.spawn(i.command,i.args,i.options);return _s.hookChildProcess(n,i),n}function WC(t,e,r){let i=As(t,e,r),n=jm.spawnSync(i.command,i.args,i.options);return n.error=n.error||_s.verifyENOENTSync(n.status,i),n}Vt.exports=Nm;Vt.exports.spawn=Nm;Vt.exports.sync=WC;Vt.exports._parse=As;Vt.exports._enoent=_s;});var Xe=class extends Error{constructor(e,r,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0;}},mt=class extends Xe{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var ir=class{constructor(e,r){switch(this.description=r||"",this.variadic=false,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case "<":this.required=true,this._name=e.slice(1,-1);break;case "[":this.required=false,this._name=e.slice(1,-1);break;default:this.required=true,this._name=e;break}this._name.endsWith("...")&&(this.variadic=true,this._name=this._name.slice(0,-3));}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new mt(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}argRequired(){return this.required=true,this}argOptional(){return this.required=false,this}};function Gr(t){let e=t.name()+(t.variadic===true?"...":"");return t.required?"<"+e+">":"["+e+"]"}var nr=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=false,this.sortOptions=false,this.showGlobalOptions=false;}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80;}visibleCommands(e){let r=e.commands.filter(n=>!n._hidden),i=e._getHelpCommand();return i&&!i._hidden&&r.push(i),this.sortSubcommands&&r.sort((n,o)=>n.name().localeCompare(o.name())),r}compareOptions(e,r){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(e).localeCompare(i(r))}visibleOptions(e){let r=e.options.filter(n=>!n.hidden),i=e._getHelpOption();if(i&&!i.hidden){let n=i.short&&e._findOption(i.short),o=i.long&&e._findOption(i.long);!n&&!o?r.push(i):i.long&&!o?r.push(e.createOption(i.long,i.description)):i.short&&!n&&r.push(e.createOption(i.short,i.description));}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return [];let r=[];for(let i=e.parent;i;i=i.parent){let n=i.options.filter(o=>!o.hidden);r.push(...n);}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||"";}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(i=>Gr(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let i="";for(let n=e.parent;n;n=n.parent)i=n.name()+" "+i;return i+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let i=`(${r.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let i=`(${r.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatItemList(e,r,i){return r.length===0?[]:[i.styleTitle(e),...r,""]}groupItems(e,r,i){let n=new Map;return e.forEach(o=>{let s=i(o);n.has(s)||n.set(s,[]);}),r.forEach(o=>{let s=i(o);n.has(s)||n.set(s,[]),n.get(s).push(o);}),n}formatHelp(e,r){let i=r.padWidth(e,r),n=r.helpWidth??80;function o(u,h){return r.formatItem(u,i,h,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),n),""]));let c=r.visibleArguments(e).map(u=>o(r.styleArgumentTerm(r.argumentTerm(u)),r.styleArgumentDescription(r.argumentDescription(u))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),u=>u.helpGroupHeading??"Options:").forEach((u,h)=>{let p=u.map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));s=s.concat(this.formatItemList(h,p,r));}),r.showGlobalOptions){let u=r.visibleGlobalOptions(e).map(h=>o(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));s=s.concat(this.formatItemList("Global Options:",u,r));}return this.groupItems(e.commands,r.visibleCommands(e),u=>u.helpGroup()||"Commands:").forEach((u,h)=>{let p=u.map(f=>o(r.styleSubcommandTerm(r.subcommandTerm(f)),r.styleSubcommandDescription(r.subcommandDescription(f))));s=s.concat(this.formatItemList(h,p,r));}),s.join(`
104
+ `),this.close();}_(e,r){return e.toLowerCase()==="y"?(this.value=true,this.submit()):e.toLowerCase()==="n"?(this.value=false,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(mp.hide):this.out.write(vk(this.outputText,this.out.columns)),super.render(),this.outputText=[pp.symbol(this.done,this.aborted),hp.bold(this.msg),pp.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:hp.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(xk.line+mp.to(0)+this.outputText));}};fp.exports=ds;});var yp=g((a$,bp)=>{bp.exports={TextPrompt:fh(),SelectPrompt:wh(),TogglePrompt:kh(),DatePrompt:Jh(),NumberPrompt:Qh(),MultiselectPrompt:os(),AutocompletePrompt:ap(),AutocompleteMultiselectPrompt:up(),ConfirmPrompt:gp()};});var vp=g(wp=>{var he=wp,Sk=yp(),xi=t=>t;function Pe(t,e,r={}){return new Promise((i,n)=>{let o=new Sk[t](e),s=r.onAbort||xi,a=r.onSubmit||xi,c=r.onExit||xi;o.on("state",e.onState||xi),o.on("submit",d=>i(a(d))),o.on("exit",d=>i(c(d))),o.on("abort",d=>n(s(d)));})}he.text=t=>Pe("TextPrompt",t);he.password=t=>(t.style="password",he.text(t));he.invisible=t=>(t.style="invisible",he.text(t));he.number=t=>Pe("NumberPrompt",t);he.date=t=>Pe("DatePrompt",t);he.confirm=t=>Pe("ConfirmPrompt",t);he.list=t=>{let e=t.separator||",";return Pe("TextPrompt",t,{onSubmit:r=>r.split(e).map(i=>i.trim())})};he.toggle=t=>Pe("TogglePrompt",t);he.select=t=>Pe("SelectPrompt",t);he.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Pe("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};he.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(i=>i.selected).map(i=>i.value);return Pe("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var kk=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));he.autocomplete=t=>(t.suggest=t.suggest||kk,t.choices=[].concat(t.choices||[]),Pe("AutocompletePrompt",t));});var kp=g((l$,Sp)=>{var us=vp(),Ck=["suggest","format","onState","validate","onRender","type"],xp=()=>{};async function lt(t=[],{onSubmit:e=xp,onCancel:r=xp}={}){let i={},n=lt._override||{};t=[].concat(t);let o,s,a,c,d,l,u=async(h,p,m=false)=>{if(!(!m&&h.validate&&h.validate(p)!==true))return h.format?await h.format(p,i):p};for(s of t)if({name:c,type:d}=s,typeof d=="function"&&(d=await d(o,{...i},s),s.type=d),!!d){for(let h in s){if(Ck.includes(h))continue;let p=s[h];s[h]=typeof p=="function"?await p(o,{...i},l):p;}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");if({name:c,type:d}=s,us[d]===void 0)throw new Error(`prompt type (${d}) is not defined`);if(n[s.name]!==void 0&&(o=await u(s,n[s.name]),o!==void 0)){i[c]=o;continue}try{o=lt._injected?Ok(lt._injected,s.initial):await us[d](s),i[c]=o=await u(s,o,!0),a=await e(s,o,i);}catch{a=!await r(s,i);}if(a)return i}return i}function Ok(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function Ek(t){lt._injected=(lt._injected||[]).concat(t);}function Tk(t){lt._override=Object.assign({},t);}Sp.exports=Object.assign(lt,{prompt:lt,prompts:us,inject:Ek,override:Tk});});var hs=g((d$,Cp)=>{function Ak(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let e=0,r=process.versions.node.split(".").map(Number);for(;e<t.length;e++){if(r[e]>t[e])return false;if(t[e]>r[e])return true}return false}Cp.exports=Ak("8.6.0")?Ju():kp();});var am=g((R2,sm)=>{sm.exports=om;om.sync=_C;var im=F("fs");function AC(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return true;for(var i=0;i<r.length;i++){var n=r[i].toLowerCase();if(n&&t.substr(-n.length).toLowerCase()===n)return true}return false}function nm(t,e,r){return !t.isSymbolicLink()&&!t.isFile()?false:AC(e,r)}function om(t,e,r){im.stat(t,function(i,n){r(i,i?false:nm(n,t,e));});}function _C(t,e){return nm(im.statSync(t),t,e)}});var hm=g((M2,um)=>{um.exports=lm;lm.sync=PC;var cm=F("fs");function lm(t,e,r){cm.stat(t,function(i,n){r(i,i?false:dm(n,e));});}function PC(t,e){return dm(cm.statSync(t),e)}function dm(t,e){return t.isFile()&&DC(t,e)}function DC(t,e){var r=t.mode,i=t.uid,n=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),d=parseInt("001",8),l=a|c,u=r&d||r&c&&n===s||r&a&&i===o||r&l&&o===0;return u}});var mm=g((j2,pm)=>{F("fs");var Fi;process.platform==="win32"||global.TESTING_WINDOWS?Fi=am():Fi=hm();pm.exports=ks;ks.sync=IC;function ks(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){ks(t,e||{},function(o,s){o?n(o):i(s);});})}Fi(t,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=false),r(i,n);});}function IC(t,e){try{return Fi.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return false;throw r}}});var xm=g((N2,vm)=>{var Ht=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",fm=F("path"),$C=Ht?";":":",gm=mm(),bm=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),ym=(t,e)=>{let r=e.colon||$C,i=t.match(/\//)||Ht&&t.match(/\\/)?[""]:[...Ht?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],n=Ht?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=Ht?n.split(r):[""];return Ht&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:n}},wm=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:o}=ym(t,e),s=[],a=d=>new Promise((l,u)=>{if(d===i.length)return e.all&&s.length?l(s):u(bm(t));let h=i[d],p=/^".*"$/.test(h)?h.slice(1,-1):h,m=fm.join(p,t),b=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;l(c(b,d,0));}),c=(d,l,u)=>new Promise((h,p)=>{if(u===n.length)return h(a(l+1));let m=n[u];gm(d+m,{pathExt:o},(b,y)=>{if(!b&&y)if(e.all)s.push(d+m);else return h(d+m);return h(c(d,l,u+1))});});return r?a(0).then(d=>r(null,d),r):a(0)},RC=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:i,pathExtExe:n}=ym(t,e),o=[];for(let s=0;s<r.length;s++){let a=r[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,d=fm.join(c,t),l=!c&&/^\.[\\\/]/.test(t)?t.slice(0,2)+d:d;for(let u=0;u<i.length;u++){let h=l+i[u];try{if(gm.sync(h,{pathExt:n}))if(e.all)o.push(h);else return h}catch{}}}if(e.all&&o.length)return o;if(e.nothrow)return null;throw bm(t)};vm.exports=wm;wm.sync=RC;});var km=g((q2,Cs)=>{var Sm=(t={})=>{let e=t.env||process.env;return (t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};Cs.exports=Sm;Cs.exports.default=Sm;});var Tm=g((L2,Em)=>{var Cm=F("path"),MC=xm(),FC=km();function Om(t,e){let r=t.options.env||process.env,i=process.cwd(),n=t.options.cwd!=null,o=n&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd);}catch{}let s;try{s=MC.sync(t.command,{path:r[FC({env:r})],pathExt:e?Cm.delimiter:void 0});}catch{}finally{o&&process.chdir(i);}return s&&(s=Cm.resolve(n?t.options.cwd:"",s)),s}function jC(t){return Om(t)||Om(t,true)}Em.exports=jC;});var Am=g((B2,Es)=>{var Os=/([()\][%!^"`<>&|;, *?])/g;function NC(t){return t=t.replace(Os,"^$1"),t}function qC(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(Os,"^$1"),e&&(t=t.replace(Os,"^$1")),t}Es.exports.command=NC;Es.exports.argument=qC;});var Pm=g((U2,_m)=>{_m.exports=/^#!(.*)/;});var Im=g((z2,Dm)=>{var LC=Pm();Dm.exports=(t="")=>{let e=t.match(LC);if(!e)return null;let[r,i]=e[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n};});var Rm=g((G2,$m)=>{var Ts=F("fs"),BC=Im();function UC(t){let r=Buffer.alloc(150),i;try{i=Ts.openSync(t,"r"),Ts.readSync(i,r,0,150,0),Ts.closeSync(i);}catch{}return BC(r.toString())}$m.exports=UC;});var Nm=g((V2,jm)=>{var zC=F("path"),Mm=Tm(),Fm=Am(),GC=Rm(),VC=process.platform==="win32",WC=/\.(?:com|exe)$/i,HC=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function YC(t){t.file=Mm(t);let e=t.file&&GC(t.file);return e?(t.args.unshift(t.file),t.command=e,Mm(t)):t.file}function JC(t){if(!VC)return t;let e=YC(t),r=!WC.test(e);if(t.options.forceShell||r){let i=HC.test(e);t.command=zC.normalize(t.command),t.command=Fm.command(t.command),t.args=t.args.map(o=>Fm.argument(o,i));let n=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${n}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=true;}return t}function KC(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let i={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?i:JC(i)}jm.exports=KC;});var Bm=g((W2,Lm)=>{var As=process.platform==="win32";function _s(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function XC(t,e){if(!As)return;let r=t.emit;t.emit=function(i,n){if(i==="exit"){let o=qm(n,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)};}function qm(t,e){return As&&t===1&&!e.file?_s(e.original,"spawn"):null}function ZC(t,e){return As&&t===1&&!e.file?_s(e.original,"spawnSync"):null}Lm.exports={hookChildProcess:XC,verifyENOENT:qm,verifyENOENTSync:ZC,notFoundError:_s};});var Gm=g((H2,Yt)=>{var Um=F("child_process"),Ps=Nm(),Ds=Bm();function zm(t,e,r){let i=Ps(t,e,r),n=Um.spawn(i.command,i.args,i.options);return Ds.hookChildProcess(n,i),n}function QC(t,e,r){let i=Ps(t,e,r),n=Um.spawnSync(i.command,i.args,i.options);return n.error=n.error||Ds.verifyENOENTSync(n.status,i),n}Yt.exports=zm;Yt.exports.spawn=zm;Yt.exports.sync=QC;Yt.exports._parse=Ps;Yt.exports._enoent=Ds;});var et=class extends Error{constructor(e,r,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0;}},ft=class extends et{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name;}};var sr=class{constructor(e,r){switch(this.description=r||"",this.variadic=false,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case "<":this.required=true,this._name=e.slice(1,-1);break;case "[":this.required=false,this._name=e.slice(1,-1);break;default:this.required=true,this._name=e;break}this._name.endsWith("...")&&(this.variadic=true,this._name=this._name.slice(0,-3));}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new ft(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}argRequired(){return this.required=true,this}argOptional(){return this.required=false,this}};function Hr(t){let e=t.name()+(t.variadic===true?"...":"");return t.required?"<"+e+">":"["+e+"]"}var ar=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=false,this.sortOptions=false,this.showGlobalOptions=false;}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80;}visibleCommands(e){let r=e.commands.filter(n=>!n._hidden),i=e._getHelpCommand();return i&&!i._hidden&&r.push(i),this.sortSubcommands&&r.sort((n,o)=>n.name().localeCompare(o.name())),r}compareOptions(e,r){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(e).localeCompare(i(r))}visibleOptions(e){let r=e.options.filter(n=>!n.hidden),i=e._getHelpOption();if(i&&!i.hidden){let n=i.short&&e._findOption(i.short),o=i.long&&e._findOption(i.long);!n&&!o?r.push(i):i.long&&!o?r.push(e.createOption(i.long,i.description)):i.short&&!n&&r.push(e.createOption(i.short,i.description));}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return [];let r=[];for(let i=e.parent;i;i=i.parent){let n=i.options.filter(o=>!o.hidden);r.push(...n);}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||"";}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(i=>Hr(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let i="";for(let n=e.parent;n;n=n.parent)i=n.name()+" "+i;return i+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let i=`(${r.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let i=`(${r.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatItemList(e,r,i){return r.length===0?[]:[i.styleTitle(e),...r,""]}groupItems(e,r,i){let n=new Map;return e.forEach(o=>{let s=i(o);n.has(s)||n.set(s,[]);}),r.forEach(o=>{let s=i(o);n.has(s)||n.set(s,[]),n.get(s).push(o);}),n}formatHelp(e,r){let i=r.padWidth(e,r),n=r.helpWidth??80;function o(u,h){return r.formatItem(u,i,h,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),n),""]));let c=r.visibleArguments(e).map(u=>o(r.styleArgumentTerm(r.argumentTerm(u)),r.styleArgumentDescription(r.argumentDescription(u))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),u=>u.helpGroupHeading??"Options:").forEach((u,h)=>{let p=u.map(m=>o(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList(h,p,r));}),r.showGlobalOptions){let u=r.visibleGlobalOptions(e).map(h=>o(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));s=s.concat(this.formatItemList("Global Options:",u,r));}return this.groupItems(e.commands,r.visibleCommands(e),u=>u.helpGroup()||"Commands:").forEach((u,h)=>{let p=u.map(m=>o(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(h,p,r));}),s.join(`
105
105
  `)}displayWidth(e){return util.stripVTControlCharacters(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return /\n[^\S\r\n]/.test(e)}formatItem(e,r,i,n){let s=" ".repeat(2);if(!i)return s+e;let a=e.padEnd(r+e.length-n.displayWidth(e)),c=2,l=(this.helpWidth??80)-r-c-2,u;return l<this.minWidthToWrap||n.preformatted(i)?u=i:u=n.boxWrap(i,l).replace(/\n/g,`
106
106
  `+" ".repeat(r+c)),s+a+" ".repeat(c)+u.replace(/\n/g,`
107
107
  ${s}`)}boxWrap(e,r){if(r<this.minWidthToWrap)return e;let i=e.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,o=[];return i.forEach(s=>{let a=s.match(n);if(a===null){o.push("");return}let c=[a.shift()],d=this.displayWidth(c[0]);a.forEach(l=>{let u=this.displayWidth(l);if(d+u<=r){c.push(l),d+=u;return}o.push(c.join(""));let h=l.trimStart();c=[h],d=this.displayWidth(h);}),o.push(c.join(""));}),o.join(`
108
- `)}};var _t=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=false;let i=pw(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=false,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=false,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0;}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:true}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=true){return this.mandatory=!!e,this}hideHelp(e=true){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new mt(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Ya(this.name().replace(/^no-/,"")):Ya(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return !this.required&&!this.optional&&!this.negate}},Vr=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r);}),this.negativeOptions.forEach((r,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i);});}valueFromOption(e,r){let i=r.attributeName();if(!this.dualOptions.has(i))return true;let n=this.negativeOptions.get(i).presetArg,o=n!==void 0?n:false;return r.negate===(o===e)}};function Ya(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function pw(t){let e,r,i=/^-[^-]$/,n=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(i.test(o[0])&&(e=o.shift()),n.test(o[0])&&(r=o.shift()),!e&&i.test(o[0])&&(e=o.shift()),!e&&n.test(o[0])&&(e=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw /^-[^-][^-]/.test(s)?new Error(`${a}
108
+ `)}};var It=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=false;let i=vw(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=false,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=false,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0;}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:true}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=true){return this.mandatory=!!e,this}hideHelp(e=true){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new ft(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Qa(this.name().replace(/^no-/,"")):Qa(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return !this.required&&!this.optional&&!this.negate}},Yr=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r);}),this.negativeOptions.forEach((r,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i);});}valueFromOption(e,r){let i=r.attributeName();if(!this.dualOptions.has(i))return true;let n=this.negativeOptions.get(i).presetArg,o=n!==void 0?n:false;return r.negate===(o===e)}};function Qa(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function vw(t){let e,r,i=/^-[^-]$/,n=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(i.test(o[0])&&(e=o.shift()),n.test(o[0])&&(r=o.shift()),!e&&i.test(o[0])&&(e=o.shift()),!e&&n.test(o[0])&&(e=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw /^-[^-][^-]/.test(s)?new Error(`${a}
109
109
  - a short flag is a single dash and a single character
110
110
  - either use a single dash and a single character (for a short flag)
111
111
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):i.test(s)?new Error(`${a}
112
112
  - too many short flags`):n.test(s)?new Error(`${a}
113
113
  - too many long flags`):new Error(`${a}
114
- - unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return {shortFlag:e,longFlag:r}}function mw(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let i=0;i<=t.length;i++)r[i]=[i];for(let i=0;i<=e.length;i++)r[0][i]=i;for(let i=1;i<=e.length;i++)for(let n=1;n<=t.length;n++){let o;t[n-1]===e[i-1]?o=0:o=1,r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+o),n>1&&i>1&&t[n-1]===e[i-2]&&t[n-2]===e[i-1]&&(r[n][i]=Math.min(r[n][i],r[n-2][i-2]+1));}return r[t.length][e.length]}function jn(t,e){if(!e||e.length===0)return "";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let i=[],n=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=mw(t,s),c=Math.max(t.length,s.length);(c-a)/c>o&&(a<n?(n=a,i=[s]):a===n&&i.push(s));}),i.sort((s,a)=>s.localeCompare(a)),r&&(i=i.map(s=>`--${s}`)),i.length>1?`
114
+ - unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return {shortFlag:e,longFlag:r}}function xw(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let i=0;i<=t.length;i++)r[i]=[i];for(let i=0;i<=e.length;i++)r[0][i]=i;for(let i=1;i<=e.length;i++)for(let n=1;n<=t.length;n++){let o;t[n-1]===e[i-1]?o=0:o=1,r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+o),n>1&&i>1&&t[n-1]===e[i-2]&&t[n-2]===e[i-1]&&(r[n][i]=Math.min(r[n][i],r[n-2][i-2]+1));}return r[t.length][e.length]}function qn(t,e){if(!e||e.length===0)return "";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let i=[],n=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=xw(t,s),c=Math.max(t.length,s.length);(c-a)/c>o&&(a<n?(n=a,i=[s]):a===n&&i.push(s));}),i.sort((s,a)=>s.localeCompare(a)),r&&(i=i.map(s=>`--${s}`)),i.length>1?`
115
115
  (Did you mean one of ${i.join(", ")}?)`:i.length===1?`
116
- (Did you mean ${i[0]}?)`:""}var Dt=class t extends events.EventEmitter{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=false,this._allowExcessArguments=false,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=false,this._actionHandler=null,this._executableHandler=false,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=true,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=false,this._passThroughOptions=false,this._lifeCycleHooks={},this._showHelpAfterError=false,this._showSuggestionAfterError=true,this._savedState=null,this._outputConfiguration={writeOut:r=>R__default.default.stdout.write(r),writeErr:r=>R__default.default.stderr.write(r),outputError:(r,i)=>i(r),getOutHelpWidth:()=>R__default.default.stdout.isTTY?R__default.default.stdout.columns:void 0,getErrHelpWidth:()=>R__default.default.stderr.isTTY?R__default.default.stderr.columns:void 0,getOutHasColors:()=>Ka()??(R__default.default.stdout.isTTY&&R__default.default.stdout.hasColors?.()),getErrHasColors:()=>Ka()??(R__default.default.stderr.isTTY&&R__default.default.stderr.hasColors?.()),stripColor:r=>util.stripVTControlCharacters(r)},this._hidden=false,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0;}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,i){let n=r,o=i;typeof n=="object"&&n!==null&&(o=n,n=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return n&&(c.description(n),c._executableHandler=true),o.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),n?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new nr,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=true){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=true){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
117
- - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=true),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new ir(e,r)}argument(e,r,i,n){let o=this.createArgument(e,r);return typeof i=="function"?o.default(n).argParser(i):o.default(i),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r);}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=e??"help [command]",[,n,o]=i.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(n);return a.helpOption(false),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=true,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=true,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let i=["preSubcommand","preAction","postAction"];if(!i.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
118
- Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,i){this._exitCallback&&this._exitCallback(new Xe(e,r,i)),R__default.default.exit(e);}action(e){let r=i=>{let n=this.registeredArguments.length,o=i.slice(0,n);return this._storeOptionsAsProperties?o[n]=this:o[n]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new _t(e,r)}_callParseArg(e,r,i,n){try{return e.parseArg(r,i)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${n} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code});}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let i=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
119
- - already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e);}_registerCommand(e){let r=n=>[n.name()].concat(n.aliases()),i=r(e).find(n=>this._findCommand(n));if(i){let n=r(this._findCommand(i)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${n}'`)}this._initCommandGroup(e),this.commands.push(e);}addOption(e){this._registerOption(e);let r=e.name(),i=e.attributeName();e.defaultValue!==void 0&&this.setOptionValueWithSource(i,e.defaultValue,"default");let n=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let c=this.getOptionValue(i);o!==null&&e.parseArg?o=this._callParseArg(e,o,c,s):o!==null&&e.variadic&&(o=e._collectValue(o,c)),o==null&&(e.negate?o=false:e.isBoolean()||e.optional?o=true:o=""),this.setOptionValueWithSource(i,o,a);};return this.on("option:"+r,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;n(o,s,"cli");}),e.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;n(o,s,"env");}),this}_optionEx(e,r,i,n,o){if(typeof r=="object"&&r instanceof _t)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,i);if(s.makeOptionMandatory(!!e.mandatory),typeof n=="function")s.default(o).argParser(n);else if(n instanceof RegExp){let a=n;n=(c,d)=>{let l=a.exec(c);return l?l[0]:d},s.default(o).argParser(n);}else s.default(n);return this.addOption(s)}option(e,r,i,n){return this._optionEx({},e,r,i,n)}requiredOption(e,r,i,n){return this._optionEx({mandatory:true},e,r,i,n)}combineFlagAndOptionalValue(e=true){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=true){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=true){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=true){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=true){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=true){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,i){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=i,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(e)!==void 0&&(r=i.getOptionValueSource(e));}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){R__default.default.versions?.electron&&(r.from="electron");let n=R__default.default.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval");}e===void 0&&(e=R__default.default.argv),this.rawArgs=e.slice();let i;switch(r.from){case void 0:case "node":this._scriptPath=e[1],i=e.slice(2);break;case "electron":R__default.default.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case "user":i=e.slice(0);break;case "eval":i=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return !this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(e,r){this._prepareForParse();let i=this._prepareUserArgs(e,r);return this._parseCommand([],i),this}async parseAsync(e,r){this._prepareForParse();let i=this._prepareUserArgs(e,r);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?(this.options.filter(e=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach(e=>{let r=e.long.replace(/^--no-/,"--");this._findOption(r)||this.setOptionValueWithSource(e.attributeName(),true,"default");}),this.saveStateBeforeParse()):this.restoreStateBeforeParse();}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}};}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
120
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[];}_checkForMissingExecutable(e,r,i){if(Wr__default.default.existsSync(e))return;let n=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist
116
+ (Did you mean ${i[0]}?)`:""}var $t=class t extends events.EventEmitter{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=false,this._allowExcessArguments=false,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=false,this._actionHandler=null,this._executableHandler=false,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=true,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=false,this._passThroughOptions=false,this._lifeCycleHooks={},this._showHelpAfterError=false,this._showSuggestionAfterError=true,this._savedState=null,this._outputConfiguration={writeOut:r=>$__default.default.stdout.write(r),writeErr:r=>$__default.default.stderr.write(r),outputError:(r,i)=>i(r),getOutHelpWidth:()=>$__default.default.stdout.isTTY?$__default.default.stdout.columns:void 0,getErrHelpWidth:()=>$__default.default.stderr.isTTY?$__default.default.stderr.columns:void 0,getOutHasColors:()=>tc()??($__default.default.stdout.isTTY&&$__default.default.stdout.hasColors?.()),getErrHasColors:()=>tc()??($__default.default.stderr.isTTY&&$__default.default.stderr.hasColors?.()),stripColor:r=>util.stripVTControlCharacters(r)},this._hidden=false,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0;}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,i){let n=r,o=i;typeof n=="object"&&n!==null&&(o=n,n=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return n&&(c.description(n),c._executableHandler=true),o.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),n?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new ar,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=true){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=true){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
117
+ - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=true),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new sr(e,r)}argument(e,r,i,n){let o=this.createArgument(e,r);return typeof i=="function"?o.default(n).argParser(i):o.default(i),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r);}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=e??"help [command]",[,n,o]=i.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(n);return a.helpOption(false),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=true,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=true,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let i=["preSubcommand","preAction","postAction"];if(!i.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
118
+ Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,i){this._exitCallback&&this._exitCallback(new et(e,r,i)),$__default.default.exit(e);}action(e){let r=i=>{let n=this.registeredArguments.length,o=i.slice(0,n);return this._storeOptionsAsProperties?o[n]=this:o[n]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new It(e,r)}_callParseArg(e,r,i,n){try{return e.parseArg(r,i)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${n} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code});}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let i=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
119
+ - already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e);}_registerCommand(e){let r=n=>[n.name()].concat(n.aliases()),i=r(e).find(n=>this._findCommand(n));if(i){let n=r(this._findCommand(i)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${n}'`)}this._initCommandGroup(e),this.commands.push(e);}addOption(e){this._registerOption(e);let r=e.name(),i=e.attributeName();e.defaultValue!==void 0&&this.setOptionValueWithSource(i,e.defaultValue,"default");let n=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let c=this.getOptionValue(i);o!==null&&e.parseArg?o=this._callParseArg(e,o,c,s):o!==null&&e.variadic&&(o=e._collectValue(o,c)),o==null&&(e.negate?o=false:e.isBoolean()||e.optional?o=true:o=""),this.setOptionValueWithSource(i,o,a);};return this.on("option:"+r,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;n(o,s,"cli");}),e.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;n(o,s,"env");}),this}_optionEx(e,r,i,n,o){if(typeof r=="object"&&r instanceof It)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,i);if(s.makeOptionMandatory(!!e.mandatory),typeof n=="function")s.default(o).argParser(n);else if(n instanceof RegExp){let a=n;n=(c,d)=>{let l=a.exec(c);return l?l[0]:d},s.default(o).argParser(n);}else s.default(n);return this.addOption(s)}option(e,r,i,n){return this._optionEx({},e,r,i,n)}requiredOption(e,r,i,n){return this._optionEx({mandatory:true},e,r,i,n)}combineFlagAndOptionalValue(e=true){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=true){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=true){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=true){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=true){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=true){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,i){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=i,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(e)!==void 0&&(r=i.getOptionValueSource(e));}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){$__default.default.versions?.electron&&(r.from="electron");let n=$__default.default.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval");}e===void 0&&(e=$__default.default.argv),this.rawArgs=e.slice();let i;switch(r.from){case void 0:case "node":this._scriptPath=e[1],i=e.slice(2);break;case "electron":$__default.default.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case "user":i=e.slice(0);break;case "eval":i=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return !this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(e,r){this._prepareForParse();let i=this._prepareUserArgs(e,r);return this._parseCommand([],i),this}async parseAsync(e,r){this._prepareForParse();let i=this._prepareUserArgs(e,r);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?(this.options.filter(e=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach(e=>{let r=e.long.replace(/^--no-/,"--");this._findOption(r)||this.setOptionValueWithSource(e.attributeName(),true,"default");}),this.saveStateBeforeParse()):this.restoreStateBeforeParse();}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}};}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
120
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[];}_checkForMissingExecutable(e,r,i){if(Jr__default.default.existsSync(e))return;let n=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist
121
121
  - if '${i}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
122
122
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
123
- - ${n}`;throw new Error(o)}_executeSubCommand(e,r){r=r.slice();let i=[".js",".ts",".tsx",".mjs",".cjs"];function n(l,u){let h=L__default.default.resolve(l,u);if(Wr__default.default.existsSync(h))return h;if(i.includes(L__default.default.extname(u)))return;let p=i.find(f=>Wr__default.default.existsSync(`${h}${f}`));if(p)return `${h}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,s=this._executableDir||"";if(this._scriptPath){let l;try{l=Wr__default.default.realpathSync(this._scriptPath);}catch{l=this._scriptPath;}s=L__default.default.resolve(L__default.default.dirname(l),s);}if(s){let l=n(s,o);if(!l&&!e._executableFile&&this._scriptPath){let u=L__default.default.basename(this._scriptPath,L__default.default.extname(this._scriptPath));u!==this._name&&(l=n(s,`${u}-${e._name}`));}o=l||o;}let a=i.includes(L__default.default.extname(o)),c;R__default.default.platform!=="win32"?a?(r.unshift(o),r=Ja(R__default.default.execArgv).concat(r),c=Nn__default.default.spawn(R__default.default.argv[0],r,{stdio:"inherit"})):c=Nn__default.default.spawn(o,r,{stdio:"inherit"}):(this._checkForMissingExecutable(o,s,e._name),r.unshift(o),r=Ja(R__default.default.execArgv).concat(r),c=Nn__default.default.spawn(R__default.default.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(u=>{R__default.default.on(u,()=>{c.killed===false&&c.exitCode===null&&c.kill(u);});});let d=this._exitCallback;c.on("close",l=>{l=l??1,d?d(new Xe(l,"commander.executeSubCommandAsync","(close)")):R__default.default.exit(l);}),c.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(o,s,e._name);else if(l.code==="EACCES")throw new Error(`'${o}' not executable`);if(!d)R__default.default.exit(1);else {let u=new Xe(1,"commander.executeSubCommandAsync","(error)");u.nestedError=l,d(u);}}),this.runningCommand=c;}_dispatchSubcommand(e,r,i){let n=this._findCommand(e);n||this.help({error:true}),n._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,n,"preSubcommand"),o=this._chainOrCall(o,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(i));else return n._parseCommand(r,i)}),o}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name());}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args);}_processArguments(){let e=(i,n,o)=>{let s=n;if(n!==null&&i.parseArg){let a=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;s=this._callParseArg(i,n,o,a);}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((i,n)=>{let o=i.defaultValue;i.variadic?n<this.args.length?(o=this.args.slice(n),i.parseArg&&(o=o.reduce((s,a)=>e(i,a,s),i.defaultValue))):o===void 0&&(o=[]):n<this.args.length&&(o=this.args[n],i.parseArg&&(o=e(i,o,i.defaultValue))),r[n]=o;}),this.processedArgs=r;}_chainOrCall(e,r){return e?.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let i=e,n=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{n.push({hookedCommand:o,callback:s});});}),r==="postAction"&&n.reverse(),n.forEach(o=>{i=this._chainOrCall(i,()=>o.callback(o.hookedCommand,this));}),i}_chainOrCallSubCommandHook(e,r,i){let n=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(o=>{n=this._chainOrCall(n,()=>o(this,r));}),n}_parseCommand(e,r){let i=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),r=i.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:true}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0]);},o=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,r);})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))n(),this._processArguments(),this.parent.emit(o,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(n(),this._processArguments());}else this.commands.length?(n(),this.help({error:true})):(n(),this._processArguments());}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r);});});}_checkForConflictingLocalOptions(){let e=this.options.filter(i=>{let n=i.attributeName();return this.getOptionValue(n)===void 0?false:this.getOptionValueSource(n)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{let n=e.find(o=>i.conflictsWith.includes(o.attributeName()));n&&this._conflictingOption(i,n);});}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions();});}parseOptions(e){let r=[],i=[],n=r;function o(l){return l.length>1&&l[0]==="-"}let s=l=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(u=>u.options.map(h=>h.short).some(h=>/^-\d$/.test(h))):false,a=null,c=null,d=0;for(;d<e.length||c;){let l=c??e[d++];if(c=null,l==="--"){n===i&&n.push(l),n.push(...e.slice(d));break}if(a&&(!o(l)||s(l))){this.emit(`option:${a.name()}`,l);continue}if(a=null,o(l)){let u=this._findOption(l);if(u){if(u.required){let h=e[d++];h===void 0&&this.optionMissingArgument(u),this.emit(`option:${u.name()}`,h);}else if(u.optional){let h=null;d<e.length&&(!o(e[d])||s(e[d]))&&(h=e[d++]),this.emit(`option:${u.name()}`,h);}else this.emit(`option:${u.name()}`);a=u.variadic?u:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let u=this._findOption(`-${l[1]}`);if(u){u.required||u.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${u.name()}`,l.slice(2)):(this.emit(`option:${u.name()}`),c=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let u=l.indexOf("="),h=this._findOption(l.slice(0,u));if(h&&(h.required||h.optional)){this.emit(`option:${h.name()}`,l.slice(u+1));continue}}if(n===r&&o(l)&&!(this.commands.length===0&&s(l))&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(l)){r.push(l),i.push(...e.slice(d));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l,...e.slice(d));break}else if(this._defaultCommandName){i.push(l,...e.slice(d));break}}if(this._passThroughOptions){n.push(l,...e.slice(d));break}n.push(l);}return {operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let i=0;i<r;i++){let n=this.options[i].attributeName();e[n]=n===this._versionOptionName?this._version:this[n];}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
123
+ - ${n}`;throw new Error(o)}_executeSubCommand(e,r){r=r.slice();let i=[".js",".ts",".tsx",".mjs",".cjs"];function n(l,u){let h=L__default.default.resolve(l,u);if(Jr__default.default.existsSync(h))return h;if(i.includes(L__default.default.extname(u)))return;let p=i.find(m=>Jr__default.default.existsSync(`${h}${m}`));if(p)return `${h}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,s=this._executableDir||"";if(this._scriptPath){let l;try{l=Jr__default.default.realpathSync(this._scriptPath);}catch{l=this._scriptPath;}s=L__default.default.resolve(L__default.default.dirname(l),s);}if(s){let l=n(s,o);if(!l&&!e._executableFile&&this._scriptPath){let u=L__default.default.basename(this._scriptPath,L__default.default.extname(this._scriptPath));u!==this._name&&(l=n(s,`${u}-${e._name}`));}o=l||o;}let a=i.includes(L__default.default.extname(o)),c;$__default.default.platform!=="win32"?a?(r.unshift(o),r=ec($__default.default.execArgv).concat(r),c=Ln__default.default.spawn($__default.default.argv[0],r,{stdio:"inherit"})):c=Ln__default.default.spawn(o,r,{stdio:"inherit"}):(this._checkForMissingExecutable(o,s,e._name),r.unshift(o),r=ec($__default.default.execArgv).concat(r),c=Ln__default.default.spawn($__default.default.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(u=>{$__default.default.on(u,()=>{c.killed===false&&c.exitCode===null&&c.kill(u);});});let d=this._exitCallback;c.on("close",l=>{l=l??1,d?d(new et(l,"commander.executeSubCommandAsync","(close)")):$__default.default.exit(l);}),c.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(o,s,e._name);else if(l.code==="EACCES")throw new Error(`'${o}' not executable`);if(!d)$__default.default.exit(1);else {let u=new et(1,"commander.executeSubCommandAsync","(error)");u.nestedError=l,d(u);}}),this.runningCommand=c;}_dispatchSubcommand(e,r,i){let n=this._findCommand(e);n||this.help({error:true}),n._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,n,"preSubcommand"),o=this._chainOrCall(o,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(i));else return n._parseCommand(r,i)}),o}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name());}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args);}_processArguments(){let e=(i,n,o)=>{let s=n;if(n!==null&&i.parseArg){let a=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;s=this._callParseArg(i,n,o,a);}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((i,n)=>{let o=i.defaultValue;i.variadic?n<this.args.length?(o=this.args.slice(n),i.parseArg&&(o=o.reduce((s,a)=>e(i,a,s),i.defaultValue))):o===void 0&&(o=[]):n<this.args.length&&(o=this.args[n],i.parseArg&&(o=e(i,o,i.defaultValue))),r[n]=o;}),this.processedArgs=r;}_chainOrCall(e,r){return e?.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let i=e,n=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{n.push({hookedCommand:o,callback:s});});}),r==="postAction"&&n.reverse(),n.forEach(o=>{i=this._chainOrCall(i,()=>o.callback(o.hookedCommand,this));}),i}_chainOrCallSubCommandHook(e,r,i){let n=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(o=>{n=this._chainOrCall(n,()=>o(this,r));}),n}_parseCommand(e,r){let i=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),r=i.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:true}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0]);},o=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,r);})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))n(),this._processArguments(),this.parent.emit(o,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(n(),this._processArguments());}else this.commands.length?(n(),this.help({error:true})):(n(),this._processArguments());}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r);});});}_checkForConflictingLocalOptions(){let e=this.options.filter(i=>{let n=i.attributeName();return this.getOptionValue(n)===void 0?false:this.getOptionValueSource(n)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{let n=e.find(o=>i.conflictsWith.includes(o.attributeName()));n&&this._conflictingOption(i,n);});}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions();});}parseOptions(e){let r=[],i=[],n=r;function o(l){return l.length>1&&l[0]==="-"}let s=l=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(u=>u.options.map(h=>h.short).some(h=>/^-\d$/.test(h))):false,a=null,c=null,d=0;for(;d<e.length||c;){let l=c??e[d++];if(c=null,l==="--"){n===i&&n.push(l),n.push(...e.slice(d));break}if(a&&(!o(l)||s(l))){this.emit(`option:${a.name()}`,l);continue}if(a=null,o(l)){let u=this._findOption(l);if(u){if(u.required){let h=e[d++];h===void 0&&this.optionMissingArgument(u),this.emit(`option:${u.name()}`,h);}else if(u.optional){let h=null;d<e.length&&(!o(e[d])||s(e[d]))&&(h=e[d++]),this.emit(`option:${u.name()}`,h);}else this.emit(`option:${u.name()}`);a=u.variadic?u:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let u=this._findOption(`-${l[1]}`);if(u){u.required||u.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${u.name()}`,l.slice(2)):(this.emit(`option:${u.name()}`),c=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let u=l.indexOf("="),h=this._findOption(l.slice(0,u));if(h&&(h.required||h.optional)){this.emit(`option:${h.name()}`,l.slice(u+1));continue}}if(n===r&&o(l)&&!(this.commands.length===0&&s(l))&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(l)){r.push(l),i.push(...e.slice(d));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l,...e.slice(d));break}else if(this._defaultCommandName){i.push(l,...e.slice(d));break}}if(this._passThroughOptions){n.push(l,...e.slice(d));break}n.push(l);}return {operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let i=0;i<r;i++){let n=this.options[i].attributeName();e[n]=n===this._versionOptionName?this._version:this[n];}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
124
124
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
125
125
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
126
- `),this.outputHelp({error:true}));let i=r||{},n=i.exitCode||1,o=i.code||"commander.error";this._exit(n,o,e);}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in R__default.default.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,R__default.default.env[e.envVar]):this.emit(`optionEnv:${e.name()}`));}});}_parseOptionsImplied(){let e=new Vr(this.options),r=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&r(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied");});});}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"});}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"});}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"});}_conflictingOption(e,r){let i=s=>{let a=s.attributeName(),c=this.getOptionValue(a),d=this.options.find(u=>u.negate&&a===u.attributeName()),l=this.options.find(u=>!u.negate&&a===u.attributeName());return d&&(d.presetArg===void 0&&c===false||d.presetArg!==void 0&&c===d.presetArg)?d:l||s},n=s=>{let a=i(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${n(e)} cannot be used with ${n(r)}`;this.error(o,{code:"commander.conflictingOption"});}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);n=n.concat(s),o=o.parent;}while(o&&!o._enablePositionalOptions);r=jn(e,n);}let i=`error: unknown option '${e}'${r}`;this.error(i,{code:"commander.unknownOption"});}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,i=r===1?"":"s",n=e.length,o=this.parent?` for '${this.name()}'`:"",s=e.join(", "),a=`error: too many arguments${o}. Expected ${r} argument${i} but got ${n}: ${s}.`;this.error(a,{code:"commander.excessArguments"});}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(o=>{n.push(o.name()),o.alias()&&n.push(o.alias());}),r=jn(e,n);}let i=`error: unknown command '${e}'${r}`;this.error(i,{code:"commander.unknownCommand"});}version(e,r,i){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",i=i||"output the version number";let n=this.createOption(r,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
127
- `),this._exit(0,"commander.version",e);}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(e);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(i=>Gr(i));return [].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup);}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup);}nameFromFilename(e){return this._name=L__default.default.basename(e,L__default.default.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),i=this._getOutputContext(e);r.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let n=r.formatHelp(this,r);return i.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(e){e=e||{};let r=!!e.error,i,n,o;return r?(i=a=>this._outputConfiguration.writeErr(a),n=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(i=a=>this._outputConfiguration.writeOut(a),n=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(n||(a=this._outputConfiguration.stripColor(a)),i(a)),hasColors:n,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let i=this._getOutputContext(e),n={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let o=this.helpInformation({error:i.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",n));}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(R__default.default.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)");}addHelpText(e,r){let i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
126
+ `),this.outputHelp({error:true}));let i=r||{},n=i.exitCode||1,o=i.code||"commander.error";this._exit(n,o,e);}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in $__default.default.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,$__default.default.env[e.envVar]):this.emit(`optionEnv:${e.name()}`));}});}_parseOptionsImplied(){let e=new Yr(this.options),r=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&r(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied");});});}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"});}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"});}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"});}_conflictingOption(e,r){let i=s=>{let a=s.attributeName(),c=this.getOptionValue(a),d=this.options.find(u=>u.negate&&a===u.attributeName()),l=this.options.find(u=>!u.negate&&a===u.attributeName());return d&&(d.presetArg===void 0&&c===false||d.presetArg!==void 0&&c===d.presetArg)?d:l||s},n=s=>{let a=i(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${n(e)} cannot be used with ${n(r)}`;this.error(o,{code:"commander.conflictingOption"});}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);n=n.concat(s),o=o.parent;}while(o&&!o._enablePositionalOptions);r=qn(e,n);}let i=`error: unknown option '${e}'${r}`;this.error(i,{code:"commander.unknownOption"});}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,i=r===1?"":"s",n=e.length,o=this.parent?` for '${this.name()}'`:"",s=e.join(", "),a=`error: too many arguments${o}. Expected ${r} argument${i} but got ${n}: ${s}.`;this.error(a,{code:"commander.excessArguments"});}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(o=>{n.push(o.name()),o.alias()&&n.push(o.alias());}),r=qn(e,n);}let i=`error: unknown command '${e}'${r}`;this.error(i,{code:"commander.unknownCommand"});}version(e,r,i){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",i=i||"output the version number";let n=this.createOption(r,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
127
+ `),this._exit(0,"commander.version",e);}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(e);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(i=>Hr(i));return [].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup);}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup);}nameFromFilename(e){return this._name=L__default.default.basename(e,L__default.default.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),i=this._getOutputContext(e);r.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let n=r.formatHelp(this,r);return i.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(e){e=e||{};let r=!!e.error,i,n,o;return r?(i=a=>this._outputConfiguration.writeErr(a),n=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(i=a=>this._outputConfiguration.writeOut(a),n=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(n||(a=this._outputConfiguration.stripColor(a)),i(a)),hasColors:n,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let i=this._getOutputContext(e),n={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let o=this.helpInformation({error:i.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",n));}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number($__default.default.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)");}addHelpText(e,r){let i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
128
128
  Expecting one of '${i.join("', '")}'`);let n=`${e}Help`;return this.on(n,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s}
129
- `);}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"));}};function Ja(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,i="127.0.0.1",n="9229",o;return (o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?n=o[3]:i=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],i=o[3],n=o[4]),r&&n!=="0"?`${r}=${i}:${parseInt(n)+1}`:e})}function Ka(){if(R__default.default.env.NO_COLOR||R__default.default.env.FORCE_COLOR==="0"||R__default.default.env.FORCE_COLOR==="false")return false;if(R__default.default.env.FORCE_COLOR||R__default.default.env.CLICOLOR_FORCE!==void 0)return true}new Dt;var U=Ce(it()),My=Ce(ds());var wt=true,qt=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{},kr=0;if(qt.process&&qt.process.env&&qt.process.stdout){let{FORCE_COLOR:t,NODE_DISABLE_COLORS:e,NO_COLOR:r,TERM:i,COLORTERM:n}=qt.process.env;e||r||t==="0"?wt=false:t==="1"||t==="2"||t==="3"?wt=true:i==="dumb"?wt=false:"CI"in qt.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(o=>o in qt.process.env)?wt=true:wt=process.stdout.isTTY,wt&&(process.platform==="win32"||n&&(n==="truecolor"||n==="24bit")?kr=3:i&&(i.endsWith("-256color")||i.endsWith("256"))?kr=2:kr=1);}var vp={enabled:wt,supportLevel:kr};function A(t,e,r=1){let i=`\x1B[${t}m`,n=`\x1B[${e}m`,o=new RegExp(`\\x1b\\[${e}m`,"g");return s=>vp.enabled&&vp.supportLevel>=r?i+(""+s).replace(o,i)+n:""+s}var xp=A(31,39),Sp=A(32,39),kp=A(33,39),Cp=A(36,39);var S={info(t){console.log(Cp(t));},success(t){console.log(Sp(t));},warn(t){console.log(kp(t));},error(t){console.log(xp(t));}};var Cr=Ce(it());function vi(t){return Cr.default.existsSync(L__default.default.join(t,"pnpm-lock.yaml"))?"pnpm":Cr.default.existsSync(L__default.default.join(t,"yarn.lock"))?"yarn":Cr.default.existsSync(L__default.default.join(t,"bun.lockb"))||Cr.default.existsSync(L__default.default.join(t,"bun.lock"))?"bun":"npm"}function X(t){if(typeof t!="object"||t===null)return false;let e=Object.getPrototypeOf(t);return (e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var Bt=(t,e)=>{let r=hs(kk(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},kk=t=>us(t)?t.toString():t,us=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,hs=t=>t instanceof URL?url.fileURLToPath(t):t;var xi=(t,e=[],r={})=>{let i=Bt(t,"First argument"),[n,o]=X(e)?[[],e]:[e,r];if(!Array.isArray(n))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${n}`);if(n.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${n}`);let s=n.map(String),a=s.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!X(o))throw new TypeError(`Last argument must be an options object: ${o}`);return [i,s,o]};var{toString:Op}=Object.prototype,Ep=t=>Op.call(t)==="[object ArrayBuffer]",Q=t=>Op.call(t)==="[object Uint8Array]",We=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Ok=new TextEncoder,Tp=t=>Ok.encode(t),Ek=new TextDecoder,Si=t=>Ek.decode(t),Ap=(t,e)=>Tk(t,e).join(""),Tk=(t,e)=>{if(e==="utf8"&&t.every(o=>typeof o=="string"))return t;let r=new string_decoder.StringDecoder(e),i=t.map(o=>typeof o=="string"?Tp(o):o).map(o=>r.write(o)),n=r.end();return n===""?i:[...i,n]},Or=t=>t.length===1&&Q(t[0])?t[0]:ps(Ak(t)),Ak=t=>t.map(e=>typeof e=="string"?Tp(e):e),ps=t=>{let e=new Uint8Array(_k(t)),r=0;for(let i of t)e.set(i,r),r+=i.length;return e},_k=t=>{let e=0;for(let r of t)e+=r.length;return e};var Ip=t=>Array.isArray(t)&&Array.isArray(t.raw),$p=(t,e)=>{let r=[];for(let[o,s]of t.entries())r=Pk({templates:t,expressions:e,tokens:r,index:o,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[i,...n]=r;return [i,n,{}]},Pk=({templates:t,expressions:e,tokens:r,index:i,template:n})=>{if(n===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[i]}`);let{nextTokens:o,leadingWhitespaces:s,trailingWhitespaces:a}=Ik(n,t.raw[i]),c=Dp(r,o,s);if(i===e.length)return c;let d=e[i],l=Array.isArray(d)?d.map(u=>Pp(u)):[Pp(d)];return Dp(c,l,a)},Ik=(t,e)=>{if(e.length===0)return {nextTokens:[],leadingWhitespaces:false,trailingWhitespaces:false};let r=[],i=0,n=_p.has(e[0]);for(let s=0,a=0;s<t.length;s+=1,a+=1){let c=e[a];if(_p.has(c))i!==s&&r.push(t.slice(i,s)),i=s+1;else if(c==="\\"){let d=e[a+1];d===`
130
- `?(s-=1,a+=1):d==="u"&&e[a+2]==="{"?a=e.indexOf("}",a+3):a+=$k[d]??1;}}let o=i===t.length;return o||r.push(t.slice(i)),{nextTokens:r,leadingWhitespaces:n,trailingWhitespaces:o}},_p=new Set([" "," ","\r",`
131
- `]),$k={x:3,u:5},Dp=(t,e,r)=>r||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],Pp=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(X(t)&&("stdout"in t||"isMaxBuffer"in t))return Rk(t);throw t instanceof Nn.ChildProcess||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},Rk=({stdout:t})=>{if(typeof t=="string")return t;if(Q(t))return Si(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)};var ve=t=>ki.includes(t),ki=[R__default.default.stdin,R__default.default.stdout,R__default.default.stderr],fe=["stdin","stdout","stderr"],Ci=t=>fe[t]??`stdio[${t}]`;var Mp=t=>{let e={...t};for(let r of bs)e[r]=fs(t,r);return e},fs=(t,e)=>{let r=Array.from({length:Fk(t)+1}),i=jk(t[e],r,e);return Uk(i,e)},Fk=({stdio:t})=>Array.isArray(t)?Math.max(t.length,fe.length):fe.length,jk=(t,e,r)=>X(t)?Nk(t,e,r):e.fill(t),Nk=(t,e,r)=>{for(let i of Object.keys(t).sort(Lk))for(let n of qk(i,r,e))e[n]=t[i];return e},Lk=(t,e)=>Rp(t)<Rp(e)?1:-1,Rp=t=>t==="stdout"||t==="stderr"?0:t==="all"?2:1,qk=(t,e,r)=>{if(t==="ipc")return [r.length-1];let i=gs(t);if(i===void 0||i===0)throw new TypeError(`"${e}.${t}" is invalid.
129
+ `);}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"));}};function ec(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,i="127.0.0.1",n="9229",o;return (o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?n=o[3]:i=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],i=o[3],n=o[4]),r&&n!=="0"?`${r}=${i}:${parseInt(n)+1}`:e})}function tc(){if($__default.default.env.NO_COLOR||$__default.default.env.FORCE_COLOR==="0"||$__default.default.env.FORCE_COLOR==="false")return false;if($__default.default.env.FORCE_COLOR||$__default.default.env.CLICOLOR_FORCE!==void 0)return true}new $t;var z=be(qe()),Jy=be(hs());var vt=true,zt=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{},Er=0;if(zt.process&&zt.process.env&&zt.process.stdout){let{FORCE_COLOR:t,NODE_DISABLE_COLORS:e,NO_COLOR:r,TERM:i,COLORTERM:n}=zt.process.env;e||r||t==="0"?vt=false:t==="1"||t==="2"||t==="3"?vt=true:i==="dumb"?vt=false:"CI"in zt.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(o=>o in zt.process.env)?vt=true:vt=process.stdout.isTTY,vt&&(process.platform==="win32"||n&&(n==="truecolor"||n==="24bit")?Er=3:i&&(i.endsWith("-256color")||i.endsWith("256"))?Er=2:Er=1);}var Op={enabled:vt,supportLevel:Er};function A(t,e,r=1){let i=`\x1B[${t}m`,n=`\x1B[${e}m`,o=new RegExp(`\\x1b\\[${e}m`,"g");return s=>Op.enabled&&Op.supportLevel>=r?i+(""+s).replace(o,i)+n:""+s}var Ep=A(31,39),Tp=A(32,39),Ap=A(33,39),_p=A(36,39);var x={info(t){console.log(_p(t));},success(t){console.log(Tp(t));},warn(t){console.log(Ap(t));},error(t){console.log(Ep(t));}};var Tr=be(qe());function ki(t){return Tr.default.existsSync(L__default.default.join(t,"pnpm-lock.yaml"))?"pnpm":Tr.default.existsSync(L__default.default.join(t,"yarn.lock"))?"yarn":Tr.default.existsSync(L__default.default.join(t,"bun.lockb"))||Tr.default.existsSync(L__default.default.join(t,"bun.lock"))?"bun":"npm"}function X(t){if(typeof t!="object"||t===null)return false;let e=Object.getPrototypeOf(t);return (e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var Gt=(t,e)=>{let r=ms(Pk(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},Pk=t=>ps(t)?t.toString():t,ps=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,ms=t=>t instanceof URL?url.fileURLToPath(t):t;var Ci=(t,e=[],r={})=>{let i=Gt(t,"First argument"),[n,o]=X(e)?[[],e]:[e,r];if(!Array.isArray(n))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${n}`);if(n.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${n}`);let s=n.map(String),a=s.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!X(o))throw new TypeError(`Last argument must be an options object: ${o}`);return [i,s,o]};var{toString:Pp}=Object.prototype,Dp=t=>Pp.call(t)==="[object ArrayBuffer]",Q=t=>Pp.call(t)==="[object Uint8Array]",He=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Ik=new TextEncoder,Ip=t=>Ik.encode(t),$k=new TextDecoder,Oi=t=>$k.decode(t),$p=(t,e)=>Rk(t,e).join(""),Rk=(t,e)=>{if(e==="utf8"&&t.every(o=>typeof o=="string"))return t;let r=new string_decoder.StringDecoder(e),i=t.map(o=>typeof o=="string"?Ip(o):o).map(o=>r.write(o)),n=r.end();return n===""?i:[...i,n]},Ar=t=>t.length===1&&Q(t[0])?t[0]:fs(Mk(t)),Mk=t=>t.map(e=>typeof e=="string"?Ip(e):e),fs=t=>{let e=new Uint8Array(Fk(t)),r=0;for(let i of t)e.set(i,r),r+=i.length;return e},Fk=t=>{let e=0;for(let r of t)e+=r.length;return e};var jp=t=>Array.isArray(t)&&Array.isArray(t.raw),Np=(t,e)=>{let r=[];for(let[o,s]of t.entries())r=Nk({templates:t,expressions:e,tokens:r,index:o,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[i,...n]=r;return [i,n,{}]},Nk=({templates:t,expressions:e,tokens:r,index:i,template:n})=>{if(n===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[i]}`);let{nextTokens:o,leadingWhitespaces:s,trailingWhitespaces:a}=qk(n,t.raw[i]),c=Mp(r,o,s);if(i===e.length)return c;let d=e[i],l=Array.isArray(d)?d.map(u=>Fp(u)):[Fp(d)];return Mp(c,l,a)},qk=(t,e)=>{if(e.length===0)return {nextTokens:[],leadingWhitespaces:false,trailingWhitespaces:false};let r=[],i=0,n=Rp.has(e[0]);for(let s=0,a=0;s<t.length;s+=1,a+=1){let c=e[a];if(Rp.has(c))i!==s&&r.push(t.slice(i,s)),i=s+1;else if(c==="\\"){let d=e[a+1];d===`
130
+ `?(s-=1,a+=1):d==="u"&&e[a+2]==="{"?a=e.indexOf("}",a+3):a+=Lk[d]??1;}}let o=i===t.length;return o||r.push(t.slice(i)),{nextTokens:r,leadingWhitespaces:n,trailingWhitespaces:o}},Rp=new Set([" "," ","\r",`
131
+ `]),Lk={x:3,u:5},Mp=(t,e,r)=>r||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],Fp=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(X(t)&&("stdout"in t||"isMaxBuffer"in t))return Bk(t);throw t instanceof Ln.ChildProcess||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},Bk=({stdout:t})=>{if(typeof t=="string")return t;if(Q(t))return Oi(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)};var xe=t=>Ei.includes(t),Ei=[$__default.default.stdin,$__default.default.stdout,$__default.default.stderr],fe=["stdin","stdout","stderr"],Ti=t=>fe[t]??`stdio[${t}]`;var Lp=t=>{let e={...t};for(let r of ws)e[r]=bs(t,r);return e},bs=(t,e)=>{let r=Array.from({length:zk(t)+1}),i=Gk(t[e],r,e);return Jk(i,e)},zk=({stdio:t})=>Array.isArray(t)?Math.max(t.length,fe.length):fe.length,Gk=(t,e,r)=>X(t)?Vk(t,e,r):e.fill(t),Vk=(t,e,r)=>{for(let i of Object.keys(t).sort(Wk))for(let n of Hk(i,r,e))e[n]=t[i];return e},Wk=(t,e)=>qp(t)<qp(e)?1:-1,qp=t=>t==="stdout"||t==="stderr"?0:t==="all"?2:1,Hk=(t,e,r)=>{if(t==="ipc")return [r.length-1];let i=ys(t);if(i===void 0||i===0)throw new TypeError(`"${e}.${t}" is invalid.
132
132
  It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(i>=r.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist.
133
- Please set the "stdio" option to ensure that file descriptor exists.`);return i==="all"?[1,2]:[i]},gs=t=>{if(t==="all")return t;if(fe.includes(t))return fe.indexOf(t);let e=Bk.exec(t);if(e!==null)return Number(e[1])},Bk=/^fd(\d+)$/,Uk=(t,e)=>t.map(r=>r===void 0?Gk[e]:r),zk=util.debuglog("execa").enabled?"full":"none",Gk={lines:false,buffer:true,maxBuffer:1e3*1e3*100,verbose:zk,stripFinalNewline:true},bs=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],He=(t,e)=>e==="ipc"?t.at(-1):t[e];var Ut=({verbose:t},e)=>ys(t,e)!=="none",zt=({verbose:t},e)=>!["none","short"].includes(ys(t,e)),Fp=({verbose:t},e)=>{let r=ys(t,e);return Oi(r)?r:void 0},ys=(t,e)=>e===void 0?Vk(t):He(t,e),Vk=t=>t.find(e=>Oi(e))??Ei.findLast(e=>t.includes(e)),Oi=t=>typeof t=="function",Ei=["none","short","full"];var jp=(t,e)=>{let r=[t,...e],i=r.join(" "),n=r.map(o=>Qk(Np(o))).join(" ");return {command:i,escapedCommand:n}},Er=t=>util.stripVTControlCharacters(t).split(`
134
- `).map(e=>Np(e)).join(`
135
- `),Np=t=>t.replaceAll(Kk,e=>Yk(e)),Yk=t=>{let e=Xk[t];if(e!==void 0)return e;let r=t.codePointAt(0),i=r.toString(16);return r<=Zk?`\\u${i.padStart(4,"0")}`:`\\U${i}`},Jk=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return /[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},Kk=Jk(),Xk={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Zk=65535,Qk=t=>eC.test(t)?t:R.platform==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,eC=/^[\w./-]+$/;function ws(){let{env:t}=R__default.default,{TERM:e,TERM_PROGRAM:r}=t;return R__default.default.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var qp={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Bp={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},tC={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},rC={...qp,...Bp},iC={...qp,...tC},nC=ws(),oC=nC?rC:iC,Ti=oC;var aC=sC__default.default?.WriteStream?.prototype?.hasColors?.()??false,T=(t,e)=>{if(!aC)return n=>n;let r=`\x1B[${t}m`,i=`\x1B[${e}m`;return n=>{let o=n+"",s=o.indexOf(i);if(s===-1)return r+o+i;let a=r,c=0,l=(e===22?i:"")+r;for(;s!==-1;)a+=o.slice(c,s)+l,c=s+i.length,s=o.indexOf(i,c);return a+=o.slice(c)+i,a}},Up=T(1,22),Ai=T(90,39),zp=T(91,39),Gp=T(93,39);var Hp=({type:t,message:e,timestamp:r,piped:i,commandId:n,result:{failed:o=false}={},options:{reject:s=true}})=>{let a=cC(r),c=lC[t]({failed:o,reject:s,piped:i}),d=dC[t]({reject:s});return `${Ai(`[${a}]`)} ${Ai(`[${n}]`)} ${d(c)} ${d(e)}`},cC=t=>`${_i(t.getHours(),2)}:${_i(t.getMinutes(),2)}:${_i(t.getSeconds(),2)}.${_i(t.getMilliseconds(),3)}`,_i=(t,e)=>String(t).padStart(e,"0"),Vp=({failed:t,reject:e})=>t?e?Ti.cross:Ti.warning:Ti.tick,lC={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:Vp,duration:Vp},Wp=t=>t,dC={command:()=>Up,output:()=>Wp,ipc:()=>Wp,error:({reject:t})=>t?zp:Gp,duration:()=>Ai};var Yp=(t,e,r)=>{let i=Fp(e,r);return t.map(({verboseLine:n,verboseObject:o})=>uC(n,o,i)).filter(n=>n!==void 0).map(n=>hC(n)).join("")},uC=(t,e,r)=>{if(r===void 0)return t;let i=r(t,e);if(typeof i=="string")return i},hC=t=>t.endsWith(`
133
+ Please set the "stdio" option to ensure that file descriptor exists.`);return i==="all"?[1,2]:[i]},ys=t=>{if(t==="all")return t;if(fe.includes(t))return fe.indexOf(t);let e=Yk.exec(t);if(e!==null)return Number(e[1])},Yk=/^fd(\d+)$/,Jk=(t,e)=>t.map(r=>r===void 0?Xk[e]:r),Kk=util.debuglog("execa").enabled?"full":"none",Xk={lines:false,buffer:true,maxBuffer:1e3*1e3*100,verbose:Kk,stripFinalNewline:true},ws=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Ye=(t,e)=>e==="ipc"?t.at(-1):t[e];var Vt=({verbose:t},e)=>vs(t,e)!=="none",Wt=({verbose:t},e)=>!["none","short"].includes(vs(t,e)),Bp=({verbose:t},e)=>{let r=vs(t,e);return Ai(r)?r:void 0},vs=(t,e)=>e===void 0?Zk(t):Ye(t,e),Zk=t=>t.find(e=>Ai(e))??_i.findLast(e=>t.includes(e)),Ai=t=>typeof t=="function",_i=["none","short","full"];var Up=(t,e)=>{let r=[t,...e],i=r.join(" "),n=r.map(o=>sC(zp(o))).join(" ");return {command:i,escapedCommand:n}},_r=t=>util.stripVTControlCharacters(t).split(`
134
+ `).map(e=>zp(e)).join(`
135
+ `),zp=t=>t.replaceAll(iC,e=>tC(e)),tC=t=>{let e=nC[t];if(e!==void 0)return e;let r=t.codePointAt(0),i=r.toString(16);return r<=oC?`\\u${i.padStart(4,"0")}`:`\\U${i}`},rC=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return /[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},iC=rC(),nC={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},oC=65535,sC=t=>aC.test(t)?t:$.platform==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,aC=/^[\w./-]+$/;function xs(){let{env:t}=$__default.default,{TERM:e,TERM_PROGRAM:r}=t;return $__default.default.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Vp={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Wp={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},cC={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},lC={...Vp,...Wp},dC={...Vp,...cC},uC=xs(),hC=uC?lC:dC,Pi=hC;var mC=pC__default.default?.WriteStream?.prototype?.hasColors?.()??false,T=(t,e)=>{if(!mC)return n=>n;let r=`\x1B[${t}m`,i=`\x1B[${e}m`;return n=>{let o=n+"",s=o.indexOf(i);if(s===-1)return r+o+i;let a=r,c=0,l=(e===22?i:"")+r;for(;s!==-1;)a+=o.slice(c,s)+l,c=s+i.length,s=o.indexOf(i,c);return a+=o.slice(c)+i,a}},Hp=T(1,22),Di=T(90,39),Yp=T(91,39),Jp=T(93,39);var Zp=({type:t,message:e,timestamp:r,piped:i,commandId:n,result:{failed:o=false}={},options:{reject:s=true}})=>{let a=fC(r),c=gC[t]({failed:o,reject:s,piped:i}),d=bC[t]({reject:s});return `${Di(`[${a}]`)} ${Di(`[${n}]`)} ${d(c)} ${d(e)}`},fC=t=>`${Ii(t.getHours(),2)}:${Ii(t.getMinutes(),2)}:${Ii(t.getSeconds(),2)}.${Ii(t.getMilliseconds(),3)}`,Ii=(t,e)=>String(t).padStart(e,"0"),Kp=({failed:t,reject:e})=>t?e?Pi.cross:Pi.warning:Pi.tick,gC={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:Kp,duration:Kp},Xp=t=>t,bC={command:()=>Hp,output:()=>Xp,ipc:()=>Xp,error:({reject:t})=>t?Yp:Jp,duration:()=>Di};var Qp=(t,e,r)=>{let i=Bp(e,r);return t.map(({verboseLine:n,verboseObject:o})=>yC(n,o,i)).filter(n=>n!==void 0).map(n=>wC(n)).join("")},yC=(t,e,r)=>{if(r===void 0)return t;let i=r(t,e);if(typeof i=="string")return i},wC=t=>t.endsWith(`
136
136
  `)?t:`${t}
137
- `;var Pe=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:i,result:n})=>{let o=mC({type:t,result:n,verboseInfo:i}),s=fC(e,o),a=Yp(s,i,r);a!==""&&console.warn(a.slice(0,-1));},mC=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:i,rawOptions:{piped:n=false,...o}}})=>({type:t,escapedCommand:r,commandId:`${i}`,timestamp:new Date,piped:n,result:e,options:o}),fC=(t,e)=>t.split(`
138
- `).map(r=>gC({...e,message:r})),gC=t=>({verboseLine:Hp(t),verboseObject:t}),Di=t=>{let e=typeof t=="string"?t:util.inspect(t);return Er(e).replaceAll(" "," ".repeat(bC))},bC=2;var Jp=(t,e)=>{Ut(e)&&Pe({type:"command",verboseMessage:t,verboseInfo:e});};var Kp=(t,e,r)=>{vC(t);let i=yC(t);return {verbose:t,escapedCommand:e,commandId:i,rawOptions:r}},yC=t=>Ut({verbose:t})?wC++:void 0,wC=0n,vC=t=>{for(let e of t){if(e===false)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===true)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!Ei.includes(e)&&!Oi(e)){let r=Ei.map(i=>`'${i}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}};var Pi=()=>R.hrtime.bigint(),vs=t=>Number(R.hrtime.bigint()-t)/1e6;var Ii=(t,e,r)=>{let i=Pi(),{command:n,escapedCommand:o}=jp(t,e),s=fs(r,"verbose"),a=Kp(s,o,{...r});return Jp(o,a),{command:n,escapedCommand:o,startTime:i,verboseInfo:a}};var Xf=Ce(Lm());function Ri(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"}util.promisify(Nn.execFile);function Mi(t){return t instanceof URL?url.fileURLToPath(t):t}function Bm(t){return {*[Symbol.iterator](){let e=L__default.default.resolve(Mi(t)),r;for(;r!==e;)yield e,r=e,e=L__default.default.resolve(e,"..");}}}var KC=({cwd:t=R__default.default.cwd(),path:e=R__default.default.env[Ri()],preferLocal:r=true,execPath:i=R__default.default.execPath,addExecPath:n=true}={})=>{let o=L__default.default.resolve(Mi(t)),s=[],a=e.split(L__default.default.delimiter);return r&&XC(s,a,o),n&&ZC(s,a,i,o),e===""||e===L__default.default.delimiter?`${s.join(L__default.default.delimiter)}${e}`:[...s,e].join(L__default.default.delimiter)},XC=(t,e,r)=>{for(let i of Bm(r)){let n=L__default.default.join(i,"node_modules/.bin");e.includes(n)||t.push(n);}},ZC=(t,e,r,i)=>{let n=L__default.default.resolve(i,Mi(r),"..");e.includes(n)||t.push(n);},Um=({env:t=R__default.default.env,...e}={})=>{t={...t};let r=Ri({env:t});return e.path=t[r],t[r]=KC(e),t};var zm=(t,e,r)=>{let i=r?Ar:Tr,n=t instanceof xe?{}:{cause:t};return new i(e,n)},xe=class extends Error{},Gm=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:true,enumerable:false,configurable:true}),Object.defineProperty(t.prototype,Wm,{value:true,writable:false,enumerable:false,configurable:false});},Vm=t=>ji(t)&&Wm in t,Wm=Symbol("isExecaError"),ji=t=>Object.prototype.toString.call(t)==="[object Error]",Tr=class extends Error{};Gm(Tr,Tr.name);var Ar=class extends Error{};Gm(Ar,Ar.name);var Hm=()=>{let t=Jm-Ym+1;return Array.from({length:t},QC)},QC=(t,e)=>({name:`SIGRT${e+1}`,number:Ym+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Ym=34,Jm=64;var Km=[{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:true},{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:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{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"}];var Ds=()=>{let t=Hm();return [...Km,...t].map(tO)},tO=({name:t,number:e,description:r,action:i,forced:n=false,standard:o})=>{let{signals:{[t]:s}}=os.constants,a=s!==void 0;return {name:t,number:a?s:e,description:r,supported:a,action:i,forced:n,standard:o}};var iO=()=>{let t=Ds();return Object.fromEntries(t.map(nO))},nO=({name:t,number:e,description:r,supported:i,action:n,forced:o,standard:s})=>[t,{name:t,number:e,description:r,supported:i,action:n,forced:o,standard:s}],Xm=iO(),oO=()=>{let t=Ds(),e=65,r=Array.from({length:e},(i,n)=>sO(n,t));return Object.assign({},...r)},sO=(t,e)=>{let r=aO(t,e);if(r===void 0)return {};let{name:i,description:n,supported:o,action:s,forced:a,standard:c}=r;return {[t]:{name:i,number:t,description:n,supported:o,action:s,forced:a,standard:c}}},aO=(t,e)=>{let r=e.find(({name:i})=>os.constants.signals[i]===t);return r!==void 0?r:e.find(i=>i.number===t)};oO();var Qm=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return tf(t,e)},ef=t=>t===0?t:tf(t,"`subprocess.kill()`'s argument"),tf=(t,e)=>{if(Number.isInteger(t))return cO(t,e);if(typeof t=="string")return dO(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
139
- ${Ps()}`)},cO=(t,e)=>{if(Zm.has(t))return Zm.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist.
140
- ${Ps()}`)},lO=()=>new Map(Object.entries(os.constants.signals).reverse().map(([t,e])=>[e,t])),Zm=lO(),dO=(t,e)=>{if(t in os.constants.signals)return t;throw t.toUpperCase()in os.constants.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist.
141
- ${Ps()}`)},Ps=()=>`Available signal names: ${uO()}.
142
- Available signal numbers: ${hO()}.`,uO=()=>Object.keys(os.constants.signals).sort().map(t=>`'${t}'`).join(", "),hO=()=>[...new Set(Object.values(os.constants.signals).sort((t,e)=>t-e))].join(", "),Ni=t=>Xm[t].description;var rf=t=>{if(t===false)return t;if(t===true)return mO;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},mO=1e3*5,nf=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:i,context:n,controller:o},s,a)=>{let{signal:c,error:d}=fO(s,a,r);gO(d,i);let l=t(c);return bO({kill:t,signal:c,forceKillAfterDelay:e,killSignal:r,killResult:l,context:n,controller:o}),l},fO=(t,e,r)=>{let[i=r,n]=ji(t)?[void 0,t]:[t,e];if(typeof i!="string"&&!Number.isInteger(i))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(i)}`);if(n!==void 0&&!ji(n))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${n}`);return {signal:ef(i),error:n}},gO=(t,e)=>{t!==void 0&&e.reject(t);},bO=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:i,killResult:n,context:o,controller:s})=>{e===i&&n&&Is({kill:t,forceKillAfterDelay:r,context:o,controllerSignal:s.signal});},Is=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:i})=>{if(e!==false)try{await promises$1.setTimeout(e,void 0,{signal:i}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0);}catch{}};var Li=async(t,e)=>{t.aborted||await events.once(t,"abort",{signal:e});};var of=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},sf=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:i,controller:n})=>e===void 0||r?[]:[wO(t,e,i,n)],wO=async(t,e,r,{signal:i})=>{throw await Li(e,i),r.terminationReason??="cancel",t.kill(),e.reason};var Wt=({methodName:t,isSubprocess:e,ipc:r,isConnected:i})=>{vO(t,e,r),$s(t,e,i);},vO=(t,e,r)=>{if(!r)throw new Error(`${Se(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},$s=(t,e,r)=>{if(!r)throw new Error(`${Se(t,e)} cannot be used: the ${ct(e)} has already exited or disconnected.`)},af=t=>{throw new Error(`${Se("getOneMessage",t)} could not complete: the ${ct(t)} exited or disconnected.`)},cf=t=>{throw new Error(`${Se("sendMessage",t)} failed: the ${ct(t)} is sending a message too, instead of listening to incoming messages.
137
+ `;var De=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:i,result:n})=>{let o=xC({type:t,result:n,verboseInfo:i}),s=SC(e,o),a=Qp(s,i,r);a!==""&&console.warn(a.slice(0,-1));},xC=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:i,rawOptions:{piped:n=false,...o}}})=>({type:t,escapedCommand:r,commandId:`${i}`,timestamp:new Date,piped:n,result:e,options:o}),SC=(t,e)=>t.split(`
138
+ `).map(r=>kC({...e,message:r})),kC=t=>({verboseLine:Zp(t),verboseObject:t}),$i=t=>{let e=typeof t=="string"?t:util.inspect(t);return _r(e).replaceAll(" "," ".repeat(CC))},CC=2;var em=(t,e)=>{Vt(e)&&De({type:"command",verboseMessage:t,verboseInfo:e});};var tm=(t,e,r)=>{TC(t);let i=OC(t);return {verbose:t,escapedCommand:e,commandId:i,rawOptions:r}},OC=t=>Vt({verbose:t})?EC++:void 0,EC=0n,TC=t=>{for(let e of t){if(e===false)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===true)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!_i.includes(e)&&!Ai(e)){let r=_i.map(i=>`'${i}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}};var Ri=()=>$.hrtime.bigint(),Ss=t=>Number($.hrtime.bigint()-t)/1e6;var Mi=(t,e,r)=>{let i=Ri(),{command:n,escapedCommand:o}=Up(t,e),s=bs(r,"verbose"),a=tm(s,o,{...r});return em(o,a),{command:n,escapedCommand:o,startTime:i,verboseInfo:a}};var rg=be(Gm());function ji(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"}util.promisify(Ln.execFile);function Ni(t){return t instanceof URL?url.fileURLToPath(t):t}function Wm(t){return {*[Symbol.iterator](){let e=L__default.default.resolve(Ni(t)),r;for(;r!==e;)yield e,r=e,e=L__default.default.resolve(e,"..");}}}var iO=({cwd:t=$__default.default.cwd(),path:e=$__default.default.env[ji()],preferLocal:r=true,execPath:i=$__default.default.execPath,addExecPath:n=true}={})=>{let o=L__default.default.resolve(Ni(t)),s=[],a=e.split(L__default.default.delimiter);return r&&nO(s,a,o),n&&oO(s,a,i,o),e===""||e===L__default.default.delimiter?`${s.join(L__default.default.delimiter)}${e}`:[...s,e].join(L__default.default.delimiter)},nO=(t,e,r)=>{for(let i of Wm(r)){let n=L__default.default.join(i,"node_modules/.bin");e.includes(n)||t.push(n);}},oO=(t,e,r,i)=>{let n=L__default.default.resolve(i,Ni(r),"..");e.includes(n)||t.push(n);},Hm=({env:t=$__default.default.env,...e}={})=>{t={...t};let r=ji({env:t});return e.path=t[r],t[r]=iO(e),t};var Ym=(t,e,r)=>{let i=r?Dr:Pr,n=t instanceof Se?{}:{cause:t};return new i(e,n)},Se=class extends Error{},Jm=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:true,enumerable:false,configurable:true}),Object.defineProperty(t.prototype,Xm,{value:true,writable:false,enumerable:false,configurable:false});},Km=t=>Li(t)&&Xm in t,Xm=Symbol("isExecaError"),Li=t=>Object.prototype.toString.call(t)==="[object Error]",Pr=class extends Error{};Jm(Pr,Pr.name);var Dr=class extends Error{};Jm(Dr,Dr.name);var Zm=()=>{let t=ef-Qm+1;return Array.from({length:t},sO)},sO=(t,e)=>({name:`SIGRT${e+1}`,number:Qm+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Qm=34,ef=64;var tf=[{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:true},{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:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{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"}];var Is=()=>{let t=Zm();return [...tf,...t].map(cO)},cO=({name:t,number:e,description:r,action:i,forced:n=false,standard:o})=>{let{signals:{[t]:s}}=os$1.constants,a=s!==void 0;return {name:t,number:a?s:e,description:r,supported:a,action:i,forced:n,standard:o}};var dO=()=>{let t=Is();return Object.fromEntries(t.map(uO))},uO=({name:t,number:e,description:r,supported:i,action:n,forced:o,standard:s})=>[t,{name:t,number:e,description:r,supported:i,action:n,forced:o,standard:s}],rf=dO(),hO=()=>{let t=Is(),e=65,r=Array.from({length:e},(i,n)=>pO(n,t));return Object.assign({},...r)},pO=(t,e)=>{let r=mO(t,e);if(r===void 0)return {};let{name:i,description:n,supported:o,action:s,forced:a,standard:c}=r;return {[t]:{name:i,number:t,description:n,supported:o,action:s,forced:a,standard:c}}},mO=(t,e)=>{let r=e.find(({name:i})=>os$1.constants.signals[i]===t);return r!==void 0?r:e.find(i=>i.number===t)};hO();var of=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return af(t,e)},sf=t=>t===0?t:af(t,"`subprocess.kill()`'s argument"),af=(t,e)=>{if(Number.isInteger(t))return fO(t,e);if(typeof t=="string")return bO(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
139
+ ${$s()}`)},fO=(t,e)=>{if(nf.has(t))return nf.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist.
140
+ ${$s()}`)},gO=()=>new Map(Object.entries(os$1.constants.signals).reverse().map(([t,e])=>[e,t])),nf=gO(),bO=(t,e)=>{if(t in os$1.constants.signals)return t;throw t.toUpperCase()in os$1.constants.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist.
141
+ ${$s()}`)},$s=()=>`Available signal names: ${yO()}.
142
+ Available signal numbers: ${wO()}.`,yO=()=>Object.keys(os$1.constants.signals).sort().map(t=>`'${t}'`).join(", "),wO=()=>[...new Set(Object.values(os$1.constants.signals).sort((t,e)=>t-e))].join(", "),Bi=t=>rf[t].description;var cf=t=>{if(t===false)return t;if(t===true)return xO;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},xO=1e3*5,lf=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:i,context:n,controller:o},s,a)=>{let{signal:c,error:d}=SO(s,a,r);kO(d,i);let l=t(c);return CO({kill:t,signal:c,forceKillAfterDelay:e,killSignal:r,killResult:l,context:n,controller:o}),l},SO=(t,e,r)=>{let[i=r,n]=Li(t)?[void 0,t]:[t,e];if(typeof i!="string"&&!Number.isInteger(i))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(i)}`);if(n!==void 0&&!Li(n))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${n}`);return {signal:sf(i),error:n}},kO=(t,e)=>{t!==void 0&&e.reject(t);},CO=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:i,killResult:n,context:o,controller:s})=>{e===i&&n&&Rs({kill:t,forceKillAfterDelay:r,context:o,controllerSignal:s.signal});},Rs=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:i})=>{if(e!==false)try{await promises$1.setTimeout(e,void 0,{signal:i}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0);}catch{}};var Ui=async(t,e)=>{t.aborted||await events.once(t,"abort",{signal:e});};var df=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},uf=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:i,controller:n})=>e===void 0||r?[]:[EO(t,e,i,n)],EO=async(t,e,r,{signal:i})=>{throw await Ui(e,i),r.terminationReason??="cancel",t.kill(),e.reason};var Jt=({methodName:t,isSubprocess:e,ipc:r,isConnected:i})=>{TO(t,e,r),Ms(t,e,i);},TO=(t,e,r)=>{if(!r)throw new Error(`${ke(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},Ms=(t,e,r)=>{if(!r)throw new Error(`${ke(t,e)} cannot be used: the ${dt(e)} has already exited or disconnected.`)},hf=t=>{throw new Error(`${ke("getOneMessage",t)} could not complete: the ${dt(t)} exited or disconnected.`)},pf=t=>{throw new Error(`${ke("sendMessage",t)} failed: the ${dt(t)} is sending a message too, instead of listening to incoming messages.
143
143
  This can be fixed by both sending a message and listening to incoming messages at the same time:
144
144
 
145
145
  const [receivedMessage] = await Promise.all([
146
- ${Se("getOneMessage",t)},
147
- ${Se("sendMessage",t,"message, {strict: true}")},
148
- ]);`)},qi=(t,e)=>new Error(`${Se("sendMessage",e)} failed when sending an acknowledgment response to the ${ct(e)}.`,{cause:t}),lf=t=>{throw new Error(`${Se("sendMessage",t)} failed: the ${ct(t)} is not listening to incoming messages.`)},df=t=>{throw new Error(`${Se("sendMessage",t)} failed: the ${ct(t)} exited without listening to incoming messages.`)},uf=()=>new Error(`\`cancelSignal\` aborted: the ${ct(true)} disconnected.`),hf=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},pf=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${Se(e,r)} cannot be used: the ${ct(r)} is disconnecting.`,{cause:t})},mf=({error:t,methodName:e,isSubprocess:r,message:i})=>{if(xO(t))throw new Error(`${Se(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(i)}.`,{cause:t})},xO=({code:t,message:e})=>SO.has(t)||kO.some(r=>e.includes(r)),SO=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),kO=["could not be cloned","circular structure","call stack size exceeded"],Se=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${CO(e)}${t}(${r})`,CO=t=>t?"":"subprocess.",ct=t=>t?"parent process":"subprocess",Ht=t=>{t.connected&&t.disconnect();};var Ie=()=>{let t={},e=new Promise((r,i)=>{Object.assign(t,{resolve:r,reject:i});});return Object.assign(e,t)};var Ui=(t,e="stdin")=>{let{options:i,fileDescriptors:n}=$e.get(t),o=ff(n,e,true),s=t.stdio[o];if(s===null)throw new TypeError(gf(o,e,i,true));return s},Yt=(t,e="stdout")=>{let{options:i,fileDescriptors:n}=$e.get(t),o=ff(n,e,false),s=o==="all"?t.all:t.stdio[o];if(s==null)throw new TypeError(gf(o,e,i,false));return s},$e=new WeakMap,ff=(t,e,r)=>{let i=OO(e,r);return EO(i,e,r,t),i},OO=(t,e)=>{let r=gs(t);if(r!==void 0)return r;let{validOptions:i,defaultValue:n}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Dr(e)}" must not be "${t}".
146
+ ${ke("getOneMessage",t)},
147
+ ${ke("sendMessage",t,"message, {strict: true}")},
148
+ ]);`)},zi=(t,e)=>new Error(`${ke("sendMessage",e)} failed when sending an acknowledgment response to the ${dt(e)}.`,{cause:t}),mf=t=>{throw new Error(`${ke("sendMessage",t)} failed: the ${dt(t)} is not listening to incoming messages.`)},ff=t=>{throw new Error(`${ke("sendMessage",t)} failed: the ${dt(t)} exited without listening to incoming messages.`)},gf=()=>new Error(`\`cancelSignal\` aborted: the ${dt(true)} disconnected.`),bf=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},yf=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${ke(e,r)} cannot be used: the ${dt(r)} is disconnecting.`,{cause:t})},wf=({error:t,methodName:e,isSubprocess:r,message:i})=>{if(AO(t))throw new Error(`${ke(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(i)}.`,{cause:t})},AO=({code:t,message:e})=>_O.has(t)||PO.some(r=>e.includes(r)),_O=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),PO=["could not be cloned","circular structure","call stack size exceeded"],ke=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${DO(e)}${t}(${r})`,DO=t=>t?"":"subprocess.",dt=t=>t?"parent process":"subprocess",Kt=t=>{t.connected&&t.disconnect();};var Ie=()=>{let t={},e=new Promise((r,i)=>{Object.assign(t,{resolve:r,reject:i});});return Object.assign(e,t)};var Vi=(t,e="stdin")=>{let{options:i,fileDescriptors:n}=$e.get(t),o=vf(n,e,true),s=t.stdio[o];if(s===null)throw new TypeError(xf(o,e,i,true));return s},Xt=(t,e="stdout")=>{let{options:i,fileDescriptors:n}=$e.get(t),o=vf(n,e,false),s=o==="all"?t.all:t.stdio[o];if(s==null)throw new TypeError(xf(o,e,i,false));return s},$e=new WeakMap,vf=(t,e,r)=>{let i=IO(e,r);return $O(i,e,r,t),i},IO=(t,e)=>{let r=ys(t);if(r!==void 0)return r;let{validOptions:i,defaultValue:n}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${$r(e)}" must not be "${t}".
149
149
  It must be ${i} or "fd3", "fd4" (and so on).
150
- It is optional and defaults to "${n}".`)},EO=(t,e,r,i)=>{let n=i[bf(t)];if(n===void 0)throw new TypeError(`"${Dr(r)}" must not be ${e}. That file descriptor does not exist.
151
- Please set the "stdio" option to ensure that file descriptor exists.`);if(n.direction==="input"&&!r)throw new TypeError(`"${Dr(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(n.direction!=="input"&&r)throw new TypeError(`"${Dr(r)}" must not be ${e}. It must be a writable stream, not readable.`)},gf=(t,e,r,i)=>{if(t==="all"&&!r.all)return `The "all" option must be true to use "from: 'all'".`;let{optionName:n,optionValue:o}=TO(t,r);return `The "${n}: ${Bi(o)}" option is incompatible with using "${Dr(i)}: ${Bi(e)}".
152
- Please set this option with "pipe" instead.`},TO=(t,{stdin:e,stdout:r,stderr:i,stdio:n})=>{let o=bf(t);return o===0&&e!==void 0?{optionName:"stdin",optionValue:e}:o===1&&r!==void 0?{optionName:"stdout",optionValue:r}:o===2&&i!==void 0?{optionName:"stderr",optionValue:i}:{optionName:`stdio[${o}]`,optionValue:n[o]}},bf=t=>t==="all"?1:t,Dr=t=>t?"to":"from",Bi=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream";var xt=(t,e,r)=>{let i=t.getMaxListeners();i===0||i===Number.POSITIVE_INFINITY||(t.setMaxListeners(i+e),events.addAbortListener(r,()=>{t.setMaxListeners(t.getMaxListeners()-e);}));};var zi=(t,e)=>{e&&Rs(t);},Rs=t=>{t.refCounted();},Gi=(t,e)=>{e&&Ms(t);},Ms=t=>{t.unrefCounted();},yf=(t,e)=>{e&&(Ms(t),Ms(t));},wf=(t,e)=>{e&&(Rs(t),Rs(t));};var vf=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:i},n)=>{if(kf(n)||Of(n))return;Vi.has(t)||Vi.set(t,[]);let o=Vi.get(t);if(o.push(n),!(o.length>1))for(;o.length>0;){await Cf(t,i,n),await promises$1.scheduler.yield();let s=await Sf({wrappedMessage:o[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:i});o.shift(),i.emit("message",s),i.emit("message:done");}},xf=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:i,boundOnMessage:n})=>{Fs();let o=Vi.get(t);for(;o?.length>0;)await events.once(i,"message:done");t.removeListener("message",n),wf(e,r),i.connected=false,i.emit("disconnect");},Vi=new WeakMap;var lt=(t,e,r)=>{if(Wi.has(t))return Wi.get(t);let i=new events.EventEmitter;return i.connected=true,Wi.set(t,i),IO({ipcEmitter:i,anyProcess:t,channel:e,isSubprocess:r}),i},Wi=new WeakMap,IO=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:i})=>{let n=vf.bind(void 0,{anyProcess:e,channel:r,isSubprocess:i,ipcEmitter:t});e.on("message",n),e.once("disconnect",xf.bind(void 0,{anyProcess:e,channel:r,isSubprocess:i,ipcEmitter:t,boundOnMessage:n})),yf(r,i);},Hi=t=>{let e=Wi.get(t);return e===void 0?t.channel!==null:e.connected};var Ef=({anyProcess:t,channel:e,isSubprocess:r,message:i,strict:n})=>{if(!n)return i;let o=lt(t,e,r),s=Ki(t,o);return {id:RO++,type:Ji,message:i,hasListeners:s}},RO=0n,Tf=(t,e)=>{if(!(e?.type!==Ji||e.hasListeners))for(let{id:r}of t)r!==void 0&&Yi[r].resolve({isDeadlock:true,hasListeners:false});},Sf=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:i,ipcEmitter:n})=>{if(t?.type!==Ji||!e.connected)return t;let{id:o,message:s}=t,a={id:o,type:_f,message:Ki(e,n)};try{await Xi({anyProcess:e,channel:r,isSubprocess:i,ipc:!0},a);}catch(c){n.emit("strict:error",c);}return s},kf=t=>{if(t?.type!==_f)return false;let{id:e,message:r}=t;return Yi[e]?.resolve({isDeadlock:false,hasListeners:r}),true},Af=async(t,e,r)=>{if(t?.type!==Ji)return;let i=Ie();Yi[t.id]=i;let n=new AbortController;try{let{isDeadlock:o,hasListeners:s}=await Promise.race([i,MO(e,r,n)]);o&&cf(r),s||lf(r);}finally{n.abort(),delete Yi[t.id];}},Yi={},MO=async(t,e,{signal:r})=>{xt(t,1,r),await events.once(t,"disconnect",{signal:r}),df(e);},Ji="execa:ipc:request",_f="execa:ipc:response";var Df=(t,e,r)=>{Pr.has(t)||Pr.set(t,new Set);let i=Pr.get(t),n=Ie(),o=r?e.id:void 0,s={onMessageSent:n,id:o};return i.add(s),{outgoingMessages:i,outgoingMessage:s}},Pf=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve();},Cf=async(t,e,r)=>{for(;!Ki(t,e)&&Pr.get(t)?.size>0;){let i=[...Pr.get(t)];Tf(i,r),await Promise.all(i.map(({onMessageSent:n})=>n));}},Pr=new WeakMap,Ki=(t,e)=>e.listenerCount("message")>FO(t),FO=t=>$e.has(t)&&!He($e.get(t).options.buffer,"ipc")?1:0;var Xi=({anyProcess:t,channel:e,isSubprocess:r,ipc:i},n,{strict:o=false}={})=>{let s="sendMessage";return Wt({methodName:s,isSubprocess:r,ipc:i,isConnected:t.connected}),NO({anyProcess:t,channel:e,methodName:s,isSubprocess:r,message:n,strict:o})},NO=async({anyProcess:t,channel:e,methodName:r,isSubprocess:i,message:n,strict:o})=>{let s=Ef({anyProcess:t,channel:e,isSubprocess:i,message:n,strict:o}),a=Df(t,s,o);try{await Ns({anyProcess:t,methodName:r,isSubprocess:i,wrappedMessage:s,message:n});}catch(c){throw Ht(t),c}finally{Pf(a);}},Ns=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:i,message:n})=>{let o=LO(t);try{await Promise.all([Af(i,t,r),o(i)]);}catch(s){throw pf({error:s,methodName:e,isSubprocess:r}),mf({error:s,methodName:e,isSubprocess:r,message:n}),s}},LO=t=>{if(js.has(t))return js.get(t);let e=util.promisify(t.send.bind(t));return js.set(t,e),e},js=new WeakMap;var $f=(t,e)=>{let r="cancelSignal";return $s(r,false,t.connected),Ns({anyProcess:t,methodName:r,isSubprocess:false,wrappedMessage:{type:Mf,message:e},message:e})},Rf=async({anyProcess:t,channel:e,isSubprocess:r,ipc:i})=>(await BO({anyProcess:t,channel:e,isSubprocess:r,ipc:i}),Ls.signal),BO=async({anyProcess:t,channel:e,isSubprocess:r,ipc:i})=>{if(!If){if(If=true,!i){hf();return}if(e===null){Fs();return}lt(t,e,r),await promises$1.scheduler.yield();}},If=false,Of=t=>t?.type!==Mf?false:(Ls.abort(t.message),true),Mf="execa:ipc:cancel",Fs=()=>{Ls.abort(uf());},Ls=new AbortController;var Ff=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:i})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(i==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},jf=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:i,context:n,controller:o})=>r?[UO({subprocess:t,cancelSignal:e,forceKillAfterDelay:i,context:n,controller:o})]:[],UO=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:i,controller:{signal:n}})=>{await Li(e,n);let o=zO(e);throw await $f(t,o),Is({kill:t.kill,forceKillAfterDelay:r,context:i,controllerSignal:n}),i.terminationReason??="gracefulCancel",e.reason},zO=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:false,configurable:true,writable:true}),e};var Nf=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},Lf=(t,e,r,i)=>e===0||e===void 0?[]:[VO(t,e,r,i)],VO=async(t,e,r,{signal:i})=>{throw await promises$1.setTimeout(e,void 0,{signal:i}),r.terminationReason??="timeout",t.kill(),new xe};var Bf=({options:t})=>{if(t.node===false)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return {options:{...t,node:true}}},Uf=(t,e,{node:r=false,nodePath:i=R.execPath,nodeOptions:n=R.execArgv.filter(c=>!c.startsWith("--inspect")),cwd:o,execPath:s,...a})=>{if(s!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=Bt(i,'The "nodePath" option'),d=L__default.default.resolve(o,c),l={...a,nodePath:d,node:r,cwd:o};if(!r)return [t,e,l];if(L__default.default.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return [d,[...n,t,...e],{ipc:true,...l,shell:false}]};var zf=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");XO[r](t);}},JO=t=>{try{v8.serialize(t);}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},KO=t=>{try{JSON.stringify(t);}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},XO={advanced:JO,json:KO},Gf=async(t,e)=>{e!==void 0&&await t.sendMessage(e);};var Wf=({encoding:t})=>{if(qs.has(t))return;let e=QO(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Zi(t)}\`.
153
- Please rename it to ${Zi(e)}.`);let r=[...qs].map(i=>Zi(i)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Zi(t)}\`.
154
- Please rename it to one of: ${r}.`)},ZO=new Set(["utf8","utf16le"]),pe=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),qs=new Set([...ZO,...pe]),QO=t=>{if(t===null)return "buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in Vf)return Vf[e];if(qs.has(e))return e},Vf={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Zi=t=>typeof t=="string"?`"${t}"`:String(t);var Hf=(t=Yf())=>{let e=Bt(t,'The "cwd" option');return L__default.default.resolve(e)},Yf=()=>{try{return R__default.default.cwd()}catch(t){throw t.message=`The current directory does not exist.
155
- ${t.message}`,t}},Jf=(t,e)=>{if(e===Yf())return t;let r;try{r=Wr.statSync(e);}catch(i){return `The "cwd" option is invalid: ${e}.
150
+ It is optional and defaults to "${n}".`)},$O=(t,e,r,i)=>{let n=i[Sf(t)];if(n===void 0)throw new TypeError(`"${$r(r)}" must not be ${e}. That file descriptor does not exist.
151
+ Please set the "stdio" option to ensure that file descriptor exists.`);if(n.direction==="input"&&!r)throw new TypeError(`"${$r(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(n.direction!=="input"&&r)throw new TypeError(`"${$r(r)}" must not be ${e}. It must be a writable stream, not readable.`)},xf=(t,e,r,i)=>{if(t==="all"&&!r.all)return `The "all" option must be true to use "from: 'all'".`;let{optionName:n,optionValue:o}=RO(t,r);return `The "${n}: ${Gi(o)}" option is incompatible with using "${$r(i)}: ${Gi(e)}".
152
+ Please set this option with "pipe" instead.`},RO=(t,{stdin:e,stdout:r,stderr:i,stdio:n})=>{let o=Sf(t);return o===0&&e!==void 0?{optionName:"stdin",optionValue:e}:o===1&&r!==void 0?{optionName:"stdout",optionValue:r}:o===2&&i!==void 0?{optionName:"stderr",optionValue:i}:{optionName:`stdio[${o}]`,optionValue:n[o]}},Sf=t=>t==="all"?1:t,$r=t=>t?"to":"from",Gi=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream";var St=(t,e,r)=>{let i=t.getMaxListeners();i===0||i===Number.POSITIVE_INFINITY||(t.setMaxListeners(i+e),events.addAbortListener(r,()=>{t.setMaxListeners(t.getMaxListeners()-e);}));};var Wi=(t,e)=>{e&&Fs(t);},Fs=t=>{t.refCounted();},Hi=(t,e)=>{e&&js(t);},js=t=>{t.unrefCounted();},kf=(t,e)=>{e&&(js(t),js(t));},Cf=(t,e)=>{e&&(Fs(t),Fs(t));};var Of=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:i},n)=>{if(Af(n)||Pf(n))return;Yi.has(t)||Yi.set(t,[]);let o=Yi.get(t);if(o.push(n),!(o.length>1))for(;o.length>0;){await _f(t,i,n),await promises$1.scheduler.yield();let s=await Tf({wrappedMessage:o[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:i});o.shift(),i.emit("message",s),i.emit("message:done");}},Ef=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:i,boundOnMessage:n})=>{Ns();let o=Yi.get(t);for(;o?.length>0;)await events.once(i,"message:done");t.removeListener("message",n),Cf(e,r),i.connected=false,i.emit("disconnect");},Yi=new WeakMap;var ut=(t,e,r)=>{if(Ji.has(t))return Ji.get(t);let i=new events.EventEmitter;return i.connected=true,Ji.set(t,i),qO({ipcEmitter:i,anyProcess:t,channel:e,isSubprocess:r}),i},Ji=new WeakMap,qO=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:i})=>{let n=Of.bind(void 0,{anyProcess:e,channel:r,isSubprocess:i,ipcEmitter:t});e.on("message",n),e.once("disconnect",Ef.bind(void 0,{anyProcess:e,channel:r,isSubprocess:i,ipcEmitter:t,boundOnMessage:n})),kf(r,i);},Ki=t=>{let e=Ji.get(t);return e===void 0?t.channel!==null:e.connected};var Df=({anyProcess:t,channel:e,isSubprocess:r,message:i,strict:n})=>{if(!n)return i;let o=ut(t,e,r),s=Qi(t,o);return {id:BO++,type:Zi,message:i,hasListeners:s}},BO=0n,If=(t,e)=>{if(!(e?.type!==Zi||e.hasListeners))for(let{id:r}of t)r!==void 0&&Xi[r].resolve({isDeadlock:true,hasListeners:false});},Tf=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:i,ipcEmitter:n})=>{if(t?.type!==Zi||!e.connected)return t;let{id:o,message:s}=t,a={id:o,type:Rf,message:Qi(e,n)};try{await en({anyProcess:e,channel:r,isSubprocess:i,ipc:!0},a);}catch(c){n.emit("strict:error",c);}return s},Af=t=>{if(t?.type!==Rf)return false;let{id:e,message:r}=t;return Xi[e]?.resolve({isDeadlock:false,hasListeners:r}),true},$f=async(t,e,r)=>{if(t?.type!==Zi)return;let i=Ie();Xi[t.id]=i;let n=new AbortController;try{let{isDeadlock:o,hasListeners:s}=await Promise.race([i,UO(e,r,n)]);o&&pf(r),s||mf(r);}finally{n.abort(),delete Xi[t.id];}},Xi={},UO=async(t,e,{signal:r})=>{St(t,1,r),await events.once(t,"disconnect",{signal:r}),ff(e);},Zi="execa:ipc:request",Rf="execa:ipc:response";var Mf=(t,e,r)=>{Rr.has(t)||Rr.set(t,new Set);let i=Rr.get(t),n=Ie(),o=r?e.id:void 0,s={onMessageSent:n,id:o};return i.add(s),{outgoingMessages:i,outgoingMessage:s}},Ff=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve();},_f=async(t,e,r)=>{for(;!Qi(t,e)&&Rr.get(t)?.size>0;){let i=[...Rr.get(t)];If(i,r),await Promise.all(i.map(({onMessageSent:n})=>n));}},Rr=new WeakMap,Qi=(t,e)=>e.listenerCount("message")>zO(t),zO=t=>$e.has(t)&&!Ye($e.get(t).options.buffer,"ipc")?1:0;var en=({anyProcess:t,channel:e,isSubprocess:r,ipc:i},n,{strict:o=false}={})=>{let s="sendMessage";return Jt({methodName:s,isSubprocess:r,ipc:i,isConnected:t.connected}),VO({anyProcess:t,channel:e,methodName:s,isSubprocess:r,message:n,strict:o})},VO=async({anyProcess:t,channel:e,methodName:r,isSubprocess:i,message:n,strict:o})=>{let s=Df({anyProcess:t,channel:e,isSubprocess:i,message:n,strict:o}),a=Mf(t,s,o);try{await Ls({anyProcess:t,methodName:r,isSubprocess:i,wrappedMessage:s,message:n});}catch(c){throw Kt(t),c}finally{Ff(a);}},Ls=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:i,message:n})=>{let o=WO(t);try{await Promise.all([$f(i,t,r),o(i)]);}catch(s){throw yf({error:s,methodName:e,isSubprocess:r}),wf({error:s,methodName:e,isSubprocess:r,message:n}),s}},WO=t=>{if(qs.has(t))return qs.get(t);let e=util.promisify(t.send.bind(t));return qs.set(t,e),e},qs=new WeakMap;var Nf=(t,e)=>{let r="cancelSignal";return Ms(r,false,t.connected),Ls({anyProcess:t,methodName:r,isSubprocess:false,wrappedMessage:{type:Lf,message:e},message:e})},qf=async({anyProcess:t,channel:e,isSubprocess:r,ipc:i})=>(await YO({anyProcess:t,channel:e,isSubprocess:r,ipc:i}),Bs.signal),YO=async({anyProcess:t,channel:e,isSubprocess:r,ipc:i})=>{if(!jf){if(jf=true,!i){bf();return}if(e===null){Ns();return}ut(t,e,r),await promises$1.scheduler.yield();}},jf=false,Pf=t=>t?.type!==Lf?false:(Bs.abort(t.message),true),Lf="execa:ipc:cancel",Ns=()=>{Bs.abort(gf());},Bs=new AbortController;var Bf=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:i})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(i==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},Uf=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:i,context:n,controller:o})=>r?[JO({subprocess:t,cancelSignal:e,forceKillAfterDelay:i,context:n,controller:o})]:[],JO=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:i,controller:{signal:n}})=>{await Ui(e,n);let o=KO(e);throw await Nf(t,o),Rs({kill:t.kill,forceKillAfterDelay:r,context:i,controllerSignal:n}),i.terminationReason??="gracefulCancel",e.reason},KO=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:false,configurable:true,writable:true}),e};var zf=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},Gf=(t,e,r,i)=>e===0||e===void 0?[]:[ZO(t,e,r,i)],ZO=async(t,e,r,{signal:i})=>{throw await promises$1.setTimeout(e,void 0,{signal:i}),r.terminationReason??="timeout",t.kill(),new Se};var Wf=({options:t})=>{if(t.node===false)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return {options:{...t,node:true}}},Hf=(t,e,{node:r=false,nodePath:i=$.execPath,nodeOptions:n=$.execArgv.filter(c=>!c.startsWith("--inspect")),cwd:o,execPath:s,...a})=>{if(s!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=Gt(i,'The "nodePath" option'),d=L__default.default.resolve(o,c),l={...a,nodePath:d,node:r,cwd:o};if(!r)return [t,e,l];if(L__default.default.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return [d,[...n,t,...e],{ipc:true,...l,shell:false}]};var Yf=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");nE[r](t);}},rE=t=>{try{v8.serialize(t);}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},iE=t=>{try{JSON.stringify(t);}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},nE={advanced:rE,json:iE},Jf=async(t,e)=>{e!==void 0&&await t.sendMessage(e);};var Xf=({encoding:t})=>{if(Us.has(t))return;let e=sE(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${tn(t)}\`.
153
+ Please rename it to ${tn(e)}.`);let r=[...Us].map(i=>tn(i)).join(", ");throw new TypeError(`Invalid option \`encoding: ${tn(t)}\`.
154
+ Please rename it to one of: ${r}.`)},oE=new Set(["utf8","utf16le"]),pe=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Us=new Set([...oE,...pe]),sE=t=>{if(t===null)return "buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in Kf)return Kf[e];if(Us.has(e))return e},Kf={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},tn=t=>typeof t=="string"?`"${t}"`:String(t);var Zf=(t=Qf())=>{let e=Gt(t,'The "cwd" option');return L__default.default.resolve(e)},Qf=()=>{try{return $__default.default.cwd()}catch(t){throw t.message=`The current directory does not exist.
155
+ ${t.message}`,t}},eg=(t,e)=>{if(e===Qf())return t;let r;try{r=Jr.statSync(e);}catch(i){return `The "cwd" option is invalid: ${e}.
156
156
  ${i.message}
157
157
  ${t}`}return r.isDirectory()?t:`The "cwd" option is not a directory: ${e}.
158
- ${t}`};var Qi=(t,e,r)=>{r.cwd=Hf(r.cwd);let[i,n,o]=Uf(t,e,r),{command:s,args:a,options:c}=Xf.default._parse(i,n,o),d=Mp(c),l=nE(d);return Nf(l),Wf(l),zf(l),of(l),Ff(l),l.shell=hs(l.shell),l.env=oE(l),l.killSignal=Qm(l.killSignal),l.forceKillAfterDelay=rf(l.forceKillAfterDelay),l.lines=l.lines.map((u,h)=>u&&!pe.has(l.encoding)&&l.buffer[h]),R__default.default.platform==="win32"&&L__default.default.basename(s,".exe")==="cmd"&&a.unshift("/q"),{file:s,commandArguments:a,options:l}},nE=({extendEnv:t=true,preferLocal:e=false,cwd:r,localDir:i=r,encoding:n="utf8",reject:o=true,cleanup:s=true,all:a=false,windowsHide:c=true,killSignal:d="SIGTERM",forceKillAfterDelay:l=true,gracefulCancel:u=false,ipcInput:h,ipc:p=h!==void 0||u,serialization:f="advanced",...b})=>({...b,extendEnv:t,preferLocal:e,cwd:r,localDirectory:i,encoding:n,reject:o,cleanup:s,all:a,windowsHide:c,killSignal:d,forceKillAfterDelay:l,gracefulCancel:u,ipcInput:h,ipc:p,serialization:f}),oE=({env:t,extendEnv:e,preferLocal:r,node:i,localDirectory:n,nodePath:o})=>{let s=e?{...R__default.default.env,...t}:t;return r||i?Um({env:s,cwd:n,execPath:o,preferLocal:r,addExecPath:i}):s};var en=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r];function Jt(t){if(typeof t=="string")return sE(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return aE(t)}var sE=t=>t.at(-1)===Zf?t.slice(0,t.at(-2)===Qf?-2:-1):t,aE=t=>t.at(-1)===cE?t.subarray(0,t.at(-2)===lE?-2:-1):t,Zf=`
159
- `,cE=Zf.codePointAt(0),Qf="\r",lE=Qf.codePointAt(0);function ke(t,{checkOpen:e=true}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function Bs(t,{checkOpen:e=true}={}){return ke(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function St(t,{checkOpen:e=true}={}){return ke(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Us(t,e){return Bs(t,e)&&St(t,e)}var dE=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),zs=class{#t;#r;#e=false;#i=void 0;constructor(e,r){this.#t=e,this.#r=r;}next(){let e=()=>this.#o();return this.#i=this.#i?this.#i.then(e,e):e(),this.#i}return(e){let r=()=>this.#n(e);return this.#i?this.#i.then(r,r):r()}async#o(){if(this.#e)return {done:true,value:void 0};let e;try{e=await this.#t.read();}catch(r){throw this.#i=void 0,this.#e=true,this.#t.releaseLock(),r}return e.done&&(this.#i=void 0,this.#e=true,this.#t.releaseLock()),e}async#n(e){if(this.#e)return {done:true,value:e};if(this.#e=true,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:true,value:e}}return this.#t.releaseLock(),{done:true,value:e}}},Gs=Symbol();function eg(){return this[Gs].next()}Object.defineProperty(eg,"name",{value:"next"});function tg(t){return this[Gs].return(t)}Object.defineProperty(tg,"name",{value:"return"});var uE=Object.create(dE,{next:{enumerable:true,configurable:true,writable:true,value:eg},return:{enumerable:true,configurable:true,writable:true,value:tg}});function Vs({preventCancel:t=false}={}){let e=this.getReader(),r=new zs(e,t),i=Object.create(uE);return i[Gs]=r,i}var rg=t=>{if(St(t,{checkOpen:false})&&Ir.on!==void 0)return pE(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(hE.call(t)==="[object ReadableStream]")return Vs.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:hE}=Object.prototype,pE=async function*(t){let e=new AbortController,r={};mE(t,e,r);try{for await(let[i]of Ir.on(t,"data",{signal:e.signal}))yield i;}catch(i){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw i}finally{t.destroy();}},mE=async(t,e,r)=>{try{await Ir.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1});}catch(i){r.error=i;}finally{e.abort();}},Ir={};var Kt=async(t,{init:e,convertChunk:r,getSize:i,truncateChunk:n,addChunk:o,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let d=rg(t),l=e();l.length=0;try{for await(let u of d){let h=gE(u),p=r[h](u,l);og({convertedChunk:p,state:l,getSize:i,truncateChunk:n,addChunk:o,maxBuffer:c});}return fE({state:l,convertChunk:r,getSize:i,truncateChunk:n,addChunk:o,getFinalChunk:s,maxBuffer:c}),a(l)}catch(u){let h=typeof u=="object"&&u!==null?u:new Error(u);throw h.bufferedData=a(l),h}},fE=({state:t,getSize:e,truncateChunk:r,addChunk:i,getFinalChunk:n,maxBuffer:o})=>{let s=n(t);s!==void 0&&og({convertedChunk:s,state:t,getSize:e,truncateChunk:r,addChunk:i,maxBuffer:o});},og=({convertedChunk:t,state:e,getSize:r,truncateChunk:i,addChunk:n,maxBuffer:o})=>{let s=r(t),a=e.length+s;if(a<=o){ig(t,e,n,a);return}let c=i(t,o-e.length);throw c!==void 0&&ig(c,e,n,o),new Re},ig=(t,e,r,i)=>{e.contents=r(t,e,i),e.length=i;},gE=t=>{let e=typeof t;if(e==="string")return "string";if(e!=="object"||t===null)return "others";if(globalThis.Buffer?.isBuffer(t))return "buffer";let r=ng.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&ng.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:ng}=Object.prototype,Re=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded");}};var Ye=t=>t,$r=()=>{},tn=({contents:t})=>t,rn=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},nn=t=>t.length;async function on(t,e){return Kt(t,vE,e)}var bE=()=>({contents:[]}),yE=()=>1,wE=(t,{contents:e})=>(e.push(t),e),vE={init:bE,convertChunk:{string:Ye,buffer:Ye,arrayBuffer:Ye,dataView:Ye,typedArray:Ye,others:Ye},getSize:yE,truncateChunk:$r,addChunk:wE,getFinalChunk:$r,finalize:tn};async function sn(t,e){return Kt(t,_E,e)}var xE=()=>({contents:new ArrayBuffer(0)}),SE=t=>kE.encode(t),kE=new TextEncoder,sg=t=>new Uint8Array(t),ag=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),CE=(t,e)=>t.slice(0,e),OE=(t,{contents:e,length:r},i)=>{let n=dg()?TE(e,i):EE(e,i);return new Uint8Array(n).set(t,r),n},EE=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(lg(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},TE=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:lg(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},lg=t=>cg**Math.ceil(Math.log(t)/Math.log(cg)),cg=2,AE=({contents:t,length:e})=>dg()?t:t.slice(0,e),dg=()=>"resize"in ArrayBuffer.prototype,_E={init:xE,convertChunk:{string:SE,buffer:sg,arrayBuffer:sg,dataView:ag,typedArray:ag,others:rn},getSize:nn,truncateChunk:CE,addChunk:OE,getFinalChunk:$r,finalize:AE};async function cn(t,e){return Kt(t,RE,e)}var DE=()=>({contents:"",textDecoder:new TextDecoder}),an=(t,{textDecoder:e})=>e.decode(t,{stream:true}),PE=(t,{contents:e})=>e+t,IE=(t,e)=>t.slice(0,e),$E=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},RE={init:DE,convertChunk:{string:Ye,buffer:an,arrayBuffer:an,dataView:an,typedArray:an,others:rn},getSize:nn,truncateChunk:IE,addChunk:PE,getFinalChunk:$E,finalize:tn};Object.assign(Ir,{on:events.on,finished:promises.finished});var ug=({error:t,stream:e,readableObjectMode:r,lines:i,encoding:n,fdNumber:o})=>{if(!(t instanceof Re))throw t;if(o==="all")return t;let s=jE(r,i,n);throw t.maxBufferInfo={fdNumber:o,unit:s},e.destroy(),t},jE=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",hg=(t,e,r)=>{if(e.length!==r)return;let i=new Re;throw i.maxBufferInfo={fdNumber:"ipc"},i},pg=(t,e)=>{let{streamName:r,threshold:i,unit:n}=NE(t,e);return `Command's ${r} was larger than ${i} ${n}`},NE=(t,e)=>{if(t?.maxBufferInfo===void 0)return {streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:i}}=t;delete t.maxBufferInfo;let n=He(e,r);return r==="ipc"?{streamName:"IPC output",threshold:n,unit:"messages"}:{streamName:Ci(r),threshold:n,unit:i}},mg=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(i=>i!==null&&i.length>ln(r)),fg=(t,e,r)=>{if(!e)return t;let i=ln(r);return t.length>i?t.slice(0,i):t},ln=([,t])=>t;var bg=({stdio:t,all:e,ipcOutput:r,originalError:i,signal:n,signalDescription:o,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:d,isGracefullyCanceled:l,isMaxBuffer:u,isForcefullyTerminated:h,forceKillAfterDelay:p,killSignal:f,maxBuffer:b,timeout:v,cwd:y})=>{let x=i?.code,k=qE({originalError:i,timedOut:c,timeout:v,isMaxBuffer:u,maxBuffer:b,errorCode:x,signal:n,signalDescription:o,exitCode:s,isCanceled:d,isGracefullyCanceled:l,isForcefullyTerminated:h,forceKillAfterDelay:p,killSignal:f}),C=UE(i,y),D=C===void 0?"":`
160
- ${C}`,_=`${k}: ${a}${D}`,z=e===void 0?[t[2],t[1]]:[e],K=[_,...z,...t.slice(3),r.map(w=>zE(w)).join(`
161
- `)].map(w=>Er(Jt(GE(w)))).filter(Boolean).join(`
162
-
163
- `);return {originalMessage:C,shortMessage:_,message:K}},qE=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:i,maxBuffer:n,errorCode:o,signal:s,signalDescription:a,exitCode:c,isCanceled:d,isGracefullyCanceled:l,isForcefullyTerminated:u,forceKillAfterDelay:h,killSignal:p})=>{let f=BE(u,h);return e?`Command timed out after ${r} milliseconds${f}`:l?s===void 0?`Command was gracefully canceled with exit code ${c}`:u?`Command was gracefully canceled${f}`:`Command was gracefully canceled with ${s} (${a})`:d?`Command was canceled${f}`:i?`${pg(t,n)}${f}`:o!==void 0?`Command failed with ${o}${f}`:u?`Command was killed with ${p} (${Ni(p)})${f}`:s!==void 0?`Command was killed with ${s} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},BE=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",UE=(t,e)=>{if(t instanceof xe)return;let r=Vm(t)?t.originalMessage:String(t?.message??t),i=Er(Jf(r,e));return i===""?void 0:i},zE=t=>typeof t=="string"?t:util.inspect(t),GE=t=>Array.isArray(t)?t.map(e=>Jt(gg(e))).filter(Boolean).join(`
164
- `):gg(t),gg=t=>typeof t=="string"?t:Q(t)?Si(t):"";var dn=({command:t,escapedCommand:e,stdio:r,all:i,ipcOutput:n,options:{cwd:o},startTime:s})=>yg({command:t,escapedCommand:e,cwd:o,durationMs:vs(s),failed:false,timedOut:false,isCanceled:false,isGracefullyCanceled:false,isTerminated:false,isMaxBuffer:false,isForcefullyTerminated:false,exitCode:0,stdout:r[1],stderr:r[2],all:i,stdio:r,ipcOutput:n,pipedFrom:[]}),Xt=({error:t,command:e,escapedCommand:r,fileDescriptors:i,options:n,startTime:o,isSync:s})=>Rr({error:t,command:e,escapedCommand:r,startTime:o,timedOut:false,isCanceled:false,isGracefullyCanceled:false,isMaxBuffer:false,isForcefullyTerminated:false,stdio:Array.from({length:i.length}),ipcOutput:[],options:n,isSync:s}),Rr=({error:t,command:e,escapedCommand:r,startTime:i,timedOut:n,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:d,signal:l,stdio:u,all:h,ipcOutput:p,options:{timeoutDuration:f,timeout:b=f,forceKillAfterDelay:v,killSignal:y,cwd:x,maxBuffer:k},isSync:C})=>{let{exitCode:D,signal:_,signalDescription:z}=WE(d,l),{originalMessage:K,shortMessage:w,message:E}=bg({stdio:u,all:h,ipcOutput:p,originalError:t,signal:_,signalDescription:z,exitCode:D,escapedCommand:r,timedOut:n,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:v,killSignal:y,maxBuffer:k,timeout:b,cwd:x}),O=zm(t,E,C);return Object.assign(O,VE({error:O,command:e,escapedCommand:r,startTime:i,timedOut:n,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:D,signal:_,signalDescription:z,stdio:u,all:h,ipcOutput:p,cwd:x,originalMessage:K,shortMessage:w})),O},VE=({error:t,command:e,escapedCommand:r,startTime:i,timedOut:n,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:d,signal:l,signalDescription:u,stdio:h,all:p,ipcOutput:f,cwd:b,originalMessage:v,shortMessage:y})=>yg({shortMessage:y,originalMessage:v,command:e,escapedCommand:r,cwd:b,durationMs:vs(i),failed:true,timedOut:n,isCanceled:o,isGracefullyCanceled:s,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:d,signal:l,signalDescription:u,code:t.cause?.code,stdout:h[1],stderr:h[2],all:p,stdio:h,ipcOutput:f,pipedFrom:[]}),yg=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),WE=(t,e)=>{let r=t===null?void 0:t,i=e===null?void 0:e,n=i===void 0?void 0:Ni(e);return {exitCode:r,signal:i,signalDescription:n}};var wg=t=>Number.isFinite(t)?t:0;function HE(t){return {days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(wg(t*1e3)%1e3),nanoseconds:Math.trunc(wg(t*1e6)%1e3)}}function YE(t){return {days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function Ws(t){switch(typeof t){case "number":{if(Number.isFinite(t))return HE(t);break}case "bigint":return YE(t)}throw new TypeError("Expected a finite number or bigint")}var JE=t=>t===0||t===0n,KE=(t,e)=>e===1||e===1n?t:`${t}s`,XE=1e-7,ZE=24n*60n*60n*1000n;function Hs(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let i=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=false,e.formatSubMilliseconds=false,e.separateMilliseconds=false,e.verbose=false),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let n=[],o=(l,u)=>{let h=Math.floor(l*10**u+XE);return (Math.round(h)/10**u).toFixed(u)},s=(l,u,h,p)=>{if(!((n.length===0||!e.colonNotation)&&JE(l)&&!(e.colonNotation&&h==="m"))){if(p??=String(l),e.colonNotation){let f=p.includes(".")?p.split(".")[0].length:p.length,b=n.length>0?2:1;p="0".repeat(Math.max(0,b-f))+p;}else p+=e.verbose?" "+KE(u,l):h;n.push(p);}},a=Ws(t),c=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let l=Number(a.seconds),u=Number(a.milliseconds),h=Number(a.microseconds),p=Number(a.nanoseconds);if(s(l,"second","s"),e.formatSubMilliseconds)s(u,"millisecond","ms"),s(h,"microsecond","\xB5s"),s(p,"nanosecond","ns");else {let f=u+h/1e3+p/1e6,b=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,v=f>=1?Math.round(f):Math.ceil(f),y=b?f.toFixed(b):v;s(Number.parseFloat(y),"millisecond","ms",y);}}else {let l=(r?Number(t%ZE):t)/1e3%60,u=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,h=o(l,u),p=e.keepDecimalsOnWholeSeconds?h:h.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p);}if(n.length===0)return i+"0"+(e.verbose?" milliseconds":"ms");let d=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(n=n.slice(0,Math.max(e.unitCount,1))),i+n.join(d)}var vg=(t,e)=>{t.failed&&Pe({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t});};var xg=(t,e)=>{Ut(e)&&(vg(t,e),QE(t,e));},QE=(t,e)=>{let r=`(done in ${Hs(t.durationMs)})`;Pe({type:"duration",verboseMessage:r,verboseInfo:e,result:t});};var Zt=(t,e,{reject:r})=>{if(xg(t,e),t.failed&&r)throw t;return t};var Cg=(t,e)=>kt(t)?"asyncGenerator":Tg(t)?"generator":un(t)?"fileUrl":n1(t)?"filePath":a1(t)?"webStream":ke(t,{checkOpen:false})?"native":Q(t)?"uint8Array":c1(t)?"asyncIterable":l1(t)?"iterable":Ks(t)?Og({},e):i1(t)?e1(t,e):"native",e1=(t,e)=>Us(t.transform,{checkOpen:false})?t1(t,e):Ks(t.transform)?Og(t,e):r1(t,e),t1=(t,e)=>(Eg(t,e,"Duplex stream"),"duplex"),Og=(t,e)=>(Eg(t,e,"web TransformStream"),"webTransform"),Eg=({final:t,binary:e,objectMode:r},i,n)=>{Sg(t,`${i}.final`,n),Sg(e,`${i}.binary`,n),Ys(r,`${i}.objectMode`);},Sg=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},r1=({transform:t,final:e,binary:r,objectMode:i},n)=>{if(t!==void 0&&!kg(t))throw new TypeError(`The \`${n}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Us(e,{checkOpen:false}))throw new TypeError(`The \`${n}.final\` option must not be a Duplex stream.`);if(Ks(e))throw new TypeError(`The \`${n}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!kg(e))throw new TypeError(`The \`${n}.final\` option must be a generator.`);return Ys(r,`${n}.binary`),Ys(i,`${n}.objectMode`),kt(t)||kt(e)?"asyncGenerator":"generator"},Ys=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},kg=t=>kt(t)||Tg(t),kt=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",Tg=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",i1=t=>X(t)&&(t.transform!==void 0||t.final!==void 0),un=t=>Object.prototype.toString.call(t)==="[object URL]",Ag=t=>un(t)&&t.protocol!=="file:",n1=t=>X(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>o1.has(e))&&Js(t.file),o1=new Set(["file","append"]),Js=t=>typeof t=="string",_g=(t,e)=>t==="native"&&typeof e=="string"&&!s1.has(e),s1=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Dg=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",hn=t=>Object.prototype.toString.call(t)==="[object WritableStream]",a1=t=>Dg(t)||hn(t),Ks=t=>Dg(t?.readable)&&hn(t?.writable),c1=t=>Pg(t)&&typeof t[Symbol.asyncIterator]=="function",l1=t=>Pg(t)&&typeof t[Symbol.iterator]=="function",Pg=t=>typeof t=="object"&&t!==null,ge=new Set(["generator","asyncGenerator","duplex","webTransform"]),pn=new Set(["fileUrl","filePath","fileNumber"]),Xs=new Set(["fileUrl","filePath"]),Ig=new Set([...Xs,"webStream","nodeStream"]),$g=new Set(["webTransform","duplex"]),dt={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var Zs=(t,e,r,i)=>i==="output"?d1(t,e,r):u1(t,e,r),d1=(t,e,r)=>{let i=e!==0&&r[e-1].value.readableObjectMode;return {writableObjectMode:i,readableObjectMode:t??i}},u1=(t,e,r)=>{let i=e===0?t===true:r[e-1].value.readableObjectMode,n=e!==r.length-1&&(t??i);return {writableObjectMode:i,readableObjectMode:n}},Rg=(t,e)=>{let r=t.findLast(({type:i})=>ge.has(i));return r===void 0?false:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var Mg=(t,e,r,i)=>[...t.filter(({type:n})=>!ge.has(n)),...h1(t,e,r,i)],h1=(t,e,r,{encoding:i})=>{let n=t.filter(({type:s})=>ge.has(s)),o=Array.from({length:n.length});for(let[s,a]of Object.entries(n))o[s]=p1({stdioItem:a,index:Number(s),newTransforms:o,optionName:e,direction:r,encoding:i});return b1(o,r)},p1=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:i,optionName:n,direction:o,encoding:s})=>e==="duplex"?m1({stdioItem:t,optionName:n}):e==="webTransform"?f1({stdioItem:t,index:r,newTransforms:i,direction:o}):g1({stdioItem:t,index:r,newTransforms:i,direction:o,encoding:s}),m1=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:i},objectMode:n=i}},optionName:o})=>{if(n&&!i)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!n&&i)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return {...t,value:{transform:e,writableObjectMode:r,readableObjectMode:i}}},f1=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:i,direction:n})=>{let{transform:o,objectMode:s}=X(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=Zs(s,r,i,n);return {...t,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},g1=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:i,direction:n,encoding:o})=>{let{transform:s,final:a,binary:c=false,preserveNewlines:d=false,objectMode:l}=X(e)?e:{transform:e},u=c||pe.has(o),{writableObjectMode:h,readableObjectMode:p}=Zs(l,r,i,n);return {...t,value:{transform:s,final:a,binary:u,preserveNewlines:d,writableObjectMode:h,readableObjectMode:p}}},b1=(t,e)=>e==="input"?t.reverse():t;var Fg=(t,e,r)=>{let i=t.map(n=>y1(n,e));if(i.includes("input")&&i.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return i.find(Boolean)??x1},y1=({type:t,value:e},r)=>w1[r]??jg[t](e),w1=["input","output","output"],Qt=()=>{},ea=()=>"input",jg={generator:Qt,asyncGenerator:Qt,fileUrl:Qt,filePath:Qt,iterable:ea,asyncIterable:ea,uint8Array:ea,webStream:t=>hn(t)?"output":"input",nodeStream(t){return St(t,{checkOpen:false})?Bs(t,{checkOpen:false})?void 0:"input":"output"},webTransform:Qt,duplex:Qt,native(t){let e=v1(t);if(e!==void 0)return e;if(ke(t,{checkOpen:false}))return jg.nodeStream(t)}},v1=t=>{if([0,R__default.default.stdin].includes(t))return "input";if([1,2,R__default.default.stdout,R__default.default.stderr].includes(t))return "output"},x1="output";var Ng=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t;var Lg=({stdio:t,ipc:e,buffer:r,...i},n,o)=>{let s=S1(t,i).map((a,c)=>qg(a,c));return o?C1(s,r,n):Ng(s,e)},S1=(t,e)=>{if(t===void 0)return fe.map(i=>e[i]);if(k1(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${fe.map(i=>`\`${i}\``).join(", ")}`);if(typeof t=="string")return [t,t,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,fe.length);return Array.from({length:r},(i,n)=>t[n])},k1=t=>fe.some(e=>t[e]!==void 0),qg=(t,e)=>Array.isArray(t)?t.map(r=>qg(r,e)):t??(e>=fe.length?"ignore":"pipe"),C1=(t,e,r)=>t.map((i,n)=>!e[n]&&n!==0&&!zt(r,n)&&O1(i)?"ignore":i),O1=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe");var Ug=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:i,direction:n,isSync:o})=>!r||e!=="native"?t:o?A1({stdioItem:t,fdNumber:i,direction:n}):P1({stdioItem:t,fdNumber:i}),A1=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:i,direction:n})=>{let o=_1({value:e,optionName:r,fdNumber:i,direction:n});if(o!==void 0)return o;if(ke(e,{checkOpen:false}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},_1=({value:t,optionName:e,fdNumber:r,direction:i})=>{let n=D1(t,r);if(n!==void 0){if(i==="output")return {type:"fileNumber",value:n,optionName:e};if(sC__default.default.isatty(n))throw new TypeError(`The \`${e}: ${Bi(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return {type:"uint8Array",value:We(Wr.readFileSync(n)),optionName:e}}},D1=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=ki.indexOf(t);if(r!==-1)return r},P1=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:i})=>e==="inherit"?{type:"nodeStream",value:Bg(i,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:Bg(e,e,r),optionName:r}:ke(e,{checkOpen:false})?{type:"nodeStream",value:e,optionName:r}:t,Bg=(t,e,r)=>{let i=ki[t];if(i===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return i};var zg=({input:t,inputFile:e},r)=>r===0?[...I1(t),...R1(e)]:[],I1=t=>t===void 0?[]:[{type:$1(t),value:t,optionName:"input"}],$1=t=>{if(St(t,{checkOpen:false}))return "nodeStream";if(typeof t=="string")return "string";if(Q(t))return "uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},R1=t=>t===void 0?[]:[{...M1(t),optionName:"inputFile"}],M1=t=>{if(un(t))return {type:"fileUrl",value:t};if(Js(t))return {type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var Gg=t=>t.filter((e,r)=>t.every((i,n)=>e.value!==i.value||r>=n||e.type==="generator"||e.type==="asyncGenerator")),Vg=({stdioItem:{type:t,value:e,optionName:r},direction:i,fileDescriptors:n,isSync:o})=>{let s=F1(n,t);if(s.length!==0){if(o){j1({otherStdioItems:s,type:t,value:e,optionName:r,direction:i});return}if(Ig.has(t))return Wg({otherStdioItems:s,type:t,value:e,optionName:r,direction:i});$g.has(t)&&L1({otherStdioItems:s,type:t,value:e,optionName:r});}},F1=(t,e)=>t.flatMap(({direction:r,stdioItems:i})=>i.filter(n=>n.type===e).map((n=>({...n,direction:r})))),j1=({otherStdioItems:t,type:e,value:r,optionName:i,direction:n})=>{Xs.has(e)&&Wg({otherStdioItems:t,type:e,value:r,optionName:i,direction:n});},Wg=({otherStdioItems:t,type:e,value:r,optionName:i,direction:n})=>{let o=t.filter(a=>N1(a,r));if(o.length===0)return;let s=o.find(a=>a.direction!==n);return Hg(s,i,e),n==="output"?o[0].stream:void 0},N1=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,L1=({otherStdioItems:t,type:e,value:r,optionName:i})=>{let n=t.find(({value:{transform:o}})=>o===r.transform);Hg(n,i,e);},Hg=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${dt[r]} that is the same.`)};var mn=(t,e,r,i)=>{let o=Lg(e,r,i).map((a,c)=>q1({stdioOption:a,fdNumber:c,options:e,isSync:i})),s=Y1({initialFileDescriptors:o,addProperties:t,options:e,isSync:i});return e.stdio=s.map(({stdioItems:a})=>X1(a)),s},q1=({stdioOption:t,fdNumber:e,options:r,isSync:i})=>{let n=Ci(e),{stdioItems:o,isStdioArray:s}=B1({stdioOption:t,fdNumber:e,options:r,optionName:n}),a=Fg(o,e,n),c=o.map(u=>Ug({stdioItem:u,isStdioArray:s,fdNumber:e,direction:a,isSync:i})),d=Mg(c,n,a,r),l=Rg(d,a);return H1(d,l),{direction:a,objectMode:l,stdioItems:d}},B1=({stdioOption:t,fdNumber:e,options:r,optionName:i})=>{let o=[...(Array.isArray(t)?t:[t]).map(c=>U1(c,i)),...zg(r,e)],s=Gg(o),a=s.length>1;return z1(s,a,i),V1(s),{stdioItems:s,isStdioArray:a}},U1=(t,e)=>({type:Cg(t,e),value:t,optionName:e}),z1=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:i,optionName:n}of t)if(G1.has(i))throw new Error(`The \`${n}\` option must not include \`${i}\`.`)}},G1=new Set(["ignore","ipc"]),V1=t=>{for(let e of t)W1(e);},W1=({type:t,value:e,optionName:r})=>{if(Ag(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
165
- For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(_g(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},H1=(t,e)=>{if(!e)return;let r=t.find(({type:i})=>pn.has(i));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},Y1=({initialFileDescriptors:t,addProperties:e,options:r,isSync:i})=>{let n=[];try{for(let o of t)n.push(J1({fileDescriptor:o,fileDescriptors:n,addProperties:e,options:r,isSync:i}));return n}catch(o){throw ta(n),o}},J1=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:i,addProperties:n,options:o,isSync:s})=>{let a=r.map(c=>K1({stdioItem:c,addProperties:n,direction:t,options:o,fileDescriptors:i,isSync:s}));return {direction:t,objectMode:e,stdioItems:a}},K1=({stdioItem:t,addProperties:e,direction:r,options:i,fileDescriptors:n,isSync:o})=>{let s=Vg({stdioItem:t,direction:r,fileDescriptors:n,isSync:o});return s!==void 0?{...t,stream:s}:{...t,...e[r][t.type](t,i)}},ta=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!ve(r)&&r.destroy();},X1=t=>{if(t.length>1)return t.some(({value:i})=>i==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"};var Kg=(t,e)=>mn(Q1,t,e,true),Me=({type:t,optionName:e})=>{Xg(e,dt[t]);},Z1=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&Xg(t,`"${e}"`),{}),Xg=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},Jg={generator(){},asyncGenerator:Me,webStream:Me,nodeStream:Me,webTransform:Me,duplex:Me,asyncIterable:Me,native:Z1},Q1={input:{...Jg,fileUrl:({value:t})=>({contents:[We(Wr.readFileSync(t))]}),filePath:({value:{file:t}})=>({contents:[We(Wr.readFileSync(t))]}),fileNumber:Me,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...Jg,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:Me,string:Me,uint8Array:Me}};var Je=(t,{stripFinalNewline:e},r)=>ra(e,r)&&t!==void 0&&!Array.isArray(t)?Jt(t):t,ra=(t,e)=>e==="all"?t[1]||t[2]:t[e];var fn=(t,e,r,i)=>t||r?void 0:Qg(e,i),na=(t,e,r)=>r?t.flatMap(i=>Zg(i,e)):Zg(t,e),Zg=(t,e)=>{let{transform:r,final:i}=Qg(e,{});return [...r(t),...i()]},Qg=(t,e)=>(e.previousChunks="",{transform:eT.bind(void 0,e,t),final:rT.bind(void 0,e)}),eT=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:i}=t,n=-1;for(let o=0;o<r.length;o+=1)if(r[o]===`
166
- `){let s=tT(r,o,e,t),a=r.slice(n+1,o+1-s);i.length>0&&(a=ia(i,a),i=""),yield a,n=o;}n!==r.length-1&&(i=ia(i,r.slice(n+1))),t.previousChunks=i;},tT=(t,e,r,i)=>r?0:(i.isWindowsNewline=e!==0&&t[e-1]==="\r",i.isWindowsNewline?2:1),rT=function*({previousChunks:t}){t.length>0&&(yield t);},eb=({binary:t,preserveNewlines:e,readableObjectMode:r,state:i})=>t||e||r?void 0:{transform:iT.bind(void 0,i)},iT=function*({isWindowsNewline:t=false},e){let{unixNewline:r,windowsNewline:i,LF:n,concatBytes:o}=typeof e=="string"?nT:sT;if(e.at(-1)===n){yield e;return}yield o(e,t?i:r);},ia=(t,e)=>`${t}${e}`,nT={windowsNewline:`\r
158
+ ${t}`};var rn=(t,e,r)=>{r.cwd=Zf(r.cwd);let[i,n,o]=Hf(t,e,r),{command:s,args:a,options:c}=rg.default._parse(i,n,o),d=Lp(c),l=uE(d);return zf(l),Xf(l),Yf(l),df(l),Bf(l),l.shell=ms(l.shell),l.env=hE(l),l.killSignal=of(l.killSignal),l.forceKillAfterDelay=cf(l.forceKillAfterDelay),l.lines=l.lines.map((u,h)=>u&&!pe.has(l.encoding)&&l.buffer[h]),$__default.default.platform==="win32"&&L__default.default.basename(s,".exe")==="cmd"&&a.unshift("/q"),{file:s,commandArguments:a,options:l}},uE=({extendEnv:t=true,preferLocal:e=false,cwd:r,localDir:i=r,encoding:n="utf8",reject:o=true,cleanup:s=true,all:a=false,windowsHide:c=true,killSignal:d="SIGTERM",forceKillAfterDelay:l=true,gracefulCancel:u=false,ipcInput:h,ipc:p=h!==void 0||u,serialization:m="advanced",...b})=>({...b,extendEnv:t,preferLocal:e,cwd:r,localDirectory:i,encoding:n,reject:o,cleanup:s,all:a,windowsHide:c,killSignal:d,forceKillAfterDelay:l,gracefulCancel:u,ipcInput:h,ipc:p,serialization:m}),hE=({env:t,extendEnv:e,preferLocal:r,node:i,localDirectory:n,nodePath:o})=>{let s=e?{...$__default.default.env,...t}:t;return r||i?Hm({env:s,cwd:n,execPath:o,preferLocal:r,addExecPath:i}):s};var nn=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r];function Zt(t){if(typeof t=="string")return pE(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return mE(t)}var pE=t=>t.at(-1)===ig?t.slice(0,t.at(-2)===ng?-2:-1):t,mE=t=>t.at(-1)===fE?t.subarray(0,t.at(-2)===gE?-2:-1):t,ig=`
159
+ `,fE=ig.codePointAt(0),ng="\r",gE=ng.codePointAt(0);function Ce(t,{checkOpen:e=true}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function zs(t,{checkOpen:e=true}={}){return Ce(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function kt(t,{checkOpen:e=true}={}){return Ce(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Gs(t,e){return zs(t,e)&&kt(t,e)}var bE=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),Vs=class{#t;#r;#e=false;#i=void 0;constructor(e,r){this.#t=e,this.#r=r;}next(){let e=()=>this.#o();return this.#i=this.#i?this.#i.then(e,e):e(),this.#i}return(e){let r=()=>this.#n(e);return this.#i?this.#i.then(r,r):r()}async#o(){if(this.#e)return {done:true,value:void 0};let e;try{e=await this.#t.read();}catch(r){throw this.#i=void 0,this.#e=true,this.#t.releaseLock(),r}return e.done&&(this.#i=void 0,this.#e=true,this.#t.releaseLock()),e}async#n(e){if(this.#e)return {done:true,value:e};if(this.#e=true,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:true,value:e}}return this.#t.releaseLock(),{done:true,value:e}}},Ws=Symbol();function og(){return this[Ws].next()}Object.defineProperty(og,"name",{value:"next"});function sg(t){return this[Ws].return(t)}Object.defineProperty(sg,"name",{value:"return"});var yE=Object.create(bE,{next:{enumerable:true,configurable:true,writable:true,value:og},return:{enumerable:true,configurable:true,writable:true,value:sg}});function Hs({preventCancel:t=false}={}){let e=this.getReader(),r=new Vs(e,t),i=Object.create(yE);return i[Ws]=r,i}var ag=t=>{if(kt(t,{checkOpen:false})&&Mr.on!==void 0)return vE(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(wE.call(t)==="[object ReadableStream]")return Hs.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:wE}=Object.prototype,vE=async function*(t){let e=new AbortController,r={};xE(t,e,r);try{for await(let[i]of Mr.on(t,"data",{signal:e.signal}))yield i;}catch(i){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw i}finally{t.destroy();}},xE=async(t,e,r)=>{try{await Mr.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1});}catch(i){r.error=i;}finally{e.abort();}},Mr={};var Qt=async(t,{init:e,convertChunk:r,getSize:i,truncateChunk:n,addChunk:o,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let d=ag(t),l=e();l.length=0;try{for await(let u of d){let h=kE(u),p=r[h](u,l);dg({convertedChunk:p,state:l,getSize:i,truncateChunk:n,addChunk:o,maxBuffer:c});}return SE({state:l,convertChunk:r,getSize:i,truncateChunk:n,addChunk:o,getFinalChunk:s,maxBuffer:c}),a(l)}catch(u){let h=typeof u=="object"&&u!==null?u:new Error(u);throw h.bufferedData=a(l),h}},SE=({state:t,getSize:e,truncateChunk:r,addChunk:i,getFinalChunk:n,maxBuffer:o})=>{let s=n(t);s!==void 0&&dg({convertedChunk:s,state:t,getSize:e,truncateChunk:r,addChunk:i,maxBuffer:o});},dg=({convertedChunk:t,state:e,getSize:r,truncateChunk:i,addChunk:n,maxBuffer:o})=>{let s=r(t),a=e.length+s;if(a<=o){cg(t,e,n,a);return}let c=i(t,o-e.length);throw c!==void 0&&cg(c,e,n,o),new Re},cg=(t,e,r,i)=>{e.contents=r(t,e,i),e.length=i;},kE=t=>{let e=typeof t;if(e==="string")return "string";if(e!=="object"||t===null)return "others";if(globalThis.Buffer?.isBuffer(t))return "buffer";let r=lg.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&lg.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:lg}=Object.prototype,Re=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded");}};var Je=t=>t,Fr=()=>{},on=({contents:t})=>t,sn=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},an=t=>t.length;async function cn(t,e){return Qt(t,TE,e)}var CE=()=>({contents:[]}),OE=()=>1,EE=(t,{contents:e})=>(e.push(t),e),TE={init:CE,convertChunk:{string:Je,buffer:Je,arrayBuffer:Je,dataView:Je,typedArray:Je,others:Je},getSize:OE,truncateChunk:Fr,addChunk:EE,getFinalChunk:Fr,finalize:on};async function ln(t,e){return Qt(t,FE,e)}var AE=()=>({contents:new ArrayBuffer(0)}),_E=t=>PE.encode(t),PE=new TextEncoder,ug=t=>new Uint8Array(t),hg=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),DE=(t,e)=>t.slice(0,e),IE=(t,{contents:e,length:r},i)=>{let n=fg()?RE(e,i):$E(e,i);return new Uint8Array(n).set(t,r),n},$E=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(mg(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},RE=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:mg(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},mg=t=>pg**Math.ceil(Math.log(t)/Math.log(pg)),pg=2,ME=({contents:t,length:e})=>fg()?t:t.slice(0,e),fg=()=>"resize"in ArrayBuffer.prototype,FE={init:AE,convertChunk:{string:_E,buffer:ug,arrayBuffer:ug,dataView:hg,typedArray:hg,others:sn},getSize:an,truncateChunk:DE,addChunk:IE,getFinalChunk:Fr,finalize:ME};async function un(t,e){return Qt(t,BE,e)}var jE=()=>({contents:"",textDecoder:new TextDecoder}),dn=(t,{textDecoder:e})=>e.decode(t,{stream:true}),NE=(t,{contents:e})=>e+t,qE=(t,e)=>t.slice(0,e),LE=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},BE={init:jE,convertChunk:{string:Je,buffer:dn,arrayBuffer:dn,dataView:dn,typedArray:dn,others:sn},getSize:an,truncateChunk:qE,addChunk:NE,getFinalChunk:LE,finalize:on};Object.assign(Mr,{on:events.on,finished:promises.finished});var gg=({error:t,stream:e,readableObjectMode:r,lines:i,encoding:n,fdNumber:o})=>{if(!(t instanceof Re))throw t;if(o==="all")return t;let s=GE(r,i,n);throw t.maxBufferInfo={fdNumber:o,unit:s},e.destroy(),t},GE=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",bg=(t,e,r)=>{if(e.length!==r)return;let i=new Re;throw i.maxBufferInfo={fdNumber:"ipc"},i},yg=(t,e)=>{let{streamName:r,threshold:i,unit:n}=VE(t,e);return `Command's ${r} was larger than ${i} ${n}`},VE=(t,e)=>{if(t?.maxBufferInfo===void 0)return {streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:i}}=t;delete t.maxBufferInfo;let n=Ye(e,r);return r==="ipc"?{streamName:"IPC output",threshold:n,unit:"messages"}:{streamName:Ti(r),threshold:n,unit:i}},wg=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(i=>i!==null&&i.length>hn(r)),vg=(t,e,r)=>{if(!e)return t;let i=hn(r);return t.length>i?t.slice(0,i):t},hn=([,t])=>t;var Sg=({stdio:t,all:e,ipcOutput:r,originalError:i,signal:n,signalDescription:o,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:d,isGracefullyCanceled:l,isMaxBuffer:u,isForcefullyTerminated:h,forceKillAfterDelay:p,killSignal:m,maxBuffer:b,timeout:y,cwd:w})=>{let S=i?.code,C=HE({originalError:i,timedOut:c,timeout:y,isMaxBuffer:u,maxBuffer:b,errorCode:S,signal:n,signalDescription:o,exitCode:s,isCanceled:d,isGracefullyCanceled:l,isForcefullyTerminated:h,forceKillAfterDelay:p,killSignal:m}),M=JE(i,w),Z=M===void 0?"":`
160
+ ${M}`,O=`${C}: ${a}${Z}`,D=e===void 0?[t[2],t[1]]:[e],q=[O,...D,...t.slice(3),r.map(v=>KE(v)).join(`
161
+ `)].map(v=>_r(Zt(XE(v)))).filter(Boolean).join(`
162
+
163
+ `);return {originalMessage:M,shortMessage:O,message:q}},HE=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:i,maxBuffer:n,errorCode:o,signal:s,signalDescription:a,exitCode:c,isCanceled:d,isGracefullyCanceled:l,isForcefullyTerminated:u,forceKillAfterDelay:h,killSignal:p})=>{let m=YE(u,h);return e?`Command timed out after ${r} milliseconds${m}`:l?s===void 0?`Command was gracefully canceled with exit code ${c}`:u?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${s} (${a})`:d?`Command was canceled${m}`:i?`${yg(t,n)}${m}`:o!==void 0?`Command failed with ${o}${m}`:u?`Command was killed with ${p} (${Bi(p)})${m}`:s!==void 0?`Command was killed with ${s} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},YE=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",JE=(t,e)=>{if(t instanceof Se)return;let r=Km(t)?t.originalMessage:String(t?.message??t),i=_r(eg(r,e));return i===""?void 0:i},KE=t=>typeof t=="string"?t:util.inspect(t),XE=t=>Array.isArray(t)?t.map(e=>Zt(xg(e))).filter(Boolean).join(`
164
+ `):xg(t),xg=t=>typeof t=="string"?t:Q(t)?Oi(t):"";var pn=({command:t,escapedCommand:e,stdio:r,all:i,ipcOutput:n,options:{cwd:o},startTime:s})=>kg({command:t,escapedCommand:e,cwd:o,durationMs:Ss(s),failed:false,timedOut:false,isCanceled:false,isGracefullyCanceled:false,isTerminated:false,isMaxBuffer:false,isForcefullyTerminated:false,exitCode:0,stdout:r[1],stderr:r[2],all:i,stdio:r,ipcOutput:n,pipedFrom:[]}),er=({error:t,command:e,escapedCommand:r,fileDescriptors:i,options:n,startTime:o,isSync:s})=>jr({error:t,command:e,escapedCommand:r,startTime:o,timedOut:false,isCanceled:false,isGracefullyCanceled:false,isMaxBuffer:false,isForcefullyTerminated:false,stdio:Array.from({length:i.length}),ipcOutput:[],options:n,isSync:s}),jr=({error:t,command:e,escapedCommand:r,startTime:i,timedOut:n,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:d,signal:l,stdio:u,all:h,ipcOutput:p,options:{timeoutDuration:m,timeout:b=m,forceKillAfterDelay:y,killSignal:w,cwd:S,maxBuffer:C},isSync:M})=>{let{exitCode:Z,signal:O,signalDescription:D}=QE(d,l),{originalMessage:q,shortMessage:v,message:E}=Sg({stdio:u,all:h,ipcOutput:p,originalError:t,signal:O,signalDescription:D,exitCode:Z,escapedCommand:r,timedOut:n,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:y,killSignal:w,maxBuffer:C,timeout:b,cwd:S}),k=Ym(t,E,M);return Object.assign(k,ZE({error:k,command:e,escapedCommand:r,startTime:i,timedOut:n,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:Z,signal:O,signalDescription:D,stdio:u,all:h,ipcOutput:p,cwd:S,originalMessage:q,shortMessage:v})),k},ZE=({error:t,command:e,escapedCommand:r,startTime:i,timedOut:n,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:d,signal:l,signalDescription:u,stdio:h,all:p,ipcOutput:m,cwd:b,originalMessage:y,shortMessage:w})=>kg({shortMessage:w,originalMessage:y,command:e,escapedCommand:r,cwd:b,durationMs:Ss(i),failed:true,timedOut:n,isCanceled:o,isGracefullyCanceled:s,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:d,signal:l,signalDescription:u,code:t.cause?.code,stdout:h[1],stderr:h[2],all:p,stdio:h,ipcOutput:m,pipedFrom:[]}),kg=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),QE=(t,e)=>{let r=t===null?void 0:t,i=e===null?void 0:e,n=i===void 0?void 0:Bi(e);return {exitCode:r,signal:i,signalDescription:n}};var Cg=t=>Number.isFinite(t)?t:0;function e1(t){return {days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(Cg(t*1e3)%1e3),nanoseconds:Math.trunc(Cg(t*1e6)%1e3)}}function t1(t){return {days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function Ys(t){switch(typeof t){case "number":{if(Number.isFinite(t))return e1(t);break}case "bigint":return t1(t)}throw new TypeError("Expected a finite number or bigint")}var r1=t=>t===0||t===0n,i1=(t,e)=>e===1||e===1n?t:`${t}s`,n1=1e-7,o1=24n*60n*60n*1000n;function Js(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let i=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=false,e.formatSubMilliseconds=false,e.separateMilliseconds=false,e.verbose=false),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let n=[],o=(l,u)=>{let h=Math.floor(l*10**u+n1);return (Math.round(h)/10**u).toFixed(u)},s=(l,u,h,p)=>{if(!((n.length===0||!e.colonNotation)&&r1(l)&&!(e.colonNotation&&h==="m"))){if(p??=String(l),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,b=n.length>0?2:1;p="0".repeat(Math.max(0,b-m))+p;}else p+=e.verbose?" "+i1(u,l):h;n.push(p);}},a=Ys(t),c=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let l=Number(a.seconds),u=Number(a.milliseconds),h=Number(a.microseconds),p=Number(a.nanoseconds);if(s(l,"second","s"),e.formatSubMilliseconds)s(u,"millisecond","ms"),s(h,"microsecond","\xB5s"),s(p,"nanosecond","ns");else {let m=u+h/1e3+p/1e6,b=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,y=m>=1?Math.round(m):Math.ceil(m),w=b?m.toFixed(b):y;s(Number.parseFloat(w),"millisecond","ms",w);}}else {let l=(r?Number(t%o1):t)/1e3%60,u=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,h=o(l,u),p=e.keepDecimalsOnWholeSeconds?h:h.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p);}if(n.length===0)return i+"0"+(e.verbose?" milliseconds":"ms");let d=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(n=n.slice(0,Math.max(e.unitCount,1))),i+n.join(d)}var Og=(t,e)=>{t.failed&&De({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t});};var Eg=(t,e)=>{Vt(e)&&(Og(t,e),s1(t,e));},s1=(t,e)=>{let r=`(done in ${Js(t.durationMs)})`;De({type:"duration",verboseMessage:r,verboseInfo:e,result:t});};var tr=(t,e,{reject:r})=>{if(Eg(t,e),t.failed&&r)throw t;return t};var _g=(t,e)=>Ct(t)?"asyncGenerator":Ig(t)?"generator":mn(t)?"fileUrl":u1(t)?"filePath":m1(t)?"webStream":Ce(t,{checkOpen:false})?"native":Q(t)?"uint8Array":f1(t)?"asyncIterable":g1(t)?"iterable":Zs(t)?Pg({},e):d1(t)?a1(t,e):"native",a1=(t,e)=>Gs(t.transform,{checkOpen:false})?c1(t,e):Zs(t.transform)?Pg(t,e):l1(t,e),c1=(t,e)=>(Dg(t,e,"Duplex stream"),"duplex"),Pg=(t,e)=>(Dg(t,e,"web TransformStream"),"webTransform"),Dg=({final:t,binary:e,objectMode:r},i,n)=>{Tg(t,`${i}.final`,n),Tg(e,`${i}.binary`,n),Ks(r,`${i}.objectMode`);},Tg=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},l1=({transform:t,final:e,binary:r,objectMode:i},n)=>{if(t!==void 0&&!Ag(t))throw new TypeError(`The \`${n}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Gs(e,{checkOpen:false}))throw new TypeError(`The \`${n}.final\` option must not be a Duplex stream.`);if(Zs(e))throw new TypeError(`The \`${n}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!Ag(e))throw new TypeError(`The \`${n}.final\` option must be a generator.`);return Ks(r,`${n}.binary`),Ks(i,`${n}.objectMode`),Ct(t)||Ct(e)?"asyncGenerator":"generator"},Ks=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},Ag=t=>Ct(t)||Ig(t),Ct=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",Ig=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",d1=t=>X(t)&&(t.transform!==void 0||t.final!==void 0),mn=t=>Object.prototype.toString.call(t)==="[object URL]",$g=t=>mn(t)&&t.protocol!=="file:",u1=t=>X(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>h1.has(e))&&Xs(t.file),h1=new Set(["file","append"]),Xs=t=>typeof t=="string",Rg=(t,e)=>t==="native"&&typeof e=="string"&&!p1.has(e),p1=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Mg=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",fn=t=>Object.prototype.toString.call(t)==="[object WritableStream]",m1=t=>Mg(t)||fn(t),Zs=t=>Mg(t?.readable)&&fn(t?.writable),f1=t=>Fg(t)&&typeof t[Symbol.asyncIterator]=="function",g1=t=>Fg(t)&&typeof t[Symbol.iterator]=="function",Fg=t=>typeof t=="object"&&t!==null,ge=new Set(["generator","asyncGenerator","duplex","webTransform"]),gn=new Set(["fileUrl","filePath","fileNumber"]),Qs=new Set(["fileUrl","filePath"]),jg=new Set([...Qs,"webStream","nodeStream"]),Ng=new Set(["webTransform","duplex"]),ht={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var ea=(t,e,r,i)=>i==="output"?b1(t,e,r):y1(t,e,r),b1=(t,e,r)=>{let i=e!==0&&r[e-1].value.readableObjectMode;return {writableObjectMode:i,readableObjectMode:t??i}},y1=(t,e,r)=>{let i=e===0?t===true:r[e-1].value.readableObjectMode,n=e!==r.length-1&&(t??i);return {writableObjectMode:i,readableObjectMode:n}},qg=(t,e)=>{let r=t.findLast(({type:i})=>ge.has(i));return r===void 0?false:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var Lg=(t,e,r,i)=>[...t.filter(({type:n})=>!ge.has(n)),...w1(t,e,r,i)],w1=(t,e,r,{encoding:i})=>{let n=t.filter(({type:s})=>ge.has(s)),o=Array.from({length:n.length});for(let[s,a]of Object.entries(n))o[s]=v1({stdioItem:a,index:Number(s),newTransforms:o,optionName:e,direction:r,encoding:i});return C1(o,r)},v1=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:i,optionName:n,direction:o,encoding:s})=>e==="duplex"?x1({stdioItem:t,optionName:n}):e==="webTransform"?S1({stdioItem:t,index:r,newTransforms:i,direction:o}):k1({stdioItem:t,index:r,newTransforms:i,direction:o,encoding:s}),x1=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:i},objectMode:n=i}},optionName:o})=>{if(n&&!i)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!n&&i)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return {...t,value:{transform:e,writableObjectMode:r,readableObjectMode:i}}},S1=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:i,direction:n})=>{let{transform:o,objectMode:s}=X(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=ea(s,r,i,n);return {...t,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},k1=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:i,direction:n,encoding:o})=>{let{transform:s,final:a,binary:c=false,preserveNewlines:d=false,objectMode:l}=X(e)?e:{transform:e},u=c||pe.has(o),{writableObjectMode:h,readableObjectMode:p}=ea(l,r,i,n);return {...t,value:{transform:s,final:a,binary:u,preserveNewlines:d,writableObjectMode:h,readableObjectMode:p}}},C1=(t,e)=>e==="input"?t.reverse():t;var Bg=(t,e,r)=>{let i=t.map(n=>O1(n,e));if(i.includes("input")&&i.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return i.find(Boolean)??A1},O1=({type:t,value:e},r)=>E1[r]??Ug[t](e),E1=["input","output","output"],rr=()=>{},ra=()=>"input",Ug={generator:rr,asyncGenerator:rr,fileUrl:rr,filePath:rr,iterable:ra,asyncIterable:ra,uint8Array:ra,webStream:t=>fn(t)?"output":"input",nodeStream(t){return kt(t,{checkOpen:false})?zs(t,{checkOpen:false})?void 0:"input":"output"},webTransform:rr,duplex:rr,native(t){let e=T1(t);if(e!==void 0)return e;if(Ce(t,{checkOpen:false}))return Ug.nodeStream(t)}},T1=t=>{if([0,$__default.default.stdin].includes(t))return "input";if([1,2,$__default.default.stdout,$__default.default.stderr].includes(t))return "output"},A1="output";var zg=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t;var Gg=({stdio:t,ipc:e,buffer:r,...i},n,o)=>{let s=_1(t,i).map((a,c)=>Vg(a,c));return o?D1(s,r,n):zg(s,e)},_1=(t,e)=>{if(t===void 0)return fe.map(i=>e[i]);if(P1(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${fe.map(i=>`\`${i}\``).join(", ")}`);if(typeof t=="string")return [t,t,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,fe.length);return Array.from({length:r},(i,n)=>t[n])},P1=t=>fe.some(e=>t[e]!==void 0),Vg=(t,e)=>Array.isArray(t)?t.map(r=>Vg(r,e)):t??(e>=fe.length?"ignore":"pipe"),D1=(t,e,r)=>t.map((i,n)=>!e[n]&&n!==0&&!Wt(r,n)&&I1(i)?"ignore":i),I1=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe");var Hg=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:i,direction:n,isSync:o})=>!r||e!=="native"?t:o?M1({stdioItem:t,fdNumber:i,direction:n}):N1({stdioItem:t,fdNumber:i}),M1=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:i,direction:n})=>{let o=F1({value:e,optionName:r,fdNumber:i,direction:n});if(o!==void 0)return o;if(Ce(e,{checkOpen:false}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},F1=({value:t,optionName:e,fdNumber:r,direction:i})=>{let n=j1(t,r);if(n!==void 0){if(i==="output")return {type:"fileNumber",value:n,optionName:e};if(pC__default.default.isatty(n))throw new TypeError(`The \`${e}: ${Gi(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return {type:"uint8Array",value:He(Jr.readFileSync(n)),optionName:e}}},j1=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=Ei.indexOf(t);if(r!==-1)return r},N1=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:i})=>e==="inherit"?{type:"nodeStream",value:Wg(i,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:Wg(e,e,r),optionName:r}:Ce(e,{checkOpen:false})?{type:"nodeStream",value:e,optionName:r}:t,Wg=(t,e,r)=>{let i=Ei[t];if(i===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return i};var Yg=({input:t,inputFile:e},r)=>r===0?[...q1(t),...B1(e)]:[],q1=t=>t===void 0?[]:[{type:L1(t),value:t,optionName:"input"}],L1=t=>{if(kt(t,{checkOpen:false}))return "nodeStream";if(typeof t=="string")return "string";if(Q(t))return "uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},B1=t=>t===void 0?[]:[{...U1(t),optionName:"inputFile"}],U1=t=>{if(mn(t))return {type:"fileUrl",value:t};if(Xs(t))return {type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var Jg=t=>t.filter((e,r)=>t.every((i,n)=>e.value!==i.value||r>=n||e.type==="generator"||e.type==="asyncGenerator")),Kg=({stdioItem:{type:t,value:e,optionName:r},direction:i,fileDescriptors:n,isSync:o})=>{let s=z1(n,t);if(s.length!==0){if(o){G1({otherStdioItems:s,type:t,value:e,optionName:r,direction:i});return}if(jg.has(t))return Xg({otherStdioItems:s,type:t,value:e,optionName:r,direction:i});Ng.has(t)&&W1({otherStdioItems:s,type:t,value:e,optionName:r});}},z1=(t,e)=>t.flatMap(({direction:r,stdioItems:i})=>i.filter(n=>n.type===e).map((n=>({...n,direction:r})))),G1=({otherStdioItems:t,type:e,value:r,optionName:i,direction:n})=>{Qs.has(e)&&Xg({otherStdioItems:t,type:e,value:r,optionName:i,direction:n});},Xg=({otherStdioItems:t,type:e,value:r,optionName:i,direction:n})=>{let o=t.filter(a=>V1(a,r));if(o.length===0)return;let s=o.find(a=>a.direction!==n);return Zg(s,i,e),n==="output"?o[0].stream:void 0},V1=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,W1=({otherStdioItems:t,type:e,value:r,optionName:i})=>{let n=t.find(({value:{transform:o}})=>o===r.transform);Zg(n,i,e);},Zg=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${ht[r]} that is the same.`)};var bn=(t,e,r,i)=>{let o=Gg(e,r,i).map((a,c)=>H1({stdioOption:a,fdNumber:c,options:e,isSync:i})),s=tT({initialFileDescriptors:o,addProperties:t,options:e,isSync:i});return e.stdio=s.map(({stdioItems:a})=>nT(a)),s},H1=({stdioOption:t,fdNumber:e,options:r,isSync:i})=>{let n=Ti(e),{stdioItems:o,isStdioArray:s}=Y1({stdioOption:t,fdNumber:e,options:r,optionName:n}),a=Bg(o,e,n),c=o.map(u=>Hg({stdioItem:u,isStdioArray:s,fdNumber:e,direction:a,isSync:i})),d=Lg(c,n,a,r),l=qg(d,a);return eT(d,l),{direction:a,objectMode:l,stdioItems:d}},Y1=({stdioOption:t,fdNumber:e,options:r,optionName:i})=>{let o=[...(Array.isArray(t)?t:[t]).map(c=>J1(c,i)),...Yg(r,e)],s=Jg(o),a=s.length>1;return K1(s,a,i),Z1(s),{stdioItems:s,isStdioArray:a}},J1=(t,e)=>({type:_g(t,e),value:t,optionName:e}),K1=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:i,optionName:n}of t)if(X1.has(i))throw new Error(`The \`${n}\` option must not include \`${i}\`.`)}},X1=new Set(["ignore","ipc"]),Z1=t=>{for(let e of t)Q1(e);},Q1=({type:t,value:e,optionName:r})=>{if($g(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
165
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Rg(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},eT=(t,e)=>{if(!e)return;let r=t.find(({type:i})=>gn.has(i));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},tT=({initialFileDescriptors:t,addProperties:e,options:r,isSync:i})=>{let n=[];try{for(let o of t)n.push(rT({fileDescriptor:o,fileDescriptors:n,addProperties:e,options:r,isSync:i}));return n}catch(o){throw ia(n),o}},rT=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:i,addProperties:n,options:o,isSync:s})=>{let a=r.map(c=>iT({stdioItem:c,addProperties:n,direction:t,options:o,fileDescriptors:i,isSync:s}));return {direction:t,objectMode:e,stdioItems:a}},iT=({stdioItem:t,addProperties:e,direction:r,options:i,fileDescriptors:n,isSync:o})=>{let s=Kg({stdioItem:t,direction:r,fileDescriptors:n,isSync:o});return s!==void 0?{...t,stream:s}:{...t,...e[r][t.type](t,i)}},ia=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!xe(r)&&r.destroy();},nT=t=>{if(t.length>1)return t.some(({value:i})=>i==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"};var tb=(t,e)=>bn(sT,t,e,true),Me=({type:t,optionName:e})=>{rb(e,ht[t]);},oT=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&rb(t,`"${e}"`),{}),rb=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},eb={generator(){},asyncGenerator:Me,webStream:Me,nodeStream:Me,webTransform:Me,duplex:Me,asyncIterable:Me,native:oT},sT={input:{...eb,fileUrl:({value:t})=>({contents:[He(Jr.readFileSync(t))]}),filePath:({value:{file:t}})=>({contents:[He(Jr.readFileSync(t))]}),fileNumber:Me,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...eb,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:Me,string:Me,uint8Array:Me}};var Ke=(t,{stripFinalNewline:e},r)=>na(e,r)&&t!==void 0&&!Array.isArray(t)?Zt(t):t,na=(t,e)=>e==="all"?t[1]||t[2]:t[e];var yn=(t,e,r,i)=>t||r?void 0:nb(e,i),sa=(t,e,r)=>r?t.flatMap(i=>ib(i,e)):ib(t,e),ib=(t,e)=>{let{transform:r,final:i}=nb(e,{});return [...r(t),...i()]},nb=(t,e)=>(e.previousChunks="",{transform:aT.bind(void 0,e,t),final:lT.bind(void 0,e)}),aT=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:i}=t,n=-1;for(let o=0;o<r.length;o+=1)if(r[o]===`
166
+ `){let s=cT(r,o,e,t),a=r.slice(n+1,o+1-s);i.length>0&&(a=oa(i,a),i=""),yield a,n=o;}n!==r.length-1&&(i=oa(i,r.slice(n+1))),t.previousChunks=i;},cT=(t,e,r,i)=>r?0:(i.isWindowsNewline=e!==0&&t[e-1]==="\r",i.isWindowsNewline?2:1),lT=function*({previousChunks:t}){t.length>0&&(yield t);},ob=({binary:t,preserveNewlines:e,readableObjectMode:r,state:i})=>t||e||r?void 0:{transform:dT.bind(void 0,i)},dT=function*({isWindowsNewline:t=false},e){let{unixNewline:r,windowsNewline:i,LF:n,concatBytes:o}=typeof e=="string"?uT:pT;if(e.at(-1)===n){yield e;return}yield o(e,t?i:r);},oa=(t,e)=>`${t}${e}`,uT={windowsNewline:`\r
167
167
  `,unixNewline:`
168
168
  `,LF:`
169
- `,concatBytes:ia},oT=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},sT={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:oT};var tb=(t,e)=>t?void 0:cT.bind(void 0,e),cT=function*(t,e){if(typeof e!="string"&&!Q(e)&&!buffer.Buffer.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e;},rb=(t,e)=>t?lT.bind(void 0,e):dT.bind(void 0,e),lT=function*(t,e){ib(t,e),yield e;},dT=function*(t,e){if(ib(t,e),typeof e!="string"&&!Q(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e;},ib=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
169
+ `,concatBytes:oa},hT=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},pT={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:hT};var sb=(t,e)=>t?void 0:fT.bind(void 0,e),fT=function*(t,e){if(typeof e!="string"&&!Q(e)&&!buffer.Buffer.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e;},ab=(t,e)=>t?gT.bind(void 0,e):bT.bind(void 0,e),gT=function*(t,e){cb(t,e),yield e;},bT=function*(t,e){if(cb(t,e),typeof e!="string"&&!Q(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e;},cb=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
170
170
  Instead, \`yield\` should either be called with a value, or not be called at all. For example:
171
- if (condition) { yield value; }`)};var gn=(t,e,r)=>{if(r)return;if(t)return {transform:pT.bind(void 0,new TextEncoder)};let i=new string_decoder.StringDecoder(e);return {transform:mT.bind(void 0,i),final:fT.bind(void 0,i)}},pT=function*(t,e){buffer.Buffer.isBuffer(e)?yield We(e):typeof e=="string"?yield t.encode(e):yield e;},mT=function*(t,e){yield Q(e)?t.write(e):e;},fT=function*(t){let e=t.end();e!==""&&(yield e);};var oa=util.callbackify(async(t,e,r,i)=>{e.currentIterable=t(...r);try{for await(let n of e.currentIterable)i.push(n);}finally{delete e.currentIterable;}}),bn=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:i=bT}=e[r];for await(let n of i(t))yield*bn(n,e,r+1);},ob=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*gT(r,Number(e),t);},gT=async function*(t,e,r){if(t!==void 0)for await(let i of t())yield*bn(i,r,e+1);},sb=util.callbackify(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),bT=function*(t){yield t;};var sa=(t,e,r,i)=>{try{for(let n of t(...e))r.push(n);i();}catch(n){i(n);}},ab=(t,e)=>[...e.flatMap(r=>[...Ct(r,t,0)]),...Mr(t)],Ct=function*(t,e,r){if(r===e.length){yield t;return}let{transform:i=wT}=e[r];for(let n of i(t))yield*Ct(n,e,r+1);},Mr=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*yT(r,Number(e),t);},yT=function*(t,e,r){if(t!==void 0)for(let i of t())yield*Ct(i,r,e+1);},wT=function*(t){yield t;};var aa=({value:t,value:{transform:e,final:r,writableObjectMode:i,readableObjectMode:n},optionName:o},{encoding:s})=>{let a={},c=lb(t,s,o),d=kt(e),l=kt(r),u=d?oa.bind(void 0,bn,a):sa.bind(void 0,Ct),h=d||l?oa.bind(void 0,ob,a):sa.bind(void 0,Mr),p=d||l?sb.bind(void 0,a):void 0;return {stream:new stream.Transform({writableObjectMode:i,writableHighWaterMark:stream.getDefaultHighWaterMark(i),readableObjectMode:n,readableHighWaterMark:stream.getDefaultHighWaterMark(n),transform(b,v,y){u([b,c,0],this,y);},flush(b){h([c],this,b);},destroy:p})}},yn=(t,e,r,i)=>{let n=e.filter(({type:s})=>s==="generator"),o=i?n.reverse():n;for(let{value:s,optionName:a}of o){let c=lb(s,r,a);t=ab(c,t);}return t},lb=({transform:t,final:e,binary:r,writableObjectMode:i,readableObjectMode:n,preserveNewlines:o},s,a)=>{let c={};return [{transform:tb(i,a)},gn(r,s,i),fn(r,o,i,c),{transform:t,final:e},{transform:rb(n,a)},eb({binary:r,preserveNewlines:o,readableObjectMode:n,state:c})].filter(Boolean)};var db=(t,e)=>{for(let r of xT(t))ST(t,r,e);},xT=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),ST=(t,e,r)=>{let{stdioItems:i}=t[e],n=i.filter(({contents:a})=>a!==void 0);if(n.length===0)return;if(e!==0){let[{type:a,optionName:c}]=n;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${dt[a]} with synchronous methods.`)}let s=n.map(({contents:a})=>a).map(a=>kT(a,i));r.input=Or(s);},kT=(t,e)=>{let r=yn(t,e,"utf8",true);return CT(r),Or(r)},CT=t=>{let e=t.find(r=>typeof r!="string"&&!Q(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};var wn=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:i})=>i!=="all"&&zt(r,i)&&!pe.has(e)&&OT(i)&&(t.some(({type:n,value:o})=>n==="native"&&ET.has(o))||t.every(({type:n})=>ge.has(n))),OT=t=>t===1||t===2,ET=new Set(["pipe","overlapped"]),ub=async(t,e,r,i)=>{for await(let n of t)TT(e)||pb(n,r,i);},hb=(t,e,r)=>{for(let i of t)pb(i,e,r);},TT=t=>t._readableState.pipes.length>0,pb=(t,e,r)=>{let i=Di(t);Pe({type:"output",verboseMessage:i,fdNumber:e,verboseInfo:r});};var mb=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:i,verboseInfo:n})=>{if(e===null)return {output:Array.from({length:3})};let o={},s=new Set([]);return {output:e.map((c,d)=>DT({result:c,fileDescriptors:t,fdNumber:d,state:o,outputFiles:s,isMaxBuffer:i,verboseInfo:n},r)),...o}},DT=({result:t,fileDescriptors:e,fdNumber:r,state:i,outputFiles:n,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:d,stripFinalNewline:l,maxBuffer:u})=>{if(t===null)return;let h=fg(t,o,u),p=We(h),{stdioItems:f,objectMode:b}=e[r],v=PT([p],f,c,i),{serializedResult:y,finalResult:x=y}=IT({chunks:v,objectMode:b,encoding:c,lines:d,stripFinalNewline:l,fdNumber:r});$T({serializedResult:y,fdNumber:r,state:i,verboseInfo:s,encoding:c,stdioItems:f,objectMode:b});let k=a[r]?x:void 0;try{return i.error===void 0&&RT(y,f,n),k}catch(C){return i.error=C,k}},PT=(t,e,r,i)=>{try{return yn(t,e,r,!1)}catch(n){return i.error=n,t}},IT=({chunks:t,objectMode:e,encoding:r,lines:i,stripFinalNewline:n,fdNumber:o})=>{if(e)return {serializedResult:t};if(r==="buffer")return {serializedResult:Or(t)};let s=Ap(t,r);return i[o]?{serializedResult:s,finalResult:na(s,!n[o],e)}:{serializedResult:s}},$T=({serializedResult:t,fdNumber:e,state:r,verboseInfo:i,encoding:n,stdioItems:o,objectMode:s})=>{if(!wn({stdioItems:o,encoding:n,verboseInfo:i,fdNumber:e}))return;let a=na(t,false,s);try{hb(a,e,i);}catch(c){r.error??=c;}},RT=(t,e,r)=>{for(let{path:i,append:n}of e.filter(({type:o})=>pn.has(o))){let o=typeof i=="string"?i:i.toString();n||r.has(o)?Wr.appendFileSync(i,t):(r.add(o),Wr.writeFileSync(i,t));}};var fb=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,Je(e,r,"all")]:Array.isArray(e)?[Je(t,r,"all"),...e]:Q(t)&&Q(e)?ps([t,e]):`${t}${e}`};var gb=async(t,e)=>{let[r,i]=await MT(t);return e.isForcefullyTerminated??=false,[r,i]},MT=async t=>{let[e,r]=await Promise.allSettled([events.once(t,"spawn"),events.once(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?bb(t):r.value},bb=async t=>{try{return await events.once(t,"exit")}catch{return bb(t)}},yb=async t=>{let[e,r]=await t;if(!FT(e,r)&&la(e,r))throw new xe;return [e,r]},FT=(t,e)=>t===void 0&&e===void 0,la=(t,e)=>t!==0||e!==null;var wb=({error:t,status:e,signal:r,output:i},{maxBuffer:n})=>{let o=jT(t,e,r),s=o?.code==="ETIMEDOUT",a=mg(o,i,n);return {resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},jT=(t,e,r)=>t!==void 0?t:la(e,r)?new xe:void 0;var vb=(t,e,r)=>{let{file:i,commandArguments:n,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:d,fileDescriptors:l}=LT(t,e,r),u=UT({file:i,commandArguments:n,options:d,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:l,startTime:a});return Zt(u,c,d)},LT=(t,e,r)=>{let{command:i,escapedCommand:n,startTime:o,verboseInfo:s}=Ii(t,e,r),a=qT(r),{file:c,commandArguments:d,options:l}=Qi(t,e,a);BT(l);let u=Kg(l,s);return {file:c,commandArguments:d,command:i,escapedCommand:n,startTime:o,verboseInfo:s,options:l,fileDescriptors:u}},qT=t=>t.node&&!t.ipc?{...t,ipc:false}:t,BT=({ipc:t,ipcInput:e,detached:r,cancelSignal:i})=>{e&&vn("ipcInput"),t&&vn("ipc: true"),r&&vn("detached: true"),i&&vn("cancelSignal");},vn=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},UT=({file:t,commandArguments:e,options:r,command:i,escapedCommand:n,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=zT({file:t,commandArguments:e,options:r,command:i,escapedCommand:n,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:d,exitCode:l,signal:u,timedOut:h,isMaxBuffer:p}=wb(c,r),{output:f,error:b=d}=mb({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),v=f.map((x,k)=>Je(x,r,k)),y=Je(fb(f,r),r,"all");return VT({error:b,exitCode:l,signal:u,timedOut:h,isMaxBuffer:p,stdio:v,all:y,options:r,command:i,escapedCommand:n,startTime:a})},zT=({file:t,commandArguments:e,options:r,command:i,escapedCommand:n,fileDescriptors:o,startTime:s})=>{try{db(o,r);let a=GT(r);return Nn.spawnSync(...en(t,e,a))}catch(a){return Xt({error:a,command:i,escapedCommand:n,fileDescriptors:o,options:r,startTime:s,isSync:true})}},GT=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:ln(e)}),VT=({error:t,exitCode:e,signal:r,timedOut:i,isMaxBuffer:n,stdio:o,all:s,options:a,command:c,escapedCommand:d,startTime:l})=>t===void 0?dn({command:c,escapedCommand:d,stdio:o,all:s,ipcOutput:[],options:a,startTime:l}):Rr({error:t,command:c,escapedCommand:d,timedOut:i,isCanceled:false,isGracefullyCanceled:false,isMaxBuffer:n,isForcefullyTerminated:false,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:l,isSync:true});var xb=({anyProcess:t,channel:e,isSubprocess:r,ipc:i},{reference:n=true,filter:o}={})=>(Wt({methodName:"getOneMessage",isSubprocess:r,ipc:i,isConnected:Hi(t)}),HT({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:n})),HT=async({anyProcess:t,channel:e,isSubprocess:r,filter:i,reference:n})=>{zi(e,n);let o=lt(t,e,r),s=new AbortController;try{return await Promise.race([YT(o,i,s),JT(o,r,s),KT(o,r,s)])}catch(a){throw Ht(t),a}finally{s.abort(),Gi(e,n);}},YT=async(t,e,{signal:r})=>{if(e===void 0){let[i]=await events.once(t,"message",{signal:r});return i}for await(let[i]of events.on(t,"message",{signal:r}))if(e(i))return i},JT=async(t,e,{signal:r})=>{await events.once(t,"disconnect",{signal:r}),af(e);},KT=async(t,e,{signal:r})=>{let[i]=await events.once(t,"strict:error",{signal:r});throw qi(i,e)};var Cb=({anyProcess:t,channel:e,isSubprocess:r,ipc:i},{reference:n=true}={})=>ua({anyProcess:t,channel:e,isSubprocess:r,ipc:i,shouldAwait:!r,reference:n}),ua=({anyProcess:t,channel:e,isSubprocess:r,ipc:i,shouldAwait:n,reference:o})=>{Wt({methodName:"getEachMessage",isSubprocess:r,ipc:i,isConnected:Hi(t)}),zi(e,o);let s=lt(t,e,r),a=new AbortController,c={};return ZT(t,s,a),QT({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),eA({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:n,controller:a,state:c,reference:o})},ZT=async(t,e,r)=>{try{await events.once(e,"disconnect",{signal:r.signal}),r.abort();}catch{}},QT=async({ipcEmitter:t,isSubprocess:e,controller:r,state:i})=>{try{let[n]=await events.once(t,"strict:error",{signal:r.signal});i.error=qi(n,e),r.abort();}catch{}},eA=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:i,shouldAwait:n,controller:o,state:s,reference:a}){try{for await(let[c]of events.on(r,"message",{signal:o.signal}))Sb(s),yield c;}catch{Sb(s);}finally{o.abort(),Gi(e,a),i||Ht(t),n&&await t;}},Sb=({error:t})=>{if(t)throw t};var Eb=(t,{ipc:e})=>{Object.assign(t,Ab(t,false,e));},Tb=()=>{let t=R__default.default,e=true,r=R__default.default.channel!==void 0;return {...Ab(t,e,r),getCancelSignal:Rf.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},Ab=(t,e,r)=>({sendMessage:Xi.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:xb.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:Cb.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});var _b=({error:t,command:e,escapedCommand:r,fileDescriptors:i,options:n,startTime:o,verboseInfo:s})=>{ta(i);let a=new Nn.ChildProcess;sA(a,i),Object.assign(a,{readable:aA,writable:cA,duplex:lA});let c=Xt({error:t,command:e,escapedCommand:r,fileDescriptors:i,options:n,startTime:o,isSync:false}),d=dA(c,s,n);return {subprocess:a,promise:d}},sA=(t,e)=>{let r=Fr(),i=Fr(),n=Fr(),o=Array.from({length:e.length-3},Fr),s=Fr(),a=[r,i,n,...o];Object.assign(t,{stdin:r,stdout:i,stderr:n,all:s,stdio:a});},Fr=()=>{let t=new stream.PassThrough;return t.end(),t},aA=()=>new stream.Readable({read(){}}),cA=()=>new stream.Writable({write(){}}),lA=()=>new stream.Duplex({read(){},write(){}}),dA=async(t,e,r)=>Zt(t,e,r);var $b=(t,e)=>mn(mA,t,e,false),Nr=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${dt[t]}.`)},Ib={fileNumber:Nr,generator:aa,asyncGenerator:aa,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let i=e||r;return {stream:stream.Duplex.fromWeb(t,{objectMode:i})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},mA={input:{...Ib,fileUrl:({value:t})=>({stream:Wr.createReadStream(t)}),filePath:({value:{file:t}})=>({stream:Wr.createReadStream(t)}),webStream:({value:t})=>({stream:stream.Readable.fromWeb(t)}),iterable:({value:t})=>({stream:stream.Readable.from(t)}),asyncIterable:({value:t})=>({stream:stream.Readable.from(t)}),string:({value:t})=>({stream:stream.Readable.from(t)}),uint8Array:({value:t})=>({stream:stream.Readable.from(buffer.Buffer.from(t))})},output:{...Ib,fileUrl:({value:t})=>({stream:Wr.createWriteStream(t)}),filePath:({value:{file:t,append:e}})=>({stream:Wr.createWriteStream(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:stream.Writable.fromWeb(t)}),iterable:Nr,asyncIterable:Nr,string:Nr,uint8Array:Nr}};function Ot(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let n of t)pa(n);let e=t.some(({readableObjectMode:n})=>n),r=yA(t,e),i=new ha({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let n of t)i.add(n);return i}var yA=(t,e)=>{if(t.length===0)return stream.getDefaultHighWaterMark(e);let r=t.filter(({readableObjectMode:i})=>i===e).map(({readableHighWaterMark:i})=>i);return Math.max(...r)},ha=class extends stream.PassThrough{#t=new Set([]);#r=new Set([]);#e=new Set([]);#i;#o=Symbol("unpipe");#n=new WeakMap;add(e){if(pa(e),this.#t.has(e))return;this.#t.add(e),this.#i??=wA(this,this.#t,this.#o);let r=SA({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#i,unpipeEvent:this.#o});this.#n.set(e,r),e.pipe(this,{end:false});}async remove(e){if(pa(e),!this.#t.has(e))return false;let r=this.#n.get(e);return r===void 0?false:(this.#n.delete(e),e.unpipe(this),await r,true)}},wA=async(t,e,r)=>{xn(t,Mb);let i=new AbortController;try{await Promise.race([vA(t,i),xA(t,e,r,i)]);}finally{i.abort(),xn(t,-Mb);}},vA=async(t,{signal:e})=>{try{await promises.finished(t,{signal:e,cleanup:!0});}catch(r){throw Nb(t,r),r}},xA=async(t,e,r,{signal:i})=>{for await(let[n]of events.on(t,"unpipe",{signal:i}))e.has(n)&&n.emit(r);},pa=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},SA=async({passThroughStream:t,stream:e,streams:r,ended:i,aborted:n,onFinished:o,unpipeEvent:s})=>{xn(t,Fb);let a=new AbortController;try{await Promise.race([kA(o,e,a),CA({passThroughStream:t,stream:e,streams:r,ended:i,aborted:n,controller:a}),OA({stream:e,streams:r,ended:i,aborted:n,unpipeEvent:s,controller:a})]);}finally{a.abort(),xn(t,-Fb);}r.size>0&&r.size===i.size+n.size&&(i.size===0&&n.size>0?ma(t):EA(t));},kA=async(t,e,{signal:r})=>{try{await t,r.aborted||ma(e);}catch(i){r.aborted||Nb(e,i);}},CA=async({passThroughStream:t,stream:e,streams:r,ended:i,aborted:n,controller:{signal:o}})=>{try{await promises.finished(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&i.add(e);}catch(s){if(o.aborted||!r.has(e))return;Lb(s)?n.add(e):qb(t,s);}},OA=async({stream:t,streams:e,ended:r,aborted:i,unpipeEvent:n,controller:{signal:o}})=>{if(await events.once(t,n,{signal:o}),!t.readable)return events.once(o,"abort",{signal:o});e.delete(t),r.delete(t),i.delete(t);},EA=t=>{t.writable&&t.end();},Nb=(t,e)=>{Lb(e)?ma(t):qb(t,e);},Lb=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",ma=t=>{(t.readable||t.writable)&&t.destroy();},qb=(t,e)=>{t.destroyed||(t.once("error",TA),t.destroy(e));},TA=()=>{},xn=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e);},Mb=2,Fb=1;var er=(t,e)=>{t.pipe(e),AA(t,e),_A(t,e);},AA=async(t,e)=>{if(!(ve(t)||ve(e))){try{await promises.finished(t,{cleanup:!0,readable:!0,writable:!1});}catch{}fa(e);}},fa=t=>{t.writable&&t.end();},_A=async(t,e)=>{if(!(ve(t)||ve(e))){try{await promises.finished(e,{cleanup:!0,readable:!1,writable:!0});}catch{}ga(t);}},ga=t=>{t.readable&&t.destroy();};var Ub=(t,e,r)=>{let i=new Map;for(let[n,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>ge.has(c)))DA(t,a,s,n);for(let{stream:a}of o.filter(({type:c})=>!ge.has(c)))IA({subprocess:t,stream:a,direction:s,fdNumber:n,pipeGroups:i,controller:r});}for(let[n,o]of i.entries()){let s=o.length===1?o[0]:Ot(o);er(s,n);}},DA=(t,e,r,i)=>{r==="output"?er(t.stdio[i],e):er(e,t.stdio[i]);let n=PA[i];n!==void 0&&(t[n]=e),t.stdio[i]=e;},PA=["stdin","stdout","stderr"],IA=({subprocess:t,stream:e,direction:r,fdNumber:i,pipeGroups:n,controller:o})=>{if(e===void 0)return;$A(e,o);let[s,a]=r==="output"?[e,t.stdio[i]]:[t.stdio[i],e],c=n.get(s)??[];n.set(s,[...c,a]);},$A=(t,{signal:e})=>{ve(t)&&xt(t,RA,e);},RA=2;var Et=[];Et.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Et.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Et.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Sn=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",ba=Symbol.for("signal-exit emitter"),ya=globalThis,MA=Object.defineProperty.bind(Object),wa=class{emitted={afterExit:false,exit:false};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(ya[ba])return ya[ba];MA(ya,ba,{value:this,writable:false,enumerable:false,configurable:false});}on(e,r){this.listeners[e].push(r);}removeListener(e,r){let i=this.listeners[e],n=i.indexOf(r);n!==-1&&(n===0&&i.length===1?i.length=0:i.splice(n,1));}emit(e,r,i){if(this.emitted[e])return false;this.emitted[e]=true;let n=false;for(let o of this.listeners[e])n=o(r,i)===true||n;return e==="exit"&&(n=this.emit("afterExit",r,i)||n),n}},kn=class{},FA=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),va=class extends kn{onExit(){return ()=>{}}load(){}unload(){}},xa=class extends kn{#t=Sa.platform==="win32"?"SIGINT":"SIGHUP";#r=new wa;#e;#i;#o;#n={};#s=false;constructor(e){super(),this.#e=e,this.#n={};for(let r of Et)this.#n[r]=()=>{let i=this.#e.listeners(r),{count:n}=this.#r,o=e;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.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a);}};this.#o=e.reallyExit,this.#i=e.emit;}onExit(e,r){if(!Sn(this.#e))return ()=>{};this.#s===false&&this.load();let i=r?.alwaysLast?"afterExit":"exit";return this.#r.on(i,e),()=>{this.#r.removeListener(i,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload();}}load(){if(!this.#s){this.#s=true,this.#r.count+=1;for(let e of Et)try{let r=this.#n[e];r&&this.#e.on(e,r);}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e);}}unload(){this.#s&&(this.#s=false,Et.forEach(e=>{let r=this.#n[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r);}catch{}}),this.#e.emit=this.#i,this.#e.reallyExit=this.#o,this.#r.count-=1);}#a(e){return Sn(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let i=this.#i;if(e==="exit"&&Sn(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let n=i.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),n}else return i.call(this.#e,e,...r)}},Sa=globalThis.process,{onExit:zb}=FA(Sn(Sa)?new xa(Sa):new va);var Gb=(t,{cleanup:e,detached:r},{signal:i})=>{if(!e||r)return;let n=zb(()=>{t.kill();});events.addAbortListener(i,()=>{n();});};var Wb=({source:t,sourcePromise:e,boundOptions:r,createNested:i},...n)=>{let o=Pi(),{destination:s,destinationStream:a,destinationError:c,from:d,unpipeSignal:l}=NA(r,i,n),{sourceStream:u,sourceError:h}=qA(t,d),{options:p,fileDescriptors:f}=$e.get(t);return {sourcePromise:e,sourceStream:u,sourceOptions:p,sourceError:h,destination:s,destinationStream:a,destinationError:c,unpipeSignal:l,fileDescriptors:f,startTime:o}},NA=(t,e,r)=>{try{let{destination:i,pipeOptions:{from:n,to:o,unpipeSignal:s}={}}=LA(t,e,...r),a=Ui(i,o);return {destination:i,destinationStream:a,from:n,unpipeSignal:s}}catch(i){return {destinationError:i}}},LA=(t,e,r,...i)=>{if(Array.isArray(r))return {destination:e(Vb,t)(r,...i),pipeOptions:t};if(typeof r=="string"||r instanceof URL||us(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[n,o,s]=xi(r,...i);return {destination:e(Vb)(n,o,s),pipeOptions:s}}if($e.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return {destination:r,pipeOptions:i[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Vb=({options:t})=>({options:{...t,stdin:"pipe",piped:true}}),qA=(t,e)=>{try{return {sourceStream:Yt(t,e)}}catch(r){return {sourceError:r}}};var Yb=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:i,fileDescriptors:n,sourceOptions:o,startTime:s})=>{let a=BA({sourceStream:t,sourceError:e,destinationStream:r,destinationError:i});if(a!==void 0)throw ka({error:a,fileDescriptors:n,sourceOptions:o,startTime:s})},BA=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:i})=>{if(e!==void 0&&i!==void 0)return i;if(i!==void 0)return ga(t),i;if(e!==void 0)return fa(r),e},ka=({error:t,fileDescriptors:e,sourceOptions:r,startTime:i})=>Xt({error:t,command:Hb,escapedCommand:Hb,fileDescriptors:e,options:r,startTime:i,isSync:false}),Hb="source.pipe(destination)";var Jb=async t=>{let[{status:e,reason:r,value:i=r},{status:n,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(i)||s.pipedFrom.push(i),n==="rejected")throw s;if(e==="rejected")throw i;return s};var Kb=(t,e,r)=>{let i=Cn.has(e)?GA(t,e):zA(t,e);return xt(t,WA,r.signal),xt(e,HA,r.signal),VA(e),i},zA=(t,e)=>{let r=Ot([t]);return er(r,e),Cn.set(e,r),r},GA=(t,e)=>{let r=Cn.get(e);return r.add(t),r},VA=async t=>{try{await promises.finished(t,{cleanup:!0,readable:!1,writable:!0});}catch{}Cn.delete(t);},Cn=new WeakMap,WA=2,HA=1;var Xb=(t,e)=>t===void 0?[]:[JA(t,e)],JA=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:i,sourceOptions:n,startTime:o})=>{await util.aborted(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw ka({error:s,fileDescriptors:i,sourceOptions:n,startTime:o})};var On=(t,...e)=>{if(X(e[0]))return On.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...i}=Wb(t,...e),n=KA({...i,destination:r});return n.pipe=On.bind(void 0,{...t,source:r,sourcePromise:n,boundOptions:{}}),n},KA=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:i,destination:n,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:d})=>{let l=XA(t,n);Yb({sourceStream:e,sourceError:i,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:d});let u=new AbortController;try{let h=Kb(e,o,u);return await Promise.race([Jb(l),...Xb(a,{sourceStream:e,mergedStream:h,sourceOptions:r,fileDescriptors:c,startTime:d})])}finally{u.abort();}},XA=(t,e)=>Promise.allSettled([t,e]);var En=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:i,encoding:n,preserveNewlines:o})=>{let s=new AbortController;return e_(e,s),Qb({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&i,encoding:n,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},e_=async(t,e)=>{try{await t;}catch{}finally{e.abort();}},Ca=({stream:t,onStreamEnd:e,lines:r,encoding:i,stripFinalNewline:n,allMixed:o})=>{let s=new AbortController;t_(e,s,t);let a=t.readableObjectMode&&!o;return Qb({stream:t,controller:s,binary:i==="buffer",shouldEncode:!a,encoding:i,shouldSplit:!a&&r,preserveNewlines:!n})},t_=async(t,e,r)=>{try{await t;}catch{r.destroy();}finally{e.abort();}},Qb=({stream:t,controller:e,binary:r,shouldEncode:i,encoding:n,shouldSplit:o,preserveNewlines:s})=>{let a=events.on(t,"data",{signal:e.signal,highWaterMark:Zb,highWatermark:Zb});return r_({onStdoutChunk:a,controller:e,binary:r,shouldEncode:i,encoding:n,shouldSplit:o,preserveNewlines:s})},Oa=stream.getDefaultHighWaterMark(true),Zb=Oa,r_=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:i,encoding:n,shouldSplit:o,preserveNewlines:s}){let a=i_({binary:r,shouldEncode:i,encoding:n,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*Ct(c,a,0);}catch(c){if(!e.signal.aborted)throw c}finally{yield*Mr(a);}},i_=({binary:t,shouldEncode:e,encoding:r,shouldSplit:i,preserveNewlines:n})=>[gn(t,r,!e),fn(t,n,!i,{})].filter(Boolean);var ey=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:i,buffer:n,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:d,streamInfo:l})=>{let u=o_({stream:t,onStreamEnd:e,fdNumber:r,encoding:i,allMixed:a,verboseInfo:d,streamInfo:l});if(!n){await Promise.all([s_(t),u]);return}let h=ra(c,r),p=Ca({stream:t,onStreamEnd:e,lines:s,encoding:i,stripFinalNewline:h,allMixed:a}),[f]=await Promise.all([a_({stream:t,iterable:p,fdNumber:r,encoding:i,maxBuffer:o,lines:s}),u]);return f},o_=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:i,allMixed:n,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!wn({stdioItems:s[r]?.stdioItems,encoding:i,verboseInfo:o,fdNumber:r}))return;let a=Ca({stream:t,onStreamEnd:e,lines:true,encoding:i,stripFinalNewline:true,allMixed:n});await ub(a,t,r,o);},s_=async t=>{await promises$1.setImmediate(),t.readableFlowing===null&&t.resume();},a_=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:i,encoding:n,maxBuffer:o,lines:s})=>{try{return e||s?await on(r,{maxBuffer:o}):n==="buffer"?new Uint8Array(await sn(r,{maxBuffer:o})):await cn(r,{maxBuffer:o})}catch(a){return ty(ug({error:a,stream:t,readableObjectMode:e,lines:s,encoding:n,fdNumber:i}))}},Ea=async t=>{try{return await t}catch(e){return ty(e)}},ty=({bufferedData:t})=>Ep(t)?new Uint8Array(t):t;var Lr=async(t,e,r,{isSameDirection:i,stopOnExit:n=false}={})=>{let o=l_(t,r),s=new AbortController;try{await Promise.race([...n?[r.exitPromise]:[],promises.finished(t,{cleanup:!0,signal:s.signal})]);}catch(a){o.stdinCleanedUp||h_(a,e,r,i);}finally{s.abort();}},l_=(t,{originalStreams:[e],subprocess:r})=>{let i={stdinCleanedUp:false};return t===e&&d_(t,r,i),i},d_=(t,e,r)=>{let{_destroy:i}=t;t._destroy=(...n)=>{u_(e,r),i.call(t,...n);};},u_=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=true);},h_=(t,e,r,i)=>{if(!p_(t,e,r,i))throw t},p_=(t,e,r,i=true)=>r.propagating?ry(t)||Tn(t):(r.propagating=true,Ta(r,e)===i?ry(t):Tn(t)),Ta=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",Tn=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",ry=t=>t?.code==="EPIPE";var iy=({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,d)=>Aa({stream:c,fdNumber:d,encoding:e,buffer:r[d],maxBuffer:i[d],lines:n[d],allMixed:false,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),Aa=async({stream:t,fdNumber:e,encoding:r,buffer:i,maxBuffer:n,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:d})=>{if(!t)return;let l=Lr(t,e,d);if(Ta(d,e)){await l;return}let[u]=await Promise.all([ey({stream:t,onStreamEnd:l,fdNumber:e,encoding:r,buffer:i,maxBuffer:n,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:d}),l]);return u};var ny=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Ot([t,e].filter(Boolean)):void 0,oy=({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>Aa({...m_(t,r),fdNumber:"all",encoding:e,maxBuffer:i[1]+i[2],lines:n[1]||n[2],allMixed:f_(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),m_=({stdout:t,stderr:e,all:r},[,i,n])=>{let o=i||n;return o?i?n?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},f_=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;var sy=t=>zt(t,"ipc"),ay=(t,e)=>{let r=Di(t);Pe({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e});};var cy=async({subprocess:t,buffer:e,maxBuffer:r,ipc:i,ipcOutput:n,verboseInfo:o})=>{if(!i)return n;let s=sy(o),a=He(e,"ipc"),c=He(r,"ipc");for await(let d of ua({anyProcess:t,channel:t.channel,isSubprocess:false,ipc:i,shouldAwait:false,reference:true}))a&&(hg(t,n,c),n.push(d)),s&&ay(d,o);return n},ly=async(t,e)=>(await Promise.allSettled([t]),e);var dy=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:i,lines:n,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:d,ipc:l,ipcInput:u},context:h,verboseInfo:p,fileDescriptors:f,originalStreams:b,onInternalError:v,controller:y})=>{let x=gb(t,h),k={originalStreams:b,fileDescriptors:f,subprocess:t,exitPromise:x,propagating:false},C=iy({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:d,verboseInfo:p,streamInfo:k}),D=oy({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:d,verboseInfo:p,streamInfo:k}),_=[],z=cy({subprocess:t,buffer:r,maxBuffer:i,ipc:l,ipcOutput:_,verboseInfo:p}),K=b_(b,t,k),w=y_(f,k);try{return await Promise.race([Promise.all([{},yb(x),Promise.all(C),D,z,Gf(t,u),...K,...w]),v,w_(t,y),...Lf(t,o,h,y),...sf({subprocess:t,cancelSignal:s,gracefulCancel:a,context:h,controller:y}),...jf({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:h,controller:y})])}catch(E){return h.terminationReason??="other",Promise.all([{error:E},x,Promise.all(C.map(O=>Ea(O))),Ea(D),ly(z,_),Promise.allSettled(K),Promise.allSettled(w)])}},b_=(t,e,r)=>t.map((i,n)=>i===e.stdio[n]?void 0:Lr(i,n,r)),y_=(t,e)=>t.flatMap(({stdioItems:r},i)=>r.filter(({value:n,stream:o=n})=>ke(o,{checkOpen:false})&&!ve(o)).map(({type:n,value:o,stream:s=o})=>Lr(s,i,e,{isSameDirection:ge.has(n),stopOnExit:n==="native"}))),w_=async(t,{signal:e})=>{let[r]=await events.once(t,"error",{signal:e});throw r};var uy=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),qr=(t,e,r)=>{let i=t[r];i.has(e)||i.set(e,[]);let n=i.get(e),o=Ie();return n.push(o),{resolve:o.resolve.bind(o),promises:n}},tr=async({resolve:t,promises:e},r)=>{t();let[i]=await Promise.race([Promise.allSettled([true,r]),Promise.all([false,...e])]);return !i};var _a=async t=>{if(t!==void 0)try{await Da(t);}catch{}},py=async t=>{if(t!==void 0)try{await Pa(t);}catch{}},Da=async t=>{await promises.finished(t,{cleanup:true,readable:false,writable:true});},Pa=async t=>{await promises.finished(t,{cleanup:true,readable:true,writable:false});},An=async(t,e)=>{if(await t,e)throw e},_n=(t,e,r)=>{r&&!Tn(r)?t.destroy(r):e&&t.destroy();};var my=({subprocess:t,concurrentStreams:e,encoding:r},{from:i,binary:n=true,preserveNewlines:o=true}={})=>{let s=n||pe.has(r),{subprocessStdout:a,waitReadableDestroy:c}=Ia(t,i,e),{readableEncoding:d,readableObjectMode:l,readableHighWaterMark:u}=$a(a,s),{read:h,onStdoutDataDone:p}=Ra({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),f=new stream.Readable({read:h,destroy:util.callbackify(Fa.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:u,objectMode:l,encoding:d});return Ma({subprocessStdout:a,onStdoutDataDone:p,readable:f,subprocess:t}),f},Ia=(t,e,r)=>{let i=Yt(t,e),n=qr(r,i,"readableDestroy");return {subprocessStdout:i,waitReadableDestroy:n}},$a=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},i)=>i?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:true,readableHighWaterMark:Oa},Ra=({subprocessStdout:t,subprocess:e,binary:r,encoding:i,preserveNewlines:n})=>{let o=Ie(),s=En({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:i,preserveNewlines:n});return {read(){S_(this,s,o);},onStdoutDataDone:o}},S_=async(t,e,r)=>{try{let{value:i,done:n}=await e.next();n?r.resolve():t.push(i);}catch{}},Ma=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:i,subprocessStdin:n})=>{try{await Pa(t),await i,await _a(n),await e,r.readable&&r.push(null);}catch(o){await _a(n),fy(r,o);}},Fa=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},i)=>{await tr(r,e)&&(fy(t,i),await An(e,i));},fy=(t,e)=>{_n(t,t.readable,e);};var by=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:i,waitWritableFinal:n,waitWritableDestroy:o}=ja(t,r,e),s=new stream.Writable({...Na(i,t,n),destroy:util.callbackify(qa.bind(void 0,{subprocessStdin:i,subprocess:t,waitWritableFinal:n,waitWritableDestroy:o})),highWaterMark:i.writableHighWaterMark,objectMode:i.writableObjectMode});return La(i,s),s},ja=(t,e,r)=>{let i=Ui(t,e),n=qr(r,i,"writableFinal"),o=qr(r,i,"writableDestroy");return {subprocessStdin:i,waitWritableFinal:n,waitWritableDestroy:o}},Na=(t,e,r)=>({write:C_.bind(void 0,t),final:util.callbackify(O_.bind(void 0,t,e,r))}),C_=(t,e,r,i)=>{t.write(e,r)?i():t.once("drain",i);},O_=async(t,e,r)=>{await tr(r,e)&&(t.writable&&t.end(),await e);},La=async(t,e,r)=>{try{await Da(t),e.writable&&e.end();}catch(i){await py(r),yy(e,i);}},qa=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:i},n)=>{await tr(r,e),await tr(i,e)&&(yy(t,n),await An(e,n));},yy=(t,e)=>{_n(t,t.writable,e);};var wy=({subprocess:t,concurrentStreams:e,encoding:r},{from:i,to:n,binary:o=true,preserveNewlines:s=true}={})=>{let a=o||pe.has(r),{subprocessStdout:c,waitReadableDestroy:d}=Ia(t,i,e),{subprocessStdin:l,waitWritableFinal:u,waitWritableDestroy:h}=ja(t,n,e),{readableEncoding:p,readableObjectMode:f,readableHighWaterMark:b}=$a(c,a),{read:v,onStdoutDataDone:y}=Ra({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),x=new stream.Duplex({read:v,...Na(l,t,u),destroy:util.callbackify(A_.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:t,waitReadableDestroy:d,waitWritableFinal:u,waitWritableDestroy:h})),readableHighWaterMark:b,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:f,writableObjectMode:l.writableObjectMode,encoding:p});return Ma({subprocessStdout:c,onStdoutDataDone:y,readable:x,subprocess:t,subprocessStdin:l}),La(l,x,c),x},A_=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:i,waitWritableFinal:n,waitWritableDestroy:o},s)=>{await Promise.all([Fa({subprocessStdout:t,subprocess:r,waitReadableDestroy:i},s),qa({subprocessStdin:e,subprocess:r,waitWritableFinal:n,waitWritableDestroy:o},s)]);};var Ba=(t,e,{from:r,binary:i=false,preserveNewlines:n=false}={})=>{let o=i||pe.has(e),s=Yt(t,r),a=En({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:true,encoding:e,preserveNewlines:n});return __(a,s,t)},__=async function*(t,e,r){try{yield*t;}finally{e.readable&&e.destroy(),await r;}};var vy=(t,{encoding:e})=>{let r=uy();t.readable=my.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=by.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=wy.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=Ba.bind(void 0,t,e),t[Symbol.asyncIterator]=Ba.bind(void 0,t,e,{});};var xy=(t,e)=>{for(let[r,i]of P_){let n=i.value.bind(e);Reflect.defineProperty(t,r,{...i,value:n});}},D_=(async()=>{})().constructor.prototype,P_=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(D_,t)]);var Sy=(t,e,r,i)=>{let{file:n,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:d,options:l,fileDescriptors:u}=R_(t,e,r),{subprocess:h,promise:p}=F_({file:n,commandArguments:o,options:l,startTime:c,verboseInfo:d,command:s,escapedCommand:a,fileDescriptors:u});return h.pipe=On.bind(void 0,{source:h,sourcePromise:p,boundOptions:{},createNested:i}),xy(h,p),$e.set(h,{options:l,fileDescriptors:u}),h},R_=(t,e,r)=>{let{command:i,escapedCommand:n,startTime:o,verboseInfo:s}=Ii(t,e,r),{file:a,commandArguments:c,options:d}=Qi(t,e,r),l=M_(d),u=$b(l,s);return {file:a,commandArguments:c,command:i,escapedCommand:n,startTime:o,verboseInfo:s,options:l,fileDescriptors:u}},M_=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return {...r,timeoutDuration:t}},F_=({file:t,commandArguments:e,options:r,startTime:i,verboseInfo:n,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=Nn.spawn(...en(t,e,r));}catch(f){return _b({error:f,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:i,verboseInfo:n})}let d=new AbortController;events.setMaxListeners(Number.POSITIVE_INFINITY,d.signal);let l=[...c.stdio];Ub(c,a,d),Gb(c,r,d);let u={},h=Ie();c.kill=nf.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:h,context:u,controller:d}),c.all=ny(c,r),vy(c,r),Eb(c,r);let p=j_({subprocess:c,options:r,startTime:i,verboseInfo:n,fileDescriptors:a,originalStreams:l,command:o,escapedCommand:s,context:u,onInternalError:h,controller:d});return {subprocess:c,promise:p}},j_=async({subprocess:t,options:e,startTime:r,verboseInfo:i,fileDescriptors:n,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:d,controller:l})=>{let[u,[h,p],f,b,v]=await dy({subprocess:t,options:e,context:c,verboseInfo:i,fileDescriptors:n,originalStreams:o,onInternalError:d,controller:l});l.abort(),d.resolve();let y=f.map((C,D)=>Je(C,e,D)),x=Je(b,e,"all"),k=N_({errorInfo:u,exitCode:h,signal:p,stdio:y,all:x,ipcOutput:v,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Zt(k,i,e)},N_=({errorInfo:t,exitCode:e,signal:r,stdio:i,all:n,ipcOutput:o,context:s,options:a,command:c,escapedCommand:d,startTime:l})=>"error"in t?Rr({error:t.error,command:c,escapedCommand:d,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Re,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:i,all:n,ipcOutput:o,options:a,startTime:l,isSync:false}):dn({command:c,escapedCommand:d,stdio:i,all:n,ipcOutput:o,options:a,startTime:l});var Dn=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([i,n])=>[i,L_(i,t[i],n)]));return {...t,...r}},L_=(t,e,r)=>q_.has(t)&&X(e)&&X(r)?{...e,...r}:r,q_=new Set(["env",...bs]);var ut=(t,e,r,i)=>{let n=(s,a,c)=>ut(s,a,r,c),o=(...s)=>B_({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:i,createNested:n},...s);return i!==void 0&&i(o,n,e),o},B_=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:i,createNested:n},o,...s)=>{if(X(o))return n(t,Dn(r,o),i);let{file:a,commandArguments:c,options:d,isSync:l}=U_({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return l?vb(a,c,d):Sy(a,c,d,n)},U_=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:i,boundOptions:n})=>{let o=Ip(e)?$p(e,r):[e,...r],[s,a,c]=xi(...o),d=Dn(Dn(i,n),c),{file:l=s,commandArguments:u=a,options:h=d,isSync:p=false}=t({file:s,commandArguments:a,options:d});return {file:l,commandArguments:u,options:h,isSync:p}};var ky=({file:t,commandArguments:e})=>Oy(t,e),Cy=({file:t,commandArguments:e})=>({...Oy(t,e),isSync:true}),Oy=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...i]=z_(t);return {file:r,commandArguments:i}},z_=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return [];let r=[];for(let i of e.split(G_)){let n=r.at(-1);n&&n.endsWith("\\")?r[r.length-1]=`${n.slice(0,-1)} ${i}`:r.push(i);}return r},G_=/ +/g;var Ey=(t,e,r)=>{t.sync=e(V_,r),t.s=t.sync;},Ty=({options:t})=>Ay(t),V_=({options:t})=>({...Ay(t),isSync:true}),Ay=t=>({options:{...W_(t),...t}}),W_=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},_y={preferLocal:true};var Dy=ut(()=>({}));ut(()=>({isSync:true}));ut(ky);ut(Cy);ut(Bf);ut(Ty,{},_y,Ey);Tb();async function Br({cwd:t,packageManager:e,packages:r,dev:i=false}){if(!r.length)return;let n={npm:"npm",pnpm:"pnpm",yarn:"yarn",bun:"bun"},o={npm:["install",...i?["-D"]:[],...r],pnpm:["add",...i?["-D"]:[],...r],yarn:["add",...i?["-D"]:[],...r],bun:["add",...i?["-d"]:[],...r]};await Dy(n[e],o[e],{cwd:t,stdio:"inherit"});}var zr=Ce(it());var Ua="/* tembro:start */",Pn="/* tembro:end */";function Py(t){return `${Ua}
171
+ if (condition) { yield value; }`)};var wn=(t,e,r)=>{if(r)return;if(t)return {transform:vT.bind(void 0,new TextEncoder)};let i=new string_decoder.StringDecoder(e);return {transform:xT.bind(void 0,i),final:ST.bind(void 0,i)}},vT=function*(t,e){buffer.Buffer.isBuffer(e)?yield He(e):typeof e=="string"?yield t.encode(e):yield e;},xT=function*(t,e){yield Q(e)?t.write(e):e;},ST=function*(t){let e=t.end();e!==""&&(yield e);};var aa=util.callbackify(async(t,e,r,i)=>{e.currentIterable=t(...r);try{for await(let n of e.currentIterable)i.push(n);}finally{delete e.currentIterable;}}),vn=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:i=CT}=e[r];for await(let n of i(t))yield*vn(n,e,r+1);},db=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*kT(r,Number(e),t);},kT=async function*(t,e,r){if(t!==void 0)for await(let i of t())yield*vn(i,r,e+1);},ub=util.callbackify(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),CT=function*(t){yield t;};var ca=(t,e,r,i)=>{try{for(let n of t(...e))r.push(n);i();}catch(n){i(n);}},hb=(t,e)=>[...e.flatMap(r=>[...Ot(r,t,0)]),...Nr(t)],Ot=function*(t,e,r){if(r===e.length){yield t;return}let{transform:i=ET}=e[r];for(let n of i(t))yield*Ot(n,e,r+1);},Nr=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*OT(r,Number(e),t);},OT=function*(t,e,r){if(t!==void 0)for(let i of t())yield*Ot(i,r,e+1);},ET=function*(t){yield t;};var la=({value:t,value:{transform:e,final:r,writableObjectMode:i,readableObjectMode:n},optionName:o},{encoding:s})=>{let a={},c=mb(t,s,o),d=Ct(e),l=Ct(r),u=d?aa.bind(void 0,vn,a):ca.bind(void 0,Ot),h=d||l?aa.bind(void 0,db,a):ca.bind(void 0,Nr),p=d||l?ub.bind(void 0,a):void 0;return {stream:new stream.Transform({writableObjectMode:i,writableHighWaterMark:stream.getDefaultHighWaterMark(i),readableObjectMode:n,readableHighWaterMark:stream.getDefaultHighWaterMark(n),transform(b,y,w){u([b,c,0],this,w);},flush(b){h([c],this,b);},destroy:p})}},xn=(t,e,r,i)=>{let n=e.filter(({type:s})=>s==="generator"),o=i?n.reverse():n;for(let{value:s,optionName:a}of o){let c=mb(s,r,a);t=hb(c,t);}return t},mb=({transform:t,final:e,binary:r,writableObjectMode:i,readableObjectMode:n,preserveNewlines:o},s,a)=>{let c={};return [{transform:sb(i,a)},wn(r,s,i),yn(r,o,i,c),{transform:t,final:e},{transform:ab(n,a)},ob({binary:r,preserveNewlines:o,readableObjectMode:n,state:c})].filter(Boolean)};var fb=(t,e)=>{for(let r of AT(t))_T(t,r,e);},AT=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),_T=(t,e,r)=>{let{stdioItems:i}=t[e],n=i.filter(({contents:a})=>a!==void 0);if(n.length===0)return;if(e!==0){let[{type:a,optionName:c}]=n;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${ht[a]} with synchronous methods.`)}let s=n.map(({contents:a})=>a).map(a=>PT(a,i));r.input=Ar(s);},PT=(t,e)=>{let r=xn(t,e,"utf8",true);return DT(r),Ar(r)},DT=t=>{let e=t.find(r=>typeof r!="string"&&!Q(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};var Sn=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:i})=>i!=="all"&&Wt(r,i)&&!pe.has(e)&&IT(i)&&(t.some(({type:n,value:o})=>n==="native"&&$T.has(o))||t.every(({type:n})=>ge.has(n))),IT=t=>t===1||t===2,$T=new Set(["pipe","overlapped"]),gb=async(t,e,r,i)=>{for await(let n of t)RT(e)||yb(n,r,i);},bb=(t,e,r)=>{for(let i of t)yb(i,e,r);},RT=t=>t._readableState.pipes.length>0,yb=(t,e,r)=>{let i=$i(t);De({type:"output",verboseMessage:i,fdNumber:e,verboseInfo:r});};var wb=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:i,verboseInfo:n})=>{if(e===null)return {output:Array.from({length:3})};let o={},s=new Set([]);return {output:e.map((c,d)=>jT({result:c,fileDescriptors:t,fdNumber:d,state:o,outputFiles:s,isMaxBuffer:i,verboseInfo:n},r)),...o}},jT=({result:t,fileDescriptors:e,fdNumber:r,state:i,outputFiles:n,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:d,stripFinalNewline:l,maxBuffer:u})=>{if(t===null)return;let h=vg(t,o,u),p=He(h),{stdioItems:m,objectMode:b}=e[r],y=NT([p],m,c,i),{serializedResult:w,finalResult:S=w}=qT({chunks:y,objectMode:b,encoding:c,lines:d,stripFinalNewline:l,fdNumber:r});LT({serializedResult:w,fdNumber:r,state:i,verboseInfo:s,encoding:c,stdioItems:m,objectMode:b});let C=a[r]?S:void 0;try{return i.error===void 0&&BT(w,m,n),C}catch(M){return i.error=M,C}},NT=(t,e,r,i)=>{try{return xn(t,e,r,!1)}catch(n){return i.error=n,t}},qT=({chunks:t,objectMode:e,encoding:r,lines:i,stripFinalNewline:n,fdNumber:o})=>{if(e)return {serializedResult:t};if(r==="buffer")return {serializedResult:Ar(t)};let s=$p(t,r);return i[o]?{serializedResult:s,finalResult:sa(s,!n[o],e)}:{serializedResult:s}},LT=({serializedResult:t,fdNumber:e,state:r,verboseInfo:i,encoding:n,stdioItems:o,objectMode:s})=>{if(!Sn({stdioItems:o,encoding:n,verboseInfo:i,fdNumber:e}))return;let a=sa(t,false,s);try{bb(a,e,i);}catch(c){r.error??=c;}},BT=(t,e,r)=>{for(let{path:i,append:n}of e.filter(({type:o})=>gn.has(o))){let o=typeof i=="string"?i:i.toString();n||r.has(o)?Jr.appendFileSync(i,t):(r.add(o),Jr.writeFileSync(i,t));}};var vb=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,Ke(e,r,"all")]:Array.isArray(e)?[Ke(t,r,"all"),...e]:Q(t)&&Q(e)?fs([t,e]):`${t}${e}`};var xb=async(t,e)=>{let[r,i]=await UT(t);return e.isForcefullyTerminated??=false,[r,i]},UT=async t=>{let[e,r]=await Promise.allSettled([events.once(t,"spawn"),events.once(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?Sb(t):r.value},Sb=async t=>{try{return await events.once(t,"exit")}catch{return Sb(t)}},kb=async t=>{let[e,r]=await t;if(!zT(e,r)&&ua(e,r))throw new Se;return [e,r]},zT=(t,e)=>t===void 0&&e===void 0,ua=(t,e)=>t!==0||e!==null;var Cb=({error:t,status:e,signal:r,output:i},{maxBuffer:n})=>{let o=GT(t,e,r),s=o?.code==="ETIMEDOUT",a=wg(o,i,n);return {resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},GT=(t,e,r)=>t!==void 0?t:ua(e,r)?new Se:void 0;var Ob=(t,e,r)=>{let{file:i,commandArguments:n,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:d,fileDescriptors:l}=WT(t,e,r),u=JT({file:i,commandArguments:n,options:d,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:l,startTime:a});return tr(u,c,d)},WT=(t,e,r)=>{let{command:i,escapedCommand:n,startTime:o,verboseInfo:s}=Mi(t,e,r),a=HT(r),{file:c,commandArguments:d,options:l}=rn(t,e,a);YT(l);let u=tb(l,s);return {file:c,commandArguments:d,command:i,escapedCommand:n,startTime:o,verboseInfo:s,options:l,fileDescriptors:u}},HT=t=>t.node&&!t.ipc?{...t,ipc:false}:t,YT=({ipc:t,ipcInput:e,detached:r,cancelSignal:i})=>{e&&kn("ipcInput"),t&&kn("ipc: true"),r&&kn("detached: true"),i&&kn("cancelSignal");},kn=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},JT=({file:t,commandArguments:e,options:r,command:i,escapedCommand:n,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=KT({file:t,commandArguments:e,options:r,command:i,escapedCommand:n,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:d,exitCode:l,signal:u,timedOut:h,isMaxBuffer:p}=Cb(c,r),{output:m,error:b=d}=wb({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),y=m.map((S,C)=>Ke(S,r,C)),w=Ke(vb(m,r),r,"all");return ZT({error:b,exitCode:l,signal:u,timedOut:h,isMaxBuffer:p,stdio:y,all:w,options:r,command:i,escapedCommand:n,startTime:a})},KT=({file:t,commandArguments:e,options:r,command:i,escapedCommand:n,fileDescriptors:o,startTime:s})=>{try{fb(o,r);let a=XT(r);return Ln.spawnSync(...nn(t,e,a))}catch(a){return er({error:a,command:i,escapedCommand:n,fileDescriptors:o,options:r,startTime:s,isSync:true})}},XT=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:hn(e)}),ZT=({error:t,exitCode:e,signal:r,timedOut:i,isMaxBuffer:n,stdio:o,all:s,options:a,command:c,escapedCommand:d,startTime:l})=>t===void 0?pn({command:c,escapedCommand:d,stdio:o,all:s,ipcOutput:[],options:a,startTime:l}):jr({error:t,command:c,escapedCommand:d,timedOut:i,isCanceled:false,isGracefullyCanceled:false,isMaxBuffer:n,isForcefullyTerminated:false,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:l,isSync:true});var Eb=({anyProcess:t,channel:e,isSubprocess:r,ipc:i},{reference:n=true,filter:o}={})=>(Jt({methodName:"getOneMessage",isSubprocess:r,ipc:i,isConnected:Ki(t)}),eA({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:n})),eA=async({anyProcess:t,channel:e,isSubprocess:r,filter:i,reference:n})=>{Wi(e,n);let o=ut(t,e,r),s=new AbortController;try{return await Promise.race([tA(o,i,s),rA(o,r,s),iA(o,r,s)])}catch(a){throw Kt(t),a}finally{s.abort(),Hi(e,n);}},tA=async(t,e,{signal:r})=>{if(e===void 0){let[i]=await events.once(t,"message",{signal:r});return i}for await(let[i]of events.on(t,"message",{signal:r}))if(e(i))return i},rA=async(t,e,{signal:r})=>{await events.once(t,"disconnect",{signal:r}),hf(e);},iA=async(t,e,{signal:r})=>{let[i]=await events.once(t,"strict:error",{signal:r});throw zi(i,e)};var _b=({anyProcess:t,channel:e,isSubprocess:r,ipc:i},{reference:n=true}={})=>pa({anyProcess:t,channel:e,isSubprocess:r,ipc:i,shouldAwait:!r,reference:n}),pa=({anyProcess:t,channel:e,isSubprocess:r,ipc:i,shouldAwait:n,reference:o})=>{Jt({methodName:"getEachMessage",isSubprocess:r,ipc:i,isConnected:Ki(t)}),Wi(e,o);let s=ut(t,e,r),a=new AbortController,c={};return oA(t,s,a),sA({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),aA({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:n,controller:a,state:c,reference:o})},oA=async(t,e,r)=>{try{await events.once(e,"disconnect",{signal:r.signal}),r.abort();}catch{}},sA=async({ipcEmitter:t,isSubprocess:e,controller:r,state:i})=>{try{let[n]=await events.once(t,"strict:error",{signal:r.signal});i.error=zi(n,e),r.abort();}catch{}},aA=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:i,shouldAwait:n,controller:o,state:s,reference:a}){try{for await(let[c]of events.on(r,"message",{signal:o.signal}))Tb(s),yield c;}catch{Tb(s);}finally{o.abort(),Hi(e,a),i||Kt(t),n&&await t;}},Tb=({error:t})=>{if(t)throw t};var Db=(t,{ipc:e})=>{Object.assign(t,$b(t,false,e));},Ib=()=>{let t=$__default.default,e=true,r=$__default.default.channel!==void 0;return {...$b(t,e,r),getCancelSignal:qf.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},$b=(t,e,r)=>({sendMessage:en.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:Eb.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:_b.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});var Rb=({error:t,command:e,escapedCommand:r,fileDescriptors:i,options:n,startTime:o,verboseInfo:s})=>{ia(i);let a=new Ln.ChildProcess;pA(a,i),Object.assign(a,{readable:mA,writable:fA,duplex:gA});let c=er({error:t,command:e,escapedCommand:r,fileDescriptors:i,options:n,startTime:o,isSync:false}),d=bA(c,s,n);return {subprocess:a,promise:d}},pA=(t,e)=>{let r=qr(),i=qr(),n=qr(),o=Array.from({length:e.length-3},qr),s=qr(),a=[r,i,n,...o];Object.assign(t,{stdin:r,stdout:i,stderr:n,all:s,stdio:a});},qr=()=>{let t=new stream.PassThrough;return t.end(),t},mA=()=>new stream.Readable({read(){}}),fA=()=>new stream.Writable({write(){}}),gA=()=>new stream.Duplex({read(){},write(){}}),bA=async(t,e,r)=>tr(t,e,r);var Nb=(t,e)=>bn(xA,t,e,false),Br=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${ht[t]}.`)},jb={fileNumber:Br,generator:la,asyncGenerator:la,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let i=e||r;return {stream:stream.Duplex.fromWeb(t,{objectMode:i})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},xA={input:{...jb,fileUrl:({value:t})=>({stream:Jr.createReadStream(t)}),filePath:({value:{file:t}})=>({stream:Jr.createReadStream(t)}),webStream:({value:t})=>({stream:stream.Readable.fromWeb(t)}),iterable:({value:t})=>({stream:stream.Readable.from(t)}),asyncIterable:({value:t})=>({stream:stream.Readable.from(t)}),string:({value:t})=>({stream:stream.Readable.from(t)}),uint8Array:({value:t})=>({stream:stream.Readable.from(buffer.Buffer.from(t))})},output:{...jb,fileUrl:({value:t})=>({stream:Jr.createWriteStream(t)}),filePath:({value:{file:t,append:e}})=>({stream:Jr.createWriteStream(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:stream.Writable.fromWeb(t)}),iterable:Br,asyncIterable:Br,string:Br,uint8Array:Br}};function Et(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let n of t)fa(n);let e=t.some(({readableObjectMode:n})=>n),r=OA(t,e),i=new ma({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let n of t)i.add(n);return i}var OA=(t,e)=>{if(t.length===0)return stream.getDefaultHighWaterMark(e);let r=t.filter(({readableObjectMode:i})=>i===e).map(({readableHighWaterMark:i})=>i);return Math.max(...r)},ma=class extends stream.PassThrough{#t=new Set([]);#r=new Set([]);#e=new Set([]);#i;#o=Symbol("unpipe");#n=new WeakMap;add(e){if(fa(e),this.#t.has(e))return;this.#t.add(e),this.#i??=EA(this,this.#t,this.#o);let r=_A({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#i,unpipeEvent:this.#o});this.#n.set(e,r),e.pipe(this,{end:false});}async remove(e){if(fa(e),!this.#t.has(e))return false;let r=this.#n.get(e);return r===void 0?false:(this.#n.delete(e),e.unpipe(this),await r,true)}},EA=async(t,e,r)=>{Cn(t,Lb);let i=new AbortController;try{await Promise.race([TA(t,i),AA(t,e,r,i)]);}finally{i.abort(),Cn(t,-Lb);}},TA=async(t,{signal:e})=>{try{await promises.finished(t,{signal:e,cleanup:!0});}catch(r){throw zb(t,r),r}},AA=async(t,e,r,{signal:i})=>{for await(let[n]of events.on(t,"unpipe",{signal:i}))e.has(n)&&n.emit(r);},fa=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},_A=async({passThroughStream:t,stream:e,streams:r,ended:i,aborted:n,onFinished:o,unpipeEvent:s})=>{Cn(t,Bb);let a=new AbortController;try{await Promise.race([PA(o,e,a),DA({passThroughStream:t,stream:e,streams:r,ended:i,aborted:n,controller:a}),IA({stream:e,streams:r,ended:i,aborted:n,unpipeEvent:s,controller:a})]);}finally{a.abort(),Cn(t,-Bb);}r.size>0&&r.size===i.size+n.size&&(i.size===0&&n.size>0?ga(t):$A(t));},PA=async(t,e,{signal:r})=>{try{await t,r.aborted||ga(e);}catch(i){r.aborted||zb(e,i);}},DA=async({passThroughStream:t,stream:e,streams:r,ended:i,aborted:n,controller:{signal:o}})=>{try{await promises.finished(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&i.add(e);}catch(s){if(o.aborted||!r.has(e))return;Gb(s)?n.add(e):Vb(t,s);}},IA=async({stream:t,streams:e,ended:r,aborted:i,unpipeEvent:n,controller:{signal:o}})=>{if(await events.once(t,n,{signal:o}),!t.readable)return events.once(o,"abort",{signal:o});e.delete(t),r.delete(t),i.delete(t);},$A=t=>{t.writable&&t.end();},zb=(t,e)=>{Gb(e)?ga(t):Vb(t,e);},Gb=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",ga=t=>{(t.readable||t.writable)&&t.destroy();},Vb=(t,e)=>{t.destroyed||(t.once("error",RA),t.destroy(e));},RA=()=>{},Cn=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e);},Lb=2,Bb=1;var ir=(t,e)=>{t.pipe(e),MA(t,e),FA(t,e);},MA=async(t,e)=>{if(!(xe(t)||xe(e))){try{await promises.finished(t,{cleanup:!0,readable:!0,writable:!1});}catch{}ba(e);}},ba=t=>{t.writable&&t.end();},FA=async(t,e)=>{if(!(xe(t)||xe(e))){try{await promises.finished(e,{cleanup:!0,readable:!1,writable:!0});}catch{}ya(t);}},ya=t=>{t.readable&&t.destroy();};var Hb=(t,e,r)=>{let i=new Map;for(let[n,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>ge.has(c)))jA(t,a,s,n);for(let{stream:a}of o.filter(({type:c})=>!ge.has(c)))qA({subprocess:t,stream:a,direction:s,fdNumber:n,pipeGroups:i,controller:r});}for(let[n,o]of i.entries()){let s=o.length===1?o[0]:Et(o);ir(s,n);}},jA=(t,e,r,i)=>{r==="output"?ir(t.stdio[i],e):ir(e,t.stdio[i]);let n=NA[i];n!==void 0&&(t[n]=e),t.stdio[i]=e;},NA=["stdin","stdout","stderr"],qA=({subprocess:t,stream:e,direction:r,fdNumber:i,pipeGroups:n,controller:o})=>{if(e===void 0)return;LA(e,o);let[s,a]=r==="output"?[e,t.stdio[i]]:[t.stdio[i],e],c=n.get(s)??[];n.set(s,[...c,a]);},LA=(t,{signal:e})=>{xe(t)&&St(t,BA,e);},BA=2;var Tt=[];Tt.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Tt.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Tt.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var On=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",wa=Symbol.for("signal-exit emitter"),va=globalThis,UA=Object.defineProperty.bind(Object),xa=class{emitted={afterExit:false,exit:false};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(va[wa])return va[wa];UA(va,wa,{value:this,writable:false,enumerable:false,configurable:false});}on(e,r){this.listeners[e].push(r);}removeListener(e,r){let i=this.listeners[e],n=i.indexOf(r);n!==-1&&(n===0&&i.length===1?i.length=0:i.splice(n,1));}emit(e,r,i){if(this.emitted[e])return false;this.emitted[e]=true;let n=false;for(let o of this.listeners[e])n=o(r,i)===true||n;return e==="exit"&&(n=this.emit("afterExit",r,i)||n),n}},En=class{},zA=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),Sa=class extends En{onExit(){return ()=>{}}load(){}unload(){}},ka=class extends En{#t=Ca.platform==="win32"?"SIGINT":"SIGHUP";#r=new xa;#e;#i;#o;#n={};#s=false;constructor(e){super(),this.#e=e,this.#n={};for(let r of Tt)this.#n[r]=()=>{let i=this.#e.listeners(r),{count:n}=this.#r,o=e;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.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a);}};this.#o=e.reallyExit,this.#i=e.emit;}onExit(e,r){if(!On(this.#e))return ()=>{};this.#s===false&&this.load();let i=r?.alwaysLast?"afterExit":"exit";return this.#r.on(i,e),()=>{this.#r.removeListener(i,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload();}}load(){if(!this.#s){this.#s=true,this.#r.count+=1;for(let e of Tt)try{let r=this.#n[e];r&&this.#e.on(e,r);}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e);}}unload(){this.#s&&(this.#s=false,Tt.forEach(e=>{let r=this.#n[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r);}catch{}}),this.#e.emit=this.#i,this.#e.reallyExit=this.#o,this.#r.count-=1);}#a(e){return On(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let i=this.#i;if(e==="exit"&&On(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let n=i.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),n}else return i.call(this.#e,e,...r)}},Ca=globalThis.process,{onExit:Yb}=zA(On(Ca)?new ka(Ca):new Sa);var Jb=(t,{cleanup:e,detached:r},{signal:i})=>{if(!e||r)return;let n=Yb(()=>{t.kill();});events.addAbortListener(i,()=>{n();});};var Xb=({source:t,sourcePromise:e,boundOptions:r,createNested:i},...n)=>{let o=Ri(),{destination:s,destinationStream:a,destinationError:c,from:d,unpipeSignal:l}=VA(r,i,n),{sourceStream:u,sourceError:h}=HA(t,d),{options:p,fileDescriptors:m}=$e.get(t);return {sourcePromise:e,sourceStream:u,sourceOptions:p,sourceError:h,destination:s,destinationStream:a,destinationError:c,unpipeSignal:l,fileDescriptors:m,startTime:o}},VA=(t,e,r)=>{try{let{destination:i,pipeOptions:{from:n,to:o,unpipeSignal:s}={}}=WA(t,e,...r),a=Vi(i,o);return {destination:i,destinationStream:a,from:n,unpipeSignal:s}}catch(i){return {destinationError:i}}},WA=(t,e,r,...i)=>{if(Array.isArray(r))return {destination:e(Kb,t)(r,...i),pipeOptions:t};if(typeof r=="string"||r instanceof URL||ps(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[n,o,s]=Ci(r,...i);return {destination:e(Kb)(n,o,s),pipeOptions:s}}if($e.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return {destination:r,pipeOptions:i[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Kb=({options:t})=>({options:{...t,stdin:"pipe",piped:true}}),HA=(t,e)=>{try{return {sourceStream:Xt(t,e)}}catch(r){return {sourceError:r}}};var Qb=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:i,fileDescriptors:n,sourceOptions:o,startTime:s})=>{let a=YA({sourceStream:t,sourceError:e,destinationStream:r,destinationError:i});if(a!==void 0)throw Oa({error:a,fileDescriptors:n,sourceOptions:o,startTime:s})},YA=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:i})=>{if(e!==void 0&&i!==void 0)return i;if(i!==void 0)return ya(t),i;if(e!==void 0)return ba(r),e},Oa=({error:t,fileDescriptors:e,sourceOptions:r,startTime:i})=>er({error:t,command:Zb,escapedCommand:Zb,fileDescriptors:e,options:r,startTime:i,isSync:false}),Zb="source.pipe(destination)";var ey=async t=>{let[{status:e,reason:r,value:i=r},{status:n,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(i)||s.pipedFrom.push(i),n==="rejected")throw s;if(e==="rejected")throw i;return s};var ty=(t,e,r)=>{let i=Tn.has(e)?XA(t,e):KA(t,e);return St(t,QA,r.signal),St(e,e_,r.signal),ZA(e),i},KA=(t,e)=>{let r=Et([t]);return ir(r,e),Tn.set(e,r),r},XA=(t,e)=>{let r=Tn.get(e);return r.add(t),r},ZA=async t=>{try{await promises.finished(t,{cleanup:!0,readable:!1,writable:!0});}catch{}Tn.delete(t);},Tn=new WeakMap,QA=2,e_=1;var ry=(t,e)=>t===void 0?[]:[r_(t,e)],r_=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:i,sourceOptions:n,startTime:o})=>{await util.aborted(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw Oa({error:s,fileDescriptors:i,sourceOptions:n,startTime:o})};var An=(t,...e)=>{if(X(e[0]))return An.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...i}=Xb(t,...e),n=i_({...i,destination:r});return n.pipe=An.bind(void 0,{...t,source:r,sourcePromise:n,boundOptions:{}}),n},i_=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:i,destination:n,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:d})=>{let l=n_(t,n);Qb({sourceStream:e,sourceError:i,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:d});let u=new AbortController;try{let h=ty(e,o,u);return await Promise.race([ey(l),...ry(a,{sourceStream:e,mergedStream:h,sourceOptions:r,fileDescriptors:c,startTime:d})])}finally{u.abort();}},n_=(t,e)=>Promise.allSettled([t,e]);var _n=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:i,encoding:n,preserveNewlines:o})=>{let s=new AbortController;return a_(e,s),ny({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&i,encoding:n,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},a_=async(t,e)=>{try{await t;}catch{}finally{e.abort();}},Ea=({stream:t,onStreamEnd:e,lines:r,encoding:i,stripFinalNewline:n,allMixed:o})=>{let s=new AbortController;c_(e,s,t);let a=t.readableObjectMode&&!o;return ny({stream:t,controller:s,binary:i==="buffer",shouldEncode:!a,encoding:i,shouldSplit:!a&&r,preserveNewlines:!n})},c_=async(t,e,r)=>{try{await t;}catch{r.destroy();}finally{e.abort();}},ny=({stream:t,controller:e,binary:r,shouldEncode:i,encoding:n,shouldSplit:o,preserveNewlines:s})=>{let a=events.on(t,"data",{signal:e.signal,highWaterMark:iy,highWatermark:iy});return l_({onStdoutChunk:a,controller:e,binary:r,shouldEncode:i,encoding:n,shouldSplit:o,preserveNewlines:s})},Ta=stream.getDefaultHighWaterMark(true),iy=Ta,l_=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:i,encoding:n,shouldSplit:o,preserveNewlines:s}){let a=d_({binary:r,shouldEncode:i,encoding:n,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*Ot(c,a,0);}catch(c){if(!e.signal.aborted)throw c}finally{yield*Nr(a);}},d_=({binary:t,shouldEncode:e,encoding:r,shouldSplit:i,preserveNewlines:n})=>[wn(t,r,!e),yn(t,n,!i,{})].filter(Boolean);var oy=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:i,buffer:n,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:d,streamInfo:l})=>{let u=h_({stream:t,onStreamEnd:e,fdNumber:r,encoding:i,allMixed:a,verboseInfo:d,streamInfo:l});if(!n){await Promise.all([p_(t),u]);return}let h=na(c,r),p=Ea({stream:t,onStreamEnd:e,lines:s,encoding:i,stripFinalNewline:h,allMixed:a}),[m]=await Promise.all([m_({stream:t,iterable:p,fdNumber:r,encoding:i,maxBuffer:o,lines:s}),u]);return m},h_=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:i,allMixed:n,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!Sn({stdioItems:s[r]?.stdioItems,encoding:i,verboseInfo:o,fdNumber:r}))return;let a=Ea({stream:t,onStreamEnd:e,lines:true,encoding:i,stripFinalNewline:true,allMixed:n});await gb(a,t,r,o);},p_=async t=>{await promises$1.setImmediate(),t.readableFlowing===null&&t.resume();},m_=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:i,encoding:n,maxBuffer:o,lines:s})=>{try{return e||s?await cn(r,{maxBuffer:o}):n==="buffer"?new Uint8Array(await ln(r,{maxBuffer:o})):await un(r,{maxBuffer:o})}catch(a){return sy(gg({error:a,stream:t,readableObjectMode:e,lines:s,encoding:n,fdNumber:i}))}},Aa=async t=>{try{return await t}catch(e){return sy(e)}},sy=({bufferedData:t})=>Dp(t)?new Uint8Array(t):t;var Ur=async(t,e,r,{isSameDirection:i,stopOnExit:n=false}={})=>{let o=g_(t,r),s=new AbortController;try{await Promise.race([...n?[r.exitPromise]:[],promises.finished(t,{cleanup:!0,signal:s.signal})]);}catch(a){o.stdinCleanedUp||w_(a,e,r,i);}finally{s.abort();}},g_=(t,{originalStreams:[e],subprocess:r})=>{let i={stdinCleanedUp:false};return t===e&&b_(t,r,i),i},b_=(t,e,r)=>{let{_destroy:i}=t;t._destroy=(...n)=>{y_(e,r),i.call(t,...n);};},y_=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=true);},w_=(t,e,r,i)=>{if(!v_(t,e,r,i))throw t},v_=(t,e,r,i=true)=>r.propagating?ay(t)||Pn(t):(r.propagating=true,_a(r,e)===i?ay(t):Pn(t)),_a=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",Pn=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",ay=t=>t?.code==="EPIPE";var cy=({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,d)=>Pa({stream:c,fdNumber:d,encoding:e,buffer:r[d],maxBuffer:i[d],lines:n[d],allMixed:false,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),Pa=async({stream:t,fdNumber:e,encoding:r,buffer:i,maxBuffer:n,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:d})=>{if(!t)return;let l=Ur(t,e,d);if(_a(d,e)){await l;return}let[u]=await Promise.all([oy({stream:t,onStreamEnd:l,fdNumber:e,encoding:r,buffer:i,maxBuffer:n,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:d}),l]);return u};var ly=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Et([t,e].filter(Boolean)):void 0,dy=({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>Pa({...x_(t,r),fdNumber:"all",encoding:e,maxBuffer:i[1]+i[2],lines:n[1]||n[2],allMixed:S_(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),x_=({stdout:t,stderr:e,all:r},[,i,n])=>{let o=i||n;return o?i?n?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},S_=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;var uy=t=>Wt(t,"ipc"),hy=(t,e)=>{let r=$i(t);De({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e});};var py=async({subprocess:t,buffer:e,maxBuffer:r,ipc:i,ipcOutput:n,verboseInfo:o})=>{if(!i)return n;let s=uy(o),a=Ye(e,"ipc"),c=Ye(r,"ipc");for await(let d of pa({anyProcess:t,channel:t.channel,isSubprocess:false,ipc:i,shouldAwait:false,reference:true}))a&&(bg(t,n,c),n.push(d)),s&&hy(d,o);return n},my=async(t,e)=>(await Promise.allSettled([t]),e);var fy=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:i,lines:n,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:d,ipc:l,ipcInput:u},context:h,verboseInfo:p,fileDescriptors:m,originalStreams:b,onInternalError:y,controller:w})=>{let S=xb(t,h),C={originalStreams:b,fileDescriptors:m,subprocess:t,exitPromise:S,propagating:false},M=cy({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:d,verboseInfo:p,streamInfo:C}),Z=dy({subprocess:t,encoding:e,buffer:r,maxBuffer:i,lines:n,stripFinalNewline:d,verboseInfo:p,streamInfo:C}),O=[],D=py({subprocess:t,buffer:r,maxBuffer:i,ipc:l,ipcOutput:O,verboseInfo:p}),q=C_(b,t,C),v=O_(m,C);try{return await Promise.race([Promise.all([{},kb(S),Promise.all(M),Z,D,Jf(t,u),...q,...v]),y,E_(t,w),...Gf(t,o,h,w),...uf({subprocess:t,cancelSignal:s,gracefulCancel:a,context:h,controller:w}),...Uf({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:h,controller:w})])}catch(E){return h.terminationReason??="other",Promise.all([{error:E},S,Promise.all(M.map(k=>Aa(k))),Aa(Z),my(D,O),Promise.allSettled(q),Promise.allSettled(v)])}},C_=(t,e,r)=>t.map((i,n)=>i===e.stdio[n]?void 0:Ur(i,n,r)),O_=(t,e)=>t.flatMap(({stdioItems:r},i)=>r.filter(({value:n,stream:o=n})=>Ce(o,{checkOpen:false})&&!xe(o)).map(({type:n,value:o,stream:s=o})=>Ur(s,i,e,{isSameDirection:ge.has(n),stopOnExit:n==="native"}))),E_=async(t,{signal:e})=>{let[r]=await events.once(t,"error",{signal:e});throw r};var gy=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),zr=(t,e,r)=>{let i=t[r];i.has(e)||i.set(e,[]);let n=i.get(e),o=Ie();return n.push(o),{resolve:o.resolve.bind(o),promises:n}},nr=async({resolve:t,promises:e},r)=>{t();let[i]=await Promise.race([Promise.allSettled([true,r]),Promise.all([false,...e])]);return !i};var Da=async t=>{if(t!==void 0)try{await Ia(t);}catch{}},yy=async t=>{if(t!==void 0)try{await $a(t);}catch{}},Ia=async t=>{await promises.finished(t,{cleanup:true,readable:false,writable:true});},$a=async t=>{await promises.finished(t,{cleanup:true,readable:true,writable:false});},Dn=async(t,e)=>{if(await t,e)throw e},In=(t,e,r)=>{r&&!Pn(r)?t.destroy(r):e&&t.destroy();};var wy=({subprocess:t,concurrentStreams:e,encoding:r},{from:i,binary:n=true,preserveNewlines:o=true}={})=>{let s=n||pe.has(r),{subprocessStdout:a,waitReadableDestroy:c}=Ra(t,i,e),{readableEncoding:d,readableObjectMode:l,readableHighWaterMark:u}=Ma(a,s),{read:h,onStdoutDataDone:p}=Fa({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new stream.Readable({read:h,destroy:util.callbackify(Na.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:u,objectMode:l,encoding:d});return ja({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},Ra=(t,e,r)=>{let i=Xt(t,e),n=zr(r,i,"readableDestroy");return {subprocessStdout:i,waitReadableDestroy:n}},Ma=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},i)=>i?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:true,readableHighWaterMark:Ta},Fa=({subprocessStdout:t,subprocess:e,binary:r,encoding:i,preserveNewlines:n})=>{let o=Ie(),s=_n({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:i,preserveNewlines:n});return {read(){__(this,s,o);},onStdoutDataDone:o}},__=async(t,e,r)=>{try{let{value:i,done:n}=await e.next();n?r.resolve():t.push(i);}catch{}},ja=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:i,subprocessStdin:n})=>{try{await $a(t),await i,await Da(n),await e,r.readable&&r.push(null);}catch(o){await Da(n),vy(r,o);}},Na=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},i)=>{await nr(r,e)&&(vy(t,i),await Dn(e,i));},vy=(t,e)=>{In(t,t.readable,e);};var Sy=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:i,waitWritableFinal:n,waitWritableDestroy:o}=qa(t,r,e),s=new stream.Writable({...La(i,t,n),destroy:util.callbackify(Ua.bind(void 0,{subprocessStdin:i,subprocess:t,waitWritableFinal:n,waitWritableDestroy:o})),highWaterMark:i.writableHighWaterMark,objectMode:i.writableObjectMode});return Ba(i,s),s},qa=(t,e,r)=>{let i=Vi(t,e),n=zr(r,i,"writableFinal"),o=zr(r,i,"writableDestroy");return {subprocessStdin:i,waitWritableFinal:n,waitWritableDestroy:o}},La=(t,e,r)=>({write:D_.bind(void 0,t),final:util.callbackify(I_.bind(void 0,t,e,r))}),D_=(t,e,r,i)=>{t.write(e,r)?i():t.once("drain",i);},I_=async(t,e,r)=>{await nr(r,e)&&(t.writable&&t.end(),await e);},Ba=async(t,e,r)=>{try{await Ia(t),e.writable&&e.end();}catch(i){await yy(r),ky(e,i);}},Ua=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:i},n)=>{await nr(r,e),await nr(i,e)&&(ky(t,n),await Dn(e,n));},ky=(t,e)=>{In(t,t.writable,e);};var Cy=({subprocess:t,concurrentStreams:e,encoding:r},{from:i,to:n,binary:o=true,preserveNewlines:s=true}={})=>{let a=o||pe.has(r),{subprocessStdout:c,waitReadableDestroy:d}=Ra(t,i,e),{subprocessStdin:l,waitWritableFinal:u,waitWritableDestroy:h}=qa(t,n,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:b}=Ma(c,a),{read:y,onStdoutDataDone:w}=Fa({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),S=new stream.Duplex({read:y,...La(l,t,u),destroy:util.callbackify(M_.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:t,waitReadableDestroy:d,waitWritableFinal:u,waitWritableDestroy:h})),readableHighWaterMark:b,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:m,writableObjectMode:l.writableObjectMode,encoding:p});return ja({subprocessStdout:c,onStdoutDataDone:w,readable:S,subprocess:t,subprocessStdin:l}),Ba(l,S,c),S},M_=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:i,waitWritableFinal:n,waitWritableDestroy:o},s)=>{await Promise.all([Na({subprocessStdout:t,subprocess:r,waitReadableDestroy:i},s),Ua({subprocessStdin:e,subprocess:r,waitWritableFinal:n,waitWritableDestroy:o},s)]);};var za=(t,e,{from:r,binary:i=false,preserveNewlines:n=false}={})=>{let o=i||pe.has(e),s=Xt(t,r),a=_n({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:true,encoding:e,preserveNewlines:n});return F_(a,s,t)},F_=async function*(t,e,r){try{yield*t;}finally{e.readable&&e.destroy(),await r;}};var Oy=(t,{encoding:e})=>{let r=gy();t.readable=wy.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=Sy.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=Cy.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=za.bind(void 0,t,e),t[Symbol.asyncIterator]=za.bind(void 0,t,e,{});};var Ey=(t,e)=>{for(let[r,i]of N_){let n=i.value.bind(e);Reflect.defineProperty(t,r,{...i,value:n});}},j_=(async()=>{})().constructor.prototype,N_=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(j_,t)]);var Ty=(t,e,r,i)=>{let{file:n,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:d,options:l,fileDescriptors:u}=B_(t,e,r),{subprocess:h,promise:p}=z_({file:n,commandArguments:o,options:l,startTime:c,verboseInfo:d,command:s,escapedCommand:a,fileDescriptors:u});return h.pipe=An.bind(void 0,{source:h,sourcePromise:p,boundOptions:{},createNested:i}),Ey(h,p),$e.set(h,{options:l,fileDescriptors:u}),h},B_=(t,e,r)=>{let{command:i,escapedCommand:n,startTime:o,verboseInfo:s}=Mi(t,e,r),{file:a,commandArguments:c,options:d}=rn(t,e,r),l=U_(d),u=Nb(l,s);return {file:a,commandArguments:c,command:i,escapedCommand:n,startTime:o,verboseInfo:s,options:l,fileDescriptors:u}},U_=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return {...r,timeoutDuration:t}},z_=({file:t,commandArguments:e,options:r,startTime:i,verboseInfo:n,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=Ln.spawn(...nn(t,e,r));}catch(m){return Rb({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:i,verboseInfo:n})}let d=new AbortController;events.setMaxListeners(Number.POSITIVE_INFINITY,d.signal);let l=[...c.stdio];Hb(c,a,d),Jb(c,r,d);let u={},h=Ie();c.kill=lf.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:h,context:u,controller:d}),c.all=ly(c,r),Oy(c,r),Db(c,r);let p=G_({subprocess:c,options:r,startTime:i,verboseInfo:n,fileDescriptors:a,originalStreams:l,command:o,escapedCommand:s,context:u,onInternalError:h,controller:d});return {subprocess:c,promise:p}},G_=async({subprocess:t,options:e,startTime:r,verboseInfo:i,fileDescriptors:n,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:d,controller:l})=>{let[u,[h,p],m,b,y]=await fy({subprocess:t,options:e,context:c,verboseInfo:i,fileDescriptors:n,originalStreams:o,onInternalError:d,controller:l});l.abort(),d.resolve();let w=m.map((M,Z)=>Ke(M,e,Z)),S=Ke(b,e,"all"),C=V_({errorInfo:u,exitCode:h,signal:p,stdio:w,all:S,ipcOutput:y,context:c,options:e,command:s,escapedCommand:a,startTime:r});return tr(C,i,e)},V_=({errorInfo:t,exitCode:e,signal:r,stdio:i,all:n,ipcOutput:o,context:s,options:a,command:c,escapedCommand:d,startTime:l})=>"error"in t?jr({error:t.error,command:c,escapedCommand:d,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Re,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:i,all:n,ipcOutput:o,options:a,startTime:l,isSync:false}):pn({command:c,escapedCommand:d,stdio:i,all:n,ipcOutput:o,options:a,startTime:l});var $n=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([i,n])=>[i,W_(i,t[i],n)]));return {...t,...r}},W_=(t,e,r)=>H_.has(t)&&X(e)&&X(r)?{...e,...r}:r,H_=new Set(["env",...ws]);var pt=(t,e,r,i)=>{let n=(s,a,c)=>pt(s,a,r,c),o=(...s)=>Y_({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:i,createNested:n},...s);return i!==void 0&&i(o,n,e),o},Y_=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:i,createNested:n},o,...s)=>{if(X(o))return n(t,$n(r,o),i);let{file:a,commandArguments:c,options:d,isSync:l}=J_({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return l?Ob(a,c,d):Ty(a,c,d,n)},J_=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:i,boundOptions:n})=>{let o=jp(e)?Np(e,r):[e,...r],[s,a,c]=Ci(...o),d=$n($n(i,n),c),{file:l=s,commandArguments:u=a,options:h=d,isSync:p=false}=t({file:s,commandArguments:a,options:d});return {file:l,commandArguments:u,options:h,isSync:p}};var Ay=({file:t,commandArguments:e})=>Py(t,e),_y=({file:t,commandArguments:e})=>({...Py(t,e),isSync:true}),Py=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...i]=K_(t);return {file:r,commandArguments:i}},K_=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return [];let r=[];for(let i of e.split(X_)){let n=r.at(-1);n&&n.endsWith("\\")?r[r.length-1]=`${n.slice(0,-1)} ${i}`:r.push(i);}return r},X_=/ +/g;var Dy=(t,e,r)=>{t.sync=e(Z_,r),t.s=t.sync;},Iy=({options:t})=>$y(t),Z_=({options:t})=>({...$y(t),isSync:true}),$y=t=>({options:{...Q_(t),...t}}),Q_=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},Ry={preferLocal:true};var My=pt(()=>({}));pt(()=>({isSync:true}));pt(Ay);pt(_y);pt(Wf);pt(Iy,{},Ry,Dy);Ib();async function Gr({cwd:t,packageManager:e,packages:r,dev:i=false}){if(!r.length)return;let n={npm:"npm",pnpm:"pnpm",yarn:"yarn",bun:"bun"},o={npm:["install",...i?["-D"]:[],...r],pnpm:["add",...i?["-D"]:[],...r],yarn:["add",...i?["-D"]:[],...r],bun:["add",...i?["-d"]:[],...r]};await My(n[e],o[e],{cwd:t,stdio:"inherit"});}var Wr=be(qe());var Ga="/* tembro:start */",Rn="/* tembro:end */";function Fy(t){return `${Ga}
172
172
  @source "${t}";
173
173
 
174
174
  @custom-variant dark (&:is(.dark *));
@@ -1930,19 +1930,19 @@ Instead, \`yield\` should either be called with a value, or not be called at all
1930
1930
  [data-slot="file-upload-file-status"][data-status="error"] { color: var(--destructive); background: color-mix(in oklch, var(--destructive), transparent 90%); }
1931
1931
  [data-slot="file-upload-progress-bar"] { background: var(--primary); }
1932
1932
  }
1933
- ${Pn}
1934
- `}var Iy="/* tembro:custom-styles:start */",$y="/* tembro:custom-styles:end */";function H_(t){let e=["tailwindcss","tw-animate-css","@fontsource-variable/geist"],r=t;for(let n of e){let o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");r=r.replace(new RegExp(`^\\s*@import\\s+["']${o}["'];?\\s*`,"gm"),"");}return `${e.map(n=>`@import "${n}";`).join(`
1933
+ ${Rn}
1934
+ `}var jy="/* tembro:custom-styles:start */",Ny="/* tembro:custom-styles:end */";function eP(t){let e=["tailwindcss","tw-animate-css","@fontsource-variable/geist"],r=t;for(let n of e){let o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");r=r.replace(new RegExp(`^\\s*@import\\s+["']${o}["'];?\\s*`,"gm"),"");}return `${e.map(n=>`@import "${n}";`).join(`
1935
1935
  `)}
1936
1936
 
1937
1937
  ${r.trimStart()}`.trimEnd()+`
1938
- `}function Y_(t,e){let r=t.indexOf(Ua),i=t.indexOf(Pn);if(r!==-1&&i!==-1&&i>r){let n=t.slice(0,r).trimEnd(),o=t.slice(i+Pn.length).trimStart();return [n,e,o].filter(Boolean).join(`
1938
+ `}function tP(t,e){let r=t.indexOf(Ga),i=t.indexOf(Rn);if(r!==-1&&i!==-1&&i>r){let n=t.slice(0,r).trimEnd(),o=t.slice(i+Rn.length).trimStart();return [n,e,o].filter(Boolean).join(`
1939
1939
 
1940
1940
  `)+`
1941
1941
  `}return `${t.trimEnd()}
1942
1942
 
1943
1943
  ${e}
1944
- `}function J_(t){let e=t.includes(Iy),r=t.includes($y);if(e&&r)return t.trimEnd()+`
1945
- `;let i=`${Iy}
1944
+ `}function rP(t){let e=t.includes(jy),r=t.includes(Ny);if(e&&r)return t.trimEnd()+`
1945
+ `;let i=`${jy}
1946
1946
  /*
1947
1947
  * This block belongs to your application and is preserved by tembro init
1948
1948
  * and tembro theme. Override semantic tokens or data-slot styles here.
@@ -1960,32 +1960,32 @@ ${e}
1960
1960
  @layer components {
1961
1961
  /* Example: [data-slot="button"] { border-radius: var(--aui-radius-control); } */
1962
1962
  }
1963
- ${$y}`;return `${t.trimEnd()}
1963
+ ${Ny}`;return `${t.trimEnd()}
1964
1964
 
1965
1965
  ${i}
1966
- `}function K_(t){return t.replaceAll("\\","/")}async function In({cwd:t,cssPath:e,componentsPath:r="src/components"}){let i=L__default.default.resolve(t,e),n=L__default.default.dirname(i),o=L__default.default.join(t,r,"**","*.{ts,tsx}"),s=K_(L__default.default.relative(n,o)),a=s.startsWith(".")?s:`./${s}`;await zr.default.ensureDir(L__default.default.dirname(i));let c=zr.default.existsSync(i)?await zr.default.readFile(i,"utf8"):"",d=H_(c),l=Y_(d,Py(a)),u=J_(l);return await zr.default.writeFile(i,u),i}var Ry="tembro",X_="tembro";function ne(t=""){return `npx ${X_} ${t}`.trim()}var Z_=["@fontsource-variable/geist","clsx","tailwind-merge","tw-animate-css"],Q_={vite:["tailwindcss","@tailwindcss/vite"],next:["tailwindcss","@tailwindcss/postcss"]},eD=`// Generated by tembro init.
1966
+ `}function iP(t){return t.replaceAll("\\","/")}async function Mn({cwd:t,cssPath:e,componentsPath:r="src/components"}){let i=L__default.default.resolve(t,e),n=L__default.default.dirname(i),o=L__default.default.join(t,r,"**","*.{ts,tsx}"),s=iP(L__default.default.relative(n,o)),a=s.startsWith(".")?s:`./${s}`;await Wr.default.ensureDir(L__default.default.dirname(i));let c=Wr.default.existsSync(i)?await Wr.default.readFile(i,"utf8"):"",d=eP(c),l=tP(d,Fy(a)),u=rP(l);return await Wr.default.writeFile(i,u),i}var qy="tembro",nP="tembro";function re(t=""){return `npx ${nP} ${t}`.trim()}var ie=be(qe()),Hy=be(hs());var f=(t,e)=>({source:t,target:e}),R={utils:{name:"utils",category:"lib",dependencies:["clsx","tailwind-merge"],files:[f("src/lib/utils.ts","{utils}")]},button:{name:"button",category:"ui",dependencies:["@base-ui/react","class-variance-authority"],registryDependencies:["utils"],files:[f("src/components/ui/button","{ui}/button")]},input:{name:"input",category:"ui",dependencies:["@base-ui/react","lucide-react"],registryDependencies:["utils"],files:[f("src/components/ui/input","{ui}/input")]},textarea:{name:"textarea",category:"ui",registryDependencies:["utils"],files:[f("src/components/ui/textarea","{ui}/textarea")]},checkbox:{name:"checkbox",category:"ui",dependencies:["lucide-react"],registryDependencies:["utils"],files:[f("src/components/ui/checkbox","{ui}/checkbox")]},switch:{name:"switch",category:"ui",registryDependencies:["utils"],files:[f("src/components/ui/switch","{ui}/switch")]},badge:{name:"badge",category:"ui",dependencies:["@base-ui/react","class-variance-authority"],registryDependencies:["utils"],files:[f("src/components/ui/badge","{ui}/badge")]},card:{name:"card",category:"ui",dependencies:["class-variance-authority"],registryDependencies:["utils"],files:[f("src/components/ui/card","{ui}/card")]},skeleton:{name:"skeleton",category:"ui",registryDependencies:["utils"],files:[f("src/components/ui/skeleton","{ui}/skeleton")]},tabs:{name:"tabs",category:"ui",dependencies:["@base-ui/react"],registryDependencies:["utils"],files:[f("src/components/ui/tabs","{ui}/tabs")]},dialog:{name:"dialog",category:"ui",dependencies:["@base-ui/react","lucide-react"],registryDependencies:["button","utils"],files:[f("src/components/ui/dialog","{ui}/dialog")]},"dropdown-menu":{name:"dropdown-menu",category:"ui",dependencies:["@base-ui/react","lucide-react"],registryDependencies:["utils"],files:[f("src/components/ui/dropdown-menu","{ui}/dropdown-menu")]},popover:{name:"popover",category:"ui",dependencies:["@base-ui/react"],registryDependencies:["utils"],files:[f("src/components/ui/popover","{ui}/popover")]},tooltip:{name:"tooltip",category:"ui",registryDependencies:["utils"],files:[f("src/components/ui/tooltip","{ui}/tooltip")]},"hover-card":{name:"hover-card",category:"ui",migrationAliasFor:"popover"},"simple-select":{name:"simple-select",category:"ui",migrationAliasFor:"select"},combobox:{name:"combobox",category:"ui",migrationAliasFor:"select"},select:{name:"select",category:"ui",dependencies:["@base-ui/react","lucide-react"],registryDependencies:["utils"],files:[f("src/components/ui/select","{ui}/select")]},table:{name:"table",category:"ui",registryDependencies:["utils"],files:[f("src/components/ui/table","{ui}/table")]},"segmented-control":{name:"segmented-control",category:"ui",registryDependencies:["utils"],files:[f("src/components/ui/segmented-control","{ui}/segmented-control")]},"radio-group":{name:"radio-group",category:"ui",registryDependencies:["button","utils"],files:[f("src/components/ui/radio-group","{ui}/radio-group")]},accordion:{name:"accordion",category:"ui",dependencies:["lucide-react"],registryDependencies:["collapse"],files:[f("src/components/ui/accordion","{ui}/accordion")]},kbd:{name:"kbd",category:"ui",files:[f("src/components/ui/kbd","{ui}/kbd")]},"scroll-box":{name:"scroll-box",category:"ui",files:[f("src/components/ui/scroll-box","{ui}/scroll-box")]},"right-click-menu":{name:"right-click-menu",category:"ui",dependencies:["react"],files:[f("src/components/ui/right-click-menu","{ui}/right-click-menu")]},"tag-input":{name:"tag-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["badge","input","utils"],files:[f("src/components/inputs/tag-input.tsx","{components}/inputs/tag-input.tsx")]},"async-select":{name:"async-select",category:"inputs",dependencies:["lucide-react"],registryDependencies:["button","input","popover","utils"],files:[f("src/components/inputs/async-select.tsx","{components}/inputs/async-select.tsx")]},"form-field-shell":{name:"form-field-shell",category:"form",registryDependencies:["utils"],files:[f("src/components/form/form-field-shell.tsx","{components}/form/form-field-shell.tsx")]},"form-input":{name:"form-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["input","form-field-shell"],files:[f("src/components/form/form-input.tsx","{components}/form/form-input.tsx")]},"form-select":{name:"form-select",category:"form",dependencies:["react-hook-form"],registryDependencies:["select","async-select","form-field-shell"],files:[f("src/components/form/form-select.tsx","{components}/form/form-select.tsx")]},"form-textarea":{name:"form-textarea",category:"form",dependencies:["react-hook-form"],registryDependencies:["textarea","form-field-shell"],files:[f("src/components/form/form-textarea.tsx","{components}/form/form-textarea.tsx")]},"form-switch":{name:"form-switch",category:"form",dependencies:["react-hook-form"],registryDependencies:["switch","form-field-shell","utils"],files:[f("src/components/form/form-switch.tsx","{components}/form/form-switch.tsx")]},"form-date-range-input":{name:"form-date-range-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["input","form-field-shell"],files:[f("src/components/form/form-date-range-input.tsx","{components}/form/form-date-range-input.tsx")]},"form-date-picker":{name:"form-date-picker",category:"form",dependencies:["react-hook-form"],registryDependencies:["date-picker","form-field-shell"],files:[f("src/components/form/form-date-picker.tsx","{components}/form/form-date-picker.tsx")]},"form-date-range-picker":{name:"form-date-range-picker",category:"form",dependencies:["react-hook-form"],registryDependencies:["date-range-picker","form-field-shell"],files:[f("src/components/form/form-date-range-picker.tsx","{components}/form/form-date-range-picker.tsx")]},form:{name:"form",category:"group",registryDependencies:["form-field-shell","form-input","form-select","form-textarea","form-switch","form-date-range-input","form-date-picker","form-date-range-picker"],files:[f("src/components/form/index.ts","{components}/form/index.ts")]},"dialog-actions":{name:"dialog-actions",category:"overlay",migrationAliasFor:"dialog"},"modal-shell":{name:"modal-shell",category:"overlay",migrationAliasFor:"dialog"},"confirm-dialog":{name:"confirm-dialog",category:"overlay",registryDependencies:["button","dialog"],files:[f("src/components/overlay/confirm-dialog.tsx","{components}/overlay/confirm-dialog.tsx")]},"alert-dialog":{name:"alert-dialog",category:"overlay",dependencies:["lucide-react"],registryDependencies:["dialog","button"],files:[f("src/components/overlay/alert-dialog.tsx","{components}/overlay/alert-dialog.tsx")]},drawer:{name:"drawer",category:"overlay",dependencies:["@base-ui/react"],registryDependencies:["dialog"],files:[f("src/components/overlay/drawer.tsx","{components}/overlay/drawer.tsx")]},"loading-state":{name:"loading-state",category:"feedback",dependencies:["lucide-react"],registryDependencies:["utils"],files:[f("src/components/feedback/loading-state.tsx","{components}/feedback/loading-state.tsx")]},"page-state":{name:"page-state",category:"feedback",registryDependencies:["button","utils"],files:[f("src/components/feedback/page-state.tsx","{components}/feedback/page-state.tsx")]},feedback:{name:"feedback",category:"group",registryDependencies:["alert","loading-state","page-state","data-state"],files:[f("src/components/feedback/index.ts","{components}/feedback/index.ts")]},sidebar:{name:"sidebar",category:"layout",dependencies:["react"],registryDependencies:["tooltip","utils"],files:[f("src/components/layout/app-sidebar.tsx","{components}/layout/app-sidebar.tsx")]},layout:{name:"layout",category:"group",registryDependencies:["sidebar","breadcrumbs","section"],files:[f("src/components/layout/index.ts","{components}/layout/index.ts")]},calendar:{name:"calendar",category:"calendar",dependencies:["lucide-react"],registryDependencies:["button","utils"],files:[f("src/components/calendar/calendar.tsx","{components}/calendar/calendar.tsx"),f("src/components/calendar/date-utils.ts","{components}/calendar/date-utils.ts")]},"date-picker":{name:"date-picker",category:"calendar",dependencies:["lucide-react"],registryDependencies:["calendar","button","popover","utils"],files:[f("src/components/calendar/date-picker.tsx","{components}/calendar/date-picker.tsx")]},"date-range-picker":{name:"date-range-picker",category:"calendar",dependencies:["lucide-react"],registryDependencies:["calendar","button","popover","utils"],files:[f("src/components/calendar/date-range-picker.tsx","{components}/calendar/date-range-picker.tsx")]},dashboard:{name:"dashboard",category:"group",registryDependencies:["layout","feedback","input","async-select","tag-input","form"]},"calendar-kit":{name:"calendar-kit",category:"group",registryDependencies:["calendar","date-picker","date-range-picker"]},"wizard-kit":{name:"wizard-kit",category:"group",registryDependencies:["stepper","wizard"]},dnd:{name:"dnd",category:"group",registryDependencies:["sortable-list"],files:[f("src/components/dnd/index.ts","{components}/dnd/index.ts")]},all:{name:"all",category:"group",registryDependencies:["dashboard"]}},oP=[{name:"action-menu",category:"actions",files:[f("src/components/actions/action-menu.tsx","{components}/actions/action-menu.tsx")]},{name:"activity-feed",category:"display",files:[f("src/components/display/activity-feed.tsx","{components}/display/activity-feed.tsx")]},{name:"alert",category:"feedback",files:[f("src/components/feedback/alert.tsx","{components}/feedback/alert.tsx")]},{name:"app-header",category:"layout",migrationAliasFor:"sidebar"},{name:"avatar",category:"display",files:[f("src/components/display/avatar.tsx","{components}/display/avatar.tsx")]},{name:"breadcrumbs",category:"layout",files:[f("src/components/layout/breadcrumbs.tsx","{components}/layout/breadcrumbs.tsx")]},{name:"button-group",category:"actions",files:[f("src/components/actions/button-group.tsx","{components}/actions/button-group.tsx")]},{name:"code-block",category:"display",files:[f("src/components/display/code-block.tsx","{components}/display/code-block.tsx")]},{name:"collapse",category:"ui",files:[f("src/components/ui/collapse","{ui}/collapse")]},{name:"carousel",category:"display",files:[f("src/components/display/carousel.tsx","{components}/display/carousel.tsx")]},{name:"tag",category:"display",registryDependencies:["utils"],files:[f("src/components/display/tag.tsx","{components}/display/tag.tsx")]},{name:"typography",category:"display",registryDependencies:["utils"],files:[f("src/components/display/typography.tsx","{components}/display/typography.tsx")]},{name:"command",category:"ui",files:[f("src/components/ui/command","{ui}/command")]},{name:"copy-button",category:"actions",files:[f("src/components/actions/copy-button.tsx","{components}/actions/copy-button.tsx")]},{name:"copy-field",category:"actions",migrationAliasFor:"copy-button"},{name:"clearable-input",category:"inputs",migrationAliasFor:"input"},{name:"search-input",category:"inputs",migrationAliasFor:"input"},{name:"password-input",category:"inputs",migrationAliasFor:"input"},{name:"number-input",category:"inputs",migrationAliasFor:"input"},{name:"money-input",category:"inputs",migrationAliasFor:"input"},{name:"phone-input",category:"inputs",migrationAliasFor:"input"},{name:"masked-input",category:"inputs",migrationAliasFor:"input"},{name:"quantity-input",category:"inputs",migrationAliasFor:"input"},{name:"date-input",category:"inputs",migrationAliasFor:"input"},{name:"date-range-input",category:"inputs",migrationAliasFor:"input"},{name:"form-async-select",category:"form",migrationAliasFor:"form-select"},{name:"input-decorator",category:"inputs",migrationAliasFor:"input"},{name:"input-value",category:"inputs",migrationAliasFor:"input"},{name:"inputs",category:"group",migrationAliasFor:"input"},{name:"app-sidebar",category:"layout",migrationAliasFor:"sidebar"},{name:"page-header",category:"layout",migrationAliasFor:"section"},{name:"page-container",category:"layout",migrationAliasFor:"sidebar"},{name:"section-header",category:"layout",migrationAliasFor:"section"},{name:"sidebar-nav",category:"layout",migrationAliasFor:"sidebar"},{name:"stat-card",category:"layout",migrationAliasFor:"statistic"},{name:"sticky-footer-bar",category:"layout",migrationAliasFor:"sidebar"},{name:"smart-card",category:"display",migrationAliasFor:"info-card"},{name:"file-dropzone",category:"upload",migrationAliasFor:"file-upload"},{name:"comparison-card",category:"display",migrationAliasFor:"card"},{name:"delta-badge",category:"display",migrationAliasFor:"badge"},{name:"trend-card",category:"display",migrationAliasFor:"statistic"},{name:"user-card",category:"display",migrationAliasFor:"avatar"},{name:"sheet-shell",category:"overlay",migrationAliasFor:"drawer"},{name:"nav-tabs",category:"navigation",migrationAliasFor:"tabs"},{name:"page-tabs",category:"navigation",migrationAliasFor:"tabs"},{name:"stepper-tabs",category:"navigation",migrationAliasFor:"stepper"},{name:"command-bar",category:"navigation",migrationAliasFor:"command-palette"},{name:"data-list",category:"display",migrationAliasFor:"list"},{name:"property-grid",category:"display",migrationAliasFor:"description-list"},{name:"result",category:"display",migrationAliasFor:"page-state"},{name:"data-table-bulk-actions",category:"data-table",migrationAliasFor:"data-table"},{name:"data-table-column-visibility-menu",category:"data-table",migrationAliasFor:"data-table"},{name:"data-table-pagination",category:"data-table",migrationAliasFor:"data-table"},{name:"data-table-row-actions",category:"data-table",migrationAliasFor:"data-table"},{name:"data-table-saved-filters",category:"data-table",migrationAliasFor:"data-table"},{name:"data-table-select-column",category:"data-table",migrationAliasFor:"data-table"},{name:"data-table-sortable-header",category:"data-table",migrationAliasFor:"data-table"},{name:"data-table-toolbar",category:"data-table",migrationAliasFor:"data-table"},{name:"data-table-view-presets",category:"data-table",migrationAliasFor:"data-table"},{name:"data-state",category:"display",files:[f("src/components/display/data-state.tsx","{components}/display/data-state.tsx")]},{name:"data-table",category:"data-table",dependencies:["@tanstack/react-table","@tanstack/react-virtual","lucide-react"],registryDependencies:["button","checkbox","data-state","dropdown-menu","input","pagination","search-input","select","table","utils"],files:[f("src/components/data-table/data-table.tsx","{components}/data-table/data-table.tsx"),f("src/components/data-table/data-table-actions-column.tsx","{components}/data-table/data-table-actions-column.tsx"),f("src/components/data-table/data-table-bulk-actions.tsx","{components}/data-table/data-table-bulk-actions.tsx"),f("src/components/data-table/data-table-column-visibility-menu.tsx","{components}/data-table/data-table-column-visibility-menu.tsx"),f("src/components/data-table/data-table-pagination.tsx","{components}/data-table/data-table-pagination.tsx"),f("src/components/data-table/data-table-row-actions.tsx","{components}/data-table/data-table-row-actions.tsx"),f("src/components/data-table/data-table-saved-filters.tsx","{components}/data-table/data-table-saved-filters.tsx"),f("src/components/data-table/data-table-select-column.tsx","{components}/data-table/data-table-select-column.tsx"),f("src/components/data-table/data-table-sortable-header.tsx","{components}/data-table/data-table-sortable-header.tsx"),f("src/components/data-table/data-table-toolbar.tsx","{components}/data-table/data-table-toolbar.tsx"),f("src/components/data-table/data-table-view-presets.tsx","{components}/data-table/data-table-view-presets.tsx"),f("src/components/data-table/table-export-menu.tsx","{components}/data-table/table-export-menu.tsx"),f("src/components/data-table/table-import-button.tsx","{components}/data-table/table-import-button.tsx")]},{name:"data-table-actions-column",category:"data-table",migrationAliasFor:"data-table"},{name:"table-export-menu",category:"data-table",migrationAliasFor:"data-table"},{name:"table-import-button",category:"data-table",migrationAliasFor:"data-table"},{name:"description-list",category:"display",files:[f("src/components/display/description-list.tsx","{components}/display/description-list.tsx")]},{name:"divider",category:"ui",files:[f("src/components/ui/divider","{ui}/divider")]},{name:"file-upload",category:"upload",files:[f("src/components/upload/file-upload.tsx","{components}/upload/file-upload.tsx")]},{name:"filter-bar",category:"filters",files:[f("src/components/filters/filter-bar.tsx","{components}/filters/filter-bar.tsx")]},{name:"bulk-action-bar",category:"patterns",registryDependencies:["button","utils"],files:[f("src/components/patterns/bulk-action-bar.tsx","{components}/patterns/bulk-action-bar.tsx")]},{name:"data-view",category:"patterns",registryDependencies:["data-table","empty-state","page-toolbar","utils"],files:[f("src/components/patterns/data-view.tsx","{components}/patterns/data-view.tsx")]},{name:"detail-layout",category:"patterns",registryDependencies:["utils"],files:[f("src/components/patterns/detail-layout.tsx","{components}/patterns/detail-layout.tsx")]},{name:"empty-state",category:"patterns",dependencies:["lucide-react"],registryDependencies:["button","utils"],files:[f("src/components/patterns/empty-state.tsx","{components}/patterns/empty-state.tsx")]},{name:"form-builder",category:"patterns",dependencies:["react-hook-form"],registryDependencies:["button","form-input","form-select","form-textarea","form-switch","form-date-range-input","utils"],files:[f("src/components/patterns/form-builder.tsx","{components}/patterns/form-builder.tsx")]},{name:"horizontal-bar-chart",category:"charts",migrationAliasFor:"data-view"},{name:"image-upload",category:"upload",files:[f("src/components/upload/image-upload.tsx","{components}/upload/image-upload.tsx")]},{name:"kanban",category:"display",dependencies:["@dnd-kit/helpers","@dnd-kit/react","lucide-react"],registryDependencies:["card","utils"],files:[f("src/components/display/kanban.tsx","{components}/display/kanban.tsx")]},{name:"kpi",category:"charts",migrationAliasFor:"statistic"},{name:"list",category:"display",files:[f("src/components/display/list.tsx","{components}/display/list.tsx")]},{name:"otp-input",category:"inputs",files:[f("src/components/inputs/otp-input.tsx","{components}/inputs/otp-input.tsx")]},{name:"color-picker",category:"inputs",registryDependencies:["utils"],files:[f("src/components/inputs/color-picker.tsx","{components}/inputs/color-picker.tsx")]},{name:"signature-pad",category:"inputs",dependencies:["lucide-react"],registryDependencies:["utils"],files:[f("src/components/inputs/signature-pad.tsx","{components}/inputs/signature-pad.tsx")]},{name:"pagination",category:"navigation",files:[f("src/components/navigation/pagination.tsx","{components}/navigation/pagination.tsx")]},{name:"progress",category:"display",files:[f("src/components/display/progress.tsx","{components}/display/progress.tsx")]},{name:"progress-ring",category:"charts",migrationAliasFor:"progress-circle"},{name:"progress-circle",category:"charts",files:[f("src/components/charts/progress-circle.tsx","{components}/charts/progress-circle.tsx"),f("src/components/charts/progress-ring.tsx","{components}/charts/progress-ring.tsx")]},{name:"quick-action-grid",category:"actions",files:[f("src/components/actions/quick-action-grid.tsx","{components}/actions/quick-action-grid.tsx")]},{name:"rating",category:"inputs",files:[f("src/components/inputs/rating.tsx","{components}/inputs/rating.tsx")]},{name:"resource-detail-page",category:"patterns",files:[f("src/components/patterns/resource-detail-page.tsx","{components}/patterns/resource-detail-page.tsx")]},{name:"resource-page",category:"patterns",registryDependencies:["data-table","utils"],files:[f("src/components/patterns/resource-page.tsx","{components}/patterns/resource-page.tsx")]},{name:"page-toolbar",category:"patterns",registryDependencies:["utils"],files:[f("src/components/patterns/page-toolbar.tsx","{components}/patterns/page-toolbar.tsx")]},{name:"settings-page",category:"patterns",registryDependencies:["tabs","utils"],files:[f("src/components/patterns/settings-page.tsx","{components}/patterns/settings-page.tsx")]},{name:"section",category:"layout",files:[f("src/components/layout/section.tsx","{components}/layout/section.tsx")]},{name:"slider",category:"inputs",files:[f("src/components/inputs/slider.tsx","{components}/inputs/slider.tsx")]},{name:"info-card",category:"display",registryDependencies:["card","skeleton","utils"],files:[f("src/components/display/info-card.tsx","{components}/display/info-card.tsx")]},{name:"spinner",category:"ui",files:[f("src/components/ui/spinner","{ui}/spinner")]},{name:"statistic",category:"display",files:[f("src/components/display/statistic.tsx","{components}/display/statistic.tsx")]},{name:"status-dot",category:"display",files:[f("src/components/display/status-dot.tsx","{components}/display/status-dot.tsx")]},{name:"status-legend",category:"display",files:[f("src/components/display/status-legend.tsx","{components}/display/status-legend.tsx")]},{name:"stepper",category:"wizard",files:[f("src/components/wizard/stepper.tsx","{components}/wizard/stepper.tsx")]},{name:"timeline",category:"display",files:[f("src/components/display/timeline.tsx","{components}/display/timeline.tsx")]},{name:"toast",category:"notifications",files:[f("src/components/notifications/toast.tsx","{components}/notifications/toast.tsx")]},{name:"tree-view",category:"display",files:[f("src/components/display/tree-view.tsx","{components}/display/tree-view.tsx")]},{name:"use-before-unload-when-dirty",category:"hooks",files:[f("src/hooks/use-before-unload-when-dirty.ts","{hooks}/use-before-unload-when-dirty.ts")]},{name:"use-data-table-view-state",category:"hooks",files:[f("src/hooks/use-data-table-view-state.ts","{hooks}/use-data-table-view-state.ts")]},{name:"use-debounce",category:"hooks",files:[f("src/hooks/use-debounce.ts","{hooks}/use-debounce.ts")]},{name:"use-disclosure",category:"hooks",files:[f("src/hooks/use-disclosure.ts","{hooks}/use-disclosure.ts")]},{name:"use-is-mobile",category:"hooks",files:[f("src/hooks/use-is-mobile.ts","{hooks}/use-is-mobile.ts")]},{name:"use-session-storage-state",category:"hooks",files:[f("src/hooks/use-session-storage-state.ts","{hooks}/use-session-storage-state.ts")]},{name:"wizard",category:"wizard",files:[f("src/components/wizard/wizard.tsx","{components}/wizard/wizard.tsx")]},{name:"inline-editable",category:"inputs",files:[f("src/components/inputs/inline-editable.tsx","{components}/inputs/inline-editable.tsx")]},{name:"command-palette",category:"command",dependencies:["cmdk","lucide-react"],registryDependencies:["button","dialog","input","kbd","utils"],files:[f("src/components/command/command-palette.tsx","{components}/command/command-palette.tsx")]},{name:"saved-filter-select",category:"filters",files:[f("src/components/filters/saved-filter-select.tsx","{components}/filters/saved-filter-select.tsx")]},{name:"notification-center",category:"notifications",files:[f("src/components/notifications/notification-center.tsx","{components}/notifications/notification-center.tsx")]},{name:"calendar-scheduler",category:"modern",registryDependencies:["utils"],files:[f("src/components/modern/calendar-scheduler.tsx","{components}/modern/calendar-scheduler.tsx")]},{name:"dual-list-picker",category:"modern",registryDependencies:["utils"],files:[f("src/components/modern/dual-list-picker.tsx","{components}/modern/dual-list-picker.tsx")]},{name:"resizable-panel",category:"modern",dependencies:["lucide-react"],registryDependencies:["utils"],files:[f("src/components/modern/resizable-panel.tsx","{components}/modern/resizable-panel.tsx")]},{name:"rich-text-editor",category:"modern",dependencies:["@tiptap/react","@tiptap/pm","@tiptap/starter-kit","@tiptap/extension-link","@tiptap/extension-placeholder","lucide-react"],registryDependencies:["utils"],files:[f("src/components/modern/rich-text-editor.tsx","{components}/modern/rich-text-editor.tsx")]},{name:"image-cropper",category:"modern",dependencies:["react-easy-crop","lucide-react"],registryDependencies:["utils"],files:[f("src/components/modern/image-cropper.tsx","{components}/modern/image-cropper.tsx")]},{name:"qr-code",category:"display",dependencies:["qrcode","@types/qrcode"],registryDependencies:["utils"],files:[f("src/components/display/qr-code.tsx","{components}/display/qr-code.tsx")]},{name:"json-input",category:"inputs",registryDependencies:["utils"],files:[f("src/components/inputs/json-input.tsx","{components}/inputs/json-input.tsx")]},{name:"time-picker",category:"inputs",registryDependencies:["utils"],files:[f("src/components/inputs/time-picker.tsx","{components}/inputs/time-picker.tsx")]},{name:"sortable-list",category:"dnd",dependencies:["@dnd-kit/helpers","@dnd-kit/react","lucide-react"],registryDependencies:["utils"],files:[f("src/components/dnd/sortable-list.tsx","{components}/dnd/sortable-list.tsx")]},{name:"virtual-list",category:"display",dependencies:["@tanstack/react-virtual"],registryDependencies:["utils"],files:[f("src/components/display/virtual-list.tsx","{components}/display/virtual-list.tsx")]}];for(let t of oP)R[t.name]??=t;function Va(){return Object.values(R).filter(t=>t.name!=="all").filter(t=>t.category!=="group"&&t.category!=="lib").filter(t=>!t.migrationAliasFor).filter(t=>(t.files?.length??0)>0).map(t=>t.name)}R.all.registryDependencies=Va();var At=Object.keys(R);var Fn=be(qe());function Ly(t){let e=L__default.default.dirname(url.fileURLToPath(t)),r=L__default.default.resolve(e,"../vendor");if(Fn.default.existsSync(L__default.default.join(r,"src")))return r;let i=[L__default.default.resolve(e,"../.."),L__default.default.resolve(e,".."),process.cwd()];for(let n of i){let o=L__default.default.join(n,"package.json");if(Fn.default.existsSync(o))try{if(Fn.default.readJsonSync(o).name===qy)return n}catch{}}return L__default.default.resolve(e,"../..")}var Pt=be(qe());function aP(t){if(t.paths?.components)return t.paths.components;let e=t.componentsPath??"src/components/ui";return e.endsWith("/ui")||e.endsWith("\\ui")?L__default.default.dirname(e):e}function Wa(t,e){let r=e.replaceAll("\\","/").replace(/\/$/,"");return r==="src"?t:r.startsWith("src/")?`${t}/${r.slice(4)}`:`${t}/${r}`}function cP(t,e){let r=e.alias??"@",i=Wa(r,aP(e)),n=Wa(r,e.paths?.hooks??"src/hooks"),o=Wa(r,e.paths?.lib??L__default.default.dirname(e.utilsPath??"src/lib/utils.ts"));return t.replaceAll("@/components/",`${i}/`).replaceAll("@/hooks/",`${n}/`).replaceAll("@/lib/",`${o}/`).replaceAll("@/",`${r}/`)}async function By({cwd:t,config:e,packageRoot:r,overwrite:i,dryRun:n}){let o=L__default.default.join(r,"templates","showcase","src");if(!Pt.default.existsSync(o))throw new Error(`Showcase template topilmadi: ${L__default.default.relative(t,o)}`);let s=[];async function a(u){let h=await Pt.default.readdir(u,{withFileTypes:true});for(let p of h){let m=L__default.default.join(u,p.name);p.isDirectory()?await a(m):s.push(m);}}await a(o);let c=0,d=0,l=0;for(let u of s){let h=L__default.default.relative(o,u),p=L__default.default.join(t,"src",h),m=L__default.default.relative(t,p),b=Pt.default.existsSync(p);if(n){x.info(`[dry-run:${b?"conflict":"add"}] showcase/${h} -> ${m}`);continue}if(b&&!i){l+=1,x.warn(`${m} allaqachon mavjud. O\u2018tkazib yuborildi. Yangilash uchun --overwrite ishlating.`);continue}await Pt.default.ensureDir(L__default.default.dirname(p));let y=await Pt.default.readFile(u,"utf8");await Pt.default.writeFile(p,cP(y,e)),b?(d+=1,x.success(`${m} yangilandi.`)):(c+=1,x.success(`${m} qo\u2018shildi.`));}return n?x.info("Showcase dry run tugadi. Hech qanday fayl o\u2018zgartirilmadi."):x.success(`Showcase tayyor: ${c} ta qo\u2018shildi, ${d} ta yangilandi, ${l} ta saqlandi.`),{addedFiles:c,overwrittenFiles:d,skippedFiles:l}}function lP(t){return t in R}function dP(t){let e=t.toLowerCase();return At.filter(r=>!R[r].migrationAliasFor).map(r=>{let i=r.toLowerCase(),n=0;i.startsWith(e)&&(n+=40),i.includes(e)&&(n+=25);for(let o of e.split(/[-_\s]+/).filter(Boolean))i.includes(o)&&(n+=8);return {name:r,score:n}}).filter(r=>r.score>0).sort((r,i)=>i.score-r.score||r.name.localeCompare(i.name)).slice(0,5).map(r=>r.name)}function uP(t){let e=new Set,r=t;for(;R[r].migrationAliasFor;){if(e.has(r))throw new Error(`Registry migration alias cycle detected at ${r}`);e.add(r),r=R[r].migrationAliasFor;}return r}function Yy(t){if(t.paths?.components)return t.paths.components;let e=t.componentsPath??"src/components/ui";return e.endsWith("/ui")||e.endsWith("\\ui")?L__default.default.dirname(e):e}function Uy(t,e){let r=Yy(e),i=e.paths?.ui??e.componentsPath??L__default.default.join(r,"ui"),n=e.paths?.hooks??"src/hooks",o=e.paths?.lib??L__default.default.dirname(e.utilsPath??"src/lib/utils.ts"),s=e.utilsPath??L__default.default.join(o,"utils.ts");return t.replaceAll("{components}",r).replaceAll("{ui}",i).replaceAll("{hooks}",n).replaceAll("{lib}",o).replaceAll("{utils}",s)}function hP(t,e="@"){return e==="@"?t:t.replaceAll("@/",`${e}/`)}function zy(t,e){let r=t.replaceAll("\\","/");if(r==="src/lib/utils.ts")return e.utilsPath??"src/lib/utils.ts";if(r.startsWith("src/lib/")){let i=e.paths?.lib??L__default.default.dirname(e.utilsPath??"src/lib/utils.ts");return L__default.default.join(i,r.replace("src/lib/",""))}if(r.startsWith("src/hooks/"))return L__default.default.join(e.paths?.hooks??"src/hooks",r.replace("src/hooks/",""));if(r.startsWith("src/components/ui/")){let i=e.paths?.ui??e.componentsPath??"src/components/ui";return L__default.default.join(i,r.replace("src/components/ui/",""))}if(r.startsWith("src/components/")){let i=Yy(e);return L__default.default.join(i,r.replace("src/components/",""))}}function pP(t,e){if(t==="@/lib/utils")return "src/lib/utils.ts";if(t.startsWith("@/lib/"))return `src/lib/${t.replace("@/lib/","")}`;if(t.startsWith("@/components/"))return `src/components/${t.replace("@/components/","")}`;if(t.startsWith("@/hooks/"))return `src/hooks/${t.replace("@/hooks/","")}`;if(e&&t.startsWith("."))return L__default.default.posix.normalize(L__default.default.posix.join(L__default.default.posix.dirname(e),t))}function Gy(t){return [L__default.default.join(t,"index.tsx").replaceAll("\\","/"),L__default.default.join(t,"index.ts").replaceAll("\\","/"),`${t}.tsx`,`${t}.ts`]}function Vy(t,e){let r=new Set,i=/(?:import|export)\s+(?:type\s+)?(?:[^"']*?\s+from\s+)?["']([^"']+)["']|import\s*\(\s*["']([^"']+)["']\s*\)/g,n;for(;n=i.exec(t);){let o=n[1]??n[2],s=pP(o,e);s&&r.add(s);}return [...r]}var mP=new Set(["react","react-dom","node:path","node:fs","node:fs/promises"]);function Wy(t){let e=new Set,r=/(?:import|export)\s+(?:type\s+)?(?:[^"']*?\s+from\s+)?["']([^"']+)["']|import\s*\(\s*["']([^"']+)["']\s*\)/g,i;for(;i=r.exec(t);){let n=i[1]??i[2];if(!(!n||n.startsWith(".")||n.startsWith("@/")||mP.has(n))){if(n.startsWith("@")){let[o,s]=n.split("/");o&&s&&e.add(`${o}/${s}`);continue}e.add(n.split("/")[0]);}}return [...e]}function fP(t){let e=[],r=new Set;function i(n){if(r.has(n))return;let o=R[n];o.registryDependencies?.forEach(i),r.add(n),e.push(o);}return t.forEach(i),e}function gP(){return At.filter(t=>R[t].category!=="lib"&&!R[t].migrationAliasFor).sort().join(", ")}async function Dt(t,e={}){let r=process.cwd(),i=L__default.default.join(r,"tembro.json");ie.default.existsSync(i)||(x.error("tembro.json topilmadi. Avval init qiling:"),x.info(re("init")),process.exit(1)),t.length||(x.error("Component nomini kiriting:"),x.info(re("add data-table async-select input")),x.info(`Mavjud componentlar: ${gP()}`),process.exit(1));let n=t.includes("showcase")?t.flatMap(O=>O==="showcase"?Va():O):t,o=[];for(let O of n){if(!lP(O)){let q=dP(O);x.warn(`${O} registry ichida mavjud emas.`),q.length&&x.info(`Yaqin nomlar: ${q.join(", ")}`),x.info(`Barcha componentlar: ${re("list")}`);continue}let D=uP(O);D!==O&&x.warn(`${O} deprecated. ${D} ishlatiladi.`),o.includes(D)||o.push(D);}o.length||(x.error("Qo\u2018shish uchun valid component topilmadi."),process.exit(1));let s=await ie.default.readJson(i),a=Ly((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))),c=ki(r),d=fP(o),l=new Set,u=new Set,h=e.overwrite===true?true:void 0,p=0,m=0,b=0,y=t.includes("showcase");async function w(){let O=new Set,D=[];async function q(v,E){let k=v.replaceAll("\\","/");if(O.has(k))return;let B=L__default.default.join(a,k);if(!ie.default.existsSync(B)){D.push({source:k,target:null,exists:false,operation:"unresolved"});return}if((await ie.default.stat(B)).isDirectory()){O.add(k);let V=await ie.default.readdir(B,{withFileTypes:true});for(let I of V){let Xa=L__default.default.posix.join(k,I.name),hw=E?L__default.default.posix.join(E.replaceAll("\\","/"),I.name):void 0;await q(Xa,hw);}return}O.add(k);let G=E?Uy(E,s):zy(k,s),j=await ie.default.readFile(B,"utf8");for(let V of Wy(j))l.add(V);for(let V of Vy(j,k))for(let I of Gy(V))if(ie.default.existsSync(L__default.default.join(a,I))){await q(I);break}if(!G){D.push({source:k,target:null,exists:false,operation:"unresolved"});return}let _=L__default.default.join(r,G),P=ie.default.existsSync(_);D.push({source:k,target:L__default.default.relative(r,_),exists:P,operation:P?e.overwrite?"overwrite":"skip":"add"});}for(let v of d){v.dependencies?.forEach(E=>l.add(E));for(let E of v.files??[])await q(E.source,E.target);}return {components:o,resolvedComponents:d.map(v=>v.name),dependencies:Array.from(l).sort(),files:D}}if(e.plan){let O=await w();console.log(JSON.stringify({...O,showcase:y},null,2));return}x.info(`Resolved: ${d.map(O=>O.name).join(", ")}`);async function S(O){return h!==void 0?h:!(process.stdin.isTTY&&process.stdout.isTTY&&!process.env.CI)?(h=false,x.warn("Mavjud fayllar o\u2018zgartirilmadi. Majburiy yozish uchun --overwrite ishlating."),false):(h=(await(0, Hy.default)({type:"confirm",name:"overwrite",message:`${O} allaqachon mavjud. Barcha conflict fayllarni overwrite qilasizmi?`,initial:false})).overwrite===true,h||x.info("Mavjud fayllar saqlanadi; faqat yetishmayotgan fayllar qo\u2018shiladi."),h)}async function C(O,D){let q=O.replaceAll("\\","/");if(u.has(q))return;let v=L__default.default.join(a,q);if(!ie.default.existsSync(v)){x.warn(`${q} topilmadi. O\u2018tkazib yuborildi.`);return}if((await ie.default.stat(v)).isDirectory()){u.add(q);let _=await ie.default.readdir(v,{withFileTypes:true});for(let P of _){let V=L__default.default.posix.join(q,P.name),I=D?L__default.default.posix.join(D.replaceAll("\\","/"),P.name):void 0;await C(V,I);}return}u.add(q);let k=D?Uy(D,s):zy(q,s);if(!k)return;let B=L__default.default.join(r,k),W=L__default.default.relative(r,B),G=ie.default.existsSync(B);if(e.dryRun){let _=G?"conflict":"add";x.info(`[dry-run:${_}] ${q} -> ${W}`);}else if(G&&!await S(W))b+=1,x.warn(`${W} allaqachon mavjud. O\u2018tkazib yuborildi.`);else {await ie.default.ensureDir(L__default.default.dirname(B));let _=await ie.default.readFile(v,"utf8");await ie.default.writeFile(B,hP(_,s.alias)),G?(m+=1,x.success(`${W} yangilandi.`)):(p+=1,x.success(`${W} qo\u2018shildi.`));}let j=await ie.default.readFile(v,"utf8");for(let _ of Wy(j))l.add(_);for(let _ of Vy(j,q))for(let P of Gy(_))if(ie.default.existsSync(L__default.default.join(a,P))){await C(P);break}}for(let O of d){O.dependencies?.forEach(D=>l.add(D));for(let D of O.files??[])await C(D.source,D.target);}let M=p+m;y&&await By({cwd:r,config:s,packageRoot:a,overwrite:e.overwrite,dryRun:e.dryRun});let Z=Array.from(l).sort();e.dryRun&&Z.length&&x.info(`[dry-run:dependencies] ${Z.join(", ")}`),!e.skipInstall&&l.size>0&&!e.dryRun&&M>0?await Gr({cwd:r,packageManager:c,packages:Z}):e.skipInstall&&Z.length&&M>0&&x.warn(`Dependency install skipped: ${Z.join(", ")}`),e.dryRun?x.info("Dry run tugadi. Hech qanday fayl o\u2018zgartirilmadi."):M===0?x.warn(`O\u2018zgarish yo\u2018q. ${b} ta mavjud fayl saqlandi.`):x.success(`Tayyor: ${p} ta qo\u2018shildi, ${m} ta yangilandi, ${b} ta saqlandi.`);}var bP=["@fontsource-variable/geist","clsx","tailwind-merge","tw-animate-css"],yP={vite:["tailwindcss","@tailwindcss/vite"],next:["tailwindcss","@tailwindcss/postcss"]},wP=`// Generated by tembro init.
1967
1967
  // Components added with the CLI will appear under this folder.
1968
- `;function tD(t){try{return JSON.parse(t)}catch{}let i=t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/^\s*\/\/.*$/gm,"").replace(/,\s*([}\]])/g,"$1");return JSON.parse(i)}function rD(t,e,r,i){let n=[e,r,i].map(s=>s.replaceAll("\\","/"));return n.filter(s=>s.startsWith("src/")).length===n.length?"./src/*":"./*"}async function iD({cwd:t,template:e,alias:r,componentsPath:i,hooksPath:n,utilsPath:o}){let s=L__default.default.join(t,e==="vite"?"tsconfig.app.json":"tsconfig.json");if(!U.default.existsSync(s))return;let a=tD(await U.default.readFile(s,"utf8"));a.compilerOptions??={};let c=a.compilerOptions.paths??{};c[`${r}/*`]=[rD(e,i,n,o)],a.compilerOptions.paths=c,await U.default.writeJson(s,a,{spaces:2});}async function nD({cwd:t,alias:e}){let r=L__default.default.join(t,"vite.config.ts");if(!U.default.existsSync(r))return;let i=await U.default.readFile(r,"utf8"),n="import path from 'node:path'",o="import tailwindcss from '@tailwindcss/vite'",s=` resolve: {
1968
+ `;function vP(t){try{return JSON.parse(t)}catch{}let i=t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/^\s*\/\/.*$/gm,"").replace(/,\s*([}\]])/g,"$1");return JSON.parse(i)}function xP(t,e,r,i){let n=[e,r,i].map(s=>s.replaceAll("\\","/"));return n.filter(s=>s.startsWith("src/")).length===n.length?"./src/*":"./*"}async function SP({cwd:t,template:e,alias:r,componentsPath:i,hooksPath:n,utilsPath:o}){let s=L__default.default.join(t,e==="vite"?"tsconfig.app.json":"tsconfig.json");if(!z.default.existsSync(s))return;let a=vP(await z.default.readFile(s,"utf8"));a.compilerOptions??={};let c=a.compilerOptions.paths??{};c[`${r}/*`]=[xP(e,i,n,o)],a.compilerOptions.paths=c,await z.default.writeJson(s,a,{spaces:2});}async function kP({cwd:t,alias:e}){let r=L__default.default.join(t,"vite.config.ts");if(!z.default.existsSync(r))return;let i=await z.default.readFile(r,"utf8"),n="import path from 'node:path'",o="import tailwindcss from '@tailwindcss/vite'",s=` resolve: {
1969
1969
  alias: {
1970
1970
  '${e}': path.resolve(process.cwd(), 'src'),
1971
1971
  },
1972
1972
  },`,a=` '${e}': path.resolve(process.cwd(), 'src'),`,c=i;if(/import\s+path\s+from\s+["']node:path["']/.test(c)||(c=`${n}
1973
1973
  ${c}`),/from\s+["']@tailwindcss\/vite["']/.test(c)||(c=`${o}
1974
1974
  ${c}`),/plugins\s*:\s*\[[\s\S]*?tailwindcss\s*\(/.test(c)||(/plugins\s*:\s*\[/.test(c)?c=c.replace(/plugins\s*:\s*\[/,d=>`${d}tailwindcss(), `):c.includes("export default defineConfig({")&&(c=c.replace("export default defineConfig({",`export default defineConfig({
1975
- plugins: [tailwindcss()],`))),c.includes(`'${e}': path.resolve(process.cwd(), 'src')`)||c.includes(`"${e}": path.resolve(process.cwd(), "src")`)){c!==i&&await U.default.writeFile(r,c);return}/alias\s*:\s*\{/.test(c)?c=c.replace(/alias\s*:\s*\{/,d=>`${d}
1975
+ plugins: [tailwindcss()],`))),c.includes(`'${e}': path.resolve(process.cwd(), 'src')`)||c.includes(`"${e}": path.resolve(process.cwd(), "src")`)){c!==i&&await z.default.writeFile(r,c);return}/alias\s*:\s*\{/.test(c)?c=c.replace(/alias\s*:\s*\{/,d=>`${d}
1976
1976
  ${a}`):/resolve\s*:\s*\{/.test(c)?c=c.replace(/resolve\s*:\s*\{/,d=>`${d}
1977
1977
  alias: {
1978
1978
  ${a}
1979
1979
  },`):c.includes("export default defineConfig({")?c=c.replace("export default defineConfig({",`export default defineConfig({
1980
- ${s}`):S.warn("vite.config.ts ichida defineConfig topilmadi; alias faqat tsconfigga yozildi."),c!==i&&await U.default.writeFile(r,c);}var oD={vite:{alias:"@",componentsPath:"src/components",uiPath:"src/components/ui",hooksPath:"src/hooks",utilsPath:"src/lib/utils.ts",globalCssPath:"src/index.css"},next:{alias:"@",componentsPath:"components",uiPath:"components/ui",hooksPath:"hooks",utilsPath:"lib/utils.ts",globalCssPath:"app/globals.css"}};function sD(t,e){let r=oD[e];return e!=="next"||!U.default.existsSync(L__default.default.join(t,"src","app"))?r:{...r,componentsPath:"src/components",uiPath:"src/components/ui",hooksPath:"src/hooks",utilsPath:"src/lib/utils.ts",globalCssPath:U.default.existsSync(L__default.default.join(t,"src","app","globals.css"))?"src/app/globals.css":r.globalCssPath}}function aD(t,e){return e?{...t,alias:e.alias??t.alias,componentsPath:e.paths?.components??e.componentsPath??t.componentsPath,uiPath:e.paths?.ui??t.uiPath,hooksPath:e.paths?.hooks??t.hooksPath,utilsPath:e.utilsPath??t.utilsPath,globalCssPath:e.globalCssPath??e.cssPath??t.globalCssPath}:t}function cD(t,e,r){if(L__default.default.isAbsolute(e))throw new Error(`${r} project ichidagi relative path bo\u2018lishi kerak: ${e}`);let i=L__default.default.resolve(t,e),n=L__default.default.relative(t,i);if(n.startsWith("..")||L__default.default.isAbsolute(n))throw new Error(`${r} project tashqarisiga chiqmasligi kerak: ${e}`)}function lD(t,e){let r=U.default.readJsonSync(e),i={...r.dependencies,...r.devDependencies},n=["next.config.js","next.config.mjs","next.config.ts"].some(s=>U.default.existsSync(L__default.default.join(t,s)));["vite.config.js","vite.config.mjs","vite.config.ts"].some(s=>U.default.existsSync(L__default.default.join(t,s)));return i.next||n?"next":("vite")}function dD(t,e,r){if(t==="next"||t==="vite")return t;let i=lD(e,r);return t&&S.warn(`Unknown template '${t}'. Falling back to ${i} defaults.`),i}function uD(t){let e=L__default.default.join(t,"package.json"),r=U.default.readJsonSync(e);return new Set([...Object.keys(r.dependencies??{}),...Object.keys(r.devDependencies??{})])}async function Fy(t={}){let e=process.cwd(),r=L__default.default.join(e,"package.json");U.default.existsSync(r)||(S.error("package.json topilmadi / not found. Commandni React, Vite yoki Next project ichida ishlating."),process.exit(1));let i=dD(t.template,e,r);S.info(`Template: ${i}${t.template?"":" (detected)"}`);let n=L__default.default.join(e,"tembro.json"),o=U.default.existsSync(n)?await U.default.readJson(n):void 0,s=aD(sD(e,i),o),a=uD(e),c=Q_[i].filter(_=>!a.has(_)),d=t.defaults?{installDeps:!t.skipInstall,installTailwindDeps:c.length>0,alias:s.alias,componentsPath:s.componentsPath,uiPath:s.uiPath,hooksPath:s.hooksPath,utilsPath:s.utilsPath,globalCssPath:s.globalCssPath,writeThemeCss:true}:await(0, My.default)([{type:"confirm",name:"installDeps",message:"Theme va local source uchun minimal dependencylarni o\u2018rnataymi? / Install minimal theme dependencies?",initial:!t.skipInstall},{type:c.length>0?"confirm":null,name:"installTailwindDeps",message:`Tailwind paketlari topilmadi (${c.join(", ")}). O\u2018rnataymi? / Install Tailwind packages?`,initial:true},{type:"text",name:"alias",message:"Path alias qanday? / Path alias?",initial:s.alias},{type:"text",name:"componentsPath",message:"Component root qayerda? / Component root?",initial:s.componentsPath},{type:"text",name:"uiPath",message:"UI primitives qayerga yozilsin? / UI primitives path?",initial:s.uiPath},{type:"text",name:"hooksPath",message:"Hooks qayerga yozilsin? / Hooks path?",initial:s.hooksPath},{type:"text",name:"utilsPath",message:"utils.ts qayerga yozilsin? / utils.ts path?",initial:s.utilsPath},{type:"text",name:"globalCssPath",message:"Theme tokenlar qaysi global CSS faylga yozilsin? / Global CSS path?",initial:s.globalCssPath},{type:"confirm",name:"writeThemeCss",message:"Dark/light theme tokenlarni global CSS faylga yozaymi? / Write theme tokens?",initial:true}]),l=vi(e);S.info(`Package manager: ${l}`),!t.skipInstall&&d.installDeps&&await Br({cwd:e,packageManager:l,packages:Z_}),!t.skipInstall&&c.length>0&&d.installTailwindDeps&&await Br({cwd:e,packageManager:l,packages:c,dev:true});let u=d.utilsPath||s.utilsPath,h=d.componentsPath||s.componentsPath,p=d.uiPath||s.uiPath,f=d.hooksPath||s.hooksPath,b=d.globalCssPath||s.globalCssPath;for(let[_,z]of [["componentsPath",h],["uiPath",p],["hooksPath",f],["utilsPath",u],["globalCssPath",b]])cD(e,z,_);let v={style:o?.style??"default",alias:d.alias||s.alias,componentsPath:h,utilsPath:u,cssPath:b,globalCssPath:b,paths:{components:h,ui:p,hooks:f,lib:L__default.default.dirname(u)}};await U.default.writeJson(L__default.default.join(e,"tembro.json"),v,{spaces:2});let y=L__default.default.join(e,u),x=L__default.default.join(e,h),k=L__default.default.join(e,p),C=L__default.default.join(e,f);await U.default.ensureDir(L__default.default.dirname(y)),await U.default.ensureDir(x),await U.default.ensureDir(k),await U.default.ensureDir(C);let D=[L__default.default.join(x,"index.ts"),L__default.default.join(k,"index.ts"),L__default.default.join(C,"index.ts")];for(let _ of D)U.default.existsSync(_)||await U.default.writeFile(_,eD);if(U.default.existsSync(y)||await U.default.writeFile(y,`import { clsx, type ClassValue } from "clsx"
1980
+ ${s}`):x.warn("vite.config.ts ichida defineConfig topilmadi; alias faqat tsconfigga yozildi."),c!==i&&await z.default.writeFile(r,c);}var CP={vite:{alias:"@",componentsPath:"src/components",uiPath:"src/components/ui",hooksPath:"src/hooks",utilsPath:"src/lib/utils.ts",globalCssPath:"src/index.css"},next:{alias:"@",componentsPath:"components",uiPath:"components/ui",hooksPath:"hooks",utilsPath:"lib/utils.ts",globalCssPath:"app/globals.css"}};function OP(t,e){let r=CP[e];return e!=="next"||!z.default.existsSync(L__default.default.join(t,"src","app"))?r:{...r,componentsPath:"src/components",uiPath:"src/components/ui",hooksPath:"src/hooks",utilsPath:"src/lib/utils.ts",globalCssPath:z.default.existsSync(L__default.default.join(t,"src","app","globals.css"))?"src/app/globals.css":r.globalCssPath}}function EP(t,e){return e?{...t,alias:e.alias??t.alias,componentsPath:e.paths?.components??e.componentsPath??t.componentsPath,uiPath:e.paths?.ui??t.uiPath,hooksPath:e.paths?.hooks??t.hooksPath,utilsPath:e.utilsPath??t.utilsPath,globalCssPath:e.globalCssPath??e.cssPath??t.globalCssPath}:t}function TP(t,e,r){if(L__default.default.isAbsolute(e))throw new Error(`${r} project ichidagi relative path bo\u2018lishi kerak: ${e}`);let i=L__default.default.resolve(t,e),n=L__default.default.relative(t,i);if(n.startsWith("..")||L__default.default.isAbsolute(n))throw new Error(`${r} project tashqarisiga chiqmasligi kerak: ${e}`)}function AP(t,e){let r=z.default.readJsonSync(e),i={...r.dependencies,...r.devDependencies},n=["next.config.js","next.config.mjs","next.config.ts"].some(s=>z.default.existsSync(L__default.default.join(t,s)));["vite.config.js","vite.config.mjs","vite.config.ts"].some(s=>z.default.existsSync(L__default.default.join(t,s)));return i.next||n?"next":("vite")}function _P(t,e,r){if(t==="next"||t==="vite")return t;let i=AP(e,r);return t&&x.warn(`Unknown template '${t}'. Falling back to ${i} defaults.`),i}function PP(t){let e=L__default.default.join(t,"package.json"),r=z.default.readJsonSync(e);return new Set([...Object.keys(r.dependencies??{}),...Object.keys(r.devDependencies??{})])}async function Ky(t={}){let e=process.cwd(),r=L__default.default.join(e,"package.json");z.default.existsSync(r)||(x.error("package.json topilmadi / not found. Commandni React, Vite yoki Next project ichida ishlating."),process.exit(1));let i=_P(t.template,e,r);x.info(`Template: ${i}${t.template?"":" (detected)"}`);let n=L__default.default.join(e,"tembro.json"),o=z.default.existsSync(n)?await z.default.readJson(n):void 0,s=EP(OP(e,i),o),a=PP(e),c=yP[i].filter(O=>!a.has(O)),d=t.defaults?{installDeps:!t.skipInstall,installTailwindDeps:c.length>0,alias:s.alias,componentsPath:s.componentsPath,uiPath:s.uiPath,hooksPath:s.hooksPath,utilsPath:s.utilsPath,globalCssPath:s.globalCssPath,writeThemeCss:true}:await(0, Jy.default)([{type:"confirm",name:"installDeps",message:"Theme va local source uchun minimal dependencylarni o\u2018rnataymi? / Install minimal theme dependencies?",initial:!t.skipInstall},{type:c.length>0?"confirm":null,name:"installTailwindDeps",message:`Tailwind paketlari topilmadi (${c.join(", ")}). O\u2018rnataymi? / Install Tailwind packages?`,initial:true},{type:"text",name:"alias",message:"Path alias qanday? / Path alias?",initial:s.alias},{type:"text",name:"componentsPath",message:"Component root qayerda? / Component root?",initial:s.componentsPath},{type:"text",name:"uiPath",message:"UI primitives qayerga yozilsin? / UI primitives path?",initial:s.uiPath},{type:"text",name:"hooksPath",message:"Hooks qayerga yozilsin? / Hooks path?",initial:s.hooksPath},{type:"text",name:"utilsPath",message:"utils.ts qayerga yozilsin? / utils.ts path?",initial:s.utilsPath},{type:"text",name:"globalCssPath",message:"Theme tokenlar qaysi global CSS faylga yozilsin? / Global CSS path?",initial:s.globalCssPath},{type:"confirm",name:"writeThemeCss",message:"Dark/light theme tokenlarni global CSS faylga yozaymi? / Write theme tokens?",initial:true}]),l=ki(e);x.info(`Package manager: ${l}`),!t.skipInstall&&d.installDeps&&await Gr({cwd:e,packageManager:l,packages:bP}),!t.skipInstall&&c.length>0&&d.installTailwindDeps&&await Gr({cwd:e,packageManager:l,packages:c,dev:true});let u=d.utilsPath||s.utilsPath,h=d.componentsPath||s.componentsPath,p=d.uiPath||s.uiPath,m=d.hooksPath||s.hooksPath,b=d.globalCssPath||s.globalCssPath;for(let[O,D]of [["componentsPath",h],["uiPath",p],["hooksPath",m],["utilsPath",u],["globalCssPath",b]])TP(e,D,O);let y={style:o?.style??"default",alias:d.alias||s.alias,componentsPath:h,utilsPath:u,cssPath:b,globalCssPath:b,paths:{components:h,ui:p,hooks:m,lib:L__default.default.dirname(u)}};await z.default.writeJson(L__default.default.join(e,"tembro.json"),y,{spaces:2});let w=L__default.default.join(e,u),S=L__default.default.join(e,h),C=L__default.default.join(e,p),M=L__default.default.join(e,m);await z.default.ensureDir(L__default.default.dirname(w)),await z.default.ensureDir(S),await z.default.ensureDir(C),await z.default.ensureDir(M);let Z=[L__default.default.join(S,"index.ts"),L__default.default.join(C,"index.ts"),L__default.default.join(M,"index.ts")];for(let O of Z)z.default.existsSync(O)||await z.default.writeFile(O,wP);if(z.default.existsSync(w)||await z.default.writeFile(w,`import { clsx, type ClassValue } from "clsx"
1981
1981
  import { twMerge } from "tailwind-merge"
1982
1982
 
1983
1983
  export function cn(...inputs: ClassValue[]) {
1984
1984
  return twMerge(clsx(inputs))
1985
1985
  }
1986
- `),await iD({cwd:e,template:i,alias:v.alias,componentsPath:h,hooksPath:f,utilsPath:u}),i==="vite"&&await nD({cwd:e,alias:v.alias}),d.writeThemeCss&&b){let _=await In({cwd:e,cssPath:b,componentsPath:h});S.success(`Theme CSS yozildi / written: ${_}`);}S.success("Tembro source-copy setup tayyor / initialized."),S.info(`Component source root: ${h}`),S.info(`UI primitives path: ${p}`),S.info(`Hooks path: ${f}`),S.info("Componentlarni ko\u2018rish / list components:"),S.info(ne("list")),S.info("Component qo\u2018shish / add components:"),S.info(ne("add button input")),c.length>0&&!d.installTailwindDeps&&S.warn(`Tailwind paketlari hali o\u2018rnatilmadi: ${c.join(", ")}`),S.info("Theme CSS ni yangilash / update theme CSS:"),S.info(ne("theme"));}var re=Ce(it()),zy=Ce(ds());var m=(t,e)=>({source:t,target:e}),N={utils:{name:"utils",category:"lib",dependencies:["clsx","tailwind-merge"],files:[m("src/lib/utils.ts","{utils}")]},button:{name:"button",category:"ui",dependencies:["@base-ui/react","class-variance-authority"],registryDependencies:["utils"],files:[m("src/components/ui/button","{ui}/button")]},input:{name:"input",category:"ui",dependencies:["@base-ui/react","lucide-react"],registryDependencies:["utils"],files:[m("src/components/ui/input","{ui}/input")]},textarea:{name:"textarea",category:"ui",registryDependencies:["utils"],files:[m("src/components/ui/textarea","{ui}/textarea")]},checkbox:{name:"checkbox",category:"ui",dependencies:["lucide-react"],registryDependencies:["utils"],files:[m("src/components/ui/checkbox","{ui}/checkbox")]},switch:{name:"switch",category:"ui",registryDependencies:["utils"],files:[m("src/components/ui/switch","{ui}/switch")]},badge:{name:"badge",category:"ui",dependencies:["@base-ui/react","class-variance-authority"],registryDependencies:["utils"],files:[m("src/components/ui/badge","{ui}/badge")]},card:{name:"card",category:"ui",dependencies:["class-variance-authority"],registryDependencies:["utils"],files:[m("src/components/ui/card","{ui}/card")]},skeleton:{name:"skeleton",category:"ui",registryDependencies:["utils"],files:[m("src/components/ui/skeleton","{ui}/skeleton")]},tabs:{name:"tabs",category:"ui",dependencies:["@base-ui/react"],registryDependencies:["utils"],files:[m("src/components/ui/tabs","{ui}/tabs")]},dialog:{name:"dialog",category:"ui",dependencies:["@base-ui/react","lucide-react"],registryDependencies:["button","utils"],files:[m("src/components/ui/dialog","{ui}/dialog")]},"dropdown-menu":{name:"dropdown-menu",category:"ui",dependencies:["@base-ui/react","lucide-react"],registryDependencies:["utils"],files:[m("src/components/ui/dropdown-menu","{ui}/dropdown-menu")]},popover:{name:"popover",category:"ui",dependencies:["@base-ui/react"],registryDependencies:["utils"],files:[m("src/components/ui/popover","{ui}/popover")]},tooltip:{name:"tooltip",category:"ui",registryDependencies:["utils"],files:[m("src/components/ui/tooltip","{ui}/tooltip")]},"hover-card":{name:"hover-card",category:"ui",migrationAliasFor:"popover"},"simple-select":{name:"simple-select",category:"ui",migrationAliasFor:"select"},combobox:{name:"combobox",category:"ui",migrationAliasFor:"select"},select:{name:"select",category:"ui",dependencies:["@base-ui/react","lucide-react"],registryDependencies:["utils"],files:[m("src/components/ui/select","{ui}/select")]},table:{name:"table",category:"ui",registryDependencies:["utils"],files:[m("src/components/ui/table","{ui}/table")]},"segmented-control":{name:"segmented-control",category:"ui",registryDependencies:["utils"],files:[m("src/components/ui/segmented-control","{ui}/segmented-control")]},"radio-group":{name:"radio-group",category:"ui",registryDependencies:["button","utils"],files:[m("src/components/ui/radio-group","{ui}/radio-group")]},accordion:{name:"accordion",category:"ui",dependencies:["lucide-react"],registryDependencies:["collapse"],files:[m("src/components/ui/accordion","{ui}/accordion")]},kbd:{name:"kbd",category:"ui",files:[m("src/components/ui/kbd","{ui}/kbd")]},"scroll-box":{name:"scroll-box",category:"ui",files:[m("src/components/ui/scroll-box","{ui}/scroll-box")]},"right-click-menu":{name:"right-click-menu",category:"ui",dependencies:["react"],files:[m("src/components/ui/right-click-menu","{ui}/right-click-menu")]},"tag-input":{name:"tag-input",category:"inputs",dependencies:["lucide-react"],registryDependencies:["badge","input","utils"],files:[m("src/components/inputs/tag-input.tsx","{components}/inputs/tag-input.tsx")]},"async-select":{name:"async-select",category:"inputs",dependencies:["lucide-react"],registryDependencies:["button","input","popover","utils"],files:[m("src/components/inputs/async-select.tsx","{components}/inputs/async-select.tsx")]},"form-field-shell":{name:"form-field-shell",category:"form",registryDependencies:["utils"],files:[m("src/components/form/form-field-shell.tsx","{components}/form/form-field-shell.tsx")]},"form-input":{name:"form-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["input","form-field-shell"],files:[m("src/components/form/form-input.tsx","{components}/form/form-input.tsx")]},"form-select":{name:"form-select",category:"form",dependencies:["react-hook-form"],registryDependencies:["select","async-select","form-field-shell"],files:[m("src/components/form/form-select.tsx","{components}/form/form-select.tsx")]},"form-textarea":{name:"form-textarea",category:"form",dependencies:["react-hook-form"],registryDependencies:["textarea","form-field-shell"],files:[m("src/components/form/form-textarea.tsx","{components}/form/form-textarea.tsx")]},"form-switch":{name:"form-switch",category:"form",dependencies:["react-hook-form"],registryDependencies:["switch","form-field-shell","utils"],files:[m("src/components/form/form-switch.tsx","{components}/form/form-switch.tsx")]},"form-date-range-input":{name:"form-date-range-input",category:"form",dependencies:["react-hook-form"],registryDependencies:["input","form-field-shell"],files:[m("src/components/form/form-date-range-input.tsx","{components}/form/form-date-range-input.tsx")]},"form-date-picker":{name:"form-date-picker",category:"form",dependencies:["react-hook-form"],registryDependencies:["date-picker","form-field-shell"],files:[m("src/components/form/form-date-picker.tsx","{components}/form/form-date-picker.tsx")]},"form-date-range-picker":{name:"form-date-range-picker",category:"form",dependencies:["react-hook-form"],registryDependencies:["date-range-picker","form-field-shell"],files:[m("src/components/form/form-date-range-picker.tsx","{components}/form/form-date-range-picker.tsx")]},form:{name:"form",category:"group",registryDependencies:["form-field-shell","form-input","form-select","form-textarea","form-switch","form-date-range-input","form-date-picker","form-date-range-picker"],files:[m("src/components/form/index.ts","{components}/form/index.ts")]},"dialog-actions":{name:"dialog-actions",category:"overlay",migrationAliasFor:"dialog"},"modal-shell":{name:"modal-shell",category:"overlay",migrationAliasFor:"dialog"},"confirm-dialog":{name:"confirm-dialog",category:"overlay",registryDependencies:["button","dialog"],files:[m("src/components/overlay/confirm-dialog.tsx","{components}/overlay/confirm-dialog.tsx")]},"alert-dialog":{name:"alert-dialog",category:"overlay",dependencies:["lucide-react"],registryDependencies:["dialog","button"],files:[m("src/components/overlay/alert-dialog.tsx","{components}/overlay/alert-dialog.tsx")]},drawer:{name:"drawer",category:"overlay",dependencies:["@base-ui/react"],registryDependencies:["dialog"],files:[m("src/components/overlay/drawer.tsx","{components}/overlay/drawer.tsx")]},"loading-state":{name:"loading-state",category:"feedback",dependencies:["lucide-react"],registryDependencies:["utils"],files:[m("src/components/feedback/loading-state.tsx","{components}/feedback/loading-state.tsx")]},"page-state":{name:"page-state",category:"feedback",registryDependencies:["button","utils"],files:[m("src/components/feedback/page-state.tsx","{components}/feedback/page-state.tsx")]},feedback:{name:"feedback",category:"group",registryDependencies:["alert","loading-state","page-state","data-state"],files:[m("src/components/feedback/index.ts","{components}/feedback/index.ts")]},sidebar:{name:"sidebar",category:"layout",dependencies:["react"],registryDependencies:["tooltip","utils"],files:[m("src/components/layout/app-sidebar.tsx","{components}/layout/app-sidebar.tsx")]},layout:{name:"layout",category:"group",registryDependencies:["sidebar","breadcrumbs","section"],files:[m("src/components/layout/index.ts","{components}/layout/index.ts")]},calendar:{name:"calendar",category:"calendar",dependencies:["lucide-react"],registryDependencies:["button","utils"],files:[m("src/components/calendar/calendar.tsx","{components}/calendar/calendar.tsx"),m("src/components/calendar/date-utils.ts","{components}/calendar/date-utils.ts")]},"date-picker":{name:"date-picker",category:"calendar",dependencies:["lucide-react"],registryDependencies:["calendar","button","popover","utils"],files:[m("src/components/calendar/date-picker.tsx","{components}/calendar/date-picker.tsx")]},"date-range-picker":{name:"date-range-picker",category:"calendar",dependencies:["lucide-react"],registryDependencies:["calendar","button","popover","utils"],files:[m("src/components/calendar/date-range-picker.tsx","{components}/calendar/date-range-picker.tsx")]},dashboard:{name:"dashboard",category:"group",registryDependencies:["layout","feedback","input","async-select","tag-input","form"]},"calendar-kit":{name:"calendar-kit",category:"group",registryDependencies:["calendar","date-picker","date-range-picker"]},"wizard-kit":{name:"wizard-kit",category:"group",registryDependencies:["stepper","wizard"]},dnd:{name:"dnd",category:"group",registryDependencies:["sortable-list"],files:[m("src/components/dnd/index.ts","{components}/dnd/index.ts")]},all:{name:"all",category:"group",registryDependencies:["dashboard"]}},hD=[{name:"action-menu",category:"actions",files:[m("src/components/actions/action-menu.tsx","{components}/actions/action-menu.tsx")]},{name:"activity-feed",category:"display",files:[m("src/components/display/activity-feed.tsx","{components}/display/activity-feed.tsx")]},{name:"alert",category:"feedback",files:[m("src/components/feedback/alert.tsx","{components}/feedback/alert.tsx")]},{name:"app-header",category:"layout",migrationAliasFor:"sidebar"},{name:"avatar",category:"display",files:[m("src/components/display/avatar.tsx","{components}/display/avatar.tsx")]},{name:"breadcrumbs",category:"layout",files:[m("src/components/layout/breadcrumbs.tsx","{components}/layout/breadcrumbs.tsx")]},{name:"button-group",category:"actions",files:[m("src/components/actions/button-group.tsx","{components}/actions/button-group.tsx")]},{name:"code-block",category:"display",files:[m("src/components/display/code-block.tsx","{components}/display/code-block.tsx")]},{name:"collapse",category:"ui",files:[m("src/components/ui/collapse","{ui}/collapse")]},{name:"carousel",category:"display",files:[m("src/components/display/carousel.tsx","{components}/display/carousel.tsx")]},{name:"tag",category:"display",registryDependencies:["utils"],files:[m("src/components/display/tag.tsx","{components}/display/tag.tsx")]},{name:"typography",category:"display",registryDependencies:["utils"],files:[m("src/components/display/typography.tsx","{components}/display/typography.tsx")]},{name:"command",category:"ui",files:[m("src/components/ui/command","{ui}/command")]},{name:"copy-button",category:"actions",files:[m("src/components/actions/copy-button.tsx","{components}/actions/copy-button.tsx")]},{name:"copy-field",category:"actions",migrationAliasFor:"copy-button"},{name:"clearable-input",category:"inputs",migrationAliasFor:"input"},{name:"search-input",category:"inputs",migrationAliasFor:"input"},{name:"password-input",category:"inputs",migrationAliasFor:"input"},{name:"number-input",category:"inputs",migrationAliasFor:"input"},{name:"money-input",category:"inputs",migrationAliasFor:"input"},{name:"phone-input",category:"inputs",migrationAliasFor:"input"},{name:"masked-input",category:"inputs",migrationAliasFor:"input"},{name:"quantity-input",category:"inputs",migrationAliasFor:"input"},{name:"date-input",category:"inputs",migrationAliasFor:"input"},{name:"date-range-input",category:"inputs",migrationAliasFor:"input"},{name:"form-async-select",category:"form",migrationAliasFor:"form-select"},{name:"input-decorator",category:"inputs",migrationAliasFor:"input"},{name:"input-value",category:"inputs",migrationAliasFor:"input"},{name:"inputs",category:"group",migrationAliasFor:"input"},{name:"app-sidebar",category:"layout",migrationAliasFor:"sidebar"},{name:"page-header",category:"layout",migrationAliasFor:"section"},{name:"page-container",category:"layout",migrationAliasFor:"sidebar"},{name:"section-header",category:"layout",migrationAliasFor:"section"},{name:"sidebar-nav",category:"layout",migrationAliasFor:"sidebar"},{name:"stat-card",category:"layout",migrationAliasFor:"statistic"},{name:"sticky-footer-bar",category:"layout",migrationAliasFor:"sidebar"},{name:"smart-card",category:"display",migrationAliasFor:"info-card"},{name:"file-dropzone",category:"upload",migrationAliasFor:"file-upload"},{name:"comparison-card",category:"display",migrationAliasFor:"card"},{name:"delta-badge",category:"display",migrationAliasFor:"badge"},{name:"trend-card",category:"display",migrationAliasFor:"statistic"},{name:"user-card",category:"display",migrationAliasFor:"avatar"},{name:"sheet-shell",category:"overlay",migrationAliasFor:"drawer"},{name:"nav-tabs",category:"navigation",migrationAliasFor:"tabs"},{name:"page-tabs",category:"navigation",migrationAliasFor:"tabs"},{name:"stepper-tabs",category:"navigation",migrationAliasFor:"stepper"},{name:"command-bar",category:"navigation",migrationAliasFor:"command-palette"},{name:"data-list",category:"display",migrationAliasFor:"list"},{name:"property-grid",category:"display",migrationAliasFor:"description-list"},{name:"result",category:"display",migrationAliasFor:"page-state"},{name:"data-table-bulk-actions",category:"data-table",migrationAliasFor:"data-table"},{name:"data-table-column-visibility-menu",category:"data-table",migrationAliasFor:"data-table"},{name:"data-table-pagination",category:"data-table",migrationAliasFor:"data-table"},{name:"data-table-row-actions",category:"data-table",migrationAliasFor:"data-table"},{name:"data-table-saved-filters",category:"data-table",migrationAliasFor:"data-table"},{name:"data-table-select-column",category:"data-table",migrationAliasFor:"data-table"},{name:"data-table-sortable-header",category:"data-table",migrationAliasFor:"data-table"},{name:"data-table-toolbar",category:"data-table",migrationAliasFor:"data-table"},{name:"data-table-view-presets",category:"data-table",migrationAliasFor:"data-table"},{name:"data-state",category:"display",files:[m("src/components/display/data-state.tsx","{components}/display/data-state.tsx")]},{name:"data-table",category:"data-table",dependencies:["@tanstack/react-table","@tanstack/react-virtual","lucide-react"],registryDependencies:["button","checkbox","data-state","dropdown-menu","input","pagination","search-input","select","table","utils"],files:[m("src/components/data-table/data-table.tsx","{components}/data-table/data-table.tsx"),m("src/components/data-table/data-table-actions-column.tsx","{components}/data-table/data-table-actions-column.tsx"),m("src/components/data-table/data-table-bulk-actions.tsx","{components}/data-table/data-table-bulk-actions.tsx"),m("src/components/data-table/data-table-column-visibility-menu.tsx","{components}/data-table/data-table-column-visibility-menu.tsx"),m("src/components/data-table/data-table-pagination.tsx","{components}/data-table/data-table-pagination.tsx"),m("src/components/data-table/data-table-row-actions.tsx","{components}/data-table/data-table-row-actions.tsx"),m("src/components/data-table/data-table-saved-filters.tsx","{components}/data-table/data-table-saved-filters.tsx"),m("src/components/data-table/data-table-select-column.tsx","{components}/data-table/data-table-select-column.tsx"),m("src/components/data-table/data-table-sortable-header.tsx","{components}/data-table/data-table-sortable-header.tsx"),m("src/components/data-table/data-table-toolbar.tsx","{components}/data-table/data-table-toolbar.tsx"),m("src/components/data-table/data-table-view-presets.tsx","{components}/data-table/data-table-view-presets.tsx"),m("src/components/data-table/table-export-menu.tsx","{components}/data-table/table-export-menu.tsx"),m("src/components/data-table/table-import-button.tsx","{components}/data-table/table-import-button.tsx")]},{name:"data-table-actions-column",category:"data-table",migrationAliasFor:"data-table"},{name:"table-export-menu",category:"data-table",migrationAliasFor:"data-table"},{name:"table-import-button",category:"data-table",migrationAliasFor:"data-table"},{name:"description-list",category:"display",files:[m("src/components/display/description-list.tsx","{components}/display/description-list.tsx")]},{name:"divider",category:"ui",files:[m("src/components/ui/divider","{ui}/divider")]},{name:"file-upload",category:"upload",files:[m("src/components/upload/file-upload.tsx","{components}/upload/file-upload.tsx")]},{name:"filter-bar",category:"filters",files:[m("src/components/filters/filter-bar.tsx","{components}/filters/filter-bar.tsx")]},{name:"bulk-action-bar",category:"patterns",registryDependencies:["button","utils"],files:[m("src/components/patterns/bulk-action-bar.tsx","{components}/patterns/bulk-action-bar.tsx")]},{name:"data-view",category:"patterns",registryDependencies:["data-table","empty-state","page-toolbar","utils"],files:[m("src/components/patterns/data-view.tsx","{components}/patterns/data-view.tsx")]},{name:"detail-layout",category:"patterns",registryDependencies:["utils"],files:[m("src/components/patterns/detail-layout.tsx","{components}/patterns/detail-layout.tsx")]},{name:"empty-state",category:"patterns",dependencies:["lucide-react"],registryDependencies:["button","utils"],files:[m("src/components/patterns/empty-state.tsx","{components}/patterns/empty-state.tsx")]},{name:"form-builder",category:"patterns",dependencies:["react-hook-form"],registryDependencies:["button","form-input","form-select","form-textarea","form-switch","form-date-range-input","utils"],files:[m("src/components/patterns/form-builder.tsx","{components}/patterns/form-builder.tsx")]},{name:"horizontal-bar-chart",category:"charts",migrationAliasFor:"data-view"},{name:"image-upload",category:"upload",files:[m("src/components/upload/image-upload.tsx","{components}/upload/image-upload.tsx")]},{name:"kanban",category:"display",dependencies:["@dnd-kit/helpers","@dnd-kit/react","lucide-react"],registryDependencies:["card","utils"],files:[m("src/components/display/kanban.tsx","{components}/display/kanban.tsx")]},{name:"kpi",category:"charts",migrationAliasFor:"statistic"},{name:"list",category:"display",files:[m("src/components/display/list.tsx","{components}/display/list.tsx")]},{name:"otp-input",category:"inputs",files:[m("src/components/inputs/otp-input.tsx","{components}/inputs/otp-input.tsx")]},{name:"color-picker",category:"inputs",registryDependencies:["utils"],files:[m("src/components/inputs/color-picker.tsx","{components}/inputs/color-picker.tsx")]},{name:"signature-pad",category:"inputs",dependencies:["lucide-react"],registryDependencies:["utils"],files:[m("src/components/inputs/signature-pad.tsx","{components}/inputs/signature-pad.tsx")]},{name:"pagination",category:"navigation",files:[m("src/components/navigation/pagination.tsx","{components}/navigation/pagination.tsx")]},{name:"progress",category:"display",files:[m("src/components/display/progress.tsx","{components}/display/progress.tsx")]},{name:"progress-ring",category:"charts",migrationAliasFor:"progress-circle"},{name:"progress-circle",category:"charts",files:[m("src/components/charts/progress-circle.tsx","{components}/charts/progress-circle.tsx"),m("src/components/charts/progress-ring.tsx","{components}/charts/progress-ring.tsx")]},{name:"quick-action-grid",category:"actions",files:[m("src/components/actions/quick-action-grid.tsx","{components}/actions/quick-action-grid.tsx")]},{name:"rating",category:"inputs",files:[m("src/components/inputs/rating.tsx","{components}/inputs/rating.tsx")]},{name:"resource-detail-page",category:"patterns",files:[m("src/components/patterns/resource-detail-page.tsx","{components}/patterns/resource-detail-page.tsx")]},{name:"resource-page",category:"patterns",registryDependencies:["data-table","utils"],files:[m("src/components/patterns/resource-page.tsx","{components}/patterns/resource-page.tsx")]},{name:"page-toolbar",category:"patterns",registryDependencies:["utils"],files:[m("src/components/patterns/page-toolbar.tsx","{components}/patterns/page-toolbar.tsx")]},{name:"settings-page",category:"patterns",registryDependencies:["tabs","utils"],files:[m("src/components/patterns/settings-page.tsx","{components}/patterns/settings-page.tsx")]},{name:"section",category:"layout",files:[m("src/components/layout/section.tsx","{components}/layout/section.tsx")]},{name:"slider",category:"inputs",files:[m("src/components/inputs/slider.tsx","{components}/inputs/slider.tsx")]},{name:"info-card",category:"display",registryDependencies:["card","skeleton","utils"],files:[m("src/components/display/info-card.tsx","{components}/display/info-card.tsx")]},{name:"spinner",category:"ui",files:[m("src/components/ui/spinner","{ui}/spinner")]},{name:"statistic",category:"display",files:[m("src/components/display/statistic.tsx","{components}/display/statistic.tsx")]},{name:"status-dot",category:"display",files:[m("src/components/display/status-dot.tsx","{components}/display/status-dot.tsx")]},{name:"status-legend",category:"display",files:[m("src/components/display/status-legend.tsx","{components}/display/status-legend.tsx")]},{name:"stepper",category:"wizard",files:[m("src/components/wizard/stepper.tsx","{components}/wizard/stepper.tsx")]},{name:"timeline",category:"display",files:[m("src/components/display/timeline.tsx","{components}/display/timeline.tsx")]},{name:"toast",category:"notifications",files:[m("src/components/notifications/toast.tsx","{components}/notifications/toast.tsx")]},{name:"tree-view",category:"display",files:[m("src/components/display/tree-view.tsx","{components}/display/tree-view.tsx")]},{name:"use-before-unload-when-dirty",category:"hooks",files:[m("src/hooks/use-before-unload-when-dirty.ts","{hooks}/use-before-unload-when-dirty.ts")]},{name:"use-data-table-view-state",category:"hooks",files:[m("src/hooks/use-data-table-view-state.ts","{hooks}/use-data-table-view-state.ts")]},{name:"use-debounce",category:"hooks",files:[m("src/hooks/use-debounce.ts","{hooks}/use-debounce.ts")]},{name:"use-disclosure",category:"hooks",files:[m("src/hooks/use-disclosure.ts","{hooks}/use-disclosure.ts")]},{name:"use-is-mobile",category:"hooks",files:[m("src/hooks/use-is-mobile.ts","{hooks}/use-is-mobile.ts")]},{name:"use-session-storage-state",category:"hooks",files:[m("src/hooks/use-session-storage-state.ts","{hooks}/use-session-storage-state.ts")]},{name:"wizard",category:"wizard",files:[m("src/components/wizard/wizard.tsx","{components}/wizard/wizard.tsx")]},{name:"inline-editable",category:"inputs",files:[m("src/components/inputs/inline-editable.tsx","{components}/inputs/inline-editable.tsx")]},{name:"command-palette",category:"command",dependencies:["cmdk","lucide-react"],registryDependencies:["button","dialog","input","kbd","utils"],files:[m("src/components/command/command-palette.tsx","{components}/command/command-palette.tsx")]},{name:"saved-filter-select",category:"filters",files:[m("src/components/filters/saved-filter-select.tsx","{components}/filters/saved-filter-select.tsx")]},{name:"notification-center",category:"notifications",files:[m("src/components/notifications/notification-center.tsx","{components}/notifications/notification-center.tsx")]},{name:"calendar-scheduler",category:"modern",registryDependencies:["utils"],files:[m("src/components/modern/calendar-scheduler.tsx","{components}/modern/calendar-scheduler.tsx")]},{name:"dual-list-picker",category:"modern",registryDependencies:["utils"],files:[m("src/components/modern/dual-list-picker.tsx","{components}/modern/dual-list-picker.tsx")]},{name:"resizable-panel",category:"modern",dependencies:["lucide-react"],registryDependencies:["utils"],files:[m("src/components/modern/resizable-panel.tsx","{components}/modern/resizable-panel.tsx")]},{name:"rich-text-editor",category:"modern",dependencies:["@tiptap/react","@tiptap/pm","@tiptap/starter-kit","@tiptap/extension-link","@tiptap/extension-placeholder","lucide-react"],registryDependencies:["utils"],files:[m("src/components/modern/rich-text-editor.tsx","{components}/modern/rich-text-editor.tsx")]},{name:"image-cropper",category:"modern",dependencies:["react-easy-crop","lucide-react"],registryDependencies:["utils"],files:[m("src/components/modern/image-cropper.tsx","{components}/modern/image-cropper.tsx")]},{name:"qr-code",category:"display",dependencies:["qrcode","@types/qrcode"],registryDependencies:["utils"],files:[m("src/components/display/qr-code.tsx","{components}/display/qr-code.tsx")]},{name:"json-input",category:"inputs",registryDependencies:["utils"],files:[m("src/components/inputs/json-input.tsx","{components}/inputs/json-input.tsx")]},{name:"time-picker",category:"inputs",registryDependencies:["utils"],files:[m("src/components/inputs/time-picker.tsx","{components}/inputs/time-picker.tsx")]},{name:"sortable-list",category:"dnd",dependencies:["@dnd-kit/helpers","@dnd-kit/react","lucide-react"],registryDependencies:["utils"],files:[m("src/components/dnd/sortable-list.tsx","{components}/dnd/sortable-list.tsx")]},{name:"virtual-list",category:"display",dependencies:["@tanstack/react-virtual"],registryDependencies:["utils"],files:[m("src/components/display/virtual-list.tsx","{components}/display/virtual-list.tsx")]}];for(let t of hD)N[t.name]??=t;var Tt=Object.keys(N);var $n=Ce(it());function jy(t){let e=L__default.default.dirname(url.fileURLToPath(t)),r=L__default.default.resolve(e,"../vendor");if($n.default.existsSync(L__default.default.join(r,"src")))return r;let i=[L__default.default.resolve(e,"../.."),L__default.default.resolve(e,".."),process.cwd()];for(let n of i){let o=L__default.default.join(n,"package.json");if($n.default.existsSync(o))try{if($n.default.readJsonSync(o).name===Ry)return n}catch{}}return L__default.default.resolve(e,"../..")}function mD(t){return t in N}function fD(t){let e=t.toLowerCase();return Tt.filter(r=>!N[r].migrationAliasFor).map(r=>{let i=r.toLowerCase(),n=0;i.startsWith(e)&&(n+=40),i.includes(e)&&(n+=25);for(let o of e.split(/[-_\s]+/).filter(Boolean))i.includes(o)&&(n+=8);return {name:r,score:n}}).filter(r=>r.score>0).sort((r,i)=>i.score-r.score||r.name.localeCompare(i.name)).slice(0,5).map(r=>r.name)}function gD(t){let e=new Set,r=t;for(;N[r].migrationAliasFor;){if(e.has(r))throw new Error(`Registry migration alias cycle detected at ${r}`);e.add(r),r=N[r].migrationAliasFor;}return r}function Gy(t){if(t.paths?.components)return t.paths.components;let e=t.componentsPath??"src/components/ui";return e.endsWith("/ui")||e.endsWith("\\ui")?L__default.default.dirname(e):e}function Ny(t,e){let r=Gy(e),i=e.paths?.ui??e.componentsPath??L__default.default.join(r,"ui"),n=e.paths?.hooks??"src/hooks",o=e.paths?.lib??L__default.default.dirname(e.utilsPath??"src/lib/utils.ts"),s=e.utilsPath??L__default.default.join(o,"utils.ts");return t.replaceAll("{components}",r).replaceAll("{ui}",i).replaceAll("{hooks}",n).replaceAll("{lib}",o).replaceAll("{utils}",s)}function bD(t,e="@"){return e==="@"?t:t.replaceAll("@/",`${e}/`)}function Ly(t,e){let r=t.replaceAll("\\","/");if(r==="src/lib/utils.ts")return e.utilsPath??"src/lib/utils.ts";if(r.startsWith("src/lib/")){let i=e.paths?.lib??L__default.default.dirname(e.utilsPath??"src/lib/utils.ts");return L__default.default.join(i,r.replace("src/lib/",""))}if(r.startsWith("src/hooks/"))return L__default.default.join(e.paths?.hooks??"src/hooks",r.replace("src/hooks/",""));if(r.startsWith("src/components/ui/")){let i=e.paths?.ui??e.componentsPath??"src/components/ui";return L__default.default.join(i,r.replace("src/components/ui/",""))}if(r.startsWith("src/components/")){let i=Gy(e);return L__default.default.join(i,r.replace("src/components/",""))}}function yD(t,e){if(t==="@/lib/utils")return "src/lib/utils.ts";if(t.startsWith("@/lib/"))return `src/lib/${t.replace("@/lib/","")}`;if(t.startsWith("@/components/"))return `src/components/${t.replace("@/components/","")}`;if(t.startsWith("@/hooks/"))return `src/hooks/${t.replace("@/hooks/","")}`;if(e&&t.startsWith("."))return L__default.default.posix.normalize(L__default.default.posix.join(L__default.default.posix.dirname(e),t))}function qy(t){return [L__default.default.join(t,"index.tsx").replaceAll("\\","/"),L__default.default.join(t,"index.ts").replaceAll("\\","/"),`${t}.tsx`,`${t}.ts`]}function By(t,e){let r=new Set,i=/(?:import|export)\s+(?:type\s+)?(?:[^"']*?\s+from\s+)?["']([^"']+)["']|import\s*\(\s*["']([^"']+)["']\s*\)/g,n;for(;n=i.exec(t);){let o=n[1]??n[2],s=yD(o,e);s&&r.add(s);}return [...r]}var wD=new Set(["react","react-dom","node:path","node:fs","node:fs/promises"]);function Uy(t){let e=new Set,r=/(?:import|export)\s+(?:type\s+)?(?:[^"']*?\s+from\s+)?["']([^"']+)["']|import\s*\(\s*["']([^"']+)["']\s*\)/g,i;for(;i=r.exec(t);){let n=i[1]??i[2];if(!(!n||n.startsWith(".")||n.startsWith("@/")||wD.has(n))){if(n.startsWith("@")){let[o,s]=n.split("/");o&&s&&e.add(`${o}/${s}`);continue}e.add(n.split("/")[0]);}}return [...e]}function vD(t){let e=[],r=new Set;function i(n){if(r.has(n))return;let o=N[n];o.registryDependencies?.forEach(i),r.add(n),e.push(o);}return t.forEach(i),e}function xD(){return Tt.filter(t=>N[t].category!=="lib"&&!N[t].migrationAliasFor).sort().join(", ")}async function Rn(t,e={}){let r=process.cwd(),i=L__default.default.join(r,"tembro.json");re.default.existsSync(i)||(S.error("tembro.json topilmadi. Avval init qiling:"),S.info(ne("init")),process.exit(1)),t.length||(S.error("Component nomini kiriting:"),S.info(ne("add data-table async-select input")),S.info(`Mavjud componentlar: ${xD()}`),process.exit(1));let n=[];for(let C of t){if(!mD(C)){let _=fD(C);S.warn(`${C} registry ichida mavjud emas.`),_.length&&S.info(`Yaqin nomlar: ${_.join(", ")}`),S.info(`Barcha componentlar: ${ne("list")}`);continue}let D=gD(C);D!==C&&S.warn(`${C} deprecated. ${D} ishlatiladi.`),n.includes(D)||n.push(D);}n.length||(S.error("Qo\u2018shish uchun valid component topilmadi."),process.exit(1));let o=await re.default.readJson(i),s=jy((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))),a=vi(r),c=vD(n),d=new Set,l=new Set,u=e.overwrite===true?true:void 0,h=0,p=0,f=0;async function b(){let C=new Set,D=[];async function _(z,K){let w=z.replaceAll("\\","/");if(C.has(w))return;let E=L__default.default.join(s,w);if(!re.default.existsSync(E)){D.push({source:w,target:null,exists:false,operation:"unresolved"});return}if((await re.default.stat(E)).isDirectory()){C.add(w);let M=await re.default.readdir(E,{withFileTypes:true});for(let P of M){let Z=L__default.default.posix.join(w,P.name),q=K?L__default.default.posix.join(K.replaceAll("\\","/"),P.name):void 0;await _(Z,q);}return}C.add(w);let G=K?Ny(K,o):Ly(w,o),V=await re.default.readFile(E,"utf8");for(let M of Uy(V))d.add(M);for(let M of By(V,w))for(let P of qy(M))if(re.default.existsSync(L__default.default.join(s,P))){await _(P);break}if(!G){D.push({source:w,target:null,exists:false,operation:"unresolved"});return}let $=L__default.default.join(r,G),I=re.default.existsSync($);D.push({source:w,target:L__default.default.relative(r,$),exists:I,operation:I?e.overwrite?"overwrite":"skip":"add"});}for(let z of c){z.dependencies?.forEach(K=>d.add(K));for(let K of z.files??[])await _(K.source,K.target);}return {components:n,resolvedComponents:c.map(z=>z.name),dependencies:Array.from(d).sort(),files:D}}if(e.plan){console.log(JSON.stringify(await b(),null,2));return}S.info(`Resolved: ${c.map(C=>C.name).join(", ")}`);async function v(C){return u!==void 0?u:!(process.stdin.isTTY&&process.stdout.isTTY&&!process.env.CI)?(u=false,S.warn("Mavjud fayllar o\u2018zgartirilmadi. Majburiy yozish uchun --overwrite ishlating."),false):(u=(await(0, zy.default)({type:"confirm",name:"overwrite",message:`${C} allaqachon mavjud. Barcha conflict fayllarni overwrite qilasizmi?`,initial:false})).overwrite===true,u||S.info("Mavjud fayllar saqlanadi; faqat yetishmayotgan fayllar qo\u2018shiladi."),u)}async function y(C,D){let _=C.replaceAll("\\","/");if(l.has(_))return;let z=L__default.default.join(s,_);if(!re.default.existsSync(z)){S.warn(`${_} topilmadi. O\u2018tkazib yuborildi.`);return}if((await re.default.stat(z)).isDirectory()){l.add(_);let $=await re.default.readdir(z,{withFileTypes:true});for(let I of $){let M=L__default.default.posix.join(_,I.name),P=D?L__default.default.posix.join(D.replaceAll("\\","/"),I.name):void 0;await y(M,P);}return}l.add(_);let w=D?Ny(D,o):Ly(_,o);if(!w)return;let E=L__default.default.join(r,w),O=L__default.default.relative(r,E),G=re.default.existsSync(E);if(e.dryRun){let $=G?"conflict":"add";S.info(`[dry-run:${$}] ${_} -> ${O}`);}else if(G&&!await v(O))f+=1,S.warn(`${O} allaqachon mavjud. O\u2018tkazib yuborildi.`);else {await re.default.ensureDir(L__default.default.dirname(E));let $=await re.default.readFile(z,"utf8");await re.default.writeFile(E,bD($,o.alias)),G?(p+=1,S.success(`${O} yangilandi.`)):(h+=1,S.success(`${O} qo\u2018shildi.`));}let V=await re.default.readFile(z,"utf8");for(let $ of Uy(V))d.add($);for(let $ of By(V,_))for(let I of qy($))if(re.default.existsSync(L__default.default.join(s,I))){await y(I);break}}for(let C of c){C.dependencies?.forEach(D=>d.add(D));for(let D of C.files??[])await y(D.source,D.target);}let x=h+p,k=Array.from(d).sort();e.dryRun&&k.length&&S.info(`[dry-run:dependencies] ${k.join(", ")}`),!e.skipInstall&&d.size>0&&!e.dryRun&&x>0?await Br({cwd:r,packageManager:a,packages:k}):e.skipInstall&&k.length&&x>0&&S.warn(`Dependency install skipped: ${k.join(", ")}`),e.dryRun?S.info("Dry run tugadi. Hech qanday fayl o\u2018zgartirilmadi."):x===0?S.warn(`O\u2018zgarish yo\u2018q. ${f} ta mavjud fayl saqlandi.`):S.success(`Tayyor: ${h} ta qo\u2018shildi, ${p} ta yangilandi, ${f} ta saqlandi.`);}var SD={utils:"internal",button:"stable",input:"stable",textarea:"stable",checkbox:"stable",switch:"stable",badge:"stable",card:"stable",dialog:"stable","dropdown-menu":"stable",popover:"stable",select:"stable",table:"stable","radio-group":"stable",accordion:"stable","simple-select":"internal",combobox:"internal","scroll-box":"stable","right-click-menu":"stable",kbd:"stable","dialog-actions":"internal","modal-shell":"internal","confirm-dialog":"stable","alert-dialog":"stable",drawer:"stable",overlay:"stable",pagination:"stable","async-select":"preview","color-picker":"stable","signature-pad":"preview","form-field-shell":"preview","form-input":"preview","form-select":"preview","form-textarea":"preview","form-switch":"preview","form-date-range-input":"preview","form-date-picker":"preview","form-date-range-picker":"preview",form:"preview","loading-state":"stable",feedback:"stable","description-list":"stable",progress:"stable",timeline:"stable","info-card":"stable","activity-feed":"stable",display:"stable","action-menu":"stable",actions:"stable","app-header":"internal",sidebar:"stable",breadcrumbs:"stable",layout:"stable","filter-bar":"stable",filters:"stable","data-table":"preview","data-table-actions-column":"internal","table-export-menu":"internal","table-import-button":"internal",calendar:"preview","date-picker":"preview","date-range-picker":"preview","calendar-kit":"preview","file-upload":"preview","image-upload":"preview",upload:"preview",stepper:"preview",wizard:"preview","wizard-kit":"preview",toast:"preview",notifications:"preview","command-palette":"preview",command:"preview","resource-page":"preview","resource-detail-page":"preview",patterns:"preview","use-session-storage-state":"stable","use-before-unload-when-dirty":"stable","use-is-mobile":"stable","use-disclosure":"stable","use-debounce":"stable","use-data-table-view-state":"preview",hooks:"stable",dashboard:"preview",all:"preview","inline-editable":"preview","saved-filter-select":"preview","notification-center":"preview","calendar-scheduler":"preview","dual-list-picker":"preview","resizable-panel":"preview","rich-text-editor":"preview","image-cropper":"preview","qr-code":"stable","progress-circle":"stable",tag:"preview",typography:"preview","json-input":"preview","time-picker":"preview","sortable-list":"preview","virtual-list":"preview",dnd:"preview"};function rr(t){return SD[t]??"preview"}var kD={lib:"foundation",ui:"foundation",hooks:"foundation",overlay:"source-copy",navigation:"source-copy",inputs:"source-copy",form:"source-copy",feedback:"source-copy",display:"source-copy",dnd:"source-copy",actions:"source-copy",layout:"source-copy",filters:"source-copy","data-table":"system",calendar:"source-copy",upload:"source-copy",wizard:"source-copy",notifications:"source-copy",command:"source-copy",patterns:"system",modern:"source-copy",group:"system"},CD={utils:"foundation",button:"foundation",input:"foundation",textarea:"foundation",checkbox:"foundation",switch:"foundation",badge:"foundation",card:"foundation",skeleton:"foundation",tabs:"foundation",dialog:"foundation","dropdown-menu":"foundation",popover:"foundation",select:"foundation",table:"foundation","use-session-storage-state":"foundation","use-before-unload-when-dirty":"foundation","use-is-mobile":"foundation","use-disclosure":"foundation","use-debounce":"foundation",hooks:"foundation","data-table":"system","resource-page":"system","resource-detail-page":"system","calendar-kit":"system","wizard-kit":"system",dashboard:"system",all:"system"};function Mn(t,e){return CD[t]??kD[e]}var Vy=[{slug:"button",registryName:"button",surface:"documented"},{slug:"input",registryName:"input",surface:"documented"},{slug:"select",registryName:"select",surface:"documented"},{slug:"card",registryName:"card",surface:"documented"},{slug:"badge",registryName:"badge",surface:"documented"},{slug:"checkbox",registryName:"checkbox",surface:"documented"},{slug:"overlay",registryName:"dialog",surface:"documented"},{slug:"data-table",registryName:"data-table",surface:"documented"},{slug:"calendar",registryName:"calendar",surface:"documented"},{slug:"date-picker",registryName:"date-picker",surface:"documented"},{slug:"date-range-picker",registryName:"date-range-picker",surface:"documented"},{slug:"alert",registryName:"alert",surface:"documented"},{slug:"bar-chart",registryName:"charts",surface:"documented"},{slug:"sidebar",registryName:"sidebar",surface:"documented"},{slug:"file-upload",registryName:"file-upload",surface:"documented"},{slug:"progress",registryName:"progress",surface:"documented"}],za=[{slug:"accordion",registryName:"accordion",surface:"standalone"},{slug:"divider",registryName:"divider",surface:"standalone"},{slug:"segmented-control",registryName:"segmented-control",surface:"standalone"},{slug:"skeleton",registryName:"skeleton",surface:"standalone"},{slug:"spinner",registryName:"spinner",surface:"standalone"},{slug:"command-palette",registryName:"command-palette",surface:"standalone"},{slug:"inline-editable",registryName:"inline-editable",surface:"standalone"},{slug:"avatar",registryName:"avatar",surface:"standalone"},{slug:"code-block",registryName:"code-block",surface:"standalone"},{slug:"data-state",registryName:"data-state",surface:"standalone"},{slug:"kanban",registryName:"kanban",surface:"standalone"},{slug:"list",registryName:"list",surface:"standalone"},{slug:"description-list",registryName:"description-list",surface:"standalone"},{slug:"statistic",registryName:"statistic",surface:"standalone"},{slug:"tree-view",registryName:"tree-view",surface:"standalone"},{slug:"copy-button",registryName:"copy-button",surface:"standalone"},{slug:"section",registryName:"section",surface:"standalone"},{slug:"form-builder",registryName:"form-builder",surface:"standalone"},{slug:"empty-state",registryName:"empty-state",surface:"standalone"},{slug:"page-toolbar",registryName:"page-toolbar",surface:"standalone"},{slug:"bulk-action-bar",registryName:"bulk-action-bar",surface:"standalone"},{slug:"detail-layout",registryName:"detail-layout",surface:"standalone"},{slug:"settings-page",registryName:"settings-page",surface:"standalone"},{slug:"data-view",registryName:"data-view",surface:"standalone"},{slug:"resource-page",registryName:"resource-page",surface:"standalone"},{slug:"resource-detail-page",registryName:"resource-detail-page",surface:"standalone"},{slug:"calendar-scheduler",registryName:"calendar-scheduler",surface:"standalone"},{slug:"dual-list-picker",registryName:"dual-list-picker",surface:"standalone"},{slug:"resizable-panel",registryName:"resizable-panel",surface:"standalone"},{slug:"tag",registryName:"tag",surface:"standalone"},{slug:"carousel",registryName:"carousel",surface:"standalone"},{slug:"typography",registryName:"typography",surface:"standalone"},{slug:"json-input",registryName:"json-input",surface:"standalone"},{slug:"time-picker",registryName:"time-picker",surface:"standalone"},{slug:"sortable-list",registryName:"sortable-list",surface:"standalone"},{slug:"virtual-list",registryName:"virtual-list",surface:"standalone"},{slug:"color-picker",registryName:"color-picker",surface:"standalone"},{slug:"signature-pad",registryName:"signature-pad",surface:"standalone"},{slug:"qr-code",registryName:"qr-code",surface:"standalone"},{slug:"rich-text-editor",registryName:"rich-text-editor",surface:"standalone"},{slug:"image-cropper",registryName:"image-cropper",surface:"standalone"}],Fn=[...Vy,...za];new Map(Fn.map((t,e)=>[t.slug,e]));new Map(Fn.map(t=>[t.slug,t.registryName]));var OD=Fn.map(t=>t.slug);new Set(OD);za.map(t=>t.slug);var Wy=Vy.map(t=>t.registryName),Hy=za.map(t=>t.registryName);Fn.map(t=>t.registryName);var Jy=new Set;function ED(t){return Tt.filter(e=>N[e].category!=="lib").filter(e=>!N[e].migrationAliasFor).filter(e=>!Jy.has(e)).filter(e=>!t.category||N[e].category===t.category).filter(e=>!t.status||rr(e)===t.status)}function Yy(t,e,r){let i=e.filter(n=>!r.category||N[n].category===r.category).filter(n=>!r.status||rr(n)===r.status);i.length&&(console.log(`
1987
- ${t}`),i.forEach(n=>{let o=N[n],s=rr(n),a=Mn(n,o.category),c=o.registryDependencies?.length?` -> ${o.registryDependencies.join(", ")}`:"";console.log(` ${n} [${s}/${a}]${c}`);}));}function Ky(t={}){let e=ED(t);if(t.json){console.log(JSON.stringify(e.map(s=>{let a=N[s];return {name:s,category:a.category,status:rr(s),distribution:Mn(s,a.category),description:a.description??null,dependencies:a.dependencies??[],registryDependencies:a.registryDependencies??[],files:a.files??[]}}),null,2));return}if(!e.length){console.log("No registry components matched the selected filters."),console.log(`Try: ${ne("list")}`);return}let r=Wy.filter((s,a,c)=>c.indexOf(s)===a).filter(s=>N[s]&&N[s].category!=="lib"),i=Hy.filter((s,a,c)=>c.indexOf(s)===a).filter(s=>N[s]&&N[s].category!=="lib");Yy("Canonical surfaces",r,t),Yy("Additional source-copy surfaces",i,t);let n=new Set([...r,...i]),o=e.filter(s=>N[s].category!=="lib"&&!N[s].migrationAliasFor).filter(s=>!n.has(s)).filter(s=>!Jy.has(s)).filter(s=>!N[s].migrationAliasFor).reduce((s,a)=>{let c=N[a].category;return s[c]??=[],s[c].push(a),s},{});for(let[s,a]of Object.entries(o))console.log(`
1988
- ${s}`),a.sort().forEach(c=>{let d=N[c],l=rr(c),u=Mn(c,d.category),h=d.registryDependencies?.length?` -> ${d.registryDependencies.join(", ")}`:"";console.log(` ${c} [${l}/${u}]${h}`);});console.log(`
1986
+ `),await SP({cwd:e,template:i,alias:y.alias,componentsPath:h,hooksPath:m,utilsPath:u}),i==="vite"&&await kP({cwd:e,alias:y.alias}),d.writeThemeCss&&b){let O=await Mn({cwd:e,cssPath:b,componentsPath:h});x.success(`Theme CSS yozildi / written: ${O}`);}x.success("Tembro source-copy setup tayyor / initialized."),x.info(`Component source root: ${h}`),x.info(`UI primitives path: ${p}`),x.info(`Hooks path: ${m}`),x.info("Componentlarni ko\u2018rish / list components:"),x.info(re("list")),x.info("Component qo\u2018shish / add components:"),x.info(re("add button input")),c.length>0&&!d.installTailwindDeps&&x.warn(`Tailwind paketlari hali o\u2018rnatilmadi: ${c.join(", ")}`),x.info("Theme CSS ni yangilash / update theme CSS:"),x.info(re("theme")),t.showcase?(x.info("Showcase qo\u2018shilmoqda: barcha componentlar + local workbench."),await Dt(["showcase"],{overwrite:true,skipInstall:t.skipInstall})):(x.info("To\u2018liq local workbench kerak bo\u2018lsa / full local workbench:"),x.info(re("init --showcase --defaults")));}var DP={utils:"internal",button:"stable",input:"stable",textarea:"stable",checkbox:"stable",switch:"stable",badge:"stable",card:"stable",dialog:"stable","dropdown-menu":"stable",popover:"stable",select:"stable",table:"stable","radio-group":"stable",accordion:"stable","simple-select":"internal",combobox:"internal","scroll-box":"stable","right-click-menu":"stable",kbd:"stable","dialog-actions":"internal","modal-shell":"internal","confirm-dialog":"stable","alert-dialog":"stable",drawer:"stable",overlay:"stable",pagination:"stable","async-select":"preview","color-picker":"stable","signature-pad":"preview","form-field-shell":"preview","form-input":"preview","form-select":"preview","form-textarea":"preview","form-switch":"preview","form-date-range-input":"preview","form-date-picker":"preview","form-date-range-picker":"preview",form:"preview","loading-state":"stable",feedback:"stable","description-list":"stable",progress:"stable",timeline:"stable","info-card":"stable","activity-feed":"stable",display:"stable","action-menu":"stable",actions:"stable","app-header":"internal",sidebar:"stable",breadcrumbs:"stable",layout:"stable","filter-bar":"stable",filters:"stable","data-table":"preview","data-table-actions-column":"internal","table-export-menu":"internal","table-import-button":"internal",calendar:"preview","date-picker":"preview","date-range-picker":"preview","calendar-kit":"preview","file-upload":"preview","image-upload":"preview",upload:"preview",stepper:"preview",wizard:"preview","wizard-kit":"preview",toast:"preview",notifications:"preview","command-palette":"preview",command:"preview","resource-page":"preview","resource-detail-page":"preview",patterns:"preview","use-session-storage-state":"stable","use-before-unload-when-dirty":"stable","use-is-mobile":"stable","use-disclosure":"stable","use-debounce":"stable","use-data-table-view-state":"preview",hooks:"stable",dashboard:"preview",all:"preview","inline-editable":"preview","saved-filter-select":"preview","notification-center":"preview","calendar-scheduler":"preview","dual-list-picker":"preview","resizable-panel":"preview","rich-text-editor":"preview","image-cropper":"preview","qr-code":"stable","progress-circle":"stable",tag:"preview",typography:"preview","json-input":"preview","time-picker":"preview","sortable-list":"preview","virtual-list":"preview",dnd:"preview"};function or(t){return DP[t]??"preview"}var IP={lib:"foundation",ui:"foundation",hooks:"foundation",overlay:"source-copy",navigation:"source-copy",inputs:"source-copy",form:"source-copy",feedback:"source-copy",display:"source-copy",dnd:"source-copy",actions:"source-copy",layout:"source-copy",filters:"source-copy","data-table":"system",calendar:"source-copy",upload:"source-copy",wizard:"source-copy",notifications:"source-copy",command:"source-copy",patterns:"system",modern:"source-copy",group:"system"},$P={utils:"foundation",button:"foundation",input:"foundation",textarea:"foundation",checkbox:"foundation",switch:"foundation",badge:"foundation",card:"foundation",skeleton:"foundation",tabs:"foundation",dialog:"foundation","dropdown-menu":"foundation",popover:"foundation",select:"foundation",table:"foundation","use-session-storage-state":"foundation","use-before-unload-when-dirty":"foundation","use-is-mobile":"foundation","use-disclosure":"foundation","use-debounce":"foundation",hooks:"foundation","data-table":"system","resource-page":"system","resource-detail-page":"system","calendar-kit":"system","wizard-kit":"system",dashboard:"system",all:"system"};function jn(t,e){return $P[t]??IP[e]}var Xy=[{slug:"button",registryName:"button",surface:"documented"},{slug:"input",registryName:"input",surface:"documented"},{slug:"select",registryName:"select",surface:"documented"},{slug:"card",registryName:"card",surface:"documented"},{slug:"badge",registryName:"badge",surface:"documented"},{slug:"checkbox",registryName:"checkbox",surface:"documented"},{slug:"overlay",registryName:"dialog",surface:"documented"},{slug:"data-table",registryName:"data-table",surface:"documented"},{slug:"calendar",registryName:"calendar",surface:"documented"},{slug:"date-picker",registryName:"date-picker",surface:"documented"},{slug:"date-range-picker",registryName:"date-range-picker",surface:"documented"},{slug:"alert",registryName:"alert",surface:"documented"},{slug:"bar-chart",registryName:"charts",surface:"documented"},{slug:"sidebar",registryName:"sidebar",surface:"documented"},{slug:"file-upload",registryName:"file-upload",surface:"documented"},{slug:"progress",registryName:"progress",surface:"documented"}],Ha=[{slug:"accordion",registryName:"accordion",surface:"standalone"},{slug:"divider",registryName:"divider",surface:"standalone"},{slug:"segmented-control",registryName:"segmented-control",surface:"standalone"},{slug:"skeleton",registryName:"skeleton",surface:"standalone"},{slug:"spinner",registryName:"spinner",surface:"standalone"},{slug:"command-palette",registryName:"command-palette",surface:"standalone"},{slug:"inline-editable",registryName:"inline-editable",surface:"standalone"},{slug:"avatar",registryName:"avatar",surface:"standalone"},{slug:"code-block",registryName:"code-block",surface:"standalone"},{slug:"data-state",registryName:"data-state",surface:"standalone"},{slug:"kanban",registryName:"kanban",surface:"standalone"},{slug:"list",registryName:"list",surface:"standalone"},{slug:"description-list",registryName:"description-list",surface:"standalone"},{slug:"statistic",registryName:"statistic",surface:"standalone"},{slug:"tree-view",registryName:"tree-view",surface:"standalone"},{slug:"copy-button",registryName:"copy-button",surface:"standalone"},{slug:"section",registryName:"section",surface:"standalone"},{slug:"form-builder",registryName:"form-builder",surface:"standalone"},{slug:"empty-state",registryName:"empty-state",surface:"standalone"},{slug:"page-toolbar",registryName:"page-toolbar",surface:"standalone"},{slug:"bulk-action-bar",registryName:"bulk-action-bar",surface:"standalone"},{slug:"detail-layout",registryName:"detail-layout",surface:"standalone"},{slug:"settings-page",registryName:"settings-page",surface:"standalone"},{slug:"data-view",registryName:"data-view",surface:"standalone"},{slug:"resource-page",registryName:"resource-page",surface:"standalone"},{slug:"resource-detail-page",registryName:"resource-detail-page",surface:"standalone"},{slug:"calendar-scheduler",registryName:"calendar-scheduler",surface:"standalone"},{slug:"dual-list-picker",registryName:"dual-list-picker",surface:"standalone"},{slug:"resizable-panel",registryName:"resizable-panel",surface:"standalone"},{slug:"tag",registryName:"tag",surface:"standalone"},{slug:"carousel",registryName:"carousel",surface:"standalone"},{slug:"typography",registryName:"typography",surface:"standalone"},{slug:"json-input",registryName:"json-input",surface:"standalone"},{slug:"time-picker",registryName:"time-picker",surface:"standalone"},{slug:"sortable-list",registryName:"sortable-list",surface:"standalone"},{slug:"virtual-list",registryName:"virtual-list",surface:"standalone"},{slug:"color-picker",registryName:"color-picker",surface:"standalone"},{slug:"signature-pad",registryName:"signature-pad",surface:"standalone"},{slug:"qr-code",registryName:"qr-code",surface:"standalone"},{slug:"rich-text-editor",registryName:"rich-text-editor",surface:"standalone"},{slug:"image-cropper",registryName:"image-cropper",surface:"standalone"}],Nn=[...Xy,...Ha];new Map(Nn.map((t,e)=>[t.slug,e]));new Map(Nn.map(t=>[t.slug,t.registryName]));var RP=Nn.map(t=>t.slug);new Set(RP);Ha.map(t=>t.slug);var Zy=Xy.map(t=>t.registryName),Qy=Ha.map(t=>t.registryName);Nn.map(t=>t.registryName);var tw=new Set;function MP(t){return At.filter(e=>R[e].category!=="lib").filter(e=>!R[e].migrationAliasFor).filter(e=>!tw.has(e)).filter(e=>!t.category||R[e].category===t.category).filter(e=>!t.status||or(e)===t.status)}function ew(t,e,r){let i=e.filter(n=>!r.category||R[n].category===r.category).filter(n=>!r.status||or(n)===r.status);i.length&&(console.log(`
1987
+ ${t}`),i.forEach(n=>{let o=R[n],s=or(n),a=jn(n,o.category),c=o.registryDependencies?.length?` -> ${o.registryDependencies.join(", ")}`:"";console.log(` ${n} [${s}/${a}]${c}`);}));}function rw(t={}){let e=MP(t);if(t.json){console.log(JSON.stringify(e.map(s=>{let a=R[s];return {name:s,category:a.category,status:or(s),distribution:jn(s,a.category),description:a.description??null,dependencies:a.dependencies??[],registryDependencies:a.registryDependencies??[],files:a.files??[]}}),null,2));return}if(!e.length){console.log("No registry components matched the selected filters."),console.log(`Try: ${re("list")}`);return}let r=Zy.filter((s,a,c)=>c.indexOf(s)===a).filter(s=>R[s]&&R[s].category!=="lib"),i=Qy.filter((s,a,c)=>c.indexOf(s)===a).filter(s=>R[s]&&R[s].category!=="lib");ew("Canonical surfaces",r,t),ew("Additional source-copy surfaces",i,t);let n=new Set([...r,...i]),o=e.filter(s=>R[s].category!=="lib"&&!R[s].migrationAliasFor).filter(s=>!n.has(s)).filter(s=>!tw.has(s)).filter(s=>!R[s].migrationAliasFor).reduce((s,a)=>{let c=R[a].category;return s[c]??=[],s[c].push(a),s},{});for(let[s,a]of Object.entries(o))console.log(`
1988
+ ${s}`),a.sort().forEach(c=>{let d=R[c],l=or(c),u=jn(c,d.category),h=d.registryDependencies?.length?` -> ${d.registryDependencies.join(", ")}`:"";console.log(` ${c} [${l}/${u}]${h}`);});console.log(`
1989
1989
  Status:`),console.log(" stable = safe public API"),console.log(" preview = usable but API may change"),console.log(" experimental = not ready for stable app contracts"),console.log(" internal = helper metadata"),console.log(`
1990
1990
  Distribution:`),console.log(" foundation = small runtime-safe primitives, hooks, and helpers"),console.log(" source-copy = copy into app source with init/add and edit locally"),console.log(" system = larger product surfaces and patterns; prefer source-copy only"),console.log(`
1991
- Usage:`),console.log(` ${ne("add button input data-table")}`),console.log(` ${ne("add form --overwrite")}`),console.log(` ${ne("list --category data-table")}`),console.log(` ${ne("list --json")}`);}var ht=Ce(it());function Va(t){try{return ht.default.readJsonSync(t)}catch{return null}}function Qy(t){try{return ht.default.readFileSync(t,"utf8")}catch{return null}}function TD(t,e){return e?L__default.default.resolve(t,e):null}function ew(t){let e=t.paths?.components??t.componentsPath??"src/components",r=t.paths?.ui??t.componentsPath??L__default.default.join(e,"ui"),i=t.paths?.lib??L__default.default.dirname(t.utilsPath??"src/lib/utils.ts"),n=t.paths?.hooks??"src/hooks",o=t.utilsPath??L__default.default.join(i,"utils.ts");return {componentsRoot:e,uiPath:r,libPath:i,hooksPath:n,utilsPath:o}}function AD(t,e){let r=ew(e);return t.replace("{components}",r.componentsRoot).replace("{ui}",r.uiPath).replace("{hooks}",r.hooksPath).replace("{lib}",r.libPath).replace("{utils}",r.utilsPath)}function Xy(t,e){return ["tsconfig.app.json","tsconfig.json"].map(i=>L__default.default.join(t,i)).some(i=>!!Va(i)?.compilerOptions?.paths?.[`${e}/*`])}function Zy(t,e){return ["vite.config.ts","vite.config.js","vite.config.mjs"].map(i=>L__default.default.join(t,i)).some(i=>{let n=Qy(i);return !!(n?.includes(`"${e}"`)||n?.includes(`'${e}'`))})}function tw(t,e){let r=Va(L__default.default.join(t,"package.json")),i=new Set([...Object.keys(r?.dependencies??{}),...Object.keys(r?.devDependencies??{})]);return e.filter(n=>!i.has(n))}function Ga(t,e){return (t.files??[]).map(r=>({source:r.source,target:AD(r.target,e)}))}function _D(t,e){return Tt.map(r=>N[r]).filter(r=>r.category!=="lib").filter(r=>!r.migrationAliasFor).filter(r=>r.files?.length).filter(r=>Ga(r,e).some(i=>ht.default.existsSync(L__default.default.join(t,i.target))))}function DD(t,e){let r=_D(t,e),i=[],n=[],o=new Set;for(let s of r){for(let a of Ga(s,e))ht.default.existsSync(L__default.default.join(t,a.target))||i.push(`${s.name}: ${a.target}`);for(let a of s.registryDependencies??[]){let c=N[a];if(!c?.files?.length)continue;Ga(c,e).some(l=>ht.default.existsSync(L__default.default.join(t,l.target)))||n.push(`${s.name} -> ${a}`);}for(let a of s.dependencies??[])o.add(a);}return {copiedItems:r,missingFiles:i,missingRegistryDependencies:n,missingPackages:tw(t,Array.from(o).sort())}}function Ke(t,e){t.push(e);}function PD(t){return t?t.includes("/* tembro:start */")||t.includes("--aui-")||t.includes("--az-"):false}function rw(t={}){let e=process.cwd(),r=[],i=L__default.default.join(e,"package.json"),n=L__default.default.join(e,"tembro.json"),o=ht.default.existsSync(i),s=Va(n);if(Ke(r,{name:"package.json",status:o?"pass":"fail",message:o?"package.json topildi.":"package.json topilmadi. Commandni React, Vite yoki Next project ichida ishlating."}),Ke(r,{name:"tembro.json",status:s?"pass":"fail",message:s?"tembro.json topildi.":`tembro.json topilmadi. Avval ${ne("init")} ishlating.`}),s){let d=s.alias??"@",{componentsRoot:l,uiPath:u,libPath:h,hooksPath:p}=ew(s),f=s.cssPath??"src/index.css",b=[["components",l],["ui",u],["lib",h],["hooks",p]].filter(([,k])=>{let C=TD(e,k);return !C||!ht.default.existsSync(C)});Ke(r,{name:"paths",status:b.length?"warn":"pass",message:b.length?`Yetishmayotgan pathlar: ${b.map(([k,C])=>`${k}=${C}`).join(", ")}`:"Configured source paths mavjud."}),Ke(r,{name:"alias",status:Xy(e,d)||Zy(e,d)?"pass":"warn",message:Xy(e,d)||Zy(e,d)?`${d} alias tsconfig yoki vite configda topildi.`:`${d} alias topilmadi. Import pathlar ishlamasligi mumkin.`});let v=Qy(L__default.default.join(e,f)),y=PD(v);Ke(r,{name:"theme-css",status:y?"pass":"warn",message:y?`${f} ichida Tembro tokenlari bor.`:`${f} ichida Tembro tokenlari topilmadi. ${ne(`theme ${f}`)} ishlating.`});let x=DD(e,s);Ke(r,{name:"component-files",status:x.missingFiles.length?"warn":"pass",message:x.missingFiles.length?`Yetishmayotgan component fayllari: ${x.missingFiles.slice(0,8).join(", ")}${x.missingFiles.length>8?` (+${x.missingFiles.length-8})`:""}`:`${x.copiedItems.length} ta copied component file set tekshirildi.`}),Ke(r,{name:"registry-dependencies",status:x.missingRegistryDependencies.length?"warn":"pass",message:x.missingRegistryDependencies.length?`Yetishmayotgan registry dependencylar: ${x.missingRegistryDependencies.slice(0,8).join(", ")}${x.missingRegistryDependencies.length>8?` (+${x.missingRegistryDependencies.length-8})`:""}`:"Copied componentlar uchun registry dependencylar joyida."}),Ke(r,{name:"component-dependencies",status:x.missingPackages.length?"warn":"pass",message:x.missingPackages.length?`Copied componentlar uchun yetishmayotgan package dependencylar: ${x.missingPackages.join(", ")}`:"Copied component package dependencylari package.json ichida bor."});}if(o){let d=tw(e,["@fontsource-variable/geist","clsx","tailwind-merge","tw-animate-css"]);Ke(r,{name:"base-dependencies",status:d.length?"warn":"pass",message:d.length?`Yetishmayotgan dependencylar: ${d.join(", ")}`:"Base dependencylar package.json ichida bor."});}let a=r.filter(d=>d.status==="fail"),c=r.filter(d=>d.status==="warn");if(t.json){console.log(JSON.stringify({ok:a.length===0,checks:r},null,2));return}for(let d of r){let l=`${d.status.toUpperCase()} ${d.name}: ${d.message}`;d.status==="pass"&&S.success(l),d.status==="warn"&&S.warn(l),d.status==="fail"&&S.error(l);}if(a.length&&(S.error(`Doctor failed: ${a.length} fail, ${c.length} warn.`),process.exit(1)),c.length){S.warn(`Doctor completed with ${c.length} warning.`);return}S.success("Doctor passed. Project Tembro setup looks ready.");}var Wa=Ce(it());async function iw(t){let e=process.cwd(),r=L__default.default.join(e,"tembro.json"),i=Wa.default.existsSync(r)?await Wa.default.readJson(r):{},n=t??i.cssPath??i.globalCssPath??"src/index.css",o=i.paths?.components??i.componentsPath??"src/components",s=await In({cwd:e,cssPath:n,componentsPath:o});S.success(`Tembro theme CSS yangilandi: ${s}`);}var nw={minimal:["button","input","card","badge"],dashboard:["button","input","card","badge","dropdown-menu","skeleton","tabs","page-state","filter-bar","description-list","info-card","data-table"]};async function ow(t,e={}){let r=nw[t];r||(S.error(`Preset topilmadi: ${t}`),process.exit(1)),await Rn(r,e);}var pt=new Dt;pt.name("tembro").description("Tembro source-copy CLI").version("3.1.7");pt.command("init").description("Initialize local Tembro source files in your project").option("--template <template>","Project defaults: vite or next").option("--skip-install","Do not install base dependencies").option("-y, --defaults","Use template defaults without interactive prompts").action(Fy);pt.command("preset").description("Add a source-copy preset to your project").argument("<name>","preset name: minimal or dashboard").option("-o, --overwrite","overwrite existing files").option("--dry-run","show files without writing").option("--skip-install","do not install package dependencies").action(ow);pt.command("list").description("List available registry components").option("--category <category>","Filter by registry category").option("--status <status>","Filter by status: stable, preview, experimental, internal").option("--json","Print machine-readable JSON").action(Ky);pt.command("doctor").description("Check local project setup for Tembro source-copy usage").option("--json","Print machine-readable JSON").action(rw);pt.command("add").description("Copy component source files into your project").argument("[components...]","components to add").option("-o, --overwrite","overwrite existing files").option("--dry-run","show files without writing").option("--plan","print machine-readable copy plan without writing").option("--skip-install","do not install package dependencies").action(Rn);pt.command("theme").description("Write or update Tembro theme CSS in your global CSS file").argument("[cssPath]","global CSS path, default from tembro.json or src/index.css").action(iw);pt.parse();
1991
+ Usage:`),console.log(` ${re("add button input data-table")}`),console.log(` ${re("add form --overwrite")}`),console.log(` ${re("list --category data-table")}`),console.log(` ${re("list --json")}`);}var mt=be(qe());function Ja(t){try{return mt.default.readJsonSync(t)}catch{return null}}function ow(t){try{return mt.default.readFileSync(t,"utf8")}catch{return null}}function FP(t,e){return e?L__default.default.resolve(t,e):null}function sw(t){let e=t.paths?.components??t.componentsPath??"src/components",r=t.paths?.ui??t.componentsPath??L__default.default.join(e,"ui"),i=t.paths?.lib??L__default.default.dirname(t.utilsPath??"src/lib/utils.ts"),n=t.paths?.hooks??"src/hooks",o=t.utilsPath??L__default.default.join(i,"utils.ts");return {componentsRoot:e,uiPath:r,libPath:i,hooksPath:n,utilsPath:o}}function jP(t,e){let r=sw(e);return t.replace("{components}",r.componentsRoot).replace("{ui}",r.uiPath).replace("{hooks}",r.hooksPath).replace("{lib}",r.libPath).replace("{utils}",r.utilsPath)}function iw(t,e){return ["tsconfig.app.json","tsconfig.json"].map(i=>L__default.default.join(t,i)).some(i=>!!Ja(i)?.compilerOptions?.paths?.[`${e}/*`])}function nw(t,e){return ["vite.config.ts","vite.config.js","vite.config.mjs"].map(i=>L__default.default.join(t,i)).some(i=>{let n=ow(i);return !!(n?.includes(`"${e}"`)||n?.includes(`'${e}'`))})}function aw(t,e){let r=Ja(L__default.default.join(t,"package.json")),i=new Set([...Object.keys(r?.dependencies??{}),...Object.keys(r?.devDependencies??{})]);return e.filter(n=>!i.has(n))}function Ya(t,e){return (t.files??[]).map(r=>({source:r.source,target:jP(r.target,e)}))}function NP(t,e){return At.map(r=>R[r]).filter(r=>r.category!=="lib").filter(r=>!r.migrationAliasFor).filter(r=>r.files?.length).filter(r=>Ya(r,e).some(i=>mt.default.existsSync(L__default.default.join(t,i.target))))}function qP(t,e){let r=NP(t,e),i=[],n=[],o=new Set;for(let s of r){for(let a of Ya(s,e))mt.default.existsSync(L__default.default.join(t,a.target))||i.push(`${s.name}: ${a.target}`);for(let a of s.registryDependencies??[]){let c=R[a];if(!c?.files?.length)continue;Ya(c,e).some(l=>mt.default.existsSync(L__default.default.join(t,l.target)))||n.push(`${s.name} -> ${a}`);}for(let a of s.dependencies??[])o.add(a);}return {copiedItems:r,missingFiles:i,missingRegistryDependencies:n,missingPackages:aw(t,Array.from(o).sort())}}function Ze(t,e){t.push(e);}function LP(t){return t?t.includes("/* tembro:start */")||t.includes("--aui-")||t.includes("--az-"):false}function cw(t={}){let e=process.cwd(),r=[],i=L__default.default.join(e,"package.json"),n=L__default.default.join(e,"tembro.json"),o=mt.default.existsSync(i),s=Ja(n);if(Ze(r,{name:"package.json",status:o?"pass":"fail",message:o?"package.json topildi.":"package.json topilmadi. Commandni React, Vite yoki Next project ichida ishlating."}),Ze(r,{name:"tembro.json",status:s?"pass":"fail",message:s?"tembro.json topildi.":`tembro.json topilmadi. Avval ${re("init")} ishlating.`}),s){let d=s.alias??"@",{componentsRoot:l,uiPath:u,libPath:h,hooksPath:p}=sw(s),m=s.cssPath??"src/index.css",b=[["components",l],["ui",u],["lib",h],["hooks",p]].filter(([,C])=>{let M=FP(e,C);return !M||!mt.default.existsSync(M)});Ze(r,{name:"paths",status:b.length?"warn":"pass",message:b.length?`Yetishmayotgan pathlar: ${b.map(([C,M])=>`${C}=${M}`).join(", ")}`:"Configured source paths mavjud."}),Ze(r,{name:"alias",status:iw(e,d)||nw(e,d)?"pass":"warn",message:iw(e,d)||nw(e,d)?`${d} alias tsconfig yoki vite configda topildi.`:`${d} alias topilmadi. Import pathlar ishlamasligi mumkin.`});let y=ow(L__default.default.join(e,m)),w=LP(y);Ze(r,{name:"theme-css",status:w?"pass":"warn",message:w?`${m} ichida Tembro tokenlari bor.`:`${m} ichida Tembro tokenlari topilmadi. ${re(`theme ${m}`)} ishlating.`});let S=qP(e,s);Ze(r,{name:"component-files",status:S.missingFiles.length?"warn":"pass",message:S.missingFiles.length?`Yetishmayotgan component fayllari: ${S.missingFiles.slice(0,8).join(", ")}${S.missingFiles.length>8?` (+${S.missingFiles.length-8})`:""}`:`${S.copiedItems.length} ta copied component file set tekshirildi.`}),Ze(r,{name:"registry-dependencies",status:S.missingRegistryDependencies.length?"warn":"pass",message:S.missingRegistryDependencies.length?`Yetishmayotgan registry dependencylar: ${S.missingRegistryDependencies.slice(0,8).join(", ")}${S.missingRegistryDependencies.length>8?` (+${S.missingRegistryDependencies.length-8})`:""}`:"Copied componentlar uchun registry dependencylar joyida."}),Ze(r,{name:"component-dependencies",status:S.missingPackages.length?"warn":"pass",message:S.missingPackages.length?`Copied componentlar uchun yetishmayotgan package dependencylar: ${S.missingPackages.join(", ")}`:"Copied component package dependencylari package.json ichida bor."});}if(o){let d=aw(e,["@fontsource-variable/geist","clsx","tailwind-merge","tw-animate-css"]);Ze(r,{name:"base-dependencies",status:d.length?"warn":"pass",message:d.length?`Yetishmayotgan dependencylar: ${d.join(", ")}`:"Base dependencylar package.json ichida bor."});}let a=r.filter(d=>d.status==="fail"),c=r.filter(d=>d.status==="warn");if(t.json){console.log(JSON.stringify({ok:a.length===0,checks:r},null,2));return}for(let d of r){let l=`${d.status.toUpperCase()} ${d.name}: ${d.message}`;d.status==="pass"&&x.success(l),d.status==="warn"&&x.warn(l),d.status==="fail"&&x.error(l);}if(a.length&&(x.error(`Doctor failed: ${a.length} fail, ${c.length} warn.`),process.exit(1)),c.length){x.warn(`Doctor completed with ${c.length} warning.`);return}x.success("Doctor passed. Project Tembro setup looks ready.");}var Ka=be(qe());async function lw(t){let e=process.cwd(),r=L__default.default.join(e,"tembro.json"),i=Ka.default.existsSync(r)?await Ka.default.readJson(r):{},n=t??i.cssPath??i.globalCssPath??"src/index.css",o=i.paths?.components??i.componentsPath??"src/components",s=await Mn({cwd:e,cssPath:n,componentsPath:o});x.success(`Tembro theme CSS yangilandi: ${s}`);}var dw={minimal:["button","input","card","badge"],dashboard:["button","input","card","badge","dropdown-menu","skeleton","tabs","page-state","filter-bar","description-list","info-card","data-table"]};async function uw(t,e={}){let r=dw[t];r||(x.error(`Preset topilmadi: ${t}`),process.exit(1)),await Dt(r,e);}var Qe=new $t;Qe.name("tembro").description("Tembro source-copy CLI").version("3.1.9");Qe.command("init").description("Initialize local Tembro source files in your project").option("--template <template>","Project defaults: vite or next").option("--skip-install","Do not install base dependencies").option("--showcase","Add every component and write a local Tembro workbench").option("-y, --defaults","Use template defaults without interactive prompts").action(Ky);Qe.command("preset").description("Add a source-copy preset to your project").argument("<name>","preset name: minimal or dashboard").option("-o, --overwrite","overwrite existing files").option("--dry-run","show files without writing").option("--skip-install","do not install package dependencies").action(uw);Qe.command("list").description("List available registry components").option("--category <category>","Filter by registry category").option("--status <status>","Filter by status: stable, preview, experimental, internal").option("--json","Print machine-readable JSON").action(rw);Qe.command("doctor").description("Check local project setup for Tembro source-copy usage").option("--json","Print machine-readable JSON").action(cw);Qe.command("add").description("Copy component source files into your project").argument("[components...]","components to add").option("-o, --overwrite","overwrite existing files").option("--dry-run","show files without writing").option("--plan","print machine-readable copy plan without writing").option("--skip-install","do not install package dependencies").action(Dt);Qe.command("showcase").description("Add every component and write a local Tembro workbench").option("-o, --overwrite","overwrite existing files").option("--dry-run","show files without writing").option("--skip-install","do not install package dependencies").action(t=>Dt(["showcase"],t));Qe.command("theme").description("Write or update Tembro theme CSS in your global CSS file").argument("[cssPath]","global CSS path, default from tembro.json or src/index.css").action(lw);Qe.parse();