diff --git a/bin/blerp.js b/bin/blerp.js index 97636cf3..ca90ce1b 100644 --- a/bin/blerp.js +++ b/bin/blerp.js @@ -5,3737 +5,5074 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; +var __commonJS = (cb, mod) => + function __require() { + return ( + mod || + (0, cb[__getOwnPropNames(cb)[0]])( + (mod = { exports: {} }).exports, + mod, + ), + mod.exports + ); + }; var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; + if ((from && typeof from === "object") || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { + get: () => from[key], + enumerable: + !(desc = __getOwnPropDesc(from, key)) || + desc.enumerable, + }); + } + return to; }; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); +var __toESM = (mod, isNodeMode, target) => ( + (target = mod != null ? __create(__getProtoOf(mod)) : {}), + __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule + ? __defProp(target, "default", { value: mod, enumerable: true }) + : target, + mod, + ) +); // node_modules/alcalzone-shared/typeguards/index.js var require_typeguards = __commonJS({ - "node_modules/alcalzone-shared/typeguards/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isArray = exports.isObject = void 0; - function isObject2(it) { - return Object.prototype.toString.call(it) === "[object Object]"; - } - exports.isObject = isObject2; - function isArray2(it) { - if (Array.isArray != null) - return Array.isArray(it); - return Object.prototype.toString.call(it) === "[object Array]"; - } - exports.isArray = isArray2; - } + "node_modules/alcalzone-shared/typeguards/index.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isArray = exports.isObject = void 0; + function isObject2(it) { + return Object.prototype.toString.call(it) === "[object Object]"; + } + exports.isObject = isObject2; + function isArray2(it) { + if (Array.isArray != null) return Array.isArray(it); + return Object.prototype.toString.call(it) === "[object Array]"; + } + exports.isArray = isArray2; + }, }); // node_modules/y18n/build/index.cjs var require_build = __commonJS({ - "node_modules/y18n/build/index.cjs"(exports, module2) { - "use strict"; - var fs = require("fs"); - var util = require("util"); - var path = require("path"); - var shim; - var Y18N = class { - constructor(opts) { - 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 = []; - } - __(...args) { - if (typeof arguments[0] !== "string") { - return this._taggedLiteral(arguments[0], ...arguments); - } - 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(); - } - return shim.format.apply(shim.format, [this.cache[this.locale][str] || str].concat(args)); - } - __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)); - } - setLocale(locale) { - this.locale = locale; - } - getLocale() { - return this.locale; - } - 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]; - } - } - } - _taggedLiteral(parts, ...args) { - let str = ""; - parts.forEach(function(part, i) { - const arg = args[i + 1]; - str += part; - if (typeof arg !== "undefined") { - str += "%s"; - } - }); - return this.__.apply(this, [str].concat([].slice.call(args, 1))); - } - _enqueueWrite(work) { - this.writeQueue.push(work); - if (this.writeQueue.length === 1) - this._processWriteQueue(); - } - _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); - }); - } - _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; - } - this.cache[this.locale] = localeLookup; - } - _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; - } - _fileExistsSync(file) { - return shim.exists(file); - } - }; - function y18n$1(opts, _shim) { - shim = _shim; - const y18n2 = new Y18N(opts); - return { - __: y18n2.__.bind(y18n2), - __n: y18n2.__n.bind(y18n2), - setLocale: y18n2.setLocale.bind(y18n2), - getLocale: y18n2.getLocale.bind(y18n2), - updateLocale: y18n2.updateLocale.bind(y18n2), - locale: y18n2.locale - }; - } - var nodePlatformShim = { - fs: { - readFileSync: fs.readFileSync, - writeFile: fs.writeFile - }, - format: util.format, - resolve: path.resolve, - exists: (file) => { - try { - return fs.statSync(file).isFile(); - } catch (err) { - return false; - } - } - }; - var y18n = (opts) => { - return y18n$1(opts, nodePlatformShim); - }; - module2.exports = y18n; - } + "node_modules/y18n/build/index.cjs"(exports, module2) { + "use strict"; + var fs = require("fs"); + var util = require("util"); + var path = require("path"); + var shim; + var Y18N = class { + constructor(opts) { + 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 = []; + } + __(...args) { + if (typeof arguments[0] !== "string") { + return this._taggedLiteral(arguments[0], ...arguments); + } + 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(); + } + return shim.format.apply( + shim.format, + [this.cache[this.locale][str] || str].concat(args), + ); + } + __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)); + } + setLocale(locale) { + this.locale = locale; + } + getLocale() { + return this.locale; + } + 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]; + } + } + } + _taggedLiteral(parts, ...args) { + let str = ""; + parts.forEach(function (part, i) { + const arg = args[i + 1]; + str += part; + if (typeof arg !== "undefined") { + str += "%s"; + } + }); + return this.__.apply( + this, + [str].concat([].slice.call(args, 1)), + ); + } + _enqueueWrite(work) { + this.writeQueue.push(work); + if (this.writeQueue.length === 1) this._processWriteQueue(); + } + _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); + }, + ); + } + _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; + } + this.cache[this.locale] = localeLookup; + } + _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; + } + _fileExistsSync(file) { + return shim.exists(file); + } + }; + function y18n$1(opts, _shim) { + shim = _shim; + const y18n2 = new Y18N(opts); + return { + __: y18n2.__.bind(y18n2), + __n: y18n2.__n.bind(y18n2), + setLocale: y18n2.setLocale.bind(y18n2), + getLocale: y18n2.getLocale.bind(y18n2), + updateLocale: y18n2.updateLocale.bind(y18n2), + locale: y18n2.locale, + }; + } + var nodePlatformShim = { + fs: { + readFileSync: fs.readFileSync, + writeFile: fs.writeFile, + }, + format: util.format, + resolve: path.resolve, + exists: (file) => { + try { + return fs.statSync(file).isFile(); + } catch (err) { + return false; + } + }, + }; + var y18n = (opts) => { + return y18n$1(opts, nodePlatformShim); + }; + module2.exports = y18n; + }, }); // node_modules/yargs-parser/build/index.cjs var require_build2 = __commonJS({ - "node_modules/yargs-parser/build/index.cjs"(exports, module2) { - "use strict"; - var util = require("util"); - var path = require("path"); - var fs = require("fs"); - 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 i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++) { - let chr = str.charAt(i); - if (nextChrUpper) { - nextChrUpper = false; - chr = chr.toUpperCase(); - } - if (i !== 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 i = 0; i < str.length; i++) { - const chrLower = lowercase.charAt(i); - const chrString = str.charAt(i); - if (chrLower !== chrString && i > 0) { - notCamelcase += `${joinString}${lowercase.charAt(i)}`; - } else { - notCamelcase += chrString; - } - } - return notCamelcase; - } - function looksLikeNumber(x) { - if (x === null || x === void 0) - return false; - if (typeof x === "number") - return true; - if (/^0x[0-9a-f]+$/i.test(x)) - return true; - if (/^0[^.]/.test(x)) - return false; - return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); - } - function tokenizeArgString(argString) { - if (Array.isArray(argString)) { - return argString.map((e) => typeof e !== "string" ? e + "" : e); - } - argString = argString.trim(); - let i = 0; - let prevC = null; - let c = null; - let opening = null; - const args = []; - for (let ii = 0; ii < argString.length; ii++) { - prevC = c; - c = argString.charAt(ii); - if (c === " " && !opening) { - if (!(prevC === " ")) { - i++; - } - continue; - } - if (c === opening) { - opening = null; - } else if ((c === "'" || c === '"') && !opening) { - opening = c; - } - if (!args[i]) - args[i] = ""; - args[i] += c; - } - return args; - } - var DefaultValuesForTypeKey; - (function(DefaultValuesForTypeKey2) { - DefaultValuesForTypeKey2["BOOLEAN"] = "boolean"; - DefaultValuesForTypeKey2["STRING"] = "string"; - DefaultValuesForTypeKey2["NUMBER"] = "number"; - DefaultValuesForTypeKey2["ARRAY"] = "array"; - })(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {})); - var mixin; - var YargsParser = class { - constructor(_mixin) { - mixin = _mixin; - } - parse(argsInput, options) { - const opts = Object.assign({ - alias: void 0, - array: void 0, - boolean: void 0, - config: void 0, - configObjects: void 0, - configuration: void 0, - coerce: void 0, - count: void 0, - default: void 0, - envPrefix: void 0, - narg: void 0, - normalize: void 0, - string: void 0, - number: void 0, - __: void 0, - key: void 0 - }, options); - const args = tokenizeArgString(argsInput); - const inputIsString = typeof argsInput === "string"; - const aliases = combineAliases(Object.assign(/* @__PURE__ */ Object.create(null), opts.alias)); - const configuration = Object.assign({ - "boolean-negation": true, - "camel-case-expansion": true, - "combine-arrays": false, - "dot-notation": true, - "duplicate-arguments-array": true, - "flatten-duplicate-arrays": true, - "greedy-arrays": true, - "halt-at-non-option": false, - "nargs-eats-options": false, - "negation-prefix": "no-", - "parse-numbers": true, - "parse-positional-numbers": true, - "populate--": false, - "set-placeholder-key": false, - "short-option-groups": true, - "strip-aliased": false, - "strip-dashed": false, - "unknown-options-as-args": false - }, opts.configuration); - const defaults = Object.assign(/* @__PURE__ */ Object.create(null), opts.default); - const configObjects = opts.configObjects || []; - const envPrefix = opts.envPrefix; - const notFlagsOption = configuration["populate--"]; - const notFlagsArgv = notFlagsOption ? "--" : "_"; - const newAliases = /* @__PURE__ */ Object.create(null); - const defaulted = /* @__PURE__ */ Object.create(null); - const __ = opts.__ || mixin.format; - const flags = { - aliases: /* @__PURE__ */ Object.create(null), - arrays: /* @__PURE__ */ Object.create(null), - bools: /* @__PURE__ */ Object.create(null), - strings: /* @__PURE__ */ Object.create(null), - numbers: /* @__PURE__ */ Object.create(null), - counts: /* @__PURE__ */ Object.create(null), - normalize: /* @__PURE__ */ Object.create(null), - configs: /* @__PURE__ */ Object.create(null), - nargs: /* @__PURE__ */ Object.create(null), - coercions: /* @__PURE__ */ Object.create(null), - keys: [] - }; - const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/; - const negatedBoolean = new RegExp("^--" + configuration["negation-prefix"] + "(.+)"); - [].concat(opts.array || []).filter(Boolean).forEach(function(opt) { - const key = typeof opt === "object" ? opt.key : opt; - const assignment = Object.keys(opt).map(function(key2) { - const arrayFlagKeys = { - boolean: "bools", - string: "strings", - number: "numbers" - }; - return arrayFlagKeys[key2]; - }).filter(Boolean).pop(); - if (assignment) { - flags[assignment][key] = true; - } - flags.arrays[key] = true; - flags.keys.push(key); - }); - [].concat(opts.boolean || []).filter(Boolean).forEach(function(key) { - flags.bools[key] = true; - flags.keys.push(key); - }); - [].concat(opts.string || []).filter(Boolean).forEach(function(key) { - flags.strings[key] = true; - flags.keys.push(key); - }); - [].concat(opts.number || []).filter(Boolean).forEach(function(key) { - flags.numbers[key] = true; - flags.keys.push(key); - }); - [].concat(opts.count || []).filter(Boolean).forEach(function(key) { - flags.counts[key] = true; - flags.keys.push(key); - }); - [].concat(opts.normalize || []).filter(Boolean).forEach(function(key) { - flags.normalize[key] = true; - flags.keys.push(key); - }); - if (typeof opts.narg === "object") { - Object.entries(opts.narg).forEach(([key, value]) => { - if (typeof value === "number") { - flags.nargs[key] = value; - flags.keys.push(key); - } - }); - } - if (typeof opts.coerce === "object") { - Object.entries(opts.coerce).forEach(([key, value]) => { - if (typeof value === "function") { - flags.coercions[key] = value; - flags.keys.push(key); - } - }); - } - 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; - }); - } else if (typeof opts.config === "object") { - Object.entries(opts.config).forEach(([key, value]) => { - if (typeof value === "boolean" || typeof value === "function") { - flags.configs[key] = value; - } - }); - } - } - extendAliases(opts.key, aliases, opts.default, flags.arrays); - Object.keys(defaults).forEach(function(key) { - (flags.aliases[key] || []).forEach(function(alias) { - defaults[alias] = defaults[key]; - }); - }); - let error = null; - checkConfiguration(); - let notFlags = []; - const argv2 = Object.assign(/* @__PURE__ */ Object.create(null), { _: [] }); - const argvReturn = {}; - for (let i = 0; i < args.length; i++) { - const arg = args[i]; - const truncatedArg = arg.replace(/^-{3,}/, "---"); - let broken; - let key; - let letters; - let m; - let next; - let value; - if (arg !== "--" && isUnknownOptionAsArg(arg)) { - pushPositional(arg); - } else if (truncatedArg.match(/---+(=|$)/)) { - pushPositional(arg); - continue; - } else if (arg.match(/^--.+=/) || !configuration["short-option-groups"] && arg.match(/^-.+=/)) { - m = arg.match(/^--?([^=]+)=([\s\S]*)$/); - if (m !== null && Array.isArray(m) && m.length >= 3) { - if (checkAllAliases(m[1], flags.arrays)) { - i = eatArray(i, m[1], args, m[2]); - } else if (checkAllAliases(m[1], flags.nargs) !== false) { - i = eatNargs(i, m[1], args, m[2]); - } else { - setArg(m[1], m[2], true); - } - } - } else if (arg.match(negatedBoolean) && configuration["boolean-negation"]) { - m = arg.match(negatedBoolean); - if (m !== null && Array.isArray(m) && m.length >= 2) { - key = m[1]; - setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false); - } - } else if (arg.match(/^--.+/) || !configuration["short-option-groups"] && arg.match(/^-[^-]+/)) { - m = arg.match(/^--?(.+)/); - if (m !== null && Array.isArray(m) && m.length >= 2) { - key = m[1]; - if (checkAllAliases(key, flags.arrays)) { - i = eatArray(i, key, args); - } else if (checkAllAliases(key, flags.nargs) !== false) { - i = eatNargs(i, key, args); - } else { - next = args[i + 1]; - if (next !== void 0 && (!next.match(/^-/) || next.match(negative)) && !checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts)) { - setArg(key, next); - i++; - } else if (/^(true|false)$/.test(next)) { - setArg(key, next); - i++; - } else { - setArg(key, defaultValue(key)); - } - } - } - } else if (arg.match(/^-.\..+=/)) { - m = arg.match(/^-([^=]+)=([\s\S]*)$/); - if (m !== null && Array.isArray(m) && m.length >= 3) { - setArg(m[1], m[2]); - } - } else if (arg.match(/^-.\..+/) && !arg.match(negative)) { - next = args[i + 1]; - m = arg.match(/^-(.\..+)/); - if (m !== null && Array.isArray(m) && m.length >= 2) { - key = m[1]; - if (next !== void 0 && !next.match(/^-/) && !checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts)) { - setArg(key, next); - i++; - } else { - setArg(key, defaultValue(key)); - } - } - } else if (arg.match(/^-[^-]+/) && !arg.match(negative)) { - letters = arg.slice(1, -1).split(""); - broken = false; - for (let j = 0; j < letters.length; j++) { - next = arg.slice(j + 2); - if (letters[j + 1] && letters[j + 1] === "=") { - value = arg.slice(j + 3); - key = letters[j]; - if (checkAllAliases(key, flags.arrays)) { - i = eatArray(i, key, args, value); - } else if (checkAllAliases(key, flags.nargs) !== false) { - i = eatNargs(i, key, args, value); - } else { - setArg(key, value); - } - broken = true; - break; - } - if (next === "-") { - setArg(letters[j], next); - continue; - } - if (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) && checkAllAliases(next, flags.bools) === false) { - setArg(letters[j], next); - broken = true; - break; - } - if (letters[j + 1] && letters[j + 1].match(/\W/)) { - setArg(letters[j], next); - broken = true; - break; - } else { - setArg(letters[j], defaultValue(letters[j])); - } - } - key = arg.slice(-1)[0]; - if (!broken && key !== "-") { - if (checkAllAliases(key, flags.arrays)) { - i = eatArray(i, key, args); - } else if (checkAllAliases(key, flags.nargs) !== false) { - i = eatNargs(i, key, args); - } else { - next = args[i + 1]; - if (next !== void 0 && (!/^(-|--)[^-]/.test(next) || next.match(negative)) && !checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts)) { - setArg(key, next); - i++; - } else if (/^(true|false)$/.test(next)) { - setArg(key, next); - i++; - } else { - setArg(key, defaultValue(key)); - } - } - } - } else if (arg.match(/^-[0-9]$/) && arg.match(negative) && checkAllAliases(arg.slice(1), flags.bools)) { - key = arg.slice(1); - setArg(key, defaultValue(key)); - } else if (arg === "--") { - notFlags = args.slice(i + 1); - break; - } else if (configuration["halt-at-non-option"]) { - notFlags = args.slice(i); - break; - } else { - pushPositional(arg); - } - } - applyEnvVars(argv2, true); - applyEnvVars(argv2, false); - setConfig(argv2); - setConfigObjects(); - applyDefaultsAndAliases(argv2, flags.aliases, defaults, true); - applyCoercions(argv2); - if (configuration["set-placeholder-key"]) - setPlaceholderKeys(argv2); - Object.keys(flags.counts).forEach(function(key) { - if (!hasKey(argv2, key.split("."))) - setArg(key, 0); - }); - if (notFlagsOption && notFlags.length) - argv2[notFlagsArgv] = []; - notFlags.forEach(function(key) { - argv2[notFlagsArgv].push(key); - }); - if (configuration["camel-case-expansion"] && configuration["strip-dashed"]) { - Object.keys(argv2).filter((key) => key !== "--" && key.includes("-")).forEach((key) => { - delete argv2[key]; - }); - } - if (configuration["strip-aliased"]) { - [].concat(...Object.keys(aliases).map((k) => aliases[k])).forEach((alias) => { - if (configuration["camel-case-expansion"] && alias.includes("-")) { - delete argv2[alias.split(".").map((prop) => camelCase(prop)).join(".")]; - } - delete argv2[alias]; - }); - } - function pushPositional(arg) { - const maybeCoercedNumber = maybeCoerceNumber("_", arg); - if (typeof maybeCoercedNumber === "string" || typeof maybeCoercedNumber === "number") { - argv2._.push(maybeCoercedNumber); - } - } - function eatNargs(i, key, args2, argAfterEqualSign) { - let ii; - let toEat = checkAllAliases(key, flags.nargs); - toEat = typeof toEat !== "number" || isNaN(toEat) ? 1 : toEat; - if (toEat === 0) { - if (!isUndefined(argAfterEqualSign)) { - error = Error(__("Argument unexpected for: %s", key)); - } - setArg(key, defaultValue(key)); - return i; - } - let available = isUndefined(argAfterEqualSign) ? 0 : 1; - if (configuration["nargs-eats-options"]) { - if (args2.length - (i + 1) + available < toEat) { - error = Error(__("Not enough arguments following: %s", key)); - } - available = toEat; - } else { - for (ii = i + 1; ii < args2.length; ii++) { - if (!args2[ii].match(/^-[^0-9]/) || args2[ii].match(negative) || isUnknownOptionAsArg(args2[ii])) - available++; - else - break; - } - if (available < toEat) - error = Error(__("Not enough arguments following: %s", key)); - } - let consumed = Math.min(available, toEat); - if (!isUndefined(argAfterEqualSign) && consumed > 0) { - setArg(key, argAfterEqualSign); - consumed--; - } - for (ii = i + 1; ii < consumed + i + 1; ii++) { - setArg(key, args2[ii]); - } - return i + consumed; - } - function eatArray(i, key, args2, argAfterEqualSign) { - let argsToSet = []; - let next = argAfterEqualSign || args2[i + 1]; - const nargsCount = checkAllAliases(key, flags.nargs); - if (checkAllAliases(key, flags.bools) && !/^(true|false)$/.test(next)) { - argsToSet.push(true); - } else if (isUndefined(next) || isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) { - if (defaults[key] !== void 0) { - const defVal = defaults[key]; - argsToSet = Array.isArray(defVal) ? defVal : [defVal]; - } - } else { - if (!isUndefined(argAfterEqualSign)) { - argsToSet.push(processValue(key, argAfterEqualSign, true)); - } - for (let ii = i + 1; ii < args2.length; ii++) { - if (!configuration["greedy-arrays"] && argsToSet.length > 0 || nargsCount && typeof nargsCount === "number" && argsToSet.length >= nargsCount) - break; - next = args2[ii]; - if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) - break; - i = ii; - argsToSet.push(processValue(key, next, inputIsString)); - } - } - if (typeof nargsCount === "number" && (nargsCount && argsToSet.length < nargsCount || isNaN(nargsCount) && argsToSet.length === 0)) { - error = Error(__("Not enough arguments following: %s", key)); - } - setArg(key, argsToSet); - return i; - } - function setArg(key, val, shouldStripQuotes = inputIsString) { - if (/-/.test(key) && configuration["camel-case-expansion"]) { - const alias = key.split(".").map(function(prop) { - return camelCase(prop); - }).join("."); - addNewAlias(key, alias); - } - const value = processValue(key, val, shouldStripQuotes); - const splitKey = key.split("."); - setKey(argv2, splitKey, value); - if (flags.aliases[key]) { - flags.aliases[key].forEach(function(x) { - const keyProperties = x.split("."); - setKey(argv2, keyProperties, value); - }); - } - if (splitKey.length > 1 && configuration["dot-notation"]) { - (flags.aliases[splitKey[0]] || []).forEach(function(x) { - let keyProperties = x.split("."); - const a = [].concat(splitKey); - a.shift(); - keyProperties = keyProperties.concat(a); - if (!(flags.aliases[key] || []).includes(keyProperties.join("."))) { - setKey(argv2, keyProperties, value); - } - }); - } - if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) { - const keys = [key].concat(flags.aliases[key] || []); - keys.forEach(function(key2) { - Object.defineProperty(argvReturn, key2, { - enumerable: true, - get() { - return val; - }, - set(value2) { - val = typeof value2 === "string" ? mixin.normalize(value2) : value2; - } - }); - }); - } - } - function addNewAlias(key, alias) { - if (!(flags.aliases[key] && flags.aliases[key].length)) { - flags.aliases[key] = [alias]; - newAliases[alias] = true; - } - if (!(flags.aliases[alias] && flags.aliases[alias].length)) { - addNewAlias(alias, key); - } - } - function processValue(key, val, shouldStripQuotes) { - if (shouldStripQuotes) { - val = stripQuotes(val); - } - if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) { - if (typeof val === "string") - val = val === "true"; - } - let value = Array.isArray(val) ? val.map(function(v) { - return maybeCoerceNumber(key, v); - }) : maybeCoerceNumber(key, val); - if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === "boolean")) { - value = increment(); - } - if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) { - if (Array.isArray(val)) - value = val.map((val2) => { - return mixin.normalize(val2); - }); - else - value = mixin.normalize(val); - } - return value; - } - function maybeCoerceNumber(key, value) { - if (!configuration["parse-positional-numbers"] && key === "_") - return value; - if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) { - const shouldCoerceNumber = looksLikeNumber(value) && configuration["parse-numbers"] && Number.isSafeInteger(Math.floor(parseFloat(`${value}`))); - if (shouldCoerceNumber || !isUndefined(value) && checkAllAliases(key, flags.numbers)) { - value = Number(value); - } - } - return value; - } - function setConfig(argv3) { - const configLookup = /* @__PURE__ */ Object.create(null); - applyDefaultsAndAliases(configLookup, flags.aliases, defaults); - Object.keys(flags.configs).forEach(function(configKey) { - const configPath = argv3[configKey] || configLookup[configKey]; - if (configPath) { - try { - let config = null; - const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath); - const resolveConfig = flags.configs[configKey]; - if (typeof resolveConfig === "function") { - try { - config = resolveConfig(resolvedConfigPath); - } catch (e) { - config = e; - } - if (config instanceof Error) { - error = config; - return; - } - } else { - config = mixin.require(resolvedConfigPath); - } - setConfigObject(config); - } catch (ex) { - if (ex.name === "PermissionDenied") - error = ex; - else if (argv3[configKey]) - error = Error(__("Invalid JSON config file: %s", configPath)); - } - } - }); - } - function setConfigObject(config, prev) { - Object.keys(config).forEach(function(key) { - const value = config[key]; - const fullKey = prev ? prev + "." + key : key; - if (typeof value === "object" && value !== null && !Array.isArray(value) && configuration["dot-notation"]) { - setConfigObject(value, fullKey); - } else { - if (!hasKey(argv2, fullKey.split(".")) || checkAllAliases(fullKey, flags.arrays) && configuration["combine-arrays"]) { - setArg(fullKey, value); - } - } - }); - } - function setConfigObjects() { - if (typeof configObjects !== "undefined") { - configObjects.forEach(function(configObject) { - setConfigObject(configObject); - }); - } - } - function applyEnvVars(argv3, configOnly) { - if (typeof envPrefix === "undefined") - return; - const prefix = typeof envPrefix === "string" ? envPrefix : ""; - const env2 = mixin.env(); - Object.keys(env2).forEach(function(envVar) { - if (prefix === "" || envVar.lastIndexOf(prefix, 0) === 0) { - const keys = envVar.split("__").map(function(key, i) { - if (i === 0) { - key = key.substring(prefix.length); - } - return camelCase(key); - }); - if ((configOnly && flags.configs[keys.join(".")] || !configOnly) && !hasKey(argv3, keys)) { - setArg(keys.join("."), env2[envVar]); - } - } - }); - } - function applyCoercions(argv3) { - let coerce; - const applied = /* @__PURE__ */ new Set(); - Object.keys(argv3).forEach(function(key) { - if (!applied.has(key)) { - coerce = checkAllAliases(key, flags.coercions); - if (typeof coerce === "function") { - try { - const value = maybeCoerceNumber(key, coerce(argv3[key])); - [].concat(flags.aliases[key] || [], key).forEach((ali) => { - applied.add(ali); - argv3[ali] = value; - }); - } catch (err) { - error = err; - } - } - } - }); - } - function setPlaceholderKeys(argv3) { - flags.keys.forEach((key) => { - if (~key.indexOf(".")) - return; - if (typeof argv3[key] === "undefined") - argv3[key] = void 0; - }); - return argv3; - } - function applyDefaultsAndAliases(obj, aliases2, defaults2, canLog = false) { - Object.keys(defaults2).forEach(function(key) { - if (!hasKey(obj, key.split("."))) { - setKey(obj, key.split("."), defaults2[key]); - if (canLog) - defaulted[key] = true; - (aliases2[key] || []).forEach(function(x) { - if (hasKey(obj, x.split("."))) - return; - setKey(obj, x.split("."), defaults2[key]); - }); - } - }); - } - function hasKey(obj, keys) { - let o = obj; - if (!configuration["dot-notation"]) - keys = [keys.join(".")]; - keys.slice(0, -1).forEach(function(key2) { - o = o[key2] || {}; - }); - const key = keys[keys.length - 1]; - if (typeof o !== "object") - return false; - else - return key in o; - } - function setKey(obj, keys, value) { - let o = obj; - if (!configuration["dot-notation"]) - keys = [keys.join(".")]; - keys.slice(0, -1).forEach(function(key2) { - key2 = sanitizeKey(key2); - if (typeof o === "object" && o[key2] === void 0) { - o[key2] = {}; - } - if (typeof o[key2] !== "object" || Array.isArray(o[key2])) { - if (Array.isArray(o[key2])) { - o[key2].push({}); - } else { - o[key2] = [o[key2], {}]; - } - o = o[key2][o[key2].length - 1]; - } else { - o = o[key2]; - } - }); - const key = sanitizeKey(keys[keys.length - 1]); - const isTypeArray = checkAllAliases(keys.join("."), flags.arrays); - const isValueArray = Array.isArray(value); - let duplicate = configuration["duplicate-arguments-array"]; - if (!duplicate && checkAllAliases(key, flags.nargs)) { - duplicate = true; - if (!isUndefined(o[key]) && flags.nargs[key] === 1 || Array.isArray(o[key]) && o[key].length === flags.nargs[key]) { - o[key] = void 0; - } - } - if (value === increment()) { - o[key] = increment(o[key]); - } else if (Array.isArray(o[key])) { - if (duplicate && isTypeArray && isValueArray) { - o[key] = configuration["flatten-duplicate-arrays"] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]); - } else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) { - o[key] = value; - } else { - o[key] = o[key].concat([value]); - } - } else if (o[key] === void 0 && isTypeArray) { - o[key] = isValueArray ? value : [value]; - } else if (duplicate && !(o[key] === void 0 || checkAllAliases(key, flags.counts) || checkAllAliases(key, flags.bools))) { - o[key] = [o[key], value]; - } else { - o[key] = value; - } - } - function extendAliases(...args2) { - args2.forEach(function(obj) { - Object.keys(obj || {}).forEach(function(key) { - if (flags.aliases[key]) - return; - flags.aliases[key] = [].concat(aliases[key] || []); - flags.aliases[key].concat(key).forEach(function(x) { - if (/-/.test(x) && configuration["camel-case-expansion"]) { - const c = camelCase(x); - if (c !== key && flags.aliases[key].indexOf(c) === -1) { - flags.aliases[key].push(c); - newAliases[c] = true; - } - } - }); - flags.aliases[key].concat(key).forEach(function(x) { - if (x.length > 1 && /[A-Z]/.test(x) && configuration["camel-case-expansion"]) { - const c = decamelize(x, "-"); - if (c !== key && flags.aliases[key].indexOf(c) === -1) { - flags.aliases[key].push(c); - newAliases[c] = true; - } - } - }); - flags.aliases[key].forEach(function(x) { - flags.aliases[x] = [key].concat(flags.aliases[key].filter(function(y) { - return x !== y; - })); - }); - }); - }); - } - function checkAllAliases(key, flag) { - const toCheck = [].concat(flags.aliases[key] || [], key); - const keys = Object.keys(flag); - const setAlias = toCheck.find((key2) => keys.includes(key2)); - return setAlias ? flag[setAlias] : false; - } - function hasAnyFlag(key) { - const flagsKeys = Object.keys(flags); - const toCheck = [].concat(flagsKeys.map((k) => flags[k])); - return toCheck.some(function(flag) { - return Array.isArray(flag) ? flag.includes(key) : flag[key]; - }); - } - function hasFlagsMatching(arg, ...patterns) { - const toCheck = [].concat(...patterns); - return toCheck.some(function(pattern) { - const match = arg.match(pattern); - return match && hasAnyFlag(match[1]); - }); - } - function hasAllShortFlags(arg) { - if (arg.match(negative) || !arg.match(/^-[^-]+/)) { - return false; - } - let hasAllFlags = true; - let next; - const letters = arg.slice(1).split(""); - for (let j = 0; j < letters.length; j++) { - next = arg.slice(j + 2); - if (!hasAnyFlag(letters[j])) { - hasAllFlags = false; - break; - } - if (letters[j + 1] && letters[j + 1] === "=" || next === "-" || /[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) || letters[j + 1] && letters[j + 1].match(/\W/)) { - break; - } - } - return hasAllFlags; - } - function isUnknownOptionAsArg(arg) { - return configuration["unknown-options-as-args"] && isUnknownOption(arg); - } - function isUnknownOption(arg) { - arg = arg.replace(/^-{3,}/, "--"); - if (arg.match(negative)) { - return false; - } - if (hasAllShortFlags(arg)) { - return false; - } - const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/; - const normalFlag = /^-+([^=]+?)$/; - const flagEndingInHyphen = /^-+([^=]+?)-$/; - const flagEndingInDigits = /^-+([^=]+?\d+)$/; - const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/; - return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters); - } - function defaultValue(key) { - if (!checkAllAliases(key, flags.bools) && !checkAllAliases(key, flags.counts) && `${key}` in defaults) { - return defaults[key]; - } else { - return defaultForType(guessType(key)); - } - } - function defaultForType(type) { - const def = { - [DefaultValuesForTypeKey.BOOLEAN]: true, - [DefaultValuesForTypeKey.STRING]: "", - [DefaultValuesForTypeKey.NUMBER]: void 0, - [DefaultValuesForTypeKey.ARRAY]: [] - }; - return def[type]; - } - function guessType(key) { - let type = DefaultValuesForTypeKey.BOOLEAN; - if (checkAllAliases(key, flags.strings)) - type = DefaultValuesForTypeKey.STRING; - else if (checkAllAliases(key, flags.numbers)) - type = DefaultValuesForTypeKey.NUMBER; - else if (checkAllAliases(key, flags.bools)) - type = DefaultValuesForTypeKey.BOOLEAN; - else if (checkAllAliases(key, flags.arrays)) - type = DefaultValuesForTypeKey.ARRAY; - return type; - } - function isUndefined(num) { - return num === void 0; - } - function checkConfiguration() { - Object.keys(flags.counts).find((key) => { - if (checkAllAliases(key, flags.arrays)) { - error = Error(__("Invalid configuration: %s, opts.count excludes opts.array.", key)); - return true; - } else if (checkAllAliases(key, flags.nargs)) { - error = Error(__("Invalid configuration: %s, opts.count excludes opts.narg.", key)); - return true; - } - return false; - }); - } - return { - aliases: Object.assign({}, flags.aliases), - argv: Object.assign(argvReturn, argv2), - configuration, - defaulted: Object.assign({}, defaulted), - error, - newAliases: Object.assign({}, newAliases) - }; - } - }; - 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 i = 0; i < aliasArrays.length; i++) { - for (let ii = i + 1; ii < aliasArrays.length; ii++) { - const intersect = aliasArrays[i].filter(function(v) { - return aliasArrays[ii].indexOf(v) !== -1; - }); - if (intersect.length) { - aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]); - aliasArrays.splice(ii, 1); - change = true; - break; - } - } - } - } - aliasArrays.forEach(function(aliasArray) { - aliasArray = aliasArray.filter(function(v, i, self) { - return self.indexOf(v) === i; - }); - 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 minNodeVersion = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12; - if (process && process.version) { - const major = Number(process.version.match(/v([^.]+)/)[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 env = process ? process.env : {}; - var parser = new YargsParser({ - cwd: process.cwd, - env: () => { - return env; - }, - format: util.format, - normalize: path.normalize, - resolve: path.resolve, - require: (path2) => { - if (typeof require !== "undefined") { - return require(path2); - } else if (path2.match(/\.json$/)) { - return JSON.parse(fs.readFileSync(path2, "utf8")); - } else { - throw Error("only .json config files are supported in ESM"); - } - } - }); - var yargsParser = function Parser(args, opts) { - const result = parser.parse(args.slice(), opts); - return result.argv; - }; - yargsParser.detailed = function(args, opts) { - return parser.parse(args.slice(), opts); - }; - yargsParser.camelCase = camelCase; - yargsParser.decamelize = decamelize; - yargsParser.looksLikeNumber = looksLikeNumber; - module2.exports = yargsParser; - } + "node_modules/yargs-parser/build/index.cjs"(exports, module2) { + "use strict"; + var util = require("util"); + var path = require("path"); + var fs = require("fs"); + 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 i = leadingHyphens ? leadingHyphens[0].length : 0; + i < str.length; + i++ + ) { + let chr = str.charAt(i); + if (nextChrUpper) { + nextChrUpper = false; + chr = chr.toUpperCase(); + } + if (i !== 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 i = 0; i < str.length; i++) { + const chrLower = lowercase.charAt(i); + const chrString = str.charAt(i); + if (chrLower !== chrString && i > 0) { + notCamelcase += `${joinString}${lowercase.charAt(i)}`; + } else { + notCamelcase += chrString; + } + } + return notCamelcase; + } + function looksLikeNumber(x) { + if (x === null || x === void 0) return false; + if (typeof x === "number") return true; + if (/^0x[0-9a-f]+$/i.test(x)) return true; + if (/^0[^.]/.test(x)) return false; + return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); + } + function tokenizeArgString(argString) { + if (Array.isArray(argString)) { + return argString.map((e) => + typeof e !== "string" ? e + "" : e, + ); + } + argString = argString.trim(); + let i = 0; + let prevC = null; + let c = null; + let opening = null; + const args = []; + for (let ii = 0; ii < argString.length; ii++) { + prevC = c; + c = argString.charAt(ii); + if (c === " " && !opening) { + if (!(prevC === " ")) { + i++; + } + continue; + } + if (c === opening) { + opening = null; + } else if ((c === "'" || c === '"') && !opening) { + opening = c; + } + if (!args[i]) args[i] = ""; + args[i] += c; + } + return args; + } + var DefaultValuesForTypeKey; + (function (DefaultValuesForTypeKey2) { + DefaultValuesForTypeKey2["BOOLEAN"] = "boolean"; + DefaultValuesForTypeKey2["STRING"] = "string"; + DefaultValuesForTypeKey2["NUMBER"] = "number"; + DefaultValuesForTypeKey2["ARRAY"] = "array"; + })(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {})); + var mixin; + var YargsParser = class { + constructor(_mixin) { + mixin = _mixin; + } + parse(argsInput, options) { + const opts = Object.assign( + { + alias: void 0, + array: void 0, + boolean: void 0, + config: void 0, + configObjects: void 0, + configuration: void 0, + coerce: void 0, + count: void 0, + default: void 0, + envPrefix: void 0, + narg: void 0, + normalize: void 0, + string: void 0, + number: void 0, + __: void 0, + key: void 0, + }, + options, + ); + const args = tokenizeArgString(argsInput); + const inputIsString = typeof argsInput === "string"; + const aliases = combineAliases( + Object.assign( + /* @__PURE__ */ Object.create(null), + opts.alias, + ), + ); + const configuration = Object.assign( + { + "boolean-negation": true, + "camel-case-expansion": true, + "combine-arrays": false, + "dot-notation": true, + "duplicate-arguments-array": true, + "flatten-duplicate-arrays": true, + "greedy-arrays": true, + "halt-at-non-option": false, + "nargs-eats-options": false, + "negation-prefix": "no-", + "parse-numbers": true, + "parse-positional-numbers": true, + "populate--": false, + "set-placeholder-key": false, + "short-option-groups": true, + "strip-aliased": false, + "strip-dashed": false, + "unknown-options-as-args": false, + }, + opts.configuration, + ); + const defaults = Object.assign( + /* @__PURE__ */ Object.create(null), + opts.default, + ); + const configObjects = opts.configObjects || []; + const envPrefix = opts.envPrefix; + const notFlagsOption = configuration["populate--"]; + const notFlagsArgv = notFlagsOption ? "--" : "_"; + const newAliases = /* @__PURE__ */ Object.create(null); + const defaulted = /* @__PURE__ */ Object.create(null); + const __ = opts.__ || mixin.format; + const flags = { + aliases: /* @__PURE__ */ Object.create(null), + arrays: /* @__PURE__ */ Object.create(null), + bools: /* @__PURE__ */ Object.create(null), + strings: /* @__PURE__ */ Object.create(null), + numbers: /* @__PURE__ */ Object.create(null), + counts: /* @__PURE__ */ Object.create(null), + normalize: /* @__PURE__ */ Object.create(null), + configs: /* @__PURE__ */ Object.create(null), + nargs: /* @__PURE__ */ Object.create(null), + coercions: /* @__PURE__ */ Object.create(null), + keys: [], + }; + const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/; + const negatedBoolean = new RegExp( + "^--" + configuration["negation-prefix"] + "(.+)", + ); + [] + .concat(opts.array || []) + .filter(Boolean) + .forEach(function (opt) { + const key = typeof opt === "object" ? opt.key : opt; + const assignment = Object.keys(opt) + .map(function (key2) { + const arrayFlagKeys = { + boolean: "bools", + string: "strings", + number: "numbers", + }; + return arrayFlagKeys[key2]; + }) + .filter(Boolean) + .pop(); + if (assignment) { + flags[assignment][key] = true; + } + flags.arrays[key] = true; + flags.keys.push(key); + }); + [] + .concat(opts.boolean || []) + .filter(Boolean) + .forEach(function (key) { + flags.bools[key] = true; + flags.keys.push(key); + }); + [] + .concat(opts.string || []) + .filter(Boolean) + .forEach(function (key) { + flags.strings[key] = true; + flags.keys.push(key); + }); + [] + .concat(opts.number || []) + .filter(Boolean) + .forEach(function (key) { + flags.numbers[key] = true; + flags.keys.push(key); + }); + [] + .concat(opts.count || []) + .filter(Boolean) + .forEach(function (key) { + flags.counts[key] = true; + flags.keys.push(key); + }); + [] + .concat(opts.normalize || []) + .filter(Boolean) + .forEach(function (key) { + flags.normalize[key] = true; + flags.keys.push(key); + }); + if (typeof opts.narg === "object") { + Object.entries(opts.narg).forEach(([key, value]) => { + if (typeof value === "number") { + flags.nargs[key] = value; + flags.keys.push(key); + } + }); + } + if (typeof opts.coerce === "object") { + Object.entries(opts.coerce).forEach(([key, value]) => { + if (typeof value === "function") { + flags.coercions[key] = value; + flags.keys.push(key); + } + }); + } + 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; + }); + } else if (typeof opts.config === "object") { + Object.entries(opts.config).forEach(([key, value]) => { + if ( + typeof value === "boolean" || + typeof value === "function" + ) { + flags.configs[key] = value; + } + }); + } + } + extendAliases(opts.key, aliases, opts.default, flags.arrays); + Object.keys(defaults).forEach(function (key) { + (flags.aliases[key] || []).forEach(function (alias) { + defaults[alias] = defaults[key]; + }); + }); + let error = null; + checkConfiguration(); + let notFlags = []; + const argv2 = Object.assign( + /* @__PURE__ */ Object.create(null), + { _: [] }, + ); + const argvReturn = {}; + for (let i = 0; i < args.length; i++) { + const arg = args[i]; + const truncatedArg = arg.replace(/^-{3,}/, "---"); + let broken; + let key; + let letters; + let m; + let next; + let value; + if (arg !== "--" && isUnknownOptionAsArg(arg)) { + pushPositional(arg); + } else if (truncatedArg.match(/---+(=|$)/)) { + pushPositional(arg); + continue; + } else if ( + arg.match(/^--.+=/) || + (!configuration["short-option-groups"] && + arg.match(/^-.+=/)) + ) { + m = arg.match(/^--?([^=]+)=([\s\S]*)$/); + if (m !== null && Array.isArray(m) && m.length >= 3) { + if (checkAllAliases(m[1], flags.arrays)) { + i = eatArray(i, m[1], args, m[2]); + } else if ( + checkAllAliases(m[1], flags.nargs) !== false + ) { + i = eatNargs(i, m[1], args, m[2]); + } else { + setArg(m[1], m[2], true); + } + } + } else if ( + arg.match(negatedBoolean) && + configuration["boolean-negation"] + ) { + m = arg.match(negatedBoolean); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + setArg( + key, + checkAllAliases(key, flags.arrays) + ? [false] + : false, + ); + } + } else if ( + arg.match(/^--.+/) || + (!configuration["short-option-groups"] && + arg.match(/^-[^-]+/)) + ) { + m = arg.match(/^--?(.+)/); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + if (checkAllAliases(key, flags.arrays)) { + i = eatArray(i, key, args); + } else if ( + checkAllAliases(key, flags.nargs) !== false + ) { + i = eatNargs(i, key, args); + } else { + next = args[i + 1]; + if ( + next !== void 0 && + (!next.match(/^-/) || + next.match(negative)) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts) + ) { + setArg(key, next); + i++; + } else if (/^(true|false)$/.test(next)) { + setArg(key, next); + i++; + } else { + setArg(key, defaultValue(key)); + } + } + } + } else if (arg.match(/^-.\..+=/)) { + m = arg.match(/^-([^=]+)=([\s\S]*)$/); + if (m !== null && Array.isArray(m) && m.length >= 3) { + setArg(m[1], m[2]); + } + } else if (arg.match(/^-.\..+/) && !arg.match(negative)) { + next = args[i + 1]; + m = arg.match(/^-(.\..+)/); + if (m !== null && Array.isArray(m) && m.length >= 2) { + key = m[1]; + if ( + next !== void 0 && + !next.match(/^-/) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts) + ) { + setArg(key, next); + i++; + } else { + setArg(key, defaultValue(key)); + } + } + } else if (arg.match(/^-[^-]+/) && !arg.match(negative)) { + letters = arg.slice(1, -1).split(""); + broken = false; + for (let j = 0; j < letters.length; j++) { + next = arg.slice(j + 2); + if (letters[j + 1] && letters[j + 1] === "=") { + value = arg.slice(j + 3); + key = letters[j]; + if (checkAllAliases(key, flags.arrays)) { + i = eatArray(i, key, args, value); + } else if ( + checkAllAliases(key, flags.nargs) !== false + ) { + i = eatNargs(i, key, args, value); + } else { + setArg(key, value); + } + broken = true; + break; + } + if (next === "-") { + setArg(letters[j], next); + continue; + } + if ( + /[A-Za-z]/.test(letters[j]) && + /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) && + checkAllAliases(next, flags.bools) === false + ) { + setArg(letters[j], next); + broken = true; + break; + } + if (letters[j + 1] && letters[j + 1].match(/\W/)) { + setArg(letters[j], next); + broken = true; + break; + } else { + setArg(letters[j], defaultValue(letters[j])); + } + } + key = arg.slice(-1)[0]; + if (!broken && key !== "-") { + if (checkAllAliases(key, flags.arrays)) { + i = eatArray(i, key, args); + } else if ( + checkAllAliases(key, flags.nargs) !== false + ) { + i = eatNargs(i, key, args); + } else { + next = args[i + 1]; + if ( + next !== void 0 && + (!/^(-|--)[^-]/.test(next) || + next.match(negative)) && + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts) + ) { + setArg(key, next); + i++; + } else if (/^(true|false)$/.test(next)) { + setArg(key, next); + i++; + } else { + setArg(key, defaultValue(key)); + } + } + } + } else if ( + arg.match(/^-[0-9]$/) && + arg.match(negative) && + checkAllAliases(arg.slice(1), flags.bools) + ) { + key = arg.slice(1); + setArg(key, defaultValue(key)); + } else if (arg === "--") { + notFlags = args.slice(i + 1); + break; + } else if (configuration["halt-at-non-option"]) { + notFlags = args.slice(i); + break; + } else { + pushPositional(arg); + } + } + applyEnvVars(argv2, true); + applyEnvVars(argv2, false); + setConfig(argv2); + setConfigObjects(); + applyDefaultsAndAliases(argv2, flags.aliases, defaults, true); + applyCoercions(argv2); + if (configuration["set-placeholder-key"]) + setPlaceholderKeys(argv2); + Object.keys(flags.counts).forEach(function (key) { + if (!hasKey(argv2, key.split("."))) setArg(key, 0); + }); + if (notFlagsOption && notFlags.length) argv2[notFlagsArgv] = []; + notFlags.forEach(function (key) { + argv2[notFlagsArgv].push(key); + }); + if ( + configuration["camel-case-expansion"] && + configuration["strip-dashed"] + ) { + Object.keys(argv2) + .filter((key) => key !== "--" && key.includes("-")) + .forEach((key) => { + delete argv2[key]; + }); + } + if (configuration["strip-aliased"]) { + [] + .concat(...Object.keys(aliases).map((k) => aliases[k])) + .forEach((alias) => { + if ( + configuration["camel-case-expansion"] && + alias.includes("-") + ) { + delete argv2[ + alias + .split(".") + .map((prop) => camelCase(prop)) + .join(".") + ]; + } + delete argv2[alias]; + }); + } + function pushPositional(arg) { + const maybeCoercedNumber = maybeCoerceNumber("_", arg); + if ( + typeof maybeCoercedNumber === "string" || + typeof maybeCoercedNumber === "number" + ) { + argv2._.push(maybeCoercedNumber); + } + } + function eatNargs(i, key, args2, argAfterEqualSign) { + let ii; + let toEat = checkAllAliases(key, flags.nargs); + toEat = + typeof toEat !== "number" || isNaN(toEat) ? 1 : toEat; + if (toEat === 0) { + if (!isUndefined(argAfterEqualSign)) { + error = Error( + __("Argument unexpected for: %s", key), + ); + } + setArg(key, defaultValue(key)); + return i; + } + let available = isUndefined(argAfterEqualSign) ? 0 : 1; + if (configuration["nargs-eats-options"]) { + if (args2.length - (i + 1) + available < toEat) { + error = Error( + __("Not enough arguments following: %s", key), + ); + } + available = toEat; + } else { + for (ii = i + 1; ii < args2.length; ii++) { + if ( + !args2[ii].match(/^-[^0-9]/) || + args2[ii].match(negative) || + isUnknownOptionAsArg(args2[ii]) + ) + available++; + else break; + } + if (available < toEat) + error = Error( + __("Not enough arguments following: %s", key), + ); + } + let consumed = Math.min(available, toEat); + if (!isUndefined(argAfterEqualSign) && consumed > 0) { + setArg(key, argAfterEqualSign); + consumed--; + } + for (ii = i + 1; ii < consumed + i + 1; ii++) { + setArg(key, args2[ii]); + } + return i + consumed; + } + function eatArray(i, key, args2, argAfterEqualSign) { + let argsToSet = []; + let next = argAfterEqualSign || args2[i + 1]; + const nargsCount = checkAllAliases(key, flags.nargs); + if ( + checkAllAliases(key, flags.bools) && + !/^(true|false)$/.test(next) + ) { + argsToSet.push(true); + } else if ( + isUndefined(next) || + (isUndefined(argAfterEqualSign) && + /^-/.test(next) && + !negative.test(next) && + !isUnknownOptionAsArg(next)) + ) { + if (defaults[key] !== void 0) { + const defVal = defaults[key]; + argsToSet = Array.isArray(defVal) + ? defVal + : [defVal]; + } + } else { + if (!isUndefined(argAfterEqualSign)) { + argsToSet.push( + processValue(key, argAfterEqualSign, true), + ); + } + for (let ii = i + 1; ii < args2.length; ii++) { + if ( + (!configuration["greedy-arrays"] && + argsToSet.length > 0) || + (nargsCount && + typeof nargsCount === "number" && + argsToSet.length >= nargsCount) + ) + break; + next = args2[ii]; + if ( + /^-/.test(next) && + !negative.test(next) && + !isUnknownOptionAsArg(next) + ) + break; + i = ii; + argsToSet.push( + processValue(key, next, inputIsString), + ); + } + } + if ( + typeof nargsCount === "number" && + ((nargsCount && argsToSet.length < nargsCount) || + (isNaN(nargsCount) && argsToSet.length === 0)) + ) { + error = Error( + __("Not enough arguments following: %s", key), + ); + } + setArg(key, argsToSet); + return i; + } + function setArg(key, val, shouldStripQuotes = inputIsString) { + if ( + /-/.test(key) && + configuration["camel-case-expansion"] + ) { + const alias = key + .split(".") + .map(function (prop) { + return camelCase(prop); + }) + .join("."); + addNewAlias(key, alias); + } + const value = processValue(key, val, shouldStripQuotes); + const splitKey = key.split("."); + setKey(argv2, splitKey, value); + if (flags.aliases[key]) { + flags.aliases[key].forEach(function (x) { + const keyProperties = x.split("."); + setKey(argv2, keyProperties, value); + }); + } + if (splitKey.length > 1 && configuration["dot-notation"]) { + (flags.aliases[splitKey[0]] || []).forEach( + function (x) { + let keyProperties = x.split("."); + const a = [].concat(splitKey); + a.shift(); + keyProperties = keyProperties.concat(a); + if ( + !(flags.aliases[key] || []).includes( + keyProperties.join("."), + ) + ) { + setKey(argv2, keyProperties, value); + } + }, + ); + } + if ( + checkAllAliases(key, flags.normalize) && + !checkAllAliases(key, flags.arrays) + ) { + const keys = [key].concat(flags.aliases[key] || []); + keys.forEach(function (key2) { + Object.defineProperty(argvReturn, key2, { + enumerable: true, + get() { + return val; + }, + set(value2) { + val = + typeof value2 === "string" + ? mixin.normalize(value2) + : value2; + }, + }); + }); + } + } + function addNewAlias(key, alias) { + if (!(flags.aliases[key] && flags.aliases[key].length)) { + flags.aliases[key] = [alias]; + newAliases[alias] = true; + } + if ( + !(flags.aliases[alias] && flags.aliases[alias].length) + ) { + addNewAlias(alias, key); + } + } + function processValue(key, val, shouldStripQuotes) { + if (shouldStripQuotes) { + val = stripQuotes(val); + } + if ( + checkAllAliases(key, flags.bools) || + checkAllAliases(key, flags.counts) + ) { + if (typeof val === "string") val = val === "true"; + } + let value = Array.isArray(val) + ? val.map(function (v) { + return maybeCoerceNumber(key, v); + }) + : maybeCoerceNumber(key, val); + if ( + checkAllAliases(key, flags.counts) && + (isUndefined(value) || typeof value === "boolean") + ) { + value = increment(); + } + if ( + checkAllAliases(key, flags.normalize) && + checkAllAliases(key, flags.arrays) + ) { + if (Array.isArray(val)) + value = val.map((val2) => { + return mixin.normalize(val2); + }); + else value = mixin.normalize(val); + } + return value; + } + function maybeCoerceNumber(key, value) { + if ( + !configuration["parse-positional-numbers"] && + key === "_" + ) + return value; + if ( + !checkAllAliases(key, flags.strings) && + !checkAllAliases(key, flags.bools) && + !Array.isArray(value) + ) { + const shouldCoerceNumber = + looksLikeNumber(value) && + configuration["parse-numbers"] && + Number.isSafeInteger( + Math.floor(parseFloat(`${value}`)), + ); + if ( + shouldCoerceNumber || + (!isUndefined(value) && + checkAllAliases(key, flags.numbers)) + ) { + value = Number(value); + } + } + return value; + } + function setConfig(argv3) { + const configLookup = /* @__PURE__ */ Object.create(null); + applyDefaultsAndAliases( + configLookup, + flags.aliases, + defaults, + ); + Object.keys(flags.configs).forEach(function (configKey) { + const configPath = + argv3[configKey] || configLookup[configKey]; + if (configPath) { + try { + let config = null; + const resolvedConfigPath = mixin.resolve( + mixin.cwd(), + configPath, + ); + const resolveConfig = flags.configs[configKey]; + if (typeof resolveConfig === "function") { + try { + config = + resolveConfig(resolvedConfigPath); + } catch (e) { + config = e; + } + if (config instanceof Error) { + error = config; + return; + } + } else { + config = mixin.require(resolvedConfigPath); + } + setConfigObject(config); + } catch (ex) { + if (ex.name === "PermissionDenied") error = ex; + else if (argv3[configKey]) + error = Error( + __( + "Invalid JSON config file: %s", + configPath, + ), + ); + } + } + }); + } + function setConfigObject(config, prev) { + Object.keys(config).forEach(function (key) { + const value = config[key]; + const fullKey = prev ? prev + "." + key : key; + if ( + typeof value === "object" && + value !== null && + !Array.isArray(value) && + configuration["dot-notation"] + ) { + setConfigObject(value, fullKey); + } else { + if ( + !hasKey(argv2, fullKey.split(".")) || + (checkAllAliases(fullKey, flags.arrays) && + configuration["combine-arrays"]) + ) { + setArg(fullKey, value); + } + } + }); + } + function setConfigObjects() { + if (typeof configObjects !== "undefined") { + configObjects.forEach(function (configObject) { + setConfigObject(configObject); + }); + } + } + function applyEnvVars(argv3, configOnly) { + if (typeof envPrefix === "undefined") return; + const prefix = + typeof envPrefix === "string" ? envPrefix : ""; + const env2 = mixin.env(); + Object.keys(env2).forEach(function (envVar) { + if ( + prefix === "" || + envVar.lastIndexOf(prefix, 0) === 0 + ) { + const keys = envVar + .split("__") + .map(function (key, i) { + if (i === 0) { + key = key.substring(prefix.length); + } + return camelCase(key); + }); + if ( + ((configOnly && + flags.configs[keys.join(".")]) || + !configOnly) && + !hasKey(argv3, keys) + ) { + setArg(keys.join("."), env2[envVar]); + } + } + }); + } + function applyCoercions(argv3) { + let coerce; + const applied = /* @__PURE__ */ new Set(); + Object.keys(argv3).forEach(function (key) { + if (!applied.has(key)) { + coerce = checkAllAliases(key, flags.coercions); + if (typeof coerce === "function") { + try { + const value = maybeCoerceNumber( + key, + coerce(argv3[key]), + ); + [] + .concat(flags.aliases[key] || [], key) + .forEach((ali) => { + applied.add(ali); + argv3[ali] = value; + }); + } catch (err) { + error = err; + } + } + } + }); + } + function setPlaceholderKeys(argv3) { + flags.keys.forEach((key) => { + if (~key.indexOf(".")) return; + if (typeof argv3[key] === "undefined") + argv3[key] = void 0; + }); + return argv3; + } + function applyDefaultsAndAliases( + obj, + aliases2, + defaults2, + canLog = false, + ) { + Object.keys(defaults2).forEach(function (key) { + if (!hasKey(obj, key.split("."))) { + setKey(obj, key.split("."), defaults2[key]); + if (canLog) defaulted[key] = true; + (aliases2[key] || []).forEach(function (x) { + if (hasKey(obj, x.split("."))) return; + setKey(obj, x.split("."), defaults2[key]); + }); + } + }); + } + function hasKey(obj, keys) { + let o = obj; + if (!configuration["dot-notation"]) keys = [keys.join(".")]; + keys.slice(0, -1).forEach(function (key2) { + o = o[key2] || {}; + }); + const key = keys[keys.length - 1]; + if (typeof o !== "object") return false; + else return key in o; + } + function setKey(obj, keys, value) { + let o = obj; + if (!configuration["dot-notation"]) keys = [keys.join(".")]; + keys.slice(0, -1).forEach(function (key2) { + key2 = sanitizeKey(key2); + if (typeof o === "object" && o[key2] === void 0) { + o[key2] = {}; + } + if ( + typeof o[key2] !== "object" || + Array.isArray(o[key2]) + ) { + if (Array.isArray(o[key2])) { + o[key2].push({}); + } else { + o[key2] = [o[key2], {}]; + } + o = o[key2][o[key2].length - 1]; + } else { + o = o[key2]; + } + }); + const key = sanitizeKey(keys[keys.length - 1]); + const isTypeArray = checkAllAliases( + keys.join("."), + flags.arrays, + ); + const isValueArray = Array.isArray(value); + let duplicate = configuration["duplicate-arguments-array"]; + if (!duplicate && checkAllAliases(key, flags.nargs)) { + duplicate = true; + if ( + (!isUndefined(o[key]) && flags.nargs[key] === 1) || + (Array.isArray(o[key]) && + o[key].length === flags.nargs[key]) + ) { + o[key] = void 0; + } + } + if (value === increment()) { + o[key] = increment(o[key]); + } else if (Array.isArray(o[key])) { + if (duplicate && isTypeArray && isValueArray) { + o[key] = configuration["flatten-duplicate-arrays"] + ? o[key].concat(value) + : (Array.isArray(o[key][0]) + ? o[key] + : [o[key]] + ).concat([value]); + } else if ( + !duplicate && + Boolean(isTypeArray) === Boolean(isValueArray) + ) { + o[key] = value; + } else { + o[key] = o[key].concat([value]); + } + } else if (o[key] === void 0 && isTypeArray) { + o[key] = isValueArray ? value : [value]; + } else if ( + duplicate && + !( + o[key] === void 0 || + checkAllAliases(key, flags.counts) || + checkAllAliases(key, flags.bools) + ) + ) { + o[key] = [o[key], value]; + } else { + o[key] = value; + } + } + function extendAliases(...args2) { + args2.forEach(function (obj) { + Object.keys(obj || {}).forEach(function (key) { + if (flags.aliases[key]) return; + flags.aliases[key] = [].concat(aliases[key] || []); + flags.aliases[key] + .concat(key) + .forEach(function (x) { + if ( + /-/.test(x) && + configuration["camel-case-expansion"] + ) { + const c = camelCase(x); + if ( + c !== key && + flags.aliases[key].indexOf(c) === -1 + ) { + flags.aliases[key].push(c); + newAliases[c] = true; + } + } + }); + flags.aliases[key] + .concat(key) + .forEach(function (x) { + if ( + x.length > 1 && + /[A-Z]/.test(x) && + configuration["camel-case-expansion"] + ) { + const c = decamelize(x, "-"); + if ( + c !== key && + flags.aliases[key].indexOf(c) === -1 + ) { + flags.aliases[key].push(c); + newAliases[c] = true; + } + } + }); + flags.aliases[key].forEach(function (x) { + flags.aliases[x] = [key].concat( + flags.aliases[key].filter(function (y) { + return x !== y; + }), + ); + }); + }); + }); + } + function checkAllAliases(key, flag) { + const toCheck = [].concat(flags.aliases[key] || [], key); + const keys = Object.keys(flag); + const setAlias = toCheck.find((key2) => + keys.includes(key2), + ); + return setAlias ? flag[setAlias] : false; + } + function hasAnyFlag(key) { + const flagsKeys = Object.keys(flags); + const toCheck = [].concat(flagsKeys.map((k) => flags[k])); + return toCheck.some(function (flag) { + return Array.isArray(flag) + ? flag.includes(key) + : flag[key]; + }); + } + function hasFlagsMatching(arg, ...patterns) { + const toCheck = [].concat(...patterns); + return toCheck.some(function (pattern) { + const match = arg.match(pattern); + return match && hasAnyFlag(match[1]); + }); + } + function hasAllShortFlags(arg) { + if (arg.match(negative) || !arg.match(/^-[^-]+/)) { + return false; + } + let hasAllFlags = true; + let next; + const letters = arg.slice(1).split(""); + for (let j = 0; j < letters.length; j++) { + next = arg.slice(j + 2); + if (!hasAnyFlag(letters[j])) { + hasAllFlags = false; + break; + } + if ( + (letters[j + 1] && letters[j + 1] === "=") || + next === "-" || + (/[A-Za-z]/.test(letters[j]) && + /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) || + (letters[j + 1] && letters[j + 1].match(/\W/)) + ) { + break; + } + } + return hasAllFlags; + } + function isUnknownOptionAsArg(arg) { + return ( + configuration["unknown-options-as-args"] && + isUnknownOption(arg) + ); + } + function isUnknownOption(arg) { + arg = arg.replace(/^-{3,}/, "--"); + if (arg.match(negative)) { + return false; + } + if (hasAllShortFlags(arg)) { + return false; + } + const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/; + const normalFlag = /^-+([^=]+?)$/; + const flagEndingInHyphen = /^-+([^=]+?)-$/; + const flagEndingInDigits = /^-+([^=]+?\d+)$/; + const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/; + return !hasFlagsMatching( + arg, + flagWithEquals, + negatedBoolean, + normalFlag, + flagEndingInHyphen, + flagEndingInDigits, + flagEndingInNonWordCharacters, + ); + } + function defaultValue(key) { + if ( + !checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts) && + `${key}` in defaults + ) { + return defaults[key]; + } else { + return defaultForType(guessType(key)); + } + } + function defaultForType(type) { + const def = { + [DefaultValuesForTypeKey.BOOLEAN]: true, + [DefaultValuesForTypeKey.STRING]: "", + [DefaultValuesForTypeKey.NUMBER]: void 0, + [DefaultValuesForTypeKey.ARRAY]: [], + }; + return def[type]; + } + function guessType(key) { + let type = DefaultValuesForTypeKey.BOOLEAN; + if (checkAllAliases(key, flags.strings)) + type = DefaultValuesForTypeKey.STRING; + else if (checkAllAliases(key, flags.numbers)) + type = DefaultValuesForTypeKey.NUMBER; + else if (checkAllAliases(key, flags.bools)) + type = DefaultValuesForTypeKey.BOOLEAN; + else if (checkAllAliases(key, flags.arrays)) + type = DefaultValuesForTypeKey.ARRAY; + return type; + } + function isUndefined(num) { + return num === void 0; + } + function checkConfiguration() { + Object.keys(flags.counts).find((key) => { + if (checkAllAliases(key, flags.arrays)) { + error = Error( + __( + "Invalid configuration: %s, opts.count excludes opts.array.", + key, + ), + ); + return true; + } else if (checkAllAliases(key, flags.nargs)) { + error = Error( + __( + "Invalid configuration: %s, opts.count excludes opts.narg.", + key, + ), + ); + return true; + } + return false; + }); + } + return { + aliases: Object.assign({}, flags.aliases), + argv: Object.assign(argvReturn, argv2), + configuration, + defaulted: Object.assign({}, defaulted), + error, + newAliases: Object.assign({}, newAliases), + }; + } + }; + 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 i = 0; i < aliasArrays.length; i++) { + for (let ii = i + 1; ii < aliasArrays.length; ii++) { + const intersect = aliasArrays[i].filter(function (v) { + return aliasArrays[ii].indexOf(v) !== -1; + }); + if (intersect.length) { + aliasArrays[i] = aliasArrays[i].concat( + aliasArrays[ii], + ); + aliasArrays.splice(ii, 1); + change = true; + break; + } + } + } + } + aliasArrays.forEach(function (aliasArray) { + aliasArray = aliasArray.filter(function (v, i, self) { + return self.indexOf(v) === i; + }); + 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 minNodeVersion = + process && process.env && process.env.YARGS_MIN_NODE_VERSION + ? Number(process.env.YARGS_MIN_NODE_VERSION) + : 12; + if (process && process.version) { + const major = Number(process.version.match(/v([^.]+)/)[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 env = process ? process.env : {}; + var parser = new YargsParser({ + cwd: process.cwd, + env: () => { + return env; + }, + format: util.format, + normalize: path.normalize, + resolve: path.resolve, + require: (path2) => { + if (typeof require !== "undefined") { + return require(path2); + } else if (path2.match(/\.json$/)) { + return JSON.parse(fs.readFileSync(path2, "utf8")); + } else { + throw Error("only .json config files are supported in ESM"); + } + }, + }); + var yargsParser = function Parser(args, opts) { + const result = parser.parse(args.slice(), opts); + return result.argv; + }; + yargsParser.detailed = function (args, opts) { + return parser.parse(args.slice(), opts); + }; + yargsParser.camelCase = camelCase; + yargsParser.decamelize = decamelize; + yargsParser.looksLikeNumber = looksLikeNumber; + module2.exports = yargsParser; + }, }); // node_modules/ansi-regex/index.js var require_ansi_regex = __commonJS({ - "node_modules/ansi-regex/index.js"(exports, module2) { - "use strict"; - module2.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/ansi-regex/index.js"(exports, module2) { + "use strict"; + module2.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"(exports, module2) { - "use strict"; - var ansiRegex = require_ansi_regex(); - module2.exports = (string) => typeof string === "string" ? string.replace(ansiRegex(), "") : string; - } + "node_modules/strip-ansi/index.js"(exports, module2) { + "use strict"; + var ansiRegex = require_ansi_regex(); + module2.exports = (string) => + typeof string === "string" + ? string.replace(ansiRegex(), "") + : string; + }, }); // node_modules/is-fullwidth-code-point/index.js var require_is_fullwidth_code_point = __commonJS({ - "node_modules/is-fullwidth-code-point/index.js"(exports, module2) { - "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; - }; - module2.exports = isFullwidthCodePoint; - module2.exports.default = isFullwidthCodePoint; - } + "node_modules/is-fullwidth-code-point/index.js"(exports, module2) { + "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; + }; + module2.exports = isFullwidthCodePoint; + module2.exports.default = isFullwidthCodePoint; + }, }); // node_modules/emoji-regex/index.js var require_emoji_regex = __commonJS({ - "node_modules/emoji-regex/index.js"(exports, module2) { - "use strict"; - module2.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; - }; - } + "node_modules/emoji-regex/index.js"(exports, module2) { + "use strict"; + module2.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; + }; + }, }); // node_modules/string-width/index.js var require_string_width = __commonJS({ - "node_modules/string-width/index.js"(exports, module2) { - "use strict"; - var stripAnsi = 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 = stripAnsi(string); - if (string.length === 0) { - return 0; - } - string = string.replace(emojiRegex(), " "); - let width = 0; - for (let i = 0; i < string.length; i++) { - const code = string.codePointAt(i); - if (code <= 31 || code >= 127 && code <= 159) { - continue; - } - if (code >= 768 && code <= 879) { - continue; - } - if (code > 65535) { - i++; - } - width += isFullwidthCodePoint(code) ? 2 : 1; - } - return width; - }; - module2.exports = stringWidth; - module2.exports.default = stringWidth; - } + "node_modules/string-width/index.js"(exports, module2) { + "use strict"; + var stripAnsi = 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 = stripAnsi(string); + if (string.length === 0) { + return 0; + } + string = string.replace(emojiRegex(), " "); + let width = 0; + for (let i = 0; i < string.length; i++) { + const code = string.codePointAt(i); + if (code <= 31 || (code >= 127 && code <= 159)) { + continue; + } + if (code >= 768 && code <= 879) { + continue; + } + if (code > 65535) { + i++; + } + width += isFullwidthCodePoint(code) ? 2 : 1; + } + return width; + }; + module2.exports = stringWidth; + module2.exports.default = stringWidth; + }, }); // node_modules/ansi-styles/node_modules/color-name/index.js var require_color_name = __commonJS({ - "node_modules/ansi-styles/node_modules/color-name/index.js"(exports, module2) { - "use strict"; - module2.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/ansi-styles/node_modules/color-name/index.js"( + exports, + module2, + ) { + "use strict"; + module2.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/ansi-styles/node_modules/color-convert/conversions.js var require_conversions = __commonJS({ - "node_modules/ansi-styles/node_modules/color-convert/conversions.js"(exports, module2) { - var cssKeywords = require_color_name(); - var reverseKeywords = {}; - for (const key of Object.keys(cssKeywords)) { - reverseKeywords[cssKeywords[key]] = key; - } - var convert = { - 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"] } - }; - module2.exports = convert; - for (const model of Object.keys(convert)) { - if (!("channels" in convert[model])) { - throw new Error("missing channels property: " + model); - } - if (!("labels" in convert[model])) { - throw new Error("missing channel labels property: " + model); - } - if (convert[model].labels.length !== convert[model].channels) { - throw new Error("channel and label counts mismatch: " + model); - } - const { channels, labels } = convert[model]; - delete convert[model].channels; - delete convert[model].labels; - Object.defineProperty(convert[model], "channels", { value: channels }); - Object.defineProperty(convert[model], "labels", { value: labels }); - } - convert.rgb.hsl = function(rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const min = Math.min(r, g, b); - const max = Math.max(r, g, b); - const delta = max - min; - let h; - let s; - if (max === min) { - h = 0; - } else if (r === max) { - h = (g - b) / delta; - } else if (g === max) { - h = 2 + (b - r) / delta; - } else if (b === max) { - h = 4 + (r - g) / delta; - } - h = Math.min(h * 60, 360); - if (h < 0) { - h += 360; - } - const l = (min + max) / 2; - if (max === min) { - s = 0; - } else if (l <= 0.5) { - s = delta / (max + min); - } else { - s = delta / (2 - max - min); - } - return [h, s * 100, l * 100]; - }; - convert.rgb.hsv = function(rgb) { - let rdif; - let gdif; - let bdif; - let h; - let s; - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const v = Math.max(r, g, b); - const diff = v - Math.min(r, g, b); - const diffc = function(c) { - return (v - c) / 6 / diff + 1 / 2; - }; - if (diff === 0) { - h = 0; - s = 0; - } else { - s = diff / v; - rdif = diffc(r); - gdif = diffc(g); - bdif = diffc(b); - if (r === v) { - h = bdif - gdif; - } else if (g === v) { - h = 1 / 3 + rdif - bdif; - } else if (b === v) { - h = 2 / 3 + gdif - rdif; - } - if (h < 0) { - h += 1; - } else if (h > 1) { - h -= 1; - } - } - return [ - h * 360, - s * 100, - v * 100 - ]; - }; - convert.rgb.hwb = function(rgb) { - const r = rgb[0]; - const g = rgb[1]; - let b = rgb[2]; - const h = convert.rgb.hsl(rgb)[0]; - const w = 1 / 255 * Math.min(r, Math.min(g, b)); - b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); - return [h, w * 100, b * 100]; - }; - convert.rgb.cmyk = function(rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const k = Math.min(1 - r, 1 - g, 1 - b); - const c = (1 - r - k) / (1 - k) || 0; - const m = (1 - g - k) / (1 - k) || 0; - const y = (1 - b - k) / (1 - k) || 0; - return [c * 100, m * 100, y * 100, k * 100]; - }; - function comparativeDistance(x, y) { - return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2; - } - convert.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; - }; - convert.keyword.rgb = function(keyword) { - return cssKeywords[keyword]; - }; - convert.rgb.xyz = function(rgb) { - let r = rgb[0] / 255; - let g = rgb[1] / 255; - let b = rgb[2] / 255; - r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92; - g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92; - b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92; - const x = r * 0.4124 + g * 0.3576 + b * 0.1805; - const y = r * 0.2126 + g * 0.7152 + b * 0.0722; - const z = r * 0.0193 + g * 0.1192 + b * 0.9505; - return [x * 100, y * 100, z * 100]; - }; - convert.rgb.lab = function(rgb) { - const xyz = convert.rgb.xyz(rgb); - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; - x /= 95.047; - y /= 100; - z /= 108.883; - x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116; - y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116; - z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116; - const l = 116 * y - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); - return [l, a, b]; - }; - convert.hsl.rgb = function(hsl) { - const h = hsl[0] / 360; - const s = hsl[1] / 100; - const l = hsl[2] / 100; - let t2; - let t3; - let val; - if (s === 0) { - val = l * 255; - return [val, val, val]; - } - if (l < 0.5) { - t2 = l * (1 + s); - } else { - t2 = l + s - l * s; - } - const t1 = 2 * l - t2; - const rgb = [0, 0, 0]; - for (let i = 0; i < 3; i++) { - t3 = h + 1 / 3 * -(i - 1); - if (t3 < 0) { - t3++; - } - if (t3 > 1) { - t3--; - } - if (6 * t3 < 1) { - val = t1 + (t2 - t1) * 6 * t3; - } else if (2 * t3 < 1) { - val = t2; - } else if (3 * t3 < 2) { - val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; - } else { - val = t1; - } - rgb[i] = val * 255; - } - return rgb; - }; - convert.hsl.hsv = function(hsl) { - const h = hsl[0]; - let s = hsl[1] / 100; - let l = hsl[2] / 100; - let smin = s; - const lmin = Math.max(l, 0.01); - l *= 2; - s *= l <= 1 ? l : 2 - l; - smin *= lmin <= 1 ? lmin : 2 - lmin; - const v = (l + s) / 2; - const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s); - return [h, sv * 100, v * 100]; - }; - convert.hsv.rgb = function(hsv) { - const h = hsv[0] / 60; - const s = hsv[1] / 100; - let v = hsv[2] / 100; - const hi = Math.floor(h) % 6; - const f = h - Math.floor(h); - const p = 255 * v * (1 - s); - const q = 255 * v * (1 - s * f); - const t = 255 * v * (1 - s * (1 - f)); - v *= 255; - switch (hi) { - case 0: - return [v, t, p]; - case 1: - return [q, v, p]; - case 2: - return [p, v, t]; - case 3: - return [p, q, v]; - case 4: - return [t, p, v]; - case 5: - return [v, p, q]; - } - }; - convert.hsv.hsl = function(hsv) { - const h = hsv[0]; - const s = hsv[1] / 100; - const v = hsv[2] / 100; - const vmin = Math.max(v, 0.01); - let sl; - let l; - l = (2 - s) * v; - const lmin = (2 - s) * vmin; - sl = s * vmin; - sl /= lmin <= 1 ? lmin : 2 - lmin; - sl = sl || 0; - l /= 2; - return [h, sl * 100, l * 100]; - }; - convert.hwb.rgb = function(hwb) { - const h = hwb[0] / 360; - let wh = hwb[1] / 100; - let bl = hwb[2] / 100; - const ratio = wh + bl; - let f; - if (ratio > 1) { - wh /= ratio; - bl /= ratio; - } - const i = Math.floor(6 * h); - const v = 1 - bl; - f = 6 * h - i; - if ((i & 1) !== 0) { - f = 1 - f; - } - const n = wh + f * (v - wh); - let r; - let g; - let b; - switch (i) { - default: - case 6: - case 0: - r = v; - g = n; - b = wh; - break; - case 1: - r = n; - g = v; - b = wh; - break; - case 2: - r = wh; - g = v; - b = n; - break; - case 3: - r = wh; - g = n; - b = v; - break; - case 4: - r = n; - g = wh; - b = v; - break; - case 5: - r = v; - g = wh; - b = n; - break; - } - return [r * 255, g * 255, b * 255]; - }; - convert.cmyk.rgb = function(cmyk) { - const c = cmyk[0] / 100; - const m = cmyk[1] / 100; - const y = cmyk[2] / 100; - const k = cmyk[3] / 100; - const r = 1 - Math.min(1, c * (1 - k) + k); - const g = 1 - Math.min(1, m * (1 - k) + k); - const b = 1 - Math.min(1, y * (1 - k) + k); - return [r * 255, g * 255, b * 255]; - }; - convert.xyz.rgb = function(xyz) { - const x = xyz[0] / 100; - const y = xyz[1] / 100; - const z = xyz[2] / 100; - let r; - let g; - let b; - r = x * 3.2406 + y * -1.5372 + z * -0.4986; - g = x * -0.9689 + y * 1.8758 + z * 0.0415; - b = x * 0.0557 + y * -0.204 + z * 1.057; - r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92; - g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92; - b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92; - r = Math.min(Math.max(0, r), 1); - g = Math.min(Math.max(0, g), 1); - b = Math.min(Math.max(0, b), 1); - return [r * 255, g * 255, b * 255]; - }; - convert.xyz.lab = function(xyz) { - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; - x /= 95.047; - y /= 100; - z /= 108.883; - x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116; - y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116; - z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116; - const l = 116 * y - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); - return [l, a, b]; - }; - convert.lab.xyz = function(lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let x; - let y; - let z; - y = (l + 16) / 116; - x = a / 500 + y; - z = y - b / 200; - const y2 = y ** 3; - const x2 = x ** 3; - const z2 = z ** 3; - y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787; - x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787; - z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787; - x *= 95.047; - y *= 100; - z *= 108.883; - return [x, y, z]; - }; - convert.lab.lch = function(lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let h; - const hr = Math.atan2(b, a); - h = hr * 360 / 2 / Math.PI; - if (h < 0) { - h += 360; - } - const c = Math.sqrt(a * a + b * b); - return [l, c, h]; - }; - convert.lch.lab = function(lch) { - const l = lch[0]; - const c = lch[1]; - const h = lch[2]; - const hr = h / 360 * 2 * Math.PI; - const a = c * Math.cos(hr); - const b = c * Math.sin(hr); - return [l, a, b]; - }; - convert.rgb.ansi16 = function(args, saturation = null) { - const [r, g, b] = args; - let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; - value = Math.round(value / 50); - if (value === 0) { - return 30; - } - let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255)); - if (value === 2) { - ansi += 60; - } - return ansi; - }; - convert.hsv.ansi16 = function(args) { - return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); - }; - convert.rgb.ansi256 = function(args) { - const r = args[0]; - const g = args[1]; - const b = args[2]; - if (r === g && g === b) { - if (r < 8) { - return 16; - } - if (r > 248) { - return 231; - } - return Math.round((r - 8) / 247 * 24) + 232; - } - const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5); - return ansi; - }; - convert.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 r = (color & 1) * mult * 255; - const g = (color >> 1 & 1) * mult * 255; - const b = (color >> 2 & 1) * mult * 255; - return [r, g, b]; - }; - convert.ansi256.rgb = function(args) { - if (args >= 232) { - const c = (args - 232) * 10 + 8; - return [c, c, c]; - } - args -= 16; - let rem; - const r = Math.floor(args / 36) / 5 * 255; - const g = Math.floor((rem = args % 36) / 6) / 5 * 255; - const b = rem % 6 / 5 * 255; - return [r, g, b]; - }; - convert.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; - }; - convert.hex.rgb = function(args) { - const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); - if (!match) { - return [0, 0, 0]; - } - let colorString = match[0]; - if (match[0].length === 3) { - colorString = colorString.split("").map((char) => { - return char + char; - }).join(""); - } - const integer = parseInt(colorString, 16); - const r = integer >> 16 & 255; - const g = integer >> 8 & 255; - const b = integer & 255; - return [r, g, b]; - }; - convert.rgb.hcg = function(rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const max = Math.max(Math.max(r, g), b); - const min = Math.min(Math.min(r, g), b); - 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 === r) { - hue = (g - b) / chroma % 6; - } else if (max === g) { - hue = 2 + (b - r) / chroma; - } else { - hue = 4 + (r - g) / chroma; - } - hue /= 6; - hue %= 1; - return [hue * 360, chroma * 100, grayscale * 100]; - }; - convert.hsl.hcg = function(hsl) { - const s = hsl[1] / 100; - const l = hsl[2] / 100; - const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l); - let f = 0; - if (c < 1) { - f = (l - 0.5 * c) / (1 - c); - } - return [hsl[0], c * 100, f * 100]; - }; - convert.hsv.hcg = function(hsv) { - const s = hsv[1] / 100; - const v = hsv[2] / 100; - const c = s * v; - let f = 0; - if (c < 1) { - f = (v - c) / (1 - c); - } - return [hsv[0], c * 100, f * 100]; - }; - convert.hcg.rgb = function(hcg) { - const h = hcg[0] / 360; - const c = hcg[1] / 100; - const g = hcg[2] / 100; - if (c === 0) { - return [g * 255, g * 255, g * 255]; - } - const pure = [0, 0, 0]; - const hi = h % 1 * 6; - const v = hi % 1; - const w = 1 - v; - let mg = 0; - switch (Math.floor(hi)) { - case 0: - pure[0] = 1; - pure[1] = v; - pure[2] = 0; - break; - case 1: - pure[0] = w; - pure[1] = 1; - pure[2] = 0; - break; - case 2: - pure[0] = 0; - pure[1] = 1; - pure[2] = v; - break; - case 3: - pure[0] = 0; - pure[1] = w; - pure[2] = 1; - break; - case 4: - pure[0] = v; - pure[1] = 0; - pure[2] = 1; - break; - default: - pure[0] = 1; - pure[1] = 0; - pure[2] = w; - } - mg = (1 - c) * g; - return [ - (c * pure[0] + mg) * 255, - (c * pure[1] + mg) * 255, - (c * pure[2] + mg) * 255 - ]; - }; - convert.hcg.hsv = function(hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const v = c + g * (1 - c); - let f = 0; - if (v > 0) { - f = c / v; - } - return [hcg[0], f * 100, v * 100]; - }; - convert.hcg.hsl = function(hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const l = g * (1 - c) + 0.5 * c; - let s = 0; - if (l > 0 && l < 0.5) { - s = c / (2 * l); - } else if (l >= 0.5 && l < 1) { - s = c / (2 * (1 - l)); - } - return [hcg[0], s * 100, l * 100]; - }; - convert.hcg.hwb = function(hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const v = c + g * (1 - c); - return [hcg[0], (v - c) * 100, (1 - v) * 100]; - }; - convert.hwb.hcg = function(hwb) { - const w = hwb[1] / 100; - const b = hwb[2] / 100; - const v = 1 - b; - const c = v - w; - let g = 0; - if (c < 1) { - g = (v - c) / (1 - c); - } - return [hwb[0], c * 100, g * 100]; - }; - convert.apple.rgb = function(apple) { - return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255]; - }; - convert.rgb.apple = function(rgb) { - return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535]; - }; - convert.gray.rgb = function(args) { - return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; - }; - convert.gray.hsl = function(args) { - return [0, 0, args[0]]; - }; - convert.gray.hsv = convert.gray.hsl; - convert.gray.hwb = function(gray) { - return [0, 100, gray[0]]; - }; - convert.gray.cmyk = function(gray) { - return [0, 0, 0, gray[0]]; - }; - convert.gray.lab = function(gray) { - return [gray[0], 0, 0]; - }; - convert.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; - }; - convert.rgb.gray = function(rgb) { - const val = (rgb[0] + rgb[1] + rgb[2]) / 3; - return [val / 255 * 100]; - }; - } + "node_modules/ansi-styles/node_modules/color-convert/conversions.js"( + exports, + module2, + ) { + var cssKeywords = require_color_name(); + var reverseKeywords = {}; + for (const key of Object.keys(cssKeywords)) { + reverseKeywords[cssKeywords[key]] = key; + } + var convert = { + 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"] }, + }; + module2.exports = convert; + for (const model of Object.keys(convert)) { + if (!("channels" in convert[model])) { + throw new Error("missing channels property: " + model); + } + if (!("labels" in convert[model])) { + throw new Error("missing channel labels property: " + model); + } + if (convert[model].labels.length !== convert[model].channels) { + throw new Error("channel and label counts mismatch: " + model); + } + const { channels, labels } = convert[model]; + delete convert[model].channels; + delete convert[model].labels; + Object.defineProperty(convert[model], "channels", { + value: channels, + }); + Object.defineProperty(convert[model], "labels", { value: labels }); + } + convert.rgb.hsl = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const min = Math.min(r, g, b); + const max = Math.max(r, g, b); + const delta = max - min; + let h; + let s; + if (max === min) { + h = 0; + } else if (r === max) { + h = (g - b) / delta; + } else if (g === max) { + h = 2 + (b - r) / delta; + } else if (b === max) { + h = 4 + (r - g) / delta; + } + h = Math.min(h * 60, 360); + if (h < 0) { + h += 360; + } + const l = (min + max) / 2; + if (max === min) { + s = 0; + } else if (l <= 0.5) { + s = delta / (max + min); + } else { + s = delta / (2 - max - min); + } + return [h, s * 100, l * 100]; + }; + convert.rgb.hsv = function (rgb) { + let rdif; + let gdif; + let bdif; + let h; + let s; + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const v = Math.max(r, g, b); + const diff = v - Math.min(r, g, b); + const diffc = function (c) { + return (v - c) / 6 / diff + 1 / 2; + }; + if (diff === 0) { + h = 0; + s = 0; + } else { + s = diff / v; + rdif = diffc(r); + gdif = diffc(g); + bdif = diffc(b); + if (r === v) { + h = bdif - gdif; + } else if (g === v) { + h = 1 / 3 + rdif - bdif; + } else if (b === v) { + h = 2 / 3 + gdif - rdif; + } + if (h < 0) { + h += 1; + } else if (h > 1) { + h -= 1; + } + } + return [h * 360, s * 100, v * 100]; + }; + convert.rgb.hwb = function (rgb) { + const r = rgb[0]; + const g = rgb[1]; + let b = rgb[2]; + const h = convert.rgb.hsl(rgb)[0]; + const w = (1 / 255) * Math.min(r, Math.min(g, b)); + b = 1 - (1 / 255) * Math.max(r, Math.max(g, b)); + return [h, w * 100, b * 100]; + }; + convert.rgb.cmyk = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const k = Math.min(1 - r, 1 - g, 1 - b); + const c = (1 - r - k) / (1 - k) || 0; + const m = (1 - g - k) / (1 - k) || 0; + const y = (1 - b - k) / (1 - k) || 0; + return [c * 100, m * 100, y * 100, k * 100]; + }; + function comparativeDistance(x, y) { + return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2; + } + convert.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; + }; + convert.keyword.rgb = function (keyword) { + return cssKeywords[keyword]; + }; + convert.rgb.xyz = function (rgb) { + let r = rgb[0] / 255; + let g = rgb[1] / 255; + let b = rgb[2] / 255; + r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92; + g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92; + b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92; + const x = r * 0.4124 + g * 0.3576 + b * 0.1805; + const y = r * 0.2126 + g * 0.7152 + b * 0.0722; + const z = r * 0.0193 + g * 0.1192 + b * 0.9505; + return [x * 100, y * 100, z * 100]; + }; + convert.rgb.lab = function (rgb) { + const xyz = convert.rgb.xyz(rgb); + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; + x /= 95.047; + y /= 100; + z /= 108.883; + x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116; + y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116; + z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116; + const l = 116 * y - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); + return [l, a, b]; + }; + convert.hsl.rgb = function (hsl) { + const h = hsl[0] / 360; + const s = hsl[1] / 100; + const l = hsl[2] / 100; + let t2; + let t3; + let val; + if (s === 0) { + val = l * 255; + return [val, val, val]; + } + if (l < 0.5) { + t2 = l * (1 + s); + } else { + t2 = l + s - l * s; + } + const t1 = 2 * l - t2; + const rgb = [0, 0, 0]; + for (let i = 0; i < 3; i++) { + t3 = h + (1 / 3) * -(i - 1); + if (t3 < 0) { + t3++; + } + if (t3 > 1) { + t3--; + } + if (6 * t3 < 1) { + val = t1 + (t2 - t1) * 6 * t3; + } else if (2 * t3 < 1) { + val = t2; + } else if (3 * t3 < 2) { + val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; + } else { + val = t1; + } + rgb[i] = val * 255; + } + return rgb; + }; + convert.hsl.hsv = function (hsl) { + const h = hsl[0]; + let s = hsl[1] / 100; + let l = hsl[2] / 100; + let smin = s; + const lmin = Math.max(l, 0.01); + l *= 2; + s *= l <= 1 ? l : 2 - l; + smin *= lmin <= 1 ? lmin : 2 - lmin; + const v = (l + s) / 2; + const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); + return [h, sv * 100, v * 100]; + }; + convert.hsv.rgb = function (hsv) { + const h = hsv[0] / 60; + const s = hsv[1] / 100; + let v = hsv[2] / 100; + const hi = Math.floor(h) % 6; + const f = h - Math.floor(h); + const p = 255 * v * (1 - s); + const q = 255 * v * (1 - s * f); + const t = 255 * v * (1 - s * (1 - f)); + v *= 255; + switch (hi) { + case 0: + return [v, t, p]; + case 1: + return [q, v, p]; + case 2: + return [p, v, t]; + case 3: + return [p, q, v]; + case 4: + return [t, p, v]; + case 5: + return [v, p, q]; + } + }; + convert.hsv.hsl = function (hsv) { + const h = hsv[0]; + const s = hsv[1] / 100; + const v = hsv[2] / 100; + const vmin = Math.max(v, 0.01); + let sl; + let l; + l = (2 - s) * v; + const lmin = (2 - s) * vmin; + sl = s * vmin; + sl /= lmin <= 1 ? lmin : 2 - lmin; + sl = sl || 0; + l /= 2; + return [h, sl * 100, l * 100]; + }; + convert.hwb.rgb = function (hwb) { + const h = hwb[0] / 360; + let wh = hwb[1] / 100; + let bl = hwb[2] / 100; + const ratio = wh + bl; + let f; + if (ratio > 1) { + wh /= ratio; + bl /= ratio; + } + const i = Math.floor(6 * h); + const v = 1 - bl; + f = 6 * h - i; + if ((i & 1) !== 0) { + f = 1 - f; + } + const n = wh + f * (v - wh); + let r; + let g; + let b; + switch (i) { + default: + case 6: + case 0: + r = v; + g = n; + b = wh; + break; + case 1: + r = n; + g = v; + b = wh; + break; + case 2: + r = wh; + g = v; + b = n; + break; + case 3: + r = wh; + g = n; + b = v; + break; + case 4: + r = n; + g = wh; + b = v; + break; + case 5: + r = v; + g = wh; + b = n; + break; + } + return [r * 255, g * 255, b * 255]; + }; + convert.cmyk.rgb = function (cmyk) { + const c = cmyk[0] / 100; + const m = cmyk[1] / 100; + const y = cmyk[2] / 100; + const k = cmyk[3] / 100; + const r = 1 - Math.min(1, c * (1 - k) + k); + const g = 1 - Math.min(1, m * (1 - k) + k); + const b = 1 - Math.min(1, y * (1 - k) + k); + return [r * 255, g * 255, b * 255]; + }; + convert.xyz.rgb = function (xyz) { + const x = xyz[0] / 100; + const y = xyz[1] / 100; + const z = xyz[2] / 100; + let r; + let g; + let b; + r = x * 3.2406 + y * -1.5372 + z * -0.4986; + g = x * -0.9689 + y * 1.8758 + z * 0.0415; + b = x * 0.0557 + y * -0.204 + z * 1.057; + r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92; + g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92; + b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92; + r = Math.min(Math.max(0, r), 1); + g = Math.min(Math.max(0, g), 1); + b = Math.min(Math.max(0, b), 1); + return [r * 255, g * 255, b * 255]; + }; + convert.xyz.lab = function (xyz) { + let x = xyz[0]; + let y = xyz[1]; + let z = xyz[2]; + x /= 95.047; + y /= 100; + z /= 108.883; + x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116; + y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116; + z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116; + const l = 116 * y - 16; + const a = 500 * (x - y); + const b = 200 * (y - z); + return [l, a, b]; + }; + convert.lab.xyz = function (lab) { + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let x; + let y; + let z; + y = (l + 16) / 116; + x = a / 500 + y; + z = y - b / 200; + const y2 = y ** 3; + const x2 = x ** 3; + const z2 = z ** 3; + y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787; + x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787; + z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787; + x *= 95.047; + y *= 100; + z *= 108.883; + return [x, y, z]; + }; + convert.lab.lch = function (lab) { + const l = lab[0]; + const a = lab[1]; + const b = lab[2]; + let h; + const hr = Math.atan2(b, a); + h = (hr * 360) / 2 / Math.PI; + if (h < 0) { + h += 360; + } + const c = Math.sqrt(a * a + b * b); + return [l, c, h]; + }; + convert.lch.lab = function (lch) { + const l = lch[0]; + const c = lch[1]; + const h = lch[2]; + const hr = (h / 360) * 2 * Math.PI; + const a = c * Math.cos(hr); + const b = c * Math.sin(hr); + return [l, a, b]; + }; + convert.rgb.ansi16 = function (args, saturation = null) { + const [r, g, b] = args; + let value = + saturation === null ? convert.rgb.hsv(args)[2] : saturation; + value = Math.round(value / 50); + if (value === 0) { + return 30; + } + let ansi = + 30 + + ((Math.round(b / 255) << 2) | + (Math.round(g / 255) << 1) | + Math.round(r / 255)); + if (value === 2) { + ansi += 60; + } + return ansi; + }; + convert.hsv.ansi16 = function (args) { + return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); + }; + convert.rgb.ansi256 = function (args) { + const r = args[0]; + const g = args[1]; + const b = args[2]; + if (r === g && g === b) { + if (r < 8) { + return 16; + } + if (r > 248) { + return 231; + } + return Math.round(((r - 8) / 247) * 24) + 232; + } + const ansi = + 16 + + 36 * Math.round((r / 255) * 5) + + 6 * Math.round((g / 255) * 5) + + Math.round((b / 255) * 5); + return ansi; + }; + convert.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 r = (color & 1) * mult * 255; + const g = ((color >> 1) & 1) * mult * 255; + const b = ((color >> 2) & 1) * mult * 255; + return [r, g, b]; + }; + convert.ansi256.rgb = function (args) { + if (args >= 232) { + const c = (args - 232) * 10 + 8; + return [c, c, c]; + } + args -= 16; + let rem; + const r = (Math.floor(args / 36) / 5) * 255; + const g = (Math.floor((rem = args % 36) / 6) / 5) * 255; + const b = ((rem % 6) / 5) * 255; + return [r, g, b]; + }; + convert.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; + }; + convert.hex.rgb = function (args) { + const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + if (!match) { + return [0, 0, 0]; + } + let colorString = match[0]; + if (match[0].length === 3) { + colorString = colorString + .split("") + .map((char) => { + return char + char; + }) + .join(""); + } + const integer = parseInt(colorString, 16); + const r = (integer >> 16) & 255; + const g = (integer >> 8) & 255; + const b = integer & 255; + return [r, g, b]; + }; + convert.rgb.hcg = function (rgb) { + const r = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const max = Math.max(Math.max(r, g), b); + const min = Math.min(Math.min(r, g), b); + 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 === r) { + hue = ((g - b) / chroma) % 6; + } else if (max === g) { + hue = 2 + (b - r) / chroma; + } else { + hue = 4 + (r - g) / chroma; + } + hue /= 6; + hue %= 1; + return [hue * 360, chroma * 100, grayscale * 100]; + }; + convert.hsl.hcg = function (hsl) { + const s = hsl[1] / 100; + const l = hsl[2] / 100; + const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l); + let f = 0; + if (c < 1) { + f = (l - 0.5 * c) / (1 - c); + } + return [hsl[0], c * 100, f * 100]; + }; + convert.hsv.hcg = function (hsv) { + const s = hsv[1] / 100; + const v = hsv[2] / 100; + const c = s * v; + let f = 0; + if (c < 1) { + f = (v - c) / (1 - c); + } + return [hsv[0], c * 100, f * 100]; + }; + convert.hcg.rgb = function (hcg) { + const h = hcg[0] / 360; + const c = hcg[1] / 100; + const g = hcg[2] / 100; + if (c === 0) { + return [g * 255, g * 255, g * 255]; + } + const pure = [0, 0, 0]; + const hi = (h % 1) * 6; + const v = hi % 1; + const w = 1 - v; + let mg = 0; + switch (Math.floor(hi)) { + case 0: + pure[0] = 1; + pure[1] = v; + pure[2] = 0; + break; + case 1: + pure[0] = w; + pure[1] = 1; + pure[2] = 0; + break; + case 2: + pure[0] = 0; + pure[1] = 1; + pure[2] = v; + break; + case 3: + pure[0] = 0; + pure[1] = w; + pure[2] = 1; + break; + case 4: + pure[0] = v; + pure[1] = 0; + pure[2] = 1; + break; + default: + pure[0] = 1; + pure[1] = 0; + pure[2] = w; + } + mg = (1 - c) * g; + return [ + (c * pure[0] + mg) * 255, + (c * pure[1] + mg) * 255, + (c * pure[2] + mg) * 255, + ]; + }; + convert.hcg.hsv = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; + const v = c + g * (1 - c); + let f = 0; + if (v > 0) { + f = c / v; + } + return [hcg[0], f * 100, v * 100]; + }; + convert.hcg.hsl = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; + const l = g * (1 - c) + 0.5 * c; + let s = 0; + if (l > 0 && l < 0.5) { + s = c / (2 * l); + } else if (l >= 0.5 && l < 1) { + s = c / (2 * (1 - l)); + } + return [hcg[0], s * 100, l * 100]; + }; + convert.hcg.hwb = function (hcg) { + const c = hcg[1] / 100; + const g = hcg[2] / 100; + const v = c + g * (1 - c); + return [hcg[0], (v - c) * 100, (1 - v) * 100]; + }; + convert.hwb.hcg = function (hwb) { + const w = hwb[1] / 100; + const b = hwb[2] / 100; + const v = 1 - b; + const c = v - w; + let g = 0; + if (c < 1) { + g = (v - c) / (1 - c); + } + return [hwb[0], c * 100, g * 100]; + }; + convert.apple.rgb = function (apple) { + return [ + (apple[0] / 65535) * 255, + (apple[1] / 65535) * 255, + (apple[2] / 65535) * 255, + ]; + }; + convert.rgb.apple = function (rgb) { + return [ + (rgb[0] / 255) * 65535, + (rgb[1] / 255) * 65535, + (rgb[2] / 255) * 65535, + ]; + }; + convert.gray.rgb = function (args) { + return [ + (args[0] / 100) * 255, + (args[0] / 100) * 255, + (args[0] / 100) * 255, + ]; + }; + convert.gray.hsl = function (args) { + return [0, 0, args[0]]; + }; + convert.gray.hsv = convert.gray.hsl; + convert.gray.hwb = function (gray) { + return [0, 100, gray[0]]; + }; + convert.gray.cmyk = function (gray) { + return [0, 0, 0, gray[0]]; + }; + convert.gray.lab = function (gray) { + return [gray[0], 0, 0]; + }; + convert.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; + }; + convert.rgb.gray = function (rgb) { + const val = (rgb[0] + rgb[1] + rgb[2]) / 3; + return [(val / 255) * 100]; + }; + }, }); // node_modules/ansi-styles/node_modules/color-convert/route.js var require_route = __commonJS({ - "node_modules/ansi-styles/node_modules/color-convert/route.js"(exports, module2) { - var conversions = require_conversions(); - function buildGraph() { - const graph = {}; - const models = Object.keys(conversions); - for (let len = models.length, i = 0; i < len; i++) { - graph[models[i]] = { - // http://jsperf.com/1-vs-infinity - // micro-opt, but this is simple. - distance: -1, - parent: null - }; - } - return graph; - } - function deriveBFS(fromModel) { - const graph = buildGraph(); - const queue = [fromModel]; - graph[fromModel].distance = 0; - while (queue.length) { - const current = queue.pop(); - const adjacents = Object.keys(conversions[current]); - for (let len = adjacents.length, i = 0; i < len; i++) { - const adjacent = adjacents[i]; - const node = graph[adjacent]; - if (node.distance === -1) { - node.distance = graph[current].distance + 1; - node.parent = current; - queue.unshift(adjacent); - } - } - } - return graph; - } - function link(from, to) { - return function(args) { - return to(from(args)); - }; - } - function wrapConversion(toModel, graph) { - const path = [graph[toModel].parent, toModel]; - let fn = conversions[graph[toModel].parent][toModel]; - let cur = graph[toModel].parent; - while (graph[cur].parent) { - path.unshift(graph[cur].parent); - fn = link(conversions[graph[cur].parent][cur], fn); - cur = graph[cur].parent; - } - fn.conversion = path; - return fn; - } - module2.exports = function(fromModel) { - const graph = deriveBFS(fromModel); - const conversion = {}; - const models = Object.keys(graph); - for (let len = models.length, i = 0; i < len; i++) { - const toModel = models[i]; - const node = graph[toModel]; - if (node.parent === null) { - continue; - } - conversion[toModel] = wrapConversion(toModel, graph); - } - return conversion; - }; - } + "node_modules/ansi-styles/node_modules/color-convert/route.js"( + exports, + module2, + ) { + var conversions = require_conversions(); + function buildGraph() { + const graph = {}; + const models = Object.keys(conversions); + for (let len = models.length, i = 0; i < len; i++) { + graph[models[i]] = { + // http://jsperf.com/1-vs-infinity + // micro-opt, but this is simple. + distance: -1, + parent: null, + }; + } + return graph; + } + function deriveBFS(fromModel) { + const graph = buildGraph(); + const queue = [fromModel]; + graph[fromModel].distance = 0; + while (queue.length) { + const current = queue.pop(); + const adjacents = Object.keys(conversions[current]); + for (let len = adjacents.length, i = 0; i < len; i++) { + const adjacent = adjacents[i]; + const node = graph[adjacent]; + if (node.distance === -1) { + node.distance = graph[current].distance + 1; + node.parent = current; + queue.unshift(adjacent); + } + } + } + return graph; + } + function link(from, to) { + return function (args) { + return to(from(args)); + }; + } + function wrapConversion(toModel, graph) { + const path = [graph[toModel].parent, toModel]; + let fn = conversions[graph[toModel].parent][toModel]; + let cur = graph[toModel].parent; + while (graph[cur].parent) { + path.unshift(graph[cur].parent); + fn = link(conversions[graph[cur].parent][cur], fn); + cur = graph[cur].parent; + } + fn.conversion = path; + return fn; + } + module2.exports = function (fromModel) { + const graph = deriveBFS(fromModel); + const conversion = {}; + const models = Object.keys(graph); + for (let len = models.length, i = 0; i < len; i++) { + const toModel = models[i]; + const node = graph[toModel]; + if (node.parent === null) { + continue; + } + conversion[toModel] = wrapConversion(toModel, graph); + } + return conversion; + }; + }, }); // node_modules/ansi-styles/node_modules/color-convert/index.js var require_color_convert = __commonJS({ - "node_modules/ansi-styles/node_modules/color-convert/index.js"(exports, module2) { - var conversions = require_conversions(); - var route = require_route(); - var convert = {}; - 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; - } - 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, i = 0; i < len; i++) { - result[i] = Math.round(result[i]); - } - } - return result; - }; - if ("conversion" in fn) { - wrappedFn.conversion = fn.conversion; - } - return wrappedFn; - } - models.forEach((fromModel) => { - convert[fromModel] = {}; - Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels }); - Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels }); - const routes = route(fromModel); - const routeModels = Object.keys(routes); - routeModels.forEach((toModel) => { - const fn = routes[toModel]; - convert[fromModel][toModel] = wrapRounded(fn); - convert[fromModel][toModel].raw = wrapRaw(fn); - }); - }); - module2.exports = convert; - } + "node_modules/ansi-styles/node_modules/color-convert/index.js"( + exports, + module2, + ) { + var conversions = require_conversions(); + var route = require_route(); + var convert = {}; + 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; + } + 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, i = 0; i < len; i++) { + result[i] = Math.round(result[i]); + } + } + return result; + }; + if ("conversion" in fn) { + wrappedFn.conversion = fn.conversion; + } + return wrappedFn; + } + models.forEach((fromModel) => { + convert[fromModel] = {}; + Object.defineProperty(convert[fromModel], "channels", { + value: conversions[fromModel].channels, + }); + Object.defineProperty(convert[fromModel], "labels", { + value: conversions[fromModel].labels, + }); + const routes = route(fromModel); + const routeModels = Object.keys(routes); + routeModels.forEach((toModel) => { + const fn = routes[toModel]; + convert[fromModel][toModel] = wrapRounded(fn); + convert[fromModel][toModel].raw = wrapRaw(fn); + }); + }); + module2.exports = convert; + }, }); // node_modules/ansi-styles/index.js var require_ansi_styles = __commonJS({ - "node_modules/ansi-styles/index.js"(exports, module2) { - "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 = (n) => n; - var rgb2rgb = (r, g, b) => [r, g, b]; - var setLazyProperty = (object, property, get) => { - Object.defineProperty(object, property, { - get: () => { - const value = get(); - Object.defineProperty(object, property, { - value, - enumerable: true, - configurable: true - }); - return value; - }, - enumerable: true, - configurable: true - }); - }; - var colorConvert; - var makeDynamicStyles = (wrap, 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] = wrap(identity, offset); - } else if (typeof suite === "object") { - styles[name] = wrap(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, group] of Object.entries(styles)) { - for (const [styleName, style] of Object.entries(group)) { - styles[styleName] = { - open: `\x1B[${style[0]}m`, - close: `\x1B[${style[1]}m` - }; - group[styleName] = styles[styleName]; - codes.set(style[0], style[1]); - } - Object.defineProperty(styles, groupName, { - value: group, - 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(module2, "exports", { - enumerable: true, - get: assembleStyles - }); - } + "node_modules/ansi-styles/index.js"(exports, module2) { + "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 = (n) => n; + var rgb2rgb = (r, g, b) => [r, g, b]; + var setLazyProperty = (object, property, get) => { + Object.defineProperty(object, property, { + get: () => { + const value = get(); + Object.defineProperty(object, property, { + value, + enumerable: true, + configurable: true, + }); + return value; + }, + enumerable: true, + configurable: true, + }); + }; + var colorConvert; + var makeDynamicStyles = (wrap, 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] = wrap(identity, offset); + } else if (typeof suite === "object") { + styles[name] = wrap(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, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\x1B[${style[0]}m`, + close: `\x1B[${style[1]}m`, + }; + group[styleName] = styles[styleName]; + codes.set(style[0], style[1]); + } + Object.defineProperty(styles, groupName, { + value: group, + 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(module2, "exports", { + enumerable: true, + get: assembleStyles, + }); + }, }); // node_modules/cliui/node_modules/wrap-ansi/index.js var require_wrap_ansi = __commonJS({ - "node_modules/cliui/node_modules/wrap-ansi/index.js"(exports, module2) { - "use strict"; - var stringWidth = require_string_width(); - var stripAnsi = 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(stripAnsi(rows[rows.length - 1])); - for (const [index, 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(index + 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 && index < 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 exec = (string, columns, options = {}) => { - if (options.trim !== false && string.trim() === "") { - return ""; - } - let returnValue = ""; - let escapeCode; - let escapeUrl; - const lengths = wordLengths(string); - let rows = [""]; - for (const [index, 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 (index !== 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[index] > columns) { - const remainingColumns = columns - rowLength; - const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns); - const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns); - if (breaksStartingNextLine < breaksStartingThisLine) { - rows.push(""); - } - wrapWord(rows, word, columns); - continue; - } - if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) { - if (options.wordWrap === false && rowLength < columns) { - wrapWord(rows, word, columns); - continue; - } - rows.push(""); - } - if (rowLength + lengths[index] > 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 [index, 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(index).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[index + 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); - } - } - } - return returnValue; - }; - module2.exports = (string, columns, options) => { - return String(string).normalize().replace(/\r\n/g, "\n").split("\n").map((line) => exec(line, columns, options)).join("\n"); - }; - } + "node_modules/cliui/node_modules/wrap-ansi/index.js"(exports, module2) { + "use strict"; + var stringWidth = require_string_width(); + var stripAnsi = 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(stripAnsi(rows[rows.length - 1])); + for (const [index, 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(index + 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 && index < 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 exec = (string, columns, options = {}) => { + if (options.trim !== false && string.trim() === "") { + return ""; + } + let returnValue = ""; + let escapeCode; + let escapeUrl; + const lengths = wordLengths(string); + let rows = [""]; + for (const [index, 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 (index !== 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[index] > columns) { + const remainingColumns = columns - rowLength; + const breaksStartingThisLine = + 1 + + Math.floor( + (lengths[index] - remainingColumns - 1) / columns, + ); + const breaksStartingNextLine = Math.floor( + (lengths[index] - 1) / columns, + ); + if (breaksStartingNextLine < breaksStartingThisLine) { + rows.push(""); + } + wrapWord(rows, word, columns); + continue; + } + if ( + rowLength + lengths[index] > columns && + rowLength > 0 && + lengths[index] > 0 + ) { + if (options.wordWrap === false && rowLength < columns) { + wrapWord(rows, word, columns); + continue; + } + rows.push(""); + } + if ( + rowLength + lengths[index] > 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 [index, 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(index).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[index + 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); + } + } + } + return returnValue; + }; + module2.exports = (string, columns, options) => { + return String(string) + .normalize() + .replace(/\r\n/g, "\n") + .split("\n") + .map((line) => exec(line, columns, options)) + .join("\n"); + }; + }, }); // node_modules/cliui/build/index.cjs var require_build3 = __commonJS({ - "node_modules/cliui/build/index.cjs"(exports, module2) { - "use strict"; - var align = { - right: alignRight, - center: alignCenter - }; - var top = 0; - var right = 1; - var bottom = 2; - var left = 3; - var UI = class { - constructor(opts) { - var _a; - this.width = opts.width; - this.wrap = (_a = opts.wrap) !== null && _a !== void 0 ? _a : true; - this.rows = []; - } - span(...args) { - const cols = this.div(...args); - cols.span = true; - } - resetOutput() { - this.rows = []; - } - div(...args) { - if (args.length === 0) { - this.div(""); - } - if (this.wrap && this.shouldApplyLayoutDSL(...args) && typeof args[0] === "string") { - return this.applyLayoutDSL(args[0]); - } - 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((r, i) => { - return { - text: r.trim(), - padding: this.measurePadding(r), - width: i === 0 && columns.length > 1 ? leftColumnWidth : void 0 - }; - })); - }); - return this.rows[this.rows.length - 1]; - } - colFromString(text) { - return { - text, - padding: this.measurePadding(text) - }; - } - 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"); - } - rowToString(row, lines) { - this.rasterize(row).forEach((rrow, r) => { - let str = ""; - rrow.forEach((col, c) => { - const { width } = row[c]; - const wrapWidth = this.negatePadding(row[c]); - let ts = col; - if (wrapWidth > mixin.stringWidth(col)) { - ts += " ".repeat(wrapWidth - mixin.stringWidth(col)); - } - if (row[c].align && row[c].align !== "left" && this.wrap) { - const fn = align[row[c].align]; - ts = fn(ts, wrapWidth); - if (mixin.stringWidth(ts) < wrapWidth) { - ts += " ".repeat((width || 0) - mixin.stringWidth(ts) - 1); - } - } - const padding = row[c].padding || [0, 0, 0, 0]; - if (padding[left]) { - str += " ".repeat(padding[left]); - } - str += addBorder(row[c], ts, "| "); - str += ts; - str += addBorder(row[c], ts, " |"); - if (padding[right]) { - str += " ".repeat(padding[right]); - } - if (r === 0 && lines.length > 0) { - str = this.renderInline(str, lines[lines.length - 1]); - } - }); - lines.push({ - text: str.replace(/ +$/, ""), - span: row.span - }); - }); - return lines; - } - // if the full 'source' can render in - // the target line, do so. - renderInline(source, previousLine) { - const match = source.match(/^ */); - const leadingWhitespace = match ? match[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; - } - 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, c) => { - col.width = widths[c]; - 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("")); - } - wrapped.forEach((str, r) => { - if (!rrows[r]) { - rrows.push([]); - } - const rrow = rrows[r]; - for (let i = 0; i < c; i++) { - if (rrow[i] === void 0) { - rrow.push(""); - } - } - rrow.push(str); - }); - }); - return rrows; - } - 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; - } - 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((w, i) => { - if (w === void 0) { - return Math.max(unsetWidth, _minWidth(row[i])); - } - return w; - }); - } - }; - function addBorder(col, ts, style) { - if (col.border) { - if (/[.']-+[.']/.test(ts)) { - return ""; - } - if (ts.trim().length !== 0) { - return style; - } - 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; - } - return 80; - } - function alignRight(str, width) { - str = str.trim(); - const strWidth = mixin.stringWidth(str); - if (strWidth < width) { - return " ".repeat(width - strWidth) + str; - } - return str; - } - function alignCenter(str, width) { - str = str.trim(); - const strWidth = mixin.stringWidth(str); - if (strWidth >= width) { - return str; - } - 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 stripAnsi = require_strip_ansi(); - var wrap = require_wrap_ansi(); - function ui(opts) { - return cliui(opts, { - stringWidth, - stripAnsi, - wrap - }); - } - module2.exports = ui; - } + "node_modules/cliui/build/index.cjs"(exports, module2) { + "use strict"; + var align = { + right: alignRight, + center: alignCenter, + }; + var top = 0; + var right = 1; + var bottom = 2; + var left = 3; + var UI = class { + constructor(opts) { + var _a; + this.width = opts.width; + this.wrap = + (_a = opts.wrap) !== null && _a !== void 0 ? _a : true; + this.rows = []; + } + span(...args) { + const cols = this.div(...args); + cols.span = true; + } + resetOutput() { + this.rows = []; + } + div(...args) { + if (args.length === 0) { + this.div(""); + } + if ( + this.wrap && + this.shouldApplyLayoutDSL(...args) && + typeof args[0] === "string" + ) { + return this.applyLayoutDSL(args[0]); + } + 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((r, i) => { + return { + text: r.trim(), + padding: this.measurePadding(r), + width: + i === 0 && columns.length > 1 + ? leftColumnWidth + : void 0, + }; + }), + ); + }); + return this.rows[this.rows.length - 1]; + } + colFromString(text) { + return { + text, + padding: this.measurePadding(text), + }; + } + 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"); + } + rowToString(row, lines) { + this.rasterize(row).forEach((rrow, r) => { + let str = ""; + rrow.forEach((col, c) => { + const { width } = row[c]; + const wrapWidth = this.negatePadding(row[c]); + let ts = col; + if (wrapWidth > mixin.stringWidth(col)) { + ts += " ".repeat( + wrapWidth - mixin.stringWidth(col), + ); + } + if ( + row[c].align && + row[c].align !== "left" && + this.wrap + ) { + const fn = align[row[c].align]; + ts = fn(ts, wrapWidth); + if (mixin.stringWidth(ts) < wrapWidth) { + ts += " ".repeat( + (width || 0) - mixin.stringWidth(ts) - 1, + ); + } + } + const padding = row[c].padding || [0, 0, 0, 0]; + if (padding[left]) { + str += " ".repeat(padding[left]); + } + str += addBorder(row[c], ts, "| "); + str += ts; + str += addBorder(row[c], ts, " |"); + if (padding[right]) { + str += " ".repeat(padding[right]); + } + if (r === 0 && lines.length > 0) { + str = this.renderInline( + str, + lines[lines.length - 1], + ); + } + }); + lines.push({ + text: str.replace(/ +$/, ""), + span: row.span, + }); + }); + return lines; + } + // if the full 'source' can render in + // the target line, do so. + renderInline(source, previousLine) { + const match = source.match(/^ */); + const leadingWhitespace = match ? match[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; + } + 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, c) => { + col.width = widths[c]; + 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(""), + ); + } + wrapped.forEach((str, r) => { + if (!rrows[r]) { + rrows.push([]); + } + const rrow = rrows[r]; + for (let i = 0; i < c; i++) { + if (rrow[i] === void 0) { + rrow.push(""); + } + } + rrow.push(str); + }); + }); + return rrows; + } + 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; + } + 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((w, i) => { + if (w === void 0) { + return Math.max(unsetWidth, _minWidth(row[i])); + } + return w; + }); + } + }; + function addBorder(col, ts, style) { + if (col.border) { + if (/[.']-+[.']/.test(ts)) { + return ""; + } + if (ts.trim().length !== 0) { + return style; + } + 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; + } + return 80; + } + function alignRight(str, width) { + str = str.trim(); + const strWidth = mixin.stringWidth(str); + if (strWidth < width) { + return " ".repeat(width - strWidth) + str; + } + return str; + } + function alignCenter(str, width) { + str = str.trim(); + const strWidth = mixin.stringWidth(str); + if (strWidth >= width) { + return str; + } + 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 stripAnsi = require_strip_ansi(); + var wrap = require_wrap_ansi(); + function ui(opts) { + return cliui(opts, { + stringWidth, + stripAnsi, + wrap, + }); + } + module2.exports = ui; + }, }); // node_modules/escalade/sync/index.js var require_sync = __commonJS({ - "node_modules/escalade/sync/index.js"(exports, module2) { - var { dirname, resolve } = require("path"); - var { readdirSync, statSync } = require("fs"); - module2.exports = function(start, callback) { - let dir = resolve(".", start); - let tmp, stats = statSync(dir); - if (!stats.isDirectory()) { - dir = dirname(dir); - } - while (true) { - tmp = callback(dir, readdirSync(dir)); - if (tmp) - return resolve(dir, tmp); - dir = dirname(tmp = dir); - if (tmp === dir) - break; - } - }; - } + "node_modules/escalade/sync/index.js"(exports, module2) { + var { dirname, resolve } = require("path"); + var { readdirSync, statSync } = require("fs"); + module2.exports = function (start, callback) { + let dir = resolve(".", start); + let tmp, + stats = statSync(dir); + if (!stats.isDirectory()) { + dir = dirname(dir); + } + while (true) { + tmp = callback(dir, readdirSync(dir)); + if (tmp) return resolve(dir, tmp); + dir = dirname((tmp = dir)); + if (tmp === dir) break; + } + }; + }, }); // node_modules/get-caller-file/index.js var require_get_caller_file = __commonJS({ - "node_modules/get-caller-file/index.js"(exports, module2) { - "use strict"; - module2.exports = function getCallerFile(position) { - if (position === void 0) { - position = 2; - } - if (position >= Error.stackTraceLimit) { - throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `" + position + "` and Error.stackTraceLimit was: `" + Error.stackTraceLimit + "`"); - } - var oldPrepareStackTrace = Error.prepareStackTrace; - Error.prepareStackTrace = function(_, stack2) { - return stack2; - }; - var stack = new Error().stack; - Error.prepareStackTrace = oldPrepareStackTrace; - if (stack !== null && typeof stack === "object") { - return stack[position] ? stack[position].getFileName() : void 0; - } - }; - } + "node_modules/get-caller-file/index.js"(exports, module2) { + "use strict"; + module2.exports = function getCallerFile(position) { + if (position === void 0) { + position = 2; + } + if (position >= Error.stackTraceLimit) { + throw new TypeError( + "getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `" + + position + + "` and Error.stackTraceLimit was: `" + + Error.stackTraceLimit + + "`", + ); + } + var oldPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = function (_, stack2) { + return stack2; + }; + var stack = new Error().stack; + Error.prepareStackTrace = oldPrepareStackTrace; + if (stack !== null && typeof stack === "object") { + return stack[position] ? stack[position].getFileName() : void 0; + } + }; + }, }); // node_modules/require-directory/index.js var require_require_directory = __commonJS({ - "node_modules/require-directory/index.js"(exports, module2) { - "use strict"; - var fs = require("fs"); - var join = require("path").join; - var resolve = require("path").resolve; - var dirname = require("path").dirname; - var defaultOptions = { - extensions: ["js", "json", "coffee"], - recurse: true, - rename: function(name) { - return name; - }, - visit: function(obj) { - return obj; - } - }; - function checkFileInclusion(path, 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(path)) && // if options.include is a function, evaluate it and make sure the path passes - !(options.include && typeof options.include === "function" && !options.include(path, 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(path)) && // if options.exclude is a function, evaluate it and make sure the path doesn't pass - !(options.exclude && typeof options.exclude === "function" && options.exclude(path, filename)) - ); - } - function requireDirectory(m, path, options) { - var retval = {}; - if (path && !options && typeof path !== "string") { - options = path; - path = null; - } - options = options || {}; - for (var prop in defaultOptions) { - if (typeof options[prop] === "undefined") { - options[prop] = defaultOptions[prop]; - } - } - path = !path ? dirname(m.filename) : resolve(dirname(m.filename), path); - fs.readdirSync(path).forEach(function(filename) { - var joined = join(path, filename), files, key, obj; - if (fs.statSync(joined).isDirectory() && options.recurse) { - files = requireDirectory(m, joined, options); - if (Object.keys(files).length) { - retval[options.rename(filename, joined, filename)] = files; - } - } else { - if (joined !== m.filename && checkFileInclusion(joined, filename, options)) { - key = filename.substring(0, filename.lastIndexOf(".")); - obj = m.require(joined); - retval[options.rename(key, joined, filename)] = options.visit(obj, joined, filename) || obj; - } - } - }); - return retval; - } - module2.exports = requireDirectory; - module2.exports.defaults = defaultOptions; - } + "node_modules/require-directory/index.js"(exports, module2) { + "use strict"; + var fs = require("fs"); + var join = require("path").join; + var resolve = require("path").resolve; + var dirname = require("path").dirname; + var defaultOptions = { + extensions: ["js", "json", "coffee"], + recurse: true, + rename: function (name) { + return name; + }, + visit: function (obj) { + return obj; + }, + }; + function checkFileInclusion(path, 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(path) + ) && // if options.include is a function, evaluate it and make sure the path passes + !( + options.include && + typeof options.include === "function" && + !options.include(path, 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(path) + ) && // if options.exclude is a function, evaluate it and make sure the path doesn't pass + !( + options.exclude && + typeof options.exclude === "function" && + options.exclude(path, filename) + ) + ); + } + function requireDirectory(m, path, options) { + var retval = {}; + if (path && !options && typeof path !== "string") { + options = path; + path = null; + } + options = options || {}; + for (var prop in defaultOptions) { + if (typeof options[prop] === "undefined") { + options[prop] = defaultOptions[prop]; + } + } + path = !path + ? dirname(m.filename) + : resolve(dirname(m.filename), path); + fs.readdirSync(path).forEach(function (filename) { + var joined = join(path, filename), + files, + key, + obj; + if (fs.statSync(joined).isDirectory() && options.recurse) { + files = requireDirectory(m, joined, options); + if (Object.keys(files).length) { + retval[options.rename(filename, joined, filename)] = + files; + } + } else { + if ( + joined !== m.filename && + checkFileInclusion(joined, filename, options) + ) { + key = filename.substring(0, filename.lastIndexOf(".")); + obj = m.require(joined); + retval[options.rename(key, joined, filename)] = + options.visit(obj, joined, filename) || obj; + } + } + }); + return retval; + } + module2.exports = requireDirectory; + module2.exports.defaults = defaultOptions; + }, }); // node_modules/yargs/build/index.cjs var require_build4 = __commonJS({ - "node_modules/yargs/build/index.cjs"(exports, module2) { - "use strict"; - var t = require("assert"); - var e = class extends Error { - constructor(t2) { - super(t2 || "yargs error"), this.name = "YError", Error.captureStackTrace(this, e); - } - }; - var s; - var i = []; - function n(t2, o2, a2, h2) { - s = h2; - let l2 = {}; - if (Object.prototype.hasOwnProperty.call(t2, "extends")) { - if ("string" != typeof t2.extends) - return l2; - const r2 = /\.json|\..*rc$/.test(t2.extends); - let h3 = null; - if (r2) - h3 = function(t3, e2) { - return s.path.resolve(t3, e2); - }(o2, t2.extends); - else - try { - h3 = require.resolve(t2.extends); - } catch (e2) { - return t2; - } - !function(t3) { - if (i.indexOf(t3) > -1) - throw new e(`Circular extended configurations: '${t3}'.`); - }(h3), i.push(h3), l2 = r2 ? JSON.parse(s.readFileSync(h3, "utf8")) : require(t2.extends), delete t2.extends, l2 = n(l2, s.path.dirname(h3), a2, s); - } - return i = [], a2 ? r(l2, t2) : Object.assign({}, l2, t2); - } - function r(t2, e2) { - const s2 = {}; - function i2(t3) { - return t3 && "object" == typeof t3 && !Array.isArray(t3); - } - Object.assign(s2, t2); - for (const n2 of Object.keys(e2)) - i2(e2[n2]) && i2(s2[n2]) ? s2[n2] = r(t2[n2], e2[n2]) : s2[n2] = e2[n2]; - return s2; - } - function o(t2) { - const e2 = t2.replace(/\s{2,}/g, " ").split(/\s+(?![^[]*]|[^<]*>)/), s2 = /\.*[\][<>]/g, i2 = e2.shift(); - if (!i2) - throw new Error(`No command found in: ${t2}`); - const n2 = { cmd: i2.replace(s2, ""), demanded: [], optional: [] }; - return e2.forEach((t3, i3) => { - let r2 = false; - t3 = t3.replace(/\s/g, ""), /\.+[\]>]/.test(t3) && i3 === e2.length - 1 && (r2 = true), /^\[/.test(t3) ? n2.optional.push({ cmd: t3.replace(s2, "").split("|"), variadic: r2 }) : n2.demanded.push({ cmd: t3.replace(s2, "").split("|"), variadic: r2 }); - }), n2; - } - var a = ["first", "second", "third", "fourth", "fifth", "sixth"]; - function h(t2, s2, i2) { - try { - let n2 = 0; - const [r2, a2, h2] = "object" == typeof t2 ? [{ demanded: [], optional: [] }, t2, s2] : [o(`cmd ${t2}`), s2, i2], f2 = [].slice.call(a2); - for (; f2.length && void 0 === f2[f2.length - 1]; ) - f2.pop(); - const d2 = h2 || f2.length; - if (d2 < r2.demanded.length) - throw new e(`Not enough arguments provided. Expected ${r2.demanded.length} but received ${f2.length}.`); - const u2 = r2.demanded.length + r2.optional.length; - if (d2 > u2) - throw new e(`Too many arguments provided. Expected max ${u2} but received ${d2}.`); - r2.demanded.forEach((t3) => { - const e2 = l(f2.shift()); - 0 === t3.cmd.filter((t4) => t4 === e2 || "*" === t4).length && c(e2, t3.cmd, n2), n2 += 1; - }), r2.optional.forEach((t3) => { - if (0 === f2.length) - return; - const e2 = l(f2.shift()); - 0 === t3.cmd.filter((t4) => t4 === e2 || "*" === t4).length && c(e2, t3.cmd, n2), n2 += 1; - }); - } catch (t3) { - console.warn(t3.stack); - } - } - function l(t2) { - return Array.isArray(t2) ? "array" : null === t2 ? "null" : typeof t2; - } - function c(t2, s2, i2) { - throw new e(`Invalid ${a[i2] || "manyith"} argument. Expected ${s2.join(" or ")} but received ${t2}.`); - } - function f(t2) { - return !!t2 && !!t2.then && "function" == typeof t2.then; - } - function d(t2, e2, s2, i2) { - s2.assert.notStrictEqual(t2, e2, i2); - } - function u(t2, e2) { - e2.assert.strictEqual(typeof t2, "string"); - } - function p(t2) { - return Object.keys(t2); - } - function g(t2 = {}, e2 = () => true) { - const s2 = {}; - return p(t2).forEach((i2) => { - e2(i2, t2[i2]) && (s2[i2] = t2[i2]); - }), s2; - } - function m() { - return process.versions.electron && !process.defaultApp ? 0 : 1; - } - function y() { - return process.argv[m()]; - } - var b = Object.freeze({ __proto__: null, hideBin: function(t2) { - return t2.slice(m() + 1); - }, getProcessArgvBin: y }); - function v(t2, e2, s2, i2) { - if ("a" === s2 && !i2) - throw new TypeError("Private accessor was defined without a getter"); - if ("function" == typeof e2 ? t2 !== e2 || !i2 : !e2.has(t2)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return "m" === s2 ? i2 : "a" === s2 ? i2.call(t2) : i2 ? i2.value : e2.get(t2); - } - function O(t2, e2, s2, i2, n2) { - if ("m" === i2) - throw new TypeError("Private method is not writable"); - if ("a" === i2 && !n2) - throw new TypeError("Private accessor was defined without a setter"); - if ("function" == typeof e2 ? t2 !== e2 || !n2 : !e2.has(t2)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return "a" === i2 ? n2.call(t2, s2) : n2 ? n2.value = s2 : e2.set(t2, s2), s2; - } - var w = class { - constructor(t2) { - this.globalMiddleware = [], this.frozens = [], this.yargs = t2; - } - addMiddleware(t2, e2, s2 = true, i2 = false) { - if (h(" [boolean] [boolean] [boolean]", [t2, e2, s2], arguments.length), Array.isArray(t2)) { - for (let i3 = 0; i3 < t2.length; i3++) { - if ("function" != typeof t2[i3]) - throw Error("middleware must be a function"); - const n2 = t2[i3]; - n2.applyBeforeValidation = e2, n2.global = s2; - } - Array.prototype.push.apply(this.globalMiddleware, t2); - } else if ("function" == typeof t2) { - const n2 = t2; - n2.applyBeforeValidation = e2, n2.global = s2, n2.mutates = i2, this.globalMiddleware.push(t2); - } - return this.yargs; - } - addCoerceMiddleware(t2, e2) { - const s2 = this.yargs.getAliases(); - return this.globalMiddleware = this.globalMiddleware.filter((t3) => { - const i2 = [...s2[e2] || [], e2]; - return !t3.option || !i2.includes(t3.option); - }), t2.option = e2, this.addMiddleware(t2, true, true, true); - } - getMiddleware() { - return this.globalMiddleware; - } - freeze() { - this.frozens.push([...this.globalMiddleware]); - } - unfreeze() { - const t2 = this.frozens.pop(); - void 0 !== t2 && (this.globalMiddleware = t2); - } - reset() { - this.globalMiddleware = this.globalMiddleware.filter((t2) => t2.global); - } - }; - function C(t2, e2, s2, i2) { - return s2.reduce((t3, s3) => { - if (s3.applyBeforeValidation !== i2) - return t3; - if (s3.mutates) { - if (s3.applied) - return t3; - s3.applied = true; - } - if (f(t3)) - return t3.then((t4) => Promise.all([t4, s3(t4, e2)])).then(([t4, e3]) => Object.assign(t4, e3)); - { - const i3 = s3(t3, e2); - return f(i3) ? i3.then((e3) => Object.assign(t3, e3)) : Object.assign(t3, i3); - } - }, t2); - } - function j(t2, e2, s2 = (t3) => { - throw t3; - }) { - try { - const s3 = "function" == typeof t2 ? t2() : t2; - return f(s3) ? s3.then((t3) => e2(t3)) : e2(s3); - } catch (t3) { - return s2(t3); - } - } - var _ = /(^\*)|(^\$0)/; - var M = class { - constructor(t2, e2, s2, i2) { - this.requireCache = /* @__PURE__ */ new Set(), this.handlers = {}, this.aliasMap = {}, this.frozens = [], this.shim = i2, this.usage = t2, this.globalMiddleware = s2, this.validation = e2; - } - addDirectory(t2, e2, s2, i2) { - "boolean" != typeof (i2 = i2 || {}).recurse && (i2.recurse = false), Array.isArray(i2.extensions) || (i2.extensions = ["js"]); - const n2 = "function" == typeof i2.visit ? i2.visit : (t3) => t3; - i2.visit = (t3, e3, s3) => { - const i3 = n2(t3, e3, s3); - if (i3) { - if (this.requireCache.has(e3)) - return i3; - this.requireCache.add(e3), this.addHandler(i3); - } - return i3; - }, this.shim.requireDirectory({ require: e2, filename: s2 }, t2, i2); - } - addHandler(t2, e2, s2, i2, n2, r2) { - let a2 = []; - const h2 = function(t3) { - return t3 ? t3.map((t4) => (t4.applyBeforeValidation = false, t4)) : []; - }(n2); - if (i2 = i2 || (() => { - }), Array.isArray(t2)) - if (function(t3) { - return t3.every((t4) => "string" == typeof t4); - }(t2)) - [t2, ...a2] = t2; - else - for (const e3 of t2) - this.addHandler(e3); - else { - if (function(t3) { - return "object" == typeof t3 && !Array.isArray(t3); - }(t2)) { - let e3 = Array.isArray(t2.command) || "string" == typeof t2.command ? t2.command : this.moduleName(t2); - return t2.aliases && (e3 = [].concat(e3).concat(t2.aliases)), void this.addHandler(e3, this.extractDesc(t2), t2.builder, t2.handler, t2.middlewares, t2.deprecated); - } - if (k(s2)) - return void this.addHandler([t2].concat(a2), e2, s2.builder, s2.handler, s2.middlewares, s2.deprecated); - } - if ("string" == typeof t2) { - const n3 = o(t2); - a2 = a2.map((t3) => o(t3).cmd); - let l2 = false; - const c2 = [n3.cmd].concat(a2).filter((t3) => !_.test(t3) || (l2 = true, false)); - 0 === c2.length && l2 && c2.push("$0"), l2 && (n3.cmd = c2[0], a2 = c2.slice(1), t2 = t2.replace(_, n3.cmd)), a2.forEach((t3) => { - this.aliasMap[t3] = n3.cmd; - }), false !== e2 && this.usage.command(t2, e2, l2, a2, r2), this.handlers[n3.cmd] = { original: t2, description: e2, handler: i2, builder: s2 || {}, middlewares: h2, deprecated: r2, demanded: n3.demanded, optional: n3.optional }, l2 && (this.defaultCommand = this.handlers[n3.cmd]); - } - } - getCommandHandlers() { - return this.handlers; - } - getCommands() { - return Object.keys(this.handlers).concat(Object.keys(this.aliasMap)); - } - hasDefaultCommand() { - return !!this.defaultCommand; - } - runCommand(t2, e2, s2, i2, n2, r2) { - const o2 = this.handlers[t2] || this.handlers[this.aliasMap[t2]] || this.defaultCommand, a2 = e2.getInternalMethods().getContext(), h2 = a2.commands.slice(), l2 = !t2; - t2 && (a2.commands.push(t2), a2.fullCommands.push(o2.original)); - const c2 = this.applyBuilderUpdateUsageAndParse(l2, o2, e2, s2.aliases, h2, i2, n2, r2); - return f(c2) ? c2.then((t3) => this.applyMiddlewareAndGetResult(l2, o2, t3.innerArgv, a2, n2, t3.aliases, e2)) : this.applyMiddlewareAndGetResult(l2, o2, c2.innerArgv, a2, n2, c2.aliases, e2); - } - applyBuilderUpdateUsageAndParse(t2, e2, s2, i2, n2, r2, o2, a2) { - const h2 = e2.builder; - let l2 = s2; - if (x(h2)) { - const c2 = h2(s2.getInternalMethods().reset(i2), a2); - if (f(c2)) - return c2.then((i3) => { - var a3; - return l2 = (a3 = i3) && "function" == typeof a3.getInternalMethods ? i3 : s2, this.parseAndUpdateUsage(t2, e2, l2, n2, r2, o2); - }); - } else - (function(t3) { - return "object" == typeof t3; - })(h2) && (l2 = s2.getInternalMethods().reset(i2), Object.keys(e2.builder).forEach((t3) => { - l2.option(t3, h2[t3]); - })); - return this.parseAndUpdateUsage(t2, e2, l2, n2, r2, o2); - } - parseAndUpdateUsage(t2, e2, s2, i2, n2, r2) { - t2 && s2.getInternalMethods().getUsageInstance().unfreeze(true), this.shouldUpdateUsage(s2) && s2.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i2, e2), e2.description); - const o2 = s2.getInternalMethods().runYargsParserAndExecuteCommands(null, void 0, true, n2, r2); - return f(o2) ? o2.then((t3) => ({ aliases: s2.parsed.aliases, innerArgv: t3 })) : { aliases: s2.parsed.aliases, innerArgv: o2 }; - } - shouldUpdateUsage(t2) { - return !t2.getInternalMethods().getUsageInstance().getUsageDisabled() && 0 === t2.getInternalMethods().getUsageInstance().getUsage().length; - } - usageFromParentCommandsCommandHandler(t2, e2) { - const s2 = _.test(e2.original) ? e2.original.replace(_, "").trim() : e2.original, i2 = t2.filter((t3) => !_.test(t3)); - return i2.push(s2), `$0 ${i2.join(" ")}`; - } - applyMiddlewareAndGetResult(t2, e2, s2, i2, n2, r2, o2) { - let a2 = {}; - if (n2) - return s2; - o2.getInternalMethods().getHasOutput() || (a2 = this.populatePositionals(e2, s2, i2, o2)); - const h2 = this.globalMiddleware.getMiddleware().slice(0).concat(e2.middlewares); - if (s2 = C(s2, o2, h2, true), !o2.getInternalMethods().getHasOutput()) { - const e3 = o2.getInternalMethods().runValidation(r2, a2, o2.parsed.error, t2); - s2 = j(s2, (t3) => (e3(t3), t3)); - } - if (e2.handler && !o2.getInternalMethods().getHasOutput()) { - o2.getInternalMethods().setHasOutput(); - const i3 = !!o2.getOptions().configuration["populate--"]; - o2.getInternalMethods().postProcess(s2, i3, false, false), s2 = j(s2 = C(s2, o2, h2, false), (t3) => { - const s3 = e2.handler(t3); - return f(s3) ? s3.then(() => t3) : t3; - }), t2 || o2.getInternalMethods().getUsageInstance().cacheHelpMessage(), f(s2) && !o2.getInternalMethods().hasParseCallback() && s2.catch((t3) => { - try { - o2.getInternalMethods().getUsageInstance().fail(null, t3); - } catch (t4) { - } - }); - } - return t2 || (i2.commands.pop(), i2.fullCommands.pop()), s2; - } - populatePositionals(t2, e2, s2, i2) { - e2._ = e2._.slice(s2.commands.length); - const n2 = t2.demanded.slice(0), r2 = t2.optional.slice(0), o2 = {}; - for (this.validation.positionalCount(n2.length, e2._.length); n2.length; ) { - const t3 = n2.shift(); - this.populatePositional(t3, e2, o2); - } - for (; r2.length; ) { - const t3 = r2.shift(); - this.populatePositional(t3, e2, o2); - } - return e2._ = s2.commands.concat(e2._.map((t3) => "" + t3)), this.postProcessPositionals(e2, o2, this.cmdToParseOptions(t2.original), i2), o2; - } - populatePositional(t2, e2, s2) { - const i2 = t2.cmd[0]; - t2.variadic ? s2[i2] = e2._.splice(0).map(String) : e2._.length && (s2[i2] = [String(e2._.shift())]); - } - cmdToParseOptions(t2) { - const e2 = { array: [], default: {}, alias: {}, demand: {} }, s2 = o(t2); - return s2.demanded.forEach((t3) => { - const [s3, ...i2] = t3.cmd; - t3.variadic && (e2.array.push(s3), e2.default[s3] = []), e2.alias[s3] = i2, e2.demand[s3] = true; - }), s2.optional.forEach((t3) => { - const [s3, ...i2] = t3.cmd; - t3.variadic && (e2.array.push(s3), e2.default[s3] = []), e2.alias[s3] = i2; - }), e2; - } - postProcessPositionals(t2, e2, s2, i2) { - const n2 = Object.assign({}, i2.getOptions()); - n2.default = Object.assign(s2.default, n2.default); - for (const t3 of Object.keys(s2.alias)) - n2.alias[t3] = (n2.alias[t3] || []).concat(s2.alias[t3]); - n2.array = n2.array.concat(s2.array), n2.config = {}; - const r2 = []; - if (Object.keys(e2).forEach((t3) => { - e2[t3].map((e3) => { - n2.configuration["unknown-options-as-args"] && (n2.key[t3] = true), r2.push(`--${t3}`), r2.push(e3); - }); - }), !r2.length) - return; - const o2 = Object.assign({}, n2.configuration, { "populate--": false }), a2 = this.shim.Parser.detailed(r2, Object.assign({}, n2, { configuration: o2 })); - if (a2.error) - i2.getInternalMethods().getUsageInstance().fail(a2.error.message, a2.error); - else { - const s3 = Object.keys(e2); - Object.keys(e2).forEach((t3) => { - s3.push(...a2.aliases[t3]); - }); - const n3 = i2.getOptions().default; - Object.keys(a2.argv).forEach((i3) => { - s3.includes(i3) && (e2[i3] || (e2[i3] = a2.argv[i3]), !Object.hasOwnProperty.call(n3, i3) && Object.hasOwnProperty.call(t2, i3) && Object.hasOwnProperty.call(a2.argv, i3) && (Array.isArray(t2[i3]) || Array.isArray(a2.argv[i3])) ? t2[i3] = [].concat(t2[i3], a2.argv[i3]) : t2[i3] = a2.argv[i3]); - }); - } - } - runDefaultBuilderOn(t2) { - if (!this.defaultCommand) - return; - if (this.shouldUpdateUsage(t2)) { - const e3 = _.test(this.defaultCommand.original) ? this.defaultCommand.original : this.defaultCommand.original.replace(/^[^[\]<>]*/, "$0 "); - t2.getInternalMethods().getUsageInstance().usage(e3, this.defaultCommand.description); - } - const e2 = this.defaultCommand.builder; - if (x(e2)) - return e2(t2, true); - k(e2) || Object.keys(e2).forEach((s2) => { - t2.option(s2, e2[s2]); - }); - } - moduleName(t2) { - const e2 = function(t3) { - if ("undefined" == typeof require) - return null; - for (let e3, s2 = 0, i2 = Object.keys(require.cache); s2 < i2.length; s2++) - if (e3 = require.cache[i2[s2]], e3.exports === t3) - return e3; - return null; - }(t2); - if (!e2) - throw new Error(`No command name given for module: ${this.shim.inspect(t2)}`); - return this.commandFromFilename(e2.filename); - } - commandFromFilename(t2) { - return this.shim.path.basename(t2, this.shim.path.extname(t2)); - } - extractDesc({ describe: t2, description: e2, desc: s2 }) { - for (const i2 of [t2, e2, s2]) { - if ("string" == typeof i2 || false === i2) - return i2; - d(i2, true, this.shim); - } - return false; - } - freeze() { - this.frozens.push({ handlers: this.handlers, aliasMap: this.aliasMap, defaultCommand: this.defaultCommand }); - } - unfreeze() { - const t2 = this.frozens.pop(); - d(t2, void 0, this.shim), { handlers: this.handlers, aliasMap: this.aliasMap, defaultCommand: this.defaultCommand } = t2; - } - reset() { - return this.handlers = {}, this.aliasMap = {}, this.defaultCommand = void 0, this.requireCache = /* @__PURE__ */ new Set(), this; - } - }; - function k(t2) { - return "object" == typeof t2 && !!t2.builder && "function" == typeof t2.handler; - } - function x(t2) { - return "function" == typeof t2; - } - function E(t2) { - "undefined" != typeof process && [process.stdout, process.stderr].forEach((e2) => { - const s2 = e2; - s2._handle && s2.isTTY && "function" == typeof s2._handle.setBlocking && s2._handle.setBlocking(t2); - }); - } - function A(t2) { - return "boolean" == typeof t2; - } - function P(t2, s2) { - const i2 = s2.y18n.__, n2 = {}, r2 = []; - n2.failFn = function(t3) { - r2.push(t3); - }; - let o2 = null, a2 = null, h2 = true; - n2.showHelpOnFail = function(e2 = true, s3) { - const [i3, r3] = "string" == typeof e2 ? [true, e2] : [e2, s3]; - return t2.getInternalMethods().isGlobalContext() && (a2 = r3), o2 = r3, h2 = i3, n2; - }; - let l2 = false; - n2.fail = function(s3, i3) { - const c3 = t2.getInternalMethods().getLoggerInstance(); - if (!r2.length) { - if (t2.getExitProcess() && E(true), !l2) { - l2 = true, h2 && (t2.showHelp("error"), c3.error()), (s3 || i3) && c3.error(s3 || i3); - const e2 = o2 || a2; - e2 && ((s3 || i3) && c3.error(""), c3.error(e2)); - } - if (i3 = i3 || new e(s3), t2.getExitProcess()) - return t2.exit(1); - if (t2.getInternalMethods().hasParseCallback()) - return t2.exit(1, i3); - throw i3; - } - for (let t3 = r2.length - 1; t3 >= 0; --t3) { - const e2 = r2[t3]; - if (A(e2)) { - if (i3) - throw i3; - if (s3) - throw Error(s3); - } else - e2(s3, i3, n2); - } - }; - let c2 = [], f2 = false; - n2.usage = (t3, e2) => null === t3 ? (f2 = true, c2 = [], n2) : (f2 = false, c2.push([t3, e2 || ""]), n2), n2.getUsage = () => c2, n2.getUsageDisabled = () => f2, n2.getPositionalGroupName = () => i2("Positionals:"); - let d2 = []; - n2.example = (t3, e2) => { - d2.push([t3, e2 || ""]); - }; - let u2 = []; - n2.command = function(t3, e2, s3, i3, n3 = false) { - s3 && (u2 = u2.map((t4) => (t4[2] = false, t4))), u2.push([t3, e2 || "", s3, i3, n3]); - }, n2.getCommands = () => u2; - let p2 = {}; - n2.describe = function(t3, e2) { - Array.isArray(t3) ? t3.forEach((t4) => { - n2.describe(t4, e2); - }) : "object" == typeof t3 ? Object.keys(t3).forEach((e3) => { - n2.describe(e3, t3[e3]); - }) : p2[t3] = e2; - }, n2.getDescriptions = () => p2; - let m2 = []; - n2.epilog = (t3) => { - m2.push(t3); - }; - let y2, b2 = false; - function v2() { - return b2 || (y2 = function() { - const t3 = 80; - return s2.process.stdColumns ? Math.min(t3, s2.process.stdColumns) : t3; - }(), b2 = true), y2; - } - n2.wrap = (t3) => { - b2 = true, y2 = t3; - }; - const O2 = "__yargsString__:"; - function w2(t3, e2, i3) { - let n3 = 0; - return Array.isArray(t3) || (t3 = Object.values(t3).map((t4) => [t4])), t3.forEach((t4) => { - n3 = Math.max(s2.stringWidth(i3 ? `${i3} ${I(t4[0])}` : I(t4[0])) + $(t4[0]), n3); - }), e2 && (n3 = Math.min(n3, parseInt((0.5 * e2).toString(), 10))), n3; - } - let C2; - function j2(e2) { - return t2.getOptions().hiddenOptions.indexOf(e2) < 0 || t2.parsed.argv[t2.getOptions().showHiddenOpt]; - } - function _2(t3, e2) { - let s3 = `[${i2("default:")} `; - if (void 0 === t3 && !e2) - return null; - if (e2) - s3 += e2; - else - switch (typeof t3) { - case "string": - s3 += `"${t3}"`; - break; - case "object": - s3 += JSON.stringify(t3); - break; - default: - s3 += t3; - } - return `${s3}]`; - } - n2.deferY18nLookup = (t3) => O2 + t3, n2.help = function() { - if (C2) - return C2; - !function() { - const e3 = t2.getDemandedOptions(), s3 = t2.getOptions(); - (Object.keys(s3.alias) || []).forEach((i3) => { - s3.alias[i3].forEach((r4) => { - p2[r4] && n2.describe(i3, p2[r4]), r4 in e3 && t2.demandOption(i3, e3[r4]), s3.boolean.includes(r4) && t2.boolean(i3), s3.count.includes(r4) && t2.count(i3), s3.string.includes(r4) && t2.string(i3), s3.normalize.includes(r4) && t2.normalize(i3), s3.array.includes(r4) && t2.array(i3), s3.number.includes(r4) && t2.number(i3); - }); - }); - }(); - const e2 = t2.customScriptName ? t2.$0 : s2.path.basename(t2.$0), r3 = t2.getDemandedOptions(), o3 = t2.getDemandedCommands(), a3 = t2.getDeprecatedOptions(), h3 = t2.getGroups(), l3 = t2.getOptions(); - let g2 = []; - g2 = g2.concat(Object.keys(p2)), g2 = g2.concat(Object.keys(r3)), g2 = g2.concat(Object.keys(o3)), g2 = g2.concat(Object.keys(l3.default)), g2 = g2.filter(j2), g2 = Object.keys(g2.reduce((t3, e3) => ("_" !== e3 && (t3[e3] = true), t3), {})); - const y3 = v2(), b3 = s2.cliui({ width: y3, wrap: !!y3 }); - if (!f2) { - if (c2.length) - c2.forEach((t3) => { - b3.div({ text: `${t3[0].replace(/\$0/g, e2)}` }), t3[1] && b3.div({ text: `${t3[1]}`, padding: [1, 0, 0, 0] }); - }), b3.div(); - else if (u2.length) { - let t3 = null; - t3 = o3._ ? `${e2} <${i2("command")}> -` : `${e2} [${i2("command")}] -`, b3.div(`${t3}`); - } - } - if (u2.length > 1 || 1 === u2.length && !u2[0][2]) { - b3.div(i2("Commands:")); - const s3 = t2.getInternalMethods().getContext(), n3 = s3.commands.length ? `${s3.commands.join(" ")} ` : ""; - true === t2.getInternalMethods().getParserConfiguration()["sort-commands"] && (u2 = u2.sort((t3, e3) => t3[0].localeCompare(e3[0]))); - const r4 = e2 ? `${e2} ` : ""; - u2.forEach((t3) => { - const s4 = `${r4}${n3}${t3[0].replace(/^\$0 ?/, "")}`; - b3.span({ text: s4, padding: [0, 2, 0, 2], width: w2(u2, y3, `${e2}${n3}`) + 4 }, { text: t3[1] }); - const o4 = []; - t3[2] && o4.push(`[${i2("default")}]`), t3[3] && t3[3].length && o4.push(`[${i2("aliases:")} ${t3[3].join(", ")}]`), t3[4] && ("string" == typeof t3[4] ? o4.push(`[${i2("deprecated: %s", t3[4])}]`) : o4.push(`[${i2("deprecated")}]`)), o4.length ? b3.div({ text: o4.join(" "), padding: [0, 0, 0, 2], align: "right" }) : b3.div(); - }), b3.div(); - } - const M3 = (Object.keys(l3.alias) || []).concat(Object.keys(t2.parsed.newAliases) || []); - g2 = g2.filter((e3) => !t2.parsed.newAliases[e3] && M3.every((t3) => -1 === (l3.alias[t3] || []).indexOf(e3))); - const k3 = i2("Options:"); - h3[k3] || (h3[k3] = []), function(t3, e3, s3, i3) { - let n3 = [], r4 = null; - Object.keys(s3).forEach((t4) => { - n3 = n3.concat(s3[t4]); - }), t3.forEach((t4) => { - r4 = [t4].concat(e3[t4]), r4.some((t5) => -1 !== n3.indexOf(t5)) || s3[i3].push(t4); - }); - }(g2, l3.alias, h3, k3); - const x2 = (t3) => /^--/.test(I(t3)), E2 = Object.keys(h3).filter((t3) => h3[t3].length > 0).map((t3) => ({ groupName: t3, normalizedKeys: h3[t3].filter(j2).map((t4) => { - if (M3.includes(t4)) - return t4; - for (let e3, s3 = 0; void 0 !== (e3 = M3[s3]); s3++) - if ((l3.alias[e3] || []).includes(t4)) - return e3; - return t4; - }) })).filter(({ normalizedKeys: t3 }) => t3.length > 0).map(({ groupName: t3, normalizedKeys: e3 }) => { - const s3 = e3.reduce((e4, s4) => (e4[s4] = [s4].concat(l3.alias[s4] || []).map((e5) => t3 === n2.getPositionalGroupName() ? e5 : (/^[0-9]$/.test(e5) ? l3.boolean.includes(s4) ? "-" : "--" : e5.length > 1 ? "--" : "-") + e5).sort((t4, e5) => x2(t4) === x2(e5) ? 0 : x2(t4) ? 1 : -1).join(", "), e4), {}); - return { groupName: t3, normalizedKeys: e3, switches: s3 }; - }); - if (E2.filter(({ groupName: t3 }) => t3 !== n2.getPositionalGroupName()).some(({ normalizedKeys: t3, switches: e3 }) => !t3.every((t4) => x2(e3[t4]))) && E2.filter(({ groupName: t3 }) => t3 !== n2.getPositionalGroupName()).forEach(({ normalizedKeys: t3, switches: e3 }) => { - t3.forEach((t4) => { - var s3, i3; - x2(e3[t4]) && (e3[t4] = (s3 = e3[t4], i3 = "-x, ".length, S(s3) ? { text: s3.text, indentation: s3.indentation + i3 } : { text: s3, indentation: i3 })); - }); - }), E2.forEach(({ groupName: t3, normalizedKeys: e3, switches: s3 }) => { - b3.div(t3), e3.forEach((t4) => { - const e4 = s3[t4]; - let o4 = p2[t4] || "", h4 = null; - o4.includes(O2) && (o4 = i2(o4.substring(O2.length))), l3.boolean.includes(t4) && (h4 = `[${i2("boolean")}]`), l3.count.includes(t4) && (h4 = `[${i2("count")}]`), l3.string.includes(t4) && (h4 = `[${i2("string")}]`), l3.normalize.includes(t4) && (h4 = `[${i2("string")}]`), l3.array.includes(t4) && (h4 = `[${i2("array")}]`), l3.number.includes(t4) && (h4 = `[${i2("number")}]`); - const c3 = [t4 in a3 ? (f3 = a3[t4], "string" == typeof f3 ? `[${i2("deprecated: %s", f3)}]` : `[${i2("deprecated")}]`) : null, h4, t4 in r3 ? `[${i2("required")}]` : null, l3.choices && l3.choices[t4] ? `[${i2("choices:")} ${n2.stringifiedValues(l3.choices[t4])}]` : null, _2(l3.default[t4], l3.defaultDescription[t4])].filter(Boolean).join(" "); - var f3; - b3.span({ text: I(e4), padding: [0, 2, 0, 2 + $(e4)], width: w2(s3, y3) + 4 }, o4), c3 ? b3.div({ text: c3, padding: [0, 0, 0, 2], align: "right" }) : b3.div(); - }), b3.div(); - }), d2.length && (b3.div(i2("Examples:")), d2.forEach((t3) => { - t3[0] = t3[0].replace(/\$0/g, e2); - }), d2.forEach((t3) => { - "" === t3[1] ? b3.div({ text: t3[0], padding: [0, 2, 0, 2] }) : b3.div({ text: t3[0], padding: [0, 2, 0, 2], width: w2(d2, y3) + 4 }, { text: t3[1] }); - }), b3.div()), m2.length > 0) { - const t3 = m2.map((t4) => t4.replace(/\$0/g, e2)).join("\n"); - b3.div(`${t3} + "node_modules/yargs/build/index.cjs"(exports, module2) { + "use strict"; + var t = require("assert"); + var e = class extends Error { + constructor(t2) { + super(t2 || "yargs error"), + (this.name = "YError"), + Error.captureStackTrace(this, e); + } + }; + var s; + var i = []; + function n(t2, o2, a2, h2) { + s = h2; + let l2 = {}; + if (Object.prototype.hasOwnProperty.call(t2, "extends")) { + if ("string" != typeof t2.extends) return l2; + const r2 = /\.json|\..*rc$/.test(t2.extends); + let h3 = null; + if (r2) + h3 = (function (t3, e2) { + return s.path.resolve(t3, e2); + })(o2, t2.extends); + else + try { + h3 = require.resolve(t2.extends); + } catch (e2) { + return t2; + } + !(function (t3) { + if (i.indexOf(t3) > -1) + throw new e( + `Circular extended configurations: '${t3}'.`, + ); + })(h3), + i.push(h3), + (l2 = r2 + ? JSON.parse(s.readFileSync(h3, "utf8")) + : require(t2.extends)), + delete t2.extends, + (l2 = n(l2, s.path.dirname(h3), a2, s)); + } + return (i = []), a2 ? r(l2, t2) : Object.assign({}, l2, t2); + } + function r(t2, e2) { + const s2 = {}; + function i2(t3) { + return t3 && "object" == typeof t3 && !Array.isArray(t3); + } + Object.assign(s2, t2); + for (const n2 of Object.keys(e2)) + i2(e2[n2]) && i2(s2[n2]) + ? (s2[n2] = r(t2[n2], e2[n2])) + : (s2[n2] = e2[n2]); + return s2; + } + function o(t2) { + const e2 = t2.replace(/\s{2,}/g, " ").split(/\s+(?![^[]*]|[^<]*>)/), + s2 = /\.*[\][<>]/g, + i2 = e2.shift(); + if (!i2) throw new Error(`No command found in: ${t2}`); + const n2 = { cmd: i2.replace(s2, ""), demanded: [], optional: [] }; + return ( + e2.forEach((t3, i3) => { + let r2 = false; + (t3 = t3.replace(/\s/g, "")), + /\.+[\]>]/.test(t3) && + i3 === e2.length - 1 && + (r2 = true), + /^\[/.test(t3) + ? n2.optional.push({ + cmd: t3.replace(s2, "").split("|"), + variadic: r2, + }) + : n2.demanded.push({ + cmd: t3.replace(s2, "").split("|"), + variadic: r2, + }); + }), + n2 + ); + } + var a = ["first", "second", "third", "fourth", "fifth", "sixth"]; + function h(t2, s2, i2) { + try { + let n2 = 0; + const [r2, a2, h2] = + "object" == typeof t2 + ? [{ demanded: [], optional: [] }, t2, s2] + : [o(`cmd ${t2}`), s2, i2], + f2 = [].slice.call(a2); + for (; f2.length && void 0 === f2[f2.length - 1]; ) f2.pop(); + const d2 = h2 || f2.length; + if (d2 < r2.demanded.length) + throw new e( + `Not enough arguments provided. Expected ${r2.demanded.length} but received ${f2.length}.`, + ); + const u2 = r2.demanded.length + r2.optional.length; + if (d2 > u2) + throw new e( + `Too many arguments provided. Expected max ${u2} but received ${d2}.`, + ); + r2.demanded.forEach((t3) => { + const e2 = l(f2.shift()); + 0 === + t3.cmd.filter((t4) => t4 === e2 || "*" === t4).length && + c(e2, t3.cmd, n2), + (n2 += 1); + }), + r2.optional.forEach((t3) => { + if (0 === f2.length) return; + const e2 = l(f2.shift()); + 0 === + t3.cmd.filter((t4) => t4 === e2 || "*" === t4) + .length && c(e2, t3.cmd, n2), + (n2 += 1); + }); + } catch (t3) { + console.warn(t3.stack); + } + } + function l(t2) { + return Array.isArray(t2) + ? "array" + : null === t2 + ? "null" + : typeof t2; + } + function c(t2, s2, i2) { + throw new e( + `Invalid ${a[i2] || "manyith"} argument. Expected ${s2.join(" or ")} but received ${t2}.`, + ); + } + function f(t2) { + return !!t2 && !!t2.then && "function" == typeof t2.then; + } + function d(t2, e2, s2, i2) { + s2.assert.notStrictEqual(t2, e2, i2); + } + function u(t2, e2) { + e2.assert.strictEqual(typeof t2, "string"); + } + function p(t2) { + return Object.keys(t2); + } + function g(t2 = {}, e2 = () => true) { + const s2 = {}; + return ( + p(t2).forEach((i2) => { + e2(i2, t2[i2]) && (s2[i2] = t2[i2]); + }), + s2 + ); + } + function m() { + return process.versions.electron && !process.defaultApp ? 0 : 1; + } + function y() { + return process.argv[m()]; + } + var b = Object.freeze({ + __proto__: null, + hideBin: function (t2) { + return t2.slice(m() + 1); + }, + getProcessArgvBin: y, + }); + function v(t2, e2, s2, i2) { + if ("a" === s2 && !i2) + throw new TypeError( + "Private accessor was defined without a getter", + ); + if ("function" == typeof e2 ? t2 !== e2 || !i2 : !e2.has(t2)) + throw new TypeError( + "Cannot read private member from an object whose class did not declare it", + ); + return "m" === s2 + ? i2 + : "a" === s2 + ? i2.call(t2) + : i2 + ? i2.value + : e2.get(t2); + } + function O(t2, e2, s2, i2, n2) { + if ("m" === i2) + throw new TypeError("Private method is not writable"); + if ("a" === i2 && !n2) + throw new TypeError( + "Private accessor was defined without a setter", + ); + if ("function" == typeof e2 ? t2 !== e2 || !n2 : !e2.has(t2)) + throw new TypeError( + "Cannot write private member to an object whose class did not declare it", + ); + return ( + "a" === i2 + ? n2.call(t2, s2) + : n2 + ? (n2.value = s2) + : e2.set(t2, s2), + s2 + ); + } + var w = class { + constructor(t2) { + (this.globalMiddleware = []), + (this.frozens = []), + (this.yargs = t2); + } + addMiddleware(t2, e2, s2 = true, i2 = false) { + if ( + (h( + " [boolean] [boolean] [boolean]", + [t2, e2, s2], + arguments.length, + ), + Array.isArray(t2)) + ) { + for (let i3 = 0; i3 < t2.length; i3++) { + if ("function" != typeof t2[i3]) + throw Error("middleware must be a function"); + const n2 = t2[i3]; + (n2.applyBeforeValidation = e2), (n2.global = s2); + } + Array.prototype.push.apply(this.globalMiddleware, t2); + } else if ("function" == typeof t2) { + const n2 = t2; + (n2.applyBeforeValidation = e2), + (n2.global = s2), + (n2.mutates = i2), + this.globalMiddleware.push(t2); + } + return this.yargs; + } + addCoerceMiddleware(t2, e2) { + const s2 = this.yargs.getAliases(); + return ( + (this.globalMiddleware = this.globalMiddleware.filter( + (t3) => { + const i2 = [...(s2[e2] || []), e2]; + return !t3.option || !i2.includes(t3.option); + }, + )), + (t2.option = e2), + this.addMiddleware(t2, true, true, true) + ); + } + getMiddleware() { + return this.globalMiddleware; + } + freeze() { + this.frozens.push([...this.globalMiddleware]); + } + unfreeze() { + const t2 = this.frozens.pop(); + void 0 !== t2 && (this.globalMiddleware = t2); + } + reset() { + this.globalMiddleware = this.globalMiddleware.filter( + (t2) => t2.global, + ); + } + }; + function C(t2, e2, s2, i2) { + return s2.reduce((t3, s3) => { + if (s3.applyBeforeValidation !== i2) return t3; + if (s3.mutates) { + if (s3.applied) return t3; + s3.applied = true; + } + if (f(t3)) + return t3 + .then((t4) => Promise.all([t4, s3(t4, e2)])) + .then(([t4, e3]) => Object.assign(t4, e3)); + { + const i3 = s3(t3, e2); + return f(i3) + ? i3.then((e3) => Object.assign(t3, e3)) + : Object.assign(t3, i3); + } + }, t2); + } + function j( + t2, + e2, + s2 = (t3) => { + throw t3; + }, + ) { + try { + const s3 = "function" == typeof t2 ? t2() : t2; + return f(s3) ? s3.then((t3) => e2(t3)) : e2(s3); + } catch (t3) { + return s2(t3); + } + } + var _ = /(^\*)|(^\$0)/; + var M = class { + constructor(t2, e2, s2, i2) { + (this.requireCache = /* @__PURE__ */ new Set()), + (this.handlers = {}), + (this.aliasMap = {}), + (this.frozens = []), + (this.shim = i2), + (this.usage = t2), + (this.globalMiddleware = s2), + (this.validation = e2); + } + addDirectory(t2, e2, s2, i2) { + "boolean" != typeof (i2 = i2 || {}).recurse && + (i2.recurse = false), + Array.isArray(i2.extensions) || (i2.extensions = ["js"]); + const n2 = + "function" == typeof i2.visit ? i2.visit : (t3) => t3; + (i2.visit = (t3, e3, s3) => { + const i3 = n2(t3, e3, s3); + if (i3) { + if (this.requireCache.has(e3)) return i3; + this.requireCache.add(e3), this.addHandler(i3); + } + return i3; + }), + this.shim.requireDirectory( + { require: e2, filename: s2 }, + t2, + i2, + ); + } + addHandler(t2, e2, s2, i2, n2, r2) { + let a2 = []; + const h2 = (function (t3) { + return t3 + ? t3.map( + (t4) => ( + (t4.applyBeforeValidation = false), t4 + ), + ) + : []; + })(n2); + if (((i2 = i2 || (() => {})), Array.isArray(t2))) + if ( + (function (t3) { + return t3.every((t4) => "string" == typeof t4); + })(t2) + ) + [t2, ...a2] = t2; + else for (const e3 of t2) this.addHandler(e3); + else { + if ( + (function (t3) { + return "object" == typeof t3 && !Array.isArray(t3); + })(t2) + ) { + let e3 = + Array.isArray(t2.command) || + "string" == typeof t2.command + ? t2.command + : this.moduleName(t2); + return ( + t2.aliases && + (e3 = [].concat(e3).concat(t2.aliases)), + void this.addHandler( + e3, + this.extractDesc(t2), + t2.builder, + t2.handler, + t2.middlewares, + t2.deprecated, + ) + ); + } + if (k(s2)) + return void this.addHandler( + [t2].concat(a2), + e2, + s2.builder, + s2.handler, + s2.middlewares, + s2.deprecated, + ); + } + if ("string" == typeof t2) { + const n3 = o(t2); + a2 = a2.map((t3) => o(t3).cmd); + let l2 = false; + const c2 = [n3.cmd] + .concat(a2) + .filter((t3) => !_.test(t3) || ((l2 = true), false)); + 0 === c2.length && l2 && c2.push("$0"), + l2 && + ((n3.cmd = c2[0]), + (a2 = c2.slice(1)), + (t2 = t2.replace(_, n3.cmd))), + a2.forEach((t3) => { + this.aliasMap[t3] = n3.cmd; + }), + false !== e2 && this.usage.command(t2, e2, l2, a2, r2), + (this.handlers[n3.cmd] = { + original: t2, + description: e2, + handler: i2, + builder: s2 || {}, + middlewares: h2, + deprecated: r2, + demanded: n3.demanded, + optional: n3.optional, + }), + l2 && (this.defaultCommand = this.handlers[n3.cmd]); + } + } + getCommandHandlers() { + return this.handlers; + } + getCommands() { + return Object.keys(this.handlers).concat( + Object.keys(this.aliasMap), + ); + } + hasDefaultCommand() { + return !!this.defaultCommand; + } + runCommand(t2, e2, s2, i2, n2, r2) { + const o2 = + this.handlers[t2] || + this.handlers[this.aliasMap[t2]] || + this.defaultCommand, + a2 = e2.getInternalMethods().getContext(), + h2 = a2.commands.slice(), + l2 = !t2; + t2 && (a2.commands.push(t2), a2.fullCommands.push(o2.original)); + const c2 = this.applyBuilderUpdateUsageAndParse( + l2, + o2, + e2, + s2.aliases, + h2, + i2, + n2, + r2, + ); + return f(c2) + ? c2.then((t3) => + this.applyMiddlewareAndGetResult( + l2, + o2, + t3.innerArgv, + a2, + n2, + t3.aliases, + e2, + ), + ) + : this.applyMiddlewareAndGetResult( + l2, + o2, + c2.innerArgv, + a2, + n2, + c2.aliases, + e2, + ); + } + applyBuilderUpdateUsageAndParse(t2, e2, s2, i2, n2, r2, o2, a2) { + const h2 = e2.builder; + let l2 = s2; + if (x(h2)) { + const c2 = h2(s2.getInternalMethods().reset(i2), a2); + if (f(c2)) + return c2.then((i3) => { + var a3; + return ( + (l2 = + (a3 = i3) && + "function" == typeof a3.getInternalMethods + ? i3 + : s2), + this.parseAndUpdateUsage(t2, e2, l2, n2, r2, o2) + ); + }); + } else + (function (t3) { + return "object" == typeof t3; + })(h2) && + ((l2 = s2.getInternalMethods().reset(i2)), + Object.keys(e2.builder).forEach((t3) => { + l2.option(t3, h2[t3]); + })); + return this.parseAndUpdateUsage(t2, e2, l2, n2, r2, o2); + } + parseAndUpdateUsage(t2, e2, s2, i2, n2, r2) { + t2 && s2.getInternalMethods().getUsageInstance().unfreeze(true), + this.shouldUpdateUsage(s2) && + s2 + .getInternalMethods() + .getUsageInstance() + .usage( + this.usageFromParentCommandsCommandHandler( + i2, + e2, + ), + e2.description, + ); + const o2 = s2 + .getInternalMethods() + .runYargsParserAndExecuteCommands( + null, + void 0, + true, + n2, + r2, + ); + return f(o2) + ? o2.then((t3) => ({ + aliases: s2.parsed.aliases, + innerArgv: t3, + })) + : { aliases: s2.parsed.aliases, innerArgv: o2 }; + } + shouldUpdateUsage(t2) { + return ( + !t2 + .getInternalMethods() + .getUsageInstance() + .getUsageDisabled() && + 0 === + t2.getInternalMethods().getUsageInstance().getUsage() + .length + ); + } + usageFromParentCommandsCommandHandler(t2, e2) { + const s2 = _.test(e2.original) + ? e2.original.replace(_, "").trim() + : e2.original, + i2 = t2.filter((t3) => !_.test(t3)); + return i2.push(s2), `$0 ${i2.join(" ")}`; + } + applyMiddlewareAndGetResult(t2, e2, s2, i2, n2, r2, o2) { + let a2 = {}; + if (n2) return s2; + o2.getInternalMethods().getHasOutput() || + (a2 = this.populatePositionals(e2, s2, i2, o2)); + const h2 = this.globalMiddleware + .getMiddleware() + .slice(0) + .concat(e2.middlewares); + if ( + ((s2 = C(s2, o2, h2, true)), + !o2.getInternalMethods().getHasOutput()) + ) { + const e3 = o2 + .getInternalMethods() + .runValidation(r2, a2, o2.parsed.error, t2); + s2 = j(s2, (t3) => (e3(t3), t3)); + } + if (e2.handler && !o2.getInternalMethods().getHasOutput()) { + o2.getInternalMethods().setHasOutput(); + const i3 = !!o2.getOptions().configuration["populate--"]; + o2.getInternalMethods().postProcess(s2, i3, false, false), + (s2 = j((s2 = C(s2, o2, h2, false)), (t3) => { + const s3 = e2.handler(t3); + return f(s3) ? s3.then(() => t3) : t3; + })), + t2 || + o2 + .getInternalMethods() + .getUsageInstance() + .cacheHelpMessage(), + f(s2) && + !o2.getInternalMethods().hasParseCallback() && + s2.catch((t3) => { + try { + o2.getInternalMethods() + .getUsageInstance() + .fail(null, t3); + } catch (t4) {} + }); + } + return t2 || (i2.commands.pop(), i2.fullCommands.pop()), s2; + } + populatePositionals(t2, e2, s2, i2) { + e2._ = e2._.slice(s2.commands.length); + const n2 = t2.demanded.slice(0), + r2 = t2.optional.slice(0), + o2 = {}; + for ( + this.validation.positionalCount(n2.length, e2._.length); + n2.length; + + ) { + const t3 = n2.shift(); + this.populatePositional(t3, e2, o2); + } + for (; r2.length; ) { + const t3 = r2.shift(); + this.populatePositional(t3, e2, o2); + } + return ( + (e2._ = s2.commands.concat(e2._.map((t3) => "" + t3))), + this.postProcessPositionals( + e2, + o2, + this.cmdToParseOptions(t2.original), + i2, + ), + o2 + ); + } + populatePositional(t2, e2, s2) { + const i2 = t2.cmd[0]; + t2.variadic + ? (s2[i2] = e2._.splice(0).map(String)) + : e2._.length && (s2[i2] = [String(e2._.shift())]); + } + cmdToParseOptions(t2) { + const e2 = { array: [], default: {}, alias: {}, demand: {} }, + s2 = o(t2); + return ( + s2.demanded.forEach((t3) => { + const [s3, ...i2] = t3.cmd; + t3.variadic && + (e2.array.push(s3), (e2.default[s3] = [])), + (e2.alias[s3] = i2), + (e2.demand[s3] = true); + }), + s2.optional.forEach((t3) => { + const [s3, ...i2] = t3.cmd; + t3.variadic && + (e2.array.push(s3), (e2.default[s3] = [])), + (e2.alias[s3] = i2); + }), + e2 + ); + } + postProcessPositionals(t2, e2, s2, i2) { + const n2 = Object.assign({}, i2.getOptions()); + n2.default = Object.assign(s2.default, n2.default); + for (const t3 of Object.keys(s2.alias)) + n2.alias[t3] = (n2.alias[t3] || []).concat(s2.alias[t3]); + (n2.array = n2.array.concat(s2.array)), (n2.config = {}); + const r2 = []; + if ( + (Object.keys(e2).forEach((t3) => { + e2[t3].map((e3) => { + n2.configuration["unknown-options-as-args"] && + (n2.key[t3] = true), + r2.push(`--${t3}`), + r2.push(e3); + }); + }), + !r2.length) + ) + return; + const o2 = Object.assign({}, n2.configuration, { + "populate--": false, + }), + a2 = this.shim.Parser.detailed( + r2, + Object.assign({}, n2, { configuration: o2 }), + ); + if (a2.error) + i2.getInternalMethods() + .getUsageInstance() + .fail(a2.error.message, a2.error); + else { + const s3 = Object.keys(e2); + Object.keys(e2).forEach((t3) => { + s3.push(...a2.aliases[t3]); + }); + const n3 = i2.getOptions().default; + Object.keys(a2.argv).forEach((i3) => { + s3.includes(i3) && + (e2[i3] || (e2[i3] = a2.argv[i3]), + !Object.hasOwnProperty.call(n3, i3) && + Object.hasOwnProperty.call(t2, i3) && + Object.hasOwnProperty.call(a2.argv, i3) && + (Array.isArray(t2[i3]) || + Array.isArray(a2.argv[i3])) + ? (t2[i3] = [].concat(t2[i3], a2.argv[i3])) + : (t2[i3] = a2.argv[i3])); + }); + } + } + runDefaultBuilderOn(t2) { + if (!this.defaultCommand) return; + if (this.shouldUpdateUsage(t2)) { + const e3 = _.test(this.defaultCommand.original) + ? this.defaultCommand.original + : this.defaultCommand.original.replace( + /^[^[\]<>]*/, + "$0 ", + ); + t2.getInternalMethods() + .getUsageInstance() + .usage(e3, this.defaultCommand.description); + } + const e2 = this.defaultCommand.builder; + if (x(e2)) return e2(t2, true); + k(e2) || + Object.keys(e2).forEach((s2) => { + t2.option(s2, e2[s2]); + }); + } + moduleName(t2) { + const e2 = (function (t3) { + if ("undefined" == typeof require) return null; + for ( + let e3, s2 = 0, i2 = Object.keys(require.cache); + s2 < i2.length; + s2++ + ) + if (((e3 = require.cache[i2[s2]]), e3.exports === t3)) + return e3; + return null; + })(t2); + if (!e2) + throw new Error( + `No command name given for module: ${this.shim.inspect(t2)}`, + ); + return this.commandFromFilename(e2.filename); + } + commandFromFilename(t2) { + return this.shim.path.basename(t2, this.shim.path.extname(t2)); + } + extractDesc({ describe: t2, description: e2, desc: s2 }) { + for (const i2 of [t2, e2, s2]) { + if ("string" == typeof i2 || false === i2) return i2; + d(i2, true, this.shim); + } + return false; + } + freeze() { + this.frozens.push({ + handlers: this.handlers, + aliasMap: this.aliasMap, + defaultCommand: this.defaultCommand, + }); + } + unfreeze() { + const t2 = this.frozens.pop(); + d(t2, void 0, this.shim), + ({ + handlers: this.handlers, + aliasMap: this.aliasMap, + defaultCommand: this.defaultCommand, + } = t2); + } + reset() { + return ( + (this.handlers = {}), + (this.aliasMap = {}), + (this.defaultCommand = void 0), + (this.requireCache = /* @__PURE__ */ new Set()), + this + ); + } + }; + function k(t2) { + return ( + "object" == typeof t2 && + !!t2.builder && + "function" == typeof t2.handler + ); + } + function x(t2) { + return "function" == typeof t2; + } + function E(t2) { + "undefined" != typeof process && + [process.stdout, process.stderr].forEach((e2) => { + const s2 = e2; + s2._handle && + s2.isTTY && + "function" == typeof s2._handle.setBlocking && + s2._handle.setBlocking(t2); + }); + } + function A(t2) { + return "boolean" == typeof t2; + } + function P(t2, s2) { + const i2 = s2.y18n.__, + n2 = {}, + r2 = []; + n2.failFn = function (t3) { + r2.push(t3); + }; + let o2 = null, + a2 = null, + h2 = true; + n2.showHelpOnFail = function (e2 = true, s3) { + const [i3, r3] = "string" == typeof e2 ? [true, e2] : [e2, s3]; + return ( + t2.getInternalMethods().isGlobalContext() && (a2 = r3), + (o2 = r3), + (h2 = i3), + n2 + ); + }; + let l2 = false; + n2.fail = function (s3, i3) { + const c3 = t2.getInternalMethods().getLoggerInstance(); + if (!r2.length) { + if ((t2.getExitProcess() && E(true), !l2)) { + (l2 = true), + h2 && (t2.showHelp("error"), c3.error()), + (s3 || i3) && c3.error(s3 || i3); + const e2 = o2 || a2; + e2 && ((s3 || i3) && c3.error(""), c3.error(e2)); + } + if (((i3 = i3 || new e(s3)), t2.getExitProcess())) + return t2.exit(1); + if (t2.getInternalMethods().hasParseCallback()) + return t2.exit(1, i3); + throw i3; + } + for (let t3 = r2.length - 1; t3 >= 0; --t3) { + const e2 = r2[t3]; + if (A(e2)) { + if (i3) throw i3; + if (s3) throw Error(s3); + } else e2(s3, i3, n2); + } + }; + let c2 = [], + f2 = false; + (n2.usage = (t3, e2) => + null === t3 + ? ((f2 = true), (c2 = []), n2) + : ((f2 = false), c2.push([t3, e2 || ""]), n2)), + (n2.getUsage = () => c2), + (n2.getUsageDisabled = () => f2), + (n2.getPositionalGroupName = () => i2("Positionals:")); + let d2 = []; + n2.example = (t3, e2) => { + d2.push([t3, e2 || ""]); + }; + let u2 = []; + (n2.command = function (t3, e2, s3, i3, n3 = false) { + s3 && (u2 = u2.map((t4) => ((t4[2] = false), t4))), + u2.push([t3, e2 || "", s3, i3, n3]); + }), + (n2.getCommands = () => u2); + let p2 = {}; + (n2.describe = function (t3, e2) { + Array.isArray(t3) + ? t3.forEach((t4) => { + n2.describe(t4, e2); + }) + : "object" == typeof t3 + ? Object.keys(t3).forEach((e3) => { + n2.describe(e3, t3[e3]); + }) + : (p2[t3] = e2); + }), + (n2.getDescriptions = () => p2); + let m2 = []; + n2.epilog = (t3) => { + m2.push(t3); + }; + let y2, + b2 = false; + function v2() { + return ( + b2 || + ((y2 = (function () { + const t3 = 80; + return s2.process.stdColumns + ? Math.min(t3, s2.process.stdColumns) + : t3; + })()), + (b2 = true)), + y2 + ); + } + n2.wrap = (t3) => { + (b2 = true), (y2 = t3); + }; + const O2 = "__yargsString__:"; + function w2(t3, e2, i3) { + let n3 = 0; + return ( + Array.isArray(t3) || + (t3 = Object.values(t3).map((t4) => [t4])), + t3.forEach((t4) => { + n3 = Math.max( + s2.stringWidth( + i3 ? `${i3} ${I(t4[0])}` : I(t4[0]), + ) + $(t4[0]), + n3, + ); + }), + e2 && + (n3 = Math.min( + n3, + parseInt((0.5 * e2).toString(), 10), + )), + n3 + ); + } + let C2; + function j2(e2) { + return ( + t2.getOptions().hiddenOptions.indexOf(e2) < 0 || + t2.parsed.argv[t2.getOptions().showHiddenOpt] + ); + } + function _2(t3, e2) { + let s3 = `[${i2("default:")} `; + if (void 0 === t3 && !e2) return null; + if (e2) s3 += e2; + else + switch (typeof t3) { + case "string": + s3 += `"${t3}"`; + break; + case "object": + s3 += JSON.stringify(t3); + break; + default: + s3 += t3; + } + return `${s3}]`; + } + (n2.deferY18nLookup = (t3) => O2 + t3), + (n2.help = function () { + if (C2) return C2; + !(function () { + const e3 = t2.getDemandedOptions(), + s3 = t2.getOptions(); + (Object.keys(s3.alias) || []).forEach((i3) => { + s3.alias[i3].forEach((r4) => { + p2[r4] && n2.describe(i3, p2[r4]), + r4 in e3 && t2.demandOption(i3, e3[r4]), + s3.boolean.includes(r4) && t2.boolean(i3), + s3.count.includes(r4) && t2.count(i3), + s3.string.includes(r4) && t2.string(i3), + s3.normalize.includes(r4) && + t2.normalize(i3), + s3.array.includes(r4) && t2.array(i3), + s3.number.includes(r4) && t2.number(i3); + }); + }); + })(); + const e2 = t2.customScriptName + ? t2.$0 + : s2.path.basename(t2.$0), + r3 = t2.getDemandedOptions(), + o3 = t2.getDemandedCommands(), + a3 = t2.getDeprecatedOptions(), + h3 = t2.getGroups(), + l3 = t2.getOptions(); + let g2 = []; + (g2 = g2.concat(Object.keys(p2))), + (g2 = g2.concat(Object.keys(r3))), + (g2 = g2.concat(Object.keys(o3))), + (g2 = g2.concat(Object.keys(l3.default))), + (g2 = g2.filter(j2)), + (g2 = Object.keys( + g2.reduce( + (t3, e3) => ("_" !== e3 && (t3[e3] = true), t3), + {}, + ), + )); + const y3 = v2(), + b3 = s2.cliui({ width: y3, wrap: !!y3 }); + if (!f2) { + if (c2.length) + c2.forEach((t3) => { + b3.div({ + text: `${t3[0].replace(/\$0/g, e2)}`, + }), + t3[1] && + b3.div({ + text: `${t3[1]}`, + padding: [1, 0, 0, 0], + }); + }), + b3.div(); + else if (u2.length) { + let t3 = null; + (t3 = o3._ + ? `${e2} <${i2("command")}> +` + : `${e2} [${i2("command")}] +`), + b3.div(`${t3}`); + } + } + if (u2.length > 1 || (1 === u2.length && !u2[0][2])) { + b3.div(i2("Commands:")); + const s3 = t2.getInternalMethods().getContext(), + n3 = s3.commands.length + ? `${s3.commands.join(" ")} ` + : ""; + true === + t2.getInternalMethods().getParserConfiguration()[ + "sort-commands" + ] && + (u2 = u2.sort((t3, e3) => + t3[0].localeCompare(e3[0]), + )); + const r4 = e2 ? `${e2} ` : ""; + u2.forEach((t3) => { + const s4 = `${r4}${n3}${t3[0].replace(/^\$0 ?/, "")}`; + b3.span( + { + text: s4, + padding: [0, 2, 0, 2], + width: w2(u2, y3, `${e2}${n3}`) + 4, + }, + { text: t3[1] }, + ); + const o4 = []; + t3[2] && o4.push(`[${i2("default")}]`), + t3[3] && + t3[3].length && + o4.push( + `[${i2("aliases:")} ${t3[3].join(", ")}]`, + ), + t3[4] && + ("string" == typeof t3[4] + ? o4.push( + `[${i2("deprecated: %s", t3[4])}]`, + ) + : o4.push(`[${i2("deprecated")}]`)), + o4.length + ? b3.div({ + text: o4.join(" "), + padding: [0, 0, 0, 2], + align: "right", + }) + : b3.div(); + }), + b3.div(); + } + const M3 = (Object.keys(l3.alias) || []).concat( + Object.keys(t2.parsed.newAliases) || [], + ); + g2 = g2.filter( + (e3) => + !t2.parsed.newAliases[e3] && + M3.every( + (t3) => -1 === (l3.alias[t3] || []).indexOf(e3), + ), + ); + const k3 = i2("Options:"); + h3[k3] || (h3[k3] = []), + (function (t3, e3, s3, i3) { + let n3 = [], + r4 = null; + Object.keys(s3).forEach((t4) => { + n3 = n3.concat(s3[t4]); + }), + t3.forEach((t4) => { + (r4 = [t4].concat(e3[t4])), + r4.some( + (t5) => -1 !== n3.indexOf(t5), + ) || s3[i3].push(t4); + }); + })(g2, l3.alias, h3, k3); + const x2 = (t3) => /^--/.test(I(t3)), + E2 = Object.keys(h3) + .filter((t3) => h3[t3].length > 0) + .map((t3) => ({ + groupName: t3, + normalizedKeys: h3[t3].filter(j2).map((t4) => { + if (M3.includes(t4)) return t4; + for ( + let e3, s3 = 0; + void 0 !== (e3 = M3[s3]); + s3++ + ) + if ((l3.alias[e3] || []).includes(t4)) + return e3; + return t4; + }), + })) + .filter(({ normalizedKeys: t3 }) => t3.length > 0) + .map(({ groupName: t3, normalizedKeys: e3 }) => { + const s3 = e3.reduce( + (e4, s4) => ( + (e4[s4] = [s4] + .concat(l3.alias[s4] || []) + .map((e5) => + t3 === + n2.getPositionalGroupName() + ? e5 + : (/^[0-9]$/.test(e5) + ? l3.boolean.includes( + s4, + ) + ? "-" + : "--" + : e5.length > 1 + ? "--" + : "-") + e5, + ) + .sort((t4, e5) => + x2(t4) === x2(e5) + ? 0 + : x2(t4) + ? 1 + : -1, + ) + .join(", ")), + e4 + ), + {}, + ); + return { + groupName: t3, + normalizedKeys: e3, + switches: s3, + }; + }); + if ( + (E2.filter( + ({ groupName: t3 }) => + t3 !== n2.getPositionalGroupName(), + ).some( + ({ normalizedKeys: t3, switches: e3 }) => + !t3.every((t4) => x2(e3[t4])), + ) && + E2.filter( + ({ groupName: t3 }) => + t3 !== n2.getPositionalGroupName(), + ).forEach( + ({ normalizedKeys: t3, switches: e3 }) => { + t3.forEach((t4) => { + var s3, i3; + x2(e3[t4]) && + (e3[t4] = + ((s3 = e3[t4]), + (i3 = "-x, ".length), + S(s3) + ? { + text: s3.text, + indentation: + s3.indentation + + i3, + } + : { + text: s3, + indentation: i3, + })); + }); + }, + ), + E2.forEach( + ({ + groupName: t3, + normalizedKeys: e3, + switches: s3, + }) => { + b3.div(t3), + e3.forEach((t4) => { + const e4 = s3[t4]; + let o4 = p2[t4] || "", + h4 = null; + o4.includes(O2) && + (o4 = i2(o4.substring(O2.length))), + l3.boolean.includes(t4) && + (h4 = `[${i2("boolean")}]`), + l3.count.includes(t4) && + (h4 = `[${i2("count")}]`), + l3.string.includes(t4) && + (h4 = `[${i2("string")}]`), + l3.normalize.includes(t4) && + (h4 = `[${i2("string")}]`), + l3.array.includes(t4) && + (h4 = `[${i2("array")}]`), + l3.number.includes(t4) && + (h4 = `[${i2("number")}]`); + const c3 = [ + t4 in a3 + ? ((f3 = a3[t4]), + "string" == typeof f3 + ? `[${i2("deprecated: %s", f3)}]` + : `[${i2("deprecated")}]`) + : null, + h4, + t4 in r3 + ? `[${i2("required")}]` + : null, + l3.choices && l3.choices[t4] + ? `[${i2("choices:")} ${n2.stringifiedValues(l3.choices[t4])}]` + : null, + _2( + l3.default[t4], + l3.defaultDescription[t4], + ), + ] + .filter(Boolean) + .join(" "); + var f3; + b3.span( + { + text: I(e4), + padding: [0, 2, 0, 2 + $(e4)], + width: w2(s3, y3) + 4, + }, + o4, + ), + c3 + ? b3.div({ + text: c3, + padding: [0, 0, 0, 2], + align: "right", + }) + : b3.div(); + }), + b3.div(); + }, + ), + d2.length && + (b3.div(i2("Examples:")), + d2.forEach((t3) => { + t3[0] = t3[0].replace(/\$0/g, e2); + }), + d2.forEach((t3) => { + "" === t3[1] + ? b3.div({ + text: t3[0], + padding: [0, 2, 0, 2], + }) + : b3.div( + { + text: t3[0], + padding: [0, 2, 0, 2], + width: w2(d2, y3) + 4, + }, + { text: t3[1] }, + ); + }), + b3.div()), + m2.length > 0) + ) { + const t3 = m2 + .map((t4) => t4.replace(/\$0/g, e2)) + .join("\n"); + b3.div(`${t3} `); - } - return b3.toString().replace(/\s*$/, ""); - }, n2.cacheHelpMessage = function() { - C2 = this.help(); - }, n2.clearCachedHelpMessage = function() { - C2 = void 0; - }, n2.hasCachedHelpMessage = function() { - return !!C2; - }, n2.showHelp = (e2) => { - const s3 = t2.getInternalMethods().getLoggerInstance(); - e2 || (e2 = "error"); - ("function" == typeof e2 ? e2 : s3[e2])(n2.help()); - }, n2.functionDescription = (t3) => ["(", t3.name ? s2.Parser.decamelize(t3.name, "-") : i2("generated-value"), ")"].join(""), n2.stringifiedValues = function(t3, e2) { - let s3 = ""; - const i3 = e2 || ", ", n3 = [].concat(t3); - return t3 && n3.length ? (n3.forEach((t4) => { - s3.length && (s3 += i3), s3 += JSON.stringify(t4); - }), s3) : s3; - }; - let M2 = null; - n2.version = (t3) => { - M2 = t3; - }, n2.showVersion = (e2) => { - const s3 = t2.getInternalMethods().getLoggerInstance(); - e2 || (e2 = "error"); - ("function" == typeof e2 ? e2 : s3[e2])(M2); - }, n2.reset = function(t3) { - return o2 = null, l2 = false, c2 = [], f2 = false, m2 = [], d2 = [], u2 = [], p2 = g(p2, (e2) => !t3[e2]), n2; - }; - const k2 = []; - return n2.freeze = function() { - k2.push({ failMessage: o2, failureOutput: l2, usages: c2, usageDisabled: f2, epilogs: m2, examples: d2, commands: u2, descriptions: p2 }); - }, n2.unfreeze = function(t3 = false) { - const e2 = k2.pop(); - e2 && (t3 ? (p2 = { ...e2.descriptions, ...p2 }, u2 = [...e2.commands, ...u2], c2 = [...e2.usages, ...c2], d2 = [...e2.examples, ...d2], m2 = [...e2.epilogs, ...m2]) : { failMessage: o2, failureOutput: l2, usages: c2, usageDisabled: f2, epilogs: m2, examples: d2, commands: u2, descriptions: p2 } = e2); - }, n2; - } - function S(t2) { - return "object" == typeof t2; - } - function $(t2) { - return S(t2) ? t2.indentation : 0; - } - function I(t2) { - return S(t2) ? t2.text : t2; - } - var N = class { - constructor(t2, e2, s2, i2) { - var n2, r2, o2; - this.yargs = t2, this.usage = e2, this.command = s2, this.shim = i2, this.completionKey = "get-yargs-completions", this.aliases = null, this.customCompletionFunction = null, this.indexAfterLastReset = 0, this.zshShell = null !== (o2 = (null === (n2 = this.shim.getEnv("SHELL")) || void 0 === n2 ? void 0 : n2.includes("zsh")) || (null === (r2 = this.shim.getEnv("ZSH_NAME")) || void 0 === r2 ? void 0 : r2.includes("zsh"))) && void 0 !== o2 && o2; - } - defaultCompletion(t2, e2, s2, i2) { - const n2 = this.command.getCommandHandlers(); - for (let e3 = 0, s3 = t2.length; e3 < s3; ++e3) - if (n2[t2[e3]] && n2[t2[e3]].builder) { - const s4 = n2[t2[e3]].builder; - if (x(s4)) { - this.indexAfterLastReset = e3 + 1; - const t3 = this.yargs.getInternalMethods().reset(); - return s4(t3, true), t3.argv; - } - } - const r2 = []; - this.commandCompletions(r2, t2, s2), this.optionCompletions(r2, t2, e2, s2), this.choicesFromOptionsCompletions(r2, t2, e2, s2), this.choicesFromPositionalsCompletions(r2, t2, e2, s2), i2(null, r2); - } - commandCompletions(t2, e2, s2) { - const i2 = this.yargs.getInternalMethods().getContext().commands; - s2.match(/^-/) || i2[i2.length - 1] === s2 || this.previousArgHasChoices(e2) || this.usage.getCommands().forEach((s3) => { - const i3 = o(s3[0]).cmd; - if (-1 === e2.indexOf(i3)) - if (this.zshShell) { - const e3 = s3[1] || ""; - t2.push(i3.replace(/:/g, "\\:") + ":" + e3); - } else - t2.push(i3); - }); - } - optionCompletions(t2, e2, s2, i2) { - if ((i2.match(/^-/) || "" === i2 && 0 === t2.length) && !this.previousArgHasChoices(e2)) { - const n2 = this.yargs.getOptions(), r2 = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || []; - Object.keys(n2.key).forEach((o2) => { - const a2 = !!n2.configuration["boolean-negation"] && n2.boolean.includes(o2); - r2.includes(o2) || n2.hiddenOptions.includes(o2) || this.argsContainKey(e2, s2, o2, a2) || (this.completeOptionKey(o2, t2, i2), a2 && n2.default[o2] && this.completeOptionKey(`no-${o2}`, t2, i2)); - }); - } - } - choicesFromOptionsCompletions(t2, e2, s2, i2) { - if (this.previousArgHasChoices(e2)) { - const s3 = this.getPreviousArgChoices(e2); - s3 && s3.length > 0 && t2.push(...s3.map((t3) => t3.replace(/:/g, "\\:"))); - } - } - choicesFromPositionalsCompletions(t2, e2, s2, i2) { - if ("" === i2 && t2.length > 0 && this.previousArgHasChoices(e2)) - return; - const n2 = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [], r2 = Math.max(this.indexAfterLastReset, this.yargs.getInternalMethods().getContext().commands.length + 1), o2 = n2[s2._.length - r2 - 1]; - if (!o2) - return; - const a2 = this.yargs.getOptions().choices[o2] || []; - for (const e3 of a2) - e3.startsWith(i2) && t2.push(e3.replace(/:/g, "\\:")); - } - getPreviousArgChoices(t2) { - if (t2.length < 1) - return; - let e2 = t2[t2.length - 1], s2 = ""; - if (!e2.startsWith("-") && t2.length > 1 && (s2 = e2, e2 = t2[t2.length - 2]), !e2.startsWith("-")) - return; - const i2 = e2.replace(/^-+/, ""), n2 = this.yargs.getOptions(), r2 = [i2, ...this.yargs.getAliases()[i2] || []]; - let o2; - for (const t3 of r2) - if (Object.prototype.hasOwnProperty.call(n2.key, t3) && Array.isArray(n2.choices[t3])) { - o2 = n2.choices[t3]; - break; - } - return o2 ? o2.filter((t3) => !s2 || t3.startsWith(s2)) : void 0; - } - previousArgHasChoices(t2) { - const e2 = this.getPreviousArgChoices(t2); - return void 0 !== e2 && e2.length > 0; - } - argsContainKey(t2, e2, s2, i2) { - if (-1 !== t2.indexOf(`--${s2}`)) - return true; - if (i2 && -1 !== t2.indexOf(`--no-${s2}`)) - return true; - if (this.aliases) { - for (const t3 of this.aliases[s2]) - if (void 0 !== e2[t3]) - return true; - } - return false; - } - completeOptionKey(t2, e2, s2) { - const i2 = this.usage.getDescriptions(), n2 = !/^--/.test(s2) && ((t3) => /^[^0-9]$/.test(t3))(t2) ? "-" : "--"; - if (this.zshShell) { - const s3 = i2[t2] || ""; - e2.push(n2 + `${t2.replace(/:/g, "\\:")}:${s3.replace("__yargsString__:", "")}`); - } else - e2.push(n2 + t2); - } - customCompletion(t2, e2, s2, i2) { - if (d(this.customCompletionFunction, null, this.shim), this.customCompletionFunction.length < 3) { - const t3 = this.customCompletionFunction(s2, e2); - return f(t3) ? t3.then((t4) => { - this.shim.process.nextTick(() => { - i2(null, t4); - }); - }).catch((t4) => { - this.shim.process.nextTick(() => { - i2(t4, void 0); - }); - }) : i2(null, t3); - } - return function(t3) { - return t3.length > 3; - }(this.customCompletionFunction) ? this.customCompletionFunction(s2, e2, (n2 = i2) => this.defaultCompletion(t2, e2, s2, n2), (t3) => { - i2(null, t3); - }) : this.customCompletionFunction(s2, e2, (t3) => { - i2(null, t3); - }); - } - getCompletion(t2, e2) { - const s2 = t2.length ? t2[t2.length - 1] : "", i2 = this.yargs.parse(t2, true), n2 = this.customCompletionFunction ? (i3) => this.customCompletion(t2, i3, s2, e2) : (i3) => this.defaultCompletion(t2, i3, s2, e2); - return f(i2) ? i2.then(n2) : n2(i2); - } - generateCompletionScript(t2, e2) { - let s2 = this.zshShell ? `#compdef {{app_name}} + } + return b3.toString().replace(/\s*$/, ""); + }), + (n2.cacheHelpMessage = function () { + C2 = this.help(); + }), + (n2.clearCachedHelpMessage = function () { + C2 = void 0; + }), + (n2.hasCachedHelpMessage = function () { + return !!C2; + }), + (n2.showHelp = (e2) => { + const s3 = t2.getInternalMethods().getLoggerInstance(); + e2 || (e2 = "error"); + ("function" == typeof e2 ? e2 : s3[e2])(n2.help()); + }), + (n2.functionDescription = (t3) => + [ + "(", + t3.name + ? s2.Parser.decamelize(t3.name, "-") + : i2("generated-value"), + ")", + ].join("")), + (n2.stringifiedValues = function (t3, e2) { + let s3 = ""; + const i3 = e2 || ", ", + n3 = [].concat(t3); + return t3 && n3.length + ? (n3.forEach((t4) => { + s3.length && (s3 += i3), + (s3 += JSON.stringify(t4)); + }), + s3) + : s3; + }); + let M2 = null; + (n2.version = (t3) => { + M2 = t3; + }), + (n2.showVersion = (e2) => { + const s3 = t2.getInternalMethods().getLoggerInstance(); + e2 || (e2 = "error"); + ("function" == typeof e2 ? e2 : s3[e2])(M2); + }), + (n2.reset = function (t3) { + return ( + (o2 = null), + (l2 = false), + (c2 = []), + (f2 = false), + (m2 = []), + (d2 = []), + (u2 = []), + (p2 = g(p2, (e2) => !t3[e2])), + n2 + ); + }); + const k2 = []; + return ( + (n2.freeze = function () { + k2.push({ + failMessage: o2, + failureOutput: l2, + usages: c2, + usageDisabled: f2, + epilogs: m2, + examples: d2, + commands: u2, + descriptions: p2, + }); + }), + (n2.unfreeze = function (t3 = false) { + const e2 = k2.pop(); + e2 && + (t3 + ? ((p2 = { ...e2.descriptions, ...p2 }), + (u2 = [...e2.commands, ...u2]), + (c2 = [...e2.usages, ...c2]), + (d2 = [...e2.examples, ...d2]), + (m2 = [...e2.epilogs, ...m2])) + : ({ + failMessage: o2, + failureOutput: l2, + usages: c2, + usageDisabled: f2, + epilogs: m2, + examples: d2, + commands: u2, + descriptions: p2, + } = e2)); + }), + n2 + ); + } + function S(t2) { + return "object" == typeof t2; + } + function $(t2) { + return S(t2) ? t2.indentation : 0; + } + function I(t2) { + return S(t2) ? t2.text : t2; + } + var N = class { + constructor(t2, e2, s2, i2) { + var n2, r2, o2; + (this.yargs = t2), + (this.usage = e2), + (this.command = s2), + (this.shim = i2), + (this.completionKey = "get-yargs-completions"), + (this.aliases = null), + (this.customCompletionFunction = null), + (this.indexAfterLastReset = 0), + (this.zshShell = + null !== + (o2 = + (null === (n2 = this.shim.getEnv("SHELL")) || + void 0 === n2 + ? void 0 + : n2.includes("zsh")) || + (null === (r2 = this.shim.getEnv("ZSH_NAME")) || + void 0 === r2 + ? void 0 + : r2.includes("zsh"))) && + void 0 !== o2 && + o2); + } + defaultCompletion(t2, e2, s2, i2) { + const n2 = this.command.getCommandHandlers(); + for (let e3 = 0, s3 = t2.length; e3 < s3; ++e3) + if (n2[t2[e3]] && n2[t2[e3]].builder) { + const s4 = n2[t2[e3]].builder; + if (x(s4)) { + this.indexAfterLastReset = e3 + 1; + const t3 = this.yargs.getInternalMethods().reset(); + return s4(t3, true), t3.argv; + } + } + const r2 = []; + this.commandCompletions(r2, t2, s2), + this.optionCompletions(r2, t2, e2, s2), + this.choicesFromOptionsCompletions(r2, t2, e2, s2), + this.choicesFromPositionalsCompletions(r2, t2, e2, s2), + i2(null, r2); + } + commandCompletions(t2, e2, s2) { + const i2 = this.yargs + .getInternalMethods() + .getContext().commands; + s2.match(/^-/) || + i2[i2.length - 1] === s2 || + this.previousArgHasChoices(e2) || + this.usage.getCommands().forEach((s3) => { + const i3 = o(s3[0]).cmd; + if (-1 === e2.indexOf(i3)) + if (this.zshShell) { + const e3 = s3[1] || ""; + t2.push(i3.replace(/:/g, "\\:") + ":" + e3); + } else t2.push(i3); + }); + } + optionCompletions(t2, e2, s2, i2) { + if ( + (i2.match(/^-/) || ("" === i2 && 0 === t2.length)) && + !this.previousArgHasChoices(e2) + ) { + const n2 = this.yargs.getOptions(), + r2 = + this.yargs.getGroups()[ + this.usage.getPositionalGroupName() + ] || []; + Object.keys(n2.key).forEach((o2) => { + const a2 = + !!n2.configuration["boolean-negation"] && + n2.boolean.includes(o2); + r2.includes(o2) || + n2.hiddenOptions.includes(o2) || + this.argsContainKey(e2, s2, o2, a2) || + (this.completeOptionKey(o2, t2, i2), + a2 && + n2.default[o2] && + this.completeOptionKey(`no-${o2}`, t2, i2)); + }); + } + } + choicesFromOptionsCompletions(t2, e2, s2, i2) { + if (this.previousArgHasChoices(e2)) { + const s3 = this.getPreviousArgChoices(e2); + s3 && + s3.length > 0 && + t2.push(...s3.map((t3) => t3.replace(/:/g, "\\:"))); + } + } + choicesFromPositionalsCompletions(t2, e2, s2, i2) { + if ( + "" === i2 && + t2.length > 0 && + this.previousArgHasChoices(e2) + ) + return; + const n2 = + this.yargs.getGroups()[ + this.usage.getPositionalGroupName() + ] || [], + r2 = Math.max( + this.indexAfterLastReset, + this.yargs.getInternalMethods().getContext().commands + .length + 1, + ), + o2 = n2[s2._.length - r2 - 1]; + if (!o2) return; + const a2 = this.yargs.getOptions().choices[o2] || []; + for (const e3 of a2) + e3.startsWith(i2) && t2.push(e3.replace(/:/g, "\\:")); + } + getPreviousArgChoices(t2) { + if (t2.length < 1) return; + let e2 = t2[t2.length - 1], + s2 = ""; + if ( + (!e2.startsWith("-") && + t2.length > 1 && + ((s2 = e2), (e2 = t2[t2.length - 2])), + !e2.startsWith("-")) + ) + return; + const i2 = e2.replace(/^-+/, ""), + n2 = this.yargs.getOptions(), + r2 = [i2, ...(this.yargs.getAliases()[i2] || [])]; + let o2; + for (const t3 of r2) + if ( + Object.prototype.hasOwnProperty.call(n2.key, t3) && + Array.isArray(n2.choices[t3]) + ) { + o2 = n2.choices[t3]; + break; + } + return o2 + ? o2.filter((t3) => !s2 || t3.startsWith(s2)) + : void 0; + } + previousArgHasChoices(t2) { + const e2 = this.getPreviousArgChoices(t2); + return void 0 !== e2 && e2.length > 0; + } + argsContainKey(t2, e2, s2, i2) { + if (-1 !== t2.indexOf(`--${s2}`)) return true; + if (i2 && -1 !== t2.indexOf(`--no-${s2}`)) return true; + if (this.aliases) { + for (const t3 of this.aliases[s2]) + if (void 0 !== e2[t3]) return true; + } + return false; + } + completeOptionKey(t2, e2, s2) { + const i2 = this.usage.getDescriptions(), + n2 = + !/^--/.test(s2) && ((t3) => /^[^0-9]$/.test(t3))(t2) + ? "-" + : "--"; + if (this.zshShell) { + const s3 = i2[t2] || ""; + e2.push( + n2 + + `${t2.replace(/:/g, "\\:")}:${s3.replace("__yargsString__:", "")}`, + ); + } else e2.push(n2 + t2); + } + customCompletion(t2, e2, s2, i2) { + if ( + (d(this.customCompletionFunction, null, this.shim), + this.customCompletionFunction.length < 3) + ) { + const t3 = this.customCompletionFunction(s2, e2); + return f(t3) + ? t3 + .then((t4) => { + this.shim.process.nextTick(() => { + i2(null, t4); + }); + }) + .catch((t4) => { + this.shim.process.nextTick(() => { + i2(t4, void 0); + }); + }) + : i2(null, t3); + } + return (function (t3) { + return t3.length > 3; + })(this.customCompletionFunction) + ? this.customCompletionFunction( + s2, + e2, + (n2 = i2) => this.defaultCompletion(t2, e2, s2, n2), + (t3) => { + i2(null, t3); + }, + ) + : this.customCompletionFunction(s2, e2, (t3) => { + i2(null, t3); + }); + } + getCompletion(t2, e2) { + const s2 = t2.length ? t2[t2.length - 1] : "", + i2 = this.yargs.parse(t2, true), + n2 = this.customCompletionFunction + ? (i3) => this.customCompletion(t2, i3, s2, e2) + : (i3) => this.defaultCompletion(t2, i3, s2, e2); + return f(i2) ? i2.then(n2) : n2(i2); + } + generateCompletionScript(t2, e2) { + let s2 = this.zshShell + ? `#compdef {{app_name}} ###-begin-{{app_name}}-completions-### # # yargs command completion script @@ -3754,948 +5091,2504 @@ _{{app_name}}_yargs_completions() } compdef _{{app_name}}_yargs_completions {{app_name}} ###-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 i2 = this.shim.path.basename(t2); - return t2.match(/\.js$/) && (t2 = `./${t2}`), s2 = s2.replace(/{{app_name}}/g, i2), s2 = s2.replace(/{{completion_command}}/g, e2), s2.replace(/{{app_path}}/g, t2); - } - registerFunction(t2) { - this.customCompletionFunction = t2; - } - setParsed(t2) { - this.aliases = t2.aliases; - } - }; - function D(t2, e2) { - if (0 === t2.length) - return e2.length; - if (0 === e2.length) - return t2.length; - const s2 = []; - let i2, n2; - for (i2 = 0; i2 <= e2.length; i2++) - s2[i2] = [i2]; - for (n2 = 0; n2 <= t2.length; n2++) - s2[0][n2] = n2; - for (i2 = 1; i2 <= e2.length; i2++) - for (n2 = 1; n2 <= t2.length; n2++) - e2.charAt(i2 - 1) === t2.charAt(n2 - 1) ? s2[i2][n2] = s2[i2 - 1][n2 - 1] : i2 > 1 && n2 > 1 && e2.charAt(i2 - 2) === t2.charAt(n2 - 1) && e2.charAt(i2 - 1) === t2.charAt(n2 - 2) ? s2[i2][n2] = s2[i2 - 2][n2 - 2] + 1 : s2[i2][n2] = Math.min(s2[i2 - 1][n2 - 1] + 1, Math.min(s2[i2][n2 - 1] + 1, s2[i2 - 1][n2] + 1)); - return s2[e2.length][t2.length]; - } - var H = ["$0", "--", "_"]; - var z; - var q; - var W; - var F; - var U; - var L; - var V; - var G; - var R; - var T; - var K; - var B; - var Y; - var J; - var Z; - var X; - var Q; - var tt; - var et; - var st; - var it; - var nt; - var rt; - var ot; - var at; - var ht; - var lt; - var ct; - var ft; - var dt; - var ut; - var pt; - var gt; - var mt; - var yt = Symbol("copyDoubleDash"); - var bt = Symbol("copyDoubleDash"); - var vt = Symbol("deleteFromParserHintObject"); - var Ot = Symbol("emitWarning"); - var wt = Symbol("freeze"); - var Ct = Symbol("getDollarZero"); - var jt = Symbol("getParserConfiguration"); - var _t = Symbol("guessLocale"); - var Mt = Symbol("guessVersion"); - var kt = Symbol("parsePositionalNumbers"); - var xt = Symbol("pkgUp"); - var Et = Symbol("populateParserHintArray"); - var At = Symbol("populateParserHintSingleValueDictionary"); - var Pt = Symbol("populateParserHintArrayDictionary"); - var St = Symbol("populateParserHintDictionary"); - var $t = Symbol("sanitizeKey"); - var It = Symbol("setKey"); - var Nt = Symbol("unfreeze"); - var Dt = Symbol("validateAsync"); - var Ht = Symbol("getCommandInstance"); - var zt = Symbol("getContext"); - var qt = Symbol("getHasOutput"); - var Wt = Symbol("getLoggerInstance"); - var Ft = Symbol("getParseContext"); - var Ut = Symbol("getUsageInstance"); - var Lt = Symbol("getValidationInstance"); - var Vt = Symbol("hasParseCallback"); - var Gt = Symbol("isGlobalContext"); - var Rt = Symbol("postProcess"); - var Tt = Symbol("rebase"); - var Kt = Symbol("reset"); - var Bt = Symbol("runYargsParserAndExecuteCommands"); - var Yt = Symbol("runValidation"); - var Jt = Symbol("setHasOutput"); - var Zt = Symbol("kTrackManuallySetKeys"); - var Xt = class { - constructor(t2 = [], e2, s2, i2) { - this.customScriptName = false, this.parsed = false, z.set(this, void 0), q.set(this, void 0), W.set(this, { commands: [], fullCommands: [] }), F.set(this, null), U.set(this, null), L.set(this, "show-hidden"), V.set(this, null), G.set(this, true), R.set(this, {}), T.set(this, true), K.set(this, []), B.set(this, void 0), Y.set(this, {}), J.set(this, false), Z.set(this, null), X.set(this, true), Q.set(this, void 0), tt.set(this, ""), et.set(this, void 0), st.set(this, void 0), it.set(this, {}), nt.set(this, null), rt.set(this, null), ot.set(this, {}), at.set(this, {}), ht.set(this, void 0), lt.set(this, false), ct.set(this, void 0), ft.set(this, false), dt.set(this, false), ut.set(this, false), pt.set(this, void 0), gt.set(this, null), mt.set(this, void 0), O(this, ct, i2, "f"), O(this, ht, t2, "f"), O(this, q, e2, "f"), O(this, st, s2, "f"), O(this, B, new w(this), "f"), this.$0 = this[Ct](), this[Kt](), O(this, z, v(this, z, "f"), "f"), O(this, pt, v(this, pt, "f"), "f"), O(this, mt, v(this, mt, "f"), "f"), O(this, et, v(this, et, "f"), "f"), v(this, et, "f").showHiddenOpt = v(this, L, "f"), O(this, Q, this[bt](), "f"); - } - addHelpOpt(t2, e2) { - return h("[string|boolean] [string]", [t2, e2], arguments.length), v(this, Z, "f") && (this[vt](v(this, Z, "f")), O(this, Z, null, "f")), false === t2 && void 0 === e2 || (O(this, Z, "string" == typeof t2 ? t2 : "help", "f"), this.boolean(v(this, Z, "f")), this.describe(v(this, Z, "f"), e2 || v(this, pt, "f").deferY18nLookup("Show help"))), this; - } - help(t2, e2) { - return this.addHelpOpt(t2, e2); - } - addShowHiddenOpt(t2, e2) { - if (h("[string|boolean] [string]", [t2, e2], arguments.length), false === t2 && void 0 === e2) - return this; - const s2 = "string" == typeof t2 ? t2 : v(this, L, "f"); - return this.boolean(s2), this.describe(s2, e2 || v(this, pt, "f").deferY18nLookup("Show hidden options")), v(this, et, "f").showHiddenOpt = s2, this; - } - showHidden(t2, e2) { - return this.addShowHiddenOpt(t2, e2); - } - alias(t2, e2) { - return h(" [string|array]", [t2, e2], arguments.length), this[Pt](this.alias.bind(this), "alias", t2, e2), this; - } - array(t2) { - return h("", [t2], arguments.length), this[Et]("array", t2), this[Zt](t2), this; - } - boolean(t2) { - return h("", [t2], arguments.length), this[Et]("boolean", t2), this[Zt](t2), this; - } - check(t2, e2) { - return h(" [boolean]", [t2, e2], arguments.length), this.middleware((e3, s2) => j(() => t2(e3, s2.getOptions()), (s3) => (s3 ? ("string" == typeof s3 || s3 instanceof Error) && v(this, pt, "f").fail(s3.toString(), s3) : v(this, pt, "f").fail(v(this, ct, "f").y18n.__("Argument check failed: %s", t2.toString())), e3), (t3) => (v(this, pt, "f").fail(t3.message ? t3.message : t3.toString(), t3), e3)), false, e2), this; - } - choices(t2, e2) { - return h(" [string|array]", [t2, e2], arguments.length), this[Pt](this.choices.bind(this), "choices", t2, e2), this; - } - coerce(t2, s2) { - if (h(" [function]", [t2, s2], arguments.length), Array.isArray(t2)) { - if (!s2) - throw new e("coerce callback must be provided"); - for (const e2 of t2) - this.coerce(e2, s2); - return this; - } - if ("object" == typeof t2) { - for (const e2 of Object.keys(t2)) - this.coerce(e2, t2[e2]); - return this; - } - if (!s2) - throw new e("coerce callback must be provided"); - return v(this, et, "f").key[t2] = true, v(this, B, "f").addCoerceMiddleware((i2, n2) => { - let r2; - return Object.hasOwnProperty.call(i2, t2) ? j(() => (r2 = n2.getAliases(), s2(i2[t2])), (e2) => { - i2[t2] = e2; - const s3 = n2.getInternalMethods().getParserConfiguration()["strip-aliased"]; - if (r2[t2] && true !== s3) - for (const s4 of r2[t2]) - i2[s4] = e2; - return i2; - }, (t3) => { - throw new e(t3.message); - }) : i2; - }, t2), this; - } - conflicts(t2, e2) { - return h(" [string|array]", [t2, e2], arguments.length), v(this, mt, "f").conflicts(t2, e2), this; - } - config(t2 = "config", e2, s2) { - return h("[object|string] [string|function] [function]", [t2, e2, s2], arguments.length), "object" != typeof t2 || Array.isArray(t2) ? ("function" == typeof e2 && (s2 = e2, e2 = void 0), this.describe(t2, e2 || v(this, pt, "f").deferY18nLookup("Path to JSON config file")), (Array.isArray(t2) ? t2 : [t2]).forEach((t3) => { - v(this, et, "f").config[t3] = s2 || true; - }), this) : (t2 = n(t2, v(this, q, "f"), this[jt]()["deep-merge-config"] || false, v(this, ct, "f")), v(this, et, "f").configObjects = (v(this, et, "f").configObjects || []).concat(t2), this); - } - completion(t2, e2, s2) { - return h("[string] [string|boolean|function] [function]", [t2, e2, s2], arguments.length), "function" == typeof e2 && (s2 = e2, e2 = void 0), O(this, U, t2 || v(this, U, "f") || "completion", "f"), e2 || false === e2 || (e2 = "generate completion script"), this.command(v(this, U, "f"), e2), s2 && v(this, F, "f").registerFunction(s2), this; - } - command(t2, e2, s2, i2, n2, r2) { - return h(" [string|boolean] [function|object] [function] [array] [boolean|string]", [t2, e2, s2, i2, n2, r2], arguments.length), v(this, z, "f").addHandler(t2, e2, s2, i2, n2, r2), this; - } - commands(t2, e2, s2, i2, n2, r2) { - return this.command(t2, e2, s2, i2, n2, r2); - } - commandDir(t2, e2) { - h(" [object]", [t2, e2], arguments.length); - const s2 = v(this, st, "f") || v(this, ct, "f").require; - return v(this, z, "f").addDirectory(t2, s2, v(this, ct, "f").getCallerFile(), e2), this; - } - count(t2) { - return h("", [t2], arguments.length), this[Et]("count", t2), this[Zt](t2), this; - } - default(t2, e2, s2) { - return h(" [*] [string]", [t2, e2, s2], arguments.length), s2 && (u(t2, v(this, ct, "f")), v(this, et, "f").defaultDescription[t2] = s2), "function" == typeof e2 && (u(t2, v(this, ct, "f")), v(this, et, "f").defaultDescription[t2] || (v(this, et, "f").defaultDescription[t2] = v(this, pt, "f").functionDescription(e2)), e2 = e2.call()), this[At](this.default.bind(this), "default", t2, e2), this; - } - defaults(t2, e2, s2) { - return this.default(t2, e2, s2); - } - demandCommand(t2 = 1, e2, s2, i2) { - return h("[number] [number|string] [string|null|undefined] [string|null|undefined]", [t2, e2, s2, i2], arguments.length), "number" != typeof e2 && (s2 = e2, e2 = 1 / 0), this.global("_", false), v(this, et, "f").demandedCommands._ = { min: t2, max: e2, minMsg: s2, maxMsg: i2 }, this; - } - demand(t2, e2, s2) { - return Array.isArray(e2) ? (e2.forEach((t3) => { - d(s2, true, v(this, ct, "f")), this.demandOption(t3, s2); - }), e2 = 1 / 0) : "number" != typeof e2 && (s2 = e2, e2 = 1 / 0), "number" == typeof t2 ? (d(s2, true, v(this, ct, "f")), this.demandCommand(t2, e2, s2, s2)) : Array.isArray(t2) ? t2.forEach((t3) => { - d(s2, true, v(this, ct, "f")), this.demandOption(t3, s2); - }) : "string" == typeof s2 ? this.demandOption(t2, s2) : true !== s2 && void 0 !== s2 || this.demandOption(t2), this; - } - demandOption(t2, e2) { - return h(" [string]", [t2, e2], arguments.length), this[At](this.demandOption.bind(this), "demandedOptions", t2, e2), this; - } - deprecateOption(t2, e2) { - return h(" [string|boolean]", [t2, e2], arguments.length), v(this, et, "f").deprecatedOptions[t2] = e2, this; - } - describe(t2, e2) { - return h(" [string]", [t2, e2], arguments.length), this[It](t2, true), v(this, pt, "f").describe(t2, e2), this; - } - detectLocale(t2) { - return h("", [t2], arguments.length), O(this, G, t2, "f"), this; - } - env(t2) { - return h("[string|boolean]", [t2], arguments.length), false === t2 ? delete v(this, et, "f").envPrefix : v(this, et, "f").envPrefix = t2 || "", this; - } - epilogue(t2) { - return h("", [t2], arguments.length), v(this, pt, "f").epilog(t2), this; - } - epilog(t2) { - return this.epilogue(t2); - } - example(t2, e2) { - return h(" [string]", [t2, e2], arguments.length), Array.isArray(t2) ? t2.forEach((t3) => this.example(...t3)) : v(this, pt, "f").example(t2, e2), this; - } - exit(t2, e2) { - O(this, J, true, "f"), O(this, V, e2, "f"), v(this, T, "f") && v(this, ct, "f").process.exit(t2); - } - exitProcess(t2 = true) { - return h("[boolean]", [t2], arguments.length), O(this, T, t2, "f"), this; - } - fail(t2) { - if (h("", [t2], arguments.length), "boolean" == typeof t2 && false !== t2) - throw new e("Invalid first argument. Expected function or boolean 'false'"); - return v(this, pt, "f").failFn(t2), this; - } - getAliases() { - return this.parsed ? this.parsed.aliases : {}; - } - async getCompletion(t2, e2) { - return h(" [function]", [t2, e2], arguments.length), e2 ? v(this, F, "f").getCompletion(t2, e2) : new Promise((e3, s2) => { - v(this, F, "f").getCompletion(t2, (t3, i2) => { - t3 ? s2(t3) : e3(i2); - }); - }); - } - getDemandedOptions() { - return h([], 0), v(this, et, "f").demandedOptions; - } - getDemandedCommands() { - return h([], 0), v(this, et, "f").demandedCommands; - } - getDeprecatedOptions() { - return h([], 0), v(this, et, "f").deprecatedOptions; - } - getDetectLocale() { - return v(this, G, "f"); - } - getExitProcess() { - return v(this, T, "f"); - } - getGroups() { - return Object.assign({}, v(this, Y, "f"), v(this, at, "f")); - } - getHelp() { - if (O(this, J, true, "f"), !v(this, pt, "f").hasCachedHelpMessage()) { - if (!this.parsed) { - const t3 = this[Bt](v(this, ht, "f"), void 0, void 0, 0, true); - if (f(t3)) - return t3.then(() => v(this, pt, "f").help()); - } - const t2 = v(this, z, "f").runDefaultBuilderOn(this); - if (f(t2)) - return t2.then(() => v(this, pt, "f").help()); - } - return Promise.resolve(v(this, pt, "f").help()); - } - getOptions() { - return v(this, et, "f"); - } - getStrict() { - return v(this, ft, "f"); - } - getStrictCommands() { - return v(this, dt, "f"); - } - getStrictOptions() { - return v(this, ut, "f"); - } - global(t2, e2) { - return h(" [boolean]", [t2, e2], arguments.length), t2 = [].concat(t2), false !== e2 ? v(this, et, "f").local = v(this, et, "f").local.filter((e3) => -1 === t2.indexOf(e3)) : t2.forEach((t3) => { - v(this, et, "f").local.includes(t3) || v(this, et, "f").local.push(t3); - }), this; - } - group(t2, e2) { - h(" ", [t2, e2], arguments.length); - const s2 = v(this, at, "f")[e2] || v(this, Y, "f")[e2]; - v(this, at, "f")[e2] && delete v(this, at, "f")[e2]; - const i2 = {}; - return v(this, Y, "f")[e2] = (s2 || []).concat(t2).filter((t3) => !i2[t3] && (i2[t3] = true)), this; - } - hide(t2) { - return h("", [t2], arguments.length), v(this, et, "f").hiddenOptions.push(t2), this; - } - implies(t2, e2) { - return h(" [number|string|array]", [t2, e2], arguments.length), v(this, mt, "f").implies(t2, e2), this; - } - locale(t2) { - return h("[string]", [t2], arguments.length), t2 ? (O(this, G, false, "f"), v(this, ct, "f").y18n.setLocale(t2), this) : (this[_t](), v(this, ct, "f").y18n.getLocale()); - } - middleware(t2, e2, s2) { - return v(this, B, "f").addMiddleware(t2, !!e2, s2); - } - nargs(t2, e2) { - return h(" [number]", [t2, e2], arguments.length), this[At](this.nargs.bind(this), "narg", t2, e2), this; - } - normalize(t2) { - return h("", [t2], arguments.length), this[Et]("normalize", t2), this; - } - number(t2) { - return h("", [t2], arguments.length), this[Et]("number", t2), this[Zt](t2), this; - } - option(t2, e2) { - if (h(" [object]", [t2, e2], arguments.length), "object" == typeof t2) - Object.keys(t2).forEach((e3) => { - this.options(e3, t2[e3]); - }); - else { - "object" != typeof e2 && (e2 = {}), this[Zt](t2), !v(this, gt, "f") || "version" !== t2 && "version" !== (null == e2 ? void 0 : e2.alias) || this[Ot](['"version" is a reserved word.', "Please do one of the following:", '- Disable version with `yargs.version(false)` if using "version" as an option', "- Use the built-in `yargs.version` method instead (if applicable)", "- Use a different option key", "https://yargs.js.org/docs/#api-reference-version"].join("\n"), void 0, "versionWarning"), v(this, et, "f").key[t2] = true, e2.alias && this.alias(t2, e2.alias); - const s2 = e2.deprecate || e2.deprecated; - s2 && this.deprecateOption(t2, s2); - const i2 = e2.demand || e2.required || e2.require; - i2 && this.demand(t2, i2), e2.demandOption && this.demandOption(t2, "string" == typeof e2.demandOption ? e2.demandOption : void 0), e2.conflicts && this.conflicts(t2, e2.conflicts), "default" in e2 && this.default(t2, e2.default), void 0 !== e2.implies && this.implies(t2, e2.implies), void 0 !== e2.nargs && this.nargs(t2, e2.nargs), e2.config && this.config(t2, e2.configParser), e2.normalize && this.normalize(t2), e2.choices && this.choices(t2, e2.choices), e2.coerce && this.coerce(t2, e2.coerce), e2.group && this.group(t2, e2.group), (e2.boolean || "boolean" === e2.type) && (this.boolean(t2), e2.alias && this.boolean(e2.alias)), (e2.array || "array" === e2.type) && (this.array(t2), e2.alias && this.array(e2.alias)), (e2.number || "number" === e2.type) && (this.number(t2), e2.alias && this.number(e2.alias)), (e2.string || "string" === e2.type) && (this.string(t2), e2.alias && this.string(e2.alias)), (e2.count || "count" === e2.type) && this.count(t2), "boolean" == typeof e2.global && this.global(t2, e2.global), e2.defaultDescription && (v(this, et, "f").defaultDescription[t2] = e2.defaultDescription), e2.skipValidation && this.skipValidation(t2); - const n2 = e2.describe || e2.description || e2.desc; - this.describe(t2, n2), e2.hidden && this.hide(t2), e2.requiresArg && this.requiresArg(t2); - } - return this; - } - options(t2, e2) { - return this.option(t2, e2); - } - parse(t2, e2, s2) { - h("[string|array] [function|boolean|object] [function]", [t2, e2, s2], arguments.length), this[wt](), void 0 === t2 && (t2 = v(this, ht, "f")), "object" == typeof e2 && (O(this, rt, e2, "f"), e2 = s2), "function" == typeof e2 && (O(this, nt, e2, "f"), e2 = false), e2 || O(this, ht, t2, "f"), v(this, nt, "f") && O(this, T, false, "f"); - const i2 = this[Bt](t2, !!e2), n2 = this.parsed; - return v(this, F, "f").setParsed(this.parsed), f(i2) ? i2.then((t3) => (v(this, nt, "f") && v(this, nt, "f").call(this, v(this, V, "f"), t3, v(this, tt, "f")), t3)).catch((t3) => { - throw v(this, nt, "f") && v(this, nt, "f")(t3, this.parsed.argv, v(this, tt, "f")), t3; - }).finally(() => { - this[Nt](), this.parsed = n2; - }) : (v(this, nt, "f") && v(this, nt, "f").call(this, v(this, V, "f"), i2, v(this, tt, "f")), this[Nt](), this.parsed = n2, i2); - } - parseAsync(t2, e2, s2) { - const i2 = this.parse(t2, e2, s2); - return f(i2) ? i2 : Promise.resolve(i2); - } - parseSync(t2, s2, i2) { - const n2 = this.parse(t2, s2, i2); - if (f(n2)) - throw new e(".parseSync() must not be used with asynchronous builders, handlers, or middleware"); - return n2; - } - parserConfiguration(t2) { - return h("", [t2], arguments.length), O(this, it, t2, "f"), this; - } - pkgConf(t2, e2) { - h(" [string]", [t2, e2], arguments.length); - let s2 = null; - const i2 = this[xt](e2 || v(this, q, "f")); - return i2[t2] && "object" == typeof i2[t2] && (s2 = n(i2[t2], e2 || v(this, q, "f"), this[jt]()["deep-merge-config"] || false, v(this, ct, "f")), v(this, et, "f").configObjects = (v(this, et, "f").configObjects || []).concat(s2)), this; - } - positional(t2, e2) { - h(" ", [t2, e2], arguments.length); - const s2 = ["default", "defaultDescription", "implies", "normalize", "choices", "conflicts", "coerce", "type", "describe", "desc", "description", "alias"]; - e2 = g(e2, (t3, e3) => !("type" === t3 && !["string", "number", "boolean"].includes(e3)) && s2.includes(t3)); - const i2 = v(this, W, "f").fullCommands[v(this, W, "f").fullCommands.length - 1], n2 = i2 ? v(this, z, "f").cmdToParseOptions(i2) : { array: [], alias: {}, default: {}, demand: {} }; - return p(n2).forEach((s3) => { - const i3 = n2[s3]; - Array.isArray(i3) ? -1 !== i3.indexOf(t2) && (e2[s3] = true) : i3[t2] && !(s3 in e2) && (e2[s3] = i3[t2]); - }), this.group(t2, v(this, pt, "f").getPositionalGroupName()), this.option(t2, e2); - } - recommendCommands(t2 = true) { - return h("[boolean]", [t2], arguments.length), O(this, lt, t2, "f"), this; - } - required(t2, e2, s2) { - return this.demand(t2, e2, s2); - } - require(t2, e2, s2) { - return this.demand(t2, e2, s2); - } - requiresArg(t2) { - return h(" [number]", [t2], arguments.length), "string" == typeof t2 && v(this, et, "f").narg[t2] || this[At](this.requiresArg.bind(this), "narg", t2, NaN), this; - } - showCompletionScript(t2, e2) { - return h("[string] [string]", [t2, e2], arguments.length), t2 = t2 || this.$0, v(this, Q, "f").log(v(this, F, "f").generateCompletionScript(t2, e2 || v(this, U, "f") || "completion")), this; - } - showHelp(t2) { - if (h("[string|function]", [t2], arguments.length), O(this, J, true, "f"), !v(this, pt, "f").hasCachedHelpMessage()) { - if (!this.parsed) { - const e3 = this[Bt](v(this, ht, "f"), void 0, void 0, 0, true); - if (f(e3)) - return e3.then(() => { - v(this, pt, "f").showHelp(t2); - }), this; - } - const e2 = v(this, z, "f").runDefaultBuilderOn(this); - if (f(e2)) - return e2.then(() => { - v(this, pt, "f").showHelp(t2); - }), this; - } - return v(this, pt, "f").showHelp(t2), this; - } - scriptName(t2) { - return this.customScriptName = true, this.$0 = t2, this; - } - showHelpOnFail(t2, e2) { - return h("[boolean|string] [string]", [t2, e2], arguments.length), v(this, pt, "f").showHelpOnFail(t2, e2), this; - } - showVersion(t2) { - return h("[string|function]", [t2], arguments.length), v(this, pt, "f").showVersion(t2), this; - } - skipValidation(t2) { - return h("", [t2], arguments.length), this[Et]("skipValidation", t2), this; - } - strict(t2) { - return h("[boolean]", [t2], arguments.length), O(this, ft, false !== t2, "f"), this; - } - strictCommands(t2) { - return h("[boolean]", [t2], arguments.length), O(this, dt, false !== t2, "f"), this; - } - strictOptions(t2) { - return h("[boolean]", [t2], arguments.length), O(this, ut, false !== t2, "f"), this; - } - string(t2) { - return h("", [t2], arguments.length), this[Et]("string", t2), this[Zt](t2), this; - } - terminalWidth() { - return h([], 0), v(this, ct, "f").process.stdColumns; - } - updateLocale(t2) { - return this.updateStrings(t2); - } - updateStrings(t2) { - return h("", [t2], arguments.length), O(this, G, false, "f"), v(this, ct, "f").y18n.updateLocale(t2), this; - } - usage(t2, s2, i2, n2) { - if (h(" [string|boolean] [function|object] [function]", [t2, s2, i2, n2], arguments.length), void 0 !== s2) { - if (d(t2, null, v(this, ct, "f")), (t2 || "").match(/^\$0( |$)/)) - return this.command(t2, s2, i2, n2); - throw new e(".usage() description must start with $0 if being used as alias for .command()"); - } - return v(this, pt, "f").usage(t2), this; - } - version(t2, e2, s2) { - const i2 = "version"; - if (h("[boolean|string] [string] [string]", [t2, e2, s2], arguments.length), v(this, gt, "f") && (this[vt](v(this, gt, "f")), v(this, pt, "f").version(void 0), O(this, gt, null, "f")), 0 === arguments.length) - s2 = this[Mt](), t2 = i2; - else if (1 === arguments.length) { - if (false === t2) - return this; - s2 = t2, t2 = i2; - } else - 2 === arguments.length && (s2 = e2, e2 = void 0); - return O(this, gt, "string" == typeof t2 ? t2 : i2, "f"), e2 = e2 || v(this, pt, "f").deferY18nLookup("Show version number"), v(this, pt, "f").version(s2 || void 0), this.boolean(v(this, gt, "f")), this.describe(v(this, gt, "f"), e2), this; - } - wrap(t2) { - return h("", [t2], arguments.length), v(this, pt, "f").wrap(t2), this; - } - [(z = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakMap(), it = /* @__PURE__ */ new WeakMap(), nt = /* @__PURE__ */ new WeakMap(), rt = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), at = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), yt)](t2) { - if (!t2._ || !t2["--"]) - return t2; - t2._.push.apply(t2._, t2["--"]); - try { - delete t2["--"]; - } catch (t3) { - } - return t2; - } - [bt]() { - return { log: (...t2) => { - this[Vt]() || console.log(...t2), O(this, J, true, "f"), v(this, tt, "f").length && O(this, tt, v(this, tt, "f") + "\n", "f"), O(this, tt, v(this, tt, "f") + t2.join(" "), "f"); - }, error: (...t2) => { - this[Vt]() || console.error(...t2), O(this, J, true, "f"), v(this, tt, "f").length && O(this, tt, v(this, tt, "f") + "\n", "f"), O(this, tt, v(this, tt, "f") + t2.join(" "), "f"); - } }; - } - [vt](t2) { - p(v(this, et, "f")).forEach((e2) => { - if ("configObjects" === e2) - return; - const s2 = v(this, et, "f")[e2]; - Array.isArray(s2) ? s2.includes(t2) && s2.splice(s2.indexOf(t2), 1) : "object" == typeof s2 && delete s2[t2]; - }), delete v(this, pt, "f").getDescriptions()[t2]; - } - [Ot](t2, e2, s2) { - v(this, R, "f")[s2] || (v(this, ct, "f").process.emitWarning(t2, e2), v(this, R, "f")[s2] = true); - } - [wt]() { - v(this, K, "f").push({ options: v(this, et, "f"), configObjects: v(this, et, "f").configObjects.slice(0), exitProcess: v(this, T, "f"), groups: v(this, Y, "f"), strict: v(this, ft, "f"), strictCommands: v(this, dt, "f"), strictOptions: v(this, ut, "f"), completionCommand: v(this, U, "f"), output: v(this, tt, "f"), exitError: v(this, V, "f"), hasOutput: v(this, J, "f"), parsed: this.parsed, parseFn: v(this, nt, "f"), parseContext: v(this, rt, "f") }), v(this, pt, "f").freeze(), v(this, mt, "f").freeze(), v(this, z, "f").freeze(), v(this, B, "f").freeze(); - } - [Ct]() { - let t2, e2 = ""; - return t2 = /\b(node|iojs|electron)(\.exe)?$/.test(v(this, ct, "f").process.argv()[0]) ? v(this, ct, "f").process.argv().slice(1, 2) : v(this, ct, "f").process.argv().slice(0, 1), e2 = t2.map((t3) => { - const e3 = this[Tt](v(this, q, "f"), t3); - return t3.match(/^(\/|([a-zA-Z]:)?\\)/) && e3.length < t3.length ? e3 : t3; - }).join(" ").trim(), v(this, ct, "f").getEnv("_") && v(this, ct, "f").getProcessArgvBin() === v(this, ct, "f").getEnv("_") && (e2 = v(this, ct, "f").getEnv("_").replace(`${v(this, ct, "f").path.dirname(v(this, ct, "f").process.execPath())}/`, "")), e2; - } - [jt]() { - return v(this, it, "f"); - } - [_t]() { - if (!v(this, G, "f")) - return; - const t2 = v(this, ct, "f").getEnv("LC_ALL") || v(this, ct, "f").getEnv("LC_MESSAGES") || v(this, ct, "f").getEnv("LANG") || v(this, ct, "f").getEnv("LANGUAGE") || "en_US"; - this.locale(t2.replace(/[.:].*/, "")); - } - [Mt]() { - return this[xt]().version || "unknown"; - } - [kt](t2) { - const e2 = t2["--"] ? t2["--"] : t2._; - for (let t3, s2 = 0; void 0 !== (t3 = e2[s2]); s2++) - v(this, ct, "f").Parser.looksLikeNumber(t3) && Number.isSafeInteger(Math.floor(parseFloat(`${t3}`))) && (e2[s2] = Number(t3)); - return t2; - } - [xt](t2) { - const e2 = t2 || "*"; - if (v(this, ot, "f")[e2]) - return v(this, ot, "f")[e2]; - let s2 = {}; - try { - let e3 = t2 || v(this, ct, "f").mainFilename; - !t2 && v(this, ct, "f").path.extname(e3) && (e3 = v(this, ct, "f").path.dirname(e3)); - const i2 = v(this, ct, "f").findUp(e3, (t3, e4) => e4.includes("package.json") ? "package.json" : void 0); - d(i2, void 0, v(this, ct, "f")), s2 = JSON.parse(v(this, ct, "f").readFileSync(i2, "utf8")); - } catch (t3) { - } - return v(this, ot, "f")[e2] = s2 || {}, v(this, ot, "f")[e2]; - } - [Et](t2, e2) { - (e2 = [].concat(e2)).forEach((e3) => { - e3 = this[$t](e3), v(this, et, "f")[t2].push(e3); - }); - } - [At](t2, e2, s2, i2) { - this[St](t2, e2, s2, i2, (t3, e3, s3) => { - v(this, et, "f")[t3][e3] = s3; - }); - } - [Pt](t2, e2, s2, i2) { - this[St](t2, e2, s2, i2, (t3, e3, s3) => { - v(this, et, "f")[t3][e3] = (v(this, et, "f")[t3][e3] || []).concat(s3); - }); - } - [St](t2, e2, s2, i2, n2) { - if (Array.isArray(s2)) - s2.forEach((e3) => { - t2(e3, i2); - }); - else if (((t3) => "object" == typeof t3)(s2)) - for (const e3 of p(s2)) - t2(e3, s2[e3]); - else - n2(e2, this[$t](s2), i2); - } - [$t](t2) { - return "__proto__" === t2 ? "___proto___" : t2; - } - [It](t2, e2) { - return this[At](this[It].bind(this), "key", t2, e2), this; - } - [Nt]() { - var t2, e2, s2, i2, n2, r2, o2, a2, h2, l2, c2, f2; - const u2 = v(this, K, "f").pop(); - let p2; - d(u2, void 0, v(this, ct, "f")), t2 = this, e2 = this, s2 = this, i2 = this, n2 = this, r2 = this, o2 = this, a2 = this, h2 = this, l2 = this, c2 = this, f2 = this, { options: { set value(e3) { - O(t2, et, e3, "f"); - } }.value, configObjects: p2, exitProcess: { set value(t3) { - O(e2, T, t3, "f"); - } }.value, groups: { set value(t3) { - O(s2, Y, t3, "f"); - } }.value, output: { set value(t3) { - O(i2, tt, t3, "f"); - } }.value, exitError: { set value(t3) { - O(n2, V, t3, "f"); - } }.value, hasOutput: { set value(t3) { - O(r2, J, t3, "f"); - } }.value, parsed: this.parsed, strict: { set value(t3) { - O(o2, ft, t3, "f"); - } }.value, strictCommands: { set value(t3) { - O(a2, dt, t3, "f"); - } }.value, strictOptions: { set value(t3) { - O(h2, ut, t3, "f"); - } }.value, completionCommand: { set value(t3) { - O(l2, U, t3, "f"); - } }.value, parseFn: { set value(t3) { - O(c2, nt, t3, "f"); - } }.value, parseContext: { set value(t3) { - O(f2, rt, t3, "f"); - } }.value } = u2, v(this, et, "f").configObjects = p2, v(this, pt, "f").unfreeze(), v(this, mt, "f").unfreeze(), v(this, z, "f").unfreeze(), v(this, B, "f").unfreeze(); - } - [Dt](t2, e2) { - return j(e2, (e3) => (t2(e3), e3)); - } - getInternalMethods() { - return { getCommandInstance: this[Ht].bind(this), getContext: this[zt].bind(this), getHasOutput: this[qt].bind(this), getLoggerInstance: this[Wt].bind(this), getParseContext: this[Ft].bind(this), getParserConfiguration: this[jt].bind(this), getUsageInstance: this[Ut].bind(this), getValidationInstance: this[Lt].bind(this), hasParseCallback: this[Vt].bind(this), isGlobalContext: this[Gt].bind(this), postProcess: this[Rt].bind(this), reset: this[Kt].bind(this), runValidation: this[Yt].bind(this), runYargsParserAndExecuteCommands: this[Bt].bind(this), setHasOutput: this[Jt].bind(this) }; - } - [Ht]() { - return v(this, z, "f"); - } - [zt]() { - return v(this, W, "f"); - } - [qt]() { - return v(this, J, "f"); - } - [Wt]() { - return v(this, Q, "f"); - } - [Ft]() { - return v(this, rt, "f") || {}; - } - [Ut]() { - return v(this, pt, "f"); - } - [Lt]() { - return v(this, mt, "f"); - } - [Vt]() { - return !!v(this, nt, "f"); - } - [Gt]() { - return v(this, X, "f"); - } - [Rt](t2, e2, s2, i2) { - if (s2) - return t2; - if (f(t2)) - return t2; - e2 || (t2 = this[yt](t2)); - return (this[jt]()["parse-positional-numbers"] || void 0 === this[jt]()["parse-positional-numbers"]) && (t2 = this[kt](t2)), i2 && (t2 = C(t2, this, v(this, B, "f").getMiddleware(), false)), t2; - } - [Kt](t2 = {}) { - O(this, et, v(this, et, "f") || {}, "f"); - const e2 = {}; - e2.local = v(this, et, "f").local || [], e2.configObjects = v(this, et, "f").configObjects || []; - const s2 = {}; - e2.local.forEach((e3) => { - s2[e3] = true, (t2[e3] || []).forEach((t3) => { - s2[t3] = true; - }); - }), Object.assign(v(this, at, "f"), Object.keys(v(this, Y, "f")).reduce((t3, e3) => { - const i2 = v(this, Y, "f")[e3].filter((t4) => !(t4 in s2)); - return i2.length > 0 && (t3[e3] = i2), t3; - }, {})), O(this, Y, {}, "f"); - return ["array", "boolean", "string", "skipValidation", "count", "normalize", "number", "hiddenOptions"].forEach((t3) => { - e2[t3] = (v(this, et, "f")[t3] || []).filter((t4) => !s2[t4]); - }), ["narg", "key", "alias", "default", "defaultDescription", "config", "choices", "demandedOptions", "demandedCommands", "deprecatedOptions"].forEach((t3) => { - e2[t3] = g(v(this, et, "f")[t3], (t4) => !s2[t4]); - }), e2.envPrefix = v(this, et, "f").envPrefix, O(this, et, e2, "f"), O(this, pt, v(this, pt, "f") ? v(this, pt, "f").reset(s2) : P(this, v(this, ct, "f")), "f"), O(this, mt, v(this, mt, "f") ? v(this, mt, "f").reset(s2) : function(t3, e3, s3) { - const i2 = s3.y18n.__, n2 = s3.y18n.__n, r2 = { nonOptionCount: function(s4) { - const i3 = t3.getDemandedCommands(), r3 = s4._.length + (s4["--"] ? s4["--"].length : 0) - t3.getInternalMethods().getContext().commands.length; - i3._ && (r3 < i3._.min || r3 > i3._.max) && (r3 < i3._.min ? void 0 !== i3._.minMsg ? e3.fail(i3._.minMsg ? i3._.minMsg.replace(/\$0/g, r3.toString()).replace(/\$1/, i3._.min.toString()) : null) : e3.fail(n2("Not enough non-option arguments: got %s, need at least %s", "Not enough non-option arguments: got %s, need at least %s", r3, r3.toString(), i3._.min.toString())) : r3 > i3._.max && (void 0 !== i3._.maxMsg ? e3.fail(i3._.maxMsg ? i3._.maxMsg.replace(/\$0/g, r3.toString()).replace(/\$1/, i3._.max.toString()) : null) : e3.fail(n2("Too many non-option arguments: got %s, maximum of %s", "Too many non-option arguments: got %s, maximum of %s", r3, r3.toString(), i3._.max.toString())))); - }, positionalCount: function(t4, s4) { - s4 < t4 && e3.fail(n2("Not enough non-option arguments: got %s, need at least %s", "Not enough non-option arguments: got %s, need at least %s", s4, s4 + "", t4 + "")); - }, requiredArguments: function(t4, s4) { - let i3 = null; - for (const e4 of Object.keys(s4)) - Object.prototype.hasOwnProperty.call(t4, e4) && void 0 !== t4[e4] || (i3 = i3 || {}, i3[e4] = s4[e4]); - if (i3) { - const t5 = []; - for (const e4 of Object.keys(i3)) { - const s6 = i3[e4]; - s6 && t5.indexOf(s6) < 0 && t5.push(s6); - } - const s5 = t5.length ? ` -${t5.join("\n")}` : ""; - e3.fail(n2("Missing required argument: %s", "Missing required arguments: %s", Object.keys(i3).length, Object.keys(i3).join(", ") + s5)); - } - }, unknownArguments: function(s4, i3, o3, a3, h2 = true) { - var l3; - const c3 = t3.getInternalMethods().getCommandInstance().getCommands(), f2 = [], d2 = t3.getInternalMethods().getContext(); - if (Object.keys(s4).forEach((e4) => { - H.includes(e4) || Object.prototype.hasOwnProperty.call(o3, e4) || Object.prototype.hasOwnProperty.call(t3.getInternalMethods().getParseContext(), e4) || r2.isValidAndSomeAliasIsNotNew(e4, i3) || f2.push(e4); - }), h2 && (d2.commands.length > 0 || c3.length > 0 || a3) && s4._.slice(d2.commands.length).forEach((t4) => { - c3.includes("" + t4) || f2.push("" + t4); - }), h2) { - const e4 = (null === (l3 = t3.getDemandedCommands()._) || void 0 === l3 ? void 0 : l3.max) || 0, i4 = d2.commands.length + e4; - i4 < s4._.length && s4._.slice(i4).forEach((t4) => { - t4 = String(t4), d2.commands.includes(t4) || f2.includes(t4) || f2.push(t4); - }); - } - f2.length && e3.fail(n2("Unknown argument: %s", "Unknown arguments: %s", f2.length, f2.map((t4) => t4.trim() ? t4 : `"${t4}"`).join(", "))); - }, unknownCommands: function(s4) { - const i3 = t3.getInternalMethods().getCommandInstance().getCommands(), r3 = [], o3 = t3.getInternalMethods().getContext(); - return (o3.commands.length > 0 || i3.length > 0) && s4._.slice(o3.commands.length).forEach((t4) => { - i3.includes("" + t4) || r3.push("" + t4); - }), r3.length > 0 && (e3.fail(n2("Unknown command: %s", "Unknown commands: %s", r3.length, r3.join(", "))), true); - }, isValidAndSomeAliasIsNotNew: function(e4, s4) { - if (!Object.prototype.hasOwnProperty.call(s4, e4)) - return false; - const i3 = t3.parsed.newAliases; - return [e4, ...s4[e4]].some((t4) => !Object.prototype.hasOwnProperty.call(i3, t4) || !i3[e4]); - }, limitedChoices: function(s4) { - const n3 = t3.getOptions(), r3 = {}; - if (!Object.keys(n3.choices).length) - return; - Object.keys(s4).forEach((t4) => { - -1 === H.indexOf(t4) && Object.prototype.hasOwnProperty.call(n3.choices, t4) && [].concat(s4[t4]).forEach((e4) => { - -1 === n3.choices[t4].indexOf(e4) && void 0 !== e4 && (r3[t4] = (r3[t4] || []).concat(e4)); - }); - }); - const o3 = Object.keys(r3); - if (!o3.length) - return; - let a3 = i2("Invalid values:"); - o3.forEach((t4) => { - a3 += ` +` + : '###-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 i2 = this.shim.path.basename(t2); + return ( + t2.match(/\.js$/) && (t2 = `./${t2}`), + (s2 = s2.replace(/{{app_name}}/g, i2)), + (s2 = s2.replace(/{{completion_command}}/g, e2)), + s2.replace(/{{app_path}}/g, t2) + ); + } + registerFunction(t2) { + this.customCompletionFunction = t2; + } + setParsed(t2) { + this.aliases = t2.aliases; + } + }; + function D(t2, e2) { + if (0 === t2.length) return e2.length; + if (0 === e2.length) return t2.length; + const s2 = []; + let i2, n2; + for (i2 = 0; i2 <= e2.length; i2++) s2[i2] = [i2]; + for (n2 = 0; n2 <= t2.length; n2++) s2[0][n2] = n2; + for (i2 = 1; i2 <= e2.length; i2++) + for (n2 = 1; n2 <= t2.length; n2++) + e2.charAt(i2 - 1) === t2.charAt(n2 - 1) + ? (s2[i2][n2] = s2[i2 - 1][n2 - 1]) + : i2 > 1 && + n2 > 1 && + e2.charAt(i2 - 2) === t2.charAt(n2 - 1) && + e2.charAt(i2 - 1) === t2.charAt(n2 - 2) + ? (s2[i2][n2] = s2[i2 - 2][n2 - 2] + 1) + : (s2[i2][n2] = Math.min( + s2[i2 - 1][n2 - 1] + 1, + Math.min( + s2[i2][n2 - 1] + 1, + s2[i2 - 1][n2] + 1, + ), + )); + return s2[e2.length][t2.length]; + } + var H = ["$0", "--", "_"]; + var z; + var q; + var W; + var F; + var U; + var L; + var V; + var G; + var R; + var T; + var K; + var B; + var Y; + var J; + var Z; + var X; + var Q; + var tt; + var et; + var st; + var it; + var nt; + var rt; + var ot; + var at; + var ht; + var lt; + var ct; + var ft; + var dt; + var ut; + var pt; + var gt; + var mt; + var yt = Symbol("copyDoubleDash"); + var bt = Symbol("copyDoubleDash"); + var vt = Symbol("deleteFromParserHintObject"); + var Ot = Symbol("emitWarning"); + var wt = Symbol("freeze"); + var Ct = Symbol("getDollarZero"); + var jt = Symbol("getParserConfiguration"); + var _t = Symbol("guessLocale"); + var Mt = Symbol("guessVersion"); + var kt = Symbol("parsePositionalNumbers"); + var xt = Symbol("pkgUp"); + var Et = Symbol("populateParserHintArray"); + var At = Symbol("populateParserHintSingleValueDictionary"); + var Pt = Symbol("populateParserHintArrayDictionary"); + var St = Symbol("populateParserHintDictionary"); + var $t = Symbol("sanitizeKey"); + var It = Symbol("setKey"); + var Nt = Symbol("unfreeze"); + var Dt = Symbol("validateAsync"); + var Ht = Symbol("getCommandInstance"); + var zt = Symbol("getContext"); + var qt = Symbol("getHasOutput"); + var Wt = Symbol("getLoggerInstance"); + var Ft = Symbol("getParseContext"); + var Ut = Symbol("getUsageInstance"); + var Lt = Symbol("getValidationInstance"); + var Vt = Symbol("hasParseCallback"); + var Gt = Symbol("isGlobalContext"); + var Rt = Symbol("postProcess"); + var Tt = Symbol("rebase"); + var Kt = Symbol("reset"); + var Bt = Symbol("runYargsParserAndExecuteCommands"); + var Yt = Symbol("runValidation"); + var Jt = Symbol("setHasOutput"); + var Zt = Symbol("kTrackManuallySetKeys"); + var Xt = class { + constructor(t2 = [], e2, s2, i2) { + (this.customScriptName = false), + (this.parsed = false), + z.set(this, void 0), + q.set(this, void 0), + W.set(this, { commands: [], fullCommands: [] }), + F.set(this, null), + U.set(this, null), + L.set(this, "show-hidden"), + V.set(this, null), + G.set(this, true), + R.set(this, {}), + T.set(this, true), + K.set(this, []), + B.set(this, void 0), + Y.set(this, {}), + J.set(this, false), + Z.set(this, null), + X.set(this, true), + Q.set(this, void 0), + tt.set(this, ""), + et.set(this, void 0), + st.set(this, void 0), + it.set(this, {}), + nt.set(this, null), + rt.set(this, null), + ot.set(this, {}), + at.set(this, {}), + ht.set(this, void 0), + lt.set(this, false), + ct.set(this, void 0), + ft.set(this, false), + dt.set(this, false), + ut.set(this, false), + pt.set(this, void 0), + gt.set(this, null), + mt.set(this, void 0), + O(this, ct, i2, "f"), + O(this, ht, t2, "f"), + O(this, q, e2, "f"), + O(this, st, s2, "f"), + O(this, B, new w(this), "f"), + (this.$0 = this[Ct]()), + this[Kt](), + O(this, z, v(this, z, "f"), "f"), + O(this, pt, v(this, pt, "f"), "f"), + O(this, mt, v(this, mt, "f"), "f"), + O(this, et, v(this, et, "f"), "f"), + (v(this, et, "f").showHiddenOpt = v(this, L, "f")), + O(this, Q, this[bt](), "f"); + } + addHelpOpt(t2, e2) { + return ( + h("[string|boolean] [string]", [t2, e2], arguments.length), + v(this, Z, "f") && + (this[vt](v(this, Z, "f")), O(this, Z, null, "f")), + (false === t2 && void 0 === e2) || + (O(this, Z, "string" == typeof t2 ? t2 : "help", "f"), + this.boolean(v(this, Z, "f")), + this.describe( + v(this, Z, "f"), + e2 || v(this, pt, "f").deferY18nLookup("Show help"), + )), + this + ); + } + help(t2, e2) { + return this.addHelpOpt(t2, e2); + } + addShowHiddenOpt(t2, e2) { + if ( + (h("[string|boolean] [string]", [t2, e2], arguments.length), + false === t2 && void 0 === e2) + ) + return this; + const s2 = "string" == typeof t2 ? t2 : v(this, L, "f"); + return ( + this.boolean(s2), + this.describe( + s2, + e2 || + v(this, pt, "f").deferY18nLookup( + "Show hidden options", + ), + ), + (v(this, et, "f").showHiddenOpt = s2), + this + ); + } + showHidden(t2, e2) { + return this.addShowHiddenOpt(t2, e2); + } + alias(t2, e2) { + return ( + h( + " [string|array]", + [t2, e2], + arguments.length, + ), + this[Pt](this.alias.bind(this), "alias", t2, e2), + this + ); + } + array(t2) { + return ( + h("", [t2], arguments.length), + this[Et]("array", t2), + this[Zt](t2), + this + ); + } + boolean(t2) { + return ( + h("", [t2], arguments.length), + this[Et]("boolean", t2), + this[Zt](t2), + this + ); + } + check(t2, e2) { + return ( + h(" [boolean]", [t2, e2], arguments.length), + this.middleware( + (e3, s2) => + j( + () => t2(e3, s2.getOptions()), + (s3) => ( + s3 + ? ("string" == typeof s3 || + s3 instanceof Error) && + v(this, pt, "f").fail( + s3.toString(), + s3, + ) + : v(this, pt, "f").fail( + v(this, ct, "f").y18n.__( + "Argument check failed: %s", + t2.toString(), + ), + ), + e3 + ), + (t3) => ( + v(this, pt, "f").fail( + t3.message ? t3.message : t3.toString(), + t3, + ), + e3 + ), + ), + false, + e2, + ), + this + ); + } + choices(t2, e2) { + return ( + h( + " [string|array]", + [t2, e2], + arguments.length, + ), + this[Pt](this.choices.bind(this), "choices", t2, e2), + this + ); + } + coerce(t2, s2) { + if ( + (h( + " [function]", + [t2, s2], + arguments.length, + ), + Array.isArray(t2)) + ) { + if (!s2) throw new e("coerce callback must be provided"); + for (const e2 of t2) this.coerce(e2, s2); + return this; + } + if ("object" == typeof t2) { + for (const e2 of Object.keys(t2)) this.coerce(e2, t2[e2]); + return this; + } + if (!s2) throw new e("coerce callback must be provided"); + return ( + (v(this, et, "f").key[t2] = true), + v(this, B, "f").addCoerceMiddleware((i2, n2) => { + let r2; + return Object.hasOwnProperty.call(i2, t2) + ? j( + () => ((r2 = n2.getAliases()), s2(i2[t2])), + (e2) => { + i2[t2] = e2; + const s3 = n2 + .getInternalMethods() + .getParserConfiguration()[ + "strip-aliased" + ]; + if (r2[t2] && true !== s3) + for (const s4 of r2[t2]) + i2[s4] = e2; + return i2; + }, + (t3) => { + throw new e(t3.message); + }, + ) + : i2; + }, t2), + this + ); + } + conflicts(t2, e2) { + return ( + h( + " [string|array]", + [t2, e2], + arguments.length, + ), + v(this, mt, "f").conflicts(t2, e2), + this + ); + } + config(t2 = "config", e2, s2) { + return ( + h( + "[object|string] [string|function] [function]", + [t2, e2, s2], + arguments.length, + ), + "object" != typeof t2 || Array.isArray(t2) + ? ("function" == typeof e2 && + ((s2 = e2), (e2 = void 0)), + this.describe( + t2, + e2 || + v(this, pt, "f").deferY18nLookup( + "Path to JSON config file", + ), + ), + (Array.isArray(t2) ? t2 : [t2]).forEach((t3) => { + v(this, et, "f").config[t3] = s2 || true; + }), + this) + : ((t2 = n( + t2, + v(this, q, "f"), + this[jt]()["deep-merge-config"] || false, + v(this, ct, "f"), + )), + (v(this, et, "f").configObjects = ( + v(this, et, "f").configObjects || [] + ).concat(t2)), + this) + ); + } + completion(t2, e2, s2) { + return ( + h( + "[string] [string|boolean|function] [function]", + [t2, e2, s2], + arguments.length, + ), + "function" == typeof e2 && ((s2 = e2), (e2 = void 0)), + O(this, U, t2 || v(this, U, "f") || "completion", "f"), + e2 || false === e2 || (e2 = "generate completion script"), + this.command(v(this, U, "f"), e2), + s2 && v(this, F, "f").registerFunction(s2), + this + ); + } + command(t2, e2, s2, i2, n2, r2) { + return ( + h( + " [string|boolean] [function|object] [function] [array] [boolean|string]", + [t2, e2, s2, i2, n2, r2], + arguments.length, + ), + v(this, z, "f").addHandler(t2, e2, s2, i2, n2, r2), + this + ); + } + commands(t2, e2, s2, i2, n2, r2) { + return this.command(t2, e2, s2, i2, n2, r2); + } + commandDir(t2, e2) { + h(" [object]", [t2, e2], arguments.length); + const s2 = v(this, st, "f") || v(this, ct, "f").require; + return ( + v(this, z, "f").addDirectory( + t2, + s2, + v(this, ct, "f").getCallerFile(), + e2, + ), + this + ); + } + count(t2) { + return ( + h("", [t2], arguments.length), + this[Et]("count", t2), + this[Zt](t2), + this + ); + } + default(t2, e2, s2) { + return ( + h( + " [*] [string]", + [t2, e2, s2], + arguments.length, + ), + s2 && + (u(t2, v(this, ct, "f")), + (v(this, et, "f").defaultDescription[t2] = s2)), + "function" == typeof e2 && + (u(t2, v(this, ct, "f")), + v(this, et, "f").defaultDescription[t2] || + (v(this, et, "f").defaultDescription[t2] = v( + this, + pt, + "f", + ).functionDescription(e2)), + (e2 = e2.call())), + this[At](this.default.bind(this), "default", t2, e2), + this + ); + } + defaults(t2, e2, s2) { + return this.default(t2, e2, s2); + } + demandCommand(t2 = 1, e2, s2, i2) { + return ( + h( + "[number] [number|string] [string|null|undefined] [string|null|undefined]", + [t2, e2, s2, i2], + arguments.length, + ), + "number" != typeof e2 && ((s2 = e2), (e2 = 1 / 0)), + this.global("_", false), + (v(this, et, "f").demandedCommands._ = { + min: t2, + max: e2, + minMsg: s2, + maxMsg: i2, + }), + this + ); + } + demand(t2, e2, s2) { + return ( + Array.isArray(e2) + ? (e2.forEach((t3) => { + d(s2, true, v(this, ct, "f")), + this.demandOption(t3, s2); + }), + (e2 = 1 / 0)) + : "number" != typeof e2 && ((s2 = e2), (e2 = 1 / 0)), + "number" == typeof t2 + ? (d(s2, true, v(this, ct, "f")), + this.demandCommand(t2, e2, s2, s2)) + : Array.isArray(t2) + ? t2.forEach((t3) => { + d(s2, true, v(this, ct, "f")), + this.demandOption(t3, s2); + }) + : "string" == typeof s2 + ? this.demandOption(t2, s2) + : (true !== s2 && void 0 !== s2) || + this.demandOption(t2), + this + ); + } + demandOption(t2, e2) { + return ( + h( + " [string]", + [t2, e2], + arguments.length, + ), + this[At]( + this.demandOption.bind(this), + "demandedOptions", + t2, + e2, + ), + this + ); + } + deprecateOption(t2, e2) { + return ( + h(" [string|boolean]", [t2, e2], arguments.length), + (v(this, et, "f").deprecatedOptions[t2] = e2), + this + ); + } + describe(t2, e2) { + return ( + h( + " [string]", + [t2, e2], + arguments.length, + ), + this[It](t2, true), + v(this, pt, "f").describe(t2, e2), + this + ); + } + detectLocale(t2) { + return ( + h("", [t2], arguments.length), + O(this, G, t2, "f"), + this + ); + } + env(t2) { + return ( + h("[string|boolean]", [t2], arguments.length), + false === t2 + ? delete v(this, et, "f").envPrefix + : (v(this, et, "f").envPrefix = t2 || ""), + this + ); + } + epilogue(t2) { + return ( + h("", [t2], arguments.length), + v(this, pt, "f").epilog(t2), + this + ); + } + epilog(t2) { + return this.epilogue(t2); + } + example(t2, e2) { + return ( + h(" [string]", [t2, e2], arguments.length), + Array.isArray(t2) + ? t2.forEach((t3) => this.example(...t3)) + : v(this, pt, "f").example(t2, e2), + this + ); + } + exit(t2, e2) { + O(this, J, true, "f"), + O(this, V, e2, "f"), + v(this, T, "f") && v(this, ct, "f").process.exit(t2); + } + exitProcess(t2 = true) { + return ( + h("[boolean]", [t2], arguments.length), + O(this, T, t2, "f"), + this + ); + } + fail(t2) { + if ( + (h("", [t2], arguments.length), + "boolean" == typeof t2 && false !== t2) + ) + throw new e( + "Invalid first argument. Expected function or boolean 'false'", + ); + return v(this, pt, "f").failFn(t2), this; + } + getAliases() { + return this.parsed ? this.parsed.aliases : {}; + } + async getCompletion(t2, e2) { + return ( + h(" [function]", [t2, e2], arguments.length), + e2 + ? v(this, F, "f").getCompletion(t2, e2) + : new Promise((e3, s2) => { + v(this, F, "f").getCompletion(t2, (t3, i2) => { + t3 ? s2(t3) : e3(i2); + }); + }) + ); + } + getDemandedOptions() { + return h([], 0), v(this, et, "f").demandedOptions; + } + getDemandedCommands() { + return h([], 0), v(this, et, "f").demandedCommands; + } + getDeprecatedOptions() { + return h([], 0), v(this, et, "f").deprecatedOptions; + } + getDetectLocale() { + return v(this, G, "f"); + } + getExitProcess() { + return v(this, T, "f"); + } + getGroups() { + return Object.assign({}, v(this, Y, "f"), v(this, at, "f")); + } + getHelp() { + if ( + (O(this, J, true, "f"), + !v(this, pt, "f").hasCachedHelpMessage()) + ) { + if (!this.parsed) { + const t3 = this[Bt]( + v(this, ht, "f"), + void 0, + void 0, + 0, + true, + ); + if (f(t3)) + return t3.then(() => v(this, pt, "f").help()); + } + const t2 = v(this, z, "f").runDefaultBuilderOn(this); + if (f(t2)) return t2.then(() => v(this, pt, "f").help()); + } + return Promise.resolve(v(this, pt, "f").help()); + } + getOptions() { + return v(this, et, "f"); + } + getStrict() { + return v(this, ft, "f"); + } + getStrictCommands() { + return v(this, dt, "f"); + } + getStrictOptions() { + return v(this, ut, "f"); + } + global(t2, e2) { + return ( + h(" [boolean]", [t2, e2], arguments.length), + (t2 = [].concat(t2)), + false !== e2 + ? (v(this, et, "f").local = v( + this, + et, + "f", + ).local.filter((e3) => -1 === t2.indexOf(e3))) + : t2.forEach((t3) => { + v(this, et, "f").local.includes(t3) || + v(this, et, "f").local.push(t3); + }), + this + ); + } + group(t2, e2) { + h(" ", [t2, e2], arguments.length); + const s2 = v(this, at, "f")[e2] || v(this, Y, "f")[e2]; + v(this, at, "f")[e2] && delete v(this, at, "f")[e2]; + const i2 = {}; + return ( + (v(this, Y, "f")[e2] = (s2 || []) + .concat(t2) + .filter((t3) => !i2[t3] && (i2[t3] = true))), + this + ); + } + hide(t2) { + return ( + h("", [t2], arguments.length), + v(this, et, "f").hiddenOptions.push(t2), + this + ); + } + implies(t2, e2) { + return ( + h( + " [number|string|array]", + [t2, e2], + arguments.length, + ), + v(this, mt, "f").implies(t2, e2), + this + ); + } + locale(t2) { + return ( + h("[string]", [t2], arguments.length), + t2 + ? (O(this, G, false, "f"), + v(this, ct, "f").y18n.setLocale(t2), + this) + : (this[_t](), v(this, ct, "f").y18n.getLocale()) + ); + } + middleware(t2, e2, s2) { + return v(this, B, "f").addMiddleware(t2, !!e2, s2); + } + nargs(t2, e2) { + return ( + h( + " [number]", + [t2, e2], + arguments.length, + ), + this[At](this.nargs.bind(this), "narg", t2, e2), + this + ); + } + normalize(t2) { + return ( + h("", [t2], arguments.length), + this[Et]("normalize", t2), + this + ); + } + number(t2) { + return ( + h("", [t2], arguments.length), + this[Et]("number", t2), + this[Zt](t2), + this + ); + } + option(t2, e2) { + if ( + (h(" [object]", [t2, e2], arguments.length), + "object" == typeof t2) + ) + Object.keys(t2).forEach((e3) => { + this.options(e3, t2[e3]); + }); + else { + "object" != typeof e2 && (e2 = {}), + this[Zt](t2), + !v(this, gt, "f") || + ("version" !== t2 && + "version" !== + (null == e2 ? void 0 : e2.alias)) || + this[Ot]( + [ + '"version" is a reserved word.', + "Please do one of the following:", + '- Disable version with `yargs.version(false)` if using "version" as an option', + "- Use the built-in `yargs.version` method instead (if applicable)", + "- Use a different option key", + "https://yargs.js.org/docs/#api-reference-version", + ].join("\n"), + void 0, + "versionWarning", + ), + (v(this, et, "f").key[t2] = true), + e2.alias && this.alias(t2, e2.alias); + const s2 = e2.deprecate || e2.deprecated; + s2 && this.deprecateOption(t2, s2); + const i2 = e2.demand || e2.required || e2.require; + i2 && this.demand(t2, i2), + e2.demandOption && + this.demandOption( + t2, + "string" == typeof e2.demandOption + ? e2.demandOption + : void 0, + ), + e2.conflicts && this.conflicts(t2, e2.conflicts), + "default" in e2 && this.default(t2, e2.default), + void 0 !== e2.implies && this.implies(t2, e2.implies), + void 0 !== e2.nargs && this.nargs(t2, e2.nargs), + e2.config && this.config(t2, e2.configParser), + e2.normalize && this.normalize(t2), + e2.choices && this.choices(t2, e2.choices), + e2.coerce && this.coerce(t2, e2.coerce), + e2.group && this.group(t2, e2.group), + (e2.boolean || "boolean" === e2.type) && + (this.boolean(t2), + e2.alias && this.boolean(e2.alias)), + (e2.array || "array" === e2.type) && + (this.array(t2), e2.alias && this.array(e2.alias)), + (e2.number || "number" === e2.type) && + (this.number(t2), + e2.alias && this.number(e2.alias)), + (e2.string || "string" === e2.type) && + (this.string(t2), + e2.alias && this.string(e2.alias)), + (e2.count || "count" === e2.type) && this.count(t2), + "boolean" == typeof e2.global && + this.global(t2, e2.global), + e2.defaultDescription && + (v(this, et, "f").defaultDescription[t2] = + e2.defaultDescription), + e2.skipValidation && this.skipValidation(t2); + const n2 = e2.describe || e2.description || e2.desc; + this.describe(t2, n2), + e2.hidden && this.hide(t2), + e2.requiresArg && this.requiresArg(t2); + } + return this; + } + options(t2, e2) { + return this.option(t2, e2); + } + parse(t2, e2, s2) { + h( + "[string|array] [function|boolean|object] [function]", + [t2, e2, s2], + arguments.length, + ), + this[wt](), + void 0 === t2 && (t2 = v(this, ht, "f")), + "object" == typeof e2 && (O(this, rt, e2, "f"), (e2 = s2)), + "function" == typeof e2 && + (O(this, nt, e2, "f"), (e2 = false)), + e2 || O(this, ht, t2, "f"), + v(this, nt, "f") && O(this, T, false, "f"); + const i2 = this[Bt](t2, !!e2), + n2 = this.parsed; + return ( + v(this, F, "f").setParsed(this.parsed), + f(i2) + ? i2 + .then( + (t3) => ( + v(this, nt, "f") && + v(this, nt, "f").call( + this, + v(this, V, "f"), + t3, + v(this, tt, "f"), + ), + t3 + ), + ) + .catch((t3) => { + throw ( + (v(this, nt, "f") && + v(this, nt, "f")( + t3, + this.parsed.argv, + v(this, tt, "f"), + ), + t3) + ); + }) + .finally(() => { + this[Nt](), (this.parsed = n2); + }) + : (v(this, nt, "f") && + v(this, nt, "f").call( + this, + v(this, V, "f"), + i2, + v(this, tt, "f"), + ), + this[Nt](), + (this.parsed = n2), + i2) + ); + } + parseAsync(t2, e2, s2) { + const i2 = this.parse(t2, e2, s2); + return f(i2) ? i2 : Promise.resolve(i2); + } + parseSync(t2, s2, i2) { + const n2 = this.parse(t2, s2, i2); + if (f(n2)) + throw new e( + ".parseSync() must not be used with asynchronous builders, handlers, or middleware", + ); + return n2; + } + parserConfiguration(t2) { + return ( + h("", [t2], arguments.length), + O(this, it, t2, "f"), + this + ); + } + pkgConf(t2, e2) { + h(" [string]", [t2, e2], arguments.length); + let s2 = null; + const i2 = this[xt](e2 || v(this, q, "f")); + return ( + i2[t2] && + "object" == typeof i2[t2] && + ((s2 = n( + i2[t2], + e2 || v(this, q, "f"), + this[jt]()["deep-merge-config"] || false, + v(this, ct, "f"), + )), + (v(this, et, "f").configObjects = ( + v(this, et, "f").configObjects || [] + ).concat(s2))), + this + ); + } + positional(t2, e2) { + h(" ", [t2, e2], arguments.length); + const s2 = [ + "default", + "defaultDescription", + "implies", + "normalize", + "choices", + "conflicts", + "coerce", + "type", + "describe", + "desc", + "description", + "alias", + ]; + e2 = g( + e2, + (t3, e3) => + !( + "type" === t3 && + !["string", "number", "boolean"].includes(e3) + ) && s2.includes(t3), + ); + const i2 = v(this, W, "f").fullCommands[ + v(this, W, "f").fullCommands.length - 1 + ], + n2 = i2 + ? v(this, z, "f").cmdToParseOptions(i2) + : { array: [], alias: {}, default: {}, demand: {} }; + return ( + p(n2).forEach((s3) => { + const i3 = n2[s3]; + Array.isArray(i3) + ? -1 !== i3.indexOf(t2) && (e2[s3] = true) + : i3[t2] && !(s3 in e2) && (e2[s3] = i3[t2]); + }), + this.group(t2, v(this, pt, "f").getPositionalGroupName()), + this.option(t2, e2) + ); + } + recommendCommands(t2 = true) { + return ( + h("[boolean]", [t2], arguments.length), + O(this, lt, t2, "f"), + this + ); + } + required(t2, e2, s2) { + return this.demand(t2, e2, s2); + } + require(t2, e2, s2) { + return this.demand(t2, e2, s2); + } + requiresArg(t2) { + return ( + h(" [number]", [t2], arguments.length), + ("string" == typeof t2 && v(this, et, "f").narg[t2]) || + this[At](this.requiresArg.bind(this), "narg", t2, NaN), + this + ); + } + showCompletionScript(t2, e2) { + return ( + h("[string] [string]", [t2, e2], arguments.length), + (t2 = t2 || this.$0), + v(this, Q, "f").log( + v(this, F, "f").generateCompletionScript( + t2, + e2 || v(this, U, "f") || "completion", + ), + ), + this + ); + } + showHelp(t2) { + if ( + (h("[string|function]", [t2], arguments.length), + O(this, J, true, "f"), + !v(this, pt, "f").hasCachedHelpMessage()) + ) { + if (!this.parsed) { + const e3 = this[Bt]( + v(this, ht, "f"), + void 0, + void 0, + 0, + true, + ); + if (f(e3)) + return ( + e3.then(() => { + v(this, pt, "f").showHelp(t2); + }), + this + ); + } + const e2 = v(this, z, "f").runDefaultBuilderOn(this); + if (f(e2)) + return ( + e2.then(() => { + v(this, pt, "f").showHelp(t2); + }), + this + ); + } + return v(this, pt, "f").showHelp(t2), this; + } + scriptName(t2) { + return (this.customScriptName = true), (this.$0 = t2), this; + } + showHelpOnFail(t2, e2) { + return ( + h("[boolean|string] [string]", [t2, e2], arguments.length), + v(this, pt, "f").showHelpOnFail(t2, e2), + this + ); + } + showVersion(t2) { + return ( + h("[string|function]", [t2], arguments.length), + v(this, pt, "f").showVersion(t2), + this + ); + } + skipValidation(t2) { + return ( + h("", [t2], arguments.length), + this[Et]("skipValidation", t2), + this + ); + } + strict(t2) { + return ( + h("[boolean]", [t2], arguments.length), + O(this, ft, false !== t2, "f"), + this + ); + } + strictCommands(t2) { + return ( + h("[boolean]", [t2], arguments.length), + O(this, dt, false !== t2, "f"), + this + ); + } + strictOptions(t2) { + return ( + h("[boolean]", [t2], arguments.length), + O(this, ut, false !== t2, "f"), + this + ); + } + string(t2) { + return ( + h("", [t2], arguments.length), + this[Et]("string", t2), + this[Zt](t2), + this + ); + } + terminalWidth() { + return h([], 0), v(this, ct, "f").process.stdColumns; + } + updateLocale(t2) { + return this.updateStrings(t2); + } + updateStrings(t2) { + return ( + h("", [t2], arguments.length), + O(this, G, false, "f"), + v(this, ct, "f").y18n.updateLocale(t2), + this + ); + } + usage(t2, s2, i2, n2) { + if ( + (h( + " [string|boolean] [function|object] [function]", + [t2, s2, i2, n2], + arguments.length, + ), + void 0 !== s2) + ) { + if ( + (d(t2, null, v(this, ct, "f")), + (t2 || "").match(/^\$0( |$)/)) + ) + return this.command(t2, s2, i2, n2); + throw new e( + ".usage() description must start with $0 if being used as alias for .command()", + ); + } + return v(this, pt, "f").usage(t2), this; + } + version(t2, e2, s2) { + const i2 = "version"; + if ( + (h( + "[boolean|string] [string] [string]", + [t2, e2, s2], + arguments.length, + ), + v(this, gt, "f") && + (this[vt](v(this, gt, "f")), + v(this, pt, "f").version(void 0), + O(this, gt, null, "f")), + 0 === arguments.length) + ) + (s2 = this[Mt]()), (t2 = i2); + else if (1 === arguments.length) { + if (false === t2) return this; + (s2 = t2), (t2 = i2); + } else 2 === arguments.length && ((s2 = e2), (e2 = void 0)); + return ( + O(this, gt, "string" == typeof t2 ? t2 : i2, "f"), + (e2 = + e2 || + v(this, pt, "f").deferY18nLookup( + "Show version number", + )), + v(this, pt, "f").version(s2 || void 0), + this.boolean(v(this, gt, "f")), + this.describe(v(this, gt, "f"), e2), + this + ); + } + wrap(t2) { + return ( + h("", [t2], arguments.length), + v(this, pt, "f").wrap(t2), + this + ); + } + [((z = /* @__PURE__ */ new WeakMap()), + (q = /* @__PURE__ */ new WeakMap()), + (W = /* @__PURE__ */ new WeakMap()), + (F = /* @__PURE__ */ new WeakMap()), + (U = /* @__PURE__ */ new WeakMap()), + (L = /* @__PURE__ */ new WeakMap()), + (V = /* @__PURE__ */ new WeakMap()), + (G = /* @__PURE__ */ new WeakMap()), + (R = /* @__PURE__ */ new WeakMap()), + (T = /* @__PURE__ */ new WeakMap()), + (K = /* @__PURE__ */ new WeakMap()), + (B = /* @__PURE__ */ new WeakMap()), + (Y = /* @__PURE__ */ new WeakMap()), + (J = /* @__PURE__ */ new WeakMap()), + (Z = /* @__PURE__ */ new WeakMap()), + (X = /* @__PURE__ */ new WeakMap()), + (Q = /* @__PURE__ */ new WeakMap()), + (tt = /* @__PURE__ */ new WeakMap()), + (et = /* @__PURE__ */ new WeakMap()), + (st = /* @__PURE__ */ new WeakMap()), + (it = /* @__PURE__ */ new WeakMap()), + (nt = /* @__PURE__ */ new WeakMap()), + (rt = /* @__PURE__ */ new WeakMap()), + (ot = /* @__PURE__ */ new WeakMap()), + (at = /* @__PURE__ */ new WeakMap()), + (ht = /* @__PURE__ */ new WeakMap()), + (lt = /* @__PURE__ */ new WeakMap()), + (ct = /* @__PURE__ */ new WeakMap()), + (ft = /* @__PURE__ */ new WeakMap()), + (dt = /* @__PURE__ */ new WeakMap()), + (ut = /* @__PURE__ */ new WeakMap()), + (pt = /* @__PURE__ */ new WeakMap()), + (gt = /* @__PURE__ */ new WeakMap()), + (mt = /* @__PURE__ */ new WeakMap()), + yt)](t2) { + if (!t2._ || !t2["--"]) return t2; + t2._.push.apply(t2._, t2["--"]); + try { + delete t2["--"]; + } catch (t3) {} + return t2; + } + [bt]() { + return { + log: (...t2) => { + this[Vt]() || console.log(...t2), + O(this, J, true, "f"), + v(this, tt, "f").length && + O(this, tt, v(this, tt, "f") + "\n", "f"), + O(this, tt, v(this, tt, "f") + t2.join(" "), "f"); + }, + error: (...t2) => { + this[Vt]() || console.error(...t2), + O(this, J, true, "f"), + v(this, tt, "f").length && + O(this, tt, v(this, tt, "f") + "\n", "f"), + O(this, tt, v(this, tt, "f") + t2.join(" "), "f"); + }, + }; + } + [vt](t2) { + p(v(this, et, "f")).forEach((e2) => { + if ("configObjects" === e2) return; + const s2 = v(this, et, "f")[e2]; + Array.isArray(s2) + ? s2.includes(t2) && s2.splice(s2.indexOf(t2), 1) + : "object" == typeof s2 && delete s2[t2]; + }), + delete v(this, pt, "f").getDescriptions()[t2]; + } + [Ot](t2, e2, s2) { + v(this, R, "f")[s2] || + (v(this, ct, "f").process.emitWarning(t2, e2), + (v(this, R, "f")[s2] = true)); + } + [wt]() { + v(this, K, "f").push({ + options: v(this, et, "f"), + configObjects: v(this, et, "f").configObjects.slice(0), + exitProcess: v(this, T, "f"), + groups: v(this, Y, "f"), + strict: v(this, ft, "f"), + strictCommands: v(this, dt, "f"), + strictOptions: v(this, ut, "f"), + completionCommand: v(this, U, "f"), + output: v(this, tt, "f"), + exitError: v(this, V, "f"), + hasOutput: v(this, J, "f"), + parsed: this.parsed, + parseFn: v(this, nt, "f"), + parseContext: v(this, rt, "f"), + }), + v(this, pt, "f").freeze(), + v(this, mt, "f").freeze(), + v(this, z, "f").freeze(), + v(this, B, "f").freeze(); + } + [Ct]() { + let t2, + e2 = ""; + return ( + (t2 = /\b(node|iojs|electron)(\.exe)?$/.test( + v(this, ct, "f").process.argv()[0], + ) + ? v(this, ct, "f").process.argv().slice(1, 2) + : v(this, ct, "f").process.argv().slice(0, 1)), + (e2 = t2 + .map((t3) => { + const e3 = this[Tt](v(this, q, "f"), t3); + return t3.match(/^(\/|([a-zA-Z]:)?\\)/) && + e3.length < t3.length + ? e3 + : t3; + }) + .join(" ") + .trim()), + v(this, ct, "f").getEnv("_") && + v(this, ct, "f").getProcessArgvBin() === + v(this, ct, "f").getEnv("_") && + (e2 = v(this, ct, "f") + .getEnv("_") + .replace( + `${v(this, ct, "f").path.dirname(v(this, ct, "f").process.execPath())}/`, + "", + )), + e2 + ); + } + [jt]() { + return v(this, it, "f"); + } + [_t]() { + if (!v(this, G, "f")) return; + const t2 = + v(this, ct, "f").getEnv("LC_ALL") || + v(this, ct, "f").getEnv("LC_MESSAGES") || + v(this, ct, "f").getEnv("LANG") || + v(this, ct, "f").getEnv("LANGUAGE") || + "en_US"; + this.locale(t2.replace(/[.:].*/, "")); + } + [Mt]() { + return this[xt]().version || "unknown"; + } + [kt](t2) { + const e2 = t2["--"] ? t2["--"] : t2._; + for (let t3, s2 = 0; void 0 !== (t3 = e2[s2]); s2++) + v(this, ct, "f").Parser.looksLikeNumber(t3) && + Number.isSafeInteger(Math.floor(parseFloat(`${t3}`))) && + (e2[s2] = Number(t3)); + return t2; + } + [xt](t2) { + const e2 = t2 || "*"; + if (v(this, ot, "f")[e2]) return v(this, ot, "f")[e2]; + let s2 = {}; + try { + let e3 = t2 || v(this, ct, "f").mainFilename; + !t2 && + v(this, ct, "f").path.extname(e3) && + (e3 = v(this, ct, "f").path.dirname(e3)); + const i2 = v(this, ct, "f").findUp(e3, (t3, e4) => + e4.includes("package.json") ? "package.json" : void 0, + ); + d(i2, void 0, v(this, ct, "f")), + (s2 = JSON.parse( + v(this, ct, "f").readFileSync(i2, "utf8"), + )); + } catch (t3) {} + return (v(this, ot, "f")[e2] = s2 || {}), v(this, ot, "f")[e2]; + } + [Et](t2, e2) { + (e2 = [].concat(e2)).forEach((e3) => { + (e3 = this[$t](e3)), v(this, et, "f")[t2].push(e3); + }); + } + [At](t2, e2, s2, i2) { + this[St](t2, e2, s2, i2, (t3, e3, s3) => { + v(this, et, "f")[t3][e3] = s3; + }); + } + [Pt](t2, e2, s2, i2) { + this[St](t2, e2, s2, i2, (t3, e3, s3) => { + v(this, et, "f")[t3][e3] = ( + v(this, et, "f")[t3][e3] || [] + ).concat(s3); + }); + } + [St](t2, e2, s2, i2, n2) { + if (Array.isArray(s2)) + s2.forEach((e3) => { + t2(e3, i2); + }); + else if (((t3) => "object" == typeof t3)(s2)) + for (const e3 of p(s2)) t2(e3, s2[e3]); + else n2(e2, this[$t](s2), i2); + } + [$t](t2) { + return "__proto__" === t2 ? "___proto___" : t2; + } + [It](t2, e2) { + return this[At](this[It].bind(this), "key", t2, e2), this; + } + [Nt]() { + var t2, e2, s2, i2, n2, r2, o2, a2, h2, l2, c2, f2; + const u2 = v(this, K, "f").pop(); + let p2; + d(u2, void 0, v(this, ct, "f")), + (t2 = this), + (e2 = this), + (s2 = this), + (i2 = this), + (n2 = this), + (r2 = this), + (o2 = this), + (a2 = this), + (h2 = this), + (l2 = this), + (c2 = this), + (f2 = this), + ({ + options: { + set value(e3) { + O(t2, et, e3, "f"); + }, + }.value, + configObjects: p2, + exitProcess: { + set value(t3) { + O(e2, T, t3, "f"); + }, + }.value, + groups: { + set value(t3) { + O(s2, Y, t3, "f"); + }, + }.value, + output: { + set value(t3) { + O(i2, tt, t3, "f"); + }, + }.value, + exitError: { + set value(t3) { + O(n2, V, t3, "f"); + }, + }.value, + hasOutput: { + set value(t3) { + O(r2, J, t3, "f"); + }, + }.value, + parsed: this.parsed, + strict: { + set value(t3) { + O(o2, ft, t3, "f"); + }, + }.value, + strictCommands: { + set value(t3) { + O(a2, dt, t3, "f"); + }, + }.value, + strictOptions: { + set value(t3) { + O(h2, ut, t3, "f"); + }, + }.value, + completionCommand: { + set value(t3) { + O(l2, U, t3, "f"); + }, + }.value, + parseFn: { + set value(t3) { + O(c2, nt, t3, "f"); + }, + }.value, + parseContext: { + set value(t3) { + O(f2, rt, t3, "f"); + }, + }.value, + } = u2), + (v(this, et, "f").configObjects = p2), + v(this, pt, "f").unfreeze(), + v(this, mt, "f").unfreeze(), + v(this, z, "f").unfreeze(), + v(this, B, "f").unfreeze(); + } + [Dt](t2, e2) { + return j(e2, (e3) => (t2(e3), e3)); + } + getInternalMethods() { + return { + getCommandInstance: this[Ht].bind(this), + getContext: this[zt].bind(this), + getHasOutput: this[qt].bind(this), + getLoggerInstance: this[Wt].bind(this), + getParseContext: this[Ft].bind(this), + getParserConfiguration: this[jt].bind(this), + getUsageInstance: this[Ut].bind(this), + getValidationInstance: this[Lt].bind(this), + hasParseCallback: this[Vt].bind(this), + isGlobalContext: this[Gt].bind(this), + postProcess: this[Rt].bind(this), + reset: this[Kt].bind(this), + runValidation: this[Yt].bind(this), + runYargsParserAndExecuteCommands: this[Bt].bind(this), + setHasOutput: this[Jt].bind(this), + }; + } + [Ht]() { + return v(this, z, "f"); + } + [zt]() { + return v(this, W, "f"); + } + [qt]() { + return v(this, J, "f"); + } + [Wt]() { + return v(this, Q, "f"); + } + [Ft]() { + return v(this, rt, "f") || {}; + } + [Ut]() { + return v(this, pt, "f"); + } + [Lt]() { + return v(this, mt, "f"); + } + [Vt]() { + return !!v(this, nt, "f"); + } + [Gt]() { + return v(this, X, "f"); + } + [Rt](t2, e2, s2, i2) { + if (s2) return t2; + if (f(t2)) return t2; + e2 || (t2 = this[yt](t2)); + return ( + (this[jt]()["parse-positional-numbers"] || + void 0 === this[jt]()["parse-positional-numbers"]) && + (t2 = this[kt](t2)), + i2 && + (t2 = C( + t2, + this, + v(this, B, "f").getMiddleware(), + false, + )), + t2 + ); + } + [Kt](t2 = {}) { + O(this, et, v(this, et, "f") || {}, "f"); + const e2 = {}; + (e2.local = v(this, et, "f").local || []), + (e2.configObjects = v(this, et, "f").configObjects || []); + const s2 = {}; + e2.local.forEach((e3) => { + (s2[e3] = true), + (t2[e3] || []).forEach((t3) => { + s2[t3] = true; + }); + }), + Object.assign( + v(this, at, "f"), + Object.keys(v(this, Y, "f")).reduce((t3, e3) => { + const i2 = v(this, Y, "f")[e3].filter( + (t4) => !(t4 in s2), + ); + return i2.length > 0 && (t3[e3] = i2), t3; + }, {}), + ), + O(this, Y, {}, "f"); + return ( + [ + "array", + "boolean", + "string", + "skipValidation", + "count", + "normalize", + "number", + "hiddenOptions", + ].forEach((t3) => { + e2[t3] = (v(this, et, "f")[t3] || []).filter( + (t4) => !s2[t4], + ); + }), + [ + "narg", + "key", + "alias", + "default", + "defaultDescription", + "config", + "choices", + "demandedOptions", + "demandedCommands", + "deprecatedOptions", + ].forEach((t3) => { + e2[t3] = g(v(this, et, "f")[t3], (t4) => !s2[t4]); + }), + (e2.envPrefix = v(this, et, "f").envPrefix), + O(this, et, e2, "f"), + O( + this, + pt, + v(this, pt, "f") + ? v(this, pt, "f").reset(s2) + : P(this, v(this, ct, "f")), + "f", + ), + O( + this, + mt, + v(this, mt, "f") + ? v(this, mt, "f").reset(s2) + : (function (t3, e3, s3) { + const i2 = s3.y18n.__, + n2 = s3.y18n.__n, + r2 = { + nonOptionCount: function (s4) { + const i3 = + t3.getDemandedCommands(), + r3 = + s4._.length + + (s4["--"] + ? s4["--"].length + : 0) - + t3 + .getInternalMethods() + .getContext() + .commands.length; + i3._ && + (r3 < i3._.min || + r3 > i3._.max) && + (r3 < i3._.min + ? void 0 !== i3._.minMsg + ? e3.fail( + i3._.minMsg + ? i3._.minMsg + .replace( + /\$0/g, + r3.toString(), + ) + .replace( + /\$1/, + i3._.min.toString(), + ) + : null, + ) + : e3.fail( + n2( + "Not enough non-option arguments: got %s, need at least %s", + "Not enough non-option arguments: got %s, need at least %s", + r3, + r3.toString(), + i3._.min.toString(), + ), + ) + : r3 > i3._.max && + (void 0 !== + i3._.maxMsg + ? e3.fail( + i3._ + .maxMsg + ? i3._.maxMsg + .replace( + /\$0/g, + r3.toString(), + ) + .replace( + /\$1/, + i3._.max.toString(), + ) + : null, + ) + : e3.fail( + n2( + "Too many non-option arguments: got %s, maximum of %s", + "Too many non-option arguments: got %s, maximum of %s", + r3, + r3.toString(), + i3._.max.toString(), + ), + ))); + }, + positionalCount: function (t4, s4) { + s4 < t4 && + e3.fail( + n2( + "Not enough non-option arguments: got %s, need at least %s", + "Not enough non-option arguments: got %s, need at least %s", + s4, + s4 + "", + t4 + "", + ), + ); + }, + requiredArguments: function ( + t4, + s4, + ) { + let i3 = null; + for (const e4 of Object.keys( + s4, + )) + (Object.prototype.hasOwnProperty.call( + t4, + e4, + ) && + void 0 !== t4[e4]) || + ((i3 = i3 || {}), + (i3[e4] = s4[e4])); + if (i3) { + const t5 = []; + for (const e4 of Object.keys( + i3, + )) { + const s6 = i3[e4]; + s6 && + t5.indexOf(s6) < + 0 && + t5.push(s6); + } + const s5 = t5.length + ? ` +${t5.join("\n")}` + : ""; + e3.fail( + n2( + "Missing required argument: %s", + "Missing required arguments: %s", + Object.keys(i3) + .length, + Object.keys( + i3, + ).join(", ") + s5, + ), + ); + } + }, + unknownArguments: function ( + s4, + i3, + o3, + a3, + h2 = true, + ) { + var l3; + const c3 = t3 + .getInternalMethods() + .getCommandInstance() + .getCommands(), + f2 = [], + d2 = t3 + .getInternalMethods() + .getContext(); + if ( + (Object.keys(s4).forEach( + (e4) => { + H.includes(e4) || + Object.prototype.hasOwnProperty.call( + o3, + e4, + ) || + Object.prototype.hasOwnProperty.call( + t3 + .getInternalMethods() + .getParseContext(), + e4, + ) || + r2.isValidAndSomeAliasIsNotNew( + e4, + i3, + ) || + f2.push(e4); + }, + ), + h2 && + (d2.commands.length > + 0 || + c3.length > 0 || + a3) && + s4._.slice( + d2.commands.length, + ).forEach((t4) => { + c3.includes( + "" + t4, + ) || + f2.push( + "" + t4, + ); + }), + h2) + ) { + const e4 = + (null === + (l3 = + t3.getDemandedCommands() + ._) || + void 0 === l3 + ? void 0 + : l3.max) || 0, + i4 = + d2.commands.length + + e4; + i4 < s4._.length && + s4._.slice(i4).forEach( + (t4) => { + (t4 = + String(t4)), + d2.commands.includes( + t4, + ) || + f2.includes( + t4, + ) || + f2.push( + t4, + ); + }, + ); + } + f2.length && + e3.fail( + n2( + "Unknown argument: %s", + "Unknown arguments: %s", + f2.length, + f2 + .map((t4) => + t4.trim() + ? t4 + : `"${t4}"`, + ) + .join(", "), + ), + ); + }, + unknownCommands: function (s4) { + const i3 = t3 + .getInternalMethods() + .getCommandInstance() + .getCommands(), + r3 = [], + o3 = t3 + .getInternalMethods() + .getContext(); + return ( + (o3.commands.length > 0 || + i3.length > 0) && + s4._.slice( + o3.commands.length, + ).forEach((t4) => { + i3.includes( + "" + t4, + ) || + r3.push( + "" + t4, + ); + }), + r3.length > 0 && + (e3.fail( + n2( + "Unknown command: %s", + "Unknown commands: %s", + r3.length, + r3.join(", "), + ), + ), + true) + ); + }, + isValidAndSomeAliasIsNotNew: + function (e4, s4) { + if ( + !Object.prototype.hasOwnProperty.call( + s4, + e4, + ) + ) + return false; + const i3 = + t3.parsed.newAliases; + return [e4, ...s4[e4]].some( + (t4) => + !Object.prototype.hasOwnProperty.call( + i3, + t4, + ) || !i3[e4], + ); + }, + limitedChoices: function (s4) { + const n3 = t3.getOptions(), + r3 = {}; + if ( + !Object.keys(n3.choices) + .length + ) + return; + Object.keys(s4).forEach( + (t4) => { + -1 === H.indexOf(t4) && + Object.prototype.hasOwnProperty.call( + n3.choices, + t4, + ) && + [] + .concat(s4[t4]) + .forEach( + (e4) => { + -1 === + n3.choices[ + t4 + ].indexOf( + e4, + ) && + void 0 !== + e4 && + (r3[ + t4 + ] = + ( + r3[ + t4 + ] || + [] + ).concat( + e4, + )); + }, + ); + }, + ); + const o3 = Object.keys(r3); + if (!o3.length) return; + let a3 = i2("Invalid values:"); + o3.forEach((t4) => { + a3 += ` ${i2("Argument: %s, Given: %s, Choices: %s", t4, e3.stringifiedValues(r3[t4]), e3.stringifiedValues(n3.choices[t4]))}`; - }), e3.fail(a3); - } }; - let o2 = {}; - function a2(t4, e4) { - const s4 = Number(e4); - return "number" == typeof (e4 = isNaN(s4) ? e4 : s4) ? e4 = t4._.length >= e4 : e4.match(/^--no-.+/) ? (e4 = e4.match(/^--no-(.+)/)[1], e4 = !Object.prototype.hasOwnProperty.call(t4, e4)) : e4 = Object.prototype.hasOwnProperty.call(t4, e4), e4; - } - r2.implies = function(e4, i3) { - h(" [array|number|string]", [e4, i3], arguments.length), "object" == typeof e4 ? Object.keys(e4).forEach((t4) => { - r2.implies(t4, e4[t4]); - }) : (t3.global(e4), o2[e4] || (o2[e4] = []), Array.isArray(i3) ? i3.forEach((t4) => r2.implies(e4, t4)) : (d(i3, void 0, s3), o2[e4].push(i3))); - }, r2.getImplied = function() { - return o2; - }, r2.implications = function(t4) { - const s4 = []; - if (Object.keys(o2).forEach((e4) => { - const i3 = e4; - (o2[e4] || []).forEach((e5) => { - let n3 = i3; - const r3 = e5; - n3 = a2(t4, n3), e5 = a2(t4, e5), n3 && !e5 && s4.push(` ${i3} -> ${r3}`); - }); - }), s4.length) { - let t5 = `${i2("Implications failed:")} + }), + e3.fail(a3); + }, + }; + let o2 = {}; + function a2(t4, e4) { + const s4 = Number(e4); + return ( + "number" == + typeof (e4 = isNaN(s4) ? e4 : s4) + ? (e4 = t4._.length >= e4) + : e4.match(/^--no-.+/) + ? ((e4 = + e4.match( + /^--no-(.+)/, + )[1]), + (e4 = + !Object.prototype.hasOwnProperty.call( + t4, + e4, + ))) + : (e4 = + Object.prototype.hasOwnProperty.call( + t4, + e4, + )), + e4 + ); + } + (r2.implies = function (e4, i3) { + h( + " [array|number|string]", + [e4, i3], + arguments.length, + ), + "object" == typeof e4 + ? Object.keys(e4).forEach( + (t4) => { + r2.implies( + t4, + e4[t4], + ); + }, + ) + : (t3.global(e4), + o2[e4] || (o2[e4] = []), + Array.isArray(i3) + ? i3.forEach((t4) => + r2.implies( + e4, + t4, + ), + ) + : (d(i3, void 0, s3), + o2[e4].push(i3))); + }), + (r2.getImplied = function () { + return o2; + }), + (r2.implications = function (t4) { + const s4 = []; + if ( + (Object.keys(o2).forEach( + (e4) => { + const i3 = e4; + (o2[e4] || []).forEach( + (e5) => { + let n3 = i3; + const r3 = e5; + (n3 = a2( + t4, + n3, + )), + (e5 = a2( + t4, + e5, + )), + n3 && + !e5 && + s4.push( + ` ${i3} -> ${r3}`, + ); + }, + ); + }, + ), + s4.length) + ) { + let t5 = `${i2("Implications failed:")} `; - s4.forEach((e4) => { - t5 += e4; - }), e3.fail(t5); - } - }; - let l2 = {}; - r2.conflicts = function(e4, s4) { - h(" [array|string]", [e4, s4], arguments.length), "object" == typeof e4 ? Object.keys(e4).forEach((t4) => { - r2.conflicts(t4, e4[t4]); - }) : (t3.global(e4), l2[e4] || (l2[e4] = []), Array.isArray(s4) ? s4.forEach((t4) => r2.conflicts(e4, t4)) : l2[e4].push(s4)); - }, r2.getConflicting = () => l2, r2.conflicting = function(n3) { - Object.keys(n3).forEach((t4) => { - l2[t4] && l2[t4].forEach((s4) => { - s4 && void 0 !== n3[t4] && void 0 !== n3[s4] && e3.fail(i2("Arguments %s and %s are mutually exclusive", t4, s4)); - }); - }), t3.getInternalMethods().getParserConfiguration()["strip-dashed"] && Object.keys(l2).forEach((t4) => { - l2[t4].forEach((r3) => { - r3 && void 0 !== n3[s3.Parser.camelCase(t4)] && void 0 !== n3[s3.Parser.camelCase(r3)] && e3.fail(i2("Arguments %s and %s are mutually exclusive", t4, r3)); - }); - }); - }, r2.recommendCommands = function(t4, s4) { - s4 = s4.sort((t5, e4) => e4.length - t5.length); - let n3 = null, r3 = 1 / 0; - for (let e4, i3 = 0; void 0 !== (e4 = s4[i3]); i3++) { - const s5 = D(t4, e4); - s5 <= 3 && s5 < r3 && (r3 = s5, n3 = e4); - } - n3 && e3.fail(i2("Did you mean %s?", n3)); - }, r2.reset = function(t4) { - return o2 = g(o2, (e4) => !t4[e4]), l2 = g(l2, (e4) => !t4[e4]), r2; - }; - const c2 = []; - return r2.freeze = function() { - c2.push({ implied: o2, conflicting: l2 }); - }, r2.unfreeze = function() { - const t4 = c2.pop(); - d(t4, void 0, s3), { implied: o2, conflicting: l2 } = t4; - }, r2; - }(this, v(this, pt, "f"), v(this, ct, "f")), "f"), O(this, z, v(this, z, "f") ? v(this, z, "f").reset() : function(t3, e3, s3, i2) { - return new M(t3, e3, s3, i2); - }(v(this, pt, "f"), v(this, mt, "f"), v(this, B, "f"), v(this, ct, "f")), "f"), v(this, F, "f") || O(this, F, function(t3, e3, s3, i2) { - return new N(t3, e3, s3, i2); - }(this, v(this, pt, "f"), v(this, z, "f"), v(this, ct, "f")), "f"), v(this, B, "f").reset(), O(this, U, null, "f"), O(this, tt, "", "f"), O(this, V, null, "f"), O(this, J, false, "f"), this.parsed = false, this; - } - [Tt](t2, e2) { - return v(this, ct, "f").path.relative(t2, e2); - } - [Bt](t2, s2, i2, n2 = 0, r2 = false) { - let o2 = !!i2 || r2; - t2 = t2 || v(this, ht, "f"), v(this, et, "f").__ = v(this, ct, "f").y18n.__, v(this, et, "f").configuration = this[jt](); - const a2 = !!v(this, et, "f").configuration["populate--"], h2 = Object.assign({}, v(this, et, "f").configuration, { "populate--": true }), l2 = v(this, ct, "f").Parser.detailed(t2, Object.assign({}, v(this, et, "f"), { configuration: { "parse-positional-numbers": false, ...h2 } })), c2 = Object.assign(l2.argv, v(this, rt, "f")); - let d2; - const u2 = l2.aliases; - let p2 = false, g2 = false; - Object.keys(c2).forEach((t3) => { - t3 === v(this, Z, "f") && c2[t3] ? p2 = true : t3 === v(this, gt, "f") && c2[t3] && (g2 = true); - }), c2.$0 = this.$0, this.parsed = l2, 0 === n2 && v(this, pt, "f").clearCachedHelpMessage(); - try { - if (this[_t](), s2) - return this[Rt](c2, a2, !!i2, false); - if (v(this, Z, "f")) { - [v(this, Z, "f")].concat(u2[v(this, Z, "f")] || []).filter((t3) => t3.length > 1).includes("" + c2._[c2._.length - 1]) && (c2._.pop(), p2 = true); - } - O(this, X, false, "f"); - const h3 = v(this, z, "f").getCommands(), m2 = v(this, F, "f").completionKey in c2, y2 = p2 || m2 || r2; - if (c2._.length) { - if (h3.length) { - let t3; - for (let e2, s3 = n2 || 0; void 0 !== c2._[s3]; s3++) { - if (e2 = String(c2._[s3]), h3.includes(e2) && e2 !== v(this, U, "f")) { - const t4 = v(this, z, "f").runCommand(e2, this, l2, s3 + 1, r2, p2 || g2 || r2); - return this[Rt](t4, a2, !!i2, false); - } - if (!t3 && e2 !== v(this, U, "f")) { - t3 = e2; - break; - } - } - !v(this, z, "f").hasDefaultCommand() && v(this, lt, "f") && t3 && !y2 && v(this, mt, "f").recommendCommands(t3, h3); - } - v(this, U, "f") && c2._.includes(v(this, U, "f")) && !m2 && (v(this, T, "f") && E(true), this.showCompletionScript(), this.exit(0)); - } - if (v(this, z, "f").hasDefaultCommand() && !y2) { - const t3 = v(this, z, "f").runCommand(null, this, l2, 0, r2, p2 || g2 || r2); - return this[Rt](t3, a2, !!i2, false); - } - if (m2) { - v(this, T, "f") && E(true); - const s3 = (t2 = [].concat(t2)).slice(t2.indexOf(`--${v(this, F, "f").completionKey}`) + 1); - return v(this, F, "f").getCompletion(s3, (t3, s4) => { - if (t3) - throw new e(t3.message); - (s4 || []).forEach((t4) => { - v(this, Q, "f").log(t4); - }), this.exit(0); - }), this[Rt](c2, !a2, !!i2, false); - } - if (v(this, J, "f") || (p2 ? (v(this, T, "f") && E(true), o2 = true, this.showHelp("log"), this.exit(0)) : g2 && (v(this, T, "f") && E(true), o2 = true, v(this, pt, "f").showVersion("log"), this.exit(0))), !o2 && v(this, et, "f").skipValidation.length > 0 && (o2 = Object.keys(c2).some((t3) => v(this, et, "f").skipValidation.indexOf(t3) >= 0 && true === c2[t3])), !o2) { - if (l2.error) - throw new e(l2.error.message); - if (!m2) { - const t3 = this[Yt](u2, {}, l2.error); - i2 || (d2 = C(c2, this, v(this, B, "f").getMiddleware(), true)), d2 = this[Dt](t3, null != d2 ? d2 : c2), f(d2) && !i2 && (d2 = d2.then(() => C(c2, this, v(this, B, "f").getMiddleware(), false))); - } - } - } catch (t3) { - if (!(t3 instanceof e)) - throw t3; - v(this, pt, "f").fail(t3.message, t3); - } - return this[Rt](null != d2 ? d2 : c2, a2, !!i2, true); - } - [Yt](t2, s2, i2, n2) { - const r2 = { ...this.getDemandedOptions() }; - return (o2) => { - if (i2) - throw new e(i2.message); - v(this, mt, "f").nonOptionCount(o2), v(this, mt, "f").requiredArguments(o2, r2); - let a2 = false; - v(this, dt, "f") && (a2 = v(this, mt, "f").unknownCommands(o2)), v(this, ft, "f") && !a2 ? v(this, mt, "f").unknownArguments(o2, t2, s2, !!n2) : v(this, ut, "f") && v(this, mt, "f").unknownArguments(o2, t2, {}, false, false), v(this, mt, "f").limitedChoices(o2), v(this, mt, "f").implications(o2), v(this, mt, "f").conflicting(o2); - }; - } - [Jt]() { - O(this, J, true, "f"); - } - [Zt](t2) { - if ("string" == typeof t2) - v(this, et, "f").key[t2] = true; - else - for (const e2 of t2) - v(this, et, "f").key[e2] = true; - } - }; - var Qt; - var te; - var { readFileSync: ee } = require("fs"); - var { inspect: se } = require("util"); - var { resolve: ie } = require("path"); - var ne = require_build(); - var re = require_build2(); - var oe; - var ae = { assert: { notStrictEqual: t.notStrictEqual, strictEqual: t.strictEqual }, cliui: require_build3(), findUp: require_sync(), getEnv: (t2) => process.env[t2], getCallerFile: require_get_caller_file(), getProcessArgvBin: y, inspect: se, mainFilename: null !== (te = null === (Qt = null === require || void 0 === require ? void 0 : require.main) || void 0 === Qt ? void 0 : Qt.filename) && void 0 !== te ? te : process.cwd(), Parser: re, path: require("path"), process: { argv: () => process.argv, cwd: process.cwd, emitWarning: (t2, e2) => process.emitWarning(t2, e2), execPath: () => process.execPath, exit: (t2) => { - process.exit(t2); - }, nextTick: process.nextTick, stdColumns: void 0 !== process.stdout.columns ? process.stdout.columns : null }, readFileSync: ee, require, requireDirectory: require_require_directory(), stringWidth: require_string_width(), y18n: ne({ directory: ie(__dirname, "../locales"), updateFiles: false }) }; - var he = (null === (oe = null === process || void 0 === process ? void 0 : process.env) || void 0 === oe ? void 0 : oe.YARGS_MIN_NODE_VERSION) ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12; - if (process && process.version) { - if (Number(process.version.match(/v([^.]+)/)[1]) < he) - throw Error(`yargs supports a minimum Node.js version of ${he}. Read our version support policy: https://github.com/yargs/yargs#supported-nodejs-versions`); - } - var le = require_build2(); - var ce; - var fe = { applyExtends: n, cjsPlatformShim: ae, Yargs: (ce = ae, (t2 = [], e2 = ce.process.cwd(), s2) => { - const i2 = new Xt(t2, e2, s2, ce); - return Object.defineProperty(i2, "argv", { get: () => i2.parse(), enumerable: true }), i2.help(), i2.version(), i2; - }), argsert: h, isPromise: f, objFilter: g, parseCommand: o, Parser: le, processArgv: b, YError: e }; - module2.exports = fe; - } + s4.forEach((e4) => { + t5 += e4; + }), + e3.fail(t5); + } + }); + let l2 = {}; + (r2.conflicts = function (e4, s4) { + h( + " [array|string]", + [e4, s4], + arguments.length, + ), + "object" == typeof e4 + ? Object.keys(e4).forEach( + (t4) => { + r2.conflicts( + t4, + e4[t4], + ); + }, + ) + : (t3.global(e4), + l2[e4] || (l2[e4] = []), + Array.isArray(s4) + ? s4.forEach((t4) => + r2.conflicts( + e4, + t4, + ), + ) + : l2[e4].push(s4)); + }), + (r2.getConflicting = () => l2), + (r2.conflicting = function (n3) { + Object.keys(n3).forEach((t4) => { + l2[t4] && + l2[t4].forEach((s4) => { + s4 && + void 0 !== n3[t4] && + void 0 !== n3[s4] && + e3.fail( + i2( + "Arguments %s and %s are mutually exclusive", + t4, + s4, + ), + ); + }); + }), + t3 + .getInternalMethods() + .getParserConfiguration()[ + "strip-dashed" + ] && + Object.keys(l2).forEach( + (t4) => { + l2[t4].forEach( + (r3) => { + r3 && + void 0 !== + n3[ + s3.Parser.camelCase( + t4, + ) + ] && + void 0 !== + n3[ + s3.Parser.camelCase( + r3, + ) + ] && + e3.fail( + i2( + "Arguments %s and %s are mutually exclusive", + t4, + r3, + ), + ); + }, + ); + }, + ); + }), + (r2.recommendCommands = function ( + t4, + s4, + ) { + s4 = s4.sort( + (t5, e4) => + e4.length - t5.length, + ); + let n3 = null, + r3 = 1 / 0; + for ( + let e4, i3 = 0; + void 0 !== (e4 = s4[i3]); + i3++ + ) { + const s5 = D(t4, e4); + s5 <= 3 && + s5 < r3 && + ((r3 = s5), (n3 = e4)); + } + n3 && + e3.fail( + i2("Did you mean %s?", n3), + ); + }), + (r2.reset = function (t4) { + return ( + (o2 = g(o2, (e4) => !t4[e4])), + (l2 = g(l2, (e4) => !t4[e4])), + r2 + ); + }); + const c2 = []; + return ( + (r2.freeze = function () { + c2.push({ + implied: o2, + conflicting: l2, + }); + }), + (r2.unfreeze = function () { + const t4 = c2.pop(); + d(t4, void 0, s3), + ({ + implied: o2, + conflicting: l2, + } = t4); + }), + r2 + ); + })(this, v(this, pt, "f"), v(this, ct, "f")), + "f", + ), + O( + this, + z, + v(this, z, "f") + ? v(this, z, "f").reset() + : (function (t3, e3, s3, i2) { + return new M(t3, e3, s3, i2); + })( + v(this, pt, "f"), + v(this, mt, "f"), + v(this, B, "f"), + v(this, ct, "f"), + ), + "f", + ), + v(this, F, "f") || + O( + this, + F, + (function (t3, e3, s3, i2) { + return new N(t3, e3, s3, i2); + })( + this, + v(this, pt, "f"), + v(this, z, "f"), + v(this, ct, "f"), + ), + "f", + ), + v(this, B, "f").reset(), + O(this, U, null, "f"), + O(this, tt, "", "f"), + O(this, V, null, "f"), + O(this, J, false, "f"), + (this.parsed = false), + this + ); + } + [Tt](t2, e2) { + return v(this, ct, "f").path.relative(t2, e2); + } + [Bt](t2, s2, i2, n2 = 0, r2 = false) { + let o2 = !!i2 || r2; + (t2 = t2 || v(this, ht, "f")), + (v(this, et, "f").__ = v(this, ct, "f").y18n.__), + (v(this, et, "f").configuration = this[jt]()); + const a2 = !!v(this, et, "f").configuration["populate--"], + h2 = Object.assign({}, v(this, et, "f").configuration, { + "populate--": true, + }), + l2 = v(this, ct, "f").Parser.detailed( + t2, + Object.assign({}, v(this, et, "f"), { + configuration: { + "parse-positional-numbers": false, + ...h2, + }, + }), + ), + c2 = Object.assign(l2.argv, v(this, rt, "f")); + let d2; + const u2 = l2.aliases; + let p2 = false, + g2 = false; + Object.keys(c2).forEach((t3) => { + t3 === v(this, Z, "f") && c2[t3] + ? (p2 = true) + : t3 === v(this, gt, "f") && c2[t3] && (g2 = true); + }), + (c2.$0 = this.$0), + (this.parsed = l2), + 0 === n2 && v(this, pt, "f").clearCachedHelpMessage(); + try { + if ((this[_t](), s2)) return this[Rt](c2, a2, !!i2, false); + if (v(this, Z, "f")) { + [v(this, Z, "f")] + .concat(u2[v(this, Z, "f")] || []) + .filter((t3) => t3.length > 1) + .includes("" + c2._[c2._.length - 1]) && + (c2._.pop(), (p2 = true)); + } + O(this, X, false, "f"); + const h3 = v(this, z, "f").getCommands(), + m2 = v(this, F, "f").completionKey in c2, + y2 = p2 || m2 || r2; + if (c2._.length) { + if (h3.length) { + let t3; + for ( + let e2, s3 = n2 || 0; + void 0 !== c2._[s3]; + s3++ + ) { + if ( + ((e2 = String(c2._[s3])), + h3.includes(e2) && e2 !== v(this, U, "f")) + ) { + const t4 = v(this, z, "f").runCommand( + e2, + this, + l2, + s3 + 1, + r2, + p2 || g2 || r2, + ); + return this[Rt](t4, a2, !!i2, false); + } + if (!t3 && e2 !== v(this, U, "f")) { + t3 = e2; + break; + } + } + !v(this, z, "f").hasDefaultCommand() && + v(this, lt, "f") && + t3 && + !y2 && + v(this, mt, "f").recommendCommands(t3, h3); + } + v(this, U, "f") && + c2._.includes(v(this, U, "f")) && + !m2 && + (v(this, T, "f") && E(true), + this.showCompletionScript(), + this.exit(0)); + } + if (v(this, z, "f").hasDefaultCommand() && !y2) { + const t3 = v(this, z, "f").runCommand( + null, + this, + l2, + 0, + r2, + p2 || g2 || r2, + ); + return this[Rt](t3, a2, !!i2, false); + } + if (m2) { + v(this, T, "f") && E(true); + const s3 = (t2 = [].concat(t2)).slice( + t2.indexOf(`--${v(this, F, "f").completionKey}`) + + 1, + ); + return ( + v(this, F, "f").getCompletion(s3, (t3, s4) => { + if (t3) throw new e(t3.message); + (s4 || []).forEach((t4) => { + v(this, Q, "f").log(t4); + }), + this.exit(0); + }), + this[Rt](c2, !a2, !!i2, false) + ); + } + if ( + (v(this, J, "f") || + (p2 + ? (v(this, T, "f") && E(true), + (o2 = true), + this.showHelp("log"), + this.exit(0)) + : g2 && + (v(this, T, "f") && E(true), + (o2 = true), + v(this, pt, "f").showVersion("log"), + this.exit(0))), + !o2 && + v(this, et, "f").skipValidation.length > 0 && + (o2 = Object.keys(c2).some( + (t3) => + v(this, et, "f").skipValidation.indexOf( + t3, + ) >= 0 && true === c2[t3], + )), + !o2) + ) { + if (l2.error) throw new e(l2.error.message); + if (!m2) { + const t3 = this[Yt](u2, {}, l2.error); + i2 || + (d2 = C( + c2, + this, + v(this, B, "f").getMiddleware(), + true, + )), + (d2 = this[Dt](t3, null != d2 ? d2 : c2)), + f(d2) && + !i2 && + (d2 = d2.then(() => + C( + c2, + this, + v(this, B, "f").getMiddleware(), + false, + ), + )); + } + } + } catch (t3) { + if (!(t3 instanceof e)) throw t3; + v(this, pt, "f").fail(t3.message, t3); + } + return this[Rt](null != d2 ? d2 : c2, a2, !!i2, true); + } + [Yt](t2, s2, i2, n2) { + const r2 = { ...this.getDemandedOptions() }; + return (o2) => { + if (i2) throw new e(i2.message); + v(this, mt, "f").nonOptionCount(o2), + v(this, mt, "f").requiredArguments(o2, r2); + let a2 = false; + v(this, dt, "f") && + (a2 = v(this, mt, "f").unknownCommands(o2)), + v(this, ft, "f") && !a2 + ? v(this, mt, "f").unknownArguments( + o2, + t2, + s2, + !!n2, + ) + : v(this, ut, "f") && + v(this, mt, "f").unknownArguments( + o2, + t2, + {}, + false, + false, + ), + v(this, mt, "f").limitedChoices(o2), + v(this, mt, "f").implications(o2), + v(this, mt, "f").conflicting(o2); + }; + } + [Jt]() { + O(this, J, true, "f"); + } + [Zt](t2) { + if ("string" == typeof t2) v(this, et, "f").key[t2] = true; + else for (const e2 of t2) v(this, et, "f").key[e2] = true; + } + }; + var Qt; + var te; + var { readFileSync: ee } = require("fs"); + var { inspect: se } = require("util"); + var { resolve: ie } = require("path"); + var ne = require_build(); + var re = require_build2(); + var oe; + var ae = { + assert: { + notStrictEqual: t.notStrictEqual, + strictEqual: t.strictEqual, + }, + cliui: require_build3(), + findUp: require_sync(), + getEnv: (t2) => process.env[t2], + getCallerFile: require_get_caller_file(), + getProcessArgvBin: y, + inspect: se, + mainFilename: + null !== + (te = + null === + (Qt = + null === require || void 0 === require + ? void 0 + : require.main) || void 0 === Qt + ? void 0 + : Qt.filename) && void 0 !== te + ? te + : process.cwd(), + Parser: re, + path: require("path"), + process: { + argv: () => process.argv, + cwd: process.cwd, + emitWarning: (t2, e2) => process.emitWarning(t2, e2), + execPath: () => process.execPath, + exit: (t2) => { + process.exit(t2); + }, + nextTick: process.nextTick, + stdColumns: + void 0 !== process.stdout.columns + ? process.stdout.columns + : null, + }, + readFileSync: ee, + require, + requireDirectory: require_require_directory(), + stringWidth: require_string_width(), + y18n: ne({ + directory: ie(__dirname, "../locales"), + updateFiles: false, + }), + }; + var he = ( + null === + (oe = + null === process || void 0 === process + ? void 0 + : process.env) || void 0 === oe + ? void 0 + : oe.YARGS_MIN_NODE_VERSION + ) + ? Number(process.env.YARGS_MIN_NODE_VERSION) + : 12; + if (process && process.version) { + if (Number(process.version.match(/v([^.]+)/)[1]) < he) + throw Error( + `yargs supports a minimum Node.js version of ${he}. Read our version support policy: https://github.com/yargs/yargs#supported-nodejs-versions`, + ); + } + var le = require_build2(); + var ce; + var fe = { + applyExtends: n, + cjsPlatformShim: ae, + Yargs: + ((ce = ae), + (t2 = [], e2 = ce.process.cwd(), s2) => { + const i2 = new Xt(t2, e2, s2, ce); + return ( + Object.defineProperty(i2, "argv", { + get: () => i2.parse(), + enumerable: true, + }), + i2.help(), + i2.version(), + i2 + ); + }), + argsert: h, + isPromise: f, + objFilter: g, + parseCommand: o, + Parser: le, + processArgv: b, + YError: e, + }; + module2.exports = fe; + }, }); // node_modules/yargs/index.cjs var require_yargs = __commonJS({ - "node_modules/yargs/index.cjs"(exports, module2) { - "use strict"; - var { Yargs, processArgv } = require_build4(); - Argv(processArgv.hideBin(process.argv)); - module2.exports = Argv; - function Argv(processArgs, cwd) { - const argv2 = Yargs(processArgs, cwd, require); - singletonify(argv2); - return argv2; - } - function defineGetter(obj, key, getter) { - Object.defineProperty(obj, key, { - configurable: true, - enumerable: true, - get: getter - }); - } - function lookupGetter(obj, key) { - const desc = Object.getOwnPropertyDescriptor(obj, key); - if (typeof desc !== "undefined") { - return desc.get; - } - } - function singletonify(inst) { - [ - ...Object.keys(inst), - ...Object.getOwnPropertyNames(inst.constructor.prototype) - ].forEach((key) => { - if (key === "argv") { - defineGetter(Argv, key, lookupGetter(inst, key)); - } else if (typeof inst[key] === "function") { - Argv[key] = inst[key].bind(inst); - } else { - defineGetter(Argv, "$0", () => inst.$0); - defineGetter(Argv, "parsed", () => inst.parsed); - } - }); - } - } + "node_modules/yargs/index.cjs"(exports, module2) { + "use strict"; + var { Yargs, processArgv } = require_build4(); + Argv(processArgv.hideBin(process.argv)); + module2.exports = Argv; + function Argv(processArgs, cwd) { + const argv2 = Yargs(processArgs, cwd, require); + singletonify(argv2); + return argv2; + } + function defineGetter(obj, key, getter) { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: true, + get: getter, + }); + } + function lookupGetter(obj, key) { + const desc = Object.getOwnPropertyDescriptor(obj, key); + if (typeof desc !== "undefined") { + return desc.get; + } + } + function singletonify(inst) { + [ + ...Object.keys(inst), + ...Object.getOwnPropertyNames(inst.constructor.prototype), + ].forEach((key) => { + if (key === "argv") { + defineGetter(Argv, key, lookupGetter(inst, key)); + } else if (typeof inst[key] === "function") { + Argv[key] = inst[key].bind(inst); + } else { + defineGetter(Argv, "$0", () => inst.$0); + defineGetter(Argv, "parsed", () => inst.parsed); + } + }); + } + }, }); // src/scanProcess.ts @@ -4703,12 +7596,11 @@ var import_net = require("net"); // src/lib/misc.ts function pick(obj, keys) { - const ret = {}; - for (const key of keys) { - if (key in obj) - ret[key] = obj[key]; - } - return ret; + const ret = {}; + for (const key of keys) { + if (key in obj) ret[key] = obj[key]; + } + return ret; } // src/lib/scanProcessInterface.ts @@ -4716,213 +7608,208 @@ var import_typeguards = __toESM(require_typeguards()); // src/scanProcess.ts var yargs = require_yargs(); -var argv = yargs.env("IOB_BLE").strict().usage("ioBroker.ble scanner process\n\nUsage: $0 [options]").options({ - hciDevice: { - alias: "-d", - type: "number", - desc: "Index of the HCI device to use for scanning", - default: 0 - }, - services: { - alias: "-s", - type: "array", - desc: "Which BLE services to scan for", - default: [] - }, - listenInterface: { - alias: "-i", - type: "string", - desc: "If not spawned as a child process, the interface to listen for TCP connections. Default: all interfaces." - }, - listenPort: { - alias: "-p", - type: "number", - desc: "If not spawned as a child process, the port to listen on.", - default: 8734 - } -}).parseSync(); +var argv = yargs + .env("IOB_BLE") + .strict() + .usage("ioBroker.ble scanner process\n\nUsage: $0 [options]") + .options({ + hciDevice: { + alias: "-d", + type: "number", + desc: "Index of the HCI device to use for scanning", + default: 0, + }, + services: { + alias: "-s", + type: "array", + desc: "Which BLE services to scan for", + default: [], + }, + listenInterface: { + alias: "-i", + type: "string", + desc: "If not spawned as a child process, the interface to listen for TCP connections. Default: all interfaces.", + }, + listenPort: { + alias: "-p", + type: "number", + desc: "If not spawned as a child process, the port to listen on.", + default: 8734, + }, + }) + .parseSync(); var noble; var server; var clients = /* @__PURE__ */ new Set(); function sendAsync(message, sendHandle, swallowErrors = true) { - if (process.send) { - return new Promise((resolve, reject) => { - process.send(message, sendHandle, void 0, (err) => { - if (err && !swallowErrors) - reject(err); - else - resolve(); - }); - }); - } else { - const promises = [...clients].map((client) => { - return new Promise((resolve, reject) => { - client.write(JSON.stringify(message) + "\n", (err) => { - if (err && !swallowErrors) - reject(err); - else - resolve(); - }); - }); - }); - return Promise.all(promises).then(() => void 0); - } + if (process.send) { + return new Promise((resolve, reject) => { + process.send(message, sendHandle, void 0, (err) => { + if (err && !swallowErrors) reject(err); + else resolve(); + }); + }); + } else { + const promises = [...clients].map((client) => { + return new Promise((resolve, reject) => { + client.write(JSON.stringify(message) + "\n", (err) => { + if (err && !swallowErrors) reject(err); + else resolve(); + }); + }); + }); + return Promise.all(promises).then(() => void 0); + } } -Error.prototype.toJSON = function() { - const ret = { - type: "Error", - name: this.name, - message: this.message, - stack: this.stack - }; - for (const key of Object.keys(this)) { - if (!ret[key]) { - ret[key] = this[key]; - } - } - return ret; +Error.prototype.toJSON = function () { + const ret = { + type: "Error", + name: this.name, + message: this.message, + stack: this.stack, + }; + for (const key of Object.keys(this)) { + if (!ret[key]) { + ret[key] = this[key]; + } + } + return ret; }; process.on("uncaughtException", (error) => { - sendAsync({ type: "error", error }); + sendAsync({ type: "error", error }); }); process.on("unhandledRejection", (error) => { - sendAsync({ - type: "error", - error: ( - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions - error instanceof Error ? error : new Error(`${error}`) - ) - }); + sendAsync({ + type: "error", + error: + // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + error instanceof Error ? error : new Error(`${error}`), + }); }); process.on("message", (msg) => { - handleMessage(msg); + handleMessage(msg); }); function handleMessage(msg) { - switch (msg.type) { - case "startScanning": - startScanning(); - break; - case "stopScanning": - stopScanning(); - break; - } + switch (msg.type) { + case "startScanning": + startScanning(); + break; + case "stopScanning": + stopScanning(); + break; + } } function serializePeripheral(peripheral) { - return pick(peripheral, [ - "id", - "uuid", - "address", - "addressType", - "connectable", - "advertisement", - "rssi", - "services", - "state" - ]); + return pick(peripheral, [ + "id", + "uuid", + "address", + "addressType", + "connectable", + "advertisement", + "rssi", + "services", + "state", + ]); } function onDiscover(peripheral) { - if (peripheral == void 0) - return; - sendAsync({ - type: "discover", - peripheral: serializePeripheral(peripheral) - }); + if (peripheral == void 0) return; + sendAsync({ + type: "discover", + peripheral: serializePeripheral(peripheral), + }); } var isScanning = false; async function startScanning() { - if (isScanning) - return; - await sendAsync({ type: "connected" }); - await sendAsync({ - type: "log", - message: `starting scan for services ${JSON.stringify(argv.services)}` - }); - noble.on("discover", onDiscover); - await noble.startScanningAsync(argv.services, true); - isScanning = true; + if (isScanning) return; + await sendAsync({ type: "connected" }); + await sendAsync({ + type: "log", + message: `starting scan for services ${JSON.stringify(argv.services)}`, + }); + noble.on("discover", onDiscover); + await noble.startScanningAsync(argv.services, true); + isScanning = true; } async function stopScanning() { - if (!isScanning) - return; - noble.removeAllListeners("discover"); - sendAsync({ - type: "log", - message: `stopping scan` - }); - noble.stopScanning(); - sendAsync({ type: "disconnected" }); - isScanning = false; + if (!isScanning) return; + noble.removeAllListeners("discover"); + sendAsync({ + type: "log", + message: `stopping scan`, + }); + noble.stopScanning(); + sendAsync({ type: "disconnected" }); + isScanning = false; } function maybeStartServer() { - if (process.send) - return Promise.resolve(); - return new Promise((resolve, reject) => { - server = (0, import_net.createServer)((socket) => { - console.log("Client connected"); - clients.add(socket); - socket.on("close", () => { - console.log("Client disconnected"); - clients.delete(socket); - }); - }); - server.maxConnections = 1; - server.on("error", (err) => { - if (err.code === "EADDRINUSE") { - reject(err); - } - }); - server.listen( - { - host: argv.listenInterface, - port: argv.listenPort - }, - () => { - const address = server.address(); - console.log( - `Server listening on tcp://${address.address}:${address.port}` - ); - resolve(); - } - ); - }); + if (process.send) return Promise.resolve(); + return new Promise((resolve, reject) => { + server = (0, import_net.createServer)((socket) => { + console.log("Client connected"); + clients.add(socket); + socket.on("close", () => { + console.log("Client disconnected"); + clients.delete(socket); + }); + }); + server.maxConnections = 1; + server.on("error", (err) => { + if (err.code === "EADDRINUSE") { + reject(err); + } + }); + server.listen( + { + host: argv.listenInterface, + port: argv.listenPort, + }, + () => { + const address = server.address(); + console.log( + `Server listening on tcp://${address.address}:${address.port}`, + ); + resolve(); + }, + ); + }); } async function loadNoble() { - process.env.NOBLE_HCI_DEVICE_ID = argv.hciDevice.toString(); - try { - noble = require("@abandonware/noble"); - if (typeof noble.on !== "function") { - noble = noble({ extended: false }); - } - } catch (error) { - await sendAsync({ type: "fatal", error }); - process.exit(1 /* RequireNobleFailed */); - } + process.env.NOBLE_HCI_DEVICE_ID = argv.hciDevice.toString(); + try { + noble = require("@stoprocent/noble"); + if (typeof noble.on !== "function") { + noble = noble({ extended: false }); + } + } catch (error) { + await sendAsync({ type: "fatal", error }); + process.exit(1 /* RequireNobleFailed */); + } } async function main() { - noble.on("stateChange", (state) => { - switch (state) { - case "poweredOn": - startScanning(); - break; - case "poweredOff": - stopScanning(); - break; - } - console.log(`driver state is ${state}`); - sendAsync({ type: "driverState", driverState: state }); - }); - if (noble.state === "poweredOn") - startScanning(); - sendAsync({ type: "driverState", driverState: noble.state }); + noble.on("stateChange", (state) => { + switch (state) { + case "poweredOn": + startScanning(); + break; + case "poweredOff": + stopScanning(); + break; + } + console.log(`driver state is ${state}`); + sendAsync({ type: "driverState", driverState: state }); + }); + if (noble.state === "poweredOn") startScanning(); + sendAsync({ type: "driverState", driverState: noble.state }); } (async () => { - await loadNoble(); - await maybeStartServer(); - if (server) { - server.once("connection", () => { - main(); - }); - } else { - main(); - } + await loadNoble(); + await maybeStartServer(); + if (server) { + server.once("connection", () => { + main(); + }); + } else { + main(); + } })(); diff --git a/build/lib/scanProcessInterface.js.map b/build/lib/scanProcessInterface.js.map index e35a0db6..6cbf074f 100644 --- a/build/lib/scanProcessInterface.js.map +++ b/build/lib/scanProcessInterface.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../../src/lib/scanProcessInterface.ts"], - "sourcesContent": ["import type { Peripheral } from \"@abandonware/noble\";\nimport { isArray, isObject } from \"alcalzone-shared/typeguards\";\n\nexport enum ScanExitCodes {\n\tRequireNobleFailed = 1,\n}\n\nexport type InboundMessage =\n\t| {\n\t\t\ttype: \"startScanning\";\n\t }\n\t| {\n\t\t\ttype: \"stopScanning\";\n\t };\n\nexport type ScanMessage =\n\t| {\n\t\t\ttype: \"error\";\n\t\t\terror: Error;\n\t }\n\t| {\n\t\t\ttype: \"fatal\";\n\t\t\terror: Error;\n\t }\n\t| {\n\t\t\ttype: \"connected\";\n\t }\n\t| {\n\t\t\ttype: \"disconnected\";\n\t }\n\t| {\n\t\t\ttype: \"driverState\";\n\t\t\tdriverState: string;\n\t }\n\t| {\n\t\t\ttype: \"log\";\n\t\t\tmessage: string;\n\t\t\tlevel?: ioBroker.LogLevel;\n\t }\n\t| {\n\t\t\ttype: \"discover\";\n\t\t\tperipheral: PeripheralInfo;\n\t };\n\nexport type PeripheralInfo = Pick<\n\tPeripheral,\n\t| \"id\"\n\t| \"uuid\"\n\t| \"address\"\n\t| \"addressType\"\n\t| \"connectable\"\n\t| \"advertisement\"\n\t| \"rssi\"\n\t| \"services\"\n\t| \"state\"\n>;\n\nexport function getMessageReviver>(\n\tcallback: (message: T) => void,\n): (input: Record) => void {\n\tconst reviveValue = (value: any): any => {\n\t\tif (isArray(value)) {\n\t\t\treturn value.map((v: any) => reviveValue(v));\n\t\t} else if (isObject(value)) {\n\t\t\tconst v = value as any;\n\t\t\tif (v.type === \"Buffer\" && isArray(v.data)) {\n\t\t\t\treturn Buffer.from(v.data);\n\t\t\t} else if (\n\t\t\t\tv.type === \"Error\" &&\n\t\t\t\ttypeof v.name === \"string\" &&\n\t\t\t\ttypeof v.message === \"string\"\n\t\t\t) {\n\t\t\t\tconst ret = new Error(v.message);\n\t\t\t\tret.name = v.name;\n\t\t\t\tret.stack = v.stack;\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\t\treturn reviveObject(value);\n\t\t} else {\n\t\t\treturn value;\n\t\t}\n\t};\n\tconst reviveObject = (input: Record): Record => {\n\t\tconst ret: Record = {};\n\t\tfor (const [key, value] of Object.entries(input)) {\n\t\t\tret[key] = reviveValue(value);\n\t\t}\n\t\treturn ret;\n\t};\n\n\treturn (input) => {\n\t\tcallback(reviveObject(input) as T);\n\t};\n}\n"], + "sourcesContent": ["import type { Peripheral } from \"@stoprocent/noble\";\nimport { isArray, isObject } from \"alcalzone-shared/typeguards\";\n\nexport enum ScanExitCodes {\n\tRequireNobleFailed = 1,\n}\n\nexport type InboundMessage =\n\t| {\n\t\t\ttype: \"startScanning\";\n\t }\n\t| {\n\t\t\ttype: \"stopScanning\";\n\t };\n\nexport type ScanMessage =\n\t| {\n\t\t\ttype: \"error\";\n\t\t\terror: Error;\n\t }\n\t| {\n\t\t\ttype: \"fatal\";\n\t\t\terror: Error;\n\t }\n\t| {\n\t\t\ttype: \"connected\";\n\t }\n\t| {\n\t\t\ttype: \"disconnected\";\n\t }\n\t| {\n\t\t\ttype: \"driverState\";\n\t\t\tdriverState: string;\n\t }\n\t| {\n\t\t\ttype: \"log\";\n\t\t\tmessage: string;\n\t\t\tlevel?: ioBroker.LogLevel;\n\t }\n\t| {\n\t\t\ttype: \"discover\";\n\t\t\tperipheral: PeripheralInfo;\n\t };\n\nexport type PeripheralInfo = Pick<\n\tPeripheral,\n\t| \"id\"\n\t| \"uuid\"\n\t| \"address\"\n\t| \"addressType\"\n\t| \"connectable\"\n\t| \"advertisement\"\n\t| \"rssi\"\n\t| \"services\"\n\t| \"state\"\n>;\n\nexport function getMessageReviver>(\n\tcallback: (message: T) => void,\n): (input: Record) => void {\n\tconst reviveValue = (value: any): any => {\n\t\tif (isArray(value)) {\n\t\t\treturn value.map((v: any) => reviveValue(v));\n\t\t} else if (isObject(value)) {\n\t\t\tconst v = value as any;\n\t\t\tif (v.type === \"Buffer\" && isArray(v.data)) {\n\t\t\t\treturn Buffer.from(v.data);\n\t\t\t} else if (\n\t\t\t\tv.type === \"Error\" &&\n\t\t\t\ttypeof v.name === \"string\" &&\n\t\t\t\ttypeof v.message === \"string\"\n\t\t\t) {\n\t\t\t\tconst ret = new Error(v.message);\n\t\t\t\tret.name = v.name;\n\t\t\t\tret.stack = v.stack;\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\t\treturn reviveObject(value);\n\t\t} else {\n\t\t\treturn value;\n\t\t}\n\t};\n\tconst reviveObject = (input: Record): Record => {\n\t\tconst ret: Record = {};\n\t\tfor (const [key, value] of Object.entries(input)) {\n\t\t\tret[key] = reviveValue(value);\n\t\t}\n\t\treturn ret;\n\t};\n\n\treturn (input) => {\n\t\tcallback(reviveObject(input) as T);\n\t};\n}\n"], "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAAkC;AAE3B,IAAK,gBAAL,kBAAKA,mBAAL;AACN,EAAAA,8BAAA,wBAAqB,KAArB;AADW,SAAAA;AAAA,GAAA;AAsDL,SAAS,kBACf,UACuC;AACvC,QAAM,cAAc,CAAC,UAAoB;AACxC,YAAI,2BAAQ,KAAK,GAAG;AACnB,aAAO,MAAM,IAAI,CAAC,MAAW,YAAY,CAAC,CAAC;AAAA,IAC5C,eAAW,4BAAS,KAAK,GAAG;AAC3B,YAAM,IAAI;AACV,UAAI,EAAE,SAAS,gBAAY,2BAAQ,EAAE,IAAI,GAAG;AAC3C,eAAO,OAAO,KAAK,EAAE,IAAI;AAAA,MAC1B,WACC,EAAE,SAAS,WACX,OAAO,EAAE,SAAS,YAClB,OAAO,EAAE,YAAY,UACpB;AACD,cAAM,MAAM,IAAI,MAAM,EAAE,OAAO;AAC/B,YAAI,OAAO,EAAE;AACb,YAAI,QAAQ,EAAE;AACd,eAAO;AAAA,MACR;AAEA,aAAO,aAAa,KAAK;AAAA,IAC1B,OAAO;AACN,aAAO;AAAA,IACR;AAAA,EACD;AACA,QAAM,eAAe,CAAC,UAAoD;AACzE,UAAM,MAA2B,CAAC;AAClC,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,KAAK,GAAG;AACjD,UAAI,OAAO,YAAY,KAAK;AAAA,IAC7B;AACA,WAAO;AAAA,EACR;AAEA,SAAO,CAAC,UAAU;AACjB,aAAS,aAAa,KAAK,CAAM;AAAA,EAClC;AACD;", "names": ["ScanExitCodes"] } diff --git a/build/scanProcess.js b/build/scanProcess.js index c4fea2a3..6e70dd64 100644 --- a/build/scanProcess.js +++ b/build/scanProcess.js @@ -174,7 +174,7 @@ function maybeStartServer() { async function loadNoble() { process.env.NOBLE_HCI_DEVICE_ID = argv.hciDevice.toString(); try { - noble = require("@abandonware/noble"); + noble = require("@stoprocent/noble"); if (typeof noble.on !== "function") { noble = noble({ extended: false }); } diff --git a/build/scanProcess.js.map b/build/scanProcess.js.map index e602f9fe..540a1142 100644 --- a/build/scanProcess.js.map +++ b/build/scanProcess.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../src/scanProcess.ts"], - "sourcesContent": ["/** noble-Treiber-Instanz */\nimport type { Peripheral } from \"@abandonware/noble\";\nimport { createServer, type AddressInfo, type Server, type Socket } from \"net\";\nimport { pick } from \"./lib/misc\";\nimport {\n\tScanExitCodes,\n\ttype InboundMessage,\n\ttype PeripheralInfo,\n\ttype ScanMessage,\n} from \"./lib/scanProcessInterface\";\nimport yargs = require(\"yargs\");\n\n/** Define command line arguments */\nconst argv = yargs\n\t.env(\"IOB_BLE\")\n\t.strict()\n\t.usage(\"ioBroker.ble scanner process\\n\\nUsage: $0 [options]\")\n\t.options({\n\t\thciDevice: {\n\t\t\talias: \"-d\",\n\t\t\ttype: \"number\",\n\t\t\tdesc: \"Index of the HCI device to use for scanning\",\n\t\t\tdefault: 0,\n\t\t},\n\t\tservices: {\n\t\t\talias: \"-s\",\n\t\t\ttype: \"string\",\n\t\t\tarray: true,\n\t\t\tdesc: \"Which BLE services to scan for\",\n\t\t\tdefault: [],\n\t\t},\n\t\tlistenInterface: {\n\t\t\talias: \"-i\",\n\t\t\ttype: \"string\",\n\t\t\tdesc: \"If not spawned as a child process, the interface to listen for TCP connections. Default: all interfaces.\",\n\t\t},\n\t\tlistenPort: {\n\t\t\talias: \"-p\",\n\t\t\ttype: \"number\",\n\t\t\tdesc: \"If not spawned as a child process, the port to listen on.\",\n\t\t\tdefault: 8734,\n\t\t},\n\t})\n\t.parseSync();\n\nlet noble: typeof import(\"@abandonware/noble\");\nlet server: Server | undefined;\nconst clients: Set = new Set();\n\nfunction sendAsync(\n\tmessage: ScanMessage,\n\tsendHandle?: any,\n\tswallowErrors: boolean = true,\n): Promise {\n\tif (process.send) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tprocess.send!(message, sendHandle, undefined, (err) => {\n\t\t\t\tif (err && !swallowErrors) reject(err);\n\t\t\t\telse resolve();\n\t\t\t});\n\t\t});\n\t} else {\n\t\tconst promises = [...clients].map((client) => {\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tclient.write(JSON.stringify(message) + \"\\n\", (err) => {\n\t\t\t\t\tif (err && !swallowErrors) reject(err);\n\t\t\t\t\telse resolve();\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t\treturn Promise.all(promises).then(() => undefined);\n\t}\n}\n\n// @ts-expect-error We need this to serialize and deserialize Error objects\nError.prototype.toJSON = function (this: Error) {\n\tconst ret: Record = {\n\t\ttype: \"Error\",\n\t\tname: this.name,\n\t\tmessage: this.message,\n\t\tstack: this.stack,\n\t};\n\t// Add any custom properties such as .code in file-system errors\n\tfor (const key of Object.keys(this) as (keyof Error)[]) {\n\t\tif (!ret[key]) {\n\t\t\tret[key] = this[key];\n\t\t}\n\t}\n\treturn ret;\n};\n\nprocess.on(\"uncaughtException\", (error) => {\n\t// Delegate the error to the parent process and let it decide whether to shut down the scanning process\n\tsendAsync({ type: \"error\", error });\n});\nprocess.on(\"unhandledRejection\", (error) => {\n\t// Delegate the error to the parent process and let it decide whether to shut down the scanning process\n\tsendAsync({\n\t\ttype: \"error\",\n\t\terror:\n\t\t\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\t\t\terror instanceof Error ? error : new Error(`${error}`),\n\t});\n});\n\n// This will be called when an IPC channel exists\nprocess.on(\"message\", (msg) => {\n\thandleMessage(msg as InboundMessage);\n});\n\nfunction handleMessage(msg: InboundMessage) {\n\tswitch (msg.type) {\n\t\tcase \"startScanning\":\n\t\t\tstartScanning();\n\t\t\tbreak;\n\t\tcase \"stopScanning\":\n\t\t\tstopScanning();\n\t\t\tbreak;\n\t}\n}\n\nfunction serializePeripheral(peripheral: Peripheral): PeripheralInfo {\n\treturn pick(peripheral, [\n\t\t\"id\",\n\t\t\"uuid\",\n\t\t\"address\",\n\t\t\"addressType\",\n\t\t\"connectable\",\n\t\t\"advertisement\",\n\t\t\"rssi\",\n\t\t\"services\",\n\t\t\"state\",\n\t]);\n}\n\nfunction onDiscover(peripheral?: Peripheral) {\n\tif (peripheral == undefined) return;\n\tsendAsync({\n\t\ttype: \"discover\",\n\t\tperipheral: serializePeripheral(peripheral),\n\t});\n}\n\nlet isScanning = false;\nasync function startScanning() {\n\tif (isScanning) return;\n\tawait sendAsync({ type: \"connected\" });\n\tawait sendAsync({\n\t\ttype: \"log\",\n\t\tmessage: `starting scan for services ${JSON.stringify(argv.services)}`,\n\t});\n\t// We must allow duplicates in order to support\n\tnoble.on(\"discover\", onDiscover);\n\tawait noble.startScanningAsync(argv.services, true);\n\tisScanning = true;\n}\n\nasync function stopScanning() {\n\tif (!isScanning) return;\n\tnoble.removeAllListeners(\"discover\");\n\tsendAsync({\n\t\ttype: \"log\",\n\t\tmessage: `stopping scan`,\n\t});\n\tnoble.stopScanning();\n\tsendAsync({ type: \"disconnected\" });\n\tisScanning = false;\n}\n\nfunction maybeStartServer(): Promise {\n\t// This is a child process, we have an IPC channel\n\tif (process.send) return Promise.resolve();\n\n\treturn new Promise((resolve, reject) => {\n\t\t// Start a TCP server, listen for connections, and forward them to the serial port\n\t\tserver = createServer((socket) => {\n\t\t\tconsole.log(\"Client connected\");\n\t\t\tclients.add(socket);\n\n\t\t\t// when the connection is closed, unpipe the streams\n\t\t\tsocket.on(\"close\", () => {\n\t\t\t\tconsole.log(\"Client disconnected\");\n\t\t\t\tclients.delete(socket);\n\t\t\t});\n\t\t});\n\n\t\t// Do not allow more than one client to connect\n\t\tserver.maxConnections = 1;\n\n\t\tserver.on(\"error\", (err) => {\n\t\t\tif ((err as any).code === \"EADDRINUSE\") {\n\t\t\t\treject(err);\n\t\t\t}\n\t\t});\n\t\tserver.listen(\n\t\t\t{\n\t\t\t\thost: argv.listenInterface,\n\t\t\t\tport: argv.listenPort,\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tconst address: AddressInfo = server!.address() as any;\n\t\t\t\tconsole.log(\n\t\t\t\t\t`Server listening on tcp://${address.address}:${address.port}`,\n\t\t\t\t);\n\t\t\t\tresolve();\n\t\t\t},\n\t\t);\n\t});\n}\n\nasync function loadNoble() {\n\t// load noble driver with the correct device selected\n\tprocess.env.NOBLE_HCI_DEVICE_ID = argv.hciDevice.toString();\n\ttry {\n\t\t// eslint-disable-next-line @typescript-eslint/no-var-requires\n\t\tnoble = require(\"@abandonware/noble\");\n\t\tif (typeof noble.on !== \"function\") {\n\t\t\t// The following commit broke the default exported instance of noble:\n\t\t\t// https://github.com/abandonware/noble/commit/b67eea246f719947fc45b1b52b856e61637a8a8e\n\t\t\tnoble = (noble as any)({ extended: false });\n\t\t}\n\t} catch (error: any) {\n\t\tawait sendAsync({ type: \"fatal\", error });\n\t\tprocess.exit(ScanExitCodes.RequireNobleFailed);\n\t}\n}\n\nasync function main() {\n\t// prepare scanning for beacons\n\tnoble.on(\"stateChange\", (state) => {\n\t\tswitch (state) {\n\t\t\tcase \"poweredOn\":\n\t\t\t\tstartScanning();\n\t\t\t\tbreak;\n\t\t\tcase \"poweredOff\":\n\t\t\t\tstopScanning();\n\t\t\t\tbreak;\n\t\t}\n\t\tconsole.log(`driver state is ${state}`);\n\t\tsendAsync({ type: \"driverState\", driverState: state });\n\t});\n\tif (noble.state === \"poweredOn\") startScanning();\n\tsendAsync({ type: \"driverState\", driverState: noble.state });\n}\n\n(async () => {\n\tawait loadNoble();\n\tawait maybeStartServer();\n\tif (server) {\n\t\t// wait for connection\n\t\tserver.once(\"connection\", () => {\n\t\t\tmain();\n\t\t});\n\t} else {\n\t\t// child process, start scanning immediately\n\t\tmain();\n\t}\n})();\n"], - "mappings": ";AAEA,iBAAyE;AACzE,kBAAqB;AACrB,kCAKO;AACP,MAAO,QAAQ,QAAQ;AAGvB,MAAM,OAAO,MACX,IAAI,SAAS,EACb,OAAO,EACP,MAAM,qDAAqD,EAC3D,QAAQ;AAAA,EACR,WAAW;AAAA,IACV,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,EACV;AAAA,EACA,UAAU;AAAA,IACT,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,SAAS,CAAC;AAAA,EACX;AAAA,EACA,iBAAiB;AAAA,IAChB,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,EACP;AAAA,EACA,YAAY;AAAA,IACX,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,EACV;AACD,CAAC,EACA,UAAU;AAEZ,IAAI;AACJ,IAAI;AACJ,MAAM,UAAuB,oBAAI,IAAI;AAErC,SAAS,UACR,SACA,YACA,gBAAyB,MACT;AAChB,MAAI,QAAQ,MAAM;AACjB,WAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACvC,cAAQ,KAAM,SAAS,YAAY,QAAW,CAAC,QAAQ;AACtD,YAAI,OAAO,CAAC;AAAe,iBAAO,GAAG;AAAA;AAChC,kBAAQ;AAAA,MACd,CAAC;AAAA,IACF,CAAC;AAAA,EACF,OAAO;AACN,UAAM,WAAW,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,WAAW;AAC7C,aAAO,IAAI,QAAc,CAAC,SAAS,WAAW;AAC7C,eAAO,MAAM,KAAK,UAAU,OAAO,IAAI,MAAM,CAAC,QAAQ;AACrD,cAAI,OAAO,CAAC;AAAe,mBAAO,GAAG;AAAA;AAChC,oBAAQ;AAAA,QACd,CAAC;AAAA,MACF,CAAC;AAAA,IACF,CAAC;AACD,WAAO,QAAQ,IAAI,QAAQ,EAAE,KAAK,MAAM,MAAS;AAAA,EAClD;AACD;AAGA,MAAM,UAAU,SAAS,WAAuB;AAC/C,QAAM,MAA2B;AAAA,IAChC,MAAM;AAAA,IACN,MAAM,KAAK;AAAA,IACX,SAAS,KAAK;AAAA,IACd,OAAO,KAAK;AAAA,EACb;AAEA,aAAW,OAAO,OAAO,KAAK,IAAI,GAAsB;AACvD,QAAI,CAAC,IAAI,MAAM;AACd,UAAI,OAAO,KAAK;AAAA,IACjB;AAAA,EACD;AACA,SAAO;AACR;AAEA,QAAQ,GAAG,qBAAqB,CAAC,UAAU;AAE1C,YAAU,EAAE,MAAM,SAAS,MAAM,CAAC;AACnC,CAAC;AACD,QAAQ,GAAG,sBAAsB,CAAC,UAAU;AAE3C,YAAU;AAAA,IACT,MAAM;AAAA,IACN,OAEC,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,GAAG,OAAO;AAAA,EACvD,CAAC;AACF,CAAC;AAGD,QAAQ,GAAG,WAAW,CAAC,QAAQ;AAC9B,gBAAc,GAAqB;AACpC,CAAC;AAED,SAAS,cAAc,KAAqB;AAC3C,UAAQ,IAAI,MAAM;AAAA,IACjB,KAAK;AACJ,oBAAc;AACd;AAAA,IACD,KAAK;AACJ,mBAAa;AACb;AAAA,EACF;AACD;AAEA,SAAS,oBAAoB,YAAwC;AACpE,aAAO,kBAAK,YAAY;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAC;AACF;AAEA,SAAS,WAAW,YAAyB;AAC5C,MAAI,cAAc;AAAW;AAC7B,YAAU;AAAA,IACT,MAAM;AAAA,IACN,YAAY,oBAAoB,UAAU;AAAA,EAC3C,CAAC;AACF;AAEA,IAAI,aAAa;AACjB,eAAe,gBAAgB;AAC9B,MAAI;AAAY;AAChB,QAAM,UAAU,EAAE,MAAM,YAAY,CAAC;AACrC,QAAM,UAAU;AAAA,IACf,MAAM;AAAA,IACN,SAAS,8BAA8B,KAAK,UAAU,KAAK,QAAQ;AAAA,EACpE,CAAC;AAED,QAAM,GAAG,YAAY,UAAU;AAC/B,QAAM,MAAM,mBAAmB,KAAK,UAAU,IAAI;AAClD,eAAa;AACd;AAEA,eAAe,eAAe;AAC7B,MAAI,CAAC;AAAY;AACjB,QAAM,mBAAmB,UAAU;AACnC,YAAU;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA,EACV,CAAC;AACD,QAAM,aAAa;AACnB,YAAU,EAAE,MAAM,eAAe,CAAC;AAClC,eAAa;AACd;AAEA,SAAS,mBAAkC;AAE1C,MAAI,QAAQ;AAAM,WAAO,QAAQ,QAAQ;AAEzC,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AAEvC,iBAAS,yBAAa,CAAC,WAAW;AACjC,cAAQ,IAAI,kBAAkB;AAC9B,cAAQ,IAAI,MAAM;AAGlB,aAAO,GAAG,SAAS,MAAM;AACxB,gBAAQ,IAAI,qBAAqB;AACjC,gBAAQ,OAAO,MAAM;AAAA,MACtB,CAAC;AAAA,IACF,CAAC;AAGD,WAAO,iBAAiB;AAExB,WAAO,GAAG,SAAS,CAAC,QAAQ;AAC3B,UAAK,IAAY,SAAS,cAAc;AACvC,eAAO,GAAG;AAAA,MACX;AAAA,IACD,CAAC;AACD,WAAO;AAAA,MACN;AAAA,QACC,MAAM,KAAK;AAAA,QACX,MAAM,KAAK;AAAA,MACZ;AAAA,MACA,MAAM;AACL,cAAM,UAAuB,OAAQ,QAAQ;AAC7C,gBAAQ;AAAA,UACP,6BAA6B,QAAQ,WAAW,QAAQ;AAAA,QACzD;AACA,gBAAQ;AAAA,MACT;AAAA,IACD;AAAA,EACD,CAAC;AACF;AAEA,eAAe,YAAY;AAE1B,UAAQ,IAAI,sBAAsB,KAAK,UAAU,SAAS;AAC1D,MAAI;AAEH,YAAQ,QAAQ,oBAAoB;AACpC,QAAI,OAAO,MAAM,OAAO,YAAY;AAGnC,cAAS,MAAc,EAAE,UAAU,MAAM,CAAC;AAAA,IAC3C;AAAA,EACD,SAAS,OAAP;AACD,UAAM,UAAU,EAAE,MAAM,SAAS,MAAM,CAAC;AACxC,YAAQ,KAAK,0CAAc,kBAAkB;AAAA,EAC9C;AACD;AAEA,eAAe,OAAO;AAErB,QAAM,GAAG,eAAe,CAAC,UAAU;AAClC,YAAQ,OAAO;AAAA,MACd,KAAK;AACJ,sBAAc;AACd;AAAA,MACD,KAAK;AACJ,qBAAa;AACb;AAAA,IACF;AACA,YAAQ,IAAI,mBAAmB,OAAO;AACtC,cAAU,EAAE,MAAM,eAAe,aAAa,MAAM,CAAC;AAAA,EACtD,CAAC;AACD,MAAI,MAAM,UAAU;AAAa,kBAAc;AAC/C,YAAU,EAAE,MAAM,eAAe,aAAa,MAAM,MAAM,CAAC;AAC5D;AAAA,CAEC,YAAY;AACZ,QAAM,UAAU;AAChB,QAAM,iBAAiB;AACvB,MAAI,QAAQ;AAEX,WAAO,KAAK,cAAc,MAAM;AAC/B,WAAK;AAAA,IACN,CAAC;AAAA,EACF,OAAO;AAEN,SAAK;AAAA,EACN;AACD,GAAG;", + "sourcesContent": ["/** noble-Treiber-Instanz */\nimport type { Peripheral } from \"@stoprocent/noble\";\nimport { createServer, type AddressInfo, type Server, type Socket } from \"net\";\nimport { pick } from \"./lib/misc\";\nimport {\n\tScanExitCodes,\n\ttype InboundMessage,\n\ttype PeripheralInfo,\n\ttype ScanMessage,\n} from \"./lib/scanProcessInterface\";\nimport yargs = require(\"yargs\");\n\n/** Define command line arguments */\nconst argv = yargs\n\t.env(\"IOB_BLE\")\n\t.strict()\n\t.usage(\"ioBroker.ble scanner process\\n\\nUsage: $0 [options]\")\n\t.options({\n\t\thciDevice: {\n\t\t\talias: \"-d\",\n\t\t\ttype: \"number\",\n\t\t\tdesc: \"Index of the HCI device to use for scanning\",\n\t\t\tdefault: 0,\n\t\t},\n\t\tservices: {\n\t\t\talias: \"-s\",\n\t\t\ttype: \"string\",\n\t\t\tarray: true,\n\t\t\tdesc: \"Which BLE services to scan for\",\n\t\t\tdefault: [],\n\t\t},\n\t\tlistenInterface: {\n\t\t\talias: \"-i\",\n\t\t\ttype: \"string\",\n\t\t\tdesc: \"If not spawned as a child process, the interface to listen for TCP connections. Default: all interfaces.\",\n\t\t},\n\t\tlistenPort: {\n\t\t\talias: \"-p\",\n\t\t\ttype: \"number\",\n\t\t\tdesc: \"If not spawned as a child process, the port to listen on.\",\n\t\t\tdefault: 8734,\n\t\t},\n\t})\n\t.parseSync();\n\nlet noble: typeof import(\"@stoprocent/noble\");\nlet server: Server | undefined;\nconst clients: Set = new Set();\n\nfunction sendAsync(\n\tmessage: ScanMessage,\n\tsendHandle?: any,\n\tswallowErrors: boolean = true,\n): Promise {\n\tif (process.send) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tprocess.send!(message, sendHandle, undefined, (err) => {\n\t\t\t\tif (err && !swallowErrors) reject(err);\n\t\t\t\telse resolve();\n\t\t\t});\n\t\t});\n\t} else {\n\t\tconst promises = [...clients].map((client) => {\n\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\tclient.write(JSON.stringify(message) + \"\\n\", (err) => {\n\t\t\t\t\tif (err && !swallowErrors) reject(err);\n\t\t\t\t\telse resolve();\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t\treturn Promise.all(promises).then(() => undefined);\n\t}\n}\n\n// @ts-expect-error We need this to serialize and deserialize Error objects\nError.prototype.toJSON = function (this: Error) {\n\tconst ret: Record = {\n\t\ttype: \"Error\",\n\t\tname: this.name,\n\t\tmessage: this.message,\n\t\tstack: this.stack,\n\t};\n\t// Add any custom properties such as .code in file-system errors\n\tfor (const key of Object.keys(this) as (keyof Error)[]) {\n\t\tif (!ret[key]) {\n\t\t\tret[key] = this[key];\n\t\t}\n\t}\n\treturn ret;\n};\n\nprocess.on(\"uncaughtException\", (error) => {\n\t// Delegate the error to the parent process and let it decide whether to shut down the scanning process\n\tsendAsync({ type: \"error\", error });\n});\nprocess.on(\"unhandledRejection\", (error) => {\n\t// Delegate the error to the parent process and let it decide whether to shut down the scanning process\n\tsendAsync({\n\t\ttype: \"error\",\n\t\terror:\n\t\t\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\t\t\terror instanceof Error ? error : new Error(`${error}`),\n\t});\n});\n\n// This will be called when an IPC channel exists\nprocess.on(\"message\", (msg) => {\n\thandleMessage(msg as InboundMessage);\n});\n\nfunction handleMessage(msg: InboundMessage) {\n\tswitch (msg.type) {\n\t\tcase \"startScanning\":\n\t\t\tstartScanning();\n\t\t\tbreak;\n\t\tcase \"stopScanning\":\n\t\t\tstopScanning();\n\t\t\tbreak;\n\t}\n}\n\nfunction serializePeripheral(peripheral: Peripheral): PeripheralInfo {\n\treturn pick(peripheral, [\n\t\t\"id\",\n\t\t\"uuid\",\n\t\t\"address\",\n\t\t\"addressType\",\n\t\t\"connectable\",\n\t\t\"advertisement\",\n\t\t\"rssi\",\n\t\t\"services\",\n\t\t\"state\",\n\t]);\n}\n\nfunction onDiscover(peripheral?: Peripheral) {\n\tif (peripheral == undefined) return;\n\tsendAsync({\n\t\ttype: \"discover\",\n\t\tperipheral: serializePeripheral(peripheral),\n\t});\n}\n\nlet isScanning = false;\nasync function startScanning() {\n\tif (isScanning) return;\n\tawait sendAsync({ type: \"connected\" });\n\tawait sendAsync({\n\t\ttype: \"log\",\n\t\tmessage: `starting scan for services ${JSON.stringify(argv.services)}`,\n\t});\n\t// We must allow duplicates in order to support\n\tnoble.on(\"discover\", onDiscover);\n\tawait noble.startScanningAsync(argv.services, true);\n\tisScanning = true;\n}\n\nasync function stopScanning() {\n\tif (!isScanning) return;\n\tnoble.removeAllListeners(\"discover\");\n\tsendAsync({\n\t\ttype: \"log\",\n\t\tmessage: `stopping scan`,\n\t});\n\tnoble.stopScanning();\n\tsendAsync({ type: \"disconnected\" });\n\tisScanning = false;\n}\n\nfunction maybeStartServer(): Promise {\n\t// This is a child process, we have an IPC channel\n\tif (process.send) return Promise.resolve();\n\n\treturn new Promise((resolve, reject) => {\n\t\t// Start a TCP server, listen for connections, and forward them to the serial port\n\t\tserver = createServer((socket) => {\n\t\t\tconsole.log(\"Client connected\");\n\t\t\tclients.add(socket);\n\n\t\t\t// when the connection is closed, unpipe the streams\n\t\t\tsocket.on(\"close\", () => {\n\t\t\t\tconsole.log(\"Client disconnected\");\n\t\t\t\tclients.delete(socket);\n\t\t\t});\n\t\t});\n\n\t\t// Do not allow more than one client to connect\n\t\tserver.maxConnections = 1;\n\n\t\tserver.on(\"error\", (err) => {\n\t\t\tif ((err as any).code === \"EADDRINUSE\") {\n\t\t\t\treject(err);\n\t\t\t}\n\t\t});\n\t\tserver.listen(\n\t\t\t{\n\t\t\t\thost: argv.listenInterface,\n\t\t\t\tport: argv.listenPort,\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tconst address: AddressInfo = server!.address() as any;\n\t\t\t\tconsole.log(\n\t\t\t\t\t`Server listening on tcp://${address.address}:${address.port}`,\n\t\t\t\t);\n\t\t\t\tresolve();\n\t\t\t},\n\t\t);\n\t});\n}\n\nasync function loadNoble() {\n\t// load noble driver with the correct device selected\n\tprocess.env.NOBLE_HCI_DEVICE_ID = argv.hciDevice.toString();\n\ttry {\n\t\t// eslint-disable-next-line @typescript-eslint/no-var-requires\n\t\tnoble = require(\"@stoprocent/noble\");\n\t\tif (typeof noble.on !== \"function\") {\n\t\t\t// The following commit broke the default exported instance of noble:\n\t\t\t// https://github.com/stoprocent/noble/commit/b67eea246f719947fc45b1b52b856e61637a8a8e\n\t\t\tnoble = (noble as any)({ extended: false });\n\t\t}\n\t} catch (error: any) {\n\t\tawait sendAsync({ type: \"fatal\", error });\n\t\tprocess.exit(ScanExitCodes.RequireNobleFailed);\n\t}\n}\n\nasync function main() {\n\t// prepare scanning for beacons\n\tnoble.on(\"stateChange\", (state) => {\n\t\tswitch (state) {\n\t\t\tcase \"poweredOn\":\n\t\t\t\tstartScanning();\n\t\t\t\tbreak;\n\t\t\tcase \"poweredOff\":\n\t\t\t\tstopScanning();\n\t\t\t\tbreak;\n\t\t}\n\t\tconsole.log(`driver state is ${state}`);\n\t\tsendAsync({ type: \"driverState\", driverState: state });\n\t});\n\tif (noble.state === \"poweredOn\") startScanning();\n\tsendAsync({ type: \"driverState\", driverState: noble.state });\n}\n\n(async () => {\n\tawait loadNoble();\n\tawait maybeStartServer();\n\tif (server) {\n\t\t// wait for connection\n\t\tserver.once(\"connection\", () => {\n\t\t\tmain();\n\t\t});\n\t} else {\n\t\t// child process, start scanning immediately\n\t\tmain();\n\t}\n})();\n"], + "mappings": ";AAEA,iBAAyE;AACzE,kBAAqB;AACrB,kCAKO;AACP,MAAO,QAAQ,QAAQ;AAGvB,MAAM,OAAO,MACX,IAAI,SAAS,EACb,OAAO,EACP,MAAM,qDAAqD,EAC3D,QAAQ;AAAA,EACR,WAAW;AAAA,IACV,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,EACV;AAAA,EACA,UAAU;AAAA,IACT,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,SAAS,CAAC;AAAA,EACX;AAAA,EACA,iBAAiB;AAAA,IAChB,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,EACP;AAAA,EACA,YAAY;AAAA,IACX,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,EACV;AACD,CAAC,EACA,UAAU;AAEZ,IAAI;AACJ,IAAI;AACJ,MAAM,UAAuB,oBAAI,IAAI;AAErC,SAAS,UACR,SACA,YACA,gBAAyB,MACT;AAChB,MAAI,QAAQ,MAAM;AACjB,WAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACvC,cAAQ,KAAM,SAAS,YAAY,QAAW,CAAC,QAAQ;AACtD,YAAI,OAAO,CAAC;AAAe,iBAAO,GAAG;AAAA;AAChC,kBAAQ;AAAA,MACd,CAAC;AAAA,IACF,CAAC;AAAA,EACF,OAAO;AACN,UAAM,WAAW,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,WAAW;AAC7C,aAAO,IAAI,QAAc,CAAC,SAAS,WAAW;AAC7C,eAAO,MAAM,KAAK,UAAU,OAAO,IAAI,MAAM,CAAC,QAAQ;AACrD,cAAI,OAAO,CAAC;AAAe,mBAAO,GAAG;AAAA;AAChC,oBAAQ;AAAA,QACd,CAAC;AAAA,MACF,CAAC;AAAA,IACF,CAAC;AACD,WAAO,QAAQ,IAAI,QAAQ,EAAE,KAAK,MAAM,MAAS;AAAA,EAClD;AACD;AAGA,MAAM,UAAU,SAAS,WAAuB;AAC/C,QAAM,MAA2B;AAAA,IAChC,MAAM;AAAA,IACN,MAAM,KAAK;AAAA,IACX,SAAS,KAAK;AAAA,IACd,OAAO,KAAK;AAAA,EACb;AAEA,aAAW,OAAO,OAAO,KAAK,IAAI,GAAsB;AACvD,QAAI,CAAC,IAAI,MAAM;AACd,UAAI,OAAO,KAAK;AAAA,IACjB;AAAA,EACD;AACA,SAAO;AACR;AAEA,QAAQ,GAAG,qBAAqB,CAAC,UAAU;AAE1C,YAAU,EAAE,MAAM,SAAS,MAAM,CAAC;AACnC,CAAC;AACD,QAAQ,GAAG,sBAAsB,CAAC,UAAU;AAE3C,YAAU;AAAA,IACT,MAAM;AAAA,IACN,OAEC,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,GAAG,OAAO;AAAA,EACvD,CAAC;AACF,CAAC;AAGD,QAAQ,GAAG,WAAW,CAAC,QAAQ;AAC9B,gBAAc,GAAqB;AACpC,CAAC;AAED,SAAS,cAAc,KAAqB;AAC3C,UAAQ,IAAI,MAAM;AAAA,IACjB,KAAK;AACJ,oBAAc;AACd;AAAA,IACD,KAAK;AACJ,mBAAa;AACb;AAAA,EACF;AACD;AAEA,SAAS,oBAAoB,YAAwC;AACpE,aAAO,kBAAK,YAAY;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAC;AACF;AAEA,SAAS,WAAW,YAAyB;AAC5C,MAAI,cAAc;AAAW;AAC7B,YAAU;AAAA,IACT,MAAM;AAAA,IACN,YAAY,oBAAoB,UAAU;AAAA,EAC3C,CAAC;AACF;AAEA,IAAI,aAAa;AACjB,eAAe,gBAAgB;AAC9B,MAAI;AAAY;AAChB,QAAM,UAAU,EAAE,MAAM,YAAY,CAAC;AACrC,QAAM,UAAU;AAAA,IACf,MAAM;AAAA,IACN,SAAS,8BAA8B,KAAK,UAAU,KAAK,QAAQ;AAAA,EACpE,CAAC;AAED,QAAM,GAAG,YAAY,UAAU;AAC/B,QAAM,MAAM,mBAAmB,KAAK,UAAU,IAAI;AAClD,eAAa;AACd;AAEA,eAAe,eAAe;AAC7B,MAAI,CAAC;AAAY;AACjB,QAAM,mBAAmB,UAAU;AACnC,YAAU;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA,EACV,CAAC;AACD,QAAM,aAAa;AACnB,YAAU,EAAE,MAAM,eAAe,CAAC;AAClC,eAAa;AACd;AAEA,SAAS,mBAAkC;AAE1C,MAAI,QAAQ;AAAM,WAAO,QAAQ,QAAQ;AAEzC,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AAEvC,iBAAS,yBAAa,CAAC,WAAW;AACjC,cAAQ,IAAI,kBAAkB;AAC9B,cAAQ,IAAI,MAAM;AAGlB,aAAO,GAAG,SAAS,MAAM;AACxB,gBAAQ,IAAI,qBAAqB;AACjC,gBAAQ,OAAO,MAAM;AAAA,MACtB,CAAC;AAAA,IACF,CAAC;AAGD,WAAO,iBAAiB;AAExB,WAAO,GAAG,SAAS,CAAC,QAAQ;AAC3B,UAAK,IAAY,SAAS,cAAc;AACvC,eAAO,GAAG;AAAA,MACX;AAAA,IACD,CAAC;AACD,WAAO;AAAA,MACN;AAAA,QACC,MAAM,KAAK;AAAA,QACX,MAAM,KAAK;AAAA,MACZ;AAAA,MACA,MAAM;AACL,cAAM,UAAuB,OAAQ,QAAQ;AAC7C,gBAAQ;AAAA,UACP,6BAA6B,QAAQ,WAAW,QAAQ;AAAA,QACzD;AACA,gBAAQ;AAAA,MACT;AAAA,IACD;AAAA,EACD,CAAC;AACF;AAEA,eAAe,YAAY;AAE1B,UAAQ,IAAI,sBAAsB,KAAK,UAAU,SAAS;AAC1D,MAAI;AAEH,YAAQ,QAAQ,mBAAmB;AACnC,QAAI,OAAO,MAAM,OAAO,YAAY;AAGnC,cAAS,MAAc,EAAE,UAAU,MAAM,CAAC;AAAA,IAC3C;AAAA,EACD,SAAS,OAAP;AACD,UAAM,UAAU,EAAE,MAAM,SAAS,MAAM,CAAC;AACxC,YAAQ,KAAK,0CAAc,kBAAkB;AAAA,EAC9C;AACD;AAEA,eAAe,OAAO;AAErB,QAAM,GAAG,eAAe,CAAC,UAAU;AAClC,YAAQ,OAAO;AAAA,MACd,KAAK;AACJ,sBAAc;AACd;AAAA,MACD,KAAK;AACJ,qBAAa;AACb;AAAA,IACF;AACA,YAAQ,IAAI,mBAAmB,OAAO;AACtC,cAAU,EAAE,MAAM,eAAe,aAAa,MAAM,CAAC;AAAA,EACtD,CAAC;AACD,MAAI,MAAM,UAAU;AAAa,kBAAc;AAC/C,YAAU,EAAE,MAAM,eAAe,aAAa,MAAM,MAAM,CAAC;AAC5D;AAAA,CAEC,YAAY;AACZ,QAAM,UAAU;AAChB,QAAM,iBAAiB;AACvB,MAAI,QAAQ;AAEX,WAAO,KAAK,cAAc,MAAM;AAC/B,WAAK;AAAA,IACN,CAAC;AAAA,EACF,OAAO;AAEN,SAAK;AAAA,EACN;AACD,GAAG;", "names": [] } diff --git a/package-lock.json b/package-lock.json index c81e50c9..d9f7b6ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,8 @@ "version": "0.14.0", "license": "MIT", "dependencies": { - "@abandonware/noble": "^1.9.2-23", "@iobroker/adapter-core": "^3.0.4", + "@stoprocent/noble": "^1.18.2", "alcalzone-shared": "^4.0.8", "iobroker-react-components": "^1.0.0", "yargs": "^17.7.2" @@ -70,51 +70,6 @@ "node": ">=0.10.0" } }, - "node_modules/@abandonware/bluetooth-hci-socket": { - "version": "0.5.3-10", - "resolved": "https://registry.npmjs.org/@abandonware/bluetooth-hci-socket/-/bluetooth-hci-socket-0.5.3-10.tgz", - "integrity": "sha512-wXHiGmHaHz1pUR6Ix6uut24uTYCWZJL68aP9F056jnnl+U3KrjLT77g9dZHWDAId+9yQN54lLO4MEOIV0z9fUg==", - "hasInstallScript": true, - "optional": true, - "os": [ - "linux", - "android", - "freebsd", - "win32" - ], - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.10", - "debug": "^4.3.4", - "nan": "^2.17.0" - }, - "optionalDependencies": { - "usb": "^1.9.2" - } - }, - "node_modules/@abandonware/noble": { - "version": "1.9.2-23", - "resolved": "https://registry.npmjs.org/@abandonware/noble/-/noble-1.9.2-23.tgz", - "integrity": "sha512-BPb/a2s+t6SIZRU4oNfY61cPM91/+dH0t8Ulb4QpQ1zBfKtR+n4r/r6j+vPcnAOiQ5hWC2lDj+Mc/iiZPAYLRw==", - "hasInstallScript": true, - "os": [ - "darwin", - "linux", - "freebsd", - "win32" - ], - "dependencies": { - "debug": "^4.3.4", - "napi-thread-safe-callback": "^0.0.6", - "node-addon-api": "^4.3.0", - "node-gyp-build": "^4.5.0" - }, - "engines": { - "node": ">=6" - }, - "optionalDependencies": { - "@abandonware/bluetooth-hci-socket": "^0.5.3-10" - } - }, "node_modules/@alcalzone/pak": { "version": "0.10.1", "resolved": "https://registry.npmjs.org/@alcalzone/pak/-/pak-0.10.1.tgz", @@ -1871,41 +1826,6 @@ "node": ">=v12.0.0" } }, - "node_modules/@mapbox/node-pre-gyp": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", - "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", - "optional": true, - "dependencies": { - "detect-libc": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "make-dir": "^3.1.0", - "node-fetch": "^2.6.7", - "nopt": "^5.0.0", - "npmlog": "^5.0.1", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.11" - }, - "bin": { - "node-pre-gyp": "bin/node-pre-gyp" - } - }, - "node_modules/@mapbox/node-pre-gyp/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "optional": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/@material-ui/core": { "version": "4.12.4", "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-4.12.4.tgz", @@ -2374,6 +2294,246 @@ "node": ">=6" } }, + "node_modules/@serialport/binding-mock": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/@serialport/binding-mock/-/binding-mock-10.2.2.tgz", + "integrity": "sha512-HAFzGhk9OuFMpuor7aT5G1ChPgn5qSsklTFOTUX72Rl6p0xwcSVsRtG/xaGp6bxpN7fI9D/S8THLBWbBgS6ldw==", + "license": "MIT", + "optional": true, + "dependencies": { + "@serialport/bindings-interface": "^1.2.1", + "debug": "^4.3.3" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@serialport/bindings-cpp": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/@serialport/bindings-cpp/-/bindings-cpp-12.0.1.tgz", + "integrity": "sha512-r2XOwY2dDvbW7dKqSPIk2gzsr6M6Qpe9+/Ngs94fNaNlcTRCV02PfaoDmRgcubpNVVcLATlxSxPTIDw12dbKOg==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@serialport/bindings-interface": "1.2.2", + "@serialport/parser-readline": "11.0.0", + "debug": "4.3.4", + "node-addon-api": "7.0.0", + "node-gyp-build": "4.6.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" + } + }, + "node_modules/@serialport/bindings-cpp/node_modules/@serialport/parser-delimiter": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-delimiter/-/parser-delimiter-11.0.0.tgz", + "integrity": "sha512-aZLJhlRTjSmEwllLG7S4J8s8ctRAS0cbvCpO87smLvl3e4BgzbVgF6Z6zaJd3Aji2uSiYgfedCdNc4L6W+1E2g==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" + } + }, + "node_modules/@serialport/bindings-cpp/node_modules/@serialport/parser-readline": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-readline/-/parser-readline-11.0.0.tgz", + "integrity": "sha512-rRAivhRkT3YO28WjmmG4FQX6L+KMb5/ikhyylRfzWPw0nSXy97+u07peS9CbHqaNvJkMhH1locp2H36aGMOEIA==", + "license": "MIT", + "optional": true, + "dependencies": { + "@serialport/parser-delimiter": "11.0.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" + } + }, + "node_modules/@serialport/bindings-cpp/node_modules/node-addon-api": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.0.0.tgz", + "integrity": "sha512-vgbBJTS4m5/KkE16t5Ly0WW9hz46swAstv0hYYwMtbG7AznRhNyfLRe8HZAiWIpcHzoO7HxhLuBQj9rJ/Ho0ZA==", + "license": "MIT", + "optional": true + }, + "node_modules/@serialport/bindings-cpp/node_modules/node-gyp-build": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", + "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", + "license": "MIT", + "optional": true, + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/@serialport/bindings-interface": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@serialport/bindings-interface/-/bindings-interface-1.2.2.tgz", + "integrity": "sha512-CJaUd5bLvtM9c5dmO9rPBHPXTa9R2UwpkJ0wdh9JCYcbrPWsKz+ErvR0hBLeo7NPeiFdjFO4sonRljiw4d2XiA==", + "license": "MIT", + "optional": true, + "engines": { + "node": "^12.22 || ^14.13 || >=16" + } + }, + "node_modules/@serialport/parser-byte-length": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-byte-length/-/parser-byte-length-12.0.0.tgz", + "integrity": "sha512-0ei0txFAj+s6FTiCJFBJ1T2hpKkX8Md0Pu6dqMrYoirjPskDLJRgZGLqoy3/lnU1bkvHpnJO+9oJ3PB9v8rNlg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" + } + }, + "node_modules/@serialport/parser-cctalk": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-cctalk/-/parser-cctalk-12.0.0.tgz", + "integrity": "sha512-0PfLzO9t2X5ufKuBO34DQKLXrCCqS9xz2D0pfuaLNeTkyGUBv426zxoMf3rsMRodDOZNbFblu3Ae84MOQXjnZw==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" + } + }, + "node_modules/@serialport/parser-delimiter": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-delimiter/-/parser-delimiter-12.0.0.tgz", + "integrity": "sha512-gu26tVt5lQoybhorLTPsH2j2LnX3AOP2x/34+DUSTNaUTzu2fBXw+isVjQJpUBFWu6aeQRZw5bJol5X9Gxjblw==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" + } + }, + "node_modules/@serialport/parser-inter-byte-timeout": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-inter-byte-timeout/-/parser-inter-byte-timeout-12.0.0.tgz", + "integrity": "sha512-GnCh8K0NAESfhCuXAt+FfBRz1Cf9CzIgXfp7SdMgXwrtuUnCC/yuRTUFWRvuzhYKoAo1TL0hhUo77SFHUH1T/w==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" + } + }, + "node_modules/@serialport/parser-packet-length": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-packet-length/-/parser-packet-length-12.0.0.tgz", + "integrity": "sha512-p1hiCRqvGHHLCN/8ZiPUY/G0zrxd7gtZs251n+cfNTn+87rwcdUeu9Dps3Aadx30/sOGGFL6brIRGK4l/t7MuQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/@serialport/parser-readline": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-readline/-/parser-readline-12.0.0.tgz", + "integrity": "sha512-O7cywCWC8PiOMvo/gglEBfAkLjp/SENEML46BXDykfKP5mTPM46XMaX1L0waWU6DXJpBgjaL7+yX6VriVPbN4w==", + "license": "MIT", + "optional": true, + "dependencies": { + "@serialport/parser-delimiter": "12.0.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" + } + }, + "node_modules/@serialport/parser-ready": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-ready/-/parser-ready-12.0.0.tgz", + "integrity": "sha512-ygDwj3O4SDpZlbrRUraoXIoIqb8sM7aMKryGjYTIF0JRnKeB1ys8+wIp0RFMdFbO62YriUDextHB5Um5cKFSWg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" + } + }, + "node_modules/@serialport/parser-regex": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-regex/-/parser-regex-12.0.0.tgz", + "integrity": "sha512-dCAVh4P/pZrLcPv9NJ2mvPRBg64L5jXuiRxIlyxxdZGH4WubwXVXY/kBTihQmiAMPxbT3yshSX8f2+feqWsxqA==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" + } + }, + "node_modules/@serialport/parser-slip-encoder": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-slip-encoder/-/parser-slip-encoder-12.0.0.tgz", + "integrity": "sha512-0APxDGR9YvJXTRfY+uRGhzOhTpU5akSH183RUcwzN7QXh8/1jwFsFLCu0grmAUfi+fItCkR+Xr1TcNJLR13VNA==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" + } + }, + "node_modules/@serialport/parser-spacepacket": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-spacepacket/-/parser-spacepacket-12.0.0.tgz", + "integrity": "sha512-dozONxhPC/78pntuxpz/NOtVps8qIc/UZzdc/LuPvVsqCoJXiRxOg6ZtCP/W58iibJDKPZPAWPGYeZt9DJxI+Q==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" + } + }, + "node_modules/@serialport/stream": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/stream/-/stream-12.0.0.tgz", + "integrity": "sha512-9On64rhzuqKdOQyiYLYv2lQOh3TZU/D3+IWCR5gk0alPel2nwpp4YwDEGiUBfrQZEdQ6xww0PWkzqth4wqwX3Q==", + "license": "MIT", + "optional": true, + "dependencies": { + "@serialport/bindings-interface": "1.2.2", + "debug": "4.3.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" + } + }, "node_modules/@sinonjs/commons": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", @@ -2409,32 +2569,125 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, - "node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", - "dev": true, - "engines": { - "node": ">= 10" + "node_modules/@stoprocent/bluetooth-hci-socket": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/@stoprocent/bluetooth-hci-socket/-/bluetooth-hci-socket-1.4.4.tgz", + "integrity": "sha512-X7TO8t/NjNvTOcvaak5eTpR8pgG5/lwBFSOSllsCjSeVxHp4oAmTeKVAswfAFhA124KHSLF/NX4rDsvCfER31w==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "linux", + "android", + "freebsd", + "win32", + "darwin" + ], + "dependencies": { + "async": "^3.2.6", + "debug": "^4.3.7", + "node-addon-api": "^8.1.0", + "node-gyp-build": "^4.8.1", + "patch-package": "^8.0.0", + "serialport": "^12.0.0" + }, + "optionalDependencies": { + "usb": "^2.14.0" } }, - "node_modules/@tsconfig/node10": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", - "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", - "dev": true - }, - "node_modules/@tsconfig/node14": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", - "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", - "dev": true + "node_modules/@stoprocent/bluetooth-hci-socket/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } }, - "node_modules/@tsconfig/node16": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", - "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", - "dev": true + "node_modules/@stoprocent/bluetooth-hci-socket/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT", + "optional": true + }, + "node_modules/@stoprocent/noble": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/@stoprocent/noble/-/noble-1.18.2.tgz", + "integrity": "sha512-sFOnaJqdcoYYFh55SEkw294vZpDYh+ZpzyLBOrf171cYcdycwMKrrNhiRJaTAVAcyk+0MGtbMicC40J1ewIGsA==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.7", + "napi-thread-safe-callback": "^0.0.6", + "node-addon-api": "^8.1.0", + "node-gyp-build": "^4.8.1" + }, + "engines": { + "node": ">=14" + }, + "optionalDependencies": { + "@stoprocent/bluetooth-hci-socket": "^1.4.4" + } + }, + "node_modules/@stoprocent/noble/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@stoprocent/noble/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", + "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", + "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", + "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "dev": true }, "node_modules/@tsconfig/node18": { "version": "18.2.2", @@ -2616,6 +2869,13 @@ "integrity": "sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g==", "dev": true }, + "node_modules/@types/w3c-web-usb": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@types/w3c-web-usb/-/w3c-web-usb-1.0.10.tgz", + "integrity": "sha512-CHgUI5kTc/QLMP8hODUHhge0D4vx+9UiAwIGiT0sTy/B2XpdX1U5rJt6JSISgr6ikRT7vxV9EVAFeYZqUnl1gQ==", + "license": "MIT", + "optional": true + }, "node_modules/@types/yargs": { "version": "17.0.32", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", @@ -3054,10 +3314,11 @@ "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", "dev": true }, - "node_modules/abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "node_modules/@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", + "license": "BSD-2-Clause", "optional": true }, "node_modules/abort-controller": { @@ -3097,7 +3358,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "devOptional": true, + "dev": true, "dependencies": { "debug": "4" }, @@ -3226,31 +3487,12 @@ "node": ">=8" } }, - "node_modules/aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", - "optional": true - }, "node_modules/archy": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", "dev": true }, - "node_modules/are-we-there-yet": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", - "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", - "optional": true, - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -3293,12 +3535,29 @@ "node": "*" } }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "license": "MIT", + "optional": true + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "license": "ISC", + "optional": true, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/attr-accept": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/attr-accept/-/attr-accept-2.2.2.tgz", @@ -3395,7 +3654,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, + "devOptional": true, "dependencies": { "fill-range": "^7.1.1" }, @@ -3593,6 +3852,56 @@ "node": ">=8" } }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "license": "MIT", + "optional": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "license": "MIT", + "optional": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "license": "MIT", + "optional": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -3764,11 +4073,27 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=10" } }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -3813,15 +4138,6 @@ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, - "node_modules/color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", - "optional": true, - "bin": { - "color-support": "bin.js" - } - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -3846,12 +4162,6 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "devOptional": true }, - "node_modules/console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", - "optional": true - }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -3862,7 +4172,7 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, + "devOptional": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -4096,6 +4406,24 @@ "node": ">=8" } }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "license": "MIT", + "optional": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/define-lazy-prop": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", @@ -4117,21 +4445,6 @@ "node": ">=0.4.0" } }, - "node_modules/delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", - "optional": true - }, - "node_modules/detect-libc": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", - "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", - "optional": true, - "engines": { - "node": ">=8" - } - }, "node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -4181,6 +4494,21 @@ "integrity": "sha512-jXKhWqXPmlUeoQnF/EhTtTl4C9SnrxSH/jZUih3jmO6lBKr99rP3/+FmrMj4EFpOXzMtXHAZkd3x0E6h6Fgflw==", "dev": true }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "optional": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/duplexify": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz", @@ -4280,6 +4608,39 @@ "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", "dev": true }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "optional": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", @@ -5214,7 +5575,7 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, + "devOptional": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -5319,6 +5680,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/find-yarn-workspace-root": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", + "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "micromatch": "^4.0.2" + } + }, "node_modules/flat": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", @@ -5447,7 +5818,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "devOptional": true, + "dev": true, "dependencies": { "minipass": "^3.0.0" }, @@ -5459,7 +5830,7 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "devOptional": true, + "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -5487,24 +5858,14 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/gauge": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", - "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", "optional": true, - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.2", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.1", - "object-assign": "^4.1.1", - "signal-exit": "^3.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.2" - }, - "engines": { - "node": ">=10" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/gaxios": { @@ -5561,6 +5922,31 @@ "node": "*" } }, + "node_modules/get-intrinsic": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", + "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", + "license": "MIT", + "optional": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "function-bind": "^1.1.2", + "get-proto": "^1.0.0", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", @@ -5570,6 +5956,20 @@ "node": ">=8.0.0" } }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "optional": true, + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", @@ -5720,11 +6120,24 @@ "node": ">=12.0.0" } }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.9", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", - "dev": true + "devOptional": true }, "node_modules/graphemer": { "version": "1.4.0", @@ -5755,11 +6168,31 @@ "node": ">=4" } }, - "node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", - "optional": true + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "license": "MIT", + "optional": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/hasha": { "version": "5.2.0", @@ -5774,6 +6207,19 @@ "node": ">=8" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -5840,7 +6286,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", - "devOptional": true, + "dev": true, "dependencies": { "agent-base": "6", "debug": "4" @@ -6057,7 +6503,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, + "devOptional": true, "engines": { "node": ">=0.12.0" } @@ -6132,7 +6578,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dev": true, + "devOptional": true, "dependencies": { "is-docker": "^2.0.0" }, @@ -6144,7 +6590,7 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "dev": true, + "devOptional": true, "bin": { "is-docker": "cli.js" }, @@ -6155,11 +6601,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "license": "MIT", + "optional": true + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "devOptional": true }, "node_modules/istanbul-lib-coverage": { "version": "3.0.0", @@ -6412,6 +6865,26 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, + "node_modules/json-stable-stringify": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.2.1.tgz", + "integrity": "sha512-Lp6HbbBgosLmJbjx0pBLbgvx68FaFU1sdkmBuckmhhJ88kL13OA51CDtR2yJB50eCNMH9wRqtQNNiAqQH4YXnA==", + "license": "MIT", + "optional": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "isarray": "^2.0.5", + "jsonify": "^0.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", @@ -6434,7 +6907,7 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, + "devOptional": true, "dependencies": { "universalify": "^2.0.0" }, @@ -6442,6 +6915,16 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jsonify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", + "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", + "license": "Public Domain", + "optional": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/jss": { "version": "10.9.0", "resolved": "https://registry.npmjs.org/jss/-/jss-10.9.0.tgz", @@ -6574,6 +7057,16 @@ "graceful-fs": "^4.1.9" } }, + "node_modules/klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "graceful-fs": "^4.1.11" + } + }, "node_modules/levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -6761,7 +7254,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "devOptional": true, + "dev": true, "dependencies": { "semver": "^6.0.0" }, @@ -6776,7 +7269,7 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "devOptional": true, + "dev": true, "bin": { "semver": "bin/semver.js" } @@ -6868,6 +7361,16 @@ "integrity": "sha512-6qE4B9deFBIa9YSpOc9O0Sgc43zTeVYbgDT5veRKSlB2+ZuHNoVVxA1L/ckMUayV9Ay9y7Z/SZCLcGteW9i7bg==", "dev": true }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/mdurl": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", @@ -6899,7 +7402,7 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, + "devOptional": true, "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -6954,7 +7457,7 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, + "devOptional": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -6963,7 +7466,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "devOptional": true, + "dev": true, "engines": { "node": ">=8" } @@ -7091,7 +7594,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "devOptional": true, + "dev": true, "dependencies": { "minipass": "^3.0.0", "yallist": "^4.0.0" @@ -7104,7 +7607,7 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "devOptional": true, + "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -7116,7 +7619,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "devOptional": true, + "dev": true, "bin": { "mkdirp": "bin/cmd.js" }, @@ -7292,12 +7795,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, - "node_modules/nan": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", - "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==", - "optional": true - }, "node_modules/nanoid": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", @@ -7313,7 +7810,8 @@ "node_modules/napi-thread-safe-callback": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/napi-thread-safe-callback/-/napi-thread-safe-callback-0.0.6.tgz", - "integrity": "sha512-X7uHCOCdY4u0yamDxDrv3jF2NtYc8A1nvPzBQgvpoSX+WB3jAe2cVNsY448V1ucq7Whf9Wdy02HEUoLW5rJKWg==" + "integrity": "sha512-X7uHCOCdY4u0yamDxDrv3jF2NtYc8A1nvPzBQgvpoSX+WB3jAe2cVNsY448V1ucq7Whf9Wdy02HEUoLW5rJKWg==", + "license": "ISC" }, "node_modules/natural-compare": { "version": "1.4.0", @@ -7362,15 +7860,19 @@ } }, "node_modules/node-addon-api": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", - "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==" + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.3.0.tgz", + "integrity": "sha512-8VOpLHFrOQlAH+qA0ZzuGRlALRA6/LVh8QJldbrC4DY0hXoMP0l4Acq8TzFC018HztWiRqyCEj2aTWY2UvnJUg==", + "license": "MIT", + "engines": { + "node": "^18 || ^20 || >= 21" + } }, "node_modules/node-fetch": { "version": "2.6.12", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", - "devOptional": true, + "dev": true, "dependencies": { "whatwg-url": "^5.0.0" }, @@ -7390,19 +7892,19 @@ "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", - "devOptional": true + "dev": true }, "node_modules/node-fetch/node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", - "devOptional": true + "dev": true }, "node_modules/node-fetch/node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "devOptional": true, + "dev": true, "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -7442,9 +7944,10 @@ } }, "node_modules/node-gyp-build": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", - "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", + "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", + "license": "MIT", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -7594,21 +8097,6 @@ "node": ">=8" } }, - "node_modules/nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "optional": true, - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -7621,18 +8109,6 @@ "node": ">=8" } }, - "node_modules/npmlog": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", - "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", - "optional": true, - "dependencies": { - "are-we-there-yet": "^2.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^3.0.0", - "set-blocking": "^2.0.0" - } - }, "node_modules/nyc": { "version": "15.1.0", "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", @@ -7835,7 +8311,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "devOptional": true, + "dev": true, "engines": { "node": ">=0.10.0" } @@ -7849,6 +8325,16 @@ "node": ">= 6" } }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -7908,6 +8394,16 @@ "node": ">= 0.8.0" } }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -7944,46 +8440,203 @@ "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", "dev": true, "dependencies": { - "aggregate-error": "^3.0.0" + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/patch-package": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz", + "integrity": "sha512-da8BVIhzjtgScwDJ2TtKsfT5JFWz1hYoBl9rUQ1f38MC2HwnEIkK8VN3dKMKcP7P7bvvgzNDbfNHtx3MsQb5vA==", + "license": "MIT", + "optional": true, + "dependencies": { + "@yarnpkg/lockfile": "^1.1.0", + "chalk": "^4.1.2", + "ci-info": "^3.7.0", + "cross-spawn": "^7.0.3", + "find-yarn-workspace-root": "^2.0.0", + "fs-extra": "^9.0.0", + "json-stable-stringify": "^1.0.2", + "klaw-sync": "^6.0.0", + "minimist": "^1.2.6", + "open": "^7.4.2", + "rimraf": "^2.6.3", + "semver": "^7.5.3", + "slash": "^2.0.0", + "tmp": "^0.0.33", + "yaml": "^2.2.2" + }, + "bin": { + "patch-package": "index.js" + }, + "engines": { + "node": ">=14", + "npm": ">5" + } + }, + "node_modules/patch-package/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "optional": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/patch-package/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/patch-package/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/patch-package/node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "license": "MIT", + "optional": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/patch-package/node_modules/open": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "license": "MIT", + "optional": true, + "dependencies": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/patch-package/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "optional": true, + "dependencies": { + "glob": "^7.1.3" }, - "engines": { - "node": ">=8" + "bin": { + "rimraf": "bin.js" } }, - "node_modules/p-try": { + "node_modules/patch-package/node_modules/slash": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", - "dev": true, + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "license": "MIT", + "optional": true, "engines": { "node": ">=6" } }, - "node_modules/package-hash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", - "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", - "dev": true, + "node_modules/patch-package/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "optional": true, "dependencies": { - "graceful-fs": "^4.1.15", - "hasha": "^5.0.0", - "lodash.flattendeep": "^4.4.0", - "release-zalgo": "^1.0.0" + "has-flag": "^4.0.0" }, "engines": { "node": ">=8" } }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, + "node_modules/patch-package/node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "license": "MIT", + "optional": true, "dependencies": { - "callsites": "^3.0.0" + "os-tmpdir": "~1.0.2" }, "engines": { - "node": ">=6" + "node": ">=0.6.0" } }, "node_modules/path-exists": { @@ -8008,7 +8661,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, + "devOptional": true, "engines": { "node": ">=8" } @@ -8096,7 +8749,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, + "devOptional": true, "engines": { "node": ">=8.6" }, @@ -8566,7 +9219,7 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "devOptional": true, + "dev": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -8832,17 +9485,64 @@ "randombytes": "^2.1.0" } }, + "node_modules/serialport": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/serialport/-/serialport-12.0.0.tgz", + "integrity": "sha512-AmH3D9hHPFmnF/oq/rvigfiAouAKyK/TjnrkwZRYSFZxNggJxwvbAbfYrLeuvq7ktUdhuHdVdSjj852Z55R+uA==", + "license": "MIT", + "optional": true, + "dependencies": { + "@serialport/binding-mock": "10.2.2", + "@serialport/bindings-cpp": "12.0.1", + "@serialport/parser-byte-length": "12.0.0", + "@serialport/parser-cctalk": "12.0.0", + "@serialport/parser-delimiter": "12.0.0", + "@serialport/parser-inter-byte-timeout": "12.0.0", + "@serialport/parser-packet-length": "12.0.0", + "@serialport/parser-readline": "12.0.0", + "@serialport/parser-ready": "12.0.0", + "@serialport/parser-regex": "12.0.0", + "@serialport/parser-slip-encoder": "12.0.0", + "@serialport/parser-spacepacket": "12.0.0", + "@serialport/stream": "12.0.0", + "debug": "4.3.4" + }, + "engines": { + "node": ">=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/serialport/donate" + } + }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "devOptional": true + "dev": true + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "license": "MIT", + "optional": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, + "devOptional": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -8854,7 +9554,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, + "devOptional": true, "engines": { "node": ">=8" } @@ -8863,7 +9563,7 @@ "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "devOptional": true + "dev": true }, "node_modules/sinon": { "version": "17.0.1", @@ -9117,7 +9817,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "devOptional": true, + "dev": true, "dependencies": { "safe-buffer": "~5.2.0" } @@ -9126,7 +9826,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -9259,7 +9959,7 @@ "version": "6.2.1", "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", - "devOptional": true, + "dev": true, "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -9394,7 +10094,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, + "devOptional": true, "dependencies": { "is-number": "^7.0.0" }, @@ -9588,7 +10288,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true, + "devOptional": true, "engines": { "node": ">= 10.0.0" } @@ -9612,24 +10312,26 @@ } }, "node_modules/usb": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/usb/-/usb-1.9.2.tgz", - "integrity": "sha512-dryNz030LWBPAf6gj8vyq0Iev3vPbCLHCT8dBw3gQRXRzVNsIdeuU+VjPp3ksmSPkeMAl1k+kQ14Ij0QHyeiAg==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/usb/-/usb-2.14.0.tgz", + "integrity": "sha512-I3lzVOH21BsO6qPYvx1C7Ji08lbuM0qmsEtNGAphqlhNME5cz/vExY+jIXZl+HQIRybI/sTxdyLab5tALsL69w==", "hasInstallScript": true, + "license": "MIT", "optional": true, "dependencies": { - "node-addon-api": "^4.2.0", - "node-gyp-build": "^4.3.0" + "@types/w3c-web-usb": "^1.0.6", + "node-addon-api": "^8.0.0", + "node-gyp-build": "^4.5.0" }, "engines": { - "node": ">=10.16.0" + "node": ">=12.22.0 <13.0 || >=14.17.0" } }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "devOptional": true + "dev": true }, "node_modules/uuid": { "version": "3.3.3", @@ -9651,7 +10353,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, + "devOptional": true, "dependencies": { "isexe": "^2.0.0" }, @@ -9668,15 +10370,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "node_modules/wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "optional": true, - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, "node_modules/word-wrap": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", @@ -9764,6 +10457,19 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "devOptional": true }, + "node_modules/yaml": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", + "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", + "license": "ISC", + "optional": true, + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", @@ -9870,30 +10576,6 @@ "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", "dev": true }, - "@abandonware/bluetooth-hci-socket": { - "version": "0.5.3-10", - "resolved": "https://registry.npmjs.org/@abandonware/bluetooth-hci-socket/-/bluetooth-hci-socket-0.5.3-10.tgz", - "integrity": "sha512-wXHiGmHaHz1pUR6Ix6uut24uTYCWZJL68aP9F056jnnl+U3KrjLT77g9dZHWDAId+9yQN54lLO4MEOIV0z9fUg==", - "optional": true, - "requires": { - "@mapbox/node-pre-gyp": "^1.0.10", - "debug": "^4.3.4", - "nan": "^2.17.0", - "usb": "^1.9.2" - } - }, - "@abandonware/noble": { - "version": "1.9.2-23", - "resolved": "https://registry.npmjs.org/@abandonware/noble/-/noble-1.9.2-23.tgz", - "integrity": "sha512-BPb/a2s+t6SIZRU4oNfY61cPM91/+dH0t8Ulb4QpQ1zBfKtR+n4r/r6j+vPcnAOiQ5hWC2lDj+Mc/iiZPAYLRw==", - "requires": { - "@abandonware/bluetooth-hci-socket": "^0.5.3-10", - "debug": "^4.3.4", - "napi-thread-safe-callback": "^0.0.6", - "node-addon-api": "^4.3.0", - "node-gyp-build": "^4.5.0" - } - }, "@alcalzone/pak": { "version": "0.10.1", "resolved": "https://registry.npmjs.org/@alcalzone/pak/-/pak-0.10.1.tgz", @@ -11097,34 +11779,6 @@ "lodash": "^4.17.21" } }, - "@mapbox/node-pre-gyp": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", - "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", - "optional": true, - "requires": { - "detect-libc": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "make-dir": "^3.1.0", - "node-fetch": "^2.6.7", - "nopt": "^5.0.0", - "npmlog": "^5.0.1", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.11" - }, - "dependencies": { - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "optional": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, "@material-ui/core": { "version": "4.12.4", "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-4.12.4.tgz", @@ -11461,6 +12115,137 @@ "tslib": "^1.9.3" } }, + "@serialport/binding-mock": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/@serialport/binding-mock/-/binding-mock-10.2.2.tgz", + "integrity": "sha512-HAFzGhk9OuFMpuor7aT5G1ChPgn5qSsklTFOTUX72Rl6p0xwcSVsRtG/xaGp6bxpN7fI9D/S8THLBWbBgS6ldw==", + "optional": true, + "requires": { + "@serialport/bindings-interface": "^1.2.1", + "debug": "^4.3.3" + } + }, + "@serialport/bindings-cpp": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/@serialport/bindings-cpp/-/bindings-cpp-12.0.1.tgz", + "integrity": "sha512-r2XOwY2dDvbW7dKqSPIk2gzsr6M6Qpe9+/Ngs94fNaNlcTRCV02PfaoDmRgcubpNVVcLATlxSxPTIDw12dbKOg==", + "optional": true, + "requires": { + "@serialport/bindings-interface": "1.2.2", + "@serialport/parser-readline": "11.0.0", + "debug": "4.3.4", + "node-addon-api": "7.0.0", + "node-gyp-build": "4.6.0" + }, + "dependencies": { + "@serialport/parser-delimiter": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-delimiter/-/parser-delimiter-11.0.0.tgz", + "integrity": "sha512-aZLJhlRTjSmEwllLG7S4J8s8ctRAS0cbvCpO87smLvl3e4BgzbVgF6Z6zaJd3Aji2uSiYgfedCdNc4L6W+1E2g==", + "optional": true + }, + "@serialport/parser-readline": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-readline/-/parser-readline-11.0.0.tgz", + "integrity": "sha512-rRAivhRkT3YO28WjmmG4FQX6L+KMb5/ikhyylRfzWPw0nSXy97+u07peS9CbHqaNvJkMhH1locp2H36aGMOEIA==", + "optional": true, + "requires": { + "@serialport/parser-delimiter": "11.0.0" + } + }, + "node-addon-api": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.0.0.tgz", + "integrity": "sha512-vgbBJTS4m5/KkE16t5Ly0WW9hz46swAstv0hYYwMtbG7AznRhNyfLRe8HZAiWIpcHzoO7HxhLuBQj9rJ/Ho0ZA==", + "optional": true + }, + "node-gyp-build": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", + "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", + "optional": true + } + } + }, + "@serialport/bindings-interface": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@serialport/bindings-interface/-/bindings-interface-1.2.2.tgz", + "integrity": "sha512-CJaUd5bLvtM9c5dmO9rPBHPXTa9R2UwpkJ0wdh9JCYcbrPWsKz+ErvR0hBLeo7NPeiFdjFO4sonRljiw4d2XiA==", + "optional": true + }, + "@serialport/parser-byte-length": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-byte-length/-/parser-byte-length-12.0.0.tgz", + "integrity": "sha512-0ei0txFAj+s6FTiCJFBJ1T2hpKkX8Md0Pu6dqMrYoirjPskDLJRgZGLqoy3/lnU1bkvHpnJO+9oJ3PB9v8rNlg==", + "optional": true + }, + "@serialport/parser-cctalk": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-cctalk/-/parser-cctalk-12.0.0.tgz", + "integrity": "sha512-0PfLzO9t2X5ufKuBO34DQKLXrCCqS9xz2D0pfuaLNeTkyGUBv426zxoMf3rsMRodDOZNbFblu3Ae84MOQXjnZw==", + "optional": true + }, + "@serialport/parser-delimiter": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-delimiter/-/parser-delimiter-12.0.0.tgz", + "integrity": "sha512-gu26tVt5lQoybhorLTPsH2j2LnX3AOP2x/34+DUSTNaUTzu2fBXw+isVjQJpUBFWu6aeQRZw5bJol5X9Gxjblw==", + "optional": true + }, + "@serialport/parser-inter-byte-timeout": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-inter-byte-timeout/-/parser-inter-byte-timeout-12.0.0.tgz", + "integrity": "sha512-GnCh8K0NAESfhCuXAt+FfBRz1Cf9CzIgXfp7SdMgXwrtuUnCC/yuRTUFWRvuzhYKoAo1TL0hhUo77SFHUH1T/w==", + "optional": true + }, + "@serialport/parser-packet-length": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-packet-length/-/parser-packet-length-12.0.0.tgz", + "integrity": "sha512-p1hiCRqvGHHLCN/8ZiPUY/G0zrxd7gtZs251n+cfNTn+87rwcdUeu9Dps3Aadx30/sOGGFL6brIRGK4l/t7MuQ==", + "optional": true + }, + "@serialport/parser-readline": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-readline/-/parser-readline-12.0.0.tgz", + "integrity": "sha512-O7cywCWC8PiOMvo/gglEBfAkLjp/SENEML46BXDykfKP5mTPM46XMaX1L0waWU6DXJpBgjaL7+yX6VriVPbN4w==", + "optional": true, + "requires": { + "@serialport/parser-delimiter": "12.0.0" + } + }, + "@serialport/parser-ready": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-ready/-/parser-ready-12.0.0.tgz", + "integrity": "sha512-ygDwj3O4SDpZlbrRUraoXIoIqb8sM7aMKryGjYTIF0JRnKeB1ys8+wIp0RFMdFbO62YriUDextHB5Um5cKFSWg==", + "optional": true + }, + "@serialport/parser-regex": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-regex/-/parser-regex-12.0.0.tgz", + "integrity": "sha512-dCAVh4P/pZrLcPv9NJ2mvPRBg64L5jXuiRxIlyxxdZGH4WubwXVXY/kBTihQmiAMPxbT3yshSX8f2+feqWsxqA==", + "optional": true + }, + "@serialport/parser-slip-encoder": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-slip-encoder/-/parser-slip-encoder-12.0.0.tgz", + "integrity": "sha512-0APxDGR9YvJXTRfY+uRGhzOhTpU5akSH183RUcwzN7QXh8/1jwFsFLCu0grmAUfi+fItCkR+Xr1TcNJLR13VNA==", + "optional": true + }, + "@serialport/parser-spacepacket": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/parser-spacepacket/-/parser-spacepacket-12.0.0.tgz", + "integrity": "sha512-dozONxhPC/78pntuxpz/NOtVps8qIc/UZzdc/LuPvVsqCoJXiRxOg6ZtCP/W58iibJDKPZPAWPGYeZt9DJxI+Q==", + "optional": true + }, + "@serialport/stream": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@serialport/stream/-/stream-12.0.0.tgz", + "integrity": "sha512-9On64rhzuqKdOQyiYLYv2lQOh3TZU/D3+IWCR5gk0alPel2nwpp4YwDEGiUBfrQZEdQ6xww0PWkzqth4wqwX3Q==", + "optional": true, + "requires": { + "@serialport/bindings-interface": "1.2.2", + "debug": "4.3.4" + } + }, "@sinonjs/commons": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", @@ -11496,6 +12281,65 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, + "@stoprocent/bluetooth-hci-socket": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/@stoprocent/bluetooth-hci-socket/-/bluetooth-hci-socket-1.4.4.tgz", + "integrity": "sha512-X7TO8t/NjNvTOcvaak5eTpR8pgG5/lwBFSOSllsCjSeVxHp4oAmTeKVAswfAFhA124KHSLF/NX4rDsvCfER31w==", + "optional": true, + "requires": { + "async": "^3.2.6", + "debug": "^4.3.7", + "node-addon-api": "^8.1.0", + "node-gyp-build": "^4.8.1", + "patch-package": "^8.0.0", + "serialport": "^12.0.0", + "usb": "^2.14.0" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "optional": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "optional": true + } + } + }, + "@stoprocent/noble": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/@stoprocent/noble/-/noble-1.18.2.tgz", + "integrity": "sha512-sFOnaJqdcoYYFh55SEkw294vZpDYh+ZpzyLBOrf171cYcdycwMKrrNhiRJaTAVAcyk+0MGtbMicC40J1ewIGsA==", + "requires": { + "@stoprocent/bluetooth-hci-socket": "^1.4.4", + "debug": "^4.3.7", + "napi-thread-safe-callback": "^0.0.6", + "node-addon-api": "^8.1.0", + "node-gyp-build": "^4.8.1" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } + } + }, "@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", @@ -11702,6 +12546,12 @@ "integrity": "sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g==", "dev": true }, + "@types/w3c-web-usb": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@types/w3c-web-usb/-/w3c-web-usb-1.0.10.tgz", + "integrity": "sha512-CHgUI5kTc/QLMP8hODUHhge0D4vx+9UiAwIGiT0sTy/B2XpdX1U5rJt6JSISgr6ikRT7vxV9EVAFeYZqUnl1gQ==", + "optional": true + }, "@types/yargs": { "version": "17.0.32", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", @@ -11965,10 +12815,10 @@ "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", "dev": true }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", "optional": true }, "abort-controller": { @@ -11997,7 +12847,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "devOptional": true, + "dev": true, "requires": { "debug": "4" } @@ -12093,28 +12943,12 @@ "default-require-extensions": "^3.0.0" } }, - "aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", - "optional": true - }, "archy": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", "dev": true }, - "are-we-there-yet": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", - "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - } - }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -12148,12 +12982,24 @@ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, + "async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "optional": true + }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, + "at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "optional": true + }, "attr-accept": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/attr-accept/-/attr-accept-2.2.2.tgz", @@ -12224,7 +13070,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, + "devOptional": true, "requires": { "fill-range": "^7.1.1" } @@ -12367,6 +13213,38 @@ "write-file-atomic": "^3.0.0" } }, + "call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "optional": true, + "requires": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + } + }, + "call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "optional": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + } + }, + "call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "optional": true, + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" + } + }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -12495,7 +13373,13 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "devOptional": true + "dev": true + }, + "ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "optional": true }, "clean-stack": { "version": "2.2.0", @@ -12535,12 +13419,6 @@ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, - "color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", - "optional": true - }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -12559,14 +13437,8 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "devOptional": true - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", - "optional": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "devOptional": true }, "create-require": { "version": "1.1.1", @@ -12578,7 +13450,7 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, + "devOptional": true, "requires": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -12736,6 +13608,17 @@ } } }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "optional": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, "define-lazy-prop": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", @@ -12748,18 +13631,6 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", - "optional": true - }, - "detect-libc": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", - "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", - "optional": true - }, "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -12802,6 +13673,17 @@ } } }, + "dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "optional": true, + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + } + }, "duplexify": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz", @@ -12892,6 +13774,27 @@ "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", "dev": true }, + "es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "optional": true + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "optional": true + }, + "es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "optional": true, + "requires": { + "es-errors": "^1.3.0" + } + }, "es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", @@ -13486,7 +14389,7 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, + "devOptional": true, "requires": { "to-regex-range": "^5.0.1" } @@ -13560,6 +14463,15 @@ "path-exists": "^4.0.0" } }, + "find-yarn-workspace-root": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", + "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", + "optional": true, + "requires": { + "micromatch": "^4.0.2" + } + }, "flat": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", @@ -13641,7 +14553,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "devOptional": true, + "dev": true, "requires": { "minipass": "^3.0.0" }, @@ -13650,7 +14562,7 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "devOptional": true, + "dev": true, "requires": { "yallist": "^4.0.0" } @@ -13670,22 +14582,11 @@ "dev": true, "optional": true }, - "gauge": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", - "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", - "optional": true, - "requires": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.2", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.1", - "object-assign": "^4.1.1", - "signal-exit": "^3.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.2" - } + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "optional": true }, "gaxios": { "version": "5.1.3", @@ -13726,12 +14627,40 @@ "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true }, + "get-intrinsic": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", + "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", + "optional": true, + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "function-bind": "^1.1.2", + "get-proto": "^1.0.0", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + } + }, "get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true }, + "get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "optional": true, + "requires": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + } + }, "get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", @@ -13842,11 +14771,17 @@ "node-forge": "^1.3.1" } }, + "gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "optional": true + }, "graceful-fs": { "version": "4.2.9", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", - "dev": true + "devOptional": true }, "graphemer": { "version": "1.4.0", @@ -13871,10 +14806,19 @@ "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "optional": true, + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "optional": true }, "hasha": { @@ -13887,6 +14831,15 @@ "type-fest": "^0.8.0" } }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "optional": true, + "requires": { + "function-bind": "^1.1.2" + } + }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -13943,7 +14896,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", - "devOptional": true, + "dev": true, "requires": { "agent-base": "6", "debug": "4" @@ -14101,7 +15054,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true + "devOptional": true }, "is-object": { "version": "1.0.1", @@ -14155,7 +15108,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dev": true, + "devOptional": true, "requires": { "is-docker": "^2.0.0" }, @@ -14164,15 +15117,21 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "dev": true + "devOptional": true } } }, + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "optional": true + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "devOptional": true }, "istanbul-lib-coverage": { "version": "3.0.0", @@ -14371,6 +15330,19 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, + "json-stable-stringify": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.2.1.tgz", + "integrity": "sha512-Lp6HbbBgosLmJbjx0pBLbgvx68FaFU1sdkmBuckmhhJ88kL13OA51CDtR2yJB50eCNMH9wRqtQNNiAqQH4YXnA==", + "optional": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "isarray": "^2.0.5", + "jsonify": "^0.0.1", + "object-keys": "^1.1.1" + } + }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", @@ -14387,12 +15359,18 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, + "devOptional": true, "requires": { "graceful-fs": "^4.1.6", "universalify": "^2.0.0" } }, + "jsonify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", + "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", + "optional": true + }, "jss": { "version": "10.9.0", "resolved": "https://registry.npmjs.org/jss/-/jss-10.9.0.tgz", @@ -14523,6 +15501,15 @@ "graceful-fs": "^4.1.9" } }, + "klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "optional": true, + "requires": { + "graceful-fs": "^4.1.11" + } + }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -14679,7 +15666,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "devOptional": true, + "dev": true, "requires": { "semver": "^6.0.0" }, @@ -14688,7 +15675,7 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "devOptional": true + "dev": true } } }, @@ -14765,6 +15752,12 @@ "integrity": "sha512-6qE4B9deFBIa9YSpOc9O0Sgc43zTeVYbgDT5veRKSlB2+ZuHNoVVxA1L/ckMUayV9Ay9y7Z/SZCLcGteW9i7bg==", "dev": true }, + "math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "optional": true + }, "mdurl": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", @@ -14793,7 +15786,7 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, + "devOptional": true, "requires": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -14833,13 +15826,13 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true + "devOptional": true }, "minipass": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "devOptional": true + "dev": true }, "minipass-collect": { "version": "2.0.1", @@ -14942,7 +15935,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "devOptional": true, + "dev": true, "requires": { "minipass": "^3.0.0", "yallist": "^4.0.0" @@ -14952,7 +15945,7 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "devOptional": true, + "dev": true, "requires": { "yallist": "^4.0.0" } @@ -14963,7 +15956,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "devOptional": true + "dev": true }, "mocha": { "version": "10.2.0", @@ -15094,12 +16087,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, - "nan": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", - "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==", - "optional": true - }, "nanoid": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", @@ -15157,15 +16144,15 @@ } }, "node-addon-api": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", - "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==" + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.3.0.tgz", + "integrity": "sha512-8VOpLHFrOQlAH+qA0ZzuGRlALRA6/LVh8QJldbrC4DY0hXoMP0l4Acq8TzFC018HztWiRqyCEj2aTWY2UvnJUg==" }, "node-fetch": { "version": "2.6.12", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", - "devOptional": true, + "dev": true, "requires": { "whatwg-url": "^5.0.0" }, @@ -15174,19 +16161,19 @@ "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", - "devOptional": true + "dev": true }, "webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", - "devOptional": true + "dev": true }, "whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "devOptional": true, + "dev": true, "requires": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -15304,9 +16291,9 @@ } }, "node-gyp-build": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", - "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==" + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", + "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==" }, "node-preload": { "version": "0.2.1", @@ -15317,15 +16304,6 @@ "process-on-spawn": "^1.0.0" } }, - "nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "optional": true, - "requires": { - "abbrev": "1" - } - }, "npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -15335,18 +16313,6 @@ "path-key": "^3.0.0" } }, - "npmlog": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", - "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", - "optional": true, - "requires": { - "are-we-there-yet": "^2.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^3.0.0", - "set-blocking": "^2.0.0" - } - }, "nyc": { "version": "15.1.0", "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", @@ -15512,7 +16478,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "devOptional": true + "dev": true }, "object-hash": { "version": "3.0.0", @@ -15520,6 +16486,12 @@ "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", "dev": true }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "optional": true + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -15564,6 +16536,12 @@ "word-wrap": "~1.2.3" } }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "optional": true + }, "p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -15618,6 +16596,108 @@ "callsites": "^3.0.0" } }, + "patch-package": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz", + "integrity": "sha512-da8BVIhzjtgScwDJ2TtKsfT5JFWz1hYoBl9rUQ1f38MC2HwnEIkK8VN3dKMKcP7P7bvvgzNDbfNHtx3MsQb5vA==", + "optional": true, + "requires": { + "@yarnpkg/lockfile": "^1.1.0", + "chalk": "^4.1.2", + "ci-info": "^3.7.0", + "cross-spawn": "^7.0.3", + "find-yarn-workspace-root": "^2.0.0", + "fs-extra": "^9.0.0", + "json-stable-stringify": "^1.0.2", + "klaw-sync": "^6.0.0", + "minimist": "^1.2.6", + "open": "^7.4.2", + "rimraf": "^2.6.3", + "semver": "^7.5.3", + "slash": "^2.0.0", + "tmp": "^0.0.33", + "yaml": "^2.2.2" + }, + "dependencies": { + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "optional": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "optional": true, + "requires": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "optional": true + }, + "is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "optional": true + }, + "open": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", + "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "optional": true, + "requires": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "optional": true, + "requires": { + "glob": "^7.1.3" + } + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "optional": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "optional": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "optional": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + } + } + }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -15634,7 +16714,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true + "devOptional": true }, "path-parse": { "version": "1.0.7", @@ -15705,7 +16785,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true + "devOptional": true }, "popper.js": { "version": "1.16.1-lts", @@ -16055,7 +17135,7 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "devOptional": true, + "dev": true, "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -16236,17 +17316,53 @@ "randombytes": "^2.1.0" } }, + "serialport": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/serialport/-/serialport-12.0.0.tgz", + "integrity": "sha512-AmH3D9hHPFmnF/oq/rvigfiAouAKyK/TjnrkwZRYSFZxNggJxwvbAbfYrLeuvq7ktUdhuHdVdSjj852Z55R+uA==", + "optional": true, + "requires": { + "@serialport/binding-mock": "10.2.2", + "@serialport/bindings-cpp": "12.0.1", + "@serialport/parser-byte-length": "12.0.0", + "@serialport/parser-cctalk": "12.0.0", + "@serialport/parser-delimiter": "12.0.0", + "@serialport/parser-inter-byte-timeout": "12.0.0", + "@serialport/parser-packet-length": "12.0.0", + "@serialport/parser-readline": "12.0.0", + "@serialport/parser-ready": "12.0.0", + "@serialport/parser-regex": "12.0.0", + "@serialport/parser-slip-encoder": "12.0.0", + "@serialport/parser-spacepacket": "12.0.0", + "@serialport/stream": "12.0.0", + "debug": "4.3.4" + } + }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "devOptional": true + "dev": true + }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "optional": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, + "devOptional": true, "requires": { "shebang-regex": "^3.0.0" } @@ -16255,13 +17371,13 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true + "devOptional": true }, "signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "devOptional": true + "dev": true }, "sinon": { "version": "17.0.1", @@ -16474,7 +17590,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "devOptional": true, + "dev": true, "requires": { "safe-buffer": "~5.2.0" }, @@ -16483,7 +17599,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "devOptional": true + "dev": true } } }, @@ -16574,7 +17690,7 @@ "version": "6.2.1", "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", - "devOptional": true, + "dev": true, "requires": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -16680,7 +17796,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, + "devOptional": true, "requires": { "is-number": "^7.0.0" } @@ -16815,7 +17931,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true + "devOptional": true }, "untildify": { "version": "4.0.0", @@ -16833,20 +17949,21 @@ } }, "usb": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/usb/-/usb-1.9.2.tgz", - "integrity": "sha512-dryNz030LWBPAf6gj8vyq0Iev3vPbCLHCT8dBw3gQRXRzVNsIdeuU+VjPp3ksmSPkeMAl1k+kQ14Ij0QHyeiAg==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/usb/-/usb-2.14.0.tgz", + "integrity": "sha512-I3lzVOH21BsO6qPYvx1C7Ji08lbuM0qmsEtNGAphqlhNME5cz/vExY+jIXZl+HQIRybI/sTxdyLab5tALsL69w==", "optional": true, "requires": { - "node-addon-api": "^4.2.0", - "node-gyp-build": "^4.3.0" + "@types/w3c-web-usb": "^1.0.6", + "node-addon-api": "^8.0.0", + "node-gyp-build": "^4.5.0" } }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "devOptional": true + "dev": true }, "uuid": { "version": "3.3.3", @@ -16864,7 +17981,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, + "devOptional": true, "requires": { "isexe": "^2.0.0" } @@ -16875,15 +17992,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, "word-wrap": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", @@ -16952,6 +18060,12 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "devOptional": true }, + "yaml": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", + "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", + "optional": true + }, "yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", diff --git a/package.json b/package.json index 7075ec9b..1421c95a 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,8 @@ "node": ">= 18" }, "dependencies": { - "@abandonware/noble": "^1.9.2-23", "@iobroker/adapter-core": "^3.0.4", + "@stoprocent/noble": "^1.18.2", "alcalzone-shared": "^4.0.8", "iobroker-react-components": "^1.0.0", "yargs": "^17.7.2" diff --git a/src/lib/scanProcessInterface.ts b/src/lib/scanProcessInterface.ts index cb1e51c1..f14a789a 100644 --- a/src/lib/scanProcessInterface.ts +++ b/src/lib/scanProcessInterface.ts @@ -1,4 +1,4 @@ -import type { Peripheral } from "@abandonware/noble"; +import type { Peripheral } from "@stoprocent/noble"; import { isArray, isObject } from "alcalzone-shared/typeguards"; export enum ScanExitCodes { diff --git a/src/plugins/lib/ruuvi-tag_protocol.test.ts b/src/plugins/lib/ruuvi-tag_protocol.test.ts index 1c5f0268..315b3e15 100644 --- a/src/plugins/lib/ruuvi-tag_protocol.test.ts +++ b/src/plugins/lib/ruuvi-tag_protocol.test.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-namespace */ -import type { Peripheral } from "@abandonware/noble"; +import type { Peripheral } from "@stoprocent/noble"; import * as proxyquireModule from "proxyquire"; import { createGlobalMock } from "../../../test/mocks/global"; diff --git a/src/scanProcess.ts b/src/scanProcess.ts index 4975836b..50303b16 100644 --- a/src/scanProcess.ts +++ b/src/scanProcess.ts @@ -1,5 +1,5 @@ /** noble-Treiber-Instanz */ -import type { Peripheral } from "@abandonware/noble"; +import type { Peripheral } from "@stoprocent/noble"; import { createServer, type AddressInfo, type Server, type Socket } from "net"; import { pick } from "./lib/misc"; import { @@ -43,7 +43,7 @@ const argv = yargs }) .parseSync(); -let noble: typeof import("@abandonware/noble"); +let noble: typeof import("@stoprocent/noble"); let server: Server | undefined; const clients: Set = new Set(); @@ -213,10 +213,10 @@ async function loadNoble() { process.env.NOBLE_HCI_DEVICE_ID = argv.hciDevice.toString(); try { // eslint-disable-next-line @typescript-eslint/no-var-requires - noble = require("@abandonware/noble"); + noble = require("@stoprocent/noble"); if (typeof noble.on !== "function") { // The following commit broke the default exported instance of noble: - // https://github.com/abandonware/noble/commit/b67eea246f719947fc45b1b52b856e61637a8a8e + // https://github.com/stoprocent/noble/commit/b67eea246f719947fc45b1b52b856e61637a8a8e noble = (noble as any)({ extended: false }); } } catch (error: any) { diff --git a/test/noble.js b/test/noble.js index 12e6b6dc..4da05e81 100644 --- a/test/noble.js +++ b/test/noble.js @@ -10,7 +10,7 @@ function tryCatchUnsupportedHardware(err) { process.env.NOBLE_HCI_DEVICE_ID = "0"; try { - const noble = require("@abandonware/noble")({ extended: false }); + const noble = require("@stoprocent/noble")({ extended: false }); } catch (e) { if (!tryCatchUnsupportedHardware(e)) process.exit(1); }