\\d+)m|\\${ANSI_ESCAPE_LINK}(?.*)${ANSI_ESCAPE_BELL})`).exec(preString.slice(preStringIndex)) || { groups: {} };
+ if (groups.code !== void 0) {
+ const code2 = Number.parseFloat(groups.code);
+ escapeCode = code2 === END_CODE ? void 0 : code2;
+ } else if (groups.uri !== void 0) {
+ escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
+ }
+ }
+ const code = ansi_styles_default.codes.get(Number(escapeCode));
+ if (pre[index2 + 1] === "\n") {
+ if (escapeUrl) {
+ returnValue += wrapAnsiHyperlink("");
+ }
+ if (escapeCode && code) {
+ returnValue += wrapAnsiCode(code);
+ }
+ } else if (character === "\n") {
+ if (escapeCode && code) {
+ returnValue += wrapAnsiCode(escapeCode);
+ }
+ if (escapeUrl) {
+ returnValue += wrapAnsiHyperlink(escapeUrl);
+ }
}
- if (!args[i6])
- args[i6] = "";
- args[i6] += c6;
+ preStringIndex += character.length;
}
- return args;
+ return returnValue;
+ };
+ }
+});
+
+// node_modules/cliui/index.mjs
+function ui2(opts) {
+ return cliui(opts, {
+ stringWidth,
+ stripAnsi: stripAnsi3,
+ wrap: wrapAnsi
+ });
+}
+var init_cliui = __esm({
+ "node_modules/cliui/index.mjs"() {
+ "use strict";
+ init_lib();
+ init_string_width();
+ init_strip_ansi();
+ init_wrap_ansi();
+ }
+});
+
+// node_modules/escalade/sync/index.mjs
+import { dirname as dirname2, resolve as resolve4 } from "path";
+import { readdirSync as readdirSync3, statSync as statSync2 } from "fs";
+function sync_default(start, callback) {
+ let dir2 = resolve4(".", start);
+ let tmp, stats = statSync2(dir2);
+ if (!stats.isDirectory()) {
+ dir2 = dirname2(dir2);
+ }
+ while (true) {
+ tmp = callback(dir2, readdirSync3(dir2));
+ if (tmp) return resolve4(dir2, tmp);
+ dir2 = dirname2(tmp = dir2);
+ if (tmp === dir2) break;
+ }
+}
+var init_sync = __esm({
+ "node_modules/escalade/sync/index.mjs"() {
+ "use strict";
+ }
+});
+
+// node_modules/yargs/node_modules/yargs-parser/build/lib/string-utils.js
+function camelCase(str) {
+ const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase();
+ if (!isCamelCase) {
+ str = str.toLowerCase();
+ }
+ if (str.indexOf("-") === -1 && str.indexOf("_") === -1) {
+ return str;
+ } else {
+ let camelcase = "";
+ let nextChrUpper = false;
+ const leadingHyphens = str.match(/^-+/);
+ for (let i6 = leadingHyphens ? leadingHyphens[0].length : 0; i6 < str.length; i6++) {
+ let chr = str.charAt(i6);
+ if (nextChrUpper) {
+ nextChrUpper = false;
+ chr = chr.toUpperCase();
+ }
+ if (i6 !== 0 && (chr === "-" || chr === "_")) {
+ nextChrUpper = true;
+ } else if (chr !== "-" && chr !== "_") {
+ camelcase += chr;
+ }
+ }
+ return camelcase;
+ }
+}
+function decamelize(str, joinString) {
+ const lowercase = str.toLowerCase();
+ joinString = joinString || "-";
+ let notCamelcase = "";
+ for (let i6 = 0; i6 < str.length; i6++) {
+ const chrLower = lowercase.charAt(i6);
+ const chrString = str.charAt(i6);
+ if (chrLower !== chrString && i6 > 0) {
+ notCamelcase += `${joinString}${lowercase.charAt(i6)}`;
+ } else {
+ notCamelcase += chrString;
}
- var DefaultValuesForTypeKey;
+ }
+ return notCamelcase;
+}
+function looksLikeNumber(x2) {
+ if (x2 === null || x2 === void 0)
+ return false;
+ if (typeof x2 === "number")
+ return true;
+ if (/^0x[0-9a-f]+$/i.test(x2))
+ return true;
+ if (/^0[^.]/.test(x2))
+ return false;
+ return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x2);
+}
+var init_string_utils = __esm({
+ "node_modules/yargs/node_modules/yargs-parser/build/lib/string-utils.js"() {
+ "use strict";
+ }
+});
+
+// node_modules/yargs/node_modules/yargs-parser/build/lib/tokenize-arg-string.js
+function tokenizeArgString(argString) {
+ if (Array.isArray(argString)) {
+ return argString.map((e6) => typeof e6 !== "string" ? e6 + "" : e6);
+ }
+ argString = argString.trim();
+ let i6 = 0;
+ let prevC = null;
+ let c6 = null;
+ let opening = null;
+ const args = [];
+ for (let ii2 = 0; ii2 < argString.length; ii2++) {
+ prevC = c6;
+ c6 = argString.charAt(ii2);
+ if (c6 === " " && !opening) {
+ if (!(prevC === " ")) {
+ i6++;
+ }
+ continue;
+ }
+ if (c6 === opening) {
+ opening = null;
+ } else if ((c6 === "'" || c6 === '"') && !opening) {
+ opening = c6;
+ }
+ if (!args[i6])
+ args[i6] = "";
+ args[i6] += c6;
+ }
+ return args;
+}
+var init_tokenize_arg_string = __esm({
+ "node_modules/yargs/node_modules/yargs-parser/build/lib/tokenize-arg-string.js"() {
+ "use strict";
+ }
+});
+
+// node_modules/yargs/node_modules/yargs-parser/build/lib/yargs-parser-types.js
+var DefaultValuesForTypeKey;
+var init_yargs_parser_types = __esm({
+ "node_modules/yargs/node_modules/yargs-parser/build/lib/yargs-parser-types.js"() {
+ "use strict";
(function(DefaultValuesForTypeKey2) {
DefaultValuesForTypeKey2["BOOLEAN"] = "boolean";
DefaultValuesForTypeKey2["STRING"] = "string";
DefaultValuesForTypeKey2["NUMBER"] = "number";
DefaultValuesForTypeKey2["ARRAY"] = "array";
})(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {}));
- var mixin;
- var YargsParser = class {
+ }
+});
+
+// node_modules/yargs/node_modules/yargs-parser/build/lib/yargs-parser.js
+function combineAliases(aliases) {
+ const aliasArrays = [];
+ const combined = /* @__PURE__ */ Object.create(null);
+ let change = true;
+ Object.keys(aliases).forEach(function(key) {
+ aliasArrays.push([].concat(aliases[key], key));
+ });
+ while (change) {
+ change = false;
+ for (let i6 = 0; i6 < aliasArrays.length; i6++) {
+ for (let ii2 = i6 + 1; ii2 < aliasArrays.length; ii2++) {
+ const intersect = aliasArrays[i6].filter(function(v2) {
+ return aliasArrays[ii2].indexOf(v2) !== -1;
+ });
+ if (intersect.length) {
+ aliasArrays[i6] = aliasArrays[i6].concat(aliasArrays[ii2]);
+ aliasArrays.splice(ii2, 1);
+ change = true;
+ break;
+ }
+ }
+ }
+ }
+ aliasArrays.forEach(function(aliasArray) {
+ aliasArray = aliasArray.filter(function(v2, i6, self2) {
+ return self2.indexOf(v2) === i6;
+ });
+ const lastAlias = aliasArray.pop();
+ if (lastAlias !== void 0 && typeof lastAlias === "string") {
+ combined[lastAlias] = aliasArray;
+ }
+ });
+ return combined;
+}
+function increment(orig) {
+ return orig !== void 0 ? orig + 1 : 1;
+}
+function sanitizeKey(key) {
+ if (key === "__proto__")
+ return "___proto___";
+ return key;
+}
+function stripQuotes(val) {
+ return typeof val === "string" && (val[0] === "'" || val[0] === '"') && val[val.length - 1] === val[0] ? val.substring(1, val.length - 1) : val;
+}
+var mixin2, YargsParser;
+var init_yargs_parser = __esm({
+ "node_modules/yargs/node_modules/yargs-parser/build/lib/yargs-parser.js"() {
+ "use strict";
+ init_tokenize_arg_string();
+ init_yargs_parser_types();
+ init_string_utils();
+ YargsParser = class {
constructor(_mixin) {
- mixin = _mixin;
+ mixin2 = _mixin;
}
parse(argsInput, options) {
const opts = Object.assign({
@@ -93976,7 +94831,7 @@ var require_build2 = __commonJS({
const notFlagsArgv = notFlagsOption ? "--" : "_";
const newAliases = /* @__PURE__ */ Object.create(null);
const defaulted = /* @__PURE__ */ Object.create(null);
- const __ = opts.__ || mixin.format;
+ const __ = opts.__ || mixin2.format;
const flags = {
aliases: /* @__PURE__ */ Object.create(null),
arrays: /* @__PURE__ */ Object.create(null),
@@ -94046,6 +94901,7 @@ var require_build2 = __commonJS({
}
if (typeof opts.config !== "undefined") {
if (Array.isArray(opts.config) || typeof opts.config === "string") {
+ ;
[].concat(opts.config).filter(Boolean).forEach(function(key) {
flags.configs[key] = true;
});
@@ -94074,7 +94930,7 @@ var require_build2 = __commonJS({
let broken;
let key;
let letters;
- let m6;
+ let m3;
let next;
let value;
if (arg !== "--" && /^-/.test(arg) && isUnknownOptionAsArg(arg)) {
@@ -94083,26 +94939,26 @@ var require_build2 = __commonJS({
pushPositional(arg);
continue;
} else if (arg.match(/^--.+=/) || !configuration["short-option-groups"] && arg.match(/^-.+=/)) {
- m6 = arg.match(/^--?([^=]+)=([\s\S]*)$/);
- if (m6 !== null && Array.isArray(m6) && m6.length >= 3) {
- if (checkAllAliases(m6[1], flags.arrays)) {
- i6 = eatArray(i6, m6[1], args, m6[2]);
- } else if (checkAllAliases(m6[1], flags.nargs) !== false) {
- i6 = eatNargs(i6, m6[1], args, m6[2]);
+ m3 = arg.match(/^--?([^=]+)=([\s\S]*)$/);
+ if (m3 !== null && Array.isArray(m3) && m3.length >= 3) {
+ if (checkAllAliases(m3[1], flags.arrays)) {
+ i6 = eatArray(i6, m3[1], args, m3[2]);
+ } else if (checkAllAliases(m3[1], flags.nargs) !== false) {
+ i6 = eatNargs(i6, m3[1], args, m3[2]);
} else {
- setArg(m6[1], m6[2], true);
+ setArg(m3[1], m3[2], true);
}
}
} else if (arg.match(negatedBoolean) && configuration["boolean-negation"]) {
- m6 = arg.match(negatedBoolean);
- if (m6 !== null && Array.isArray(m6) && m6.length >= 2) {
- key = m6[1];
+ m3 = arg.match(negatedBoolean);
+ if (m3 !== null && Array.isArray(m3) && m3.length >= 2) {
+ key = m3[1];
setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false);
}
} else if (arg.match(/^--.+/) || !configuration["short-option-groups"] && arg.match(/^-[^-]+/)) {
- m6 = arg.match(/^--?(.+)/);
- if (m6 !== null && Array.isArray(m6) && m6.length >= 2) {
- key = m6[1];
+ m3 = arg.match(/^--?(.+)/);
+ if (m3 !== null && Array.isArray(m3) && m3.length >= 2) {
+ key = m3[1];
if (checkAllAliases(key, flags.arrays)) {
i6 = eatArray(i6, key, args);
} else if (checkAllAliases(key, flags.nargs) !== false) {
@@ -94121,15 +94977,15 @@ var require_build2 = __commonJS({
}
}
} else if (arg.match(/^-.\..+=/)) {
- m6 = arg.match(/^-([^=]+)=([\s\S]*)$/);
- if (m6 !== null && Array.isArray(m6) && m6.length >= 3) {
- setArg(m6[1], m6[2]);
+ m3 = arg.match(/^-([^=]+)=([\s\S]*)$/);
+ if (m3 !== null && Array.isArray(m3) && m3.length >= 3) {
+ setArg(m3[1], m3[2]);
}
} else if (arg.match(/^-.\..+/) && !arg.match(negative)) {
next = args[i6 + 1];
- m6 = arg.match(/^-(.\..+)/);
- if (m6 !== null && Array.isArray(m6) && m6.length >= 2) {
- key = m6[1];
+ m3 = arg.match(/^-(.\..+)/);
+ if (m3 !== null && Array.isArray(m3) && m3.length >= 2) {
+ key = m3[1];
if (next !== void 0 && !next.match(/^-/) && !checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts)) {
setArg(key, next);
i6++;
@@ -94227,6 +95083,7 @@ var require_build2 = __commonJS({
});
}
if (configuration["strip-aliased"]) {
+ ;
[].concat(...Object.keys(aliases).map((k7) => aliases[k7])).forEach((alias) => {
if (configuration["camel-case-expansion"] && alias.includes("-")) {
delete argv[alias.split(".").map((prop) => camelCase(prop)).join(".")];
@@ -94319,14 +95176,15 @@ var require_build2 = __commonJS({
const splitKey = key.split(".");
setKey(argv, splitKey, value);
if (flags.aliases[key]) {
- flags.aliases[key].forEach(function(x6) {
- const keyProperties = x6.split(".");
+ flags.aliases[key].forEach(function(x2) {
+ const keyProperties = x2.split(".");
setKey(argv, keyProperties, value);
});
}
if (splitKey.length > 1 && configuration["dot-notation"]) {
- (flags.aliases[splitKey[0]] || []).forEach(function(x6) {
- let keyProperties = x6.split(".");
+ ;
+ (flags.aliases[splitKey[0]] || []).forEach(function(x2) {
+ let keyProperties = x2.split(".");
const a6 = [].concat(splitKey);
a6.shift();
keyProperties = keyProperties.concat(a6);
@@ -94344,7 +95202,7 @@ var require_build2 = __commonJS({
return val;
},
set(value2) {
- val = typeof value2 === "string" ? mixin.normalize(value2) : value2;
+ val = typeof value2 === "string" ? mixin2.normalize(value2) : value2;
}
});
});
@@ -94367,8 +95225,8 @@ var require_build2 = __commonJS({
if (typeof val === "string")
val = val === "true";
}
- let value = Array.isArray(val) ? val.map(function(v8) {
- return maybeCoerceNumber(key, v8);
+ let value = Array.isArray(val) ? val.map(function(v2) {
+ return maybeCoerceNumber(key, v2);
}) : maybeCoerceNumber(key, val);
if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === "boolean")) {
value = increment();
@@ -94376,10 +95234,10 @@ var require_build2 = __commonJS({
if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) {
if (Array.isArray(val))
value = val.map((val2) => {
- return mixin.normalize(val2);
+ return mixin2.normalize(val2);
});
else
- value = mixin.normalize(val);
+ value = mixin2.normalize(val);
}
return value;
}
@@ -94402,7 +95260,7 @@ var require_build2 = __commonJS({
if (configPath) {
try {
let config = null;
- const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath);
+ const resolvedConfigPath = mixin2.resolve(mixin2.cwd(), configPath);
const resolveConfig = flags.configs[configKey];
if (typeof resolveConfig === "function") {
try {
@@ -94415,7 +95273,7 @@ var require_build2 = __commonJS({
return;
}
} else {
- config = mixin.require(resolvedConfigPath);
+ config = mixin2.require(resolvedConfigPath);
}
setConfigObject(config);
} catch (ex) {
@@ -94451,7 +95309,7 @@ var require_build2 = __commonJS({
if (typeof envPrefix === "undefined")
return;
const prefix2 = typeof envPrefix === "string" ? envPrefix : "";
- const env3 = mixin.env();
+ const env3 = mixin2.env();
Object.keys(env3).forEach(function(envVar) {
if (prefix2 === "" || envVar.lastIndexOf(prefix2, 0) === 0) {
const keys = envVar.split("__").map(function(key, i6) {
@@ -94501,45 +95359,45 @@ var require_build2 = __commonJS({
setKey(obj, key.split("."), defaults5[key]);
if (canLog)
defaulted[key] = true;
- (aliases2[key] || []).forEach(function(x6) {
- if (hasKey(obj, x6.split(".")))
+ (aliases2[key] || []).forEach(function(x2) {
+ if (hasKey(obj, x2.split(".")))
return;
- setKey(obj, x6.split("."), defaults5[key]);
+ setKey(obj, x2.split("."), defaults5[key]);
});
}
});
}
function hasKey(obj, keys) {
- let o6 = obj;
+ let o2 = obj;
if (!configuration["dot-notation"])
keys = [keys.join(".")];
keys.slice(0, -1).forEach(function(key2) {
- o6 = o6[key2] || {};
+ o2 = o2[key2] || {};
});
const key = keys[keys.length - 1];
- if (typeof o6 !== "object")
+ if (typeof o2 !== "object")
return false;
else
- return key in o6;
+ return key in o2;
}
function setKey(obj, keys, value) {
- let o6 = obj;
+ let o2 = obj;
if (!configuration["dot-notation"])
keys = [keys.join(".")];
keys.slice(0, -1).forEach(function(key2) {
key2 = sanitizeKey(key2);
- if (typeof o6 === "object" && o6[key2] === void 0) {
- o6[key2] = {};
+ if (typeof o2 === "object" && o2[key2] === void 0) {
+ o2[key2] = {};
}
- if (typeof o6[key2] !== "object" || Array.isArray(o6[key2])) {
- if (Array.isArray(o6[key2])) {
- o6[key2].push({});
+ if (typeof o2[key2] !== "object" || Array.isArray(o2[key2])) {
+ if (Array.isArray(o2[key2])) {
+ o2[key2].push({});
} else {
- o6[key2] = [o6[key2], {}];
+ o2[key2] = [o2[key2], {}];
}
- o6 = o6[key2][o6[key2].length - 1];
+ o2 = o2[key2][o2[key2].length - 1];
} else {
- o6 = o6[key2];
+ o2 = o2[key2];
}
});
const key = sanitizeKey(keys[keys.length - 1]);
@@ -94548,26 +95406,26 @@ var require_build2 = __commonJS({
let duplicate = configuration["duplicate-arguments-array"];
if (!duplicate && checkAllAliases(key, flags.nargs)) {
duplicate = true;
- if (!isUndefined(o6[key]) && flags.nargs[key] === 1 || Array.isArray(o6[key]) && o6[key].length === flags.nargs[key]) {
- o6[key] = void 0;
+ if (!isUndefined(o2[key]) && flags.nargs[key] === 1 || Array.isArray(o2[key]) && o2[key].length === flags.nargs[key]) {
+ o2[key] = void 0;
}
}
if (value === increment()) {
- o6[key] = increment(o6[key]);
- } else if (Array.isArray(o6[key])) {
+ o2[key] = increment(o2[key]);
+ } else if (Array.isArray(o2[key])) {
if (duplicate && isTypeArray && isValueArray) {
- o6[key] = configuration["flatten-duplicate-arrays"] ? o6[key].concat(value) : (Array.isArray(o6[key][0]) ? o6[key] : [o6[key]]).concat([value]);
+ o2[key] = configuration["flatten-duplicate-arrays"] ? o2[key].concat(value) : (Array.isArray(o2[key][0]) ? o2[key] : [o2[key]]).concat([value]);
} else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) {
- o6[key] = value;
+ o2[key] = value;
} else {
- o6[key] = o6[key].concat([value]);
+ o2[key] = o2[key].concat([value]);
}
- } else if (o6[key] === void 0 && isTypeArray) {
- o6[key] = isValueArray ? value : [value];
- } else if (duplicate && !(o6[key] === void 0 || checkAllAliases(key, flags.counts) || checkAllAliases(key, flags.bools))) {
- o6[key] = [o6[key], value];
+ } else if (o2[key] === void 0 && isTypeArray) {
+ o2[key] = isValueArray ? value : [value];
+ } else if (duplicate && !(o2[key] === void 0 || checkAllAliases(key, flags.counts) || checkAllAliases(key, flags.bools))) {
+ o2[key] = [o2[key], value];
} else {
- o6[key] = value;
+ o2[key] = value;
}
}
function extendAliases(...args2) {
@@ -94576,27 +95434,27 @@ var require_build2 = __commonJS({
if (flags.aliases[key])
return;
flags.aliases[key] = [].concat(aliases[key] || []);
- flags.aliases[key].concat(key).forEach(function(x6) {
- if (/-/.test(x6) && configuration["camel-case-expansion"]) {
- const c6 = camelCase(x6);
+ flags.aliases[key].concat(key).forEach(function(x2) {
+ if (/-/.test(x2) && configuration["camel-case-expansion"]) {
+ const c6 = camelCase(x2);
if (c6 !== key && flags.aliases[key].indexOf(c6) === -1) {
flags.aliases[key].push(c6);
newAliases[c6] = true;
}
}
});
- flags.aliases[key].concat(key).forEach(function(x6) {
- if (x6.length > 1 && /[A-Z]/.test(x6) && configuration["camel-case-expansion"]) {
- const c6 = decamelize(x6, "-");
+ flags.aliases[key].concat(key).forEach(function(x2) {
+ if (x2.length > 1 && /[A-Z]/.test(x2) && configuration["camel-case-expansion"]) {
+ const c6 = decamelize(x2, "-");
if (c6 !== key && flags.aliases[key].indexOf(c6) === -1) {
flags.aliases[key].push(c6);
newAliases[c6] = true;
}
}
});
- flags.aliases[key].forEach(function(x6) {
- flags.aliases[x6] = [key].concat(flags.aliases[key].filter(function(y2) {
- return x6 !== y2;
+ flags.aliases[key].forEach(function(x2) {
+ flags.aliases[x2] = [key].concat(flags.aliases[key].filter(function(y) {
+ return x2 !== y;
}));
});
});
@@ -94663,7 +95521,7 @@ var require_build2 = __commonJS({
if (!checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts) && `${key}` in defaults4) {
return defaults4[key];
} else {
- return defaultForType(guessType(key));
+ return defaultForType(guessType2(key));
}
}
function defaultForType(type) {
@@ -94675,7 +95533,7 @@ var require_build2 = __commonJS({
};
return def[type];
}
- function guessType(key) {
+ function guessType2(key) {
let type = DefaultValuesForTypeKey.BOOLEAN;
if (checkAllAliases(key, flags.strings))
type = DefaultValuesForTypeKey.STRING;
@@ -94712,1752 +95570,390 @@ var require_build2 = __commonJS({
};
}
};
- function combineAliases(aliases) {
- const aliasArrays = [];
- const combined = /* @__PURE__ */ Object.create(null);
- let change = true;
- Object.keys(aliases).forEach(function(key) {
- aliasArrays.push([].concat(aliases[key], key));
- });
- while (change) {
- change = false;
- for (let i6 = 0; i6 < aliasArrays.length; i6++) {
- for (let ii2 = i6 + 1; ii2 < aliasArrays.length; ii2++) {
- const intersect = aliasArrays[i6].filter(function(v8) {
- return aliasArrays[ii2].indexOf(v8) !== -1;
- });
- if (intersect.length) {
- aliasArrays[i6] = aliasArrays[i6].concat(aliasArrays[ii2]);
- aliasArrays.splice(ii2, 1);
- change = true;
- break;
- }
- }
- }
- }
- aliasArrays.forEach(function(aliasArray) {
- aliasArray = aliasArray.filter(function(v8, i6, self2) {
- return self2.indexOf(v8) === i6;
- });
- const lastAlias = aliasArray.pop();
- if (lastAlias !== void 0 && typeof lastAlias === "string") {
- combined[lastAlias] = aliasArray;
- }
- });
- return combined;
- }
- function increment(orig) {
- return orig !== void 0 ? orig + 1 : 1;
- }
- function sanitizeKey(key) {
- if (key === "__proto__")
- return "___proto___";
- return key;
- }
- function stripQuotes(val) {
- return typeof val === "string" && (val[0] === "'" || val[0] === '"') && val[val.length - 1] === val[0] ? val.substring(1, val.length - 1) : val;
- }
- var _a5;
- var _b2;
- var _c6;
- var minNodeVersion = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12;
- var nodeVersion = (_b2 = (_a5 = process === null || process === void 0 ? void 0 : process.versions) === null || _a5 === void 0 ? void 0 : _a5.node) !== null && _b2 !== void 0 ? _b2 : (_c6 = process === null || process === void 0 ? void 0 : process.version) === null || _c6 === void 0 ? void 0 : _c6.slice(1);
+ }
+});
+
+// node_modules/yargs/node_modules/yargs-parser/build/lib/index.js
+import { format } from "util";
+import { normalize as normalize3, resolve as resolve5 } from "path";
+import { readFileSync as readFileSync4 } from "fs";
+import { createRequire } from "module";
+var _a3, _b, _c, minNodeVersion, nodeVersion, env, require2, parser, yargsParser, lib_default;
+var init_lib2 = __esm({
+ "node_modules/yargs/node_modules/yargs-parser/build/lib/index.js"() {
+ "use strict";
+ init_string_utils();
+ init_yargs_parser();
+ minNodeVersion = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 20;
+ nodeVersion = (_b = (_a3 = process === null || process === void 0 ? void 0 : process.versions) === null || _a3 === void 0 ? void 0 : _a3.node) !== null && _b !== void 0 ? _b : (_c = process === null || process === void 0 ? void 0 : process.version) === null || _c === void 0 ? void 0 : _c.slice(1);
if (nodeVersion) {
const major = Number(nodeVersion.match(/^([^.]+)/)[1]);
if (major < minNodeVersion) {
throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
}
}
- var env2 = process ? process.env : {};
- var parser2 = new YargsParser({
+ env = process ? process.env : {};
+ require2 = createRequire ? createRequire(import.meta.url) : void 0;
+ parser = new YargsParser({
cwd: process.cwd,
env: () => {
- return env2;
- },
- format: util3.format,
- normalize: path10.normalize,
- resolve: path10.resolve,
- require: (path11) => {
- if (typeof __require !== "undefined") {
- return __require(path11);
- } else if (path11.match(/\.json$/)) {
- return JSON.parse(fs16.readFileSync(path11, "utf8"));
+ return env;
+ },
+ format,
+ normalize: normalize3,
+ resolve: resolve5,
+ require: (path10) => {
+ if (typeof require2 !== "undefined") {
+ return require2(path10);
+ } else if (path10.match(/\.json$/)) {
+ return JSON.parse(readFileSync4(path10, "utf8"));
} else {
throw Error("only .json config files are supported in ESM");
}
}
});
- var yargsParser = function Parser(args, opts) {
- const result = parser2.parse(args.slice(), opts);
+ yargsParser = function Parser(args, opts) {
+ const result = parser.parse(args.slice(), opts);
return result.argv;
};
yargsParser.detailed = function(args, opts) {
- return parser2.parse(args.slice(), opts);
+ return parser.parse(args.slice(), opts);
};
yargsParser.camelCase = camelCase;
yargsParser.decamelize = decamelize;
yargsParser.looksLikeNumber = looksLikeNumber;
- module.exports = yargsParser;
+ lib_default = yargsParser;
}
});
-// node_modules/ansi-regex/index.js
-var require_ansi_regex = __commonJS({
- "node_modules/ansi-regex/index.js"(exports2, module) {
+// node_modules/yargs/build/lib/utils/process-argv.js
+function getProcessArgvBinIndex() {
+ if (isBundledElectronApp())
+ return 0;
+ return 1;
+}
+function isBundledElectronApp() {
+ return isElectronApp() && !process.defaultApp;
+}
+function isElectronApp() {
+ return !!process.versions.electron;
+}
+function hideBin(argv) {
+ return argv.slice(getProcessArgvBinIndex() + 1);
+}
+function getProcessArgvBin() {
+ return process.argv[getProcessArgvBinIndex()];
+}
+var init_process_argv = __esm({
+ "node_modules/yargs/build/lib/utils/process-argv.js"() {
"use strict";
- module.exports = ({ onlyFirst = false } = {}) => {
- const pattern = [
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
- ].join("|");
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
- };
}
});
-// node_modules/strip-ansi/index.js
-var require_strip_ansi = __commonJS({
- "node_modules/strip-ansi/index.js"(exports2, module) {
+// node_modules/yargs/node_modules/ansi-regex/index.js
+function ansiRegex4({ onlyFirst = false } = {}) {
+ const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
+ const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
+ const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
+ const pattern = `${osc}|${csi}`;
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
+}
+var init_ansi_regex2 = __esm({
+ "node_modules/yargs/node_modules/ansi-regex/index.js"() {
"use strict";
- var ansiRegex3 = require_ansi_regex();
- module.exports = (string) => typeof string === "string" ? string.replace(ansiRegex3(), "") : string;
}
});
-// node_modules/is-fullwidth-code-point/index.js
-var require_is_fullwidth_code_point = __commonJS({
- "node_modules/is-fullwidth-code-point/index.js"(exports2, module) {
- "use strict";
- var isFullwidthCodePoint = (codePoint) => {
- if (Number.isNaN(codePoint)) {
- return false;
- }
- if (codePoint >= 4352 && (codePoint <= 4447 || // Hangul Jamo
- codePoint === 9001 || // LEFT-POINTING ANGLE BRACKET
- codePoint === 9002 || // RIGHT-POINTING ANGLE BRACKET
- // CJK Radicals Supplement .. Enclosed CJK Letters and Months
- 11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
- 12880 <= codePoint && codePoint <= 19903 || // CJK Unified Ideographs .. Yi Radicals
- 19968 <= codePoint && codePoint <= 42182 || // Hangul Jamo Extended-A
- 43360 <= codePoint && codePoint <= 43388 || // Hangul Syllables
- 44032 <= codePoint && codePoint <= 55203 || // CJK Compatibility Ideographs
- 63744 <= codePoint && codePoint <= 64255 || // Vertical Forms
- 65040 <= codePoint && codePoint <= 65049 || // CJK Compatibility Forms .. Small Form Variants
- 65072 <= codePoint && codePoint <= 65131 || // Halfwidth and Fullwidth Forms
- 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || // Kana Supplement
- 110592 <= codePoint && codePoint <= 110593 || // Enclosed Ideographic Supplement
- 127488 <= codePoint && codePoint <= 127569 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
- 131072 <= codePoint && codePoint <= 262141)) {
- return true;
- }
- return false;
- };
- module.exports = isFullwidthCodePoint;
- module.exports.default = isFullwidthCodePoint;
+// node_modules/yargs/node_modules/strip-ansi/index.js
+function stripAnsi4(string) {
+ if (typeof string !== "string") {
+ throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
}
-});
-
-// node_modules/emoji-regex/index.js
-var require_emoji_regex = __commonJS({
- "node_modules/emoji-regex/index.js"(exports2, module) {
- "use strict";
- module.exports = function() {
- return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
- };
+ if (!string.includes("\x1B") && !string.includes("\x9B")) {
+ return string;
}
-});
-
-// node_modules/string-width/index.js
-var require_string_width = __commonJS({
- "node_modules/string-width/index.js"(exports2, module) {
+ return string.replace(regex2, "");
+}
+var regex2;
+var init_strip_ansi2 = __esm({
+ "node_modules/yargs/node_modules/strip-ansi/index.js"() {
"use strict";
- var stripAnsi3 = require_strip_ansi();
- var isFullwidthCodePoint = require_is_fullwidth_code_point();
- var emojiRegex = require_emoji_regex();
- var stringWidth = (string) => {
- if (typeof string !== "string" || string.length === 0) {
- return 0;
- }
- string = stripAnsi3(string);
- if (string.length === 0) {
- return 0;
- }
- string = string.replace(emojiRegex(), " ");
- let width = 0;
- for (let i6 = 0; i6 < string.length; i6++) {
- const code = string.codePointAt(i6);
- if (code <= 31 || code >= 127 && code <= 159) {
- continue;
- }
- if (code >= 768 && code <= 879) {
- continue;
- }
- if (code > 65535) {
- i6++;
- }
- width += isFullwidthCodePoint(code) ? 2 : 1;
- }
- return width;
- };
- module.exports = stringWidth;
- module.exports.default = stringWidth;
+ init_ansi_regex2();
+ regex2 = ansiRegex4();
}
});
-// node_modules/color-name/index.js
-var require_color_name = __commonJS({
- "node_modules/color-name/index.js"(exports2, module) {
+// node_modules/yargs/node_modules/emoji-regex/index.mjs
+var emoji_regex_default2;
+var init_emoji_regex2 = __esm({
+ "node_modules/yargs/node_modules/emoji-regex/index.mjs"() {
"use strict";
- module.exports = {
- "aliceblue": [240, 248, 255],
- "antiquewhite": [250, 235, 215],
- "aqua": [0, 255, 255],
- "aquamarine": [127, 255, 212],
- "azure": [240, 255, 255],
- "beige": [245, 245, 220],
- "bisque": [255, 228, 196],
- "black": [0, 0, 0],
- "blanchedalmond": [255, 235, 205],
- "blue": [0, 0, 255],
- "blueviolet": [138, 43, 226],
- "brown": [165, 42, 42],
- "burlywood": [222, 184, 135],
- "cadetblue": [95, 158, 160],
- "chartreuse": [127, 255, 0],
- "chocolate": [210, 105, 30],
- "coral": [255, 127, 80],
- "cornflowerblue": [100, 149, 237],
- "cornsilk": [255, 248, 220],
- "crimson": [220, 20, 60],
- "cyan": [0, 255, 255],
- "darkblue": [0, 0, 139],
- "darkcyan": [0, 139, 139],
- "darkgoldenrod": [184, 134, 11],
- "darkgray": [169, 169, 169],
- "darkgreen": [0, 100, 0],
- "darkgrey": [169, 169, 169],
- "darkkhaki": [189, 183, 107],
- "darkmagenta": [139, 0, 139],
- "darkolivegreen": [85, 107, 47],
- "darkorange": [255, 140, 0],
- "darkorchid": [153, 50, 204],
- "darkred": [139, 0, 0],
- "darksalmon": [233, 150, 122],
- "darkseagreen": [143, 188, 143],
- "darkslateblue": [72, 61, 139],
- "darkslategray": [47, 79, 79],
- "darkslategrey": [47, 79, 79],
- "darkturquoise": [0, 206, 209],
- "darkviolet": [148, 0, 211],
- "deeppink": [255, 20, 147],
- "deepskyblue": [0, 191, 255],
- "dimgray": [105, 105, 105],
- "dimgrey": [105, 105, 105],
- "dodgerblue": [30, 144, 255],
- "firebrick": [178, 34, 34],
- "floralwhite": [255, 250, 240],
- "forestgreen": [34, 139, 34],
- "fuchsia": [255, 0, 255],
- "gainsboro": [220, 220, 220],
- "ghostwhite": [248, 248, 255],
- "gold": [255, 215, 0],
- "goldenrod": [218, 165, 32],
- "gray": [128, 128, 128],
- "green": [0, 128, 0],
- "greenyellow": [173, 255, 47],
- "grey": [128, 128, 128],
- "honeydew": [240, 255, 240],
- "hotpink": [255, 105, 180],
- "indianred": [205, 92, 92],
- "indigo": [75, 0, 130],
- "ivory": [255, 255, 240],
- "khaki": [240, 230, 140],
- "lavender": [230, 230, 250],
- "lavenderblush": [255, 240, 245],
- "lawngreen": [124, 252, 0],
- "lemonchiffon": [255, 250, 205],
- "lightblue": [173, 216, 230],
- "lightcoral": [240, 128, 128],
- "lightcyan": [224, 255, 255],
- "lightgoldenrodyellow": [250, 250, 210],
- "lightgray": [211, 211, 211],
- "lightgreen": [144, 238, 144],
- "lightgrey": [211, 211, 211],
- "lightpink": [255, 182, 193],
- "lightsalmon": [255, 160, 122],
- "lightseagreen": [32, 178, 170],
- "lightskyblue": [135, 206, 250],
- "lightslategray": [119, 136, 153],
- "lightslategrey": [119, 136, 153],
- "lightsteelblue": [176, 196, 222],
- "lightyellow": [255, 255, 224],
- "lime": [0, 255, 0],
- "limegreen": [50, 205, 50],
- "linen": [250, 240, 230],
- "magenta": [255, 0, 255],
- "maroon": [128, 0, 0],
- "mediumaquamarine": [102, 205, 170],
- "mediumblue": [0, 0, 205],
- "mediumorchid": [186, 85, 211],
- "mediumpurple": [147, 112, 219],
- "mediumseagreen": [60, 179, 113],
- "mediumslateblue": [123, 104, 238],
- "mediumspringgreen": [0, 250, 154],
- "mediumturquoise": [72, 209, 204],
- "mediumvioletred": [199, 21, 133],
- "midnightblue": [25, 25, 112],
- "mintcream": [245, 255, 250],
- "mistyrose": [255, 228, 225],
- "moccasin": [255, 228, 181],
- "navajowhite": [255, 222, 173],
- "navy": [0, 0, 128],
- "oldlace": [253, 245, 230],
- "olive": [128, 128, 0],
- "olivedrab": [107, 142, 35],
- "orange": [255, 165, 0],
- "orangered": [255, 69, 0],
- "orchid": [218, 112, 214],
- "palegoldenrod": [238, 232, 170],
- "palegreen": [152, 251, 152],
- "paleturquoise": [175, 238, 238],
- "palevioletred": [219, 112, 147],
- "papayawhip": [255, 239, 213],
- "peachpuff": [255, 218, 185],
- "peru": [205, 133, 63],
- "pink": [255, 192, 203],
- "plum": [221, 160, 221],
- "powderblue": [176, 224, 230],
- "purple": [128, 0, 128],
- "rebeccapurple": [102, 51, 153],
- "red": [255, 0, 0],
- "rosybrown": [188, 143, 143],
- "royalblue": [65, 105, 225],
- "saddlebrown": [139, 69, 19],
- "salmon": [250, 128, 114],
- "sandybrown": [244, 164, 96],
- "seagreen": [46, 139, 87],
- "seashell": [255, 245, 238],
- "sienna": [160, 82, 45],
- "silver": [192, 192, 192],
- "skyblue": [135, 206, 235],
- "slateblue": [106, 90, 205],
- "slategray": [112, 128, 144],
- "slategrey": [112, 128, 144],
- "snow": [255, 250, 250],
- "springgreen": [0, 255, 127],
- "steelblue": [70, 130, 180],
- "tan": [210, 180, 140],
- "teal": [0, 128, 128],
- "thistle": [216, 191, 216],
- "tomato": [255, 99, 71],
- "turquoise": [64, 224, 208],
- "violet": [238, 130, 238],
- "wheat": [245, 222, 179],
- "white": [255, 255, 255],
- "whitesmoke": [245, 245, 245],
- "yellow": [255, 255, 0],
- "yellowgreen": [154, 205, 50]
- };
- }
-});
-
-// node_modules/color-convert/conversions.js
-var require_conversions = __commonJS({
- "node_modules/color-convert/conversions.js"(exports2, module) {
- "use strict";
- var cssKeywords = require_color_name();
- var reverseKeywords = {};
- for (const key of Object.keys(cssKeywords)) {
- reverseKeywords[cssKeywords[key]] = key;
- }
- var convert2 = {
- rgb: { channels: 3, labels: "rgb" },
- hsl: { channels: 3, labels: "hsl" },
- hsv: { channels: 3, labels: "hsv" },
- hwb: { channels: 3, labels: "hwb" },
- cmyk: { channels: 4, labels: "cmyk" },
- xyz: { channels: 3, labels: "xyz" },
- lab: { channels: 3, labels: "lab" },
- lch: { channels: 3, labels: "lch" },
- hex: { channels: 1, labels: ["hex"] },
- keyword: { channels: 1, labels: ["keyword"] },
- ansi16: { channels: 1, labels: ["ansi16"] },
- ansi256: { channels: 1, labels: ["ansi256"] },
- hcg: { channels: 3, labels: ["h", "c", "g"] },
- apple: { channels: 3, labels: ["r16", "g16", "b16"] },
- gray: { channels: 1, labels: ["gray"] }
- };
- module.exports = convert2;
- for (const model of Object.keys(convert2)) {
- if (!("channels" in convert2[model])) {
- throw new Error("missing channels property: " + model);
- }
- if (!("labels" in convert2[model])) {
- throw new Error("missing channel labels property: " + model);
- }
- if (convert2[model].labels.length !== convert2[model].channels) {
- throw new Error("channel and label counts mismatch: " + model);
- }
- const { channels, labels } = convert2[model];
- delete convert2[model].channels;
- delete convert2[model].labels;
- Object.defineProperty(convert2[model], "channels", { value: channels });
- Object.defineProperty(convert2[model], "labels", { value: labels });
- }
- convert2.rgb.hsl = function(rgb) {
- const r6 = rgb[0] / 255;
- const g6 = rgb[1] / 255;
- const b6 = rgb[2] / 255;
- const min = Math.min(r6, g6, b6);
- const max = Math.max(r6, g6, b6);
- const delta = max - min;
- let h6;
- let s6;
- if (max === min) {
- h6 = 0;
- } else if (r6 === max) {
- h6 = (g6 - b6) / delta;
- } else if (g6 === max) {
- h6 = 2 + (b6 - r6) / delta;
- } else if (b6 === max) {
- h6 = 4 + (r6 - g6) / delta;
- }
- h6 = Math.min(h6 * 60, 360);
- if (h6 < 0) {
- h6 += 360;
- }
- const l6 = (min + max) / 2;
- if (max === min) {
- s6 = 0;
- } else if (l6 <= 0.5) {
- s6 = delta / (max + min);
- } else {
- s6 = delta / (2 - max - min);
- }
- return [h6, s6 * 100, l6 * 100];
- };
- convert2.rgb.hsv = function(rgb) {
- let rdif;
- let gdif;
- let bdif;
- let h6;
- let s6;
- const r6 = rgb[0] / 255;
- const g6 = rgb[1] / 255;
- const b6 = rgb[2] / 255;
- const v8 = Math.max(r6, g6, b6);
- const diff = v8 - Math.min(r6, g6, b6);
- const diffc = function(c6) {
- return (v8 - c6) / 6 / diff + 1 / 2;
- };
- if (diff === 0) {
- h6 = 0;
- s6 = 0;
- } else {
- s6 = diff / v8;
- rdif = diffc(r6);
- gdif = diffc(g6);
- bdif = diffc(b6);
- if (r6 === v8) {
- h6 = bdif - gdif;
- } else if (g6 === v8) {
- h6 = 1 / 3 + rdif - bdif;
- } else if (b6 === v8) {
- h6 = 2 / 3 + gdif - rdif;
- }
- if (h6 < 0) {
- h6 += 1;
- } else if (h6 > 1) {
- h6 -= 1;
- }
- }
- return [
- h6 * 360,
- s6 * 100,
- v8 * 100
- ];
- };
- convert2.rgb.hwb = function(rgb) {
- const r6 = rgb[0];
- const g6 = rgb[1];
- let b6 = rgb[2];
- const h6 = convert2.rgb.hsl(rgb)[0];
- const w5 = 1 / 255 * Math.min(r6, Math.min(g6, b6));
- b6 = 1 - 1 / 255 * Math.max(r6, Math.max(g6, b6));
- return [h6, w5 * 100, b6 * 100];
- };
- convert2.rgb.cmyk = function(rgb) {
- const r6 = rgb[0] / 255;
- const g6 = rgb[1] / 255;
- const b6 = rgb[2] / 255;
- const k7 = Math.min(1 - r6, 1 - g6, 1 - b6);
- const c6 = (1 - r6 - k7) / (1 - k7) || 0;
- const m6 = (1 - g6 - k7) / (1 - k7) || 0;
- const y2 = (1 - b6 - k7) / (1 - k7) || 0;
- return [c6 * 100, m6 * 100, y2 * 100, k7 * 100];
- };
- function comparativeDistance(x6, y2) {
- return (x6[0] - y2[0]) ** 2 + (x6[1] - y2[1]) ** 2 + (x6[2] - y2[2]) ** 2;
- }
- convert2.rgb.keyword = function(rgb) {
- const reversed = reverseKeywords[rgb];
- if (reversed) {
- return reversed;
- }
- let currentClosestDistance = Infinity;
- let currentClosestKeyword;
- for (const keyword of Object.keys(cssKeywords)) {
- const value = cssKeywords[keyword];
- const distance = comparativeDistance(rgb, value);
- if (distance < currentClosestDistance) {
- currentClosestDistance = distance;
- currentClosestKeyword = keyword;
- }
- }
- return currentClosestKeyword;
- };
- convert2.keyword.rgb = function(keyword) {
- return cssKeywords[keyword];
- };
- convert2.rgb.xyz = function(rgb) {
- let r6 = rgb[0] / 255;
- let g6 = rgb[1] / 255;
- let b6 = rgb[2] / 255;
- r6 = r6 > 0.04045 ? ((r6 + 0.055) / 1.055) ** 2.4 : r6 / 12.92;
- g6 = g6 > 0.04045 ? ((g6 + 0.055) / 1.055) ** 2.4 : g6 / 12.92;
- b6 = b6 > 0.04045 ? ((b6 + 0.055) / 1.055) ** 2.4 : b6 / 12.92;
- const x6 = r6 * 0.4124 + g6 * 0.3576 + b6 * 0.1805;
- const y2 = r6 * 0.2126 + g6 * 0.7152 + b6 * 0.0722;
- const z2 = r6 * 0.0193 + g6 * 0.1192 + b6 * 0.9505;
- return [x6 * 100, y2 * 100, z2 * 100];
- };
- convert2.rgb.lab = function(rgb) {
- const xyz = convert2.rgb.xyz(rgb);
- let x6 = xyz[0];
- let y2 = xyz[1];
- let z2 = xyz[2];
- x6 /= 95.047;
- y2 /= 100;
- z2 /= 108.883;
- x6 = x6 > 8856e-6 ? x6 ** (1 / 3) : 7.787 * x6 + 16 / 116;
- y2 = y2 > 8856e-6 ? y2 ** (1 / 3) : 7.787 * y2 + 16 / 116;
- z2 = z2 > 8856e-6 ? z2 ** (1 / 3) : 7.787 * z2 + 16 / 116;
- const l6 = 116 * y2 - 16;
- const a6 = 500 * (x6 - y2);
- const b6 = 200 * (y2 - z2);
- return [l6, a6, b6];
- };
- convert2.hsl.rgb = function(hsl) {
- const h6 = hsl[0] / 360;
- const s6 = hsl[1] / 100;
- const l6 = hsl[2] / 100;
- let t22;
- let t32;
- let val;
- if (s6 === 0) {
- val = l6 * 255;
- return [val, val, val];
- }
- if (l6 < 0.5) {
- t22 = l6 * (1 + s6);
- } else {
- t22 = l6 + s6 - l6 * s6;
- }
- const t1 = 2 * l6 - t22;
- const rgb = [0, 0, 0];
- for (let i6 = 0; i6 < 3; i6++) {
- t32 = h6 + 1 / 3 * -(i6 - 1);
- if (t32 < 0) {
- t32++;
- }
- if (t32 > 1) {
- t32--;
- }
- if (6 * t32 < 1) {
- val = t1 + (t22 - t1) * 6 * t32;
- } else if (2 * t32 < 1) {
- val = t22;
- } else if (3 * t32 < 2) {
- val = t1 + (t22 - t1) * (2 / 3 - t32) * 6;
- } else {
- val = t1;
- }
- rgb[i6] = val * 255;
- }
- return rgb;
- };
- convert2.hsl.hsv = function(hsl) {
- const h6 = hsl[0];
- let s6 = hsl[1] / 100;
- let l6 = hsl[2] / 100;
- let smin = s6;
- const lmin = Math.max(l6, 0.01);
- l6 *= 2;
- s6 *= l6 <= 1 ? l6 : 2 - l6;
- smin *= lmin <= 1 ? lmin : 2 - lmin;
- const v8 = (l6 + s6) / 2;
- const sv = l6 === 0 ? 2 * smin / (lmin + smin) : 2 * s6 / (l6 + s6);
- return [h6, sv * 100, v8 * 100];
- };
- convert2.hsv.rgb = function(hsv) {
- const h6 = hsv[0] / 60;
- const s6 = hsv[1] / 100;
- let v8 = hsv[2] / 100;
- const hi2 = Math.floor(h6) % 6;
- const f6 = h6 - Math.floor(h6);
- const p6 = 255 * v8 * (1 - s6);
- const q7 = 255 * v8 * (1 - s6 * f6);
- const t6 = 255 * v8 * (1 - s6 * (1 - f6));
- v8 *= 255;
- switch (hi2) {
- case 0:
- return [v8, t6, p6];
- case 1:
- return [q7, v8, p6];
- case 2:
- return [p6, v8, t6];
- case 3:
- return [p6, q7, v8];
- case 4:
- return [t6, p6, v8];
- case 5:
- return [v8, p6, q7];
- }
- };
- convert2.hsv.hsl = function(hsv) {
- const h6 = hsv[0];
- const s6 = hsv[1] / 100;
- const v8 = hsv[2] / 100;
- const vmin = Math.max(v8, 0.01);
- let sl;
- let l6;
- l6 = (2 - s6) * v8;
- const lmin = (2 - s6) * vmin;
- sl = s6 * vmin;
- sl /= lmin <= 1 ? lmin : 2 - lmin;
- sl = sl || 0;
- l6 /= 2;
- return [h6, sl * 100, l6 * 100];
- };
- convert2.hwb.rgb = function(hwb) {
- const h6 = hwb[0] / 360;
- let wh = hwb[1] / 100;
- let bl = hwb[2] / 100;
- const ratio = wh + bl;
- let f6;
- if (ratio > 1) {
- wh /= ratio;
- bl /= ratio;
- }
- const i6 = Math.floor(6 * h6);
- const v8 = 1 - bl;
- f6 = 6 * h6 - i6;
- if ((i6 & 1) !== 0) {
- f6 = 1 - f6;
- }
- const n12 = wh + f6 * (v8 - wh);
- let r6;
- let g6;
- let b6;
- switch (i6) {
- default:
- case 6:
- case 0:
- r6 = v8;
- g6 = n12;
- b6 = wh;
- break;
- case 1:
- r6 = n12;
- g6 = v8;
- b6 = wh;
- break;
- case 2:
- r6 = wh;
- g6 = v8;
- b6 = n12;
- break;
- case 3:
- r6 = wh;
- g6 = n12;
- b6 = v8;
- break;
- case 4:
- r6 = n12;
- g6 = wh;
- b6 = v8;
- break;
- case 5:
- r6 = v8;
- g6 = wh;
- b6 = n12;
- break;
- }
- return [r6 * 255, g6 * 255, b6 * 255];
- };
- convert2.cmyk.rgb = function(cmyk) {
- const c6 = cmyk[0] / 100;
- const m6 = cmyk[1] / 100;
- const y2 = cmyk[2] / 100;
- const k7 = cmyk[3] / 100;
- const r6 = 1 - Math.min(1, c6 * (1 - k7) + k7);
- const g6 = 1 - Math.min(1, m6 * (1 - k7) + k7);
- const b6 = 1 - Math.min(1, y2 * (1 - k7) + k7);
- return [r6 * 255, g6 * 255, b6 * 255];
- };
- convert2.xyz.rgb = function(xyz) {
- const x6 = xyz[0] / 100;
- const y2 = xyz[1] / 100;
- const z2 = xyz[2] / 100;
- let r6;
- let g6;
- let b6;
- r6 = x6 * 3.2406 + y2 * -1.5372 + z2 * -0.4986;
- g6 = x6 * -0.9689 + y2 * 1.8758 + z2 * 0.0415;
- b6 = x6 * 0.0557 + y2 * -0.204 + z2 * 1.057;
- r6 = r6 > 31308e-7 ? 1.055 * r6 ** (1 / 2.4) - 0.055 : r6 * 12.92;
- g6 = g6 > 31308e-7 ? 1.055 * g6 ** (1 / 2.4) - 0.055 : g6 * 12.92;
- b6 = b6 > 31308e-7 ? 1.055 * b6 ** (1 / 2.4) - 0.055 : b6 * 12.92;
- r6 = Math.min(Math.max(0, r6), 1);
- g6 = Math.min(Math.max(0, g6), 1);
- b6 = Math.min(Math.max(0, b6), 1);
- return [r6 * 255, g6 * 255, b6 * 255];
- };
- convert2.xyz.lab = function(xyz) {
- let x6 = xyz[0];
- let y2 = xyz[1];
- let z2 = xyz[2];
- x6 /= 95.047;
- y2 /= 100;
- z2 /= 108.883;
- x6 = x6 > 8856e-6 ? x6 ** (1 / 3) : 7.787 * x6 + 16 / 116;
- y2 = y2 > 8856e-6 ? y2 ** (1 / 3) : 7.787 * y2 + 16 / 116;
- z2 = z2 > 8856e-6 ? z2 ** (1 / 3) : 7.787 * z2 + 16 / 116;
- const l6 = 116 * y2 - 16;
- const a6 = 500 * (x6 - y2);
- const b6 = 200 * (y2 - z2);
- return [l6, a6, b6];
- };
- convert2.lab.xyz = function(lab) {
- const l6 = lab[0];
- const a6 = lab[1];
- const b6 = lab[2];
- let x6;
- let y2;
- let z2;
- y2 = (l6 + 16) / 116;
- x6 = a6 / 500 + y2;
- z2 = y2 - b6 / 200;
- const y22 = y2 ** 3;
- const x22 = x6 ** 3;
- const z22 = z2 ** 3;
- y2 = y22 > 8856e-6 ? y22 : (y2 - 16 / 116) / 7.787;
- x6 = x22 > 8856e-6 ? x22 : (x6 - 16 / 116) / 7.787;
- z2 = z22 > 8856e-6 ? z22 : (z2 - 16 / 116) / 7.787;
- x6 *= 95.047;
- y2 *= 100;
- z2 *= 108.883;
- return [x6, y2, z2];
- };
- convert2.lab.lch = function(lab) {
- const l6 = lab[0];
- const a6 = lab[1];
- const b6 = lab[2];
- let h6;
- const hr = Math.atan2(b6, a6);
- h6 = hr * 360 / 2 / Math.PI;
- if (h6 < 0) {
- h6 += 360;
- }
- const c6 = Math.sqrt(a6 * a6 + b6 * b6);
- return [l6, c6, h6];
- };
- convert2.lch.lab = function(lch) {
- const l6 = lch[0];
- const c6 = lch[1];
- const h6 = lch[2];
- const hr = h6 / 360 * 2 * Math.PI;
- const a6 = c6 * Math.cos(hr);
- const b6 = c6 * Math.sin(hr);
- return [l6, a6, b6];
- };
- convert2.rgb.ansi16 = function(args, saturation = null) {
- const [r6, g6, b6] = args;
- let value = saturation === null ? convert2.rgb.hsv(args)[2] : saturation;
- value = Math.round(value / 50);
- if (value === 0) {
- return 30;
- }
- let ansi = 30 + (Math.round(b6 / 255) << 2 | Math.round(g6 / 255) << 1 | Math.round(r6 / 255));
- if (value === 2) {
- ansi += 60;
- }
- return ansi;
- };
- convert2.hsv.ansi16 = function(args) {
- return convert2.rgb.ansi16(convert2.hsv.rgb(args), args[2]);
- };
- convert2.rgb.ansi256 = function(args) {
- const r6 = args[0];
- const g6 = args[1];
- const b6 = args[2];
- if (r6 === g6 && g6 === b6) {
- if (r6 < 8) {
- return 16;
- }
- if (r6 > 248) {
- return 231;
- }
- return Math.round((r6 - 8) / 247 * 24) + 232;
- }
- const ansi = 16 + 36 * Math.round(r6 / 255 * 5) + 6 * Math.round(g6 / 255 * 5) + Math.round(b6 / 255 * 5);
- return ansi;
- };
- convert2.ansi16.rgb = function(args) {
- let color = args % 10;
- if (color === 0 || color === 7) {
- if (args > 50) {
- color += 3.5;
- }
- color = color / 10.5 * 255;
- return [color, color, color];
- }
- const mult = (~~(args > 50) + 1) * 0.5;
- const r6 = (color & 1) * mult * 255;
- const g6 = (color >> 1 & 1) * mult * 255;
- const b6 = (color >> 2 & 1) * mult * 255;
- return [r6, g6, b6];
- };
- convert2.ansi256.rgb = function(args) {
- if (args >= 232) {
- const c6 = (args - 232) * 10 + 8;
- return [c6, c6, c6];
- }
- args -= 16;
- let rem;
- const r6 = Math.floor(args / 36) / 5 * 255;
- const g6 = Math.floor((rem = args % 36) / 6) / 5 * 255;
- const b6 = rem % 6 / 5 * 255;
- return [r6, g6, b6];
- };
- convert2.rgb.hex = function(args) {
- const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
- const string = integer.toString(16).toUpperCase();
- return "000000".substring(string.length) + string;
- };
- convert2.hex.rgb = function(args) {
- const match3 = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
- if (!match3) {
- return [0, 0, 0];
- }
- let colorString = match3[0];
- if (match3[0].length === 3) {
- colorString = colorString.split("").map((char) => {
- return char + char;
- }).join("");
- }
- const integer = parseInt(colorString, 16);
- const r6 = integer >> 16 & 255;
- const g6 = integer >> 8 & 255;
- const b6 = integer & 255;
- return [r6, g6, b6];
- };
- convert2.rgb.hcg = function(rgb) {
- const r6 = rgb[0] / 255;
- const g6 = rgb[1] / 255;
- const b6 = rgb[2] / 255;
- const max = Math.max(Math.max(r6, g6), b6);
- const min = Math.min(Math.min(r6, g6), b6);
- const chroma = max - min;
- let grayscale;
- let hue;
- if (chroma < 1) {
- grayscale = min / (1 - chroma);
- } else {
- grayscale = 0;
- }
- if (chroma <= 0) {
- hue = 0;
- } else if (max === r6) {
- hue = (g6 - b6) / chroma % 6;
- } else if (max === g6) {
- hue = 2 + (b6 - r6) / chroma;
- } else {
- hue = 4 + (r6 - g6) / chroma;
- }
- hue /= 6;
- hue %= 1;
- return [hue * 360, chroma * 100, grayscale * 100];
- };
- convert2.hsl.hcg = function(hsl) {
- const s6 = hsl[1] / 100;
- const l6 = hsl[2] / 100;
- const c6 = l6 < 0.5 ? 2 * s6 * l6 : 2 * s6 * (1 - l6);
- let f6 = 0;
- if (c6 < 1) {
- f6 = (l6 - 0.5 * c6) / (1 - c6);
- }
- return [hsl[0], c6 * 100, f6 * 100];
- };
- convert2.hsv.hcg = function(hsv) {
- const s6 = hsv[1] / 100;
- const v8 = hsv[2] / 100;
- const c6 = s6 * v8;
- let f6 = 0;
- if (c6 < 1) {
- f6 = (v8 - c6) / (1 - c6);
- }
- return [hsv[0], c6 * 100, f6 * 100];
- };
- convert2.hcg.rgb = function(hcg) {
- const h6 = hcg[0] / 360;
- const c6 = hcg[1] / 100;
- const g6 = hcg[2] / 100;
- if (c6 === 0) {
- return [g6 * 255, g6 * 255, g6 * 255];
- }
- const pure = [0, 0, 0];
- const hi2 = h6 % 1 * 6;
- const v8 = hi2 % 1;
- const w5 = 1 - v8;
- let mg = 0;
- switch (Math.floor(hi2)) {
- case 0:
- pure[0] = 1;
- pure[1] = v8;
- pure[2] = 0;
- break;
- case 1:
- pure[0] = w5;
- pure[1] = 1;
- pure[2] = 0;
- break;
- case 2:
- pure[0] = 0;
- pure[1] = 1;
- pure[2] = v8;
- break;
- case 3:
- pure[0] = 0;
- pure[1] = w5;
- pure[2] = 1;
- break;
- case 4:
- pure[0] = v8;
- pure[1] = 0;
- pure[2] = 1;
- break;
- default:
- pure[0] = 1;
- pure[1] = 0;
- pure[2] = w5;
- }
- mg = (1 - c6) * g6;
- return [
- (c6 * pure[0] + mg) * 255,
- (c6 * pure[1] + mg) * 255,
- (c6 * pure[2] + mg) * 255
- ];
- };
- convert2.hcg.hsv = function(hcg) {
- const c6 = hcg[1] / 100;
- const g6 = hcg[2] / 100;
- const v8 = c6 + g6 * (1 - c6);
- let f6 = 0;
- if (v8 > 0) {
- f6 = c6 / v8;
- }
- return [hcg[0], f6 * 100, v8 * 100];
- };
- convert2.hcg.hsl = function(hcg) {
- const c6 = hcg[1] / 100;
- const g6 = hcg[2] / 100;
- const l6 = g6 * (1 - c6) + 0.5 * c6;
- let s6 = 0;
- if (l6 > 0 && l6 < 0.5) {
- s6 = c6 / (2 * l6);
- } else if (l6 >= 0.5 && l6 < 1) {
- s6 = c6 / (2 * (1 - l6));
- }
- return [hcg[0], s6 * 100, l6 * 100];
- };
- convert2.hcg.hwb = function(hcg) {
- const c6 = hcg[1] / 100;
- const g6 = hcg[2] / 100;
- const v8 = c6 + g6 * (1 - c6);
- return [hcg[0], (v8 - c6) * 100, (1 - v8) * 100];
- };
- convert2.hwb.hcg = function(hwb) {
- const w5 = hwb[1] / 100;
- const b6 = hwb[2] / 100;
- const v8 = 1 - b6;
- const c6 = v8 - w5;
- let g6 = 0;
- if (c6 < 1) {
- g6 = (v8 - c6) / (1 - c6);
- }
- return [hwb[0], c6 * 100, g6 * 100];
- };
- convert2.apple.rgb = function(apple) {
- return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
- };
- convert2.rgb.apple = function(rgb) {
- return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
- };
- convert2.gray.rgb = function(args) {
- return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
- };
- convert2.gray.hsl = function(args) {
- return [0, 0, args[0]];
- };
- convert2.gray.hsv = convert2.gray.hsl;
- convert2.gray.hwb = function(gray) {
- return [0, 100, gray[0]];
- };
- convert2.gray.cmyk = function(gray) {
- return [0, 0, 0, gray[0]];
- };
- convert2.gray.lab = function(gray) {
- return [gray[0], 0, 0];
- };
- convert2.gray.hex = function(gray) {
- const val = Math.round(gray[0] / 100 * 255) & 255;
- const integer = (val << 16) + (val << 8) + val;
- const string = integer.toString(16).toUpperCase();
- return "000000".substring(string.length) + string;
- };
- convert2.rgb.gray = function(rgb) {
- const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
- return [val / 255 * 100];
+ emoji_regex_default2 = () => {
+ return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
};
}
});
-// node_modules/color-convert/route.js
-var require_route = __commonJS({
- "node_modules/color-convert/route.js"(exports2, module) {
- "use strict";
- var conversions = require_conversions();
- function buildGraph() {
- const graph = {};
- const models = Object.keys(conversions);
- for (let len = models.length, i6 = 0; i6 < len; i6++) {
- graph[models[i6]] = {
- // http://jsperf.com/1-vs-infinity
- // micro-opt, but this is simple.
- distance: -1,
- parent: null
- };
- }
- return graph;
+// node_modules/yargs/node_modules/string-width/index.js
+function stringWidth2(string, options = {}) {
+ if (typeof string !== "string" || string.length === 0) {
+ return 0;
+ }
+ const {
+ ambiguousIsNarrow = true,
+ countAnsiEscapeCodes = false
+ } = options;
+ if (!countAnsiEscapeCodes) {
+ string = stripAnsi4(string);
+ }
+ if (string.length === 0) {
+ return 0;
+ }
+ let width = 0;
+ const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
+ for (const { segment: character } of segmenter2.segment(string)) {
+ const codePoint = character.codePointAt(0);
+ if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
+ continue;
}
- function deriveBFS(fromModel) {
- const graph = buildGraph();
- const queue2 = [fromModel];
- graph[fromModel].distance = 0;
- while (queue2.length) {
- const current = queue2.pop();
- const adjacents = Object.keys(conversions[current]);
- for (let len = adjacents.length, i6 = 0; i6 < len; i6++) {
- const adjacent = adjacents[i6];
- const node = graph[adjacent];
- if (node.distance === -1) {
- node.distance = graph[current].distance + 1;
- node.parent = current;
- queue2.unshift(adjacent);
- }
- }
- }
- return graph;
- }
- function link(from, to) {
- return function(args) {
- return to(from(args));
- };
+ if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
+ continue;
}
- function wrapConversion(toModel, graph) {
- const path10 = [graph[toModel].parent, toModel];
- let fn = conversions[graph[toModel].parent][toModel];
- let cur = graph[toModel].parent;
- while (graph[cur].parent) {
- path10.unshift(graph[cur].parent);
- fn = link(conversions[graph[cur].parent][cur], fn);
- cur = graph[cur].parent;
- }
- fn.conversion = path10;
- return fn;
+ if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
+ continue;
}
- module.exports = function(fromModel) {
- const graph = deriveBFS(fromModel);
- const conversion = {};
- const models = Object.keys(graph);
- for (let len = models.length, i6 = 0; i6 < len; i6++) {
- const toModel = models[i6];
- const node = graph[toModel];
- if (node.parent === null) {
- continue;
- }
- conversion[toModel] = wrapConversion(toModel, graph);
- }
- return conversion;
- };
- }
-});
-
-// node_modules/color-convert/index.js
-var require_color_convert = __commonJS({
- "node_modules/color-convert/index.js"(exports2, module) {
- "use strict";
- var conversions = require_conversions();
- var route = require_route();
- var convert2 = {};
- var models = Object.keys(conversions);
- function wrapRaw(fn) {
- const wrappedFn = function(...args) {
- const arg0 = args[0];
- if (arg0 === void 0 || arg0 === null) {
- return arg0;
- }
- if (arg0.length > 1) {
- args = arg0;
- }
- return fn(args);
- };
- if ("conversion" in fn) {
- wrappedFn.conversion = fn.conversion;
- }
- return wrappedFn;
+ if (codePoint >= 55296 && codePoint <= 57343) {
+ continue;
}
- function wrapRounded(fn) {
- const wrappedFn = function(...args) {
- const arg0 = args[0];
- if (arg0 === void 0 || arg0 === null) {
- return arg0;
- }
- if (arg0.length > 1) {
- args = arg0;
- }
- const result = fn(args);
- if (typeof result === "object") {
- for (let len = result.length, i6 = 0; i6 < len; i6++) {
- result[i6] = Math.round(result[i6]);
- }
- }
- return result;
- };
- if ("conversion" in fn) {
- wrappedFn.conversion = fn.conversion;
- }
- return wrappedFn;
+ if (codePoint >= 65024 && codePoint <= 65039) {
+ continue;
}
- models.forEach((fromModel) => {
- convert2[fromModel] = {};
- Object.defineProperty(convert2[fromModel], "channels", { value: conversions[fromModel].channels });
- Object.defineProperty(convert2[fromModel], "labels", { value: conversions[fromModel].labels });
- const routes = route(fromModel);
- const routeModels = Object.keys(routes);
- routeModels.forEach((toModel) => {
- const fn = routes[toModel];
- convert2[fromModel][toModel] = wrapRounded(fn);
- convert2[fromModel][toModel].raw = wrapRaw(fn);
- });
- });
- module.exports = convert2;
+ if (defaultIgnorableCodePointRegex2.test(character)) {
+ continue;
+ }
+ if (emoji_regex_default2().test(character)) {
+ width += 2;
+ continue;
+ }
+ width += eastAsianWidth(codePoint, eastAsianWidthOptions);
}
-});
-
-// node_modules/ansi-styles/index.js
-var require_ansi_styles = __commonJS({
- "node_modules/ansi-styles/index.js"(exports2, module) {
+ return width;
+}
+var segmenter2, defaultIgnorableCodePointRegex2;
+var init_string_width2 = __esm({
+ "node_modules/yargs/node_modules/string-width/index.js"() {
"use strict";
- var wrapAnsi16 = (fn, offset) => (...args) => {
- const code = fn(...args);
- return `\x1B[${code + offset}m`;
- };
- var wrapAnsi256 = (fn, offset) => (...args) => {
- const code = fn(...args);
- return `\x1B[${38 + offset};5;${code}m`;
- };
- var wrapAnsi16m = (fn, offset) => (...args) => {
- const rgb = fn(...args);
- return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
- };
- var ansi2ansi = (n12) => n12;
- var rgb2rgb = (r6, g6, b6) => [r6, g6, b6];
- var setLazyProperty = (object, property, get2) => {
- Object.defineProperty(object, property, {
- get: () => {
- const value = get2();
- Object.defineProperty(object, property, {
- value,
- enumerable: true,
- configurable: true
- });
- return value;
- },
- enumerable: true,
- configurable: true
- });
- };
- var colorConvert;
- var makeDynamicStyles = (wrap2, targetSpace, identity, isBackground) => {
- if (colorConvert === void 0) {
- colorConvert = require_color_convert();
- }
- const offset = isBackground ? 10 : 0;
- const styles = {};
- for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
- const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
- if (sourceSpace === targetSpace) {
- styles[name] = wrap2(identity, offset);
- } else if (typeof suite === "object") {
- styles[name] = wrap2(suite[targetSpace], offset);
- }
- }
- return styles;
- };
- function assembleStyles() {
- const codes = /* @__PURE__ */ new Map();
- const styles = {
- modifier: {
- reset: [0, 0],
- // 21 isn't widely supported and 22 does the same thing
- bold: [1, 22],
- dim: [2, 22],
- italic: [3, 23],
- underline: [4, 24],
- inverse: [7, 27],
- hidden: [8, 28],
- strikethrough: [9, 29]
- },
- color: {
- black: [30, 39],
- red: [31, 39],
- green: [32, 39],
- yellow: [33, 39],
- blue: [34, 39],
- magenta: [35, 39],
- cyan: [36, 39],
- white: [37, 39],
- // Bright color
- blackBright: [90, 39],
- redBright: [91, 39],
- greenBright: [92, 39],
- yellowBright: [93, 39],
- blueBright: [94, 39],
- magentaBright: [95, 39],
- cyanBright: [96, 39],
- whiteBright: [97, 39]
- },
- bgColor: {
- bgBlack: [40, 49],
- bgRed: [41, 49],
- bgGreen: [42, 49],
- bgYellow: [43, 49],
- bgBlue: [44, 49],
- bgMagenta: [45, 49],
- bgCyan: [46, 49],
- bgWhite: [47, 49],
- // Bright color
- bgBlackBright: [100, 49],
- bgRedBright: [101, 49],
- bgGreenBright: [102, 49],
- bgYellowBright: [103, 49],
- bgBlueBright: [104, 49],
- bgMagentaBright: [105, 49],
- bgCyanBright: [106, 49],
- bgWhiteBright: [107, 49]
- }
- };
- styles.color.gray = styles.color.blackBright;
- styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
- styles.color.grey = styles.color.blackBright;
- styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
- for (const [groupName, group4] of Object.entries(styles)) {
- for (const [styleName, style] of Object.entries(group4)) {
- styles[styleName] = {
- open: `\x1B[${style[0]}m`,
- close: `\x1B[${style[1]}m`
- };
- group4[styleName] = styles[styleName];
- codes.set(style[0], style[1]);
- }
- Object.defineProperty(styles, groupName, {
- value: group4,
- enumerable: false
- });
- }
- Object.defineProperty(styles, "codes", {
- value: codes,
- enumerable: false
- });
- styles.color.close = "\x1B[39m";
- styles.bgColor.close = "\x1B[49m";
- setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
- setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
- setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
- setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
- setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
- setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
- return styles;
- }
- Object.defineProperty(module, "exports", {
- enumerable: true,
- get: assembleStyles
- });
+ init_strip_ansi2();
+ init_get_east_asian_width();
+ init_emoji_regex2();
+ segmenter2 = new Intl.Segmenter();
+ defaultIgnorableCodePointRegex2 = /^\p{Default_Ignorable_Code_Point}$/u;
}
});
-// node_modules/wrap-ansi/index.js
-var require_wrap_ansi = __commonJS({
- "node_modules/wrap-ansi/index.js"(exports2, module) {
+// node_modules/y18n/build/lib/platform-shims/node.js
+import { readFileSync as readFileSync5, statSync as statSync3, writeFile as writeFile2 } from "fs";
+import { format as format2 } from "util";
+import { resolve as resolve6 } from "path";
+var node_default;
+var init_node = __esm({
+ "node_modules/y18n/build/lib/platform-shims/node.js"() {
"use strict";
- var stringWidth = require_string_width();
- var stripAnsi3 = require_strip_ansi();
- var ansiStyles = require_ansi_styles();
- var ESCAPES = /* @__PURE__ */ new Set([
- "\x1B",
- "\x9B"
- ]);
- var END_CODE = 39;
- var ANSI_ESCAPE_BELL = "\x07";
- var ANSI_CSI = "[";
- var ANSI_OSC = "]";
- var ANSI_SGR_TERMINATOR = "m";
- var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
- var wrapAnsi = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
- var wrapAnsiHyperlink = (uri) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;
- var wordLengths = (string) => string.split(" ").map((character) => stringWidth(character));
- var wrapWord = (rows, word, columns) => {
- const characters = [...word];
- let isInsideEscape = false;
- let isInsideLinkEscape = false;
- let visible = stringWidth(stripAnsi3(rows[rows.length - 1]));
- for (const [index2, character] of characters.entries()) {
- const characterLength = stringWidth(character);
- if (visible + characterLength <= columns) {
- rows[rows.length - 1] += character;
- } else {
- rows.push(character);
- visible = 0;
- }
- if (ESCAPES.has(character)) {
- isInsideEscape = true;
- isInsideLinkEscape = characters.slice(index2 + 1).join("").startsWith(ANSI_ESCAPE_LINK);
- }
- if (isInsideEscape) {
- if (isInsideLinkEscape) {
- if (character === ANSI_ESCAPE_BELL) {
- isInsideEscape = false;
- isInsideLinkEscape = false;
- }
- } else if (character === ANSI_SGR_TERMINATOR) {
- isInsideEscape = false;
- }
- continue;
- }
- visible += characterLength;
- if (visible === columns && index2 < characters.length - 1) {
- rows.push("");
- visible = 0;
- }
- }
- if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {
- rows[rows.length - 2] += rows.pop();
- }
- };
- var stringVisibleTrimSpacesRight = (string) => {
- const words = string.split(" ");
- let last = words.length;
- while (last > 0) {
- if (stringWidth(words[last - 1]) > 0) {
- break;
- }
- last--;
- }
- if (last === words.length) {
- return string;
- }
- return words.slice(0, last).join(" ") + words.slice(last).join("");
- };
- var exec2 = (string, columns, options = {}) => {
- if (options.trim !== false && string.trim() === "") {
- return "";
- }
- let returnValue = "";
- let escapeCode;
- let escapeUrl;
- const lengths = wordLengths(string);
- let rows = [""];
- for (const [index2, word] of string.split(" ").entries()) {
- if (options.trim !== false) {
- rows[rows.length - 1] = rows[rows.length - 1].trimStart();
- }
- let rowLength = stringWidth(rows[rows.length - 1]);
- if (index2 !== 0) {
- if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
- rows.push("");
- rowLength = 0;
- }
- if (rowLength > 0 || options.trim === false) {
- rows[rows.length - 1] += " ";
- rowLength++;
- }
- }
- if (options.hard && lengths[index2] > columns) {
- const remainingColumns = columns - rowLength;
- const breaksStartingThisLine = 1 + Math.floor((lengths[index2] - remainingColumns - 1) / columns);
- const breaksStartingNextLine = Math.floor((lengths[index2] - 1) / columns);
- if (breaksStartingNextLine < breaksStartingThisLine) {
- rows.push("");
- }
- wrapWord(rows, word, columns);
- continue;
- }
- if (rowLength + lengths[index2] > columns && rowLength > 0 && lengths[index2] > 0) {
- if (options.wordWrap === false && rowLength < columns) {
- wrapWord(rows, word, columns);
- continue;
- }
- rows.push("");
- }
- if (rowLength + lengths[index2] > columns && options.wordWrap === false) {
- wrapWord(rows, word, columns);
- continue;
- }
- rows[rows.length - 1] += word;
- }
- if (options.trim !== false) {
- rows = rows.map(stringVisibleTrimSpacesRight);
- }
- const pre = [...rows.join("\n")];
- for (const [index2, character] of pre.entries()) {
- returnValue += character;
- if (ESCAPES.has(character)) {
- const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?\\d+)m|\\${ANSI_ESCAPE_LINK}(?.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index2).join("")) || { groups: {} };
- if (groups.code !== void 0) {
- const code2 = Number.parseFloat(groups.code);
- escapeCode = code2 === END_CODE ? void 0 : code2;
- } else if (groups.uri !== void 0) {
- escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
- }
- }
- const code = ansiStyles.codes.get(Number(escapeCode));
- if (pre[index2 + 1] === "\n") {
- if (escapeUrl) {
- returnValue += wrapAnsiHyperlink("");
- }
- if (escapeCode && code) {
- returnValue += wrapAnsi(code);
- }
- } else if (character === "\n") {
- if (escapeCode && code) {
- returnValue += wrapAnsi(escapeCode);
- }
- if (escapeUrl) {
- returnValue += wrapAnsiHyperlink(escapeUrl);
- }
+ node_default = {
+ fs: {
+ readFileSync: readFileSync5,
+ writeFile: writeFile2
+ },
+ format: format2,
+ resolve: resolve6,
+ exists: (file) => {
+ try {
+ return statSync3(file).isFile();
+ } catch (err) {
+ return false;
}
}
- return returnValue;
- };
- module.exports = (string, columns, options) => {
- return String(string).normalize().replace(/\r\n/g, "\n").split("\n").map((line) => exec2(line, columns, options)).join("\n");
};
}
});
-// node_modules/ai-ctrf/node_modules/cliui/build/index.cjs
-var require_build3 = __commonJS({
- "node_modules/ai-ctrf/node_modules/cliui/build/index.cjs"(exports2, module) {
+// node_modules/y18n/build/lib/index.js
+function y18n(opts, _shim) {
+ shim = _shim;
+ const y18n3 = new Y18N(opts);
+ return {
+ __: y18n3.__.bind(y18n3),
+ __n: y18n3.__n.bind(y18n3),
+ setLocale: y18n3.setLocale.bind(y18n3),
+ getLocale: y18n3.getLocale.bind(y18n3),
+ updateLocale: y18n3.updateLocale.bind(y18n3),
+ locale: y18n3.locale
+ };
+}
+var shim, Y18N;
+var init_lib3 = __esm({
+ "node_modules/y18n/build/lib/index.js"() {
"use strict";
- var align = {
- right: alignRight,
- center: alignCenter
- };
- var top = 0;
- var right = 1;
- var bottom = 2;
- var left = 3;
- var UI = class {
+ Y18N = class {
constructor(opts) {
- var _a5;
- this.width = opts.width;
- this.wrap = (_a5 = opts.wrap) !== null && _a5 !== void 0 ? _a5 : true;
- this.rows = [];
- }
- span(...args) {
- const cols = this.div(...args);
- cols.span = true;
- }
- resetOutput() {
- this.rows = [];
+ opts = opts || {};
+ this.directory = opts.directory || "./locales";
+ this.updateFiles = typeof opts.updateFiles === "boolean" ? opts.updateFiles : true;
+ this.locale = opts.locale || "en";
+ this.fallbackToLanguage = typeof opts.fallbackToLanguage === "boolean" ? opts.fallbackToLanguage : true;
+ this.cache = /* @__PURE__ */ Object.create(null);
+ this.writeQueue = [];
}
- div(...args) {
- if (args.length === 0) {
- this.div("");
+ __(...args) {
+ if (typeof arguments[0] !== "string") {
+ return this._taggedLiteral(arguments[0], ...arguments);
}
- if (this.wrap && this.shouldApplyLayoutDSL(...args) && typeof args[0] === "string") {
- return this.applyLayoutDSL(args[0]);
+ const str = args.shift();
+ let cb = function() {
+ };
+ if (typeof args[args.length - 1] === "function")
+ cb = args.pop();
+ cb = cb || function() {
+ };
+ if (!this.cache[this.locale])
+ this._readLocaleFile();
+ if (!this.cache[this.locale][str] && this.updateFiles) {
+ this.cache[this.locale][str] = str;
+ this._enqueueWrite({
+ directory: this.directory,
+ locale: this.locale,
+ cb
+ });
+ } else {
+ cb();
}
- const cols = args.map((arg) => {
- if (typeof arg === "string") {
- return this.colFromString(arg);
- }
- return arg;
- });
- this.rows.push(cols);
- return cols;
- }
- shouldApplyLayoutDSL(...args) {
- return args.length === 1 && typeof args[0] === "string" && /[\t\n]/.test(args[0]);
- }
- applyLayoutDSL(str) {
- const rows = str.split("\n").map((row) => row.split(" "));
- let leftColumnWidth = 0;
- rows.forEach((columns) => {
- if (columns.length > 1 && mixin.stringWidth(columns[0]) > leftColumnWidth) {
- leftColumnWidth = Math.min(Math.floor(this.width * 0.5), mixin.stringWidth(columns[0]));
- }
- });
- rows.forEach((columns) => {
- this.div(...columns.map((r6, i6) => {
- return {
- text: r6.trim(),
- padding: this.measurePadding(r6),
- width: i6 === 0 && columns.length > 1 ? leftColumnWidth : void 0
- };
- }));
- });
- return this.rows[this.rows.length - 1];
+ return shim.format.apply(shim.format, [this.cache[this.locale][str] || str].concat(args));
}
- colFromString(text) {
- return {
- text,
- padding: this.measurePadding(text)
+ __n() {
+ const args = Array.prototype.slice.call(arguments);
+ const singular = args.shift();
+ const plural = args.shift();
+ const quantity = args.shift();
+ let cb = function() {
};
+ if (typeof args[args.length - 1] === "function")
+ cb = args.pop();
+ if (!this.cache[this.locale])
+ this._readLocaleFile();
+ let str = quantity === 1 ? singular : plural;
+ if (this.cache[this.locale][singular]) {
+ const entry = this.cache[this.locale][singular];
+ str = entry[quantity === 1 ? "one" : "other"];
+ }
+ if (!this.cache[this.locale][singular] && this.updateFiles) {
+ this.cache[this.locale][singular] = {
+ one: singular,
+ other: plural
+ };
+ this._enqueueWrite({
+ directory: this.directory,
+ locale: this.locale,
+ cb
+ });
+ } else {
+ cb();
+ }
+ const values = [str];
+ if (~str.indexOf("%d"))
+ values.push(quantity);
+ return shim.format.apply(shim.format, values.concat(args));
}
- measurePadding(str) {
- const noAnsi = mixin.stripAnsi(str);
- return [0, noAnsi.match(/\s*$/)[0].length, 0, noAnsi.match(/^\s*/)[0].length];
- }
- toString() {
- const lines = [];
- this.rows.forEach((row) => {
- this.rowToString(row, lines);
- });
- return lines.filter((line) => !line.hidden).map((line) => line.text).join("\n");
+ setLocale(locale) {
+ this.locale = locale;
}
- rowToString(row, lines) {
- this.rasterize(row).forEach((rrow, r6) => {
- let str = "";
- rrow.forEach((col, c6) => {
- const { width } = row[c6];
- const wrapWidth = this.negatePadding(row[c6]);
- let ts2 = col;
- if (wrapWidth > mixin.stringWidth(col)) {
- ts2 += " ".repeat(wrapWidth - mixin.stringWidth(col));
- }
- if (row[c6].align && row[c6].align !== "left" && this.wrap) {
- const fn = align[row[c6].align];
- ts2 = fn(ts2, wrapWidth);
- if (mixin.stringWidth(ts2) < wrapWidth) {
- ts2 += " ".repeat((width || 0) - mixin.stringWidth(ts2) - 1);
- }
- }
- const padding = row[c6].padding || [0, 0, 0, 0];
- if (padding[left]) {
- str += " ".repeat(padding[left]);
- }
- str += addBorder(row[c6], ts2, "| ");
- str += ts2;
- str += addBorder(row[c6], ts2, " |");
- if (padding[right]) {
- str += " ".repeat(padding[right]);
- }
- if (r6 === 0 && lines.length > 0) {
- str = this.renderInline(str, lines[lines.length - 1]);
- }
- });
- lines.push({
- text: str.replace(/ +$/, ""),
- span: row.span
- });
- });
- return lines;
+ getLocale() {
+ return this.locale;
}
- // if the full 'source' can render in
- // the target line, do so.
- renderInline(source, previousLine) {
- const match3 = source.match(/^ */);
- const leadingWhitespace = match3 ? match3[0].length : 0;
- const target = previousLine.text;
- const targetTextWidth = mixin.stringWidth(target.trimRight());
- if (!previousLine.span) {
- return source;
- }
- if (!this.wrap) {
- previousLine.hidden = true;
- return target + source;
- }
- if (leadingWhitespace < targetTextWidth) {
- return source;
+ updateLocale(obj) {
+ if (!this.cache[this.locale])
+ this._readLocaleFile();
+ for (const key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
+ this.cache[this.locale][key] = obj[key];
+ }
}
- previousLine.hidden = true;
- return target.trimRight() + " ".repeat(leadingWhitespace - targetTextWidth) + source.trimLeft();
}
- rasterize(row) {
- const rrows = [];
- const widths = this.columnWidths(row);
- let wrapped;
- row.forEach((col, c6) => {
- col.width = widths[c6];
- if (this.wrap) {
- wrapped = mixin.wrap(col.text, this.negatePadding(col), { hard: true }).split("\n");
- } else {
- wrapped = col.text.split("\n");
- }
- if (col.border) {
- wrapped.unshift("." + "-".repeat(this.negatePadding(col) + 2) + ".");
- wrapped.push("'" + "-".repeat(this.negatePadding(col) + 2) + "'");
- }
- if (col.padding) {
- wrapped.unshift(...new Array(col.padding[top] || 0).fill(""));
- wrapped.push(...new Array(col.padding[bottom] || 0).fill(""));
+ _taggedLiteral(parts, ...args) {
+ let str = "";
+ parts.forEach(function(part, i6) {
+ const arg = args[i6 + 1];
+ str += part;
+ if (typeof arg !== "undefined") {
+ str += "%s";
}
- wrapped.forEach((str, r6) => {
- if (!rrows[r6]) {
- rrows.push([]);
- }
- const rrow = rrows[r6];
- for (let i6 = 0; i6 < c6; i6++) {
- if (rrow[i6] === void 0) {
- rrow.push("");
- }
- }
- rrow.push(str);
- });
});
- return rrows;
+ return this.__.apply(this, [str].concat([].slice.call(args, 1)));
}
- negatePadding(col) {
- let wrapWidth = col.width || 0;
- if (col.padding) {
- wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0);
- }
- if (col.border) {
- wrapWidth -= 4;
- }
- return wrapWidth;
+ _enqueueWrite(work) {
+ this.writeQueue.push(work);
+ if (this.writeQueue.length === 1)
+ this._processWriteQueue();
}
- columnWidths(row) {
- if (!this.wrap) {
- return row.map((col) => {
- return col.width || mixin.stringWidth(col.text);
- });
- }
- let unset = row.length;
- let remainingWidth = this.width;
- const widths = row.map((col) => {
- if (col.width) {
- unset--;
- remainingWidth -= col.width;
- return col.width;
- }
- return void 0;
- });
- const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0;
- return widths.map((w5, i6) => {
- if (w5 === void 0) {
- return Math.max(unsetWidth, _minWidth(row[i6]));
- }
- return w5;
+ _processWriteQueue() {
+ const _this = this;
+ const work = this.writeQueue[0];
+ const directory = work.directory;
+ const locale = work.locale;
+ const cb = work.cb;
+ const languageFile = this._resolveLocaleFile(directory, locale);
+ const serializedLocale = JSON.stringify(this.cache[locale], null, 2);
+ shim.fs.writeFile(languageFile, serializedLocale, "utf-8", function(err) {
+ _this.writeQueue.shift();
+ if (_this.writeQueue.length > 0)
+ _this._processWriteQueue();
+ cb(err);
});
}
- };
- function addBorder(col, ts2, style) {
- if (col.border) {
- if (/[.']-+[.']/.test(ts2)) {
- return "";
- }
- if (ts2.trim().length !== 0) {
- return style;
+ _readLocaleFile() {
+ let localeLookup = {};
+ const languageFile = this._resolveLocaleFile(this.directory, this.locale);
+ try {
+ if (shim.fs.readFileSync) {
+ localeLookup = JSON.parse(shim.fs.readFileSync(languageFile, "utf-8"));
+ }
+ } catch (err) {
+ if (err instanceof SyntaxError) {
+ err.message = "syntax error in " + languageFile;
+ }
+ if (err.code === "ENOENT")
+ localeLookup = {};
+ else
+ throw err;
}
- return " ";
- }
- return "";
- }
- function _minWidth(col) {
- const padding = col.padding || [];
- const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0);
- if (col.border) {
- return minWidth + 4;
- }
- return minWidth;
- }
- function getWindowWidth() {
- if (typeof process === "object" && process.stdout && process.stdout.columns) {
- return process.stdout.columns;
+ this.cache[this.locale] = localeLookup;
}
- return 80;
- }
- function alignRight(str, width) {
- str = str.trim();
- const strWidth = mixin.stringWidth(str);
- if (strWidth < width) {
- return " ".repeat(width - strWidth) + str;
+ _resolveLocaleFile(directory, locale) {
+ let file = shim.resolve(directory, "./", locale + ".json");
+ if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf("_")) {
+ const languageFile = shim.resolve(directory, "./", locale.split("_")[0] + ".json");
+ if (this._fileExistsSync(languageFile))
+ file = languageFile;
+ }
+ return file;
}
- return str;
- }
- function alignCenter(str, width) {
- str = str.trim();
- const strWidth = mixin.stringWidth(str);
- if (strWidth >= width) {
- return str;
+ _fileExistsSync(file) {
+ return shim.exists(file);
}
- return " ".repeat(width - strWidth >> 1) + str;
- }
- var mixin;
- function cliui(opts, _mixin) {
- mixin = _mixin;
- return new UI({
- width: (opts === null || opts === void 0 ? void 0 : opts.width) || getWindowWidth(),
- wrap: opts === null || opts === void 0 ? void 0 : opts.wrap
- });
- }
- var stringWidth = require_string_width();
- var stripAnsi3 = require_strip_ansi();
- var wrap2 = require_wrap_ansi();
- function ui2(opts) {
- return cliui(opts, {
- stringWidth,
- stripAnsi: stripAnsi3,
- wrap: wrap2
- });
- }
- module.exports = ui2;
+ };
}
});
-// node_modules/escalade/sync/index.js
-var require_sync = __commonJS({
- "node_modules/escalade/sync/index.js"(exports2, module) {
+// node_modules/y18n/index.mjs
+var y18n2, y18n_default;
+var init_y18n = __esm({
+ "node_modules/y18n/index.mjs"() {
"use strict";
- var { dirname: dirname3, resolve: resolve4 } = __require("path");
- var { readdirSync: readdirSync3, statSync: statSync2 } = __require("fs");
- module.exports = function(start, callback) {
- let dir2 = resolve4(".", start);
- let tmp, stats = statSync2(dir2);
- if (!stats.isDirectory()) {
- dir2 = dirname3(dir2);
- }
- while (true) {
- tmp = callback(dir2, readdirSync3(dir2));
- if (tmp) return resolve4(dir2, tmp);
- dir2 = dirname3(tmp = dir2);
- if (tmp === dir2) break;
- }
+ init_node();
+ init_lib3();
+ y18n2 = (opts) => {
+ return y18n(opts, node_default);
};
+ y18n_default = y18n2;
}
});
@@ -96465,7 +95961,7 @@ var require_sync = __commonJS({
var require_get_caller_file = __commonJS({
"node_modules/get-caller-file/index.js"(exports2, module) {
"use strict";
- module.exports = function getCallerFile(position) {
+ module.exports = function getCallerFile2(position) {
if (position === void 0) {
position = 2;
}
@@ -96485,210 +95981,294 @@ var require_get_caller_file = __commonJS({
}
});
-// node_modules/require-directory/index.js
-var require_require_directory = __commonJS({
- "node_modules/require-directory/index.js"(exports2, module) {
+// node_modules/yargs/lib/platform-shims/esm.mjs
+import { notStrictEqual, strictEqual } from "assert";
+import { inspect as inspect2 } from "util";
+import { fileURLToPath as fileURLToPath3 } from "url";
+import { basename as basename4, dirname as dirname3, extname as extname3, relative as relative2, resolve as resolve7, join as join4 } from "path";
+import { createRequire as createRequire2 } from "module";
+import { readFileSync as readFileSync6, readdirSync as readdirSync4 } from "fs";
+var import_get_caller_file, __dirname2, mainFilename, require3, esm_default;
+var init_esm = __esm({
+ "node_modules/yargs/lib/platform-shims/esm.mjs"() {
"use strict";
- var fs16 = __require("fs");
- var join10 = __require("path").join;
- var resolve4 = __require("path").resolve;
- var dirname3 = __require("path").dirname;
- var defaultOptions4 = {
- extensions: ["js", "json", "coffee"],
- recurse: true,
- rename: function(name) {
- return name;
+ init_cliui();
+ init_sync();
+ init_lib2();
+ init_process_argv();
+ init_string_width2();
+ init_y18n();
+ import_get_caller_file = __toESM(require_get_caller_file(), 1);
+ __dirname2 = fileURLToPath3(import.meta.url);
+ mainFilename = __dirname2.substring(0, __dirname2.lastIndexOf("node_modules"));
+ require3 = createRequire2(import.meta.url);
+ esm_default = {
+ assert: {
+ notStrictEqual,
+ strictEqual
+ },
+ cliui: ui2,
+ findUp: sync_default,
+ getEnv: (key) => {
+ return process.env[key];
},
- visit: function(obj) {
- return obj;
- }
+ inspect: inspect2,
+ getProcessArgvBin,
+ mainFilename: mainFilename || process.cwd(),
+ Parser: lib_default,
+ path: {
+ basename: basename4,
+ dirname: dirname3,
+ extname: extname3,
+ relative: relative2,
+ resolve: resolve7,
+ join: join4
+ },
+ process: {
+ argv: () => process.argv,
+ cwd: process.cwd,
+ emitWarning: (warning3, type) => process.emitWarning(warning3, type),
+ execPath: () => process.execPath,
+ exit: (code) => {
+ process.exit(code);
+ },
+ nextTick: process.nextTick,
+ stdColumns: typeof process.stdout.columns !== "undefined" ? process.stdout.columns : null
+ },
+ readFileSync: readFileSync6,
+ readdirSync: readdirSync4,
+ require: require3,
+ getCallerFile: () => {
+ const callerFile = (0, import_get_caller_file.default)(3);
+ return callerFile.match(/^file:\/\//) ? fileURLToPath3(callerFile) : callerFile;
+ },
+ stringWidth: stringWidth2,
+ y18n: y18n_default({
+ directory: resolve7(__dirname2, "../../../locales"),
+ updateFiles: false
+ })
};
- function checkFileInclusion(path10, filename, options) {
- return (
- // verify file has valid extension
- new RegExp("\\.(" + options.extensions.join("|") + ")$", "i").test(filename) && // if options.include is a RegExp, evaluate it and make sure the path passes
- !(options.include && options.include instanceof RegExp && !options.include.test(path10)) && // if options.include is a function, evaluate it and make sure the path passes
- !(options.include && typeof options.include === "function" && !options.include(path10, filename)) && // if options.exclude is a RegExp, evaluate it and make sure the path doesn't pass
- !(options.exclude && options.exclude instanceof RegExp && options.exclude.test(path10)) && // if options.exclude is a function, evaluate it and make sure the path doesn't pass
- !(options.exclude && typeof options.exclude === "function" && options.exclude(path10, filename))
- );
- }
- function requireDirectory(m6, path10, options) {
- var retval = {};
- if (path10 && !options && typeof path10 !== "string") {
- options = path10;
- path10 = null;
- }
- options = options || {};
- for (var prop in defaultOptions4) {
- if (typeof options[prop] === "undefined") {
- options[prop] = defaultOptions4[prop];
+ }
+});
+
+// node_modules/yargs/build/lib/typings/common-types.js
+function assertNotStrictEqual(actual, expected, shim3, message) {
+ shim3.assert.notStrictEqual(actual, expected, message);
+}
+function assertSingleKey(actual, shim3) {
+ shim3.assert.strictEqual(typeof actual, "string");
+}
+function objectKeys(object) {
+ return Object.keys(object);
+}
+var init_common_types = __esm({
+ "node_modules/yargs/build/lib/typings/common-types.js"() {
+ "use strict";
+ }
+});
+
+// node_modules/yargs/build/lib/utils/is-promise.js
+function isPromise(maybePromise) {
+ return !!maybePromise && !!maybePromise.then && typeof maybePromise.then === "function";
+}
+var init_is_promise = __esm({
+ "node_modules/yargs/build/lib/utils/is-promise.js"() {
+ "use strict";
+ }
+});
+
+// node_modules/yargs/build/lib/yerror.js
+var YError;
+var init_yerror = __esm({
+ "node_modules/yargs/build/lib/yerror.js"() {
+ "use strict";
+ YError = class _YError extends Error {
+ constructor(msg) {
+ super(msg || "yargs error");
+ this.name = "YError";
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, _YError);
}
}
- path10 = !path10 ? dirname3(m6.filename) : resolve4(dirname3(m6.filename), path10);
- fs16.readdirSync(path10).forEach(function(filename) {
- var joined = join10(path10, filename), files, key, obj;
- if (fs16.statSync(joined).isDirectory() && options.recurse) {
- files = requireDirectory(m6, joined, options);
- if (Object.keys(files).length) {
- retval[options.rename(filename, joined, filename)] = files;
- }
- } else {
- if (joined !== m6.filename && checkFileInclusion(joined, filename, options)) {
- key = filename.substring(0, filename.lastIndexOf("."));
- obj = m6.require(joined);
- retval[options.rename(key, joined, filename)] = options.visit(obj, joined, filename) || obj;
- }
- }
+ };
+ }
+});
+
+// node_modules/yargs/build/lib/parse-command.js
+function parseCommand(cmd) {
+ const extraSpacesStrippedCommand = cmd.replace(/\s{2,}/g, " ");
+ const splitCommand = extraSpacesStrippedCommand.split(/\s+(?![^[]*]|[^<]*>)/);
+ const bregex = /\.*[\][<>]/g;
+ const firstCommand = splitCommand.shift();
+ if (!firstCommand)
+ throw new Error(`No command found in: ${cmd}`);
+ const parsedCommand = {
+ cmd: firstCommand.replace(bregex, ""),
+ demanded: [],
+ optional: []
+ };
+ splitCommand.forEach((cmd2, i6) => {
+ let variadic = false;
+ cmd2 = cmd2.replace(/\s/g, "");
+ if (/\.+[\]>]/.test(cmd2) && i6 === splitCommand.length - 1)
+ variadic = true;
+ if (/^\[/.test(cmd2)) {
+ parsedCommand.optional.push({
+ cmd: cmd2.replace(bregex, "").split("|"),
+ variadic
+ });
+ } else {
+ parsedCommand.demanded.push({
+ cmd: cmd2.replace(bregex, "").split("|"),
+ variadic
});
- return retval;
}
- module.exports = requireDirectory;
- module.exports.defaults = defaultOptions4;
+ });
+ return parsedCommand;
+}
+var init_parse_command = __esm({
+ "node_modules/yargs/build/lib/parse-command.js"() {
+ "use strict";
}
});
-// node_modules/ai-ctrf/node_modules/yargs/build/index.cjs
-var require_build4 = __commonJS({
- "node_modules/ai-ctrf/node_modules/yargs/build/index.cjs"(exports2, module) {
+// node_modules/yargs/build/lib/argsert.js
+function argsert(arg1, arg2, arg3) {
+ function parseArgs() {
+ return typeof arg1 === "object" ? [{ demanded: [], optional: [] }, arg1, arg2] : [
+ parseCommand(`cmd ${arg1}`),
+ arg2,
+ arg3
+ ];
+ }
+ try {
+ let position = 0;
+ const [parsed, callerArguments, _length] = parseArgs();
+ const args = [].slice.call(callerArguments);
+ while (args.length && args[args.length - 1] === void 0)
+ args.pop();
+ const length = _length || args.length;
+ if (length < parsed.demanded.length) {
+ throw new YError(`Not enough arguments provided. Expected ${parsed.demanded.length} but received ${args.length}.`);
+ }
+ const totalCommands = parsed.demanded.length + parsed.optional.length;
+ if (length > totalCommands) {
+ throw new YError(`Too many arguments provided. Expected max ${totalCommands} but received ${length}.`);
+ }
+ parsed.demanded.forEach((demanded) => {
+ const arg = args.shift();
+ const observedType = guessType(arg);
+ const matchingTypes = demanded.cmd.filter((type) => type === observedType || type === "*");
+ if (matchingTypes.length === 0)
+ argumentTypeError(observedType, demanded.cmd, position);
+ position += 1;
+ });
+ parsed.optional.forEach((optional) => {
+ if (args.length === 0)
+ return;
+ const arg = args.shift();
+ const observedType = guessType(arg);
+ const matchingTypes = optional.cmd.filter((type) => type === observedType || type === "*");
+ if (matchingTypes.length === 0)
+ argumentTypeError(observedType, optional.cmd, position);
+ position += 1;
+ });
+ } catch (err) {
+ console.warn(err.stack);
+ }
+}
+function guessType(arg) {
+ if (Array.isArray(arg)) {
+ return "array";
+ } else if (arg === null) {
+ return "null";
+ }
+ return typeof arg;
+}
+function argumentTypeError(observedType, allowedTypes, position) {
+ throw new YError(`Invalid ${positionName[position] || "manyith"} argument. Expected ${allowedTypes.join(" or ")} but received ${observedType}.`);
+}
+var positionName;
+var init_argsert = __esm({
+ "node_modules/yargs/build/lib/argsert.js"() {
"use strict";
- var t6 = __require("assert");
- var e6 = class _e7 extends Error {
- constructor(t7) {
- super(t7 || "yargs error"), this.name = "YError", Error.captureStackTrace && Error.captureStackTrace(this, _e7);
- }
- };
- var s6;
- var i6 = [];
- function n12(t7, o7, a7, h7) {
- s6 = h7;
- let l7 = {};
- if (Object.prototype.hasOwnProperty.call(t7, "extends")) {
- if ("string" != typeof t7.extends) return l7;
- const r7 = /\.json|\..*rc$/.test(t7.extends);
- let h8 = null;
- if (r7) h8 = (function(t8, e7) {
- return s6.path.resolve(t8, e7);
- })(o7, t7.extends);
- else try {
- h8 = __require.resolve(t7.extends);
- } catch (e7) {
- return t7;
- }
- !(function(t8) {
- if (i6.indexOf(t8) > -1) throw new e6(`Circular extended configurations: '${t8}'.`);
- })(h8), i6.push(h8), l7 = r7 ? JSON.parse(s6.readFileSync(h8, "utf8")) : __require(t7.extends), delete t7.extends, l7 = n12(l7, s6.path.dirname(h8), a7, s6);
- }
- return i6 = [], a7 ? r6(l7, t7) : Object.assign({}, l7, t7);
- }
- function r6(t7, e7) {
- const s7 = {};
- function i7(t8) {
- return t8 && "object" == typeof t8 && !Array.isArray(t8);
- }
- Object.assign(s7, t7);
- for (const n13 of Object.keys(e7)) i7(e7[n13]) && i7(s7[n13]) ? s7[n13] = r6(t7[n13], e7[n13]) : s7[n13] = e7[n13];
- return s7;
- }
- function o6(t7) {
- const e7 = t7.replace(/\s{2,}/g, " ").split(/\s+(?![^[]*]|[^<]*>)/), s7 = /\.*[\][<>]/g, i7 = e7.shift();
- if (!i7) throw new Error(`No command found in: ${t7}`);
- const n13 = { cmd: i7.replace(s7, ""), demanded: [], optional: [] };
- return e7.forEach(((t8, i8) => {
- let r7 = false;
- t8 = t8.replace(/\s/g, ""), /\.+[\]>]/.test(t8) && i8 === e7.length - 1 && (r7 = true), /^\[/.test(t8) ? n13.optional.push({ cmd: t8.replace(s7, "").split("|"), variadic: r7 }) : n13.demanded.push({ cmd: t8.replace(s7, "").split("|"), variadic: r7 });
- })), n13;
- }
- var a6 = ["first", "second", "third", "fourth", "fifth", "sixth"];
- function h6(t7, s7, i7) {
- try {
- let n13 = 0;
- const [r7, a7, h7] = "object" == typeof t7 ? [{ demanded: [], optional: [] }, t7, s7] : [o6(`cmd ${t7}`), s7, i7], f7 = [].slice.call(a7);
- for (; f7.length && void 0 === f7[f7.length - 1]; ) f7.pop();
- const d7 = h7 || f7.length;
- if (d7 < r7.demanded.length) throw new e6(`Not enough arguments provided. Expected ${r7.demanded.length} but received ${f7.length}.`);
- const u7 = r7.demanded.length + r7.optional.length;
- if (d7 > u7) throw new e6(`Too many arguments provided. Expected max ${u7} but received ${d7}.`);
- r7.demanded.forEach(((t8) => {
- const e7 = l6(f7.shift());
- 0 === t8.cmd.filter(((t9) => t9 === e7 || "*" === t9)).length && c6(e7, t8.cmd, n13), n13 += 1;
- })), r7.optional.forEach(((t8) => {
- if (0 === f7.length) return;
- const e7 = l6(f7.shift());
- 0 === t8.cmd.filter(((t9) => t9 === e7 || "*" === t9)).length && c6(e7, t8.cmd, n13), n13 += 1;
- }));
- } catch (t8) {
- console.warn(t8.stack);
- }
- }
- function l6(t7) {
- return Array.isArray(t7) ? "array" : null === t7 ? "null" : typeof t7;
- }
- function c6(t7, s7, i7) {
- throw new e6(`Invalid ${a6[i7] || "manyith"} argument. Expected ${s7.join(" or ")} but received ${t7}.`);
- }
- function f6(t7) {
- return !!t7 && !!t7.then && "function" == typeof t7.then;
- }
- function d6(t7, e7, s7, i7) {
- s7.assert.notStrictEqual(t7, e7, i7);
- }
- function u6(t7, e7) {
- e7.assert.strictEqual(typeof t7, "string");
- }
- function p6(t7) {
- return Object.keys(t7);
- }
- function g6(t7 = {}, e7 = (() => true)) {
- const s7 = {};
- return p6(t7).forEach(((i7) => {
- e7(i7, t7[i7]) && (s7[i7] = t7[i7]);
- })), s7;
- }
- function m6() {
- return process.versions.electron && !process.defaultApp ? 0 : 1;
- }
- function y2() {
- return process.argv[m6()];
+ init_yerror();
+ init_parse_command();
+ positionName = ["first", "second", "third", "fourth", "fifth", "sixth"];
+ }
+});
+
+// node_modules/yargs/build/lib/middleware.js
+function commandMiddlewareFactory(commandMiddleware) {
+ if (!commandMiddleware)
+ return [];
+ return commandMiddleware.map((middleware) => {
+ middleware.applyBeforeValidation = false;
+ return middleware;
+ });
+}
+function applyMiddleware(argv, yargs, middlewares, beforeValidation) {
+ return middlewares.reduce((acc, middleware) => {
+ if (middleware.applyBeforeValidation !== beforeValidation) {
+ return acc;
}
- var b6 = Object.freeze({ __proto__: null, hideBin: function(t7) {
- return t7.slice(m6() + 1);
- }, getProcessArgvBin: y2 });
- function v8(t7, e7, s7, i7) {
- if ("a" === s7 && !i7) throw new TypeError("Private accessor was defined without a getter");
- if ("function" == typeof e7 ? t7 !== e7 || !i7 : !e7.has(t7)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
- return "m" === s7 ? i7 : "a" === s7 ? i7.call(t7) : i7 ? i7.value : e7.get(t7);
+ if (middleware.mutates) {
+ if (middleware.applied)
+ return acc;
+ middleware.applied = true;
}
- function O2(t7, e7, s7, i7, n13) {
- if ("m" === i7) throw new TypeError("Private method is not writable");
- if ("a" === i7 && !n13) throw new TypeError("Private accessor was defined without a setter");
- if ("function" == typeof e7 ? t7 !== e7 || !n13 : !e7.has(t7)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
- return "a" === i7 ? n13.call(t7, s7) : n13 ? n13.value = s7 : e7.set(t7, s7), s7;
+ if (isPromise(acc)) {
+ return acc.then((initialObj) => Promise.all([initialObj, middleware(initialObj, yargs)])).then(([initialObj, middlewareObj]) => Object.assign(initialObj, middlewareObj));
+ } else {
+ const result = middleware(acc, yargs);
+ return isPromise(result) ? result.then((middlewareObj) => Object.assign(acc, middlewareObj)) : Object.assign(acc, result);
}
- var w5 = class {
- constructor(t7) {
- this.globalMiddleware = [], this.frozens = [], this.yargs = t7;
- }
- addMiddleware(t7, e7, s7 = true, i7 = false) {
- if (h6(" [boolean] [boolean] [boolean]", [t7, e7, s7], arguments.length), Array.isArray(t7)) {
- for (let i8 = 0; i8 < t7.length; i8++) {
- if ("function" != typeof t7[i8]) throw Error("middleware must be a function");
- const n13 = t7[i8];
- n13.applyBeforeValidation = e7, n13.global = s7;
- }
- Array.prototype.push.apply(this.globalMiddleware, t7);
- } else if ("function" == typeof t7) {
- const n13 = t7;
- n13.applyBeforeValidation = e7, n13.global = s7, n13.mutates = i7, this.globalMiddleware.push(t7);
+ }, argv);
+}
+var GlobalMiddleware;
+var init_middleware = __esm({
+ "node_modules/yargs/build/lib/middleware.js"() {
+ "use strict";
+ init_argsert();
+ init_is_promise();
+ GlobalMiddleware = class {
+ constructor(yargs) {
+ this.globalMiddleware = [];
+ this.frozens = [];
+ this.yargs = yargs;
+ }
+ addMiddleware(callback, applyBeforeValidation, global2 = true, mutates = false) {
+ argsert(" [boolean] [boolean] [boolean]", [callback, applyBeforeValidation, global2], arguments.length);
+ if (Array.isArray(callback)) {
+ for (let i6 = 0; i6 < callback.length; i6++) {
+ if (typeof callback[i6] !== "function") {
+ throw Error("middleware must be a function");
+ }
+ const m3 = callback[i6];
+ m3.applyBeforeValidation = applyBeforeValidation;
+ m3.global = global2;
+ }
+ Array.prototype.push.apply(this.globalMiddleware, callback);
+ } else if (typeof callback === "function") {
+ const m3 = callback;
+ m3.applyBeforeValidation = applyBeforeValidation;
+ m3.global = global2;
+ m3.mutates = mutates;
+ this.globalMiddleware.push(callback);
}
return this.yargs;
}
- addCoerceMiddleware(t7, e7) {
- const s7 = this.yargs.getAliases();
- return this.globalMiddleware = this.globalMiddleware.filter(((t8) => {
- const i7 = [...s7[e7] || [], e7];
- return !t8.option || !i7.includes(t8.option);
- })), t7.option = e7, this.addMiddleware(t7, true, true, true);
+ addCoerceMiddleware(callback, option) {
+ const aliases = this.yargs.getAliases();
+ this.globalMiddleware = this.globalMiddleware.filter((m3) => {
+ const toCheck = [...aliases[option] || [], option];
+ if (!m3.option)
+ return true;
+ else
+ return !toCheck.includes(m3.option);
+ });
+ callback.option = option;
+ return this.addMiddleware(callback, true, true, true);
}
getMiddleware() {
return this.globalMiddleware;
@@ -96697,81 +96277,196 @@ var require_build4 = __commonJS({
this.frozens.push([...this.globalMiddleware]);
}
unfreeze() {
- const t7 = this.frozens.pop();
- void 0 !== t7 && (this.globalMiddleware = t7);
+ const frozen = this.frozens.pop();
+ if (frozen !== void 0)
+ this.globalMiddleware = frozen;
}
reset() {
- this.globalMiddleware = this.globalMiddleware.filter(((t7) => t7.global));
+ this.globalMiddleware = this.globalMiddleware.filter((m3) => m3.global);
}
};
- function C3(t7, e7, s7, i7) {
- return s7.reduce(((t8, s8) => {
- if (s8.applyBeforeValidation !== i7) return t8;
- if (s8.mutates) {
- if (s8.applied) return t8;
- s8.applied = true;
- }
- if (f6(t8)) return t8.then(((t9) => Promise.all([t9, s8(t9, e7)]))).then((([t9, e8]) => Object.assign(t9, e8)));
- {
- const i8 = s8(t8, e7);
- return f6(i8) ? i8.then(((e8) => Object.assign(t8, e8))) : Object.assign(t8, i8);
+ }
+});
+
+// node_modules/yargs/build/lib/utils/maybe-async-result.js
+function maybeAsyncResult(getResult, resultHandler, errorHandler = (err) => {
+ throw err;
+}) {
+ try {
+ const result = isFunction(getResult) ? getResult() : getResult;
+ return isPromise(result) ? result.then((result2) => resultHandler(result2)) : resultHandler(result);
+ } catch (err) {
+ return errorHandler(err);
+ }
+}
+function isFunction(arg) {
+ return typeof arg === "function";
+}
+var init_maybe_async_result = __esm({
+ "node_modules/yargs/build/lib/utils/maybe-async-result.js"() {
+ "use strict";
+ init_is_promise();
+ }
+});
+
+// node_modules/yargs/build/lib/command.js
+function command(usage2, validation2, globalMiddleware, shim3) {
+ return new CommandInstance(usage2, validation2, globalMiddleware, shim3);
+}
+function isCommandBuilderDefinition(builder) {
+ return typeof builder === "object" && !!builder.builder && typeof builder.handler === "function";
+}
+function isCommandAndAliases(cmd) {
+ return cmd.every((c6) => typeof c6 === "string");
+}
+function isCommandBuilderCallback(builder) {
+ return typeof builder === "function";
+}
+function isCommandBuilderOptionDefinitions(builder) {
+ return typeof builder === "object";
+}
+function isCommandHandlerDefinition(cmd) {
+ return typeof cmd === "object" && !Array.isArray(cmd);
+}
+var DEFAULT_MARKER, CommandInstance;
+var init_command = __esm({
+ "node_modules/yargs/build/lib/command.js"() {
+ "use strict";
+ init_common_types();
+ init_is_promise();
+ init_middleware();
+ init_parse_command();
+ init_yargs_factory();
+ init_maybe_async_result();
+ DEFAULT_MARKER = /(^\*)|(^\$0)/;
+ CommandInstance = class {
+ constructor(usage2, validation2, globalMiddleware, shim3) {
+ this.requireCache = /* @__PURE__ */ new Set();
+ this.handlers = {};
+ this.aliasMap = {};
+ this.frozens = [];
+ this.shim = shim3;
+ this.usage = usage2;
+ this.globalMiddleware = globalMiddleware;
+ this.validation = validation2;
+ }
+ addDirectory(dir2, req, callerFile, opts) {
+ opts = opts || {};
+ this.requireCache.add(callerFile);
+ const fullDirPath = this.shim.path.resolve(this.shim.path.dirname(callerFile), dir2);
+ const files = this.shim.readdirSync(fullDirPath, {
+ recursive: opts.recurse ? true : false
+ });
+ if (!Array.isArray(opts.extensions))
+ opts.extensions = ["js"];
+ const visit = typeof opts.visit === "function" ? opts.visit : (o2) => o2;
+ for (const fileb of files) {
+ const file = fileb.toString();
+ if (opts.exclude) {
+ let exclude = false;
+ if (typeof opts.exclude === "function") {
+ exclude = opts.exclude(file);
+ } else {
+ exclude = opts.exclude.test(file);
+ }
+ if (exclude)
+ continue;
+ }
+ if (opts.include) {
+ let include2 = false;
+ if (typeof opts.include === "function") {
+ include2 = opts.include(file);
+ } else {
+ include2 = opts.include.test(file);
+ }
+ if (!include2)
+ continue;
+ }
+ let supportedExtension = false;
+ for (const ext3 of opts.extensions) {
+ if (file.endsWith(ext3))
+ supportedExtension = true;
+ }
+ if (supportedExtension) {
+ const joined = this.shim.path.join(fullDirPath, file);
+ const module = req(joined);
+ const extendableModule = Object.create(null, Object.getOwnPropertyDescriptors({ ...module }));
+ const visited = visit(extendableModule, joined, file);
+ if (visited) {
+ if (this.requireCache.has(joined))
+ continue;
+ else
+ this.requireCache.add(joined);
+ if (!extendableModule.command) {
+ extendableModule.command = this.shim.path.basename(joined, this.shim.path.extname(joined));
+ }
+ this.addHandler(extendableModule);
+ }
+ }
}
- }), t7);
- }
- function j7(t7, e7, s7 = ((t8) => {
- throw t8;
- })) {
- try {
- const s8 = "function" == typeof t7 ? t7() : t7;
- return f6(s8) ? s8.then(((t8) => e7(t8))) : e7(s8);
- } catch (t8) {
- return s7(t8);
- }
- }
- var M2 = /(^\*)|(^\$0)/;
- var _3 = class {
- constructor(t7, e7, s7, i7) {
- this.requireCache = /* @__PURE__ */ new Set(), this.handlers = {}, this.aliasMap = {}, this.frozens = [], this.shim = i7, this.usage = t7, this.globalMiddleware = s7, this.validation = e7;
- }
- addDirectory(t7, e7, s7, i7) {
- "boolean" != typeof (i7 = i7 || {}).recurse && (i7.recurse = false), Array.isArray(i7.extensions) || (i7.extensions = ["js"]);
- const n13 = "function" == typeof i7.visit ? i7.visit : (t8) => t8;
- i7.visit = (t8, e8, s8) => {
- const i8 = n13(t8, e8, s8);
- if (i8) {
- if (this.requireCache.has(e8)) return i8;
- this.requireCache.add(e8), this.addHandler(i8);
- }
- return i8;
- }, this.shim.requireDirectory({ require: e7, filename: s7 }, t7, i7);
- }
- addHandler(t7, e7, s7, i7, n13, r7) {
- let a7 = [];
- const h7 = (function(t8) {
- return t8 ? t8.map(((t9) => (t9.applyBeforeValidation = false, t9))) : [];
- })(n13);
- if (i7 = i7 || (() => {
- }), Array.isArray(t7)) if ((function(t8) {
- return t8.every(((t9) => "string" == typeof t9));
- })(t7)) [t7, ...a7] = t7;
- else for (const e8 of t7) this.addHandler(e8);
- else {
- if ((function(t8) {
- return "object" == typeof t8 && !Array.isArray(t8);
- })(t7)) {
- let e8 = Array.isArray(t7.command) || "string" == typeof t7.command ? t7.command : this.moduleName(t7);
- return t7.aliases && (e8 = [].concat(e8).concat(t7.aliases)), void this.addHandler(e8, this.extractDesc(t7), t7.builder, t7.handler, t7.middlewares, t7.deprecated);
+ }
+ addHandler(cmd, description, builder, handler2, commandMiddleware, deprecated) {
+ let aliases = [];
+ const middlewares = commandMiddlewareFactory(commandMiddleware);
+ handler2 = handler2 || (() => {
+ });
+ if (Array.isArray(cmd)) {
+ if (isCommandAndAliases(cmd)) {
+ [cmd, ...aliases] = cmd;
+ } else {
+ for (const command2 of cmd) {
+ this.addHandler(command2);
+ }
}
- if (k7(s7)) return void this.addHandler([t7].concat(a7), e7, s7.builder, s7.handler, s7.middlewares, s7.deprecated);
+ } else if (isCommandHandlerDefinition(cmd)) {
+ let command2 = Array.isArray(cmd.command) || typeof cmd.command === "string" ? cmd.command : null;
+ if (command2 === null) {
+ throw new Error(`No command name given for module: ${this.shim.inspect(cmd)}`);
+ }
+ if (cmd.aliases)
+ command2 = [].concat(command2).concat(cmd.aliases);
+ this.addHandler(command2, this.extractDesc(cmd), cmd.builder, cmd.handler, cmd.middlewares, cmd.deprecated);
+ return;
+ } else if (isCommandBuilderDefinition(builder)) {
+ this.addHandler([cmd].concat(aliases), description, builder.builder, builder.handler, builder.middlewares, builder.deprecated);
+ return;
}
- if ("string" == typeof t7) {
- const n14 = o6(t7);
- a7 = a7.map(((t8) => o6(t8).cmd));
- let l7 = false;
- const c7 = [n14.cmd].concat(a7).filter(((t8) => !M2.test(t8) || (l7 = true, false)));
- 0 === c7.length && l7 && c7.push("$0"), l7 && (n14.cmd = c7[0], a7 = c7.slice(1), t7 = t7.replace(M2, n14.cmd)), a7.forEach(((t8) => {
- this.aliasMap[t8] = n14.cmd;
- })), false !== e7 && this.usage.command(t7, e7, l7, a7, r7), this.handlers[n14.cmd] = { original: t7, description: e7, handler: i7, builder: s7 || {}, middlewares: h7, deprecated: r7, demanded: n14.demanded, optional: n14.optional }, l7 && (this.defaultCommand = this.handlers[n14.cmd]);
+ if (typeof cmd === "string") {
+ const parsedCommand = parseCommand(cmd);
+ aliases = aliases.map((alias) => parseCommand(alias).cmd);
+ let isDefault = false;
+ const parsedAliases = [parsedCommand.cmd].concat(aliases).filter((c6) => {
+ if (DEFAULT_MARKER.test(c6)) {
+ isDefault = true;
+ return false;
+ }
+ return true;
+ });
+ if (parsedAliases.length === 0 && isDefault)
+ parsedAliases.push("$0");
+ if (isDefault) {
+ parsedCommand.cmd = parsedAliases[0];
+ aliases = parsedAliases.slice(1);
+ cmd = cmd.replace(DEFAULT_MARKER, parsedCommand.cmd);
+ }
+ aliases.forEach((alias) => {
+ this.aliasMap[alias] = parsedCommand.cmd;
+ });
+ if (description !== false) {
+ this.usage.command(cmd, description, isDefault, aliases, deprecated);
+ }
+ this.handlers[parsedCommand.cmd] = {
+ original: cmd,
+ description,
+ handler: handler2,
+ builder: builder || {},
+ middlewares,
+ deprecated,
+ demanded: parsedCommand.demanded,
+ optional: parsedCommand.optional
+ };
+ if (isDefault)
+ this.defaultCommand = this.handlers[parsedCommand.cmd];
}
}
getCommandHandlers() {
@@ -96783,510 +96478,874 @@ var require_build4 = __commonJS({
hasDefaultCommand() {
return !!this.defaultCommand;
}
- runCommand(t7, e7, s7, i7, n13, r7) {
- const o7 = this.handlers[t7] || this.handlers[this.aliasMap[t7]] || this.defaultCommand, a7 = e7.getInternalMethods().getContext(), h7 = a7.commands.slice(), l7 = !t7;
- t7 && (a7.commands.push(t7), a7.fullCommands.push(o7.original));
- const c7 = this.applyBuilderUpdateUsageAndParse(l7, o7, e7, s7.aliases, h7, i7, n13, r7);
- return f6(c7) ? c7.then(((t8) => this.applyMiddlewareAndGetResult(l7, o7, t8.innerArgv, a7, n13, t8.aliases, e7))) : this.applyMiddlewareAndGetResult(l7, o7, c7.innerArgv, a7, n13, c7.aliases, e7);
- }
- applyBuilderUpdateUsageAndParse(t7, e7, s7, i7, n13, r7, o7, a7) {
- const h7 = e7.builder;
- let l7 = s7;
- if (x6(h7)) {
- s7.getInternalMethods().getUsageInstance().freeze();
- const c7 = h7(s7.getInternalMethods().reset(i7), a7);
- if (f6(c7)) return c7.then(((i8) => {
- var a8;
- return l7 = (a8 = i8) && "function" == typeof a8.getInternalMethods ? i8 : s7, this.parseAndUpdateUsage(t7, e7, l7, n13, r7, o7);
- }));
- } else /* @__PURE__ */ (function(t8) {
- return "object" == typeof t8;
- })(h7) && (s7.getInternalMethods().getUsageInstance().freeze(), l7 = s7.getInternalMethods().reset(i7), Object.keys(e7.builder).forEach(((t8) => {
- l7.option(t8, h7[t8]);
- })));
- return this.parseAndUpdateUsage(t7, e7, l7, n13, r7, o7);
- }
- parseAndUpdateUsage(t7, e7, s7, i7, n13, r7) {
- t7 && s7.getInternalMethods().getUsageInstance().unfreeze(true), this.shouldUpdateUsage(s7) && s7.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i7, e7), e7.description);
- const o7 = s7.getInternalMethods().runYargsParserAndExecuteCommands(null, void 0, true, n13, r7);
- return f6(o7) ? o7.then(((t8) => ({ aliases: s7.parsed.aliases, innerArgv: t8 }))) : { aliases: s7.parsed.aliases, innerArgv: o7 };
- }
- shouldUpdateUsage(t7) {
- return !t7.getInternalMethods().getUsageInstance().getUsageDisabled() && 0 === t7.getInternalMethods().getUsageInstance().getUsage().length;
- }
- usageFromParentCommandsCommandHandler(t7, e7) {
- const s7 = M2.test(e7.original) ? e7.original.replace(M2, "").trim() : e7.original, i7 = t7.filter(((t8) => !M2.test(t8)));
- return i7.push(s7), `$0 ${i7.join(" ")}`;
- }
- handleValidationAndGetResult(t7, e7, s7, i7, n13, r7, o7, a7) {
- if (!r7.getInternalMethods().getHasOutput()) {
- const e8 = r7.getInternalMethods().runValidation(n13, a7, r7.parsed.error, t7);
- s7 = j7(s7, ((t8) => (e8(t8), t8)));
- }
- if (e7.handler && !r7.getInternalMethods().getHasOutput()) {
- r7.getInternalMethods().setHasOutput();
- const i8 = !!r7.getOptions().configuration["populate--"];
- r7.getInternalMethods().postProcess(s7, i8, false, false), s7 = j7(s7 = C3(s7, r7, o7, false), ((t8) => {
- const s8 = e7.handler(t8);
- return f6(s8) ? s8.then((() => t8)) : t8;
- })), t7 || r7.getInternalMethods().getUsageInstance().cacheHelpMessage(), f6(s7) && !r7.getInternalMethods().hasParseCallback() && s7.catch(((t8) => {
- try {
- r7.getInternalMethods().getUsageInstance().fail(null, t8);
- } catch (t9) {
- }
- }));
+ runCommand(command2, yargs, parsed, commandIndex, helpOnly, helpOrVersionSet) {
+ const commandHandler = this.handlers[command2] || this.handlers[this.aliasMap[command2]] || this.defaultCommand;
+ const currentContext = yargs.getInternalMethods().getContext();
+ const parentCommands = currentContext.commands.slice();
+ const isDefaultCommand = !command2;
+ if (command2) {
+ currentContext.commands.push(command2);
+ currentContext.fullCommands.push(commandHandler.original);
+ }
+ const builderResult = this.applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, parsed.aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet);
+ return isPromise(builderResult) ? builderResult.then((result) => this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, result.innerArgv, currentContext, helpOnly, result.aliases, yargs)) : this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, builderResult.innerArgv, currentContext, helpOnly, builderResult.aliases, yargs);
+ }
+ applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet) {
+ const builder = commandHandler.builder;
+ let innerYargs = yargs;
+ if (isCommandBuilderCallback(builder)) {
+ yargs.getInternalMethods().getUsageInstance().freeze();
+ const builderOutput = builder(yargs.getInternalMethods().reset(aliases), helpOrVersionSet);
+ if (isPromise(builderOutput)) {
+ return builderOutput.then((output) => {
+ innerYargs = isYargsInstance(output) ? output : yargs;
+ return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly);
+ });
+ }
+ } else if (isCommandBuilderOptionDefinitions(builder)) {
+ yargs.getInternalMethods().getUsageInstance().freeze();
+ innerYargs = yargs.getInternalMethods().reset(aliases);
+ Object.keys(commandHandler.builder).forEach((key) => {
+ innerYargs.option(key, builder[key]);
+ });
}
- return t7 || (i7.commands.pop(), i7.fullCommands.pop()), s7;
- }
- applyMiddlewareAndGetResult(t7, e7, s7, i7, n13, r7, o7) {
- let a7 = {};
- if (n13) return s7;
- o7.getInternalMethods().getHasOutput() || (a7 = this.populatePositionals(e7, s7, i7, o7));
- const h7 = this.globalMiddleware.getMiddleware().slice(0).concat(e7.middlewares), l7 = C3(s7, o7, h7, true);
- return f6(l7) ? l7.then(((s8) => this.handleValidationAndGetResult(t7, e7, s8, i7, r7, o7, h7, a7))) : this.handleValidationAndGetResult(t7, e7, l7, i7, r7, o7, h7, a7);
- }
- populatePositionals(t7, e7, s7, i7) {
- e7._ = e7._.slice(s7.commands.length);
- const n13 = t7.demanded.slice(0), r7 = t7.optional.slice(0), o7 = {};
- for (this.validation.positionalCount(n13.length, e7._.length); n13.length; ) {
- const t8 = n13.shift();
- this.populatePositional(t8, e7, o7);
- }
- for (; r7.length; ) {
- const t8 = r7.shift();
- this.populatePositional(t8, e7, o7);
- }
- return e7._ = s7.commands.concat(e7._.map(((t8) => "" + t8))), this.postProcessPositionals(e7, o7, this.cmdToParseOptions(t7.original), i7), o7;
- }
- populatePositional(t7, e7, s7) {
- const i7 = t7.cmd[0];
- t7.variadic ? s7[i7] = e7._.splice(0).map(String) : e7._.length && (s7[i7] = [String(e7._.shift())]);
- }
- cmdToParseOptions(t7) {
- const e7 = { array: [], default: {}, alias: {}, demand: {} }, s7 = o6(t7);
- return s7.demanded.forEach(((t8) => {
- const [s8, ...i7] = t8.cmd;
- t8.variadic && (e7.array.push(s8), e7.default[s8] = []), e7.alias[s8] = i7, e7.demand[s8] = true;
- })), s7.optional.forEach(((t8) => {
- const [s8, ...i7] = t8.cmd;
- t8.variadic && (e7.array.push(s8), e7.default[s8] = []), e7.alias[s8] = i7;
- })), e7;
- }
- postProcessPositionals(t7, e7, s7, i7) {
- const n13 = Object.assign({}, i7.getOptions());
- n13.default = Object.assign(s7.default, n13.default);
- for (const t8 of Object.keys(s7.alias)) n13.alias[t8] = (n13.alias[t8] || []).concat(s7.alias[t8]);
- n13.array = n13.array.concat(s7.array), n13.config = {};
- const r7 = [];
- if (Object.keys(e7).forEach(((t8) => {
- e7[t8].map(((e8) => {
- n13.configuration["unknown-options-as-args"] && (n13.key[t8] = true), r7.push(`--${t8}`), r7.push(e8);
- }));
- })), !r7.length) return;
- const o7 = Object.assign({}, n13.configuration, { "populate--": false }), a7 = this.shim.Parser.detailed(r7, Object.assign({}, n13, { configuration: o7 }));
- if (a7.error) i7.getInternalMethods().getUsageInstance().fail(a7.error.message, a7.error);
- else {
- const s8 = Object.keys(e7);
- Object.keys(e7).forEach(((t8) => {
- s8.push(...a7.aliases[t8]);
- })), Object.keys(a7.argv).forEach(((n14) => {
- s8.includes(n14) && (e7[n14] || (e7[n14] = a7.argv[n14]), !this.isInConfigs(i7, n14) && !this.isDefaulted(i7, n14) && Object.prototype.hasOwnProperty.call(t7, n14) && Object.prototype.hasOwnProperty.call(a7.argv, n14) && (Array.isArray(t7[n14]) || Array.isArray(a7.argv[n14])) ? t7[n14] = [].concat(t7[n14], a7.argv[n14]) : t7[n14] = a7.argv[n14]);
- }));
+ return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly);
+ }
+ parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly) {
+ if (isDefaultCommand)
+ innerYargs.getInternalMethods().getUsageInstance().unfreeze(true);
+ if (this.shouldUpdateUsage(innerYargs)) {
+ innerYargs.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(parentCommands, commandHandler), commandHandler.description);
}
+ const innerArgv = innerYargs.getInternalMethods().runYargsParserAndExecuteCommands(null, void 0, true, commandIndex, helpOnly);
+ return isPromise(innerArgv) ? innerArgv.then((argv) => ({
+ aliases: innerYargs.parsed.aliases,
+ innerArgv: argv
+ })) : {
+ aliases: innerYargs.parsed.aliases,
+ innerArgv
+ };
}
- isDefaulted(t7, e7) {
- const { default: s7 } = t7.getOptions();
- return Object.prototype.hasOwnProperty.call(s7, e7) || Object.prototype.hasOwnProperty.call(s7, this.shim.Parser.camelCase(e7));
+ shouldUpdateUsage(yargs) {
+ return !yargs.getInternalMethods().getUsageInstance().getUsageDisabled() && yargs.getInternalMethods().getUsageInstance().getUsage().length === 0;
}
- isInConfigs(t7, e7) {
- const { configObjects: s7 } = t7.getOptions();
- return s7.some(((t8) => Object.prototype.hasOwnProperty.call(t8, e7))) || s7.some(((t8) => Object.prototype.hasOwnProperty.call(t8, this.shim.Parser.camelCase(e7))));
+ usageFromParentCommandsCommandHandler(parentCommands, commandHandler) {
+ const c6 = DEFAULT_MARKER.test(commandHandler.original) ? commandHandler.original.replace(DEFAULT_MARKER, "").trim() : commandHandler.original;
+ const pc = parentCommands.filter((c7) => {
+ return !DEFAULT_MARKER.test(c7);
+ });
+ pc.push(c6);
+ return `$0 ${pc.join(" ")}`;
}
- runDefaultBuilderOn(t7) {
- if (!this.defaultCommand) return;
- if (this.shouldUpdateUsage(t7)) {
- const e8 = M2.test(this.defaultCommand.original) ? this.defaultCommand.original : this.defaultCommand.original.replace(/^[^[\]<>]*/, "$0 ");
- t7.getInternalMethods().getUsageInstance().usage(e8, this.defaultCommand.description);
+ handleValidationAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, aliases, yargs, middlewares, positionalMap) {
+ if (!yargs.getInternalMethods().getHasOutput()) {
+ const validation2 = yargs.getInternalMethods().runValidation(aliases, positionalMap, yargs.parsed.error, isDefaultCommand);
+ innerArgv = maybeAsyncResult(innerArgv, (result) => {
+ validation2(result);
+ return result;
+ });
}
- const e7 = this.defaultCommand.builder;
- if (x6(e7)) return e7(t7, true);
- k7(e7) || Object.keys(e7).forEach(((s7) => {
- t7.option(s7, e7[s7]);
+ if (commandHandler.handler && !yargs.getInternalMethods().getHasOutput()) {
+ yargs.getInternalMethods().setHasOutput();
+ const populateDoubleDash = !!yargs.getOptions().configuration["populate--"];
+ yargs.getInternalMethods().postProcess(innerArgv, populateDoubleDash, false, false);
+ innerArgv = applyMiddleware(innerArgv, yargs, middlewares, false);
+ innerArgv = maybeAsyncResult(innerArgv, (result) => {
+ const handlerResult = commandHandler.handler(result);
+ return isPromise(handlerResult) ? handlerResult.then(() => result) : result;
+ });
+ if (!isDefaultCommand) {
+ yargs.getInternalMethods().getUsageInstance().cacheHelpMessage();
+ }
+ if (isPromise(innerArgv) && !yargs.getInternalMethods().hasParseCallback()) {
+ innerArgv.catch((error2) => {
+ try {
+ yargs.getInternalMethods().getUsageInstance().fail(null, error2);
+ } catch (_err) {
+ }
+ });
+ }
+ }
+ if (!isDefaultCommand) {
+ currentContext.commands.pop();
+ currentContext.fullCommands.pop();
+ }
+ return innerArgv;
+ }
+ applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, helpOnly, aliases, yargs) {
+ let positionalMap = {};
+ if (helpOnly)
+ return innerArgv;
+ if (!yargs.getInternalMethods().getHasOutput()) {
+ positionalMap = this.populatePositionals(commandHandler, innerArgv, currentContext, yargs);
+ }
+ const middlewares = this.globalMiddleware.getMiddleware().slice(0).concat(commandHandler.middlewares);
+ const maybePromiseArgv = applyMiddleware(innerArgv, yargs, middlewares, true);
+ return isPromise(maybePromiseArgv) ? maybePromiseArgv.then((resolvedInnerArgv) => this.handleValidationAndGetResult(isDefaultCommand, commandHandler, resolvedInnerArgv, currentContext, aliases, yargs, middlewares, positionalMap)) : this.handleValidationAndGetResult(isDefaultCommand, commandHandler, maybePromiseArgv, currentContext, aliases, yargs, middlewares, positionalMap);
+ }
+ populatePositionals(commandHandler, argv, context5, yargs) {
+ argv._ = argv._.slice(context5.commands.length);
+ const demanded = commandHandler.demanded.slice(0);
+ const optional = commandHandler.optional.slice(0);
+ const positionalMap = {};
+ this.validation.positionalCount(demanded.length, argv._.length);
+ while (demanded.length) {
+ const demand = demanded.shift();
+ this.populatePositional(demand, argv, positionalMap);
+ }
+ while (optional.length) {
+ const maybe = optional.shift();
+ this.populatePositional(maybe, argv, positionalMap);
+ }
+ argv._ = context5.commands.concat(argv._.map((a6) => "" + a6));
+ this.postProcessPositionals(argv, positionalMap, this.cmdToParseOptions(commandHandler.original), yargs);
+ return positionalMap;
+ }
+ populatePositional(positional, argv, positionalMap) {
+ const cmd = positional.cmd[0];
+ if (positional.variadic) {
+ positionalMap[cmd] = argv._.splice(0).map(String);
+ } else {
+ if (argv._.length)
+ positionalMap[cmd] = [String(argv._.shift())];
+ }
+ }
+ cmdToParseOptions(cmdString) {
+ const parseOptions = {
+ array: [],
+ default: {},
+ alias: {},
+ demand: {}
+ };
+ const parsed = parseCommand(cmdString);
+ parsed.demanded.forEach((d6) => {
+ const [cmd, ...aliases] = d6.cmd;
+ if (d6.variadic) {
+ parseOptions.array.push(cmd);
+ parseOptions.default[cmd] = [];
+ }
+ parseOptions.alias[cmd] = aliases;
+ parseOptions.demand[cmd] = true;
+ });
+ parsed.optional.forEach((o2) => {
+ const [cmd, ...aliases] = o2.cmd;
+ if (o2.variadic) {
+ parseOptions.array.push(cmd);
+ parseOptions.default[cmd] = [];
+ }
+ parseOptions.alias[cmd] = aliases;
+ });
+ return parseOptions;
+ }
+ postProcessPositionals(argv, positionalMap, parseOptions, yargs) {
+ const options = Object.assign({}, yargs.getOptions());
+ options.default = Object.assign(parseOptions.default, options.default);
+ for (const key of Object.keys(parseOptions.alias)) {
+ options.alias[key] = (options.alias[key] || []).concat(parseOptions.alias[key]);
+ }
+ options.array = options.array.concat(parseOptions.array);
+ options.config = {};
+ const unparsed = [];
+ Object.keys(positionalMap).forEach((key) => {
+ positionalMap[key].map((value) => {
+ if (options.configuration["unknown-options-as-args"])
+ options.key[key] = true;
+ unparsed.push(`--${key}`);
+ unparsed.push(value);
+ });
+ });
+ if (!unparsed.length)
+ return;
+ const config = Object.assign({}, options.configuration, {
+ "populate--": false
+ });
+ const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, {
+ configuration: config
}));
+ if (parsed.error) {
+ yargs.getInternalMethods().getUsageInstance().fail(parsed.error.message, parsed.error);
+ } else {
+ const positionalKeys = Object.keys(positionalMap);
+ Object.keys(positionalMap).forEach((key) => {
+ positionalKeys.push(...parsed.aliases[key]);
+ });
+ Object.keys(parsed.argv).forEach((key) => {
+ if (positionalKeys.includes(key)) {
+ if (!positionalMap[key])
+ positionalMap[key] = parsed.argv[key];
+ if (!this.isInConfigs(yargs, key) && !this.isDefaulted(yargs, key) && Object.prototype.hasOwnProperty.call(argv, key) && Object.prototype.hasOwnProperty.call(parsed.argv, key) && (Array.isArray(argv[key]) || Array.isArray(parsed.argv[key]))) {
+ argv[key] = [].concat(argv[key], parsed.argv[key]);
+ } else {
+ argv[key] = parsed.argv[key];
+ }
+ }
+ });
+ }
}
- moduleName(t7) {
- const e7 = (function(t8) {
- if ("undefined" == typeof __require) return null;
- for (let e8, s7 = 0, i7 = Object.keys(__require.cache); s7 < i7.length; s7++) if (e8 = __require.cache[i7[s7]], e8.exports === t8) return e8;
- return null;
- })(t7);
- if (!e7) throw new Error(`No command name given for module: ${this.shim.inspect(t7)}`);
- return this.commandFromFilename(e7.filename);
+ isDefaulted(yargs, key) {
+ const { default: defaults4 } = yargs.getOptions();
+ return Object.prototype.hasOwnProperty.call(defaults4, key) || Object.prototype.hasOwnProperty.call(defaults4, this.shim.Parser.camelCase(key));
}
- commandFromFilename(t7) {
- return this.shim.path.basename(t7, this.shim.path.extname(t7));
+ isInConfigs(yargs, key) {
+ const { configObjects } = yargs.getOptions();
+ return configObjects.some((c6) => Object.prototype.hasOwnProperty.call(c6, key)) || configObjects.some((c6) => Object.prototype.hasOwnProperty.call(c6, this.shim.Parser.camelCase(key)));
+ }
+ runDefaultBuilderOn(yargs) {
+ if (!this.defaultCommand)
+ return;
+ if (this.shouldUpdateUsage(yargs)) {
+ const commandString = DEFAULT_MARKER.test(this.defaultCommand.original) ? this.defaultCommand.original : this.defaultCommand.original.replace(/^[^[\]<>]*/, "$0 ");
+ yargs.getInternalMethods().getUsageInstance().usage(commandString, this.defaultCommand.description);
+ }
+ const builder = this.defaultCommand.builder;
+ if (isCommandBuilderCallback(builder)) {
+ return builder(yargs, true);
+ } else if (!isCommandBuilderDefinition(builder)) {
+ Object.keys(builder).forEach((key) => {
+ yargs.option(key, builder[key]);
+ });
+ }
+ return void 0;
}
- extractDesc({ describe: t7, description: e7, desc: s7 }) {
- for (const i7 of [t7, e7, s7]) {
- if ("string" == typeof i7 || false === i7) return i7;
- d6(i7, true, this.shim);
+ extractDesc({ describe, description, desc }) {
+ for (const test of [describe, description, desc]) {
+ if (typeof test === "string" || test === false)
+ return test;
+ assertNotStrictEqual(test, true, this.shim);
}
return false;
}
freeze() {
- this.frozens.push({ handlers: this.handlers, aliasMap: this.aliasMap, defaultCommand: this.defaultCommand });
+ this.frozens.push({
+ handlers: this.handlers,
+ aliasMap: this.aliasMap,
+ defaultCommand: this.defaultCommand
+ });
}
unfreeze() {
- const t7 = this.frozens.pop();
- d6(t7, void 0, this.shim), { handlers: this.handlers, aliasMap: this.aliasMap, defaultCommand: this.defaultCommand } = t7;
+ const frozen = this.frozens.pop();
+ assertNotStrictEqual(frozen, void 0, this.shim);
+ ({
+ handlers: this.handlers,
+ aliasMap: this.aliasMap,
+ defaultCommand: this.defaultCommand
+ } = frozen);
}
reset() {
- return this.handlers = {}, this.aliasMap = {}, this.defaultCommand = void 0, this.requireCache = /* @__PURE__ */ new Set(), this;
+ this.handlers = {};
+ this.aliasMap = {};
+ this.defaultCommand = void 0;
+ this.requireCache = /* @__PURE__ */ new Set();
+ return this;
}
};
- function k7(t7) {
- return "object" == typeof t7 && !!t7.builder && "function" == typeof t7.handler;
- }
- function x6(t7) {
- return "function" == typeof t7;
+ }
+});
+
+// node_modules/yargs/build/lib/utils/obj-filter.js
+function objFilter(original = {}, filter4 = () => true) {
+ const obj = {};
+ objectKeys(original).forEach((key) => {
+ if (filter4(key, original[key])) {
+ obj[key] = original[key];
}
- function E2(t7) {
- "undefined" != typeof process && [process.stdout, process.stderr].forEach(((e7) => {
- const s7 = e7;
- s7._handle && s7.isTTY && "function" == typeof s7._handle.setBlocking && s7._handle.setBlocking(t7);
- }));
+ });
+ return obj;
+}
+var init_obj_filter = __esm({
+ "node_modules/yargs/build/lib/utils/obj-filter.js"() {
+ "use strict";
+ init_common_types();
+ }
+});
+
+// node_modules/yargs/build/lib/utils/set-blocking.js
+function setBlocking(blocking) {
+ if (typeof process === "undefined")
+ return;
+ [process.stdout, process.stderr].forEach((_stream) => {
+ const stream5 = _stream;
+ if (stream5._handle && stream5.isTTY && typeof stream5._handle.setBlocking === "function") {
+ stream5._handle.setBlocking(blocking);
}
- function A3(t7) {
- return "boolean" == typeof t7;
- }
- function P2(t7, s7) {
- const i7 = s7.y18n.__, n13 = {}, r7 = [];
- n13.failFn = function(t8) {
- r7.push(t8);
- };
- let o7 = null, a7 = null, h7 = true;
- n13.showHelpOnFail = function(e7 = true, s8) {
- const [i8, r8] = "string" == typeof e7 ? [true, e7] : [e7, s8];
- return t7.getInternalMethods().isGlobalContext() && (a7 = r8), o7 = r8, h7 = i8, n13;
- };
- let l7 = false;
- n13.fail = function(s8, i8) {
- const c8 = t7.getInternalMethods().getLoggerInstance();
- if (!r7.length) {
- if (t7.getExitProcess() && E2(true), !l7) {
- l7 = true, h7 && (t7.showHelp("error"), c8.error()), (s8 || i8) && c8.error(s8 || i8);
- const e7 = o7 || a7;
- e7 && ((s8 || i8) && c8.error(""), c8.error(e7));
- }
- if (i8 = i8 || new e6(s8), t7.getExitProcess()) return t7.exit(1);
- if (t7.getInternalMethods().hasParseCallback()) return t7.exit(1, i8);
- throw i8;
- }
- for (let t8 = r7.length - 1; t8 >= 0; --t8) {
- const e7 = r7[t8];
- if (A3(e7)) {
- if (i8) throw i8;
- if (s8) throw Error(s8);
- } else e7(s8, i8, n13);
- }
- };
- let c7 = [], f7 = false;
- n13.usage = (t8, e7) => null === t8 ? (f7 = true, c7 = [], n13) : (f7 = false, c7.push([t8, e7 || ""]), n13), n13.getUsage = () => c7, n13.getUsageDisabled = () => f7, n13.getPositionalGroupName = () => i7("Positionals:");
- let d7 = [];
- n13.example = (t8, e7) => {
- d7.push([t8, e7 || ""]);
- };
- let u7 = [];
- n13.command = function(t8, e7, s8, i8, n14 = false) {
- s8 && (u7 = u7.map(((t9) => (t9[2] = false, t9)))), u7.push([t8, e7 || "", s8, i8, n14]);
- }, n13.getCommands = () => u7;
- let p7 = {};
- n13.describe = function(t8, e7) {
- Array.isArray(t8) ? t8.forEach(((t9) => {
- n13.describe(t9, e7);
- })) : "object" == typeof t8 ? Object.keys(t8).forEach(((e8) => {
- n13.describe(e8, t8[e8]);
- })) : p7[t8] = e7;
- }, n13.getDescriptions = () => p7;
- let m7 = [];
- n13.epilog = (t8) => {
- m7.push(t8);
- };
- let y3, b7 = false;
- n13.wrap = (t8) => {
- b7 = true, y3 = t8;
- }, n13.getWrap = () => s7.getEnv("YARGS_DISABLE_WRAP") ? null : (b7 || (y3 = (function() {
- const t8 = 80;
- return s7.process.stdColumns ? Math.min(t8, s7.process.stdColumns) : t8;
- })(), b7 = true), y3);
- const v9 = "__yargsString__:";
- function O3(t8, e7, i8) {
- let n14 = 0;
- return Array.isArray(t8) || (t8 = Object.values(t8).map(((t9) => [t9]))), t8.forEach(((t9) => {
- n14 = Math.max(s7.stringWidth(i8 ? `${i8} ${I3(t9[0])}` : I3(t9[0])) + $(t9[0]), n14);
- })), e7 && (n14 = Math.min(n14, parseInt((0.5 * e7).toString(), 10))), n14;
- }
- let w6;
- function C4(e7) {
- return t7.getOptions().hiddenOptions.indexOf(e7) < 0 || t7.parsed.argv[t7.getOptions().showHiddenOpt];
- }
- function j8(t8, e7) {
- let s8 = `[${i7("default:")} `;
- if (void 0 === t8 && !e7) return null;
- if (e7) s8 += e7;
- else switch (typeof t8) {
- case "string":
- s8 += `"${t8}"`;
- break;
- case "object":
- s8 += JSON.stringify(t8);
- break;
- default:
- s8 += t8;
+ });
+}
+var init_set_blocking = __esm({
+ "node_modules/yargs/build/lib/utils/set-blocking.js"() {
+ "use strict";
+ }
+});
+
+// node_modules/yargs/build/lib/usage.js
+function isBoolean(fail) {
+ return typeof fail === "boolean";
+}
+function usage(yargs, shim3) {
+ const __ = shim3.y18n.__;
+ const self2 = {};
+ const fails = [];
+ self2.failFn = function failFn(f6) {
+ fails.push(f6);
+ };
+ let failMessage = null;
+ let globalFailMessage = null;
+ let showHelpOnFail = true;
+ self2.showHelpOnFail = function showHelpOnFailFn(arg1 = true, arg2) {
+ const [enabled2, message] = typeof arg1 === "string" ? [true, arg1] : [arg1, arg2];
+ if (yargs.getInternalMethods().isGlobalContext()) {
+ globalFailMessage = message;
+ }
+ failMessage = message;
+ showHelpOnFail = enabled2;
+ return self2;
+ };
+ let failureOutput = false;
+ self2.fail = function fail(msg, err) {
+ const logger8 = yargs.getInternalMethods().getLoggerInstance();
+ if (fails.length) {
+ for (let i6 = fails.length - 1; i6 >= 0; --i6) {
+ const fail2 = fails[i6];
+ if (isBoolean(fail2)) {
+ if (err)
+ throw err;
+ else if (msg)
+ throw Error(msg);
+ } else {
+ fail2(msg, err, self2);
}
- return `${s8}]`;
}
- n13.deferY18nLookup = (t8) => v9 + t8, n13.help = function() {
- if (w6) return w6;
- !(function() {
- const e8 = t7.getDemandedOptions(), s8 = t7.getOptions();
- (Object.keys(s8.alias) || []).forEach(((i8) => {
- s8.alias[i8].forEach(((r9) => {
- p7[r9] && n13.describe(i8, p7[r9]), r9 in e8 && t7.demandOption(i8, e8[r9]), s8.boolean.includes(r9) && t7.boolean(i8), s8.count.includes(r9) && t7.count(i8), s8.string.includes(r9) && t7.string(i8), s8.normalize.includes(r9) && t7.normalize(i8), s8.array.includes(r9) && t7.array(i8), s8.number.includes(r9) && t7.number(i8);
- }));
- }));
- })();
- const e7 = t7.customScriptName ? t7.$0 : s7.path.basename(t7.$0), r8 = t7.getDemandedOptions(), o8 = t7.getDemandedCommands(), a8 = t7.getDeprecatedOptions(), h8 = t7.getGroups(), l8 = t7.getOptions();
- let g7 = [];
- g7 = g7.concat(Object.keys(p7)), g7 = g7.concat(Object.keys(r8)), g7 = g7.concat(Object.keys(o8)), g7 = g7.concat(Object.keys(l8.default)), g7 = g7.filter(C4), g7 = Object.keys(g7.reduce(((t8, e8) => ("_" !== e8 && (t8[e8] = true), t8)), {}));
- const y4 = n13.getWrap(), b8 = s7.cliui({ width: y4, wrap: !!y4 });
- if (!f7) {
- if (c7.length) c7.forEach(((t8) => {
- b8.div({ text: `${t8[0].replace(/\$0/g, e7)}` }), t8[1] && b8.div({ text: `${t8[1]}`, padding: [1, 0, 0, 0] });
- })), b8.div();
- else if (u7.length) {
- let t8 = null;
- t8 = o8._ ? `${e7} <${i7("command")}>
-` : `${e7} [${i7("command")}]
-`, b8.div(`${t8}`);
- }
- }
- if (u7.length > 1 || 1 === u7.length && !u7[0][2]) {
- b8.div(i7("Commands:"));
- const s8 = t7.getInternalMethods().getContext(), n14 = s8.commands.length ? `${s8.commands.join(" ")} ` : "";
- true === t7.getInternalMethods().getParserConfiguration()["sort-commands"] && (u7 = u7.sort(((t8, e8) => t8[0].localeCompare(e8[0]))));
- const r9 = e7 ? `${e7} ` : "";
- u7.forEach(((t8) => {
- const s9 = `${r9}${n14}${t8[0].replace(/^\$0 ?/, "")}`;
- b8.span({ text: s9, padding: [0, 2, 0, 2], width: O3(u7, y4, `${e7}${n14}`) + 4 }, { text: t8[1] });
- const o9 = [];
- t8[2] && o9.push(`[${i7("default")}]`), t8[3] && t8[3].length && o9.push(`[${i7("aliases:")} ${t8[3].join(", ")}]`), t8[4] && ("string" == typeof t8[4] ? o9.push(`[${i7("deprecated: %s", t8[4])}]`) : o9.push(`[${i7("deprecated")}]`)), o9.length ? b8.div({ text: o9.join(" "), padding: [0, 0, 0, 2], align: "right" }) : b8.div();
- })), b8.div();
- }
- const M4 = (Object.keys(l8.alias) || []).concat(Object.keys(t7.parsed.newAliases) || []);
- g7 = g7.filter(((e8) => !t7.parsed.newAliases[e8] && M4.every(((t8) => -1 === (l8.alias[t8] || []).indexOf(e8)))));
- const _5 = i7("Options:");
- h8[_5] || (h8[_5] = []), (function(t8, e8, s8, i8) {
- let n14 = [], r9 = null;
- Object.keys(s8).forEach(((t9) => {
- n14 = n14.concat(s8[t9]);
- })), t8.forEach(((t9) => {
- r9 = [t9].concat(e8[t9]), r9.some(((t10) => -1 !== n14.indexOf(t10))) || s8[i8].push(t9);
- }));
- })(g7, l8.alias, h8, _5);
- const k8 = (t8) => /^--/.test(I3(t8)), x7 = Object.keys(h8).filter(((t8) => h8[t8].length > 0)).map(((t8) => ({ groupName: t8, normalizedKeys: h8[t8].filter(C4).map(((t9) => {
- if (M4.includes(t9)) return t9;
- for (let e8, s8 = 0; void 0 !== (e8 = M4[s8]); s8++) if ((l8.alias[e8] || []).includes(t9)) return e8;
- return t9;
- })) }))).filter((({ normalizedKeys: t8 }) => t8.length > 0)).map((({ groupName: t8, normalizedKeys: e8 }) => {
- const s8 = e8.reduce(((e9, s9) => (e9[s9] = [s9].concat(l8.alias[s9] || []).map(((e10) => t8 === n13.getPositionalGroupName() ? e10 : (/^[0-9]$/.test(e10) ? l8.boolean.includes(s9) ? "-" : "--" : e10.length > 1 ? "--" : "-") + e10)).sort(((t9, e10) => k8(t9) === k8(e10) ? 0 : k8(t9) ? 1 : -1)).join(", "), e9)), {});
- return { groupName: t8, normalizedKeys: e8, switches: s8 };
- }));
- if (x7.filter((({ groupName: t8 }) => t8 !== n13.getPositionalGroupName())).some((({ normalizedKeys: t8, switches: e8 }) => !t8.every(((t9) => k8(e8[t9]))))) && x7.filter((({ groupName: t8 }) => t8 !== n13.getPositionalGroupName())).forEach((({ normalizedKeys: t8, switches: e8 }) => {
- t8.forEach(((t9) => {
- var s8, i8;
- k8(e8[t9]) && (e8[t9] = (s8 = e8[t9], i8 = 4, S(s8) ? { text: s8.text, indentation: s8.indentation + i8 } : { text: s8, indentation: i8 }));
- }));
- })), x7.forEach((({ groupName: e8, normalizedKeys: s8, switches: o9 }) => {
- b8.div(e8), s8.forEach(((e9) => {
- const s9 = o9[e9];
- let h9 = p7[e9] || "", c8 = null;
- h9.includes(v9) && (h9 = i7(h9.substring(16))), l8.boolean.includes(e9) && (c8 = `[${i7("boolean")}]`), l8.count.includes(e9) && (c8 = `[${i7("count")}]`), l8.string.includes(e9) && (c8 = `[${i7("string")}]`), l8.normalize.includes(e9) && (c8 = `[${i7("string")}]`), l8.array.includes(e9) && (c8 = `[${i7("array")}]`), l8.number.includes(e9) && (c8 = `[${i7("number")}]`);
- const f8 = [e9 in a8 ? (d8 = a8[e9], "string" == typeof d8 ? `[${i7("deprecated: %s", d8)}]` : `[${i7("deprecated")}]`) : null, c8, e9 in r8 ? `[${i7("required")}]` : null, l8.choices && l8.choices[e9] ? `[${i7("choices:")} ${n13.stringifiedValues(l8.choices[e9])}]` : null, j8(l8.default[e9], l8.defaultDescription[e9])].filter(Boolean).join(" ");
- var d8;
- b8.span({ text: I3(s9), padding: [0, 2, 0, 2 + $(s9)], width: O3(o9, y4) + 4 }, h9);
- const u8 = true === t7.getInternalMethods().getUsageConfiguration()["hide-types"];
- f8 && !u8 ? b8.div({ text: f8, padding: [0, 0, 0, 2], align: "right" }) : b8.div();
- })), b8.div();
- })), d7.length && (b8.div(i7("Examples:")), d7.forEach(((t8) => {
- t8[0] = t8[0].replace(/\$0/g, e7);
- })), d7.forEach(((t8) => {
- "" === t8[1] ? b8.div({ text: t8[0], padding: [0, 2, 0, 2] }) : b8.div({ text: t8[0], padding: [0, 2, 0, 2], width: O3(d7, y4) + 4 }, { text: t8[1] });
- })), b8.div()), m7.length > 0) {
- const t8 = m7.map(((t9) => t9.replace(/\$0/g, e7))).join("\n");
- b8.div(`${t8}
-`);
- }
- return b8.toString().replace(/\s*$/, "");
- }, n13.cacheHelpMessage = function() {
- w6 = this.help();
- }, n13.clearCachedHelpMessage = function() {
- w6 = void 0;
- }, n13.hasCachedHelpMessage = function() {
- return !!w6;
- }, n13.showHelp = (e7) => {
- const s8 = t7.getInternalMethods().getLoggerInstance();
- e7 || (e7 = "error");
- ("function" == typeof e7 ? e7 : s8[e7])(n13.help());
- }, n13.functionDescription = (t8) => ["(", t8.name ? s7.Parser.decamelize(t8.name, "-") : i7("generated-value"), ")"].join(""), n13.stringifiedValues = function(t8, e7) {
- let s8 = "";
- const i8 = e7 || ", ", n14 = [].concat(t8);
- return t8 && n14.length ? (n14.forEach(((t9) => {
- s8.length && (s8 += i8), s8 += JSON.stringify(t9);
- })), s8) : s8;
- };
- let M3 = null;
- n13.version = (t8) => {
- M3 = t8;
- }, n13.showVersion = (e7) => {
- const s8 = t7.getInternalMethods().getLoggerInstance();
- e7 || (e7 = "error");
- ("function" == typeof e7 ? e7 : s8[e7])(M3);
- }, n13.reset = function(t8) {
- return o7 = null, l7 = false, c7 = [], f7 = false, m7 = [], d7 = [], u7 = [], p7 = g6(p7, ((e7) => !t8[e7])), n13;
- };
- const _4 = [];
- return n13.freeze = function() {
- _4.push({ failMessage: o7, failureOutput: l7, usages: c7, usageDisabled: f7, epilogs: m7, examples: d7, commands: u7, descriptions: p7 });
- }, n13.unfreeze = function(t8 = false) {
- const e7 = _4.pop();
- e7 && (t8 ? (p7 = { ...e7.descriptions, ...p7 }, u7 = [...e7.commands, ...u7], c7 = [...e7.usages, ...c7], d7 = [...e7.examples, ...d7], m7 = [...e7.epilogs, ...m7]) : { failMessage: o7, failureOutput: l7, usages: c7, usageDisabled: f7, epilogs: m7, examples: d7, commands: u7, descriptions: p7 } = e7);
- }, n13;
- }
- function S(t7) {
- return "object" == typeof t7;
- }
- function $(t7) {
- return S(t7) ? t7.indentation : 0;
- }
- function I3(t7) {
- return S(t7) ? t7.text : t7;
- }
- var D3 = class {
- constructor(t7, e7, s7, i7) {
- var n13, r7, o7;
- this.yargs = t7, this.usage = e7, this.command = s7, this.shim = i7, this.completionKey = "get-yargs-completions", this.aliases = null, this.customCompletionFunction = null, this.indexAfterLastReset = 0, this.zshShell = null !== (o7 = (null === (n13 = this.shim.getEnv("SHELL")) || void 0 === n13 ? void 0 : n13.includes("zsh")) || (null === (r7 = this.shim.getEnv("ZSH_NAME")) || void 0 === r7 ? void 0 : r7.includes("zsh"))) && void 0 !== o7 && o7;
- }
- defaultCompletion(t7, e7, s7, i7) {
- const n13 = this.command.getCommandHandlers();
- for (let e8 = 0, s8 = t7.length; e8 < s8; ++e8) if (n13[t7[e8]] && n13[t7[e8]].builder) {
- const s9 = n13[t7[e8]].builder;
- if (x6(s9)) {
- this.indexAfterLastReset = e8 + 1;
- const t8 = this.yargs.getInternalMethods().reset();
- return s9(t8, true), t8.argv;
- }
- }
- const r7 = [];
- this.commandCompletions(r7, t7, s7), this.optionCompletions(r7, t7, e7, s7), this.choicesFromOptionsCompletions(r7, t7, e7, s7), this.choicesFromPositionalsCompletions(r7, t7, e7, s7), i7(null, r7);
- }
- commandCompletions(t7, e7, s7) {
- const i7 = this.yargs.getInternalMethods().getContext().commands;
- s7.match(/^-/) || i7[i7.length - 1] === s7 || this.previousArgHasChoices(e7) || this.usage.getCommands().forEach(((s8) => {
- const i8 = o6(s8[0]).cmd;
- if (-1 === e7.indexOf(i8)) if (this.zshShell) {
- const e8 = s8[1] || "";
- t7.push(i8.replace(/:/g, "\\:") + ":" + e8);
- } else t7.push(i8);
- }));
+ } else {
+ if (yargs.getExitProcess())
+ setBlocking(true);
+ if (!failureOutput) {
+ failureOutput = true;
+ if (showHelpOnFail) {
+ yargs.showHelp("error");
+ logger8.error();
+ }
+ if (msg || err)
+ logger8.error(msg || err);
+ const globalOrCommandFailMessage = failMessage || globalFailMessage;
+ if (globalOrCommandFailMessage) {
+ if (msg || err)
+ logger8.error("");
+ logger8.error(globalOrCommandFailMessage);
+ }
+ }
+ err = err || new YError(msg);
+ if (yargs.getExitProcess()) {
+ return yargs.exit(1);
+ } else if (yargs.getInternalMethods().hasParseCallback()) {
+ return yargs.exit(1, err);
+ } else {
+ throw err;
}
- optionCompletions(t7, e7, s7, i7) {
- if ((i7.match(/^-/) || "" === i7 && 0 === t7.length) && !this.previousArgHasChoices(e7)) {
- const s8 = this.yargs.getOptions(), n13 = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [];
- Object.keys(s8.key).forEach(((r7) => {
- const o7 = !!s8.configuration["boolean-negation"] && s8.boolean.includes(r7);
- n13.includes(r7) || s8.hiddenOptions.includes(r7) || this.argsContainKey(e7, r7, o7) || this.completeOptionKey(r7, t7, i7, o7 && !!s8.default[r7]);
- }));
+ }
+ };
+ let usages = [];
+ let usageDisabled = false;
+ self2.usage = (msg, description) => {
+ if (msg === null) {
+ usageDisabled = true;
+ usages = [];
+ return self2;
+ }
+ usageDisabled = false;
+ usages.push([msg, description || ""]);
+ return self2;
+ };
+ self2.getUsage = () => {
+ return usages;
+ };
+ self2.getUsageDisabled = () => {
+ return usageDisabled;
+ };
+ self2.getPositionalGroupName = () => {
+ return __("Positionals:");
+ };
+ let examples = [];
+ self2.example = (cmd, description) => {
+ examples.push([cmd, description || ""]);
+ };
+ let commands6 = [];
+ self2.command = function command2(cmd, description, isDefault, aliases, deprecated = false) {
+ if (isDefault) {
+ commands6 = commands6.map((cmdArray) => {
+ cmdArray[2] = false;
+ return cmdArray;
+ });
+ }
+ commands6.push([cmd, description || "", isDefault, aliases, deprecated]);
+ };
+ self2.getCommands = () => commands6;
+ let descriptions = {};
+ self2.describe = function describe(keyOrKeys, desc) {
+ if (Array.isArray(keyOrKeys)) {
+ keyOrKeys.forEach((k7) => {
+ self2.describe(k7, desc);
+ });
+ } else if (typeof keyOrKeys === "object") {
+ Object.keys(keyOrKeys).forEach((k7) => {
+ self2.describe(k7, keyOrKeys[k7]);
+ });
+ } else {
+ descriptions[keyOrKeys] = desc;
+ }
+ };
+ self2.getDescriptions = () => descriptions;
+ let epilogs = [];
+ self2.epilog = (msg) => {
+ epilogs.push(msg);
+ };
+ let wrapSet = false;
+ let wrap2;
+ self2.wrap = (cols) => {
+ wrapSet = true;
+ wrap2 = cols;
+ };
+ self2.getWrap = () => {
+ if (shim3.getEnv("YARGS_DISABLE_WRAP")) {
+ return null;
+ }
+ if (!wrapSet) {
+ wrap2 = windowWidth();
+ wrapSet = true;
+ }
+ return wrap2;
+ };
+ const deferY18nLookupPrefix = "__yargsString__:";
+ self2.deferY18nLookup = (str) => deferY18nLookupPrefix + str;
+ self2.help = function help() {
+ if (cachedHelpMessage)
+ return cachedHelpMessage;
+ normalizeAliases();
+ const base$0 = yargs.customScriptName ? yargs.$0 : shim3.path.basename(yargs.$0);
+ const demandedOptions = yargs.getDemandedOptions();
+ const demandedCommands = yargs.getDemandedCommands();
+ const deprecatedOptions = yargs.getDeprecatedOptions();
+ const groups = yargs.getGroups();
+ const options = yargs.getOptions();
+ let keys = [];
+ keys = keys.concat(Object.keys(descriptions));
+ keys = keys.concat(Object.keys(demandedOptions));
+ keys = keys.concat(Object.keys(demandedCommands));
+ keys = keys.concat(Object.keys(options.default));
+ keys = keys.filter(filterHiddenOptions);
+ keys = Object.keys(keys.reduce((acc, key) => {
+ if (key !== "_")
+ acc[key] = true;
+ return acc;
+ }, {}));
+ const theWrap = self2.getWrap();
+ const ui3 = shim3.cliui({
+ width: theWrap,
+ wrap: !!theWrap
+ });
+ if (!usageDisabled) {
+ if (usages.length) {
+ usages.forEach((usage2) => {
+ ui3.div({ text: `${usage2[0].replace(/\$0/g, base$0)}` });
+ if (usage2[1]) {
+ ui3.div({ text: `${usage2[1]}`, padding: [1, 0, 0, 0] });
+ }
+ });
+ ui3.div();
+ } else if (commands6.length) {
+ let u = null;
+ if (demandedCommands._) {
+ u = `${base$0} <${__("command")}>
+`;
+ } else {
+ u = `${base$0} [${__("command")}]
+`;
}
- }
- choicesFromOptionsCompletions(t7, e7, s7, i7) {
- if (this.previousArgHasChoices(e7)) {
- const s8 = this.getPreviousArgChoices(e7);
- s8 && s8.length > 0 && t7.push(...s8.map(((t8) => t8.replace(/:/g, "\\:"))));
+ ui3.div(`${u}`);
+ }
+ }
+ if (commands6.length > 1 || commands6.length === 1 && !commands6[0][2]) {
+ ui3.div(__("Commands:"));
+ const context5 = yargs.getInternalMethods().getContext();
+ const parentCommands = context5.commands.length ? `${context5.commands.join(" ")} ` : "";
+ if (yargs.getInternalMethods().getParserConfiguration()["sort-commands"] === true) {
+ commands6 = commands6.sort((a6, b6) => a6[0].localeCompare(b6[0]));
+ }
+ const prefix2 = base$0 ? `${base$0} ` : "";
+ commands6.forEach((command2) => {
+ const commandString = `${prefix2}${parentCommands}${command2[0].replace(/^\$0 ?/, "")}`;
+ ui3.span({
+ text: commandString,
+ padding: [0, 2, 0, 2],
+ width: maxWidth(commands6, theWrap, `${base$0}${parentCommands}`) + 4
+ }, { text: command2[1] });
+ const hints = [];
+ if (command2[2])
+ hints.push(`[${__("default")}]`);
+ if (command2[3] && command2[3].length) {
+ hints.push(`[${__("aliases:")} ${command2[3].join(", ")}]`);
+ }
+ if (command2[4]) {
+ if (typeof command2[4] === "string") {
+ hints.push(`[${__("deprecated: %s", command2[4])}]`);
+ } else {
+ hints.push(`[${__("deprecated")}]`);
+ }
}
- }
- choicesFromPositionalsCompletions(t7, e7, s7, i7) {
- if ("" === i7 && t7.length > 0 && this.previousArgHasChoices(e7)) return;
- const n13 = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [], r7 = Math.max(this.indexAfterLastReset, this.yargs.getInternalMethods().getContext().commands.length + 1), o7 = n13[s7._.length - r7 - 1];
- if (!o7) return;
- const a7 = this.yargs.getOptions().choices[o7] || [];
- for (const e8 of a7) e8.startsWith(i7) && t7.push(e8.replace(/:/g, "\\:"));
- }
- getPreviousArgChoices(t7) {
- if (t7.length < 1) return;
- let e7 = t7[t7.length - 1], s7 = "";
- if (!e7.startsWith("-") && t7.length > 1 && (s7 = e7, e7 = t7[t7.length - 2]), !e7.startsWith("-")) return;
- const i7 = e7.replace(/^-+/, ""), n13 = this.yargs.getOptions(), r7 = [i7, ...this.yargs.getAliases()[i7] || []];
- let o7;
- for (const t8 of r7) if (Object.prototype.hasOwnProperty.call(n13.key, t8) && Array.isArray(n13.choices[t8])) {
- o7 = n13.choices[t8];
- break;
+ if (hints.length) {
+ ui3.div({
+ text: hints.join(" "),
+ padding: [0, 0, 0, 2],
+ align: "right"
+ });
+ } else {
+ ui3.div();
+ }
+ });
+ ui3.div();
+ }
+ const aliasKeys = (Object.keys(options.alias) || []).concat(Object.keys(yargs.parsed.newAliases) || []);
+ keys = keys.filter((key) => !yargs.parsed.newAliases[key] && aliasKeys.every((alias) => (options.alias[alias] || []).indexOf(key) === -1));
+ const defaultGroup = __("Options:");
+ if (!groups[defaultGroup])
+ groups[defaultGroup] = [];
+ addUngroupedKeys(keys, options.alias, groups, defaultGroup);
+ const isLongSwitch = (sw) => /^--/.test(getText(sw));
+ const displayedGroups = Object.keys(groups).filter((groupName) => groups[groupName].length > 0).map((groupName) => {
+ const normalizedKeys = groups[groupName].filter(filterHiddenOptions).map((key) => {
+ if (aliasKeys.includes(key))
+ return key;
+ for (let i6 = 0, aliasKey; (aliasKey = aliasKeys[i6]) !== void 0; i6++) {
+ if ((options.alias[aliasKey] || []).includes(key))
+ return aliasKey;
}
- return o7 ? o7.filter(((t8) => !s7 || t8.startsWith(s7))) : void 0;
- }
- previousArgHasChoices(t7) {
- const e7 = this.getPreviousArgChoices(t7);
- return void 0 !== e7 && e7.length > 0;
- }
- argsContainKey(t7, e7, s7) {
- const i7 = (e8) => -1 !== t7.indexOf((/^[^0-9]$/.test(e8) ? "-" : "--") + e8);
- if (i7(e7)) return true;
- if (s7 && i7(`no-${e7}`)) return true;
- if (this.aliases) {
- for (const t8 of this.aliases[e7]) if (i7(t8)) return true;
+ return key;
+ });
+ return { groupName, normalizedKeys };
+ }).filter(({ normalizedKeys }) => normalizedKeys.length > 0).map(({ groupName, normalizedKeys }) => {
+ const switches = normalizedKeys.reduce((acc, key) => {
+ acc[key] = [key].concat(options.alias[key] || []).map((sw) => {
+ if (groupName === self2.getPositionalGroupName())
+ return sw;
+ else {
+ return (/^[0-9]$/.test(sw) ? options.boolean.includes(key) ? "-" : "--" : sw.length > 1 ? "--" : "-") + sw;
+ }
+ }).sort((sw1, sw2) => isLongSwitch(sw1) === isLongSwitch(sw2) ? 0 : isLongSwitch(sw1) ? 1 : -1).join(", ");
+ return acc;
+ }, {});
+ return { groupName, normalizedKeys, switches };
+ });
+ const shortSwitchesUsed = displayedGroups.filter(({ groupName }) => groupName !== self2.getPositionalGroupName()).some(({ normalizedKeys, switches }) => !normalizedKeys.every((key) => isLongSwitch(switches[key])));
+ if (shortSwitchesUsed) {
+ displayedGroups.filter(({ groupName }) => groupName !== self2.getPositionalGroupName()).forEach(({ normalizedKeys, switches }) => {
+ normalizedKeys.forEach((key) => {
+ if (isLongSwitch(switches[key])) {
+ switches[key] = addIndentation(switches[key], "-x, ".length);
+ }
+ });
+ });
+ }
+ displayedGroups.forEach(({ groupName, normalizedKeys, switches }) => {
+ ui3.div(groupName);
+ normalizedKeys.forEach((key) => {
+ const kswitch = switches[key];
+ let desc = descriptions[key] || "";
+ let type = null;
+ if (desc.includes(deferY18nLookupPrefix))
+ desc = __(desc.substring(deferY18nLookupPrefix.length));
+ if (options.boolean.includes(key))
+ type = `[${__("boolean")}]`;
+ if (options.count.includes(key))
+ type = `[${__("count")}]`;
+ if (options.string.includes(key))
+ type = `[${__("string")}]`;
+ if (options.normalize.includes(key))
+ type = `[${__("string")}]`;
+ if (options.array.includes(key))
+ type = `[${__("array")}]`;
+ if (options.number.includes(key))
+ type = `[${__("number")}]`;
+ const deprecatedExtra = (deprecated) => typeof deprecated === "string" ? `[${__("deprecated: %s", deprecated)}]` : `[${__("deprecated")}]`;
+ const extra = [
+ key in deprecatedOptions ? deprecatedExtra(deprecatedOptions[key]) : null,
+ type,
+ key in demandedOptions ? `[${__("required")}]` : null,
+ options.choices && options.choices[key] ? `[${__("choices:")} ${self2.stringifiedValues(options.choices[key])}]` : null,
+ defaultString(options.default[key], options.defaultDescription[key])
+ ].filter(Boolean).join(" ");
+ ui3.span({
+ text: getText(kswitch),
+ padding: [0, 2, 0, 2 + getIndentation(kswitch)],
+ width: maxWidth(switches, theWrap) + 4
+ }, desc);
+ const shouldHideOptionExtras = yargs.getInternalMethods().getUsageConfiguration()["hide-types"] === true;
+ if (extra && !shouldHideOptionExtras)
+ ui3.div({ text: extra, padding: [0, 0, 0, 2], align: "right" });
+ else
+ ui3.div();
+ });
+ ui3.div();
+ });
+ if (examples.length) {
+ ui3.div(__("Examples:"));
+ examples.forEach((example) => {
+ example[0] = example[0].replace(/\$0/g, base$0);
+ });
+ examples.forEach((example) => {
+ if (example[1] === "") {
+ ui3.div({
+ text: example[0],
+ padding: [0, 2, 0, 2]
+ });
+ } else {
+ ui3.div({
+ text: example[0],
+ padding: [0, 2, 0, 2],
+ width: maxWidth(examples, theWrap) + 4
+ }, {
+ text: example[1]
+ });
}
- return false;
- }
- completeOptionKey(t7, e7, s7, i7) {
- var n13, r7, o7, a7;
- let h7 = t7;
- if (this.zshShell) {
- const e8 = this.usage.getDescriptions(), s8 = null === (r7 = null === (n13 = null == this ? void 0 : this.aliases) || void 0 === n13 ? void 0 : n13[t7]) || void 0 === r7 ? void 0 : r7.find(((t8) => {
- const s9 = e8[t8];
- return "string" == typeof s9 && s9.length > 0;
- })), i8 = s8 ? e8[s8] : void 0, l8 = null !== (a7 = null !== (o7 = e8[t7]) && void 0 !== o7 ? o7 : i8) && void 0 !== a7 ? a7 : "";
- h7 = `${t7.replace(/:/g, "\\:")}:${l8.replace("__yargsString__:", "").replace(/(\r\n|\n|\r)/gm, " ")}`;
- }
- const l7 = !/^--/.test(s7) && ((t8) => /^[^0-9]$/.test(t8))(t7) ? "-" : "--";
- e7.push(l7 + h7), i7 && e7.push(l7 + "no-" + h7);
- }
- customCompletion(t7, e7, s7, i7) {
- if (d6(this.customCompletionFunction, null, this.shim), this.customCompletionFunction.length < 3) {
- const t8 = this.customCompletionFunction(s7, e7);
- return f6(t8) ? t8.then(((t9) => {
- this.shim.process.nextTick((() => {
- i7(null, t9);
- }));
- })).catch(((t9) => {
- this.shim.process.nextTick((() => {
- i7(t9, void 0);
- }));
- })) : i7(null, t8);
- }
- return (function(t8) {
- return t8.length > 3;
- })(this.customCompletionFunction) ? this.customCompletionFunction(s7, e7, ((n13 = i7) => this.defaultCompletion(t7, e7, s7, n13)), ((t8) => {
- i7(null, t8);
- })) : this.customCompletionFunction(s7, e7, ((t8) => {
- i7(null, t8);
- }));
+ });
+ ui3.div();
+ }
+ if (epilogs.length > 0) {
+ const e6 = epilogs.map((epilog) => epilog.replace(/\$0/g, base$0)).join("\n");
+ ui3.div(`${e6}
+`);
+ }
+ return ui3.toString().replace(/\s*$/, "");
+ };
+ function maxWidth(table, theWrap, modifier) {
+ let width = 0;
+ if (!Array.isArray(table)) {
+ table = Object.values(table).map((v2) => [v2]);
+ }
+ table.forEach((v2) => {
+ width = Math.max(shim3.stringWidth(modifier ? `${modifier} ${getText(v2[0])}` : getText(v2[0])) + getIndentation(v2[0]), width);
+ });
+ if (theWrap)
+ width = Math.min(width, parseInt((theWrap * 0.5).toString(), 10));
+ return width;
+ }
+ function normalizeAliases() {
+ const demandedOptions = yargs.getDemandedOptions();
+ const options = yargs.getOptions();
+ (Object.keys(options.alias) || []).forEach((key) => {
+ options.alias[key].forEach((alias) => {
+ if (descriptions[alias])
+ self2.describe(key, descriptions[alias]);
+ if (alias in demandedOptions)
+ yargs.demandOption(key, demandedOptions[alias]);
+ if (options.boolean.includes(alias))
+ yargs.boolean(key);
+ if (options.count.includes(alias))
+ yargs.count(key);
+ if (options.string.includes(alias))
+ yargs.string(key);
+ if (options.normalize.includes(alias))
+ yargs.normalize(key);
+ if (options.array.includes(alias))
+ yargs.array(key);
+ if (options.number.includes(alias))
+ yargs.number(key);
+ });
+ });
+ }
+ let cachedHelpMessage;
+ self2.cacheHelpMessage = function() {
+ cachedHelpMessage = this.help();
+ };
+ self2.clearCachedHelpMessage = function() {
+ cachedHelpMessage = void 0;
+ };
+ self2.hasCachedHelpMessage = function() {
+ return !!cachedHelpMessage;
+ };
+ function addUngroupedKeys(keys, aliases, groups, defaultGroup) {
+ let groupedKeys = [];
+ let toCheck = null;
+ Object.keys(groups).forEach((group3) => {
+ groupedKeys = groupedKeys.concat(groups[group3]);
+ });
+ keys.forEach((key) => {
+ toCheck = [key].concat(aliases[key]);
+ if (!toCheck.some((k7) => groupedKeys.indexOf(k7) !== -1)) {
+ groups[defaultGroup].push(key);
}
- getCompletion(t7, e7) {
- const s7 = t7.length ? t7[t7.length - 1] : "", i7 = this.yargs.parse(t7, true), n13 = this.customCompletionFunction ? (i8) => this.customCompletion(t7, i8, s7, e7) : (i8) => this.defaultCompletion(t7, i8, s7, e7);
- return f6(i7) ? i7.then(n13) : n13(i7);
+ });
+ return groupedKeys;
+ }
+ function filterHiddenOptions(key) {
+ return yargs.getOptions().hiddenOptions.indexOf(key) < 0 || yargs.parsed.argv[yargs.getOptions().showHiddenOpt];
+ }
+ self2.showHelp = (level) => {
+ const logger8 = yargs.getInternalMethods().getLoggerInstance();
+ if (!level)
+ level = "error";
+ const emit = typeof level === "function" ? level : logger8[level];
+ emit(self2.help());
+ };
+ self2.functionDescription = (fn) => {
+ const description = fn.name ? shim3.Parser.decamelize(fn.name, "-") : __("generated-value");
+ return ["(", description, ")"].join("");
+ };
+ self2.stringifiedValues = function stringifiedValues(values, separator) {
+ let string = "";
+ const sep7 = separator || ", ";
+ const array = [].concat(values);
+ if (!values || !array.length)
+ return string;
+ array.forEach((value) => {
+ if (string.length)
+ string += sep7;
+ string += JSON.stringify(value);
+ });
+ return string;
+ };
+ function defaultString(value, defaultDescription) {
+ let string = `[${__("default:")} `;
+ if (value === void 0 && !defaultDescription)
+ return null;
+ if (defaultDescription) {
+ string += defaultDescription;
+ } else {
+ switch (typeof value) {
+ case "string":
+ string += `"${value}"`;
+ break;
+ case "object":
+ string += JSON.stringify(value);
+ break;
+ default:
+ string += value;
}
- generateCompletionScript(t7, e7) {
- let s7 = this.zshShell ? `#compdef {{app_name}}
+ }
+ return `${string}]`;
+ }
+ function windowWidth() {
+ const maxWidth2 = 80;
+ if (shim3.process.stdColumns) {
+ return Math.min(maxWidth2, shim3.process.stdColumns);
+ } else {
+ return maxWidth2;
+ }
+ }
+ let version3 = null;
+ self2.version = (ver) => {
+ version3 = ver;
+ };
+ self2.showVersion = (level) => {
+ const logger8 = yargs.getInternalMethods().getLoggerInstance();
+ if (!level)
+ level = "error";
+ const emit = typeof level === "function" ? level : logger8[level];
+ emit(version3);
+ };
+ self2.reset = function reset(localLookup) {
+ failMessage = null;
+ failureOutput = false;
+ usages = [];
+ usageDisabled = false;
+ epilogs = [];
+ examples = [];
+ commands6 = [];
+ descriptions = objFilter(descriptions, (k7) => !localLookup[k7]);
+ return self2;
+ };
+ const frozens = [];
+ self2.freeze = function freeze() {
+ frozens.push({
+ failMessage,
+ failureOutput,
+ usages,
+ usageDisabled,
+ epilogs,
+ examples,
+ commands: commands6,
+ descriptions
+ });
+ };
+ self2.unfreeze = function unfreeze(defaultCommand = false) {
+ const frozen = frozens.pop();
+ if (!frozen)
+ return;
+ if (defaultCommand) {
+ descriptions = { ...frozen.descriptions, ...descriptions };
+ commands6 = [...frozen.commands, ...commands6];
+ usages = [...frozen.usages, ...usages];
+ examples = [...frozen.examples, ...examples];
+ epilogs = [...frozen.epilogs, ...epilogs];
+ } else {
+ ({
+ failMessage,
+ failureOutput,
+ usages,
+ usageDisabled,
+ epilogs,
+ examples,
+ commands: commands6,
+ descriptions
+ } = frozen);
+ }
+ };
+ return self2;
+}
+function isIndentedText(text) {
+ return typeof text === "object";
+}
+function addIndentation(text, indent) {
+ return isIndentedText(text) ? { text: text.text, indentation: text.indentation + indent } : { text, indentation: indent };
+}
+function getIndentation(text) {
+ return isIndentedText(text) ? text.indentation : 0;
+}
+function getText(text) {
+ return isIndentedText(text) ? text.text : text;
+}
+var init_usage = __esm({
+ "node_modules/yargs/build/lib/usage.js"() {
+ "use strict";
+ init_obj_filter();
+ init_yerror();
+ init_set_blocking();
+ }
+});
+
+// node_modules/yargs/build/lib/completion-templates.js
+var completionShTemplate, completionZshTemplate;
+var init_completion_templates = __esm({
+ "node_modules/yargs/build/lib/completion-templates.js"() {
+ "use strict";
+ completionShTemplate = `###-begin-{{app_name}}-completions-###
+#
+# yargs command completion script
+#
+# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc
+# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.
+#
+_{{app_name}}_yargs_completions()
+{
+ local cur_word args type_list
+
+ cur_word="\${COMP_WORDS[COMP_CWORD]}"
+ args=("\${COMP_WORDS[@]}")
+
+ # ask yargs to generate completions.
+ # see https://stackoverflow.com/a/40944195/7080036 for the spaces-handling awk
+ mapfile -t type_list < <({{app_path}} --get-yargs-completions "\${args[@]}")
+ mapfile -t COMPREPLY < <(compgen -W "$( printf '%q ' "\${type_list[@]}" )" -- "\${cur_word}" |
+ awk '/ / { print "\\""$0"\\"" } /^[^ ]+$/ { print $0 }')
+
+ # if no match was found, fall back to filename completion
+ if [ \${#COMPREPLY[@]} -eq 0 ]; then
+ COMPREPLY=()
+ fi
+
+ return 0
+}
+complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
+###-end-{{app_name}}-completions-###
+`;
+ completionZshTemplate = `#compdef {{app_name}}
###-begin-{{app_name}}-completions-###
#
# yargs command completion script
@@ -97301,961 +97360,2138 @@ _{{app_name}}_yargs_completions()
IFS=$'
' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
IFS=$si
- _describe 'values' reply
-}
-compdef _{{app_name}}_yargs_completions {{app_name}}
+ if [[ \${#reply} -gt 0 ]]; then
+ _describe 'values' reply
+ else
+ _default
+ fi
+}
+if [[ "'\${zsh_eval_context[-1]}" == "loadautofunc" ]]; then
+ _{{app_name}}_yargs_completions "$@"
+else
+ compdef _{{app_name}}_yargs_completions {{app_name}}
+fi
###-end-{{app_name}}-completions-###
-` : '###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n';
- const i7 = this.shim.path.basename(t7);
- return t7.match(/\.js$/) && (t7 = `./${t7}`), s7 = s7.replace(/{{app_name}}/g, i7), s7 = s7.replace(/{{completion_command}}/g, e7), s7.replace(/{{app_path}}/g, t7);
- }
- registerFunction(t7) {
- this.customCompletionFunction = t7;
- }
- setParsed(t7) {
- this.aliases = t7.aliases;
- }
- };
- function N2(t7, e7) {
- if (0 === t7.length) return e7.length;
- if (0 === e7.length) return t7.length;
- const s7 = [];
- let i7, n13;
- for (i7 = 0; i7 <= e7.length; i7++) s7[i7] = [i7];
- for (n13 = 0; n13 <= t7.length; n13++) s7[0][n13] = n13;
- for (i7 = 1; i7 <= e7.length; i7++) for (n13 = 1; n13 <= t7.length; n13++) e7.charAt(i7 - 1) === t7.charAt(n13 - 1) ? s7[i7][n13] = s7[i7 - 1][n13 - 1] : i7 > 1 && n13 > 1 && e7.charAt(i7 - 2) === t7.charAt(n13 - 1) && e7.charAt(i7 - 1) === t7.charAt(n13 - 2) ? s7[i7][n13] = s7[i7 - 2][n13 - 2] + 1 : s7[i7][n13] = Math.min(s7[i7 - 1][n13 - 1] + 1, Math.min(s7[i7][n13 - 1] + 1, s7[i7 - 1][n13] + 1));
- return s7[e7.length][t7.length];
- }
- var H3 = ["$0", "--", "_"];
- var z2;
- var W2;
- var q7;
- var U2;
- var F3;
- var L2;
- var V2;
- var G3;
- var R2;
- var T2;
- var B3;
- var Y2;
- var K2;
- var J2;
- var Z;
- var X2;
- var Q2;
- var tt2;
- var et2;
- var st2;
- var it2;
- var nt2;
- var rt2;
- var ot2;
- var at2;
- var ht2;
- var lt2;
- var ct2;
- var ft2;
- var dt2;
- var ut2;
- var pt2;
- var gt2;
- var mt2;
- var yt2;
- var bt2 = /* @__PURE__ */ Symbol("copyDoubleDash");
- var vt2 = /* @__PURE__ */ Symbol("copyDoubleDash");
- var Ot2 = /* @__PURE__ */ Symbol("deleteFromParserHintObject");
- var wt2 = /* @__PURE__ */ Symbol("emitWarning");
- var Ct2 = /* @__PURE__ */ Symbol("freeze");
- var jt2 = /* @__PURE__ */ Symbol("getDollarZero");
- var Mt2 = /* @__PURE__ */ Symbol("getParserConfiguration");
- var _t3 = /* @__PURE__ */ Symbol("getUsageConfiguration");
- var kt2 = /* @__PURE__ */ Symbol("guessLocale");
- var xt2 = /* @__PURE__ */ Symbol("guessVersion");
- var Et2 = /* @__PURE__ */ Symbol("parsePositionalNumbers");
- var At2 = /* @__PURE__ */ Symbol("pkgUp");
- var Pt2 = /* @__PURE__ */ Symbol("populateParserHintArray");
- var St2 = /* @__PURE__ */ Symbol("populateParserHintSingleValueDictionary");
- var $t = /* @__PURE__ */ Symbol("populateParserHintArrayDictionary");
- var It2 = /* @__PURE__ */ Symbol("populateParserHintDictionary");
- var Dt2 = /* @__PURE__ */ Symbol("sanitizeKey");
- var Nt2 = /* @__PURE__ */ Symbol("setKey");
- var Ht2 = /* @__PURE__ */ Symbol("unfreeze");
- var zt2 = /* @__PURE__ */ Symbol("validateAsync");
- var Wt2 = /* @__PURE__ */ Symbol("getCommandInstance");
- var qt2 = /* @__PURE__ */ Symbol("getContext");
- var Ut2 = /* @__PURE__ */ Symbol("getHasOutput");
- var Ft2 = /* @__PURE__ */ Symbol("getLoggerInstance");
- var Lt2 = /* @__PURE__ */ Symbol("getParseContext");
- var Vt2 = /* @__PURE__ */ Symbol("getUsageInstance");
- var Gt2 = /* @__PURE__ */ Symbol("getValidationInstance");
- var Rt2 = /* @__PURE__ */ Symbol("hasParseCallback");
- var Tt2 = /* @__PURE__ */ Symbol("isGlobalContext");
- var Bt2 = /* @__PURE__ */ Symbol("postProcess");
- var Yt2 = /* @__PURE__ */ Symbol("rebase");
- var Kt2 = /* @__PURE__ */ Symbol("reset");
- var Jt2 = /* @__PURE__ */ Symbol("runYargsParserAndExecuteCommands");
- var Zt2 = /* @__PURE__ */ Symbol("runValidation");
- var Xt2 = /* @__PURE__ */ Symbol("setHasOutput");
- var Qt2 = /* @__PURE__ */ Symbol("kTrackManuallySetKeys");
- var te2 = class {
- constructor(t7 = [], e7, s7, i7) {
- this.customScriptName = false, this.parsed = false, z2.set(this, void 0), W2.set(this, void 0), q7.set(this, { commands: [], fullCommands: [] }), U2.set(this, null), F3.set(this, null), L2.set(this, "show-hidden"), V2.set(this, null), G3.set(this, true), R2.set(this, {}), T2.set(this, true), B3.set(this, []), Y2.set(this, void 0), K2.set(this, {}), J2.set(this, false), Z.set(this, null), X2.set(this, true), Q2.set(this, void 0), tt2.set(this, ""), et2.set(this, void 0), st2.set(this, void 0), it2.set(this, {}), nt2.set(this, null), rt2.set(this, null), ot2.set(this, {}), at2.set(this, {}), ht2.set(this, void 0), lt2.set(this, false), ct2.set(this, void 0), ft2.set(this, false), dt2.set(this, false), ut2.set(this, false), pt2.set(this, void 0), gt2.set(this, {}), mt2.set(this, null), yt2.set(this, void 0), O2(this, ct2, i7, "f"), O2(this, ht2, t7, "f"), O2(this, W2, e7, "f"), O2(this, st2, s7, "f"), O2(this, Y2, new w5(this), "f"), this.$0 = this[jt2](), this[Kt2](), O2(this, z2, v8(this, z2, "f"), "f"), O2(this, pt2, v8(this, pt2, "f"), "f"), O2(this, yt2, v8(this, yt2, "f"), "f"), O2(this, et2, v8(this, et2, "f"), "f"), v8(this, et2, "f").showHiddenOpt = v8(this, L2, "f"), O2(this, Q2, this[vt2](), "f");
- }
- addHelpOpt(t7, e7) {
- return h6("[string|boolean] [string]", [t7, e7], arguments.length), v8(this, Z, "f") && (this[Ot2](v8(this, Z, "f")), O2(this, Z, null, "f")), false === t7 && void 0 === e7 || (O2(this, Z, "string" == typeof t7 ? t7 : "help", "f"), this.boolean(v8(this, Z, "f")), this.describe(v8(this, Z, "f"), e7 || v8(this, pt2, "f").deferY18nLookup("Show help"))), this;
- }
- help(t7, e7) {
- return this.addHelpOpt(t7, e7);
- }
- addShowHiddenOpt(t7, e7) {
- if (h6("[string|boolean] [string]", [t7, e7], arguments.length), false === t7 && void 0 === e7) return this;
- const s7 = "string" == typeof t7 ? t7 : v8(this, L2, "f");
- return this.boolean(s7), this.describe(s7, e7 || v8(this, pt2, "f").deferY18nLookup("Show hidden options")), v8(this, et2, "f").showHiddenOpt = s7, this;
- }
- showHidden(t7, e7) {
- return this.addShowHiddenOpt(t7, e7);
- }
- alias(t7, e7) {
- return h6("