@nice-move/cli 0.11.14 → 0.11.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/992.mjs DELETED
@@ -1 +0,0 @@
1
- export const id=992;export const ids=[992];export const modules={4078:(t,e,r)=>{const s=r(303),n=r(5111),i=r(9288),o=r(3585),a=(t,e={})=>{let r=[];if(Array.isArray(t))for(const s of t){const t=a.create(s,e);Array.isArray(t)?r.push(...t):r.push(t)}else r=[].concat(a.create(t,e));return e&&!0===e.expand&&!0===e.nodupes&&(r=[...new Set(r)]),r};a.parse=(t,e={})=>o(t,e),a.stringify=(t,e={})=>s("string"==typeof t?a.parse(t,e):t,e),a.compile=(t,e={})=>("string"==typeof t&&(t=a.parse(t,e)),n(t,e)),a.expand=(t,e={})=>{"string"==typeof t&&(t=a.parse(t,e));let r=i(t,e);return!0===e.noempty&&(r=r.filter(Boolean)),!0===e.nodupes&&(r=[...new Set(r)]),r},a.create=(t,e={})=>""===t||t.length<3?[t]:!0!==e.expand?a.compile(t,e):a.expand(t,e),t.exports=a},5111:(t,e,r)=>{const s=r(2411),n=r(1811);t.exports=(t,e={})=>{const r=(t,i={})=>{const o=n.isInvalidBrace(i),a=!0===t.invalid&&!0===e.escapeInvalid,c=!0===o||!0===a,l=!0===e.escapeInvalid?"\\":"";let u="";if(!0===t.isOpen)return l+t.value;if(!0===t.isClose)return console.log("node.isClose",l,t.value),l+t.value;if("open"===t.type)return c?l+t.value:"(";if("close"===t.type)return c?l+t.value:")";if("comma"===t.type)return"comma"===t.prev.type?"":c?t.value:"|";if(t.value)return t.value;if(t.nodes&&t.ranges>0){const r=n.reduce(t.nodes),i=s(...r,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(0!==i.length)return r.length>1&&i.length>1?`(${i})`:i}if(t.nodes)for(const e of t.nodes)u+=r(e,t);return u};return r(t)}},803:t=>{t.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:"\xa0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"}},9288:(t,e,r)=>{const s=r(2411),n=r(303),i=r(1811),o=(t="",e="",r=!1)=>{const s=[];if(t=[].concat(t),!(e=[].concat(e)).length)return t;if(!t.length)return r?i.flatten(e).map((t=>`{${t}}`)):e;for(const n of t)if(Array.isArray(n))for(const t of n)s.push(o(t,e,r));else for(let t of e)!0===r&&"string"==typeof t&&(t=`{${t}}`),s.push(Array.isArray(t)?o(n,t,r):n+t);return i.flatten(s)};t.exports=(t,e={})=>{const r=void 0===e.rangeLimit?1e3:e.rangeLimit,a=(t,c={})=>{t.queue=[];let l=c,u=c.queue;for(;"brace"!==l.type&&"root"!==l.type&&l.parent;)l=l.parent,u=l.queue;if(t.invalid||t.dollar)return void u.push(o(u.pop(),n(t,e)));if("brace"===t.type&&!0!==t.invalid&&2===t.nodes.length)return void u.push(o(u.pop(),["{}"]));if(t.nodes&&t.ranges>0){const a=i.reduce(t.nodes);if(i.exceedsLimit(...a,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let c=s(...a,e);return 0===c.length&&(c=n(t,e)),u.push(o(u.pop(),c)),void(t.nodes=[])}const p=i.encloseBrace(t);let d=t.queue,h=t;for(;"brace"!==h.type&&"root"!==h.type&&h.parent;)h=h.parent,d=h.queue;for(let e=0;e<t.nodes.length;e++){const r=t.nodes[e];"comma"!==r.type||"brace"!==t.type?"close"!==r.type?r.value&&"open"!==r.type?d.push(o(d.pop(),r.value)):r.nodes&&a(r,t):u.push(o(u.pop(),d,p)):(1===e&&d.push(""),d.push(""))}return d};return i.flatten(a(t))}},3585:(t,e,r)=>{const s=r(303),{MAX_LENGTH:n,CHAR_BACKSLASH:i,CHAR_BACKTICK:o,CHAR_COMMA:a,CHAR_DOT:c,CHAR_LEFT_PARENTHESES:l,CHAR_RIGHT_PARENTHESES:u,CHAR_LEFT_CURLY_BRACE:p,CHAR_RIGHT_CURLY_BRACE:d,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_RIGHT_SQUARE_BRACKET:f,CHAR_DOUBLE_QUOTE:g,CHAR_SINGLE_QUOTE:m,CHAR_NO_BREAK_SPACE:y,CHAR_ZERO_WIDTH_NOBREAK_SPACE:E}=r(803);t.exports=(t,e={})=>{if("string"!=typeof t)throw new TypeError("Expected a string");const r=e||{},b="number"==typeof r.maxLength?Math.min(n,r.maxLength):n;if(t.length>b)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${b})`);const w={type:"root",input:t,nodes:[]},S=[w];let A=w,R=w,C=0;const v=t.length;let T,O=0,x=0;const k=()=>t[O++],_=t=>{if("text"===t.type&&"dot"===R.type&&(R.type="text"),!R||"text"!==R.type||"text"!==t.type)return A.nodes.push(t),t.parent=A,t.prev=R,R=t,t;R.value+=t.value};for(_({type:"bos"});O<v;)if(A=S[S.length-1],T=k(),T!==E&&T!==y)if(T!==i)if(T!==f)if(T!==h)if(T!==l)if(T!==u)if(T!==g&&T!==m&&T!==o)if(T!==p)if(T!==d)if(T===a&&x>0){if(A.ranges>0){A.ranges=0;const t=A.nodes.shift();A.nodes=[t,{type:"text",value:s(A)}]}_({type:"comma",value:T}),A.commas++}else if(T===c&&x>0&&0===A.commas){const t=A.nodes;if(0===x||0===t.length){_({type:"text",value:T});continue}if("dot"===R.type){if(A.range=[],R.value+=T,R.type="range",3!==A.nodes.length&&5!==A.nodes.length){A.invalid=!0,A.ranges=0,R.type="text";continue}A.ranges++,A.args=[];continue}if("range"===R.type){t.pop();const e=t[t.length-1];e.value+=R.value+T,R=e,A.ranges--;continue}_({type:"dot",value:T})}else _({type:"text",value:T});else{if("brace"!==A.type){_({type:"text",value:T});continue}const t="close";A=S.pop(),A.close=!0,_({type:t,value:T}),x--,A=S[S.length-1]}else{x++;const t=R.value&&"$"===R.value.slice(-1)||!0===A.dollar;A=_({type:"brace",open:!0,close:!1,dollar:t,depth:x,commas:0,ranges:0,nodes:[]}),S.push(A),_({type:"open",value:T})}else{const t=T;let r;for(!0!==e.keepQuotes&&(T="");O<v&&(r=k());)if(r!==i){if(r===t){!0===e.keepQuotes&&(T+=r);break}T+=r}else T+=r+k();_({type:"text",value:T})}else{if("paren"!==A.type){_({type:"text",value:T});continue}A=S.pop(),_({type:"text",value:T}),A=S[S.length-1]}else A=_({type:"paren",nodes:[]}),S.push(A),_({type:"text",value:T});else{let t;for(C++;O<v&&(t=k());)if(T+=t,t!==h)if(t!==i){if(t===f&&(C--,0===C))break}else T+=k();else C++;_({type:"text",value:T})}else _({type:"text",value:"\\"+T});else _({type:"text",value:(e.keepEscaping?T:"")+k()});do{if(A=S.pop(),"root"!==A.type){A.nodes.forEach((t=>{t.nodes||("open"===t.type&&(t.isOpen=!0),"close"===t.type&&(t.isClose=!0),t.nodes||(t.type="text"),t.invalid=!0)}));const t=S[S.length-1],e=t.nodes.indexOf(A);t.nodes.splice(e,1,...A.nodes)}}while(S.length>0);return _({type:"eos"}),w}},303:(t,e,r)=>{const s=r(1811);t.exports=(t,e={})=>{const r=(t,n={})=>{const i=e.escapeInvalid&&s.isInvalidBrace(n),o=!0===t.invalid&&!0===e.escapeInvalid;let a="";if(t.value)return(i||o)&&s.isOpenOrClose(t)?"\\"+t.value:t.value;if(t.value)return t.value;if(t.nodes)for(const e of t.nodes)a+=r(e);return a};return r(t)}},1811:(t,e)=>{e.isInteger=t=>"number"==typeof t?Number.isInteger(t):"string"==typeof t&&""!==t.trim()&&Number.isInteger(Number(t)),e.find=(t,e)=>t.nodes.find((t=>t.type===e)),e.exceedsLimit=(t,r,s=1,n)=>!1!==n&&(!(!e.isInteger(t)||!e.isInteger(r))&&(Number(r)-Number(t))/Number(s)>=n),e.escapeNode=(t,e=0,r)=>{const s=t.nodes[e];s&&(r&&s.type===r||"open"===s.type||"close"===s.type)&&!0!==s.escaped&&(s.value="\\"+s.value,s.escaped=!0)},e.encloseBrace=t=>"brace"===t.type&&(!(t.commas>>0+t.ranges)&&(t.invalid=!0,!0)),e.isInvalidBrace=t=>"brace"===t.type&&(!(!0!==t.invalid&&!t.dollar)||(t.commas>>0+t.ranges?(!0!==t.open||!0!==t.close)&&(t.invalid=!0,!0):(t.invalid=!0,!0))),e.isOpenOrClose=t=>"open"===t.type||"close"===t.type||(!0===t.open||!0===t.close),e.reduce=t=>t.reduce(((t,e)=>("text"===e.type&&t.push(e.value),"range"===e.type&&(e.type="text"),t)),[]),e.flatten=(...t)=>{const e=[],r=t=>{for(let s=0;s<t.length;s++){const n=t[s];Array.isArray(n)?r(n):void 0!==n&&e.push(n)}return e};return r(t),e}},526:(t,e,r)=>{const s=r(5317),n=r(4705),i=r(2369);function o(t,e,r){const o=n(t,e,r),a=s.spawn(o.command,o.args,o.options);return i.hookChildProcess(a,o),a}t.exports=o,t.exports.spawn=o,t.exports.sync=function(t,e,r){const o=n(t,e,r),a=s.spawnSync(o.command,o.args,o.options);return a.error=a.error||i.verifyENOENTSync(a.status,o),a},t.exports._parse=n,t.exports._enoent=i},2369:t=>{const e="win32"===process.platform;function r(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 s(t,s){return e&&1===t&&!s.file?r(s.original,"spawn"):null}t.exports={hookChildProcess:function(t,r){if(!e)return;const n=t.emit;t.emit=function(e,i){if("exit"===e){const e=s(i,r);if(e)return n.call(t,"error",e)}return n.apply(t,arguments)}},verifyENOENT:s,verifyENOENTSync:function(t,s){return e&&1===t&&!s.file?r(s.original,"spawnSync"):null},notFoundError:r}},4705:(t,e,r)=>{const s=r(6928),n=r(6694),i=r(1192),o=r(3179),a="win32"===process.platform,c=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function u(t){if(!a)return t;const e=function(t){t.file=n(t);const e=t.file&&o(t.file);return e?(t.args.unshift(t.file),t.command=e,n(t)):t.file}(t),r=!c.test(e);if(t.options.forceShell||r){const r=l.test(e);t.command=s.normalize(t.command),t.command=i.command(t.command),t.args=t.args.map((t=>i.argument(t,r)));const n=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${n}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}t.exports=function(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null);const s={command:t,args:e=e?e.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:t,args:e}};return r.shell?s:u(s)}},1192:t=>{const e=/([()\][%!^"`<>&|;, *?])/g;t.exports.command=function(t){return t=t.replace(e,"^$1")},t.exports.argument=function(t,r){return t=(t=`"${t=(t=(t=`${t}`).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(e,"^$1"),r&&(t=t.replace(e,"^$1")),t}},3179:(t,e,r)=>{const s=r(9896),n=r(600);t.exports=function(t){const e=Buffer.alloc(150);let r;try{r=s.openSync(t,"r"),s.readSync(r,e,0,150,0),s.closeSync(r)}catch(t){}return n(e.toString())}},6694:(t,e,r)=>{const s=r(6928),n=r(1905),i=r(9695);function o(t,e){const r=t.options.env||process.env,o=process.cwd(),a=null!=t.options.cwd,c=a&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(t.options.cwd)}catch(t){}let l;try{l=n.sync(t.command,{path:r[i({env:r})],pathExt:e?s.delimiter:void 0})}catch(t){}finally{c&&process.chdir(o)}return l&&(l=s.resolve(a?t.options.cwd:"",l)),l}t.exports=function(t){return o(t)||o(t,!0)}},7281:(t,e,r)=>{e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;e.splice(1,0,r,"color: inherit");let s=0,n=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(s++,"%c"===t&&(n=s))})),e.splice(n,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=r(7e3)(e);const{formatters:s}=t.exports;s.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},7e3:(t,e,r)=>{t.exports=function(t){function e(t){let r,n,i,o=null;function a(...t){if(!a.enabled)return;const s=a,n=Number(new Date),i=n-(r||n);s.diff=i,s.prev=r,s.curr=n,r=n,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let o=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((r,n)=>{if("%%"===r)return"%";o++;const i=e.formatters[n];if("function"==typeof i){const e=t[o];r=i.call(s,e),t.splice(o,1),o--}return r})),e.formatArgs.call(s,t);(s.log||e.log).apply(s,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=s,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(n!==e.namespaces&&(n=e.namespaces,i=e.enabled(t)),i),set:t=>{o=t}}),"function"==typeof e.init&&e.init(a),a}function s(t,r){const s=e(this.namespace+(void 0===r?":":r)+t);return s.log=this.log,s}function n(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(n),...e.skips.map(n).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let r;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const s=("string"==typeof t?t:"").split(/[\s,]+/),n=s.length;for(r=0;r<n;r++)s[r]&&("-"===(t=s[r].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let r,s;for(r=0,s=e.skips.length;r<s;r++)if(e.skips[r].test(t))return!1;for(r=0,s=e.names.length;r<s;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=r(7821),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((r=>{e[r]=t[r]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let r=0;for(let e=0;e<t.length;e++)r=(r<<5)-r+t.charCodeAt(e),r|=0;return e.colors[Math.abs(r)%e.colors.length]},e.enable(e.load()),e}},4833:(t,e,r)=>{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?t.exports=r(7281):t.exports=r(5833)},5833:(t,e,r)=>{const s=r(2018),n=r(9023);e.init=function(t){t.inspectOpts={};const r=Object.keys(e.inspectOpts);for(let s=0;s<r.length;s++)t.inspectOpts[r[s]]=e.inspectOpts[r[s]]},e.log=function(...t){return process.stderr.write(n.formatWithOptions(e.inspectOpts,...t)+"\n")},e.formatArgs=function(r){const{namespace:s,useColors:n}=this;if(n){const e=this.color,n="\x1b[3"+(e<8?e:"8;5;"+e),i=` ${n};1m${s} \x1b[0m`;r[0]=i+r[0].split("\n").join("\n"+i),r.push(n+"m+"+t.exports.humanize(this.diff)+"\x1b[0m")}else r[0]=function(){if(e.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+s+" "+r[0]},e.save=function(t){t?process.env.DEBUG=t:delete process.env.DEBUG},e.load=function(){return process.env.DEBUG},e.useColors=function(){return"colors"in e.inspectOpts?Boolean(e.inspectOpts.colors):s.isatty(process.stderr.fd)},e.destroy=n.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{const t=r(1754);t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(t){}e.inspectOpts=Object.keys(process.env).filter((t=>/^debug_/i.test(t))).reduce(((t,e)=>{const r=e.substring(6).toLowerCase().replace(/_([a-z])/g,((t,e)=>e.toUpperCase()));let s=process.env[e];return s=!!/^(yes|on|true|enabled)$/i.test(s)||!/^(no|off|false|disabled)$/i.test(s)&&("null"===s?null:Number(s)),t[r]=s,t}),{}),t.exports=r(7e3)(e);const{formatters:i}=t.exports;i.o=function(t){return this.inspectOpts.colors=this.useColors,n.inspect(t,this.inspectOpts).split("\n").map((t=>t.trim())).join(" ")},i.O=function(t){return this.inspectOpts.colors=this.useColors,n.inspect(t,this.inspectOpts)}},6296:t=>{var e=Object.prototype.hasOwnProperty,r="~";function s(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function i(t,e,s,i,o){if("function"!=typeof s)throw new TypeError("The listener must be a function");var a=new n(s,i||t,o),c=r?r+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],a]:t._events[c].push(a):(t._events[c]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function a(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,s,n=[];if(0===this._eventsCount)return n;for(s in t=this._events)e.call(t,s)&&n.push(r?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=r?r+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,i=s.length,o=new Array(i);n<i;n++)o[n]=s[n].fn;return o},a.prototype.listenerCount=function(t){var e=r?r+t:t,s=this._events[e];return s?s.fn?1:s.length:0},a.prototype.emit=function(t,e,s,n,i,o){var a=r?r+t:t;if(!this._events[a])return!1;var c,l,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,s),!0;case 4:return u.fn.call(u.context,e,s,n),!0;case 5:return u.fn.call(u.context,e,s,n,i),!0;case 6:return u.fn.call(u.context,e,s,n,i,o),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,h=u.length;for(l=0;l<h;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,s);break;case 4:u[l].fn.call(u[l].context,e,s,n);break;default:if(!c)for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(t,e,r){return i(this,t,e,r,!1)},a.prototype.once=function(t,e,r){return i(this,t,e,r,!0)},a.prototype.removeListener=function(t,e,s,n){var i=r?r+t:t;if(!this._events[i])return this;if(!e)return o(this,i),this;var a=this._events[i];if(a.fn)a.fn!==e||n&&!a.once||s&&a.context!==s||o(this,i);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==e||n&&!a[c].once||s&&a[c].context!==s)&&l.push(a[c]);l.length?this._events[i]=1===l.length?l[0]:l:o(this,i)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&o(this,e)):(this._events=new s,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a},2411:(t,e,r)=>{const s=r(9023),n=r(4710),i=t=>null!==t&&"object"==typeof t&&!Array.isArray(t),o=t=>"number"==typeof t||"string"==typeof t&&""!==t,a=t=>Number.isInteger(+t),c=t=>{let e=`${t}`,r=-1;if("-"===e[0]&&(e=e.slice(1)),"0"===e)return!1;for(;"0"===e[++r];);return r>0},l=(t,e,r)=>{if(e>0){let r="-"===t[0]?"-":"";r&&(t=t.slice(1)),t=r+t.padStart(r?e-1:e,"0")}return!1===r?String(t):t},u=(t,e)=>{let r="-"===t[0]?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},p=(t,e,r,s)=>{if(r)return n(t,e,{wrap:!1,...s});let i=String.fromCharCode(t);return t===e?i:`[${i}-${String.fromCharCode(e)}]`},d=(t,e,r)=>{if(Array.isArray(t)){let e=!0===r.wrap,s=r.capture?"":"?:";return e?`(${s}${t.join("|")})`:t.join("|")}return n(t,e,r)},h=(...t)=>new RangeError("Invalid range arguments: "+s.inspect(...t)),f=(t,e,r)=>{if(!0===r.strictRanges)throw h([t,e]);return[]},g=(t,e,r=1,s={})=>{let n=Number(t),i=Number(e);if(!Number.isInteger(n)||!Number.isInteger(i)){if(!0===s.strictRanges)throw h([t,e]);return[]}0===n&&(n=0),0===i&&(i=0);let o=n>i,a=String(t),f=String(e),g=String(r);r=Math.max(Math.abs(r),1);let m=c(a)||c(f)||c(g),y=m?Math.max(a.length,f.length,g.length):0,E=!1===m&&!1===((t,e,r)=>"string"==typeof t||"string"==typeof e||!0===r.stringify)(t,e,s),b=s.transform||(t=>e=>!0===t?Number(e):String(e))(E);if(s.toRegex&&1===r)return p(u(t,y),u(e,y),!0,s);let w={negatives:[],positives:[]},S=[],A=0;for(;o?n>=i:n<=i;)!0===s.toRegex&&r>1?w[(R=n)<0?"negatives":"positives"].push(Math.abs(R)):S.push(l(b(n,A),y,E)),n=o?n-r:n+r,A++;var R;return!0===s.toRegex?r>1?((t,e,r)=>{t.negatives.sort(((t,e)=>t<e?-1:t>e?1:0)),t.positives.sort(((t,e)=>t<e?-1:t>e?1:0));let s,n=e.capture?"":"?:",i="",o="";return t.positives.length&&(i=t.positives.map((t=>u(String(t),r))).join("|")),t.negatives.length&&(o=`-(${n}${t.negatives.map((t=>u(String(t),r))).join("|")})`),s=i&&o?`${i}|${o}`:i||o,e.wrap?`(${n}${s})`:s})(w,s,y):d(S,null,{wrap:!1,...s}):S},m=(t,e,r,s={})=>{if(null==e&&o(t))return[t];if(!o(t)||!o(e))return f(t,e,s);if("function"==typeof r)return m(t,e,1,{transform:r});if(i(r))return m(t,e,0,r);let n={...s};return!0===n.capture&&(n.wrap=!0),r=r||n.step||1,a(r)?a(t)&&a(e)?g(t,e,r,n):((t,e,r=1,s={})=>{if(!a(t)&&t.length>1||!a(e)&&e.length>1)return f(t,e,s);let n=s.transform||(t=>String.fromCharCode(t)),i=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),c=i>o,l=Math.min(i,o),u=Math.max(i,o);if(s.toRegex&&1===r)return p(l,u,!1,s);let h=[],g=0;for(;c?i>=o:i<=o;)h.push(n(i,g)),i=c?i-r:i+r,g++;return!0===s.toRegex?d(h,null,{wrap:!1,options:s}):h})(t,e,Math.max(Math.abs(r),1),n):null==r||i(r)?m(t,e,1,r):((t,e)=>{if(!0===e.strictRanges)throw new TypeError(`Expected step "${t}" to be a number`);return[]})(r,n)};t.exports=m},4891:t=>{t.exports=(t,e)=>{e=e||process.argv;const r=t.startsWith("-")?"":1===t.length?"-":"--",s=e.indexOf(r+t),n=e.indexOf("--");return-1!==s&&(-1===n||s<n)}},9789:t=>{t.exports=function(t){return"number"==typeof t?t-t==0:"string"==typeof t&&""!==t.trim()&&(Number.isFinite?Number.isFinite(+t):isFinite(+t))}},9344:(t,e,r)=>{var s;r(9896);function n(t,e,r){if("function"==typeof e&&(r=e,e={}),!r){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise((function(r,s){n(t,e||{},(function(t,e){t?s(t):r(e)}))}))}s(t,e||{},(function(t,s){t&&("EACCES"===t.code||e&&e.ignoreErrors)&&(t=null,s=!1),r(t,s)}))}s="win32"===process.platform||global.TESTING_WINDOWS?r(8541):r(709),t.exports=n,n.sync=function(t,e){try{return s.sync(t,e||{})}catch(t){if(e&&e.ignoreErrors||"EACCES"===t.code)return!1;throw t}}},709:(t,e,r)=>{t.exports=n,n.sync=function(t,e){return i(s.statSync(t),e)};var s=r(9896);function n(t,e,r){s.stat(t,(function(t,s){r(t,!t&&i(s,e))}))}function i(t,e){return t.isFile()&&function(t,e){var r=t.mode,s=t.uid,n=t.gid,i=void 0!==e.uid?e.uid:process.getuid&&process.getuid(),o=void 0!==e.gid?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c;return r&l||r&c&&n===o||r&a&&s===i||r&u&&0===i}(t,e)}},8541:(t,e,r)=>{t.exports=i,i.sync=function(t,e){return n(s.statSync(t),t,e)};var s=r(9896);function n(t,e,r){return!(!t.isSymbolicLink()&&!t.isFile())&&function(t,e){var r=void 0!==e.pathExt?e.pathExt:process.env.PATHEXT;if(!r)return!0;if(-1!==(r=r.split(";")).indexOf(""))return!0;for(var s=0;s<r.length;s++){var n=r[s].toLowerCase();if(n&&t.substr(-n.length).toLowerCase()===n)return!0}return!1}(e,r)}function i(t,e,r){s.stat(t,(function(s,i){r(s,!s&&n(i,t,e))}))}},1404:(t,e,r)=>{const{PassThrough:s}=r(2203);t.exports=function(){var t=[],e=new s({objectMode:!0});return e.setMaxListeners(0),e.add=r,e.isEmpty=function(){return 0==t.length},e.on("unpipe",n),Array.prototype.slice.call(arguments).forEach(r),e;function r(s){return Array.isArray(s)?(s.forEach(r),this):(t.push(s),s.once("end",n.bind(null,s)),s.once("error",e.emit.bind(e,"error")),s.pipe(e,{end:!1}),this)}function n(r){!(t=t.filter((function(t){return t!==r}))).length&&e.readable&&e.end()}}},1723:(t,e,r)=>{const s=r(9023),n=r(4078),i=r(5562),o=r(6927),a=t=>""===t||"./"===t,c=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let s=new Set,n=new Set,o=new Set,a=0,c=t=>{o.add(t.output),r&&r.onResult&&r.onResult(t)};for(let o=0;o<e.length;o++){let l=i(String(e[o]),{...r,onResult:c},!0),u=l.state.negated||l.state.negatedExtglob;u&&a++;for(let e of t){let t=l(e,!0);(u?!t.isMatch:t.isMatch)&&(u?s.add(t.output):(s.delete(t.output),n.add(t.output)))}}let l=(a===e.length?[...o]:[...n]).filter((t=>!s.has(t)));if(r&&0===l.length){if(!0===r.failglob)throw new Error(`No matches found for "${e.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?e.map((t=>t.replace(/\\/g,""))):e}return l};c.match=c,c.matcher=(t,e)=>i(t,e),c.any=c.isMatch=(t,e,r)=>i(e,r)(t),c.not=(t,e,r={})=>{e=[].concat(e).map(String);let s=new Set,n=[],i=new Set(c(t,e,{...r,onResult:t=>{r.onResult&&r.onResult(t),n.push(t.output)}}));for(let t of n)i.has(t)||s.add(t);return[...s]},c.contains=(t,e,r)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${s.inspect(t)}"`);if(Array.isArray(e))return e.some((e=>c.contains(t,e,r)));if("string"==typeof e){if(a(t)||a(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return c.isMatch(t,e,{...r,contains:!0})},c.matchKeys=(t,e,r)=>{if(!o.isObject(t))throw new TypeError("Expected the first argument to be an object");let s=c(Object.keys(t),e,r),n={};for(let e of s)n[e]=t[e];return n},c.some=(t,e,r)=>{let s=[].concat(t);for(let t of[].concat(e)){let e=i(String(t),r);if(s.some((t=>e(t))))return!0}return!1},c.every=(t,e,r)=>{let s=[].concat(t);for(let t of[].concat(e)){let e=i(String(t),r);if(!s.every((t=>e(t))))return!1}return!0},c.all=(t,e,r)=>{if("string"!=typeof t)throw new TypeError(`Expected a string: "${s.inspect(t)}"`);return[].concat(e).every((e=>i(e,r)(t)))},c.capture=(t,e,r)=>{let s=o.isWindows(r),n=i.makeRe(String(t),{...r,capture:!0}).exec(s?o.toPosixSlashes(e):e);if(n)return n.slice(1).map((t=>void 0===t?"":t))},c.makeRe=(...t)=>i.makeRe(...t),c.scan=(...t)=>i.scan(...t),c.parse=(t,e)=>{let r=[];for(let s of[].concat(t||[]))for(let t of n(String(s),e))r.push(i.parse(t,e));return r},c.braces=(t,e)=>{if("string"!=typeof t)throw new TypeError("Expected a string");return e&&!0===e.nobrace||!/\{.*\}/.test(t)?[t]:n(t,e)},c.braceExpand=(t,e)=>{if("string"!=typeof t)throw new TypeError("Expected a string");return c.braces(t,{...e,expand:!0})},t.exports=c},7821:t=>{var e=1e3,r=60*e,s=60*r,n=24*s,i=7*n,o=365.25*n;function a(t,e,r,s){var n=e>=1.5*r;return Math.round(t/r)+" "+s+(n?"s":"")}t.exports=function(t,c){c=c||{};var l=typeof t;if("string"===l&&t.length>0)return function(t){if((t=String(t)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*n;case"hours":case"hour":case"hrs":case"hr":case"h":return c*s;case"minutes":case"minute":case"mins":case"min":case"m":return c*r;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(t);if("number"===l&&isFinite(t))return c.long?function(t){var i=Math.abs(t);if(i>=n)return a(t,i,n,"day");if(i>=s)return a(t,i,s,"hour");if(i>=r)return a(t,i,r,"minute");if(i>=e)return a(t,i,e,"second");return t+" ms"}(t):function(t){var i=Math.abs(t);if(i>=n)return Math.round(t/n)+"d";if(i>=s)return Math.round(t/s)+"h";if(i>=r)return Math.round(t/r)+"m";if(i>=e)return Math.round(t/e)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},9695:t=>{const e=(t={})=>{const e=t.env||process.env;return"win32"!==(t.platform||process.platform)?"PATH":Object.keys(e).reverse().find((t=>"PATH"===t.toUpperCase()))||"Path"};t.exports=e,t.exports.default=e},5562:(t,e,r)=>{t.exports=r(8996)},4751:(t,e,r)=>{const s=r(6928),n="\\\\/",i=`[^${n}]`,o="\\.",a="\\/",c="[^/]",l=`(?:${a}|$)`,u=`(?:^|${a})`,p=`${o}{1,2}${l}`,d={DOT_LITERAL:o,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:a,ONE_CHAR:"(?=.)",QMARK:c,END_ANCHOR:l,DOTS_SLASH:p,NO_DOT:`(?!${o})`,NO_DOTS:`(?!${u}${p})`,NO_DOT_SLASH:`(?!${o}{0,1}${l})`,NO_DOTS_SLASH:`(?!${p})`,QMARK_NO_DOT:`[^.${a}]`,STAR:`${c}*?`,START_ANCHOR:u},h={...d,SLASH_LITERAL:`[${n}]`,QMARK:i,STAR:`${i}*?`,DOTS_SLASH:`${o}{1,2}(?:[${n}]|$)`,NO_DOT:`(?!${o})`,NO_DOTS:`(?!(?:^|[${n}])${o}{1,2}(?:[${n}]|$))`,NO_DOT_SLASH:`(?!${o}{0,1}(?:[${n}]|$))`,NO_DOTS_SLASH:`(?!${o}{1,2}(?:[${n}]|$))`,QMARK_NO_DOT:`[^.${n}]`,START_ANCHOR:`(?:^|[${n}])`,END_ANCHOR:`(?:[${n}]|$)`};t.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:s.sep,extglobChars:t=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:t=>!0===t?h:d}},5453:(t,e,r)=>{const s=r(4751),n=r(6927),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:c,REPLACEMENTS:l}=s,u=(t,e)=>{if("function"==typeof e.expandRange)return e.expandRange(...t,e);t.sort();const r=`[${t.join("-")}]`;try{new RegExp(r)}catch(e){return t.map((t=>n.escapeRegex(t))).join("..")}return r},p=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,d=(t,e)=>{if("string"!=typeof t)throw new TypeError("Expected a string");t=l[t]||t;const r={...e},h="number"==typeof r.maxLength?Math.min(i,r.maxLength):i;let f=t.length;if(f>h)throw new SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${h}`);const g={type:"bos",value:"",output:r.prepend||""},m=[g],y=r.capture?"":"?:",E=n.isWindows(e),b=s.globChars(E),w=s.extglobChars(b),{DOT_LITERAL:S,PLUS_LITERAL:A,SLASH_LITERAL:R,ONE_CHAR:C,DOTS_SLASH:v,NO_DOT:T,NO_DOT_SLASH:O,NO_DOTS_SLASH:x,QMARK:k,QMARK_NO_DOT:_,STAR:L,START_ANCHOR:P}=b,I=t=>`(${y}(?:(?!${P}${t.dot?v:S}).)*?)`,$=r.dot?"":T,B=r.dot?k:_;let H=!0===r.bash?I(r):L;r.capture&&(H=`(${H})`),"boolean"==typeof r.noext&&(r.noextglob=r.noext);const D={input:t,index:-1,start:0,dot:!0===r.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:m};t=n.removePrefix(t,D),f=t.length;const F=[],M=[],N=[];let G,U=g;const j=()=>D.index===f-1,K=D.peek=(e=1)=>t[D.index+e],W=D.advance=()=>t[++D.index]||"",z=()=>t.slice(D.index+1),Y=(t="",e=0)=>{D.consumed+=t,D.index+=e},q=t=>{D.output+=null!=t.output?t.output:t.value,Y(t.value)},V=()=>{let t=1;for(;"!"===K()&&("("!==K(2)||"?"===K(3));)W(),D.start++,t++;return t%2!=0&&(D.negated=!0,D.start++,!0)},X=t=>{D[t]++,N.push(t)},Q=t=>{D[t]--,N.pop()},Z=t=>{if("globstar"===U.type){const e=D.braces>0&&("comma"===t.type||"brace"===t.type),r=!0===t.extglob||F.length&&("pipe"===t.type||"paren"===t.type);"slash"===t.type||"paren"===t.type||e||r||(D.output=D.output.slice(0,-U.output.length),U.type="star",U.value="*",U.output=H,D.output+=U.output)}if(F.length&&"paren"!==t.type&&(F[F.length-1].inner+=t.value),(t.value||t.output)&&q(t),U&&"text"===U.type&&"text"===t.type)return U.value+=t.value,void(U.output=(U.output||"")+t.value);t.prev=U,m.push(t),U=t},J=(t,e)=>{const s={...w[e],conditions:1,inner:""};s.prev=U,s.parens=D.parens,s.output=D.output;const n=(r.capture?"(":"")+s.open;X("parens"),Z({type:t,value:e,output:D.output?"":C}),Z({type:"paren",extglob:!0,value:W(),output:n}),F.push(s)},tt=t=>{let s,n=t.close+(r.capture?")":"");if("negate"===t.type){let i=H;if(t.inner&&t.inner.length>1&&t.inner.includes("/")&&(i=I(r)),(i!==H||j()||/^\)+$/.test(z()))&&(n=t.close=`)$))${i}`),t.inner.includes("*")&&(s=z())&&/^\.[^\\/.]+$/.test(s)){const r=d(s,{...e,fastpaths:!1}).output;n=t.close=`)${r})${i})`}"bos"===t.prev.type&&(D.negatedExtglob=!0)}Z({type:"paren",extglob:!0,value:G,output:n}),Q("parens")};if(!1!==r.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(t)){let s=!1,i=t.replace(c,((t,e,r,n,i,o)=>"\\"===n?(s=!0,t):"?"===n?e?e+n+(i?k.repeat(i.length):""):0===o?B+(i?k.repeat(i.length):""):k.repeat(r.length):"."===n?S.repeat(r.length):"*"===n?e?e+n+(i?H:""):H:e?t:`\\${t}`));return!0===s&&(i=!0===r.unescape?i.replace(/\\/g,""):i.replace(/\\+/g,(t=>t.length%2==0?"\\\\":t?"\\":""))),i===t&&!0===r.contains?(D.output=t,D):(D.output=n.wrapOutput(i,D,e),D)}for(;!j();){if(G=W(),"\0"===G)continue;if("\\"===G){const t=K();if("/"===t&&!0!==r.bash)continue;if("."===t||";"===t)continue;if(!t){G+="\\",Z({type:"text",value:G});continue}const e=/^\\+/.exec(z());let s=0;if(e&&e[0].length>2&&(s=e[0].length,D.index+=s,s%2!=0&&(G+="\\")),!0===r.unescape?G=W():G+=W(),0===D.brackets){Z({type:"text",value:G});continue}}if(D.brackets>0&&("]"!==G||"["===U.value||"[^"===U.value)){if(!1!==r.posix&&":"===G){const t=U.value.slice(1);if(t.includes("[")&&(U.posix=!0,t.includes(":"))){const t=U.value.lastIndexOf("["),e=U.value.slice(0,t),r=U.value.slice(t+2),s=o[r];if(s){U.value=e+s,D.backtrack=!0,W(),g.output||1!==m.indexOf(U)||(g.output=C);continue}}}("["===G&&":"!==K()||"-"===G&&"]"===K())&&(G=`\\${G}`),"]"!==G||"["!==U.value&&"[^"!==U.value||(G=`\\${G}`),!0===r.posix&&"!"===G&&"["===U.value&&(G="^"),U.value+=G,q({value:G});continue}if(1===D.quotes&&'"'!==G){G=n.escapeRegex(G),U.value+=G,q({value:G});continue}if('"'===G){D.quotes=1===D.quotes?0:1,!0===r.keepQuotes&&Z({type:"text",value:G});continue}if("("===G){X("parens"),Z({type:"paren",value:G});continue}if(")"===G){if(0===D.parens&&!0===r.strictBrackets)throw new SyntaxError(p("opening","("));const t=F[F.length-1];if(t&&D.parens===t.parens+1){tt(F.pop());continue}Z({type:"paren",value:G,output:D.parens?")":"\\)"}),Q("parens");continue}if("["===G){if(!0!==r.nobracket&&z().includes("]"))X("brackets");else{if(!0!==r.nobracket&&!0===r.strictBrackets)throw new SyntaxError(p("closing","]"));G=`\\${G}`}Z({type:"bracket",value:G});continue}if("]"===G){if(!0===r.nobracket||U&&"bracket"===U.type&&1===U.value.length){Z({type:"text",value:G,output:`\\${G}`});continue}if(0===D.brackets){if(!0===r.strictBrackets)throw new SyntaxError(p("opening","["));Z({type:"text",value:G,output:`\\${G}`});continue}Q("brackets");const t=U.value.slice(1);if(!0===U.posix||"^"!==t[0]||t.includes("/")||(G=`/${G}`),U.value+=G,q({value:G}),!1===r.literalBrackets||n.hasRegexChars(t))continue;const e=n.escapeRegex(U.value);if(D.output=D.output.slice(0,-U.value.length),!0===r.literalBrackets){D.output+=e,U.value=e;continue}U.value=`(${y}${e}|${U.value})`,D.output+=U.value;continue}if("{"===G&&!0!==r.nobrace){X("braces");const t={type:"brace",value:G,output:"(",outputIndex:D.output.length,tokensIndex:D.tokens.length};M.push(t),Z(t);continue}if("}"===G){const t=M[M.length-1];if(!0===r.nobrace||!t){Z({type:"text",value:G,output:G});continue}let e=")";if(!0===t.dots){const t=m.slice(),s=[];for(let e=t.length-1;e>=0&&(m.pop(),"brace"!==t[e].type);e--)"dots"!==t[e].type&&s.unshift(t[e].value);e=u(s,r),D.backtrack=!0}if(!0!==t.comma&&!0!==t.dots){const r=D.output.slice(0,t.outputIndex),s=D.tokens.slice(t.tokensIndex);t.value=t.output="\\{",G=e="\\}",D.output=r;for(const t of s)D.output+=t.output||t.value}Z({type:"brace",value:G,output:e}),Q("braces"),M.pop();continue}if("|"===G){F.length>0&&F[F.length-1].conditions++,Z({type:"text",value:G});continue}if(","===G){let t=G;const e=M[M.length-1];e&&"braces"===N[N.length-1]&&(e.comma=!0,t="|"),Z({type:"comma",value:G,output:t});continue}if("/"===G){if("dot"===U.type&&D.index===D.start+1){D.start=D.index+1,D.consumed="",D.output="",m.pop(),U=g;continue}Z({type:"slash",value:G,output:R});continue}if("."===G){if(D.braces>0&&"dot"===U.type){"."===U.value&&(U.output=S);const t=M[M.length-1];U.type="dots",U.output+=G,U.value+=G,t.dots=!0;continue}if(D.braces+D.parens===0&&"bos"!==U.type&&"slash"!==U.type){Z({type:"text",value:G,output:S});continue}Z({type:"dot",value:G,output:S});continue}if("?"===G){if(!(U&&"("===U.value)&&!0!==r.noextglob&&"("===K()&&"?"!==K(2)){J("qmark",G);continue}if(U&&"paren"===U.type){const t=K();let e=G;if("<"===t&&!n.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===U.value&&!/[!=<:]/.test(t)||"<"===t&&!/<([!=]|\w+>)/.test(z()))&&(e=`\\${G}`),Z({type:"text",value:G,output:e});continue}if(!0!==r.dot&&("slash"===U.type||"bos"===U.type)){Z({type:"qmark",value:G,output:_});continue}Z({type:"qmark",value:G,output:k});continue}if("!"===G){if(!0!==r.noextglob&&"("===K()&&("?"!==K(2)||!/[!=<:]/.test(K(3)))){J("negate",G);continue}if(!0!==r.nonegate&&0===D.index){V();continue}}if("+"===G){if(!0!==r.noextglob&&"("===K()&&"?"!==K(2)){J("plus",G);continue}if(U&&"("===U.value||!1===r.regex){Z({type:"plus",value:G,output:A});continue}if(U&&("bracket"===U.type||"paren"===U.type||"brace"===U.type)||D.parens>0){Z({type:"plus",value:G});continue}Z({type:"plus",value:A});continue}if("@"===G){if(!0!==r.noextglob&&"("===K()&&"?"!==K(2)){Z({type:"at",extglob:!0,value:G,output:""});continue}Z({type:"text",value:G});continue}if("*"!==G){"$"!==G&&"^"!==G||(G=`\\${G}`);const t=a.exec(z());t&&(G+=t[0],D.index+=t[0].length),Z({type:"text",value:G});continue}if(U&&("globstar"===U.type||!0===U.star)){U.type="star",U.star=!0,U.value+=G,U.output=H,D.backtrack=!0,D.globstar=!0,Y(G);continue}let e=z();if(!0!==r.noextglob&&/^\([^?]/.test(e)){J("star",G);continue}if("star"===U.type){if(!0===r.noglobstar){Y(G);continue}const s=U.prev,n=s.prev,i="slash"===s.type||"bos"===s.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===r.bash&&(!i||e[0]&&"/"!==e[0])){Z({type:"star",value:G,output:""});continue}const a=D.braces>0&&("comma"===s.type||"brace"===s.type),c=F.length&&("pipe"===s.type||"paren"===s.type);if(!i&&"paren"!==s.type&&!a&&!c){Z({type:"star",value:G,output:""});continue}for(;"/**"===e.slice(0,3);){const r=t[D.index+4];if(r&&"/"!==r)break;e=e.slice(3),Y("/**",3)}if("bos"===s.type&&j()){U.type="globstar",U.value+=G,U.output=I(r),D.output=U.output,D.globstar=!0,Y(G);continue}if("slash"===s.type&&"bos"!==s.prev.type&&!o&&j()){D.output=D.output.slice(0,-(s.output+U.output).length),s.output=`(?:${s.output}`,U.type="globstar",U.output=I(r)+(r.strictSlashes?")":"|$)"),U.value+=G,D.globstar=!0,D.output+=s.output+U.output,Y(G);continue}if("slash"===s.type&&"bos"!==s.prev.type&&"/"===e[0]){const t=void 0!==e[1]?"|$":"";D.output=D.output.slice(0,-(s.output+U.output).length),s.output=`(?:${s.output}`,U.type="globstar",U.output=`${I(r)}${R}|${R}${t})`,U.value+=G,D.output+=s.output+U.output,D.globstar=!0,Y(G+W()),Z({type:"slash",value:"/",output:""});continue}if("bos"===s.type&&"/"===e[0]){U.type="globstar",U.value+=G,U.output=`(?:^|${R}|${I(r)}${R})`,D.output=U.output,D.globstar=!0,Y(G+W()),Z({type:"slash",value:"/",output:""});continue}D.output=D.output.slice(0,-U.output.length),U.type="globstar",U.output=I(r),U.value+=G,D.output+=U.output,D.globstar=!0,Y(G);continue}const s={type:"star",value:G,output:H};!0!==r.bash?!U||"bracket"!==U.type&&"paren"!==U.type||!0!==r.regex?(D.index!==D.start&&"slash"!==U.type&&"dot"!==U.type||("dot"===U.type?(D.output+=O,U.output+=O):!0===r.dot?(D.output+=x,U.output+=x):(D.output+=$,U.output+=$),"*"!==K()&&(D.output+=C,U.output+=C)),Z(s)):(s.output=G,Z(s)):(s.output=".*?","bos"!==U.type&&"slash"!==U.type||(s.output=$+s.output),Z(s))}for(;D.brackets>0;){if(!0===r.strictBrackets)throw new SyntaxError(p("closing","]"));D.output=n.escapeLast(D.output,"["),Q("brackets")}for(;D.parens>0;){if(!0===r.strictBrackets)throw new SyntaxError(p("closing",")"));D.output=n.escapeLast(D.output,"("),Q("parens")}for(;D.braces>0;){if(!0===r.strictBrackets)throw new SyntaxError(p("closing","}"));D.output=n.escapeLast(D.output,"{"),Q("braces")}if(!0===r.strictSlashes||"star"!==U.type&&"bracket"!==U.type||Z({type:"maybe_slash",value:"",output:`${R}?`}),!0===D.backtrack){D.output="";for(const t of D.tokens)D.output+=null!=t.output?t.output:t.value,t.suffix&&(D.output+=t.suffix)}return D};d.fastpaths=(t,e)=>{const r={...e},o="number"==typeof r.maxLength?Math.min(i,r.maxLength):i,a=t.length;if(a>o)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);t=l[t]||t;const c=n.isWindows(e),{DOT_LITERAL:u,SLASH_LITERAL:p,ONE_CHAR:d,DOTS_SLASH:h,NO_DOT:f,NO_DOTS:g,NO_DOTS_SLASH:m,STAR:y,START_ANCHOR:E}=s.globChars(c),b=r.dot?g:f,w=r.dot?m:f,S=r.capture?"":"?:";let A=!0===r.bash?".*?":y;r.capture&&(A=`(${A})`);const R=t=>!0===t.noglobstar?A:`(${S}(?:(?!${E}${t.dot?h:u}).)*?)`,C=t=>{switch(t){case"*":return`${b}${d}${A}`;case".*":return`${u}${d}${A}`;case"*.*":return`${b}${A}${u}${d}${A}`;case"*/*":return`${b}${A}${p}${d}${w}${A}`;case"**":return b+R(r);case"**/*":return`(?:${b}${R(r)}${p})?${w}${d}${A}`;case"**/*.*":return`(?:${b}${R(r)}${p})?${w}${A}${u}${d}${A}`;case"**/.*":return`(?:${b}${R(r)}${p})?${u}${d}${A}`;default:{const e=/^(.*?)\.(\w+)$/.exec(t);if(!e)return;const r=C(e[1]);if(!r)return;return r+u+e[2]}}},v=n.removePrefix(t,{negated:!1,prefix:""});let T=C(v);return T&&!0!==r.strictSlashes&&(T+=`${p}?`),T},t.exports=d},8996:(t,e,r)=>{const s=r(6928),n=r(3297),i=r(5453),o=r(6927),a=r(4751),c=(t,e,r=!1)=>{if(Array.isArray(t)){const s=t.map((t=>c(t,e,r))),n=t=>{for(const e of s){const r=e(t);if(r)return r}return!1};return n}const s=(n=t)&&"object"==typeof n&&!Array.isArray(n)&&t.tokens&&t.input;var n;if(""===t||"string"!=typeof t&&!s)throw new TypeError("Expected pattern to be a non-empty string");const i=e||{},a=o.isWindows(e),l=s?c.compileRe(t,e):c.makeRe(t,e,!1,!0),u=l.state;delete l.state;let p=()=>!1;if(i.ignore){const t={...e,ignore:null,onMatch:null,onResult:null};p=c(i.ignore,t,r)}const d=(r,s=!1)=>{const{isMatch:n,match:o,output:d}=c.test(r,l,e,{glob:t,posix:a}),h={glob:t,state:u,regex:l,posix:a,input:r,output:d,match:o,isMatch:n};return"function"==typeof i.onResult&&i.onResult(h),!1===n?(h.isMatch=!1,!!s&&h):p(r)?("function"==typeof i.onIgnore&&i.onIgnore(h),h.isMatch=!1,!!s&&h):("function"==typeof i.onMatch&&i.onMatch(h),!s||h)};return r&&(d.state=u),d};c.test=(t,e,r,{glob:s,posix:n}={})=>{if("string"!=typeof t)throw new TypeError("Expected input to be a string");if(""===t)return{isMatch:!1,output:""};const i=r||{},a=i.format||(n?o.toPosixSlashes:null);let l=t===s,u=l&&a?a(t):t;return!1===l&&(u=a?a(t):t,l=u===s),!1!==l&&!0!==i.capture||(l=!0===i.matchBase||!0===i.basename?c.matchBase(t,e,r,n):e.exec(u)),{isMatch:Boolean(l),match:l,output:u}},c.matchBase=(t,e,r,n=o.isWindows(r))=>(e instanceof RegExp?e:c.makeRe(e,r)).test(s.basename(t)),c.isMatch=(t,e,r)=>c(e,r)(t),c.parse=(t,e)=>Array.isArray(t)?t.map((t=>c.parse(t,e))):i(t,{...e,fastpaths:!1}),c.scan=(t,e)=>n(t,e),c.compileRe=(t,e,r=!1,s=!1)=>{if(!0===r)return t.output;const n=e||{},i=n.contains?"":"^",o=n.contains?"":"$";let a=`${i}(?:${t.output})${o}`;t&&!0===t.negated&&(a=`^(?!${a}).*$`);const l=c.toRegex(a,e);return!0===s&&(l.state=t),l},c.makeRe=(t,e={},r=!1,s=!1)=>{if(!t||"string"!=typeof t)throw new TypeError("Expected a non-empty string");let n={negated:!1,fastpaths:!0};return!1===e.fastpaths||"."!==t[0]&&"*"!==t[0]||(n.output=i.fastpaths(t,e)),n.output||(n=i(t,e)),c.compileRe(n,e,r,s)},c.toRegex=(t,e)=>{try{const r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(t){if(e&&!0===e.debug)throw t;return/$^/}},c.constants=a,t.exports=c},3297:(t,e,r)=>{const s=r(6927),{CHAR_ASTERISK:n,CHAR_AT:i,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:a,CHAR_DOT:c,CHAR_EXCLAMATION_MARK:l,CHAR_FORWARD_SLASH:u,CHAR_LEFT_CURLY_BRACE:p,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:f,CHAR_QUESTION_MARK:g,CHAR_RIGHT_CURLY_BRACE:m,CHAR_RIGHT_PARENTHESES:y,CHAR_RIGHT_SQUARE_BRACKET:E}=r(4751),b=t=>t===u||t===o,w=t=>{!0!==t.isPrefix&&(t.depth=t.isGlobstar?1/0:1)};t.exports=(t,e)=>{const r=e||{},S=t.length-1,A=!0===r.parts||!0===r.scanToEnd,R=[],C=[],v=[];let T,O,x=t,k=-1,_=0,L=0,P=!1,I=!1,$=!1,B=!1,H=!1,D=!1,F=!1,M=!1,N=!1,G=!1,U=0,j={value:"",depth:0,isGlob:!1};const K=()=>k>=S,W=()=>(T=O,x.charCodeAt(++k));for(;k<S;){let t;if(O=W(),O!==o){if(!0===D||O===p){for(U++;!0!==K()&&(O=W());)if(O!==o)if(O!==p){if(!0!==D&&O===c&&(O=W())===c){if(P=j.isBrace=!0,$=j.isGlob=!0,G=!0,!0===A)continue;break}if(!0!==D&&O===a){if(P=j.isBrace=!0,$=j.isGlob=!0,G=!0,!0===A)continue;break}if(O===m&&(U--,0===U)){D=!1,P=j.isBrace=!0,G=!0;break}}else U++;else F=j.backslashes=!0,W();if(!0===A)continue;break}if(O!==u){if(!0!==r.noext){if(!0===(O===f||O===i||O===n||O===g||O===l)&&x.charCodeAt(k+1)===d){if($=j.isGlob=!0,B=j.isExtglob=!0,G=!0,O===l&&k===_&&(N=!0),!0===A){for(;!0!==K()&&(O=W());)if(O!==o){if(O===y){$=j.isGlob=!0,G=!0;break}}else F=j.backslashes=!0,O=W();continue}break}}if(O===n){if(T===n&&(H=j.isGlobstar=!0),$=j.isGlob=!0,G=!0,!0===A)continue;break}if(O===g){if($=j.isGlob=!0,G=!0,!0===A)continue;break}if(O===h){for(;!0!==K()&&(t=W());)if(t!==o){if(t===E){I=j.isBracket=!0,$=j.isGlob=!0,G=!0;break}}else F=j.backslashes=!0,W();if(!0===A)continue;break}if(!0===r.nonegate||O!==l||k!==_){if(!0!==r.noparen&&O===d){if($=j.isGlob=!0,!0===A){for(;!0!==K()&&(O=W());)if(O!==d){if(O===y){G=!0;break}}else F=j.backslashes=!0,O=W();continue}break}if(!0===$){if(G=!0,!0===A)continue;break}}else M=j.negated=!0,_++}else{if(R.push(k),C.push(j),j={value:"",depth:0,isGlob:!1},!0===G)continue;if(T===c&&k===_+1){_+=2;continue}L=k+1}}else F=j.backslashes=!0,O=W(),O===p&&(D=!0)}!0===r.noext&&(B=!1,$=!1);let z=x,Y="",q="";_>0&&(Y=x.slice(0,_),x=x.slice(_),L-=_),z&&!0===$&&L>0?(z=x.slice(0,L),q=x.slice(L)):!0===$?(z="",q=x):z=x,z&&""!==z&&"/"!==z&&z!==x&&b(z.charCodeAt(z.length-1))&&(z=z.slice(0,-1)),!0===r.unescape&&(q&&(q=s.removeBackslashes(q)),z&&!0===F&&(z=s.removeBackslashes(z)));const V={prefix:Y,input:t,start:_,base:z,glob:q,isBrace:P,isBracket:I,isGlob:$,isExtglob:B,isGlobstar:H,negated:M,negatedExtglob:N};if(!0===r.tokens&&(V.maxDepth=0,b(O)||C.push(j),V.tokens=C),!0===r.parts||!0===r.tokens){let e;for(let s=0;s<R.length;s++){const n=e?e+1:_,i=R[s],o=t.slice(n,i);r.tokens&&(0===s&&0!==_?(C[s].isPrefix=!0,C[s].value=Y):C[s].value=o,w(C[s]),V.maxDepth+=C[s].depth),0===s&&""===o||v.push(o),e=i}if(e&&e+1<t.length){const s=t.slice(e+1);v.push(s),r.tokens&&(C[C.length-1].value=s,w(C[C.length-1]),V.maxDepth+=C[C.length-1].depth)}V.slashes=R,V.parts=v}return V}},6927:(t,e,r)=>{const s=r(6928),n="win32"===process.platform,{REGEX_BACKSLASH:i,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:c}=r(4751);e.isObject=t=>null!==t&&"object"==typeof t&&!Array.isArray(t),e.hasRegexChars=t=>a.test(t),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=t=>t.replace(c,"\\$1"),e.toPosixSlashes=t=>t.replace(i,"/"),e.removeBackslashes=t=>t.replace(o,(t=>"\\"===t?"":t)),e.supportsLookbehinds=()=>{const t=process.version.slice(1).split(".").map(Number);return 3===t.length&&t[0]>=9||8===t[0]&&t[1]>=10},e.isWindows=t=>t&&"boolean"==typeof t.windows?t.windows:!0===n||"\\"===s.sep,e.escapeLast=(t,r,s)=>{const n=t.lastIndexOf(r,s);return-1===n?t:"\\"===t[n-1]?e.escapeLast(t,r,n-1):`${t.slice(0,n)}\\${t.slice(n)}`},e.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r},e.wrapOutput=(t,e={},r={})=>{let s=`${r.contains?"":"^"}(?:${t})${r.contains?"":"$"}`;return!0===e.negated&&(s=`(?:^(?!${s}).*$)`),s}},6454:(t,e,r)=>{String.prototype.startsWith||(String.prototype.startsWith=function(t){return this.substring(0,t.length)===t});var s=r(6179);t.exports=function(t,e,r){var n,i,o;if("function"==typeof e&&(r=e,e=void 0),"function"!=typeof r)return n=s,i=t,o=e,new Promise((function(t,e){n(i,o,(function(r,s){if(r)return e(r);t(s)}))}));s(t,e,r)}},2775:(t,e,r)=>{var s=r(5317).spawn;t.exports=function(t,e,r,n){"function"==typeof r&&(n=r,r=void 0);var i=!1,o=s(t,e,r),a="",c="";o.stdout.on("data",(function(t){a+=t.toString()})),o.stderr.on("data",(function(t){c+=t.toString()})),o.on("error",(function(t){i||(i=!0,n(new Error(t)))})),o.on("close",(function(t){if(!i){if(i=!0,c=function(t){if(t)return(t=(t=t.trim()).replace(/your \d+x\d+ screen size is bogus\. expect trouble/gi,"")).trim()}(c))return n(new Error(c));n(null,a,t)}}))}},4182:(t,e,r)=>{var s=r(857),n={ps:()=>r(433),wmic:()=>r(7868)},i=s.platform();i.startsWith("win")&&(i="win");var o={darwin:"ps",sunos:"ps",freebsd:"ps",netbsd:"ps",win:"wmic",linux:"ps",aix:"ps"}[i];t.exports=function(t){void 0===o&&t(new Error(s.platform()+" is not supported yet, please open an issue (https://github.com/simonepri/pidtree)")),n[o]()(t)}},6179:(t,e,r)=>{var s=r(4182);t.exports=function(t,e,r){"function"==typeof e&&(r=e,e={}),"object"!=typeof e&&(e={}),t=parseInt(t,10),isNaN(t)||t<-1?r(new TypeError("The pid provided is invalid")):s((function(s,n){if(s)r(s);else if(-1!==t){for(var i,o=0;o<n.length;o++){if(n[o][1]===t){i=e.advanced?{ppid:n[o][0],pid:t}:t;break}n[o][0]===t&&(i=e.advanced?{pid:t}:t)}if(i){for(var a={};n.length>0;){var c=n.pop();a[c[0]]?a[c[0]].push(c[1]):a[c[0]]=[c[1]]}for(var l=0,u=[i];l<u.length;){var p=e.advanced?u[l++].pid:u[l++];if(a[p]){for(var d=a[p].length,h=0;h<d;h++)u.push(e.advanced?{ppid:p,pid:a[p][h]}:a[p][h]);delete a[p]}}e.root||u.shift(),r(null,u)}else r(new Error("No matching pid found"))}else{for(var f=0;f<n.length;f++)n[f]=e.advanced?{ppid:n[f][0],pid:n[f][1]}:n[f]=n[f][1];r(null,n)}}))}},433:(t,e,r)=>{var s=r(857),n=r(2775);t.exports=function(t){n("ps",["-A","-o","ppid,pid"],(function(e,r,n){if(e)return t(e);if(0!==n)return t(new Error("pidtree ps command exited with code "+n));try{r=r.split(s.EOL);for(var i=[],o=1;o<r.length;o++)r[o]=r[o].trim(),r[o]&&(r[o]=r[o].split(/\s+/),r[o][0]=parseInt(r[o][0],10),r[o][1]=parseInt(r[o][1],10),i.push(r[o]));t(null,i)}catch(e){t(e)}}))}},7868:(t,e,r)=>{var s=r(857),n=r(2775);t.exports=function(t){n("wmic",["PROCESS","get","ParentProcessId,ProcessId"],{windowsHide:!0,windowsVerbatimArguments:!0},(function(e,r,n){if(e)t(e);else if(0===n)try{r=r.split(s.EOL);for(var i=[],o=1;o<r.length;o++)r[o]=r[o].trim(),r[o]&&(r[o]=r[o].split(/\s+/),r[o][0]=parseInt(r[o][0],10),r[o][1]=parseInt(r[o][1],10),i.push(r[o]));t(null,i)}catch(e){t(e)}else t(new Error("pidtree wmic command exited with code "+n))}))}},9018:t=>{function e(t){return t instanceof Buffer?Buffer.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}t.exports=function(t){if((t=t||{}).circles)return function(t){const r=[],s=[],n=new Map;if(n.set(Date,(t=>new Date(t))),n.set(Map,((t,e)=>new Map(o(Array.from(t),e)))),n.set(Set,((t,e)=>new Set(o(Array.from(t),e)))),t.constructorHandlers)for(const e of t.constructorHandlers)n.set(e[0],e[1]);let i=null;return t.proto?c:a;function o(t,o){const a=Object.keys(t),c=new Array(a.length);for(let l=0;l<a.length;l++){const u=a[l],p=t[u];if("object"!=typeof p||null===p)c[u]=p;else if(p.constructor!==Object&&(i=n.get(p.constructor)))c[u]=i(p,o);else if(ArrayBuffer.isView(p))c[u]=e(p);else{const t=r.indexOf(p);c[u]=-1!==t?s[t]:o(p)}}return c}function a(t){if("object"!=typeof t||null===t)return t;if(Array.isArray(t))return o(t,a);if(t.constructor!==Object&&(i=n.get(t.constructor)))return i(t,a);const c={};r.push(t),s.push(c);for(const o in t){if(!1===Object.hasOwnProperty.call(t,o))continue;const l=t[o];if("object"!=typeof l||null===l)c[o]=l;else if(l.constructor!==Object&&(i=n.get(l.constructor)))c[o]=i(l,a);else if(ArrayBuffer.isView(l))c[o]=e(l);else{const t=r.indexOf(l);c[o]=-1!==t?s[t]:a(l)}}return r.pop(),s.pop(),c}function c(t){if("object"!=typeof t||null===t)return t;if(Array.isArray(t))return o(t,c);if(t.constructor!==Object&&(i=n.get(t.constructor)))return i(t,c);const a={};r.push(t),s.push(a);for(const o in t){const l=t[o];if("object"!=typeof l||null===l)a[o]=l;else if(l.constructor!==Object&&(i=n.get(l.constructor)))a[o]=i(l,c);else if(ArrayBuffer.isView(l))a[o]=e(l);else{const t=r.indexOf(l);a[o]=-1!==t?s[t]:c(l)}}return r.pop(),s.pop(),a}}(t);const r=new Map;if(r.set(Date,(t=>new Date(t))),r.set(Map,((t,e)=>new Map(n(Array.from(t),e)))),r.set(Set,((t,e)=>new Set(n(Array.from(t),e)))),t.constructorHandlers)for(const e of t.constructorHandlers)r.set(e[0],e[1]);let s=null;return t.proto?function t(i){if("object"!=typeof i||null===i)return i;if(Array.isArray(i))return n(i,t);if(i.constructor!==Object&&(s=r.get(i.constructor)))return s(i,t);const o={};for(const n in i){const a=i[n];"object"!=typeof a||null===a?o[n]=a:a.constructor!==Object&&(s=r.get(a.constructor))?o[n]=s(a,t):ArrayBuffer.isView(a)?o[n]=e(a):o[n]=t(a)}return o}:function t(i){if("object"!=typeof i||null===i)return i;if(Array.isArray(i))return n(i,t);if(i.constructor!==Object&&(s=r.get(i.constructor)))return s(i,t);const o={};for(const n in i){if(!1===Object.hasOwnProperty.call(i,n))continue;const a=i[n];"object"!=typeof a||null===a?o[n]=a:a.constructor!==Object&&(s=r.get(a.constructor))?o[n]=s(a,t):ArrayBuffer.isView(a)?o[n]=e(a):o[n]=t(a)}return o};function n(t,n){const i=Object.keys(t),o=new Array(i.length);for(let a=0;a<i.length;a++){const c=i[a],l=t[c];"object"!=typeof l||null===l?o[c]=l:l.constructor!==Object&&(s=r.get(l.constructor))?o[c]=s(l,n):ArrayBuffer.isView(l)?o[c]=e(l):o[c]=n(l)}return o}}},600:(t,e,r)=>{const s=r(7257);t.exports=(t="")=>{const e=t.match(s);if(!e)return null;const[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return"env"===i?n:n?`${i} ${n}`:i}},7257:t=>{t.exports=/^#!(.*)/},1754:(t,e,r)=>{const s=r(857),n=r(4891),i=process.env;let o;function a(t){const e=function(t){if(!1===o)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==o)return 0;const e=o?1:0;if("win32"===process.platform){const t=s.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in i)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((t=>t in i))||"codeship"===i.CI_NAME?1:e;if("TEAMCITY_VERSION"in i)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0;if("truecolor"===i.COLORTERM)return 3;if("TERM_PROGRAM"in i){const t=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||"COLORTERM"in i?1:(i.TERM,e)}(t);return function(t){return 0!==t&&{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}(e)}n("no-color")||n("no-colors")||n("color=false")?o=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(o=!0),"FORCE_COLOR"in i&&(o=0===i.FORCE_COLOR.length||0!==parseInt(i.FORCE_COLOR,10)),t.exports={supportsColor:a,stdout:a(process.stdout),stderr:a(process.stderr)}},4710:(t,e,r)=>{const s=r(9789),n=(t,e,r)=>{if(!1===s(t))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===e||t===e)return String(t);if(!1===s(e))throw new TypeError("toRegexRange: expected the second argument to be a number.");let i={relaxZeros:!0,...r};"boolean"==typeof i.strictZeros&&(i.relaxZeros=!1===i.strictZeros);let c=t+":"+e+"="+String(i.relaxZeros)+String(i.shorthand)+String(i.capture)+String(i.wrap);if(n.cache.hasOwnProperty(c))return n.cache[c].result;let l=Math.min(t,e),u=Math.max(t,e);if(1===Math.abs(l-u)){let r=t+"|"+e;return i.capture?`(${r})`:!1===i.wrap?r:`(?:${r})`}let p=f(t)||f(e),d={min:t,max:e,a:l,b:u},h=[],g=[];if(p&&(d.isPadded=p,d.maxLen=String(d.max).length),l<0){g=o(u<0?Math.abs(u):1,Math.abs(l),d,i),l=d.a=0}return u>=0&&(h=o(l,u,d,i)),d.negatives=g,d.positives=h,d.result=function(t,e,r){let s=a(t,e,"-",!1,r)||[],n=a(e,t,"",!1,r)||[],i=a(t,e,"-?",!0,r)||[];return s.concat(i).concat(n).join("|")}(g,h,i),!0===i.capture?d.result=`(${d.result})`:!1!==i.wrap&&h.length+g.length>1&&(d.result=`(?:${d.result})`),n.cache[c]=d,d.result};function i(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let s=function(t,e){let r=[];for(let s=0;s<t.length;s++)r.push([t[s],e[s]]);return r}(t,e),n=s.length,i="",o=0;for(let t=0;t<n;t++){let[e,n]=s[t];e===n?i+=e:"0"!==e||"9"!==n?i+=h(e,n,r):o++}return o&&(i+=!0===r.shorthand?"\\d":"[0-9]"),{pattern:i,count:[o],digits:n}}function o(t,e,r,s){let n,o=function(t,e){let r=1,s=1,n=u(t,r),i=new Set([e]);for(;t<=n&&n<=e;)i.add(n),r+=1,n=u(t,r);for(n=p(e+1,s)-1;t<n&&n<=e;)i.add(n),s+=1,n=p(e+1,s)-1;return i=[...i],i.sort(c),i}(t,e),a=[],l=t;for(let t=0;t<o.length;t++){let e=o[t],c=i(String(l),String(e),s),u="";r.isPadded||!n||n.pattern!==c.pattern?(r.isPadded&&(u=g(e,r,s)),c.string=u+c.pattern+d(c.count),a.push(c),l=e+1,n=c):(n.count.length>1&&n.count.pop(),n.count.push(c.count[0]),n.string=n.pattern+d(n.count),l=e+1)}return a}function a(t,e,r,s,n){let i=[];for(let n of t){let{string:t}=n;s||l(e,"string",t)||i.push(r+t),s&&l(e,"string",t)&&i.push(r+t)}return i}function c(t,e){return t>e?1:e>t?-1:0}function l(t,e,r){return t.some((t=>t[e]===r))}function u(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function p(t,e){return t-t%Math.pow(10,e)}function d(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function h(t,e,r){return`[${t}${e-t==1?"":"-"}${e}]`}function f(t){return/^-?(0+)\d/.test(t)}function g(t,e,r){if(!e.isPadded)return t;let s=Math.abs(e.maxLen-String(t).length),n=!1!==r.relaxZeros;switch(s){case 0:return"";case 1:return n?"0?":"0";case 2:return n?"0{0,2}":"00";default:return n?`0{0,${s}}`:`0{${s}}`}}n.cache={},n.clearCache=()=>n.cache={},t.exports=n},1905:(t,e,r)=>{const s="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,n=r(6928),i=s?";":":",o=r(9344),a=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),c=(t,e)=>{const r=e.colon||i,n=t.match(/\//)||s&&t.match(/\\/)?[""]:[...s?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=s?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=s?o.split(r):[""];return s&&-1!==t.indexOf(".")&&""!==a[0]&&a.unshift(""),{pathEnv:n,pathExt:a,pathExtExe:o}},l=(t,e,r)=>{"function"==typeof e&&(r=e,e={}),e||(e={});const{pathEnv:s,pathExt:i,pathExtExe:l}=c(t,e),u=[],p=r=>new Promise(((i,o)=>{if(r===s.length)return e.all&&u.length?i(u):o(a(t));const c=s[r],l=/^".*"$/.test(c)?c.slice(1,-1):c,p=n.join(l,t),h=!l&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;i(d(h,r,0))})),d=(t,r,s)=>new Promise(((n,a)=>{if(s===i.length)return n(p(r+1));const c=i[s];o(t+c,{pathExt:l},((i,o)=>{if(!i&&o){if(!e.all)return n(t+c);u.push(t+c)}return n(d(t,r,s+1))}))}));return r?p(0).then((t=>r(null,t)),r):p(0)};t.exports=l,l.sync=(t,e)=>{e=e||{};const{pathEnv:r,pathExt:s,pathExtExe:i}=c(t,e),l=[];for(let a=0;a<r.length;a++){const c=r[a],u=/^".*"$/.test(c)?c.slice(1,-1):c,p=n.join(u,t),d=!u&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;for(let t=0;t<s.length;t++){const r=d+s[t];try{if(o.sync(r,{pathExt:i})){if(!e.all)return r;l.push(r)}}catch(t){}}}if(e.all&&l.length)return l;if(e.nothrow)return null;throw a(t)}},6992:(t,e,r)=>{r.d(e,{default:()=>ii});var s=r(4833),n=r(4573),i=r(6760),o=r(1421),a=r(1708),c=r(526);var l=r(5190);const u=(t,e,r,s)=>{if("length"===r||"prototype"===r)return;if("arguments"===r||"caller"===r)return;const n=Object.getOwnPropertyDescriptor(t,r),i=Object.getOwnPropertyDescriptor(e,r);!p(n,i)&&s||Object.defineProperty(t,r,i)},p=function(t,e){return void 0===t||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},d=(t,e)=>`/* Wrapped ${t}*/\n${e}`,h=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),f=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");function g(t,e,{ignoreNonConfigurable:r=!1}={}){const{name:s}=t;for(const s of Reflect.ownKeys(e))u(t,e,s,r);return((t,e)=>{const r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)})(t,e),((t,e,r)=>{const s=""===r?"":`with ${r.trim()}() `,n=d.bind(null,s,e.toString());Object.defineProperty(n,"name",f),Object.defineProperty(t,"toString",{...h,value:n})})(t,e,s),t}const m=new WeakMap,y=(t,e={})=>{if("function"!=typeof t)throw new TypeError("Expected a function");let r,s=0;const n=t.displayName||t.name||"<anonymous>",i=function(...o){if(m.set(i,++s),1===s)r=t.apply(this,o),t=null;else if(!0===e.throw)throw new Error(`Function \`${n}\` can only be called once`);return r};return g(i,t),m.set(i,s),i};y.callCount=t=>{if(!m.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return m.get(t)};const E=y;var b=r(8161);const w=(t,e)=>({name:`SIGRT${e+1}`,number:S+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),S=34,A=64,R=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],C=()=>{const t=(()=>{const t=A-S+1;return Array.from({length:t},w)})();return[...R,...t].map(v)},v=({name:t,number:e,description:r,action:s,forced:n=!1,standard:i})=>{const{signals:{[t]:o}}=b.constants,a=void 0!==o;return{name:t,number:a?o:e,description:r,supported:a,action:s,forced:n,standard:i}},T=({name:t,number:e,description:r,supported:s,action:n,forced:i,standard:o})=>[t,{name:t,number:e,description:r,supported:s,action:n,forced:i,standard:o}],O=(()=>{const t=C();return Object.fromEntries(t.map(T))})(),x=(t,e)=>{const r=k(t,e);if(void 0===r)return{};const{name:s,description:n,supported:i,action:o,forced:a,standard:c}=r;return{[t]:{name:s,number:t,description:n,supported:i,action:o,forced:a,standard:c}}},k=(t,e)=>{const r=e.find((({name:e})=>b.constants.signals[e]===t));return void 0!==r?r:e.find((e=>e.number===t))},_=((()=>{const t=C(),e=A+1,r=Array.from({length:e},((e,r)=>x(r,t)));Object.assign({},...r)})(),({stdout:t,stderr:e,all:r,error:s,signal:n,exitCode:i,command:o,escapedCommand:c,timedOut:l,isCanceled:u,killed:p,parsed:{options:{timeout:d,cwd:h=a.cwd()}}})=>{i=null===i?void 0:i;const f=void 0===(n=null===n?void 0:n)?void 0:O[n].description,g=(({timedOut:t,timeout:e,errorCode:r,signal:s,signalDescription:n,exitCode:i,isCanceled:o})=>t?`timed out after ${e} milliseconds`:o?"was canceled":void 0!==r?`failed with ${r}`:void 0!==s?`was killed with ${s} (${n})`:void 0!==i?`failed with exit code ${i}`:"failed")({timedOut:l,timeout:d,errorCode:s&&s.code,signal:n,signalDescription:f,exitCode:i,isCanceled:u}),m=`Command ${g}: ${o}`,y="[object Error]"===Object.prototype.toString.call(s),E=y?`${m}\n${s.message}`:m,b=[E,e,t].filter(Boolean).join("\n");return y?(s.originalMessage=s.message,s.message=b):s=new Error(b),s.shortMessage=E,s.command=o,s.escapedCommand=c,s.exitCode=i,s.signal=n,s.signalDescription=f,s.stdout=t,s.stderr=e,s.cwd=h,void 0!==r&&(s.all=r),"bufferedData"in s&&delete s.bufferedData,s.failed=!0,s.timedOut=Boolean(l),s.isCanceled=u,s.killed=p&&!l,s}),L=["stdin","stdout","stderr"],P=t=>{if(!t)return;const{stdio:e}=t;if(void 0===e)return L.map((e=>t[e]));if((t=>L.some((e=>void 0!==t[e])))(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${L.map((t=>`\`${t}\``)).join(", ")}`);if("string"==typeof e)return e;if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);const r=Math.max(e.length,L.length);return Array.from({length:r},((t,r)=>e[r]))};var I=r(7017);const $=(t,e="SIGTERM",r={})=>{const s=t(e);return B(t,e,r,s),s},B=(t,e,r,s)=>{if(!H(e,r,s))return;const n=F(r),i=setTimeout((()=>{t("SIGKILL")}),n);i.unref&&i.unref()},H=(t,{forceKillAfterTimeout:e},r)=>D(t)&&!1!==e&&r,D=t=>t===b.constants.signals.SIGTERM||"string"==typeof t&&"SIGTERM"===t.toUpperCase(),F=({forceKillAfterTimeout:t=!0})=>{if(!0===t)return 5e3;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},M=(t,e)=>{t.kill()&&(e.isCanceled=!0)},N=(t,{timeout:e,killSignal:r="SIGTERM"},s)=>{if(0===e||void 0===e)return s;let n;const i=new Promise(((s,i)=>{n=setTimeout((()=>{((t,e,r)=>{t.kill(e),r(Object.assign(new Error("Timed out"),{timedOut:!0,signal:e}))})(t,r,i)}),e)})),o=s.finally((()=>{clearTimeout(n)}));return Promise.race([i,o])},G=({timeout:t})=>{if(void 0!==t&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},U=async(t,{cleanup:e,detached:r},s)=>{if(!e||r)return s;const n=(0,I.cf)((()=>{t.kill()}));return s.finally((()=>{n()}))};var j=r(3024);function K(t){return null!==t&&"object"==typeof t&&"function"==typeof t.pipe}function W(t){return K(t)&&!1!==t.writable&&"function"==typeof t._write&&"object"==typeof t._writableState}const z=(t,e,r)=>{if("string"==typeof r)return t[e].pipe((0,j.createWriteStream)(r)),t;if(W(r))return t[e].pipe(r),t;if(!(t=>t instanceof o.ChildProcess&&"function"==typeof t.then)(r))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!W(r.stdin))throw new TypeError("The target child process's stdin must be available.");return t[e].pipe(r.stdin),r},Y=t=>{null!==t.stdout&&(t.pipeStdout=z.bind(void 0,t,"stdout")),null!==t.stderr&&(t.pipeStderr=z.bind(void 0,t,"stderr")),void 0!==t.all&&(t.pipeAll=z.bind(void 0,t,"all"))};var q=r(8500);const V=async(t,{init:e,convertChunk:r,getSize:s,truncateChunk:n,addChunk:i,getFinalChunk:o,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{if(!J(t))throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");const l=e();l.length=0;try{for await(const e of t){const t=r[tt(e)](e,l);Q({convertedChunk:t,state:l,getSize:s,truncateChunk:n,addChunk:i,maxBuffer:c})}return X({state:l,convertChunk:r,getSize:s,truncateChunk:n,addChunk:i,getFinalChunk:o,maxBuffer:c}),a(l)}catch(t){throw t.bufferedData=a(l),t}},X=({state:t,getSize:e,truncateChunk:r,addChunk:s,getFinalChunk:n,maxBuffer:i})=>{const o=n(t);void 0!==o&&Q({convertedChunk:o,state:t,getSize:e,truncateChunk:r,addChunk:s,maxBuffer:i})},Q=({convertedChunk:t,state:e,getSize:r,truncateChunk:s,addChunk:n,maxBuffer:i})=>{const o=r(t),a=e.length+o;if(a<=i)return void Z(t,e,n,a);const c=s(t,i-e.length);throw void 0!==c&&Z(c,e,n,i),new rt},Z=(t,e,r,s)=>{e.contents=r(t,e,s),e.length=s},J=t=>"object"==typeof t&&null!==t&&"function"==typeof t[Symbol.asyncIterator],tt=t=>{const e=typeof t;if("string"===e)return"string";if("object"!==e||null===t)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";const r=et.call(t);return"[object ArrayBuffer]"===r?"arrayBuffer":"[object DataView]"===r?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&"[object ArrayBuffer]"===et.call(t.buffer)?"typedArray":"others"},{toString:et}=Object.prototype;class rt extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const st=t=>t,nt=()=>{},it=({contents:t})=>t,ot=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},at=t=>t.length;const ct=new TextEncoder,lt=t=>new Uint8Array(t),ut=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),pt=(t,e)=>{if(e<=t.byteLength)return t;const r=new ArrayBuffer(ht(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},dt=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;const r=new ArrayBuffer(e,{maxByteLength:ht(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},ht=t=>ft**Math.ceil(Math.log(t)/Math.log(ft)),ft=2,gt=()=>"resize"in ArrayBuffer.prototype,mt={init:()=>({contents:new ArrayBuffer(0)}),convertChunk:{string:t=>ct.encode(t),buffer:lt,arrayBuffer:lt,dataView:ut,typedArray:ut,others:ot},getSize:at,truncateChunk:(t,e)=>t.slice(0,e),addChunk:(t,{contents:e,length:r},s)=>{const n=gt()?dt(e,s):pt(e,s);return new Uint8Array(n).set(t,r),n},getFinalChunk:nt,finalize:({contents:t,length:e})=>gt()?t:t.slice(0,e)};async function yt(t,e){if(!("Buffer"in globalThis))throw new Error("getStreamAsBuffer() is only supported in Node.js");try{return Et(await async function(t,e){return V(t,mt,e)}(t,e))}catch(t){throw void 0!==t.bufferedData&&(t.bufferedData=Et(t.bufferedData)),t}}const Et=t=>globalThis.Buffer.from(t);const bt=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),wt={init:()=>({contents:"",textDecoder:new TextDecoder}),convertChunk:{string:st,buffer:bt,arrayBuffer:bt,dataView:bt,typedArray:bt,others:ot},getSize:at,truncateChunk:(t,e)=>t.slice(0,e),addChunk:(t,{contents:e})=>e+t,getFinalChunk:({textDecoder:t})=>{const e=t.decode();return""===e?void 0:e},finalize:it};var St=r(1404);const At=t=>{if(void 0!==t)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},Rt=t=>{const e=(({input:t,inputFile:e})=>"string"!=typeof e?t:(At(t),(0,j.readFileSync)(e)))(t);if(K(e))throw new TypeError("The `input` option cannot be a stream in sync mode");return e},Ct=(t,e)=>{const r=(({input:t,inputFile:e})=>"string"!=typeof e?t:(At(t),(0,j.createReadStream)(e)))(e);void 0!==r&&(K(r)?r.pipe(t.stdin):t.stdin.end(r))},vt=(t,{all:e})=>{if(!e||!t.stdout&&!t.stderr)return;const r=St();return t.stdout&&r.add(t.stdout),t.stderr&&r.add(t.stderr),r},Tt=async(t,e)=>{if(t&&void 0!==e){await(0,q.setTimeout)(0),t.destroy();try{return await e}catch(t){return t.bufferedData}}},Ot=(t,{encoding:e,buffer:r,maxBuffer:s})=>{if(t&&r)return"utf8"===e||"utf-8"===e?async function(t,e){return V(t,wt,e)}(t,{maxBuffer:s}):null===e||"buffer"===e?yt(t,{maxBuffer:s}):xt(t,s,e)},xt=async(t,e,r)=>(await yt(t,{maxBuffer:e})).toString(r),kt=async({stdout:t,stderr:e,all:r},{encoding:s,buffer:n,maxBuffer:i},o)=>{const a=Ot(t,{encoding:s,buffer:n,maxBuffer:i}),c=Ot(e,{encoding:s,buffer:n,maxBuffer:i}),l=Ot(r,{encoding:s,buffer:n,maxBuffer:2*i});try{return await Promise.all([o,a,c,l])}catch(s){return Promise.all([{error:s,signal:s.signal,timedOut:s.timedOut},Tt(t,a),Tt(e,c),Tt(r,l)])}},_t=(async()=>{})().constructor.prototype,Lt=["then","catch","finally"].map((t=>[t,Reflect.getOwnPropertyDescriptor(_t,t)])),Pt=(t,e)=>{for(const[r,s]of Lt){const n="function"==typeof e?(...t)=>Reflect.apply(s.value,e(),t):s.value.bind(e);Reflect.defineProperty(t,r,{...s,value:n})}},It=t=>new Promise(((e,r)=>{t.on("exit",((t,r)=>{e({exitCode:t,signal:r})})),t.on("error",(t=>{r(t)})),t.stdin&&t.stdin.on("error",(t=>{r(t)}))})),$t=(t,e=[])=>Array.isArray(e)?[t,...e]:[t],Bt=/^[\w.-]+$/,Ht=(t,e)=>$t(t,e).join(" "),Dt=(t,e)=>$t(t,e).map((t=>(t=>"string"!=typeof t||Bt.test(t)?t:`"${t.replaceAll('"','\\"')}"`)(t))).join(" "),Ft=/ +/g,Mt=t=>{const e=typeof t;if("string"===e)return t;if("number"===e)return String(t);if("object"===e&&null!==t&&!(t instanceof o.ChildProcess)&&"stdout"in t){const e=typeof t.stdout;if("string"===e)return t.stdout;if(n.Buffer.isBuffer(t.stdout))return t.stdout.toString();throw new TypeError(`Unexpected "${e}" stdout in template expression`)}throw new TypeError(`Unexpected "${e}" in template expression`)},Nt=(t,e,r)=>r||0===t.length||0===e.length?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],Gt=({templates:t,expressions:e,tokens:r,index:s,template:n})=>{const i=n??t.raw[s],o=i.split(Ft).filter(Boolean),a=Nt(r,o,i.startsWith(" "));if(s===e.length)return a;const c=e[s],l=Array.isArray(c)?c.map((t=>Mt(t))):[Mt(c)];return Nt(a,l,i.endsWith(" "))},Ut=(t,e)=>{let r=[];for(const[s,n]of t.entries())r=Gt({templates:t,expressions:e,tokens:r,index:s,template:n});return r};var jt=r(7975);const Kt=(0,jt.debuglog)("execa").enabled,Wt=(t,e)=>String(t).padStart(e,"0"),zt=(t,{verbose:e})=>{e&&a.stderr.write(`[${(()=>{const t=new Date;return`${Wt(t.getHours(),2)}:${Wt(t.getMinutes(),2)}:${Wt(t.getSeconds(),2)}.${Wt(t.getMilliseconds(),3)}`})()}] ${t}\n`)},Yt=(t,e,r={})=>{const s=c._parse(t,e,r);return t=s.command,e=s.args,(r={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(r=s.options).cwd||a.cwd(),execPath:a.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:Kt,...r}).env=(({env:t,extendEnv:e,preferLocal:r,localDir:s,execPath:n})=>{const i=e?{...a.env,...t}:t;return r?(0,l.V)({env:i,cwd:s,execPath:n}):i})(r),r.stdio=P(r),"win32"===a.platform&&"cmd"===i.basename(t,".exe")&&e.unshift("/q"),{file:t,args:e,options:r,parsed:s}},qt=(t,e,r)=>"string"==typeof e||n.Buffer.isBuffer(e)?t.stripFinalNewline?function(t){const e="string"==typeof t?"\n":"\n".charCodeAt(),r="string"==typeof t?"\r":"\r".charCodeAt();return t[t.length-1]===e&&(t=t.slice(0,-1)),t[t.length-1]===r&&(t=t.slice(0,-1)),t}(e):e:void 0===r?void 0:"";function Vt(t,e,r){const s=Yt(t,e,r),n=Ht(t,e),i=Dt(t,e);let a;zt(i,s.options),G(s.options);try{a=o.spawn(s.file,s.args,s.options)}catch(t){const e=new o.ChildProcess,r=Promise.reject(_({error:t,stdout:"",stderr:"",all:"",command:n,escapedCommand:i,parsed:s,timedOut:!1,isCanceled:!1,killed:!1}));return Pt(e,r),e}const c=It(a),l=N(a,s.options,c),u=U(a,s.options,l),p={isCanceled:!1};a.kill=$.bind(null,a.kill.bind(a)),a.cancel=M.bind(null,a,p);const d=E((async()=>{const[{error:t,exitCode:e,signal:r,timedOut:o},c,l,d]=await kt(a,s.options,u),h=qt(s.options,c),f=qt(s.options,l),g=qt(s.options,d);if(t||0!==e||null!==r){const c=_({error:t,exitCode:e,signal:r,stdout:h,stderr:f,all:g,command:n,escapedCommand:i,parsed:s,timedOut:o,isCanceled:p.isCanceled||!!s.options.signal&&s.options.signal.aborted,killed:a.killed});if(!s.options.reject)return c;throw c}return{command:n,escapedCommand:i,exitCode:0,stdout:h,stderr:f,all:g,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}));return Ct(a,s.options),a.all=vt(a,s.options),Y(a),Pt(a,d),a}function Xt(t,e,r){const s=Yt(t,e,r),n=Ht(t,e),i=Dt(t,e);zt(i,s.options);const a=Rt(s.options);let c;try{c=o.spawnSync(s.file,s.args,{...s.options,input:a})}catch(t){throw _({error:t,stdout:"",stderr:"",all:"",command:n,escapedCommand:i,parsed:s,timedOut:!1,isCanceled:!1,killed:!1})}const l=qt(s.options,c.stdout,c.error),u=qt(s.options,c.stderr,c.error);if(c.error||0!==c.status||null!==c.signal){const t=_({stdout:l,stderr:u,error:c.error,signal:c.signal,exitCode:c.status,command:n,escapedCommand:i,parsed:s,timedOut:c.error&&"ETIMEDOUT"===c.error.code,isCanceled:!1,killed:null!==c.signal});if(!s.options.reject)return t;throw t}return{command:n,escapedCommand:i,exitCode:0,stdout:l,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}const Qt=({input:t,inputFile:e,stdio:r})=>void 0===t&&void 0===e&&void 0===r?{stdin:"inherit"}:{},Zt=(t={})=>({preferLocal:!0,...Qt(t),...t});(function t(e){function r(r,...s){if(!Array.isArray(r))return t({...e,...r});const[n,...i]=Ut(r,s);return Vt(n,i,Zt(e))}return r.sync=(t,...r)=>{if(!Array.isArray(t))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");const[s,...n]=Ut(t,r);return Xt(s,n,Zt(e))},r})();function Jt(t,e){const[r,...s]=(t=>{const e=[];for(const r of t.trim().split(Ft)){const t=e.at(-1);t&&t.endsWith("\\")?e[e.length-1]=`${t.slice(0,-1)} ${r}`:e.push(r)}return e})(t);return Vt(r,s,e)}const te=s("lint-staged:execGit"),ee=["-c","submodule.recurse=false"],re=async(t,e={})=>{te("Running git command",t);try{const{stdout:r}=await Vt("git",ee.concat(t),{...e,all:!0,cwd:e.cwd||process.cwd(),stdin:"ignore"});return r}catch({all:t}){throw new Error(t)}};var se=r(5441);const ne=r(6296);var ie=r(2018),oe=r.t(ie,2);const{env:ae={},argv:ce=[],platform:le=""}="undefined"==typeof process?{}:process,ue="NO_COLOR"in ae||ce.includes("--no-color"),pe="FORCE_COLOR"in ae||ce.includes("--color"),de="win32"===le,he="dumb"===ae.TERM,fe=oe&&ie.isatty&&ie.isatty(1)&&ae.TERM&&!he,ge=!ue&&(pe||de&&!he||fe||"CI"in ae&&("GITHUB_ACTIONS"in ae||"GITLAB_CI"in ae||"CIRCLECI"in ae)),me=(t,e,r,s,n=e.substring(0,t)+s,i=e.substring(t+r.length),o=i.indexOf(r))=>n+(o<0?i:me(o,i,r,s)),ye=(t,e,r=t,s=t.length+1)=>n=>n||""!==n&&void 0!==n?((t,e,r,s,n)=>t<0?r+e+s:r+me(t,e,s,n)+s)((""+n).indexOf(e,s),n,t,e,r):"",Ee=(t,e,r)=>ye(`\x1b[${t}m`,`\x1b[${e}m`,r),be={reset:Ee(0,0),bold:Ee(1,22,"\x1b[22m\x1b[1m"),dim:Ee(2,22,"\x1b[22m\x1b[2m"),italic:Ee(3,23),underline:Ee(4,24),inverse:Ee(7,27),hidden:Ee(8,28),strikethrough:Ee(9,29),black:Ee(30,39),red:Ee(31,39),green:Ee(32,39),yellow:Ee(33,39),blue:Ee(34,39),magenta:Ee(35,39),cyan:Ee(36,39),white:Ee(37,39),gray:Ee(90,39),bgBlack:Ee(40,49),bgRed:Ee(41,49),bgGreen:Ee(42,49),bgYellow:Ee(43,49),bgBlue:Ee(44,49),bgMagenta:Ee(45,49),bgCyan:Ee(46,49),bgWhite:Ee(47,49),blackBright:Ee(90,39),redBright:Ee(91,39),greenBright:Ee(92,39),yellowBright:Ee(93,39),blueBright:Ee(94,39),magentaBright:Ee(95,39),cyanBright:Ee(96,39),whiteBright:Ee(97,39),bgBlackBright:Ee(100,49),bgRedBright:Ee(101,49),bgGreenBright:Ee(102,49),bgYellowBright:Ee(103,49),bgBlueBright:Ee(104,49),bgMagentaBright:Ee(105,49),bgCyanBright:Ee(106,49),bgWhiteBright:Ee(107,49)},we=({useColor:t=ge}={})=>t?be:Object.keys(be).reduce(((t,e)=>({...t,[e]:String})),{}),{reset:Se,bold:Ae,dim:Re,italic:Ce,underline:ve,inverse:Te,hidden:Oe,strikethrough:xe,black:ke,red:_e,green:Le,yellow:Pe,blue:Ie,magenta:$e,cyan:Be,white:He,gray:De,bgBlack:Fe,bgRed:Me,bgGreen:Ne,bgYellow:Ge,bgBlue:Ue,bgMagenta:je,bgCyan:Ke,bgWhite:We,blackBright:ze,redBright:Ye,greenBright:qe,yellowBright:Ve,blueBright:Xe,magentaBright:Qe,cyanBright:Ze,whiteBright:Je,bgBlackBright:tr,bgRedBright:er,bgGreenBright:rr,bgYellowBright:sr,bgBlueBright:nr,bgMagentaBright:ir,bgCyanBright:or,bgWhiteBright:ar}=we();var cr=r(9023),lr=r(857),ur=r(3193),pr=r(2203),dr=r(9018),hr=r(6982),fr=Object.defineProperty,gr=(t,e)=>fr(t,"name",{value:e,configurable:!0}),mr={CURSOR_HIDE:"\x1b[?25l",CURSOR_SHOW:"\x1b[?25h"},yr=(t=>(t.WAITING="WAITING",t.STARTED="STARTED",t.COMPLETED="COMPLETED",t.FAILED="FAILED",t.SKIPPED="SKIPPED",t.ROLLING_BACK="ROLLING_BACK",t.ROLLED_BACK="ROLLED_BACK",t.RETRY="RETRY",t.PAUSED="PAUSED",t.PROMPT="PROMPT",t.PROMPT_COMPLETED="PROMPT_COMPLETED",t.PROMPT_FAILED="PROMPT_FAILED",t))(yr||{}),Er=class{static{gr(this,"EventManager")}emitter=new ne;emit(t,e){this.emitter.emit(t,e)}on(t,e){this.emitter.addListener(t,e)}once(t,e){this.emitter.once(t,e)}off(t,e){this.emitter.off(t,e)}complete(){this.emitter.removeAllListeners()}};(class{static{gr(this,"BaseEventMap")}});function br(t){return!!t&&"object"==typeof t&&"function"==typeof t.lift&&"function"==typeof t.subscribe}function wr(t){return!!t&&"object"==typeof t&&!0===t.readable&&"function"==typeof t.read&&"function"==typeof t.on}function Sr(){return!!process.env.LISTR_FORCE_UNICODE||"win32"!==process.platform||!!process.env.CI||!!process.env.WT_SESSION||"vscode"===process.env.TERM_PROGRAM||"xterm-256color"===process.env.TERM||"alacritty"===process.env.TERM}gr(br,"isObservable"),gr(wr,"isReadable"),gr(Sr,"isUnicodeSupported");var Ar=/\u0007/;function Rr(t){return String(t).replace(new RegExp("(?:\\u001b|\\u009b)\\[[\\=><~/#&.:=?%@~_-]*[0-9]*[\\a-ln-tqyz=><~/#&.:=?%@~_-]+","gmi"),"").replace(new RegExp(Ar,"gmi"),"").trim()}gr(Rr,"cleanseAnsi");var Cr=we();function vr(t,e){return t.replace(/^(?!\s*$)/gm," ".repeat(e))}gr(vr,"indent");var Tr={warning:"\u26a0",cross:"\u2716",arrowDown:"\u2193",tick:"\u2714",arrowRight:"\u2192",pointer:"\u276f",checkboxOn:"\u2612",arrowLeft:"\u2190",squareSmallFilled:"\u25fc",pointerSmall:"\u203a"},Or={...Tr,warning:"\u203c",cross:"\xd7",tick:"\u221a",pointer:">",checkboxOn:"[\xd7]",squareSmallFilled:"\u25a0"},xr=Sr()?Tr:Or;function kr(t,...e){return(0,cr.format)(String(t),...e)}gr(kr,"splat");var _r={STARTED:xr.pointer,FAILED:xr.cross,SKIPPED:xr.arrowDown,COMPLETED:xr.tick,OUTPUT:xr.pointerSmall,TITLE:xr.arrowRight,RETRY:xr.warning,ROLLBACK:xr.arrowLeft,PAUSED:xr.squareSmallFilled},Lr={STARTED:Cr.yellow,FAILED:Cr.red,SKIPPED:Cr.yellow,COMPLETED:Cr.green,RETRY:Cr.yellowBright,ROLLBACK:Cr.redBright,PAUSED:Cr.yellowBright},Pr=["RETRY","ROLLBACK","FAILED"],Ir=class{constructor(t){this.options=t,this.options={useIcons:!0,toStderr:[],...t??{}},this.options.fields??={},this.options.fields.prefix??=[],this.options.fields.suffix??=[],this.process=this.options.processOutput??new Hr}static{gr(this,"ListrLogger")}process;log(t,e,r){const s=this.format(t,e,r);this.options.toStderr.includes(t)?this.process.toStderr(s):this.process.toStdout(s)}toStdout(t,e,r=!0){this.process.toStdout(this.format(null,t,e),r)}toStderr(t,e,r=!0){this.process.toStderr(this.format(null,t,e),r)}wrap(t,e){return t?this.applyFormat(`[${t}]`,e):t}splat(...t){const e=t.shift()??"";return 0===t.length?e:kr(e,t)}suffix(t,...e){return e.filter(Boolean).forEach((e=>{if(t+=this.spacing(t),"string"==typeof e)t+=this.wrap(e);else if("object"==typeof e){if(e.args??=[],"function"==typeof e.condition?!e.condition(...e.args):!(e.condition??1))return t;t+=this.wrap("function"==typeof e.field?e.field(...e.args):e.field,{format:e?.format(...e.args)})}})),t}prefix(t,...e){return e.filter(Boolean).forEach((e=>{if(t=this.spacing(t)+t,"string"==typeof e)t=this.wrap(e)+t;else if("object"==typeof e){if(e.args??=[],"function"==typeof e.condition?!e.condition(...e.args):!(e.condition??1))return t;t=this.wrap("function"==typeof e.field?e.field(...e.args):e.field,{format:e?.format()})+t}})),t}fields(t,e){return this.options?.fields?.prefix&&(t=this.prefix(t,...this.options.fields.prefix)),e?.prefix&&(t=this.prefix(t,...e.prefix)),e?.suffix&&(t=this.suffix(t,...e.suffix)),this.options?.fields?.suffix&&(t=this.suffix(t,...this.options.fields.suffix)),t}icon(t,e){if(!t)return null;e||=this.options.icon?.[t];const r=this.options.color?.[t];return e&&r&&(e=r(e)),e}format(t,e,r){return Array.isArray(e)||(e=[e]),e=this.splat(e.shift(),...e).toString().split(lr.EOL).filter((t=>!t||""!==t.trim())).map((e=>this.style(t,this.fields(e,{prefix:Array.isArray(r?.prefix)?r.prefix:[r?.prefix],suffix:Array.isArray(r?.suffix)?r.suffix:[r?.suffix]})))).join(lr.EOL)}style(t,e){if(!t||!e)return e;const r=this.icon(t,!this.options.useIcons&&this.wrap(t));return r&&(e=r+" "+e),e}applyFormat(t,e){return e?.format?e.format(t):t}spacing(t){return void 0===t||""===t.trim()?"":" "}},$r=class{constructor(t){this.options=t}static{gr(this,"ProcessOutputBuffer")}buffer=[];decoder=new ur.StringDecoder;get all(){return this.buffer}get last(){return this.buffer.at(-1)}get length(){return this.buffer.length}write(t,...e){const r=e[e.length-1];return this.buffer.push({time:Date.now(),stream:this.options?.stream,entry:this.decoder.write("string"==typeof t?Buffer.from(t,"string"==typeof e[0]?e[0]:void 0):Buffer.from(t))}),this.options?.limit&&(this.buffer=this.buffer.slice(-this.options.limit)),"function"==typeof r&&r(),!0}reset(){this.buffer=[]}},Br=class{constructor(t){this.stream=t,this.method=t.write,this.buffer=new $r({stream:t})}static{gr(this,"ProcessOutputStream")}method;buffer;get out(){return Object.assign({},this.stream,{write:this.write.bind(this)})}hijack(){this.stream.write=this.buffer.write.bind(this.buffer)}release(){this.stream.write=this.method;const t=[...this.buffer.all];return this.buffer.reset(),t}write(...t){return this.method.apply(this.stream,t)}},Hr=class{constructor(t,e,r){this.options=r,this.stream={stdout:new Br(t??process.stdout),stderr:new Br(e??process.stderr)},this.options={dump:["stdout","stderr"],leaveEmptyLine:!0,...r}}static{gr(this,"ProcessOutput")}stream;active;get stdout(){return this.stream.stdout.out}get stderr(){return this.stream.stderr.out}hijack(){if(this.active)throw new Error("ProcessOutput has been already hijacked!");this.stream.stdout.write(mr.CURSOR_HIDE),Object.values(this.stream).forEach((t=>t.hijack())),this.active=!0}release(){const t=Object.entries(this.stream).map((([t,e])=>({name:t,buffer:e.release()}))).filter((t=>this.options.dump.includes(t.name))).flatMap((t=>t.buffer)).sort(((t,e)=>t.time-e.time)).map((t=>({...t,entry:Rr(t.entry)}))).filter((t=>t.entry));t.length>0&&(this.options.leaveEmptyLine&&this.stdout.write(lr.EOL),t.forEach((t=>{(t.stream??this.stdout).write(t.entry+lr.EOL)}))),this.stream.stdout.write(mr.CURSOR_SHOW),this.active=!1}toStdout(t,e=!0){return e&&(t+=lr.EOL),this.stream.stdout.write(t)}toStderr(t,e=!0){return e&&(t+=lr.EOL),this.stream.stderr.write(t)}};function Dr(t){const e=new pr.Writable;return e.rows=1/0,e.columns=1/0,e.write=e=>(t(e.toString()),!0),e}gr(Dr,"createWritable");(class{constructor(t,e){this.task=t,this.wrapper=e}static{gr(this,"ListrPromptAdapter")}state;reportStarted(){if(this.state=this.task.state,this.task.prompt)throw new os("There is already an active prompt attached to this task which may not be cleaned up properly.");this.task.prompt=this,this.task.state$="PROMPT"}reportFailed(){this.task.state$="PROMPT_FAILED",this.restoreState()}reportCompleted(){this.task.state$="PROMPT_COMPLETED",this.restoreState()}restoreState(){this.task.prompt=void 0,this.state&&(this.task.state=this.state)}});var Fr=class{static{gr(this,"Spinner")}spinner=Sr()?["\u280b","\u2819","\u2839","\u2838","\u283c","\u2834","\u2826","\u2827","\u2807","\u280f"]:["-","\\","|","/"];id;spinnerPosition=0;spin(){this.spinnerPosition=++this.spinnerPosition%this.spinner.length}fetch(){return this.spinner[this.spinnerPosition]}isRunning(){return!!this.id}start(t,e=100){this.id=setInterval((()=>{this.spin(),t&&t()}),e)}stop(){clearInterval(this.id)}},Mr={SKIPPED_WITH_COLLAPSE:xr.arrowDown,SKIPPED_WITHOUT_COLLAPSE:xr.warning,OUTPUT:xr.pointerSmall,OUTPUT_WITH_BOTTOMBAR:xr.pointerSmall,PENDING:xr.pointer,COMPLETED:xr.tick,COMPLETED_WITH_FAILED_SUBTASKS:xr.warning,COMPLETED_WITH_SISTER_TASKS_FAILED:xr.squareSmallFilled,RETRY:xr.warning,ROLLING_BACK:xr.warning,ROLLED_BACK:xr.arrowLeft,FAILED:xr.cross,FAILED_WITH_SUBTASKS:xr.pointer,WAITING:xr.squareSmallFilled,PAUSED:xr.squareSmallFilled},Nr={SKIPPED_WITH_COLLAPSE:Cr.yellow,SKIPPED_WITHOUT_COLLAPSE:Cr.yellow,PENDING:Cr.yellow,COMPLETED:Cr.green,COMPLETED_WITH_FAILED_SUBTASKS:Cr.yellow,COMPLETED_WITH_SISTER_TASKS_FAILED:Cr.red,RETRY:Cr.yellowBright,ROLLING_BACK:Cr.redBright,ROLLED_BACK:Cr.redBright,FAILED:Cr.red,FAILED_WITH_SUBTASKS:Cr.red,WAITING:Cr.dim,PAUSED:Cr.yellowBright};function Gr(t){const e=Math.floor(t/1e3),r=Math.floor(e/60);let s;return 0===e&&0===r&&(s=`0.${Math.floor(t/100)}s`),e>0&&(s=e%60+"s"),r>0&&(s=`${r}m${s}`),s}gr(Gr,"parseTimer");var Ur={condition:!0,field:Gr,format:gr((()=>Cr.dim),"format")};function jr(){const t=new Date;return String(t.getHours()).padStart(2,"0")+":"+String(t.getMinutes()).padStart(2,"0")+":"+String(t.getSeconds()).padStart(2,"0")}gr(jr,"parseTimestamp");var Kr=class t{constructor(e,r,s){this.tasks=e,this.options=r,this.events=s,this.options={...t.rendererOptions,...this.options,icon:{...Mr,...r?.icon??{}},color:{...Nr,...r?.color??{}}},this.spinner=this.options.spinner??new Fr,this.logger=this.options.logger??new Ir({useIcons:!0,toStderr:[]}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color}static{gr(this,"DefaultRenderer")}static nonTTY=!1;static rendererOptions={indentation:2,clearOutput:!1,showSubtasks:!0,collapseSubtasks:!0,collapseSkips:!0,showSkipMessage:!0,suffixSkips:!1,collapseErrors:!0,showErrorMessage:!0,suffixRetries:!0,lazy:!1,removeEmptyLines:!0,formatOutput:"wrap",pausedTimer:{...Ur,format:gr((()=>Cr.yellowBright),"format")}};static rendererTaskOptions={outputBar:!0};prompt;activePrompt;spinner;logger;updater;truncate;wrap;buffer={output:new Map,bottom:new Map};cache={render:new Map,rendererOptions:new Map,rendererTaskOptions:new Map};async render(){const{createLogUpdate:t}=await Promise.all([r.e(762),r.e(782),r.e(216)]).then(r.bind(r,2216)),{default:e}=await Promise.all([r.e(762),r.e(145)]).then(r.bind(r,5145)),{default:s}=await Promise.all([r.e(762),r.e(782)]).then(r.bind(r,782));this.updater=t(this.logger.process.stdout),this.truncate=e,this.wrap=s,this.logger.process.hijack(),this.options?.lazy||this.spinner.start((()=>{this.update()})),this.events.on("SHOUD_REFRESH_RENDER",(()=>{this.update()}))}update(){this.updater(this.create())}end(){this.spinner.stop(),this.updater.clear(),this.updater.done(),this.options.clearOutput||this.logger.process.toStdout(this.create({prompt:!1})),this.logger.process.release()}create(t){t={tasks:!0,bottomBar:!0,prompt:!0,...t};const e=[],r=this.renderer(this.tasks),s=this.renderBottomBar(),n=this.renderPrompt();return t.tasks&&r.length>0&&e.push(...r),t.bottomBar&&s.length>0&&(e.length>0&&e.push(""),e.push(...s)),t.prompt&&n.length>0&&(e.length>0&&e.push(""),e.push(...n)),e.join(lr.EOL)}style(t,e=!1){const r=this.cache.rendererOptions.get(t.id);if(t.isSkipped()){if(e||r.collapseSkips)return this.logger.icon("SKIPPED_WITH_COLLAPSE");if(!1===r.collapseSkips)return this.logger.icon("SKIPPED_WITHOUT_COLLAPSE")}if(e)return this.shouldOutputToBottomBar(t)?this.logger.icon("OUTPUT_WITH_BOTTOMBAR"):this.logger.icon("OUTPUT");if(t.hasSubtasks()){if(t.isStarted()||t.isPrompt()&&!1!==r.showSubtasks&&!t.subtasks.every((t=>!t.hasTitle())))return this.logger.icon("PENDING");if(t.isCompleted()&&t.subtasks.some((t=>t.hasFailed())))return this.logger.icon("COMPLETED_WITH_FAILED_SUBTASKS");if(t.hasFailed())return this.logger.icon("FAILED_WITH_SUBTASKS")}return t.isStarted()||t.isPrompt()?this.logger.icon("PENDING",!this.options?.lazy&&this.spinner.fetch()):t.isCompleted()?this.logger.icon("COMPLETED"):t.isRetrying()?this.logger.icon("RETRY",!this.options?.lazy&&this.spinner.fetch()):t.isRollingBack()?this.logger.icon("ROLLING_BACK",!this.options?.lazy&&this.spinner.fetch()):t.hasRolledBack()?this.logger.icon("ROLLED_BACK"):t.hasFailed()?this.logger.icon("FAILED"):t.isPaused()?this.logger.icon("PAUSED"):this.logger.icon("WAITING")}format(t,e,r){if(""===t.trim())return[];let s;e&&(t=e+" "+t);const n=(process.stdout.columns??80)-r*this.options.indentation-2;switch(this.options.formatOutput){case"truncate":s=t.split(lr.EOL).map(((t,e)=>this.truncate(this.indent(t,e),n)));break;case"wrap":s=this.wrap(t,n,{hard:!0}).split(lr.EOL).map(((t,e)=>this.indent(t,e)));break;default:throw new is("Format option for the renderer is wrong.")}return this.options.removeEmptyLines&&(s=s.filter(Boolean)),s.map((t=>vr(t,r*this.options.indentation)))}shouldOutputToOutputBar(t){const e=this.cache.rendererTaskOptions.get(t.id).outputBar;return"number"==typeof e&&0!==e||"boolean"==typeof e&&!1!==e}shouldOutputToBottomBar(t){const e=this.cache.rendererTaskOptions.get(t.id).bottomBar;return"number"==typeof e&&0!==e||"boolean"==typeof e&&!1!==e||!t.hasTitle()}renderer(t,e=0){return t.flatMap((r=>{if(!r.isEnabled())return[];if(this.cache.render.has(r.id))return this.cache.render.get(r.id);this.calculate(r),this.setupBuffer(r);const s=this.cache.rendererOptions.get(r.id),n=this.cache.rendererTaskOptions.get(r.id),i=[];if(r.isPrompt()){if(this.activePrompt&&this.activePrompt!==r.id)throw new is("Only one prompt can be active at the given time, please re-evaluate your task design.");this.activePrompt||(r.on("PROMPT",(t=>{const e=Rr(t);e&&(this.prompt=e)})),r.on("STATE",(t=>{("PROMPT_COMPLETED"===t||r.hasFinalized()||r.hasReset())&&(this.prompt=null,this.activePrompt=null,r.off("PROMPT"))})),this.activePrompt=r.id)}if(r.hasTitle()&&(!t.some((t=>t.hasFailed()))||r.hasFailed()||!1===r.options.exitOnError||r.isCompleted()||r.isSkipped()?r.hasFailed()&&s.collapseErrors?i.push(...this.format(!r.hasSubtasks()&&r.message.error&&s.showErrorMessage?r.message.error:r.title,this.style(r),e)):r.isSkipped()&&s.collapseSkips?i.push(...this.format(this.logger.suffix(r.message.skip&&s.showSkipMessage?r.message.skip:r.title,{field:"SKIPPED",condition:s.suffixSkips,format:gr((()=>Cr.dim),"format")}),this.style(r),e)):r.isRetrying()?i.push(...this.format(this.logger.suffix(r.title,{field:`RETRY:${r.message.retry.count}`,format:gr((()=>Cr.yellow),"format"),condition:s.suffixRetries}),this.style(r),e)):r.isCompleted()&&r.hasTitle()&&Jr(n.timer?.condition,r.message.duration)?i.push(...this.format(this.logger.suffix(r?.title,{...n.timer,args:[r.message.duration]}),this.style(r),e)):r.isPaused()?i.push(...this.format(this.logger.suffix(r.title,{...s.pausedTimer,args:[r.message.paused-Date.now()]}),this.style(r),e)):i.push(...this.format(r.title,this.style(r),e)):i.push(...this.format(r.title,this.logger.icon("COMPLETED_WITH_SISTER_TASKS_FAILED"),e))),r.hasSubtasks()&&s.showSubtasks||(!r.hasFailed()||!1!==s.collapseErrors||!s.showErrorMessage&&s.showSubtasks?!r.isSkipped()||!1!==s.collapseSkips||!s.showSkipMessage&&s.showSubtasks||i.push(...this.dump(r,e,"SKIPPED")):i.push(...this.dump(r,e,"FAILED"))),(r.isPending()||n.persistentOutput)&&i.push(...this.renderOutputBar(r,e)),!1!==s.showSubtasks&&r.hasSubtasks()&&(r.isPending()||r.hasFinalized()&&!r.hasTitle()||r.isCompleted()&&!1===s.collapseSubtasks&&!r.subtasks.some((t=>!0===this.cache.rendererOptions.get(t.id)?.collapseSubtasks))||r.subtasks.some((t=>!1===this.cache.rendererOptions.get(t.id)?.collapseSubtasks))||r.subtasks.some((t=>t.hasFailed()))||r.subtasks.some((t=>t.hasRolledBack())))){const t=r.hasTitle()?e+1:e,s=this.renderer(r.subtasks,t);i.push(...s)}return r.hasFinalized()&&(n.persistentOutput||(this.buffer.bottom.delete(r.id),this.buffer.output.delete(r.id))),r.isClosed()&&(this.cache.render.set(r.id,i),this.reset(r)),i}))}renderOutputBar(t,e){const r=this.buffer.output.get(t.id);return r?r.all.flatMap((r=>this.dump(t,e,"OUTPUT",r.entry))):[]}renderBottomBar(){return 0===this.buffer.bottom.size?[]:Array.from(this.buffer.bottom.values()).flatMap((t=>t.all)).sort(((t,e)=>t.time-e.time)).map((t=>t.entry))}renderPrompt(){return this.prompt?[this.prompt]:[]}calculate(e){if(this.cache.rendererOptions.has(e.id)&&this.cache.rendererTaskOptions.has(e.id))return;const r={...this.options,...e.rendererOptions};this.cache.rendererOptions.set(e.id,r),this.cache.rendererTaskOptions.set(e.id,{...t.rendererTaskOptions,timer:r.timer,...e.rendererTaskOptions})}setupBuffer(t){if(this.buffer.bottom.has(t.id)||this.buffer.output.has(t.id))return;const e=this.cache.rendererTaskOptions.get(t.id);this.shouldOutputToBottomBar(t)&&!this.buffer.bottom.has(t.id)?(this.buffer.bottom.set(t.id,new $r({limit:"number"==typeof e.bottomBar?e.bottomBar:1})),t.on("OUTPUT",(e=>{const r=this.dump(t,-1,"OUTPUT",e);this.buffer.bottom.get(t.id).write(r.join(lr.EOL))})),t.on("STATE",(e=>{if("RETRY"===e)this.buffer.bottom.delete(t.id)}))):this.shouldOutputToOutputBar(t)&&!this.buffer.output.has(t.id)&&(this.buffer.output.set(t.id,new $r({limit:"number"==typeof e.outputBar?e.outputBar:1})),t.on("OUTPUT",(e=>{this.buffer.output.get(t.id).write(e)})),t.on("STATE",(e=>{if("RETRY"===e)this.buffer.output.delete(t.id)})))}reset(t){this.cache.rendererOptions.delete(t.id),this.cache.rendererTaskOptions.delete(t.id),this.buffer.output.delete(t.id)}dump(t,e,r="OUTPUT",s){if(!s)switch(r){case"OUTPUT":s=t.output;break;case"SKIPPED":s=t.message.skip;break;case"FAILED":s=t.message.error}return t.hasTitle()&&"FAILED"===r&&s===t.title||"string"!=typeof s?[]:("OUTPUT"===r&&(s=Rr(s)),this.format(s,this.style(t,!0),e+1))}indent(t,e){return e>0?vr(t.trim(),this.options.indentation):t.trim()}},Wr=class{constructor(t,e){this.tasks=t,this.options=e}static{gr(this,"SilentRenderer")}static nonTTY=!0;static rendererOptions;static rendererTaskOptions;render(){}end(){}},zr=class t{constructor(e,r){this.tasks=e,this.options=r,this.options={...t.rendererOptions,...r,icon:{..._r,...r?.icon??{}},color:{...Lr,...r?.color??{}}},this.logger=this.options.logger??new Ir({useIcons:!0,toStderr:Pr}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color,this.options.timestamp&&this.logger.options.fields.prefix.unshift(this.options.timestamp)}static{gr(this,"SimpleRenderer")}static nonTTY=!0;static rendererOptions={pausedTimer:{...Ur,field:gr((t=>`PAUSED:${t}`),"field"),format:gr((()=>Cr.yellowBright),"format")}};static rendererTaskOptions={};logger;cache={rendererOptions:new Map,rendererTaskOptions:new Map};end(){}render(){this.renderer(this.tasks)}renderer(t){t.forEach((t=>{this.calculate(t),t.once("CLOSED",(()=>{this.reset(t)}));const e=this.cache.rendererOptions.get(t.id),r=this.cache.rendererTaskOptions.get(t.id);t.on("SUBTASK",(t=>{this.renderer(t)})),t.on("STATE",(e=>{if(t.hasTitle())if("STARTED"===e)this.logger.log("STARTED",t.title);else if("COMPLETED"===e){const e=r?.timer;this.logger.log("COMPLETED",t.title,e&&{suffix:{...e,condition:!!t.message?.duration&&e.condition,args:[t.message.duration]}})}else"PROMPT"===e?(this.logger.process.hijack(),t.on("PROMPT",(t=>{this.logger.process.toStderr(t,!1)}))):"PROMPT_COMPLETED"===e&&(t.off("PROMPT"),this.logger.process.release())})),t.on("OUTPUT",(t=>{this.logger.log("OUTPUT",t)})),t.on("MESSAGE",(r=>{if(r.error)this.logger.log("FAILED",t.title,{suffix:{field:`FAILED: ${r.error}`,format:gr((()=>Cr.red),"format")}});else if(r.skip)this.logger.log("SKIPPED",t.title,{suffix:{field:`SKIPPED: ${r.skip}`,format:gr((()=>Cr.yellow),"format")}});else if(r.rollback)this.logger.log("ROLLBACK",t.title,{suffix:{field:`ROLLBACK: ${r.rollback}`,format:gr((()=>Cr.red),"format")}});else if(r.retry)this.logger.log("RETRY",t.title,{suffix:{field:`RETRY:${r.retry.count}`,format:gr((()=>Cr.red),"format")}});else if(r.paused){const s=e?.pausedTimer;this.logger.log("PAUSED",t.title,s&&{suffix:{...s,condition:!!r?.paused&&s.condition,args:[r.paused-Date.now()]}})}}))}))}calculate(e){if(this.cache.rendererOptions.has(e.id)&&this.cache.rendererTaskOptions.has(e.id))return;const r={...this.options,...e.rendererOptions};this.cache.rendererOptions.set(e.id,r),this.cache.rendererTaskOptions.set(e.id,{...t.rendererTaskOptions,timer:r.timer,...e.rendererTaskOptions})}reset(t){this.cache.rendererOptions.delete(t.id),this.cache.rendererTaskOptions.delete(t.id)}},Yr=class{constructor(t){this.options=t}static{gr(this,"TestRendererSerializer")}serialize(t,e,r){return JSON.stringify(this.generate(t,e,r))}generate(t,e,r){const s={event:t,data:e};if("boolean"!=typeof this.options?.task){const t=Object.fromEntries(this.options.task.map((t=>{const e=r[t];return"function"==typeof e?[t,e.call(r)]:[t,e]})));Object.keys(r).length>0&&(s.task=t)}return s}},qr=class t{constructor(e,r){this.tasks=e,this.options=r,this.options={...t.rendererOptions,...this.options},this.logger=this.options.logger??new Ir({useIcons:!1}),this.serializer=new Yr(this.options)}static{gr(this,"TestRenderer")}static nonTTY=!0;static rendererOptions={subtasks:!0,state:Object.values(yr),output:!0,prompt:!0,title:!0,messages:["skip","error","retry","rollback","paused"],messagesToStderr:["error","rollback","retry"],task:["hasRolledBack","isRollingBack","isCompleted","isSkipped","hasFinalized","hasSubtasks","title","hasReset","hasTitle","isPrompt","isPaused","isPending","isSkipped","isStarted","hasFailed","isEnabled","isRetrying","path"]};static rendererTaskOptions;logger;serializer;render(){this.renderer(this.tasks)}end(){}renderer(t){t.forEach((t=>{this.options.subtasks&&t.on("SUBTASK",(t=>{this.renderer(t)})),this.options.state&&t.on("STATE",(e=>{this.logger.toStdout(this.serializer.serialize("STATE",e,t))})),this.options.output&&t.on("OUTPUT",(e=>{this.logger.toStdout(this.serializer.serialize("OUTPUT",e,t))})),this.options.prompt&&t.on("PROMPT",(e=>{this.logger.toStdout(this.serializer.serialize("PROMPT",e,t))})),this.options.title&&t.on("TITLE",(e=>{this.logger.toStdout(this.serializer.serialize("TITLE",e,t))})),t.on("MESSAGE",(e=>{const r=Object.fromEntries(Object.entries(e).map((([t,e])=>{if(this.options.messages.includes(t))return[t,e]})).filter(Boolean));if(Object.keys(r).length>0){const e=this.serializer.serialize("MESSAGE",r,t);this.options.messagesToStderr.some((t=>Object.keys(r).includes(t)))?this.logger.toStderr(e):this.logger.toStdout(e)}}))}))}},Vr={default:Kr,simple:zr,verbose:class t{constructor(e,r){this.tasks=e,this.options=r,this.options={...t.rendererOptions,...this.options,icon:{..._r,...r?.icon??{}},color:{...Lr,...r?.color??{}}},this.logger=this.options.logger??new Ir({useIcons:!1,toStderr:Pr}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color,this.options.timestamp&&this.logger.options.fields.prefix.unshift(this.options.timestamp)}static{gr(this,"VerboseRenderer")}static nonTTY=!0;static rendererOptions={logTitleChange:!1,pausedTimer:{...Ur,format:gr((()=>Cr.yellowBright),"format")}};static rendererTaskOptions;logger;cache={rendererOptions:new Map,rendererTaskOptions:new Map};render(){this.renderer(this.tasks)}end(){}renderer(t){t.forEach((t=>{this.calculate(t),t.once("CLOSED",(()=>{this.reset(t)}));const e=this.cache.rendererOptions.get(t.id),r=this.cache.rendererTaskOptions.get(t.id);t.on("SUBTASK",(t=>{this.renderer(t)})),t.on("STATE",(e=>{if(t.hasTitle())if("STARTED"===e)this.logger.log("STARTED",t.title);else if("COMPLETED"===e){const e=r.timer;this.logger.log("COMPLETED",t.title,e&&{suffix:{...e,condition:!!t.message?.duration&&e.condition,args:[t.message.duration]}})}})),t.on("OUTPUT",(t=>{this.logger.log("OUTPUT",t)})),t.on("PROMPT",(t=>{const e=Rr(t);e&&this.logger.log("PROMPT",e)})),!1!==this.options?.logTitleChange&&t.on("TITLE",(t=>{this.logger.log("TITLE",t)})),t.on("MESSAGE",(r=>{if(r?.error)this.logger.log("FAILED",r.error);else if(r?.skip)this.logger.log("SKIPPED",r.skip);else if(r?.rollback)this.logger.log("ROLLBACK",r.rollback);else if(r?.retry)this.logger.log("RETRY",t.title,{suffix:r.retry.count.toString()});else if(r?.paused){const s=e?.pausedTimer;this.logger.log("PAUSED",t.title,s&&{suffix:{...s,condition:!!r?.paused&&s.condition,args:[r.paused-Date.now()]}})}}))}))}calculate(e){if(this.cache.rendererOptions.has(e.id)&&this.cache.rendererTaskOptions.has(e.id))return;const r={...this.options,...e.rendererOptions};this.cache.rendererOptions.set(e.id,r),this.cache.rendererTaskOptions.set(e.id,{...t.rendererTaskOptions,timer:r.timer,...e.rendererTaskOptions})}reset(t){this.cache.rendererOptions.delete(t.id),this.cache.rendererTaskOptions.delete(t.id)}},test:qr,silent:Wr};function Xr(t){return!0===process.stdout.isTTY||!0===t.nonTTY}function Qr(t){return"string"==typeof t?Vr[t]??Vr.default:"function"==typeof t?t:Vr.default}function Zr(t){if(Jr(t?.silentRendererCondition))return{renderer:Qr("silent"),selection:"SILENT"};const e={renderer:Qr(t.renderer),options:t.rendererOptions,selection:"PRIMARY"};return!Xr(e.renderer)||Jr(t?.fallbackRendererCondition)?{renderer:Qr(t.fallbackRenderer),options:t.fallbackRendererOptions,selection:"SECONDARY"}:e}function Jr(t,...e){return"function"==typeof t?t(...e):t}gr(Xr,"isRendererSupported"),gr(Qr,"getRendererClass"),gr(Zr,"getRenderer"),gr(Jr,"assertFunctionOrSelf");var ts=dr({circles:!0});function es(t){return ts(t)}gr(es,"cloneObject");var rs=class{static{gr(this,"Concurrency")}concurrency;count;queue;constructor(t){this.concurrency=t.concurrency,this.count=0,this.queue=new Set}add(t){return this.count<this.concurrency?this.run(t):new Promise((e=>{const r=gr((()=>e(this.run(t))),"callback");this.queue.add(r)}))}flush(){for(const t of this.queue){if(this.count>=this.concurrency)break;this.queue.delete(t),t()}}run(t){this.count++;const e=t(),r=gr((()=>{this.count--,this.flush()}),"cleanup");return e.then(r,(()=>{this.queue.clear()})),e}};function ss(t){return new Promise((e=>{setTimeout(e,t)}))}gr(ss,"delay");var ns=class extends Error{constructor(t,e,r){super(t.message),this.error=t,this.type=e,this.task=r,this.name="ListrError",this.path=r.path,"full"===r?.options.collectErrors&&(this.task=es(r),this.ctx=es(r.listr.ctx)),this.stack=t?.stack}static{gr(this,"ListrError")}path;ctx},is=class extends Error{static{gr(this,"ListrRendererError")}},os=class extends Error{static{gr(this,"PromptError")}},as=class{constructor(t){this.task=t}static{gr(this,"TaskWrapper")}get title(){return this.task.title}set title(t){t=Array.isArray(t)?t:[t],this.task.title$=kr(t.shift(),...t)}get output(){return this.task.output}set output(t){t=Array.isArray(t)?t:[t],this.task.output$=kr(t.shift(),...t)}set promptOutput(t){this.task.promptOutput$=t}newListr(t,e){let r;return r="function"==typeof t?t(this):t,new ps(r,e,this.task)}report(t,e){!1!==this.task.options.collectErrors&&this.task.listr.errors.push(new ns(t,e,this.task)),this.task.message$={error:t.message??this.task?.title}}skip(t,...e){this.task.state$="SKIPPED",t&&(this.task.message$={skip:t?kr(t,...e):this.task?.title})}isRetrying(){return this.task.isRetrying()?this.task.retry:{count:0}}prompt(t){return this.task.prompt?this.task.prompt:new t(this.task,this)}stdout(t){return Dr((e=>{if("PROMPT"===t)this.promptOutput=e;else this.output=e}))}run(t){return this.task.run(t,this)}},cs=class extends Er{static{gr(this,"ListrTaskEventManager")}},ls=class extends cs{constructor(t,e,r,s,n){if(super(),this.listr=t,this.task=e,this.options=r,this.rendererOptions=s,this.rendererTaskOptions=n,e.title){const t=Array.isArray(e?.title)?e.title:[e.title];this.title=kr(t.shift(),...t),this.initialTitle=this.title}this.taskFn=e.task,this.parent=t.parentTask}static{gr(this,"Task")}id=(0,hr.randomUUID)();state="WAITING";subtasks;title;initialTitle;output;retry;message={};prompt;parent;enabled;taskFn;closed;set state$(t){if(this.state=t,this.emit("STATE",t),this.hasSubtasks()&&this.hasFailed())for(const t of this.subtasks)"STARTED"===t.state&&(t.state$="FAILED");this.listr.events.emit("SHOUD_REFRESH_RENDER")}set output$(t){this.output=t,this.emit("OUTPUT",t),this.listr.events.emit("SHOUD_REFRESH_RENDER")}set promptOutput$(t){this.emit("PROMPT",t),Rr(t)&&this.listr.events.emit("SHOUD_REFRESH_RENDER")}set message$(t){this.message={...this.message,...t},this.emit("MESSAGE",t),this.listr.events.emit("SHOUD_REFRESH_RENDER")}set title$(t){this.title=t,this.emit("TITLE",t),this.listr.events.emit("SHOUD_REFRESH_RENDER")}get path(){return[...this.listr.path,this.initialTitle]}async check(t){return"WAITING"===this.state&&(this.enabled=await Jr(this.task?.enabled??!0,t),this.emit("ENABLED",this.enabled),this.listr.events.emit("SHOUD_REFRESH_RENDER")),this.enabled}hasSubtasks(){return this.subtasks?.length>0}hasFinalized(){return this.isCompleted()||this.hasFailed()||this.isSkipped()||this.hasRolledBack()}isPending(){return this.isStarted()||this.isPrompt()||this.hasReset()}isStarted(){return"STARTED"===this.state}isSkipped(){return"SKIPPED"===this.state}isCompleted(){return"COMPLETED"===this.state}hasFailed(){return"FAILED"===this.state}isRollingBack(){return"ROLLING_BACK"===this.state}hasRolledBack(){return"ROLLED_BACK"===this.state}isRetrying(){return"RETRY"===this.state}hasReset(){return"RETRY"===this.state||"ROLLING_BACK"===this.state}isEnabled(){return this.enabled}hasTitle(){return"string"==typeof this?.title}isPrompt(){return"PROMPT"===this.state||"PROMPT_COMPLETED"===this.state}isPaused(){return"PAUSED"===this.state}isClosed(){return this.closed}async pause(t){const e=this.state;this.state$="PAUSED",this.message$={paused:Date.now()+t},await ss(t),this.state$=e,this.message$={paused:null}}async run(t,e){const r=gr((e=>(e instanceof ps?(e.options={...this.options,...e.options},e.rendererClass=Qr("silent"),this.subtasks=e.tasks,e.errors=this.listr.errors,this.emit("SUBTASK",this.subtasks),e=e.run(t)):e instanceof Promise?e=e.then(r):wr(e)?e=new Promise(((t,r)=>{e.on("data",(t=>{this.output$=t.toString()})),e.on("error",(t=>r(t))),e.on("end",(()=>t(null)))})):br(e)&&(e=new Promise(((t,r)=>{e.subscribe({next:gr((t=>{this.output$=t}),"next"),error:r,complete:t})}))),e)),"handleResult"),s=Date.now();this.state$="STARTED";const n=await Jr(this.task?.skip??!1,t);if(n)return"string"==typeof n?this.message$={skip:n}:this.hasTitle()?this.message$={skip:this.title}:this.message$={skip:"Skipped task without a title."},void(this.state$="SKIPPED");try{const n="number"==typeof this.task?.retry&&this.task.retry>0?this.task.retry+1:"object"==typeof this.task?.retry&&this.task.retry.tries>0?this.task.retry.tries+1:1,i="object"==typeof this.task.retry&&this.task.retry.delay;for(let s=1;s<=n;s++)try{await r(this.taskFn(t,e));break}catch(t){if(s===n)throw t;this.retry={count:s,error:t},this.message$={retry:this.retry},this.title$=this.initialTitle,this.output=void 0,e.report(t,"WILL_RETRY"),this.state$="RETRY",i&&await this.pause(i)}(this.isStarted()||this.isRetrying())&&(this.message$={duration:Date.now()-s},this.state$="COMPLETED")}catch(r){if(this.prompt instanceof os&&(r=this.prompt),this.task?.rollback){e.report(r,"WILL_ROLLBACK");try{this.state$="ROLLING_BACK",await this.task.rollback(t,e),this.message$={rollback:this.title},this.state$="ROLLED_BACK"}catch(t){throw this.state$="FAILED",e.report(t,"HAS_FAILED_TO_ROLLBACK"),this.close(),t}if(!1!==this.listr.options?.exitAfterRollback)throw this.close(),r}else{if(this.state$="FAILED",!1!==this.listr.options.exitOnError&&!1!==await Jr(this.task?.exitOnError,t))throw e.report(r,"HAS_FAILED"),this.close(),r;this.hasSubtasks()||e.report(r,"HAS_FAILED_WITHOUT_ERROR")}}finally{this.close()}}close(){this.emit("CLOSED"),this.listr.events.emit("SHOUD_REFRESH_RENDER"),this.complete()}},us=class extends Er{static{gr(this,"ListrEventManager")}},ps=class{constructor(t,e,r){this.task=t,this.options=e,this.parentTask=r,this.options={concurrent:!1,renderer:"default",fallbackRenderer:"simple",exitOnError:!0,exitAfterRollback:!0,collectErrors:!1,registerSignalListeners:!0,...this.parentTask?.options??{},...e},!0===this.options.concurrent?this.options.concurrent=1/0:"number"!=typeof this.options.concurrent&&(this.options.concurrent=1),this.concurrency=new rs({concurrency:this.options.concurrent}),r&&(this.path=[...r.listr.path,r.title],this.errors=r.listr.errors),this.parentTask?.listr.events instanceof us?this.events=this.parentTask.listr.events:this.events=new us;const s=Zr({renderer:this.options.renderer,rendererOptions:this.options.rendererOptions,fallbackRenderer:this.options.fallbackRenderer,fallbackRendererOptions:this.options.fallbackRendererOptions,fallbackRendererCondition:this.options?.fallbackRendererCondition,silentRendererCondition:this.options?.silentRendererCondition});this.rendererClass=s.renderer,this.rendererClassOptions=s.options,this.rendererSelection=s.selection,this.add(t??[]),this.options.registerSignalListeners&&(this.boundSignalHandler=this.signalHandler.bind(this),process.once("SIGINT",this.boundSignalHandler).setMaxListeners(0)),(this.options?.forceTTY||process.env.LISTR_FORCE_TTY)&&(process.stdout.isTTY=!0,process.stderr.isTTY=!0),this.options?.forceUnicode&&(process.env.LISTR_FORCE_UNICODE="1")}static{gr(this,"Listr")}tasks=[];errors=[];ctx;events;path=[];rendererClass;rendererClassOptions;rendererSelection;boundSignalHandler;concurrency;renderer;isRoot(){return!this.parentTask}isSubtask(){return!!this.parentTask}add(t){this.tasks.push(...this.generate(t))}async run(t){this.renderer||(this.renderer=new this.rendererClass(this.tasks,this.rendererClassOptions,this.events)),await this.renderer.render(),this.ctx=this.options?.ctx??t??{},await Promise.all(this.tasks.map((t=>t.check(this.ctx))));try{await Promise.all(this.tasks.map((t=>this.concurrency.add((()=>this.runTask(t)))))),this.renderer.end(),this.removeSignalHandler()}catch(t){if(!1!==this.options.exitOnError)throw this.renderer.end(t),this.removeSignalHandler(),t}return this.ctx}generate(t){return(t=Array.isArray(t)?t:[t]).map((t=>{let e;return"PRIMARY"===this.rendererSelection?e=t.rendererOptions:"SECONDARY"===this.rendererSelection&&(e=t.fallbackRendererOptions),new ls(this,t,this.options,this.rendererClassOptions,e)}))}async runTask(t){if(await t.check(this.ctx))return new as(t).run(this.ctx)}signalHandler(){this.tasks?.forEach((async t=>{t.isPending()&&(t.state$="FAILED")})),this.isRoot()&&(this.renderer.end(new Error("Interrupted.")),process.exit(127))}removeSignalHandler(){this.boundSignalHandler&&process.removeListener("SIGINT",this.boundSignalHandler)}};const ds=se.Ay.blue(xr.arrowRight),hs=se.Ay.redBright(xr.cross),fs=se.Ay.yellow(xr.warning),gs=(t,e,r)=>`${se.Ay.redBright(`${hs} Validation Error:`)}\n\n Invalid value for '${se.Ay.bold(t)}': ${se.Ay.bold((0,jt.inspect)(r))}\n\n ${e}`,ms=se.Ay.redBright(`${hs} Current directory is not a git directory!`),ys=se.Ay.redBright(`${hs} Failed to get staged files!`),Es=`${hs} No valid configuration found.`,bs=`${ds} No staged files found.`,ws=`${ds} No staged files match any configured task.`,Ss=se.Ay.yellow(`${fs} Some of your tasks use \`git add\` command. Please remove it from the config since all modifications made by tasks will be automatically added to the git commit index.\n`),As="Skipped because of errors from tasks.",Rs=`\n ${se.Ay.redBright(`${hs} lint-staged failed due to a git error.`)}`,Cs=(t,e,r)=>`${se.Ay.redBright(`${hs} Validation Error:`)}\n\n Invalid value for option '${se.Ay.bold(t)}': ${se.Ay.bold(e)}\n\n ${r}\n\nSee https://github.com/okonet/lint-staged#command-line-flags`,vs=`\n ${se.Ay.yellow(`${fs} lint-staged prevented an empty git commit.\n Use the --allow-empty option to continue, or check your task configuration`)}\n`,Ts=(se.Ay.redBright(`${hs} Failed to read config from stdin.`),(t,e)=>`${se.Ay.redBright(`${e} Failed to parse config from file "${t}".`)}\n\n${e}\n\nSee https://github.com/okonet/lint-staged#configuration.`),Os=(t={},e)=>{if(!Array.isArray(t.output))return;const r=t.errors?.size>0?e.error:e.log;for(const e of t.output)r(e)},xs=t=>{if(t===i.posix.sep||t===i.win32.sep)return i.posix.sep;let e=t.split(/[/\\]+/).join(i.posix.sep);return(t.startsWith("\\\\?\\")||t.startsWith("\\\\.\\"))&&(e=e.replace(/^\/(\.|\?)/,"//$1")),e.endsWith(i.posix.sep)&&(e=e.slice(0,-1)),e},ks=s("lint-staged:chunkFiles"),_s=({files:t,baseDir:e,maxArgLength:r=null,relative:s=!1})=>{const n=t.map((t=>xs(s||!e?t:i.resolve(e,t))));if(!r)return ks("Skip chunking files because of undefined maxArgLength"),[n];const o=n.join(" ").length;ks(`Resolved an argument string length of ${o} characters from ${n.length} files`);const a=Math.min(Math.ceil(o/r),n.length);return ks(`Creating ${a} chunks for maxArgLength of ${r}`),((t,e)=>{if(1===e)return[t];const r=[];let s=0;for(let n=0;n<e;n++){const i=Math.ceil((t.length-s)/(e-n));r.push([]),r[n]=t.slice(s,i+s),s+=i}return r})(n,a)};var Ls=r(1723);const Ps=s("lint-staged:generateTasks"),Is=({config:t,cwd:e=process.cwd(),files:r,relative:s=!1})=>{Ps("Generating linter tasks");const n=r.map((t=>xs(i.relative(e,t))));return Object.entries(t).map((([t,r])=>{const o=t.startsWith("../"),a=n.filter((t=>!!o||!t.startsWith("..")&&!i.isAbsolute(t))),c=Ls(a,t,{cwd:e,dot:!0,matchBase:!t.includes("/"),posixSlashes:!0,strictBrackets:!0}),l={pattern:t,commands:r,fileList:c.map((t=>xs(s?t:i.resolve(e,t))))};return Ps("Generated task: \n%O",l),l}))};var $s=r(7075);const Bs=new RegExp(b.EOL+"$"),Hs=t=>new $s.Writable({write:function(e,r,s){t(e.toString().replace(Bs,"")),s()}}),Ds=({renderer:t},{FORCE_COLOR:e})=>"silent"===t||"test"===t||Number(e)>0?t:"verbose",Fs=(t,e,r=process.env)=>{const s=(({debug:t,quiet:e},r,s)=>e?{renderer:"silent"}:"test"===s.NODE_ENV?{renderer:"test",rendererOptions:{logger:new Ir({processOutput:new Hr(Hs(r.log),Hs(r.error))})}}:t||"dumb"===s.TERM?{renderer:"verbose"}:{renderer:"update",rendererOptions:{formatOutput:"truncate"}})(t,e,r);return{...s,fallbackRenderer:Ds(s,r)}};function Ms(t,e){return["diff","--name-only","-z",`--diff-filter=${void 0!==e?e.trim():"ACMR"}`,...void 0!==t?t.trim().split(" "):["--staged"]]}const Ns=t=>t?t.replace(/\u0000$/,"").split("\0"):[];var Gs=r(1455);const Us=s("lint-staged:file"),js=async(t,e=!0)=>{Us("Reading file `%s`",t);try{return await Gs.readFile(t)}catch(r){if(e&&"ENOENT"===r.code)return Us("File `%s` doesn't exist, ignoring...",t),null;throw r}},Ks=async(t,e=!0)=>{Us("Removing file `%s`",t);try{await Gs.unlink(t)}catch(r){if(!e||"ENOENT"!==r.code)throw r;Us("File `%s` doesn't exist, ignoring...",t)}},Ws=async(t,e)=>{Us("Writing file `%s`",t),await Gs.writeFile(t,e)},zs=Symbol("ApplyEmptyCommitError"),Ys=new Error("Configuration could not be found"),qs=new Error("Configuration should be an object or a function"),Vs=new Error("Configuration should not be empty"),Xs=Symbol("GetBackupStashError"),Qs=Symbol("GetStagedFilesError"),Zs=Symbol("GitError"),Js=Symbol("GitRepoError"),tn=Symbol("HideUnstagedChangesError"),en=new Error("Invalid Options"),rn=Symbol("RestoreMergeStatusError"),sn=Symbol("RestoreOriginalStateError"),nn=Symbol("RestoreUnstagedChangesError"),on=Symbol("TaskError"),an=s("lint-staged:GitWorkflow"),cn=/\x00/,ln=(t,e=!0)=>t.reduce(((t,r)=>{if(cn.test(r)){const[s,n]=r.split(cn);e&&t.push(n),t.push(s)}else t.push(r);return t}),[]),un="lint-staged automatic backup",pn="lint-staged_unstaged.patch",dn=["--binary","--unified=0","--no-color","--no-ext-diff","--src-prefix=a/","--dst-prefix=b/","--patch","--submodule=short"],hn=["-v","--whitespace=nowarn","--recount","--unidiff-zero"],fn=(t,e,r)=>{throw e.errors.add(Zs),r&&e.errors.add(r),t};class gn{constructor({allowEmpty:t,gitConfigDir:e,topLevelDir:r,matchedFileChunks:s,diff:n,diffFilter:o}){this.execGit=(t,e={})=>re(t,{...e,cwd:r}),this.deletedFiles=[],this.gitConfigDir=e,this.topLevelDir=r,this.diff=n,this.diffFilter=o,this.allowEmpty=t,this.matchedFileChunks=s,this.mergeHeadFilename=i.resolve(e,"MERGE_HEAD"),this.mergeModeFilename=i.resolve(e,"MERGE_MODE"),this.mergeMsgFilename=i.resolve(e,"MERGE_MSG")}getHiddenFilepath(t){return i.resolve(this.gitConfigDir,`./${t}`)}async getBackupStash(t){const e=(await this.execGit(["stash","list"])).split("\n").findIndex((t=>t.includes(un)));if(-1===e)throw t.errors.add(Xs),new Error("lint-staged automatic backup is missing!");return String(e)}async getDeletedFiles(){an("Getting deleted files...");const t=(await this.execGit(["ls-files","--deleted"])).split("\n").filter(Boolean).map((t=>i.resolve(this.topLevelDir,t)));return an("Found deleted files:",t),t}async backupMergeStatus(){an("Backing up merge state..."),await Promise.all([js(this.mergeHeadFilename).then((t=>this.mergeHeadBuffer=t)),js(this.mergeModeFilename).then((t=>this.mergeModeBuffer=t)),js(this.mergeMsgFilename).then((t=>this.mergeMsgBuffer=t))]),an("Done backing up merge state!")}async restoreMergeStatus(t){an("Restoring merge state...");try{await Promise.all([this.mergeHeadBuffer&&Ws(this.mergeHeadFilename,this.mergeHeadBuffer),this.mergeModeBuffer&&Ws(this.mergeModeFilename,this.mergeModeBuffer),this.mergeMsgBuffer&&Ws(this.mergeMsgFilename,this.mergeMsgBuffer)]),an("Done restoring merge state!")}catch(e){an("Failed restoring merge state with error:"),an(e),fn(new Error("Merge state could not be restored due to an error!"),t,rn)}}async getPartiallyStagedFiles(){an("Getting partially staged files...");const t=(await this.execGit(["status","-z"])).split(/\x00(?=[ AMDRCU?!]{2} |$)/).filter((t=>{const[e,r]=t;return" "!==e&&" "!==r&&"?"!==e&&"?"!==r})).map((t=>t.substr(3))).filter(Boolean);return an("Found partially staged files:",t),t.length?t:null}async prepare(t){try{if(an("Backing up original state..."),this.partiallyStagedFiles=await this.getPartiallyStagedFiles(),this.partiallyStagedFiles){t.hasPartiallyStagedFiles=!0;const e=this.getHiddenFilepath(pn),r=ln(this.partiallyStagedFiles);await this.execGit(["diff",...dn,"--output",e,"--",...r])}else t.hasPartiallyStagedFiles=!1;if(!t.shouldBackup)return;await this.backupMergeStatus(),this.deletedFiles=await this.getDeletedFiles();const e=await this.execGit(["stash","create"]);await this.execGit(["stash","store","--quiet","--message",un,e]),an("Done backing up original state!")}catch(e){fn(e,t)}}async hideUnstagedChanges(t){try{const t=ln(this.partiallyStagedFiles,!1);await this.execGit(["checkout","--force","--",...t])}catch(e){fn(e,t,tn)}}async applyModifications(t){an("Adding task modifications to index...");for(const t of this.matchedFileChunks)await this.execGit(["add","--",...t]);an("Done adding task modifications to index!");await this.execGit(Ms(this.diff,this.diffFilter))||this.allowEmpty||fn(new Error("Prevented an empty git commit!"),t,zs)}async restoreUnstagedChanges(t){an("Restoring unstaged changes...");const e=this.getHiddenFilepath(pn);try{await this.execGit(["apply",...hn,e])}catch(r){an("Error while restoring changes:"),an(r),an("Retrying with 3-way merge");try{await this.execGit(["apply",...hn,"--3way",e])}catch(e){an("Error while restoring unstaged changes using 3-way merge:"),an(e),fn(new Error("Unstaged changes could not be restored due to a merge conflict!"),t,nn)}}}async restoreOriginalState(t){try{an("Restoring original state..."),await this.execGit(["reset","--hard","HEAD"]),await this.execGit(["stash","apply","--quiet","--index",await this.getBackupStash(t)]),await this.restoreMergeStatus(t),await Promise.all(this.deletedFiles.map((t=>Ks(t)))),await Ks(this.getHiddenFilepath(pn)),an("Done restoring original state!")}catch(e){fn(e,t,sn)}}async cleanup(t){try{an("Dropping backup stash..."),await this.execGit(["stash","drop","--quiet",await this.getBackupStash(t)]),an("Done dropping backup stash!")}catch(e){fn(e,t)}}}const mn=s("lint-staged:groupFilesByConfig");function yn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=0;r<t.length;r++){var s=t[r];if("string"==typeof s)return s}}var En=r(6454),bn=r(4434);const wn=({quiet:t=!1}={})=>({hasPartiallyStagedFiles:null,shouldBackup:null,shouldHidePartiallyStaged:!0,errors:new Set([]),events:new bn,output:[],quiet:t}),Sn=t=>t.hasPartiallyStagedFiles&&t.shouldHidePartiallyStaged,An=t=>!!t.shouldBackup&&(t.errors.has(Zs)?Rs:t.errors.has(on)?As:void 0),Rn=t=>t.errors.has(Zs)?Rs:t.errors.has(on)?As:void 0,Cn=t=>t.shouldBackup&&(t.errors.has(on)||t.errors.has(zs)||t.errors.has(nn)),vn=t=>{if(t.errors.has(Zs)&&!t.errors.has(zs)&&!t.errors.has(nn))return Rs},Tn=t=>t.shouldBackup,On=t=>!t.errors.has(Zs)||t.errors.has(zs)||t.errors.has(nn)?t.errors.has(sn)?Rs:void 0:Rs,xn="lint-staged:taskError",kn=s("lint-staged:resolveTaskFn"),_n=({code:t,killed:e,signal:r})=>(e?"KILLED":r)||t||"FAILED",Ln=(t,e,r,s=!1)=>{const{stderr:n,stdout:i}=e;if(!!n||!!i){const e=s?se.Ay.redBright(`${hs} ${t}:`):`${ds} ${t}:`,o=[].concat(r.quiet?[]:["",e]).concat(n||[]).concat(i||[]);r.output.push(o.join("\n"))}else if(s){const s=_n(e),n=se.Ay.redBright(`\n${hs} ${t} failed without output (${s}).`);r.quiet||r.output.push(n)}},Pn=(t,e)=>{let r;const s=async()=>{r=(async t=>{try{const e=await En(t.pid);for(const t of e)try{process.kill(t)}catch(e){kn('Failed to kill process with pid "%d": %o',t,e)}}catch(e){kn('Failed to kill process with pid "%d": %o',t.pid,e)}t.kill()})(e),await r};return t.events.on(xn,s,{once:!0}),async()=>{t.events.off(xn,s),await r}},In=({command:t,cwd:e=process.cwd(),files:r,topLevelDir:s,isFn:n,shell:i=!1,verbose:o=!1})=>{const[a,...c]=function(t,e,r){var s,n=/([^\s'"]([^\s'"]*(['"])([^\3]*?)\3)+[^\s'"]*)|[^\s'"]+|(['"])([^\5]*?)\5/gi,i=t,o=[];e&&o.push(e),r&&o.push(r);do{null!==(s=n.exec(i))&&o.push(yn(s[1],s[6],s[0]))}while(null!==s);return o}(t);kn("cmd:",a),kn("args:",c);const l={cwd:/^git(\.exe)?/i.test(a)?s:e,preferLocal:!0,reject:!1,shell:i,stdin:"ignore"};return kn("execaOptions:",l),async(e=wn())=>{const s=i?Jt(n?t:`${t} ${r.join(" ")}`,l):Vt(a,n?c:c.concat(r),l),u=Pn(e,s),p=await s;if(await u(),p.failed||p.killed||null!=p.signal)throw((t,e,r)=>{r.errors.add(on),r.events.emit(xn,on),Ln(t,e,r,!0);const s=_n(e);return new Error(`${se.Ay.redBright(t)} ${se.Ay.dim(`[${s}]`)}`)})(t,p,e);o&&Ln(t,p,e)}},$n=s("lint-staged:makeCmdTasks"),Bn=async({commands:t,cwd:e,files:r,topLevelDir:s,shell:n,verbose:i})=>{$n("Creating listr tasks for commands %o",t);const o=Array.isArray(t)?t:[t],a=[];for(const t of o){const o="function"==typeof t,c=o?await t([...r]):t,l=Array.isArray(c)?c:[c];for(const t of l){if(o&&"string"!=typeof t)throw new Error(gs("[Function]","Function task should return a string or an array of strings",c));const l=In({command:t,cwd:e,files:r,topLevelDir:s,isFn:o,shell:n,verbose:i});a.push({title:t,command:t,task:l})}}return a},Hn=s("lint-staged:resolveGitRepo"),Dn=async(t=process.cwd())=>{try{Hn("Resolving git repo from `%s`",t),Hn("Unset GIT_DIR (was `%s`)",process.env.GIT_DIR),delete process.env.GIT_DIR,Hn("Unset GIT_WORK_TREE (was `%s`)",process.env.GIT_WORK_TREE),delete process.env.GIT_WORK_TREE;const e=await re(["rev-parse","--show-cdup"],{cwd:t}),r=xs(i.join(t,e));Hn("Resolved git repository top-level directory to be `%s`",r);const s=await(async(t=process.cwd())=>{const e=re(["rev-parse","--show-toplevel"],{cwd:t}),r=re(["rev-parse","--absolute-git-dir"],{cwd:t}),[s,n]=await Promise.all([e,r]);return i.relative(s,n)})(t),n=xs(i.join(r,s));return Hn("Resolved git config directory to be `%s`",n),{topLevelDir:r,gitConfigDir:n}}catch(t){return Hn("Failed to resolve git repo with error:",t),{error:t,topLevelDir:null,gitConfigDir:null}}},Fn=async()=>{},Mn=/(?<![\\$])({)(?:(?!(?<!\\),|\.\.|\{|\}).)*?(?<!\\)(})/g,Nn=/{{[^}{]*}}/,Gn=(t,e)=>{const r=(t=>{let e=`${t}`;const r=Nn.exec(t)?.[0];if(r){const t=r.replace("{{","{").replace("}}","}");e=e.replace(r,t)}return e})((t=>{let e=`${t}`,r=null;for(;r=Mn.exec(t);){const t=r[0],s=t.replace(/{/,"").replace(/}/,"");e=e.replace(t,s)}return e})(t));var s,n;return r!==t&&e.warn((s=t,n=r,se.Ay.yellow(`${fs} Detected incorrect braces with only single value: \`${s}\`. Reformatted as: \`${n}\`\n`))),r},Un=s("lint-staged:validateConfig"),jn=t=>t&&"object"==typeof t&&!Array.isArray(t),Kn=new Map([["concurrent",t=>"boolean"==typeof t],["chunkSize",t=>"number"==typeof t],["globOptions",jn],["linters",jn],["ignore",t=>Array.isArray(t)],["subTaskConcurrency",t=>"number"==typeof t],["renderer",t=>"string"==typeof t],["relative",t=>"boolean"==typeof t]]),Wn=(t,e,r)=>{try{return((t,e,r)=>{if(Un("Validating config from `%s`...",e),!t||"object"!=typeof t&&"function"!=typeof t)throw qs;if("function"==typeof t)return{"*":t};if(0===Object.entries(t).length)throw Vs;const s=[],n=Object.entries(t).reduce(((t,[e,n])=>{if(Kn.has(e))return Kn.get(e)(n)&&s.push(gs(e,"Advanced configuration has been deprecated.",n)),t;Array.isArray(n)&&!n.some((t=>"string"!=typeof t&&"function"!=typeof t))||"string"==typeof n||"function"==typeof n||s.push(gs(e,"Should be a string, a function, or an array of strings and functions.",n));const i=Gn(e,r);return{...t,[i]:n}}),{});if(s.length){const t=s.join("\n\n");throw r.error(Ts(e,t)),new Error(t)}return Un("Validated config from `%s`:",e),Un((0,jt.inspect)(t,{compact:!1})),n})(t,e,r)}catch(t){throw r.error(Ts(e,t)),t}},zn=["package.json","package.yaml","package.yml",".lintstagedrc",".lintstagedrc.json",".lintstagedrc.yaml",".lintstagedrc.yml",".lintstagedrc.mjs",".lintstagedrc.js",".lintstagedrc.cjs","lint-staged.config.mjs","lint-staged.config.js","lint-staged.config.cjs"],Yn=s("lint-staged:searchConfigs"),qn=["ls-files","-z","--full-name","-t"],Vn=t=>zn.includes(i.basename(t)),Xn=t=>t.split("/").length,Qn=(t,e)=>Xn(t)>Xn(e)?-1:1,Zn=async({configObject:t,configPath:e,cwd:r=process.cwd(),topLevelDir:s=r},n)=>{if(Yn("Searching for configuration files..."),t)return Yn("Using single direct configuration object..."),{"":Wn(t,"config object",n)};if(e){Yn("Using single configuration path...");const{config:t,filepath:r}=await Fn();return t?{[e]:Wn(t,r,n)}:{}}const[o,a]=await Promise.all([re(qn,{cwd:s}).then(Ns),re([...qn,"--others","--exclude-standard"],{cwd:s}).then(Ns)]),c=[...o,...a].flatMap((t=>t.startsWith("S ")?[]:[t.replace(/^[HSMRCK?U] /,"")])).filter(Vn).map((t=>xs(i.join(s,t)))).filter((l=r,t=>t.startsWith(xs(l)))).sort(Qn);var l;Yn("Found possible config files:",c);const u=c.reduce(((t,e)=>Object.assign(t,{[e]:null})),{});await Promise.all(Object.keys(u).map((t=>Fn().then((({config:e,filepath:r})=>{e&&(t!==r&&Yn('Config file "%s" resolved to "%s"',t,r),u[t]=Wn(e,r,n))})))));const p=Object.entries(u).filter((([,t])=>!!t)).reduce(((t,[e,r])=>({...t,[e]:r})),{});if(!Object.keys(p).length){Yn('Could not find config files inside "%s"',r);const{config:t,filepath:e}=await Fn();t?(Yn('Found parent configuration file from "%s"',e),p[e]=Wn(t,e,n)):Yn('Could not find parent configuration files from "%s"',r)}return Yn("Found %d config files",Object.keys(p).length),p},Jn=s("lint-staged:runAll"),ti=t=>Object.assign(new Error("lint-staged failed"),{ctx:t}),ei=async({allowEmpty:t=!1,concurrent:e=!0,configObject:r,configPath:s,cwd:n,debug:o=!1,diff:a,diffFilter:c,maxArgLength:l,quiet:u=!1,relative:p=!1,shell:d=!1,stash:h=void 0===a,hidePartiallyStaged:f=h,verbose:g=!1},m=console)=>{Jn("Running all linter scripts...");const y=!!n;n=y?i.resolve(n):process.cwd(),Jn("Using working directory `%s`",n);const E=wn({quiet:u}),{topLevelDir:b,gitConfigDir:w}=await Dn(n);if(!b)throw u||E.output.push(ms),E.errors.add(Js),ti(E);const S=await re(["log","-1"],{cwd:b}).then((()=>!0)).catch((()=>!1));E.shouldBackup=S&&h,E.shouldBackup||u||m.warn(((t,e)=>{const r=void 0!==e?"`--diff` was used":t?"`--no-stash` was used":"there\u2019s no initial commit yet";return se.Ay.yellow(`${fs} Skipping backup because ${r}.\n`)})(S,a)),E.shouldHidePartiallyStaged=f,E.shouldHidePartiallyStaged||u||m.warn(((t,e)=>{const r=void 0!==e?"`--diff` was used":t?"`--no-hide-partially-staged` was used":"`--no-stash` was used";return se.Ay.yellow(`${fs} Skipping hiding unstaged changes from partially staged files because ${r}.\n`)})(S&&h,a));const A=await(async({cwd:t=process.cwd(),diff:e,diffFilter:r}={})=>{try{const s=await re(Ms(e,r),{cwd:t});return s?Ns(s).map((e=>xs(i.resolve(t,e)))):[]}catch{return null}})({cwd:b,diff:a,diffFilter:c});if(!A)throw u||E.output.push(ys),E.errors.add(Qs),ti(E);if(Jn("Loaded list of staged files in git:\n%O",A),0===A.length)return u||E.output.push(bs),E;const R=await Zn({configObject:r,configPath:s,cwd:n,topLevelDir:b},m),C=Object.keys(R).length;if(0===C)throw E.errors.add(Ys),ti(E);const v=await(async({configs:t,files:e,singleConfigMode:r})=>{mn("Grouping %d files by %d configurations",e.length,Object.keys(t).length);const s=new Set(e),n={};for(const[o,a]of Object.entries(t)){if(r){n[o]={config:a,files:e};break}const t=i.normalize(i.dirname(o)),c=e=>{const r=i.relative(t,e);return r&&!r.startsWith("..")&&!i.isAbsolute(r)},l=Object.keys(a).some((t=>t.startsWith(".."))),u=new Set(l?s:void 0);l||s.forEach((t=>{c(t)&&u.add(t)})),u.forEach((t=>{s.delete(t)})),n[o]={config:a,files:Array.from(u)}}return n})({configs:R,files:A,singleConfigMode:r||void 0!==s}),T=C>1;let O=!1;const x={ctx:E,exitOnError:!1,registerSignalListeners:!1,...Fs({debug:o,quiet:u},m)},k=[],_=new Set;for(const[t,{config:r,files:s}]of Object.entries(v)){const o=t?xs(i.relative(n,t)):"Config object",a=_s({baseDir:b,files:s,maxArgLength:l,relative:p}),c=T&&!y?i.dirname(t):n,u=a.length;u>1&&Jn("Chunked staged files from `%s` into %d part",t,u);for(const[t,s]of a.entries()){const n=await Promise.all(Is({config:r,cwd:c,files:s,relative:p}).map((t=>Bn({commands:t.commands,cwd:c,files:t.fileList,topLevelDir:b,shell:d,verbose:g}).then((e=>{t.fileList.forEach((t=>{const e=i.isAbsolute(t)?t:xs(i.join(c,t));_.add(e)})),O=O||e.some((t=>"git add"===t.command));const r=t.fileList.length;return{title:`${t.pattern}${se.Ay.dim(` \u2014 ${r} ${1===r?"file":"files"}`)}`,task:async(t,r)=>r.newListr(e,{concurrent:!1,exitOnError:!0}),skip:()=>0===r&&`${t.pattern}${se.Ay.dim(" \u2014 no files")}`}})))));k.push({title:`${o}${se.Ay.dim(` \u2014 ${s.length} ${s.length>1?"files":"file"}`)}`+(u>1?se.Ay.dim(` (chunk ${t+1}/${u})...`):""),task:(t,r)=>r.newListr(n,{concurrent:e,exitOnError:!0}),skip:()=>E.errors.has(Zs)?"Skipped because of previous git error.":!!n.every((t=>t.skip()))&&`${o}${se.Ay.dim(" \u2014 no tasks to run")}`})}}if(O&&!u&&m.warn(Ss),k.every((t=>t.skip())))return u||E.output.push(ws),E;const L=_s({baseDir:n,files:Array.from(_),maxArgLength:l,relative:!1}),P=new gn({allowEmpty:t,gitConfigDir:w,topLevelDir:b,matchedFileChunks:L,diff:a,diffFilter:c}),I=new ps([{title:"Preparing lint-staged...",task:t=>P.prepare(t)},{title:"Hiding unstaged changes to partially staged files...",task:t=>P.hideUnstagedChanges(t),enabled:Sn},{title:`Running tasks for ${a?"changed":"staged"} files...`,task:(t,r)=>r.newListr(k,{concurrent:e}),skip:()=>k.every((t=>t.skip()))},{title:"Applying modifications from tasks...",task:t=>P.applyModifications(t),skip:An},{title:"Restoring unstaged changes to partially staged files...",task:t=>P.restoreUnstagedChanges(t),enabled:Sn,skip:Rn},{title:"Reverting to original state because of errors...",task:t=>P.restoreOriginalState(t),enabled:Cn,skip:vn},{title:"Cleaning up temporary files...",task:t=>P.cleanup(t),enabled:Tn,skip:On}],x);if(await I.run(),E.errors.size>0)throw ti(E);return E},ri=s("lint-staged:validateOptions"),si=s("lint-staged"),ni=()=>{switch(process.platform){case"darwin":return 262144;case"win32":return 8191;default:return 131072}},ii=async({allowEmpty:t=!1,concurrent:e=!0,config:r,configPath:s,cwd:n,debug:o=!1,diff:a,diffFilter:c,maxArgLength:l=ni()/2,quiet:u=!1,relative:p=!1,shell:d=!1,stash:h=void 0===a,hidePartiallyStaged:f=h,verbose:g=!1}={},m=console)=>{const y=await re(["version","--build-options"],{cwd:n});si("%s",y);const E={allowEmpty:t,concurrent:e,configObject:r,configPath:s,cwd:n,debug:o,diff:a,diffFilter:c,maxArgLength:l,quiet:u,relative:p,shell:d,stash:h,hidePartiallyStaged:f,verbose:g};await(async(t={},e)=>{if(ri("Validating options..."),"string"==typeof t.cwd)try{const e=i.resolve(t.cwd);await Gs.access(e,j.constants.F_OK)}catch(r){throw ri("Failed to validate options: %o",t),e.error(Cs("cwd",t.cwd,r.message)),en}if("string"==typeof t.shell)try{await Gs.access(t.shell,j.constants.X_OK)}catch(r){throw ri("Failed to validate options: %o",t),e.error(Cs("shell",t.shell,r.message)),en}ri("Validated options: %o",t)})(E,m),si("Unset GIT_LITERAL_PATHSPECS (was `%s`)",process.env.GIT_LITERAL_PATHSPECS),delete process.env.GIT_LITERAL_PATHSPECS;try{const t=await ei(E,m);return si("Tasks were executed successfully!"),Os(t,m),!0}catch(t){if(t?.ctx?.errors){const{ctx:e}=t;return e.errors.has(Ys)?m.error(Es):e.errors.has(zs)?m.warn(vs):e.errors.has(Zs)&&!e.errors.has(Xs)&&(m.error(Rs),e.shouldBackup&&m.error(" Any lost modifications can be restored from a git stash:\n\n > git stash list\n stash@{0}: automatic lint-staged backup\n > git stash apply --index stash@{0}\n")),Os(e,m),!1}throw t}}},5190:(t,e,r)=>{r.d(e,{V:()=>l});var s=r(1708),n=r(6760),i=r(3136);function o(t={}){const{env:e=process.env,platform:r=process.platform}=t;return"win32"!==r?"PATH":Object.keys(e).reverse().find((t=>"PATH"===t.toUpperCase()))||"Path"}const a=(t,e)=>{let r;for(;r!==e;)t.push(n.join(e,"node_modules/.bin")),r=e,e=n.resolve(e,"..")},c=(t,e,r)=>{const s=e instanceof URL?(0,i.fileURLToPath)(e):e;t.push(n.resolve(r,s,".."))},l=({env:t=s.env,...e}={})=>{const r=o({env:t={...t}});return e.path=t[r],t[r]=(({cwd:t=s.cwd(),path:e=s.env[o()],preferLocal:r=!0,execPath:l=s.execPath,addExecPath:u=!0}={})=>{const p=t instanceof URL?(0,i.fileURLToPath)(t):t,d=n.resolve(p),h=[];return r&&a(h,d),u&&c(h,l,d),[...h,e].join(n.delimiter)})(e),t}},7017:(t,e,r)=>{r.d(e,{cf:()=>p});const s=[];s.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&s.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&s.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const n=t=>!!t&&"object"==typeof t&&"function"==typeof t.removeListener&&"function"==typeof t.emit&&"function"==typeof t.reallyExit&&"function"==typeof t.listeners&&"function"==typeof t.kill&&"number"==typeof t.pid&&"function"==typeof t.on,i=Symbol.for("signal-exit emitter"),o=globalThis,a=Object.defineProperty.bind(Object);class c{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(o[i])return o[i];a(o,i,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,e){this.listeners[t].push(e)}removeListener(t,e){const r=this.listeners[t],s=r.indexOf(e);-1!==s&&(0===s&&1===r.length?r.length=0:r.splice(s,1))}emit(t,e,r){if(this.emitted[t])return!1;this.emitted[t]=!0;let s=!1;for(const n of this.listeners[t])s=!0===n(e,r)||s;return"exit"===t&&(s=this.emit("afterExit",e,r)||s),s}}class l{}const u=globalThis.process,{onExit:p,load:d,unload:h}=(f=n(u)?new class extends l{#t="win32"===u.platform?"SIGINT":"SIGHUP";#e=new c;#r;#s;#n;#i={};#o=!1;constructor(t){super(),this.#r=t,this.#i={};for(const e of s)this.#i[e]=()=>{const r=this.#r.listeners(e);let{count:s}=this.#e;const n=t;if("object"==typeof n.__signal_exit_emitter__&&"number"==typeof n.__signal_exit_emitter__.count&&(s+=n.__signal_exit_emitter__.count),r.length===s){this.unload();const r=this.#e.emit("exit",null,e),s="SIGHUP"===e?this.#t:e;r||t.kill(t.pid,s)}};this.#n=t.reallyExit,this.#s=t.emit}onExit(t,e){if(!n(this.#r))return()=>{};!1===this.#o&&this.load();const r=e?.alwaysLast?"afterExit":"exit";return this.#e.on(r,t),()=>{this.#e.removeListener(r,t),0===this.#e.listeners.exit.length&&0===this.#e.listeners.afterExit.length&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#e.count+=1;for(const t of s)try{const e=this.#i[t];e&&this.#r.on(t,e)}catch(t){}this.#r.emit=(t,...e)=>this.#a(t,...e),this.#r.reallyExit=t=>this.#c(t)}}unload(){this.#o&&(this.#o=!1,s.forEach((t=>{const e=this.#i[t];if(!e)throw new Error("Listener not defined for signal: "+t);try{this.#r.removeListener(t,e)}catch(t){}})),this.#r.emit=this.#s,this.#r.reallyExit=this.#n,this.#e.count-=1)}#c(t){return n(this.#r)?(this.#r.exitCode=t||0,this.#e.emit("exit",this.#r.exitCode,null),this.#n.call(this.#r,this.#r.exitCode)):0}#a(t,...e){const r=this.#s;if("exit"===t&&n(this.#r)){"number"==typeof e[0]&&(this.#r.exitCode=e[0]);const s=r.call(this.#r,t,...e);return this.#e.emit("exit",this.#r.exitCode,null),s}return r.call(this.#r,t,...e)}}(u):new class extends l{onExit(){return()=>{}}load(){}unload(){}},{onExit:(t,e)=>f.onExit(t,e),load:()=>f.load(),unload:()=>f.unload()});var f}};