@lntvow/dev 4.4.1 → 4.4.3

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/cli.mjs CHANGED
@@ -1,36 +1,36 @@
1
1
  #!/usr/bin/env node
2
- var Ao=Object.create;var hn=Object.defineProperty;var Eo=Object.getOwnPropertyDescriptor;var $o=Object.getOwnPropertyNames;var Ro=Object.getPrototypeOf,Fo=Object.prototype.hasOwnProperty;var Tt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Mo=(e,t)=>()=>(e&&(t=e(e=0)),t);var Y=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Po=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of $o(t))!Fo.call(e,s)&&s!==r&&hn(e,s,{get:()=>t[s],enumerable:!(n=Eo(t,s))||n.enumerable});return e};var xt=(e,t,r)=>(r=e!=null?Ao(Ro(e)):{},Po(t||!e||!e.__esModule?hn(r,"default",{value:e,enumerable:!0}):r,e));import Kl from"path";import{fileURLToPath as Zl}from"url";var w=Mo(()=>{"use strict"});var Jt=Y(We=>{"use strict";w();var he=class extends Error{constructor(t,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},Ve=class extends he{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};We.CommanderError=he;We.InvalidArgumentError=Ve});var fe=Y(Ue=>{"use strict";w();var{InvalidArgumentError:Do}=Jt(),qe=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Do(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Io(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Ue.Argument=qe;Ue.humanReadableArgName=Io});var Je=Y(Ye=>{"use strict";w();var{humanReadableArgName:Lo}=fe(),ze=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(s=>!s._hidden),n=t._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((s,i)=>s.name().localeCompare(i.name())),r}compareOptions(t,r){let n=s=>s.short?s.short.replace(/^-/,""):s.long.replace(/^--/,"");return n(t).localeCompare(n(r))}visibleOptions(t){let r=t.options.filter(s=>!s.hidden),n=t._getHelpOption();if(n&&!n.hidden){let s=n.short&&t._findOption(n.short),i=n.long&&t._findOption(n.long);!s&&!i?r.push(n):n.long&&!i?r.push(t.createOption(n.long,n.description)):n.short&&!s&&r.push(t.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let n=t.parent;n;n=n.parent){let s=n.options.filter(i=>!i.hidden);r.push(...s)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(n=>Lo(n)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((n,s)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(s)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((n,s)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(s)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((n,s)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(s)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((n,s)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(s)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let n="";for(let s=t.parent;s;s=s.parent)n=s.name()+" "+n;return n+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}formatItemList(t,r,n){return r.length===0?[]:[n.styleTitle(t),...r,""]}groupItems(t,r,n){let s=new Map;return t.forEach(i=>{let o=n(i);s.has(o)||s.set(o,[])}),r.forEach(i=>{let o=n(i);s.has(o)||s.set(o,[]),s.get(o).push(i)}),s}formatHelp(t,r){let n=r.padWidth(t,r),s=r.helpWidth??80;function i(u,f){return r.formatItem(u,n,f,r)}let o=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],a=r.commandDescription(t);a.length>0&&(o=o.concat([r.boxWrap(r.styleCommandDescription(a),s),""]));let h=r.visibleArguments(t).map(u=>i(r.styleArgumentTerm(r.argumentTerm(u)),r.styleArgumentDescription(r.argumentDescription(u))));if(o=o.concat(this.formatItemList("Arguments:",h,r)),this.groupItems(t.options,r.visibleOptions(t),u=>u.helpGroupHeading??"Options:").forEach((u,f)=>{let p=u.map(A=>i(r.styleOptionTerm(r.optionTerm(A)),r.styleOptionDescription(r.optionDescription(A))));o=o.concat(this.formatItemList(f,p,r))}),r.showGlobalOptions){let u=r.visibleGlobalOptions(t).map(f=>i(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));o=o.concat(this.formatItemList("Global Options:",u,r))}return this.groupItems(t.commands,r.visibleCommands(t),u=>u.helpGroup()||"Commands:").forEach((u,f)=>{let p=u.map(A=>i(r.styleSubcommandTerm(r.subcommandTerm(A)),r.styleSubcommandDescription(r.subcommandDescription(A))));o=o.concat(this.formatItemList(f,p,r))}),o.join(`
3
- `)}displayWidth(t){return fn(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,n,s){let o=" ".repeat(2);if(!n)return o+t;let a=t.padEnd(r+t.length-s.displayWidth(t)),h=2,c=(this.helpWidth??80)-r-h-2,u;return c<this.minWidthToWrap||s.preformatted(n)?u=n:u=s.boxWrap(n,c).replace(/\n/g,`
4
- `+" ".repeat(r+h)),o+a+" ".repeat(h)+u.replace(/\n/g,`
5
- ${o}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let n=t.split(/\r\n|\n/),s=/[\s]*[^\s]+/g,i=[];return n.forEach(o=>{let a=o.match(s);if(a===null){i.push("");return}let h=[a.shift()],l=this.displayWidth(h[0]);a.forEach(c=>{let u=this.displayWidth(c);if(l+u<=r){h.push(c),l+=u;return}i.push(h.join(""));let f=c.trimStart();h=[f],l=this.displayWidth(f)}),i.push(h.join(""))}),i.join(`
6
- `)}};function fn(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}Ye.Help=ze;Ye.stripColor=fn});var Xe=Y(Ze=>{"use strict";w();var{InvalidArgumentError:jo}=Jt(),Ke=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let n=No(t);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new jo(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?pn(this.name().replace(/^no-/,"")):pn(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Qe=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(t,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let s=this.negativeOptions.get(n).presetArg,i=s!==void 0?s:!1;return r.negate===(i===t)}};function pn(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function No(e){let t,r,n=/^-[^-]$/,s=/^--[^-]/,i=e.split(/[ |,]+/).concat("guard");if(n.test(i[0])&&(t=i.shift()),s.test(i[0])&&(r=i.shift()),!t&&n.test(i[0])&&(t=i.shift()),!t&&s.test(i[0])&&(t=r,r=i.shift()),i[0].startsWith("-")){let o=i[0],a=`option creation failed due to '${o}' in option flags '${e}'`;throw/^-[^-][^-]/.test(o)?new Error(`${a}
2
+ var ko=Object.create;var an=Object.defineProperty;var Oo=Object.getOwnPropertyDescriptor;var To=Object.getOwnPropertyNames;var xo=Object.getPrototypeOf,So=Object.prototype.hasOwnProperty;var Ot=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ao=(e,t)=>()=>(e&&(t=e(e=0)),t);var Y=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Eo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of To(t))!So.call(e,s)&&s!==r&&an(e,s,{get:()=>t[s],enumerable:!(n=Oo(t,s))||n.enumerable});return e};var Tt=(e,t,r)=>(r=e!=null?ko(xo(e)):{},Eo(t||!e||!e.__esModule?an(r,"default",{value:e,enumerable:!0}):r,e));import Wl from"path";import{fileURLToPath as Ul}from"url";var w=Ao(()=>{"use strict"});var Yt=Y(He=>{"use strict";w();var ae=class extends Error{constructor(t,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},Ne=class extends ae{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};He.CommanderError=ae;He.InvalidArgumentError=Ne});var ue=Y(Ge=>{"use strict";w();var{InvalidArgumentError:$o}=Yt(),Be=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new $o(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Ro(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Ge.Argument=Be;Ge.humanReadableArgName=Ro});var qe=Y(We=>{"use strict";w();var{humanReadableArgName:Fo}=ue(),Ve=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(s=>!s._hidden),n=t._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((s,i)=>s.name().localeCompare(i.name())),r}compareOptions(t,r){let n=s=>s.short?s.short.replace(/^-/,""):s.long.replace(/^--/,"");return n(t).localeCompare(n(r))}visibleOptions(t){let r=t.options.filter(s=>!s.hidden),n=t._getHelpOption();if(n&&!n.hidden){let s=n.short&&t._findOption(n.short),i=n.long&&t._findOption(n.long);!s&&!i?r.push(n):n.long&&!i?r.push(t.createOption(n.long,n.description)):n.short&&!s&&r.push(t.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let n=t.parent;n;n=n.parent){let s=n.options.filter(i=>!i.hidden);r.push(...s)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(n=>Fo(n)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((n,s)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(s)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((n,s)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(s)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((n,s)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(s)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((n,s)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(s)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let n="";for(let s=t.parent;s;s=s.parent)n=s.name()+" "+n;return n+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}formatItemList(t,r,n){return r.length===0?[]:[n.styleTitle(t),...r,""]}groupItems(t,r,n){let s=new Map;return t.forEach(i=>{let o=n(i);s.has(o)||s.set(o,[])}),r.forEach(i=>{let o=n(i);s.has(o)||s.set(o,[]),s.get(o).push(i)}),s}formatHelp(t,r){let n=r.padWidth(t,r),s=r.helpWidth??80;function i(c,f){return r.formatItem(c,n,f,r)}let o=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],a=r.commandDescription(t);a.length>0&&(o=o.concat([r.boxWrap(r.styleCommandDescription(a),s),""]));let l=r.visibleArguments(t).map(c=>i(r.styleArgumentTerm(r.argumentTerm(c)),r.styleArgumentDescription(r.argumentDescription(c))));if(o=o.concat(this.formatItemList("Arguments:",l,r)),this.groupItems(t.options,r.visibleOptions(t),c=>c.helpGroupHeading??"Options:").forEach((c,f)=>{let p=c.map(E=>i(r.styleOptionTerm(r.optionTerm(E)),r.styleOptionDescription(r.optionDescription(E))));o=o.concat(this.formatItemList(f,p,r))}),r.showGlobalOptions){let c=r.visibleGlobalOptions(t).map(f=>i(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));o=o.concat(this.formatItemList("Global Options:",c,r))}return this.groupItems(t.commands,r.visibleCommands(t),c=>c.helpGroup()||"Commands:").forEach((c,f)=>{let p=c.map(E=>i(r.styleSubcommandTerm(r.subcommandTerm(E)),r.styleSubcommandDescription(r.subcommandDescription(E))));o=o.concat(this.formatItemList(f,p,r))}),o.join(`
3
+ `)}displayWidth(t){return un(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,n,s){let o=" ".repeat(2);if(!n)return o+t;let a=t.padEnd(r+t.length-s.displayWidth(t)),l=2,u=(this.helpWidth??80)-r-l-2,c;return u<this.minWidthToWrap||s.preformatted(n)?c=n:c=s.boxWrap(n,u).replace(/\n/g,`
4
+ `+" ".repeat(r+l)),o+a+" ".repeat(l)+c.replace(/\n/g,`
5
+ ${o}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let n=t.split(/\r\n|\n/),s=/[\s]*[^\s]+/g,i=[];return n.forEach(o=>{let a=o.match(s);if(a===null){i.push("");return}let l=[a.shift()],h=this.displayWidth(l[0]);a.forEach(u=>{let c=this.displayWidth(u);if(h+c<=r){l.push(u),h+=c;return}i.push(l.join(""));let f=u.trimStart();l=[f],h=this.displayWidth(f)}),i.push(l.join(""))}),i.join(`
6
+ `)}};function un(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}We.Help=Ve;We.stripColor=un});var Je=Y(Ye=>{"use strict";w();var{InvalidArgumentError:Mo}=Yt(),Ue=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let n=Do(t);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Mo(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?cn(this.name().replace(/^no-/,"")):cn(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},ze=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(t,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let s=this.negativeOptions.get(n).presetArg,i=s!==void 0?s:!1;return r.negate===(i===t)}};function cn(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function Do(e){let t,r,n=/^-[^-]$/,s=/^--[^-]/,i=e.split(/[ |,]+/).concat("guard");if(n.test(i[0])&&(t=i.shift()),s.test(i[0])&&(r=i.shift()),!t&&n.test(i[0])&&(t=i.shift()),!t&&s.test(i[0])&&(t=r,r=i.shift()),i[0].startsWith("-")){let o=i[0],a=`option creation failed due to '${o}' in option flags '${e}'`;throw/^-[^-][^-]/.test(o)?new Error(`${a}
7
7
  - a short flag is a single dash and a single character
8
8
  - either use a single dash and a single character (for a short flag)
9
9
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(o)?new Error(`${a}
10
10
  - too many short flags`):s.test(o)?new Error(`${a}
11
11
  - too many long flags`):new Error(`${a}
12
- - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}Ze.Option=Ke;Ze.DualOptions=Qe});var dn=Y(mn=>{"use strict";w();function Ho(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let n=0;n<=e.length;n++)r[n]=[n];for(let n=0;n<=t.length;n++)r[0][n]=n;for(let n=1;n<=t.length;n++)for(let s=1;s<=e.length;s++){let i=1;e[s-1]===t[n-1]?i=0:i=1,r[s][n]=Math.min(r[s-1][n]+1,r[s][n-1]+1,r[s-1][n-1]+i),s>1&&n>1&&e[s-1]===t[n-2]&&e[s-2]===t[n-1]&&(r[s][n]=Math.min(r[s][n],r[s-2][n-2]+1))}return r[e.length][t.length]}function Bo(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(o=>o.slice(2)));let n=[],s=3,i=.4;return t.forEach(o=>{if(o.length<=1)return;let a=Ho(e,o),h=Math.max(e.length,o.length);(h-a)/h>i&&(a<s?(s=a,n=[o]):a===s&&n.push(o))}),n.sort((o,a)=>o.localeCompare(a)),r&&(n=n.map(o=>`--${o}`)),n.length>1?`
12
+ - unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}Ye.Option=Ue;Ye.DualOptions=ze});var hn=Y(ln=>{"use strict";w();function Po(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let n=0;n<=e.length;n++)r[n]=[n];for(let n=0;n<=t.length;n++)r[0][n]=n;for(let n=1;n<=t.length;n++)for(let s=1;s<=e.length;s++){let i=1;e[s-1]===t[n-1]?i=0:i=1,r[s][n]=Math.min(r[s-1][n]+1,r[s][n-1]+1,r[s-1][n-1]+i),s>1&&n>1&&e[s-1]===t[n-2]&&e[s-2]===t[n-1]&&(r[s][n]=Math.min(r[s][n],r[s-2][n-2]+1))}return r[e.length][t.length]}function Io(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(o=>o.slice(2)));let n=[],s=3,i=.4;return t.forEach(o=>{if(o.length<=1)return;let a=Po(e,o),l=Math.max(e.length,o.length);(l-a)/l>i&&(a<s?(s=a,n=[o]):a===s&&n.push(o))}),n.sort((o,a)=>o.localeCompare(a)),r&&(n=n.map(o=>`--${o}`)),n.length>1?`
13
13
  (Did you mean one of ${n.join(", ")}?)`:n.length===1?`
14
- (Did you mean ${n[0]}?)`:""}mn.suggestSimilar=Bo});var yn=Y(sr=>{"use strict";w();var Go=Tt("events").EventEmitter,tr=Tt("child_process"),St=Tt("path"),pe=Tt("fs"),R=Tt("process"),{Argument:Vo,humanReadableArgName:Wo}=fe(),{CommanderError:er}=Jt(),{Help:qo,stripColor:Uo}=Je(),{Option:gn,DualOptions:zo}=Xe(),{suggestSimilar:_n}=dn(),rr=class e extends Go{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>R.stdout.write(r),writeErr:r=>R.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>R.stdout.isTTY?R.stdout.columns:void 0,getErrHelpWidth:()=>R.stderr.isTTY?R.stderr.columns:void 0,getOutHasColors:()=>nr()??(R.stdout.isTTY&&R.stdout.hasColors?.()),getErrHasColors:()=>nr()??(R.stderr.isTTY&&R.stderr.hasColors?.()),stripColor:r=>Uo(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,n){let s=r,i=n;typeof s=="object"&&s!==null&&(i=s,s=null),i=i||{};let[,o,a]=t.match(/([^ ]+) *(.*)/),h=this.createCommand(o);return s&&(h.description(s),h._executableHandler=!0),i.isDefault&&(this._defaultCommandName=h._name),h._hidden=!!(i.noHelp||i.hidden),h._executableFile=i.executableFile||null,a&&h.arguments(a),this._registerCommand(h),h.parent=this,h.copyInheritedSettings(this),s?this:h}createCommand(t){return new e(t)}createHelp(){return Object.assign(new qo,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration=Object.assign({},this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
15
- - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new Vo(t,r)}argument(t,r,n,s){let i=this.createArgument(t,r);return typeof n=="function"?i.default(s).argParser(n):i.default(n),this.addArgument(i),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=t??"help [command]",[,s,i]=n.match(/([^ ]+) *(.*)/),o=r??"display help for command",a=this.createCommand(s);return a.helpOption(!1),i&&a.arguments(i),o&&a.description(o),this._addImplicitHelpCommand=!0,this._helpCommand=a,(t||r)&&this._initCommandGroup(a),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
16
- Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,n){this._exitCallback&&this._exitCallback(new er(t,r,n)),R.exit(t)}action(t){let r=n=>{let s=this.registeredArguments.length,i=n.slice(0,s);return this._storeOptionsAsProperties?i[s]=this:i[s]=this.opts(),i.push(this),t.apply(this,i)};return this._actionHandler=r,this}createOption(t,r){return new gn(t,r)}_callParseArg(t,r,n,s){try{return t.parseArg(r,n)}catch(i){if(i.code==="commander.invalidArgument"){let o=`${s} ${i.message}`;this.error(o,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let n=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
17
- - already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=s=>[s.name()].concat(s.aliases()),n=r(t).find(s=>this._findCommand(s));if(n){let s=r(this._findCommand(n)).join("|"),i=r(t).join("|");throw new Error(`cannot add command '${i}' as already have command '${s}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),n=t.attributeName();if(t.negate){let i=t.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(n,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(n,t.defaultValue,"default");let s=(i,o,a)=>{i==null&&t.presetArg!==void 0&&(i=t.presetArg);let h=this.getOptionValue(n);i!==null&&t.parseArg?i=this._callParseArg(t,i,h,o):i!==null&&t.variadic&&(i=t._concatValue(i,h)),i==null&&(t.negate?i=!1:t.isBoolean()||t.optional?i=!0:i=""),this.setOptionValueWithSource(n,i,a)};return this.on("option:"+r,i=>{let o=`error: option '${t.flags}' argument '${i}' is invalid.`;s(i,o,"cli")}),t.envVar&&this.on("optionEnv:"+r,i=>{let o=`error: option '${t.flags}' value '${i}' from env '${t.envVar}' is invalid.`;s(i,o,"env")}),this}_optionEx(t,r,n,s,i){if(typeof r=="object"&&r instanceof gn)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(r,n);if(o.makeOptionMandatory(!!t.mandatory),typeof s=="function")o.default(i).argParser(s);else if(s instanceof RegExp){let a=s;s=(h,l)=>{let c=a.exec(h);return c?c[0]:l},o.default(i).argParser(s)}else o.default(s);return this.addOption(o)}option(t,r,n,s){return this._optionEx({},t,r,n,s)}requiredOption(t,r,n,s){return this._optionEx({mandatory:!0},t,r,n,s)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,n){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=n,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(t)!==void 0&&(r=n.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){R.versions?.electron&&(r.from="electron");let s=R.execArgv??[];(s.includes("-e")||s.includes("--eval")||s.includes("-p")||s.includes("--print"))&&(r.from="eval")}t===void 0&&(t=R.argv),this.rawArgs=t.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=t[1],n=t.slice(2);break;case"electron":R.defaultApp?(this._scriptPath=t[1],n=t.slice(2)):n=t.slice(1);break;case"user":n=t.slice(0);break;case"eval":n=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(t,r){this._prepareForParse();let n=this._prepareUserArgs(t,r);return this._parseCommand([],n),this}async parseAsync(t,r){this._prepareForParse();let n=this._prepareUserArgs(t,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
18
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,r,n){if(pe.existsSync(t))return;let s=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",i=`'${t}' does not exist
14
+ (Did you mean ${n[0]}?)`:""}ln.suggestSimilar=Io});var dn=Y(tr=>{"use strict";w();var Lo=Ot("events").EventEmitter,Ke=Ot("child_process"),xt=Ot("path"),ce=Ot("fs"),R=Ot("process"),{Argument:jo,humanReadableArgName:No}=ue(),{CommanderError:Qe}=Yt(),{Help:Ho,stripColor:Bo}=qe(),{Option:fn,DualOptions:Go}=Je(),{suggestSimilar:pn}=hn(),Ze=class e extends Lo{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>R.stdout.write(r),writeErr:r=>R.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>R.stdout.isTTY?R.stdout.columns:void 0,getErrHelpWidth:()=>R.stderr.isTTY?R.stderr.columns:void 0,getOutHasColors:()=>Xe()??(R.stdout.isTTY&&R.stdout.hasColors?.()),getErrHasColors:()=>Xe()??(R.stderr.isTTY&&R.stderr.hasColors?.()),stripColor:r=>Bo(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,n){let s=r,i=n;typeof s=="object"&&s!==null&&(i=s,s=null),i=i||{};let[,o,a]=t.match(/([^ ]+) *(.*)/),l=this.createCommand(o);return s&&(l.description(s),l._executableHandler=!0),i.isDefault&&(this._defaultCommandName=l._name),l._hidden=!!(i.noHelp||i.hidden),l._executableFile=i.executableFile||null,a&&l.arguments(a),this._registerCommand(l),l.parent=this,l.copyInheritedSettings(this),s?this:l}createCommand(t){return new e(t)}createHelp(){return Object.assign(new Ho,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration=Object.assign({},this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
15
+ - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new jo(t,r)}argument(t,r,n,s){let i=this.createArgument(t,r);return typeof n=="function"?i.default(s).argParser(n):i.default(n),this.addArgument(i),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=t??"help [command]",[,s,i]=n.match(/([^ ]+) *(.*)/),o=r??"display help for command",a=this.createCommand(s);return a.helpOption(!1),i&&a.arguments(i),o&&a.description(o),this._addImplicitHelpCommand=!0,this._helpCommand=a,(t||r)&&this._initCommandGroup(a),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
16
+ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,n){this._exitCallback&&this._exitCallback(new Qe(t,r,n)),R.exit(t)}action(t){let r=n=>{let s=this.registeredArguments.length,i=n.slice(0,s);return this._storeOptionsAsProperties?i[s]=this:i[s]=this.opts(),i.push(this),t.apply(this,i)};return this._actionHandler=r,this}createOption(t,r){return new fn(t,r)}_callParseArg(t,r,n,s){try{return t.parseArg(r,n)}catch(i){if(i.code==="commander.invalidArgument"){let o=`${s} ${i.message}`;this.error(o,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let n=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
17
+ - already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=s=>[s.name()].concat(s.aliases()),n=r(t).find(s=>this._findCommand(s));if(n){let s=r(this._findCommand(n)).join("|"),i=r(t).join("|");throw new Error(`cannot add command '${i}' as already have command '${s}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),n=t.attributeName();if(t.negate){let i=t.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(n,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(n,t.defaultValue,"default");let s=(i,o,a)=>{i==null&&t.presetArg!==void 0&&(i=t.presetArg);let l=this.getOptionValue(n);i!==null&&t.parseArg?i=this._callParseArg(t,i,l,o):i!==null&&t.variadic&&(i=t._concatValue(i,l)),i==null&&(t.negate?i=!1:t.isBoolean()||t.optional?i=!0:i=""),this.setOptionValueWithSource(n,i,a)};return this.on("option:"+r,i=>{let o=`error: option '${t.flags}' argument '${i}' is invalid.`;s(i,o,"cli")}),t.envVar&&this.on("optionEnv:"+r,i=>{let o=`error: option '${t.flags}' value '${i}' from env '${t.envVar}' is invalid.`;s(i,o,"env")}),this}_optionEx(t,r,n,s,i){if(typeof r=="object"&&r instanceof fn)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(r,n);if(o.makeOptionMandatory(!!t.mandatory),typeof s=="function")o.default(i).argParser(s);else if(s instanceof RegExp){let a=s;s=(l,h)=>{let u=a.exec(l);return u?u[0]:h},o.default(i).argParser(s)}else o.default(s);return this.addOption(o)}option(t,r,n,s){return this._optionEx({},t,r,n,s)}requiredOption(t,r,n,s){return this._optionEx({mandatory:!0},t,r,n,s)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,n){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=n,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(t)!==void 0&&(r=n.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){R.versions?.electron&&(r.from="electron");let s=R.execArgv??[];(s.includes("-e")||s.includes("--eval")||s.includes("-p")||s.includes("--print"))&&(r.from="eval")}t===void 0&&(t=R.argv),this.rawArgs=t.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=t[1],n=t.slice(2);break;case"electron":R.defaultApp?(this._scriptPath=t[1],n=t.slice(2)):n=t.slice(1);break;case"user":n=t.slice(0);break;case"eval":n=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(t,r){this._prepareForParse();let n=this._prepareUserArgs(t,r);return this._parseCommand([],n),this}async parseAsync(t,r){this._prepareForParse();let n=this._prepareUserArgs(t,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
18
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,r,n){if(ce.existsSync(t))return;let s=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",i=`'${t}' does not exist
19
19
  - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
20
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
- - ${s}`;throw new Error(i)}_executeSubCommand(t,r){r=r.slice();let n=!1,s=[".js",".ts",".tsx",".mjs",".cjs"];function i(c,u){let f=St.resolve(c,u);if(pe.existsSync(f))return f;if(s.includes(St.extname(u)))return;let p=s.find(A=>pe.existsSync(`${f}${A}`));if(p)return`${f}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let c;try{c=pe.realpathSync(this._scriptPath)}catch{c=this._scriptPath}a=St.resolve(St.dirname(c),a)}if(a){let c=i(a,o);if(!c&&!t._executableFile&&this._scriptPath){let u=St.basename(this._scriptPath,St.extname(this._scriptPath));u!==this._name&&(c=i(a,`${u}-${t._name}`))}o=c||o}n=s.includes(St.extname(o));let h;R.platform!=="win32"?n?(r.unshift(o),r=bn(R.execArgv).concat(r),h=tr.spawn(R.argv[0],r,{stdio:"inherit"})):h=tr.spawn(o,r,{stdio:"inherit"}):(this._checkForMissingExecutable(o,a,t._name),r.unshift(o),r=bn(R.execArgv).concat(r),h=tr.spawn(R.execPath,r,{stdio:"inherit"})),h.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(u=>{R.on(u,()=>{h.killed===!1&&h.exitCode===null&&h.kill(u)})});let l=this._exitCallback;h.on("close",c=>{c=c??1,l?l(new er(c,"commander.executeSubCommandAsync","(close)")):R.exit(c)}),h.on("error",c=>{if(c.code==="ENOENT")this._checkForMissingExecutable(o,a,t._name);else if(c.code==="EACCES")throw new Error(`'${o}' not executable`);if(!l)R.exit(1);else{let u=new er(1,"commander.executeSubCommandAsync","(error)");u.nestedError=c,l(u)}}),this.runningCommand=h}_dispatchSubcommand(t,r,n){let s=this._findCommand(t);s||this.help({error:!0}),s._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,s,"preSubcommand"),i=this._chainOrCall(i,()=>{if(s._executableHandler)this._executeSubCommand(s,r.concat(n));else return s._parseCommand(r,n)}),i}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(n,s,i)=>{let o=s;if(s!==null&&n.parseArg){let a=`error: command-argument value '${s}' is invalid for argument '${n.name()}'.`;o=this._callParseArg(n,s,i,a)}return o};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,s)=>{let i=n.defaultValue;n.variadic?s<this.args.length?(i=this.args.slice(s),n.parseArg&&(i=i.reduce((o,a)=>t(n,a,o),n.defaultValue))):i===void 0&&(i=[]):s<this.args.length&&(i=this.args[s],n.parseArg&&(i=t(n,i,n.defaultValue))),r[s]=i}),this.processedArgs=r}_chainOrCall(t,r){return t&&t.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let n=t,s=[];return this._getCommandAndAncestors().reverse().filter(i=>i._lifeCycleHooks[r]!==void 0).forEach(i=>{i._lifeCycleHooks[r].forEach(o=>{s.push({hookedCommand:i,callback:o})})}),r==="postAction"&&s.reverse(),s.forEach(i=>{n=this._chainOrCall(n,()=>i.callback(i.hookedCommand,this))}),n}_chainOrCallSubCommandHook(t,r,n){let s=t;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(i=>{s=this._chainOrCall(s,()=>i(this,r))}),s}_parseCommand(t,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(n.operands),r=n.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){s(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(i,t,r)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent&&this.parent.listenerCount(i))s(),this._processArguments(),this.parent.emit(i,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(s(),this._processArguments())}else this.commands.length?(s(),this.help({error:!0})):(s(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(n=>{let s=n.attributeName();return this.getOptionValue(s)===void 0?!1:this.getOptionValueSource(s)!=="default"});t.filter(n=>n.conflictsWith.length>0).forEach(n=>{let s=t.find(i=>n.conflictsWith.includes(i.attributeName()));s&&this._conflictingOption(n,s)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],n=[],s=r,i=t.slice();function o(l){return l.length>1&&l[0]==="-"}let a=l=>/^-\d*\.?\d+(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(c=>c.options.map(u=>u.short).some(u=>/^-\d$/.test(u))):!1,h=null;for(;i.length;){let l=i.shift();if(l==="--"){s===n&&s.push(l),s.push(...i);break}if(h&&(!o(l)||a(l))){this.emit(`option:${h.name()}`,l);continue}if(h=null,o(l)){let c=this._findOption(l);if(c){if(c.required){let u=i.shift();u===void 0&&this.optionMissingArgument(c),this.emit(`option:${c.name()}`,u)}else if(c.optional){let u=null;i.length>0&&(!o(i[0])||a(i[0]))&&(u=i.shift()),this.emit(`option:${c.name()}`,u)}else this.emit(`option:${c.name()}`);h=c.variadic?c:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let c=this._findOption(`-${l[1]}`);if(c){c.required||c.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${c.name()}`,l.slice(2)):(this.emit(`option:${c.name()}`),i.unshift(`-${l.slice(2)}`));continue}}if(/^--[^=]+=/.test(l)){let c=l.indexOf("="),u=this._findOption(l.slice(0,c));if(u&&(u.required||u.optional)){this.emit(`option:${u.name()}`,l.slice(c+1));continue}}if(s===r&&o(l)&&!(this.commands.length===0&&a(l))&&(s=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(l)){r.push(l),i.length>0&&n.push(...i);break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l),i.length>0&&r.push(...i);break}else if(this._defaultCommandName){n.push(l),i.length>0&&n.push(...i);break}}if(this._passThroughOptions){s.push(l),i.length>0&&s.push(...i);break}s.push(l)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let n=0;n<r;n++){let s=this.options[n].attributeName();t[s]=s===this._versionOptionName?this._version:this[s]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
21
+ - ${s}`;throw new Error(i)}_executeSubCommand(t,r){r=r.slice();let n=!1,s=[".js",".ts",".tsx",".mjs",".cjs"];function i(u,c){let f=xt.resolve(u,c);if(ce.existsSync(f))return f;if(s.includes(xt.extname(c)))return;let p=s.find(E=>ce.existsSync(`${f}${E}`));if(p)return`${f}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let u;try{u=ce.realpathSync(this._scriptPath)}catch{u=this._scriptPath}a=xt.resolve(xt.dirname(u),a)}if(a){let u=i(a,o);if(!u&&!t._executableFile&&this._scriptPath){let c=xt.basename(this._scriptPath,xt.extname(this._scriptPath));c!==this._name&&(u=i(a,`${c}-${t._name}`))}o=u||o}n=s.includes(xt.extname(o));let l;R.platform!=="win32"?n?(r.unshift(o),r=mn(R.execArgv).concat(r),l=Ke.spawn(R.argv[0],r,{stdio:"inherit"})):l=Ke.spawn(o,r,{stdio:"inherit"}):(this._checkForMissingExecutable(o,a,t._name),r.unshift(o),r=mn(R.execArgv).concat(r),l=Ke.spawn(R.execPath,r,{stdio:"inherit"})),l.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(c=>{R.on(c,()=>{l.killed===!1&&l.exitCode===null&&l.kill(c)})});let h=this._exitCallback;l.on("close",u=>{u=u??1,h?h(new Qe(u,"commander.executeSubCommandAsync","(close)")):R.exit(u)}),l.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(o,a,t._name);else if(u.code==="EACCES")throw new Error(`'${o}' not executable`);if(!h)R.exit(1);else{let c=new Qe(1,"commander.executeSubCommandAsync","(error)");c.nestedError=u,h(c)}}),this.runningCommand=l}_dispatchSubcommand(t,r,n){let s=this._findCommand(t);s||this.help({error:!0}),s._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,s,"preSubcommand"),i=this._chainOrCall(i,()=>{if(s._executableHandler)this._executeSubCommand(s,r.concat(n));else return s._parseCommand(r,n)}),i}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(n,s,i)=>{let o=s;if(s!==null&&n.parseArg){let a=`error: command-argument value '${s}' is invalid for argument '${n.name()}'.`;o=this._callParseArg(n,s,i,a)}return o};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,s)=>{let i=n.defaultValue;n.variadic?s<this.args.length?(i=this.args.slice(s),n.parseArg&&(i=i.reduce((o,a)=>t(n,a,o),n.defaultValue))):i===void 0&&(i=[]):s<this.args.length&&(i=this.args[s],n.parseArg&&(i=t(n,i,n.defaultValue))),r[s]=i}),this.processedArgs=r}_chainOrCall(t,r){return t&&t.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let n=t,s=[];return this._getCommandAndAncestors().reverse().filter(i=>i._lifeCycleHooks[r]!==void 0).forEach(i=>{i._lifeCycleHooks[r].forEach(o=>{s.push({hookedCommand:i,callback:o})})}),r==="postAction"&&s.reverse(),s.forEach(i=>{n=this._chainOrCall(n,()=>i.callback(i.hookedCommand,this))}),n}_chainOrCallSubCommandHook(t,r,n){let s=t;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(i=>{s=this._chainOrCall(s,()=>i(this,r))}),s}_parseCommand(t,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(n.operands),r=n.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){s(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(i,t,r)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent&&this.parent.listenerCount(i))s(),this._processArguments(),this.parent.emit(i,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(s(),this._processArguments())}else this.commands.length?(s(),this.help({error:!0})):(s(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(n=>{let s=n.attributeName();return this.getOptionValue(s)===void 0?!1:this.getOptionValueSource(s)!=="default"});t.filter(n=>n.conflictsWith.length>0).forEach(n=>{let s=t.find(i=>n.conflictsWith.includes(i.attributeName()));s&&this._conflictingOption(n,s)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],n=[],s=r,i=t.slice();function o(h){return h.length>1&&h[0]==="-"}let a=h=>/^-\d*\.?\d+(e[+-]?\d+)?$/.test(h)?!this._getCommandAndAncestors().some(u=>u.options.map(c=>c.short).some(c=>/^-\d$/.test(c))):!1,l=null;for(;i.length;){let h=i.shift();if(h==="--"){s===n&&s.push(h),s.push(...i);break}if(l&&(!o(h)||a(h))){this.emit(`option:${l.name()}`,h);continue}if(l=null,o(h)){let u=this._findOption(h);if(u){if(u.required){let c=i.shift();c===void 0&&this.optionMissingArgument(u),this.emit(`option:${u.name()}`,c)}else if(u.optional){let c=null;i.length>0&&(!o(i[0])||a(i[0]))&&(c=i.shift()),this.emit(`option:${u.name()}`,c)}else this.emit(`option:${u.name()}`);l=u.variadic?u:null;continue}}if(h.length>2&&h[0]==="-"&&h[1]!=="-"){let u=this._findOption(`-${h[1]}`);if(u){u.required||u.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${u.name()}`,h.slice(2)):(this.emit(`option:${u.name()}`),i.unshift(`-${h.slice(2)}`));continue}}if(/^--[^=]+=/.test(h)){let u=h.indexOf("="),c=this._findOption(h.slice(0,u));if(c&&(c.required||c.optional)){this.emit(`option:${c.name()}`,h.slice(u+1));continue}}if(s===r&&o(h)&&!(this.commands.length===0&&a(h))&&(s=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(h)){r.push(h),i.length>0&&n.push(...i);break}else if(this._getHelpCommand()&&h===this._getHelpCommand().name()){r.push(h),i.length>0&&r.push(...i);break}else if(this._defaultCommandName){n.push(h),i.length>0&&n.push(...i);break}}if(this._passThroughOptions){s.push(h),i.length>0&&s.push(...i);break}s.push(h)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let n=0;n<r;n++){let s=this.options[n].attributeName();t[s]=s===this._versionOptionName?this._version:this[s]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
22
22
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
23
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
24
- `),this.outputHelp({error:!0}));let n=r||{},s=n.exitCode||1,i=n.code||"commander.error";this._exit(s,i,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in R.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,R.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new zo(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&t.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(s=>!r(s)).forEach(s=>{this.setOptionValueWithSource(s,n.implied[s],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let n=o=>{let a=o.attributeName(),h=this.getOptionValue(a),l=this.options.find(u=>u.negate&&a===u.attributeName()),c=this.options.find(u=>!u.negate&&a===u.attributeName());return l&&(l.presetArg===void 0&&h===!1||l.presetArg!==void 0&&h===l.presetArg)?l:c||o},s=o=>{let a=n(o),h=a.attributeName();return this.getOptionValueSource(h)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},i=`error: ${s(t)} cannot be used with ${s(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let s=[],i=this;do{let o=i.createHelp().visibleOptions(i).filter(a=>a.long).map(a=>a.long);s=s.concat(o),i=i.parent}while(i&&!i._enablePositionalOptions);r=_n(t,s)}let n=`error: unknown option '${t}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",i=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${t.length}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let s=[];this.createHelp().visibleCommands(this).forEach(i=>{s.push(i.name()),i.alias()&&s.push(i.alias())}),r=_n(t,s)}let n=`error: unknown command '${t}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(t,r,n){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",n=n||"output the version number";let s=this.createOption(r,n);return this._versionOptionName=s.attributeName(),this._registerOption(s),this.on("option:"+s.name(),()=>{this._outputConfiguration.writeOut(`${t}
25
- `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(t);if(n){let s=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${s}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>Wo(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=St.basename(t,St.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),n=this._getOutputContext(t);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let s=r.formatHelp(this,r);return n.hasColors?s:this._outputConfiguration.stripColor(s)}_getOutputContext(t){t=t||{};let r=!!t.error,n,s,i;return r?(n=a=>this._outputConfiguration.writeErr(a),s=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),s=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(s||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:s,helpWidth:i}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let n=this._getOutputContext(t),s={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",s)),this.emit("beforeHelp",s);let i=this.helpInformation({error:n.error});if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",s),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",s))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(R.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(t))throw new Error(`Unexpected value for position to addHelpText.
24
+ `),this.outputHelp({error:!0}));let n=r||{},s=n.exitCode||1,i=n.code||"commander.error";this._exit(s,i,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in R.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,R.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new Go(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&t.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(s=>!r(s)).forEach(s=>{this.setOptionValueWithSource(s,n.implied[s],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let n=o=>{let a=o.attributeName(),l=this.getOptionValue(a),h=this.options.find(c=>c.negate&&a===c.attributeName()),u=this.options.find(c=>!c.negate&&a===c.attributeName());return h&&(h.presetArg===void 0&&l===!1||h.presetArg!==void 0&&l===h.presetArg)?h:u||o},s=o=>{let a=n(o),l=a.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},i=`error: ${s(t)} cannot be used with ${s(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let s=[],i=this;do{let o=i.createHelp().visibleOptions(i).filter(a=>a.long).map(a=>a.long);s=s.concat(o),i=i.parent}while(i&&!i._enablePositionalOptions);r=pn(t,s)}let n=`error: unknown option '${t}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",i=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${t.length}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let s=[];this.createHelp().visibleCommands(this).forEach(i=>{s.push(i.name()),i.alias()&&s.push(i.alias())}),r=pn(t,s)}let n=`error: unknown command '${t}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(t,r,n){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",n=n||"output the version number";let s=this.createOption(r,n);return this._versionOptionName=s.attributeName(),this._registerOption(s),this.on("option:"+s.name(),()=>{this._outputConfiguration.writeOut(`${t}
25
+ `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(t);if(n){let s=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${s}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>No(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=xt.basename(t,xt.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),n=this._getOutputContext(t);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let s=r.formatHelp(this,r);return n.hasColors?s:this._outputConfiguration.stripColor(s)}_getOutputContext(t){t=t||{};let r=!!t.error,n,s,i;return r?(n=a=>this._outputConfiguration.writeErr(a),s=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),s=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(s||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:s,helpWidth:i}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let n=this._getOutputContext(t),s={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",s)),this.emit("beforeHelp",s);let i=this.helpInformation({error:n.error});if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",s),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",s))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(R.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(t))throw new Error(`Unexpected value for position to addHelpText.
26
26
  Expecting one of '${n.join("', '")}'`);let s=`${t}Help`;return this.on(s,i=>{let o;typeof r=="function"?o=r({error:i.error,command:i.command}):o=r,o&&i.write(`${o}
27
- `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(s=>r.is(s))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function bn(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,n="127.0.0.1",s="9229",i;return(i=t.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?s=i[3]:n=i[3]):(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],n=i[3],s=i[4]),r&&s!=="0"?`${r}=${n}:${parseInt(s)+1}`:t})}function nr(){if(R.env.NO_COLOR||R.env.FORCE_COLOR==="0"||R.env.FORCE_COLOR==="false")return!1;if(R.env.FORCE_COLOR||R.env.CLICOLOR_FORCE!==void 0)return!0}sr.Command=rr;sr.useColor=nr});var kn=Y(dt=>{"use strict";w();var{Argument:vn}=fe(),{Command:ir}=yn(),{CommanderError:Yo,InvalidArgumentError:Cn}=Jt(),{Help:Jo}=Je(),{Option:wn}=Xe();dt.program=new ir;dt.createCommand=e=>new ir(e);dt.createOption=(e,t)=>new wn(e,t);dt.createArgument=(e,t)=>new vn(e,t);dt.Command=ir;dt.Option=wn;dt.Argument=vn;dt.Help=Jo;dt.CommanderError=Yo;dt.InvalidArgumentError=Cn;dt.InvalidOptionArgumentError=Cn});var ar=Y((xh,or)=>{"use strict";w();var de=process||{},Tn=de.argv||[],me=de.env||{},Ko=!(me.NO_COLOR||Tn.includes("--no-color"))&&(!!me.FORCE_COLOR||Tn.includes("--color")||de.platform==="win32"||(de.stdout||{}).isTTY&&me.TERM!=="dumb"||!!me.CI),Qo=(e,t,r=e)=>n=>{let s=""+n,i=s.indexOf(t,e.length);return~i?e+Zo(s,t,r,i)+t:e+s+t},Zo=(e,t,r,n)=>{let s="",i=0;do s+=e.substring(i,n)+r,i=n+t.length,n=e.indexOf(t,i);while(~n);return s+e.substring(i)},xn=(e=Ko)=>{let t=e?Qo:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};or.exports=xn();or.exports.createColors=xn});var Sn=Y((ur,cr)=>{"use strict";w();(function(e,t){typeof ur=="object"&&typeof cr<"u"?cr.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(ur,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",s="second",i="minute",o="hour",a="day",h="week",l="month",c="quarter",u="year",f="date",p="Invalid Date",A=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,M=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,I={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(k){var b=["th","st","nd","rd"],g=k%100;return"["+k+(b[(g-20)%10]||b[g]||b[0])+"]"}},j=function(k,b,g){var v=String(k);return!v||v.length>=b?k:""+Array(b+1-v.length).join(g)+k},K={s:j,z:function(k){var b=-k.utcOffset(),g=Math.abs(b),v=Math.floor(g/60),_=g%60;return(b<=0?"+":"-")+j(v,2,"0")+":"+j(_,2,"0")},m:function k(b,g){if(b.date()<g.date())return-k(g,b);var v=12*(g.year()-b.year())+(g.month()-b.month()),_=b.clone().add(v,l),T=g-_<0,x=b.clone().add(v+(T?-1:1),l);return+(-(v+(g-_)/(T?_-x:x-_))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:l,y:u,w:h,d:a,D:f,h:o,m:i,s,ms:n,Q:c}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},U="en",J={};J[U]=I;var mt="$isDayjsObject",rt=function(k){return k instanceof Ht||!(!k||!k[mt])},ht=function k(b,g,v){var _;if(!b)return U;if(typeof b=="string"){var T=b.toLowerCase();J[T]&&(_=T),g&&(J[T]=g,_=T);var x=b.split("-");if(!_&&x.length>1)return k(x[0])}else{var P=b.name;J[P]=b,_=P}return!v&&_&&(U=_),_||!v&&U},F=function(k,b){if(rt(k))return k.clone();var g=typeof b=="object"?b:{};return g.date=k,g.args=arguments,new Ht(g)},E=K;E.l=ht,E.i=rt,E.w=function(k,b){return F(k,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var Ht=function(){function k(g){this.$L=ht(g.locale,null,!0),this.parse(g),this.$x=this.$x||g.x||{},this[mt]=!0}var b=k.prototype;return b.parse=function(g){this.$d=function(v){var _=v.date,T=v.utc;if(_===null)return new Date(NaN);if(E.u(_))return new Date;if(_ instanceof Date)return new Date(_);if(typeof _=="string"&&!/Z$/i.test(_)){var x=_.match(A);if(x){var P=x[2]-1||0,N=(x[7]||"0").substring(0,3);return T?new Date(Date.UTC(x[1],P,x[3]||1,x[4]||0,x[5]||0,x[6]||0,N)):new Date(x[1],P,x[3]||1,x[4]||0,x[5]||0,x[6]||0,N)}}return new Date(_)}(g),this.init()},b.init=function(){var g=this.$d;this.$y=g.getFullYear(),this.$M=g.getMonth(),this.$D=g.getDate(),this.$W=g.getDay(),this.$H=g.getHours(),this.$m=g.getMinutes(),this.$s=g.getSeconds(),this.$ms=g.getMilliseconds()},b.$utils=function(){return E},b.isValid=function(){return this.$d.toString()!==p},b.isSame=function(g,v){var _=F(g);return this.startOf(v)<=_&&_<=this.endOf(v)},b.isAfter=function(g,v){return F(g)<this.startOf(v)},b.isBefore=function(g,v){return this.endOf(v)<F(g)},b.$g=function(g,v,_){return E.u(g)?this[v]:this.set(_,g)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(g,v){var _=this,T=!!E.u(v)||v,x=E.p(g),P=function(Ot,X){var yt=E.w(_.$u?Date.UTC(_.$y,X,Ot):new Date(_.$y,X,Ot),_);return T?yt:yt.endOf(a)},N=function(Ot,X){return E.w(_.toDate()[Ot].apply(_.toDate("s"),(T?[0,0,0,0]:[23,59,59,999]).slice(X)),_)},z=this.$W,Q=this.$M,ot=this.$D,$t="set"+(this.$u?"UTC":"");switch(x){case u:return T?P(1,0):P(31,11);case l:return T?P(1,Q):P(0,Q+1);case h:var kt=this.$locale().weekStart||0,Mt=(z<kt?z+7:z)-kt;return P(T?ot-Mt:ot+(6-Mt),Q);case a:case f:return N($t+"Hours",0);case o:return N($t+"Minutes",1);case i:return N($t+"Seconds",2);case s:return N($t+"Milliseconds",3);default:return this.clone()}},b.endOf=function(g){return this.startOf(g,!1)},b.$set=function(g,v){var _,T=E.p(g),x="set"+(this.$u?"UTC":""),P=(_={},_[a]=x+"Date",_[f]=x+"Date",_[l]=x+"Month",_[u]=x+"FullYear",_[o]=x+"Hours",_[i]=x+"Minutes",_[s]=x+"Seconds",_[n]=x+"Milliseconds",_)[T],N=T===a?this.$D+(v-this.$W):v;if(T===l||T===u){var z=this.clone().set(f,1);z.$d[P](N),z.init(),this.$d=z.set(f,Math.min(this.$D,z.daysInMonth())).$d}else P&&this.$d[P](N);return this.init(),this},b.set=function(g,v){return this.clone().$set(g,v)},b.get=function(g){return this[E.p(g)]()},b.add=function(g,v){var _,T=this;g=Number(g);var x=E.p(v),P=function(Q){var ot=F(T);return E.w(ot.date(ot.date()+Math.round(Q*g)),T)};if(x===l)return this.set(l,this.$M+g);if(x===u)return this.set(u,this.$y+g);if(x===a)return P(1);if(x===h)return P(7);var N=(_={},_[i]=t,_[o]=r,_[s]=e,_)[x]||1,z=this.$d.getTime()+g*N;return E.w(z,this)},b.subtract=function(g,v){return this.add(-1*g,v)},b.format=function(g){var v=this,_=this.$locale();if(!this.isValid())return _.invalidDate||p;var T=g||"YYYY-MM-DDTHH:mm:ssZ",x=E.z(this),P=this.$H,N=this.$m,z=this.$M,Q=_.weekdays,ot=_.months,$t=_.meridiem,kt=function(X,yt,Pt,nt){return X&&(X[yt]||X(v,T))||Pt[yt].slice(0,nt)},Mt=function(X){return E.s(P%12||12,X,"0")},Ot=$t||function(X,yt,Pt){var nt=X<12?"AM":"PM";return Pt?nt.toLowerCase():nt};return T.replace(M,function(X,yt){return yt||function(Pt){switch(Pt){case"YY":return String(v.$y).slice(-2);case"YYYY":return E.s(v.$y,4,"0");case"M":return z+1;case"MM":return E.s(z+1,2,"0");case"MMM":return kt(_.monthsShort,z,ot,3);case"MMMM":return kt(ot,z);case"D":return v.$D;case"DD":return E.s(v.$D,2,"0");case"d":return String(v.$W);case"dd":return kt(_.weekdaysMin,v.$W,Q,2);case"ddd":return kt(_.weekdaysShort,v.$W,Q,3);case"dddd":return Q[v.$W];case"H":return String(P);case"HH":return E.s(P,2,"0");case"h":return Mt(1);case"hh":return Mt(2);case"a":return Ot(P,N,!0);case"A":return Ot(P,N,!1);case"m":return String(N);case"mm":return E.s(N,2,"0");case"s":return String(v.$s);case"ss":return E.s(v.$s,2,"0");case"SSS":return E.s(v.$ms,3,"0");case"Z":return x}return null}(X)||x.replace(":","")})},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(g,v,_){var T,x=this,P=E.p(v),N=F(g),z=(N.utcOffset()-this.utcOffset())*t,Q=this-N,ot=function(){return E.m(x,N)};switch(P){case u:T=ot()/12;break;case l:T=ot();break;case c:T=ot()/3;break;case h:T=(Q-z)/6048e5;break;case a:T=(Q-z)/864e5;break;case o:T=Q/r;break;case i:T=Q/t;break;case s:T=Q/e;break;default:T=Q}return _?T:E.a(T)},b.daysInMonth=function(){return this.endOf(l).$D},b.$locale=function(){return J[this.$L]},b.locale=function(g,v){if(!g)return this.$L;var _=this.clone(),T=ht(g,v,!0);return T&&(_.$L=T),_},b.clone=function(){return E.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},k}(),le=Ht.prototype;return F.prototype=le,[["$ms",n],["$s",s],["$m",i],["$H",o],["$W",a],["$M",l],["$y",u],["$D",f]].forEach(function(k){le[k[1]]=function(b){return this.$g(b,k[0],k[1])}}),F.extend=function(k,b){return k.$i||(k(b,Ht,F),k.$i=!0),F},F.locale=ht,F.isDayjs=rt,F.unix=function(k){return F(1e3*k)},F.en=J[U],F.Ls=J,F.p={},F})});var An=Y((lr,hr)=>{"use strict";w();(function(e,t){typeof lr=="object"&&typeof hr<"u"?hr.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_timezone=t()})(lr,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,s){var i,o=function(c,u,f){f===void 0&&(f={});var p=new Date(c),A=function(M,I){I===void 0&&(I={});var j=I.timeZoneName||"short",K=M+"|"+j,U=t[K];return U||(U=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:M,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:j}),t[K]=U),U}(u,f);return A.formatToParts(p)},a=function(c,u){for(var f=o(c,u),p=[],A=0;A<f.length;A+=1){var M=f[A],I=M.type,j=M.value,K=e[I];K>=0&&(p[K]=parseInt(j,10))}var U=p[3],J=U===24?0:U,mt=p[0]+"-"+p[1]+"-"+p[2]+" "+J+":"+p[4]+":"+p[5]+":000",rt=+c;return(s.utc(mt).valueOf()-(rt-=rt%1e3))/6e4},h=n.prototype;h.tz=function(c,u){c===void 0&&(c=i);var f,p=this.utcOffset(),A=this.toDate(),M=A.toLocaleString("en-US",{timeZone:c}),I=Math.round((A-new Date(M))/1e3/60),j=15*-Math.round(A.getTimezoneOffset()/15)-I;if(!Number(j))f=this.utcOffset(0,u);else if(f=s(M,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(j,!0),u){var K=f.utcOffset();f=f.add(p-K,"minute")}return f.$x.$timezone=c,f},h.offsetName=function(c){var u=this.$x.$timezone||s.tz.guess(),f=o(this.valueOf(),u,{timeZoneName:c}).find(function(p){return p.type.toLowerCase()==="timezonename"});return f&&f.value};var l=h.startOf;h.startOf=function(c,u){if(!this.$x||!this.$x.$timezone)return l.call(this,c,u);var f=s(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return l.call(f,c,u).tz(this.$x.$timezone,!0)},s.tz=function(c,u,f){var p=f&&u,A=f||u||i,M=a(+s(),A);if(typeof c!="string")return s(c).tz(A);var I=function(J,mt,rt){var ht=J-60*mt*1e3,F=a(ht,rt);if(mt===F)return[ht,mt];var E=a(ht-=60*(F-mt)*1e3,rt);return F===E?[ht,F]:[J-60*Math.min(F,E)*1e3,Math.max(F,E)]}(s.utc(c,p).valueOf(),M,A),j=I[0],K=I[1],U=s(j).utcOffset(K);return U.$x.$timezone=A,U},s.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},s.tz.setDefault=function(c){i=c}}})});var $n=Y(($h,En)=>{"use strict";w();var Bt=1e3,Gt=Bt*60,Vt=Gt*60,Dt=Vt*24,Xo=Dt*7,ta=Dt*365.25;En.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return ea(e);if(r==="number"&&isFinite(e))return t.long?na(e):ra(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function ea(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*ta;case"weeks":case"week":case"w":return r*Xo;case"days":case"day":case"d":return r*Dt;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Vt;case"minutes":case"minute":case"mins":case"min":case"m":return r*Gt;case"seconds":case"second":case"secs":case"sec":case"s":return r*Bt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function ra(e){var t=Math.abs(e);return t>=Dt?Math.round(e/Dt)+"d":t>=Vt?Math.round(e/Vt)+"h":t>=Gt?Math.round(e/Gt)+"m":t>=Bt?Math.round(e/Bt)+"s":e+"ms"}function na(e){var t=Math.abs(e);return t>=Dt?ge(e,t,Dt,"day"):t>=Vt?ge(e,t,Vt,"hour"):t>=Gt?ge(e,t,Gt,"minute"):t>=Bt?ge(e,t,Bt,"second"):e+" ms"}function ge(e,t,r,n){var s=t>=r*1.5;return Math.round(e/r)+" "+n+(s?"s":"")}});var fr=Y((Fh,Rn)=>{"use strict";w();function sa(e){r.debug=r,r.default=r,r.coerce=h,r.disable=o,r.enable=s,r.enabled=a,r.humanize=$n(),r.destroy=l,Object.keys(e).forEach(c=>{r[c]=e[c]}),r.names=[],r.skips=[],r.formatters={};function t(c){let u=0;for(let f=0;f<c.length;f++)u=(u<<5)-u+c.charCodeAt(f),u|=0;return r.colors[Math.abs(u)%r.colors.length]}r.selectColor=t;function r(c){let u,f=null,p,A;function M(...I){if(!M.enabled)return;let j=M,K=Number(new Date),U=K-(u||K);j.diff=U,j.prev=u,j.curr=K,u=K,I[0]=r.coerce(I[0]),typeof I[0]!="string"&&I.unshift("%O");let J=0;I[0]=I[0].replace(/%([a-zA-Z%])/g,(rt,ht)=>{if(rt==="%%")return"%";J++;let F=r.formatters[ht];if(typeof F=="function"){let E=I[J];rt=F.call(j,E),I.splice(J,1),J--}return rt}),r.formatArgs.call(j,I),(j.log||r.log).apply(j,I)}return M.namespace=c,M.useColors=r.useColors(),M.color=r.selectColor(c),M.extend=n,M.destroy=r.destroy,Object.defineProperty(M,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(p!==r.namespaces&&(p=r.namespaces,A=r.enabled(c)),A),set:I=>{f=I}}),typeof r.init=="function"&&r.init(M),M}function n(c,u){let f=r(this.namespace+(typeof u>"u"?":":u)+c);return f.log=this.log,f}function s(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let u=(typeof c=="string"?c:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let f of u)f[0]==="-"?r.skips.push(f.slice(1)):r.names.push(f)}function i(c,u){let f=0,p=0,A=-1,M=0;for(;f<c.length;)if(p<u.length&&(u[p]===c[f]||u[p]==="*"))u[p]==="*"?(A=p,M=f,p++):(f++,p++);else if(A!==-1)p=A+1,M++,f=M;else return!1;for(;p<u.length&&u[p]==="*";)p++;return p===u.length}function o(){let c=[...r.names,...r.skips.map(u=>"-"+u)].join(",");return r.enable(""),c}function a(c){for(let u of r.skips)if(i(c,u))return!1;for(let u of r.names)if(i(c,u))return!0;return!1}function h(c){return c instanceof Error?c.stack||c.message:c}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Rn.exports=sa});var Fn=Y((at,_e)=>{"use strict";w();at.formatArgs=oa;at.save=aa;at.load=ua;at.useColors=ia;at.storage=ca();at.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})();at.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"];function ia(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function oa(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+_e.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(r++,s==="%c"&&(n=r))}),e.splice(n,0,t)}at.log=console.debug||console.log||(()=>{});function aa(e){try{e?at.storage.setItem("debug",e):at.storage.removeItem("debug")}catch{}}function ua(){let e;try{e=at.storage.getItem("debug")||at.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function ca(){try{return localStorage}catch{}}_e.exports=fr()(at);var{formatters:la}=_e.exports;la.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Pn=Y((Dh,Mn)=>{"use strict";w();Mn.exports=(e,t)=>{t=t||process.argv;let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return n!==-1&&(s===-1?!0:n<s)}});var In=Y((Lh,Dn)=>{"use strict";w();var ha=Tt("os"),bt=Pn(),tt=process.env,Wt;bt("no-color")||bt("no-colors")||bt("color=false")?Wt=!1:(bt("color")||bt("colors")||bt("color=true")||bt("color=always"))&&(Wt=!0);"FORCE_COLOR"in tt&&(Wt=tt.FORCE_COLOR.length===0||parseInt(tt.FORCE_COLOR,10)!==0);function fa(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function pa(e){if(Wt===!1)return 0;if(bt("color=16m")||bt("color=full")||bt("color=truecolor"))return 3;if(bt("color=256"))return 2;if(e&&!e.isTTY&&Wt!==!0)return 0;let t=Wt?1:0;if(process.platform==="win32"){let r=ha.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in tt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(r=>r in tt)||tt.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in tt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(tt.TEAMCITY_VERSION)?1:0;if(tt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in tt){let r=parseInt((tt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(tt.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(tt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(tt.TERM)||"COLORTERM"in tt?1:(tt.TERM==="dumb",t)}function pr(e){let t=pa(e);return fa(t)}Dn.exports={supportsColor:pr,stdout:pr(process.stdout),stderr:pr(process.stderr)}});var jn=Y((Z,ye)=>{"use strict";w();var ma=Tt("tty"),be=Tt("util");Z.init=Ca;Z.log=ba;Z.formatArgs=ga;Z.save=ya;Z.load=va;Z.useColors=da;Z.destroy=be.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Z.colors=[6,2,3,4,5,1];try{let e=In();e&&(e.stderr||e).level>=2&&(Z.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{}Z.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(s,i)=>i.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function da(){return"colors"in Z.inspectOpts?!!Z.inspectOpts.colors:ma.isatty(process.stderr.fd)}function ga(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,s="\x1B[3"+(n<8?n:"8;5;"+n),i=` ${s};1m${t} \x1B[0m`;e[0]=i+e[0].split(`
27
+ `)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(s=>r.is(s))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function mn(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,n="127.0.0.1",s="9229",i;return(i=t.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?s=i[3]:n=i[3]):(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],n=i[3],s=i[4]),r&&s!=="0"?`${r}=${n}:${parseInt(s)+1}`:t})}function Xe(){if(R.env.NO_COLOR||R.env.FORCE_COLOR==="0"||R.env.FORCE_COLOR==="false")return!1;if(R.env.FORCE_COLOR||R.env.CLICOLOR_FORCE!==void 0)return!0}tr.Command=Ze;tr.useColor=Xe});var yn=Y(dt=>{"use strict";w();var{Argument:gn}=ue(),{Command:er}=dn(),{CommanderError:Vo,InvalidArgumentError:_n}=Yt(),{Help:Wo}=qe(),{Option:bn}=Je();dt.program=new er;dt.createCommand=e=>new er(e);dt.createOption=(e,t)=>new bn(e,t);dt.createArgument=(e,t)=>new gn(e,t);dt.Command=er;dt.Option=bn;dt.Argument=gn;dt.Help=Wo;dt.CommanderError=Vo;dt.InvalidArgumentError=_n;dt.InvalidOptionArgumentError=_n});var nr=Y((vh,rr)=>{"use strict";w();var he=process||{},Cn=he.argv||[],le=he.env||{},qo=!(le.NO_COLOR||Cn.includes("--no-color"))&&(!!le.FORCE_COLOR||Cn.includes("--color")||he.platform==="win32"||(he.stdout||{}).isTTY&&le.TERM!=="dumb"||!!le.CI),Uo=(e,t,r=e)=>n=>{let s=""+n,i=s.indexOf(t,e.length);return~i?e+zo(s,t,r,i)+t:e+s+t},zo=(e,t,r,n)=>{let s="",i=0;do s+=e.substring(i,n)+r,i=n+t.length,n=e.indexOf(t,i);while(~n);return s+e.substring(i)},wn=(e=qo)=>{let t=e?Uo:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};rr.exports=wn();rr.exports.createColors=wn});var kn=Y((sr,ir)=>{"use strict";w();(function(e,t){typeof sr=="object"&&typeof ir<"u"?ir.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(sr,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",s="second",i="minute",o="hour",a="day",l="week",h="month",u="quarter",c="year",f="date",p="Invalid Date",E=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,M=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,I={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(k){var b=["th","st","nd","rd"],g=k%100;return"["+k+(b[(g-20)%10]||b[g]||b[0])+"]"}},j=function(k,b,g){var v=String(k);return!v||v.length>=b?k:""+Array(b+1-v.length).join(g)+k},K={s:j,z:function(k){var b=-k.utcOffset(),g=Math.abs(b),v=Math.floor(g/60),_=g%60;return(b<=0?"+":"-")+j(v,2,"0")+":"+j(_,2,"0")},m:function k(b,g){if(b.date()<g.date())return-k(g,b);var v=12*(g.year()-b.year())+(g.month()-b.month()),_=b.clone().add(v,h),T=g-_<0,x=b.clone().add(v+(T?-1:1),h);return+(-(v+(g-_)/(T?_-x:x-_))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:h,y:c,w:l,d:a,D:f,h:o,m:i,s,ms:n,Q:u}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},U="en",J={};J[U]=I;var mt="$isDayjsObject",rt=function(k){return k instanceof Nt||!(!k||!k[mt])},ht=function k(b,g,v){var _;if(!b)return U;if(typeof b=="string"){var T=b.toLowerCase();J[T]&&(_=T),g&&(J[T]=g,_=T);var x=b.split("-");if(!_&&x.length>1)return k(x[0])}else{var D=b.name;J[D]=b,_=D}return!v&&_&&(U=_),_||!v&&U},F=function(k,b){if(rt(k))return k.clone();var g=typeof b=="object"?b:{};return g.date=k,g.args=arguments,new Nt(g)},A=K;A.l=ht,A.i=rt,A.w=function(k,b){return F(k,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var Nt=function(){function k(g){this.$L=ht(g.locale,null,!0),this.parse(g),this.$x=this.$x||g.x||{},this[mt]=!0}var b=k.prototype;return b.parse=function(g){this.$d=function(v){var _=v.date,T=v.utc;if(_===null)return new Date(NaN);if(A.u(_))return new Date;if(_ instanceof Date)return new Date(_);if(typeof _=="string"&&!/Z$/i.test(_)){var x=_.match(E);if(x){var D=x[2]-1||0,N=(x[7]||"0").substring(0,3);return T?new Date(Date.UTC(x[1],D,x[3]||1,x[4]||0,x[5]||0,x[6]||0,N)):new Date(x[1],D,x[3]||1,x[4]||0,x[5]||0,x[6]||0,N)}}return new Date(_)}(g),this.init()},b.init=function(){var g=this.$d;this.$y=g.getFullYear(),this.$M=g.getMonth(),this.$D=g.getDate(),this.$W=g.getDay(),this.$H=g.getHours(),this.$m=g.getMinutes(),this.$s=g.getSeconds(),this.$ms=g.getMilliseconds()},b.$utils=function(){return A},b.isValid=function(){return this.$d.toString()!==p},b.isSame=function(g,v){var _=F(g);return this.startOf(v)<=_&&_<=this.endOf(v)},b.isAfter=function(g,v){return F(g)<this.startOf(v)},b.isBefore=function(g,v){return this.endOf(v)<F(g)},b.$g=function(g,v,_){return A.u(g)?this[v]:this.set(_,g)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(g,v){var _=this,T=!!A.u(v)||v,x=A.p(g),D=function(kt,X){var bt=A.w(_.$u?Date.UTC(_.$y,X,kt):new Date(_.$y,X,kt),_);return T?bt:bt.endOf(a)},N=function(kt,X){return A.w(_.toDate()[kt].apply(_.toDate("s"),(T?[0,0,0,0]:[23,59,59,999]).slice(X)),_)},z=this.$W,Q=this.$M,ot=this.$D,Et="set"+(this.$u?"UTC":"");switch(x){case c:return T?D(1,0):D(31,11);case h:return T?D(1,Q):D(0,Q+1);case l:var wt=this.$locale().weekStart||0,Ft=(z<wt?z+7:z)-wt;return D(T?ot-Ft:ot+(6-Ft),Q);case a:case f:return N(Et+"Hours",0);case o:return N(Et+"Minutes",1);case i:return N(Et+"Seconds",2);case s:return N(Et+"Milliseconds",3);default:return this.clone()}},b.endOf=function(g){return this.startOf(g,!1)},b.$set=function(g,v){var _,T=A.p(g),x="set"+(this.$u?"UTC":""),D=(_={},_[a]=x+"Date",_[f]=x+"Date",_[h]=x+"Month",_[c]=x+"FullYear",_[o]=x+"Hours",_[i]=x+"Minutes",_[s]=x+"Seconds",_[n]=x+"Milliseconds",_)[T],N=T===a?this.$D+(v-this.$W):v;if(T===h||T===c){var z=this.clone().set(f,1);z.$d[D](N),z.init(),this.$d=z.set(f,Math.min(this.$D,z.daysInMonth())).$d}else D&&this.$d[D](N);return this.init(),this},b.set=function(g,v){return this.clone().$set(g,v)},b.get=function(g){return this[A.p(g)]()},b.add=function(g,v){var _,T=this;g=Number(g);var x=A.p(v),D=function(Q){var ot=F(T);return A.w(ot.date(ot.date()+Math.round(Q*g)),T)};if(x===h)return this.set(h,this.$M+g);if(x===c)return this.set(c,this.$y+g);if(x===a)return D(1);if(x===l)return D(7);var N=(_={},_[i]=t,_[o]=r,_[s]=e,_)[x]||1,z=this.$d.getTime()+g*N;return A.w(z,this)},b.subtract=function(g,v){return this.add(-1*g,v)},b.format=function(g){var v=this,_=this.$locale();if(!this.isValid())return _.invalidDate||p;var T=g||"YYYY-MM-DDTHH:mm:ssZ",x=A.z(this),D=this.$H,N=this.$m,z=this.$M,Q=_.weekdays,ot=_.months,Et=_.meridiem,wt=function(X,bt,Mt,nt){return X&&(X[bt]||X(v,T))||Mt[bt].slice(0,nt)},Ft=function(X){return A.s(D%12||12,X,"0")},kt=Et||function(X,bt,Mt){var nt=X<12?"AM":"PM";return Mt?nt.toLowerCase():nt};return T.replace(M,function(X,bt){return bt||function(Mt){switch(Mt){case"YY":return String(v.$y).slice(-2);case"YYYY":return A.s(v.$y,4,"0");case"M":return z+1;case"MM":return A.s(z+1,2,"0");case"MMM":return wt(_.monthsShort,z,ot,3);case"MMMM":return wt(ot,z);case"D":return v.$D;case"DD":return A.s(v.$D,2,"0");case"d":return String(v.$W);case"dd":return wt(_.weekdaysMin,v.$W,Q,2);case"ddd":return wt(_.weekdaysShort,v.$W,Q,3);case"dddd":return Q[v.$W];case"H":return String(D);case"HH":return A.s(D,2,"0");case"h":return Ft(1);case"hh":return Ft(2);case"a":return kt(D,N,!0);case"A":return kt(D,N,!1);case"m":return String(N);case"mm":return A.s(N,2,"0");case"s":return String(v.$s);case"ss":return A.s(v.$s,2,"0");case"SSS":return A.s(v.$ms,3,"0");case"Z":return x}return null}(X)||x.replace(":","")})},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(g,v,_){var T,x=this,D=A.p(v),N=F(g),z=(N.utcOffset()-this.utcOffset())*t,Q=this-N,ot=function(){return A.m(x,N)};switch(D){case c:T=ot()/12;break;case h:T=ot();break;case u:T=ot()/3;break;case l:T=(Q-z)/6048e5;break;case a:T=(Q-z)/864e5;break;case o:T=Q/r;break;case i:T=Q/t;break;case s:T=Q/e;break;default:T=Q}return _?T:A.a(T)},b.daysInMonth=function(){return this.endOf(h).$D},b.$locale=function(){return J[this.$L]},b.locale=function(g,v){if(!g)return this.$L;var _=this.clone(),T=ht(g,v,!0);return T&&(_.$L=T),_},b.clone=function(){return A.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},k}(),oe=Nt.prototype;return F.prototype=oe,[["$ms",n],["$s",s],["$m",i],["$H",o],["$W",a],["$M",h],["$y",c],["$D",f]].forEach(function(k){oe[k[1]]=function(b){return this.$g(b,k[0],k[1])}}),F.extend=function(k,b){return k.$i||(k(b,Nt,F),k.$i=!0),F},F.locale=ht,F.isDayjs=rt,F.unix=function(k){return F(1e3*k)},F.en=J[U],F.Ls=J,F.p={},F})});var On=Y((or,ar)=>{"use strict";w();(function(e,t){typeof or=="object"&&typeof ar<"u"?ar.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_timezone=t()})(or,function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(r,n,s){var i,o=function(u,c,f){f===void 0&&(f={});var p=new Date(u),E=function(M,I){I===void 0&&(I={});var j=I.timeZoneName||"short",K=M+"|"+j,U=t[K];return U||(U=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:M,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:j}),t[K]=U),U}(c,f);return E.formatToParts(p)},a=function(u,c){for(var f=o(u,c),p=[],E=0;E<f.length;E+=1){var M=f[E],I=M.type,j=M.value,K=e[I];K>=0&&(p[K]=parseInt(j,10))}var U=p[3],J=U===24?0:U,mt=p[0]+"-"+p[1]+"-"+p[2]+" "+J+":"+p[4]+":"+p[5]+":000",rt=+u;return(s.utc(mt).valueOf()-(rt-=rt%1e3))/6e4},l=n.prototype;l.tz=function(u,c){u===void 0&&(u=i);var f,p=this.utcOffset(),E=this.toDate(),M=E.toLocaleString("en-US",{timeZone:u}),I=Math.round((E-new Date(M))/1e3/60),j=15*-Math.round(E.getTimezoneOffset()/15)-I;if(!Number(j))f=this.utcOffset(0,c);else if(f=s(M,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(j,!0),c){var K=f.utcOffset();f=f.add(p-K,"minute")}return f.$x.$timezone=u,f},l.offsetName=function(u){var c=this.$x.$timezone||s.tz.guess(),f=o(this.valueOf(),c,{timeZoneName:u}).find(function(p){return p.type.toLowerCase()==="timezonename"});return f&&f.value};var h=l.startOf;l.startOf=function(u,c){if(!this.$x||!this.$x.$timezone)return h.call(this,u,c);var f=s(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return h.call(f,u,c).tz(this.$x.$timezone,!0)},s.tz=function(u,c,f){var p=f&&c,E=f||c||i,M=a(+s(),E);if(typeof u!="string")return s(u).tz(E);var I=function(J,mt,rt){var ht=J-60*mt*1e3,F=a(ht,rt);if(mt===F)return[ht,mt];var A=a(ht-=60*(F-mt)*1e3,rt);return F===A?[ht,F]:[J-60*Math.min(F,A)*1e3,Math.max(F,A)]}(s.utc(u,p).valueOf(),M,E),j=I[0],K=I[1],U=s(j).utcOffset(K);return U.$x.$timezone=E,U},s.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},s.tz.setDefault=function(u){i=u}}})});var xn=Y((Oh,Tn)=>{"use strict";w();var Ht=1e3,Bt=Ht*60,Gt=Bt*60,Dt=Gt*24,Yo=Dt*7,Jo=Dt*365.25;Tn.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return Ko(e);if(r==="number"&&isFinite(e))return t.long?Zo(e):Qo(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Ko(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Jo;case"weeks":case"week":case"w":return r*Yo;case"days":case"day":case"d":return r*Dt;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Gt;case"minutes":case"minute":case"mins":case"min":case"m":return r*Bt;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ht;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Qo(e){var t=Math.abs(e);return t>=Dt?Math.round(e/Dt)+"d":t>=Gt?Math.round(e/Gt)+"h":t>=Bt?Math.round(e/Bt)+"m":t>=Ht?Math.round(e/Ht)+"s":e+"ms"}function Zo(e){var t=Math.abs(e);return t>=Dt?fe(e,t,Dt,"day"):t>=Gt?fe(e,t,Gt,"hour"):t>=Bt?fe(e,t,Bt,"minute"):t>=Ht?fe(e,t,Ht,"second"):e+" ms"}function fe(e,t,r,n){var s=t>=r*1.5;return Math.round(e/r)+" "+n+(s?"s":"")}});var ur=Y((xh,Sn)=>{"use strict";w();function Xo(e){r.debug=r,r.default=r,r.coerce=l,r.disable=o,r.enable=s,r.enabled=a,r.humanize=xn(),r.destroy=h,Object.keys(e).forEach(u=>{r[u]=e[u]}),r.names=[],r.skips=[],r.formatters={};function t(u){let c=0;for(let f=0;f<u.length;f++)c=(c<<5)-c+u.charCodeAt(f),c|=0;return r.colors[Math.abs(c)%r.colors.length]}r.selectColor=t;function r(u){let c,f=null,p,E;function M(...I){if(!M.enabled)return;let j=M,K=Number(new Date),U=K-(c||K);j.diff=U,j.prev=c,j.curr=K,c=K,I[0]=r.coerce(I[0]),typeof I[0]!="string"&&I.unshift("%O");let J=0;I[0]=I[0].replace(/%([a-zA-Z%])/g,(rt,ht)=>{if(rt==="%%")return"%";J++;let F=r.formatters[ht];if(typeof F=="function"){let A=I[J];rt=F.call(j,A),I.splice(J,1),J--}return rt}),r.formatArgs.call(j,I),(j.log||r.log).apply(j,I)}return M.namespace=u,M.useColors=r.useColors(),M.color=r.selectColor(u),M.extend=n,M.destroy=r.destroy,Object.defineProperty(M,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(p!==r.namespaces&&(p=r.namespaces,E=r.enabled(u)),E),set:I=>{f=I}}),typeof r.init=="function"&&r.init(M),M}function n(u,c){let f=r(this.namespace+(typeof c>"u"?":":c)+u);return f.log=this.log,f}function s(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let c=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let f of c)f[0]==="-"?r.skips.push(f.slice(1)):r.names.push(f)}function i(u,c){let f=0,p=0,E=-1,M=0;for(;f<u.length;)if(p<c.length&&(c[p]===u[f]||c[p]==="*"))c[p]==="*"?(E=p,M=f,p++):(f++,p++);else if(E!==-1)p=E+1,M++,f=M;else return!1;for(;p<c.length&&c[p]==="*";)p++;return p===c.length}function o(){let u=[...r.names,...r.skips.map(c=>"-"+c)].join(",");return r.enable(""),u}function a(u){for(let c of r.skips)if(i(u,c))return!1;for(let c of r.names)if(i(u,c))return!0;return!1}function l(u){return u instanceof Error?u.stack||u.message:u}function h(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Sn.exports=Xo});var An=Y((at,pe)=>{"use strict";w();at.formatArgs=ea;at.save=ra;at.load=na;at.useColors=ta;at.storage=sa();at.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})();at.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"];function ta(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function ea(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+pe.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(r++,s==="%c"&&(n=r))}),e.splice(n,0,t)}at.log=console.debug||console.log||(()=>{});function ra(e){try{e?at.storage.setItem("debug",e):at.storage.removeItem("debug")}catch{}}function na(){let e;try{e=at.storage.getItem("debug")||at.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function sa(){try{return localStorage}catch{}}pe.exports=ur()(at);var{formatters:ia}=pe.exports;ia.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var $n=Y((Eh,En)=>{"use strict";w();En.exports=(e,t)=>{t=t||process.argv;let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return n!==-1&&(s===-1?!0:n<s)}});var Fn=Y((Rh,Rn)=>{"use strict";w();var oa=Ot("os"),_t=$n(),tt=process.env,Vt;_t("no-color")||_t("no-colors")||_t("color=false")?Vt=!1:(_t("color")||_t("colors")||_t("color=true")||_t("color=always"))&&(Vt=!0);"FORCE_COLOR"in tt&&(Vt=tt.FORCE_COLOR.length===0||parseInt(tt.FORCE_COLOR,10)!==0);function aa(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ua(e){if(Vt===!1)return 0;if(_t("color=16m")||_t("color=full")||_t("color=truecolor"))return 3;if(_t("color=256"))return 2;if(e&&!e.isTTY&&Vt!==!0)return 0;let t=Vt?1:0;if(process.platform==="win32"){let r=oa.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in tt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(r=>r in tt)||tt.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in tt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(tt.TEAMCITY_VERSION)?1:0;if(tt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in tt){let r=parseInt((tt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(tt.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(tt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(tt.TERM)||"COLORTERM"in tt?1:(tt.TERM==="dumb",t)}function cr(e){let t=ua(e);return aa(t)}Rn.exports={supportsColor:cr,stdout:cr(process.stdout),stderr:cr(process.stderr)}});var Dn=Y((Z,de)=>{"use strict";w();var ca=Ot("tty"),me=Ot("util");Z.init=ga;Z.log=pa;Z.formatArgs=ha;Z.save=ma;Z.load=da;Z.useColors=la;Z.destroy=me.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Z.colors=[6,2,3,4,5,1];try{let e=Fn();e&&(e.stderr||e).level>=2&&(Z.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{}Z.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(s,i)=>i.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function la(){return"colors"in Z.inspectOpts?!!Z.inspectOpts.colors:ca.isatty(process.stderr.fd)}function ha(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,s="\x1B[3"+(n<8?n:"8;5;"+n),i=` ${s};1m${t} \x1B[0m`;e[0]=i+e[0].split(`
28
28
  `).join(`
29
- `+i),e.push(s+"m+"+ye.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=_a()+t+" "+e[0]}function _a(){return Z.inspectOpts.hideDate?"":new Date().toISOString()+" "}function ba(...e){return process.stderr.write(be.formatWithOptions(Z.inspectOpts,...e)+`
30
- `)}function ya(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function va(){return process.env.DEBUG}function Ca(e){e.inspectOpts={};let t=Object.keys(Z.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=Z.inspectOpts[t[r]]}ye.exports=fr()(Z);var{formatters:Ln}=ye.exports;Ln.o=function(e){return this.inspectOpts.colors=this.useColors,be.inspect(e,this.inspectOpts).split(`
31
- `).map(t=>t.trim()).join(" ")};Ln.O=function(e){return this.inspectOpts.colors=this.useColors,be.inspect(e,this.inspectOpts)}});var dr=Y((Hh,mr)=>{"use strict";w();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?mr.exports=Fn():mr.exports=jn()});var Nn=Y(ft=>{"use strict";w();var wa=ft&&ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ft,"__esModule",{value:!0});var ka=Tt("fs"),Oa=wa(dr()),qt=Oa.default("@kwsites/file-exists");function Ta(e,t,r){qt("checking %s",e);try{let n=ka.statSync(e);return n.isFile()&&t?(qt("[OK] path represents a file"),!0):n.isDirectory()&&r?(qt("[OK] path represents a directory"),!0):(qt("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return qt("[FAIL] path is not accessible: %o",n),!1;throw qt("[FATAL] %o",n),n}}function xa(e,t=ft.READABLE){return Ta(e,(t&ft.FILE)>0,(t&ft.FOLDER)>0)}ft.exists=xa;ft.FILE=1;ft.FOLDER=2;ft.READABLE=ft.FILE+ft.FOLDER});var Hn=Y(ve=>{"use strict";w();function Sa(e){for(var t in e)ve.hasOwnProperty(t)||(ve[t]=e[t])}Object.defineProperty(ve,"__esModule",{value:!0});Sa(Nn())});var _r=Y(It=>{"use strict";w();Object.defineProperty(It,"__esModule",{value:!0});It.createDeferred=It.deferred=void 0;function gr(){let e,t,r="pending";return{promise:new Promise((s,i)=>{e=s,t=i}),done(s){r==="pending"&&(r="resolved",e(s))},fail(s){r==="pending"&&(r="rejected",t(s))},get fulfilled(){return r!=="pending"},get status(){return r}}}It.deferred=gr;It.createDeferred=gr;It.default=gr});w();import{execSync as Vl}from"child_process";import{readFileSync as Wl,writeFileSync as ql}from"fs";import{resolve as Ul}from"path";w();var On=xt(kn(),1),{program:Kt,createCommand:mh,createArgument:dh,createOption:gh,CommanderError:_h,InvalidArgumentError:bh,InvalidOptionArgumentError:yh,Command:vh,Argument:Ch,Option:wh,Help:kh}=On.default;var wt=xt(ar(),1),cn=xt(Sn(),1),So=xt(An(),1);w();var Me=xt(Hn(),1),Ee=xt(dr(),1),Yi=xt(_r(),1),Ut=xt(_r(),1);import{spawn as du}from"child_process";import{EventEmitter as Rl}from"events";var Re=Object.defineProperty,Aa=Object.defineProperties,Ea=Object.getOwnPropertyDescriptor,$a=Object.getOwnPropertyDescriptors,Lr=Object.getOwnPropertyNames,Bn=Object.getOwnPropertySymbols,vs=Object.prototype.hasOwnProperty,Ra=Object.prototype.propertyIsEnumerable,Gn=(e,t,r)=>t in e?Re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gt=(e,t)=>{for(var r in t||(t={}))vs.call(t,r)&&Gn(e,r,t[r]);if(Bn)for(var r of Bn(t))Ra.call(t,r)&&Gn(e,r,t[r]);return e},Xt=(e,t)=>Aa(e,$a(t)),d=(e,t)=>function(){return e&&(t=(0,e[Lr(e)[0]])(e=0)),t},Fa=(e,t)=>function(){return t||(0,e[Lr(e)[0]])((t={exports:{}}).exports,t),t.exports},q=(e,t)=>{for(var r in t)Re(e,r,{get:t[r],enumerable:!0})},Ma=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Lr(t))!vs.call(e,s)&&s!==r&&Re(e,s,{get:()=>t[s],enumerable:!(n=Ea(t,s))||n.enumerable});return e},G=e=>Ma(Re({},"__esModule",{value:!0}),e),Zt=(e,t,r)=>new Promise((n,s)=>{var i=h=>{try{a(r.next(h))}catch(l){s(l)}},o=h=>{try{a(r.throw(h))}catch(l){s(l)}},a=h=>h.done?n(h.value):Promise.resolve(h.value).then(i,o);a((r=r.apply(e,t)).next())});function Pa(...e){let t=new String(e);return Fe.set(t,e),t}function Se(e){return e instanceof String&&Fe.has(e)}function Vn(e){return Fe.get(e)||[]}var Fe,ne=d({"src/lib/args/pathspec.ts"(){"use strict";Fe=new WeakMap}}),Et,Ft=d({"src/lib/errors/git-error.ts"(){"use strict";Et=class extends Error{constructor(e,t){super(t),this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),se,Yt=d({"src/lib/errors/git-response-error.ts"(){"use strict";Ft(),se=class extends Et{constructor(e,t){super(void 0,t||String(e)),this.git=e}}}}),Cs,ws=d({"src/lib/errors/task-configuration-error.ts"(){"use strict";Ft(),Cs=class extends Et{constructor(e){super(void 0,e)}}}});function ks(e){return typeof e=="function"?e:Nt}function Os(e){return typeof e=="function"&&e!==Nt}function Ts(e,t){let r=e.indexOf(t);return r<=0?[e,""]:[e.substr(0,r),e.substr(r+1)]}function xs(e,t=0){return Ss(e)&&e.length>t?e[t]:void 0}function jt(e,t=0){if(Ss(e)&&e.length>t)return e[e.length-1-t]}function Ss(e){return!!(e&&typeof e.length=="number")}function ie(e="",t=!0,r=`
32
- `){return e.split(r).reduce((n,s)=>{let i=t?s.trim():s;return i&&n.push(i),n},[])}function jr(e,t){return ie(e,!0).map(r=>t(r))}function Nr(e){return(0,Me.exists)(e,Me.FOLDER)}function $(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function As(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function Pe(e,t){if(Array.isArray(e)){let r=e.indexOf(t);r>=0&&e.splice(r,1)}else e.delete(t);return t}function vt(e){return Array.isArray(e)?e:[e]}function Es(e){return e.replace(/[\s-]+(.)/g,(t,r)=>r.toUpperCase())}function $s(e){return vt(e).map(String)}function L(e,t=0){if(e==null)return t;let r=parseInt(e,10);return isNaN(r)?t:r}function te(e,t){let r=[];for(let n=0,s=e.length;n<s;n++)r.push(t,e[n]);return r}function ee(e){return(Array.isArray(e)?Buffer.concat(e):e).toString("utf-8")}function Rs(e,t){return Object.assign({},...t.map(r=>r in e?{[r]:e[r]}:{}))}function Or(e=0){return new Promise(t=>setTimeout(t,e))}function Tr(e){if(e!==!1)return e}var zt,Nt,oe,De=d({"src/lib/utils/util.ts"(){"use strict";zt="\0",Nt=()=>{},oe=Object.prototype.toString.call.bind(Object.prototype.toString)}});function Ct(e,t,r){return t(e)?e:arguments.length>2?r:void 0}function Hr(e,t){let r=Se(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function Br(e){return!!e&&oe(e)==="[object Object]"}function Fs(e){return typeof e=="function"}var ae,et,Ms,Ae,Gr,Ps=d({"src/lib/utils/argument-filters.ts"(){"use strict";De(),ne(),ae=e=>Array.isArray(e),et=e=>typeof e=="string",Ms=e=>Array.isArray(e)&&e.every(et),Ae=e=>et(e)||Array.isArray(e)&&e.every(et),Gr=e=>e==null||"number|boolean|function".includes(typeof e)?!1:Array.isArray(e)||typeof e=="string"||typeof e.length=="number"}}),xr,Da=d({"src/lib/utils/exit-codes.ts"(){"use strict";xr=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(xr||{})}}),re,Ia=d({"src/lib/utils/git-output-streams.ts"(){"use strict";re=class{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new re(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),S,Rt,La=d({"src/lib/utils/line-parser.ts"(){"use strict";S=class{constructor(e,t){this.matches=[],this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((s,i)=>this.addMatch(s,i,r(i)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}useMatches(e,t){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,r){let n=r&&e.exec(r);return n&&this.pushMatch(t,n),!!n}pushMatch(e,t){this.matches.push(...t.slice(1))}},Rt=class extends S{addMatch(e,t,r){return/^remote:\s/.test(String(r))&&super.addMatch(e,t,r)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function Ds(...e){let t=process.cwd(),r=Object.assign(gt({baseDir:t},Is),...e.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||t,r.trimmed=r.trimmed===!0,r}var Is,ja=d({"src/lib/utils/simple-git-options.ts"(){"use strict";Is={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Vr(e,t=[]){return Br(e)?Object.keys(e).reduce((r,n)=>{let s=e[n];return Se(s)?r.push(s):Hr(s,["boolean"])?r.push(n+"="+s):r.push(n),r},t):t}function ut(e,t=0,r=!1){let n=[];for(let s=0,i=t<0?e.length:t;s<i;s++)"string|number".includes(typeof e[s])&&n.push(String(e[s]));return Vr(Wr(e),n),r||n.push(...Na(e)),n}function Na(e){let t=typeof jt(e)=="function";return Ct(jt(e,t?1:0),ae,[])}function Wr(e){let t=Fs(jt(e));return Ct(jt(e,t?1:0),Br)}function V(e,t=!0){let r=ks(jt(e));return t||Os(r)?r:void 0}var Ha=d({"src/lib/utils/task-options.ts"(){"use strict";Ps(),De(),ne()}});function Sr(e,t){return e(t.stdOut,t.stdErr)}function lt(e,t,r,n=!0){return vt(r).forEach(s=>{for(let i=ie(s,n),o=0,a=i.length;o<a;o++){let h=(l=0)=>{if(!(o+l>=a))return i[o+l]};t.some(({parse:l})=>l(h,e))}}),e}var Ba=d({"src/lib/utils/task-parser.ts"(){"use strict";De()}}),Ls={};q(Ls,{ExitCodes:()=>xr,GitOutputStreams:()=>re,LineParser:()=>S,NOOP:()=>Nt,NULL:()=>zt,RemoteLineParser:()=>Rt,append:()=>$,appendTaskOptions:()=>Vr,asArray:()=>vt,asCamelCase:()=>Es,asFunction:()=>ks,asNumber:()=>L,asStringArray:()=>$s,bufferToString:()=>ee,callTaskParser:()=>Sr,createInstanceConfig:()=>Ds,delay:()=>Or,filterArray:()=>ae,filterFunction:()=>Fs,filterHasLength:()=>Gr,filterPlainObject:()=>Br,filterPrimitives:()=>Hr,filterString:()=>et,filterStringArray:()=>Ms,filterStringOrStringArray:()=>Ae,filterType:()=>Ct,first:()=>xs,folderExists:()=>Nr,forEachLineWithContent:()=>jr,getTrailingOptions:()=>ut,including:()=>As,isUserFunction:()=>Os,last:()=>jt,objectToString:()=>oe,orVoid:()=>Tr,parseStringResponse:()=>lt,pick:()=>Rs,prefixedArray:()=>te,remove:()=>Pe,splitOn:()=>Ts,toLinesWithContent:()=>ie,trailingFunctionArgument:()=>V,trailingOptionsArgument:()=>Wr});var O=d({"src/lib/utils/index.ts"(){"use strict";Ps(),Da(),Ia(),La(),ja(),Ha(),Ba(),De()}}),js={};q(js,{CheckRepoActions:()=>Ar,checkIsBareRepoTask:()=>Hs,checkIsRepoRootTask:()=>Ns,checkIsRepoTask:()=>Ga});function Ga(e){switch(e){case"bare":return Hs();case"root":return Ns()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:Ie,parser:qr}}function Ns(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:Ie,parser(t){return/^\.(git)?$/.test(t.trim())}}}function Hs(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:Ie,parser:qr}}function Va(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var Ar,Ie,qr,Bs=d({"src/lib/tasks/check-is-repo.ts"(){"use strict";O(),Ar=(e=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(Ar||{}),Ie=({exitCode:e},t,r,n)=>{if(e===128&&Va(t))return r(Buffer.from("false"));n(t)},qr=e=>e.trim()==="true"}});function Wa(e,t){let r=new Gs(e),n=e?Ws:Vs;return ie(t).forEach(s=>{let i=s.replace(n,"");r.paths.push(i),(qs.test(i)?r.folders:r.files).push(i)}),r}var Gs,Vs,Ws,qs,qa=d({"src/lib/responses/CleanSummary.ts"(){"use strict";O(),Gs=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},Vs=/^[a-z]+\s*/i,Ws=/^[a-z]+\s+[a-z]+\s*/i,qs=/\/$/}}),Er={};q(Er,{EMPTY_COMMANDS:()=>Le,adhocExecTask:()=>Us,configurationErrorTask:()=>ct,isBufferTask:()=>Ys,isEmptyTask:()=>Js,straightThroughBufferTask:()=>zs,straightThroughStringTask:()=>it});function Us(e){return{commands:Le,format:"empty",parser:e}}function ct(e){return{commands:Le,format:"empty",parser(){throw typeof e=="string"?new Cs(e):e}}}function it(e,t=!1){return{commands:e,format:"utf-8",parser(r){return t?String(r).trim():r}}}function zs(e){return{commands:e,format:"buffer",parser(t){return t}}}function Ys(e){return e.format==="buffer"}function Js(e){return e.format==="empty"||!e.commands.length}var Le,W=d({"src/lib/tasks/task.ts"(){"use strict";ws(),Le=[]}}),Ks={};q(Ks,{CONFIG_ERROR_INTERACTIVE_MODE:()=>Ur,CONFIG_ERROR_MODE_REQUIRED:()=>zr,CONFIG_ERROR_UNKNOWN_OPTION:()=>Yr,CleanOptions:()=>ke,cleanTask:()=>Qs,cleanWithOptionsTask:()=>Ua,isCleanOptionsArray:()=>za});function Ua(e,t){let{cleanMode:r,options:n,valid:s}=Ya(e);return r?s.options?(n.push(...t),n.some(Qa)?ct(Ur):Qs(r,n)):ct(Yr+JSON.stringify(e)):ct(zr)}function Qs(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser(n){return Wa(e==="n",n)}}}function za(e){return Array.isArray(e)&&e.every(t=>Jr.has(t))}function Ya(e){let t,r=[],n={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach(s=>{Ja(s)?(t=s,n.cleanMode=!0):n.options=n.options&&Ka(r[r.length]=`-${s}`)}),{cleanMode:t,options:r,valid:n}}function Ja(e){return e==="f"||e==="n"}function Ka(e){return/^-[a-z]$/i.test(e)&&Jr.has(e.charAt(1))}function Qa(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:e==="--interactive"}var Ur,zr,Yr,ke,Jr,Zs=d({"src/lib/tasks/clean.ts"(){"use strict";qa(),O(),W(),Ur="Git clean interactive mode is not supported",zr='Git clean mode parameter ("n" or "f") is required',Yr="Git clean unknown option found in: ",ke=(e=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(ke||{}),Jr=new Set(["i",...$s(Object.values(ke))])}});function Za(e){let t=new ti;for(let r of Xs(e))t.addValue(r.file,String(r.key),r.value);return t}function Xa(e,t){let r=null,n=[],s=new Map;for(let i of Xs(e,t))i.key===t&&(n.push(r=i.value),s.has(i.file)||s.set(i.file,[]),s.get(i.file).push(r));return{key:t,paths:Array.from(s.keys()),scopes:s,value:r,values:n}}function tu(e){return e.replace(/^(file):/,"")}function*Xs(e,t=null){let r=e.split("\0");for(let n=0,s=r.length-1;n<s;){let i=tu(r[n++]),o=r[n++],a=t;if(o.includes(`
33
- `)){let h=Ts(o,`
34
- `);a=h[0],o=h[1]}yield{file:i,key:a,value:o}}}var ti,eu=d({"src/lib/responses/ConfigList.ts"(){"use strict";O(),ti=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{})),this._all}addFile(e){if(!(e in this.values)){let t=jt(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,r){let n=this.addFile(e);n.hasOwnProperty(t)?Array.isArray(n[t])?n[t].push(r):n[t]=[n[t],r]:n[t]=r,this._all=void 0}}}});function br(e,t){return typeof e=="string"&&$r.hasOwnProperty(e)?e:t}function ru(e,t,r,n){let s=["config",`--${n}`];return r&&s.push("--add"),s.push(e,t),{commands:s,format:"utf-8",parser(i){return i}}}function nu(e,t){let r=["config","--null","--show-origin","--get-all",e];return t&&r.splice(1,0,`--${t}`),{commands:r,format:"utf-8",parser(n){return Xa(n,e)}}}function su(e){let t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser(r){return Za(r)}}}function iu(){return{addConfig(e,t,...r){return this._runTask(ru(e,t,r[0]===!0,br(r[1],"local")),V(arguments))},getConfig(e,t){return this._runTask(nu(e,br(t,void 0)),V(arguments))},listConfig(...e){return this._runTask(su(br(e[0],void 0)),V(arguments))}}}var $r,ei=d({"src/lib/tasks/config.ts"(){"use strict";eu(),O(),$r=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))($r||{})}});function ou(e){return ri.has(e)}var yr,ri,ni=d({"src/lib/tasks/diff-name-status.ts"(){"use strict";yr=(e=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(yr||{}),ri=new Set(Object.values(yr))}});function au(...e){return new ii().param(...e)}function uu(e){let t=new Set,r={};return jr(e,n=>{let[s,i,o]=n.split(zt);t.add(s),(r[s]=r[s]||[]).push({line:L(i),path:s,preview:o})}),{paths:t,results:r}}function cu(){return{grep(e){let t=V(arguments),r=ut(arguments);for(let s of si)if(r.includes(s))return this._runTask(ct(`git.grep: use of "${s}" is not supported.`),t);typeof e=="string"&&(e=au().param(e));let n=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:n,format:"utf-8",parser(s){return uu(s)}},t)}}}var si,Qt,Wn,ii,oi=d({"src/lib/tasks/grep.ts"(){"use strict";O(),W(),si=["-h"],Qt=Symbol("grepQuery"),ii=class{constructor(){this[Wn]=[]}*[(Wn=Qt,Symbol.iterator)](){for(let e of this[Qt])yield e}and(...e){return e.length&&this[Qt].push("--and","(",...te(e,"-e"),")"),this}param(...e){return this[Qt].push(...te(e,"-e")),this}}}}),ai={};q(ai,{ResetMode:()=>Oe,getResetMode:()=>hu,resetTask:()=>lu});function lu(e,t){let r=["reset"];return ui(e)&&r.push(`--${e}`),r.push(...t),it(r)}function hu(e){if(ui(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function ui(e){return ci.includes(e)}var Oe,ci,li=d({"src/lib/tasks/reset.ts"(){"use strict";W(),Oe=(e=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(Oe||{}),ci=Array.from(Object.values(Oe))}});function fu(){return(0,Ee.default)("simple-git")}function qn(e,t,r){return!t||!String(t).replace(/\s*/,"")?r?(n,...s)=>{e(n,...s),r(n,...s)}:e:(n,...s)=>{e(`%s ${n}`,t,...s),r&&r(n,...s)}}function pu(e,t,{namespace:r}){if(typeof e=="string")return e;let n=t&&t.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}function Kr(e,t,r,n=fu()){let s=e&&`[${e}]`||"",i=[],o=typeof t=="string"?n.extend(t):t,a=pu(Ct(t,et),o,n);return l(r);function h(c,u){return $(i,Kr(e,a.replace(/^[^:]+/,c),u,n))}function l(c){let u=c&&`[${c}]`||"",f=o&&qn(o,u)||Nt,p=qn(n,`${s} ${u}`,f);return Object.assign(o?f:p,{label:e,sibling:h,info:p,step:l})}}var hi=d({"src/lib/git-logger.ts"(){"use strict";O(),Ee.default.formatters.L=e=>String(Gr(e)?e.length:"-"),Ee.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):oe(e)}}),Ce,Rr,mu=d({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";Ft(),hi(),Ce=class{constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){let t=Ce.getName(e.commands[0]),r=Kr(this.logLabel,t);return{task:e,logger:r,name:t}}push(e){let t=this.createProgress(e);return t.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,t),t}fatal(e){for(let[t,{logger:r}]of Array.from(this._queue.entries()))t===e.task?(r.info("Failed %o",e),r("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):r.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(t);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let t=this.withProgress(e);if(!t)throw new Et(void 0,"TasksPendingQueue: attempt called for an unknown task");return t.logger("Starting task"),t}static getName(e="empty"){return`task:${e}:${++Ce.counter}`}},Rr=Ce,Rr.counter=0}});function Lt(e,t){return{method:xs(e.commands)||"",commands:t}}function gu(e,t){return r=>{t("[ERROR] child process exception %o",r),e.push(Buffer.from(String(r.stack),"ascii"))}}function Un(e,t,r,n){return s=>{r("%s received %L bytes",t,s),n("%B",s),e.push(s)}}var Fr,_u=d({"src/lib/runners/git-executor-chain.ts"(){"use strict";Ft(),W(),O(),mu(),Fr=class{constructor(e,t,r){this._executor=e,this._scheduler=t,this._plugins=r,this._chain=Promise.resolve(),this._queue=new Rr}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}attemptTask(e){return Zt(this,null,function*(){let t=yield this._scheduler.next(),r=()=>this._queue.complete(e);try{let{logger:n}=this._queue.attempt(e);return yield Js(e)?this.attemptEmptyTask(e,n):this.attemptRemoteTask(e,n)}catch(n){throw this.onFatalException(e,n)}finally{r(),t()}})}onFatalException(e,t){let r=t instanceof Et?Object.assign(t,{task:e}):new Et(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(r),r}attemptRemoteTask(e,t){return Zt(this,null,function*(){let r=this._plugins.exec("spawn.binary","",Lt(e,e.commands)),n=this._plugins.exec("spawn.args",[...e.commands],Lt(e,e.commands)),s=yield this.gitResponse(e,r,n,this.outputHandler,t.step("SPAWN")),i=yield this.handleTaskData(e,n,s,t.step("HANDLE"));return t("passing response to task's parser as a %s",e.format),Ys(e)?Sr(e.parser,i):Sr(e.parser,i.asStrings())})}attemptEmptyTask(e,t){return Zt(this,null,function*(){return t("empty task bypassing child process to call to task's parser"),e.parser(this)})}handleTaskData(e,t,r,n){let{exitCode:s,rejection:i,stdOut:o,stdErr:a}=r;return new Promise((h,l)=>{n("Preparing to handle process response exitCode=%d stdOut=",s);let{error:c}=this._plugins.exec("task.error",{error:i},gt(gt({},Lt(e,t)),r));if(c&&e.onError)return n.info("exitCode=%s handling with custom error handler"),e.onError(r,c,u=>{n.info("custom error handler treated as success"),n("custom error returned a %s",oe(u)),h(new re(Array.isArray(u)?Buffer.concat(u):u,Buffer.concat(a)))},l);if(c)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",s,a.length,i),l(c);n.info("retrieving task output complete"),h(new re(Buffer.concat(o),Buffer.concat(a)))})}gitResponse(e,t,r,n,s){return Zt(this,null,function*(){let i=s.sibling("output"),o=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},Lt(e,e.commands));return new Promise(a=>{let h=[],l=[];s.info("%s %o",t,r),s("%O",o);let c=this._beforeSpawn(e,r);if(c)return a({stdOut:h,stdErr:l,exitCode:9901,rejection:c});this._plugins.exec("spawn.before",void 0,Xt(gt({},Lt(e,r)),{kill(f){c=f||c}}));let u=du(t,r,o);u.stdout.on("data",Un(h,"stdOut",s,i.step("stdOut"))),u.stderr.on("data",Un(l,"stdErr",s,i.step("stdErr"))),u.on("error",gu(l,s)),n&&(s("Passing child process stdOut/stdErr to custom outputHandler"),n(t,u.stdout,u.stderr,[...r])),this._plugins.exec("spawn.after",void 0,Xt(gt({},Lt(e,r)),{spawned:u,close(f,p){a({stdOut:h,stdErr:l,exitCode:f,rejection:c||p})},kill(f){u.killed||(c=f,u.kill("SIGINT"))}}))})})}_beforeSpawn(e,t){let r;return this._plugins.exec("spawn.before",void 0,Xt(gt({},Lt(e,t)),{kill(n){r=n||r}})),r}}}}),fi={};q(fi,{GitExecutor:()=>pi});var pi,bu=d({"src/lib/runners/git-executor.ts"(){"use strict";_u(),pi=class{constructor(e,t,r){this.cwd=e,this._scheduler=t,this._plugins=r,this._chain=new Fr(this,this._scheduler,this._plugins)}chain(){return new Fr(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function yu(e,t,r=Nt){let n=i=>{r(null,i)},s=i=>{i?.task===e&&r(i instanceof se?vu(i):i,void 0)};t.then(n,s)}function vu(e){let t=n=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),t=Nt};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(r,{}));function r(n,s){return s in e||(n[s]={enumerable:!1,configurable:!1,get(){return t(s),e.git[s]}}),n}}var Cu=d({"src/lib/task-callback.ts"(){"use strict";Yt(),O()}});function zn(e,t){return Us(r=>{if(!Nr(e))throw new Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||r).cwd=e})}var wu=d({"src/lib/tasks/change-working-directory.ts"(){"use strict";O(),W()}});function vr(e){let t=["checkout",...e];return t[1]==="-b"&&t.includes("-B")&&(t[1]=Pe(t,"-B")),it(t)}function ku(){return{checkout(){return this._runTask(vr(ut(arguments,1)),V(arguments))},checkoutBranch(e,t){return this._runTask(vr(["-b",e,t,...ut(arguments)]),V(arguments))},checkoutLocalBranch(e){return this._runTask(vr(["-b",e,...ut(arguments)]),V(arguments))}}}var Ou=d({"src/lib/tasks/checkout.ts"(){"use strict";O(),W()}});function Tu(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function xu(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(e){return lt(Tu(),[mi],e)}})}}}var mi,Su=d({"src/lib/tasks/count-objects.ts"(){"use strict";O(),mi=new S(/([a-z-]+): (\d+)$/,(e,[t,r])=>{let n=Es(t);e.hasOwnProperty(n)&&(e[n]=L(r))})}});function Au(e){return lt({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},di,e)}var di,Eu=d({"src/lib/parsers/parse-commit.ts"(){"use strict";O(),di=[new S(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,r,n])=>{e.branch=t,e.commit=n,e.root=!!r}),new S(/\s*Author:\s(.+)/i,(e,[t])=>{let r=t.split("<"),n=r.pop();!n||!n.includes("@")||(e.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new S(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(r,10)||0,e.summary.deletions=parseInt(n,10)||0}),new S(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0;let s=parseInt(r,10)||0;n==="-"?e.summary.deletions=s:n==="+"&&(e.summary.insertions=s)})]}});function $u(e,t,r){return{commands:["-c","core.abbrev=40","commit",...te(e,"-m"),...t,...r],format:"utf-8",parser:Au}}function Ru(){return{commit(t,...r){let n=V(arguments),s=e(t)||$u(vt(t),vt(Ct(r[0],Ae,[])),[...Ct(r[1],ae,[]),...ut(arguments,0,!0)]);return this._runTask(s,n)}};function e(t){return!Ae(t)&&ct("git.commit: requires the commit message to be supplied as a string/string[]")}}var Fu=d({"src/lib/tasks/commit.ts"(){"use strict";Eu(),O(),W()}});function Mu(){return{firstCommit(){return this._runTask(it(["rev-list","--max-parents=0","HEAD"],!0),V(arguments))}}}var Pu=d({"src/lib/tasks/first-commit.ts"(){"use strict";O(),W()}});function Du(e,t){let r=["hash-object",e];return t&&r.push("-w"),it(r,!0)}var Iu=d({"src/lib/tasks/hash-object.ts"(){"use strict";W()}});function Lu(e,t,r){let n=String(r).trim(),s;if(s=gi.exec(n))return new Te(e,t,!1,s[1]);if(s=_i.exec(n))return new Te(e,t,!0,s[1]);let i="",o=n.split(" ");for(;o.length;)if(o.shift()==="in"){i=o.join(" ");break}return new Te(e,t,/^re/i.test(n),i)}var Te,gi,_i,ju=d({"src/lib/responses/InitSummary.ts"(){"use strict";Te=class{constructor(e,t,r,n){this.bare=e,this.path=t,this.existing=r,this.gitDir=n}},gi=/^Init.+ repository in (.+)$/,_i=/^Rein.+ in (.+)$/}});function Nu(e){return e.includes(Qr)}function Hu(e=!1,t,r){let n=["init",...r];return e&&!Nu(n)&&n.splice(1,0,Qr),{commands:n,format:"utf-8",parser(s){return Lu(n.includes("--bare"),t,s)}}}var Qr,Bu=d({"src/lib/tasks/init.ts"(){"use strict";ju(),Qr="--bare"}});function Zr(e){for(let t=0;t<e.length;t++){let r=Xr.exec(e[t]);if(r)return`--${r[1]}`}return""}function Gu(e){return Xr.test(e)}var Xr,ue=d({"src/lib/args/log-format.ts"(){"use strict";Xr=/^--(stat|numstat|name-only|name-status)(=|$)/}}),bi,Vu=d({"src/lib/responses/DiffSummary.ts"(){"use strict";bi=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function yi(e=""){let t=vi[e];return r=>lt(new bi,t,r,!1)}var Cr,Yn,Jn,Kn,vi,Ci=d({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";ue(),Vu(),ni(),O(),Cr=[new S(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,r,n=""])=>{e.files.push({file:t.trim(),changes:L(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new S(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,r,n])=>{e.files.push({file:t.trim(),before:L(r),after:L(n),binary:!0})}),new S(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,r])=>{let n=/(\d+) i/.exec(r),s=/(\d+) d/.exec(r);e.changed=L(t),e.insertions=L(n?.[1]),e.deletions=L(s?.[1])})],Yn=[new S(/(\d+)\t(\d+)\t(.+)$/,(e,[t,r,n])=>{let s=L(t),i=L(r);e.changed++,e.insertions+=s,e.deletions+=i,e.files.push({file:n,changes:s+i,insertions:s,deletions:i,binary:!1})}),new S(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],Jn=[new S(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],Kn=[new S(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,r,n,s,i])=>{e.changed++,e.files.push({file:i??n,changes:0,insertions:0,deletions:0,binary:!1,status:Tr(ou(t)&&t),from:Tr(!!i&&n!==i&&n),similarity:L(r)})})],vi={"":Cr,"--stat":Cr,"--numstat":Yn,"--name-status":Kn,"--name-only":Jn}}});function Wu(e,t){return t.reduce((r,n,s)=>(r[n]=e[s]||"",r),Object.create({diff:null}))}function wi(e=rn,t=ki,r=""){let n=yi(r);return function(s){let i=ie(s.trim(),!1,tn).map(function(o){let a=o.split(en),h=Wu(a[0].split(e),t);return a.length>1&&a[1].trim()&&(h.diff=n(a[1])),h});return{all:i,latest:i.length&&i[0]||null,total:i.length}}}var tn,en,rn,ki,Oi=d({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";O(),Ci(),ue(),tn="\xF2\xF2\xF2\xF2\xF2\xF2 ",en=" \xF2\xF2",rn=" \xF2 ",ki=["hash","date","message","refs","author_name","author_email"]}}),Ti={};q(Ti,{diffSummaryTask:()=>qu,validateLogFormatConfig:()=>je});function qu(e){let t=Zr(e),r=["diff"];return t===""&&(t="--stat",r.push("--stat=4096")),r.push(...e),je(r)||{commands:r,format:"utf-8",parser:yi(t)}}function je(e){let t=e.filter(Gu);if(t.length>1)return ct(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`);if(t.length&&e.includes("-z"))return ct(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var nn=d({"src/lib/tasks/diff.ts"(){"use strict";ue(),Ci(),W()}});function Uu(e,t){let r=[],n=[];return Object.keys(e).forEach(s=>{r.push(s),n.push(String(e[s]))}),[r,n.join(t)]}function zu(e){return Object.keys(e).reduce((t,r)=>(r in Mr||(t[r]=e[r]),t),{})}function xi(e={},t=[]){let r=Ct(e.splitter,et,rn),n=!Hr(e.format)&&e.format?e.format:{hash:"%H",date:e.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:e.mailMap!==!1?"%aN":"%an",author_email:e.mailMap!==!1?"%aE":"%ae"},[s,i]=Uu(n,r),o=[],a=[`--pretty=format:${tn}${i}${en}`,...t],h=e.n||e["max-count"]||e.maxCount;if(h&&a.push(`--max-count=${h}`),e.from||e.to){let l=e.symmetric!==!1?"...":"..";o.push(`${e.from||""}${l}${e.to||""}`)}return et(e.file)&&a.push("--follow",Pa(e.file)),Vr(zu(e),a),{fields:s,splitter:r,commands:[...a,...o]}}function Yu(e,t,r){let n=wi(e,t,Zr(r));return{commands:["log",...r],format:"utf-8",parser:n}}function Ju(){return{log(...r){let n=V(arguments),s=xi(Wr(arguments),Ct(arguments[0],ae)),i=t(...r)||je(s.commands)||e(s);return this._runTask(i,n)}};function e(r){return Yu(r.splitter,r.fields,r.commands)}function t(r,n){return et(r)&&et(n)&&ct("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var Mr,Si=d({"src/lib/tasks/log.ts"(){"use strict";ue(),ne(),Oi(),O(),W(),nn(),Mr=(e=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))(Mr||{})}}),xe,Ai,Ku=d({"src/lib/responses/MergeSummary.ts"(){"use strict";xe=class{constructor(e,t=null,r){this.reason=e,this.file=t,this.meta=r}toString(){return`${this.file}:${this.reason}`}},Ai=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),Pr,Ei,Qu=d({"src/lib/responses/PullSummary.ts"(){"use strict";Pr=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Ei=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function wr(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function Qn(e){let t=/^\s*(\d+)/.exec(e),r=/delta (\d+)/i.exec(e);return{count:L(t&&t[1]||"0"),delta:L(r&&r[1]||"0")}}var $i,Zu=d({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";O(),$i=[new Rt(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,r])=>{let n=t.toLowerCase(),s=wr(e.remoteMessages);Object.assign(s,{[n]:L(r)})}),new Rt(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,r])=>{let n=t.toLowerCase(),s=wr(e.remoteMessages);Object.assign(s,{[n]:L(r)})}),new Rt(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,r,n])=>{let s=wr(e.remoteMessages);s.total=Qn(t),s.reused=Qn(r),s.packReused=L(n)})]}});function Ri(e,t){return lt({remoteMessages:new Mi},Fi,t)}var Fi,Mi,Pi=d({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";O(),Zu(),Fi=[new Rt(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...$i,new Rt([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new Rt([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,r,n])=>{e.remoteMessages.vulnerabilities={count:L(t),summary:r,url:n}})],Mi=class{constructor(){this.all=[]}}}});function Xu(e,t){let r=lt(new Ei,Di,[e,t]);return r.message&&r}var Zn,Xn,ts,es,Di,rs,sn,Ii=d({"src/lib/parsers/parse-pull.ts"(){"use strict";Qu(),O(),Pi(),Zn=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,Xn=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,ts=/^(create|delete) mode \d+ (.+)/,es=[new S(Zn,(e,[t,r,n])=>{e.files.push(t),r&&(e.insertions[t]=r.length),n&&(e.deletions[t]=n.length)}),new S(Xn,(e,[t,,r,,n])=>r!==void 0||n!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+r||0,e.summary.deletions=+n||0,!0):!1),new S(ts,(e,[t,r])=>{$(e.files,r),$(t==="create"?e.created:e.deleted,r)})],Di=[new S(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new S(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new S(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,r,n,s])=>{e.branch.local=n,e.hash.local=t,e.branch.remote=s,e.hash.remote=r})],rs=(e,t)=>lt(new Pr,es,[e,t]),sn=(e,t)=>Object.assign(new Pr,rs(e,t),Ri(e,t))}}),ns,Li,ss,tc=d({"src/lib/parsers/parse-merge.ts"(){"use strict";Ku(),O(),Ii(),ns=[new S(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new S(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,r])=>{e.conflicts.push(new xe(t,r))}),new S(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,r,n])=>{e.conflicts.push(new xe(t,r,{deleteRef:n}))}),new S(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new xe(t,null))}),new S(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],Li=(e,t)=>Object.assign(ss(e,t),sn(e,t)),ss=e=>lt(new Ai,ns,e)}});function is(e){return e.length?{commands:["merge",...e],format:"utf-8",parser(t,r){let n=Li(t,r);if(n.failed)throw new se(n);return n}}:ct("Git.merge requires at least one option")}var ec=d({"src/lib/tasks/merge.ts"(){"use strict";Yt(),tc(),W()}});function rc(e,t,r){let n=r.includes("deleted"),s=r.includes("tag")||/^refs\/tags/.test(e),i=!r.includes("new");return{deleted:n,tag:s,branch:!s,new:!i,alreadyUpdated:i,local:e,remote:t}}var os,ji,as,nc=d({"src/lib/parsers/parse-push.ts"(){"use strict";O(),Pi(),os=[new S(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new S(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref=Xt(gt({},e.ref||{}),{local:t})}),new S(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,r,n])=>{e.pushed.push(rc(t,r,n))}),new S(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,r,n])=>{e.branch=Xt(gt({},e.branch||{}),{local:t,remote:r,remoteName:n})}),new S(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,r,n,s])=>{e.update={head:{local:t,remote:r},hash:{from:n,to:s}}})],ji=(e,t)=>{let r=as(e,t),n=Ri(e,t);return gt(gt({},r),n)},as=(e,t)=>lt({pushed:[]},os,[e,t])}}),Ni={};q(Ni,{pushTagsTask:()=>sc,pushTask:()=>on});function sc(e={},t){return $(t,"--tags"),on(e,t)}function on(e={},t){let r=["push",...t];return e.branch&&r.splice(1,0,e.branch),e.remote&&r.splice(1,0,e.remote),Pe(r,"-v"),$(r,"--verbose"),$(r,"--porcelain"),{commands:r,format:"utf-8",parser:ji}}var Hi=d({"src/lib/tasks/push.ts"(){"use strict";nc(),O()}});function ic(){return{showBuffer(){let e=["show",...ut(arguments,1)];return e.includes("--binary")||e.splice(1,0,"--binary"),this._runTask(zs(e),V(arguments))},show(){let e=["show",...ut(arguments,1)];return this._runTask(it(e),V(arguments))}}}var oc=d({"src/lib/tasks/show.ts"(){"use strict";O(),W()}}),us,Bi,ac=d({"src/lib/responses/FileStatusSummary.ts"(){"use strict";us=/^(.+)\0(.+)$/,Bi=class{constructor(e,t,r){if(this.path=e,this.index=t,this.working_dir=r,t==="R"||r==="R"){let n=us.exec(e)||[null,e,e];this.from=n[2]||"",this.path=n[1]||""}}}}});function cs(e){let[t,r]=e.split(zt);return{from:r||t,to:t}}function pt(e,t,r){return[`${e}${t}`,r]}function kr(e,...t){return t.map(r=>pt(e,r,(n,s)=>$(n.conflicted,s)))}function uc(e,t){let r=t.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return n(" ",r.charAt(0),r.substr(2));default:return}function n(s,i,o){let a=`${s}${i}`,h=Gi.get(a);h&&h(e,o),a!=="##"&&a!=="!!"&&e.files.push(new Bi(o,s,i))}}var ls,Gi,Vi,cc=d({"src/lib/responses/StatusSummary.ts"(){"use strict";O(),ac(),ls=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},Gi=new Map([pt(" ","A",(e,t)=>$(e.created,t)),pt(" ","D",(e,t)=>$(e.deleted,t)),pt(" ","M",(e,t)=>$(e.modified,t)),pt("A"," ",(e,t)=>$(e.created,t)&&$(e.staged,t)),pt("A","M",(e,t)=>$(e.created,t)&&$(e.staged,t)&&$(e.modified,t)),pt("D"," ",(e,t)=>$(e.deleted,t)&&$(e.staged,t)),pt("M"," ",(e,t)=>$(e.modified,t)&&$(e.staged,t)),pt("M","M",(e,t)=>$(e.modified,t)&&$(e.staged,t)),pt("R"," ",(e,t)=>{$(e.renamed,cs(t))}),pt("R","M",(e,t)=>{let r=cs(t);$(e.renamed,r),$(e.modified,r.to)}),pt("!","!",(e,t)=>{$(e.ignored=e.ignored||[],t)}),pt("?","?",(e,t)=>$(e.not_added,t)),...kr("A","A","U"),...kr("D","D","U"),...kr("U","A","D","U"),["##",(e,t)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,s=/^(.+?(?=(?:\.{3}|\s|$)))/,i=/\.{3}(\S*)/,o=/\son\s([\S]+)$/,a;a=r.exec(t),e.ahead=a&&+a[1]||0,a=n.exec(t),e.behind=a&&+a[1]||0,a=s.exec(t),e.current=a&&a[1],a=i.exec(t),e.tracking=a&&a[1],a=o.exec(t),e.current=a&&a[1]||e.current,e.detached=/\(no branch\)/.test(t)}]]),Vi=function(e){let t=e.split(zt),r=new ls;for(let n=0,s=t.length;n<s;){let i=t[n++].trim();i&&(i.charAt(0)==="R"&&(i+=zt+(t[n++]||"")),uc(r,i))}return r}}});function lc(e){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter(r=>!Wi.includes(r))],parser(r){return Vi(r)}}}var Wi,hc=d({"src/lib/tasks/status.ts"(){"use strict";cc(),Wi=["--null","-z"]}});function $e(e=0,t=0,r=0,n="",s=!0){return Object.defineProperty({major:e,minor:t,patch:r,agent:n,installed:s},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function fc(){return $e(0,0,0,"",!1)}function pc(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:mc,onError(e,t,r,n){if(e.exitCode===-2)return r(Buffer.from(an));n(t)}})}}}function mc(e){return e===an?fc():lt($e(0,0,0,e),qi,e)}var an,qi,dc=d({"src/lib/tasks/version.ts"(){"use strict";O(),an="installed=false",qi=[new S(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,r,n,s=""])=>{Object.assign(e,$e(L(t),L(r),L(n),s))}),new S(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,r,n,s=""])=>{Object.assign(e,$e(L(t),L(r),n,s))})]}}),Ui={};q(Ui,{SimpleGitApi:()=>Dr});var Dr,gc=d({"src/lib/simple-git-api.ts"(){"use strict";Cu(),wu(),Ou(),Su(),Fu(),ei(),Pu(),oi(),Iu(),Bu(),Si(),ec(),Hi(),oc(),hc(),W(),dc(),O(),Dr=class{constructor(e){this._executor=e}_runTask(e,t){let r=this._executor.chain(),n=r.push(e);return t&&yu(e,n,t),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(e){return this._runTask(it(["add",...vt(e)]),V(arguments))}cwd(e){let t=V(arguments);return typeof e=="string"?this._runTask(zn(e,this._executor),t):typeof e?.path=="string"?this._runTask(zn(e.path,e.root&&this._executor||void 0),t):this._runTask(ct("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(Du(e,t===!0),V(arguments))}init(e){return this._runTask(Hu(e===!0,this._executor.cwd,ut(arguments)),V(arguments))}merge(){return this._runTask(is(ut(arguments)),V(arguments))}mergeFromTo(e,t){return et(e)&&et(t)?this._runTask(is([e,t,...ut(arguments)]),V(arguments,!1)):this._runTask(ct("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=on({remote:Ct(arguments[0],et),branch:Ct(arguments[1],et)},ut(arguments));return this._runTask(e,V(arguments))}stash(){return this._runTask(it(["stash",...ut(arguments)]),V(arguments))}status(){return this._runTask(lc(ut(arguments)),V(arguments))}},Object.assign(Dr.prototype,ku(),Ru(),iu(),xu(),Mu(),cu(),Ju(),ic(),pc())}}),zi={};q(zi,{Scheduler:()=>Ji});var hs,Ji,_c=d({"src/lib/runners/scheduler.ts"(){"use strict";O(),hi(),hs=(()=>{let e=0;return()=>{e++;let{promise:t,done:r}=(0,Yi.createDeferred)();return{promise:t,done:r,id:e}}})(),Ji=class{constructor(e=2){this.concurrency=e,this.logger=Kr("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let e=$(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),Pe(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=$(this.pending,hs());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),Ki={};q(Ki,{applyPatchTask:()=>bc});function bc(e,t){return it(["apply",...t,...e])}var yc=d({"src/lib/tasks/apply-patch.ts"(){"use strict";W()}});function vc(e,t){return{branch:e,hash:t,success:!0}}function Cc(e){return{branch:e,hash:null,success:!1}}var Qi,wc=d({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";Qi=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function Zi(e,t){return t===1&&Ir.test(e)}var fs,Ir,ps,Ne,kc=d({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";wc(),O(),fs=/(\S+)\s+\(\S+\s([^)]+)\)/,Ir=/^error[^']+'([^']+)'/m,ps=[new S(fs,(e,[t,r])=>{let n=vc(t,r);e.all.push(n),e.branches[t]=n}),new S(Ir,(e,[t])=>{let r=Cc(t);e.errors.push(r),e.all.push(r),e.branches[t]=r})],Ne=(e,t)=>lt(new Qi,ps,[e,t])}}),Xi,Oc=d({"src/lib/responses/BranchSummary.ts"(){"use strict";Xi=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,r,n,s){e==="*"&&(this.detached=t,this.current=r),this.all.push(r),this.branches[r]={current:e==="*",linkedWorkTree:e==="+",name:r,commit:n,label:s}}}}});function ms(e){return e?e.charAt(0):""}function to(e){return lt(new Xi,eo,e)}var eo,Tc=d({"src/lib/parsers/parse-branch.ts"(){"use strict";Oc(),O(),eo=[new S(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,r,n,s])=>{e.push(ms(t),!0,r,n,s)}),new S(new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$","s"),(e,[t,r,n,s])=>{e.push(ms(t),!1,r,n,s)})]}}),ro={};q(ro,{branchLocalTask:()=>Sc,branchTask:()=>xc,containsDeleteBranchCommand:()=>no,deleteBranchTask:()=>Ec,deleteBranchesTask:()=>Ac});function no(e){let t=["-d","-D","--delete"];return e.some(r=>t.includes(r))}function xc(e){let t=no(e),r=["branch",...e];return r.length===1&&r.push("-a"),r.includes("-v")||r.splice(1,0,"-v"),{format:"utf-8",commands:r,parser(n,s){return t?Ne(n,s).all[0]:to(n)}}}function Sc(){return{format:"utf-8",commands:["branch","-v"],parser:to}}function Ac(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser(r,n){return Ne(r,n)},onError({exitCode:r,stdOut:n},s,i,o){if(!Zi(String(s),r))return o(s);i(n)}}}function Ec(e,t=!1){let r={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser(n,s){return Ne(n,s).branches[e]},onError({exitCode:n,stdErr:s,stdOut:i},o,a,h){if(!Zi(String(o),n))return h(o);throw new se(r.parser(ee(i),ee(s)),String(o))}};return r}var $c=d({"src/lib/tasks/branch.ts"(){"use strict";Yt(),kc(),Tc(),O()}}),so,Rc=d({"src/lib/responses/CheckIgnore.ts"(){"use strict";so=e=>e.split(/\n/g).map(t=>t.trim()).filter(t=>!!t)}}),io={};q(io,{checkIgnoreTask:()=>Fc});function Fc(e){return{commands:["check-ignore",...e],format:"utf-8",parser:so}}var Mc=d({"src/lib/tasks/check-ignore.ts"(){"use strict";Rc()}}),oo={};q(oo,{cloneMirrorTask:()=>Dc,cloneTask:()=>ao});function Pc(e){return/^--upload-pack(=|$)/.test(e)}function ao(e,t,r){let n=["clone",...r];return et(e)&&n.push(e),et(t)&&n.push(t),n.find(Pc)?ct("git.fetch: potential exploit argument blocked."):it(n)}function Dc(e,t,r){return $(r,"--mirror"),ao(e,t,r)}var Ic=d({"src/lib/tasks/clone.ts"(){"use strict";W(),O()}});function Lc(e,t){return lt({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},uo,[e,t])}var uo,jc=d({"src/lib/parsers/parse-fetch.ts"(){"use strict";O(),uo=[new S(/From (.+)$/,(e,[t])=>{e.remote=t}),new S(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.branches.push({name:t,tracking:r})}),new S(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.tags.push({name:t,tracking:r})}),new S(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new S(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,r,n,s])=>{e.updated.push({name:n,tracking:s,to:r,from:t})})]}}),co={};q(co,{fetchTask:()=>Hc});function Nc(e){return/^--upload-pack(=|$)/.test(e)}function Hc(e,t,r){let n=["fetch",...r];return e&&t&&n.push(e,t),n.find(Nc)?ct("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:Lc}}var Bc=d({"src/lib/tasks/fetch.ts"(){"use strict";jc(),W()}});function Gc(e){return lt({moves:[]},lo,e)}var lo,Vc=d({"src/lib/parsers/parse-move.ts"(){"use strict";O(),lo=[new S(/^Renaming (.+) to (.+)$/,(e,[t,r])=>{e.moves.push({from:t,to:r})})]}}),ho={};q(ho,{moveTask:()=>Wc});function Wc(e,t){return{commands:["mv","-v",...vt(e),t],format:"utf-8",parser:Gc}}var qc=d({"src/lib/tasks/move.ts"(){"use strict";Vc(),O()}}),fo={};q(fo,{pullTask:()=>Uc});function Uc(e,t,r){let n=["pull",...r];return e&&t&&n.splice(1,0,e,t),{commands:n,format:"utf-8",parser(s,i){return sn(s,i)},onError(s,i,o,a){let h=Xu(ee(s.stdOut),ee(s.stdErr));if(h)return a(new se(h));a(i)}}}var zc=d({"src/lib/tasks/pull.ts"(){"use strict";Yt(),Ii(),O()}});function Yc(e){let t={};return po(e,([r])=>t[r]={name:r}),Object.values(t)}function Jc(e){let t={};return po(e,([r,n,s])=>{t.hasOwnProperty(r)||(t[r]={name:r,refs:{fetch:"",push:""}}),s&&n&&(t[r].refs[s.replace(/[^a-z]/g,"")]=n)}),Object.values(t)}function po(e,t){jr(e,r=>t(r.split(/\s+/)))}var Kc=d({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";O()}}),mo={};q(mo,{addRemoteTask:()=>Qc,getRemotesTask:()=>Zc,listRemotesTask:()=>Xc,remoteTask:()=>tl,removeRemoteTask:()=>el});function Qc(e,t,r){return it(["remote","add",...r,e,t])}function Zc(e){let t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?Jc:Yc}}function Xc(e){let t=[...e];return t[0]!=="ls-remote"&&t.unshift("ls-remote"),it(t)}function tl(e){let t=[...e];return t[0]!=="remote"&&t.unshift("remote"),it(t)}function el(e){return it(["remote","remove",e])}var rl=d({"src/lib/tasks/remote.ts"(){"use strict";Kc(),W()}}),go={};q(go,{stashListTask:()=>nl});function nl(e={},t){let r=xi(e),n=["stash","list",...r.commands,...t],s=wi(r.splitter,r.fields,Zr(n));return je(n)||{commands:n,format:"utf-8",parser:s}}var sl=d({"src/lib/tasks/stash-list.ts"(){"use strict";ue(),Oi(),nn(),Si()}}),_o={};q(_o,{addSubModuleTask:()=>il,initSubModuleTask:()=>ol,subModuleTask:()=>He,updateSubModuleTask:()=>al});function il(e,t){return He(["add",e,t])}function ol(e){return He(["init",...e])}function He(e){let t=[...e];return t[0]!=="submodule"&&t.unshift("submodule"),it(t)}function al(e){return He(["update",...e])}var ul=d({"src/lib/tasks/sub-module.ts"(){"use strict";W()}});function cl(e,t){let r=isNaN(e),n=isNaN(t);return r!==n?r?1:-1:r?bo(e,t):0}function bo(e,t){return e===t?0:e>t?1:-1}function ll(e){return e.trim()}function we(e){return typeof e=="string"&&parseInt(e.replace(/^\D+/g,""),10)||0}var ds,yo,hl=d({"src/lib/responses/TagList.ts"(){"use strict";ds=class{constructor(e,t){this.all=e,this.latest=t}},yo=function(e,t=!1){let r=e.split(`
35
- `).map(ll).filter(Boolean);t||r.sort(function(s,i){let o=s.split("."),a=i.split(".");if(o.length===1||a.length===1)return cl(we(o[0]),we(a[0]));for(let h=0,l=Math.max(o.length,a.length);h<l;h++){let c=bo(we(o[h]),we(a[h]));if(c)return c}return 0});let n=t?r[0]:[...r].reverse().find(s=>s.indexOf(".")>=0);return new ds(r,n)}}}),vo={};q(vo,{addAnnotatedTagTask:()=>ml,addTagTask:()=>pl,tagListTask:()=>fl});function fl(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return yo(r,t)}}}function pl(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function ml(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var dl=d({"src/lib/tasks/tag.ts"(){"use strict";hl()}}),gl=Fa({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(bu(),G(fi)),{SimpleGitApi:n}=(gc(),G(Ui)),{Scheduler:s}=(_c(),G(zi)),{configurationErrorTask:i}=(W(),G(Er)),{asArray:o,filterArray:a,filterPrimitives:h,filterString:l,filterStringOrStringArray:c,filterType:u,getTrailingOptions:f,trailingFunctionArgument:p,trailingOptionsArgument:A}=(O(),G(Ls)),{applyPatchTask:M}=(yc(),G(Ki)),{branchTask:I,branchLocalTask:j,deleteBranchesTask:K,deleteBranchTask:U}=($c(),G(ro)),{checkIgnoreTask:J}=(Mc(),G(io)),{checkIsRepoTask:mt}=(Bs(),G(js)),{cloneTask:rt,cloneMirrorTask:ht}=(Ic(),G(oo)),{cleanWithOptionsTask:F,isCleanOptionsArray:E}=(Zs(),G(Ks)),{diffSummaryTask:Ht}=(nn(),G(Ti)),{fetchTask:le}=(Bc(),G(co)),{moveTask:k}=(qc(),G(ho)),{pullTask:b}=(zc(),G(fo)),{pushTagsTask:g}=(Hi(),G(Ni)),{addRemoteTask:v,getRemotesTask:_,listRemotesTask:T,remoteTask:x,removeRemoteTask:P}=(rl(),G(mo)),{getResetMode:N,resetTask:z}=(li(),G(ai)),{stashListTask:Q}=(sl(),G(go)),{addSubModuleTask:ot,initSubModuleTask:$t,subModuleTask:kt,updateSubModuleTask:Mt}=(ul(),G(_o)),{addAnnotatedTagTask:Ot,addTagTask:X,tagListTask:yt}=(dl(),G(vo)),{straightThroughBufferTask:Pt,straightThroughStringTask:nt}=(W(),G(Er));function C(m,y){this._plugins=y,this._executor=new r(m.baseDir,new s(m.maxConcurrentProcesses),y),this._trimmed=m.trimmed}(C.prototype=Object.create(n.prototype)).constructor=C,C.prototype.customBinary=function(m){return this._plugins.reconfigure("binary",m),this},C.prototype.env=function(m,y){return arguments.length===1&&typeof m=="object"?this._executor.env=m:(this._executor.env=this._executor.env||{})[m]=y,this},C.prototype.stashList=function(m){return this._runTask(Q(A(arguments)||{},a(m)&&m||[]),p(arguments))};function ln(m,y,D,st){return typeof D!="string"?i(`git.${m}() requires a string 'repoPath'`):y(D,u(st,l),f(arguments))}C.prototype.clone=function(){return this._runTask(ln("clone",rt,...arguments),p(arguments))},C.prototype.mirror=function(){return this._runTask(ln("mirror",ht,...arguments),p(arguments))},C.prototype.mv=function(m,y){return this._runTask(k(m,y),p(arguments))},C.prototype.checkoutLatestTag=function(m){var y=this;return this.pull(function(){y.tags(function(D,st){y.checkout(st.latest,m)})})},C.prototype.pull=function(m,y,D,st){return this._runTask(b(u(m,l),u(y,l),f(arguments)),p(arguments))},C.prototype.fetch=function(m,y){return this._runTask(le(u(m,l),u(y,l),f(arguments)),p(arguments))},C.prototype.silent=function(m){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},C.prototype.tags=function(m,y){return this._runTask(yt(f(arguments)),p(arguments))},C.prototype.rebase=function(){return this._runTask(nt(["rebase",...f(arguments)]),p(arguments))},C.prototype.reset=function(m){return this._runTask(z(N(m),f(arguments)),p(arguments))},C.prototype.revert=function(m){let y=p(arguments);return typeof m!="string"?this._runTask(i("Commit must be a string"),y):this._runTask(nt(["revert",...f(arguments,0,!0),m]),y)},C.prototype.addTag=function(m){let y=typeof m=="string"?X(m):i("Git.addTag requires a tag name");return this._runTask(y,p(arguments))},C.prototype.addAnnotatedTag=function(m,y){return this._runTask(Ot(m,y),p(arguments))},C.prototype.deleteLocalBranch=function(m,y,D){return this._runTask(U(m,typeof y=="boolean"?y:!1),p(arguments))},C.prototype.deleteLocalBranches=function(m,y,D){return this._runTask(K(m,typeof y=="boolean"?y:!1),p(arguments))},C.prototype.branch=function(m,y){return this._runTask(I(f(arguments)),p(arguments))},C.prototype.branchLocal=function(m){return this._runTask(j(),p(arguments))},C.prototype.raw=function(m){let y=!Array.isArray(m),D=[].slice.call(y?arguments:m,0);for(let _t=0;_t<D.length&&y;_t++)if(!h(D[_t])){D.splice(_t,D.length-_t);break}D.push(...f(arguments,0,!0));var st=p(arguments);return D.length?this._runTask(nt(D,this._trimmed),st):this._runTask(i("Raw: must supply one or more command to execute"),st)},C.prototype.submoduleAdd=function(m,y,D){return this._runTask(ot(m,y),p(arguments))},C.prototype.submoduleUpdate=function(m,y){return this._runTask(Mt(f(arguments,!0)),p(arguments))},C.prototype.submoduleInit=function(m,y){return this._runTask($t(f(arguments,!0)),p(arguments))},C.prototype.subModule=function(m,y){return this._runTask(kt(f(arguments)),p(arguments))},C.prototype.listRemote=function(){return this._runTask(T(f(arguments)),p(arguments))},C.prototype.addRemote=function(m,y,D){return this._runTask(v(m,y,f(arguments)),p(arguments))},C.prototype.removeRemote=function(m,y){return this._runTask(P(m),p(arguments))},C.prototype.getRemotes=function(m,y){return this._runTask(_(m===!0),p(arguments))},C.prototype.remote=function(m,y){return this._runTask(x(f(arguments)),p(arguments))},C.prototype.tag=function(m,y){let D=f(arguments);return D[0]!=="tag"&&D.unshift("tag"),this._runTask(nt(D),p(arguments))},C.prototype.updateServerInfo=function(m){return this._runTask(nt(["update-server-info"]),p(arguments))},C.prototype.pushTags=function(m,y){let D=g({remote:u(m,l)},f(arguments));return this._runTask(D,p(arguments))},C.prototype.rm=function(m){return this._runTask(nt(["rm","-f",...o(m)]),p(arguments))},C.prototype.rmKeepLocal=function(m){return this._runTask(nt(["rm","--cached",...o(m)]),p(arguments))},C.prototype.catFile=function(m,y){return this._catFile("utf-8",arguments)},C.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},C.prototype._catFile=function(m,y){var D=p(y),st=["cat-file"],_t=y[0];if(typeof _t=="string")return this._runTask(i("Git.catFile: options must be supplied as an array of strings"),D);Array.isArray(_t)&&st.push.apply(st,_t);let Ge=m==="buffer"?Pt(st):nt(st);return this._runTask(Ge,D)},C.prototype.diff=function(m,y){let D=l(m)?i("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):nt(["diff",...f(arguments)]);return this._runTask(D,p(arguments))},C.prototype.diffSummary=function(){return this._runTask(Ht(f(arguments,1)),p(arguments))},C.prototype.applyPatch=function(m){let y=c(m)?M(o(m),f([].slice.call(arguments,1))):i("git.applyPatch requires one or more string patches as the first argument");return this._runTask(y,p(arguments))},C.prototype.revparse=function(){let m=["rev-parse",...f(arguments,!0)];return this._runTask(nt(m,!0),p(arguments))},C.prototype.clean=function(m,y,D){let st=E(m),_t=st&&m.join("")||u(m,l)||"",Ge=f([].slice.call(arguments,st?1:0));return this._runTask(F(_t,Ge),p(arguments))},C.prototype.exec=function(m){let y={commands:[],format:"utf-8",parser(){typeof m=="function"&&m()}};return this._runTask(y)},C.prototype.clearQueue=function(){return this},C.prototype.checkIgnore=function(m,y){return this._runTask(J(o(u(m,c,[]))),p(arguments))},C.prototype.checkIsRepo=function(m,y){return this._runTask(mt(u(m,l)),p(arguments))},t.exports=C}});ne();Ft();var _l=class extends Et{constructor(e,t){super(void 0,t),this.config=e}};Ft();Ft();var At=class extends Et{constructor(e,t,r){super(e,r),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};Yt();ws();Bs();Zs();ei();ni();oi();li();function bl(e){return e?[{type:"spawn.before",action(n,s){e.aborted&&s.kill(new At(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,s){function i(){s.kill(new At(void 0,"abort","Abort signal received"))}e.addEventListener("abort",i),s.spawned.on("close",()=>e.removeEventListener("abort",i))}}]:void 0}function yl(e){return typeof e=="string"&&e.trim().toLowerCase()==="-c"}function vl(e,t){if(yl(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new At(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function Cl(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new At(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(t==="clone"&&/^\s*-u\b/.test(e))throw new At(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(t==="push"&&/^\s*--exec\b/.test(e))throw new At(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function wl({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:"spawn.args",action(r,n){return r.forEach((s,i)=>{let o=i<r.length?r[i+1]:"";e||vl(s,o),t||Cl(s,n.method)}),r}}}O();function kl(e){let t=te(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}O();var gs=(0,Ut.deferred)().promise;function Ol({onClose:e=!0,onExit:t=50}={}){function r(){let s=-1,i={close:(0,Ut.deferred)(),closeTimeout:(0,Ut.deferred)(),exit:(0,Ut.deferred)(),exitTimeout:(0,Ut.deferred)()},o=Promise.race([e===!1?gs:i.closeTimeout.promise,t===!1?gs:i.exitTimeout.promise]);return n(e,i.close,i.closeTimeout),n(t,i.exit,i.exitTimeout),{close(a){s=a,i.close.done()},exit(a){s=a,i.exit.done()},get exitCode(){return s},result:o}}function n(s,i,o){s!==!1&&(s===!0?i.promise:i.promise.then(()=>Or(s))).then(o.done)}return{type:"spawn.after",action(s,i){return Zt(this,arguments,function*(o,{spawned:a,close:h}){var l,c;let u=r(),f=!0,p=()=>void(f=!1);(l=a.stdout)==null||l.on("data",p),(c=a.stderr)==null||c.on("data",p),a.on("error",p),a.on("close",A=>u.close(A)),a.on("exit",A=>u.exit(A));try{yield u.result,f&&(yield Or(50)),h(u.exitCode)}catch(A){h(u.exitCode,A)}})}}}O();var Tl="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",_s="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function xl(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function bs(e,t){if(e.length<1||e.length>2)throw new At(void 0,"binary",Tl);if(e.some(xl))if(t)console.warn(_s);else throw new At(void 0,"binary",_s);let[n,s]=e;return{binary:n,prefix:s}}function Sl(e,t=["git"],r=!1){let n=bs(vt(t),r);e.on("binary",s=>{n=bs(vt(s),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",s=>n.prefix?[n.prefix,...s]:s)}Ft();function Al(e){return!!(e.exitCode&&e.stdErr.length)}function El(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function $l(e=!1,t=Al,r=El){return(n,s)=>!e&&n||!t(s)?n:r(s)}function ys(e){return{type:"task.error",action(t,r){let n=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new Et(void 0,n.toString("utf-8"))}:{error:n}}}}O();var Fl=class{constructor(){this.plugins=new Set,this.events=new Rl}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=$(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return vt(e).forEach(r=>r&&this.plugins.add($(t,r))),()=>{t.forEach(r=>this.plugins.delete(r))}}exec(e,t,r){let n=t,s=Object.freeze(Object.create(r));for(let i of this.plugins)i.type===e&&(n=i.action(n,s));return n}};O();function Ml(e){let t="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(i,o){return r.includes(o.method)?As(i,t):i}},{type:"spawn.after",action(i,o){var a;o.commands.includes(t)&&((a=o.spawned.stderr)==null||a.on("data",h=>{let l=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(h.toString("utf8"));l&&e({method:o.method,stage:Pl(l[1]),progress:L(l[2]),processed:L(l[3]),total:L(l[4])})}))}}]}function Pl(e){return String(e.toLowerCase().split(" ",1))||"unknown"}O();function Dl(e){let t=Rs(e,["uid","gid"]);return{type:"spawn.options",action(r){return gt(gt({},t),r)}}}function Il({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,s){var i,o;let a;function h(){a&&clearTimeout(a),a=setTimeout(c,e)}function l(){var u,f;(u=s.spawned.stdout)==null||u.off("data",h),(f=s.spawned.stderr)==null||f.off("data",h),s.spawned.off("exit",l),s.spawned.off("close",l),a&&clearTimeout(a)}function c(){l(),s.kill(new At(void 0,"timeout","block timeout reached"))}r&&((i=s.spawned.stdout)==null||i.on("data",h)),t&&((o=s.spawned.stderr)==null||o.on("data",h)),s.spawned.on("exit",l),s.spawned.on("close",l),h()}}}ne();function Ll(){return{type:"spawn.args",action(e){let t=[],r;function n(s){(r=r||[]).push(...s)}for(let s=0;s<e.length;s++){let i=e[s];if(Se(i)){n(Vn(i));continue}if(i==="--"){n(e.slice(s+1).flatMap(o=>Se(o)&&Vn(o)||o));break}t.push(i)}return r?[...t,"--",...r.map(String)]:t}}}O();var jl=gl();function Nl(e,t){var r;let n=new Fl,s=Ds(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!Nr(s.baseDir))throw new _l(s,"Cannot use simple-git on a directory that does not exist");return Array.isArray(s.config)&&n.add(kl(s.config)),n.add(wl(s.unsafe)),n.add(Ll()),n.add(Ol(s.completion)),s.abort&&n.add(bl(s.abort)),s.progress&&n.add(Ml(s.progress)),s.timeout&&n.add(Il(s.timeout)),s.spawnOptions&&n.add(Dl(s.spawnOptions)),n.add(ys($l(!0))),s.errors&&n.add(ys(s.errors)),Sl(n,s.binary,(r=s.unsafe)==null?void 0:r.allowUnsafeCustomBinary),new jl(s,n)}Yt();var Co=Nl;var ko="@lntvow/dev",Oo="4.4.1";w();var un=xt(ar(),1);import ce from"fs";import Be from"path";import{fileURLToPath as Hl}from"url";var Bl=Hl(import.meta.url),Gl=Be.dirname(Bl);function To(e,t){ce.existsSync(t)||ce.mkdirSync(t),ce.readdirSync(e,{withFileTypes:!0}).forEach(n=>{let s=Be.resolve(e,n.name),i=Be.resolve(t,n.name);if(n.isDirectory())To(s,i);else{if(ce.existsSync(i))return;ce.copyFileSync(s,i)}})}function xo(){console.log(un.default.blue("Start copying template files")),To(Be.resolve(Gl,"./configs"),process.cwd()),console.log(un.default.green("Template files copied successfully"))}cn.default.extend(So.default);console.log(wt.default.blue(`Cwd is ${process.cwd()}`));Kt.name(ko).version(Oo,"-v, --version","output the version number");Kt.command("init").option("-t, --temp","copy template files",!0).option("--no-temp","not copy template files").option("-g, --git","init simple-git-hooks",!0).option("--no-git","not init simple-git-hooks").option("-s, --scripts","init scripts",!0).option("--no-scripts","not init scripts").description("init project").action(e=>{console.log(wt.default.green("Init project by @lntvow/dev"));let{temp:t,git:r,scripts:n}=e;if(t&&xo(),r){console.log(wt.default.blue("Start init simple-git-hooks"));let s=Vl("npx simple-git-hooks");console.log(s.toString())}if(n){console.log(wt.default.blue("Start init scripts"));try{let s=Ul(process.cwd(),"package.json"),i=JSON.parse(Wl(s,"utf-8"));i={...i,scripts:{postinstall:"simple-git-hooks",rimraf:"rimraf ./node_modules/",commit:"git add . && git-cz && git push",release:"git add . && bumpp package.json --all --no-tag --no-print-commits","lint:eslint":'eslint "src/**/*.{js,jsx,ts,tsx,vue}" --fix',"lint:tsc":"tsc --noEmit",lint:"run-p lint:eslint lint:tsc",ncu:"ncu -u && pnpm install",...i.scripts}},ql(s,JSON.stringify(i,null,2)),console.log(wt.default.green("Scripts added successfully"))}catch{console.log(wt.default.yellow("No package.json file found ignoring scripts"))}}console.log(wt.default.yellow(`
36
- You may need to re-execute the "pnpm install" command`))});Kt.command("release").description("git release").action(async()=>{console.log(wt.default.green("Release project...")),await zl()});Kt.parse();async function zl(){let e=Co(),t=(0,cn.default)().format("YYYYMMDD");await e.cwd(process.cwd()),await e.pull(),await e.add("."),await e.commit(t,"--no-verify"),await e.push("origin"),console.log(wt.default.green(`Changes committed with message: ${t}`))}
29
+ `+i),e.push(s+"m+"+de.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=fa()+t+" "+e[0]}function fa(){return Z.inspectOpts.hideDate?"":new Date().toISOString()+" "}function pa(...e){return process.stderr.write(me.formatWithOptions(Z.inspectOpts,...e)+`
30
+ `)}function ma(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function da(){return process.env.DEBUG}function ga(e){e.inspectOpts={};let t=Object.keys(Z.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=Z.inspectOpts[t[r]]}de.exports=ur()(Z);var{formatters:Mn}=de.exports;Mn.o=function(e){return this.inspectOpts.colors=this.useColors,me.inspect(e,this.inspectOpts).split(`
31
+ `).map(t=>t.trim()).join(" ")};Mn.O=function(e){return this.inspectOpts.colors=this.useColors,me.inspect(e,this.inspectOpts)}});var hr=Y((Dh,lr)=>{"use strict";w();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?lr.exports=An():lr.exports=Dn()});var Pn=Y(ft=>{"use strict";w();var _a=ft&&ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ft,"__esModule",{value:!0});var ba=Ot("fs"),ya=_a(hr()),Wt=ya.default("@kwsites/file-exists");function va(e,t,r){Wt("checking %s",e);try{let n=ba.statSync(e);return n.isFile()&&t?(Wt("[OK] path represents a file"),!0):n.isDirectory()&&r?(Wt("[OK] path represents a directory"),!0):(Wt("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return Wt("[FAIL] path is not accessible: %o",n),!1;throw Wt("[FATAL] %o",n),n}}function Ca(e,t=ft.READABLE){return va(e,(t&ft.FILE)>0,(t&ft.FOLDER)>0)}ft.exists=Ca;ft.FILE=1;ft.FOLDER=2;ft.READABLE=ft.FILE+ft.FOLDER});var In=Y(ge=>{"use strict";w();function wa(e){for(var t in e)ge.hasOwnProperty(t)||(ge[t]=e[t])}Object.defineProperty(ge,"__esModule",{value:!0});wa(Pn())});var pr=Y(Pt=>{"use strict";w();Object.defineProperty(Pt,"__esModule",{value:!0});Pt.createDeferred=Pt.deferred=void 0;function fr(){let e,t,r="pending";return{promise:new Promise((s,i)=>{e=s,t=i}),done(s){r==="pending"&&(r="resolved",e(s))},fail(s){r==="pending"&&(r="rejected",t(s))},get fulfilled(){return r!=="pending"},get status(){return r}}}Pt.deferred=fr;Pt.createDeferred=fr;Pt.default=fr});w();import{execSync as Ll}from"child_process";import{readFileSync as jl,writeFileSync as Nl}from"fs";import{resolve as Hl}from"path";w();var vn=Tt(yn(),1),{program:Jt,createCommand:uh,createArgument:ch,createOption:lh,CommanderError:hh,InvalidArgumentError:fh,InvalidOptionArgumentError:ph,Command:mh,Argument:dh,Option:gh,Help:_h}=vn.default;var Ct=Tt(nr(),1),sn=Tt(kn(),1),wo=Tt(On(),1);w();var Ae=Tt(In(),1),Te=Tt(hr(),1),Vi=Tt(pr(),1),qt=Tt(pr(),1);import{Buffer as Aa}from"buffer";import{spawn as cu}from"child_process";import{EventEmitter as Tl}from"events";var Dr=Object.defineProperty,ka=Object.getOwnPropertyDescriptor,Pr=Object.getOwnPropertyNames,Oa=Object.prototype.hasOwnProperty,d=(e,t)=>function(){return e&&(t=(0,e[Pr(e)[0]])(e=0)),t},Ta=(e,t)=>function(){return t||(0,e[Pr(e)[0]])((t={exports:{}}).exports,t),t.exports},q=(e,t)=>{for(var r in t)Dr(e,r,{get:t[r],enumerable:!0})},xa=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Pr(t))!Oa.call(e,s)&&s!==r&&Dr(e,s,{get:()=>t[s],enumerable:!(n=ka(t,s))||n.enumerable});return e},G=e=>xa(Dr({},"__esModule",{value:!0}),e);function Sa(...e){let t=new String(e);return Se.set(t,e),t}function we(e){return e instanceof String&&Se.has(e)}function Ln(e){return Se.get(e)||[]}var Se,Xt=d({"src/lib/args/pathspec.ts"(){"use strict";Se=new WeakMap}}),At,Rt=d({"src/lib/errors/git-error.ts"(){"use strict";At=class extends Error{constructor(e,t){super(t),this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),te,zt=d({"src/lib/errors/git-response-error.ts"(){"use strict";Rt(),te=class extends At{constructor(e,t){super(void 0,t||String(e)),this.git=e}}}}),ms,ds=d({"src/lib/errors/task-configuration-error.ts"(){"use strict";Rt(),ms=class extends At{constructor(e){super(void 0,e)}}}});function gs(e){return typeof e!="function"?jt:e}function _s(e){return typeof e=="function"&&e!==jt}function bs(e,t){let r=e.indexOf(t);return r<=0?[e,""]:[e.substr(0,r),e.substr(r+1)]}function ys(e,t=0){return vs(e)&&e.length>t?e[t]:void 0}function Lt(e,t=0){if(vs(e)&&e.length>t)return e[e.length-1-t]}function vs(e){return!!(e&&typeof e.length=="number")}function ee(e="",t=!0,r=`
32
+ `){return e.split(r).reduce((n,s)=>{let i=t?s.trim():s;return i&&n.push(i),n},[])}function Ir(e,t){return ee(e,!0).map(r=>t(r))}function Lr(e){return(0,Ae.exists)(e,Ae.FOLDER)}function $(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function Cs(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function Ee(e,t){if(Array.isArray(e)){let r=e.indexOf(t);r>=0&&e.splice(r,1)}else e.delete(t);return t}function yt(e){return Array.isArray(e)?e:[e]}function ws(e){return e.replace(/[\s-]+(.)/g,(t,r)=>r.toUpperCase())}function ks(e){return yt(e).map(String)}function L(e,t=0){if(e==null)return t;let r=parseInt(e,10);return isNaN(r)?t:r}function Qt(e,t){let r=[];for(let n=0,s=e.length;n<s;n++)r.push(t,e[n]);return r}function Zt(e){return(Array.isArray(e)?Aa.concat(e):e).toString("utf-8")}function Os(e,t){return Object.assign({},...t.map(r=>r in e?{[r]:e[r]}:{}))}function vr(e=0){return new Promise(t=>setTimeout(t,e))}function Cr(e){if(e!==!1)return e}var Ut,jt,re,$e=d({"src/lib/utils/util.ts"(){"use strict";Ut="\0",jt=()=>{},re=Object.prototype.toString.call.bind(Object.prototype.toString)}});function vt(e,t,r){return t(e)?e:arguments.length>2?r:void 0}function wr(e,t){let r=we(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function Re(e){return!!e&&re(e)==="[object Object]"}function Ts(e){return typeof e=="function"}var ne,et,xs,ke,jr,Ss=d({"src/lib/utils/argument-filters.ts"(){"use strict";$e(),Xt(),ne=e=>Array.isArray(e),et=e=>typeof e=="string",xs=e=>Array.isArray(e)&&e.every(et),ke=e=>et(e)||Array.isArray(e)&&e.every(et),jr=e=>e==null||"number|boolean|function".includes(typeof e)?!1:Array.isArray(e)||typeof e=="string"||typeof e.length=="number"}}),kr,Ea=d({"src/lib/utils/exit-codes.ts"(){"use strict";kr=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(kr||{})}}),Oe,$a=d({"src/lib/utils/git-output-streams.ts"(){"use strict";Oe=class As{constructor(t,r){this.stdOut=t,this.stdErr=r}asStrings(){return new As(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),S,$t,Ra=d({"src/lib/utils/line-parser.ts"(){"use strict";S=class{constructor(e,t){this.matches=[],this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((s,i)=>this.addMatch(s,i,r(i)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}useMatches(e,t){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,r){let n=r&&e.exec(r);return n&&this.pushMatch(t,n),!!n}pushMatch(e,t){this.matches.push(...t.slice(1))}},$t=class extends S{addMatch(e,t,r){return/^remote:\s/.test(String(r))&&super.addMatch(e,t,r)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function Es(...e){let t=process.cwd(),r=Object.assign({baseDir:t,...$s},...e.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||t,r.trimmed=r.trimmed===!0,r}var $s,Fa=d({"src/lib/utils/simple-git-options.ts"(){"use strict";$s={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Nr(e,t=[]){return Re(e)?Object.keys(e).reduce((r,n)=>{let s=e[n];if(we(s))r.push(s);else if(wr(s,["boolean"]))r.push(n+"="+s);else if(Array.isArray(s))for(let i of s)wr(i,["string","number"])||r.push(n+"="+i);else r.push(n);return r},t):t}function ut(e,t=0,r=!1){let n=[];for(let s=0,i=t<0?e.length:t;s<i;s++)"string|number".includes(typeof e[s])&&n.push(String(e[s]));return Nr(Hr(e),n),r||n.push(...Ma(e)),n}function Ma(e){let t=typeof Lt(e)=="function";return vt(Lt(e,t?1:0),ne,[])}function Hr(e){let t=Ts(Lt(e));return vt(Lt(e,t?1:0),Re)}function V(e,t=!0){let r=gs(Lt(e));return t||_s(r)?r:void 0}var Da=d({"src/lib/utils/task-options.ts"(){"use strict";Ss(),$e(),Xt()}});function Or(e,t){return e(t.stdOut,t.stdErr)}function lt(e,t,r,n=!0){return yt(r).forEach(s=>{for(let i=ee(s,n),o=0,a=i.length;o<a;o++){let l=(h=0)=>{if(!(o+h>=a))return i[o+h]};t.some(({parse:h})=>h(l,e))}}),e}var Pa=d({"src/lib/utils/task-parser.ts"(){"use strict";$e()}}),Rs={};q(Rs,{ExitCodes:()=>kr,GitOutputStreams:()=>Oe,LineParser:()=>S,NOOP:()=>jt,NULL:()=>Ut,RemoteLineParser:()=>$t,append:()=>$,appendTaskOptions:()=>Nr,asArray:()=>yt,asCamelCase:()=>ws,asFunction:()=>gs,asNumber:()=>L,asStringArray:()=>ks,bufferToString:()=>Zt,callTaskParser:()=>Or,createInstanceConfig:()=>Es,delay:()=>vr,filterArray:()=>ne,filterFunction:()=>Ts,filterHasLength:()=>jr,filterPlainObject:()=>Re,filterPrimitives:()=>wr,filterString:()=>et,filterStringArray:()=>xs,filterStringOrStringArray:()=>ke,filterType:()=>vt,first:()=>ys,folderExists:()=>Lr,forEachLineWithContent:()=>Ir,getTrailingOptions:()=>ut,including:()=>Cs,isUserFunction:()=>_s,last:()=>Lt,objectToString:()=>re,orVoid:()=>Cr,parseStringResponse:()=>lt,pick:()=>Os,prefixedArray:()=>Qt,remove:()=>Ee,splitOn:()=>bs,toLinesWithContent:()=>ee,trailingFunctionArgument:()=>V,trailingOptionsArgument:()=>Hr});var O=d({"src/lib/utils/index.ts"(){"use strict";Ss(),Ea(),$a(),Ra(),Fa(),Da(),Pa(),$e()}}),Fs={};q(Fs,{CheckRepoActions:()=>Tr,checkIsBareRepoTask:()=>Ds,checkIsRepoRootTask:()=>Ms,checkIsRepoTask:()=>Ia});function Ia(e){switch(e){case"bare":return Ds();case"root":return Ms()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:Fe,parser:Br}}function Ms(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:Fe,parser(t){return/^\.(git)?$/.test(t.trim())}}}function Ds(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:Fe,parser:Br}}function La(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var Tr,Fe,Br,Ps=d({"src/lib/tasks/check-is-repo.ts"(){"use strict";O(),Tr=(e=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(Tr||{}),Fe=({exitCode:e},t,r,n)=>{if(e===128&&La(t))return r(Buffer.from("false"));n(t)},Br=e=>e.trim()==="true"}});function ja(e,t){let r=new Is(e),n=e?js:Ls;return ee(t).forEach(s=>{let i=s.replace(n,"");r.paths.push(i),(Ns.test(i)?r.folders:r.files).push(i)}),r}var Is,Ls,js,Ns,Na=d({"src/lib/responses/CleanSummary.ts"(){"use strict";O(),Is=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},Ls=/^[a-z]+\s*/i,js=/^[a-z]+\s+[a-z]+\s*/i,Ns=/\/$/}}),xr={};q(xr,{EMPTY_COMMANDS:()=>Me,adhocExecTask:()=>Hs,configurationErrorTask:()=>ct,isBufferTask:()=>Gs,isEmptyTask:()=>Vs,straightThroughBufferTask:()=>Bs,straightThroughStringTask:()=>it});function Hs(e){return{commands:Me,format:"empty",parser:e}}function ct(e){return{commands:Me,format:"empty",parser(){throw typeof e=="string"?new ms(e):e}}}function it(e,t=!1){return{commands:e,format:"utf-8",parser(r){return t?String(r).trim():r}}}function Bs(e){return{commands:e,format:"buffer",parser(t){return t}}}function Gs(e){return e.format==="buffer"}function Vs(e){return e.format==="empty"||!e.commands.length}var Me,W=d({"src/lib/tasks/task.ts"(){"use strict";ds(),Me=[]}}),Ws={};q(Ws,{CONFIG_ERROR_INTERACTIVE_MODE:()=>Gr,CONFIG_ERROR_MODE_REQUIRED:()=>Vr,CONFIG_ERROR_UNKNOWN_OPTION:()=>Wr,CleanOptions:()=>be,cleanTask:()=>qs,cleanWithOptionsTask:()=>Ha,isCleanOptionsArray:()=>Ba});function Ha(e,t){let{cleanMode:r,options:n,valid:s}=Ga(e);return r?s.options?(n.push(...t),n.some(qa)?ct(Gr):qs(r,n)):ct(Wr+JSON.stringify(e)):ct(Vr)}function qs(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser(n){return ja(e==="n",n)}}}function Ba(e){return Array.isArray(e)&&e.every(t=>qr.has(t))}function Ga(e){let t,r=[],n={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach(s=>{Va(s)?(t=s,n.cleanMode=!0):n.options=n.options&&Wa(r[r.length]=`-${s}`)}),{cleanMode:t,options:r,valid:n}}function Va(e){return e==="f"||e==="n"}function Wa(e){return/^-[a-z]$/i.test(e)&&qr.has(e.charAt(1))}function qa(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:e==="--interactive"}var Gr,Vr,Wr,be,qr,Us=d({"src/lib/tasks/clean.ts"(){"use strict";Na(),O(),W(),Gr="Git clean interactive mode is not supported",Vr='Git clean mode parameter ("n" or "f") is required',Wr="Git clean unknown option found in: ",be=(e=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(be||{}),qr=new Set(["i",...ks(Object.values(be))])}});function Ua(e){let t=new Ys;for(let r of zs(e))t.addValue(r.file,String(r.key),r.value);return t}function za(e,t){let r=null,n=[],s=new Map;for(let i of zs(e,t))i.key===t&&(n.push(r=i.value),s.has(i.file)||s.set(i.file,[]),s.get(i.file).push(r));return{key:t,paths:Array.from(s.keys()),scopes:s,value:r,values:n}}function Ya(e){return e.replace(/^(file):/,"")}function*zs(e,t=null){let r=e.split("\0");for(let n=0,s=r.length-1;n<s;){let i=Ya(r[n++]),o=r[n++],a=t;if(o.includes(`
33
+ `)){let l=bs(o,`
34
+ `);a=l[0],o=l[1]}yield{file:i,key:a,value:o}}}var Ys,Ja=d({"src/lib/responses/ConfigList.ts"(){"use strict";O(),Ys=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{})),this._all}addFile(e){if(!(e in this.values)){let t=Lt(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,r){let n=this.addFile(e);n.hasOwnProperty(t)?Array.isArray(n[t])?n[t].push(r):n[t]=[n[t],r]:n[t]=r,this._all=void 0}}}});function mr(e,t){return typeof e=="string"&&Sr.hasOwnProperty(e)?e:t}function Ka(e,t,r,n){let s=["config",`--${n}`];return r&&s.push("--add"),s.push(e,t),{commands:s,format:"utf-8",parser(i){return i}}}function Qa(e,t){let r=["config","--null","--show-origin","--get-all",e];return t&&r.splice(1,0,`--${t}`),{commands:r,format:"utf-8",parser(n){return za(n,e)}}}function Za(e){let t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser(r){return Ua(r)}}}function Xa(){return{addConfig(e,t,...r){return this._runTask(Ka(e,t,r[0]===!0,mr(r[1],"local")),V(arguments))},getConfig(e,t){return this._runTask(Qa(e,mr(t,void 0)),V(arguments))},listConfig(...e){return this._runTask(Za(mr(e[0],void 0)),V(arguments))}}}var Sr,Js=d({"src/lib/tasks/config.ts"(){"use strict";Ja(),O(),Sr=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(Sr||{})}});function tu(e){return Ks.has(e)}var dr,Ks,Qs=d({"src/lib/tasks/diff-name-status.ts"(){"use strict";dr=(e=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(dr||{}),Ks=new Set(Object.values(dr))}});function eu(...e){return new Xs().param(...e)}function ru(e){let t=new Set,r={};return Ir(e,n=>{let[s,i,o]=n.split(Ut);t.add(s),(r[s]=r[s]||[]).push({line:L(i),path:s,preview:o})}),{paths:t,results:r}}function nu(){return{grep(e){let t=V(arguments),r=ut(arguments);for(let s of Zs)if(r.includes(s))return this._runTask(ct(`git.grep: use of "${s}" is not supported.`),t);typeof e=="string"&&(e=eu().param(e));let n=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:n,format:"utf-8",parser(s){return ru(s)}},t)}}}var Zs,Kt,jn,Xs,ti=d({"src/lib/tasks/grep.ts"(){"use strict";O(),W(),Zs=["-h"],Kt=Symbol("grepQuery"),Xs=class{constructor(){this[jn]=[]}*[(jn=Kt,Symbol.iterator)](){for(let e of this[Kt])yield e}and(...e){return e.length&&this[Kt].push("--and","(",...Qt(e,"-e"),")"),this}param(...e){return this[Kt].push(...Qt(e,"-e")),this}}}}),ei={};q(ei,{ResetMode:()=>ye,getResetMode:()=>iu,resetTask:()=>su});function su(e,t){let r=["reset"];return ri(e)&&r.push(`--${e}`),r.push(...t),it(r)}function iu(e){if(ri(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function ri(e){return ni.includes(e)}var ye,ni,si=d({"src/lib/tasks/reset.ts"(){"use strict";W(),ye=(e=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(ye||{}),ni=Array.from(Object.values(ye))}});function ou(){return(0,Te.default)("simple-git")}function Nn(e,t,r){return!t||!String(t).replace(/\s*/,"")?r?(n,...s)=>{e(n,...s),r(n,...s)}:e:(n,...s)=>{e(`%s ${n}`,t,...s),r&&r(n,...s)}}function au(e,t,{namespace:r}){if(typeof e=="string")return e;let n=t&&t.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}function Ur(e,t,r,n=ou()){let s=e&&`[${e}]`||"",i=[],o=typeof t=="string"?n.extend(t):t,a=au(vt(t,et),o,n);return h(r);function l(u,c){return $(i,Ur(e,a.replace(/^[^:]+/,u),c,n))}function h(u){let c=u&&`[${u}]`||"",f=o&&Nn(o,c)||jt,p=Nn(n,`${s} ${c}`,f);return Object.assign(o?f:p,{label:e,sibling:l,info:p,step:h})}}var ii=d({"src/lib/git-logger.ts"(){"use strict";O(),Te.default.formatters.L=e=>String(jr(e)?e.length:"-"),Te.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):re(e)}}),oi,uu=d({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";Rt(),ii(),oi=class Ar{constructor(t="GitExecutor"){this.logLabel=t,this._queue=new Map}withProgress(t){return this._queue.get(t)}createProgress(t){let r=Ar.getName(t.commands[0]),n=Ur(this.logLabel,r);return{task:t,logger:n,name:r}}push(t){let r=this.createProgress(t);return r.logger("Adding task to the queue, commands = %o",t.commands),this._queue.set(t,r),r}fatal(t){for(let[r,{logger:n}]of Array.from(this._queue.entries()))r===t.task?(n.info("Failed %o",t),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",t.message),this.complete(r);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(t){this.withProgress(t)&&this._queue.delete(t)}attempt(t){let r=this.withProgress(t);if(!r)throw new At(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(t="empty"){return`task:${t}:${++Ar.counter}`}static{this.counter=0}}}});function It(e,t){return{method:ys(e.commands)||"",commands:t}}function lu(e,t){return r=>{t("[ERROR] child process exception %o",r),e.push(Buffer.from(String(r.stack),"ascii"))}}function Hn(e,t,r,n){return s=>{r("%s received %L bytes",t,s),n("%B",s),e.push(s)}}var Er,hu=d({"src/lib/runners/git-executor-chain.ts"(){"use strict";Rt(),W(),O(),uu(),Er=class{constructor(e,t,r){this._executor=e,this._scheduler=t,this._plugins=r,this._chain=Promise.resolve(),this._queue=new oi}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){let t=await this._scheduler.next(),r=()=>this._queue.complete(e);try{let{logger:n}=this._queue.attempt(e);return await(Vs(e)?this.attemptEmptyTask(e,n):this.attemptRemoteTask(e,n))}catch(n){throw this.onFatalException(e,n)}finally{r(),t()}}onFatalException(e,t){let r=t instanceof At?Object.assign(t,{task:e}):new At(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(e,t){let r=this._plugins.exec("spawn.binary","",It(e,e.commands)),n=this._plugins.exec("spawn.args",[...e.commands],It(e,e.commands)),s=await this.gitResponse(e,r,n,this.outputHandler,t.step("SPAWN")),i=await this.handleTaskData(e,n,s,t.step("HANDLE"));return t("passing response to task's parser as a %s",e.format),Gs(e)?Or(e.parser,i):Or(e.parser,i.asStrings())}async attemptEmptyTask(e,t){return t("empty task bypassing child process to call to task's parser"),e.parser(this)}handleTaskData(e,t,r,n){let{exitCode:s,rejection:i,stdOut:o,stdErr:a}=r;return new Promise((l,h)=>{n("Preparing to handle process response exitCode=%d stdOut=",s);let{error:u}=this._plugins.exec("task.error",{error:i},{...It(e,t),...r});if(u&&e.onError)return n.info("exitCode=%s handling with custom error handler"),e.onError(r,u,c=>{n.info("custom error handler treated as success"),n("custom error returned a %s",re(c)),l(new Oe(Array.isArray(c)?Buffer.concat(c):c,Buffer.concat(a)))},h);if(u)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",s,a.length,i),h(u);n.info("retrieving task output complete"),l(new Oe(Buffer.concat(o),Buffer.concat(a)))})}async gitResponse(e,t,r,n,s){let i=s.sibling("output"),o=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},It(e,e.commands));return new Promise(a=>{let l=[],h=[];s.info("%s %o",t,r),s("%O",o);let u=this._beforeSpawn(e,r);if(u)return a({stdOut:l,stdErr:h,exitCode:9901,rejection:u});this._plugins.exec("spawn.before",void 0,{...It(e,r),kill(f){u=f||u}});let c=cu(t,r,o);c.stdout.on("data",Hn(l,"stdOut",s,i.step("stdOut"))),c.stderr.on("data",Hn(h,"stdErr",s,i.step("stdErr"))),c.on("error",lu(h,s)),n&&(s("Passing child process stdOut/stdErr to custom outputHandler"),n(t,c.stdout,c.stderr,[...r])),this._plugins.exec("spawn.after",void 0,{...It(e,r),spawned:c,close(f,p){a({stdOut:l,stdErr:h,exitCode:f,rejection:u||p})},kill(f){c.killed||(u=f,c.kill("SIGINT"))}})})}_beforeSpawn(e,t){let r;return this._plugins.exec("spawn.before",void 0,{...It(e,t),kill(n){r=n||r}}),r}}}}),ai={};q(ai,{GitExecutor:()=>ui});var ui,fu=d({"src/lib/runners/git-executor.ts"(){"use strict";hu(),ui=class{constructor(e,t,r){this.cwd=e,this._scheduler=t,this._plugins=r,this._chain=new Er(this,this._scheduler,this._plugins)}chain(){return new Er(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function pu(e,t,r=jt){let n=i=>{r(null,i)},s=i=>{i?.task===e&&r(i instanceof te?mu(i):i,void 0)};t.then(n,s)}function mu(e){let t=n=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),t=jt};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(r,{}));function r(n,s){return s in e||(n[s]={enumerable:!1,configurable:!1,get(){return t(s),e.git[s]}}),n}}var du=d({"src/lib/task-callback.ts"(){"use strict";zt(),O()}});function Bn(e,t){return Hs(r=>{if(!Lr(e))throw new Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||r).cwd=e})}var gu=d({"src/lib/tasks/change-working-directory.ts"(){"use strict";O(),W()}});function gr(e){let t=["checkout",...e];return t[1]==="-b"&&t.includes("-B")&&(t[1]=Ee(t,"-B")),it(t)}function _u(){return{checkout(){return this._runTask(gr(ut(arguments,1)),V(arguments))},checkoutBranch(e,t){return this._runTask(gr(["-b",e,t,...ut(arguments)]),V(arguments))},checkoutLocalBranch(e){return this._runTask(gr(["-b",e,...ut(arguments)]),V(arguments))}}}var bu=d({"src/lib/tasks/checkout.ts"(){"use strict";O(),W()}});function yu(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function vu(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(e){return lt(yu(),[ci],e)}})}}}var ci,Cu=d({"src/lib/tasks/count-objects.ts"(){"use strict";O(),ci=new S(/([a-z-]+): (\d+)$/,(e,[t,r])=>{let n=ws(t);e.hasOwnProperty(n)&&(e[n]=L(r))})}});function wu(e){return lt({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},li,e)}var li,ku=d({"src/lib/parsers/parse-commit.ts"(){"use strict";O(),li=[new S(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,r,n])=>{e.branch=t,e.commit=n,e.root=!!r}),new S(/\s*Author:\s(.+)/i,(e,[t])=>{let r=t.split("<"),n=r.pop();!n||!n.includes("@")||(e.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new S(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(r,10)||0,e.summary.deletions=parseInt(n,10)||0}),new S(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0;let s=parseInt(r,10)||0;n==="-"?e.summary.deletions=s:n==="+"&&(e.summary.insertions=s)})]}});function Ou(e,t,r){return{commands:["-c","core.abbrev=40","commit",...Qt(e,"-m"),...t,...r],format:"utf-8",parser:wu}}function Tu(){return{commit(t,...r){let n=V(arguments),s=e(t)||Ou(yt(t),yt(vt(r[0],ke,[])),[...vt(r[1],ne,[]),...ut(arguments,0,!0)]);return this._runTask(s,n)}};function e(t){return!ke(t)&&ct("git.commit: requires the commit message to be supplied as a string/string[]")}}var xu=d({"src/lib/tasks/commit.ts"(){"use strict";ku(),O(),W()}});function Su(){return{firstCommit(){return this._runTask(it(["rev-list","--max-parents=0","HEAD"],!0),V(arguments))}}}var Au=d({"src/lib/tasks/first-commit.ts"(){"use strict";O(),W()}});function Eu(e,t){let r=["hash-object",e];return t&&r.push("-w"),it(r,!0)}var $u=d({"src/lib/tasks/hash-object.ts"(){"use strict";W()}});function Ru(e,t,r){let n=String(r).trim(),s;if(s=hi.exec(n))return new ve(e,t,!1,s[1]);if(s=fi.exec(n))return new ve(e,t,!0,s[1]);let i="",o=n.split(" ");for(;o.length;)if(o.shift()==="in"){i=o.join(" ");break}return new ve(e,t,/^re/i.test(n),i)}var ve,hi,fi,Fu=d({"src/lib/responses/InitSummary.ts"(){"use strict";ve=class{constructor(e,t,r,n){this.bare=e,this.path=t,this.existing=r,this.gitDir=n}},hi=/^Init.+ repository in (.+)$/,fi=/^Rein.+ in (.+)$/}});function Mu(e){return e.includes(zr)}function Du(e=!1,t,r){let n=["init",...r];return e&&!Mu(n)&&n.splice(1,0,zr),{commands:n,format:"utf-8",parser(s){return Ru(n.includes("--bare"),t,s)}}}var zr,Pu=d({"src/lib/tasks/init.ts"(){"use strict";Fu(),zr="--bare"}});function Yr(e){for(let t=0;t<e.length;t++){let r=Jr.exec(e[t]);if(r)return`--${r[1]}`}return""}function Iu(e){return Jr.test(e)}var Jr,se=d({"src/lib/args/log-format.ts"(){"use strict";Jr=/^--(stat|numstat|name-only|name-status)(=|$)/}}),pi,Lu=d({"src/lib/responses/DiffSummary.ts"(){"use strict";pi=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function mi(e=""){let t=di[e];return r=>lt(new pi,t,r,!1)}var _r,Gn,Vn,Wn,di,gi=d({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";se(),Lu(),Qs(),O(),_r=[new S(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,r,n=""])=>{e.files.push({file:t.trim(),changes:L(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new S(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,r,n])=>{e.files.push({file:t.trim(),before:L(r),after:L(n),binary:!0})}),new S(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,r])=>{let n=/(\d+) i/.exec(r),s=/(\d+) d/.exec(r);e.changed=L(t),e.insertions=L(n?.[1]),e.deletions=L(s?.[1])})],Gn=[new S(/(\d+)\t(\d+)\t(.+)$/,(e,[t,r,n])=>{let s=L(t),i=L(r);e.changed++,e.insertions+=s,e.deletions+=i,e.files.push({file:n,changes:s+i,insertions:s,deletions:i,binary:!1})}),new S(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],Vn=[new S(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],Wn=[new S(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,r,n,s,i])=>{e.changed++,e.files.push({file:i??n,changes:0,insertions:0,deletions:0,binary:!1,status:Cr(tu(t)&&t),from:Cr(!!i&&n!==i&&n),similarity:L(r)})})],di={"":_r,"--stat":_r,"--numstat":Gn,"--name-status":Wn,"--name-only":Vn}}});function ju(e,t){return t.reduce((r,n,s)=>(r[n]=e[s]||"",r),Object.create({diff:null}))}function _i(e=Zr,t=bi,r=""){let n=mi(r);return function(s){let i=ee(s.trim(),!1,Kr).map(function(o){let a=o.split(Qr),l=ju(a[0].split(e),t);return a.length>1&&a[1].trim()&&(l.diff=n(a[1])),l});return{all:i,latest:i.length&&i[0]||null,total:i.length}}}var Kr,Qr,Zr,bi,yi=d({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";O(),gi(),se(),Kr="\xF2\xF2\xF2\xF2\xF2\xF2 ",Qr=" \xF2\xF2",Zr=" \xF2 ",bi=["hash","date","message","refs","author_name","author_email"]}}),vi={};q(vi,{diffSummaryTask:()=>Nu,validateLogFormatConfig:()=>De});function Nu(e){let t=Yr(e),r=["diff"];return t===""&&(t="--stat",r.push("--stat=4096")),r.push(...e),De(r)||{commands:r,format:"utf-8",parser:mi(t)}}function De(e){let t=e.filter(Iu);if(t.length>1)return ct(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`);if(t.length&&e.includes("-z"))return ct(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var Xr=d({"src/lib/tasks/diff.ts"(){"use strict";se(),gi(),W()}});function Hu(e,t){let r=[],n=[];return Object.keys(e).forEach(s=>{r.push(s),n.push(String(e[s]))}),[r,n.join(t)]}function Bu(e){return Object.keys(e).reduce((t,r)=>(r in $r||(t[r]=e[r]),t),{})}function Ci(e={},t=[]){let r=vt(e.splitter,et,Zr),n=Re(e.format)?e.format:{hash:"%H",date:e.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:e.mailMap!==!1?"%aN":"%an",author_email:e.mailMap!==!1?"%aE":"%ae"},[s,i]=Hu(n,r),o=[],a=[`--pretty=format:${Kr}${i}${Qr}`,...t],l=e.n||e["max-count"]||e.maxCount;if(l&&a.push(`--max-count=${l}`),e.from||e.to){let h=e.symmetric!==!1?"...":"..";o.push(`${e.from||""}${h}${e.to||""}`)}return et(e.file)&&a.push("--follow",Sa(e.file)),Nr(Bu(e),a),{fields:s,splitter:r,commands:[...a,...o]}}function Gu(e,t,r){let n=_i(e,t,Yr(r));return{commands:["log",...r],format:"utf-8",parser:n}}function Vu(){return{log(...r){let n=V(arguments),s=Ci(Hr(arguments),vt(arguments[0],ne)),i=t(...r)||De(s.commands)||e(s);return this._runTask(i,n)}};function e(r){return Gu(r.splitter,r.fields,r.commands)}function t(r,n){return et(r)&&et(n)&&ct("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var $r,wi=d({"src/lib/tasks/log.ts"(){"use strict";se(),Xt(),yi(),O(),W(),Xr(),$r=(e=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))($r||{})}}),Ce,ki,Wu=d({"src/lib/responses/MergeSummary.ts"(){"use strict";Ce=class{constructor(e,t=null,r){this.reason=e,this.file=t,this.meta=r}toString(){return`${this.file}:${this.reason}`}},ki=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),Rr,Oi,qu=d({"src/lib/responses/PullSummary.ts"(){"use strict";Rr=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Oi=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function br(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function qn(e){let t=/^\s*(\d+)/.exec(e),r=/delta (\d+)/i.exec(e);return{count:L(t&&t[1]||"0"),delta:L(r&&r[1]||"0")}}var Ti,Uu=d({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";O(),Ti=[new $t(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,r])=>{let n=t.toLowerCase(),s=br(e.remoteMessages);Object.assign(s,{[n]:L(r)})}),new $t(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,r])=>{let n=t.toLowerCase(),s=br(e.remoteMessages);Object.assign(s,{[n]:L(r)})}),new $t(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,r,n])=>{let s=br(e.remoteMessages);s.total=qn(t),s.reused=qn(r),s.packReused=L(n)})]}});function xi(e,t){return lt({remoteMessages:new Ai},Si,t)}var Si,Ai,Ei=d({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";O(),Uu(),Si=[new $t(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...Ti,new $t([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new $t([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,r,n])=>{e.remoteMessages.vulnerabilities={count:L(t),summary:r,url:n}})],Ai=class{constructor(){this.all=[]}}}});function zu(e,t){let r=lt(new Oi,$i,[e,t]);return r.message&&r}var Un,zn,Yn,Jn,$i,Kn,tn,Ri=d({"src/lib/parsers/parse-pull.ts"(){"use strict";qu(),O(),Ei(),Un=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,zn=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Yn=/^(create|delete) mode \d+ (.+)/,Jn=[new S(Un,(e,[t,r,n])=>{e.files.push(t),r&&(e.insertions[t]=r.length),n&&(e.deletions[t]=n.length)}),new S(zn,(e,[t,,r,,n])=>r!==void 0||n!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+r||0,e.summary.deletions=+n||0,!0):!1),new S(Yn,(e,[t,r])=>{$(e.files,r),$(t==="create"?e.created:e.deleted,r)})],$i=[new S(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new S(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new S(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,r,n,s])=>{e.branch.local=n,e.hash.local=t,e.branch.remote=s,e.hash.remote=r})],Kn=(e,t)=>lt(new Rr,Jn,[e,t]),tn=(e,t)=>Object.assign(new Rr,Kn(e,t),xi(e,t))}}),Qn,Fi,Zn,Yu=d({"src/lib/parsers/parse-merge.ts"(){"use strict";Wu(),O(),Ri(),Qn=[new S(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new S(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,r])=>{e.conflicts.push(new Ce(t,r))}),new S(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,r,n])=>{e.conflicts.push(new Ce(t,r,{deleteRef:n}))}),new S(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new Ce(t,null))}),new S(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],Fi=(e,t)=>Object.assign(Zn(e,t),tn(e,t)),Zn=e=>lt(new ki,Qn,e)}});function Xn(e){return e.length?{commands:["merge",...e],format:"utf-8",parser(t,r){let n=Fi(t,r);if(n.failed)throw new te(n);return n}}:ct("Git.merge requires at least one option")}var Ju=d({"src/lib/tasks/merge.ts"(){"use strict";zt(),Yu(),W()}});function Ku(e,t,r){let n=r.includes("deleted"),s=r.includes("tag")||/^refs\/tags/.test(e),i=!r.includes("new");return{deleted:n,tag:s,branch:!s,new:!i,alreadyUpdated:i,local:e,remote:t}}var ts,Mi,es,Qu=d({"src/lib/parsers/parse-push.ts"(){"use strict";O(),Ei(),ts=[new S(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new S(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new S(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,r,n])=>{e.pushed.push(Ku(t,r,n))}),new S(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,r,n])=>{e.branch={...e.branch||{},local:t,remote:r,remoteName:n}}),new S(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,r,n,s])=>{e.update={head:{local:t,remote:r},hash:{from:n,to:s}}})],Mi=(e,t)=>{let r=es(e,t),n=xi(e,t);return{...r,...n}},es=(e,t)=>lt({pushed:[]},ts,[e,t])}}),Di={};q(Di,{pushTagsTask:()=>Zu,pushTask:()=>en});function Zu(e={},t){return $(t,"--tags"),en(e,t)}function en(e={},t){let r=["push",...t];return e.branch&&r.splice(1,0,e.branch),e.remote&&r.splice(1,0,e.remote),Ee(r,"-v"),$(r,"--verbose"),$(r,"--porcelain"),{commands:r,format:"utf-8",parser:Mi}}var Pi=d({"src/lib/tasks/push.ts"(){"use strict";Qu(),O()}});function Xu(){return{showBuffer(){let e=["show",...ut(arguments,1)];return e.includes("--binary")||e.splice(1,0,"--binary"),this._runTask(Bs(e),V(arguments))},show(){let e=["show",...ut(arguments,1)];return this._runTask(it(e),V(arguments))}}}var tc=d({"src/lib/tasks/show.ts"(){"use strict";O(),W()}}),rs,Ii,ec=d({"src/lib/responses/FileStatusSummary.ts"(){"use strict";rs=/^(.+)\0(.+)$/,Ii=class{constructor(e,t,r){if(this.path=e,this.index=t,this.working_dir=r,t==="R"||r==="R"){let n=rs.exec(e)||[null,e,e];this.from=n[2]||"",this.path=n[1]||""}}}}});function ns(e){let[t,r]=e.split(Ut);return{from:r||t,to:t}}function pt(e,t,r){return[`${e}${t}`,r]}function yr(e,...t){return t.map(r=>pt(e,r,(n,s)=>$(n.conflicted,s)))}function rc(e,t){let r=t.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return n(" ",r.charAt(0),r.substr(2));default:return}function n(s,i,o){let a=`${s}${i}`,l=Li.get(a);l&&l(e,o),a!=="##"&&a!=="!!"&&e.files.push(new Ii(o,s,i))}}var ss,Li,ji,nc=d({"src/lib/responses/StatusSummary.ts"(){"use strict";O(),ec(),ss=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},Li=new Map([pt(" ","A",(e,t)=>$(e.created,t)),pt(" ","D",(e,t)=>$(e.deleted,t)),pt(" ","M",(e,t)=>$(e.modified,t)),pt("A"," ",(e,t)=>$(e.created,t)&&$(e.staged,t)),pt("A","M",(e,t)=>$(e.created,t)&&$(e.staged,t)&&$(e.modified,t)),pt("D"," ",(e,t)=>$(e.deleted,t)&&$(e.staged,t)),pt("M"," ",(e,t)=>$(e.modified,t)&&$(e.staged,t)),pt("M","M",(e,t)=>$(e.modified,t)&&$(e.staged,t)),pt("R"," ",(e,t)=>{$(e.renamed,ns(t))}),pt("R","M",(e,t)=>{let r=ns(t);$(e.renamed,r),$(e.modified,r.to)}),pt("!","!",(e,t)=>{$(e.ignored=e.ignored||[],t)}),pt("?","?",(e,t)=>$(e.not_added,t)),...yr("A","A","U"),...yr("D","D","U"),...yr("U","A","D","U"),["##",(e,t)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,s=/^(.+?(?=(?:\.{3}|\s|$)))/,i=/\.{3}(\S*)/,o=/\son\s([\S]+)$/,a;a=r.exec(t),e.ahead=a&&+a[1]||0,a=n.exec(t),e.behind=a&&+a[1]||0,a=s.exec(t),e.current=a&&a[1],a=i.exec(t),e.tracking=a&&a[1],a=o.exec(t),e.current=a&&a[1]||e.current,e.detached=/\(no branch\)/.test(t)}]]),ji=function(e){let t=e.split(Ut),r=new ss;for(let n=0,s=t.length;n<s;){let i=t[n++].trim();i&&(i.charAt(0)==="R"&&(i+=Ut+(t[n++]||"")),rc(r,i))}return r}}});function sc(e){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter(r=>!Ni.includes(r))],parser(r){return ji(r)}}}var Ni,ic=d({"src/lib/tasks/status.ts"(){"use strict";nc(),Ni=["--null","-z"]}});function xe(e=0,t=0,r=0,n="",s=!0){return Object.defineProperty({major:e,minor:t,patch:r,agent:n,installed:s},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function oc(){return xe(0,0,0,"",!1)}function ac(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:uc,onError(e,t,r,n){if(e.exitCode===-2)return r(Buffer.from(rn));n(t)}})}}}function uc(e){return e===rn?oc():lt(xe(0,0,0,e),Hi,e)}var rn,Hi,cc=d({"src/lib/tasks/version.ts"(){"use strict";O(),rn="installed=false",Hi=[new S(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,r,n,s=""])=>{Object.assign(e,xe(L(t),L(r),L(n),s))}),new S(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,r,n,s=""])=>{Object.assign(e,xe(L(t),L(r),n,s))})]}}),Bi={};q(Bi,{SimpleGitApi:()=>Fr});var Fr,lc=d({"src/lib/simple-git-api.ts"(){"use strict";du(),gu(),bu(),Cu(),xu(),Js(),Au(),ti(),$u(),Pu(),wi(),Ju(),Pi(),tc(),ic(),W(),cc(),O(),Fr=class{constructor(e){this._executor=e}_runTask(e,t){let r=this._executor.chain(),n=r.push(e);return t&&pu(e,n,t),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(e){return this._runTask(it(["add",...yt(e)]),V(arguments))}cwd(e){let t=V(arguments);return typeof e=="string"?this._runTask(Bn(e,this._executor),t):typeof e?.path=="string"?this._runTask(Bn(e.path,e.root&&this._executor||void 0),t):this._runTask(ct("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(Eu(e,t===!0),V(arguments))}init(e){return this._runTask(Du(e===!0,this._executor.cwd,ut(arguments)),V(arguments))}merge(){return this._runTask(Xn(ut(arguments)),V(arguments))}mergeFromTo(e,t){return et(e)&&et(t)?this._runTask(Xn([e,t,...ut(arguments)]),V(arguments,!1)):this._runTask(ct("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=en({remote:vt(arguments[0],et),branch:vt(arguments[1],et)},ut(arguments));return this._runTask(e,V(arguments))}stash(){return this._runTask(it(["stash",...ut(arguments)]),V(arguments))}status(){return this._runTask(sc(ut(arguments)),V(arguments))}},Object.assign(Fr.prototype,_u(),Tu(),Xa(),vu(),Su(),nu(),Vu(),Xu(),ac())}}),Gi={};q(Gi,{Scheduler:()=>Wi});var is,Wi,hc=d({"src/lib/runners/scheduler.ts"(){"use strict";O(),ii(),is=(()=>{let e=0;return()=>{e++;let{promise:t,done:r}=(0,Vi.createDeferred)();return{promise:t,done:r,id:e}}})(),Wi=class{constructor(e=2){this.concurrency=e,this.logger=Ur("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let e=$(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),Ee(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=$(this.pending,is());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),qi={};q(qi,{applyPatchTask:()=>fc});function fc(e,t){return it(["apply",...t,...e])}var pc=d({"src/lib/tasks/apply-patch.ts"(){"use strict";W()}});function mc(e,t){return{branch:e,hash:t,success:!0}}function dc(e){return{branch:e,hash:null,success:!1}}var Ui,gc=d({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";Ui=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function zi(e,t){return t===1&&Mr.test(e)}var os,Mr,as,Pe,_c=d({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";gc(),O(),os=/(\S+)\s+\(\S+\s([^)]+)\)/,Mr=/^error[^']+'([^']+)'/m,as=[new S(os,(e,[t,r])=>{let n=mc(t,r);e.all.push(n),e.branches[t]=n}),new S(Mr,(e,[t])=>{let r=dc(t);e.errors.push(r),e.all.push(r),e.branches[t]=r})],Pe=(e,t)=>lt(new Ui,as,[e,t])}}),Yi,bc=d({"src/lib/responses/BranchSummary.ts"(){"use strict";Yi=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,r,n,s){e==="*"&&(this.detached=t,this.current=r),this.all.push(r),this.branches[r]={current:e==="*",linkedWorkTree:e==="+",name:r,commit:n,label:s}}}}});function us(e){return e?e.charAt(0):""}function Ji(e){return lt(new Yi,Ki,e)}var Ki,yc=d({"src/lib/parsers/parse-branch.ts"(){"use strict";bc(),O(),Ki=[new S(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,r,n,s])=>{e.push(us(t),!0,r,n,s)}),new S(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,r,n,s])=>{e.push(us(t),!1,r,n,s)})]}}),Qi={};q(Qi,{branchLocalTask:()=>Cc,branchTask:()=>vc,containsDeleteBranchCommand:()=>Zi,deleteBranchTask:()=>kc,deleteBranchesTask:()=>wc});function Zi(e){let t=["-d","-D","--delete"];return e.some(r=>t.includes(r))}function vc(e){let t=Zi(e),r=["branch",...e];return r.length===1&&r.push("-a"),r.includes("-v")||r.splice(1,0,"-v"),{format:"utf-8",commands:r,parser(n,s){return t?Pe(n,s).all[0]:Ji(n)}}}function Cc(){return{format:"utf-8",commands:["branch","-v"],parser:Ji}}function wc(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser(r,n){return Pe(r,n)},onError({exitCode:r,stdOut:n},s,i,o){if(!zi(String(s),r))return o(s);i(n)}}}function kc(e,t=!1){let r={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser(n,s){return Pe(n,s).branches[e]},onError({exitCode:n,stdErr:s,stdOut:i},o,a,l){if(!zi(String(o),n))return l(o);throw new te(r.parser(Zt(i),Zt(s)),String(o))}};return r}var Oc=d({"src/lib/tasks/branch.ts"(){"use strict";zt(),_c(),yc(),O()}}),Xi,Tc=d({"src/lib/responses/CheckIgnore.ts"(){"use strict";Xi=e=>e.split(/\n/g).map(t=>t.trim()).filter(t=>!!t)}}),to={};q(to,{checkIgnoreTask:()=>xc});function xc(e){return{commands:["check-ignore",...e],format:"utf-8",parser:Xi}}var Sc=d({"src/lib/tasks/check-ignore.ts"(){"use strict";Tc()}}),eo={};q(eo,{cloneMirrorTask:()=>Ec,cloneTask:()=>ro});function Ac(e){return/^--upload-pack(=|$)/.test(e)}function ro(e,t,r){let n=["clone",...r];return et(e)&&n.push(e),et(t)&&n.push(t),n.find(Ac)?ct("git.fetch: potential exploit argument blocked."):it(n)}function Ec(e,t,r){return $(r,"--mirror"),ro(e,t,r)}var $c=d({"src/lib/tasks/clone.ts"(){"use strict";W(),O()}});function Rc(e,t){return lt({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},no,[e,t])}var no,Fc=d({"src/lib/parsers/parse-fetch.ts"(){"use strict";O(),no=[new S(/From (.+)$/,(e,[t])=>{e.remote=t}),new S(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.branches.push({name:t,tracking:r})}),new S(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.tags.push({name:t,tracking:r})}),new S(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new S(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,r,n,s])=>{e.updated.push({name:n,tracking:s,to:r,from:t})})]}}),so={};q(so,{fetchTask:()=>Dc});function Mc(e){return/^--upload-pack(=|$)/.test(e)}function Dc(e,t,r){let n=["fetch",...r];return e&&t&&n.push(e,t),n.find(Mc)?ct("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:Rc}}var Pc=d({"src/lib/tasks/fetch.ts"(){"use strict";Fc(),W()}});function Ic(e){return lt({moves:[]},io,e)}var io,Lc=d({"src/lib/parsers/parse-move.ts"(){"use strict";O(),io=[new S(/^Renaming (.+) to (.+)$/,(e,[t,r])=>{e.moves.push({from:t,to:r})})]}}),oo={};q(oo,{moveTask:()=>jc});function jc(e,t){return{commands:["mv","-v",...yt(e),t],format:"utf-8",parser:Ic}}var Nc=d({"src/lib/tasks/move.ts"(){"use strict";Lc(),O()}}),ao={};q(ao,{pullTask:()=>Hc});function Hc(e,t,r){let n=["pull",...r];return e&&t&&n.splice(1,0,e,t),{commands:n,format:"utf-8",parser(s,i){return tn(s,i)},onError(s,i,o,a){let l=zu(Zt(s.stdOut),Zt(s.stdErr));if(l)return a(new te(l));a(i)}}}var Bc=d({"src/lib/tasks/pull.ts"(){"use strict";zt(),Ri(),O()}});function Gc(e){let t={};return uo(e,([r])=>t[r]={name:r}),Object.values(t)}function Vc(e){let t={};return uo(e,([r,n,s])=>{t.hasOwnProperty(r)||(t[r]={name:r,refs:{fetch:"",push:""}}),s&&n&&(t[r].refs[s.replace(/[^a-z]/g,"")]=n)}),Object.values(t)}function uo(e,t){Ir(e,r=>t(r.split(/\s+/)))}var Wc=d({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";O()}}),co={};q(co,{addRemoteTask:()=>qc,getRemotesTask:()=>Uc,listRemotesTask:()=>zc,remoteTask:()=>Yc,removeRemoteTask:()=>Jc});function qc(e,t,r){return it(["remote","add",...r,e,t])}function Uc(e){let t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?Vc:Gc}}function zc(e){let t=[...e];return t[0]!=="ls-remote"&&t.unshift("ls-remote"),it(t)}function Yc(e){let t=[...e];return t[0]!=="remote"&&t.unshift("remote"),it(t)}function Jc(e){return it(["remote","remove",e])}var Kc=d({"src/lib/tasks/remote.ts"(){"use strict";Wc(),W()}}),lo={};q(lo,{stashListTask:()=>Qc});function Qc(e={},t){let r=Ci(e),n=["stash","list",...r.commands,...t],s=_i(r.splitter,r.fields,Yr(n));return De(n)||{commands:n,format:"utf-8",parser:s}}var Zc=d({"src/lib/tasks/stash-list.ts"(){"use strict";se(),yi(),Xr(),wi()}}),ho={};q(ho,{addSubModuleTask:()=>Xc,initSubModuleTask:()=>tl,subModuleTask:()=>Ie,updateSubModuleTask:()=>el});function Xc(e,t){return Ie(["add",e,t])}function tl(e){return Ie(["init",...e])}function Ie(e){let t=[...e];return t[0]!=="submodule"&&t.unshift("submodule"),it(t)}function el(e){return Ie(["update",...e])}var rl=d({"src/lib/tasks/sub-module.ts"(){"use strict";W()}});function nl(e,t){let r=isNaN(e),n=isNaN(t);return r!==n?r?1:-1:r?fo(e,t):0}function fo(e,t){return e===t?0:e>t?1:-1}function sl(e){return e.trim()}function _e(e){return typeof e=="string"&&parseInt(e.replace(/^\D+/g,""),10)||0}var cs,po,il=d({"src/lib/responses/TagList.ts"(){"use strict";cs=class{constructor(e,t){this.all=e,this.latest=t}},po=function(e,t=!1){let r=e.split(`
35
+ `).map(sl).filter(Boolean);t||r.sort(function(s,i){let o=s.split("."),a=i.split(".");if(o.length===1||a.length===1)return nl(_e(o[0]),_e(a[0]));for(let l=0,h=Math.max(o.length,a.length);l<h;l++){let u=fo(_e(o[l]),_e(a[l]));if(u)return u}return 0});let n=t?r[0]:[...r].reverse().find(s=>s.indexOf(".")>=0);return new cs(r,n)}}}),mo={};q(mo,{addAnnotatedTagTask:()=>ul,addTagTask:()=>al,tagListTask:()=>ol});function ol(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return po(r,t)}}}function al(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function ul(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var cl=d({"src/lib/tasks/tag.ts"(){"use strict";il()}}),ll=Ta({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(fu(),G(ai)),{SimpleGitApi:n}=(lc(),G(Bi)),{Scheduler:s}=(hc(),G(Gi)),{configurationErrorTask:i}=(W(),G(xr)),{asArray:o,filterArray:a,filterPrimitives:l,filterString:h,filterStringOrStringArray:u,filterType:c,getTrailingOptions:f,trailingFunctionArgument:p,trailingOptionsArgument:E}=(O(),G(Rs)),{applyPatchTask:M}=(pc(),G(qi)),{branchTask:I,branchLocalTask:j,deleteBranchesTask:K,deleteBranchTask:U}=(Oc(),G(Qi)),{checkIgnoreTask:J}=(Sc(),G(to)),{checkIsRepoTask:mt}=(Ps(),G(Fs)),{cloneTask:rt,cloneMirrorTask:ht}=($c(),G(eo)),{cleanWithOptionsTask:F,isCleanOptionsArray:A}=(Us(),G(Ws)),{diffSummaryTask:Nt}=(Xr(),G(vi)),{fetchTask:oe}=(Pc(),G(so)),{moveTask:k}=(Nc(),G(oo)),{pullTask:b}=(Bc(),G(ao)),{pushTagsTask:g}=(Pi(),G(Di)),{addRemoteTask:v,getRemotesTask:_,listRemotesTask:T,remoteTask:x,removeRemoteTask:D}=(Kc(),G(co)),{getResetMode:N,resetTask:z}=(si(),G(ei)),{stashListTask:Q}=(Zc(),G(lo)),{addSubModuleTask:ot,initSubModuleTask:Et,subModuleTask:wt,updateSubModuleTask:Ft}=(rl(),G(ho)),{addAnnotatedTagTask:kt,addTagTask:X,tagListTask:bt}=(cl(),G(mo)),{straightThroughBufferTask:Mt,straightThroughStringTask:nt}=(W(),G(xr));function C(m,y){this._plugins=y,this._executor=new r(m.baseDir,new s(m.maxConcurrentProcesses),y),this._trimmed=m.trimmed}(C.prototype=Object.create(n.prototype)).constructor=C,C.prototype.customBinary=function(m){return this._plugins.reconfigure("binary",m),this},C.prototype.env=function(m,y){return arguments.length===1&&typeof m=="object"?this._executor.env=m:(this._executor.env=this._executor.env||{})[m]=y,this},C.prototype.stashList=function(m){return this._runTask(Q(E(arguments)||{},a(m)&&m||[]),p(arguments))};function on(m,y,P,st){return typeof P!="string"?i(`git.${m}() requires a string 'repoPath'`):y(P,c(st,h),f(arguments))}C.prototype.clone=function(){return this._runTask(on("clone",rt,...arguments),p(arguments))},C.prototype.mirror=function(){return this._runTask(on("mirror",ht,...arguments),p(arguments))},C.prototype.mv=function(m,y){return this._runTask(k(m,y),p(arguments))},C.prototype.checkoutLatestTag=function(m){var y=this;return this.pull(function(){y.tags(function(P,st){y.checkout(st.latest,m)})})},C.prototype.pull=function(m,y,P,st){return this._runTask(b(c(m,h),c(y,h),f(arguments)),p(arguments))},C.prototype.fetch=function(m,y){return this._runTask(oe(c(m,h),c(y,h),f(arguments)),p(arguments))},C.prototype.silent=function(m){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},C.prototype.tags=function(m,y){return this._runTask(bt(f(arguments)),p(arguments))},C.prototype.rebase=function(){return this._runTask(nt(["rebase",...f(arguments)]),p(arguments))},C.prototype.reset=function(m){return this._runTask(z(N(m),f(arguments)),p(arguments))},C.prototype.revert=function(m){let y=p(arguments);return typeof m!="string"?this._runTask(i("Commit must be a string"),y):this._runTask(nt(["revert",...f(arguments,0,!0),m]),y)},C.prototype.addTag=function(m){let y=typeof m=="string"?X(m):i("Git.addTag requires a tag name");return this._runTask(y,p(arguments))},C.prototype.addAnnotatedTag=function(m,y){return this._runTask(kt(m,y),p(arguments))},C.prototype.deleteLocalBranch=function(m,y,P){return this._runTask(U(m,typeof y=="boolean"?y:!1),p(arguments))},C.prototype.deleteLocalBranches=function(m,y,P){return this._runTask(K(m,typeof y=="boolean"?y:!1),p(arguments))},C.prototype.branch=function(m,y){return this._runTask(I(f(arguments)),p(arguments))},C.prototype.branchLocal=function(m){return this._runTask(j(),p(arguments))},C.prototype.raw=function(m){let y=!Array.isArray(m),P=[].slice.call(y?arguments:m,0);for(let gt=0;gt<P.length&&y;gt++)if(!l(P[gt])){P.splice(gt,P.length-gt);break}P.push(...f(arguments,0,!0));var st=p(arguments);return P.length?this._runTask(nt(P,this._trimmed),st):this._runTask(i("Raw: must supply one or more command to execute"),st)},C.prototype.submoduleAdd=function(m,y,P){return this._runTask(ot(m,y),p(arguments))},C.prototype.submoduleUpdate=function(m,y){return this._runTask(Ft(f(arguments,!0)),p(arguments))},C.prototype.submoduleInit=function(m,y){return this._runTask(Et(f(arguments,!0)),p(arguments))},C.prototype.subModule=function(m,y){return this._runTask(wt(f(arguments)),p(arguments))},C.prototype.listRemote=function(){return this._runTask(T(f(arguments)),p(arguments))},C.prototype.addRemote=function(m,y,P){return this._runTask(v(m,y,f(arguments)),p(arguments))},C.prototype.removeRemote=function(m,y){return this._runTask(D(m),p(arguments))},C.prototype.getRemotes=function(m,y){return this._runTask(_(m===!0),p(arguments))},C.prototype.remote=function(m,y){return this._runTask(x(f(arguments)),p(arguments))},C.prototype.tag=function(m,y){let P=f(arguments);return P[0]!=="tag"&&P.unshift("tag"),this._runTask(nt(P),p(arguments))},C.prototype.updateServerInfo=function(m){return this._runTask(nt(["update-server-info"]),p(arguments))},C.prototype.pushTags=function(m,y){let P=g({remote:c(m,h)},f(arguments));return this._runTask(P,p(arguments))},C.prototype.rm=function(m){return this._runTask(nt(["rm","-f",...o(m)]),p(arguments))},C.prototype.rmKeepLocal=function(m){return this._runTask(nt(["rm","--cached",...o(m)]),p(arguments))},C.prototype.catFile=function(m,y){return this._catFile("utf-8",arguments)},C.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},C.prototype._catFile=function(m,y){var P=p(y),st=["cat-file"],gt=y[0];if(typeof gt=="string")return this._runTask(i("Git.catFile: options must be supplied as an array of strings"),P);Array.isArray(gt)&&st.push.apply(st,gt);let je=m==="buffer"?Mt(st):nt(st);return this._runTask(je,P)},C.prototype.diff=function(m,y){let P=h(m)?i("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):nt(["diff",...f(arguments)]);return this._runTask(P,p(arguments))},C.prototype.diffSummary=function(){return this._runTask(Nt(f(arguments,1)),p(arguments))},C.prototype.applyPatch=function(m){let y=u(m)?M(o(m),f([].slice.call(arguments,1))):i("git.applyPatch requires one or more string patches as the first argument");return this._runTask(y,p(arguments))},C.prototype.revparse=function(){let m=["rev-parse",...f(arguments,!0)];return this._runTask(nt(m,!0),p(arguments))},C.prototype.clean=function(m,y,P){let st=A(m),gt=st&&m.join("")||c(m,h)||"",je=f([].slice.call(arguments,st?1:0));return this._runTask(F(gt,je),p(arguments))},C.prototype.exec=function(m){let y={commands:[],format:"utf-8",parser(){typeof m=="function"&&m()}};return this._runTask(y)},C.prototype.clearQueue=function(){return this},C.prototype.checkIgnore=function(m,y){return this._runTask(J(o(c(m,u,[]))),p(arguments))},C.prototype.checkIsRepo=function(m,y){return this._runTask(mt(c(m,h)),p(arguments))},t.exports=C}});Xt();Rt();var hl=class extends At{constructor(e,t){super(void 0,t),this.config=e}};Rt();Rt();var St=class extends At{constructor(e,t,r){super(e,r),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};zt();ds();Ps();Us();Js();Qs();ti();si();function fl(e){return e?[{type:"spawn.before",action(n,s){e.aborted&&s.kill(new St(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,s){function i(){s.kill(new St(void 0,"abort","Abort signal received"))}e.addEventListener("abort",i),s.spawned.on("close",()=>e.removeEventListener("abort",i))}}]:void 0}function pl(e){return typeof e=="string"&&e.trim().toLowerCase()==="-c"}function ml(e,t){if(pl(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new St(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function dl(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new St(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(t==="clone"&&/^\s*-u\b/.test(e))throw new St(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(t==="push"&&/^\s*--exec\b/.test(e))throw new St(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function gl({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:"spawn.args",action(r,n){return r.forEach((s,i)=>{let o=i<r.length?r[i+1]:"";e||ml(s,o),t||dl(s,n.method)}),r}}}O();function _l(e){let t=Qt(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}O();var ls=(0,qt.deferred)().promise;function bl({onClose:e=!0,onExit:t=50}={}){function r(){let s=-1,i={close:(0,qt.deferred)(),closeTimeout:(0,qt.deferred)(),exit:(0,qt.deferred)(),exitTimeout:(0,qt.deferred)()},o=Promise.race([e===!1?ls:i.closeTimeout.promise,t===!1?ls:i.exitTimeout.promise]);return n(e,i.close,i.closeTimeout),n(t,i.exit,i.exitTimeout),{close(a){s=a,i.close.done()},exit(a){s=a,i.exit.done()},get exitCode(){return s},result:o}}function n(s,i,o){s!==!1&&(s===!0?i.promise:i.promise.then(()=>vr(s))).then(o.done)}return{type:"spawn.after",async action(s,{spawned:i,close:o}){let a=r(),l=!0,h=()=>void(l=!1);i.stdout?.on("data",h),i.stderr?.on("data",h),i.on("error",h),i.on("close",u=>a.close(u)),i.on("exit",u=>a.exit(u));try{await a.result,l&&await vr(50),o(a.exitCode)}catch(u){o(a.exitCode,u)}}}}O();var yl="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",hs="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function vl(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function fs(e,t){if(e.length<1||e.length>2)throw new St(void 0,"binary",yl);if(e.some(vl))if(t)console.warn(hs);else throw new St(void 0,"binary",hs);let[n,s]=e;return{binary:n,prefix:s}}function Cl(e,t=["git"],r=!1){let n=fs(yt(t),r);e.on("binary",s=>{n=fs(yt(s),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",s=>n.prefix?[n.prefix,...s]:s)}Rt();function wl(e){return!!(e.exitCode&&e.stdErr.length)}function kl(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Ol(e=!1,t=wl,r=kl){return(n,s)=>!e&&n||!t(s)?n:r(s)}function ps(e){return{type:"task.error",action(t,r){let n=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new At(void 0,n.toString("utf-8"))}:{error:n}}}}O();var xl=class{constructor(){this.plugins=new Set,this.events=new Tl}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=$(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return yt(e).forEach(r=>r&&this.plugins.add($(t,r))),()=>{t.forEach(r=>this.plugins.delete(r))}}exec(e,t,r){let n=t,s=Object.freeze(Object.create(r));for(let i of this.plugins)i.type===e&&(n=i.action(n,s));return n}};O();function Sl(e){let t="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(i,o){return r.includes(o.method)?Cs(i,t):i}},{type:"spawn.after",action(i,o){o.commands.includes(t)&&o.spawned.stderr?.on("data",a=>{let l=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(a.toString("utf8"));l&&e({method:o.method,stage:Al(l[1]),progress:L(l[2]),processed:L(l[3]),total:L(l[4])})})}}]}function Al(e){return String(e.toLowerCase().split(" ",1))||"unknown"}O();function El(e){let t=Os(e,["uid","gid"]);return{type:"spawn.options",action(r){return{...t,...r}}}}function $l({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,s){let i;function o(){i&&clearTimeout(i),i=setTimeout(l,e)}function a(){s.spawned.stdout?.off("data",o),s.spawned.stderr?.off("data",o),s.spawned.off("exit",a),s.spawned.off("close",a),i&&clearTimeout(i)}function l(){a(),s.kill(new St(void 0,"timeout","block timeout reached"))}r&&s.spawned.stdout?.on("data",o),t&&s.spawned.stderr?.on("data",o),s.spawned.on("exit",a),s.spawned.on("close",a),o()}}}Xt();function Rl(){return{type:"spawn.args",action(e){let t=[],r;function n(s){(r=r||[]).push(...s)}for(let s=0;s<e.length;s++){let i=e[s];if(we(i)){n(Ln(i));continue}if(i==="--"){n(e.slice(s+1).flatMap(o=>we(o)&&Ln(o)||o));break}t.push(i)}return r?[...t,"--",...r.map(String)]:t}}}O();var Fl=ll();function Ml(e,t){let r=new xl,n=Es(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!Lr(n.baseDir))throw new hl(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(_l(n.config)),r.add(gl(n.unsafe)),r.add(Rl()),r.add(bl(n.completion)),n.abort&&r.add(fl(n.abort)),n.progress&&r.add(Sl(n.progress)),n.timeout&&r.add($l(n.timeout)),n.spawnOptions&&r.add(El(n.spawnOptions)),r.add(ps(Ol(!0))),n.errors&&r.add(ps(n.errors)),Cl(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new Fl(n,r)}zt();var go=Ml;var bo="@lntvow/dev",yo="4.4.3";w();var nn=Tt(nr(),1);import ie from"fs";import Le from"path";import{fileURLToPath as Dl}from"url";var Pl=Dl(import.meta.url),Il=Le.dirname(Pl);function vo(e,t){ie.existsSync(t)||ie.mkdirSync(t),ie.readdirSync(e,{withFileTypes:!0}).forEach(n=>{let s=Le.resolve(e,n.name),i=Le.resolve(t,n.name);if(n.isDirectory())vo(s,i);else{if(ie.existsSync(i))return;ie.copyFileSync(s,i)}})}function Co(){console.log(nn.default.blue("Start copying template files")),vo(Le.resolve(Il,"./configs"),process.cwd()),console.log(nn.default.green("Template files copied successfully"))}sn.default.extend(wo.default);console.log(Ct.default.blue(`Cwd is ${process.cwd()}`));Jt.name(bo).version(yo,"-v, --version","output the version number");Jt.command("init").option("-t, --temp","copy template files",!0).option("--no-temp","not copy template files").option("-g, --git","init simple-git-hooks",!0).option("--no-git","not init simple-git-hooks").option("-s, --scripts","init scripts",!0).option("--no-scripts","not init scripts").description("init project").action(e=>{console.log(Ct.default.green("Init project by @lntvow/dev"));let{temp:t,git:r,scripts:n}=e;if(t&&Co(),r){console.log(Ct.default.blue("Start init simple-git-hooks"));let s=Ll("npx simple-git-hooks");console.log(s.toString())}if(n){console.log(Ct.default.blue("Start init scripts"));try{let s=Hl(process.cwd(),"package.json"),i=JSON.parse(jl(s,"utf-8"));i={...i,scripts:{postinstall:"simple-git-hooks",rimraf:"rimraf ./node_modules/",commit:"git add . && git-cz && git push",release:"git add . && bumpp package.json --all --no-tag --no-print-commits","lint:eslint":'eslint "src/**/*.{js,jsx,ts,tsx,vue}" --fix',"lint:tsc":"tsc --noEmit",lint:"run-p lint:eslint lint:tsc",ncu:"ncu -u && pnpm install",...i.scripts}},Nl(s,JSON.stringify(i,null,2)),console.log(Ct.default.green("Scripts added successfully"))}catch{console.log(Ct.default.yellow("No package.json file found ignoring scripts"))}}console.log(Ct.default.yellow(`
36
+ You may need to re-execute the "pnpm install" command`))});Jt.command("release").description("git release").action(async()=>{console.log(Ct.default.green("Release project...")),await Bl()});Jt.parse();async function Bl(){let e=go(),t=(0,sn.default)().format("YYYYMMDD");await e.cwd(process.cwd()),await e.pull(),await e.add("."),await e.commit(t,"--no-verify"),await e.push("origin"),console.log(Ct.default.green(`Changes committed with message: ${t}`))}